pinomad 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-wb10efyq.js → chunk-445cevpm.js} +1 -1
  3. package/dist/{chunk-jt34g8st.js → chunk-4fferbxw.js} +247 -27
  4. package/dist/{chunk-67gq282t.js → chunk-53xv3fny.js} +725 -75
  5. package/dist/{chunk-44pnts98.js → chunk-563fnad9.js} +1 -1
  6. package/dist/{chunk-b457q0tm.js → chunk-6th9xv39.js} +11 -8
  7. package/dist/{chunk-ncbqa8jk.js → chunk-7mn38n4f.js} +1 -1
  8. package/dist/{chunk-as6pyf00.js → chunk-90g1cg9n.js} +1 -1
  9. package/dist/{chunk-9h5vawnm.js → chunk-aapsc9g0.js} +270 -66
  10. package/dist/{chunk-n1m1tjrk.js → chunk-d4tq62yr.js} +57 -16
  11. package/dist/{chunk-gtdpjqa3.js → chunk-d9mq5d46.js} +205 -49
  12. package/dist/{chunk-y127fe1a.js → chunk-g3ahp7b9.js} +11 -0
  13. package/dist/{chunk-xqycs43g.js → chunk-kmzzjv53.js} +83 -8
  14. package/dist/{chunk-4dcs8sbj.js → chunk-m51mq8vh.js} +43 -21
  15. package/dist/{chunk-tj57aqav.js → chunk-maqv34cs.js} +2 -2
  16. package/dist/chunk-nq57fdnq.js +106 -0
  17. package/dist/{chunk-h5q2y57m.js → chunk-ra86wjp5.js} +10 -4
  18. package/dist/{chunk-sd5fkxjj.js → chunk-s0h7c7da.js} +1 -1
  19. package/dist/chunk-sd640dt7.js +22 -0
  20. package/dist/{chunk-6d16c2fv.js → chunk-t6fw0wa9.js} +13 -6
  21. package/dist/{chunk-vvj9b1gc.js → chunk-wd7aracm.js} +188 -54
  22. package/dist/pinomad.js +15 -14
  23. package/package.json +13 -11
  24. package/web/assets/astro-DOly5024.js +1 -0
  25. package/web/assets/c-BIGW1oBm.js +1 -0
  26. package/web/assets/core-BHm2gdHL.js +4 -0
  27. package/web/assets/cpp-DddhVWhK.js +1 -0
  28. package/web/assets/csharp-B_TYUkTI.js +1 -0
  29. package/web/assets/css-Z72CF80r.js +1 -0
  30. package/web/assets/dart-CtKP3W-j.js +1 -0
  31. package/web/assets/diff-D97Zzqfu.js +1 -0
  32. package/web/assets/dockerfile-BcOcwvcX.js +1 -0
  33. package/web/assets/elixir-DkJLSxtU.js +1 -0
  34. package/web/assets/engine-javascript-BHPwbUfN.js +141 -0
  35. package/web/assets/engine-oniguruma-CQjQPVHy.js +1 -0
  36. package/web/assets/fish-BvzEVeQv.js +1 -0
  37. package/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  38. package/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  39. package/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  40. package/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  41. package/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  42. package/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  43. package/web/assets/go-C27-OAKa.js +1 -0
  44. package/web/assets/graphql-ChdNCCLP.js +1 -0
  45. package/web/assets/haskell-Df6bDoY_.js +1 -0
  46. package/web/assets/hcl-BWvSN4gD.js +1 -0
  47. package/web/assets/highlighted-diff-DrHvSLK9.js +175 -0
  48. package/web/assets/highlights-1aLwssz-.js +4 -0
  49. package/web/assets/highlights-themes-C1p4pFYS.js +1 -0
  50. package/web/assets/html-BlS82ilI.js +1 -0
  51. package/web/assets/index-A_AUJoO6.css +1 -0
  52. package/web/assets/index-BafYMKiN.js +396 -0
  53. package/web/assets/ini-BEwlwnbL.js +1 -0
  54. package/web/assets/java-CylS5w8V.js +1 -0
  55. package/web/assets/javascript-wDzz0qaB.js +1 -0
  56. package/web/assets/json-Cp-IABpG.js +1 -0
  57. package/web/assets/jsonc-Des-eS-w.js +1 -0
  58. package/web/assets/jsx-g9-lgVsj.js +1 -0
  59. package/web/assets/kotlin-BdnUsdx6.js +1 -0
  60. package/web/assets/less-B1dDrJ26.js +1 -0
  61. package/web/assets/lua-BaeVxFsk.js +1 -0
  62. package/web/assets/make-CHLpvVh8.js +1 -0
  63. package/web/assets/markdown-Cvjx9yec.js +1 -0
  64. package/web/assets/nix-CwoSXNpI.js +1 -0
  65. package/web/assets/objective-c-DXmwc3jG.js +1 -0
  66. package/web/assets/php-DoruYMF0.js +1 -0
  67. package/web/assets/pierre-dark-CyvmCCZW.js +1 -0
  68. package/web/assets/pierre-dark-VKo95ZgA.js +1 -0
  69. package/web/assets/pierre-light-480U9XYS.js +1 -0
  70. package/web/assets/pierre-light-BVSW-Xev.js +1 -0
  71. package/web/assets/postcss-DnzrXTVv.js +1 -0
  72. package/web/assets/powershell-Dd0kTxKP.js +1 -0
  73. package/web/assets/prisma-Vru482bI.js +1 -0
  74. package/web/assets/proto-C7zT0LnQ.js +1 -0
  75. package/web/assets/python-B6aJPvgy.js +1 -0
  76. package/web/assets/ruby-B43yHlf9.js +1 -0
  77. package/web/assets/rust-DPvrY3IQ.js +1 -0
  78. package/web/assets/scala-CqE71os6.js +1 -0
  79. package/web/assets/scss-Cw6XMfVs.js +1 -0
  80. package/web/assets/shellscript-Yzrsuije.js +1 -0
  81. package/web/assets/shiki-BwyCm3kZ.js +2 -0
  82. package/web/assets/shiki-langs-CMlALLSg.js +2 -0
  83. package/web/assets/shiki-wasm-CgFRq91U.js +1 -0
  84. package/web/assets/sql-DkvoVjww.js +1 -0
  85. package/web/assets/stream-tokenizer-BlgIhw0y.js +4 -0
  86. package/web/assets/svelte-DoIXUgJc.js +1 -0
  87. package/web/assets/swift-C2oV4EkX.js +1 -0
  88. package/web/assets/terraform-BETggiCN.js +1 -0
  89. package/web/assets/theming-themes-DDvoqEqT.js +1 -0
  90. package/web/assets/toml-vGWfd6FD.js +1 -0
  91. package/web/assets/tsx-COt5Ahok.js +1 -0
  92. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  93. package/web/assets/vue-CwSeJimo.js +1 -0
  94. package/web/assets/xml-sdJ4AIDG.js +1 -0
  95. package/web/assets/xterm-view-6GBZ9nXN.css +32 -0
  96. package/web/assets/xterm-view-BnKOnF3C.js +38 -0
  97. package/web/assets/yaml-Buea-lGh.js +1 -0
  98. package/web/assets/zig-VOosw3JB.js +1 -0
  99. package/web/index.html +2 -2
  100. package/dist/chunk-etf7ef97.js +0 -55
  101. package/dist/chunk-greb3dp6.js +0 -22
  102. package/web/assets/index-BhHrKpoo.js +0 -395
  103. package/web/assets/index-DoyHMPwf.css +0 -1
@@ -1,395 +0,0 @@
1
- var bR=Object.defineProperty;var hb=e=>{throw TypeError(e)};var wR=(e,t,n)=>t in e?bR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>wR(e,typeof t!="symbol"?t+"":t,n),xm=(e,t,n)=>t.has(e)||hb("Cannot "+n);var S=(e,t,n)=>(xm(e,t,"read from private field"),n?n.call(e):t.get(e)),ae=(e,t,n)=>t.has(e)?hb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,s)=>(xm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),C=(e,t,n)=>(xm(e,t,"access private method"),n);var Cn=(e,t,n,s)=>({set _(r){G(e,t,r,n)},get _(){return S(e,t,s)}});function jR(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function SR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jw={exports:{}},tg={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var CR=Symbol.for("react.transitional.element"),ER=Symbol.for("react.fragment");function ej(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:CR,type:e,key:s,ref:t!==void 0?t:null,props:n}}tg.Fragment=ER;tg.jsx=ej;tg.jsxs=ej;Jw.exports=tg;var a=Jw.exports,tj={exports:{}},Re={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var s5=Symbol.for("react.transitional.element"),$R=Symbol.for("react.portal"),AR=Symbol.for("react.fragment"),MR=Symbol.for("react.strict_mode"),TR=Symbol.for("react.profiler"),zR=Symbol.for("react.consumer"),NR=Symbol.for("react.context"),_R=Symbol.for("react.forward_ref"),RR=Symbol.for("react.suspense"),IR=Symbol.for("react.memo"),nj=Symbol.for("react.lazy"),LR=Symbol.for("react.activity"),OR=Symbol.for("react.view_transition"),pb=Symbol.iterator;function DR(e){return e===null||typeof e!="object"?null:(e=pb&&e[pb]||e["@@iterator"],typeof e=="function"?e:null)}var sj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rj=Object.assign,ij={};function kd(e,t,n){this.props=e,this.context=t,this.refs=ij,this.updater=n||sj}kd.prototype.isReactComponent={};kd.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};kd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function oj(){}oj.prototype=kd.prototype;function r5(e,t,n){this.props=e,this.context=t,this.refs=ij,this.updater=n||sj}var i5=r5.prototype=new oj;i5.constructor=r5;rj(i5,kd.prototype);i5.isPureReactComponent=!0;var xb=Array.isArray;function ly(){}var Ct={H:null,A:null,T:null,S:null},aj=Object.prototype.hasOwnProperty;function o5(e,t,n){var s=n.ref;return{$$typeof:s5,type:e,key:t,ref:s!==void 0?s:null,props:n}}function BR(e,t){return o5(e.type,t,e.props)}function a5(e){return typeof e=="object"&&e!==null&&e.$$typeof===s5}function HR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var gb=/\/+/g;function gm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?HR(""+e.key):t.toString(36)}function qR(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ly,ly):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Fc(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case s5:case $R:o=!0;break;case nj:return o=e._init,Fc(o(e._payload),t,n,s,r)}}if(o)return r=r(e),o=s===""?"."+gm(e,0):s,xb(r)?(n="",o!=null&&(n=o.replace(gb,"$&/")+"/"),Fc(r,t,n,"",function(u){return u})):r!=null&&(a5(r)&&(r=BR(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(gb,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=s===""?".":s+":";if(xb(e))for(var c=0;c<e.length;c++)s=e[c],i=l+gm(s,c),o+=Fc(s,t,n,i,r);else if(c=DR(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+gm(s,c++),o+=Fc(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return Fc(qR(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function Mh(e,t,n){if(e==null)return e;var s=[],r=0;return Fc(e,s,"","",function(i){return t.call(n,i,r++)}),s}function PR(e){if(e._status===-1){var t=e._result,n=t();n.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,n.status===void 0&&(n.status="fulfilled",n.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,n.status===void 0&&(n.status="rejected",n.reason=s))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var mb=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function lj(e){var t=Ct.T,n={};n.types=t!==null?t.types:null,Ct.T=n;try{var s=e(),r=Ct.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(ly,mb)}catch(i){mb(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Ct.T=t}}function cj(e){var t=Ct.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else lj(cj.bind(null,e))}var UR={map:Mh,forEach:function(e,t,n){Mh(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Mh(e,function(){t++}),t},toArray:function(e){return Mh(e,function(t){return t})||[]},only:function(e){if(!a5(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Activity=LR;Re.Children=UR;Re.Component=kd;Re.Fragment=AR;Re.Profiler=TR;Re.PureComponent=r5;Re.StrictMode=MR;Re.Suspense=RR;Re.ViewTransition=OR;Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ct;Re.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ct.H.useMemoCache(e)}};Re.addTransitionType=cj;Re.cache=function(e){return function(){return e.apply(null,arguments)}};Re.cacheSignal=function(){return null};Re.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=rj({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!aj.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];s.children=o}return o5(e.type,r,s)};Re.createContext=function(e){return e={$$typeof:NR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:zR,_context:e},e};Re.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)aj.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return o5(e,i,r)};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:_R,render:e}};Re.isValidElement=a5;Re.lazy=function(e){return{$$typeof:nj,_payload:{_status:-1,_result:e},_init:PR}};Re.memo=function(e,t){return{$$typeof:IR,type:e,compare:t===void 0?null:t}};Re.startTransition=lj;Re.unstable_useCacheRefresh=function(){return Ct.H.useCacheRefresh()};Re.use=function(e){return Ct.H.use(e)};Re.useActionState=function(e,t,n){return Ct.H.useActionState(e,t,n)};Re.useCallback=function(e,t){return Ct.H.useCallback(e,t)};Re.useContext=function(e){return Ct.H.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e,t){return Ct.H.useDeferredValue(e,t)};Re.useEffect=function(e,t){return Ct.H.useEffect(e,t)};Re.useEffectEvent=function(e){return Ct.H.useEffectEvent(e)};Re.useId=function(){return Ct.H.useId()};Re.useImperativeHandle=function(e,t,n){return Ct.H.useImperativeHandle(e,t,n)};Re.useInsertionEffect=function(e,t){return Ct.H.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return Ct.H.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return Ct.H.useMemo(e,t)};Re.useOptimistic=function(e,t){return Ct.H.useOptimistic(e,t)};Re.useReducer=function(e,t,n){return Ct.H.useReducer(e,t,n)};Re.useRef=function(e){return Ct.H.useRef(e)};Re.useState=function(e){return Ct.H.useState(e)};Re.useSyncExternalStore=function(e,t,n){return Ct.H.useSyncExternalStore(e,t,n)};Re.useTransition=function(){return Ct.H.useTransition()};Re.version="19.3.0";tj.exports=Re;var p=tj.exports;const ng=SR(p),uj=jR({__proto__:null,default:ng},[p]);var Wd={},yb;function FR(){if(yb)return Wd;yb=1,Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.styleq=void 0;var e=new WeakMap,t="$$css";function n(r){var i,o,l;return r!=null&&(i=r.disableCache===!0,o=r.disableMix===!0,l=r.transform),function(){for(var u=[],d="",f=null,h="",x=i?null:e,g=new Array(arguments.length),y=0;y<arguments.length;y++)g[y]=arguments[y];for(;g.length>0;){var v=g.pop();if(!(v==null||v===!1)){if(Array.isArray(v)){for(var m=0;m<v.length;m++)g.push(v[m]);continue}var k=l!=null?l(v):v;if(k.$$css!=null){var b="";if(x!=null&&x.has(k)){var j=x.get(k);j!=null&&(b=j[0],h=j[2],u.push.apply(u,j[1]),x=j[3])}else{var A=[];for(var M in k){var E=k[M];if(M===t){var z=k[M];z!==!0&&(h=h?z+"; "+h:z);continue}typeof E=="string"||E===null?u.includes(M)||(u.push(M),x!=null&&A.push(M),typeof E=="string"&&(b+=b?" "+E:E)):console.error("styleq: ".concat(M," typeof ").concat(String(E),' is not "string" or "null".'))}if(x!=null){var T=new WeakMap;x.set(k,[b,A,h,T]),x=T}}b&&(d=d?b+" "+d:b)}else if(o)f==null&&(f={}),f=Object.assign({},k,f);else{var $=null;for(var _ in k){var R=k[_];R!==void 0&&(u.includes(_)||(R!=null&&(f==null&&(f={}),$==null&&($={}),$[_]=R),u.push(_),x=null))}$!=null&&(f=Object.assign($,f))}}}var N=[d,f,h];return N}}var s=Wd.styleq=n();return s.factory=n,Wd}var VR=FR();function W(...e){const[t,n,s]=VR.styleq(e),r={};return t!=null&&t!==""&&(r.className=t),n!=null&&Object.keys(n).length>0&&(r.style=n),s!=null&&s!==""&&(r["data-style-src"]=s),r}const GR={"--color-accent":"light-dark(#0064E0, #2694FE)","--color-accent-muted":"light-dark(#0082FB33, #0082FB3F)","--color-on-accent":"light-dark(#FFFFFF, #FFFFFF)","--color-neutral":"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))","--color-background-surface":"light-dark(#FFFFFF, #1F1F22)","--color-background-body":"light-dark(#F1F4F7, #111112)","--color-overlay":"light-dark(#01122866, #11111299)","--color-overlay-hover":"light-dark(#0536590C, #FFFFFF0C)","--color-overlay-pressed":"light-dark(#05365919, #FFFFFF19)","--color-background-muted":"light-dark(#0536590C, #1111127F)","--color-text-primary":"light-dark(#0A1317, #DFE2E5)","--color-text-secondary":"light-dark(#4E606F, #AAAFB5)","--color-text-disabled":"light-dark(#A4B0BC, #6F747C)","--color-text-accent":"light-dark(#0064E0, #3E9EFB)","--color-on-dark":"light-dark(#FFFFFF, #FFFFFF)","--color-on-light":"light-dark(#000000, #000000)","--color-icon-accent":"light-dark(#0064E0, #2694FE)","--color-icon-primary":"light-dark(#0A1317, #DFE2E5)","--color-icon-secondary":"light-dark(#4E606F, #AAAFB5)","--color-icon-disabled":"light-dark(#A4B0BC, #6F747C)","--color-background-card":"light-dark(#FFFFFF, #1F1F22)","--color-background-popover":"light-dark(#FFFFFF, #28292C)","--color-background-inverted":"light-dark(#0A1317, #FFFFFF)","--color-background-error-inverted":"light-dark(#AA071E, #E3193B)","--color-success":"light-dark(#0D8626, #0D8626)","--color-success-muted":"light-dark(#0B991F33, #0B991F3F)","--color-on-success":"light-dark(#FFFFFF, #FFFFFF)","--color-error":"light-dark(#E3193B, #F5394F)","--color-error-muted":"light-dark(#E3193B33, #F5394F3F)","--color-on-error":"light-dark(#FFFFFF, #FFFFFF)","--color-warning":"light-dark(#E9AF08, #F2C00B)","--color-warning-muted":"light-dark(#E2A40033, #E2A4003F)","--color-on-warning":"light-dark(#0A1317, #0A1317)","--color-border":"light-dark(#05365919, #F2F4F619)","--color-border-emphasized":"light-dark(#CCD3DB, #494D53)","--color-skeleton":"light-dark(#CCD3DB, #5A5E66)","--color-track":"light-dark(#CCD3DB, #5A5E66)","--color-shadow":"light-dark(rgba(5, 54, 89, 0.1), rgba(0, 0, 0, 0.3))","--color-tint-hover":"light-dark(black, white)","--color-background-blue":"light-dark(#0171E333, #0171E333)","--color-border-blue":"light-dark(#0064E0, #2694FE)","--color-icon-blue":"light-dark(#0064E0, #2694FE)","--color-text-blue":"light-dark(#042F97, #AFD7FF)","--color-background-cyan":"light-dark(#03A7D733, #03A7D733)","--color-border-cyan":"light-dark(#089DD0, #0171A4)","--color-icon-cyan":"light-dark(#00ACC1, #26C6DA)","--color-text-cyan":"light-dark(#014975, #A1EEF9)","--color-background-gray":"light-dark(#0A131733, #666A724C)","--color-border-gray":"light-dark(#647685, #748695)","--color-icon-gray":"light-dark(#4E606F, #AAAFB5)","--color-text-gray":"light-dark(#0A1317, #E7EAED)","--color-background-green":"light-dark(#24BB5E33, #24BB5E33)","--color-border-green":"light-dark(#0D8626, #0B991F)","--color-icon-green":"light-dark(#0D8626, #26A756)","--color-text-green":"light-dark(#09441F, #A5F690)","--color-background-orange":"light-dark(#F2790233, #F2790233)","--color-border-orange":"light-dark(#EB6E00, #B34A01)","--color-icon-orange":"light-dark(#E9690B, #FB8C00)","--color-text-orange":"light-dark(#6B2203, #FDB876)","--color-background-pink":"light-dark(#E638B333, #E638B333)","--color-border-pink":"light-dark(#F351C0, #C02294)","--color-icon-pink":"light-dark(#C2185B, #EC407A)","--color-text-pink":"light-dark(#650053, #FEADE3)","--color-background-purple":"light-dark(#7952FF33, #7952FF33)","--color-border-purple":"light-dark(#9081FF, #7340FE)","--color-icon-purple":"light-dark(#5B08D8, #7952FF)","--color-text-purple":"light-dark(#3E0697, #B3B0FE)","--color-background-red":"light-dark(#E3193B33, #E3193B33)","--color-border-red":"light-dark(#E3193B, #F5394F)","--color-icon-red":"light-dark(#D31130, #E3193B)","--color-text-red":"light-dark(#7B0210, #FFB2B8)","--color-background-teal":"light-dark(#0DB7AF33, #0DB7AF33)","--color-border-teal":"light-dark(#08A3A3, #08767D)","--color-icon-teal":"light-dark(#009688, #26A69A)","--color-text-teal":"light-dark(#083943, #40DCCD)","--color-background-yellow":"light-dark(#E2A40033, #E2A40033)","--color-border-yellow":"light-dark(#C58600, #B47700)","--color-icon-yellow":"light-dark(#FBC02D, #FFEE58)","--color-text-yellow":"light-dark(#753F07, #FBCE03)"},WR={"--spacing-0":"0px","--spacing-0-5":"2px","--spacing-1":"4px","--spacing-1-5":"6px","--spacing-2":"8px","--spacing-3":"12px","--spacing-4":"16px","--spacing-5":"20px","--spacing-6":"24px","--spacing-7":"28px","--spacing-8":"32px","--spacing-9":"36px","--spacing-10":"40px","--spacing-11":"44px","--spacing-12":"48px"},jr={"--spacing-1":"var(--spacing-1)","--spacing-2":"var(--spacing-2)"},KR={"--size-element-sm":"28px","--size-element-md":"32px","--size-element-lg":"36px"},XR={"--radius-none":"0px","--radius-inner":"4px","--radius-element":"8px","--radius-container":"12px","--radius-page":"28px","--radius-chat":"28px","--radius-full":"9999px"},ZR={"--shadow-low":"0px 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))","--shadow-med":"0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))","--shadow-high":"0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))","--shadow-inset-hover":"inset 0px 0px 0px 2px light-dark(rgba(5, 54, 89, 0.15), rgba(223, 226, 229, 0.2))","--shadow-inset-selected":"inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)","--shadow-inset-success":"inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)","--shadow-inset-warning":"inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)","--shadow-inset-error":"inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)"},YR={"--duration-fast-min":"130ms","--duration-fast":"175ms","--duration-fast-max":"230ms","--duration-medium-min":"310ms","--duration-medium":"410ms","--duration-medium-max":"550ms","--duration-slow-min":"730ms","--duration-slow":"975ms","--duration-slow-max":"1300ms"},QR={"--ease-standard":"cubic-bezier(0.24, 1, 0.4, 1)"},JR={"--font-family-body":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-code":'"SF Mono", Monaco, Consolas, monospace',"--font-family-heading":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'},eI={"--font-size-4xs":"0.375rem","--font-size-3xs":"0.4375rem","--font-size-2xs":"0.5rem","--font-size-xs":"0.625rem","--font-size-sm":"0.75rem","--font-size-base":"0.875rem","--font-size-lg":"1.0625rem","--font-size-xl":"1.25rem","--font-size-2xl":"1.5rem","--font-size-3xl":"1.8125rem","--font-size-4xl":"2.1875rem","--font-size-5xl":"2.625rem"},tI={"--font-weight-normal":"400","--font-weight-medium":"500","--font-weight-semibold":"600","--font-weight-bold":"700"},nI={"--text-heading-1-size":"var(--font-size-2xl)","--text-heading-1-weight":"var(--font-weight-semibold)","--text-heading-1-leading":"1.3333","--text-heading-2-size":"var(--font-size-xl)","--text-heading-2-weight":"var(--font-weight-semibold)","--text-heading-2-leading":"1.4","--text-heading-3-size":"var(--font-size-lg)","--text-heading-3-weight":"var(--font-weight-semibold)","--text-heading-3-leading":"1.4118","--text-heading-4-size":"var(--font-size-base)","--text-heading-4-weight":"var(--font-weight-semibold)","--text-heading-4-leading":"1.4286","--text-heading-5-size":"var(--font-size-sm)","--text-heading-5-weight":"var(--font-weight-semibold)","--text-heading-5-leading":"1.6667","--text-heading-6-size":"var(--font-size-xs)","--text-heading-6-weight":"var(--font-weight-semibold)","--text-heading-6-leading":"1.6","--text-body-size":"var(--font-size-base)","--text-body-weight":"var(--font-weight-normal)","--text-body-leading":"1.4286","--text-large-size":"var(--font-size-lg)","--text-large-weight":"var(--font-weight-semibold)","--text-large-leading":"1.4118","--text-label-size":"var(--font-size-base)","--text-label-weight":"var(--font-weight-medium)","--text-label-leading":"1.4286","--text-code-size":"var(--font-size-base)","--text-code-weight":"var(--font-weight-normal)","--text-code-leading":"1.4286","--text-supporting-size":"var(--font-size-sm)","--text-supporting-weight":"var(--font-weight-normal)","--text-supporting-leading":"1.6667","--text-display-1-size":"var(--font-size-5xl)","--text-display-1-weight":"var(--font-weight-normal)","--text-display-1-leading":"1.2381","--text-display-2-size":"var(--font-size-4xl)","--text-display-2-weight":"var(--font-weight-normal)","--text-display-2-leading":"1.2571","--text-display-3-size":"var(--font-size-3xl)","--text-display-3-weight":"var(--font-weight-normal)","--text-display-3-leading":"1.2414"},l5=p.createContext(null);l5.displayName="LayoutAreaContext";const sI={hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1},sg=p.createContext(sI);sg.displayName="LayoutSlotsContext";const rg=p.createContext(null);rg.displayName="LayoutDividerContext";const rI={center:{kGNEyG:"x6s0dn4",$$css:!0},end:{kGNEyG:"xuk3077",$$css:!0},start:{kGNEyG:"x1cy8zhl",$$css:!0},stretch:{kGNEyG:"x1qjc9v5",$$css:!0}},iI={start:{kjj79g:"x1nhvcw1",$$css:!0},center:{kjj79g:"xl56j7k",$$css:!0},end:{kjj79g:"x13a6bvl",$$css:!0},between:{kjj79g:"x1qughib",$$css:!0},around:{kjj79g:"x1l1ennw",$$css:!0},evenly:{kjj79g:"xaw8158",$$css:!0}},oI={horizontal:{kXwgrk:"x1q0g3np",$$css:!0},vertical:{kXwgrk:"xdt5ytf",$$css:!0}},aI={nowrap:{kwnvtZ:"xozqiw3",$$css:!0},wrap:{kwnvtZ:"x1a02dak",$$css:!0},"wrap-reverse":{kwnvtZ:"x8hhl5t",$$css:!0}},lI={stack:{k1xSpc:"x78zum5",$$css:!0}},cI={0:{k1C7PZ:"x1o57wo1",khm7nJ:"x6yxi7o",$$css:!0},1:{k1C7PZ:"x1lfs0n9",khm7nJ:"x1ngg2t4",$$css:!0},2:{k1C7PZ:"xak3so",khm7nJ:"x1x7z4sm",$$css:!0},3:{k1C7PZ:"xewh9hi",khm7nJ:"x4olc9o",$$css:!0},4:{k1C7PZ:"xty4p9g",khm7nJ:"xtx9w7w",$$css:!0},5:{k1C7PZ:"x1eqhezk",khm7nJ:"x1iu6piu",$$css:!0},6:{k1C7PZ:"x3qlgwd",khm7nJ:"xczp1bk",$$css:!0},8:{k1C7PZ:"xicv188",khm7nJ:"xgx0vcf",$$css:!0},10:{k1C7PZ:"x1p37tyl",khm7nJ:"x1xpicb7",$$css:!0},"0.5":{k1C7PZ:"x1kihgfc",khm7nJ:"x1tw44j4",$$css:!0},"1.5":{k1C7PZ:"x1thn6ci",khm7nJ:"xhq53yo",$$css:!0}};function cy({crossAlign:e,direction:t,gap:n,mainAlign:s,wrap:r}){return[lI.stack,oI[t],n!=null&&cI[n],e!=null&&rI[e],s!=null&&iI[s],r!=null&&aI[r]]}const uI={reset:{kAzted:"x2lwn1j",k7Eaqz:"xeuugli",$$css:!0}},dI={center:{kSGwAc:"xamitd3",$$css:!0},end:{kSGwAc:"xpvyfi4",$$css:!0},start:{kSGwAc:"xqcrz7y",$$css:!0},stretch:{kSGwAc:"xkh2ocl",$$css:!0}},fI={fill:{kzQI83:"x1iyjqo2",$$css:!0},static:{kzQI83:"x1c4vz4f",kmuXW:"x2lah0s",$$css:!0}};function hI({crossAlignSelf:e,size:t}={}){return[uI.reset,fI[t??"static"],e!=null&&dI[e]]}function c5(e){return e==="base"?"":e.split("+").map(t=>{const[n,s]=t.split(":");return s===void 0?`.${n}`:/^\d/.test(s)?`.${n}-${s}`:`.${s}`}).join("")}function pI(e,t){return e!=null?`id:${e}`:`fallback:${typeof t=="function"?t():t}`}function Th(e,t){const n={...e,...t},s=[e.className,t.className].filter(Boolean).join(" ");s?n.className=s:delete n.className;const r=t.style&&e.style?{...e.style,...t.style}:t.style||e.style;return r?n.style=r:delete n.style,n}function ee(e,t,n,s){if(typeof e=="string"){const l=e,c=t??{className:""},u=n;let d=c.className?`${l} ${c.className}`:l;u&&(d=`${d} ${u}`);const f=s&&c.style?{...c.style,...s}:s||c.style;return{...c,className:d,style:f}}let o=Th(e,typeof t=="string"?{className:t}:t??{});return typeof n=="string"?o=Th(o,{className:n}):n!=null&&(o=Th(o,{style:n})),s!=null&&(o=Th(o,{style:s})),o}function Wt(...e){return t=>{const n=[];for(const s of e)if(typeof s=="function"){const r=s(t);typeof r=="function"&&n.push(r)}else s!=null&&(s.current=t);if(n.length>0)return()=>{for(const s of n)s()}}}function ig(...e){return t=>{for(const n of e)if(n==null||n(t),t.defaultPrevented)return}}const u5="astryx",dj=u5,og=u5,xI=u5;function uy(e){return`${dj}-${e}`}function zs(e){return`data-${og}-${e}`}function gI(e){return`--${xI}-${e}`}function mI(e){return`data-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}function yI(e,t){return/^\d/.test(t)?`${e}-${t}`:t}function vI(e,t){const n=[uy(e)];if(t)for(const[s,r]of Object.entries(t))r!=null&&n.push(yI(s,String(r)));return n.join(" ")}function kI(e){const t={};if(e)for(const[n,s]of Object.entries(e))s!=null&&(t[mI(n)]=String(s));return t}function J(e,t){return{className:vI(e,t),...kI(t)}}function vb(e){const t=e.auxiliaryData;return typeof(t==null?void 0:t.group)=="string"?t.group:void 0}function bI(e){var o;if(!e.some(l=>vb(l)!=null))return[{heading:null,items:e}];const n=[],s=new Map,r=[];for(const l of e){const c=vb(l);c!=null?(s.has(c)||(n.push(c),s.set(c,[])),(o=s.get(c))==null||o.push(l)):r.push(l)}const i=n.map(l=>({heading:l,items:s.get(l)??[]}));return r.length>0&&i.push({heading:null,items:r}),i}let Sl=null;const Bp=new Map;function wI(){return Sl||(Sl=new ResizeObserver(e=>{for(const t of e){const n=Bp.get(t.target);n&&n(t)}})),Sl}function d5(e,t){Bp.set(e,t),wI().observe(e),t({target:e})}function f5(e){Bp.delete(e),Sl&&(Sl.unobserve(e),Bp.size===0&&(Sl.disconnect(),Sl=null))}function mm(e){return e!=null&&typeof e!="boolean"&&e!==""}function kb(...e){const t=e.flatMap(n=>typeof n=="string"?n.trim().split(/\s+/):[]).filter(Boolean);if(t.length!==0)return Array.from(new Set(t)).join(" ")}function h5(e,t=[],n){return{ariaLabelledBy:n?kb(n.labelID,e):void 0,ariaDescribedBy:kb(n==null?void 0:n.describedByIDs,...t)}}const jI={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:1},white:{r:255,g:255,b:255,a:1}},Hp=(e,t,n)=>Math.max(t,Math.min(n,e));function SI(e){return e.split("").map(t=>t+t).join("")}function CI(e){if(typeof e!="string")return null;const t=e.trim().replace(/^#/,""),n=t.length===3||t.length===4?SI(t):t;return n.length!==6&&n.length!==8||!/^[0-9a-fA-F]+$/.test(n)?null:{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:n.length===8?parseInt(n.slice(6,8),16)/255:1}}function EI(e){const t=e.indexOf("(");if(t===-1||!e.trim().endsWith(")"))return null;const s=e.slice(t+1,e.lastIndexOf(")")).replace(/\//g," ").split(/[\s,]+/).map(u=>u.trim()).filter(Boolean);if(s.length<3)return null;const r=u=>{const d=u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u);return Hp(d,0,255)},i=r(s[0]),o=r(s[1]),l=r(s[2]);if([i,o,l].some(Number.isNaN))return null;let c=1;if(s.length>=4){const u=s[3];if(c=u.endsWith("%")?parseFloat(u)/100:parseFloat(u),Number.isNaN(c))return null;c=Hp(c,0,1)}return{r:i,g:o,b:l,a:c}}function bb(e){const t=e.trim(),n=jI[t.toLowerCase()];return n?{...n}:t.startsWith("#")?CI(t):/^rgba?\(/i.test(t)?EI(t):null}function $I(e,t,n){const s=r=>Hp(Math.round(r),0,255).toString(16).padStart(2,"0").toUpperCase();return`#${s(e)}${s(t)}${s(n)}`}function AI({r:e,g:t,b:n,a:s}){if(s>=1)return $I(e,t,n);const r=i=>Hp(Math.round(i),0,255);return`rgba(${r(e)}, ${r(t)}, ${r(n)}, ${parseFloat(s.toFixed(4))})`}function MI(e,t){return`${e}: ${t}`}function Zl(e,t,...n){}function fj(e,t,...n){console.error(MI(e,t),...n)}function p5(e,t,n,...s){}const TI={kbCHJM:"x1nrll8i",k3aq6I:"xsqj5wx",$$css:!0},sd={mirror:{k3aq6I:"xgtlewx",$$css:!0},centerInline:e=>[TI,{"--x-transform":`translate(-50%, ${e})`!=null?`translate(-50%, ${e})`:void 0}]},hj={0:"spacing0",.5:"spacing0_5",1:"spacing1",1.5:"spacing1_5",2:"spacing2",3:"spacing3",4:"spacing4",5:"spacing5",6:"spacing6",8:"spacing8",10:"spacing10"},bd={0:{kZCmMZ:"x18gyask",kwRFfy:"x1s0aq8i",kLKAdn:"x1ydh6w3",kGO01o:"x1l20ajd",$$css:!0},1:{kZCmMZ:"x1vsv5vr",kwRFfy:"x1nryj5t",kLKAdn:"xfsso4q",kGO01o:"xy143xn",$$css:!0},2:{kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",kLKAdn:"x1xye8es",kGO01o:"x1wesfrj",$$css:!0},3:{kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",kLKAdn:"x1vlblms",kGO01o:"xvmdzux",$$css:!0},4:{kZCmMZ:"x1rey3nv",kwRFfy:"xnjyzlh",kLKAdn:"x1oa1p4a",kGO01o:"x1awphl8",$$css:!0},5:{kZCmMZ:"x1blguxw",kwRFfy:"xdbrk9v",kLKAdn:"xx7rijo",kGO01o:"x1hk98q",$$css:!0},6:{kZCmMZ:"x31w388",kwRFfy:"x1we12cn",kLKAdn:"x1adxfkp",kGO01o:"xjpqqx5",$$css:!0},8:{kZCmMZ:"x1j3hnjz",kwRFfy:"x1q91b2g",kLKAdn:"xoxd1wu",kGO01o:"x2oz4g1",$$css:!0},10:{kZCmMZ:"xqp078j",kwRFfy:"x160ivqr",kLKAdn:"xk6660b",kGO01o:"x2izi54",$$css:!0},"0.5":{kZCmMZ:"x138rykx",kwRFfy:"x1le3yxw",kLKAdn:"xbx876j",kGO01o:"xij103a",$$css:!0},"1.5":{kZCmMZ:"xfti1ec",kwRFfy:"x17hk9do",kLKAdn:"x1kwdpsa",kGO01o:"x1opdxmq",$$css:!0}},wd={0:{"--container-padding-inline-start":"x1gu2k80","--container-padding-inline-end":"x91ghl5",$$css:!0},1:{"--container-padding-inline-start":"x1cvlban","--container-padding-inline-end":"x2oyxnl",$$css:!0},2:{"--container-padding-inline-start":"x1xlrr2o","--container-padding-inline-end":"xcas3b9",$$css:!0},3:{"--container-padding-inline-start":"xfdwxua","--container-padding-inline-end":"xu0ipoa",$$css:!0},4:{"--container-padding-inline-start":"x1dlhslv","--container-padding-inline-end":"xs0pscg",$$css:!0},5:{"--container-padding-inline-start":"x1s81nki","--container-padding-inline-end":"xgkj7vj",$$css:!0},6:{"--container-padding-inline-start":"x1ep0dkj","--container-padding-inline-end":"x94cj42",$$css:!0},8:{"--container-padding-inline-start":"xw1diwv","--container-padding-inline-end":"x1b9k1pi",$$css:!0},10:{"--container-padding-inline-start":"xserb3f","--container-padding-inline-end":"xx5lg5w",$$css:!0},"0.5":{"--container-padding-inline-start":"x14ws0sr","--container-padding-inline-end":"x1wz3t3y",$$css:!0},"1.5":{"--container-padding-inline-start":"x176g23i","--container-padding-inline-end":"xntetml",$$css:!0}},jd={0:{"--container-padding-block-start":"x1i3qcxz",$$css:!0},1:{"--container-padding-block-start":"xnsckjb",$$css:!0},2:{"--container-padding-block-start":"xa8b4fq",$$css:!0},3:{"--container-padding-block-start":"x11k4f5r",$$css:!0},4:{"--container-padding-block-start":"xm01sq8",$$css:!0},5:{"--container-padding-block-start":"xp8wdkl",$$css:!0},6:{"--container-padding-block-start":"x1hmud4d",$$css:!0},8:{"--container-padding-block-start":"xfv60at",$$css:!0},10:{"--container-padding-block-start":"x17h9kl7",$$css:!0},"0.5":{"--container-padding-block-start":"xvdf9ev",$$css:!0},"1.5":{"--container-padding-block-start":"x1kbx601",$$css:!0}},Sd={0:{"--container-padding-block-end":"xkunwnr",$$css:!0},1:{"--container-padding-block-end":"x57a7ii",$$css:!0},2:{"--container-padding-block-end":"x1lsgcmx",$$css:!0},3:{"--container-padding-block-end":"x1q3ppug",$$css:!0},4:{"--container-padding-block-end":"x4hfsld",$$css:!0},5:{"--container-padding-block-end":"xbib2ws",$$css:!0},6:{"--container-padding-block-end":"x1q8d17g",$$css:!0},8:{"--container-padding-block-end":"x8lgq76",$$css:!0},10:{"--container-padding-block-end":"x15vxphk",$$css:!0},"0.5":{"--container-padding-block-end":"x1cao3zv",$$css:!0},"1.5":{"--container-padding-block-end":"xv53x8y",$$css:!0}},zI={0:{"--layout-padding-outer-x":"xswhm3q",$$css:!0},1:{"--layout-padding-outer-x":"xc96xmq",$$css:!0},2:{"--layout-padding-outer-x":"x15dxnc0",$$css:!0},3:{"--layout-padding-outer-x":"xadgj3j",$$css:!0},4:{"--layout-padding-outer-x":"x1v56qcf",$$css:!0},5:{"--layout-padding-outer-x":"x1nzs0gl",$$css:!0},6:{"--layout-padding-outer-x":"x1c3n52a",$$css:!0},8:{"--layout-padding-outer-x":"x1t3kfz",$$css:!0},10:{"--layout-padding-outer-x":"x1jdf5a4",$$css:!0},"0.5":{"--layout-padding-outer-x":"xihiwg7",$$css:!0},"1.5":{"--layout-padding-outer-x":"x1u93lgd",$$css:!0}},NI={0:{"--layout-padding-outer-y":"x1mzf5mb",$$css:!0},1:{"--layout-padding-outer-y":"x1gpfxoh",$$css:!0},2:{"--layout-padding-outer-y":"x10pz7y9",$$css:!0},3:{"--layout-padding-outer-y":"x1p6yq3h",$$css:!0},4:{"--layout-padding-outer-y":"xx738ci",$$css:!0},5:{"--layout-padding-outer-y":"x6yxws5",$$css:!0},6:{"--layout-padding-outer-y":"x180vrwl",$$css:!0},8:{"--layout-padding-outer-y":"xid7e43",$$css:!0},10:{"--layout-padding-outer-y":"x26l4wa",$$css:!0},"0.5":{"--layout-padding-outer-y":"x1vj96e0",$$css:!0},"1.5":{"--layout-padding-outer-y":"xd3dqby",$$css:!0}},_I={0:{kZCmMZ:"x18gyask",kwRFfy:"x1s0aq8i",$$css:!0},1:{kZCmMZ:"x1vsv5vr",kwRFfy:"x1nryj5t",$$css:!0},2:{kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",$$css:!0},3:{kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",$$css:!0},4:{kZCmMZ:"x1rey3nv",kwRFfy:"xnjyzlh",$$css:!0},5:{kZCmMZ:"x1blguxw",kwRFfy:"xdbrk9v",$$css:!0},6:{kZCmMZ:"x31w388",kwRFfy:"x1we12cn",$$css:!0},8:{kZCmMZ:"x1j3hnjz",kwRFfy:"x1q91b2g",$$css:!0},10:{kZCmMZ:"xqp078j",kwRFfy:"x160ivqr",$$css:!0},"0.5":{kZCmMZ:"x138rykx",kwRFfy:"x1le3yxw",$$css:!0},"1.5":{kZCmMZ:"xfti1ec",kwRFfy:"x17hk9do",$$css:!0}},RI={0:{kLKAdn:"x1ydh6w3",kGO01o:"x1l20ajd",$$css:!0},1:{kLKAdn:"xfsso4q",kGO01o:"xy143xn",$$css:!0},2:{kLKAdn:"x1xye8es",kGO01o:"x1wesfrj",$$css:!0},3:{kLKAdn:"x1vlblms",kGO01o:"xvmdzux",$$css:!0},4:{kLKAdn:"x1oa1p4a",kGO01o:"x1awphl8",$$css:!0},5:{kLKAdn:"xx7rijo",kGO01o:"x1hk98q",$$css:!0},6:{kLKAdn:"x1adxfkp",kGO01o:"xjpqqx5",$$css:!0},8:{kLKAdn:"xoxd1wu",kGO01o:"x2oz4g1",$$css:!0},10:{kLKAdn:"xk6660b",kGO01o:"x2izi54",$$css:!0},"0.5":{kLKAdn:"xbx876j",kGO01o:"xij103a",$$css:!0},"1.5":{kLKAdn:"x1kwdpsa",kGO01o:"x1opdxmq",$$css:!0}},Oo={layoutOuter:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",$$css:!0},layoutInner:{"--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},fill:{kZKoxP:"x12qplqi",kskxy:"xenllk4",$$css:!0},auto:{kAzted:"x1us19tq",$$css:!0},middle:{kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},fullBleed:{"--layout-padding-outer-x":"x1wbjvqu","--layout-padding-outer-y":"xzxxx64",$$css:!0}},II={kzqmXN:"xh8yej3",kUOVxO:"xvueqy4",$$css:!0},wb={contentWidthVar:e=>[{"--layout-content-width":(typeof e=="number"?`${e}px`:e)!=null?"x4906uf":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x---layout-content-width":(typeof e=="number"?`${e}px`:e)!=null?typeof e=="number"?`${e}px`:e:void 0}],contentWidth:e=>[II,{ks0D6T:(typeof e=="number"?`${e}px`:e)!=null?"xf68679":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function Kd({area:e,children:t}){return t==null?null:a.jsx(l5,{value:e,children:t})}const LI={"x-default-marker":"x-default-marker",$$css:!0};function Hs({children:e,content:t,contentWidth:n,defaultHasDividers:s,end:r,footer:i,header:o,height:l="fill",padding:c,ref:u,start:d,xstyle:f,className:h,style:x}){const g=l==="fill",y=t??e,v=p.useMemo(()=>s!=null?{defaultHasDividers:s}:null,[s]),m=o!=null,k=i!=null,b=d!=null,j=r!=null,A=p.useMemo(()=>({hasHeader:m,hasFooter:k,hasStart:b,hasEnd:j}),[m,k,b,j]),M=a.jsx(sg,{value:A,children:a.jsx("div",{ref:u,...ee(J("layout",{height:l}),W(Oo.layoutOuter,g?Oo.fill:Oo.auto,f),h,x),children:a.jsxs("div",{...W(LI,Oo.layoutInner,...cy({direction:"vertical"}),g?Oo.fill:Oo.auto,c===0&&Oo.fullBleed,c!=null&&zI[c],c!=null&&NI[c],n!=null&&wb.contentWidthVar(n)),children:[a.jsx(Kd,{area:"header",children:o}),a.jsxs("div",{...W(...cy({direction:"horizontal"}),Oo.middle,n!=null&&wb.contentWidth(n)),children:[a.jsx(Kd,{area:"start",children:d}),a.jsx("div",{...W(...hI({size:"fill"})),children:a.jsx(Kd,{area:"content",children:y})}),a.jsx(Kd,{area:"end",children:r})]}),a.jsx(Kd,{area:"footer",children:i})]})})});return v!=null?a.jsx(rg,{value:v,children:M}):M}Hs.displayName="Layout";const zh={header:{kmuXW:"x2lah0s",$$css:!0},inner:{kB7OPa:"x9f619",ks0D6T:"xjl2t3p",kUOVxO:"xvueqy4",kZCmMZ:"x139j0dd",kwRFfy:"xpc6k2p",kLKAdn:"x81pis9",kGO01o:"xg476vw","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r","--container-padding-block-start":"xzz8v79","--container-padding-block-end":"xi9ns85",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},divider:{kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},OI={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function qp({children:e,hasDivider:t,height:n,label:s,padding:r,role:i,xstyle:o,className:l,style:c,ref:u,...d}){const f=p.use(rg),h=t??(f==null?void 0:f.defaultHasDividers)??!1,x=r===0;return a.jsx("div",{ref:u,role:i,"aria-label":s,"data-divider":h||void 0,...ee(J("layout-header"),W(zh.header,OI.sizing(n??null),h&&zh.divider,o),l,c),...d,children:a.jsx("div",{...W(zh.inner,x&&zh.fullBleed,r!=null&&bd[r],r!=null&&wd[r],r!=null&&jd[r],r!=null&&Sd[r]),children:e})})}qp.displayName="LayoutHeader";const Pr={panel:{kB7OPa:"x9f619",kmuXW:"x2lah0s",kVQacm:"x7giv3",kZCmMZ:"xwjyata",kwRFfy:"x1peupej",kLKAdn:"xqty4a",kGO01o:"xg476vw","--container-padding-inline-start":"x408pgh","--container-padding-inline-end":"xikqloz","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"xi9ns85",$$css:!0},startPanel:{kZCmMZ:"x139j0dd",$$css:!0},endPanel:{kwRFfy:"xpc6k2p",$$css:!0},noHeader:{kLKAdn:"x81pis9",$$css:!0},noFooter:{kGO01o:"xon7vh3",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0},dividerEnd:{ke9TFa:"x1lun4ml",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0},dividerStart:{k2ei4v:"xpilrb4",kVhnKS:"x1t7ytsu",kGJrpR:"x1j92z86",$$css:!0},collapseStart:{keTefX:"x1wim8z0",$$css:!0},collapseEnd:{k71WvV:"x1kpg4um",$$css:!0}},DI={sizing:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function x5({children:e,hasDivider:t=!1,isScrollable:n=!0,label:s,padding:r,role:i,width:o,resizable:l,xstyle:c,className:u,style:d,ref:f,...h}){const x=p.use(l5),{hasHeader:g,hasFooter:y}=p.use(sg),v=l?l._size:o,m=x==="start",k=x==="end",b=r===0,j=!t&&!b&&r==null,A=m?Pr.dividerEnd:k?Pr.dividerStart:null,M=m?Pr.collapseEnd:k?Pr.collapseStart:null;return a.jsx("div",{ref:f,role:i,"aria-label":s,...ee(J("layout-panel"),W(Pr.panel,DI.sizing(v??null),m&&!b&&r==null&&Pr.startPanel,k&&!b&&r==null&&Pr.endPanel,!g&&!b&&r==null&&Pr.noHeader,!y&&!b&&r==null&&Pr.noFooter,n&&Pr.scrollable,b&&Pr.fullBleed,r!=null&&bd[r],r!=null&&wd[r],r!=null&&jd[r],r!=null&&Sd[r],t&&A,j&&M,c),u,d),...h,children:e})}x5.displayName="LayoutPanel";const Za={content:{kB7OPa:"x9f619",kZKoxP:"x5yr21d",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",kVQacm:"x7giv3",kZCmMZ:"xwjyata",kwRFfy:"x1peupej",kLKAdn:"xqty4a x1ioh5az",kGO01o:"xg476vw xsg11nj","--container-padding-inline-start":"x408pgh","--container-padding-inline-end":"xikqloz","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"xi9ns85",$$css:!0},noStart:{kZCmMZ:"x139j0dd","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r",$$css:!0},noEnd:{kwRFfy:"xpc6k2p",$$css:!0},noHeader:{kLKAdn:"x81pis9","--container-padding-block-start":"xzz8v79",$$css:!0},noFooter:{kGO01o:"xon7vh3","--container-padding-block-end":"x1xjq73n",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0}};function qs({children:e,isScrollable:t=!0,padding:n,label:s,role:r,xstyle:i,className:o,style:l,ref:c,...u}){const{hasHeader:d,hasFooter:f,hasStart:h,hasEnd:x}=p.use(sg),g=n===0;return a.jsx("div",{ref:c,role:r,"aria-label":s,...ee(J("layout-content"),W(Za.content,!h&&!g&&n==null&&Za.noStart,!x&&!g&&n==null&&Za.noEnd,!d&&!g&&n==null&&Za.noHeader,!f&&!g&&n==null&&Za.noFooter,t&&Za.scrollable,g&&Za.fullBleed,n!=null&&bd[n],n!=null&&wd[n],n!=null&&jd[n],n!=null&&Sd[n],i),o,l),...u,children:e})}qs.displayName="LayoutContent";function pj(e){return(e.style.anchorName??"").split(",").map(n=>n.trim()).filter(Boolean)}function xj(e,t){e.style.anchorName=t.join(", ")}function BI(e,t){const n=pj(e);n.includes(t)||(n.push(t),xj(e,n))}function HI(e,t){xj(e,pj(e).filter(n=>n!==t))}const ym={base:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x1lziwak",k71WvV:"x14z9mp",kLKAdn:"xexx8yu",kGO01o:"x18d9i69",kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kMzoRj:"xc342km",ksu8eU:"xng3xce",kVQacm:"x1rea2x4",kMv6JI:"x9ynric",kWkggS:"xjbqb8w",$$css:!0},fixed:{kVAEAm:"xixxii4",$$css:!0}};function qI(e="above",t="center"){if(e==="above"||e==="below"){const s=e==="above"?"self-block-start":"self-block-end";return t==="start"?`${s} span-self-inline-end`:t==="end"?`${s} span-self-inline-start`:s}const n=e==="start"?"self-inline-start":"self-inline-end";return t==="start"?`${n} span-self-block-end`:t==="end"?`${n} span-self-block-start`:n}function PI(e="above",t="center"){const n="flip-block, flip-inline, flip-block flip-inline";if(t!=="center")return n;if(e==="above"||e==="below"){const[i,o]=e==="above"?["top","bottom"]:["bottom","top"];return`${n}, ${i} span-left, ${i} span-right, ${o} span-left, ${o} span-right`}const[s,r]=e==="start"?["left","right"]:["right","left"];return`${n}, ${s} span-top, ${s} span-bottom, ${r} span-top, ${r} span-bottom`}function Cd(e){const{mode:t,onShow:n,onHide:s,lightDismiss:r=!1}=e,i=p.useId(),o=`--astryx-layer-${i.replace(/:/g,"")}`,[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(!1),h=p.useCallback(()=>{const M=u.current;M&&!f.current&&(typeof M.showPopover=="function"?M.showPopover():M.style.display="block",f.current=!0,c(!0),n==null||n())},[n]),x=p.useCallback(()=>{if(f.current){const M=u.current;M&&(typeof M.hidePopover=="function"?M.hidePopover():M.style.display="none"),f.current=!1,c(!1),s==null||s()}},[s]),g=t==="context"?M=>{d.current&&d.current!==M&&HI(d.current,o),M&&BI(M,o),d.current=M}:void 0,y=p.useCallback(M=>{M.newState==="closed"&&f.current&&(f.current=!1,c(!1),s==null||s())},[s]),v=p.useRef(null),m=p.useRef(null),k=p.useCallback((M,E)=>{v.current&&m.current&&(v.current!==M||m.current!==E)&&(v.current.removeEventListener("toggle",m.current),v.current=null,m.current=null),M&&v.current!==M&&(M.addEventListener("toggle",E),v.current=M,m.current=E)},[]),b=p.useCallback(M=>{u.current=M,k(M,y)},[y,k]);p.useEffect(()=>(u.current&&k(u.current,y),()=>{v.current&&m.current&&(v.current.removeEventListener("toggle",m.current),v.current=null,m.current=null)}),[y,k]);const j=p.useCallback((M,E)=>{const{placement:z="above",alignment:T="center",positioning:$="anchor",role:_,"aria-label":R,xstyle:N,className:H,style:B,as:I="div",onMouseEnter:L,onMouseLeave:O}=E||{},D=$==="custom"?{positionAnchor:o}:{positionAnchor:o,positionArea:qI(z,T),positionTryFallbacks:PI(z,T)},q=W(ym.base,N),F=H?`${H} ${q.className??""}`:q.className;return a.jsx(I,{ref:b,id:i,role:_,"aria-label":R,popover:r?"auto":"manual",className:F,style:{...q.style,...D,...B},onMouseEnter:L,onMouseLeave:O,children:M})},[o,i,r,b]),A=p.useCallback((M,E)=>{const{x:z,y:T,xstyle:$,className:_,style:R}=E,N={top:T,left:z},H=W(ym.base,ym.fixed,$),B=_?`${_} ${H.className??""}`:H.className;return a.jsx("div",{ref:b,id:i,popover:r?"auto":"manual",className:B,style:{...H.style,...N,...R},children:M})},[b,i,r]);return t==="context"?{ref:g,anchorId:o,show:h,hide:x,isOpen:l,id:i,render:j}:{ref:void 0,show:h,hide:x,isOpen:l,id:i,render:A}}const go={below:{kKVMdj:"xl1vlw0 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},above:{kKVMdj:"x3psbcj x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},end:{kKVMdj:"x1i331go x1vxsm5i x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},start:{kKVMdj:"xck01x9 x18lne9g x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0}},UI=100,vm={container:{kWkggS:"x19aspcf",kMwMTN:"xrkvqaz",kaIpWk:"x1hviunn",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},marginBlock:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",keTefX:"x1lziwak",k71WvV:"x14z9mp",$$css:!0},marginInline:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0}};function FI(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function Es(e={}){const{placement:t="above",alignment:n="center",delay:s=200,hideDelay:r=0,focusTrigger:i="auto",isEnabled:o=!0,isOpen:l,isDefaultOpen:c=!1,onShow:u,onHide:d}=e,f=t==="above"||t==="below"?vm.marginBlock:vm.marginInline,h=Cd({mode:"context",onShow:u,onHide:d}),x=p.useMemo(()=>[vm.container,f],[f]),g=p.useRef(null),y=p.useRef(null),v=p.useRef(null),m=p.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),k=p.useCallback(()=>{!o||l===!1||(m(),g.current=setTimeout(()=>{h.show()},s))},[o,l,m,h,s]),b=p.useCallback(()=>{if(l===!0)return;m();const N=r>0?r:UI;y.current=setTimeout(()=>{h.hide()},N)},[l,m,h,r]),j=p.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),A=p.useCallback(()=>{typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches||k()},[k]),M=p.useCallback(()=>{b()},[b]),E=p.useCallback(N=>{!o||!N.target.matches(":focus-visible")||(m(),h.show())},[o,m,h]),z=p.useCallback(()=>{b()},[b]),T=p.useCallback(()=>{l===void 0&&(m(),h.hide())},[l,m,h]),$=p.useCallback(N=>{v.current&&(v.current.removeEventListener("mouseenter",A),v.current.removeEventListener("mouseleave",M),v.current.removeEventListener("focusin",E),v.current.removeEventListener("focusout",z),v.current.removeEventListener("pointerdown",T)),N&&(N.addEventListener("mouseenter",A),N.addEventListener("mouseleave",M),N.addEventListener("pointerdown",T),(i==="always"||i==="auto"&&FI(N))&&(N.addEventListener("focusin",E),N.addEventListener("focusout",z))),v.current=N},[i,A,M,E,z,T]),_=p.useCallback(N=>{h.ref(N),$(N)},[h,$]);p.useEffect(()=>()=>{m()},[m]),p.useEffect(()=>{c&&h.show()},[]),p.useEffect(()=>{l!==void 0&&(l?(m(),h.show()):(m(),h.hide()))},[l,m,h]),p.useEffect(()=>{if(l!==void 0)return;const N=H=>{H.key==="Escape"&&(H.isComposing||H.keyCode===229||(m(),h.hide()))};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[l,h,m]);const R=p.useCallback((N,H)=>{const B=(H==null?void 0:H.placement)??t,I={placement:B,alignment:(H==null?void 0:H.alignment)??n,role:"tooltip",xstyle:[x,go[B]],className:J("tooltip").className,onMouseEnter:j,onMouseLeave:b};return h.render(a.jsx("div",{className:"xfsso4q xy143xn x12gdq22 x1djylfy xw5ewwj x13faqbe",children:N}),I)},[h,t,n,x,j,b]);return{ref:_,positionRef:h.ref,interactionRef:$,anchorId:h.anchorId,describedBy:h.id,renderTooltip:R}}const g5={"--color-syntax-keyword":"var(--color-text-accent)","--color-syntax-string":"var(--color-text-green)","--color-syntax-comment":"var(--color-text-secondary)","--color-syntax-number":"var(--color-text-orange)","--color-syntax-function":"var(--color-text-blue)","--color-syntax-type":"var(--color-text-purple)","--color-syntax-variable":"var(--color-text-primary)","--color-syntax-operator":"var(--color-text-cyan)","--color-syntax-constant":"var(--color-text-orange)","--color-syntax-tag":"var(--color-text-red)","--color-syntax-attribute":"var(--color-text-teal)","--color-syntax-property":"var(--color-text-cyan)","--color-syntax-punctuation":"var(--color-text-disabled)","--color-syntax-background":"var(--color-background-muted)"},VI={"--color-data-categorical-blue":"light-dark(#0171E3, #0171E3)","--color-data-categorical-orange":"light-dark(#EB6E00, #EB6E00)","--color-data-categorical-purple":"light-dark(#6B1EFD, #6B1EFD)","--color-data-categorical-green":"light-dark(#0B991F, #0B991F)","--color-data-categorical-pink":"light-dark(#F351C0, #F351C0)","--color-data-categorical-cyan":"light-dark(#0171A4, #0171A4)","--color-data-categorical-red":"light-dark(#F5394F, #F5394F)","--color-data-categorical-teal":"light-dark(#08A3A3, #08A3A3)","--color-data-categorical-brown":"light-dark(#965E03, #965E03)","--color-data-categorical-indigo":"light-dark(#6F8AFF, #6F8AFF)","--color-data-neutral":"light-dark(#8494A3, #8C939B)","--color-data-blue-5":"light-dark(#02165E, #02165E)","--color-data-blue-4":"light-dark(#004CBC, #004CBC)","--color-data-blue-3":"light-dark(#2694FE, #2694FE)","--color-data-blue-2":"light-dark(#78BEFF, #78BEFF)","--color-data-blue-1":"light-dark(#DBECFF, #DBECFF)","--color-data-shamrock-5":"light-dark(#0B603D, #0B603D)","--color-data-shamrock-4":"light-dark(#138546, #138546)","--color-data-shamrock-3":"light-dark(#24BB5E, #24BB5E)","--color-data-shamrock-2":"light-dark(#8EF7AA, #8EF7AA)","--color-data-shamrock-1":"light-dark(#D6FEE4, #D6FEE4)","--color-data-orange-5":"light-dark(#A13F04, #A13F04)","--color-data-orange-4":"light-dark(#D66100, #D66100)","--color-data-orange-3":"light-dark(#FD9537, #FD9537)","--color-data-orange-2":"light-dark(#FDB876, #FDB876)","--color-data-orange-1":"light-dark(#FFE6CF, #FFE6CF)","--color-data-pink-5":"light-dark(#8E1073, #8E1073)","--color-data-pink-4":"light-dark(#D123A1, #D123A1)","--color-data-pink-3":"light-dark(#F989D3, #F989D3)","--color-data-pink-2":"light-dark(#FEADE3, #FEADE3)","--color-data-pink-1":"light-dark(#FCE3F4, #FCE3F4)","--color-data-purple-5":"light-dark(#3E0697, #3E0697)","--color-data-purple-4":"light-dark(#6B1EFD, #6B1EFD)","--color-data-purple-3":"light-dark(#9081FF, #9081FF)","--color-data-purple-2":"light-dark(#B3B0FE, #B3B0FE)","--color-data-purple-1":"light-dark(#E8E8FB, #E8E8FB)","--color-data-red-5":"light-dark(#9D0519, #9D0519)","--color-data-red-4":"light-dark(#D31130, #D31130)","--color-data-red-3":"light-dark(#FB7D87, #FB7D87)","--color-data-red-2":"light-dark(#FFB2B8, #FFB2B8)","--color-data-red-1":"light-dark(#FEE4E6, #FEE4E6)","--color-data-teal-5":"light-dark(#08767D, #08767D)","--color-data-teal-4":"light-dark(#0C9293, #0C9293)","--color-data-teal-3":"light-dark(#0DB7AF, #0DB7AF)","--color-data-teal-2":"light-dark(#6CE6D8, #6CE6D8)","--color-data-teal-1":"light-dark(#D7FCF8, #D7FCF8)","--color-data-yellow-5":"light-dark(#8A5001, #8A5001)","--color-data-yellow-4":"light-dark(#D69804, #D69804)","--color-data-yellow-3":"light-dark(#FBCE03, #FBCE03)","--color-data-yellow-2":"light-dark(#FCEC85, #FCEC85)","--color-data-yellow-1":"light-dark(#FDF6BA, #FDF6BA)","--color-data-gray-5":"light-dark(#25363F, #333338)","--color-data-gray-4":"light-dark(#5D6C7B, #666A72)","--color-data-gray-3":"light-dark(#AFB9C4, #B2B8BE)","--color-data-gray-2":"light-dark(#CCD3DB, #D0D3D6)","--color-data-gray-1":"light-dark(#F1F4F7, #F2F4F6)"},GI={...g5,...VI},gj=new Map;function WI(e){gj.set(e.name,e)}function mj(e){return e==null||e===""?null:gj.get(e)??null}const KI={avatar:[{property:"fontSize",vars:["--_avatar-fallback-font-size"]},{property:"fontWeight",vars:["--_avatar-fallback-font-weight"]},{property:"color",vars:["--_avatar-fallback-color"]},{property:"backgroundColor",vars:["--_avatar-fallback-background"]}],banner:[{property:"borderRadius",vars:["--_banner-radius"]}],button:[{property:"borderRadius",vars:["--_button-radius"]}],card:[{property:"borderRadius",vars:["--_card-radius"]},{property:"padding",expand:"container"}],chat:[{property:"borderRadius",vars:["--_chat-composer-radius"]},{property:"padding",vars:["--_chat-composer-padding"]}],dialog:[{property:"borderRadius",vars:["--_dialog-radius"]},{property:"padding",expand:"container"}],"dropdown-menu":[{property:"borderRadius",vars:["--_dropdown-menu-radius"]},{property:"padding",vars:["--_dropdown-menu-padding"]}],field:[{property:"borderRadius",vars:["--_field-radius"]}],hovercard:[{property:"borderRadius",vars:["--_hovercard-radius"]}],popover:[{property:"borderRadius",vars:["--_popover-radius"]}],section:[{property:"padding",expand:"container"}],"segmented-control":[{property:"borderRadius",vars:["--_segmented-control-radius"]},{property:"padding",vars:["--_segmented-control-padding"]}]};function jb(e,t){const n=KI[e];return n?n.filter(s=>s.property===t):[]}function yj(e){return`[data-${og}-theme="${e}"]`}const vj=`[data-${og}-theme]`;function Sb(e){return`[data-${og}-media="${e}"]`}function gu(e,t){return`.${dj}-${e}${t}`}function kj(e,t){const n=[];let s=0,r=0;for(let i=0;i<e.length;i++){const o=e[i];o==="("?s++:o===")"?s=Math.max(0,s-1):o===","&&s===0&&(n.push(e.slice(r,i).trim()),r=i+1)}return n.push(e.slice(r).trim()),n.map(i=>`${i}${t}`).join(", ")}function Pp(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const Nh=new Set(["padding","paddingBlock","paddingInline","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd"]);function XI(e){const t={};for(const[n,s]of e)switch(n){case"padding":{const r=s.trim().split(/\s+/);r.length===1?(t.blockStart=r[0],t.blockEnd=r[0],t.inline=r[0]):r.length===2?(t.blockStart=r[0],t.blockEnd=r[0],t.inline=r[1]):r.length>=3&&(t.blockStart=r[0],t.inline=r[1],t.blockEnd=r[2]);break}case"paddingBlock":{const r=s.trim().split(/\s+/);t.blockStart=r[0],t.blockEnd=r[1]??r[0];break}case"paddingInline":{const r=s.trim().split(/\s+/);r.length===1?t.inline=r[0]:(t.inlineStart=r[0],t.inlineEnd=r[1]);break}case"paddingBlockStart":t.blockStart=s;break;case"paddingBlockEnd":t.blockEnd=s;break;case"paddingInlineStart":t.inlineStart=s;break;case"paddingInlineEnd":t.inlineEnd=s;break}return t}function ZI(e,t){const n=gI(`${e}-padding`),s=[],r=t.inlineStart??t.inline,i=t.inlineEnd??t.inline;return r!=null&&i!=null&&r===i&&t.blockStart!=null&&t.blockEnd!=null&&r===t.blockStart&&t.blockStart===t.blockEnd?(s.push([n,r??""]),s):(t.inlineStart!=null||t.inlineEnd!=null?(r!=null&&s.push([`${n}-inline-start`,r]),i!=null&&s.push([`${n}-inline-end`,i])):t.inline!=null&&s.push([`${n}-inline`,t.inline]),t.blockStart!=null&&s.push([`${n}-block-start`,t.blockStart]),t.blockEnd!=null&&s.push([`${n}-block-end`,t.blockEnd]),s)}function YI(e){const t=[],n=e.tokens,s=i=>n[i]||`var(${i})`,r=Object.entries(n);if(r.length>0){const i=r.map(([o,l])=>` ${o}: ${l};`).join(`
18
- `);t.push(` :scope {
19
- ${i}
20
- }`)}return e.components&&QI(e.components,t),JI(s,t),eL(e.components||{},t),nL(e.components||{},t),t}function QI(e,t){for(const[n,s]of Object.entries(e))for(const[r,i]of Object.entries(s)){const o=Object.entries(i);if(o.length===0)continue;const l=c5(r),c=gu(n,l),u=[],d=[];for(const[g,y]of o)g.startsWith(":")&&typeof y=="object"?d.push([g,y]):u.push([g,y]);let f=u;const h=[];let x=!1;for(const[g,y]of u){const v=jb(n,g),m=Nh.has(g)&&g!=="padding"?jb(n,"padding"):[];for(const k of[...v,...m])if(k.expand==="container"&&Nh.has(g)&&(x=!0),k.vars)for(const b of k.vars)h.push([b,y])}if(x){const g=u.filter(([k])=>Nh.has(k)),y=u.filter(([k])=>!Nh.has(k)),v=XI(g),m=ZI(n,v);f=[...y,...m]}if(h.length>0&&(f=[...f,...h]),f.length>0){const g=f.map(([y,v])=>` ${Pp(y)}: ${v};`).join(`
21
- `);t.push(` ${c} {
22
- ${g}
23
- }`)}for(const[g,y]of d){const v=Object.entries(y);if(v.length>0){const m=v.map(([k,b])=>` ${Pp(k)}: ${b};`).join(`
24
- `);t.push(` ${kj(c,g)} {
25
- ${m}
26
- }`)}}}}function JI(e,t){t.push(` :where(h1, h2, h3, h4, h5, h6) {
27
- font-family: var(--font-family-heading);
28
- color: var(--color-text-primary);
29
- }`);for(let n=1;n<=6;n++)t.push(` :where(h${n}) {
30
- font-size: ${e(`--text-heading-${n}-size`)};
31
- font-weight: ${e(`--text-heading-${n}-weight`)};
32
- line-height: ${e(`--text-heading-${n}-leading`)};
33
- }`);t.push(` :where(p) {
34
- font-family: var(--font-family-body);
35
- font-size: ${e("--text-body-size")};
36
- font-weight: ${e("--text-body-weight")};
37
- line-height: ${e("--text-body-leading")};
38
- color: var(--color-text-primary);
39
- }`),t.push(` :where(small) {
40
- font-size: ${e("--text-supporting-size")};
41
- font-weight: ${e("--text-supporting-weight")};
42
- line-height: ${e("--text-supporting-leading")};
43
- color: var(--color-text-secondary);
44
- }`),t.push(` :where(code, pre) {
45
- font-family: var(--font-family-code);
46
- font-size: ${e("--text-code-size")};
47
- line-height: ${e("--text-code-leading")};
48
- }`),t.push(` :where(hr) {
49
- border: none;
50
- border-top: 1px solid var(--color-border);
51
- }`)}function eL(e,t){const n={primary:"var(--color-text-primary)",secondary:"var(--color-text-secondary)",disabled:"var(--color-text-disabled)",placeholder:"var(--color-text-secondary)",accent:"var(--color-text-accent)"},s="text"in e,r="heading"in e,i="link"in e;if(s||r||i)for(const[o,l]of Object.entries(n))s&&t.push(` ${gu("text",`.${o}`)} { color: ${l}; }`),r&&t.push(` ${gu("heading",`.${o}`)} { color: ${l}; }`),i&&t.push(` ${gu("link",`.${o}`)} { color: ${l}; }`)}const tL={"4xs":"var(--font-size-4xs)","3xs":"var(--font-size-3xs)","2xs":"var(--font-size-2xs)",xsm:"var(--font-size-xs)",sm:"var(--font-size-sm)",base:"var(--font-size-base)",lg:"var(--font-size-lg)",xl:"var(--font-size-xl)","2xl":"var(--font-size-2xl)","3xl":"var(--font-size-3xl)","4xl":"var(--font-size-4xl)"};function nL(e,t){if("text"in e)for(const[n,s]of Object.entries(tL)){const r=c5(`size:${n}`);t.push(` ${gu("text",r)} { font-size: ${s}; }`)}}function sL(e){const t=YI(e),n=[],s=[];for(const r of t)r.trimStart().startsWith(":where(")?n.push(r):s.push(r);return{component:s,prose:n}}function rL(e){const t=[],n=yj(e.name);for(const r of["dark","light"]){const i=r==="dark"?e.__onDark:e.__onLight;if(!i)continue;const o=Object.entries(i.tokens);if(o.length>0){const l=o.map(([c,u])=>` ${c}: ${u};`).join(`
52
- `);t.push(` ${Sb(r)} {
53
- ${l}
54
- }`)}if(i.components)for(const[l,c]of Object.entries(i.components))for(const[u,d]of Object.entries(c)){const f=Object.entries(d);if(f.length===0)continue;const h=c5(u),x=`:is(${Sb(r)}) :is(${gu(l,h)})`,g=[],y=[];for(const[v,m]of f)v.startsWith(":")&&typeof m=="object"?y.push([v,m]):g.push([v,m]);if(g.length>0){const v=g.map(([m,k])=>` ${Pp(m)}: ${k};`).join(`
55
- `);t.push(` ${x} {
56
- ${v}
57
- }`)}for(const[v,m]of y){const k=Object.entries(m);if(k.length>0){const b=k.map(([j,A])=>` ${Pp(j)}: ${A};`).join(`
58
- `);t.push(` ${kj(x,v)} {
59
- ${b}
60
- }`)}}}}if(t.length===0)return"";const s=t.join(`
61
-
62
- `);return`@scope (${n}) to (${vj}) {
63
- ${s}
64
- }`}function iL(e){const{component:t,prose:n}=sL(e),s=yj(e.name),r=vj;let i="";if(n.length>0){const c=n.join(`
65
-
66
- `);i=`@scope (${s}) to (${r}) {
67
- ${c}
68
- }`}let o="";if(t.length>0){const c=t.join(`
69
-
70
- `);o=`@scope (${s}) to (${r}) {
71
- ${c}
72
- }`}const l=rL(e);return l&&(o=o?`${o}
73
-
74
- ${l}`:l),{prose:i,component:o}}const bj={...GR,...WR,...KR,...XR,...ZR,...YR,...QR,...JR,...eI,...tI,...nI,...GI};function oL(e){return`var(${e})`}Object.fromEntries(Object.keys(bj).map(e=>[e,oL(e)]));function m5(e){let t=0,n=null,s=!1;for(let r=0;r<e.length;r++){const i=e[r];if(n!==null){s?s=!1:i==="\\"?s=!0:i===n&&(n=null);continue}if(i==='"'||i==="'"){n=i;continue}if(i==="("){t++;continue}if(i===")"){t=Math.max(0,t-1);continue}if(i===","&&t===0)return[e.slice(0,r).trim(),e.slice(r+1).trim()]}return null}function aL(e){const t=e.trim(),n="light-dark(";if(!t.startsWith(n)||!t.endsWith(")"))return null;const s=t.slice(n.length,-1);return m5(s)}function km(e,t){if(Array.isArray(e))return t==="dark"?e[1]:e[0];const n=aL(e);return n!==null?t==="dark"?n[1]:n[0]:e}function wj(e,t){let n=0;for(let s=t;s<e.length;s++){const r=e[s];if(r==="(")n++;else if(r===")"&&(n--,n===0))return s}return-1}function Cb(e){const t=e.trim(),n=t.match(/\s+([\d.]+)%$/);return n?{color:t.slice(0,n.index).trim(),percentage:parseFloat(n[1])}:{color:t,percentage:null}}function lL(e){const t=e.match(/^in\s+([\w-]+)\s*,\s*(.+)$/s);if(!t)return null;const[,n,s]=t;if(n.toLowerCase()!=="srgb")return null;const r=m5(s);if(r===null)return null;const i=Cb(r[0]),o=Cb(r[1]);if(i===null||o===null)return null;const l=bb(i.color),c=bb(o.color);if(l===null||c===null)return null;let u,d;i.percentage!==null&&o.percentage!==null?(u=i.percentage,d=o.percentage):i.percentage!==null?(u=i.percentage,d=100-u):o.percentage!==null?(d=o.percentage,u=100-d):(u=50,d=50);const f=u+d;if(f<=0)return null;const h=u/f,x=d/f,g=f<100?f/100:1,y=h*l.a+x*c.a,v=(A,M)=>h*A*l.a+x*M*c.a,m=v(l.r,c.r),k=v(l.g,c.g),b=v(l.b,c.b),j=y===0?{r:0,g:0,b:0}:{r:m/y,g:k/y,b:b/y};return AI({...j,a:y*g})}function dy(e){const t=e.indexOf("color-mix(");if(t===-1)return e;const n=t+9,s=wj(e,n);if(s===-1)return e;const r=dy(e.slice(n+1,s)),o=lL(r)??`color-mix(${r})`;return e.slice(0,t)+o+dy(e.slice(s+1))}function fy(e,t,n,s){const r=e.indexOf("var(");if(r===-1)return e;const i=r+3,o=wj(e,i);if(o===-1)return e;const l=e.slice(i+1,o),c=m5(l),u=(c?c[0]:l).trim(),d=c?c[1]:null;let f;s.has(u)?f=e.slice(r,o+1):u in t?(s.add(u),f=jj(u,t,n,s),s.delete(u)):d!==null?f=fy(d.trim(),t,n,s):f=e.slice(r,o+1);const h=fy(e.slice(o+1),t,n,s);return e.slice(0,r)+f+h}function cL(e,t,n,s){if(!e.includes("var(")&&!e.includes("color-mix("))return e;const r=fy(e,t,n,s);return dy(r)}function jj(e,t,n,s){if(e in n)return n[e];const r=t[e];if(r===void 0)return"";const i=cL(r,t,n,s);return n[e]=i,i}function Eb(e){const t={};for(const n of Object.keys(e))jj(n,e,t,new Set);return t}function uL(e,t){const{mode:n}=t,s={};for(const[r,i]of Object.entries(bj))s[r]=km(i,n);if(e==null)return Eb(s);for(const[r,i]of Object.entries(e.tokens))s[r]=km(i,n);if(e.__inputTokens)for(const[r,i]of Object.entries(e.__inputTokens))i!==void 0&&(s[r]=km(i,n));return Eb(s)}function Pa(e,t=!1){const n=p.useCallback(i=>{const o=window.matchMedia(e);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[e]),s=p.useCallback(()=>window.matchMedia(e).matches,[e]),r=p.useCallback(()=>t,[t]);return p.useSyncExternalStore(n,s,r)}const ag=p.createContext(null);ag.displayName="ThemeContext";function dL(){if(typeof document>"u")return null;const e=document.documentElement.getAttribute("data-theme");return e==="light"||e==="dark"?e:null}function fL(){return null}function hL(){return typeof document>"u"?null:document.documentElement.getAttribute(zs("theme"))}function pL(){return null}function Sj(){return null}const hf=new Set;let Xd=null;const pf=new Set;let Zd=null;function xL(){for(const e of hf)e()}function gL(e){return hf.add(e),hf.size===1&&typeof MutationObserver<"u"&&(Xd=new MutationObserver(xL),Xd.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{hf.delete(e),hf.size===0&&Xd&&(Xd.disconnect(),Xd=null)}}function mL(){for(const e of pf)e()}function yL(e){return pf.add(e),pf.size===1&&typeof MutationObserver<"u"&&(Zd=new MutationObserver(mL),Zd.observe(document.documentElement,{attributes:!0,attributeFilter:[zs("theme")]})),()=>{pf.delete(e),pf.size===0&&Zd&&(Zd.disconnect(),Zd=null)}}function Cj(){return()=>{}}function vL(e){return p.useSyncExternalStore(e?Cj:gL,e?Sj:dL,fL)}function Ej(e){return p.useSyncExternalStore(e?Cj:yL,e?Sj:hL,pL)}function $j(){const e=p.use(ag),t=e!=null,n=Ej(t);return(e==null?void 0:e.theme.name)??n}function lg(){const e=p.use(ag),t=e!=null,n=vL(t),s=Ej(t),r=Pa("(prefers-color-scheme: dark)"),i=(e==null?void 0:e.mode)??n??"system",o=(e==null?void 0:e.theme)??mj(s),l=i==="system"?r?"dark":"light":i,c=p.useMemo(()=>uL(o,{mode:l}),[o,l]),u=d=>c[d]??"";return{name:(o==null?void 0:o.name)??"default",mode:l,token:u,tokens:c}}const kL="modulepreload",bL=function(e){return"/"+e},$b={},Aj=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=bL(c),c in $b)return;$b[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":kL,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,x)=>{f.addEventListener("load",h),f.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},y5={primary:{kMwMTN:"x1tgivj0",$$css:!0},secondary:{kMwMTN:"xv1l7n4",$$css:!0},disabled:{kMwMTN:"xnbbluu",$$css:!0},placeholder:{kMwMTN:"xv1l7n4",$$css:!0},accent:{kMwMTN:"xjse4m1",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}},wL={normal:{k63SB2:"x1sodnla",$$css:!0},medium:{k63SB2:"x1e4wzip",$$css:!0},semibold:{k63SB2:"x2mo6ok",$$css:!0},bold:{k63SB2:"x1lvx875",$$css:!0}},Mj={body:{k63SB2:"xxovm9e",$$css:!0},large:{k63SB2:"x149oux8",$$css:!0},label:{k63SB2:"xmhvcl5",$$css:!0},code:{k63SB2:"xx3eeay",$$css:!0},supporting:{k63SB2:"xv8on6e",$$css:!0},"display-1":{k63SB2:"x1txul5o",$$css:!0},"display-2":{k63SB2:"x1y36c3f",$$css:!0},"display-3":{k63SB2:"x1on40hk",$$css:!0},inherit:{k63SB2:"x1pd3egz",$$css:!0}},v5={body:{kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},large:{kGuDYH:"x18juvz8",kLWn49:"xf74fhv",$$css:!0},label:{kGuDYH:"xcr08ib",kLWn49:"x1kq96og",$$css:!0},code:{kGuDYH:"xp03k98",kLWn49:"x17iicif",kMv6JI:"x9m5x89",$$css:!0},supporting:{kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},"display-1":{kGuDYH:"xsub3ws",kLWn49:"x112ttwr",$$css:!0},"display-2":{kGuDYH:"x1yego12",kLWn49:"xh0iwvy",$$css:!0},"display-3":{kGuDYH:"xlgnzhf",kLWn49:"x1ujwuaq",$$css:!0},inherit:{kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",$$css:!0}},jL={"4xs":{kGuDYH:"xxc45ev",$$css:!0},"3xs":{kGuDYH:"x10p7juq",$$css:!0},"2xs":{kGuDYH:"x16a80zy",$$css:!0},xsm:{kGuDYH:"x51wmvv",$$css:!0},sm:{kGuDYH:"x1eqnyfr",$$css:!0},base:{kGuDYH:"x1j29vfg",$$css:!0},lg:{kGuDYH:"xc7cgfe",$$css:!0},xl:{kGuDYH:"x1wqms48",$$css:!0},"2xl":{kGuDYH:"xhs0kqb",$$css:!0},"3xl":{kGuDYH:"x10srzze",$$css:!0},"4xl":{kGuDYH:"xqcvi3d",$$css:!0}},SL={1:{kGuDYH:"xcg7oai",kLWn49:"xfmsba7",k63SB2:"x1v68xuy",$$css:!0},2:{kGuDYH:"x1xvnhcw",kLWn49:"x1cpk1wn",k63SB2:"x12yy4cs",$$css:!0},3:{kGuDYH:"xii13ha",kLWn49:"xwjzt0u",k63SB2:"x1jcxfy8",$$css:!0},4:{kGuDYH:"x8tkxat",kLWn49:"xqerer",k63SB2:"x2hcmsi",$$css:!0},5:{kGuDYH:"xsgqta0",kLWn49:"xo3gurs",k63SB2:"xno150v",$$css:!0},6:{kGuDYH:"xw5ohdf",kLWn49:"xeixjfn",k63SB2:"x1pw4frv",$$css:!0}},Tj={inline:{k1xSpc:"xt0psk2",$$css:!0},block:{k1xSpc:"x1lliihq",$$css:!0}},Up={singleLine:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",k1xSpc:"x1lliihq",$$css:!0},multiLine:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},zj={"break-word":{kTgw9:"x1lldw8n",kHjlTd:"x1mzt3pk",$$css:!0},"break-all":{kTgw9:"x1yn0g08",$$css:!0}},Nj={wrap:{kN2L0X:"xk4td0m",$$css:!0},nowrap:{kN2L0X:"xebhuq6",$$css:!0},balance:{kN2L0X:"x1w2vvpw",$$css:!0},pretty:{kN2L0X:"x1fzhlzt",$$css:!0}},_j={enabled:{kxwWH2:"x1b2iylo",kzeHkT:"xwgcxoh",k1xSpc:"x1lliihq",$$css:!0}},Rj={strikethrough:{kybGjl:"xmqliwb",$$css:!0}},CL={enabled:{kcqcaj:"xss6m8b",$$css:!0}},Ij={start:{k9WMMc:"x1yc453h",$$css:!0},center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},Lj={content:{ks0D6T:"xw5ewwj",kTgw9:"x13faqbe",$$css:!0}};function Oj(e){const{maxLines:t}=e,[n,s]=p.useState(!1),[r,i]=p.useState(""),o=p.useRef(null),l=p.useCallback(u=>{if(t===0){s(!1);return}if(i(u.textContent??""),t===1)s(u.scrollWidth>u.offsetWidth);else{let d=u.scrollHeight;try{const f=document.createRange();f.selectNodeContents(u),d=f.getBoundingClientRect().height,f.detach()}catch{}s(d>u.offsetHeight)}},[t]);return{ref:p.useCallback(u=>{o.current&&f5(o.current),o.current=u,u&&t>0?typeof ResizeObserver<"u"?d5(u,()=>{l(u)}):l(u):(s(!1),i(""))},[t,l]),isTruncated:n,fullText:r}}const EL=p.lazy(async()=>Aj(()=>Promise.resolve().then(()=>mS),void 0).then(e=>({default:e.Tooltip}))),$L={body:"primary",large:"primary",label:"primary",supporting:"secondary",code:"primary","display-1":"primary","display-2":"primary","display-3":"primary",inherit:"inherit"};function AL(e){return e in v5?e:"body"}function Dj(e){return e in y5?e:"primary"}function Y({type:e="body",size:t,color:n,weight:s,display:r="inline",maxLines:i=0,hasTruncateTooltip:o=!0,wordBreak:l,textWrap:c,justify:u="start",hasCapsize:d=!1,hasStrikethrough:f=!1,hasTabularNumbers:h=!1,xstyle:x,className:g,style:y,as:v="span",children:m,ref:k,...b}){const j=n??$L[e]??"primary",A=AL(e),M=Dj(j),E=l??(i===1?"break-all":"break-word"),z=i>0||d?"block":r,T=Oj({maxLines:i}),$=typeof o=="string"?o:"above",_=i>0&&o!==!1&&T.isTruncated,R=p.useRef(null),N=i>1?{WebkitLineClamp:i}:void 0;return a.jsxs(a.Fragment,{children:[a.jsx(v,{ref:Wt(k,T.ref,R),...ee(J("text",{type:e,size:t,color:j}),W(y5[M],v5[A],t&&jL[t],Mj[A],s&&wL[s],i===1?Up.singleLine:i>1?Up.multiLine:Tj[z],i>0&&zj[E],c&&Nj[c],u!=="start"&&Ij[u],d&&_j.enabled,f&&Rj.strikethrough,h&&CL.enabled,x),g,{...y,...N}),title:_?T.fullText:void 0,...b,children:m}),_&&a.jsx(p.Suspense,{fallback:null,children:a.jsx(EL,{anchorRef:R,content:a.jsx("span",{...W(Lj.content),children:T.fullText}),placement:$})})]})}Y.displayName="Text";const ML=.75,Ab=1.5,Mb={sm:{diameter:10,border:2},md:{diameter:14,border:3},lg:{diameter:18,border:3},xl:{diameter:28,border:4}},Tb={wrapper:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},spinner:{k1xSpc:"xwz0xwf",kgQiWS:"x1ku5rj1",kVQacm:"xb3r6kr",kXLuUW:"xxymvpz",$$css:!0}};function Jt({size:e="md",shade:t="default",label:n,xstyle:s,className:r,style:i,"aria-label":o,"data-testid":l,ref:c,...u}){const d=p.useRef(null),{tokens:f}=lg();p.useEffect(()=>{const j=d.current;if(j==null)return;const A=j.getContext("2d");if(!A)return;const{border:M,diameter:E}=Mb[e],z=window.devicePixelRatio||1,T=t==="inherit"?getComputedStyle(j).color:null,$=t==="inherit"?T:t==="onMedia"?f["--color-on-dark"]:t==="subtle"?f["--color-text-secondary"]:f["--color-accent"],_=t==="inherit"?T:t==="onMedia"?`${f["--color-on-dark"]}4D`:f["--color-track"],R=E+M*2,N=Math.round(R*z),H=N+N%2,B=H/R,I=E/2*B,L=M*B;j.height=j.width=H,j.style.width=j.style.height=R+"px",A.lineCap="round",A.lineWidth=L;const O=H/2;A.beginPath(),A.arc(O,O,I,0,2*Math.PI),A.strokeStyle=_,t==="inherit"&&(A.globalAlpha=.3),A.stroke(),A.globalAlpha=1,A.beginPath(),A.arc(O,O,I,Ab*Math.PI,(Ab+ML)%2*Math.PI),A.strokeStyle=$,A.stroke()},[t,e,f]);const{border:h,diameter:x}=Mb[e],g=x+h*2,y=n!=null,v=p.useId(),m=y&&typeof n=="string"&&o==null,k=o??(typeof n=="string"?n:void 0)??"Loading",b=a.jsx("span",{ref:y?void 0:c,role:"status","aria-label":m?void 0:k,"aria-labelledby":m?v:void 0,"data-testid":y?void 0:l,...y?{}:u,...ee(y?"":J("spinner",{size:e,shade:t}),W(Tb.spinner,!y&&s),y?void 0:r,{...y?{}:i,width:g,height:g}),children:a.jsx("canvas",{ref:d,className:"xlp1x4z x1lliihq x1so62im x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"})});return y?a.jsxs("div",{ref:c,"data-testid":l,...u,...ee(J("spinner",{size:e,shade:t}),W(Tb.wrapper,s),r,i),children:[b,typeof n=="string"?a.jsx(Y,{id:v,type:"body",weight:"bold",children:n}):n]}):b}Jt.displayName="Spinner";function qi({children:e,as:t="span",ref:n,...s}){return p.createElement(t,{ref:n,...s,className:"x10l6tqk x1i1rx1s xjm9jq1 xkdpibf x1717udv xb3r6kr xzpqnlu xuxw1ft xng3xce x13vifvy x1o0tod x47corl x87ps6o"},e)}qi.displayName="VisuallyHidden";const Fp="data-astryx-edge-comp",TL={keTefX:"x1kftj4p",k71WvV:"x92e2el",$$css:!0},zL={inset:e=>[TL,{"--x-126w13d":(t=>typeof t=="number"?t+"px":t??void 0)(`calc(-1 * ${e})`),"--x-4drmnv":(t=>typeof t=="number"?t+"px":t??void 0)(`calc(-1 * ${e})`)}]},k5=p.createContext(null);k5.displayName="SizeContext";function Ua(e,t="md"){const n=p.use(k5);return e??n??t}k5.Provider;const Bj=p.createContext(null);Bj.displayName="ButtonGroupContext";function NL(){return p.use(Bj)}const Hj=p.createContext(null);Hj.displayName="LinkContext";function _L(e){function t({href:n,ref:s,...r}){return p.createElement(e,{ref:s,href:n,to:n,...r})}return t.displayName=`LinkWithTo(${typeof e=="string"?e:e.displayName||e.name||"Component"})`,t}function Fa(e){const t=p.use(Hj),n=e??(t==null?void 0:t.component)??"a";return p.useMemo(()=>n==="a"?"a":_L(n),[n])}const b5=p.createContext({locale:"en",direction:"ltr",messages:{}});b5.displayName="InternationalizationContext";function RL(e){try{const t=new Intl.Locale(e),n=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;return(n==null?void 0:n.direction)==="rtl"?"rtl":"ltr"}catch{return"ltr"}}function w5({locale:e,messages:t,overrides:n,dir:s,children:r}){const i=s??RL(e),o=p.useMemo(()=>({locale:e,direction:i,messages:t??{},overrides:n}),[e,i,t,n]);return a.jsx(b5,{value:o,children:r})}w5.displayName="InternationalizationProvider";function bm(e,t){const n=t&&t.cache?t.cache:qL,s=t&&t.serializer?t.serializer:BL;return(t&&t.strategy?t.strategy:OL)(e,{cache:n,serializer:s})}function IL(e){return e==null||typeof e=="number"||typeof e=="boolean"}function LL(e,t,n,s){const r=IL(s)?s:n(s);let i=t.get(r);return typeof i>"u"&&(i=e.call(this,s),t.set(r,i)),i}function qj(e,t,n){const s=Array.prototype.slice.call(arguments,3),r=n(s);let i=t.get(r);return typeof i>"u"&&(i=e.apply(this,s),t.set(r,i)),i}function Pj(e,t,n,s,r){return n.bind(t,e,s,r)}function OL(e,t){const n=e.length===1?LL:qj;return Pj(e,this,n,t.cache.create(),t.serializer)}function DL(e,t){return Pj(e,this,qj,t.cache.create(),t.serializer)}const BL=function(){return JSON.stringify(arguments)};var HL=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}};const qL={create:function(){return new HL}},wm={variadic:DL},PL=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function UL(e){const t={};return e.replace(PL,n=>{const s=n.length;switch(n[0]){case"G":t.era=s===4?"long":s===5?"narrow":"short";break;case"y":t.year=s===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][s-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][s-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=s===4?"long":s===5?"narrow":"short";break;case"e":if(s<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-3];break;case"c":if(s<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-3];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][s-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][s-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][s-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][s-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][s-1];break;case"s":t.second=["numeric","2-digit"][s-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=s<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const FL=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function VL(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");const t=e.split(FL).filter(s=>s.length>0),n=[];for(const s of t){let r=s.split("/");if(r.length===0)throw new Error("Invalid number skeleton");const[i,...o]=r;for(const l of o)if(l.length===0)throw new Error("Invalid number skeleton");n.push({stem:i,options:o})}return n}function GL(e){return e.replace(/^(.*?)-/,"")}const zb=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Uj=/^(@+)?(\+|#+)?[rs]?$/g,WL=/(\*)(0+)|(#+)(0+)|(0+)/g,Fj=/^(0+)$/;function Nb(e){const t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Uj,function(n,s,r){return typeof r!="string"?(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length):r==="+"?t.minimumSignificantDigits=s.length:s[0]==="#"?t.maximumSignificantDigits=s.length:(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length+(typeof r=="string"?r.length:0)),""}),t}function Vj(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function KL(e){let t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){const n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Fj.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function _b(e){const t={},n=Vj(e);return n||t}function XL(e){let t={};for(const n of e){switch(n.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=n.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=GL(n.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...n.options.reduce((i,o)=>({...i,..._b(o)}),{})};continue;case"engineering":t={...t,notation:"engineering",...n.options.reduce((i,o)=>({...i,..._b(o)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(n.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(n.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(WL,function(i,o,l,c,u,d){if(o)t.minimumIntegerDigits=l.length;else{if(c&&u)throw new Error("We currently do not support maximum integer digits");if(d)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Fj.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(zb.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(zb,function(o,l,c,u,d,f){return c==="*"?t.minimumFractionDigits=l.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:d&&f?(t.minimumFractionDigits=d.length,t.maximumFractionDigits=d.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});const i=n.options[0];i==="w"?t={...t,trailingZeroDisplay:"stripIfInteger"}:i&&(t={...t,...Nb(i)});continue}if(Uj.test(n.stem)){t={...t,...Nb(n.stem)};continue}const s=Vj(n.stem);s&&(t={...t,...s});const r=KL(n.stem);r&&(t={...t,...r})}return t}let ZL=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});function Rb(e){return e.type===0}function YL(e){return e.type===1}function Gj(e){return e.type===2}function Wj(e){return e.type===3}function Kj(e){return e.type===4}function Xj(e){return e.type===5}function Zj(e){return e.type===6}function QL(e){return e.type===7}function Yj(e){return e.type===8}function Qj(e){return!!(e&&typeof e=="object"&&e.type===0)}function hy(e){return!!(e&&typeof e=="object"&&e.type===1)}const Jj=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Yd={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function JL(e,t){let n="";for(let s=0;s<e.length;s++){const r=e.charAt(s);if(r==="j"){let i=0;for(;s+1<e.length&&e.charAt(s+1)===r;)i++,s++;let o=1+(i&1),l=i<2?1:3+(i>>1),c="a",u=eO(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=c;for(;o-- >0;)n=u+n}else r==="J"?n+="H":n+=r}return n}function eO(e){var r,i;let t=e.hourCycle;if(t===void 0){const o=e;t=((r=o.getHourCycles)==null?void 0:r.call(o)[0])??((i=o.hourCycles)==null?void 0:i[0])}if(t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const n=e.language;let s;return n!=="root"&&(s=e.maximize().region),(Yd[`${n}-${s}`]||Yd[s||""]||Yd[n||""]||Yd[`${n}-001`]||Yd["001"])[0].charAt(0)}const tO=new RegExp(`^${Jj.source}*`),nO=new RegExp(`${Jj.source}*$`);function Ke(e,t){return{start:e,end:t}}const sO=!!Object.fromEntries,rO=!!String.prototype.trimStart,iO=!!String.prototype.trimEnd,Ib=sO?Object.fromEntries:function(t){const n={};for(const[s,r]of t)n[s]=r;return n},oO=rO?function(t){return t.trimStart()}:function(t){return t.replace(tO,"")},aO=iO?function(t){return t.trimEnd()}:function(t){return t.replace(nO,"")},Lb=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");function lO(e,t){return Lb.lastIndex=t,Lb.exec(e)[1]??""}function cO(e){if(e.length===0)return null;let t=1,n=1;for(let s=0;s<e.length;){const r=e.charCodeAt(s);switch(r){case 35:case 39:case 60:case 123:case 125:return null}if(r===10)t++,n=1,s++;else if(n++,r>=55296&&r<=56319&&s+1<e.length){const i=e.charCodeAt(s+1);s+=i>=56320&&i<=57343?2:1}else s++}return{offset:e.length,line:t,column:n}}var uO=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error("parser can only be used once");if(this.message.length>0){const e=this.message.charCodeAt(0);if(e!==35&&e!==39&&e!==60&&e!==123&&e!==125){const t=cO(this.message);if(t){const n=this.clonePosition();return this.position=t,{val:[{type:0,value:this.message,location:Ke(n,this.clonePosition())}],err:null}}}}return this.parseMessage(0,"",!1)}parseMessage(e,t,n){let s=[];for(;!this.isEOF();){const r=this.char();if(r===123){const i=this.parseArgument(e,n);if(i.err)return i;s.push(i.val)}else{if(r===125&&e>0)break;if(r===35&&(t==="plural"||t==="selectordinal")){const i=this.clonePosition();this.bump(),s.push({type:7,location:Ke(i,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,Ke(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&py(this.peek()||0)){const i=this.parseTag(e,t);if(i.err)return i;s.push(i.val)}else{const i=this.parseLiteral(e,t);if(i.err)return i;s.push(i.val)}}}return{val:s,err:null}}parseTag(e,t){const n=this.clonePosition();this.bump();const s=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:0,value:`<${s}/>`,location:Ke(n,this.clonePosition())},err:null};if(this.bumpIf(">")){const r=this.parseMessage(e+1,t,!0);if(r.err)return r;const i=r.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!py(this.char()))return this.error(23,Ke(o,this.clonePosition()));const l=this.clonePosition();return s!==this.parseTagName()?this.error(26,Ke(l,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:8,value:s,children:i,location:Ke(n,this.clonePosition())},err:null}:this.error(23,Ke(o,this.clonePosition())))}else return this.error(27,Ke(n,this.clonePosition()))}else return this.error(23,Ke(n,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&fO(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const n=this.clonePosition();let s="";for(;;){const i=this.tryParseQuote(t);if(i){s+=i;continue}const o=this.tryParseUnquoted(e,t);if(o){s+=o;continue}const l=this.tryParseLeftAngleBracket();if(l){s+=l;continue}break}const r=Ke(n,this.clonePosition());return{val:{type:0,value:s,location:r},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!dO(this.peek()||0))?(this.bump(),"<"):null}tryParseQuote(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){const n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(1,Ke(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,Ke(n,this.clonePosition()));let s=this.parseIdentifierIfPossible().value;if(!s)return this.error(3,Ke(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,Ke(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:s,location:Ke(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,Ke(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(3,Ke(n,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),n=lO(this.message,t),s=t+n.length;return this.bumpTo(s),{value:n,location:Ke(e,this.clonePosition())}}parseArgumentOptions(e,t,n,s){let r=this.clonePosition(),i=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(i){case"":return this.error(4,Ke(r,o));case"number":case"date":case"time":{this.bumpSpace();let l=null;if(this.bumpIf(",")){this.bumpSpace();const d=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;const h=aO(f.val);if(h.length===0)return this.error(6,Ke(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:Ke(d,this.clonePosition())}}const c=this.tryParseArgumentClose(s);if(c.err)return c;const u=Ke(s,this.clonePosition());if(l&&l.style.startsWith("::")){let d=oO(l.style.slice(2));if(i==="number"){const f=this.parseNumberSkeletonFromString(d,l.styleLocation);return f.err?f:{val:{type:2,value:n,location:u,style:f.val},err:null}}else{if(d.length===0)return this.error(10,u);let f=d;this.locale&&(f=JL(d,this.locale));const h={type:1,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?UL(f):{}};return{val:{type:i==="date"?3:4,value:n,location:u,style:h},err:null}}}return{val:{type:i==="number"?2:i==="date"?3:4,value:n,location:u,style:(l==null?void 0:l.style)??null},err:null}}case"plural":case"selectordinal":case"select":{const l=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(12,Ke(l,{...l}));this.bumpSpace();let c=this.parseIdentifierIfPossible(),u=0;if(i!=="select"&&c.value==="offset"){if(!this.bumpIf(":"))return this.error(13,Ke(this.clonePosition(),this.clonePosition()));this.bumpSpace();const x=this.tryParseDecimalInteger(13,14);if(x.err)return x;this.bumpSpace(),c=this.parseIdentifierIfPossible(),u=x.val}const d=this.tryParsePluralOrSelectOptions(e,i,t,c);if(d.err)return d;const f=this.tryParseArgumentClose(s);if(f.err)return f;const h=Ke(s,this.clonePosition());return i==="select"?{val:{type:5,value:n,options:Ib(d.val),location:h},err:null}:{val:{type:6,value:n,options:Ib(d.val),offset:u,pluralType:i==="plural"?"cardinal":"ordinal",location:h},err:null}}default:return this.error(5,Ke(r,o))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,Ke(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(11,Ke(n,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=VL(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?XL(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,s){let r=!1;const i=[],o=new Set;let{value:l,location:c}=s;for(;;){if(l.length===0){const h=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){const x=this.tryParseDecimalInteger(16,19);if(x.err)return x;c=Ke(h,this.clonePosition()),l=this.message.slice(h.offset,this.offset())}else break}if(o.has(l))return this.error(t==="select"?21:20,c);l==="other"&&(r=!0),this.bumpSpace();const u=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?17:18,Ke(this.clonePosition(),this.clonePosition()));const d=this.parseMessage(e+1,t,n);if(d.err)return d;const f=this.tryParseArgumentClose(u);if(f.err)return f;i.push([l,{value:d.val,location:Ke(u,this.clonePosition())}]),o.add(l),this.bumpSpace(),{value:l,location:c}=this.parseIdentifierIfPossible()}return i.length===0?this.error(t==="select"?15:16,Ke(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!r?this.error(22,Ke(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let n=1;const s=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);let r=!1,i=0;for(;!this.isEOF();){const l=this.char();if(l>=48&&l<=57)r=!0,i=i*10+(l-48),this.bump();else break}const o=Ke(s,this.clonePosition());return r?(i*=n,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,o)):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(t===void 0)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&hO(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function py(e){return e>=97&&e<=122||e>=65&&e<=90}function dO(e){return py(e)||e===47}function fO(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function hO(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function xy(e){e.forEach(t=>{if(delete t.location,Xj(t)||Zj(t))for(const n in t.options)delete t.options[n].location,xy(t.options[n].value);else Gj(t)&&Qj(t.style)||(Wj(t)||Kj(t))&&hy(t.style)?delete t.style.location:Yj(t)&&xy(t.children)})}function pO(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const n=new uO(e,t).parse();if(n.err){const s=SyntaxError(ZL[n.err.kind]);throw s.location=n.err.location,s.originalMessage=n.err.message,s}return t!=null&&t.captureLocation||xy(n.val),n.val}var cg=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},Ob=class extends cg{constructor(e,t,n,s){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join('", "')}"`,"INVALID_VALUE",s)}},xO=class extends cg{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,"INVALID_VALUE",n)}},gO=class extends cg{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,"MISSING_VALUE",t)}};function mO(e){return e.length<2?e:e.reduce((t,n)=>{const s=t[t.length-1];return!s||s.type!==0||n.type!==0?t.push(n):s.value+=n.value,t},[])}function yO(e){return typeof e=="function"}function O0(e,t,n,s,r,i,o){if(e.length===1&&Rb(e[0]))return[{type:0,value:e[0].value}];const l=[];for(const c of e){if(Rb(c)){l.push({type:0,value:c.value});continue}if(QL(c)){typeof i=="number"&&l.push({type:0,value:n.getNumberFormat(t).format(i)});continue}const{value:u}=c;if(!(r&&u in r))throw new gO(u,o);let d=r[u];if(YL(c)){(!d||typeof d=="string"||typeof d=="number"||typeof d=="bigint")&&(d=typeof d=="string"||typeof d=="number"||typeof d=="bigint"?String(d):""),l.push({type:typeof d=="string"?0:1,value:d});continue}if(Wj(c)){const f=typeof c.style=="string"?s.date[c.style]:hy(c.style)?c.style.parsedOptions:void 0;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(Kj(c)){const f=typeof c.style=="string"?s.time[c.style]:hy(c.style)?c.style.parsedOptions:s.time.medium;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(Gj(c)){const f=typeof c.style=="string"?s.number[c.style]:Qj(c.style)?c.style.parsedOptions:void 0;if(f&&f.scale){const h=f.scale||1;if(typeof d=="bigint"){if(!Number.isInteger(h))throw new TypeError(`Cannot apply fractional scale ${h} to bigint value. Scale must be an integer when formatting bigint.`);d=d*BigInt(h)}else d=d*h}l.push({type:0,value:n.getNumberFormat(t,f).format(d)});continue}if(Yj(c)){const{children:f,value:h}=c,x=r[h];if(!yO(x))throw new xO(h,"function",o);let g=x(O0(f,t,n,s,r,i).map(y=>y.value));Array.isArray(g)||(g=[g]),l.push(...g.map(y=>({type:typeof y=="string"?0:1,value:y})))}if(Xj(c)){const f=d,h=(Object.prototype.hasOwnProperty.call(c.options,f)?c.options[f]:void 0)||c.options.other;if(!h)throw new Ob(c.value,d,Object.keys(c.options),o);l.push(...O0(h.value,t,n,s,r));continue}if(Zj(c)){const f=`=${d}`;let h=Object.prototype.hasOwnProperty.call(c.options,f)?c.options[f]:void 0;if(!h){if(!Intl.PluralRules)throw new cg(`Intl.PluralRules is not available in this environment.
75
- Try polyfilling it using "@formatjs/intl-pluralrules"
76
- `,"MISSING_INTL_API",o);const g=typeof d=="bigint"?Number(d):d,y=n.getPluralRules(t,{type:c.pluralType}).select(g-(c.offset||0));h=(Object.prototype.hasOwnProperty.call(c.options,y)?c.options[y]:void 0)||c.options.other}if(!h)throw new Ob(c.value,d,Object.keys(c.options),o);const x=typeof d=="bigint"?Number(d):d;l.push(...O0(h.value,t,n,s,r,x-(c.offset||0)));continue}}return mO(l)}function vO(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,s)=>(n[s]={...e[s],...t[s]},n),{})}:e}function kO(e,t){return t?Object.keys(e).reduce((n,s)=>(n[s]=vO(e[s],t[s]),n),{...e}):e}function jm(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function bO(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:bm((...t)=>new Intl.NumberFormat(...t),{cache:jm(e.number),strategy:wm.variadic}),getDateTimeFormat:bm((...t)=>new Intl.DateTimeFormat(...t),{cache:jm(e.dateTime),strategy:wm.variadic}),getPluralRules:bm((...t)=>new Intl.PluralRules(...t),{cache:jm(e.pluralRules),strategy:wm.variadic})}}var Vn,wO=(Vn=class{constructor(t,n=Vn.defaultLocale,s,r){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=i=>{const o=this.formatToParts(i);if(o.length===1)return o[0].value;const l=o.reduce((c,u)=>(!c.length||u.type!==0||typeof c[c.length-1]!="string"?c.push(u.value):c[c.length-1]+=u.value,c),[]);return l.length<=1?l[0]||"":l},this.formatToParts=i=>O0(this.ast,this.locales,this.formatters,this.formats,i,void 0,this.message),this.resolvedOptions=()=>{var i;return{locale:((i=this.resolvedLocale)==null?void 0:i.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}},this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=Vn.resolveLocale(n),typeof t=="string"){if(this.message=t,!Vn.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...i}=r||{};this.ast=Vn.__parse(t,{...i,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=kO(Vn.formats,s),this.formatters=r&&r.formatters||bO(this.formatterCache)}static get defaultLocale(){return Vn.memoizedDefaultLocale||(Vn.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),Vn.memoizedDefaultLocale}},Vn.memoizedDefaultLocale=null,Vn.resolveLocale=t=>{if(typeof Intl.Locale>"u")return;const n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},Vn.__parse=pO,Vn.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},Vn),jO=wO;const SO={"@astryx.pagination.label":{defaultMessage:"Pagination",description:"Aria label for the pagination navigation region."},"@astryx.pagination.previous":{defaultMessage:"Go to previous page",description:"Aria label for the previous-page button."},"@astryx.pagination.next":{defaultMessage:"Go to next page",description:"Aria label for the next-page button."},"@astryx.pagination.previousBy":{defaultMessage:"Go back {step, number} {step, plural, one {page} other {pages}}",description:"Aria label for the previous button when it advances more than one page per click (the `step` prop > 1). `step` is the number of pages skipped."},"@astryx.pagination.nextBy":{defaultMessage:"Go forward {step, number} {step, plural, one {page} other {pages}}",description:"Aria label for the next button when it advances more than one page per click (the `step` prop > 1). `step` is the number of pages skipped."},"@astryx.pagination.first":{defaultMessage:"Go to first page",description:"Aria label for the first-page button (« double chevron) in the input pagination variant."},"@astryx.pagination.last":{defaultMessage:"Go to last page",description:"Aria label for the last-page button (» double chevron) in the input pagination variant."},"@astryx.pagination.goToPage":{defaultMessage:"Go to page {page, number}",description:"Aria label for an individual page-number button. `page` is 1-based."},"@astryx.pagination.goToPageInput":{defaultMessage:"Go to page",description:"Aria label for the editable page/row number box in the input pagination variant. No number — the box holds the value itself."},"@astryx.pagination.pageLabel":{defaultMessage:"Page",description:'Visible label before the editable box in the input pagination variant. Example: "Page [ 1 ] / 10".'},"@astryx.pagination.ofTotalPages":{defaultMessage:"/ {total, number}",description:'Visible total shown after the editable box in the input pagination variant. Example: the "/ 10" in "Page [ 1 ] / 10".'},"@astryx.pagination.pageIndicators":{defaultMessage:"Page indicators",description:"Aria label for the dots-variant page-indicator group."},"@astryx.pagination.itemsPerPage":{defaultMessage:"Items per page",description:"Label for the page-size selector."},"@astryx.pagination.count":{defaultMessage:"{from, number}–{to, number} of {total, number}",description:`Visible range-of-total text on a pagination bar. Example: "1–20 of 347"; the en-dash is translator's choice.`},"@astryx.pagination.pageOfTotal":{defaultMessage:"Page {current, number} of {total, number}",description:'Visible "Page X of Y" text on the compact pagination variant; also announced by screen readers. Keep short — sits in a compact toolbar.'},"@astryx.pagination.pageAnnounce":{defaultMessage:"Page {current, number}",description:"Screen-reader announcement when a page changes and total is unknown."},"@astryx.powersearch.editor.field":{defaultMessage:"Field",description:"Noun form-label above the field-picker dropdown in the PowerSearch filter-builder popover (which data column to filter on). Not an action."},"@astryx.powersearch.editor.operator":{defaultMessage:"Operator",description:'Noun form-label above the operator dropdown in the PowerSearch filter-builder popover. Refers to a comparison verb ("is", "contains"), not a math or phone operator.'},"@astryx.powersearch.editor.addFilter":{defaultMessage:"+ Add filter",description:'Button label inside a group in the PowerSearch filter-builder; adds another filter row (e.g. "Status = Active"). The leading "+ " is a plus-sign character.'},"@astryx.powersearch.editor.removeFilter":{defaultMessage:"Remove filter",description:'Screen-reader-only label on the "×" icon button next to a filter row in the PowerSearch editor; removes that row. Imperative verb.'},"@astryx.powersearch.editor.groupOperator":{defaultMessage:"Group operator",description:'Screen-reader-only label for the AND/OR toggle that combines sibling filters inside a filter group. Sighted users see just "AND" or "OR".'},"@astryx.powersearch.editor.group":{defaultMessage:"Group",description:'Fallback noun label shown on a nested filter-group chip when no AND/OR combining operator has been chosen. Use the noun ("a cluster"), not the verb "to group".'},"@astryx.powersearch.editor.delete":{defaultMessage:"Delete",description:"Button label inside the PowerSearch filter-editor popover; deletes the currently-edited filter row. Imperative verb form."},"@astryx.powersearch.editor.cancel":{defaultMessage:"Cancel",description:"Button label inside the PowerSearch filter-editor popover; closes the popover and discards pending edits. Imperative verb form."},"@astryx.powersearch.editor.apply":{defaultMessage:"Apply",description:'Primary button label inside the PowerSearch filter-editor popover; confirms the edited filter. Imperative verb; consumers may override to "Save".'},"@astryx.powersearch.valueEditor.value":{defaultMessage:"Value",description:'Noun form-label above a single free-text/number input in the PowerSearch value editor (e.g. the "acme" in `Name contains acme`). Not a verb or "worth".'},"@astryx.powersearch.valueEditor.values":{defaultMessage:"Values",description:"Plural noun form-label above a multi-value chip input in the PowerSearch value editor. Should match its singular counterpart `Value` in your language."},"@astryx.powersearch.valueEditor.time":{defaultMessage:"Time",description:"Noun form-label above a time-of-day (HH:MM) picker in the PowerSearch value editor. Clock time, not duration or era."},"@astryx.powersearch.valueEditor.date":{defaultMessage:"Date",description:"Noun form-label above a calendar-date picker in the PowerSearch value editor. Calendar date, not romantic date or fruit."},"@astryx.powersearch.valueEditor.relativeDate":{defaultMessage:"Relative date",description:'Label for the relative-date selector (e.g. "Last 7 days") in the PowerSearch value editor.'},"@astryx.powersearch.valueEditor.startDate":{defaultMessage:"Start date",description:"Noun form-label above the start-of-range date picker in the PowerSearch value editor. Pairs with `End date` — keep the two parallel in your language."},"@astryx.powersearch.valueEditor.endDate":{defaultMessage:"End date",description:"Noun form-label above the end-of-range date picker in the PowerSearch value editor. Pairs with `Start date` — keep the two parallel."},"@astryx.powersearch.valueEditor.entities":{defaultMessage:"Entities",description:'"Entities" is jargon — plural noun form-label above an entity picker (people, teams, projects). Prefer a natural collective like "items" if your language has no equivalent.'},"@astryx.powersearch.valueEditor.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input in the PowerSearch entity/typeahead picker. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.enterValuePlaceholder":{defaultMessage:"Enter value…",description:"Placeholder inside a free-text single-value input in the PowerSearch value editor. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.addValuesPlaceholder":{defaultMessage:"Add values…",description:"Placeholder inside a multi-value chip input where the user types items and presses Enter to add each as a chip. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.enterNumberPlaceholder":{defaultMessage:"Enter number…",description:"Placeholder inside a numeric input in the PowerSearch value editor. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.selectValuesPlaceholder":{defaultMessage:"Select values…",description:"Placeholder on a dropdown for choosing values from a fixed enum list in the PowerSearch value editor. Imperative verb (user selects, not types)."},"@astryx.powersearch.operator.contains":{defaultMessage:"contains",description:"PowerSearch string operator, rendered inline as `<field> contains <value>` (e.g. `Name contains acme`). Lowercase verb form."},"@astryx.powersearch.operator.notContains":{defaultMessage:"does not contain",description:"PowerSearch negated string operator. Example: `Name does not contain test`. Lowercase; pairs with `contains`."},"@astryx.powersearch.operator.startsWith":{defaultMessage:"starts with",description:"PowerSearch string prefix operator. Example: `Email starts with admin@`. Lowercase."},"@astryx.powersearch.operator.notStartsWith":{defaultMessage:"does not start with",description:"PowerSearch negated prefix operator. Example: `Email does not start with test`. Lowercase; pairs with `starts with`."},"@astryx.powersearch.operator.endsWith":{defaultMessage:"ends with",description:"PowerSearch string suffix operator. Example: `Email ends with @meta.com`. Lowercase."},"@astryx.powersearch.operator.notEndsWith":{defaultMessage:"does not end with",description:"PowerSearch negated suffix operator. Example: `Email does not end with @gmail.com`. Lowercase; pairs with `ends with`."},"@astryx.powersearch.operator.is":{defaultMessage:"is",description:"PowerSearch equality operator for strings/enums. Example: `Status is Active`. Separate from `operator.equals` (numbers) — translations may diverge."},"@astryx.powersearch.operator.isNot":{defaultMessage:"is not",description:"PowerSearch inequality operator for strings/enums. Example: `Status is not Draft`. Pairs with `is`; separate from `operator.notEquals`."},"@astryx.powersearch.operator.equals":{defaultMessage:"is",description:'PowerSearch numeric equality operator. Example: `Age is 30`. Ships same English "is" as `operator.is` but is separate so numbers may diverge (e.g. "equals").'},"@astryx.powersearch.operator.notEquals":{defaultMessage:"is not",description:"PowerSearch numeric inequality operator. Example: `Count is not 0`. Same divergence option as `operator.equals`."},"@astryx.powersearch.operator.greaterThan":{defaultMessage:"is greater than",description:"PowerSearch numeric operator, strictly greater than. Example: `Age is greater than 18`. Lowercase."},"@astryx.powersearch.operator.lessThan":{defaultMessage:"is less than",description:"PowerSearch numeric operator, strictly less than. Example: `Priority is less than 5`. Lowercase."},"@astryx.powersearch.operator.greaterThanOrEqual":{defaultMessage:"is greater than or equal to",description:'PowerSearch numeric operator, ≥. Example: `Age is greater than or equal to 21`. A shorter form (e.g. "≥") is fine if idiomatic.'},"@astryx.powersearch.operator.lessThanOrEqual":{defaultMessage:"is less than or equal to",description:"PowerSearch numeric operator, ≤. Example: `Priority is less than or equal to 3`. A shorter form is fine if idiomatic."},"@astryx.powersearch.operator.before":{defaultMessage:"is before",description:"PowerSearch date operator, strictly earlier. Example: `Created is before 2024-01-01`. Temporal, not spatial."},"@astryx.powersearch.operator.after":{defaultMessage:"is after",description:"PowerSearch date operator, strictly later. Example: `Updated is after 2024-06-01`. Temporal."},"@astryx.powersearch.operator.between":{defaultMessage:"is between",description:"PowerSearch date operator, inclusive range. Example: `Created is between 2024-01-01 and 2024-06-30`. The `and <end>` portion is composed separately."},"@astryx.powersearch.operator.isTrue":{defaultMessage:"is true",description:"PowerSearch boolean operator: matches truthy. Example: `Is admin is true`. Pairs with `is false`; field may be affirmative or a yes/no question."},"@astryx.powersearch.operator.isFalse":{defaultMessage:"is false",description:"PowerSearch boolean operator: matches falsy. Example: `Is admin is false`. Pairs with `is true`."},"@astryx.powersearch.operator.isAnyOf":{defaultMessage:"is any of",description:"PowerSearch list operator: value is in the set. Example: `Status is any of [Active, Paused, Draft]`. The value list is composed separately; pairs with `is none of`."},"@astryx.powersearch.operator.isNoneOf":{defaultMessage:"is none of",description:"PowerSearch negated list operator: value not in the set. Example: `Status is none of [Archived, Deleted]`. Pairs with `is any of`."},"@astryx.powersearch.valueEditor.itemsCount":{defaultMessage:"{count, number} {count, plural, one {item} other {items}}",description:"Overflow summary on a compact filter chip when the list of selected items is too long. Example: `3 items` or `1 item`."},"@astryx.powersearch.valueEditor.entitiesCount":{defaultMessage:"{count, number} {count, plural, one {entity} other {entities}}",description:"Overflow summary on a compact filter chip when the list of selected entities is too long. Example: `5 entities` or `1 entity`. Pair with `itemsCount` translation."},"@astryx.powersearch.valueEditor.dateRange":{defaultMessage:"date range",description:"Fallback lowercase noun rendered inline in a filter chip when a date-range value can't be formatted (e.g. `Created is between date range`). Keep lowercase."},"@astryx.powersearch.valueEditor.filtersCount":{defaultMessage:"{count, number} {count, plural, one {filter} other {filters}}",description:"Summary inside a filter chip when the value is a nested set of filters. Example: `3 filters` or `1 filter`."},"@astryx.powersearch.resultCount":{defaultMessage:"{count, number} {count, plural, one {result} other {results}}",description:"Live result-count text next to the PowerSearch input, announced to screen readers on change. Example: `12 results`, `1 result`; keep compact."},"@astryx.alertDialog.cancel":{defaultMessage:"Cancel",description:"Button label on the secondary/dismiss button of an AlertDialog (modal confirmation). Imperative verb; consumers usually override with task-specific text."},"@astryx.appShell.mobileNavigation":{defaultMessage:"Mobile navigation",description:'Screen-reader-only accessible name for the mobile-only navigation region on small viewports. "Mobile" = phone/tablet (small screen), not "movable".'},"@astryx.appShell.skipToContent":{defaultMessage:"Skip to content",description:"Text of the skip link — the first focusable element on the page, visible only while keyboard-focused. Activating it jumps focus past the navigation to the main content area. Imperative verb; keep short."},"@astryx.avatar.nameWithStatus":{defaultMessage:"{name}, {status}",description:`Screen-reader accessible name for an Avatar showing a status indicator; composes the person's name with the status label, e.g. "Jane Doe, Online". {name} = the avatar's name/alt text, {status} = the status dot's label. Adjust separator and order per locale.`},"@astryx.avatarGroup.label":{defaultMessage:"Avatars",description:'Screen-reader-only fallback name for a horizontal cluster of user avatar images. Plural noun; consumers usually override with "Team members", "Attendees", etc.'},"@astryx.avatarGroup.keyboardHint":{defaultMessage:"Use arrow keys to move between avatars",description:"Screen-reader-only instruction attached (via aria-describedby) to a group of interactive avatars that share a single Tab stop. Tells keyboard users the Left/Right arrow keys move focus between the avatars. Only announced when the group has interactive (link/button) avatars."},"@astryx.avatarGroup.overflow":{defaultMessage:"{count, number} more",description:'Accessible name for the "+N" overflow indicator at the end of an AvatarGroup — announces how many additional avatars are not shown. Example: `5 more`. The visible "+N" text is unaffected; this is the aria-label only.'},"@astryx.banner.dismiss":{defaultMessage:"Dismiss",description:'"Dismiss" = close/hide this notification (not "reject a person"). Aria label AND tooltip on the small X button on a Banner.'},"@astryx.calendar.previousMonth":{defaultMessage:"Previous month",description:"Screen-reader-only label on the left-arrow button in a Calendar's month header (navigates one month back). Pairs with `calendar.nextMonth`."},"@astryx.calendar.nextMonth":{defaultMessage:"Next month",description:"Screen-reader-only label on the right-arrow button in a Calendar's month header (navigates one month forward). Pairs with `calendar.previousMonth`."},"@astryx.calendar.daySelected":{defaultMessage:"{date}, selected",description:'Accessible name for the Calendar day button that is the current single-mode selection. `{date}` is the localized full date, e.g. "Thursday, January 15, 2026". The trailing state word tells screen-reader users the focused day is selected.'},"@astryx.calendar.dayRangeStart":{defaultMessage:"{date}, range start",description:"Accessible name for the Calendar day button that begins the selected date range (or the first pick of an in-progress range). `{date}` is the localized full date."},"@astryx.calendar.dayRangeEnd":{defaultMessage:"{date}, range end",description:"Accessible name for the Calendar day button that ends the selected date range. `{date}` is the localized full date. Pairs with `calendar.dayRangeStart`."},"@astryx.calendar.dayRangeStartAndEnd":{defaultMessage:"{date}, range start and range end",description:"Accessible name for a Calendar day button that both begins and ends a completed one-day range. `{date}` is the localized full date."},"@astryx.calendar.dayInRange":{defaultMessage:"{date}, in range",description:"Accessible name for a Calendar day button strictly inside the selected date range (not an endpoint). `{date}` is the localized full date."},"@astryx.calendar.rangeStartAnnounce":{defaultMessage:"Start date {date}. Select an end date.",description:"Screen-reader announcement after the first pick of a Calendar range selection. `{date}` is the localized full date. Prompts the user that a second pick completes the range."},"@astryx.calendar.rangeCompleteAnnounce":{defaultMessage:"Selected range: {start} to {end}.",description:"Screen-reader announcement after the second pick completes a Calendar range selection. `{start}` and `{end}` are localized full dates in chronological order."},"@astryx.carousel.label":{defaultMessage:"Carousel",description:'Screen-reader-only fallback name for a horizontally-scrolling row of items. If "carousel" is unfamiliar in your locale, prefer the standard term (e.g. "slider").'},"@astryx.carousel.scrollLeft":{defaultMessage:"Scroll left",description:"Screen-reader-only label on the left arrow button in a Carousel. Pairs with `carousel.scrollRight`; in RTL locales, coordinate the two so left/right match layout."},"@astryx.carousel.scrollRight":{defaultMessage:"Scroll right",description:"Screen-reader-only label on the right arrow button in a Carousel. Pairs with `carousel.scrollLeft`; same RTL note."},"@astryx.carousel.slideLabel":{defaultMessage:"Slide {current, number} of {total, number}",description:"Screen-reader accessible name for one slide in a Carousel, giving its position. `current` is the 1-based slide number; `total` is the slide count."},"@astryx.chat.status.sending":{defaultMessage:"Sending",description:"Chat send-status caption under an outgoing message while it is being transmitted. Part of the set sending → sent → delivered → read (or failed) — keep tense/aspect consistent."},"@astryx.chat.status.sent":{defaultMessage:"Sent",description:"Chat send-status caption shown once the message reaches the server. Part of the set sending → **sent** → delivered → read (or failed) — keep tense consistent."},"@astryx.chat.status.delivered":{defaultMessage:"Delivered",description:"Chat send-status caption shown once the recipient's device received the message. Part of the set sending → sent → **delivered** → read (or failed)."},"@astryx.chat.status.read":{defaultMessage:"Read",description:'Chat send-status caption shown once the recipient opened the message. English past-participle ("has been read", /rɛd/), not the present verb — part of the set sending → sent → delivered → **read**.'},"@astryx.chat.status.failed":{defaultMessage:"Failed",description:"Chat send-status caption shown when the send attempt errored. Part of the set — the terminal failure branch, orthogonal to the sent → delivered → read success track."},"@astryx.chat.messageAriaLabel":{defaultMessage:"Message {status}",description:"Screen-reader-only accessible name for a chat message row. `{status}` interpolates the localized status word (e.g. `Message sent`, `Message delivered`) — reorder if needed."},"@astryx.chat.pastedText.expand":{defaultMessage:"Expand",description:'Button label on a chip in the chat composer representing a long pasted text block; clicking reveals full content. "Expand" here means reveal more, not grow physically.'},"@astryx.checkboxList.item.checkbox":{defaultMessage:"Checkbox",description:"Screen-reader-only last-ditch fallback name for a checkbox inside a list item when no label is provided. Should almost never render — consumers should supply a real label."},"@astryx.commandPalette.emptySearch":{defaultMessage:"No results",description:"Fallback empty-state text inside a CommandPalette when the user's query has no matches. Very short (2 words); neutral tone."},"@astryx.commandPalette.emptyBootstrap":{defaultMessage:"Type to search",description:"Onboarding empty-state text shown inside a CommandPalette on first open, before the user has typed anything. Imperative sentence fragment."},"@astryx.commandPalette.resultCount":{defaultMessage:"{count, number} {count, plural, one {result} other {results}}",description:"Screen-reader-only announcement of how many commands match the CommandPalette query as the user types. Example: `12 results`, `1 result`; keep compact."},"@astryx.commandPalette.noResultsFor":{defaultMessage:"No results for {query}",description:"Screen-reader-only announcement when a CommandPalette query matches nothing. `{query}` is the user's verbatim search text; keep it last if your language allows so truncation-by-AT still conveys the outcome."},"@astryx.commandPalette.loading":{defaultMessage:"Loading",description:"Screen-reader-only announcement that a CommandPalette search has started and results are being fetched. Present-progressive form; matches the visible spinner."},"@astryx.dateRangeInput.presetDateRanges":{defaultMessage:"Preset date ranges",description:'Screen-reader-only accessible name for the sidebar of quick-pick preset ranges inside a DateRangeInput popover (e.g. "Last 7 days", "This month").'},"@astryx.dateTimeInput.timePlaceholder":{defaultMessage:"Select a time",description:'Grey placeholder inside the empty time-of-day slot in a DateTimeInput. "Time" = clock time (HH:MM), not duration.'},"@astryx.dialog.close":{defaultMessage:"Close",description:'"Close" = shut/dismiss the dialog, not "nearby" (English homograph). Aria label AND tooltip on the X at the top-right of a Dialog.'},"@astryx.dropdownMenu.label":{defaultMessage:"Menu",description:'Screen-reader-only fallback name for a dropdown menu popover. Very generic; consumers usually override. Noun ("a menu"), not the imperative.'},"@astryx.lightbox.close":{defaultMessage:"Close",description:'"Close" = shut/dismiss (not "nearby"). Screen-reader-only label on the X button that dismisses a Lightbox.'},"@astryx.lightbox.previous":{defaultMessage:"Previous",description:"Screen-reader-only label on the left-arrow button in a Lightbox (navigates to previous media item). Pairs with `lightbox.next`."},"@astryx.lightbox.next":{defaultMessage:"Next",description:"Screen-reader-only label on the right-arrow button in a Lightbox (navigates to next media item). Pairs with `lightbox.previous`."},"@astryx.markdown.taskList":{defaultMessage:"Task list",description:"Screen-reader-only accessible name for a GitHub-flavored Markdown task list (rendered from `- [ ] item` / `- [x] done` syntax)."},"@astryx.markdown.table":{defaultMessage:"Table",description:'Screen-reader-only accessible name for a table rendered inside a Markdown block. Noun ("a table"), not the verb. Separate from `@astryx.table.label` — translations may diverge.'},"@astryx.mobileNav.closeNavigation":{defaultMessage:"Close navigation",description:"Screen-reader-only label on the X/close button that dismisses the MobileNav overlay. Pairs with `mobileNav.toggle.open`."},"@astryx.multiSelector.selectAll":{defaultMessage:"Select all",description:'Label on the checkbox/toggle at the top of a MultiSelector dropdown that selects every option. "All" is a determiner here (as in "all the options"), not the pronoun.'},"@astryx.multiSelector.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input at the top of a MultiSelector's dropdown panel. Imperative verb; trailing `…` is one character."},"@astryx.multiSelector.searchOptions":{defaultMessage:"Search options",description:"Screen-reader-only accessible name for that same search input inside a MultiSelector."},"@astryx.multiSelector.selectAllPartiallySelected":{defaultMessage:"{label}, partially selected",description:'Accessible name for the MultiSelector select-all option while only some options are selected. `{label}` is the visible select-all label (e.g. "Select all"). ARIA forbids aria-selected="mixed" on options, so the indeterminate state is conveyed through the name instead. "Partially" = some but not all.'},"@astryx.popover.close":{defaultMessage:"Close popover",description:'"Close" = shut/dismiss, not "nearby". Screen-reader-only label on the close button inside a Popover.'},"@astryx.selector.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input at the top of a Selector's dropdown panel (for filtering options). Imperative verb; trailing `…` is one character."},"@astryx.selector.searchOptions":{defaultMessage:"Search options",description:'"Options" = the list of choices in the dropdown. Screen-reader-only accessible name for the search input inside a Selector.'},"@astryx.sideNav.label":{defaultMessage:"Side navigation",description:"Screen-reader-only accessible name for the primary vertical sidebar nav (usually on the left)."},"@astryx.sideNav.resizeSidebar":{defaultMessage:"Resize sidebar",description:"Screen-reader-only label on the vertical drag handle at the right edge of the SideNav that lets the user resize the sidebar's width."},"@astryx.sideNav.heading.openMenu":{defaultMessage:"Open menu",description:"Screen-reader-only label on the `⋯` overflow-menu button embedded in a SideNav section heading. Same string as `topNav.heading.openMenu` — translations may share."},"@astryx.tabList.label":{defaultMessage:"Tabs",description:'Screen-reader-only fallback name for a horizontal tab bar. Plural noun; "Tabs" here = UI tab panels, not browser tabs or the Tab key.'},"@astryx.table.label":{defaultMessage:"Table",description:'Fallback screen-reader-only accessible name for a data-table region when the consumer provides none. Noun ("a table"), not the verb "to table".'},"@astryx.table.noData":{defaultMessage:"No data",description:'Fallback empty-state text in the table body when there are zero rows. Neutral tone (not error-y); consumers commonly override with something specific like "No results".'},"@astryx.table.filter.allPlaceholder":{defaultMessage:"All",description:'Placeholder on a per-column filter dropdown when nothing is selected, meaning "no filter — all rows match". Determiner form (as in "all values"), not the pronoun.'},"@astryx.table.filter.reset":{defaultMessage:"Reset",description:"Button label inside a table's filter panel/popover; clears pending filter values back to defaults. Imperative verb."},"@astryx.table.filter.apply":{defaultMessage:"Apply",description:"Primary button label inside a table's filter panel/popover; commits pending filter values. Imperative verb; pairs with `Reset`."},"@astryx.table.selection.selectAllRows":{defaultMessage:"Select all rows",description:'Aria label for the "select all rows" checkbox in a Table header.'},"@astryx.table.selection.selectRow":{defaultMessage:"Select row",description:'Aria label for the "select row" checkbox on a Table row.'},"@astryx.table.selection.selectRowNamed":{defaultMessage:"Select {label}",description:"Aria label for a Table row's selection checkbox when a per-row label is available (via getRowLabel). `label` is the row's human-readable identity, e.g. \"Alice\"."},"@astryx.table.sort.ascending":{defaultMessage:"Sort ascending",description:"Screen-reader-only label on a column header button that will sort the column ascending. Part of a set with `sort.descending` and `sort.clear` — keep parallel."},"@astryx.table.sort.descending":{defaultMessage:"Sort descending",description:"Screen-reader-only label on a column header button that will sort the column descending. Part of a set with `sort.ascending` and `sort.clear`."},"@astryx.table.sort.clear":{defaultMessage:"Clear sort",description:'Screen-reader-only label on a column header button that will remove the current sort. "Clear" here means remove, not transparent. Part of the sort set.'},"@astryx.table.sort.direction.ascending":{defaultMessage:"ascending",description:"Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."},"@astryx.table.sort.direction.descending":{defaultMessage:"descending",description:"Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."},"@astryx.table.sort.sortBy":{defaultMessage:"Sort by {label}",description:"Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."},"@astryx.table.sort.sortedBy":{defaultMessage:"Sort by {label}, sorted {direction}",description:"Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."},"@astryx.table.sort.sortedByWithPriority":{defaultMessage:"Sort by {label}, sorted {direction}, priority {rank, number} of {total, number}",description:"Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."},"@astryx.toast.dismiss":{defaultMessage:"Dismiss notification",description:"Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."},"@astryx.toast.viewport":{defaultMessage:"Notifications",description:"Screen-reader-only accessible name for the invisible landmark region hosting the stack of Toast popups (usually pinned to a screen corner)."},"@astryx.tokenizer.clearAll":{defaultMessage:"Clear all",description:'Label on the "×" button that removes every token/chip from a Tokenizer input. Imperative verb + determiner "all"; short.'},"@astryx.topNav.heading.openMenu":{defaultMessage:"Open menu",description:"Screen-reader-only label on the `⋯` overflow button in a TopNav section heading. Kept separate from `sideNav.heading.openMenu` so translations may diverge."},"@astryx.topNav.landmarkLabel":{defaultMessage:"Top navigation",description:"Default accessible name (aria-label) for the <nav> landmark rendered by TopNav when no label is provided."},"@astryx.treeList.toggleChildren":{defaultMessage:"Toggle children",description:'"Children" = child nodes in the tree, not human children. Screen-reader-only label on the chevron next to a TreeList item that has children — toggles the sub-list.'},"@astryx.typeahead.emptySearchResults":{defaultMessage:"No results found",description:"Fallback empty-state message inside a Typeahead's suggestion popover when the current query has no matches. Neutral tone (not error-y)."},"@astryx.typeahead.loading":{defaultMessage:"Loading",description:"Screen-reader-only name for a spinner shown inside a Typeahead dropdown while suggestions are being fetched. Present-progressive form."},"@astryx.typeahead.searchResults":{defaultMessage:"Search results",description:"Screen-reader-only accessible name for the list of suggestions inside a Typeahead dropdown."},"@astryx.typeahead.clearSelection":{defaultMessage:"Clear selection",description:'"Selection" = the chosen value (not highlighted text). Screen-reader-only label on the X that clears the currently-selected value from a Typeahead.'},"@astryx.breadcrumbs.label":{defaultMessage:"Breadcrumb",description:"Screen-reader-only fallback name for the breadcrumb trail (e.g. `Home > Section > Page`). Singular in English per ARIA convention; plural is fine if natural in your locale."},"@astryx.chat.composer.placeholder":{defaultMessage:"Type a message…",description:"Grey placeholder text inside the empty chat composer textarea. Imperative verb; trailing `…` is one character."},"@astryx.chat.composerDrawer.label":{defaultMessage:"Items",description:'Fallback aria label for the ChatComposerDrawer — a horizontal list of attachment/tool chips. Consumers usually override with "Attachments", "Tools", etc.'},"@astryx.chat.composerInput.label":{defaultMessage:"Message input",description:'Screen-reader-only accessible name for the chat composer textarea. Reorder freely if your language uses one word for "message field".'},"@astryx.chat.speechRecognition.noSpeechDetected":{defaultMessage:"No speech was detected.",description:"Full-sentence error shown inline in the chat composer after voice input captured silence. Soft-error tone (not alarming); keep terminal period."},"@astryx.commandPalette.label":{defaultMessage:"Command palette",description:'Screen-reader-only fallback name for a keyboard-driven command menu (usually opened with Cmd/Ctrl-K). If unfamiliar, prefer a natural equivalent like "quick actions".'},"@astryx.commandPalette.input.placeholder":{defaultMessage:"Search…",description:"Grey placeholder inside the CommandPalette's search input. Imperative verb; trailing `…` is one character."},"@astryx.commandPalette.list.label":{defaultMessage:"Commands",description:'"Command" = an app action a user can invoke (metaphor from CLI), not a Unix command. Screen-reader-only name for the matching-commands list.'},"@astryx.contextMenu.label":{defaultMessage:"Context menu",description:'Screen-reader-only fallback name for the right-click / long-press popup menu. "Context" = context-specific to the activated element, not linguistic context.'},"@astryx.dateInput.placeholder":{defaultMessage:"Select a date",description:'Grey placeholder inside an empty DateInput field. "Date" = calendar date, not romantic or fruit. Imperative verb.'},"@astryx.dateInput.dialogLabel":{defaultMessage:"Choose date",description:"Screen-reader-only accessible name for the popover dialog opened from a DateInput's calendar toggle. Imperative verb + noun."},"@astryx.dateInput.closeCalendar":{defaultMessage:"Close calendar",description:"Screen-reader-only label on the X inside the DateInput calendar popover (dismisses the popover). Distinct from `dateInput.toggleCalendarClose`, which labels the outer toggle."},"@astryx.dateInput.openCalendar":{defaultMessage:"Open calendar",description:"Aria label for the DateInput / DateRangeInput / DateTimeInput calendar toggle button when the popover is closed."},"@astryx.dateInput.toggleCalendarClose":{defaultMessage:"Close calendar",description:"Aria label for the DateInput / DateRangeInput / DateTimeInput calendar toggle button when the popover is open. Distinct from closeCalendar (which labels the X inside the popover) so translators can differentiate the toggle vs the close-X UI."},"@astryx.dateInput.clear":{defaultMessage:"Clear {label}",description:"Aria label for the clear-value button in DateInput / DateRangeInput / DateTimeInput. `{label}` is the field's own label so screen readers announce e.g. 'Clear Start date'."},"@astryx.dateTimeInput.timeSuffix":{defaultMessage:"{label} time",description:'Screen-reader-only accessible name for the time-of-day slot in a DateTimeInput. Example: `Start date time`; reorder freely (e.g. "time of {label}").'},"@astryx.dateRangeInput.placeholder":{defaultMessage:"Select date range",description:"Grey placeholder inside an empty DateRangeInput field. Represents picking a start–end date pair. Imperative verb."},"@astryx.dateRangeInput.dialogLabel":{defaultMessage:"Choose date range",description:"Screen-reader-only accessible name for the popover dialog opened from a DateRangeInput. Imperative verb + noun phrase."},"@astryx.dateTimeInput.placeholder":{defaultMessage:"Select a date",description:'Grey placeholder inside an empty DateTimeInput field. Note: the English says only "date" though the field is date+time — do not add "and time" unless natural.'},"@astryx.dateTimeInput.dialogLabel":{defaultMessage:"Choose date",description:`Screen-reader-only accessible name for the DateTimeInput picker dialog. Same English-only "date" phrasing as the placeholder — don't add "and time" unless natural.`},"@astryx.link.newTab":{defaultMessage:"(opens in new tab)",description:"Visually-hidden (screen-reader-only) suffix appended to a Link's accessible name when it opens in a new tab. Example: `Documentation (opens in new tab)`."},"@astryx.mobileNav.toggle.open":{defaultMessage:"Open navigation",description:"Screen-reader-only label on the hamburger button that opens the MobileNav overlay (rendered when the overlay is closed). Pairs with `mobileNav.closeNavigation`."},"@astryx.moreMenu.label":{defaultMessage:"More options",description:"Screen-reader-only name for the small `⋯` (three-dots) overflow button that opens a menu of additional actions. Very short — sits on a tiny icon button."},"@astryx.multiSelector.selectPlaceholder":{defaultMessage:"Select…",description:'Placeholder on an empty MultiSelector trigger button. Same English as `selector.placeholder` but a separate key — plural phrasing like "Choose items…" is fine.'},"@astryx.outline.label":{defaultMessage:"Table of contents",description:"Screen-reader-only fallback name for a page's outline / table-of-contents sidebar (list of in-page headings). Rendered as `aria-label` on a `<nav>` landmark."},"@astryx.powersearch.label":{defaultMessage:"Search",description:"Screen-reader-only accessible name for the PowerSearch input (a filter-builder). The visible placeholder is separate; noun form often reads better than the verb."},"@astryx.powersearch.placeholder":{defaultMessage:"Search…",description:"Grey placeholder text inside the empty PowerSearch input. Imperative verb; trailing `…` is one character."},"@astryx.resizable.collapsed":{defaultMessage:"Collapsed",description:"aria-valuetext for the Resizable drag handle (role=separator) while its panel is collapsed to zero size. Replaces the numeric value announcement, since the numeric value is clamped to the minimum while collapsed. Adjective describing the panel state, not a verb/command."},"@astryx.resizable.handle.label":{defaultMessage:"Resize handle",description:"Screen-reader-only accessible name for the small draggable divider between two Resizable panels (users drag it to change the split ratio)."},"@astryx.selector.placeholder":{defaultMessage:"Select…",description:"Placeholder text on an empty Selector trigger button (a dropdown). Imperative verb; trailing `…` is one character. Very short — appears on the button face."},"@astryx.sideNav.heading.dialogLabel":{defaultMessage:"Navigation menu",description:"Screen-reader-only accessible name for the dropdown dialog opened from a SideNavHeading's overflow menu."},"@astryx.table.pagination.label":{defaultMessage:"Table pagination",description:"Screen-reader-only accessible name for the pagination `<nav>` appended below a data table. Kept separate from `@astryx.pagination.label` so translations may diverge."},"@astryx.timeInput.placeholder":{defaultMessage:"Select a time",description:'"Time" = clock time (HH:MM), not duration or era. Grey placeholder inside an empty TimeInput field; imperative verb.'},"@astryx.topNav.heading.dialogLabel":{defaultMessage:"Navigation menu",description:"Screen-reader-only accessible name for the dropdown dialog opened from a TopNavHeading's overflow menu. Kept separate from the SideNav sibling."},"@astryx.typeahead.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside an empty Typeahead input (a search field that suggests results as the user types). Imperative verb; trailing `…` is one character."},"@astryx.banner.collapse":{defaultMessage:"Collapse",description:'"Collapse" = fold up, not crumble. Aria label AND tooltip on the Banner expand/collapse toggle when currently expanded. Pairs with `banner.expand`.'},"@astryx.banner.expand":{defaultMessage:"Expand",description:'"Expand" = reveal more, not grow physically. Aria label AND tooltip on the same toggle when currently collapsed. Pairs with `banner.collapse`.'},"@astryx.button.loading":{defaultMessage:"Loading",description:'Screen-reader-only live-region announcement while a Button is in its loading state (spinner shown, action in flight). Progressive sense ("work in progress"), not a noun. Kept separate from `typeahead.loading` — translations may diverge.'},"@astryx.chatComposerDrawer.expand":{defaultMessage:"Expand {label}",description:"Screen-reader-only label on the ChatComposerDrawer toggle when the drawer is collapsed. `{label}` is the drawer's visible name — example: `Expand Attachments`. Pairs with `collapse`."},"@astryx.chatComposerDrawer.collapse":{defaultMessage:"Collapse {label}",description:"Screen-reader-only label on the ChatComposerDrawer toggle when the drawer is expanded. Example: `Collapse Attachments`. Pairs with `expand`."},"@astryx.chatDictationButton.startDictation":{defaultMessage:"Start dictation",description:"Accessible label for the microphone button when idle (not listening)."},"@astryx.chatDictationButton.stopDictation":{defaultMessage:"Stop dictation",description:"Accessible label for the microphone button when actively listening."},"@astryx.chatLayout.newMessages":{defaultMessage:"New messages",description:"Text on a floating pill at the bottom of a chat viewport when unseen messages arrive below the fold; clicking scrolls to bottom. Keep short — narrow pill."},"@astryx.chatLayoutScrollButton.scrollToBottom":{defaultMessage:"Scroll to bottom",description:"Visible tooltip AND screen-reader label for a small down-arrow button that scrolls the chat viewport to its latest message."},"@astryx.chatMessage.messageFrom":{defaultMessage:"Message from {sender}",description:"Screen-reader-only accessible name for a chat message when the sender name isn't visible. Example: `Message from Sarah`, `Message from Bot` — reorder freely."},"@astryx.chatSendButton.stop":{defaultMessage:"Stop",description:"Button label that replaces `Send` on the chat send button while an AI response is streaming; clicking aborts generation. Short — appears on a small button."},"@astryx.chatSendButton.send":{defaultMessage:"Send",description:"Primary button label on the chat submit button (paperplane icon). Imperative verb; pairs with `Stop`. Very short."},"@astryx.chatToolCalls.error":{defaultMessage:"Error: {message}",description:"Screen-reader text for a tool call that failed. {message} is the error detail."},"@astryx.chatToolCalls.groupLabel":{defaultMessage:"{count} tool calls",description:"Summary label shown in the group header when multiple tool calls are expanded. {count} is the number of calls."},"@astryx.chatTriggerMenu.suggestions":{defaultMessage:"Suggestions",description:"Screen-reader-only fallback label for the popover listbox opened by a trigger character (`@`, `/`) in the chat composer when the trigger provides no specific label."},"@astryx.citation.label":{defaultMessage:"Citation {number}: {title}",description:"Screen-reader-only accessible name for a Citation chip (a small numbered link to a source). Example: `Citation 1: OpenAI research paper`. Reorder freely."},"@astryx.codeBlock.copied":{defaultMessage:"Copied",description:'Screen-reader-only label on the CodeBlock copy button for ~2s after a successful copy. Past-participle ("has been copied"); pairs with `codeBlock.copyCode`.'},"@astryx.codeBlock.copyCode":{defaultMessage:"Copy code",description:'"Code" = source code. Aria label AND tooltip on the CodeBlock copy button in its default state. Pairs with `codeBlock.copied` (post-click state).'},"@astryx.codeBlock.code":{defaultMessage:"Code",description:`Screen-reader-only fallback name for a code-snippet scroll container when the code's language is unknown. "Code" = source code, not secret code or code of conduct.`},"@astryx.field.optional":{defaultMessage:"Optional",description:"Visible indicator shown next to a form field's label when the field is optional (isOptional). Mutually exclusive with the required indicator. Very short — appears inline after the label text."},"@astryx.field.required":{defaultMessage:"Required",description:"Visible indicator shown next to a form field's label when the field must be filled in (isRequired). Mutually exclusive with the optional indicator. Very short — appears inline after the label text."},"@astryx.fileInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that removes the selected file from a FileInput. Example: `Clear Attachment`, `Clear Résumé`."},"@astryx.fileInput.required":{defaultMessage:"Required",description:'Screen-reader-only description on the FileInput trigger indicating the field must be filled in. Mirrors the visible `Required` indicator next to the field label; conveyed via description because aria-required is not supported on role="button".'},"@astryx.fileInput.triggerWithFiles":{defaultMessage:"{label}, {fileNames}",description:"Accessible name for a FileInput trigger that has files attached, composing the field label with the selected filenames. Example: `Attachments, report.pdf, notes.txt`."},"@astryx.keyboardHint.toNavigate":{defaultMessage:"to navigate",description:"Trailing text in the keyboard-hint badge, shown after arrow-key icons — reads as `← → to navigate`. Lowercase sentence fragment completing the visual phrase; the badge is aria-hidden, so this is for sighted users only."},"@astryx.lightbox.mediaViewer":{defaultMessage:"Media viewer",description:"Screen-reader-only fallback name for the Lightbox dialog when the current media item has no alt text. Should rarely render — consumers should provide alt."},"@astryx.lightbox.zoom":{defaultMessage:"Zoom",description:'Screen-reader-only label on the Lightbox image acting as a zoom toggle button (aria-pressed reflects zoomed state). Verb ("to zoom"), very short.'},"@astryx.lightbox.zoomedIn":{defaultMessage:"Zoomed in, use arrow keys to pan",description:"Polite screen-reader announcement after zooming into a Lightbox image, including a hint that arrow keys pan while zoomed. Pairs with `lightbox.zoomedOut`."},"@astryx.lightbox.zoomedOut":{defaultMessage:"Zoomed out",description:"Polite screen-reader announcement after zooming back out of a Lightbox image. Pairs with `lightbox.zoomedIn`."},"@astryx.metadataList.showMore":{defaultMessage:"Show more",description:"Button label under a MetadataList that reveals items hidden beyond the configured maximum. Toggles with `metadataList.showLess` — keep the pair parallel in your language."},"@astryx.metadataList.showLess":{defaultMessage:"Show less",description:"Button label under a MetadataList that re-hides the extra items revealed by `metadataList.showMore`. Keep the pair parallel."},"@astryx.mobileNav.navigation":{defaultMessage:"Navigation",description:"Screen-reader-only fallback name for the MobileNav overlay dialog when no explicit label was passed."},"@astryx.multiSelector.clearAll":{defaultMessage:"Clear all {label}",description:"Screen-reader-only label on the X that clears every selected value from a MultiSelector. Example: `Clear all Countries`. `{label}` is typically already plural in English."},"@astryx.input.statusButton.error":{defaultMessage:"Error details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is error. Activating or focusing the button reveals the error message in a tooltip. Keep it short — it labels an icon-only button."},"@astryx.input.statusButton.warning":{defaultMessage:"Warning details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is warning. Activating or focusing the button reveals the warning message in a tooltip."},"@astryx.input.statusButton.success":{defaultMessage:"Success details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is success. Activating or focusing the button reveals the success message in a tooltip."},"@astryx.numberInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a NumberInput. Example: `Clear Age`, `Clear Quantity`."},"@astryx.selector.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the selected value from a Selector. `{label}` is the selector's visible label — example: `Clear Country`."},"@astryx.sideNavCollapseButton.expandSidebar":{defaultMessage:"Expand sidebar",description:"Aria label AND tooltip on the SideNav collapse/expand toggle when the sidebar is currently collapsed (clicking expands it). Pairs with `collapseSidebar`."},"@astryx.sideNavCollapseButton.collapseSidebar":{defaultMessage:"Collapse sidebar",description:"Aria label AND tooltip on the same toggle when the sidebar is currently expanded (clicking collapses it). Pairs with `expandSidebar`."},"@astryx.sideNavItem.expand":{defaultMessage:"Expand {label}",description:"Screen-reader-only label on the chevron next to a SideNav item with children when the group is collapsed. Example: `Expand Settings`. Pairs with `sideNavItem.collapse`."},"@astryx.sideNavItem.collapse":{defaultMessage:"Collapse {label}",description:"Screen-reader-only label on the same chevron when the group is expanded. Example: `Collapse Settings`. Pairs with `sideNavItem.expand`."},"@astryx.tableFiltering.filterByColumn":{defaultMessage:"Filter {header}",description:"Triple-use string on per-column filter controls: visible label, placeholder, AND aria label. `{header}` is the column header — example: `Filter Name`. Keep short."},"@astryx.tableGroupedRows.expandGroup":{defaultMessage:"Expand group {groupKey}",description:"Screen-reader-only label on the chevron next to a grouped table's group header when collapsed. Example: `Expand group Q1 2024`. Pairs with `collapseGroup`."},"@astryx.tableGroupedRows.collapseGroup":{defaultMessage:"Collapse group {groupKey}",description:"Screen-reader-only label on the same chevron when the group is expanded. Example: `Collapse group Q1 2024`. Pairs with `expandGroup`."},"@astryx.tableRowExpansion.collapseRow":{defaultMessage:"Collapse row",description:"Screen-reader-only label on the row-expand chevron when the row is currently expanded. Part of the four-way expand/collapse set."},"@astryx.tableRowExpansion.expandRow":{defaultMessage:"Expand row",description:"Screen-reader-only label on the row-expand chevron when the row is currently collapsed. Part of a four-way set with `collapseRow`, `expandAllRows`, `collapseAllRows`."},"@astryx.tableRowExpansion.collapseAllRows":{defaultMessage:"Collapse all rows",description:"Screen-reader-only label on the same header button when every row is expanded. Part of the four-way set."},"@astryx.tableRowExpansion.expandAllRows":{defaultMessage:"Expand all rows",description:"Screen-reader-only label on the header expand-all/collapse-all button when at least one row is collapsed (clicking expands every expandable row). Part of the four-way set."},"@astryx.step.goToStep":{defaultMessage:"Go to step {stepNumber, number}: {label}",description:"Accessible name for a clickable step in the lab Stepper. {stepNumber} is the 1-based position, {label} is the step's visible label."},"@astryx.step.goToStepWithStatus":{defaultMessage:"Go to step {stepNumber, number}: {label}, {status}",description:"Accessible name for a clickable lab Stepper step that also carries a status. {status} is one of the translated `step.status.*` words (completed/warning/error). Keep the pattern parallel to `step.goToStep`."},"@astryx.step.status.completed":{defaultMessage:"completed",description:"Screen-reader-only status word rendered next to a lab Stepper step label when the step is done (either progress-completed or status=success). Lowercase adjective; it is read mid-sentence after the step label."},"@astryx.step.status.warning":{defaultMessage:"warning",description:"Screen-reader-only status word rendered next to a lab Stepper step label when status=warning. Lowercase noun/adjective; read mid-sentence after the step label."},"@astryx.step.status.error":{defaultMessage:"error",description:"Screen-reader-only status word rendered next to a lab Stepper step label when status=error. Lowercase noun; read mid-sentence after the step label."},"@astryx.tableTree.collapseRow":{defaultMessage:"Collapse row",description:"Aria label for the Table tree-data expander chevron when the row is currently expanded."},"@astryx.tableTree.expandRow":{defaultMessage:"Expand row",description:"Aria label for the Table tree-data expander chevron when the row is currently collapsed."},"@astryx.tableTree.collapseAllRows":{defaultMessage:"Collapse all rows",description:"Aria label for the Table tree-data header toggle when all rows are expanded and clicking it collapses them."},"@astryx.tableTree.expandAllRows":{defaultMessage:"Expand all rows",description:"Aria label for the Table tree-data header toggle when rows are collapsed and clicking it expands them."},"@astryx.textArea.charactersRemaining":{defaultMessage:"{count, number} {count, plural, one {character} other {characters}} remaining",description:"Screen-reader-only announcement of how many characters the user can still type before hitting a TextArea's maxLength. Announced politely as the count nears the limit. `{count}` is the number remaining — example: `12 characters remaining`."},"@astryx.textArea.charactersOverLimit":{defaultMessage:"{count, number} {count, plural, one {character} other {characters}} over the limit",description:"Screen-reader-only assertive announcement when the user has typed past a TextArea's maxLength. `{count}` is how many characters over — example: `3 characters over the limit`."},"@astryx.textInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a TextInput. Example: `Clear Email`, `Clear Name`."},"@astryx.thumbnail.remove":{defaultMessage:"Remove {accessibleName}",description:'Screen-reader-only label on the "×" on a Thumbnail (image preview chip). `{accessibleName}` is the thumbnail\'s name — example: `Remove profile.jpg`.'},"@astryx.thumbnail.open":{defaultMessage:"Open {accessibleName}",description:'"Open" = launch/reveal (not "unfold" or the adjective). Screen-reader-only name on a clickable Thumbnail — example: `Open Sunset photo`.'},"@astryx.thumbnail.fallbackName":{defaultMessage:"Thumbnail",description:"Generic screen-reader name for a Thumbnail (image preview) that has no `alt` or `label`. Last-resort fallback so the control is never nameless; prefer a real name via `alt` or `label`."},"@astryx.timeInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a TimeInput. Example: `Clear Start time`."},"@astryx.timestamp.copyValue":{defaultMessage:"Copy {value}",description:"Aria label on a Timestamp copyable-hover-card row's copy button, in its default state. `value` is the formatted instant that row shows (e.g. `Copy February 19, 2026 at 5:00:00 PM UTC`). Imperative verb. Pairs with `timestamp.copied` (post-click state)."},"@astryx.timestamp.copy":{defaultMessage:"Copy",description:"Short label shown in the tooltip on a Timestamp copyable-hover-card row's copy button (hover/focus), in its default state. Imperative verb. Pairs with `timestamp.copied` (post-click state). The full `copyValue` string remains the button's aria-label for assistive tech."},"@astryx.timestamp.copied":{defaultMessage:"Copied",description:'Aria label on a Timestamp copy button for ~1.5s after a successful copy, and the text announced to a polite live region. Past-participle ("has been copied"); pairs with `timestamp.copyValue`.'},"@astryx.timestamp.detailsLabel":{defaultMessage:"Timestamp details",description:"Accessible name for the Timestamp copyable hover card popup, which lists the instant in the configured time zones/formats with a copy button per row."},"@astryx.token.remove":{defaultMessage:"Remove {label}",description:'Screen-reader-only label on the "×" on an individual Token/chip. Example: `Remove John Smith`, `Remove Active`. Imperative verb.'}},CO=SO,Db=new Map;function EO(e,t){const n=`${t}::${e}`;let s=Db.get(n);return s===void 0&&(s=new jO(e,t),Db.set(n,s)),s}function $O(e){let t;try{t=new Intl.Locale(e).baseName}catch{t=e}const n=t.split("-"),s=[];for(let r=n.length;r>0;r--)s.push(n.slice(0,r).join("-"));return s}function AO(e,t,n,s){var o,l;const r=$O(t);if(s!==void 0)for(const c of r){const u=(o=s[c])==null?void 0:o[e];if(u!==void 0)return u}for(const c of r){const u=(l=n[c])==null?void 0:l[e];if(u!==void 0)return u.defaultMessage}const i=CO[e];return i!==void 0?i.defaultMessage:null}function MO(e,t,n,s,r){const i=AO(e,n,s,r);return i===null?(p5(),e):t===void 0?i:EO(i,n).format(t)}function Me(){const e=p.use(b5);return p.useCallback((t,n)=>MO(t,n,e.locale,e.messages,e.overrides),[e.locale,e.messages,e.overrides])}const Do={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"x1txdalj",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"x1jxw6zd",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",kkrTdU:"x1ypdohk",k1ekBW:"xrafxwg",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},pressable:{k3aq6I:"x3oybdh xk4oym4",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},ariaDisabled:{kKwaWg:"x18o3ruo x8o3jvd xuqm82a",$$css:!0},iconOnly:{"--button-icon-only-aspect":"x1v15ycx",kOBAk4:"xioom0i",kg3NbH:"xnjsko4",k8WAf4:"xt970qd",$$css:!0},iconWrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0},contentWrapper:{k1xSpc:"xjp7ctv",$$css:!0},link:{kybGjl:"x1hl2dhg",$$css:!0}},TO={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]},zO={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},NO={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},lg:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",kGuDYH:"xwsyq91",$$css:!0}},_O={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}},RO={primary:{kWkggS:"x1ewilqj",kMwMTN:"x17wrial",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},secondary:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},ghost:{kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},destructive:{kWkggS:"x1pjz0fi",kMwMTN:"x1m024r3",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x1p73he7","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0}},Bb={hiddenContent:{kMwMTN:"x19co3pv",$$css:!0},hiddenContentDelayed:{kKVMdj:"x1ffowhz",k44tkh:"xjlvqhv",kWV6AL:"x10e4vud",kKxzle:"x17yabm6 x14q22ui",$$css:!0}},_h={horizontal:{krdFHd:"x15mokao x8eehn2",kVL7Gh:"xbiv7yw x1xrp5p4",kfmiAY:"x1ga7v0g xbfdvlp",kT0f0o:"x16uus16 xajhecq",k2ei4v:"xgbv0en x1pjv70x",kVhnKS:"x1t7ytsu xyf0ibl",kGJrpR:"x1j92z86",$$css:!0},vertical:{krdFHd:"x15mokao x8eehn2",kfmiAY:"x1ga7v0g x2qxyot",kVL7Gh:"xbiv7yw x12tyzlf",kT0f0o:"x16uus16 xajhecq",kEafiO:"x11xkdxz x1g31smg",kPef9Z:"x13fuv20 x1d9v4yf",kLZC3w:"x1pc3f07",$$css:!0},onSolidHorizontal:{kGJrpR:"xrvmtm5",$$css:!0},onSolidVertical:{kLZC3w:"x11npmm7",$$css:!0}};function Q({label:e,variant:t="secondary",size:n,type:s="button",isDisabled:r=!1,isLoading:i=!1,isInterruptible:o=!1,clickAction:l,icon:c,isIconOnly:u=!1,width:d,elevation:f="none",children:h,endContent:x,tooltip:g,href:y,as:v,target:m,rel:k,xstyle:b,className:j,style:A,ref:M,...E}){const z=Me(),T=Ua(n,"md"),$=NL(),[_,R]=p.useTransition(),N=p.useRef(!1),H=i||_,B=_||o,I=($==null?void 0:$.isDisabled)??!1,L=r||I||H&&!o,O=Fa(v),D=y!=null&&!L,q=g!=null&&L,F=Es({placement:"above",isEnabled:g!=null}),K=he=>{var V;if(L||N.current&&!o){he.preventDefault();return}(V=E.onClick)==null||V.call(E,he),l&&!he.defaultPrevented&&(N.current=!0,R(async()=>{try{await l(he)}finally{N.current=!1}}))},Z=q?he=>{var V;he.key==="Enter"||he.key===" "?he.preventDefault():(V=E.onKeyDown)==null||V.call(E,he)}:void 0,ne=t==="ghost"?{[Fp]:""}:null,ue=W(Do.base,zO[T],RO[t],u&&Do.iconOnly,L&&Do.disabled,q&&Do.ariaDisabled,D&&Do.link,!$&&Do.pressable,$&&($.orientation==="horizontal"?_h.horizontal:_h.vertical),$&&(t==="primary"||t==="destructive")&&($.orientation==="horizontal"?_h.onSolidHorizontal:_h.onSolidVertical),!$&&_O[f],d!=null&&TO.width(d),b),P=ee(J("button",{variant:t,size:T}),ue,j,A),U=a.jsxs(a.Fragment,{children:[H&&a.jsx("span",{...{0:{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x1ey2m1c xrvj5dj x1ku5rj1"},1:{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x1ey2m1c xrvj5dj x1ku5rj1 xqcmdr3 xb2rp9n xskzprw x17yabm6 x14q22ui"}}[!!B<<0],"aria-hidden":"true",children:a.jsx(Jt,{size:"sm",shade:"inherit"})}),a.jsxs("span",{...W(Do.contentWrapper,H&&(B?Bb.hiddenContentDelayed:Bb.hiddenContent)),"aria-hidden":H||void 0,children:[c&&a.jsx("span",{...W(Do.iconWrapper,NO[T]),children:c}),u?null:a.jsx("span",{className:"xb3r6kr xlyipyv xeuugli",children:h??e}),!u&&x&&a.jsx("span",{className:"x3nfvp2 x6s0dn4 x1heor9g",children:x})]}),a.jsx(qi,{role:"status","aria-live":"polite",children:H?z("@astryx.button.loading"):""})]}),ie=u&&e!==""||H&&!u||h!=null&&h!==e?{"aria-label":e}:null,te=g!=null?{"aria-describedby":[E["aria-describedby"],F.describedBy].filter(Boolean).join(" ")||void 0}:null,de=Wt(M,g!=null?F.ref:void 0);let fe;return D?fe=a.jsx(O,{ref:de,href:y,target:m,rel:k,...P,...E,...ie,...te,...ne,"aria-busy":H||void 0,onClick:K,children:U}):fe=a.jsx("button",{ref:de,type:s,disabled:q?void 0:L,...P,...E,...ie,...te,...ne,"aria-busy":H||void 0,"aria-disabled":q||void 0,onClick:K,...Z?{onKeyDown:Z}:null,children:U}),g?a.jsxs(a.Fragment,{children:[fe,F.renderTooltip(g)]}):fe}Q.displayName="Button";const Ut={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",width:"1em",height:"1em","aria-hidden":!0},zc={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-hidden":!0},IO={close:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6"})}),chevronDown:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M6 9l6 6 6-6"})}),chevronLeft:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M15 6l-6 6 6 6"})}),chevronRight:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M9 6l6 6-6 6"})}),chevronsLeft:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M18 6l-6 6 6 6M11 6l-6 6 6 6"})}),chevronsRight:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M6 6l6 6-6 6M13 6l6 6-6 6"})}),check:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M5 13l4 4L19 7"})}),success:a.jsx("svg",{...zc,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm4.06 6.56a.75.75 0 00-1.12-1l-3.94 4.4-1.94-1.94a.75.75 0 00-1.06 1.06l2.5 2.5a.75.75 0 001.09-.03l4.47-5z"})}),error:a.jsx("svg",{...zc,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm-2.47 5.47a.75.75 0 00-1.06 1.06L10.94 12l-2.47 2.47a.75.75 0 101.06 1.06L12 13.06l2.47 2.47a.75.75 0 101.06-1.06L13.06 12l2.47-2.47a.75.75 0 00-1.06-1.06L12 10.94l-2.47-2.47z"})}),warning:a.jsx("svg",{...zc,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.29 3.86L2.07 19.05A2 2 0 003.78 22h16.44a2 2 0 001.71-2.95L13.71 3.86a2 2 0 00-3.42 0zM12 9a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0112 9zm0 9a1 1 0 100-2 1 1 0 000 2z"})}),info:a.jsx("svg",{...zc,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z"})}),calendar:a.jsxs("svg",{...Ut,children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),a.jsx("path",{d:"M16 2v4M8 2v4M3 10h18"})]}),clock:a.jsxs("svg",{...Ut,children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"M12 7v5l3 3"})]}),externalLink:a.jsxs("svg",{...Ut,children:[a.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]}),menu:a.jsx("svg",{...Ut,strokeWidth:2,children:a.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),moreHorizontal:a.jsxs("svg",{...zc,children:[a.jsx("circle",{cx:"5",cy:"12",r:"1.5"}),a.jsx("circle",{cx:"12",cy:"12",r:"1.5"}),a.jsx("circle",{cx:"19",cy:"12",r:"1.5"})]}),search:a.jsxs("svg",{...Ut,children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"M21 21l-4.35-4.35"})]}),arrowUp:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M12 19V5m0 0l-7 7m7-7l7 7"})}),arrowDown:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M12 5v14m0 0l7-7m-7 7l-7-7"})}),arrowsUpDown:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"})}),funnel:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})}),eyeSlash:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 001.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),viewColumns:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125z"})}),copy:a.jsxs("svg",{...Ut,children:[a.jsx("path",{d:"M8 4v12a2 2 0 002 2h8a2 2 0 002-2V7.242a2 2 0 00-.602-1.43L16.083 2.57A2 2 0 0014.685 2H10a2 2 0 00-2 2z"}),a.jsx("path",{d:"M16 18v2a2 2 0 01-2 2H6a2 2 0 01-2-2V9a2 2 0 012-2h2"})]}),checkDouble:a.jsxs("svg",{...Ut,children:[a.jsx("path",{d:"M2 13l4 4L14 7"}),a.jsx("path",{d:"M9 13l4 4L21 7"})]}),wrench:a.jsx("svg",{...Ut,children:a.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),stop:a.jsx("svg",{...zc,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),microphone:a.jsxs("svg",{...Ut,children:[a.jsx("path",{d:"M12 2a3 3 0 00-3 3v6a3 3 0 006 0V5a3 3 0 00-3-3z"}),a.jsx("path",{d:"M19 10v1a7 7 0 01-14 0v-1"}),a.jsx("path",{d:"M12 18v4m-4 0h8"})]})};let LO={};function OO(e){var t;return e==null?null:typeof e=="string"?((t=mj(e))==null?void 0:t.icons)??null:e.icons??null}function eS(e,t){const n=OO(t);return(n==null?void 0:n[e])??LO[e]??IO[e]}const tS={root:{kmuXW:"x2lah0s",$$css:!0},span:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},nS={primary:{kMwMTN:"xtbr613",$$css:!0},secondary:{kMwMTN:"xv9yike",$$css:!0},tertiary:{kMwMTN:"xv9yike",$$css:!0},disabled:{kMwMTN:"xqa6c3m",$$css:!0},accent:{kMwMTN:"xqwr325",$$css:!0},success:{kMwMTN:"xtjic6",$$css:!0},error:{kMwMTN:"xjt36v0",$$css:!0},warning:{kMwMTN:"xs3pv69",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0},blue:{kMwMTN:"x1fns2mt",$$css:!0},red:{kMwMTN:"xeffzf7",$$css:!0},green:{kMwMTN:"xmxeech",$$css:!0},gray:{kMwMTN:"x1eyinzz",$$css:!0},cyan:{kMwMTN:"x157w0xa",$$css:!0},teal:{kMwMTN:"x1f3zxcb",$$css:!0},yellow:{kMwMTN:"x1g6zdft",$$css:!0},orange:{kMwMTN:"xxu74a4",$$css:!0},pink:{kMwMTN:"x1kxxfg5",$$css:!0},purple:{kMwMTN:"xzdw94u",$$css:!0}},DO={xsm:{kzqmXN:"x1jw3ynk",kZKoxP:"xvle69y",$$css:!0},sm:{kzqmXN:"xcdlrvm",kZKoxP:"x1l36t39",$$css:!0},md:{kzqmXN:"xwqq7k2",kZKoxP:"xmll18r",$$css:!0},lg:{kzqmXN:"xp8d6y2",kZKoxP:"xam5rvr",$$css:!0}},BO={xsm:{kzqmXN:"x1jw3ynk",kZKoxP:"xvle69y",kGuDYH:"xboafo0",$$css:!0},sm:{kzqmXN:"xcdlrvm",kZKoxP:"x1l36t39",kGuDYH:"x1jchvi3",$$css:!0},md:{kzqmXN:"xwqq7k2",kZKoxP:"xmll18r",kGuDYH:"x1603h9y",$$css:!0},lg:{kzqmXN:"xp8d6y2",kZKoxP:"xam5rvr",kGuDYH:"xngnso2",$$css:!0}};function HO(e){return e!=null&&e!==""?{role:"img","aria-label":e}:{"aria-hidden":"true"}}function ze({icon:e,color:t="inherit",size:n="md",label:s,ref:r,className:i,style:o,xstyle:l,...c}){const u=HO(s);if(typeof e=="string")return a.jsx(qO,{name:e,color:t,size:n,a11yProps:u,className:i,style:o,xstyle:l,spanProps:c});const d=e;return a.jsx(d,{ref:r,...u,...ee(J("icon",{size:n,color:t}),W(tS.root,nS[t],DO[n],l),i??void 0,o),...c})}ze.displayName="Icon";function qO({name:e,color:t,size:n,a11yProps:s,className:r,style:i,xstyle:o,spanProps:l}){const c=$j(),u=eS(e,c);if(u==null)return null;const d=l??{};return a.jsx("span",{...s,...d,...ee(J("icon",{size:n,color:t}),W(tS.span,nS[t],BO[n],o),r??void 0,i),children:u})}function ni(e,t){return typeof e=="string"?a.jsx(ze,{icon:e,...t}):typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e?a.jsx(ze,{icon:e,...t}):e}function rd(e){const t=$j();return eS(e,t)}const PO={isMobile:!1,isMobileNavOpen:!1,toggleMobileNav:()=>{},openMobileNav:()=>{},closeMobileNav:()=>{},isMobileNavEnabled:!1,hasAutoToggle:!0},j5=p.createContext(PO);j5.displayName="AppShellMobileContext";function ug(){return p.use(j5)}function sS({ref:e,children:t,label:n,"data-testid":s,xstyle:r,className:i,style:o}){const l=Me(),c=n??l("@astryx.mobileNav.toggle.open"),{isMobile:u,isMobileNavEnabled:d,isMobileNavOpen:f,mobileNavId:h,toggleMobileNav:x}=ug();return!u||!d?null:a.jsx(Q,{ref:e,variant:"ghost",label:c,icon:t??a.jsx(ze,{icon:"menu",color:"inherit"}),onClick:x,"aria-expanded":f,"aria-controls":h||void 0,"data-testid":s??"mobile-nav-toggle",xstyle:r,className:i,style:o,isIconOnly:!0})}sS.displayName="MobileNavToggle";const tu=p.createContext("default");tu.displayName="SideNavRenderContext";function rS(){return p.use(tu)}const gy=p.createContext("default");gy.displayName="TopNavRenderContext";const my=p.createContext(null);my.displayName="TopNavMobileContentContext";const UO=typeof ng.Activity<"u",FO=UO?({mode:e,children:t})=>a.jsx(ng.Activity,{mode:e,children:t}):({children:e})=>a.jsx(a.Fragment,{children:e}),VO={sm:640,md:768,lg:1024,none:0},Sm="astryx-app-shell-main",En={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kVAEAm:"x1n2onr6",$$css:!0},variantWash:{kWkggS:"x1eiddq6",$$css:!0},variantSurface:{kWkggS:"x10xzikg",$$css:!0},variantSection:{kWkggS:"x10xzikg",$$css:!0},variantElevated:{kWkggS:"x1eiddq6",$$css:!0},rootFill:{kZKoxP:"xtdtrs8",$$css:!0},rootAuto:{kAzted:"x1ov3xa9",$$css:!0},mainFocusTarget:{kI3sdo:"x1uvtmcs",$$css:!0},contentBgSurface:{kWkggS:"x10xzikg",$$css:!0},contentBgWash:{kWkggS:"x1eiddq6",$$css:!0},contentBgTransparent:{kWkggS:"xjbqb8w",kHBbk8:"xc8icb0",$$css:!0},navAreaWash:{kWkggS:"x1eiddq6",$$css:!0},navAreaSurface:{kWkggS:"x10xzikg",$$css:!0},banner:{kmuXW:"x2lah0s",$$css:!0},headerSticky:{kVAEAm:"x7wzq59",k87sOh:"x13vifvy",kY2c9j:"x1vjfegm",$$css:!0},panelAutoFill:{kUk6DE:"x98rzlu",kVQacm:"xysyzu8",$$css:!0}};function iS({variant:e="elevated",banner:t,children:n,contentPadding:s,"data-testid":r,height:i="fill",mobileNav:o,sideNav:l,topNav:c,xstyle:u,className:d,style:f,ref:h,...x}){const g=Me(),y=o===!1,v=o!=null&&o!==!1&&typeof o=="object"&&!p.isValidElement(o)?o:null,m=(v==null?void 0:v.breakpoint)??"md",k=o!=null&&o!==!1&&(p.isValidElement(o)||typeof o=="string")?o:null,b=(v==null?void 0:v.content)??null,j=(v==null?void 0:v.hasToggle)!==!1,A=(v==null?void 0:v.isOpen)!==void 0,M=m==="none"?"(max-width: 0px)":`(max-width: ${VO[m]}px)`,E=Pa(M,v==null?void 0:v.defaultIsMobile),[z,T]=p.useState(!1),$=(v==null?void 0:v.isOpen)??z,_=p.useCallback(At=>{var en;A||T(At),(en=v==null?void 0:v.onOpenChange)==null||en.call(v,At)},[A,v]),R=p.useCallback(()=>{var At;(At=document.getElementById(Sm))==null||At.focus()},[]),N=i==="fill",H=i==="auto",B=mm(t),I=mm(c),L=mm(l),D=!y&&(I||L)&&k==null,q=e==="section",F=e==="elevated",K=e==="wash"||e==="elevated"?En.navAreaWash:e==="surface"?En.navAreaSurface:void 0,Z=e==="wash"?En.contentBgWash:e==="elevated"&&I&&L&&!E?En.contentBgTransparent:e==="surface"||e==="elevated"?En.contentBgSurface:void 0,se=K??En.navAreaSurface,ne=p.useRef(null),ue=p.useRef(null);p.useEffect(()=>{if(!H||!ne.current||!ue.current)return;const At=ne.current,en=ue.current,rt=()=>{const zt=At.getBoundingClientRect().height;en.style.setProperty("--appshell-header-height",`${zt}px`)};return d5(At,()=>rt()),()=>f5(At)},[H]);const P=L&&!E,U=k!=null,X=D&&b!=null&&E,ie=p.useId(),te=p.useMemo(()=>({isMobile:E,isMobileNavOpen:$,mobileNavId:ie,toggleMobileNav:()=>D&&_(!$),openMobileNav:()=>D&&_(!0),closeMobileNav:()=>_(!1),isMobileNavEnabled:D,hasAutoToggle:j}),[E,$,ie,_,D,j]),de=L&&j?a.jsx(tu,{value:"drawer-content",children:l}):null,fe=L?a.jsx(tu,{value:"drawer-content",children:l}):null,he=I?E&&!y&&k==null?a.jsx(my,{value:de,children:a.jsx(gy,{value:"mobile-bar",children:c})}):c:null,V=I||B?a.jsxs(qp,{padding:0,hasDivider:q&&I,children:[B&&a.jsx("div",{...W(En.banner,K),children:t}),I&&he]}):void 0,xe=V!=null?a.jsx("div",{ref:ne,role:"banner",...ee(J("app-shell-header",{variant:e}),W(K,H&&En.headerSticky)),children:V}):void 0,ve=P?a.jsx(x5,{padding:0,hasDivider:q,isScrollable:N,...J("app-shell-sidenav",{variant:e}),xstyle:[K,H&&se,H&&En.panelAutoFill],children:l}):void 0,ke=ve!=null&&H?a.jsx("div",{className:"x2lah0s x7giv3 x7wzq59 xepuwc7 x16zugyo x78zum5 xdt5ytf",children:ve}):ve,me=F&&I&&P,pe=a.jsx(qs,{padding:s??0,role:"main",id:Sm,tabIndex:-1,isScrollable:N,xstyle:[Z,En.mainFocusTarget],children:n}),Qe=me?a.jsxs("div",{className:"x1n2onr6 x78zum5 x98rzlu x2lwn1j x5yr21d",children:[a.jsx("div",{className:"x10l6tqk x10a8y8t x10xzikg x183tx6i x47corl"}),pe]}):pe,$t=!y&&j&&E&&!I&&L?a.jsx("div",{...ee(J("app-shell-header",{variant:e}),W(K,H&&En.headerSticky)),children:a.jsx(qp,{padding:0,hasDivider:q,children:a.jsxs("div",{className:"x78zum5 x6s0dn4 x1k15mir xf314gf",role:"navigation","aria-label":g("@astryx.appShell.mobileNavigation"),children:[a.jsx(tu,{value:"topbar",children:l}),a.jsx(sS,{})]})})}):void 0;return a.jsx(j5,{value:te,children:a.jsxs("div",{...x,ref:Wt(h,ue),"data-testid":r,...ee(J("app-shell",{variant:e}),W(En.root,e==="wash"?En.variantWash:e==="surface"?En.variantSurface:e==="section"?En.variantSection:En.variantElevated,N?En.rootFill:En.rootAuto,u),d,f),children:[a.jsx("a",{href:`#${Sm}`,onClick:R,className:"x10l6tqk x1xrnuwo x1i1rx1s x1jqxupm xjm9jq1 x15cytp8 xt970qd xh2mrf5 xnjsko4 x1cf3d6k xkdpibf x1y5lnwp xb3r6kr xomzh7y x1hyvwdk x1rsz1da xuxw1ft x1hbpcn8 xc342km x13vifvy x1rw3289 x1o0tod xodanix x10xzikg xjse4m1 x1q2oy4v x1hl2dhg x2mo6ok xjm74w1","data-testid":"skip-to-content",children:g("@astryx.appShell.skipToContent")}),a.jsx(Hs,{height:i,padding:0,header:a.jsxs(a.Fragment,{children:[xe,$t]}),start:ke,content:Qe}),U&&k,X&&b,E&&!y&&k==null&&!b&&a.jsxs(FO,{mode:$?"visible":"hidden",children:[L&&!I&&a.jsx(tu,{value:"drawer",children:l}),I&&a.jsx(my,{value:fe,children:a.jsx(gy,{value:"drawer",children:c})})]})]})})}iS.displayName="AppShell";const oS=p.createContext(36);oS.displayName="AvatarSizeContext";const aS=p.createContext(null);aS.displayName="AvatarGroupContext";function GO(){return p.use(aS)}const Hb=(1-1/Math.SQRT2)/2,WO=.4;function KO(e){if(typeof e=="number")return e;switch(e){case"xsm":return 20;case"sm":return 24;case"md":return 36;case"lg":return 48;case"xl":return 128}}const Nc={wrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kaIpWk:"xjspbzw",$$css:!0},content:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kaIpWk:"xjspbzw",kVQacm:"xb3r6kr",kfSwDN:"x87ps6o",$$css:!0},fallback:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kWkggS:"xelv01g",kMwMTN:"xicfil",kMv6JI:"x9ynric",k63SB2:"xi08x9w",kP9fke:"xtvhhri",$$css:!0},status:{kVAEAm:"x10l6tqk",$$css:!0},focusable:{kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},interactive:{kysU6D:"xjyslct",kmVPX3:"x1717udv",kogj98:"x1ghz6dp",kMzoRj:"xc342km",ksu8eU:"xng3xce",kWkggS:"xjbqb8w",kMwMTN:"x1heor9g",kVVagm:"xln7xf2",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kaIpWk:"xjspbzw",kMeerF:"x1k57tk5 x784prv",k3XXqK:"x1t137rt x9v5kkp",kjBf7l:"xzunyri",kInvED:"x1wfwxd8 x7s97pk",$$css:!0}},XO={kGuDYH:"xdmh292",$$css:!0},ZO={krVfgx:"x1nqzi6q",kt4wiu:"xqxgn94",k3aq6I:"x4v1no5 xqgnvz5",$$css:!0},Cm={size:e=>[{kzqmXN:e!=null?"x5lhr3w":e,kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e),"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],fontSize:e=>[XO,{"--x-fontSize":(t=>typeof t=="number"?t+"px":t??void 0)(`var(--_avatar-fallback-font-size, ${e*WO}px)`)}],statusPosition:e=>[ZO,{"--x-bottom":(t=>typeof t=="number"?t+"px":t??void 0)(e*Hb),"--x-insetInlineEnd":(t=>typeof t=="number"?t+"px":t??void 0)(e*Hb)}]},qb={ring:{kaIpWk:"xjspbzw",kMzoRj:"xdh2fpr",ksu8eU:"x1y0btm7",kVAM5u:"x1touxvs",kWkggS:"x10xzikg",kB7OPa:"x1afcbsf",$$css:!0},overlap:{keTefX:"x1sik18w",$$css:!0}},YO={"--_avatar-group-overlap":"xlz5hwt",$$css:!0},QO={overlap:e=>[YO,{"--x---_avatar-group-overlap":`${e}px`!=null?`${e}px`:void 0}]};function JO(e){const t=e.trim().split(/\s+/);return t.length===0?"":t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}function eD(e){if(!p.isValidElement(e))return;const{label:t}=e.props;return typeof t=="string"&&t!==""?t:void 0}function tD({size:e}){return a.jsx("svg",{width:e*.6,height:e*.6,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}function lS({alt:e,"data-testid":t,fallbackSrc:n,name:s,size:r="md",src:i,status:o,tooltip:l=!0,href:c,as:u,target:d,rel:f,onClick:h,xstyle:x,className:g,style:y,ref:v,...m}){const[k,b]=p.useState(void 0),[j,A]=p.useState(void 0),M=i&&k!==i,E=!M&&n&&j!==n,z=!M&&!E&&s,T=!M&&!E&&!s,$=Me(),_=e||s,R=eD(o),N=_&&R?$("@astryx.avatar.nameWithStatus",{name:_,status:R}):_||R,H=!N,B=GO(),I=(B==null?void 0:B.size)??r,L=p.useMemo(()=>KO(I),[I]),O=l===!1?void 0:typeof l=="string"?l:s,D=O==null?void 0:O.trim(),q=D!=null&&D!=="",F=typeof l=="string",K=Es({placement:"above",isEnabled:q}),Z=Wt(v,q?K.ref:void 0),se=q&&F?{"aria-describedby":[m["aria-describedby"],K.describedBy].filter(Boolean).join(" ")||void 0}:null,ne=c!=null,ue=!ne&&h!=null,P=ne||ue,U=Fa(u);P&&!N&&console.warn("Avatar: an interactive avatar (with `href` or `onClick`) needs a meaningful accessible name. Pass `alt` or `name`.");const X=a.jsxs(a.Fragment,{children:[a.jsxs("div",{...W(Nc.content,Cm.size(L)),children:[M&&a.jsx("img",{src:i,alt:"",onError:()=>b(i),className:"xh8yej3 x5yr21d xl1xv1r"}),E&&a.jsx("img",{src:n,alt:"",onError:()=>A(n),className:"xh8yej3 x5yr21d xl1xv1r"}),z&&a.jsx("div",{...W(Nc.fallback,Cm.fontSize(L)),children:JO(s)}),T&&a.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xelv01g xicfil x9ynric xi08x9w xtvhhri",children:a.jsx(tD,{size:L})})]}),o&&a.jsx("div",{...W(Nc.status,Cm.statusPosition(L)),children:o})]}),ie=ee(J("avatar",{size:I}),W(Nc.wrapper,P&&Nc.interactive,!P&&q&&!B&&Nc.focusable,B&&qb.ring,B&&qb.overlap,B&&QO.overlap(-B.overlap),x),g,y);let te;const de=m;ne?te=a.jsx(U,{...de,...se,ref:Z,href:c,target:d,rel:f,"aria-label":N,"data-avatar-item":"","data-testid":t,onClick:h,...ie,children:X}):ue?te=a.jsx("button",{...de,...se,ref:Z,type:"button","aria-label":N,"data-avatar-item":"","data-testid":t,onClick:h,...ie,children:X}):te=a.jsx("div",{...m,ref:Z,role:H?"presentation":"img","aria-label":H?void 0:N,"aria-hidden":H||void 0,tabIndex:q&&!B?0:void 0,"data-testid":t,...se,...ie,children:X});const fe=a.jsx(oS,{value:L,children:te});return a.jsxs(a.Fragment,{children:[fe,q?K.renderTooltip(D):null]})}lS.displayName="Avatar";function nD(e){return!e||typeof window>"u"?!1:window.getComputedStyle(e).direction==="rtl"}const Ii=typeof window<"u"?p.useLayoutEffect:p.useEffect,sD=new Set(["text","search","url","tel","email","password","number"]);function rD(e){if(e.isContentEditable)return e;const t=e.closest("[contenteditable]");return t&&t.getAttribute("contenteditable")!=="false"?t:null}function Pb(e,t){if(!(e instanceof HTMLElement))return!1;const n=rD(e);if(n){const u=typeof window<"u"?window.getSelection():null;return u&&u.rangeCount>0&&!u.isCollapsed?!0:(n.textContent??"").length>0}const s=e.tagName==="TEXTAREA",r=e.tagName==="INPUT"&&sD.has(e.type);if(!s&&!r)return!1;const i=e,{selectionStart:o,selectionEnd:l,value:c}=i;return o!==l||o==null?!0:t==="ArrowLeft"||t==="ArrowUp"||t==="Home"?o>0:t==="ArrowRight"||t==="ArrowDown"||t==="End"?o<c.length:!1}function Ed(e={}){const{itemSelector:t='[role="menuitem"]',boundarySelector:n,wrap:s=!0,onEscape:r,orientation:i="vertical",hasHomeEnd:o=!0,isRtl:l,hasRovingTabIndex:c=!1,hasCaretGuard:u=!1}=e,d=p.useRef(null),f=p.useCallback(z=>z.getAttribute("aria-disabled")==="true"||z.disabled===!0||z.hasAttribute("disabled"),[]),h=p.useCallback(()=>{const z=d.current;if(!z)return[];const T=Array.from(z.querySelectorAll(t));return n?T.filter($=>$.closest(n)===z):T},[t,n]),x=p.useCallback(z=>{const T=d.current;if(!T||!n)return!0;const $=z.target;return $?$.closest(n)===T:!0},[n]),g=p.useCallback((z,T,$,_)=>{const R=z.length;if(R===0)return-1;let N=T;for(let H=0;H<R;H++){if(N<0||N>=R){if(!_)return-1;N=(N+R)%R}const B=z[N];if(B&&!f(B))return N;N+=$}return-1},[f]),y=p.useCallback(()=>{const z=h(),T=document.activeElement;return z.findIndex($=>$===T||$.contains(T))},[h]),v=p.useCallback((z,T)=>{z.getAttribute("tabindex")!==String(T)&&z.setAttribute("tabindex",String(T))},[]),m=p.useCallback(()=>{const z=h(),T=z.filter(R=>!f(R));if(T.length===0)return;const _=T.find(R=>R.getAttribute("tabindex")==="0")??T[0];for(const R of z)v(R,R===_?0:-1)},[h,f,v]);Ii(()=>{c&&m()});const k=p.useCallback((z,T)=>{const $=z[T];if($){if(c)for(const _ of z)v(_,_===$?0:-1);$.focus()}},[c,v]),b=p.useCallback(z=>{const T=h();if(T.length===0)return;const $=Math.max(0,Math.min(z,T.length-1));k(T,$)},[h,k]),j=p.useCallback(()=>{const z=h(),T=g(z,0,1,!1);return T!==-1?(k(z,T),!0):!1},[h,g,k]),A=p.useCallback(()=>{const z=h(),T=g(z,z.length-1,-1,!1);return T!==-1?(k(z,T),!0):!1},[h,g,k]),M=p.useCallback(()=>{c&&m()},[c,m]),E=p.useCallback(z=>{if(z.ctrlKey||z.metaKey||z.altKey||!x(z))return;if(z.key==="Escape"){z.preventDefault(),r==null||r();return}const T=i==="horizontal"||i==="both",$=i==="vertical"||i==="both",_=[],R=[];if(T){const D=z.key==="ArrowLeft"||z.key==="ArrowRight"?l??nD(d.current):!1;_.push(D?"ArrowLeft":"ArrowRight"),R.push(D?"ArrowRight":"ArrowLeft")}$&&(_.push("ArrowDown"),R.push("ArrowUp"));const N=_.includes(z.key),H=R.includes(z.key),B=o&&z.key==="Home",I=o&&z.key==="End";if(!N&&!H&&!B&&!I||u&&(Pb(z.target,z.key)||Pb(document.activeElement,z.key)))return;const L=y(),O=h();if(N){const D=L===-1?0:L+1,q=g(O,D,1,s);q!==-1&&k(O,q)}else if(H){const D=L===-1?O.length-1:L-1,q=g(O,D,-1,s);q!==-1&&k(O,q)}else B?j():I&&A();z.preventDefault()},[y,h,s,i,l,o,u,g,k,j,A,r,x]);return{listRef:d,handleKeyDown:E,handleFocus:M,focusItem:b,focusFirst:j,focusLast:A,ownsEvent:x,getItems:h}}const iD={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kZKoxP:"x1grt7ep",k8WAf4:"xt970qd",kg3NbH:"xf314gf",kaIpWk:"xjspbzw",kMv6JI:"xjb2p0i",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",$$css:!0}},oD={neutral:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},info:{kWkggS:"x1ewilqj",kMwMTN:"x17wrial",$$css:!0},success:{kWkggS:"xdsz4j9",kMwMTN:"xri61p4",$$css:!0},warning:{kWkggS:"x1q8g9m5",kMwMTN:"xrebv38",$$css:!0},error:{kWkggS:"x1pjz0fi",kMwMTN:"x1m024r3",$$css:!0},blue:{kWkggS:"x1o0wnni",kMwMTN:"x1vvqiwl",$$css:!0},cyan:{kWkggS:"x1rgj867",kMwMTN:"x1txnczv",$$css:!0},green:{kWkggS:"x1sqjeoo",kMwMTN:"xltfdvo",$$css:!0},orange:{kWkggS:"x1e9xt6e",kMwMTN:"xm47u9q",$$css:!0},pink:{kWkggS:"xnpoty2",kMwMTN:"xiuofww",$$css:!0},purple:{kWkggS:"x16i6n6f",kMwMTN:"x1m9wyeb",$$css:!0},red:{kWkggS:"x1cibrc5",kMwMTN:"x1joocv1",$$css:!0},teal:{kWkggS:"x1jtji5o",kMwMTN:"x9x0lbs",$$css:!0},yellow:{kWkggS:"x1bo7t0x",kMwMTN:"xdhq94a",$$css:!0}};function $d({variant:e="neutral",label:t,icon:n,xstyle:s,className:r,style:i,ref:o,...l}){return a.jsxs("span",{ref:o,...ee(J("badge",{variant:e}),W(iD.base,oD[e],s),r,i),...l,children:[n,t]})}$d.displayName="Badge";const aD={info:"info",warning:"warning",error:"error",success:"success"},lD={info:"status",warning:"alert",error:"alert",success:"status"},cD={info:"accent",warning:"warning",error:"error",success:"success"},Ya={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kMv6JI:"xjb2p0i",$$css:!0},rootElevatedCard:{kaIpWk:"x1hviunn",$$css:!0},header:{k1xSpc:"x78zum5",kGNEyG:"x1cy8zhl",kOIVth:"x1txdalj",k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},headerCardStandalone:{kaIpWk:"x1hviunn",$$css:!0},headerCardWithContent:{krdFHd:"x81l70g",kfmiAY:"x7hs6f1",kVL7Gh:"xbiv7yw",kT0f0o:"x16uus16",$$css:!0},headerCentered:{kGNEyG:"x6s0dn4",$$css:!0},endArea:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kmuXW:"x2lah0s",keTefX:"xvc5jky",kqGvvJ:"x81ka23",$$css:!0}},uD={info:{kWkggS:"xgcxg3y",$$css:!0},warning:{kWkggS:"x24i8r5",$$css:!0},error:{kWkggS:"x1pritpl",$$css:!0},success:{kWkggS:"xu13z74",$$css:!0}},dD={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}};function Pe({status:e,title:t,description:n,icon:s,isDismissable:r=!1,onDismiss:i,endContent:o,container:l="card",elevation:c="none",defaultIsExpanded:u=!1,children:d,xstyle:f,className:h,style:x,ref:g,...y}){const v=Me(),[m,k]=p.useState(!1),[b,j]=p.useState(u),A=p.useId(),M=aD[e],E=lD[e],z=cD[e],T=d!=null;if(m)return null;const $=()=>{k(!0),i==null||i()},_=()=>{j(L=>!L)},R=o!=null||r||T,N=o!=null||r,H=n==null&&N,B=T&&b,I=l==="card";return a.jsxs("div",{ref:g,role:E,...ee(W(Ya.root,dD[c],I&&c!=="none"&&Ya.rootElevatedCard,f),h,x),...y,children:[a.jsxs("div",{...ee(J("banner",{container:l,status:e}),W(Ya.header,H&&Ya.headerCentered,uD[e],I&&(B?Ya.headerCardWithContent:Ya.headerCardStandalone))),children:[a.jsx("div",{...ee(J("banner-icon",{status:e}),{className:"x78zum5 x6s0dn4 x2lah0s"}),"aria-hidden":"true",children:s??a.jsx(ze,{icon:M,size:"md",color:z})}),a.jsxs("div",{className:"x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli",children:[a.jsx("div",{className:"x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0",children:t}),n!=null&&a.jsx("div",{className:"x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4",children:n})]}),R&&a.jsxs("div",{...W(Ya.endArea,zL.inset(jr["--spacing-2"])),children:[o,T&&a.jsx(Q,{variant:"ghost",size:"sm",label:v(b?"@astryx.banner.collapse":"@astryx.banner.expand"),tooltip:v(b?"@astryx.banner.collapse":"@astryx.banner.expand"),icon:a.jsx("span",{...{0:{className:"x3nfvp2 x11xpdln xuedmi6 x12w9bfk xlr8y92"},1:{className:"x3nfvp2 x11xpdln xuedmi6 x12w9bfk xlr8y92 x19jd1h0"}}[!!b<<0],children:a.jsx(ze,{icon:"chevronDown",size:"sm",color:"inherit"})}),onClick:_,"aria-expanded":b,"aria-controls":B?A:void 0,isIconOnly:!0}),r&&a.jsx(Q,{variant:"ghost",size:"sm",label:v("@astryx.banner.dismiss"),tooltip:v("@astryx.banner.dismiss"),icon:a.jsx(ze,{icon:"close",size:"sm",color:"inherit"}),onClick:$,isIconOnly:!0})]})]}),B&&a.jsx("div",{id:A,...ee(J("banner-content",{container:l,status:e}),{0:{className:"x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh"},1:{className:"x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x14k8p9y xiaxfje"}}[!!I<<0]),children:d})]})}Pe.displayName="Banner";const fD={root:{k2ei4v:"xtpqe59",kVhnKS:"x1t7ytsu",kGJrpR:"x14ydlgx",kZCmMZ:"x1rey3nv",kMwMTN:"xv1l7n4",keTefX:"x1lziwak",k71WvV:"x14z9mp",keoZOQ:"xdj266r",k1K539:"xat24cr",$$css:!0}};function cS({children:e,cite:t,xstyle:n,className:s,style:r,ref:i,...o}){return a.jsxs("blockquote",{ref:i,...ee(J("blockquote"),W(fD.root,n),s,r),...o,children:[e,t!=null&&a.jsx("footer",{children:a.jsx("cite",{className:"x1lliihq xtbrsbv x141an7d x1ltkj2j x1j61x8r",children:t})})]})}cS.displayName="Blockquote";const hD='button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child',uo=[];function pD(e){uo.push(e)}function xD(e){for(let t=uo.length-1;t>=0;t--)if(uo[t].handler===e){uo.splice(t,1);return}}function gD(e){if(uo.length===0)return!1;let t=uo[0];for(let n=1;n<uo.length;n++){const s=uo[n],r=t.getContainer(),i=s.getContainer();r!=null&&i!=null&&i!==r&&i.contains(r)||(t=s)}return t.handler===e}function Ub(){return uo.length>0}function uS(e){return e.isComposing===!0||e.keyCode===229}function mD(e){if(e.hasAttribute("inert")||e.closest("[inert]")||e.hidden||e.closest("[hidden]")||e.closest('[aria-hidden="true"]'))return!1;if(typeof window<"u"&&window.getComputedStyle){const t=window.getComputedStyle(e);if(t.visibility==="hidden"||t.display==="none")return!1}return!0}function S5(e){return Array.from(e.querySelectorAll(hD)).filter(mD)}function dS(e){try{e.focus()}catch{}return document.activeElement===e}function Fb(e){const t=S5(e);for(const n of t)if(dS(n))return!0;return!1}function yD(e){const t=S5(e);for(let n=t.length-1;n>=0;n--)if(dS(t[n]))return!0;return!1}function vD(e){const{isActive:t,onEscape:n}=e,s=p.useRef(null),r=p.useRef(null),i=p.useRef(!1),o=p.useCallback(()=>{s.current&&Fb(s.current)},[]);return p.useEffect(()=>{if(!t)return;const l=document.activeElement,c=s.current;return()=>{const u=document.activeElement;(u==null||u===document.body||u===document.documentElement||c!=null&&c.contains(u))&&l!=null&&l.isConnected&&typeof l.focus=="function"&&l.focus()}},[t]),p.useEffect(()=>{if(!t)return;const l=c=>{const u=s.current;if(!u)return;const d=c.target;u.contains(d)?r.current=d:i.current&&(Fb(u),r.current===document.activeElement&&yD(u),r.current=document.activeElement),i.current=!1};return document.addEventListener("focus",l,!0),()=>{document.removeEventListener("focus",l,!0)}},[t]),p.useEffect(()=>{if(!t)return;const l=()=>{n==null||n()};n&&pD({handler:l,getContainer:()=>s.current});const c=u=>{const d=s.current;if(d){if(u.key==="Escape"&&n){if(u.defaultPrevented||uS(u)||!gD(l))return;u.preventDefault(),u.stopPropagation(),n();return}if(u.key==="Tab"){i.current=!0;const f=S5(d);if(f.length===0)return;const h=f[0],x=f[f.length-1];u.shiftKey?document.activeElement===h&&(u.preventDefault(),x.focus()):document.activeElement===x&&(u.preventDefault(),h.focus())}}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),n&&xD(l)}},[t,n]),{containerRef:s,focusFirst:o}}function Ad(e,t,n=!0){const s=p.useRef(!1);p.useEffect(()=>{n&&!s.current&&(s.current=!0,Zl())},[e,t,n])}const Em={surface:{kWkggS:"x1prclbq",kaIpWk:"x1hviunn",kGVxlE:"x1i5ehqx",$$css:!0},contentWrapper:{kVAEAm:"x1n2onr6",$$css:!0},closeButtonWrapper:{kVAEAm:"x10l6tqk",krVfgx:"x1ey2m1c",kY2c9j:"x1vjfegm",kzqmXN:"x1i1rx1s x10okhzq",kZKoxP:"xjm9jq1 x132qfvm",kVQacm:"xb3r6kr x1dordxg",kz4h6p:"x1hyvwdk x10wafsz",kfzvcC:"x47corl xbt4iw",kLKAdn:"xexx8yu x1kw28su",$$css:!0}};function Md(e={}){const{onShow:t,onHide:n,xstyle:s,hasLightDismiss:r=!0,hasEscapeDismiss:i=!0,hasAutoFocus:o=!0,hasSurface:l=!0,hasCloseButton:c=!0,closeButtonLabel:u,dialogLabel:d,role:f="dialog",isModal:h=!0}=e,x=Me(),g=u??x("@astryx.popover.close"),y=p.useRef(null),v=p.useRef(!1),m=Cd({mode:"context",lightDismiss:r,onShow:t,onHide:n}),{containerRef:k,focusFirst:b}=vD({isActive:m.isOpen,onEscape:i||r?m.hide:void 0});p.useEffect(()=>{m.isOpen&&o&&!v.current&&requestAnimationFrame(()=>{b()}),m.isOpen||(v.current=!1)},[m.isOpen,o,b]);const j=p.useCallback(T=>{y.current=T,m.ref(T)},[m]),A=p.useCallback(T=>{v.current=(T==null?void 0:T.skipAutoFocus)??!1,m.show()},[m]),M=p.useCallback(()=>{m.isOpen?m.hide():A()},[m,A]),E={"aria-haspopup":f==="dialog"?"dialog":"true","aria-expanded":m.isOpen,"aria-controls":m.id};Ad("usePopover",'role="dialog" without a `dialogLabel` renders an unnamed dialog. Pass `dialogLabel`, or use `role: "none"` for listbox/menu popups whose content already carries its own role.',f==="dialog"&&!d);const z=p.useCallback((T,$)=>m.render(a.jsxs("div",{ref:k,role:f==="dialog"?"dialog":void 0,"aria-modal":f==="dialog"&&h?!0:void 0,"aria-label":f==="dialog"?d:void 0,...W(Em.contentWrapper,l&&Em.surface,s),children:[T,c&&a.jsx("div",{...W(Em.closeButtonWrapper,sd.centerInline("100%")),children:a.jsx(Q,{variant:"secondary",label:g,onClick:m.hide})})]}),{...$,xstyle:$==null?void 0:$.xstyle}),[m,c,l,g,k,d,f,h,s]);return{triggerRef:j,contentRef:k,anchorId:m.anchorId,show:A,hide:m.hide,toggle:M,isOpen:m.isOpen,id:m.id,render:z,triggerProps:E}}function kD(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "}function C5(e){const{getItemLabels:t,onMatch:n,getCurrentIndex:s,resetMs:r=750,isDisabled:i}=e,o=p.useRef(""),l=p.useRef(void 0),c=p.useCallback(()=>{o.current="",l.current&&(clearTimeout(l.current),l.current=void 0)},[]),u=p.useCallback(()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o.current="",l.current=void 0},r)},[r]);return{onKeyDown:p.useCallback(f=>{const h=f.key===" "&&o.current.length>0;if(!kD(f)&&!h)return!1;const x=t();if(x.length===0)return!1;const g=f.key.toLowerCase(),y=o.current.length>0&&o.current.split("").every(j=>j===g),v=y?g:o.current+g;o.current=v,u();const m=(s==null?void 0:s())??-1,k=x.length,b=y?1:0;for(let j=0;j<k;j++){const A=(m+b+j+k)%k;if(i!=null&&i(A))continue;const M=x[A];if(M!=null&&M.trim().toLowerCase().startsWith(v))return n(A),!0}return!0},[t,n,s,u,i]),reset:c}}const Vb={horizontal:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kzqmXN:"xh8yej3",$$css:!0},vertical:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kZKoxP:"x5yr21d",$$css:!0}},_c={horizontalLine:{kZKoxP:"xsyqizj",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},verticalLine:{kzqmXN:"xjk4fl7",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},subtle:{kWkggS:"x1m4xfpy",$$css:!0},strong:{kWkggS:"x7njt3n",$$css:!0}},Gb={horizontal:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",$$css:!0},vertical:{keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",kZKoxP:"x12qplqi",$$css:!0}};function ja({orientation:e="horizontal",label:t,variant:n="subtle",isFullBleed:s=!1,xstyle:r,className:i,style:o,ref:l,"aria-label":c,"aria-labelledby":u,...d}){const f=e==="horizontal",h=p.useId(),x=u??(t&&c==null?h:void 0);return a.jsxs("div",{ref:l,...d,role:"separator","aria-orientation":e,"aria-label":c,"aria-labelledby":x,...ee(J("divider",{variant:n,orientation:e}),W(f?Vb.horizontal:Vb.vertical,s&&(f?Gb.horizontal:Gb.vertical),r),i,o),children:[a.jsx("div",{...W(f?_c.horizontalLine:_c.verticalLine,_c[n])}),t&&a.jsx("div",{id:h,...{0:{className:"x2lah0s xrrkdod x141an7d x1ltkj2j xv1l7n4"},1:{className:"x2lah0s x141an7d x1ltkj2j xv1l7n4 xnjsko4 x8o8v82"}}[!f<<0],children:t}),t&&a.jsx("div",{...W(f?_c.horizontalLine:_c.verticalLine,_c[n])})]})}ja.displayName="Divider";const bD=["noopener","noreferrer"];function fS(e,t){if(e!=="_blank")return{target:e,rel:t};const n=(t==null?void 0:t.split(/\s+/).filter(Boolean))??[];for(const s of bD)n.includes(s)||n.push(s);return{target:e,rel:n.join(" ")}}const hS=["button","a","input","select","textarea",'[role="button"]','[role="link"]','[role="checkbox"]','[role="radio"]','[role="switch"]','[role="tab"]','[role="menuitem"]','[role="option"]','[role="combobox"]','[role="listbox"]','[role="slider"]','[role="spinbutton"]',"[data-pressable-container]"].join(","),wD='[aria-readonly="true"]';function Wb(e,t){let n=e;for(;n!=null&&n!==t&&n!==document.body;){if(n.matches(hS)&&!n.matches(wD))return!0;n=n.parentElement}return!1}function jD(e){if(typeof document>"u"||!("getSelection"in document))return!1;const t=document.getSelection();return t==null||t.isCollapsed?!1:e.contains(t.anchorNode)}function E5({containerRef:e,interactiveRef:t,onClick:n,href:s,target:r,disabled:i=!1}){p.useEffect(()=>{const c=e.current;c&&c.setAttribute("data-pressable-container","true")},[e]);const o=p.useCallback(c=>{if(i)return;const u=e.current;if(!u||jD(u))return;const d=c.target;if(d instanceof Element&&!(d!==c.currentTarget&&Wb(d,u))&&(n==null||n(c),!c.defaultPrevented&&(s!=null&&(r==="_blank"||c.ctrlKey||c.metaKey?window.open(s,"_blank","noopener"):t!=null&&t.current?t.current.click():window.location.href=s),s==null&&n==null&&(t!=null&&t.current)))){const f=new MouseEvent("click",{bubbles:c.bubbles,cancelable:c.cancelable,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey,altKey:c.altKey,button:c.button});t.current.dispatchEvent(f),c.stopPropagation()}},[e,t,n,s,r,i]),l=p.useCallback(c=>{if(i)return;const u=e.current;if(!u)return;const d=c.target;if(!(d instanceof Element))return;c.button===1&&s!=null&&(d===c.currentTarget||!Wb(d,u))&&window.open(s,"_blank","noopener")},[e,s,i]);return{onClick:o,onMouseUp:l}}const SD=new Set(["option","tab","row","gridcell","columnheader","rowheader","treeitem"]),ms={root:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kg3NbH:"xf314gf",kVAEAm:"x1n2onr6",kB7OPa:"x9f619",k9WMMc:"x1yc453h",kaIpWk:"xh6dtrn",$$css:!0},alignStart:{kGNEyG:"x1cy8zhl",$$css:!0},interactive:{kkrTdU:"x1ypdohk",k1ekBW:"x15406qy",kIyJzY:"xkvfbh3",kAMwcw:"xlr8y92",kWkggS:"xjbqb8w xe9uy6x xyxi2l3",$$css:!0},focusVisibleOutline:{kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",$$css:!0},highlighted:{kWkggS:"x1lmrjuc",$$css:!0},selected:{kWkggS:"xgcxg3y",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kfzvcC:"x47corl",$$css:!0},label:{kMwMTN:"x1tgivj0",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},labelSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},labelMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0},description:{kMwMTN:"xv1l7n4",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},descriptionSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},descriptionMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},Kb={lineClamp:e=>[{kJFfOR:e!=null?"x1yhjpo9":e,$$css:!0},{"--x-WebkitLineClamp":e??void 0}]},CD={compact:{k8WAf4:"xu0wf1k",$$css:!0},balanced:{k8WAf4:"xce4md1",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"xrrkdod",$$css:!0}};function Td({as:e="div",marker:t,startContent:n,label:s,description:r,endContent:i,align:o="center",density:l="balanced",labelLines:c,descriptionLines:u,onClick:d,interactiveRef:f,href:h,target:x,rel:g,isHighlighted:y=!1,isSelected:v=!1,isDisabled:m=!1,xstyle:k,className:b,style:j,ref:A,role:M,...E}){const z=Fa(),T=f!=null,$=p.useRef(null),{onClick:_}=E5({containerRef:$,interactiveRef:f??void 0,disabled:m});Ad("Item","`interactiveRef` is mutually exclusive with `onClick`/`href`. In delegation mode the row only forwards clicks to the referenced control, so `onClick`/`href` are ignored. Drop one of them.",T&&(d!=null||h!=null));const R=d!=null||h!=null||T,{target:N,rel:H}=fS(x,g),B=M!=null,I=M!=null&&SD.has(M),L=typeof s=="string",O=typeof r=="string",D=c!=null?c===1?ms.labelSingleTruncate:ms.labelMultiTruncate:L?ms.labelSingleTruncate:null,q=u!=null?u===1?ms.descriptionSingleTruncate:ms.descriptionMultiTruncate:O?ms.descriptionSingleTruncate:null,F=a.jsxs(a.Fragment,{children:[a.jsx("span",{...W(ms.label,D,c!=null&&c>1&&Kb.lineClamp(c)),children:s}),r!=null&&a.jsx("span",{...W(ms.description,q,u!=null&&u>1&&Kb.lineClamp(u)),children:r})]}),K=se=>{m||se.target.closest("button, a, input, select, textarea")||d==null||d(se)},Z=a.jsxs(a.Fragment,{children:[t,n!=null&&a.jsx("span",{className:"x3psx0u x78zum5",children:n}),B||T?a.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!m<<0],children:F}):h!=null?a.jsx(z,{href:h,target:N,rel:H,"aria-disabled":m||void 0,tabIndex:m?-1:void 0,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz xbyyjgo"}}[!!m<<0],children:F}):d!=null?a.jsx("button",{type:"button",onClick:d,disabled:m,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz xbyyjgo"}}[!!m<<0],children:F}):a.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!m<<0],children:F}),i!=null&&a.jsx("span",{...{0:{className:"x3psx0u x78zum5 xvc5jky"},1:{className:"x3psx0u x78zum5 xvc5jky xbyyjgo"}}[!!m<<0],children:i})]});return a.jsx(e,{ref:T?Wt(A,$):A,...E,"aria-selected":I&&v||void 0,"aria-current":E["aria-current"]??(v&&!I?!0:void 0),"aria-disabled":m||void 0,...ee(J("item",{density:l,align:o}),W(ms.root,CD[l],o==="start"&&ms.alignStart,R&&ms.interactive,R&&ms.focusVisibleOutline,y&&ms.highlighted,v&&ms.selected,m&&!B&&ms.disabled,k),b,j),role:M,onClick:T?_:B?d:R?K:void 0,children:Z})}Td.displayName="Item";const ah=p.createContext(null);ah.displayName="DropdownMenuContext";function pS(){return p.use(ah)}const ED=p.createContext(null);ED.displayName="DropdownMenuRadioGroupContext";function xS(e,t){if(t||e.pointerType!=="mouse")return;const n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus()}const Xb={root:{kB7OPa:"x9f619",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"x1ws5lxm",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w x1c52tdz",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},disabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},$D={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}};function o1({icon:e,label:t,description:n,onClick:s,isDisabled:r=!1,endContent:i,xstyle:o,className:l,style:c}){const u=pS(),d=(u==null?void 0:u.menuSize)??"md",f=p.useCallback(()=>{r||!s||(s(),u==null||u.closeMenu())},[r,s,u]),h=p.useCallback(x=>xS(x,r),[r]);return a.jsx(Td,{role:"menuitem",tabIndex:r?void 0:-1,onPointerMove:h,startContent:e?ni(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:i,onClick:f,isDisabled:r,xstyle:[Xb.root,$D[d],r&&Xb.disabled,o],...ee(J("dropdown-menu-item",{size:d}),{className:l,style:c})})}o1.displayName="DropdownMenuItem";function AD(e){const{show:t,hide:n,isOpen:s,isEnabled:r,showDelay:i=150,hideDelay:o=200}=e,l=Pa("(hover: hover)"),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),f=p.useRef(!1),h=p.useRef(!1),x=p.useRef(s);x.current&&!s&&(f.current=!1),x.current=s;const g=p.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),u.current&&(clearTimeout(u.current),u.current=null)},[]),{listRef:y,handleKeyDown:v,focusFirst:m}=Ed({onEscape:()=>{g(),n()}});p.useEffect(()=>()=>g(),[g]);const k=p.useCallback(()=>{g(),s?(h.current=!0,n()):(h.current=!1,t(),requestAnimationFrame(()=>m()))},[s,g,t,n,m]),b=p.useCallback(()=>{if(l){if(h.current){h.current=!1;return}f.current=!0,g(),i>0?c.current=setTimeout(()=>{t({skipAutoFocus:!0})},i):t({skipAutoFocus:!0})}},[l,g,t,i]),j=p.useCallback(()=>{f.current&&(g(),u.current=setTimeout(()=>{n()},o))},[g,n,o]),A=p.useCallback(()=>{g()},[g]),M=p.useCallback($=>{d.current=$},[]),E=p.useCallback(()=>{},[]),z=p.useCallback($=>{},[]),T=p.useCallback($=>{},[]);return r?{triggerProps:{onClick:k,onMouseEnter:b,onMouseLeave:j},contentProps:{onMouseEnter:A,onMouseLeave:j,onKeyDown:v},menuRef:y,focusFirst:m,setTriggerEl:M}:{triggerProps:{onClick:E,onMouseEnter:E,onMouseLeave:E},contentProps:{onMouseEnter:E,onMouseLeave:E,onKeyDown:T},menuRef:y,focusFirst:m,setTriggerEl:z}}const dg=new Set(["menuitem","menuitemradio","menuitemcheckbox"]),$5=[...dg].map(e=>`[role="${e}"]:not([aria-disabled="true"])`).join(","),A5='[role="menu"]',$m={root:{kB7OPa:"x9f619",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"x1ws5lxm",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w x1c52tdz",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},open:{kWkggS:"x1lmrjuc",$$css:!0},disabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},MD={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},TD={keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},Zb={popover:{k7Eaqz:"x5w4yej",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[TD,{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function gS(e){const{icon:t,label:n,description:s,isDisabled:r=!1,hasSpinner:i=!1,menuWidth:o,onOpenChange:l,children:c,xstyle:u,className:d,style:f,"data-testid":h,menuDataTestId:x}=e,g=pS(),y=(g==null?void 0:g.menuSize)??"md",v=!r,m=p.useId(),k=p.useId(),b=p.useRef(null),[j,A]=p.useState(!1),M=Cd({mode:"context",lightDismiss:!1,onShow:p.useCallback(()=>{A(!0),l==null||l(!0)},[l]),onHide:p.useCallback(()=>{A(!1),l==null||l(!1)},[l])}),E=p.useCallback(()=>{v&&M.show()},[v,M]),z=p.useCallback(()=>{M.hide()},[M]),{listRef:T,handleKeyDown:$,focusFirst:_,focusItem:R,ownsEvent:N,getItems:H}=Ed({itemSelector:$5,boundarySelector:A5,wrap:!1,onEscape:()=>D({focusTrigger:!0})}),B=C5({getItemLabels:()=>H().map(U=>U.textContent),onMatch:R,getCurrentIndex:()=>H().findIndex(U=>U===document.activeElement||U.contains(document.activeElement))}),{triggerProps:I,contentProps:L}=AD({show:E,hide:z,isOpen:j,isEnabled:v}),O=p.useCallback(U=>{v&&(M.show(),U!=null&&U.focusFirst&&requestAnimationFrame(()=>{var ie;_()||(ie=T.current)==null||ie.focus()}))},[v,M,_,T]),D=p.useCallback(U=>{var X;M.hide(),(U==null?void 0:U.focusTrigger)!==!1&&((X=b.current)==null||X.focus())},[M]),q=p.useCallback(U=>{b.current=U,M.ref(U)},[M]),F=p.useCallback(()=>{r||(j?D({focusTrigger:!0}):O({focusFirst:!0}))},[r,j,O,D]),K=p.useCallback(U=>{if(r)return;const ie=(typeof window<"u"&&b.current?window.getComputedStyle(b.current).direction==="rtl":!1)?"ArrowLeft":"ArrowRight";(U.key===ie||U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),O({focusFirst:!0}))},[r,O]),Z=p.useCallback(U=>xS(U,r),[r]),se=p.useCallback(U=>{if(!N(U))return;if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),D({focusTrigger:!0});return}if(U.key==="Enter"||U.key===" "){U.preventDefault();const te=document.activeElement;te&&dg.has(te.getAttribute("role")??"")&&te.click();return}const ie=(typeof window<"u"&&T.current?window.getComputedStyle(T.current).direction==="rtl":!1)?"ArrowRight":"ArrowLeft";if(U.key===ie){U.preventDefault(),D({focusTrigger:!0});return}if(B.onKeyDown(U)){U.preventDefault();return}$(U)},[N,D,$,B,T]),ne=p.useMemo(()=>({menuSize:y,closeMenu:()=>{D({focusTrigger:!1}),g==null||g.closeMenu()}}),[y,D,g]),ue=i?a.jsx("span",{...ee(J("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:a.jsx(Jt,{size:"sm"})}):a.jsx("span",{...ee(J("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:a.jsx(ze,{icon:"chevronRight",size:"sm",color:"secondary"})}),P=o?Zb.popoverCustomWidth(o):Zb.popover;return a.jsxs(a.Fragment,{children:[a.jsx(Td,{ref:U=>q(U),id:k,role:"menuitem",tabIndex:r?void 0:-1,"aria-haspopup":"menu","aria-expanded":j,"aria-controls":j?m:void 0,"aria-disabled":r||void 0,"data-testid":h,onMouseEnter:I.onMouseEnter,onMouseLeave:I.onMouseLeave,onPointerMove:Z,startContent:t?ni(t,{size:"sm",color:"secondary"}):void 0,label:n,description:s,endContent:ue,onClick:F,onKeyDown:K,isDisabled:r,xstyle:[$m.root,MD[y],j&&$m.open,r&&$m.disabled,u],...ee(J("dropdown-menu-item",{size:y}),{className:d,style:f})}),M.render(a.jsx("div",{ref:T,id:m,role:"menu",tabIndex:-1,"aria-labelledby":k,onKeyDown:se,onMouseEnter:L.onMouseEnter,onMouseLeave:L.onMouseLeave,"data-testid":x,...ee(J("dropdown-menu"),{className:"x9f619 x78zum5 xdt5ytf x1lsbc85 xuyqlj2 x1odjw0f x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92"}),children:a.jsx(ah,{value:ne,children:c})}),{placement:"end",alignment:"start",xstyle:[P,go.end]})]})}gS.displayName="DropdownMenuSubMenu";const zD={divider:{kqGvvJ:"xsq74q5",$$css:!0}};function Am(e){return`item-${e.label}`}function ND(e,t){return`section-${e.title??t}`}function M5(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n];"type"in s&&s.type==="divider"?t.push(a.jsx(ja,{xstyle:zD.divider,...J("dropdown-menu-divider")},`divider-${n}`)):"type"in s&&s.type==="section"?t.push(a.jsxs("div",{role:"group","aria-label":s.title,children:[s.title&&a.jsx("div",{"aria-hidden":"true",...ee(J("dropdown-menu-section-heading"),{className:"xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"}),children:s.title}),s.items.map(r=>a.jsx(o1,{icon:r.icon,label:r.label,onClick:r.onClick,isDisabled:r.isDisabled},Am(r)))]},ND(s,n))):"type"in s||(s.items&&s.items.length>0?t.push(a.jsx(gS,{icon:s.icon,label:s.label,isDisabled:s.isDisabled,children:M5(s.items)},Am(s))):t.push(a.jsx(o1,{icon:s.icon,label:s.label,onClick:s.onClick,isDisabled:s.isDisabled},Am(s))))}return t}function _D(e){return typeof e=="string"||typeof e=="number"}function Yb(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Pi({children:e,anchorRef:t,content:n,placement:s="above",alignment:r="center",delay:i=200,hideDelay:o=0,focusTrigger:l="auto",isEnabled:c=!0,onOpenChange:u,hasHoverIndication:d="auto",isOpen:f,isDefaultOpen:h}){const x=p.useRef(null),g=e!=null?_D(e):!1,y=d===!0||d==="auto"&&g,v=p.useCallback(()=>{u==null||u(!0)},[u]),m=p.useCallback(()=>{u==null||u(!1)},[u]),k=Es({placement:s,alignment:r,delay:i,hideDelay:o,focusTrigger:l,isEnabled:c,isOpen:f,isDefaultOpen:h,onShow:v,onHide:m});return Ii(()=>{if(!t)return;const b=t.current;if(!b)return;k.ref(b);const j=b.getAttribute("aria-describedby");return b.setAttribute("aria-describedby",Yb(j,k.describedBy)??""),()=>{k.ref(null),j?b.setAttribute("aria-describedby",j):b.removeAttribute("aria-describedby")}},[t,k.ref,k.describedBy]),Ii(()=>{if(t||g)return;const b=x.current;if(!b)return;const j=b.firstElementChild;if(!j)return;k.ref(j);const A=j.getAttribute("aria-describedby");return j.setAttribute("aria-describedby",Yb(A,k.describedBy)??""),()=>{k.ref(null),A?j.setAttribute("aria-describedby",A):j.removeAttribute("aria-describedby")}},[t,g,k.ref,k.describedBy]),t&&e==null?a.jsx(a.Fragment,{children:k.renderTooltip(n)}):g?a.jsxs(a.Fragment,{children:[a.jsx("span",{ref:k.ref,tabIndex:0,"aria-describedby":k.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 xrys4gj"}}[!!y<<0],children:e}),k.renderTooltip(n)]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,className:"xjp7ctv",children:e}),k.renderTooltip(n)]})}Pi.displayName="Tooltip";const mS=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Pi},Symbol.toStringTag,{value:"Module"})),RD="data-astryx-live-region",ID="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;inset-block-start:0;inset-inline-start:0;pointer-events:none;user-select:none;",LD=2e3,Vp={polite:null,assertive:null};function yS(e){const t=Vp[e];t!=null&&(clearTimeout(t),Vp[e]=null)}function OD(e,t){yS(e),Vp[e]=setTimeout(()=>{Vp[e]=null,t.textContent=""},LD)}let Kr=null;function Qb(e){const t=document.createElement("div");return t.setAttribute(RD,e),t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.setAttribute("role",e==="assertive"?"alert":"status"),t.style.cssText=ID,document.body.appendChild(t),t}function DD(){return typeof document>"u"?null:Kr?(Kr.polite.isConnected||document.body.appendChild(Kr.polite),Kr.assertive.isConnected||document.body.appendChild(Kr.assertive),Kr):(Kr={polite:Qb("polite"),assertive:Qb("assertive")},Kr)}function BD(e,t){const n=DD();if(!n)return;const s=t==="assertive"?n.assertive:n.polite;s.textContent="",requestAnimationFrame(()=>{s.textContent=e}),OD(t,s)}function HD(e){if(yS(e),!Kr)return;const t=e==="assertive"?Kr.assertive:Kr.polite;t.textContent=""}function bc(){return p.useCallback((e,t="polite")=>{if(!e){HD(t);return}BD(e,t)},[])}const qD={wrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kmuXW:"x2lah0s",$$css:!0}},PD={ctrl:"⌃",alt:"⌥",shift:"⇧",enter:"↵",backspace:"⌫",escape:"Esc",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",plus:"+"};function UD(e,t){return e==="mod"?t?"⌘":"Ctrl":PD[e]??e.toUpperCase()}const FD={ctrl:"Control",alt:"Alt",shift:"Shift",enter:"Enter",backspace:"Backspace",escape:"Escape",tab:"Tab",up:"Up arrow",down:"Down arrow",left:"Left arrow",right:"Right arrow",plus:"Plus"};function VD(e,t){return e==="mod"?t?"Command":"Control":FD[e]??e.toUpperCase()}function GD(){return()=>{}}function WD(){return!1}function KD(){if(typeof navigator>"u")return!1;const e="userAgentData"in navigator?navigator.userAgentData:null;return e&&typeof e=="object"&&"platform"in e?/mac/i.test(e.platform??""):/Mac|iPhone|iPad|iPod/.test(navigator.platform??"")}function vS({keys:e,ref:t,xstyle:n,className:s,style:r,...i}){const o=p.useSyncExternalStore(GD,KD,WD),l=e.split("+").map(u=>u.trim().toLowerCase()),c=l.map(u=>VD(u,o)).join(" + ");return a.jsx("span",{...i,ref:t,role:"img","aria-label":c,...ee(J("kbd"),W(qD.wrapper,n),s,r),children:l.map(u=>a.jsx("kbd",{"aria-hidden":"true",className:"x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle xv1l7n4 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o",children:UD(u,o)},u))})}vS.displayName="Kbd";const XD=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),ZD={horizontal:["left","right"],vertical:["up","down"],both:["left","right","up","down"]},YD={hint:{kVAEAm:"xixxii4",kpwlN0:"x1anvkwx",kogj98:"x1ghz6dp",kWkggS:"x1prclbq",kaIpWk:"xh6dtrn",kGVxlE:"x1i5ehqx",kLKAdn:"xfsso4q",kGO01o:"xy143xn",kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",khDVqt:"xuxw1ft",kSiTet:"xg01cxk xofkqq2",k1ekBW:"xsm4mo9",kIyJzY:"xx6bhzk",kzIqYQ:"xd00j3c",kfzvcC:"x47corl",$$css:!0}};function kS(e={}){const{orientation:t="horizontal",dismissAfterMs:n=3e3,isEnabled:s=!0}=e,r=Me(),i=p.useRef(null),o=p.useRef(!1),l=p.useRef(!1),c=p.useRef(()=>{}),u=p.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),d=p.useCallback(()=>{l.current=!0},[]),f=p.useCallback(()=>{l.current=!1,u(),c.current(null)},[u]),h=Cd({mode:"context",onShow:d,onHide:f});c.current=h.ref;const x=p.useCallback(()=>{o.current=!0,u(),h.hide(),l.current=!1,c.current(null)},[u,h]),g=p.useCallback(j=>{o.current||!s||(c.current(j),h.show(),u(),i.current=setTimeout(()=>{x()},n))},[u,x,n,s,h]);p.useEffect(()=>()=>{u(),c.current(null)},[u]);const y=p.useCallback(j=>{if(o.current||!s)return;const A=j.target;if(!A.matches(":focus-visible"))return;const M=j.currentTarget;j.relatedTarget instanceof Node&&M.contains(j.relatedTarget)||g(A)},[g,s]),v=p.useCallback(j=>{if(!l.current)return;const A=j.currentTarget;if(j.relatedTarget instanceof Node&&A.contains(j.relatedTarget)){!o.current&&j.relatedTarget instanceof HTMLElement&&c.current(j.relatedTarget);return}x()},[x]),m=p.useCallback(j=>{l.current&&XD.has(j.key)&&x()},[x]),k=a.jsx("span",{className:"x3nfvp2 x6s0dn4 xzye2dw",children:ZD[t].map(j=>a.jsx(vS,{keys:j},j))});return{hintElement:h.render(a.jsxs("span",{"aria-hidden":"true",children:[k,a.jsx("span",{className:"x11g1kdw",children:r("@astryx.keyboardHint.toNavigate")})]}),{placement:"below",alignment:"start",xstyle:YD.hint,style:{marginBlockStart:jr["--spacing-2"]}}),onFocus:y,onBlur:v,onKeyDown:m}}function bS(e){p.useEffect(()=>{if(!e)return;const t=window.scrollX,n=window.scrollY,{body:s}=document,r=s.style.overflow,i=s.style.position,o=s.style.top,l=s.style.left,c=s.style.right;return s.style.overflow="hidden",s.style.position="fixed",s.style.top=`-${n}px`,s.style.left="0",s.style.right="0",()=>{s.style.overflow=r,s.style.position=i,s.style.top=o,s.style.left=l,s.style.right=c,window.scrollTo(t,n)}},[e])}let wS=!1;typeof window<"u"&&requestAnimationFrame(()=>{wS=!0});const QD={slideDown:{kKVMdj:"x1srr2gu x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},slideUp:{kKVMdj:"x1dvww92 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},fadeIn:{kKVMdj:"xqcmdr3 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},scaleIn:{kKVMdj:"x97zbip x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0}};function JD(e="slideDown"){const[t]=p.useState(()=>wS);return t?QD[e]:null}const eB=50;function tB(e){const t=e.match(/^([\d.]+)ms$/);if(t)return parseFloat(t[1]);const n=e.match(/^([\d.]+)s$/);return n?parseFloat(n[1])*1e3:null}const nB={natural:10,fast:4,instant:1/0};function sB(e,t,n){const s="natural",r=nB[s],{token:i}=lg(),o=p.useMemo(()=>{const v=tB(i("--duration-fast-min"));if(v==null)return eB;const m=v/10;return Math.max(4,Math.round(m))},[i,s]),[l,c]=p.useState(0),u=p.useRef(e),d=p.useRef(0),f=p.useRef(0),h=p.useRef(null);u.current=e;const x=p.useRef(e.length);e.length!==x.current&&(x.current=e.length,e.length===0&&l!==0&&(d.current=0,c(0)));const g=p.useRef(t);t!==g.current&&(g.current=t,!t&&e.length>0&&(d.current=e.length,c(e.length)));const y=Pa("(prefers-reduced-motion: reduce)");return p.useEffect(()=>{if(!t||s==="instant"||y)return;function v(m){if(m-f.current>=o){f.current=m;const b=u.current,j=d.current;if(j<b.length){const A=Math.min(j+r,b.length);d.current=A,c(A)}}h.current=requestAnimationFrame(v)}return h.current=requestAnimationFrame(v),()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null)}},[t,r,o,s,y]),!t||s==="instant"||y?e:e.slice(0,l)}const rB=new Set(["text","password","email","number","search","tel","url","date","datetime-local","month","time","week"]),iB=new Set(["true","menu","listbox","tree","grid","dialog"]);function oB(e){if(e.getAttribute("role")==="combobox")return!0;const t=e.getAttribute("aria-haspopup");return t!=null&&iB.has(t)}function T5({containerRef:e,inputRef:t,disabled:n=!1}){const s=p.useCallback(()=>{const r=t.current;r!=null&&(r instanceof HTMLElement&&oB(r)?r.click():r instanceof HTMLInputElement&&rB.has(r.type)||r instanceof HTMLTextAreaElement?r.focus():r instanceof HTMLElement?r.click():"focus"in r&&r.focus())},[t]);return E5({containerRef:e,interactiveRef:t,onClick:s,disabled:n})}const aB={warning:"warning",error:"error",success:"success"},lB={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function jS({status:e,statusVariant:t="attached",isInGroup:n=!1,size:s="md"}){const r=Me(),o=t==="tooltip"&&!!(e!=null&&e.message),[l,c]=p.useState(void 0),u=Es({placement:"above",isEnabled:o,isOpen:l}),d=p.useCallback(()=>{c(void 0)},[]),f=p.useCallback(()=>{typeof window>"u"||typeof window.matchMedia!="function"||!window.matchMedia("(hover: none)").matches||c(g=>g!==!0)},[]);if(p.useEffect(()=>{if(l!==!0)return;const g=y=>{y.key==="Escape"&&c(void 0)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l]),!(!!e&&!n&&t!=="detached"))return{statusIcon:null,describedBy:void 0};const x=a.jsx(ze,{icon:aB[e.type],size:s,color:e.type,...J("input-status-icon",{size:s,status:e.type})});return o?{statusIcon:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",ref:u.ref,"aria-label":r(lB[e.type]),"aria-describedby":u.describedBy,onClick:f,onBlur:d,className:"x3nfvp2 x6s0dn4 xl56j7k x1717udv x1ghz6dp x1heor9g x1ypdohk xjspbzw x784prv x9v5kkp xzunyri x7s97pk",children:x}),u.renderTooltip(e.message)]}),describedBy:u.describedBy}:{statusIcon:x,describedBy:void 0}}const z5=p.createContext(null);z5.displayName="InteractiveRoleContext";function cB(){return p.use(z5)}function SS({href:e,onClick:t,isDisabled:n=!1}){const s=cB();return e!=null&&!n?"link":t!=null?"button":s??"inert"}const uB=500,dB=10;function fB(e){const{onLongPress:t,disabled:n=!1,delayMs:s=uB,moveCancelPx:r=dB}=e,i=p.useRef(null),o=p.useRef(null),l=p.useRef(t);l.current=t;const c=p.useCallback(()=>{i.current!=null&&(clearTimeout(i.current),i.current=null),o.current=null},[]),u=p.useCallback(f=>{if(n||f.touches.length!==1)return;const h=f.touches[0];c(),o.current={x:h.clientX,y:h.clientY},i.current=setTimeout(()=>{const x=o.current;x!=null&&l.current({x:x.x,y:x.y})},s)},[n,s,c]),d=p.useCallback(f=>{const h=o.current;if(h==null||f.touches.length!==1)return;const x=f.touches[0];(Math.abs(x.clientX-h.x)>r||Math.abs(x.clientY-h.y)>r)&&c()},[r,c]);return p.useEffect(()=>c,[c]),{onTouchStart:u,onTouchMove:d,onTouchEnd:c,onTouchCancel:c}}const N5=6,hB={x177fznd:"x177fznd",$$css:!0},Rh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x1ue31p x134zogi x7so5qh x1eb35i0",kSiTet:"xg01cxk xz63v9m x1ceiq2s xhva3ql",kVAEAm:"x10l6tqk xd2i8i8 xw895rg x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xz63v9m x1ceiq2s xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1d23w33",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1d23w33",$$css:!0}},pB={x1e36hu2:"x1e36hu2",$$css:!0},Ih={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xqw8whb x1xhgmdq x7so5qh x1eb35i0",kSiTet:"xg01cxk x7g73g2 x8e9lel xhva3ql",kVAEAm:"x10l6tqk x13sqjsa xxj8d0r x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x7g73g2 x8e9lel xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x19f70rm",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x19f70rm",$$css:!0}},xB={x10zkftw:"x10zkftw",$$css:!0},Lh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xrhii57 xeozflw x7so5qh x1eb35i0",kSiTet:"xg01cxk xe0m1oz xtpmopf xhva3ql",kVAEAm:"x10l6tqk x1k2a1sm xs5no71 x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xe0m1oz xtpmopf xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xramsae",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xramsae",$$css:!0}},gB={xbjq1vy:"xbjq1vy",$$css:!0},Oh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xtj9ir3 x1okg2q x7so5qh x1eb35i0",kSiTet:"xg01cxk xnsjgr4 x1y0vk26 xhva3ql",kVAEAm:"x10l6tqk x1cuf62g x1qy2sty x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xnsjgr4 x1y0vk26 xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x177ftvf",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x177ftvf",$$css:!0}},mB={x3z7t8n:"x3z7t8n",$$css:!0},Dh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x1ybz0u4 x1fpm3bq x7so5qh x1eb35i0",kSiTet:"xg01cxk x1qps2i7 x1a7n03g xhva3ql",kVAEAm:"x10l6tqk xeilikp x1xz04m3 x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x1qps2i7 x1a7n03g xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1k1siky",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1k1siky",$$css:!0}},yB={x6dglqq:"x6dglqq",$$css:!0},Bh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x17lvmk x192eg1j x7so5qh x1eb35i0",kSiTet:"xg01cxk x52nu6g xt179ik xhva3ql",kVAEAm:"x10l6tqk x8j1s1q x8gw32m x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x52nu6g xt179ik xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xenj0cg",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xenj0cg",$$css:!0}},vB=[{marker:hB,reveal:Rh.reveal,revealLayoutPreserved:Rh.revealLayoutPreserved,conceal:Rh.conceal,concealLayoutPreserved:Rh.concealLayoutPreserved},{marker:pB,reveal:Ih.reveal,revealLayoutPreserved:Ih.revealLayoutPreserved,conceal:Ih.conceal,concealLayoutPreserved:Ih.concealLayoutPreserved},{marker:xB,reveal:Lh.reveal,revealLayoutPreserved:Lh.revealLayoutPreserved,conceal:Lh.conceal,concealLayoutPreserved:Lh.concealLayoutPreserved},{marker:gB,reveal:Oh.reveal,revealLayoutPreserved:Oh.revealLayoutPreserved,conceal:Oh.conceal,concealLayoutPreserved:Oh.concealLayoutPreserved},{marker:mB,reveal:Dh.reveal,revealLayoutPreserved:Dh.revealLayoutPreserved,conceal:Dh.conceal,concealLayoutPreserved:Dh.concealLayoutPreserved},{marker:yB,reveal:Bh.reveal,revealLayoutPreserved:Bh.revealLayoutPreserved,conceal:Bh.conceal,concealLayoutPreserved:Bh.concealLayoutPreserved}],yy=new Array(N5).fill(!1);function kB(){for(let e=0;e<N5;e++)if(!yy[e])return yy[e]=!0,{index:e,isExhausted:!1};return{index:0,isExhausted:!0}}function bB(e,t){t||(yy[e]=!1)}const Jb=Object.freeze({});function wB(e={}){const{isEnabled:t=!0}=e,[n]=p.useState(()=>t?kB():null);if(p.useEffect(()=>{if(n!=null)return()=>bB(n.index,n.isExhausted)},[n]),Ad("useContainerReveal",`More than ${N5} reveal containers are mounted at once; nested containers beyond the pool may share a marker. Add markers to containerReveal.pool.stylex.ts and raise POOL_SIZE.`,(n==null?void 0:n.isExhausted)??!1),n==null)return{getContainerProps:()=>Jb,getContentRevealProps:()=>Jb};const s=vB[n.index];return{getContainerProps:()=>W(s.marker),getContentRevealProps:(r={})=>{const{isRevealInverted:i=!1,isLayoutPreserved:o=!1}=r,l=i?o?s.concealLayoutPreserved:s.conceal:o?s.revealLayoutPreserved:s.reveal;return W(l)}}}const Mm={label:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",$$css:!0},labelDisabled:{kMwMTN:"xnbbluu",kkrTdU:"x1h6gzvc",$$css:!0},srOnly:{ksu8eU:"xng3xce",kMcinP:"xzpqnlu",kZKoxP:"xjm9jq1",kLqNvP:"x1o0tod",kogj98:"xkdpibf",kVQacm:"xb3r6kr",kmVPX3:"x1717udv",kfzvcC:"x47corl",kVAEAm:"x10l6tqk",k87sOh:"x13vifvy",kfSwDN:"x87ps6o",khDVqt:"xuxw1ft",kzqmXN:"x1i1rx1s",$$css:!0}};function fg({label:e,inputID:t,labelID:n,isGroupLabel:s=!1,isLabelHidden:r=!1,isDisabled:i=!1,isOptional:o=!1,isRequired:l=!1,labelIcon:c,labelTooltip:u,description:d,descriptionID:f,className:h,style:x,xstyle:g,ref:y,...v}){const m=Me(),k=o?m("@astryx.field.optional"):l?m("@astryx.field.required"):null,b=s?"span":"label",j=!s&&t!=null,A=p.useRef(null),M=p.useMemo(()=>({get current(){var T;return t==null?null:((T=A.current)==null?void 0:T.ownerDocument.getElementById(t))??null},set current(T){}}),[t]),E=T5({containerRef:A,inputRef:M,disabled:!j}),z=a.jsxs(a.Fragment,{children:[c&&ni(c,{size:"sm",color:"inherit"}),e,k&&a.jsxs("span",{className:"x1sodnla x141an7d x1ltkj2j xv1l7n4",children:[a.jsx("span",{"aria-hidden":"true",children:" ∙ "}),k]}),u&&a.jsx(Pi,{content:u,placement:"above",children:a.jsx(ze,{icon:"info",size:"sm",color:"inherit"})})]});return a.jsxs(a.Fragment,{children:[a.jsx(b,{ref:y,id:n,htmlFor:s?void 0:t,...v,...ee(J("field-label"),W(Mm.label,i&&Mm.labelDisabled,r&&Mm.srOnly,g),h,x),children:z}),d&&a.jsx("span",{ref:j?A:void 0,id:f,...j?E:void 0,...{0:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4"},2:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 x1ypdohk"},1:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 xng3xce xzpqnlu xjm9jq1 x1o0tod xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"},3:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 x1o0tod xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"}}[!!j<<1|!!r<<0],children:d})]})}fg.displayName="FieldLabel";const jB={warning:"warning",error:"error",success:"success"},Tm={base:{kMv6JI:"x9ynric",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},attached:{keoZOQ:"x1c40v9y",kLKAdn:"x1ak3mig",kGO01o:"x1wesfrj",kg3NbH:"xf314gf",kVL7Gh:"xquck67",kT0f0o:"x14i3lts",$$css:!0},detached:{keoZOQ:"xcsaf9d",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"xh6dtrn",$$css:!0}},SB={warning:{kWkggS:"x24i8r5",kMwMTN:"xdhq94a",$$css:!0},error:{kWkggS:"x1pritpl",kMwMTN:"x1joocv1",$$css:!0},success:{kWkggS:"xu13z74",kMwMTN:"xltfdvo",$$css:!0}};function lh({ref:e,type:t,message:n,id:s,variant:r="attached",xstyle:i,className:o,style:l,...c}){const u=JD("slideDown"),d=bc();return p.useEffect(()=>{n&&d(n,t==="error"?"assertive":"polite")},[d,n,t]),a.jsx("div",{ref:e,id:s,...c,...ee(J("field-status",{type:t,variant:r}),W(Tm.base,u,r==="attached"?Tm.attached:Tm.detached,SB[t],i),o,l),children:r==="detached"?a.jsxs("span",{className:"x78zum5 x1cy8zhl xzye2dw",children:[a.jsx("span",{className:"x3nfvp2 x6s0dn4 x14o5nre x2lah0s",children:a.jsx(ze,{icon:jB[t],size:"sm",color:"inherit",...J("field-status-icon",{type:t})})}),a.jsx("span",{children:n})]}):n})}lh.displayName="FieldStatus";const CB={x1tspnpo:"x1tspnpo",$$css:!0},hg=p.createContext(null);hg.displayName="CheckboxListContext";const ys={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerLabelHidden:{kOIVth:"xxhr3t",$$css:!0},checkboxWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},checkbox:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kaIpWk:"xx3sua9",k1ekBW:"xts7igz",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},checkboxFocus:{kI3sdo:"x1a2a7pz xkri23q",kInvED:"x81n7kt",$$css:!0},checkboxUnchecked:{kMwMTN:"xqwr325",kVAM5u:"xvy26l8 x1jtjlen",kWkggS:"x10xzikg xrsv7h",$$css:!0},checkboxChecked:{kMwMTN:"x17wrial",kVAM5u:"xad5do x1od6ugu",kWkggS:"x1ewilqj x6aeo4j",$$css:!0},checkboxDisabled:{kSiTet:"xbyyjgo",kVAM5u:"x14i3s5s xmt8yqp",$$css:!0},checkboxDisabledUnchecked:{kWkggS:"xwmxj5m x1cjfj8k",$$css:!0},checkmark:{k1xSpc:"x1s85apg",kMwMTN:"x17wrial xs5hli",$$css:!0},checkmarkVisible:{k1xSpc:"x1lliihq",$$css:!0},indeterminateMark:{k1xSpc:"x1s85apg",kWkggS:"x1azo05 xwvh9j7",kaIpWk:"xjspbzw",$$css:!0},indeterminateMarkVisible:{k1xSpc:"x1lliihq",$$css:!0}},e6={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},EB={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},$B={sm:{kzqmXN:"xsmyaan",kZKoxP:"x1kpxq89",$$css:!0},md:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0}},AB={sm:{kzqmXN:"x1fsd2vl",kZKoxP:"x36qwtl",$$css:!0},md:{kzqmXN:"xsmyaan",kZKoxP:"x36qwtl",$$css:!0}},MB={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function ch({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:r,isLoading:i=!1,value:o,isDisabled:l=!1,htmlName:c,disabledMessage:u,isReadOnly:d=!1,isOptional:f=!1,isRequired:h=!1,size:x="md",onFocus:g,onBlur:y,labelIcon:v,status:m,width:k,xstyle:b,className:j,style:A,ref:M,...E}){const z=p.useId(),T=p.useId(),$=p.useId(),[,_]=p.useTransition(),[R,N]=p.useOptimistic(o),H=i||R!==o,B=l&&!!u,I=p.use(hg),L=l&&(B||((I==null?void 0:I.hasDisabledMessage)??!1)),O=Es({placement:"above",focusTrigger:"always",isEnabled:B}),D=R==="indeterminate",q=R===!0,F=q||D,K=p.useCallback(ne=>{ne&&(ne.indeterminate=D)},[D]),Z=[];n&&Z.push(T),m!=null&&m.message&&Z.push($),B&&Z.push(O.describedBy);const se=Z.length>0?Z.join(" "):void 0;return a.jsxs("div",{...ee(J("checkbox-input",{size:x}),W(k!=null&&MB.width(k),b),j,A),children:[a.jsxs("div",{ref:ne=>{O.interactionRef(ne)},...W(ys.container,t&&ys.containerLabelHidden,!l&&CB),children:[a.jsxs("div",{...W(ys.checkboxWrapper,e6[x]),children:[a.jsx("input",{...E,ref:Wt(M,K,O.positionRef),id:z,type:"checkbox",name:l?void 0:c,checked:q,disabled:l&&!L,"aria-disabled":L?"true":void 0,readOnly:d,required:h,onChange:ne=>{if(l||H||d)return;const ue=ne.target.checked;s==null||s(ue,ne),r&&!ne.defaultPrevented&&_(async()=>{N(ue),await r(ue,ne)})},onFocus:g,onBlur:y,"aria-readonly":d||void 0,"aria-describedby":se,"aria-invalid":(m==null?void 0:m.type)==="error"?!0:void 0,"aria-busy":H||void 0,...W(ys.input,e6[x],l&&ys.inputDisabled)}),a.jsx("div",{"aria-hidden":"true",...ee(J("checkbox",{size:x,checked:q?"checked":D?"indeterminate":null,disabled:l?"disabled":null}),W(ys.checkbox,EB[x],!l&&ys.checkboxFocus,F?ys.checkboxChecked:ys.checkboxUnchecked,l&&ys.checkboxDisabled,l&&!F&&ys.checkboxDisabledUnchecked)),children:H?a.jsx(Jt,{size:"sm",shade:"inherit"}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{viewBox:"0 0 10 10",...W(ys.checkmark,$B[x],q&&ys.checkmarkVisible),children:a.jsx("path",{d:"M8.5 2.5L4 7.5L1.5 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}),a.jsx("div",{...W(ys.indeterminateMark,AB[x],D&&ys.indeterminateMarkVisible)})]})})]}),a.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:a.jsx(fg,{label:e,inputID:z,isLabelHidden:t,isDisabled:l,isOptional:f,isRequired:h,labelIcon:v,description:n,descriptionID:T})})]}),(m==null?void 0:m.message)&&a.jsx(lh,{type:m.type,message:m.message,id:$,variant:"detached"}),B&&O.renderTooltip(u)]})}ch.displayName="CheckboxInput";function un({icon:e,...t}){return a.jsx(Q,{...t,icon:e,isIconOnly:!0})}un.displayName="IconButton";const t6={container:{kB7OPa:"x9f619",kZCmMZ:"x1c35znw",kwRFfy:"x64h4k7",kLKAdn:"x14m0hsi",kGO01o:"xc1wllq",$$css:!0}},TB={containerPaddingInlineStart:{"--container-padding-inline-start":"xjmlhfd",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"x1ihxwbr",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x1rqz8me",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1omyuck",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x14rzhog",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"xjej9fs",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x4poyjn",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"x1u1kw4e",$$css:!0}},zB={containerPaddingInlineStart:{"--container-padding-inline-start":"xrgx2ny",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"xyk0j9o",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x876hks",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1u89lk7",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x12sptzx",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"xo78phr",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x1we69p7",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"xsdnkbz",$$css:!0}},NB={containerPaddingInlineStart:{"--container-padding-inline-start":"x1tewnwq",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"x11h1f2o",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x1g2kccc",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1gvthzm",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x1hsjncj",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"x1pui4bz",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x2so38",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"xinu7xd",$$css:!0}},_B={card:TB,section:zB,dialog:NB},RB={spacing0:{"--container-padding-inline-start":"x1gu2k80",$$css:!0},spacing0_5:{"--container-padding-inline-start":"x14ws0sr",$$css:!0},spacing1:{"--container-padding-inline-start":"x1cvlban",$$css:!0},spacing1_5:{"--container-padding-inline-start":"x176g23i",$$css:!0},spacing2:{"--container-padding-inline-start":"x1xlrr2o",$$css:!0},spacing3:{"--container-padding-inline-start":"xfdwxua",$$css:!0},spacing4:{"--container-padding-inline-start":"x1dlhslv",$$css:!0},spacing5:{"--container-padding-inline-start":"x1s81nki",$$css:!0},spacing6:{"--container-padding-inline-start":"x1ep0dkj",$$css:!0},spacing7:{"--container-padding-inline-start":"x157xojc",$$css:!0},spacing8:{"--container-padding-inline-start":"xw1diwv",$$css:!0},spacing9:{"--container-padding-inline-start":"xraca2a",$$css:!0},spacing10:{"--container-padding-inline-start":"xserb3f",$$css:!0},spacing11:{"--container-padding-inline-start":"xziclwo",$$css:!0},spacing12:{"--container-padding-inline-start":"x1iiwihq",$$css:!0}},IB={spacing0:{"--container-padding-inline-end":"x91ghl5",$$css:!0},spacing0_5:{"--container-padding-inline-end":"x1wz3t3y",$$css:!0},spacing1:{"--container-padding-inline-end":"x2oyxnl",$$css:!0},spacing1_5:{"--container-padding-inline-end":"xntetml",$$css:!0},spacing2:{"--container-padding-inline-end":"xcas3b9",$$css:!0},spacing3:{"--container-padding-inline-end":"xu0ipoa",$$css:!0},spacing4:{"--container-padding-inline-end":"xs0pscg",$$css:!0},spacing5:{"--container-padding-inline-end":"xgkj7vj",$$css:!0},spacing6:{"--container-padding-inline-end":"x94cj42",$$css:!0},spacing7:{"--container-padding-inline-end":"x11tj35w",$$css:!0},spacing8:{"--container-padding-inline-end":"x1b9k1pi",$$css:!0},spacing9:{"--container-padding-inline-end":"x19w02kr",$$css:!0},spacing10:{"--container-padding-inline-end":"xx5lg5w",$$css:!0},spacing11:{"--container-padding-inline-end":"x1nmgbqg",$$css:!0},spacing12:{"--container-padding-inline-end":"x1wsfsk2",$$css:!0}},LB={spacing0:{"--container-padding-block-start":"x1i3qcxz",$$css:!0},spacing0_5:{"--container-padding-block-start":"xvdf9ev",$$css:!0},spacing1:{"--container-padding-block-start":"xnsckjb",$$css:!0},spacing1_5:{"--container-padding-block-start":"x1kbx601",$$css:!0},spacing2:{"--container-padding-block-start":"xa8b4fq",$$css:!0},spacing3:{"--container-padding-block-start":"x11k4f5r",$$css:!0},spacing4:{"--container-padding-block-start":"xm01sq8",$$css:!0},spacing5:{"--container-padding-block-start":"xp8wdkl",$$css:!0},spacing6:{"--container-padding-block-start":"x1hmud4d",$$css:!0},spacing7:{"--container-padding-block-start":"x1c00sag",$$css:!0},spacing8:{"--container-padding-block-start":"xfv60at",$$css:!0},spacing9:{"--container-padding-block-start":"x14fzdu7",$$css:!0},spacing10:{"--container-padding-block-start":"x17h9kl7",$$css:!0},spacing11:{"--container-padding-block-start":"x1rdjxae",$$css:!0},spacing12:{"--container-padding-block-start":"xecwdl6",$$css:!0}},OB={spacing0:{"--container-padding-block-end":"xkunwnr",$$css:!0},spacing0_5:{"--container-padding-block-end":"x1cao3zv",$$css:!0},spacing1:{"--container-padding-block-end":"x57a7ii",$$css:!0},spacing1_5:{"--container-padding-block-end":"xv53x8y",$$css:!0},spacing2:{"--container-padding-block-end":"x1lsgcmx",$$css:!0},spacing3:{"--container-padding-block-end":"x1q3ppug",$$css:!0},spacing4:{"--container-padding-block-end":"x4hfsld",$$css:!0},spacing5:{"--container-padding-block-end":"xbib2ws",$$css:!0},spacing6:{"--container-padding-block-end":"x1q8d17g",$$css:!0},spacing7:{"--container-padding-block-end":"x1yqogew",$$css:!0},spacing8:{"--container-padding-block-end":"x8lgq76",$$css:!0},spacing9:{"--container-padding-block-end":"x1f7f9rt",$$css:!0},spacing10:{"--container-padding-block-end":"x15vxphk",$$css:!0},spacing11:{"--container-padding-block-end":"x4bg2x9",$$css:!0},spacing12:{"--container-padding-block-end":"x186mjxr",$$css:!0}},DB={spacing0:{"--layout-padding-outer-x":"xswhm3q",$$css:!0},spacing0_5:{"--layout-padding-outer-x":"xihiwg7",$$css:!0},spacing1:{"--layout-padding-outer-x":"xc96xmq",$$css:!0},spacing1_5:{"--layout-padding-outer-x":"x1u93lgd",$$css:!0},spacing2:{"--layout-padding-outer-x":"x15dxnc0",$$css:!0},spacing3:{"--layout-padding-outer-x":"xadgj3j",$$css:!0},spacing4:{"--layout-padding-outer-x":"x1v56qcf",$$css:!0},spacing5:{"--layout-padding-outer-x":"x1nzs0gl",$$css:!0},spacing6:{"--layout-padding-outer-x":"x1c3n52a",$$css:!0},spacing7:{"--layout-padding-outer-x":"x1gfiokx",$$css:!0},spacing8:{"--layout-padding-outer-x":"x1t3kfz",$$css:!0},spacing9:{"--layout-padding-outer-x":"xzr4qsh",$$css:!0},spacing10:{"--layout-padding-outer-x":"x1jdf5a4",$$css:!0},spacing11:{"--layout-padding-outer-x":"x1hct0t0",$$css:!0},spacing12:{"--layout-padding-outer-x":"x11cyqoe",$$css:!0}},BB={spacing0:{"--layout-padding-outer-y":"x1mzf5mb",$$css:!0},spacing0_5:{"--layout-padding-outer-y":"x1vj96e0",$$css:!0},spacing1:{"--layout-padding-outer-y":"x1gpfxoh",$$css:!0},spacing1_5:{"--layout-padding-outer-y":"xd3dqby",$$css:!0},spacing2:{"--layout-padding-outer-y":"x10pz7y9",$$css:!0},spacing3:{"--layout-padding-outer-y":"x1p6yq3h",$$css:!0},spacing4:{"--layout-padding-outer-y":"xx738ci",$$css:!0},spacing5:{"--layout-padding-outer-y":"x6yxws5",$$css:!0},spacing6:{"--layout-padding-outer-y":"x180vrwl",$$css:!0},spacing7:{"--layout-padding-outer-y":"x1q6rme1",$$css:!0},spacing8:{"--layout-padding-outer-y":"xid7e43",$$css:!0},spacing9:{"--layout-padding-outer-y":"x1t5kicu",$$css:!0},spacing10:{"--layout-padding-outer-y":"x26l4wa",$$css:!0},spacing11:{"--layout-padding-outer-y":"x10zktp0",$$css:!0},spacing12:{"--layout-padding-outer-y":"x1yz3n6a",$$css:!0}},HB={spacing0:{"--layout-padding-inner-x":"xj1bl4l",$$css:!0},spacing0_5:{"--layout-padding-inner-x":"xlriy2h",$$css:!0},spacing1:{"--layout-padding-inner-x":"x6uuyak",$$css:!0},spacing1_5:{"--layout-padding-inner-x":"xd38f90",$$css:!0},spacing2:{"--layout-padding-inner-x":"xxqksqd",$$css:!0},spacing3:{"--layout-padding-inner-x":"x1fyui2f",$$css:!0},spacing4:{"--layout-padding-inner-x":"x1i2ajwi",$$css:!0},spacing5:{"--layout-padding-inner-x":"x1tac27u",$$css:!0},spacing6:{"--layout-padding-inner-x":"x1ntgf3t",$$css:!0},spacing7:{"--layout-padding-inner-x":"xhjd9tl",$$css:!0},spacing8:{"--layout-padding-inner-x":"xn7c84u",$$css:!0},spacing9:{"--layout-padding-inner-x":"xeqkbsz",$$css:!0},spacing10:{"--layout-padding-inner-x":"x1vf4qco",$$css:!0},spacing11:{"--layout-padding-inner-x":"xsmamsf",$$css:!0},spacing12:{"--layout-padding-inner-x":"x2xk2xj",$$css:!0}},qB={spacing0:{"--layout-padding-inner-y":"xwuefyo",$$css:!0},spacing0_5:{"--layout-padding-inner-y":"x180h0y5",$$css:!0},spacing1:{"--layout-padding-inner-y":"xmpug6m",$$css:!0},spacing1_5:{"--layout-padding-inner-y":"x1g8jpzm",$$css:!0},spacing2:{"--layout-padding-inner-y":"x1lksgje",$$css:!0},spacing3:{"--layout-padding-inner-y":"x4j7gld",$$css:!0},spacing4:{"--layout-padding-inner-y":"x1s3ehtl",$$css:!0},spacing5:{"--layout-padding-inner-y":"x1rj5eim",$$css:!0},spacing6:{"--layout-padding-inner-y":"x1ftgg6u",$$css:!0},spacing7:{"--layout-padding-inner-y":"x1ho74vh",$$css:!0},spacing8:{"--layout-padding-inner-y":"xm2cs6f",$$css:!0},spacing9:{"--layout-padding-inner-y":"x1vsq92b",$$css:!0},spacing10:{"--layout-padding-inner-y":"x18gbwmk",$$css:!0},spacing11:{"--layout-padding-inner-y":"x14zymzj",$$css:!0},spacing12:{"--layout-padding-inner-y":"xzfpkx9",$$css:!0}},PB={containerMaxHeight:e=>[{"--container-max-height":e!=null?"x18nyedi":e,$$css:!0},{"--x---container-max-height":e??void 0}]};function CS({padding:e="spacing4",paddingOuterX:t,paddingOuterY:n,paddingInnerX:s,paddingInnerY:r,useThemeDefault:i,maxHeight:o}){const l=t??e,c=n??e,u=s??e,d=r??e,f=o?PB.containerMaxHeight(o):null;if(i){const h=_B[i];return[t6.container,h.containerPaddingInlineStart,h.containerPaddingInlineEnd,h.containerPaddingBlockStart,h.containerPaddingBlockEnd,h.layoutPaddingOuterX,h.layoutPaddingOuterY,h.layoutPaddingInnerX,h.layoutPaddingInnerY,f]}return[t6.container,RB[l],IB[l],LB[c],OB[c],DB[l],BB[c],HB[u],qB[d],f]}const zm={card:{"--_card-radius":"x2kkz0m",kaIpWk:"x153u1i6",kVQacm:"x7giv3",kGVxlE:"x1p8z4y0",$$css:!0},withBorder:{kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",kZCmMZ:"xs19ii7",kwRFfy:"x12frdag",kLKAdn:"x1nex4ik",kGO01o:"xbv1mwh",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0}},UB={default:{kWkggS:"x1de1mus",$$css:!0},transparent:{kWkggS:"xjbqb8w",$$css:!0},muted:{kWkggS:"xwmxj5m",$$css:!0},blue:{kWkggS:"x1o0wnni",$$css:!0},cyan:{kWkggS:"x1rgj867",$$css:!0},gray:{kWkggS:"xspzpui",$$css:!0},green:{kWkggS:"x1sqjeoo",$$css:!0},orange:{kWkggS:"x1e9xt6e",$$css:!0},pink:{kWkggS:"xnpoty2",$$css:!0},purple:{kWkggS:"x16i6n6f",$$css:!0},red:{kWkggS:"x1cibrc5",$$css:!0},teal:{kWkggS:"x1jtji5o",$$css:!0},yellow:{kWkggS:"x1bo7t0x",$$css:!0}},FB={none:{"--_card-elevation":"xw28qpl",$$css:!0},low:{"--_card-elevation":"x1nn8khe",$$css:!0},med:{"--_card-elevation":"x1ovzxg0",$$css:!0},high:{"--_card-elevation":"xnpe7fx",$$css:!0}},VB={sizing:(e,t,n,s)=>[{kzqmXN:e!=null?"x5lhr3w":e,kZKoxP:t!=null?"x16ye13r":t,ks0D6T:n!=null?"xf68679":n,kAzted:s!=null?"x82snj4":s,$$css:!0},{"--x-width":(r=>typeof r=="number"?r+"px":r??void 0)(e),"--x-height":(r=>typeof r=="number"?r+"px":r??void 0)(t),"--x-maxWidth":(r=>typeof r=="number"?r+"px":r??void 0)(n),"--x-minHeight":(r=>typeof r=="number"?r+"px":r??void 0)(s)}]};function pg({width:e,height:t,maxWidth:n,minHeight:s,children:r,padding:i,variant:o="default",elevation:l="none",xstyle:c,className:u,style:d,ref:f,...h}){const x=t!=null&&t!=="auto",g=i==null,y=i??4,v=hj[y];return a.jsx("div",{ref:f,...ee(J("card",{variant:o}),W(zm.card,UB[o],FB[l],x&&zm.scrollable,VB.sizing(e??null,t??null,n??null,s??null),...CS(g?{useThemeDefault:"card"}:{paddingInnerX:v,paddingInnerY:v,paddingOuterX:v,paddingOuterY:v}),!g&&y!==4&&bd[y],!g&&y!==4&&wd[y],!g&&y!==4&&jd[y],!g&&y!==4&&Sd[y],o==="default"&&zm.withBorder,c),u,d),...h,children:r})}pg.displayName="Card";const Hh={base:{k1xSpc:"xjp7ctv",kMwMTN:"x1tgivj0",kMv6JI:"x9ynric",$$css:!0},light:{kQNsl9:"x19aimcq",$$css:!0},dark:{kQNsl9:"xntwwlm",$$css:!0},system:{kQNsl9:"x108lcm5",$$css:!0}},vy=ng.createContext(!1);vy.displayName="ThemeNestingContext";const Nm=new Set;function GB(e){const t=p.useId();p.useInsertionEffect(()=>{if(e.__built)return;const n=`astryx-theme-${e.name}`;if(Nm.has(n))return;p5(`theme-injection:${e.name}`,"Theme",`"${e.name}" is using runtime style injection. For better performance, use the pre-built theme:
77
-
78
- import {${e.name}Theme} from '@astryxdesign/theme-${e.name}/built';
79
- import '@astryxdesign/theme-${e.name}/theme.css';
80
-
81
- For custom themes, run \`npx @astryxdesign/cli theme build <file>\` to generate the built artifacts.`);const{prose:s,component:r}=iL(e);if(!(!s&&!r)){if(s){const i=document.createElement("style");i.setAttribute(zs("theme-prose"),e.name),i.setAttribute(zs("id"),t),i.textContent=`@layer reset {
82
- ${s}
83
- }`,document.head.appendChild(i)}if(r){const i=document.createElement("style");i.setAttribute(zs("theme"),e.name),i.setAttribute(zs("id"),t),i.textContent=`@layer astryx-theme {
84
- ${r}
85
- }`,document.head.appendChild(i)}return Nm.add(n),()=>{const i=document.querySelector(`style[${zs("theme-prose")}="${e.name}"][${zs("id")}="${t}"]`),o=document.querySelector(`style[${zs("theme")}="${e.name}"][${zs("id")}="${t}"]`);i==null||i.remove(),o==null||o.remove(),Nm.delete(n)}}},[e,t])}function WB(e,t,n){Ii(()=>{if(!e&&!(typeof document>"u"))return t==="light"||t==="dark"?document.documentElement.setAttribute("data-theme",t):document.documentElement.removeAttribute("data-theme"),document.documentElement.setAttribute(zs("theme"),n),()=>{document.documentElement.removeAttribute("data-theme"),document.documentElement.removeAttribute(zs("theme"))}},[e,t,n])}function ES({theme:e,mode:t="system",children:n}){const s=p.use(vy);WI(e),GB(e),WB(s,t,e.name);const r=t==="dark"?Hh.dark:t==="light"?Hh.light:Hh.system,i=p.useMemo(()=>({theme:e,mode:t}),[e,t]);return a.jsx(ag,{value:i,children:a.jsx(vy,{value:!0,children:a.jsx("div",{...W(Hh.base,r),"data-astryx-theme":e.name,"data-theme":t==="system"?void 0:t,children:n})})})}ES.displayName="Theme";function $S({mode:e,children:t}){return a.jsx("div",{[zs("media")]:e,className:"xjp7ctv x1tgivj0",children:t})}$S.displayName="MediaTheme";const AS="--color-syntax-";function KB(e){return AS+e}const XB=Object.keys(g5).map(e=>e.replace(AS,""));function ZB(e){const t={};for(const n of XB)t[KB(n)]=e.tokens[n];return t}const MS=p.createContext(null);MS.displayName="SyntaxThemeContext";function TS({theme:e,children:t}){const n=p.useMemo(()=>ZB(e),[e]),s=p.useMemo(()=>({theme:e}),[e]);return a.jsx(MS,{value:s,children:a.jsx("div",{style:n,"data-astryx-syntax-theme":e.name,children:t})})}TS.displayName="SyntaxTheme";function zS({type:e,body:t,endContent:n,isAutoHide:s,autoHideDuration:r,isExiting:i=!1,onDismiss:o}){const l=Me(),c=p.useRef(null),u=p.useRef(!1),d=p.useRef(r),f=p.useRef(null),h=p.useRef(o);h.current=o;const x=p.useCallback(()=>{!s||u.current||(c.current&&clearTimeout(c.current),f.current=Date.now(),c.current=setTimeout(()=>{h.current("auto")},d.current))},[s]),g=p.useCallback(()=>{if(!(!s||u.current)&&(u.current=!0,c.current&&(clearTimeout(c.current),c.current=null),f.current!=null)){const j=Date.now()-f.current;d.current=Math.max(d.current-j,1e3)}},[s]),y=p.useCallback(()=>{!s||!u.current||(u.current=!1,x())},[s,x]);p.useEffect(()=>(d.current=r,x(),()=>{c.current&&clearTimeout(c.current)}),[r,x]),p.useEffect(()=>{if(s)return window.addEventListener("blur",g),window.addEventListener("focus",y),()=>{window.removeEventListener("blur",g),window.removeEventListener("focus",y)}},[s,g,y]);const v=p.useCallback(()=>{o("manual")},[o]),m=e==="error",{mode:k}=lg(),b=m||k==="light"?"dark":"light";return a.jsx("div",{role:m?"alert":"status","aria-live":m?"assertive":"polite","aria-atomic":"true",onMouseEnter:g,onMouseLeave:y,onFocusCapture:g,onBlurCapture:y,...ee(J("toast",{type:e}),{0:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x1hc1fzr x9ynric xjm74w1 xw6l6zx xnn1q72 x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 xenstv7"},2:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x1hc1fzr x9ynric xjm74w1 xw6l6zx xnn1q72 x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 x1l5t2a3"},1:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x9ynric xjm74w1 xw6l6zx x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 xenstv7 xg01cxk x1lm5u"},3:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x9ynric xjm74w1 xw6l6zx x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 x1l5t2a3 xg01cxk x1lm5u"}}[!!m<<1|!!i<<0]),children:a.jsx($S,{mode:b,children:a.jsxs("div",{className:"x78zum5 x1cy8zhl xjcht0a xh8yej3",children:[a.jsx("div",{className:"x98rzlu xeuugli",children:t}),a.jsxs("div",{className:"x2lah0s x78zum5 x6s0dn4 x1txdalj xacfrgf xmequkd",children:[n,a.jsx(Q,{variant:"ghost",size:"sm",icon:a.jsx(ze,{icon:"close",size:"sm",color:"inherit"}),label:l("@astryx.toast.dismiss"),onClick:v,isIconOnly:!0})]})]})})})}zS.displayName="Toast";const xg=p.createContext(null);xg.displayName="ToastContext";const Qd={viewport:{kVAEAm:"xixxii4",kY2c9j:"x6cuj84",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kmVPX3:"x1shk3sm",kfzvcC:"x47corl",kpwlN0:"xh3736h",kogj98:"x1ghz6dp",kWkggS:"xjbqb8w",kVQacm:"x1rea2x4",$$css:!0},bottomEnd:{krVfgx:"x1ey2m1c",kt4wiu:"xtijo5x",kGNEyG:"xuk3077",$$css:!0},bottomStart:{krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kGNEyG:"x1cy8zhl",$$css:!0},topEnd:{k87sOh:"x13vifvy",kt4wiu:"xtijo5x",kGNEyG:"xuk3077",kXwgrk:"x3ieub6",$$css:!0},topStart:{k87sOh:"x13vifvy",kLqNvP:"x1o0tod",kGNEyG:"x1cy8zhl",kXwgrk:"x3ieub6",$$css:!0}};function ky(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(ky).filter(Boolean).join(" ");if(p.isValidElement(e)){const{children:t}=e.props;return ky(t)}return""}function gg({position:e="bottomEnd",maxVisible:t=5,inset:n,isTopLayer:s=!0,children:r}){const i=Me(),[o,l]=p.useState([]),[c,u]=p.useState(new Set),d=p.useRef(o);d.current=o;const f=p.useRef(null),h=p.useRef(new Set),x=p.useRef(null),g=p.useRef(null),y=p.useRef(null),v=p.useCallback(_=>{if(!_)return null;const R=_.querySelectorAll(hS);for(const N of R)if(!(N.getAttribute("tabindex")==="-1"||N.hasAttribute("disabled")||N.getAttribute("aria-disabled")==="true"))return N;return null},[]),m=bc(),k=p.useCallback(_=>{const{uniqueID:R,collisionBehavior:N="overwrite"}=_.options;if(R&&N==="ignore"&&d.current.some(B=>B.options.uniqueID===R))return;const H=ky(_.options.body);H&&m(H,_.options.type==="error"?"assertive":"polite"),l(B=>R&&B.find(L=>L.options.uniqueID===R)?B.map(L=>L.options.uniqueID===R?_:L):[...B,_])},[m]),b=p.useCallback((_,R)=>{var L,O;if(h.current.has(_))return;h.current.add(_);const N=d.current.find(D=>D.id===_);N&&((O=(L=N.options).onHide)==null||O.call(L,R));const H=f.current,B=document.activeElement,I=(H==null?void 0:H.querySelector(`[data-toast-id="${_}"]`))??null;if(I&&B instanceof Node&&I.contains(B))if(g.current=_,d.current.filter(q=>q.id!==_).length>0){const q=d.current.findIndex(K=>K.id===_),F=d.current[q+1]??d.current[q-1];y.current=F?F.id:"restore"}else y.current="restore";u(D=>D.has(_)?D:new Set(D).add(_))},[]),j=p.useCallback(_=>{h.current.delete(_),u(R=>{if(!R.has(_))return R;const N=new Set(R);return N.delete(_),N}),l(R=>R.filter(N=>N.id!==_))},[]);p.useLayoutEffect(()=>{const _=g.current,R=y.current;if(_==null||R==null||o.some(B=>B.id===_))return;g.current=null,y.current=null;const N=f.current;if(R!=="restore"&&N){const B=N.querySelector(`[data-toast-id="${R}"]`),I=v(B)??B;if(I){I.focus();return}}const H=x.current;x.current=null,H&&H.isConnected?H.focus():N&&N.focus()},[o,v]);const A=p.useCallback(_=>d.current.find(R=>R.options.uniqueID===_),[]),M=p.useMemo(()=>({addToast:k,removeToast:b,findByUniqueID:A}),[k,b,A]),E=o.slice(-t),z={};n!=null&&n.top&&(z.top=n.top),n!=null&&n.bottom&&(z.bottom=n.bottom),n!=null&&n.start&&(z.insetInlineStart=n.start),n!=null&&n.end&&(z.insetInlineEnd=n.end),p.useEffect(()=>{if(!s)return;const _=f.current;if(_&&typeof _.showPopover=="function")try{_.showPopover()}catch{}},[s]);const T=o.length>0;p.useEffect(()=>{if(!T)return;const _=R=>{if(R.key!=="F6")return;const N=f.current;if(!N)return;const H=document.activeElement;if(H instanceof Node&&N.contains(H))return;R.preventDefault(),H instanceof HTMLElement&&(x.current=H);const B=N.querySelectorAll("[data-toast-id]"),I=B[B.length-1]??null;(v(I)??I??N).focus()};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[T,v]);const $=e==="topEnd"?Qd.topEnd:e==="topStart"?Qd.topStart:e==="bottomStart"?Qd.bottomStart:Qd.bottomEnd;return a.jsxs(xg,{value:M,children:[r,a.jsx("div",{ref:f,role:"region","aria-label":i("@astryx.toast.viewport"),tabIndex:-1,popover:s?"manual":void 0,...ee(W(Qd.viewport,$),{style:Object.keys(z).length>0?z:void 0}),children:E.map(_=>{const R=_.options,N=R.type??"info",H=R.isAutoHide??N!=="error",B=R.autoHideDuration??5e3,I=c.has(_.id);return a.jsx("div",{"data-toast-id":_.id,...{0:{className:"x67bb7w xrvj5dj x1tu4anv xvmdzux xjshnde xuedmi6 xsagj69 xlr8y92 x1sopeo2 x5rzir7"},1:{className:"x67bb7w xrvj5dj xjshnde xuedmi6 xsagj69 xlr8y92 x1sopeo2 x5rzir7 xihq33y x18d9i69"}}[!!I<<0],onTransitionEnd:I?L=>{L.propertyName==="grid-template-rows"&&j(_.id)}:void 0,children:a.jsx("div",{className:"xb3r6kr",children:a.jsx(zS,{type:N,body:R.body,endContent:R.endContent,isAutoHide:H,autoHideDuration:B,isExiting:I,onDismiss:L=>b(_.id,L)})})},_.id)})})]})}gg.displayName="ToastViewport";const n6='button, [role="button"]';function s6(e){return e.matches(n6)?e:e.querySelector(n6)}const Bo={contentPadding:{kLKAdn:"x1vlblms",kGO01o:"xvmdzux",kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",$$css:!0},gap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},customWidth:e=>[{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}],matchTrigger:{k7Eaqz:"xrzjruh",$$css:!0}};function NS({children:e,anchorRef:t,content:n,placement:s="below",alignment:r="start",isOpen:i,onOpenChange:o,isEnabled:l=!0,width:c,label:u,role:d="dialog",isModal:f,hasCloseButton:h,closeButtonLabel:x,hasAutoFocus:g,hasLightDismiss:y=!0,hasEscapeDismiss:v=!0,xstyle:m,className:k,style:b,"data-testid":j}){const A=p.useRef(null),M=i!==void 0,E=p.useRef(0),z=p.useCallback(()=>{o==null||o(!0)},[o]),T=p.useCallback(()=>{E.current=Date.now(),o==null||o(!1)},[o]),$=Md({dialogLabel:u,role:d,isModal:f,hasLightDismiss:y,hasEscapeDismiss:v,hasCloseButton:h,closeButtonLabel:x,hasAutoFocus:g,onShow:z,onHide:T}),_=p.useCallback(()=>{l&&(Date.now()-E.current<50||$.toggle())},[l,$]),R=p.useCallback(I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),_())},[_]),N=p.useCallback(I=>{I.setAttribute("aria-haspopup",$.triggerProps["aria-haspopup"]),I.setAttribute("aria-expanded",String($.triggerProps["aria-expanded"])),I.setAttribute("aria-controls",$.triggerProps["aria-controls"]),I.addEventListener("click",_);const L=I.tagName!=="BUTTON"&&I.getAttribute("role")==="button";return L&&I.addEventListener("keydown",R),()=>{I.removeAttribute("aria-haspopup"),I.removeAttribute("aria-expanded"),I.removeAttribute("aria-controls"),I.removeEventListener("click",_),L&&I.removeEventListener("keydown",R)}},[$,_,R]);Ii(()=>{if(!t)return;const I=t.current;if(!I)return;const L=s6(I);if(L||Zl(),!L)return;$.triggerRef(I);const O=N(L);return()=>{$.triggerRef(null),O()}},[t,$,N]),Ii(()=>{if(t||typeof e=="function")return;const I=A.current;if(!I)return;$.triggerRef(I);const L=s6(I);if(L||Zl(),!L)return;const O=N(L);return()=>{$.triggerRef(null),O()}},[t,$,N]),Ii(()=>{M&&(i&&!$.isOpen?$.show():!i&&$.isOpen&&$.hide())},[i,M,$]);const H=c?Bo.customWidth(c):Bo.matchTrigger;if(t&&e==null)return a.jsx(a.Fragment,{children:$.render(a.jsx("div",{"data-testid":j,...ee(J("popover"),W(Bo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[H,Bo.gap,go[s]]})});if(typeof e=="function"){const I={ref:$.triggerRef,onClick:_,"aria-haspopup":"dialog","aria-expanded":$.isOpen,"aria-controls":$.id};return a.jsxs(a.Fragment,{children:[e(I),$.render(a.jsx("div",{"data-testid":j,...ee(J("popover"),W(Bo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[H,Bo.gap,go[s]]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(z5,{value:"button",children:a.jsx("div",{ref:A,className:"x3nfvp2",children:e})}),$.render(a.jsx("div",{"data-testid":j,...ee(J("popover"),W(Bo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[H,Bo.gap,go[s]]})]})}NS.displayName="Popover";const _m={container:{kWkggS:"x10xzikg","--_hovercard-radius":"xqwz7mz",kaIpWk:"x7a53xk",kGVxlE:"x14hfi27",$$css:!0},marginBlock:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",keTefX:"x1lziwak",k71WvV:"x14z9mp",$$css:!0},marginInline:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0}};function YB(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function QB(e={}){const{placement:t="above",alignment:n="center",delay:s=300,hideDelay:r=200,focusTrigger:i="auto",isEnabled:o=!0,label:l,isOpen:c,isDefaultOpen:u=!1,onShow:d,onHide:f}=e,h=t==="above"||t==="below"?_m.marginBlock:_m.marginInline,x=Cd({mode:"context",onShow:d,onHide:f}),g=p.useMemo(()=>[_m.container,h],[h]),y=p.useRef(null),v=p.useRef(null),m=p.useRef(null),k=p.useRef(!1),b=p.useRef(!1),j=p.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null),v.current&&(clearTimeout(v.current),v.current=null)},[]),A=p.useCallback(()=>{!o||c===!1||(j(),y.current=setTimeout(()=>{x.show()},s))},[o,c,j,x,s]),M=p.useCallback(()=>{c!==!0&&(j(),v.current=setTimeout(()=>{k.current||x.hide()},r))},[c,j,x,r]),E=p.useCallback(()=>{A()},[A]),z=p.useCallback(()=>{M()},[M]),T=p.useCallback(()=>{if(o){if(b.current){b.current=!1;return}j(),x.show()}},[o,j,x]),$=p.useCallback(B=>{const I=B.relatedTarget,L=document.getElementById(x.id);L!=null&&L.contains(I)||M()},[x.id,M]),_=p.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),j(),x.hide())},[j,x]),R=p.useCallback(B=>{m.current&&(m.current.removeEventListener("mouseenter",E),m.current.removeEventListener("mouseleave",z),m.current.removeEventListener("focusin",T),m.current.removeEventListener("focusout",$),m.current.removeEventListener("keydown",_)),B&&(B.addEventListener("mouseenter",E),B.addEventListener("mouseleave",z),(i==="always"||i==="auto"&&YB(B))&&(B.addEventListener("focusin",T),B.addEventListener("focusout",$)),B.addEventListener("keydown",_)),m.current=B},[i,E,z,T,$,_]),N=p.useCallback(B=>{x.ref(B),R(B)},[x,R]);p.useEffect(()=>()=>{j()},[j]),p.useEffect(()=>{u&&x.show()},[]),p.useEffect(()=>{c!==void 0&&(c?(j(),x.show()):(j(),x.hide()))},[c,j,x]);const H=p.useCallback((B,I)=>{const L=(I==null?void 0:I.placement)??t,O=J("hovercard").className,D={placement:L,alignment:(I==null?void 0:I.alignment)??n,role:l?"dialog":"group","aria-label":l||void 0,xstyle:[g,go[L],I==null?void 0:I.xstyle],className:I!=null&&I.className?`${O} ${I.className}`:O,style:I==null?void 0:I.style,as:"span"};return x.render(a.jsx("span",{className:"x1lliihq x1vlblms xvmdzux x126nfab x1t818jl",onMouseEnter:()=>{k.current=!0,j()},onMouseLeave:()=>{k.current=!1,M()},onKeyDown:q=>{var F;q.key==="Escape"&&(q.stopPropagation(),b.current=!0,j(),x.hide(),(F=m.current)==null||F.focus())},onBlur:q=>{var Z;const F=q.relatedTarget;q.currentTarget.contains(F)||(Z=m.current)!=null&&Z.contains(F)||M()},children:B}),D)},[x,t,n,l,j,M,g]);return{ref:N,positionRef:x.ref,interactionRef:R,anchorId:x.anchorId,describedBy:x.id,renderHoverCard:H,show:x.show,hide:x.hide}}function JB(e){return typeof e=="string"||typeof e=="number"}function eH(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function _S({children:e,content:t,placement:n="above",alignment:s="center",delay:r=300,hideDelay:i=200,focusTrigger:o="auto",isEnabled:l=!0,label:c,onOpenChange:u,hasHoverIndication:d="auto",isOpen:f,isDefaultOpen:h,xstyle:x,className:g,style:y}){const v=p.useRef(null),m=JB(e),k=d===!0||d==="auto"&&m,b=p.useCallback(()=>{u==null||u(!0)},[u]),j=p.useCallback(()=>{u==null||u(!1)},[u]),A=QB({placement:n,alignment:s,delay:r,hideDelay:i,focusTrigger:o,isEnabled:l,label:c,isOpen:f,isDefaultOpen:h,onShow:b,onHide:j});Ii(()=>{if(m)return;const E=v.current;if(!E)return;const z=E.firstElementChild;if(!z)return;A.ref(z);const T=z.getAttribute("aria-describedby");return z.setAttribute("aria-describedby",eH(T,A.describedBy)??""),()=>{A.ref(null),T?z.setAttribute("aria-describedby",T):z.removeAttribute("aria-describedby")}},[m,A.ref,A.describedBy]);const M=A.renderHoverCard(t,{xstyle:x,className:g,style:y});return m?a.jsxs(a.Fragment,{children:[a.jsx("span",{ref:A.ref,tabIndex:0,"aria-describedby":A.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 x11b3rvo"}}[!!k<<0],children:e}),M]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{ref:v,className:"xjp7ctv",children:e}),M]})}_S.displayName="HoverCard";const r6=new Map,tH=/\b(const|let|var|function|class|if|else|for|while|return|import|export|from|default|async|await|try|catch|throw|new|typeof|instanceof|interface|type|enum|extends|implements|switch|case|break|continue|do|in|of|void|null|undefined|true|false|this|super|yield|delete|static|public|private|protected|readonly|abstract|as|is|keyof|declare|module|namespace|require)\b/,nH=/\b(def|class|if|elif|else|for|while|return|import|from|as|with|try|except|raise|True|False|None|and|or|not|in|is|lambda|yield|async|await|pass|break|continue|del|global|nonlocal|assert|finally|print|self|cls)\b/,sH=/\b(if|then|else|elif|fi|for|do|done|while|until|case|esac|function|in|select|return|exit|local|export|source|alias|unalias|readonly|shift|eval|exec|set|unset|trap|wait|read|echo|printf|test|true|false)\b/,rH=/\b(important|inherit|initial|unset|revert|auto|none)\b/,iH=/\b(function|class|if|else|elseif|for|foreach|while|return|echo|public|private|protected|static|new|try|catch|throw|namespace|use|require|require_once|include|include_once|extends|implements|interface|abstract|final|const|var|true|false|null|array|isset|unset|empty|list|match|enum|switch|case|break|continue|do|yield|fn)\b/,oH=/\b(function|class|if|else|for|foreach|while|return|echo|public|private|protected|static|new|try|catch|throw|namespace|use|require|include|extends|implements|interface|abstract|final|const|shape|vec|dict|keyset|async|await|concurrent|enum|type|newtype|tuple|inout)\b/;function RS(e){const t=r6.get(e);if(t!==void 0)return t;const n=aH(e);return r6.set(e,n),n}function aH(e){const t=lH(e);return t?{defaultType:t.defaultType,patterns:t.patterns.map(n=>{const s=n.regex.flags.replace(/[gy]/g,"")+"y";return{...n,anchored:new RegExp(n.regex.source,s)}})}:null}function lH(e){switch(e){case"typescript":case"javascript":case"tsx":case"jsx":case"ts":case"js":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/`(?:[^`\\]|\\.)*`/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/@[\w]+/},{type:"number",regex:/\b0[xX][0-9a-fA-F_]+\b/},{type:"number",regex:/\b0[bB][01_]+\b/},{type:"number",regex:/\b0[oO][0-7_]+\b/},{type:"number",regex:/\b\d[\d_]*\.?[\d_]*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:tH},{type:"function",regex:/\b[a-zA-Z_$][\w$]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~?:]+/},{type:"punctuation",regex:/[{}()\[\];,.]/},{type:"variable",regex:/\b[a-zA-Z_$][\w$]*\b/}]};case"json":return{defaultType:"punctuation",patterns:[{type:"property",regex:/"(?:[^"\\]|\\.)*"(?=\s*:)/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"number",regex:/-?\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"constant",regex:/\b(true|false|null)\b/},{type:"punctuation",regex:/[{}()\[\]:,]/}]};case"html":case"xml":case"svg":return{defaultType:"variable",patterns:[{type:"comment",regex:/<!--[\s\S]*?-->/},{type:"keyword",regex:/<!DOCTYPE[^>]*>/i},{type:"tag",regex:/<\/[a-zA-Z][\w-]*\s*>/},{type:"tag",regex:/<[a-zA-Z][\w-]*/},{type:"tag",regex:/\/?>/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"attribute",regex:/\b[a-zA-Z_:][\w:.-]*(?=\s*=)/},{type:"operator",regex:/=/}]};case"css":case"scss":case"less":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/--[a-zA-Z_-][\w-]*/},{type:"number",regex:/-?\b\d+\.?\d*(?:px|em|rem|%|vh|vw|vmin|vmax|ch|ex|deg|rad|turn|s|ms|fr)?\b/},{type:"constant",regex:/#[0-9a-fA-F]{3,8}\b/},{type:"keyword",regex:rH},{type:"keyword",regex:/@[a-zA-Z][\w-]*/},{type:"tag",regex:/[.#][a-zA-Z_-][\w-]*/},{type:"keyword",regex:/::?[a-zA-Z][\w-]*/},{type:"function",regex:/\b[a-zA-Z_-][\w-]*(?=\s*\()/},{type:"property",regex:/[a-zA-Z_-][\w-]*(?=\s*:)/},{type:"punctuation",regex:/[{}()\[\];:,]/},{type:"operator",regex:/[+~>*=|^$]/}]};case"python":case"py":return{defaultType:"variable",patterns:[{type:"string",regex:/"""[\s\S]*?"""/},{type:"string",regex:/'''[\s\S]*?'''/},{type:"string",regex:/f"(?:[^"\\]|\\.)*"/},{type:"string",regex:/f'(?:[^'\\]|\\.)*'/},{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/@[\w.]+/},{type:"number",regex:/\b0[xX][0-9a-fA-F_]+\b/},{type:"number",regex:/\b0[bB][01_]+\b/},{type:"number",regex:/\b0[oO][0-7_]+\b/},{type:"number",regex:/\b\d[\d_]*\.?[\d_]*(?:[eE][+-]?\d+)?j?\b/},{type:"keyword",regex:nH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~@:]+/},{type:"punctuation",regex:/[{}()\[\];,.]/},{type:"variable",regex:/\b[a-zA-Z_][\w]*\b/}]};case"bash":case"sh":case"zsh":case"shell":return{defaultType:"variable",patterns:[{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'[^']*'/},{type:"variable",regex:/\$\{[^}]+\}/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"variable",regex:/\$[0-9@#?*!$-]/},{type:"number",regex:/\b\d+\b/},{type:"keyword",regex:sH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"operator",regex:/[|&<>;!]+/},{type:"punctuation",regex:/[{}()\[\]]/}]};case"php":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"number",regex:/\b0[xX][0-9a-fA-F]+\b/},{type:"number",regex:/\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:iH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~?:.]+/},{type:"constant",regex:/@[\w]+/},{type:"punctuation",regex:/[{}()\[\];,.]/}]};case"hack":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"number",regex:/\b0[xX][0-9a-fA-F]+\b/},{type:"number",regex:/\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:oH},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"property",regex:new RegExp("(?<=->|::)\\b[a-zA-Z_][\\w]*\\b")},{type:"operator",regex:/[+\-*/%=!<>&|^~?:.]+/},{type:"constant",regex:/<<[\w]+/},{type:"punctuation",regex:/[{}()\[\];,.]/}]};case"yaml":case"yml":return{defaultType:"variable",patterns:[{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/\b(true|false|yes|no|on|off|null|~)\b/i},{type:"variable",regex:/[&*][\w]+/},{type:"type",regex:/!!\w+/},{type:"number",regex:/\b-?\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"property",regex:/^[ \t]*[\w][\w ./-]*(?=\s*:)/m},{type:"keyword",regex:/---/},{type:"keyword",regex:/\.\.\./},{type:"operator",regex:/[:|>\-?]/},{type:"punctuation",regex:/[{}()\[\],]/},{type:"variable",regex:/\b[a-zA-Z_][\w]*\b/}]};case"markdown":case"md":return{defaultType:"variable",patterns:[{type:"keyword",regex:/^```[\w]*$/m},{type:"keyword",regex:/^#{1,6}\s+.*/m},{type:"keyword",regex:/^---$/m},{type:"keyword",regex:/^\*\*\*$/m},{type:"string",regex:/\*\*(?:[^*]|\*(?!\*))+\*\*/},{type:"string",regex:/\*(?:[^*])+\*/},{type:"constant",regex:/`[^`]+`/},{type:"function",regex:/\[(?:[^\]])+\]\([^)]+\)/},{type:"comment",regex:/^>\s+.*/m},{type:"operator",regex:/^\s*[-*+]\s/m},{type:"number",regex:/^\s*\d+\.\s/m}]};default:return null}}const i6=2e3,cH=800;async function uH(){return typeof scheduler<"u"&&typeof scheduler.yield=="function"?scheduler.yield():new Promise(e=>setTimeout(e,0))}function IS(e,t,n,s){const r=[];let i=n;const o=Math.min(s,e.length);for(;i<o;){let l=!1;for(const c of t.patterns){c.anchored.lastIndex=i;const u=c.anchored.exec(e);if(u&&u.index===i&&u[0].length>0){c.type!==t.defaultType&&r.push({type:c.type,start:i-n,end:i-n+u[0].length}),i+=u[0].length,l=!0;break}}l||i++}return r}function dH(e,t){const n=RS(t);if(!n)return[];const s=[];let r=0;for(let i=0;i<=e.length;i++)(i===e.length||e[i]===`
86
- `)&&(s.push(IS(e,n,r,i)),r=i+1);return s}async function fH(e,t,n){const s=RS(t);if(!s)return[];const r=[];let i=0,o=0;for(let l=0;l<=e.length;l++)if((l===e.length||e[l]===`
87
- `)&&(r.push(IS(e,s,i,l)),o+=l-i+1,i=l+1,o>=cH&&l<e.length)){if(n!=null&&n.aborted)return r;o=0,await uH()}return r}function hH(e,t){const n=[0];for(let i=0;i<t.length;i++)t[i]===`
88
- `&&n.push(i+1);const s=Array.from({length:n.length},()=>[]);let r=0;for(const i of e){for(;r<n.length-1&&i.start>=n[r+1];)r++;const o=n[r];s[r].push({type:i.type,start:i.start-o,end:i.end-o})}return s}const pH=`:root {
89
- ${Object.entries(g5).map(([e,t])=>` ${e}: ${t};`).join(`
90
- `)}
91
- }`,xH=`
92
- ${pH}
93
-
94
- .astryx-codeblock code::highlight(astryx-keyword),
95
- .astryx-codeeditor code::highlight(astryx-keyword) { color: var(--color-syntax-keyword); }
96
- .astryx-codeblock code::highlight(astryx-string),
97
- .astryx-codeeditor code::highlight(astryx-string) { color: var(--color-syntax-string); }
98
- .astryx-codeblock code::highlight(astryx-comment),
99
- .astryx-codeeditor code::highlight(astryx-comment) { color: var(--color-syntax-comment); }
100
- .astryx-codeblock code::highlight(astryx-number),
101
- .astryx-codeeditor code::highlight(astryx-number) { color: var(--color-syntax-number); }
102
- .astryx-codeblock code::highlight(astryx-function),
103
- .astryx-codeeditor code::highlight(astryx-function) { color: var(--color-syntax-function); }
104
- .astryx-codeblock code::highlight(astryx-type),
105
- .astryx-codeeditor code::highlight(astryx-type) { color: var(--color-syntax-type); }
106
- .astryx-codeblock code::highlight(astryx-tag),
107
- .astryx-codeeditor code::highlight(astryx-tag) { color: var(--color-syntax-tag); }
108
- .astryx-codeblock code::highlight(astryx-attribute),
109
- .astryx-codeeditor code::highlight(astryx-attribute) { color: var(--color-syntax-attribute); }
110
- .astryx-codeblock code::highlight(astryx-property),
111
- .astryx-codeeditor code::highlight(astryx-property) { color: var(--color-syntax-property); }
112
- .astryx-codeblock code::highlight(astryx-operator),
113
- .astryx-codeeditor code::highlight(astryx-operator) { color: var(--color-syntax-operator); }
114
- .astryx-codeblock code::highlight(astryx-constant),
115
- .astryx-codeeditor code::highlight(astryx-constant) { color: var(--color-syntax-constant); }
116
- .astryx-codeblock code::highlight(astryx-punctuation),
117
- .astryx-codeeditor code::highlight(astryx-punctuation) { color: var(--color-syntax-punctuation); }
118
- .astryx-codeblock code::highlight(astryx-variable),
119
- .astryx-codeeditor code::highlight(astryx-variable) { color: var(--color-syntax-variable); }
120
-
121
- /* Span-based fallback classes — used when highlightMode='spans' or
122
- when the CSS Custom Highlight API is not available. */
123
- .astryx-token-keyword { color: var(--color-syntax-keyword); }
124
- .astryx-token-string { color: var(--color-syntax-string); }
125
- .astryx-token-comment { color: var(--color-syntax-comment); }
126
- .astryx-token-number { color: var(--color-syntax-number); }
127
- .astryx-token-function { color: var(--color-syntax-function); }
128
- .astryx-token-type { color: var(--color-syntax-type); }
129
- .astryx-token-tag { color: var(--color-syntax-tag); }
130
- .astryx-token-attribute { color: var(--color-syntax-attribute); }
131
- .astryx-token-property { color: var(--color-syntax-property); }
132
- .astryx-token-operator { color: var(--color-syntax-operator); }
133
- .astryx-token-constant { color: var(--color-syntax-constant); }
134
- .astryx-token-punctuation { color: var(--color-syntax-punctuation); }
135
- .astryx-token-variable { color: var(--color-syntax-variable); }
136
- `;let o6=!1;function mg(){if(o6||typeof document>"u")return;const e=document.createElement("style");e.setAttribute("data-astryx-highlight-styles",""),e.textContent=xH,document.head.appendChild(e),o6=!0}const gH=["keyword","string","comment","number","function","type","tag","attribute","property","operator","constant","punctuation","variable"],a6=new Set(gH);let qh=null;function mH(e){if(a6.has(e)||(a6.add(e),mg(),typeof document>"u"))return;if(!qh){const s=document.createElement("style");if(s.setAttribute("data-astryx-highlight-dynamic",""),document.head.appendChild(s),qh=s.sheet??null,!qh)return}const t=`astryx-${e}`,n=`var(--color-syntax-${e}, currentColor)`;qh.insertRule(`.astryx-codeblock code::highlight(${t}), .astryx-codeeditor code::highlight(${t}) { color: ${n}; }`)}function yH(){const e=new Map;return t=>{let n=e.get(t);if(n)return n;mH(t);const s=`astryx-${t}`;return n=CSS.highlights.get(s),n||(n=new Highlight,CSS.highlights.set(s,n)),e.set(t,n),n}}function LS(e,t,n,s){if(t.length===0)return;const r=e.firstChild;if(!r||r.nodeType!==Node.TEXT_NODE)return;const i=r.length;for(const o of t){if(o.start>=i||o.end<=0)continue;const l=Math.min(o.start,i),c=Math.min(o.end,i),u=s(o.type);try{const d=new Range;d.setStart(r,l),d.setEnd(r,c),u.add(d),n.push({range:d,highlight:u})}catch{}}}function Rm(e){for(const{range:t,highlight:n}of e)n.delete(t)}function vH(e,t,n,s){const r=[],i=e.querySelectorAll("[data-line]");for(let o=0;o<i.length;o++){const l=n+o,c=t[l];c&&c.length>0&&LS(i[o],c,r,s)}return r}function kH(e,t){mg();const n=yH(),s=[],r=[];let i=0;for(let d=0;d<e.children.length;d++){const f=e.children[d],h=f.querySelectorAll("[data-line]");h.length>0&&f.tagName==="DIV"&&!f.hasAttribute("data-line")&&(s.push(f),r.push(i),i+=h.length)}if(s.length===0){const d=[],f=e.querySelectorAll("[data-line]");for(let h=0;h<f.length;h++){const x=t[h];x&&x.length>0&&LS(f[h],x,d,n)}return()=>Rm(d)}const o=new Map,l=new Map;function c(d,f){if(o.has(d))return;const h=vH(d,t,r[f],n);o.set(d,h)}function u(d){const f=o.get(d);f&&(Rm(f),o.delete(d))}for(let d=0;d<s.length;d++){const f=s[d],h=g=>{g.skipped?u(f):c(f,d)};f.addEventListener("contentvisibilityautostatechange",h),l.set(f,h);const x=f;typeof x.checkVisibility=="function"?x.checkVisibility({checkVisibilityCSS:!0,contentVisibilityAuto:!0})&&c(f,d):d<5&&c(f,d)}return function(){for(const[f,h]of l)f.removeEventListener("contentvisibilityautostatechange",h);l.clear();for(const f of o.values())Rm(f);o.clear()}}const bH={card:{kaIpWk:"xh6dtrn",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",$$css:!0},section:{kaIpWk:"x2u8bby",kMzoRj:"xc342km",ksu8eU:"xng3xce",kVAM5u:"x9r1u3d","--color-syntax-background":"x1mtvhk1",$$css:!0}},wH={"--_codeblock-gutter-width":"xtk08jq",$$css:!0},_5={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,k7Eaqz:(e==="fit-content"?"min(100%, 400px)":null)!=null?"xkj4a21":e==="fit-content"?"min(100%, 400px)":null,ks0D6T:(e==="fit-content"?"100%":null)!=null?"xf68679":e==="fit-content"?"100%":null,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e),"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e==="fit-content"?"min(100%, 400px)":null),"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e==="fit-content"?"100%":null)}],gutterWidth:e=>[wH,{"--x---_codeblock-gutter-width":`${e}ch`!=null?`${e}ch`:void 0}]},mo={root:{kVAEAm:"x1n2onr6",kHBbk8:"xc8icb0",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kogj98:"x1ghz6dp",kWkggS:"xzyc27v",kVQacm:"xb3r6kr",$$css:!0},code:{k1xSpc:"x1lliihq",kUk6DE:"x98rzlu",k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kogj98:"x1ghz6dp",kMv6JI:"x9m5x89",kMwMTN:"xdfisg",kKi2Bq:"xeq4nuv",khDVqt:"x1sdyfia",kTgw9:"x1lldw8n",kHjlTd:"x1h4wwuj",$$css:!0},codeWrapped:{khDVqt:"x126k92a",kTgw9:"x1yn0g08",kHjlTd:"x1mzt3pk",$$css:!0},codeNumbered:{kVAEAm:"x1n2onr6",k5JduY:"x1s928wv",kwXMNM:"x1j6awrg",kSy8m5:"xd54j2p",kc1e00:"x1km86hw",kkgrvl:"xkj6t0a",kQlJh0:"x1p96cux",k6vLHU:"xvsnedh",kkQ525:"xnnzo76",kloYau:"x2q1x1w",$$css:!0},sizeSm:{kGuDYH:"x141an7d",$$css:!0},sizeMd:{kGuDYH:"xp03k98",$$css:!0}},jH=20,SH=100,l6=p.memo(function({lines:t,startIndex:n,highlightSet:s,renderLineContent:r,lineNumbers:i}){return a.jsx(a.Fragment,{children:t.map((o,l)=>{const c=n+l;return a.jsx("div",{"data-line":c+1,...{0:{className:"x17iicif"},2:{className:"x17iicif xrvj5dj x1xx4m37 xf5zn4v x46gnpd x17gn2l9 x19ds33d x1wnbjh8 xtkarl4 x1rbqspl x3nzp0f"},1:{className:"x17iicif xgcxg3y x1ng9b9t x1pzlopt"},3:{className:"x17iicif xrvj5dj x1xx4m37 xf5zn4v x46gnpd x17gn2l9 x19ds33d x1wnbjh8 xtkarl4 x1rbqspl x3nzp0f xgcxg3y x1ng9b9t x1pzlopt"}}[!!i<<1|!!((s==null?void 0:s.has(c+1))??!1)<<0],children:r(o,c)},c)})})});function OS(e,t,n,s,r=jH){if(r=Math.max(1,Math.floor(r)),e.length<SH)return a.jsx(l6,{lines:e,startIndex:0,highlightSet:t,renderLineContent:n,lineNumbers:s});const i=[];for(let o=0;o<e.length;o+=r){const l=Math.min(o+r,e.length),c=e.slice(o,l),u=`${c.length}lh`;i.push(a.jsx("div",{...ee({className:"xb5mbof"},{style:{containIntrinsicBlockSize:`auto ${u}`}}),children:a.jsx(l6,{lines:c,startIndex:o,highlightSet:t,renderLineContent:n,lineNumbers:s})},o))}return i}function DS(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}function CH(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}function EH(e,t,n){const[s,r]=p.useState(null),i=p.useMemo(()=>n?hH(n(e,t),e):e.length>=i6?null:dH(e,t),[e,t,n]);return p.useEffect(()=>{if(e.length<i6||n)return;const o=new AbortController;async function l(){try{const c=await fH(e,t,o.signal);o.signal.aborted||r({code:e,language:t,tokens:c})}catch{o.signal.aborted||r({code:e,language:t,tokens:[]})}}return l(),()=>{o.abort()}},[e,t,n]),i??((s==null?void 0:s.code)===e&&s.language===t?s.tokens:[])}function $H(e,t){if(t.length===0)return e||"​";const n=[];let s=0;for(const r of t){r.start>s&&n.push(e.slice(s,r.start));const i=Math.min(r.end,e.length);n.push(a.jsx("span",{className:`astryx-token-${r.type} xds-token-${r.type}`,children:e.slice(r.start,i)},`${r.start}-${r.type}`)),s=i}return s<e.length&&n.push(e.slice(s)),n.length>0?n:"​"}function AH({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:r,hasLineNumbers:i,maxDigits:o}){p.useInsertionEffect(()=>{mg()},[]);const l=p.useCallback((c,u)=>{const d=t[u]??[];return a.jsx("span",{className:"xeuugli",children:$H(c,d)})},[t]);return a.jsx("code",{...W(mo.code,r,s&&mo.codeWrapped,i&&mo.codeNumbered,i&&_5.gutterWidth(o)),children:OS(e,n,l,i)})}function MH({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:r,hasLineNumbers:i,maxDigits:o}){const l=p.useRef(null);p.useEffect(()=>{if(!DS())return;mg();const u=l.current;if(!(!u||t.length===0))return kH(u,t)},[t]);const c=p.useCallback(u=>u||"​",[]);return a.jsx("code",{ref:l,...W(mo.code,r,s&&mo.codeWrapped,i&&mo.codeNumbered,i&&_5.gutterWidth(o)),children:OS(e,n,c,i)})}function uh({code:e,language:t="plaintext",title:n,hasLanguageLabel:s=!0,hasLineNumbers:r=!1,highlightLines:i,hasCopyButton:o=!0,onCopy:l,isWrapped:c=!1,maxHeight:u,isCollapsible:d=!1,collapsibleThreshold:f=10,size:h="md",width:x="fit-content",container:g="card",tokenizer:y,highlightMode:v="auto",syntaxTheme:m,xstyle:k,className:b,style:j,ref:A,...M}){const E=Me(),[z,T]=p.useState(!1),$=p.useRef(null),_=bc();p.useEffect(()=>()=>{$.current!=null&&clearTimeout($.current)},[]);const R=v==="spans"||v==="auto"&&!DS()||v==="auto"&&CH(),N=p.useMemo(()=>{const de=e.split(`
137
- `);return de.length>1&&de[de.length-1]===""&&de.pop(),de},[e]),H=EH(e,t,y),B=p.useMemo(()=>i?new Set(i):null,[i]),I=p.useCallback(async()=>{try{await navigator.clipboard.writeText(e),T(!0),_(E("@astryx.codeBlock.copied")),l==null||l(),$.current!=null&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,T(!1)},2e3)}catch{}},[e,l,_,E]),L=h==="sm"?mo.sizeSm:mo.sizeMd,O=String(N.length).length,D=s&&t!=="plaintext"?t:null,q=n!=null||D!=null,F=d&&N.length>=f,[K,Z]=p.useState(!1),se=p.useId(),ne=p.useRef(null),ue=u?{maxHeight:typeof u=="number"?`${u}px`:u}:void 0,P=a.jsx(ze,{icon:z?"check":"copy",size:"sm",color:"inherit"}),U=o?a.jsx("button",{type:"button",onClick:de=>{de.stopPropagation(),I()},"aria-label":E(z?"@astryx.codeBlock.copied":"@astryx.codeBlock.copyCode"),...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x9epnlk x3kzqx6 xx3sua9 xjbqb8w xe9uy6x x1mjzq1q x1ypdohk x14ju556"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x9epnlk x3kzqx6 xx3sua9 xjbqb8w xe9uy6x x1mjzq1q x1ypdohk x14ju556 x10l6tqk xctzyg x72tfeb"}}[!q<<0],children:P}):null,X=q?a.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1qughib x1pzlopt xzyc27v x7wzq59 x13vifvy x1vjfegm xce4md1"},1:{className:"x78zum5 x6s0dn4 x1qughib x1pzlopt xzyc27v x7wzq59 x13vifvy x1vjfegm xce4md1 x92x3c3 x1q0q8m5 xw8gpjh"}}[!!r<<0],children:[a.jsx("div",{role:F?"button":void 0,tabIndex:F?0:void 0,"aria-expanded":F?!K:void 0,"aria-controls":F?se:void 0,onClick:F?()=>Z(de=>!de):void 0,onKeyDown:F?de=>{(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),Z(fe=>!fe))}:void 0,...{0:{className:"x78zum5 x6s0dn4 x98rzlu xeuugli x1717udv xjbqb8w x1heor9g xln7xf2 x1yc453h"},1:{className:"x78zum5 x6s0dn4 x98rzlu xeuugli x1717udv xjbqb8w x1heor9g xln7xf2 x1yc453h x1ypdohk x87ps6o x17nn4n9 x1wfwxd8 x7s97pk"}}[!!F<<0],children:a.jsxs("span",{className:"x78zum5 x6s0dn4 x141an7d x9m5x89 x1e4wzip x1mjzq1q x1ghz6dp x1ltkj2j",children:[F&&a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnur1sd xb3r6kr x1mjzq1q x1gbn2au x1aquc0h x12wqnr7 x128ha8g x11xpdln xuedmi6 xlr8y92"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnur1sd xb3r6kr x1mjzq1q x1gbn2au x1aquc0h x12wqnr7 x128ha8g x11xpdln xuedmi6 xlr8y92 x1iffjtl"}}[!K<<0],children:a.jsx(ze,{icon:"chevronRight",size:"xsm",color:"inherit"})}),n,n&&D?" — ":"",D]})}),U]}):null,ie=a.jsx("div",{ref:ne,tabIndex:0,role:"group","aria-label":D??E("@astryx.codeBlock.code"),...ee({className:"xw2csxc x1odjw0f"},{style:ue}),children:a.jsx("div",{...{0:{className:"x78zum5 x1pshirs"},1:{className:"x78zum5 x1pshirs x1ajqlyv"}}[!!(q&&!r)<<0],children:R?a.jsx(AH,{lines:N,tokenLines:H,highlightSet:B,isWrapped:c,sizeStyle:L,hasLineNumbers:r,maxDigits:O}):a.jsx(MH,{lines:N,tokenLines:H,highlightSet:B,isWrapped:c,sizeStyle:L,hasLineNumbers:r,maxDigits:O})})}),te=a.jsxs("pre",{ref:A,...ee(J("codeblock",{size:h,language:t,container:g}),W(mo.root,_5.width(x),bH[g],k),b,j),...M,children:[X,F?a.jsx("div",{id:se,inert:K?!0:void 0,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!K<<0],children:a.jsx("div",{className:"xb3r6kr x2lwn1j",children:ie})}):ie,!q&&U]});return m?a.jsx(TS,{theme:m,children:te}):te}uh.displayName="CodeBlock";const TH={base:{kMv6JI:"x9m5x89",kGuDYH:"xp03k98",kLWn49:"x15bjb6t",kWkggS:"xwmxj5m",kg3NbH:"x7a5moj",k8WAf4:"x1hp7d8q",kaIpWk:"xx3sua9",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",$$css:!0}},zH={primary:{kMwMTN:"x1tgivj0",$$css:!0},secondary:{kMwMTN:"xv1l7n4",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}},NH={inherit:{kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",$$css:!0}};function R5({children:e,color:t="primary",size:n,xstyle:s,className:r,style:i,ref:o,...l}){return a.jsx("code",{ref:o,...l,...ee(J("code",{color:t}),W(TH.base,zH[t],n&&NH[n],s),r,i),children:e})}R5.displayName="Code";const I5=p.createContext(null);I5.displayName="DialogContext";function _H(){return p.use(I5)}function RH(e,t=16){const n=e.getBoundingClientRect(),s=n.left+n.width/2-window.innerWidth/2,r=n.top+n.height/2-window.innerHeight/2,i=Math.sqrt(s*s+r*r)||1;return{x:Math.round(s/i*t),y:Math.round(r/i*t)}}const Qa={dialog:{kVAEAm:"xixxii4",kogj98:"x1bpp3o7",kmVPX3:"x1717udv",kWkggS:"x10xzikg","--_dialog-radius":"xvuvksw",kaIpWk:"xuacgfc",kGVxlE:"x1kcpxr7",k1xSpc:"x1s85apg",kXwgrk:"xdt5ytf",kZKoxP:"xg7h5cd",kZeWKH:"xish69e",kSiTet:"xg01cxk",k44tkh:"xqgcaz",kyAemX:"x128ha8g",kWV6AL:"xskzprw",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},open:{k1xSpc:"x78zum5",kSiTet:"x1hc1fzr",kKVMdj:"x1ewfqum x1aquc0h",$$css:!0},backdrop:{kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",$$css:!0},fullscreen:{kzqmXN:"x1o6l61p",kZKoxP:"xtdtrs8",ks0D6T:"xlbgzzq",kskxy:"x1wj9ous",kaIpWk:"x2u8bby",kogj98:"x1ghz6dp",kpwlN0:"x10a8y8t",$$css:!0},inner:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x12lumcd",kAzted:"x2lwn1j",kVQacm:"xb3r6kr",kaIpWk:"x1pjcqnp",$$css:!0},inlineWrapper:{kmVPX3:"x1717udv",kWkggS:"x10xzikg","--_dialog-radius":"xvuvksw",kaIpWk:"xuacgfc",kGVxlE:"x1kcpxr7",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kZKoxP:"xg7h5cd",kZeWKH:"xish69e",$$css:!0}},IH={ks0D6T:"x95b5qq",$$css:!0},LH={kogj98:"x1ghz6dp",$$css:!0},Im={sizing:(e,t)=>[IH,{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,kskxy:(typeof t=="number"?`${t}px`:t)!=null?"x1jols5v":typeof t=="number"?`${t}px`:t,$$css:!0},{"--x-width":(n=>typeof n=="number"?n+"px":n??void 0)(typeof e=="number"?`${e}px`:e),"--x-maxHeight":(n=>typeof n=="number"?n+"px":n??void 0)(typeof t=="number"?`${t}px`:t)}],position:(e,t,n,s)=>[LH,{k87sOh:e!=null?"xjbys53":e,kLqNvP:t!=null?"x1lxsm33":t,kt4wiu:n!=null?"xqxgn94":n,krVfgx:s!=null?"x1nqzi6q":s,$$css:!0},{"--x-top":(r=>typeof r=="number"?r+"px":r??void 0)(e),"--x-insetInlineStart":(r=>typeof r=="number"?r+"px":r??void 0)(t),"--x-insetInlineEnd":(r=>typeof r=="number"?r+"px":r??void 0)(n),"--x-bottom":(r=>typeof r=="number"?r+"px":r??void 0)(s)}]};function Ph(e){return typeof e=="number"?`${e}px`:e}function OH(e){const{top:t,bottom:n,start:s,end:r}=e;return{top:t!==void 0?Ph(t):"auto",bottom:n!==void 0?Ph(n):"auto",insetInlineStart:s!==void 0?Ph(s):"auto",insetInlineEnd:r!==void 0?Ph(r):"auto"}}function mr({isOpen:e,isInline:t=!1,onOpenChange:n,width:s=400,maxHeight:r="75vh",position:i,variant:o="standard",purpose:l="info",padding:c,children:u,xstyle:d,className:f,style:h,ref:x,...g}){const y=c==null,v=c??4,m=hj[v],k=o==="fullscreen",b=p.useId(),j=p.useMemo(()=>({isInline:t,titleId:b}),[t,b]),A=g["aria-label"]!=null||g["aria-labelledby"]!=null,M=p.useRef(null),E=p.useCallback(O=>{if(M.current=O,!O||A)return;O.querySelector(`#${CSS.escape(b)}`)!=null?O.setAttribute("aria-labelledby",b):O.removeAttribute("aria-labelledby")},[b,A]),z=p.useRef(null),T=l!=="required",$=l==="info";p.useEffect(()=>{var D;if(t)return;const O=M.current;if(O)if(e){z.current=document.activeElement;const q=z.current;if(q&&q!==document.body){const F=RH(q);O.style.setProperty("--dialog-dir-x",`${F.x}px`),O.style.setProperty("--dialog-dir-y",`${F.y}px`)}else O.style.setProperty("--dialog-dir-x","0px"),O.style.setProperty("--dialog-dir-y","16px");if(!O.open){O.showModal();const F=O.querySelector("[data-autofocus]");F&&F.focus()}}else O.open&&O.close(),(D=z.current)==null||D.focus(),z.current=null},[e,t]),bS(e&&!t),p.useEffect(()=>{if(t)return;const O=M.current;if(!O||!e)return;const D=q=>{if(q.key==="Escape"){if(uS(q)||Ub())return;q.preventDefault(),T&&n(!1)}};return O.addEventListener("keydown",D),()=>O.removeEventListener("keydown",D)},[e,t,T,n]);const _=p.useRef(!1);p.useEffect(()=>{var D;const O=((D=M.current)==null?void 0:D.querySelector(`#${CSS.escape(b)}`))!=null;e&&!t&&!A&&!O&&!_.current&&(_.current=!0,Zl())},[e,t,A,b]);const R=O=>{O.target===O.currentTarget&&$&&n(!1)},N=O=>{O.preventDefault(),!Ub()&&T&&n(!1)},H=a.jsx("div",{...W(Qa.inner,...CS(y?{useThemeDefault:"dialog",maxHeight:k?void 0:typeof r=="number"?`${r}px`:r}:{paddingInnerX:m,paddingInnerY:m,paddingOuterX:m,paddingOuterY:m,maxHeight:k?void 0:typeof r=="number"?`${r}px`:r}),!y&&v!==4&&bd[v],!y&&v!==4&&wd[v],!y&&v!==4&&jd[v],!y&&v!==4&&Sd[v]),children:a.jsx(I5,{value:j,children:u})}),B=i!=null&&!k,{open:I,...L}=g;return t?e?a.jsx("div",{...L,...ee(J("dialog",{variant:o}),W(Qa.inlineWrapper,!k&&Im.sizing(s,r),k&&Qa.fullscreen,d),f,h),"data-testid":g["data-testid"],children:H}):null:a.jsx("dialog",{ref:Wt(x,E),...L,...ee(J("dialog",{variant:o}),W(Qa.dialog,e&&Qa.open,Qa.backdrop,!k&&Im.sizing(s,r),B&&(()=>{const O=OH(i);return Im.position(O.top,O.insetInlineStart,O.insetInlineEnd,O.bottom)})(),k&&Qa.fullscreen,d),f,h),onClick:R,onCancel:N,"aria-modal":"true",...l==="required"?{role:"alertdialog"}:void 0,children:H})}mr.displayName="Dialog";const DH=p.lazy(async()=>Aj(()=>Promise.resolve().then(()=>mS),void 0).then(e=>({default:e.Tooltip}))),BH={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function ds({level:e,type:t,accessibilityLevel:n,color:s="primary",display:r="block",maxLines:i=0,hasTruncateTooltip:o=!0,wordBreak:l,textWrap:c,justify:u="start",hasCapsize:d=!1,hasStrikethrough:f=!1,xstyle:h,className:x,style:g,children:y,ref:v,...m}){const k=BH[e],b=n&&n!==e?{"aria-level":n}:{},j=l??(i===1?"break-all":"break-word"),A=i>0||d?"block":r,M=Oj({maxLines:i}),E=typeof o=="string"?o:"above",z=i>0&&o!==!1&&M.isTruncated,T=p.useRef(null),$=i>1?{WebkitLineClamp:i}:void 0;return a.jsxs(a.Fragment,{children:[a.jsx(k,{ref:Wt(v,M.ref,T),...ee(J("heading",{level:e,color:s,...t&&{type:t}}),W(y5[Dj(s)],t?v5[t]:SL[e],t&&Mj[t],i===1?Up.singleLine:i>1?Up.multiLine:Tj[A],i>0&&zj[j],c&&Nj[c],u!=="start"&&Ij[u],d&&_j.enabled,f&&Rj.strikethrough,h),x,{...g,...$}),title:z?M.fullText:void 0,...b,...m,children:y}),z&&a.jsx(p.Suspense,{fallback:null,children:a.jsx(DH,{anchorRef:T,content:a.jsx("span",{...W(Lj.content),children:M.fullText}),placement:E})})]})}ds.displayName="Heading";const HH={titleFocusable:{kI3sdo:"x1a2a7pz",$$css:!0}};function Hr({title:e,subtitle:t,onOpenChange:n,startContent:s,endContent:r,hasDivider:i,xstyle:o,className:l,style:c,ref:u,...d}){const f=Me(),h=p.useRef(null),x=_H(),g=(x==null?void 0:x.isInline)!==!0,y=x==null?void 0:x.titleId;return p.useEffect(()=>{g&&h.current&&h.current.focus()},[g]),a.jsx(qp,{ref:u,hasDivider:i,xstyle:o,className:l,style:c,...d,children:a.jsxs("div",{className:"x78zum5 x1cy8zhl x1qughib xjcht0a",children:[s&&a.jsx("div",{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s",children:s}),a.jsxs("div",{className:"x98rzlu xeuugli xqixskq",children:[a.jsx(ds,{ref:h,id:y,level:2,tabIndex:-1,xstyle:HH.titleFocusable,children:e}),t&&a.jsx(Y,{type:"body",size:"sm",color:"secondary",children:t})]}),(r||n)&&a.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s"},1:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f x3kzqx6"}}[!!n<<0],children:[r,n&&a.jsx(Q,{variant:"ghost",label:f("@astryx.dialog.close"),tooltip:f("@astryx.dialog.close"),icon:a.jsx(ze,{icon:"close",color:"inherit"}),onClick:()=>{n==null||n(!1)},isIconOnly:!0})]})]})})}Hr.displayName="DialogHeader";const qH={scrollable:{kVQacm:"xysyzu8",$$css:!0}};function L5({direction:e="vertical",hAlign:t,vAlign:n,justify:s,align:r,gap:i,padding:o,paddingInline:l,paddingBlock:c,isScrollable:u,width:d,height:f,maxWidth:h,minHeight:x,wrap:g,as:y="div",xstyle:v,className:m,style:k,children:b,ref:j,...A}){const M=t??(e==="horizontal"?s:r),E=n??(e==="horizontal"?r:s),z=e==="horizontal"?M:E,T=e==="horizontal"?E:M,$=l??o,_=c??o,R=W(...cy({direction:e,crossAlign:T,mainAlign:z,gap:i,wrap:g}),$!=null&&_I[$],_!=null&&RI[_],u&&qH.scrollable,v),N={...d!=null&&{width:typeof d=="number"?`${d}px`:d},...f!=null&&{height:typeof f=="number"?`${f}px`:f},...h!=null&&{maxWidth:typeof h=="number"?`${h}px`:h},...x!=null&&{minHeight:typeof x=="number"?`${x}px`:x}};return p.createElement(y,{ref:j,...ee(J("stack",{direction:e,gap:i,wrap:g}),R,m,{...k,...N}),...A},b)}L5.displayName="Stack";function ye({ref:e,justify:t,align:n,hAlign:s,vAlign:r,...i}){return a.jsx(L5,{...i,direction:"horizontal",hAlign:s??t,vAlign:r??n,ref:e})}ye.displayName="HStack";function le({ref:e,justify:t,align:n,hAlign:s,vAlign:r,...i}){return a.jsx(L5,{...i,direction:"vertical",hAlign:s??n,vAlign:r??t,ref:e})}le.displayName="VStack";const Uh={footer:{kmuXW:"x2lah0s",$$css:!0},inner:{kB7OPa:"x9f619",ks0D6T:"xjl2t3p",kUOVxO:"xvueqy4",kZCmMZ:"x139j0dd",kwRFfy:"xpc6k2p",kLKAdn:"xqty4a",kGO01o:"xon7vh3","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"x1xjq73n",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},divider:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}},PH={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function Va({children:e,hasDivider:t,height:n,label:s,padding:r,role:i,xstyle:o,className:l,style:c,ref:u,...d}){const f=p.use(rg),h=t??(f==null?void 0:f.defaultHasDividers)??!1,x=r===0;return a.jsx("div",{ref:u,role:i,"aria-label":s,"data-divider":h||void 0,...ee(J("layout-footer"),W(Uh.footer,PH.sizing(n??null),h&&Uh.divider,o),l,c),...d,children:a.jsx("div",{...W(Uh.inner,x&&Uh.fullBleed,r!=null&&bd[r],r!=null&&wd[r],r!=null&&jd[r],r!=null&&Sd[r]),children:e})})}Va.displayName="LayoutFooter";const BS=p.createContext({direction:"vertical"});BS.displayName="FormLayoutContext";const Lm={container:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},containerGap:{kOIVth:"xzye2dw",$$css:!0},horizontalLabels:{k1xSpc:"xjp7ctv",$$css:!0}},UH={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function wc({label:e,isLabelHidden:t=!1,description:n,inputID:s,labelID:r,isGroupLabel:i=!1,descriptionID:o,isOptional:l=!1,isRequired:c=!1,isDisabled:u=!1,labelIcon:d,status:f,labelTooltip:h,statusVariant:x="attached",width:g,xstyle:y,children:v,className:m,style:k,ref:b,...j}){const{direction:A}=p.use(BS),M=A==="horizontal-labels",E=o??(n?`${s}-desc`:void 0),z=(f==null?void 0:f.messageID)??(f!=null&&f.message?`${s}-status`:void 0);Ad("Field","isOptional and isRequired are mutually exclusive. isOptional takes precedence.",l&&c);const T=a.jsx(fg,{label:e,inputID:s,labelID:r,isGroupLabel:i,isLabelHidden:t,isDisabled:u,isOptional:l,isRequired:c,labelIcon:d,labelTooltip:h,description:M?void 0:n,descriptionID:M?void 0:E}),$=f!=null&&f.message&&x!=="tooltip"?a.jsx(lh,{type:f.type,message:f.message,id:z,variant:x}):null;return M?a.jsxs("div",{ref:b,...ee(J("field",{layout:"horizontal-labels"}),W(Lm.horizontalLabels,y),m,k),...j,children:[a.jsx("div",{className:"x1enrzb7",children:T}),a.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[n&&a.jsx(Y,{type:"supporting",display:"block",id:E,children:n}),v,$]})]}):a.jsxs("div",{ref:b,...ee(J("field"),W(Lm.container,!t&&Lm.containerGap,g!=null&&UH.width(g),y),m,k),...j,children:[T,x==="attached"?a.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[v,$]}):a.jsxs(a.Fragment,{children:[v,$]})]})}wc.displayName="Field";const Ia={base:{kB7OPa:"x9f619",kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"xvy26l8 x6q1khz","--_field-radius":"x1832zxr",kaIpWk:"xvdfih8",kWkggS:"x10xzikg",k1ekBW:"x12zzom9",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kGVxlE:"x1gnnqk1 x12y27fx xuihb5h",kI3sdo:"x1a2a7pz",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kVAM5u:"xvy26l8",kGVxlE:"x1gnnqk1",$$css:!0}},yg={warning:{kVAM5u:"x8wg1ba",$$css:!0},error:{kVAM5u:"x1ofxpqo",$$css:!0},success:{kVAM5u:"x16m2moy",$$css:!0}},vg={warning:{kGVxlE:"x1gnnqk1 xnoa3fc",$$css:!0},error:{kGVxlE:"x1gnnqk1 xl68szm",$$css:!0},success:{kGVxlE:"x1gnnqk1 xig9bu2",$$css:!0}},HS={warning:{kVAM5u:"x8wg1ba xa1yw2k",$$css:!0},error:{kVAM5u:"x1ofxpqo xk2sxw7",$$css:!0},success:{kVAM5u:"x16m2moy xyq33ac",$$css:!0}},O5={inGroup:{kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",kZKoxP:"x5yr21d",keTefX:"xd10s4z x1pwwqoy",krdFHd:"x15mokao x8eehn2",kVL7Gh:"xbiv7yw x1xrp5p4",kfmiAY:"x1ga7v0g x11xp8u1 xpufgd0 x1ir7nn6",kT0f0o:"x16uus16 x747jw7 xxd14kb x1vej5at",kXnDq0:"x1rm9qnc",$$css:!0}},qS=p.createContext(null);qS.displayName="InputGroupContext";function D5(){return p.use(qS)}const FH={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}};function lt({type:e="text",label:t,isLabelHidden:n=!1,description:s,isOptional:r=!1,isRequired:i=!1,isDisabled:o=!1,disabledMessage:l,startIcon:c,status:u,statusVariant:d="attached",size:f,onChange:h,changeAction:x,isLoading:g=!1,value:y,placeholder:v,labelTooltip:m,hasClear:k=!1,hasAutoFocus:b=!1,htmlName:j,onEnter:A,onKeyDown:M,width:E,xstyle:z,className:T,style:$,ref:_,...R}){const N=Me(),H=Ua(f,"md"),B=p.useId(),I=p.useId(),L=p.useId(),O=p.useId(),D=p.useRef(null),q=p.useRef(null),F=D5(),[,K]=p.useTransition(),[Z,se]=p.useOptimistic(y),ne=g||Z!==y,ue=o&&!!l,P=Es({placement:"above",focusTrigger:"always",isEnabled:ue}),{statusIcon:U,describedBy:X}=jS({status:u,statusVariant:d,isInGroup:!!F}),{ariaLabelledBy:ie,ariaDescribedBy:te}=h5(I,[s?L:null,!F&&d!=="tooltip"&&(u!=null&&u.message)?O:null,X,ue?P.describedBy:null],F),de=ve=>{if(o)return;const ke=ve.target.value;h==null||h(ke,ve),x&&!ve.defaultPrevented&&K(async()=>{se(ke),await x(ke,ve)})},fe=p.useCallback(()=>{var ve;h==null||h("",null),(ve=D.current)==null||ve.focus()},[h]),{onClick:he,onMouseUp:V}=T5({containerRef:q,inputRef:D,disabled:o}),xe=a.jsxs("div",{ref:ve=>{q.current=ve,P.ref(ve)},onClick:he,onMouseUp:V,...ee(J("text-input",{size:H,status:(u==null?void 0:u.type)??null}),W(Ia.base,FH[H],o&&Ia.disabled,u&&yg[u.type],u&&!o&&vg[u.type],u&&HS[u.type],F&&O5.inGroup,z),T,$),children:[c&&ni(c,{size:"sm",color:"secondary"}),F&&a.jsx(qi,{id:I,children:t}),a.jsx("input",{...R,ref:Wt(_,D),id:B,name:j,type:e,value:Z,onChange:de,onKeyDown:A||M?ve=>{ve.key==="Enter"&&(A==null||A()),M==null||M(ve)}:void 0,placeholder:v,disabled:o&&!ue,"aria-disabled":ue?"true":void 0,readOnly:ue||void 0,autoFocus:b,"data-autofocus":b||void 0,"aria-describedby":te,"aria-required":i===!0?"true":void 0,"aria-invalid":(u==null?void 0:u.type)==="error"?"true":void 0,"aria-busy":ne||void 0,"aria-labelledby":ie,...{0:{className:"x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5"},1:{className:"x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc"}}[!!o<<0]}),k&&y!==""&&!o&&a.jsx("button",{type:"button",onClick:fe,"aria-label":N("@astryx.textInput.clearLabel",{label:t}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:a.jsx(ze,{icon:"close",size:"sm",color:"secondary"})}),ne&&a.jsx(Jt,{size:"sm"}),U]});return F?a.jsxs(a.Fragment,{children:[xe,ue&&P.renderTooltip(l)]}):a.jsxs(wc,{label:t,isLabelHidden:n,description:s,inputID:B,descriptionID:s?L:void 0,isOptional:r,isRequired:i,isDisabled:o,status:u?{type:u.type,message:u.message,messageID:u.message?O:void 0}:void 0,statusVariant:d,labelTooltip:m,width:E,children:[xe,ue&&P.renderTooltip(l)]})}lt.displayName="TextInput";function Gp(e){return typeof e=="string"?!0:!("type"in e)}function by(e){return typeof e=="object"&&"type"in e&&e.type==="divider"}function Wp(e){return typeof e=="object"&&"type"in e&&e.type==="section"}function xa(e){return typeof e=="string"?{value:e,label:e}:{...e,label:e.label??e.value}}function PS(e){const t=[];for(const n of e)if(Gp(n))t.push(xa(n));else if(Wp(n))for(const s of n.options)t.push(xa(s));return t}function VH({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:s,triggerRef:r}){const[i,o]=p.useState(0),[l,c]=p.useState(!1),u=p.useCallback((d,f)=>{o(d),c(f)},[]);return Ii(()=>{if(!e){u(0,!1);return}if(!s.current||!r.current){u(0,!0);return}const d=t>=0?t:0,f=`${n}-item-${d}`,h=document.getElementById(f);if(!h){u(0,!0);return}const x=s.current.getBoundingClientRect(),g=h.getBoundingClientRect(),y=r.current.getBoundingClientRect(),v=x.height;if(v<=0){u(0,!0);return}const m=g.top-x.top+g.height/2,b=y.top+y.height/2-m,j=window.innerHeight,A=Math.max(0,j-v),M=Math.min(Math.max(b,0),A),E=Math.max(0,y.bottom-M);u(E,!0)},[e,t,n,s,r,u]),{offset:i,isPositioned:l}}function GH({selectableItems:e,value:t,isDisabled:n=!1,isOpen:s,hasSearch:r=!1,onOpen:i,onClose:o,onSelect:l,onClear:c,listboxId:u}){const[d,f]=p.useState(-1),[h,x]=p.useState(""),g=p.useRef(void 0),y=p.useCallback(E=>`${u}-item-${E}`,[u]),v=p.useCallback(()=>e.map((E,z)=>E.disabled?-1:z).filter(E=>E>=0),[e]),m=p.useCallback(()=>e.findIndex(E=>E.value===t),[e,t]),k=p.useCallback(()=>{f(-1),o()},[o]),b=p.useCallback(E=>{E.disabled||(l==null||l(E.value),k())},[l,k]),j=p.useCallback(()=>{if(!n){if(s)k();else if(i(),!r){const E=m();f(E>=0?E:0)}}},[n,s,i,k,m,r]),A=p.useCallback((E,z)=>{E.disabled||f(z)},[]),M=p.useCallback(E=>{if(n)return;const z=v();switch(E.key){case"ArrowDown":if(E.preventDefault(),!s)i(),f(0);else{const T=z.indexOf(d),$=Math.min(T+1,z.length-1);f(z[$]??d)}break;case"ArrowUp":if(E.preventDefault(),!s)i(),f(e.length-1);else{const T=z.indexOf(d),$=Math.max(T-1,0);f(z[$]??d)}break;case" ":if(r)break;case"Enter":if(E.preventDefault(),s&&d>=0){const T=e[d];T&&!T.disabled&&b(T)}else if(!s&&(i(),!r)){const T=m();f(T>=0?T:0)}break;case"Escape":s&&(E.preventDefault(),k());break;case"Tab":s&&k();break;case"Home":E.preventDefault(),s&&z.length>0&&f(z[0]);break;case"End":E.preventDefault(),s&&z.length>0&&f(z[z.length-1]);break;case"PageUp":E.preventDefault(),s&&z.length>0&&f(z[0]);break;case"PageDown":E.preventDefault(),s&&z.length>0&&f(z[z.length-1]);break;case"Delete":case"Backspace":!r&&!s&&c!=null&&t!=null&&(E.preventDefault(),c());break;default:if(!r&&E.key.length===1&&!E.ctrlKey&&!E.metaKey){const T=h+E.key.toLowerCase();x(T),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const $=e.findIndex(_=>{var R;return!_.disabled&&((R=_.label)==null?void 0:R.toLowerCase().startsWith(T))});$>=0&&(s||i(),f($))}break}},[n,s,i,k,e,d,b,m,v,h,r,c,t]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:y,onTriggerClick:j,onKeyDown:M,onItemSelect:b,onItemMouseEnter:A}}const WH={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",$$css:!0}};function US({icon:e,label:t,description:n,endContent:s,xstyle:r,className:i,style:o}){return a.jsx(Td,{startContent:e?ni(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:s,xstyle:[WH.root,r],...ee(J("selector-option"),{className:i,style:o})})}US.displayName="SelectorOption";const Ur={triggerContainer:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMv6JI:"x9ynric",kGuDYH:"xcr08ib xdk3u5w",kLWn49:"x1kq96og",kMwMTN:"x1tgivj0",kkrTdU:"x1ypdohk",$$css:!0},triggerPlaceholder:{kMwMTN:"xv1l7n4",$$css:!0},triggerGhost:{kzqmXN:"x14atkfc",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kKwaWg:"x1ilzqfv xq8i9tn",kGVxlE:"x1gnnqk1 x1irk71m x15ysqaf",k63SB2:"x1e4wzip",kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xscfbxq",k1ekBW:"xrafxwg",k3aq6I:"x3oybdh xk4oym4",$$css:!0},triggerGhostDisabled:{kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},popover:{k7Eaqz:"xrzjruh",$$css:!0},sectionDivider:{kqGvvJ:"xsq74q5",$$css:!0},divider:{kqGvvJ:"xsq74q5",$$css:!0},item:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kmVPX3:"xlsj2fj",kaIpWk:"xh6dtrn",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},itemHighlighted:{kWkggS:"x1lmrjuc",$$css:!0},itemSelected:{k63SB2:"x1e4wzip",$$css:!0},itemDisabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},KH={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},XH={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},c6={warning:"warning",error:"error",success:"success"},u6={warning:"warning",error:"error",success:"success"},ZH={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function YH({option:e}){return a.jsx(US,{icon:e.icon,label:e.label??e.value})}function wy(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function d6(e,t){return t?e.filter(n=>wy(n,t)):e}function oc(e){const t=Me(),{label:n,isLabelHidden:s=!1,description:r,isOptional:i=!1,isRequired:o=!1,isDisabled:l=!1,disabledMessage:c,options:u,value:d,onChange:f,changeAction:h,isLoading:x=!1,placeholder:g,size:y,variant:v="input",status:m,statusVariant:k="attached",labelTooltip:b,startIcon:j,htmlName:A,renderOption:M,hasSearch:E=!1,searchPlaceholder:z,placement:T,isDefaultOpen:$=!1,"data-testid":_,width:R,xstyle:N,className:H,style:B,hasClear:I,...L}=e,O=g??t("@astryx.selector.placeholder"),D=z??t("@astryx.selector.searchPlaceholder"),q=I===!0,F=Ua(y,"md"),K=v==="ghost"&&k==="attached"?"detached":k,Z=d===null?void 0:d,se=p.useId(),ne=p.useId(),ue=p.useId(),P=p.useId(),U=p.useId(),X=p.useId(),ie=p.useRef(null),te=p.useRef(null),de=D5(),[fe,he]=p.useState(""),V=fe.length>0,[,xe]=p.useTransition(),[ve,ke]=p.useOptimistic(Z),me=x||ve!==Z,pe=l&&!!c,Qe=Es({placement:"above",focusTrigger:"always",isEnabled:pe}),Xe=Es({placement:"above",isEnabled:K==="tooltip"&&!!(m!=null&&m.message)}),{ariaLabelledBy:$t,ariaDescribedBy:At}=h5(U,[r?ue:null,!de&&K!=="tooltip"&&(m!=null&&m.message)?P:null,K==="tooltip"&&(m!=null&&m.message)?Xe.describedBy:null,pe?Qe.describedBy:null],de),en=p.useMemo(()=>PS(u),[u]),rt=p.useMemo(()=>d6(en,fe),[en,fe]),zt=p.useMemo(()=>en.findIndex(be=>be.value===ve),[en,ve]),tn=p.useMemo(()=>zt>=0?en[zt]:void 0,[en,zt]),es=p.useRef(null),hs=bc(),Us=p.useCallback(()=>{var be;he(""),hs(""),(be=ie.current)==null||be.focus()},[hs]),vt=Md({onHide:Us,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});p.useEffect(()=>{$&&vt.show()},[]);const kt=p.useCallback(be=>{if(he(be),be.length===0){hs("");return}const bt=d6(en,be).length;hs(bt===0?"No results found":`${bt} result${bt===1?"":"s"}`)},[hs,en]),vr=T==null&&!E,{offset:Vi,isPositioned:Fs}=VH({isOpen:vt.isOpen&&vr,selectedItemIndex:zt,listboxId:ne,listboxRef:es,triggerRef:ie}),ii=vr?Vi:0,Vs=vr?Fs:!0,Bn=T??"below",qr=ii>0?{marginBlockStart:`-${ii}px`}:void 0,oi=p.useCallback(()=>{f==null||f(null),h&&xe(async()=>{ke(void 0),await h(null)})},[f,h,xe,ke]),{highlightedIndex:pn,getItemId:ps,onTriggerClick:xn,onKeyDown:qt,onItemSelect:xs,onItemMouseEnter:ai}=GH({selectableItems:rt,value:Z,isDisabled:l,isOpen:vt.isOpen,hasSearch:E,onOpen:p.useCallback(()=>{vt.show(),E&&requestAnimationFrame(()=>{var be;(be=te.current)==null||be.focus()})},[vt,E]),onClose:vt.hide,onSelect:p.useCallback(be=>{f==null||f(be),h&&xe(async()=>{ke(be),await h(be)})},[f,h,xe,ke]),onClear:q?oi:void 0,listboxId:ne});p.useEffect(()=>{var be,bt;!vt.isOpen||pn<0||(bt=(be=document.getElementById(ps(pn)))==null?void 0:be.scrollIntoView)==null||bt.call(be,{block:"nearest"})},[vt.isOpen,pn,ps]);const Gs=p.useCallback(be=>{be.stopPropagation(),oi()},[oi]),li=p.useCallback(()=>E?a.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:be=>{be.target!==te.current&&be.key==="Tab"&&!be.shiftKey&&qt(be)},children:a.jsx(lt,{ref:te,id:X,label:t("@astryx.selector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":vt.isOpen,"aria-controls":ne,"aria-autocomplete":"list","aria-activedescendant":vt.isOpen&&pn>=0?ps(pn):void 0,value:fe,onChange:kt,onKeyDown:be=>{if(be.key==="ArrowDown"||be.key==="ArrowUp"||be.key==="PageUp"||be.key==="PageDown"||be.key==="Enter"||be.key==="Escape"){qt(be);return}be.key==="Tab"&&(be.shiftKey||!V)&&qt(be)},placeholder:D})}):null,[E,X,ne,fe,V,D,kt,qt,vt.isOpen,pn,ps,t]),gs=p.useCallback((be,bt)=>{const nn=bt===pn,ce=be.value===Z;return a.jsxs("div",{id:ps(bt),role:"option","aria-selected":ce,"aria-disabled":be.disabled,onClick:()=>xs(be),onMouseEnter:()=>ai(be,bt),...W(Ur.item,XH[F],nn&&Ur.itemHighlighted,ce&&Ur.itemSelected,be.disabled&&Ur.itemDisabled),children:[a.jsx("span",{className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli",children:M?M(be):a.jsx(YH,{option:be})}),ce&&a.jsx(ze,{icon:"check",size:"sm",color:"accent"})]},be.value)},[M,pn,F,Z,ps,xs,ai]),ci=p.useCallback(()=>{const be=E&&!!fe;if(be&&rt.length===0)return[a.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")];let bt=0;const nn=[];for(let ce=0;ce<u.length;ce++){const Se=u[ce];if(by(Se)){if(be)continue;nn.push(a.jsx(ja,{xstyle:Ur.divider},`divider-${ce}`))}else if(Wp(Se)){const Ue=[];for(const re of Se.options){const Ce=xa(re);be&&!wy(Ce,fe)||(Ue.push(gs(Ce,bt)),bt++)}if(Ue.length===0)continue;Se.title&&nn.push(a.jsx(ja,{label:Se.title,xstyle:Ur.sectionDivider},`section-divider-${ce}`)),nn.push(a.jsx("div",{role:"group","aria-label":Se.title,children:Ue},`section-${ce}`))}else if(Gp(Se)){const Ue=xa(Se);if(be&&!wy(Ue,fe))continue;nn.push(gs(Ue,bt)),bt++}}return nn},[u,gs,E,fe,rt]),Ae=m!=null&&K!=="detached",tt=m!=null&&K==="tooltip"&&!!m.message,Sn=a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:be=>{vt.triggerRef(be),Qe.ref(be)},onClick:xn,"data-testid":_,...ee(J("selector",{variant:v,size:F,status:(m==null?void 0:m.type)??null}),W(Ia.base,Ur.triggerContainer,KH[F],v==="ghost"&&Ur.triggerGhost,l&&Ia.disabled,v==="ghost"&&l&&Ur.triggerGhostDisabled,!tn&&Ur.triggerPlaceholder,v!=="ghost"&&m&&yg[m.type],v!=="ghost"&&m&&!l&&vg[m.type],v!=="ghost"&&de&&O5.inGroup,N),H,B),children:[j&&ni(j,{size:"sm",color:"secondary"}),de&&a.jsx(qi,{id:U,children:n}),a.jsx("button",{ref:ie,id:se,type:"button",role:E?void 0:"combobox",...L,"aria-haspopup":"listbox","aria-expanded":vt.isOpen,"aria-controls":ne,"aria-activedescendant":!E&&vt.isOpen&&pn>=0?ps(pn):void 0,"aria-describedby":At,"aria-labelledby":$t,"aria-required":o?"true":void 0,"aria-invalid":(m==null?void 0:m.type)==="error"?"true":void 0,"aria-busy":me||void 0,disabled:l&&!pe,"aria-disabled":pe?"true":void 0,onKeyDown:qt,tabIndex:l&&!pe?-1:0,className:"x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz",children:a.jsx("span",{className:"x1iyjqo2 xeuugli xb3r6kr xlyipyv xuxw1ft x1yc453h",children:(tn==null?void 0:tn.label)??O})}),A!=null&&a.jsx("input",{type:"hidden",name:A,value:d??"",disabled:l}),me&&a.jsx(Jt,{size:"sm"}),q&&d!=null&&!l&&a.jsx("button",{type:"button",onClick:Gs,"aria-label":t("@astryx.selector.clearLabel",{label:n}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:a.jsx(ze,{icon:"close",size:"sm",color:"secondary",...J("selector-clear-icon")})}),a.jsx("span",{...{0:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"},2:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"},1:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"},3:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"}}[!!(!Ae&&vt.isOpen)<<1|!!Ae<<0],children:Ae?tt?a.jsx("button",{ref:Xe.ref,type:"button","aria-label":t(ZH[m.type]),"aria-describedby":Xe.describedBy,onClick:be=>be.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:a.jsx(ze,{icon:c6[m.type],size:"sm",color:u6[m.type]})}):a.jsx(ze,{icon:c6[m.type],size:"sm",color:u6[m.type]}):a.jsx(ze,{icon:"chevronDown",size:"sm",color:"inherit",...J("selector-indicator-icon",{state:vt.isOpen?"expanded":"collapsed"})})})]}),vt.render(E?a.jsxs("div",{children:[li(),a.jsx("div",{ref:es,id:ne,role:"listbox","aria-labelledby":se,className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo",children:ci()})]}):a.jsx("div",{ref:es,id:ne,role:"listbox","aria-labelledby":se,...{0:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo"},1:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk xg01cxk xq2gx43"}}[!Vs<<0],children:ci()}),{placement:Bn,alignment:"start",xstyle:[Ur.popover,go[Bn]],style:qr}),tt&&Xe.renderTooltip((m==null?void 0:m.message)??""),pe&&Qe.renderTooltip(c)]});return de?Sn:a.jsx(wc,{label:n,isLabelHidden:s,description:r,inputID:se,descriptionID:r?ue:void 0,isOptional:i,isRequired:o,isDisabled:l,status:m?{type:m.type,message:m.message,messageID:m.message?P:void 0}:void 0,statusVariant:K,labelTooltip:b,width:R,children:Sn})}oc.displayName="Selector";var FS={exports:{}},fs={};/**
138
- * @license React
139
- * react-dom.production.js
140
- *
141
- * Copyright (c) Meta Platforms, Inc. and affiliates.
142
- *
143
- * This source code is licensed under the MIT license found in the
144
- * LICENSE file in the root directory of this source tree.
145
- */var QH=p;function VS(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ho(){}var Ss={d:{f:Ho,r:function(){throw Error(VS(522))},D:Ho,C:Ho,L:Ho,m:Ho,X:Ho,S:Ho,M:Ho},p:0,findDOMNode:null},JH=Symbol.for("react.portal"),eq=Symbol.for("react.recoverable"),f6=Symbol.for("react.optimistic_key");function tq(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:JH,key:s==null?null:s===f6?f6:""+s,children:e,containerInfo:t,implementation:n}}var Of=QH.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kg(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ss;fs.browser=function(e){return{$$typeof:eq,_reason:e}};fs.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(VS(299));return tq(e,t,null,n)};fs.flushSync=function(e){var t=Of.T,n=Ss.p;try{if(Of.T=null,Ss.p=2,e)return e()}finally{Of.T=t,Ss.p=n,Ss.d.f()}};fs.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ss.d.C(e,t))};fs.prefetchDNS=function(e){typeof e=="string"&&Ss.d.D(e)};fs.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=kg(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Ss.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&Ss.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fs.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=kg(t.as,t.crossOrigin);Ss.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Ss.d.M(e)};fs.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=kg(n,t.crossOrigin);Ss.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};fs.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=kg(t.as,t.crossOrigin);Ss.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Ss.d.m(e)};fs.requestFormReset=function(e){Ss.d.r(e)};fs.unstable_batchedUpdates=function(e,t){return e(t)};fs.useFormState=function(e,t,n){return Of.H.useFormState(e,t,n)};fs.useFormStatus=function(){return Of.H.useHostTransitionStatus()};fs.version="19.3.0";function GS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(GS)}catch(e){console.error(e)}}GS(),FS.exports=fs;var a1=FS.exports;const h6={popoverSurface:{k7Eaqz:"xfb3i0g",$$css:!0},popoverGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0}};function nq(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);if(!n.collapsed||!e.contains(n.startContainer))return null;const s=n.startContainer;return s.nodeType===Node.TEXT_NODE?(s.textContent??"").slice(0,n.startOffset):null}function sq(e,t){for(let n=e.length-1;n>=0;n--){const s=e[n];if(s===" "||s===`
146
- `)return null;for(const r of t)if(s===r.character){const i=n>0?e[n-1]:null;if(i===null||i===" "||i===`
147
- `){const o=e.slice(n+1);return{trigger:r,query:o,triggerStart:n}}}}return null}function rq(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const s=n.getRangeAt(0),r=s.startContainer;if(r.nodeType!==Node.TEXT_NODE)return;const i=r.textContent??"",o=s.startOffset,l=i.slice(0,t),c=i.slice(o);r.textContent=l+c;const u=document.createRange();u.setStart(r,t),u.collapse(!0),n.removeAllRanges(),n.addRange(u)}function iq(e){const t=Me(),{triggers:n,editableRef:s,onInsertToken:r,onInsertText:i,onEmitChange:o,debounceMs:l=150}=e,c=p.useId(),[u,d]=p.useState({isActive:!1,activeTrigger:null,query:"",items:[],highlightedIndex:0,isLoading:!1}),f=p.useRef(-1),h=p.useRef(null),x=p.useRef(null),g=p.useCallback(()=>{x.current&&(x.current.remove(),x.current=null)},[]),y=Md({onHide:p.useCallback(()=>{g(),d($=>({...$,isActive:!1,activeTrigger:null,query:"",items:[],highlightedIndex:0,isLoading:!1}))},[g]),hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});p.useEffect(()=>()=>{h.current&&clearTimeout(h.current),g()},[g]);const v=p.useCallback(()=>{var _,R;h.current&&(clearTimeout(h.current),h.current=null);const $=u.activeTrigger;$!=null&&$.searchSource&&((R=(_=$.searchSource).cancel)==null||R.call(_)),g(),y.hide(),f.current=-1},[y,u.activeTrigger,g]),m=p.useCallback(()=>{const $=s.current;if(!$)return;const _=window.getSelection();if(!_||_.rangeCount===0){y.triggerRef($);return}g();const R=_.getRangeAt(0).cloneRange();R.collapse(!0);const N=typeof R.getBoundingClientRect=="function"?R.getBoundingClientRect():null;if(!N||N.width===0&&N.height===0&&N.top===0&&N.left===0){y.triggerRef($);return}const H=document.createElement("span");H.setAttribute("aria-hidden","true"),H.setAttribute("data-astryx-trigger-anchor",""),H.style.position="fixed",H.style.left=`${N.left}px`,H.style.top=`${N.top}px`,H.style.width=`${Math.max(N.width,1)}px`,H.style.height=`${N.height}px`,H.style.pointerEvents="none",H.style.opacity="0",document.body.appendChild(H),x.current=H,y.triggerRef(H)},[s,y,g]),k=p.useCallback(($,_)=>{h.current&&(clearTimeout(h.current),h.current=null);const R=()=>{var N,H;if($.searchSource){(H=(N=$.searchSource).cancel)==null||H.call(N),d(I=>({...I,isLoading:!0}));const B=$.searchSource.search(_);Promise.resolve(B).then(I=>{d(L=>({...L,items:I,highlightedIndex:I.length>0?0:-1,isLoading:!1}))},()=>{d(I=>({...I,items:[],highlightedIndex:-1,isLoading:!1}))})}};$.searchSource&&($.searchSource.search("")instanceof Promise&&l>0?(d(B=>({...B,isLoading:!0})),h.current=setTimeout(R,l)):R())},[l]),b=p.useCallback($=>{const _=u.activeTrigger;if(!_)return;const R=s.current;if(!R)return;g(),rq(R,f.current);const N=_.onSelect($);typeof N=="string"?i(N):r(N),o(),v()},[u.activeTrigger,s,g,i,r,o,v]),j=p.useCallback(()=>{if(!n||n.length===0)return;const $=s.current;if(!$)return;const _=nq($);if(_===null){u.isActive&&v();return}const R=sq(_,n);if(!R){u.isActive&&v();return}const{trigger:N,query:H,triggerStart:B}=R;!u.isActive||u.activeTrigger!==N?(f.current=B,d(I=>({...I,isActive:!0,activeTrigger:N,query:H,highlightedIndex:0})),m(),k(N,H),y.show()):u.query!==H&&(d(I=>({...I,query:H})),k(N,H))},[n,s,u.isActive,u.activeTrigger,u.query,v,m,k,y]),A=p.useCallback($=>{if(!u.isActive||!y.isOpen)return!1;switch($.key){case"ArrowDown":return $.preventDefault(),d(_=>({..._,highlightedIndex:_.highlightedIndex<_.items.length-1?_.highlightedIndex+1:0})),!0;case"ArrowUp":return $.preventDefault(),d(_=>({..._,highlightedIndex:_.highlightedIndex>0?_.highlightedIndex-1:_.items.length-1})),!0;case"Enter":case"Tab":return u.highlightedIndex>=0&&u.highlightedIndex<u.items.length?($.preventDefault(),b(u.items[u.highlightedIndex]),!0):!1;case"Escape":return $.preventDefault(),v(),!0;default:return!1}},[u.isActive,u.highlightedIndex,u.items,y.isOpen,b,v]),M=p.useCallback($=>`${c}-option-${$}`,[c]);p.useEffect(()=>{if(!y.isOpen||u.highlightedIndex<0)return;const $=document.getElementById(M(u.highlightedIndex));$==null||$.scrollIntoView({block:"nearest"})},[u.highlightedIndex,y.isOpen,M]);const z=((n==null?void 0:n.length)??0)>0?u.isActive&&y.isOpen?{role:"combobox","aria-expanded":!0,"aria-controls":c,"aria-activedescendant":u.highlightedIndex>=0?M(u.highlightedIndex):void 0,"aria-haspopup":"listbox"}:{role:"combobox","aria-expanded":!1,"aria-haspopup":"listbox"}:{role:"textbox"},T=p.useCallback(()=>{const $=u.activeTrigger,_=($==null?void 0:$.emptySearchResultsText)??"No results",R=($==null?void 0:$.loadingText)??"Searching…";let N;if(u.isLoading)N=a.jsx("div",{role:"status",className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:R});else if(u.items.length===0&&u.isActive)N=a.jsx("div",{className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:_});else{const H=bI(u.items);let B=0;N=H.map(I=>{const L=I.items.map(O=>{const D=B++;return a.jsx("div",{id:M(D),role:"option","aria-selected":D===u.highlightedIndex,tabIndex:-1,onMouseDown:q=>{q.preventDefault(),b(O)},onMouseEnter:()=>d(q=>({...q,highlightedIndex:D})),...{0:{className:"x9f619 x78zum5 x6s0dn4 xh8yej3 xlsj2fj xh6dtrn x1ypdohk x1a2a7pz xjbqb8w x1yc453h x9ynric xjm74w1 xw6l6zx x1tgivj0"},1:{className:"x9f619 x78zum5 x6s0dn4 xh8yej3 xlsj2fj xh6dtrn x1ypdohk x1a2a7pz x1yc453h x9ynric xjm74w1 xw6l6zx x1tgivj0 x1lmrjuc"}}[(D===u.highlightedIndex)<<0],children:$!=null&&$.renderItem?$.renderItem(O):a.jsx("span",{className:"x98rzlu xeuugli xb3r6kr xlyipyv xuxw1ft",children:O.label})},O.id)});return I.heading?a.jsxs("div",{role:"group","aria-label":I.heading,children:[a.jsx("div",{"aria-hidden":"true",className:"xf314gf x1xye8es xy143xn x141an7d x1ltkj2j xv1l7n4 x87ps6o",children:I.heading}),L]},`group-${I.heading}`):L})}return y.render(a.jsx("div",{id:c,role:"listbox","aria-label":($==null?void 0:$.menuLabel)??t("@astryx.chatTriggerMenu.suggestions"),...ee(J("trigger-menu"),{className:"x9f619 x1xiyphd x1odjw0f x9epnlk xfb3i0g"}),children:N}),{placement:"above",alignment:"start",xstyle:[h6.popoverSurface,h6.popoverGap]})},[y,c,u,b,M,t]);return{state:u,handleInput:j,handleKeyDown:A,renderMenu:T,reset:v,ariaProps:z}}function Kp(e){const t=window.getSelection();if(!t)return null;if(t.rangeCount>0){const s=t.getRangeAt(0);if(e.contains(s.startContainer))return t}const n=document.createRange();return n.selectNodeContents(e),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t}function jy(e,t){const n=Kp(e);if(!n||n.rangeCount===0)return!1;const s=n.getRangeAt(0);s.deleteContents();const r=document.createTextNode(t);return s.insertNode(r),s.setStartAfter(r),s.collapse(!0),n.removeAllRanges(),n.addRange(s),!0}function oq(e){return"render"in e&&typeof e.render=="function"}function aq(e){let t=e;for(;t;){if(t instanceof HTMLElement&&t.hasAttribute("data-astryx-token"))return t;t=t.parentNode}return null}function lq({editableRef:e,onEmitChange:t}){const[n,s]=p.useState([]),r=p.useCallback(u=>{const d=e.current;if(!d)return;const f=Kp(d);if(!f||f.rangeCount===0)return;const h=f.getRangeAt(0),x=document.createElement("span"),g=`token-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;x.setAttribute("data-astryx-token",""),x.setAttribute("data-astryx-token-value",u.value),x.setAttribute("data-astryx-token-id",g),x.contentEditable="false",x.style.display="inline-flex",x.style.verticalAlign="baseline",h.deleteContents(),h.insertNode(x);const y=document.createTextNode(" ");x.after(y);const v=document.createRange();return v.setStartAfter(y),v.collapse(!0),f.removeAllRanges(),f.addRange(v),s(m=>[...m,{id:g,span:x,token:u}]),g},[e]),i=p.useCallback(u=>{if(u.key!=="Backspace")return!1;const d=window.getSelection();if(!d||!d.isCollapsed||d.rangeCount===0)return!1;const f=d.getRangeAt(0),{startContainer:h,startOffset:x}=f;if(h.nodeType===Node.TEXT_NODE&&x===0&&h.previousSibling instanceof HTMLElement&&h.previousSibling.hasAttribute("data-astryx-token"))return!1;if(h.nodeType===Node.TEXT_NODE&&h.textContent===" "&&x<=1&&h.previousSibling instanceof HTMLElement&&h.previousSibling.hasAttribute("data-astryx-token")){u.preventDefault();const g=h.previousSibling,y=h.parentNode;return y&&(y.removeChild(h),y.removeChild(g)),t(),!0}return!1},[t]),o=p.useCallback(u=>{const d=e.current;if(!d)return!1;const f=Kp(d);if(!f||f.rangeCount===0)return!1;const h=f.getRangeAt(0),x=aq(h.startContainer);if(x){u.preventDefault();const g=u.clipboardData.getData("text/plain"),y=x.nextSibling,v=document.createRange();return y&&y.nodeType===Node.TEXT_NODE?v.setStartAfter(y):v.setStartAfter(x),v.collapse(!0),f.removeAllRanges(),f.addRange(v),jy(d,g),t(),!0}return!1},[e,t]),l=p.useCallback(u=>{if(!e.current)return;const f=n.find(m=>m.id===u);if(!f)return;const{span:h}=f,x=h.getAttribute("data-astryx-token-value")??"",g=document.createTextNode(x),y=h.nextSibling;(y==null?void 0:y.nodeType)===Node.TEXT_NODE&&y.textContent===" "&&y.remove(),h.replaceWith(g);const v=window.getSelection();if(v){const m=document.createRange();m.setStartAfter(g),m.collapse(!0),v.removeAllRanges(),v.addRange(m)}s(m=>m.filter(k=>k.id!==u)),t()},[e,n,t]),c=p.useCallback(()=>{s(u=>u.filter(d=>{var f;return(f=e.current)==null?void 0:f.contains(d.span)}))},[e]);return{tokenPortals:n,expandToken:l,insertToken:r,handleKeyDown:i,handlePaste:o,cleanupPortals:c}}function cq(e){const t=e.split(`
148
- `).length,n=e.length;return t>1?`${t} lines, ${n} chars`:`${n} chars`}function WS({text:e,onExpand:t}){const n=Me(),s=cq(e),r=a.jsxs("div",{className:"x78zum5 xdt5ytf x1txdalj x17fpy1y",children:[a.jsx("div",{className:"x9m5x89 x141an7d x1ltkj2j x1tgivj0 x126k92a x13faqbe x1xiyphd x1odjw0f",children:e}),a.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj",children:[a.jsx("span",{className:"x141an7d xv1l7n4",children:s}),t&&a.jsx(Q,{label:n("@astryx.chat.pastedText.expand"),variant:"ghost",size:"sm",onClick:t})]})]});return a.jsx(_S,{content:r,placement:"above",alignment:"start",hasHoverIndication:!1,children:a.jsx($d,{label:s,variant:"neutral"})})}WS.displayName="ChatPastedTextToken";function uq(e){const t=e.split(`
149
- `).length,n=e.length,s=t>1?`${t} lines, ${n} chars`:`${n} chars`;return{value:e,label:s,variant:"neutral"}}function dq({inputRef:e,threshold:t=200,toToken:n=uq}){return{onPaste:p.useCallback((r,i)=>{var l;if(i.length<=t)return!1;const o=n(i);return(l=e.current)==null||l.insertToken(o),!0},[e,t,n])}}const B5=p.createContext(null);B5.displayName="ChatMessageContext";function KS(){return p.use(B5)}const H5=p.createContext(null);H5.displayName="ChatListContext";function fq(){return p.use(H5)}const q5=p.createContext(null);q5.displayName="ChatComposerContext";function XS(){return p.use(q5)}const P5=p.createContext(null);P5.displayName="ChatLayoutContext";function hq(){return p.use(P5)}const pq=22,p6={root:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kAzted:"xe0957l",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0}};function Om(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function Vc(e){let t="";for(const n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t+=n.textContent??"":n instanceof HTMLElement&&(n.hasAttribute("data-astryx-token")?t+=n.getAttribute("data-astryx-token-value")??"":n.tagName==="BR"?t+=`
150
- `:t+=Vc(n));return t}function U5(e){const t=Me(),n=XS(),s=e.value!==void 0,{ref:r,handleRef:i,value:o=n==null?void 0:n.value,onChange:l,placeholder:c,maxRows:u=8,triggers:d,debounceMs:f=150,hasHistory:h=!0,label:x,isDisabled:g=(n==null?void 0:n.isDisabled)??!1,onPaste:y,pasteAsToken:v,onFiles:m,onSubmit:k=n==null?void 0:n.onSubmit,onKeyDown:b,xstyle:j,className:A,style:M,...E}=e,z=x??t("@astryx.chat.composerInput.label"),T=c??(n==null?void 0:n.placeholder)??t("@astryx.chat.composer.placeholder"),$=n==null?void 0:n.onChange,_=p.useCallback(V=>{if(s){l==null||l(V);return}$==null||$(V),l!==$&&(l==null||l(V))},[$,s,l]),R=p.useRef(null),N=p.useRef(null),[H,B]=p.useState(!0),I=p.useRef([]),L=p.useRef(-1),O=p.useRef(""),D=p.useRef(void 0),q=p.useRef(()=>{}),F=p.useRef(()=>{}),K={insertToken:V=>q.current(V),expandToken:V=>ue.expandToken(V),insertText:V=>F.current(V),focus:()=>{var V;return(V=R.current)==null?void 0:V.focus()},getValue:()=>Vc(R.current??document.createElement("div"))};N.current=K,p.useImperativeHandle(i,()=>K);const Z=n==null?void 0:n.inputControlRef;p.useEffect(()=>{if(Z)return Z.current={focus:()=>{var V;return(V=R.current)==null?void 0:V.focus()}},()=>{Z.current=null}},[Z]),p.useEffect(()=>{if(o===void 0||!R.current)return;if(o===D.current){D.current=void 0;return}const V=R.current;if(Vc(V)!==o){D.current=void 0;const xe=document.activeElement===V;if(V.textContent=o,xe){const ve=window.getSelection();if(ve){const ke=document.createRange();ke.selectNodeContents(V),ke.collapse(!1),ve.removeAllRanges(),ve.addRange(ke)}}B(o.length===0)}else D.current=void 0},[o]);const se=p.useRef(null),ne=p.useCallback(()=>{var me;if(!R.current)return;const V=Vc(R.current),xe=R.current.querySelector("[data-astryx-token], [data-astryx-dictation-interim]")!=null,ve=V.trim().length===0&&!xe,ke=ve?"":V;D.current=ke,B(ve),_==null||_(ke),(me=se.current)==null||me.call(se)},[_]),ue=lq({editableRef:R,onEmitChange:ne});se.current=ue.cleanupPortals;const P=dq({inputRef:N}),U=v===!1?null:v??P,X=p.useCallback(V=>{const xe=R.current;xe&&jy(xe,V)},[]);q.current=ue.insertToken,F.current=X;const ie=iq({triggers:d,editableRef:R,onInsertToken:ue.insertToken,onInsertText:X,onEmitChange:ne,debounceMs:f}),te=p.useCallback(()=>{ne(),ie.handleInput()},[ne,ie]),de=p.useCallback(V=>{if(!ie.handleKeyDown(V)&&(b==null||b(V),!V.defaultPrevented)){if(V.key==="Backspace"){const xe=window.getSelection();if(xe&&xe.isCollapsed&&xe.rangeCount>0){const ve=xe.getRangeAt(0),{startContainer:ke,startOffset:me}=ve;if(!(ke.nodeType===Node.TEXT_NODE&&me===0&&ke.previousSibling instanceof HTMLElement&&ke.previousSibling.hasAttribute("data-astryx-token"))){if(ke.nodeType===Node.TEXT_NODE&&ke.textContent===" "&&me<=1&&ke.previousSibling instanceof HTMLElement&&ke.previousSibling.hasAttribute("data-astryx-token")){V.preventDefault();const pe=ke.previousSibling,Qe=ke.parentNode;Qe&&(Qe.removeChild(ke),Qe.removeChild(pe)),ne();return}}}}if(V.key==="Enter"&&!V.shiftKey){if(V.nativeEvent.isComposing||V.nativeEvent.keyCode===229||(V.preventDefault(),!R.current))return;const xe=Vc(R.current).trim();if(!xe)return;h&&(I.current.push(xe),L.current=-1,O.current=""),k==null||k(xe),R.current.textContent="",B(!0),_==null||_("");return}if(h&&(V.key==="ArrowUp"||V.key==="ArrowDown")){if(!R.current)return;const xe=Vc(R.current),ve=I.current;if(ve.length===0)return;if(V.key==="ArrowUp"){L.current===-1&&(O.current=xe);const ke=L.current===-1?ve.length-1:Math.max(0,L.current-1);L.current=ke,R.current.textContent=ve[ke],Om(R.current),ne(),V.preventDefault()}else if(V.key==="ArrowDown"&&L.current!==-1){const ke=L.current+1;ke>=ve.length?(L.current=-1,R.current.textContent=O.current,O.current&&Om(R.current)):(L.current=ke,R.current.textContent=ve[ke],Om(R.current)),ne(),V.preventDefault()}}}},[h,k,_,ne,ie,b]),fe=p.useCallback(V=>{const xe=R.current;if(!xe||(Kp(xe),ue.handlePaste(V)))return;const ve=Array.from(V.clipboardData.files);if(ve.length>0){V.preventDefault(),m==null||m(ve);return}V.preventDefault();const ke=V.clipboardData.getData("text/plain");if(U!=null&&U.onPaste(V,ke)){ne();return}if(y==null?void 0:y(V,ke)){ne();return}jy(xe,ke),ne()},[m,y,ne,ue,U]),he=u*pq;return a.jsxs("div",{ref:r,...ee(J("chat-composer-input"),W(p6.root,g&&p6.disabled,j),A,M),...E,children:[H&&a.jsx("div",{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x47corl xv1l7n4 xjm74w1 x6pjikd x19v9tvf x9ynric x87ps6o x9epnlk","aria-hidden":"true",children:T}),a.jsx("div",{ref:R,"aria-multiline":"true","aria-label":z,contentEditable:!g,suppressContentEditableWarning:!0,onInput:te,onKeyDown:de,onPaste:fe,...ie.ariaProps,...ee({className:"x1a2a7pz x126k92a x13faqbe x1odjw0f xjm74w1 x6pjikd x19v9tvf x9ynric x1tgivj0 xxugrtn x9epnlk"},{style:{maxHeight:`${he}px`}})}),ie.renderMenu(),ue.tokenPortals.filter(({span:V})=>V.isConnected).map(({id:V,span:xe,token:ve})=>a1.createPortal(oq(ve)?a.jsx("span",{children:ve.render()},V):ve.value.length>(U===null?1/0:200)?a.jsx(WS,{text:ve.value,onExpand:()=>ue.expandToken(V)},V):a.jsx($d,{label:ve.label,variant:ve.variant,icon:ve.icon},V),xe))]})}U5.displayName="ChatComposerInput";const xq={root:{kaIpWk:"xy0xnkn",kmuXW:"x2lah0s",$$css:!0}};function F5(e){const t=Me(),n=XS(),{isStopShown:s=(n==null?void 0:n.isStopShown)??!1,isDisabled:r=!((n==null?void 0:n.canSend)??!1),onSend:i,onStop:o=n==null?void 0:n.onStop,sendIcon:l,stopIcon:c,size:u="md",xstyle:d,className:f,style:h,ref:x,...g}=e,y=i??(()=>n==null?void 0:n.onSubmit("")),v=rd("stop"),m=rd("arrowUp");return a.jsx(Q,{ref:x,label:t(s?"@astryx.chatSendButton.stop":"@astryx.chatSendButton.send"),variant:s?"secondary":"primary",size:u,icon:s?c??v:l??m,isIconOnly:!0,isDisabled:!s&&r,onClick:s?o:y,...g,...J("chat-send-button"),className:f,style:h,xstyle:[xq.root,d]})}F5.displayName="ChatSendButton";const x6={body:{kVAEAm:"x1n2onr6",kY2c9j:"xhtitgo",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kmVPX3:"x18oj4ui",kOIVth:"x1txdalj",kaIpWk:"x1xunbrq",kWkggS:"x1prclbq",kkrTdU:"x1ed109x",kmkexE:"xrg7dcy",$$css:!0},compact:{"--_chat-composer-padding":"x18zce08",kOIVth:"xzye2dw",$$css:!0}},gq={low:{kGVxlE:"x1i5ehqx xhouywz",knuKkz:"xyavpck",$$css:!0},none:{kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"xvy26l8 x6q1khz",kmVPX3:"x1b50gpf",kGVxlE:"x1gnnqk1 x12y27fx xuihb5h",$$css:!0}};function ZS(e){const t=Me(),{ref:n,onSubmit:s,onStop:r,isStopShown:i=!1,value:o,onChange:l,placeholder:c,isDisabled:u=!1,density:d="balanced",elevation:f="low",drawer:h,headerActions:x,headerContext:g,input:y,footerActions:v,sendActions:m,sendButton:k,status:b,statusPosition:j="bottom",xstyle:A,className:M,style:E,...z}=e,T=c??t("@astryx.chat.composer.placeholder"),[$,_]=p.useState(""),R=o!==void 0,N=R?o:$,H=p.useCallback(K=>{R||_(K),l==null||l(K)},[R,l]),B=p.useCallback(()=>{const K=N.trim();!K||u||(s(K),H(""))},[N,u,s,H]),I=N.trim().length>0&&!u,L=p.useRef(null),O=p.useRef(null),D=p.useCallback(K=>{var ne;if(K.target.closest('button, a, [role="button"], [contenteditable="true"], [data-astryx-token]'))return;if(O.current){O.current.focus();return}const se=(ne=L.current)==null?void 0:ne.querySelector('[contenteditable="true"], textarea');se==null||se.focus()},[]),q=b?a.jsxs("div",{role:b.type==="error"?"alert":"status",...{0:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c"},4:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz"},2:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x1pritpl x1joocv1"},6:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x1pritpl x1joocv1"},1:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x24i8r5 xdhq94a"},5:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x24i8r5 xdhq94a"},3:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x24i8r5 xdhq94a"},7:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x24i8r5 xdhq94a"}}[(j==="top")<<2|(b.type==="error")<<1|(b.type==="warning")<<0],children:[a.jsx(ze,{icon:b.type==="error"?"error":"warning",size:"md",color:b.type==="error"?"error":"warning"}),b.message]}):null,F=p.useMemo(()=>({value:N,onChange:H,onSubmit:B,placeholder:T,isDisabled:u,isStopShown:i,canSend:I,onStop:r,inputControlRef:O}),[N,H,B,T,u,i,I,r]);return a.jsx(q5,{value:F,children:a.jsxs("div",{ref:n,...ee(J("chat-composer",{density:d}),{0:{className:"x1n2onr6 x1ja2u2z xc8icb0 x78zum5 xdt5ytf xx161y6 xk0ittl xcw7vlg"},1:{className:"x1n2onr6 x1ja2u2z xc8icb0 x78zum5 xdt5ytf xx161y6 xk0ittl xcw7vlg x197sbye x47corl"}}[!!u<<0],M,E),...z,children:[j==="top"&&q,h,a.jsxs("div",{ref:L,onClick:D,...W(x6.body,gq[f],d==="compact"&&x6.compact,A),children:[(x||g)&&a.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj xe0p6wg",children:[a.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:x}),a.jsx("div",{className:"x78zum5 x6s0dn4 x1txdalj xvc5jky x141an7d x1ltkj2j xv1l7n4",children:g})]}),a.jsx("div",{className:"x78zum5 xdt5ytf",children:y??a.jsx(U5,{})}),a.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj x21xpn4",children:[a.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:v}),a.jsxs("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:[m,k??a.jsx(F5,{})]})]})]}),j==="bottom"&&q]})})}ZS.displayName="ChatComposer";const mq={root:{kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kVQacm:"xb3r6kr",kg3NbH:"x1pzlopt",kLKAdn:"x1vlblms",kGO01o:"xxbfulo",k1K539:"x1cdrix3",kWkggS:"x10xzikg",kKwaWg:"x1vrk509",krdFHd:"x1n70msy",kfmiAY:"xg0tfu",$$css:!0}};function YS({ref:e,children:t,count:n,label:s,isCollapsed:r,defaultIsCollapsed:i=!1,onCollapsedChange:o,xstyle:l,className:c,style:u,"data-testid":d,...f}){const h=Me(),x=s??h("@astryx.chat.composerDrawer.label"),[g,y]=p.useState(i),v=r!==void 0,m=v?r:g,k=n!=null,b=p.useId(),j=()=>{const A=!m;v||y(A),o==null||o(A)};return a.jsxs("div",{ref:e,"data-testid":d,...ee(J("chat-composer-drawer",{collapsed:m?"collapsed":null}),W(mq.root,l),c,u),...f,children:[k&&a.jsxs("div",{...{0:{className:"xrvj5dj x1y6fwsi x6s0dn4 x1grt7ep x1pzlopt x1ng9b9t x1ypdohk x87ps6o x-default-marker"},1:{className:"xrvj5dj x1y6fwsi x6s0dn4 x1grt7ep x1pzlopt x1ng9b9t x1ypdohk x87ps6o x-default-marker"}}[!!m<<0],role:"button",tabIndex:0,"aria-expanded":!m,"aria-controls":b,"aria-label":m?h("@astryx.chatComposerDrawer.expand",{label:x}):h("@astryx.chatComposerDrawer.collapse",{label:x}),onClick:j,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),j())},children:[a.jsxs("div",{...{0:{className:"x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x1hc1fzr x19991ni xuedmi6 xlr8y92"},1:{className:"x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x19991ni xuedmi6 xlr8y92 xg01cxk x47corl"}}[!m<<0],children:[a.jsx($d,{variant:"neutral",label:n}),a.jsx("span",{className:"xv1l7n4 x1t9gxa6 xjm74w1 x7acx1w xt3l3uh xuedmi6 xlr8y92",children:x})]}),a.jsx("div",{...{0:{className:"x1ms6mhf xgkxs2y x7v7x1q x1y8v6su xfyiiit x1b2l0oc xjspbzw x1q5y3ey x1pe4z86 x1hc1fzr x1e8aii2 xuedmi6 xlr8y92"},1:{className:"x1ms6mhf xgkxs2y x7v7x1q x1y8v6su xfyiiit x1b2l0oc xjspbzw x1q5y3ey x1pe4z86 x1e8aii2 xuedmi6 xlr8y92 xg01cxk x47corl"}}[!!m<<0]})]}),a.jsx("div",{id:b,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!(k&&m)<<0],children:a.jsx("div",{...{0:{className:"x2lwn1j x78zum5 x1a02dak xzye2dw x1cy8zhl x1hc1fzr x19991ni x80gvsz x10b1n17 xlr8y92"},1:{className:"x2lwn1j x78zum5 x1a02dak xzye2dw x1cy8zhl x19991ni xlr8y92 xg01cxk x1ahifba xuedmi6"}}[!!(k&&m)<<0],children:t})})]})}YS.displayName="ChatComposerDrawer";const Jd={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},inner:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},gapCompact:{kOIVth:"x1txdalj",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",$$css:!0},gapBalanced:{kOIVth:"x18g69wz",k8WAf4:"x1na6nto",kg3NbH:"x1pzlopt",$$css:!0},gapSpacious:{kOIVth:"x1qh66ti",k8WAf4:"xq6koh6",kg3NbH:"xm7rs69",$$css:!0}},yq={0:{kOIVth:"xsn7fz1",$$css:!0},1:{kOIVth:"xzye2dw",$$css:!0},2:{kOIVth:"x1txdalj",$$css:!0},3:{kOIVth:"xjcht0a",$$css:!0},4:{kOIVth:"x18g69wz",$$css:!0},5:{kOIVth:"x9mgr7n",$$css:!0},6:{kOIVth:"x1qh66ti",$$css:!0},8:{kOIVth:"x4t41sb",$$css:!0},10:{kOIVth:"x3hoi3v",$$css:!0},"0.5":{kOIVth:"x1lsbc85",$$css:!0},"1.5":{kOIVth:"x1s4dlld",$$css:!0}};function QS({children:e,emptyState:t,scrollToTopAction:n,density:s="balanced",gap:r,isStreaming:i=!1,xstyle:o,className:l,style:c,"data-testid":u,ref:d,...f}){const h=hq(),x=p.useRef(null),g=p.useRef(null),[y,v]=p.useTransition();p.useEffect(()=>{if(h!=null&&h.contentRef&&g.current)return h.contentRef(g.current),()=>h.contentRef(null)},[h]);const m=e!=null&&e!==!1&&!(Array.isArray(e)&&e.length===0);p.useEffect(()=>{var E;const A=(E=h==null?void 0:h.scrollContainerRef)==null?void 0:E.current;if(!n||!x.current)return;const M=new IntersectionObserver(z=>{var T;(T=z[0])!=null&&T.isIntersecting&&v(async()=>{await n()})},{root:A??null,threshold:0});return M.observe(x.current),()=>M.disconnect()},[n,h]);const k=p.useMemo(()=>({density:s}),[s]),b=s==="compact"?Jd.gapCompact:s==="spacious"?Jd.gapSpacious:Jd.gapBalanced,j=r==null?null:yq[r];return a.jsx(H5,{value:k,children:a.jsx("div",{...f,ref:d,role:"log","aria-live":"polite","aria-busy":i||void 0,tabIndex:0,"data-testid":u,...ee(J("chat-message-list",{density:s}),W(Jd.root,o),l,c),children:a.jsxs("div",{ref:g,...W(Jd.inner,b,j),children:[n&&a.jsx("div",{ref:x,"aria-hidden":!0}),y&&a.jsx("div",{className:"x78zum5 xl56j7k x8o8v82",children:a.jsx(Jt,{size:"md"})}),a.jsx("div",{className:"x98rzlu x2lwn1j","aria-hidden":!0}),m?e:t?a.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j",children:t}):null]})})})}QS.displayName="ChatMessageList";const $n={root:{k1xSpc:"x78zum5",kGNEyG:"x1cy8zhl",ks0D6T:"x193iq5w",$$css:!0},rootGapCompact:{kOIVth:"x1s4dlld",$$css:!0},rootGapBalanced:{kOIVth:"x1txdalj",$$css:!0},rootGapSpacious:{kOIVth:"xjcht0a",$$css:!0},rootAssistant:{kXwgrk:"x1q0g3np",kjj79g:"x1nhvcw1",$$css:!0},rootUser:{kXwgrk:"x15zctf7",kjj79g:"x1nhvcw1",$$css:!0},rootSystem:{kXwgrk:"x1q0g3np",kjj79g:"xl56j7k",$$css:!0},contentColumn:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",$$css:!0},contentColumnSystem:{ks0D6T:"xq8v1hd",kGNEyG:"x6s0dn4",$$css:!0},contentColumnAssistant:{kGNEyG:"x1cy8zhl",$$css:!0},contentColumnUser:{kGNEyG:"xuk3077",$$css:!0},childrenWrap:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k7Eaqz:"xeuugli",kzqmXN:"xh8yej3",$$css:!0},childrenAssistant:{kGNEyG:"x1cy8zhl",$$css:!0},childrenUser:{kGNEyG:"xuk3077",$$css:!0},childrenSystem:{kGNEyG:"x6s0dn4",$$css:!0},childrenGapCompact:{kOIVth:"x1lsbc85",$$css:!0},childrenGapBalanced:{kOIVth:"xzye2dw",$$css:!0},childrenGapSpacious:{kOIVth:"x1s4dlld",$$css:!0}};function V5({sender:e,children:t,avatar:n,name:s,metadata:r,density:i,xstyle:o,className:l,style:c,"data-testid":u,ref:d,...f}){const h=Me(),x=fq(),g=i??(x==null?void 0:x.density)??"balanced",y=p.useMemo(()=>({sender:e,density:g}),[e,g]),v=g==="compact"?$n.rootGapCompact:g==="spacious"?$n.rootGapSpacious:$n.rootGapBalanced,m=g==="compact"?$n.childrenGapCompact:g==="spacious"?$n.childrenGapSpacious:$n.childrenGapBalanced,k=e==="system"?$n.rootSystem:e==="user"?$n.rootUser:$n.rootAssistant,b=e==="system"?$n.contentColumnSystem:e==="user"?$n.contentColumnUser:$n.contentColumnAssistant,j=e==="system"?$n.childrenSystem:e==="user"?$n.childrenUser:$n.childrenAssistant,A=e==="system",M=n!=null&&!A,E=s!=null&&!A,z=p.useId();return a.jsx(B5,{value:y,children:a.jsxs("article",{...f,ref:d,"data-testid":u,"aria-label":E?void 0:h("@astryx.chatMessage.messageFrom",{sender:e}),"aria-labelledby":E?z:void 0,...ee(J("chat-message",{sender:e,density:g}),W($n.root,k,M&&v,o),l,c),children:[M&&a.jsx("div",{className:"x2lah0s x5du68j",children:n}),a.jsxs("div",{...W($n.contentColumn,b),children:[E&&a.jsx("div",{id:z,className:"x141an7d x2mo6ok xv1l7n4 x1ltkj2j x14cgwvg",children:s}),a.jsx("div",{...W($n.childrenWrap,j,m),children:t}),r!=null&&!A&&a.jsx("div",{children:r})]})]})})}V5.displayName="ChatMessage";const It={content:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",ks0D6T:"xl6temz",kaIpWk:"xashgol",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",$$css:!0},radiusCompact:{kaIpWk:"x1hviunn",$$css:!0},paddingCompact:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},paddingBalanced:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},paddingSpacious:{k8WAf4:"x1na6nto",kg3NbH:"xzz68wx",$$css:!0},paddingBlockNone:{k8WAf4:"xt970qd",$$css:!0},metadataPaddingCompact:{kg3NbH:"x1pzlopt",$$css:!0},metadataPaddingBalanced:{kg3NbH:"x1pzlopt",$$css:!0},metadataPaddingSpacious:{kg3NbH:"xzz68wx",$$css:!0},metadataReducedGap:{keoZOQ:"x1c40v9y",$$css:!0},headerReducedGap:{k1K539:"xdrfirk",$$css:!0},nameRow:{kZKoxP:"x1grt7ep",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",$$css:!0},alignEnd:{k9WMMc:"xp4054r",$$css:!0},assistant:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},user:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},ghost:{kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",$$css:!0},groupFirstAssistant:{kVL7Gh:"xrfs2vl",$$css:!0},groupMiddleAssistant:{krdFHd:"x3qb8m",kVL7Gh:"xrfs2vl",$$css:!0},groupLastAssistant:{krdFHd:"x3qb8m",$$css:!0},groupFirstUser:{kT0f0o:"x1whkvtz",$$css:!0},groupMiddleUser:{kfmiAY:"x126per9",kT0f0o:"x1whkvtz",$$css:!0},groupLastUser:{kfmiAY:"x126per9",$$css:!0}};function JS({children:e,variant:t="filled",name:n,metadata:s,group:r,xstyle:i,className:o,style:l,"data-testid":c,ref:u,...d}){const f=KS(),h=(f==null?void 0:f.sender)??"assistant",x=(f==null?void 0:f.density)??"balanced",g=x==="compact"?It.paddingCompact:x==="spacious"?It.paddingSpacious:It.paddingBalanced,y=h==="user",v=t==="ghost"?It.ghost:y?It.user:It.assistant,m=r==="first"?y?It.groupFirstUser:It.groupFirstAssistant:r==="middle"?y?It.groupMiddleUser:It.groupMiddleAssistant:r==="last"?y?It.groupLastUser:It.groupLastAssistant:null,k=x==="compact"?It.metadataPaddingCompact:x==="spacious"?It.metadataPaddingSpacious:It.metadataPaddingBalanced;return a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{"data-chat-name":!0,...W(k,It.nameRow,It.headerReducedGap,y&&It.alignEnd),children:n}),a.jsx("div",{...d,ref:u,"data-testid":c,...ee(J("chat-message-bubble",{sender:h,variant:t,density:x}),W(It.content,x==="compact"&&It.radiusCompact,v,g,t==="ghost"&&It.paddingBlockNone,m,i),o,l),children:e}),s&&a.jsx("div",{...W(k,It.metadataReducedGap,y&&It.alignEnd),children:s})]})}JS.displayName="ChatMessageBubble";const vq={sending:{icon:"clock",i18nKey:"@astryx.chat.status.sending"},sent:{icon:"check",i18nKey:"@astryx.chat.status.sent"},delivered:{icon:"checkDouble",i18nKey:"@astryx.chat.status.delivered"},read:{icon:"checkDouble",i18nKey:"@astryx.chat.status.read"},error:{icon:"error",i18nKey:"@astryx.chat.status.failed"}},Dm={meta:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",keoZOQ:"xcsaf9d",kGuDYH:"x141an7d",k63SB2:"x1sodnla",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",$$css:!0},metaUser:{kXwgrk:"x15zctf7",$$css:!0},metaAssistant:{kXwgrk:"x1q0g3np",$$css:!0}};function bg({ref:e,timestamp:t,footer:n,status:s,xstyle:r,className:i,style:o,...l}){const c=Me(),u=KS(),d=(u==null?void 0:u.sender)??"assistant",f=s!=null?vq[s]:null,h=f!=null?c(f.i18nKey):"";return t!=null||n!=null||f!=null?a.jsxs("div",{ref:e,...ee(J("chat-message-metadata"),W(Dm.meta,d==="user"?Dm.metaUser:Dm.metaAssistant,r),i,o),...l,children:[t!=null&&a.jsx("span",{children:t}),t!=null&&(n!=null||f!=null)&&a.jsx("span",{children:"·"}),n!=null&&n,n!=null&&f!=null&&a.jsx("span",{children:"·"}),f!=null&&a.jsxs("span",{title:h,"aria-label":c("@astryx.chat.messageAriaLabel",{status:h.toLowerCase()}),...{0:{className:"x3nfvp2 x6s0dn4 xzye2dw"},2:{className:"x3nfvp2 x6s0dn4 xzye2dw xjt36v0"},1:{className:"x3nfvp2 x6s0dn4 xzye2dw xcx56e2 xmg6eyc x4hg4is xa4qsjk x1aquc0h"},3:{className:"x3nfvp2 x6s0dn4 xzye2dw xjt36v0 xcx56e2 xmg6eyc x4hg4is xa4qsjk x1aquc0h"}}[(s==="error")<<1|(s==="sending")<<0],children:[a.jsx(ze,{icon:f.icon,size:"xsm",color:"inherit"}),a.jsx("span",{children:h})]})]}):null}bg.displayName="ChatMessageMetadata";const g6={root:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"x1txdalj",k8WAf4:"xu0wf1k",kMv6JI:"x9ynric",kGuDYH:"x141an7d",k63SB2:"x1sodnla",kMwMTN:"xv1l7n4",k9WMMc:"x2b8uid",$$css:!0},dividerWrap:{kzqmXN:"xh8yej3",$$css:!0}};function Xp({children:e,variant:t="default",icon:n,xstyle:s,className:r,style:i,ref:o,...l}){return t==="divider"?a.jsx("div",{ref:o,...ee(J("chat-system-message",{variant:t}),W(g6.dividerWrap,s),r,i),...l,role:"status",children:a.jsx(ja,{label:e})}):a.jsx("div",{ref:o,...ee(J("chat-system-message",{variant:t}),W(g6.root,s),r,i),...l,role:"status",children:a.jsxs("span",{className:"x3nfvp2 x6s0dn4 x1s4dlld x2lah0s xuxw1ft",children:[n!=null&&a.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s",children:n}),e]})})}Xp.displayName="ChatSystemMessage";const kq=1e3/60;function bq({scrollRef:e,enabled:t=!0,lockThreshold:n=10,buttonThreshold:s=100,damping:r=.7,stiffness:i=.05,mass:o=1.25}){const[l,c]=p.useState(!1),[u,d]=p.useState(!0),f=p.useRef(!0),h=p.useRef(!0),x=p.useRef(0),g=p.useRef(!1),y=p.useRef(void 0),v=p.useRef(0),m=p.useRef(0),k=p.useRef(0),b=p.useCallback(()=>{const N=e.current;if(!N||!f.current){g.current=!1,y.current=void 0,x.current=0;return}if(N.scrollHeight<=N.clientHeight){g.current=!1,y.current=void 0,x.current=0;return}const H=N.scrollHeight-N.clientHeight,B=H-N.scrollTop;if(Math.abs(B)<.5&&Math.abs(x.current)<.1){N.scrollTop=H,g.current=!1,y.current=void 0,x.current=0;return}const I=performance.now(),L=y.current?(I-y.current)/kq:1;y.current=I,x.current=(r*x.current+i*B)/o,N.scrollTop+=x.current*L,requestAnimationFrame(b)},[e,r,i,o]),j=p.useCallback(()=>{const N=e.current;N&&(g.current=!1,x.current=0,y.current=void 0,N.scrollTop=N.scrollHeight-N.clientHeight,v.current=N.scrollTop)},[e]),A=Pa("(prefers-reduced-motion: reduce)"),M=p.useCallback(()=>{if(f.current){if(A){j();return}g.current||(g.current=!0,y.current=void 0,requestAnimationFrame(b))}},[b,j,A]),E=p.useCallback(N=>{if(f.current=!0,d(!0),c(!1),h.current=!1,(N==null?void 0:N.behavior)==="instant"){j();return}M()},[M,j]),z=p.useCallback(N=>{const H=e.current;if(!H)return;const B=H.getBoundingClientRect(),L=N.getBoundingClientRect().top-B.top+H.scrollTop;H.scrollTo({top:L,behavior:"instant"}),v.current=H.scrollTop},[e]),T=p.useCallback(()=>{const N=e.current;if(!N)return;const H=N.getElementsByClassName("astryx-chat-message"),B=H[H.length-1];B instanceof HTMLElement&&z(B)},[e,z]),$=p.useCallback(()=>{f.current=!0,d(!0),c(!1),M()},[M]),_=p.useCallback(()=>{f.current=!1,g.current=!1,d(!1)},[]),R=p.useCallback(()=>{if(!t||!f.current)return;const N=e.current;if(h.current&&N&&N.scrollHeight>N.clientHeight){h.current=!1,j();return}M()},[t,M,j,e]);return p.useEffect(()=>{const N=e.current;if(!N||!t)return;v.current=N.scrollTop,m.current=N.scrollHeight,k.current=N.offsetHeight;const H=()=>{const{scrollTop:O,scrollHeight:D,offsetHeight:q}=N,F=D-O-q;c(F>s);const K=D!==m.current,Z=q!==k.current;if(m.current=D,k.current=q,K||Z){v.current=O;return}const se=O<v.current;v.current=O,se&&f.current&&(f.current=!1,g.current=!1,d(!1))},B=()=>{N.scrollHeight-N.scrollTop-N.offsetHeight<=n&&(f.current=!0,d(!0))},I=O=>{O.deltaY<0&&g.current&&(f.current=!1,g.current=!1,d(!1))},L=()=>{g.current&&(f.current=!1,g.current=!1,d(!1))};return N.addEventListener("scroll",H,{passive:!0}),N.addEventListener("scrollend",B),N.addEventListener("wheel",I,{passive:!0}),N.addEventListener("touchmove",L,{passive:!0}),requestAnimationFrame(()=>{N.scrollHeight>N.clientHeight&&(N.scrollTop=N.scrollHeight-N.clientHeight,v.current=N.scrollTop,h.current=!1)}),()=>{N.removeEventListener("scroll",H),N.removeEventListener("scrollend",B),N.removeEventListener("wheel",I),N.removeEventListener("touchmove",L)}},[e,t,n,s]),{isScrolledUp:l,isLocked:u,scrollToBottom:E,scrollToMessage:z,lock:$,unlock:_,scrollIfLocked:R,scrollToLastMessage:T}}function wq({isLocked:e,onResize:t}){const[n,s]=p.useState(!1),r=p.useRef(null),i=p.useRef(e);i.current=e;const o=p.useRef(t);o.current=t;const l=p.useRef(null),c=p.useRef(null),u=p.useCallback(x=>{d5(x,()=>{var v;(v=o.current)==null||v.call(o);const g=x.getElementsByClassName("astryx-chat-message"),y=g.length>0?g[g.length-1]:null;y&&y!==r.current&&(r.current=y,i.current||s(!0))}),c.current=()=>f5(x)},[]),d=p.useCallback(()=>{var x;(x=c.current)==null||x.call(c),c.current=null},[]),f=p.useCallback(x=>{x!==l.current&&(d(),l.current=x,x&&u(x))},[u,d]);p.useEffect(()=>()=>d(),[d]);const h=p.useCallback(()=>{s(!1)},[]);return{hasNewMessages:n,dismiss:h,contentRef:f}}const fo={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",keoZOQ:"xtbrsbv",$$css:!0},statusIcon:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kaIpWk:"xjspbzw",$$css:!0},nodePill:{kmuXW:"x2lah0s",$$css:!0},colorPending:{kMwMTN:"xnbbluu",$$css:!0},colorRunning:{kMwMTN:"xqwr325",$$css:!0},colorComplete:{kMwMTN:"xtjic6",$$css:!0},colorError:{kMwMTN:"xjt36v0",$$css:!0}},eC={pending:"clock",running:null,complete:"check",error:"close"},tC={pending:fo.colorPending,running:fo.colorRunning,complete:fo.colorComplete,error:fo.colorError};function jq(e){return pI(e.key,()=>{var t,n;return[e.name,e.status??"complete",e.target??"",e.node??"",e.duration??"",((t=e.additions)==null?void 0:t.toString())??"",((n=e.deletions)==null?void 0:n.toString())??"",e.errorMessage??""].join("")})}function m6({call:e}){const t=Me(),n=e.status??"complete",s=e.resultDetail!=null,[r,i]=p.useState(!1),o=p.useId(),l=s?()=>i(u=>!u):void 0,c=a.jsxs("div",{role:s?"button":void 0,tabIndex:s?0:void 0,"aria-expanded":s?r:void 0,"aria-controls":s&&r?o:void 0,onClick:l,onKeyDown:s?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l==null||l())}:void 0,...{0:{className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw"},1:{className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk xh6dtrn x7a5moj xtedp8i xe9uy6x"}}[!!s<<0],children:[a.jsxs("span",{title:n==="error"?e.errorMessage:void 0,...W(fo.statusIcon,tC[n]),children:[n==="running"?a.jsx(Jt,{size:"sm",shade:"subtle"}):n==="pending"?a.jsx(Jt,{size:"sm",shade:"subtle"}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"x10l6tqk x10a8y8t x1pjcqnp xtwfq29 x1xyvc85"}),a.jsx("span",{className:"x1n2onr6 x3nfvp2",children:a.jsx(ze,{icon:eC[n]??"check",size:"xsm",color:"inherit"})})]}),n==="error"&&e.errorMessage!=null&&a.jsx(qi,{children:t("@astryx.chatToolCalls.error",{message:e.errorMessage??""})})]}),a.jsx("span",{className:"x141an7d x1ltkj2j x9m5x89 x1e4wzip xv1l7n4 xuxw1ft xb3r6kr xlyipyv xs83m0k x13n9wmd",children:e.name}),e.node!=null&&a.jsx($d,{label:e.node,variant:"neutral",xstyle:fo.nodePill}),e.target!=null&&a.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft xb3r6kr xlyipyv x1g3ib7 xeuugli",children:e.target}),(e.additions!=null||e.deletions!=null||e.stats!=null)&&a.jsxs("span",{className:"x78zum5 x6s0dn4 xzye2dw x141an7d x1ltkj2j x9ynric xnbbluu x2lah0s",children:[e.additions!=null&&a.jsxs("span",{className:"xtjic6",children:["+",e.additions]}),e.deletions!=null&&a.jsxs("span",{className:"xjt36v0",children:["-",e.deletions]}),e.stats]}),e.duration!=null&&n==="complete"&&a.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft x2lah0s",children:e.duration}),s&&a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb xvc5jky"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb xvc5jky x19jd1h0"}}[!!r<<0],children:a.jsx(ze,{icon:"chevronDown",size:"xsm",color:"inherit"})})]});return s?a.jsxs("div",{children:[c,r&&a.jsx("div",{id:o,className:"x1f43n9v x1wesfrj",children:e.resultDetail})]}):c}function nC(e){const t=Me(),{calls:n,label:s,isExpanded:r,defaultIsExpanded:i,onExpandedChange:o,xstyle:l,className:c,style:u,ref:d,...f}=e,h=i??!1,[x,g]=p.useState(h),y=p.useId(),v=r!==void 0,m=v?r:x,k=p.useCallback(()=>{const A=!m;v||g(A),o==null||o(A)},[m,v,o]);if(n.length===0)return null;if(n.length===1)return a.jsx("div",{ref:d,...ee(J("chat-tool-calls"),W(fo.root,l),c,u),...f,children:a.jsx(m6,{call:n[0]})});const b=n[n.length-1],j=b.status??"complete";return a.jsxs("div",{ref:d,...ee(J("chat-tool-calls"),W(fo.root,l),c,u),...f,children:[a.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,"aria-controls":y,onClick:k,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),k())},className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk",children:[m?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x1kky2od xlup9mm xv1l7n4",children:a.jsx(ze,{icon:"wrench",size:"sm",color:"inherit"})}),a.jsx("span",{className:"x141an7d x1ltkj2j x9ynric x1e4wzip xv1l7n4",children:t("@astryx.chatToolCalls.groupLabel",{count:n.length})})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{...W(fo.statusIcon,tC[j]),children:j==="running"?a.jsx(Jt,{size:"sm",shade:"subtle"}):j==="pending"?a.jsx(Jt,{size:"sm",shade:"subtle"}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"x10l6tqk x10a8y8t x1pjcqnp xtwfq29 x1xyvc85"}),a.jsx("span",{className:"x1n2onr6 x3nfvp2",children:a.jsx(ze,{icon:eC[j]??"check",size:"xsm",color:"inherit"})})]})}),a.jsx("span",{className:"x141an7d x1ltkj2j x9m5x89 x1e4wzip xv1l7n4 xuxw1ft xb3r6kr xlyipyv xs83m0k x13n9wmd",children:b.name}),b.target!=null&&a.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft xb3r6kr xlyipyv x1g3ib7 xeuugli",children:b.target})]}),a.jsx("span",{className:"x3nfvp2 x6s0dn4 x1lsbc85 x141an7d x1ltkj2j x9ynric xnbbluu x2lah0s",children:!m&&a.jsxs(a.Fragment,{children:[a.jsx(ze,{icon:"wrench",size:"xsm",color:"inherit"}),n.length]})}),a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb x19jd1h0"}}[!!m<<0],children:a.jsx(ze,{icon:"chevronDown",size:"xsm",color:"inherit"})})]}),a.jsx("div",{id:y,...{0:{className:"xrvj5dj xihq33y xb0j27v x9kvfbb"},1:{className:"xrvj5dj xb0j27v x9kvfbb x1tu4anv"}}[!!m<<0],children:a.jsx("div",{className:"xb3r6kr x2lwn1j",children:a.jsx("div",{className:"x78zum5 xdt5ytf x7a5moj xtedp8i",children:n.map(A=>a.jsx(m6,{call:A},jq(A)))})})})]})}nC.displayName="ChatToolCalls";const Bm={wrapper:{k1xSpc:"x78zum5",kjj79g:"xl56j7k",kGO01o:"xvmdzux",$$css:!0},button:{"--radius-element":"xnpej1e",khDVqt:"xuxw1ft",kg3NbH:"xf314gf",$$css:!0},buttonWithLabel:{kwRFfy:"x1t818jl",$$css:!0}};function sC({ref:e,isVisible:t,label:n,onClick:s,xstyle:r,className:i,style:o,...l}){const c=Me();return a.jsx("div",{ref:e,...ee(W(Bm.wrapper,r),i,o),...l,children:a.jsx("div",{...{0:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk xg01cxk x47corl x1x67gh"},2:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk x1hc1fzr x67bb7w x1x67gh"},1:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk xg01cxk x47corl x1ncir08"},3:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk x1hc1fzr x67bb7w x1ncir08"}}[!!t<<1|!!n<<0],children:a.jsx(Q,{label:n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),"aria-label":n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),icon:a.jsx(ze,{icon:"chevronDown",size:"md"}),variant:"ghost",size:"md",onClick:s,xstyle:[Bm.button,n?Bm.buttonWithLabel:null],children:n??void 0})})})}sC.displayName="ChatLayoutScrollButton";const An={root:{kVAEAm:"x1n2onr6",k9g6sI:"x12h1iku",kAzted:"x2lwn1j",kUk6DE:"x98rzlu",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},rootScrollable:{kORKVm:"x1odjw0f",kXHlph:"x6ikm8r",k5wCbM:"x1mqgsch",$$css:!0},messageArea:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUOVxO:"xvueqy4",kzQI83:"x1iyjqo2",kmuXW:"x2lah0s",kCS8Yb:"xdl72j9",kGO01o:"xjpqqx5",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},blurLayer:{kVAEAm:"x10l6tqk",krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kfzvcC:"x47corl",k6WDB:"xvn2z4z",keRtuK:"x67t5t6",kZKoxP:"xpyat2d",kX1K2I:"xw26lqc",kAExgp:"x1bv1mxo",$$css:!0},dock:{kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",kfzvcC:"x67bb7w",kg3NbH:"xrrkdod",kGO01o:"xvmdzux",$$css:!0},dockInner:{kUOVxO:"xvueqy4",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",$$css:!0},messageAreaCompact:{ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},messageAreaBalanced:{ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},messageAreaSpacious:{ks0D6T:"x1ap80js",kg3NbH:"x1pzlopt",$$css:!0},blurLayerCompact:{kZKoxP:"xwzfr38",kX1K2I:"xkm2don",kAExgp:"xiy8rlo",$$css:!0},blurLayerBalanced:{kZKoxP:"xpyat2d",kX1K2I:"xw26lqc",kAExgp:"x1bv1mxo",$$css:!0},blurLayerSpacious:{kZKoxP:"x1wkxgih",kX1K2I:"xr5yg4x",kAExgp:"xo9xo30",$$css:!0},dockCompact:{kg3NbH:"xf314gf",kGO01o:"x1wesfrj",$$css:!0},dockBalanced:{kg3NbH:"xrrkdod",kGO01o:"xvmdzux",$$css:!0},dockSpacious:{kg3NbH:"x1pzlopt",kGO01o:"xvmdzux",$$css:!0},dockInnerCompact:{ks0D6T:"x193iq5w",$$css:!0},dockInnerBalanced:{ks0D6T:"x193iq5w",$$css:!0},dockInnerSpacious:{ks0D6T:"x1ap80js",$$css:!0}};function Sq(e){return!(e==null||e===!1||Array.isArray(e)&&e.length===0)}function rC({children:e,composer:t,density:n="balanced",emptyState:s,scrollButton:r,scrollRef:i,xstyle:o,className:l,style:c,"data-testid":u,ref:d,...f}){const h=Me(),x=p.useRef(null),g=i??x,y=!i,v=bq({scrollRef:g}),m=wq({isLocked:v.isLocked,onResize:v.scrollIfLocked}),k=a.jsx(sC,{isVisible:v.isScrolledUp||m.hasNewMessages,label:m.hasNewMessages?h("@astryx.chatLayout.newMessages"):void 0,onClick:()=>{m.dismiss(),v.scrollToBottom()}}),b=p.useMemo(()=>({scrollContainerRef:g,contentRef:m.contentRef}),[g,m.contentRef]),j=!Sq(e),M={compact:{messageArea:An.messageAreaCompact,blurLayer:An.blurLayerCompact,dock:An.dockCompact,dockInner:An.dockInnerCompact},balanced:{messageArea:An.messageAreaBalanced,blurLayer:An.blurLayerBalanced,dock:An.dockBalanced,dockInner:An.dockInnerBalanced},spacious:{messageArea:An.messageAreaSpacious,blurLayer:An.blurLayerSpacious,dock:An.dockSpacious,dockInner:An.dockInnerSpacious}}[n];return a.jsx(P5,{value:b,children:a.jsxs("div",{...f,ref:Wt(d,x),"data-testid":u,...ee(J("chat-layout",{density:n}),W(An.root,y&&An.rootScrollable,o),l,c),children:[a.jsx("div",{...W(An.messageArea,M.messageArea),children:j&&s?a.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k x98rzlu xz65tgg",children:s}):e}),a.jsxs("div",{...{0:{className:"x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl x2lah0s xixxii4"},1:{className:"x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl x2lah0s x7wzq59"}}[!!y<<0],children:[r===void 0?k:r,a.jsx("div",{...W(An.blurLayer,M.blurLayer)}),a.jsx("div",{...W(An.dock,M.dock),children:a.jsx("div",{...W(An.dockInner,M.dockInner),children:t})})]})]})})}rC.displayName="ChatLayout";const l1=p.createContext(null);l1.displayName="ListContext";const Hm={list:{kogj98:"x1ghz6dp",kZCmMZ:"x1c1uobl",kH6xsr:"x3ct3a4",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",$$css:!0},withDividers:{kOIVth:"xxhr3t",$$css:!0},withCounter:{kt6KFK:"xif0320",$$css:!0}},Cq={kt6KFK:"x1khind5",$$css:!0},Eq={counterStart:e=>[Cq,{"--x-counterReset":`astryx-list ${e}`!=null?`astryx-list ${e}`:void 0}]};function Bt({children:e,density:t="balanced",hasDividers:n=!1,header:s,listStyle:r="none",start:i,xstyle:o,className:l,style:c,"data-testid":u,ref:d}){const f=p.useId(),h=r==="decimal",x=h?"ol":"ul",g=p.useMemo(()=>({density:t,hasDividers:n,listStyle:r}),[t,n,r]),y=a.jsx(x,{ref:d,"data-testid":u,"aria-labelledby":s!=null?f:void 0,...h&&i!=null&&i!==1?{start:i}:{},role:"list",...ee(J("list",{density:t,listStyle:r}),W(Hm.list,n&&Hm.withDividers,r!=="none"&&(i!=null&&i!==1?Eq.counterStart(i-1):Hm.withCounter),o),l,c),children:e});return s==null?a.jsx(l1,{value:g,children:y}):a.jsx(l1,{value:g,children:a.jsxs("div",{className:"x78zum5 xdt5ytf",children:[a.jsx("div",{id:f,className:"x1p37lm5",children:s}),y]})})}Bt.displayName="List";const $q=[];function G5({label:e,isLabelHidden:t=!1,description:n,status:s,value:r,onChange:i,changeAction:o,density:l="balanced",hasDividers:c=!1,isDisabled:u=!1,disabledMessage:d,isReadOnly:f=!1,children:h,ref:x,width:g,xstyle:y,className:v,style:m,"data-testid":k,...b}){const j=p.useId(),A=p.useId(),M=p.useId(),E=p.useId(),[,z]=p.useTransition(),T=r!==void 0,$=r??$q,[_,R]=p.useOptimistic($),[N,H]=p.useOptimistic(null),B=u&&!!d,I=Es({placement:"above",focusTrigger:"always",isEnabled:B}),L=p.useCallback((D,q)=>{i==null||i(D),o&&z(async()=>{R(D),q!==void 0&&H(q),await o(D)})},[i,o,z,R,H]),O=p.useMemo(()=>({value:T?_:void 0,onChange:T?L:void 0,isDisabled:u,hasDisabledMessage:B,isReadOnly:f,loadingValue:N}),[T,_,L,u,B,f,N]);return a.jsxs(wc,{...b,ref:x,"data-testid":k,label:e,isLabelHidden:t,description:n,inputID:j,labelID:A,isGroupLabel:!0,descriptionID:n?M:void 0,isDisabled:u,status:s?{type:s.type,message:s.message,messageID:s.message?E:void 0}:void 0,statusVariant:"detached",width:g,xstyle:y,...ee(J("checkbox-list"),{className:v,style:m}),children:[a.jsx(hg,{value:O,children:a.jsx("div",{ref:D=>{I.ref(D)},role:"group","aria-labelledby":A,"aria-describedby":[n?M:null,s!=null&&s.message?E:null,B?I.describedBy:null].filter(Boolean).join(" ")||void 0,children:a.jsx(Bt,{density:l,hasDividers:c,children:h})})}),B&&I.renderTooltip(d)]})}G5.displayName="CheckboxList";const y6={withCounter:{kAmcRD:"xfrknyr",$$css:!0},withDivider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},Aq={noRadius:{kaIpWk:"x2u8bby",$$css:!0}};function Ye({label:e,description:t,startContent:n,endContent:s,onClick:r,interactiveRef:i,href:o,target:l,rel:c,isDisabled:u=!1,isSelected:d=!1,xstyle:f,className:h,style:x,ref:g,...y}){const v=p.use(l1),m=(v==null?void 0:v.density)??"balanced",k=(v==null?void 0:v.hasDividers)??!1,b=(v==null?void 0:v.listStyle)??"none",j=b!=="none",A=b==="disc"?a.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:a.jsx("span",{className:"x1v4s8kt xols6we x16rqkct x19aspcf"})}):b==="circle"?a.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:a.jsx("span",{className:"x1v4s8kt xols6we x16rqkct xmkeg23 x1y0btm7 xqcx1ss xjbqb8w"})}):b==="decimal"?a.jsx("span",{className:"xoi2r2e x2lah0s x1tgivj0 xjm74w1 xw6l6zx x12xnipv xc2ndz5"}):null;return a.jsx(Td,{as:"li",ref:g,marker:A,startContent:n,label:e,description:t,endContent:s,onClick:r,interactiveRef:i,href:o,target:l,rel:c,isDisabled:u,isSelected:d,density:m,xstyle:[j&&y6.withCounter,k&&y6.withDivider,k&&Aq.noRadius,f],...ee(J("list-item"),{className:h,style:x}),...y})}Ye.displayName="ListItem";const Mq={selected:{kWkggS:"xgcxg3y",$$css:!0}};function Zp({label:e,"aria-label":t,value:n,description:s,endContent:r,isDisabled:i=!1,isLoading:o=!1,isChecked:l,onCheck:c,ref:u,xstyle:d,className:f,style:h,onClick:x,...g}){const y=Me(),v=p.use(hg);if(v&&v.value!==void 0&&n===void 0)throw new Error("CheckboxListItem requires a `value` prop when used inside CheckboxList with a value array.");const m=t??(typeof e=="string"?e:y("@astryx.checkboxList.item.checkbox"));Ad("CheckboxListItem",'`label` is a ReactNode, so the checkbox falls back to the generic accessible name "Checkbox". Pass `aria-label` with a concise string equivalent of the visible label so screen readers can tell items apart.',typeof e!="string"&&t==null);const k=p.use(l1),j=((k==null?void 0:k.density)??"balanced")==="compact"?"sm":"md",A=((v==null?void 0:v.isDisabled)??!1)||i,M=(v==null?void 0:v.isReadOnly)??!1,E=o||((v==null?void 0:v.loadingValue)!=null&&n!==void 0?v.loadingValue===n:!1);let z=!1;v&&v.value!==void 0&&n!==void 0?z=v.value.includes(n):l!==void 0&&(z=l);const T=!M&&(v!=null||c!=null),$=p.useRef(null),_=T||x!=null,R=()=>{var N,H;if(!(A||M||E))if(v&&v.value!==void 0&&n!==void 0)v.value.includes(n)?(N=v.onChange)==null||N.call(v,v.value.filter(I=>I!==n),n):(H=v.onChange)==null||H.call(v,[...v.value,n],n);else{const B=z!==!0;c==null||c(B)}};return a.jsx(Ye,{...g,ref:u,label:e,description:s,endContent:r,isDisabled:A,interactiveRef:_?$:void 0,"aria-busy":E||void 0,xstyle:[z===!0&&!A&&!M&&Mq.selected,d],className:f,style:h,startContent:a.jsx(ch,{ref:$,label:m,isLabelHidden:!0,value:z,onChange:()=>R(),onClick:x,isDisabled:A,isReadOnly:M,isLoading:E,size:j})})}Zp.displayName="CheckboxListItem";const Sy=120;function Tq(e){let t=0,n=0;const s=[];for(const l of e){const c=l.width;if((c==null?void 0:c.type)==="pixel")n+=c.value;else{const u=(c==null?void 0:c.value)??1,d=c!=null?c.minWidth??Sy:0;t+=u,s.push({key:l.key,proportion:u,minWidth:d})}}let r=0;if(t>0)for(const l of s){const c=l.minWidth*t/l.proportion;c>r&&(r=c)}const i=n+r,o=new Map;for(const l of e){const c=l.width,u={};if((c==null?void 0:c.type)==="pixel")u.width=`${c.value}px`,u.minWidth=`${c.value}px`;else{const d=(c==null?void 0:c.value)??1;if(t>0&&(u.width=`${d/t*100}%`),c!=null){const f=c.minWidth??Sy;u.minWidth=`${f}px`}}o.set(l.key,{style:u})}return{columns:o,tableMinWidth:i}}function zq(e=1,t){return{type:"proportional",value:e,minWidth:(t==null?void 0:t.minWidth)??Sy}}function v6(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Nq(e,t){const n=e[t];return n==null?"":n instanceof Date?n.toISOString():typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?String(n):""}function _q(e){return e==null?0:typeof e=="string"?e.length:typeof e=="number"||typeof e=="boolean"?String(e).length:0}function Rq(e){if(e==null||typeof e!="string"&&typeof e!="number"&&typeof e!="boolean")return 0;const t=String(e);let n=0,s=0;for(let r=0;r<=t.length;r++)r===t.length||t[r]===" "||t[r]===" "||t[r]===`
151
- `?(s>n&&(n=s),s=0):s++;return n}const Iq=60,Lq=8;function Oq(e){if(e.length===0)return[];const t=e[0],n=Object.keys(t),s=e.slice(0,Math.min(5,e.length));return n.map(i=>{const o=v6(i).length;let l=o,c=o;for(const u of s){const d=_q(u[i]);d>l&&(l=d);const f=Rq(u[i]);f>c&&(c=f)}return{key:i,headerLen:o,maxContentLen:l,maxWordLen:c}}).map(i=>{const o=i.maxContentLen<=6?1:i.maxContentLen<=15?2:3,l=Math.max(Math.max(i.headerLen,i.maxWordLen)*Lq,Iq);return{key:i.key,header:v6(i.key),width:zq(o,{minWidth:l})}})}const k6={x139im0d:"x139im0d",$$css:!0},iC={cell:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",ks0D6T:"x1m189uc",$$css:!0}},Dq={cell:{kVQacm:"xb3r6kr",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",ks0D6T:"x1m189uc",$$css:!0}},oC={compact:{kZCmMZ:"x5uh4xs",kwRFfy:"xbg7gas",$$css:!0},balanced:{kZCmMZ:"x9bi00s",kwRFfy:"xpilulx",$$css:!0},spacious:{kZCmMZ:"x18c6q21",kwRFfy:"x1wzlfcn",$$css:!0}},wg=p.createContext(null);wg.displayName="TableContext";const Bq={row:{kWkggS:"x1dnou9g","--table-row-overlay":"x1rht92",$$css:!0}},Hq={row:{kWkggS:"xe9uy6x","--table-row-overlay":"x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}},qq={row:{kWkggS:"x1dnou9g xe9uy6x","--table-row-overlay":"x1rht92 x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}};function Yp({children:e,xstyle:t,ref:n,isHeaderRow:s=!1,...r}){const i=p.use(wg);if(!i)return a.jsx("tr",{ref:n,...r,...ee(J("table-row"),W(k6,t)),children:e});const o=[];return s||(i.isStriped&&i.hasHover?o.push(qq.row):i.isStriped?o.push(Bq.row):i.hasHover&&o.push(Hq.row)),i.dividers==="rows"||i.dividers,t&&o.push(...t),a.jsx("tr",{ref:n,...r,...ee(J("table-row"),W(k6,...o)),children:e})}Yp.displayName="TableRow";const Fh={trigger:{kVAEAm:"x1n2onr6",k7VYTy:"xpdipgo",$$css:!0},menu:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kskxy:"xuyqlj2",kORKVm:"x1odjw0f","--_dropdown-menu-radius":"x1fcsqxe","--_dropdown-menu-padding":"xgory14",kmVPX3:"x9epnlk",kaIpWk:"x1n97fys",kWkggS:"x1prclbq",kGVxlE:"x1i5ehqx",kSiTet:"x1hc1fzr",k1ekBW:"x19991ni",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kfSwDN:"x87ps6o",$$css:!0},popover:{k7Eaqz:"x5w4yej",$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function W5({children:e,menuWidth:t,size:n="md",label:s,isDisabled:r=!1,onOpenChange:i,ref:o,className:l,style:c,xstyle:u,triggerXstyle:d,"data-testid":f,...h}){const x=Me(),g=s??x("@astryx.contextMenu.label"),{items:y,menuContent:v,...m}=h,k=y??[],b=v,j=p.useId(),A=p.useRef({x:0,y:0}),M=p.useRef(null),E=p.useRef(null),z=p.useRef(null),[T,$]=p.useState(!1),_=Cd({mode:"context",onHide:p.useCallback(()=>{$(!1),i==null||i(!1);const P=z.current;z.current=null,P&&document.contains(P)&&P.focus()},[i]),onShow:p.useCallback(()=>{$(!0),i==null||i(!0)},[i]),lightDismiss:!1}),R=p.useCallback(()=>{_.hide()},[_]),{listRef:N,handleKeyDown:H,focusFirst:B,focusItem:I,ownsEvent:L,getItems:O}=Ed({itemSelector:$5,boundarySelector:A5,wrap:!1,onEscape:R}),D=C5({getItemLabels:()=>O().map(P=>P.textContent),onMatch:I,getCurrentIndex:()=>O().findIndex(P=>P===document.activeElement||P.contains(document.activeElement))});p.useEffect(()=>{if(!T)return;const P=U=>{const X=N.current;X&&!X.contains(U.target)&&R()};return document.addEventListener("mousedown",P),()=>{document.removeEventListener("mousedown",P)}},[T,R,N]),p.useEffect(()=>{if(!T)return;const P=U=>{U.key==="Escape"&&(U.isComposing||U.keyCode===229||(U.preventDefault(),R()))};return document.addEventListener("keydown",P),()=>{document.removeEventListener("keydown",P)}},[T,R]);const q=p.useCallback(P=>{if(L(P)){if(P.key==="Enter"||P.key===" "){P.preventDefault();const U=document.activeElement;U&&dg.has(U.getAttribute("role")??"")&&U.click();return}if(P.key==="Tab"){R();return}if(D.onKeyDown(P)){P.preventDefault();return}H(P)}},[H,R,D,L]),F=p.useCallback((P,U,X)=>{A.current={x:P,y:U};const ie=M.current;ie&&(ie.style.left=`${P}px`,ie.style.top=`${U}px`),z.current=document.activeElement instanceof HTMLElement?document.activeElement:X,_.show(),requestAnimationFrame(()=>B())},[_,B]),K=p.useCallback(P=>{if(r)return;P.preventDefault();const U=E.current,X=U==null?void 0:U.getBoundingClientRect(),ie=P.clientX===0&&P.clientY===0&&P.detail===0,te=ie||!X?0:P.clientX-X.left,de=ie||!X?(X==null?void 0:X.height)??0:P.clientY-X.top;F(te,de,P.currentTarget)},[r,F]),Z=fB({disabled:r,onLongPress:p.useCallback(P=>{var X;const U=(X=E.current)==null?void 0:X.getBoundingClientRect();F(U?P.x-U.left:P.x,U?P.y-U.top:P.y,E.current)},[F])}),se=t?Fh.popoverCustomWidth(t):Fh.popover,ne=p.useMemo(()=>({closeMenu:R,menuSize:n}),[R,n]),ue=y!==void 0?M5(k):b;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:Wt(o,E),onContextMenu:K,...Z,...m,"data-testid":f,...W(Fh.trigger,...d?Array.isArray(d)?d:[d]:[]),children:[e,a.jsx("span",{ref:Wt(M,_.ref),"aria-hidden":"true",...ee({className:"x10l6tqk xnalus7 xqtp20y x47corl"},{style:{left:`${A.current.x}px`,top:`${A.current.y}px`}})})]}),_.render(a.jsx("div",{ref:N,id:j,role:"menu","aria-label":g,onKeyDown:q,onContextMenu:P=>P.preventDefault(),...ee(J("context-menu"),W(Fh.menu,u),l,c),children:a.jsx(ah,{value:ne,children:ue})}),{placement:"below",alignment:"start",xstyle:[se,go.below]})]})}W5.displayName="ContextMenu";function aC(e){const t=[],n=new Map;for(const r of e){const i=r.group??"__ungrouped__";let o=n.get(i);o||(o=[],n.set(i,o),t.push(i)),o.push(r)}const s=[];return t.forEach((r,i)=>{i>0&&s.push({type:"divider"});for(const o of n.get(r)??[])s.push({label:typeof o.label=="string"?o.label:o.id,icon:o.checked?a.jsx(ze,{icon:"check",size:"xsm","aria-hidden":!0}):o.icon,isDisabled:o.disabled,onClick:o.onSelect})}),s}function Pq({element:e,getActions:t,triggerXstyle:n}){const[s,r]=p.useState(null);return a.jsx(W5,{items:s??[],triggerXstyle:n,onOpenChange:i=>{r(i?aC(t()):null)},children:e})}function lC(e,t,n){return typeof t=="function"?a.jsx(Pq,{element:e,getActions:t,triggerXstyle:n}):!t||t.length===0?e:a.jsx(W5,{items:aC(t),triggerXstyle:n,children:e})}function Uq(e,t,n){const s=[];return(e.dividers==="rows"||e.dividers==="grid")&&s.push(t),(e.dividers==="columns"||e.dividers==="grid")&&s.push(n),s}function cC(e,t){return t?Array.isArray(t)?[...e,...t]:[...e,t]:e}function uC(){return p.use(wg)}const Fq={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0}},Vq={compact:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},balanced:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},spacious:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0}},Gq={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0}},b6={fill:{k1xSpc:"x1lliihq",kB7OPa:"x9f619",kZKoxP:"x5yr21d",kzqmXN:"xh8yej3",$$css:!0}},Wq={cell:{kZKoxP:"x5yr21d",$$css:!0}},Kq={cell:{kt9PQ7:"x92x3c3 x1wp2rvj",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},Xq={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}},Zq={middle:{kXLuUW:"xxymvpz",$$css:!0},top:{kXLuUW:"x16dsc37",$$css:!0},bottom:{kXLuUW:"x3ajldb",$$css:!0}};function K5({children:e,xstyle:t,ref:n,className:s,style:r,contextMenuActions:i,...o}){const l=uC(),c=typeof i=="function"||Array.isArray(i)&&i.length>0,u=l?[c?Vq[l.density]:Fq[l.density],l.textOverflow==="truncate"?iC.cell:Dq.cell,oC[l.density],Zq[l.verticalAlign],...Uq(l,Kq.cell,Xq.cell),...c?[Wq.cell]:[]]:[],d=c&&l?[b6.fill,Gq[l.density]]:c?b6.fill:void 0,f=lC(e,i,d);return a.jsx("td",{ref:n,...o,...ee(J("table-cell",{density:l==null?void 0:l.density}),W(...cC(u,t)),s,r),children:f})}K5.displayName="TableCell";const Yq={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0}},Qq={cell:{k63SB2:"x2mo6ok",kMwMTN:"xv1l7n4",k9WMMc:"x1yc453h",$$css:!0}},Jq={cell:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},eP={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}};function X5({children:e,xstyle:t,ref:n,className:s,style:r,contextMenuActions:i,...o}){const l=uC(),c=[];l&&(c.push(Qq.cell,Yq[l.density],Jq.cell,iC.cell,oC[l.density]),(l.dividers==="columns"||l.dividers==="grid")&&c.push(eP.cell));const u=lC(e,i);return a.jsx("th",{ref:n,...o,...ee(J("table-header-cell",{density:l==null?void 0:l.density}),W(...cC(c,t)),s,r),children:u})}X5.displayName="TableHeaderCell";function Z5({ref:e,children:t,xstyle:n,className:s,style:r,...i}){return a.jsx("thead",{ref:e,...ee(J("table-header"),W(n),s,r),...i,children:t})}Z5.displayName="TableHeader";function Y5({ref:e,children:t,xstyle:n,className:s,style:r,...i}){return a.jsx("tbody",{ref:e,...ee(J("table-body"),W(n),s,r),...i,children:t})}Y5.displayName="TableBody";const w6={container:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",k9WMMc:"x2b8uid",kOIVth:"x18g69wz",k8WAf4:"xmfvnks",kg3NbH:"xm7rs69",$$css:!0},containerCompact:{kOIVth:"x1txdalj",k8WAf4:"x1na6nto",kg3NbH:"x1pzlopt",$$css:!0}};function pr({title:e,description:t,icon:n,actions:s,headingLevel:r=3,isCompact:i=!1,xstyle:o,className:l,style:c,ref:u,...d}){const f=`h${r}`;return a.jsxs("div",{ref:u,role:"status",...ee(J("empty-state",{variant:i?"compact":null}),W(w6.container,i&&w6.containerCompact,o),l,c),...d,children:[n!=null&&a.jsx("div",{"aria-hidden":"true",children:n}),a.jsxs("div",{className:"x78zum5 xdt5ytf x6s0dn4 xxc7z9f",children:[p.createElement(f,{0:{className:"x1ghz6dp xjb2p0i x18juvz8 x2mo6ok xf74fhv x1tgivj0"},1:{className:"x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib"}}[!!i<<0],e),t!=null&&a.jsx("div",{...{0:{className:"x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4"},1:{className:"x1ghz6dp xjb2p0i x1sodnla xw6l6zx xv1l7n4 x141an7d"}}[!!i<<0],children:t})]}),s!=null&&a.jsx("div",{...{0:{className:"x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d"},1:{className:"x78zum5 x6s0dn4 x1txdalj xcsaf9d xdt5ytf"}}[!!i<<0],children:s})]})}pr.displayName="EmptyState";const qm={table:{kzqmXN:"xh8yej3",kLvRdT:"x1mwwwfo",kheTzg:"x1gukg7c",kPzzVL:"x140o2bo",$$css:!0},tableAutoLayout:{kPzzVL:"x1drmoe9",$$css:!0}};function bl(e,t,n,...s){return e.reduce((r,i,o)=>{const l=t(i);if(!l)return r;try{return l(r,...s)}catch(c){return fj("Table",`Plugin at index ${o} threw in transform:`,c),r}},n)}const tP=[];function nP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function sP({item:e,rowIndex:t,rowKey:n,columns:s,plugins:r,textOverflow:i,RowComponent:o,CellComponent:l,ariaRowIndex:c}){const u=s.map((h,x)=>{var j;const g={};h.align&&(g.style={textAlign:h.align});const v=bl(r,A=>A.transformBodyCell,{htmlProps:g,xstyle:[],columnIndex:x,columns:s},h,e,x,s),m=!h.renderCell,k=m?Nq(e,h.key):((j=h.renderCell)==null?void 0:j.call(h,e))??null;let b;return m&&i==="truncate"&&typeof k=="string"&&k.length>0?b=a.jsx(Y,{type:"body",maxLines:1,children:k}):b=k,a.jsx(l,{...v.htmlProps,contextMenuActions:v.contextMenuActions,xstyle:v.xstyle,children:b},h.key)}),d=bl(r,h=>h.transformBodyRow,{htmlProps:c==null?{}:{"aria-rowindex":c},xstyle:[],children:a.jsx(a.Fragment,{children:u})},e,t);return a.jsx(o,{ref:d.ref,...d.htmlProps,xstyle:d.xstyle,children:d.children},n)}function rP(e,t){if(e.rowKey!==t.rowKey||e.rowIndex!==t.rowIndex||e.ariaRowIndex!==t.ariaRowIndex||e.columns!==t.columns||e.plugins!==t.plugins||e.textOverflow!==t.textOverflow||e.RowComponent!==t.RowComponent||e.CellComponent!==t.CellComponent)return!1;if(e.item===t.item)return!0;const n=e.item,s=t.item,r=Object.keys(s);if(Object.keys(n).length!==r.length)return!1;for(const i of r)if(n[i]!==s[i])return!1;return!0}const iP=p.memo(sP,rP);function oP({data:e,columns:t,idKey:n,plugins:s,children:r,textOverflow:i="wrap",scrollWrapper:o,emptyState:l,rowIndexStart:c,rowCount:u,xstyle:d,className:f,style:h,ref:x,...g}){const y=Me(),v=s??tP,m=c!=null||u!=null,k=c??1,b=m?u??-1:void 0,j=Yp,A=K5,M=X5,E=t??(e?Oq(e):[]),z=bl(v,D=>D.transformColumns,E),T=p.useRef(z);nP(T.current,z)||(T.current=z);const $=T.current,_=Tq($),R=bl(v,D=>D.transformTable,{htmlProps:{},xstyle:r?[qm.table,qm.tableAutoLayout]:[qm.table]}),N=$.map((D,q)=>{var xe;const F=D.header??D.key,K={"data-column-key":D.key,scope:"col"};D.align&&(K.style={textAlign:D.align});const se=bl(v,ve=>ve.transformHeaderCell,{htmlProps:K,xstyle:[],content:F,columnIndex:q,columns:$},D,q,$),ne=((xe=_.columns.get(D.key))==null?void 0:xe.style)??{},ue=se.htmlProps.style,P={...se.htmlProps,style:ue?{...ne,...ue}:ne},U=se.content??F,X=typeof U=="string"&&U.length>0?{title:U}:{},{before:ie,after:te,overlay:de,below:fe}=se,V=ie!=null||te!=null||de!=null||fe!=null?a.jsxs(a.Fragment,{children:[ie,te!=null?a.jsxs("div",{className:"x3nfvp2 x6s0dn4 xzye2dw xeuugli",children:[U,te]}):U,de,fe]}):U;return a.jsx(M,{...P,...X,contextMenuActions:se.contextMenuActions,xstyle:se.xstyle,children:V},D.key)}),H=bl(v,D=>D.transformHeaderRow,{htmlProps:{},xstyle:[],children:a.jsx(a.Fragment,{children:N})}),B=e!=null&&e.length>0,I=$.length>0,L={...R.htmlProps.style,...h,..._.tableMinWidth>0?{minWidth:`${_.tableMinWidth}px`}:null};let O=a.jsx("table",{ref:x,...b!=null?{"aria-rowcount":b}:null,...R.htmlProps,...ee(J("base-table"),W(...R.xstyle,d),[R.htmlProps.className,f].filter(Boolean).join(" ")||void 0,L),...g,children:r||a.jsxs(a.Fragment,{children:[I&&a.jsx(Z5,{children:a.jsx(j,{...H.htmlProps,isHeaderRow:!0,xstyle:H.xstyle,children:H.children})}),a.jsx(Y5,{children:B?e.map((D,q)=>{const F=n==null?q:typeof n=="function"?n(D):String(D[n]);return a.jsx(iP,{item:D,rowIndex:q,rowKey:F,columns:$,plugins:v,textOverflow:i,RowComponent:j,CellComponent:A,ariaRowIndex:m?k+q:void 0},F)}):e!=null&&l!==!1&&a.jsx("tr",{children:a.jsx("td",{colSpan:$.length,children:l??a.jsx(pr,{title:y("@astryx.table.noData"),isCompact:!0})})})})]})});if(o){const D=bl(v,q=>q.transformScrollWrapper,{htmlProps:{},xstyle:[]});O=a.jsx(o,{htmlProps:D.htmlProps,xstyle:D.xstyle,beforeTable:D.beforeTable,afterTable:D.afterTable,children:O})}for(let D=v.length-1;D>=0;D--){const q=v[D];if(q.transformTableContext)try{O=q.transformTableContext(O)}catch(F){fj("Table","Plugin threw in transformTableContext:",F)}}return O}const dC=oP;dC.displayName="BaseTable";const fC=["columnSettings","sort","tree","selection","pagination"],j6=new Map(fC.map((e,t)=>[e,t]));function aP(e){const t=fC.length;return e.sort(([n],[s])=>{const r=j6.get(n)??t,i=j6.get(s)??t;return r-i})}const Vh=new Set(["transformColumns","transformTable","transformHeaderRow","transformHeaderCell","transformBodyRow","transformBodyCell","transformScrollWrapper","transformTableContext"]);function lP(e,t){const n=Object.keys(t);for(const r of n)Vh.has(r)||Zl("Table",`Plugin "${e}" has unknown key "${r}". Valid keys: ${[...Vh].join(", ")}. This key will be ignored.`);for(const r of n)if(Vh.has(r)){const i=t[r];i!=null&&typeof i!="function"&&Zl()}n.some(r=>Vh.has(r)&&typeof t[r]=="function")||Zl()}function cP(e,t){const n=p.useRef(null);if(n.current!=null){const i=n.current;if(i.basePlugins===e&&i.userPlugins===t)return i.result;if(i.basePlugins===e&&uP(i.userPlugins,t))return i.userPlugins=t,i.result}const s=t?aP(Object.entries(t)).map(([,i])=>i):[],r=[...e,...s];if(t)for(const[i,o]of Object.entries(t))lP(i,o);return n.current={basePlugins:e,userPlugins:t,result:r},r}function uP(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}const dP={base:{kMv6JI:"xjb2p0i",kMwMTN:"x1tgivj0",$$css:!0}},S6={base:{kXHlph:"xw2csxc",kuHK5b:"x5lxg6s",$$css:!0},containerBleed:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",keoZOQ:"xkibk3",k1K539:"xlayyun",$$css:!0}};function fP({children:e,htmlProps:t,xstyle:n,beforeTable:s,afterTable:r}){const i=Me(),{ref:o,...l}=t??{};return a.jsxs("div",{ref:o,tabIndex:0,role:"group","aria-label":i("@astryx.table.label"),...l,...ee(J("table-scroll-wrapper"),W(S6.base,S6.containerBleed,...n??[])),children:[s,e,r]})}function hP(){return{transformTable(e){const t=e.htmlProps.className??"",n=J("table").className;return{...e,htmlProps:{...e.htmlProps,className:t?`${t} ${n}`:n},xstyle:[...e.xstyle,dP.base]}}}}function pP({density:e="balanced",dividers:t="rows",isStriped:n=!1,hasHover:s=!1,verticalAlign:r="middle",textOverflow:i="wrap",plugins:o,columns:l,data:c,ref:u,...d}){const f=p.useMemo(()=>hP(),[]),h=p.useMemo(()=>[f],[f]),x=cP(h,o),g=p.useMemo(()=>({density:e,dividers:t,isStriped:n,hasHover:s,verticalAlign:r,textOverflow:i}),[e,t,n,s,r,i]);return a.jsx(wg,{value:g,children:a.jsx(dC,{ref:u,data:c,columns:l,plugins:x,textOverflow:i,scrollWrapper:fP,...d})})}const hC=pP;hC.displayName="Table";function xP(e,t,n){if(e.length===0||t>e[e.length-1]){const s=[...e,t];for(;s.length>n;)s.shift();return s}return e}function gP(e,t,n,s){const r=t+e.length;if(n.length===0)return null;const i=n[0];if(r<=i)return null;const o=[];let l=t;l<i&&i<r&&(o.push({key:`settled-${s}`,text:e.slice(0,i-t),fading:!1}),l=i);for(let c=0;c<n.length;c++){const u=n[c],d=c+1<n.length?n[c+1]:r;if(u>=r||d<=l)continue;const f=Math.max(u,l),h=Math.min(d,r);f>=h||(o.push({key:`fade-${s}-b${u}`,text:e.slice(f-t,h-t),fading:!0}),l=h)}return o.length>0?o:null}const Ja={label:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kXLuUW:"x11njtxf",kZKoxP:"x1grt7ep",kGuDYH:"x141an7d",k63SB2:"xv8on6e",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",kaIpWk:"xh6dtrn",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",kg3NbH:"xf314gf",keTefX:"xladpz9",kybGjl:"x1hl2dhg",k1ekBW:"x1eaenvl",kIyJzY:"x2rcmwa",kAMwcw:"xlr8y92",ks0D6T:"x55n99s",kVQacm:"xb3r6kr",$$css:!0},labelWithIcon:{kZCmMZ:"x138rykx",$$css:!0},labelInteractive:{kkrTdU:"x1ypdohk",$$css:!0},labelHover:{kWkggS:"xe9uy6x",kMwMTN:"xv1l7n4 x140uwzg",$$css:!0},number:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kXLuUW:"x1v0h343",kGuDYH:"x141an7d",k63SB2:"x2mo6ok",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",kWkggS:"xgcxg3y",kaIpWk:"xjspbzw",k7Eaqz:"x16asifk",kZKoxP:"x1grt7ep",kg3NbH:"x7a5moj",kybGjl:"x1hl2dhg",k1ekBW:"x15406qy",kIyJzY:"x2rcmwa",kAMwcw:"xlr8y92",$$css:!0},numberInteractive:{kkrTdU:"x1ypdohk",$$css:!0},numberHover:{kWkggS:"xgcxg3y xe9uy6x",$$css:!0}};function pC({ref:e,source:t,number:n,variant:s="label",xstyle:r,className:i,style:o,"data-testid":l,...c}){const u=Me(),d=t.title??String(n),f=t.url,h=t.icon!=null&&typeof t.icon!="string"?t.icon:null,x=t.src??(typeof t.icon=="string"?t.icon:void 0),g=h!=null||x!=null,y=f?"a":"span",v=f?"doc-noteref":void 0,m=f?{href:f,target:"_blank",rel:"noopener noreferrer",title:d}:{title:d},k=e;return s==="number"?a.jsx(y,{...c,ref:k,role:v,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ee(J("citation",{variant:s}),W(Ja.number,f!=null&&Ja.numberHover,f!=null&&Ja.numberInteractive,r),i,o),children:n}):a.jsxs(y,{...c,ref:k,role:v,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ee(J("citation",{variant:s}),W(Ja.label,g&&Ja.labelWithIcon,f!=null&&Ja.labelHover,f!=null&&Ja.labelInteractive,r),i,o),children:[g&&a.jsx("span",{"aria-hidden":"true",className:"x3nfvp2 x6s0dn4 xl56j7k x12xnipv x6b6gus xjspbzw x10xzikg x1litavf x1y0btm7 x14i3s5s xb3r6kr x2lah0s",children:h!=null?ni(h,{size:"sm"}):a.jsx("img",{src:x,alt:"",className:"x1ad1g3v x9gl9lo"})}),a.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft xeuugli",children:d})]})}pC.displayName="Citation";const mP={sourceIds:void 0,autolink:void 0};function Q5(e){if(e==null)return mP;if(typeof e.has=="function")return{sourceIds:e,autolink:void 0};const t=e;return{sourceIds:t.sourceIds,autolink:t.autolink}}const yP=/^ {0,3}\[([^\]^](?:\\.|[^\]\\])*)\]:[ \t]*(?:<([^<>\n]*)>|(\S+))([ \t]+(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\)))?[ \t]*$/,vP=/^ {0,3}(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\))[ \t]*$/;function c1(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function kP(e){const t=yP.exec(e);if(t==null)return null;const n=c1(t[1]),s=t[2]!=null?t[2]:t[3];return n===""||s==null?null:{label:n,destination:s,hasTitle:t[4]!=null}}function xC(e){const t=e.split(`
152
- `),n=new Map,s=new Array(t.length).fill(!0);let r=!0,i=!1,o="";for(let c=0;c<t.length;c++){const u=t[c];if(i){u.startsWith(o)?(i=!1,o="",r=!0):r=!1;continue}const d=u.match(/^(`{3,}|~{3,})/);if(d){i=!0,o=d[1],r=!1;continue}if(u.trim()===""){r=!0;continue}if(r){const f=kP(u);if(f!=null){n.has(f.label)||n.set(f.label,f.destination),s[c]=!1,!f.hasTitle&&c+1<t.length&&vP.test(t[c+1])&&(s[c+1]=!1,c++);continue}}r=/^ {0,3}#{1,6}(?: |\t|$)/.test(u)||J5(u)}if(n.size===0)return{defs:n,cleaned:e};const l=t.filter((c,u)=>s[u]).join(`
153
- `);return{defs:n,cleaned:l}}function bP(e){return e.size===0?"":[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}\0${n}`).join("")}function wP(e,t,n,s){const r=e.indexOf("]",t+1);if(r===-1)return null;const i=e.slice(t+1,r);if(e[r+1]==="["){const l=e.indexOf("]",r+2);if(l!==-1){const c=e.slice(r+2,l),u=c===""?i:c,d=n.get(c1(u));if(d!=null)return{node:{type:"link",href:d,children:ta(i,s)},end:l+1}}}if(i.trim()==="")return null;const o=n.get(c1(i));return o==null?null:{node:{type:"link",href:o,children:ta(i,s)},end:r+1}}function jP(e,t,n){const s=e.indexOf("]",t+2);if(s===-1)return null;const r=e.slice(t+2,s);if(e[s+1]==="["){const o=e.indexOf("]",s+2);if(o!==-1){const l=e.slice(s+2,o),c=l===""?r:l,u=n.get(c1(c));if(u!=null)return{node:{type:"image",src:u,alt:r},end:o+1}}}if(r.trim()==="")return null;const i=n.get(c1(r));return i==null?null:{node:{type:"image",src:i,alt:r},end:s+1}}function C6(e,t){let n=1;for(let s=t;s<e.length;s++)if(e[s]==="(")n++;else if(e[s]===")"&&(n--,n===0))return s;return-1}function Rc(e){return e==null?!1:/\w/.test(e)}function SP(e,t,n){if(!n.sourceIds||e[t]!=="【")return null;const s=e.indexOf("】",t+1);if(s===-1)return null;const r=e.slice(t+1,s);return r.length===0||!n.sourceIds.has(r)?null:{sourceId:r,end:s+1}}function CP(e,t,n){if(!n.sourceIds||e[t]!=="[")return null;const s=e.indexOf("]",t+1);if(s===-1||e[s+1]==="(")return null;const r=e.slice(t+1,s);return r.length===0||!n.sourceIds.has(r)?null:{sourceId:r,end:s+1}}function EP(e,t){return u1(e,Q5(t))}function u1(e,t){const n=ta(e,t);return t.autolink==="gfm"?vC(n):n}function ta(e,t){const n=[];let s=0;for(;s<e.length;){if(e[s]==="\\"&&s+1<e.length){n.push({type:"text",content:e[s+1]}),s+=2;continue}if(e[s]==="`"){const l=e[s+1]==="`"?e[s+2]==="`"?3:2:1,c=s+l,u=e.indexOf("`".repeat(l),c);if(u!==-1){n.push({type:"code",content:e.slice(c,u)}),s=u+l;continue}}{const l=SP(e,s,t);if(l){n.push({type:"citation",sourceId:l.sourceId}),s=l.end;continue}}if(e[s]==="!"&&e[s+1]==="["){const l=e.indexOf("]",s+2);if(l!==-1&&e[l+1]==="("){const c=C6(e,l+2);if(c!==-1){n.push({type:"image",src:e.slice(l+2,c),alt:e.slice(s+2,l)}),s=c+1;continue}}}if(t.linkDefs!=null&&e[s]==="!"&&e[s+1]==="["){const l=jP(e,s,t.linkDefs);if(l){n.push(l.node),s=l.end;continue}}{const l=CP(e,s,t);if(l){n.push({type:"citation",sourceId:l.sourceId}),s=l.end;continue}}if(e[s]==="["){const l=e.indexOf("]",s+1);if(l!==-1&&e[l+1]==="("){const c=C6(e,l+2);if(c!==-1){n.push({type:"link",href:e.slice(l+2,c),children:ta(e.slice(s+1,l),t)}),s=c+1;continue}}}if(t.linkDefs!=null&&e[s]==="["){const l=wP(e,s,t.linkDefs,t);if(l){n.push(l.node),s=l.end;continue}}if(e[s]==="*"&&e[s+1]==="*"&&e[s+2]==="*"||e[s]==="_"&&e[s+1]==="_"&&e[s+2]==="_"){const l=e.slice(s,s+3),c=e[s]==="_";if(!(c&&Rc(e[s-1]))){const u=e.indexOf(l,s+3);if(u!==-1&&(!c||!Rc(e[u+3]))){n.push({type:"bold",children:[{type:"italic",children:ta(e.slice(s+3,u),t)}]}),s=u+3;continue}}}if(e[s]==="*"&&e[s+1]==="*"||e[s]==="_"&&e[s+1]==="_"){const l=e.slice(s,s+2),c=e[s]==="_";if(!(c&&Rc(e[s-1]))){const u=e.indexOf(l,s+2);if(u!==-1&&(!c||!Rc(e[u+2]))){n.push({type:"bold",children:ta(e.slice(s+2,u),t)}),s=u+2;continue}}}if(e[s]==="~"&&e[s+1]==="~"){const l=e.indexOf("~~",s+2);if(l!==-1){n.push({type:"strikethrough",children:ta(e.slice(s+2,l),t)}),s=l+2;continue}}if(e[s]==="*"||e[s]==="_"){const l=e[s]==="_";if(!(l&&Rc(e[s-1]))){const c=e.indexOf(e[s],s+1);if(c!==-1&&c>s+1&&(!l||!Rc(e[c+1]))){n.push({type:"italic",children:ta(e.slice(s+1,c),t)}),s=c+1;continue}}}let r=s+1;for(;r<e.length&&!"*_~`[!\\\n【".includes(e[r]);)r++;const i=e.slice(s,r);if(r<e.length&&e[r]===`
154
- `){const l=i.replace(/ +$/,"");if(i.length-l.length>=2){if(l.length>0){const c=n[n.length-1];(c==null?void 0:c.type)==="text"?c.content+=l:n.push({type:"text",content:l})}n.push({type:"break"}),s=r+1;continue}}const o=n[n.length-1];(o==null?void 0:o.type)==="text"?o.content+=i:n.push({type:"text",content:i}),s=r}return n}const gC="[^\\s<]+",$P="https?:\\/\\/",mC="[A-Za-z0-9._%+-]+",E6="[A-Za-z0-9-]+",yC=`${E6}(?:\\.${E6})+`,AP="[a-zA-Z][a-zA-Z0-9+.-]*",MP="[^<>\\s]*",TP=new RegExp(`${$P}${gC}`,"g"),zP=new RegExp(`www\\.${gC}`,"g"),NP=new RegExp(`${mC}@${yC}`,"g"),_P=new RegExp(`<(${AP}:${MP})>`,"g"),RP=new RegExp(`<(${mC}@${yC})>`,"g"),$6=new Set("?!.,:*_~"),IP=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._%+-@");function A6(e){let t=e;for(;t.length>0;){if($6.has(t[t.length-1])){let n=t.length-1;for(;n>0&&$6.has(t[n-1]);)n--;t=t.slice(0,n);continue}if(t.endsWith(")")){let n=0,s=0;for(let r=0;r<t.length;r++)t[r]==="("?n++:t[r]===")"&&s++;if(s>n){t=t.slice(0,-1);continue}}break}return t}const LP=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/=");function M6(e){return e==null?!0:!LP.has(e)}function OP(e){const t=[];{const r=new RegExp(_P.source,"g");let i;for(;(i=r.exec(e))!==null;){const o=i[1];t.push({start:i.index,end:i.index+i[0].length,href:o,display:o})}}{const r=new RegExp(RP.source,"g");let i;for(;(i=r.exec(e))!==null;){const o=i[1];t.push({start:i.index,end:i.index+i[0].length,href:`mailto:${o}`,display:o})}}{const r=new RegExp(TP.source,"g");let i;for(;(i=r.exec(e))!==null;){const o=e[i.index-1];if(!M6(o)||e.slice(i.index-2,i.index)==="](")continue;const l=A6(i[0]);l.length!==0&&t.push({start:i.index,end:i.index+l.length,href:l,display:l})}}{const r=new RegExp(zP.source,"g");let i;for(;(i=r.exec(e))!==null;){const o=e[i.index-1];if(!M6(o)||e.slice(i.index-3,i.index)==="://")continue;const l=A6(i[0]);l.length!==0&&t.push({start:i.index,end:i.index+l.length,href:`http://${l}`,display:l})}}{const r=new RegExp(NP.source,"g");let i;for(;(i=r.exec(e))!==null;){const o=e[i.index-1];o!=null&&IP.has(o)||e.slice(Math.max(0,i.index-7),i.index)!=="mailto:"&&t.push({start:i.index,end:i.index+i[0].length,href:`mailto:${i[0]}`,display:i[0]})}}t.sort((r,i)=>r.start-i.start);const n=[];let s=0;for(const r of t)r.start>=s&&(n.push(r),s=r.end);return n}function DP(e){const t=OP(e);if(t.length===0)return[{type:"text",content:e}];const n=[];let s=0;for(const r of t)r.start>s&&n.push({type:"text",content:e.slice(s,r.start)}),n.push({type:"link",href:r.href,children:[{type:"text",content:r.display}]}),s=r.end;return s<e.length&&n.push({type:"text",content:e.slice(s)}),n}function vC(e){const t=[];for(const n of e)if(n.type==="text"){const s=DP(n.content);for(const r of s){const i=t[t.length-1];r.type==="text"&&(i==null?void 0:i.type)==="text"?i.content+=r.content:t.push(r)}}else n.type==="bold"||n.type==="italic"||n.type==="strikethrough"?t.push({...n,children:vC(n.children)}):t.push(n);return t}function Pm(e){let t=0;for(;t<e.length&&e[t]===" ";)t++;return t}function J5(e){const t=e.trim();if(t.length<3)return!1;const n=t.replace(/ /g,"");if(n.length<3)return!1;const s=n[0];if(s!=="-"&&s!=="*"&&s!=="_")return!1;for(let r=1;r<n.length;r++)if(n[r]!==s)return!1;return!0}function D0(e){if(!e.includes("|"))return!1;const n=e.split("|").map(s=>s.trim()).filter(s=>s.length>0);return n.length>0&&n.every(s=>/^:?-+:?$/.test(s))}function BP(e){return!!(/^#{1,6} /.test(e)||/^(`{3,}|~{3,})/.test(e)||J5(e)||e.startsWith("> ")||e===">"||/^ {0,9}[-*+] /.test(e)||/^ {0,9}0*1[.)] /.test(e)||e.includes("|"))}function Um(e){let t=0,n=e.length;if(e.startsWith("|"))for(t=1;t<n&&e[t]===" ";)t++;for(;n>t&&e[n-1]===" ";)n--;n>t&&e[n-1]==="|"&&n--;const s=e.slice(t,n),r=[];let i="";for(let o=0;o<s.length;o++)s[o]==="\\"&&o+1<s.length&&s[o+1]==="|"?(i+="\\|",o++):s[o]==="|"?(r.push(i.trim()),i=""):i+=s[o];return r.push(i.trim()),r}function HP(e,t,n){const s=Um(e[t]).map(l=>({children:u1(l,n)})),r=Um(e[t+1]).map(l=>{const c=l.trim(),u=c.startsWith(":"),d=c.endsWith(":");return u&&d?"center":d?"right":u?"left":null}),i=[];let o=t+2;for(;o<e.length&&e[o].includes("|")&&e[o].trim()!=="";)i.push(Um(e[o]).map(l=>({children:u1(l,n)}))),o++;return{node:{type:"table",headers:s,alignments:r,rows:i},nextIndex:o}}function T6(e,t,n,s){const r=[],i=Pm(e[t]),o=n?e[t].match(/^ *(\d+)([.)]) /):null,l=o?o[2]:".",c=`\\${l}`,u=n?new RegExp(`^ {${i}}\\d+${c} `):new RegExp(`^ {${i}}[-*+] `),d=o?parseInt(o[1],10):void 0;let f=!1,h=t;for(;h<e.length&&u.test(e[h]);){const x=n?e[h].replace(new RegExp(`^ *\\d+${c} `),""):e[h].replace(/^ *[-*+] /,""),g=x.match(/^\[([ xX])\] (.*)/);let y,v;g?(y=g[1].toLowerCase()==="x",v=g[2]):v=x,h++;const m=[];for(;h<e.length&&e[h].trim()!==""&&Pm(e[h])>i;)m.push(e[h]),h++;if(m.length>0){const b=Math.min(...m.map(A=>Pm(A))),j=m.map(A=>A.slice(b));v+=`
155
- `+j.join(`
156
- `)}r.push({checked:y,children:Cl(v,s)});let k=h;for(;k<e.length&&e[k].trim()==="";)k++;k>h&&k<e.length&&u.test(e[k])&&(f=!0,h=k)}return{node:{type:"list",ordered:n,start:d,delimiter:n?l:void 0,loose:f||void 0,items:r},nextIndex:h}}function qP(e,t){return Cl(e,Q5(t))}function Cl(e,t){const{defs:n,cleaned:s}=xC(e),r=t.linkDefs;let i;n.size===0?i=r:r==null?i=n:i=new Map([...n,...r]);const o=i!=null?{...t,linkDefs:i}:t,l=s.split(`
157
- `),c=[];let u=0;for(;u<l.length;){const d=l[u];if(d.trim()===""){u++;continue}const f=d.match(/^(`{3,}|~{3,})(\w*)/);if(f){const y=f[1],v=f[2]||"plaintext",m=[];for(u++;u<l.length&&!l[u].startsWith(y);)m.push(l[u]),u++;u++,c.push({type:"codeblock",language:v,content:m.join(`
158
- `)});continue}const h=d.match(/^(#{1,6}) +(.*)/);if(h){c.push({type:"heading",level:h[1].length,children:u1(h[2],o)}),u++;continue}if(J5(d)){c.push({type:"hr"}),u++;continue}const x=d.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(x&&d.trim()===x[0]){c.push({type:"image",alt:x[1],src:x[2]}),u++;continue}if(u+1<l.length&&d.includes("|")&&D0(l[u+1])){const y=HP(l,u,o);c.push(y.node),u=y.nextIndex;continue}if(d.startsWith("> ")||d===">"){const y=[];for(;u<l.length&&(l[u].startsWith("> ")||l[u]===">");)y.push(l[u].replace(/^> ?/,"")),u++;c.push({type:"blockquote",children:Cl(y.join(`
159
- `),o)});continue}if(/^ {0,9}[-*+] /.test(d)){const y=T6(l,u,!1,o);c.push(y.node),u=y.nextIndex;continue}if(/^ {0,9}\d+[.)] /.test(d)){const y=T6(l,u,!0,o);c.push(y.node),u=y.nextIndex;continue}const g=[d];for(u++;u<l.length&&!BP(l[u])&&l[u].trim()!=="";)g.push(l[u]),u++;c.push({type:"paragraph",children:u1(g.join(`
160
- `),o)})}return c}function Fm(){return{prevInput:"",settledText:"",settledBlocks:[],settledUpTo:0}}function PP(e){let t=!1,n="",s=-1;for(let r=0;r<e.length;r++){const i=e[r],o=i.match(/^(`{3,}|~{3,})/);o&&(t?o[1].startsWith(n[0])&&o[1].length>=n.length&&(t=!1,n=""):(t=!0,n=o[1])),!t&&i.trim()===""&&r>0&&(s=r)}return t?-1:s}function z6(e){const t=e.lastIndexOf(`
161
- `),n=t===-1?"":e.slice(0,t+1);let s=t===-1?e:e.slice(t+1);const r=s.lastIndexOf("[");if(r!==-1){const o=s.slice(r);if(!(o.includes("](")&&o.includes(")"))){const c=r>0&&s[r-1]==="!"?r-1:r;s=s.slice(0,c)}}let i=s.length;for(;i>0&&s[i-1]==="`";)i--;if(i<s.length&&i>0){const o=s.length-i;s.lastIndexOf("`".repeat(o),i-1)===-1&&(s=s.slice(0,i))}for(i=s.length;i>0&&s[i-1]==="*";)i--;if(i<s.length&&i>0){const o=s.length-i;o<=3&&s.lastIndexOf("*".repeat(o),i-1)===-1&&(s=s.slice(0,i))}{let o=0;const l=[];for(;o<s.length;){const u=s.indexOf("*",o);if(u===-1)break;let d=1;for(;u+d<s.length&&s[u+d]==="*";)d++;if(d>3){o=u+d;continue}l.push({pos:u,len:d}),o=u+d}const c=new Set;for(let u=0;u<l.length;u++)if(!c.has(u)){for(let d=u+1;d<l.length;d++)if(!c.has(d)&&l[d].len===l[u].len){c.add(u),c.add(d);break}}for(let u=l.length-1;u>=0;u--)if(!c.has(u)){const d=l[u];d.pos+d.len<s.length?s=s+"*".repeat(d.len):s=s.slice(0,d.pos)}}if(s.length>=2&&s.endsWith("~~"))s.lastIndexOf("~~",s.length-3)===-1&&(s=s.slice(0,-2));else if(s.endsWith("~")){const o=s.length-2;o>=0&&s[o]!=="~"&&(s=s.slice(0,-1))}{let o=0,l=0;const c=[];for(;;){const u=s.indexOf("~~",l);if(u===-1)break;c.push(u),o++,l=u+2}o%2===1&&(s=s.slice(0,c[c.length-1]))}return n+s}function UP(e){const t=e.split(`
162
- `);for(;t.length>0;){const n=t[t.length-1],s=n.trim();if(s===""){t.pop();continue}if(/^ {0,9}[-*+] $/.test(n)||/^ {0,9}\d+[.)] $/.test(n)){t.pop();continue}if(s.includes("|")&&!D0(n)){let r=!1;for(let i=t.length-2;i>=1;i--)if(D0(t[i])&&t[i-1].includes("|")){r=!0;break}if(!r){t.pop();continue}}if(D0(n)&&(t.length<2||!t[t.length-2].includes("|"))){t.pop();continue}break}return t.join(`
163
- `)}function N6(e,t){if(e.length===0||t.length===0)return[...e,...t];const n=e[e.length-1],s=t[0];if(n.type==="list"&&s.type==="list"&&n.ordered===s.ordered&&n.delimiter===s.delimiter){const r={type:"list",ordered:n.ordered,start:n.start,delimiter:n.delimiter,loose:!0,items:[...n.items,...s.items]};return[...e.slice(0,-1),r,...t.slice(1)]}return[...e,...t]}function FP(e,t,n){const s=Q5(n);if(t.autolink!==s.autolink&&(t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.autolink=s.autolink),e==="")return t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.linkDefsKey=void 0,[];const{defs:r}=xC(e),i=bP(r);t.linkDefsKey!==i&&(t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.linkDefsKey=i);const o=r.size>0?{...s,linkDefs:r}:s,l=e.split(`
164
- `),c=PP(l);if(c<0)return t.prevInput=e,Cl(e,o);const u=l.slice(0,c).join(`
165
- `),d=l.slice(c).join(`
166
- `).trim(),f=UP(d);let h;if(u===t.settledText)h=t.settledBlocks;else if(t.settledText.length>0&&u.startsWith(t.settledText)){const g=u.slice(t.settledText.length),y=Cl(g,o);h=N6(t.settledBlocks,y)}else h=Cl(u,o);const x=f?Cl(f,o):[];return t.settledText=u,t.settledBlocks=h,t.settledUpTo=c,t.prevInput=e,N6(h,x)}const Gh={start:"0",center:"auto"},Vm={start:null,center:"auto"},VP={k7Eaqz:"xkj4a21",$$css:!0},Ws={proseWidth:e=>[{ks0D6T:e!=null?"xf68679":e,$$css:!0},{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],proseAlign:e=>[{kUOVxO:e!=null?"xvlecxo":e,$$css:!0},{"--x-marginInline":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],blockWidth:e=>[VP,{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(`min(${e}, 100%)`)}],blockAlign:e=>[{kUOVxO:e!=null?"xvlecxo":e,$$css:!0},{"--x-marginInline":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],cellMinWidth:e=>[{k7Eaqz:e!=null?"xkj4a21":e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]},Wh={center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},$e={root:{kMv6JI:"x9ynric",kMwMTN:"x1tgivj0",kLWn49:"xw6l6zx",kGuDYH:"xjm74w1",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",kHjlTd:"x1mzt3pk",$$css:!0},inlineRoot:{k1xSpc:"xt0psk2",kzqmXN:"x14atkfc",ks0D6T:"x1x1rfll",kMv6JI:"xjb2p0i",kMwMTN:"x1heor9g",kLWn49:"x15bjb6t",kGuDYH:"x1qlqyl8",$$css:!0},headingBase:{kMv6JI:"x1g81bgm",kMwMTN:"x1tgivj0",$$css:!0},h1:{kGuDYH:"xcg7oai",k63SB2:"x1v68xuy",kLWn49:"xfmsba7",$$css:!0},h2:{kGuDYH:"x1xvnhcw",k63SB2:"x12yy4cs",kLWn49:"x1cpk1wn",$$css:!0},h3:{kGuDYH:"xii13ha",k63SB2:"x1jcxfy8",kLWn49:"xwjzt0u",$$css:!0},h4:{kGuDYH:"x8tkxat",k63SB2:"x2hcmsi",kLWn49:"xqerer",$$css:!0},h5:{kGuDYH:"xsgqta0",k63SB2:"xno150v",kLWn49:"xo3gurs",$$css:!0},h6:{kGuDYH:"xw5ohdf",k63SB2:"x1pw4frv",kLWn49:"xeixjfn",$$css:!0},spacingHeadingMajorDefault:{keoZOQ:"x13rv44w",k1K539:"xep27e5",$$css:!0},spacingHeadingMinorDefault:{keoZOQ:"x1s1qpeq",k1K539:"x1p37lm5",$$css:!0},spacingParagraphDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingCodeblockDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingBlockquoteDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingListDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingTableDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingHrDefault:{keoZOQ:"x13rv44w",k1K539:"x4d5cxa",$$css:!0},spacingImageDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingHeadingMajorCompact:{keoZOQ:"x1s1qpeq",k1K539:"x1p37lm5",$$css:!0},spacingHeadingMinorCompact:{keoZOQ:"xj6sv8s",k1K539:"x14cgwvg",$$css:!0},spacingParagraphCompact:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},spacingCodeblockCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingBlockquoteCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingListCompact:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},spacingTableCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingHrCompact:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingImageCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},noMarginBlockStart:{keoZOQ:"xdj266r",$$css:!0},noMarginBlockEnd:{k1K539:"xat24cr",$$css:!0},codeBlockWrapper:{ks0D6T:"x193iq5w",$$css:!0},tableWrapper:{kXHlph:"xw2csxc",ks0D6T:"x193iq5w","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},blockIndent:{kUOVxO:"x1ho7dyk",$$css:!0},hr:{kMzoRj:"xc342km",kEafiO:"x11xkdxz",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}};function _6(e){const t=e.match(/^([\d.]+)ms$/);if(t)return parseFloat(t[1]);const n=e.match(/^([\d.]+)s$/);return n?parseFloat(n[1])*1e3:null}function Yl(e){let t=0;for(const n of e)switch(n.type){case"text":t+=n.content.length;break;case"code":t+=n.content.length;break;case"image":t+=n.alt.length;break;case"bold":case"italic":case"strikethrough":case"link":t+=Yl(n.children);break;case"break":t+=1;break;case"citation":t+=1;break}return t}function Cy(e){let t=0;for(const n of e)switch(n.type){case"heading":case"paragraph":t+=Yl(n.children);break;case"codeblock":t+=n.content.length;break;case"blockquote":t+=Cy(n.children);break;case"list":for(const s of n.items)t+=Cy(s.children);break;case"table":for(const s of n.headers)t+=Yl(s.children);for(const s of n.rows)for(const r of s)t+=Yl(r.children);break;case"hr":break;case"image":t+=n.alt.length;break}return t}const GP={1:$e.h1,2:$e.h2,3:$e.h3,4:$e.h4,5:$e.h5,6:$e.h6},WP=/^(javascript|data|vbscript):/i;function Ey(e){const t=e.trim();return t.length===0||WP.test(t)?null:t}function KP(e,t){const n=[];for(const l of t){l.pattern.lastIndex=0;let c;for(;(c=l.pattern.exec(e))!==null;){let u;if(l.getEndIndex){const d=l.getEndIndex(e,c);if(d===!1)continue;u=d}else u=c.index+c[0].length;n.push({start:c.index,end:u,match:c,plugin:l})}}n.sort((l,c)=>l.start-c.start);const s=[];let r=0;for(const l of n)l.start>=r&&(s.push(l),r=l.end);if(s.length===0)return[{type:"text",content:e}];const i=[];let o=0;for(let l=0;l<s.length;l++){const c=s[l];c.start>o&&i.push({type:"text",content:e.slice(o,c.start)}),i.push({type:"plugin",element:c.plugin.render(c.match,`plugin-${l}`),matchLength:c.end-c.start}),o=c.end}return o<e.length&&i.push({type:"text",content:e.slice(o)}),i}function R6(e,t,n){const s=t.offset;if(t.offset+=e.length,!t.active)return e;const r=gP(e,s,t.boundaries,n);if(r==null)return e;const i=r.map(o=>o.fading?a.jsx("span",{className:"x1hc1fzr x19991ni x80gvsz x12w9bfk xlr8y92 x4itv7f",children:o.text},o.key):a.jsx("span",{children:o.text},o.key));return a.jsx("span",{children:i},`wrap-${n}`)}function XP(e,t){let n=e.numberMap.get(t);return n==null&&(n=e.nextNumber++,e.numberMap.set(t,n)),n}function sr(e,t,n,s,r,i="a",o,l){switch(e.type){case"text":{if(o&&o.length>0){const c=KP(e.content,o);if(!(c.length===1&&c[0].type==="text")){const u=[];for(let d=0;d<c.length;d++){const f=c[d];f.type==="text"?u.push(R6(f.content,s,`${t}-seg-${d}`)):(s.offset+=f.matchLength,u.push(a.jsx(p.Fragment,{children:f.element},`plugin-${t}-${d}`)))}return a.jsx(p.Fragment,{children:u},t)}}return R6(e.content,s,t)}case"bold":return a.jsx("strong",{className:"x2mo6ok",children:e.children.map((c,u)=>sr(c,u,n,s,r,i,o,l))},t);case"italic":return a.jsx("em",{children:e.children.map((c,u)=>sr(c,u,n,s,r,i,o,l))},t);case"strikethrough":return a.jsx("del",{className:"xv1l7n4",children:e.children.map((c,u)=>sr(c,u,n,s,r,i,o,l))},t);case"code":{s.offset+=e.content.length;const c=l==null?void 0:l.inlineCode;return c?a.jsx(c,{children:e.content},t):a.jsx(R5,{children:e.content},t)}case"link":{const c=Ey(e.href);if(c==null)return a.jsx("span",{children:e.children.map((x,g)=>sr(x,g,n,s,r,i,o,l))},t);const u=l==null?void 0:l.link;if(u)return a.jsx(u,{href:c,children:e.children.map((x,g)=>sr(x,g,n,s,r,i,o,l))},t);const d=c.startsWith("https://")||c.startsWith("http://"),f=n?x=>{n(c,x)===!1&&x.preventDefault()}:void 0,h=d?"a":i;return a.jsx(h,{href:c,onClick:f,...d?{target:"_blank",rel:"noopener noreferrer"}:{},className:"xjse4m1 x1bvjpef",children:e.children.map((x,g)=>sr(x,g,n,s,r,i,o,l))},t)}case"image":{const c=Ey(e.src);if(c==null)return a.jsxs("span",{children:["[",e.alt,"]"]},t);const u=l==null?void 0:l.image;return u?a.jsx(u,{src:c,alt:e.alt},t):a.jsx("img",{src:c,alt:e.alt,className:"x193iq5w xh6dtrn"},t)}case"break":return s.offset+=1,a.jsx("br",{},t);case"citation":{if(s.offset+=1,!r)return a.jsxs("span",{children:["[",e.sourceId,"]"]},t);const c=XP(r,e.sourceId),u=r.sources[e.sourceId]??{title:e.sourceId},d=r.style==="number"?"number":"label",f=l==null?void 0:l.citation;return f?a.jsx(f,{source:u,number:c,variant:d},t):a.jsx(pC,{source:u,number:c,variant:d},t)}}}function ZP(e,t){const n=t==="compact";switch(e.type){case"heading":return e.level<=3?n?$e.spacingHeadingMajorCompact:$e.spacingHeadingMajorDefault:n?$e.spacingHeadingMinorCompact:$e.spacingHeadingMinorDefault;case"paragraph":return n?$e.spacingParagraphCompact:$e.spacingParagraphDefault;case"codeblock":return n?$e.spacingCodeblockCompact:$e.spacingCodeblockDefault;case"blockquote":return n?$e.spacingBlockquoteCompact:$e.spacingBlockquoteDefault;case"list":return n?$e.spacingListCompact:$e.spacingListDefault;case"table":return n?$e.spacingTableCompact:$e.spacingTableDefault;case"hr":return n?$e.spacingHrCompact:$e.spacingHrDefault;case"image":return n?$e.spacingImageCompact:$e.spacingImageDefault}}function YP(e){return e.headers.map((t,n)=>{let s=Yl(t.children);for(const r of e.rows)if(r[n]){const i=Yl(r[n].children);i>s&&(s=i)}return s<=6?60:s<=15?80:120})}function xf(e,t,n,s,r,i,o,l,c,u,d="a",f,h,x){const g=Vm[u],y=g!=null?Ws.blockAlign(g):null,v=ZP(e,s),m=t===0,k=t===n-1;switch(e.type){case"heading":{const b=Math.min(e.level+r-1,6),j=e.children.map((E,z)=>sr(E,z,i,o,l,d,f,h)),A=h==null?void 0:h.heading;if(A)return a.jsx(A,{level:b,children:j},t);const M=`h${b}`;return a.jsx(M,{...ee(J("markdown-heading",{density:s,level:b}),W($e.headingBase,GP[b],v,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(Gh[u]):null,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:j},t)}case"paragraph":{const b=e.children.map((A,M)=>sr(A,M,i,o,l,d,f,h)),j=h==null?void 0:h.paragraph;return j?a.jsx(j,{children:b},t):a.jsx("div",{role:"paragraph",...ee(J("markdown-paragraph",{density:s}),W(v,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(Gh[u]):null,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:b},t)}case"codeblock":{o.offset+=e.content.length;const b=h==null?void 0:h.code;return b?a.jsx(b,{code:e.content,language:e.language},t):a.jsx("div",{...ee(J("markdown-codeblock",{density:s}),W(v,$e.codeBlockWrapper,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:a.jsx(uh,{code:e.content,language:e.language,isCollapsible:!0,xstyle:[c!=null?Ws.blockWidth(c):void 0,y]})},t)}case"blockquote":{const b=h==null?void 0:h.blockquote;if(b){const j=e.children.map((A,M)=>xf(A,M,e.children.length,s,r,i,o,l,c,u,d,f,h,x));return a.jsx(b,{children:j},t)}return a.jsx(cS,{...J("markdown-blockquote",{density:s}),xstyle:[v,c!=null?Ws.proseWidth(c):void 0,u!=="start"?Ws.proseAlign(Gh[u]):void 0,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd],children:e.children.map((j,A)=>xf(j,A,e.children.length,s,r,i,o,l,c,u,d,f,h,x))},t)}case"list":{if(e.items.length>0&&e.items.every(j=>j.checked!=null)){const j=e.items.map((A,M)=>({item:A,key:`task-${M}`})).filter(({item:A})=>A.checked).map(({key:A})=>A);return a.jsx("div",{...ee(J("markdown-list",{density:s}),W(v,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:a.jsx(G5,{label:x("@astryx.markdown.taskList"),isLabelHidden:!0,value:j,xstyle:$e.blockIndent,isReadOnly:!0,density:"compact",children:e.items.map((A,M)=>{const E=A.children[0],T=A.children.length===1&&(E==null?void 0:E.type)==="paragraph"?a.jsx(a.Fragment,{children:E.children.map(($,_)=>sr($,_,i,o,l,d,f,h))}):a.jsx(a.Fragment,{children:A.children.map(($,_)=>xf($,_,A.children.length,s,r,i,o,l,c,u,d,f,h,x))});return a.jsx(Zp,{value:`task-${M}`,label:T},M)})})},t)}return a.jsx("div",{...ee(J("markdown-list",{density:s}),W(v,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(Gh[u]):null,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:a.jsx(Bt,{listStyle:e.ordered?"decimal":"disc",density:"compact",start:e.ordered?e.start:void 0,xstyle:$e.blockIndent,children:e.items.map((j,A)=>{const M=j.children[0],z=j.children.length===1&&(M==null?void 0:M.type)==="paragraph"?a.jsx(a.Fragment,{children:M.children.map((T,$)=>sr(T,$,i,o,l,d,f,h))}):a.jsx(a.Fragment,{children:j.children.map((T,$)=>xf(T,$,j.children.length,s,r,i,o,l,c,u,d,f,h,x))});return a.jsx(Ye,{label:z},A)})})},t)}case"table":{const b=YP(e);return a.jsx("div",{tabIndex:0,role:"group","aria-label":x("@astryx.markdown.table"),...ee(J("markdown-table",{density:s}),W($e.tableWrapper,v,c!=null?Ws.blockWidth(c):null,Vm[u]!=null?Ws.blockAlign(Vm[u]):null,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:a.jsxs(hC,{dividers:"rows",textOverflow:"wrap",children:[a.jsx(Z5,{children:a.jsx(Yp,{children:e.headers.map((j,A)=>a.jsx(X5,{xstyle:[Ws.cellMinWidth(`${b[A]}px`),e.alignments[A]==="center"&&Wh.center,e.alignments[A]==="right"&&Wh.end],children:j.children.map((M,E)=>sr(M,E,i,o,l,d,f,h))},A))})}),a.jsx(Y5,{children:e.rows.map((j,A)=>{const M=j.map((E,z)=>a.jsx(K5,{xstyle:[e.alignments[z]==="center"&&Wh.center,e.alignments[z]==="right"&&Wh.end],children:E.children.map((T,$)=>sr(T,$,i,o,l,d,f,h))},z));return a.jsx(Yp,{children:M},A)})})]})},t)}case"hr":{const b=h==null?void 0:h.hr;return b?a.jsx(b,{},t):a.jsx("hr",{...ee(J("markdown-hr",{density:s}),W($e.hr,v,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd))},t)}case"image":{const b=Ey(e.src);if(b==null)return a.jsxs("div",{...ee(J("markdown-image",{density:s}),W(v,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:["[",e.alt,"]"]},t);const j=h==null?void 0:h.image;return j?a.jsx(j,{src:b,alt:e.alt},t):a.jsx("div",{...ee(J("markdown-image",{density:s}),W(v,m&&$e.noMarginBlockStart,k&&$e.noMarginBlockEnd)),children:a.jsx("img",{src:b,alt:e.alt,className:"x193iq5w xh6dtrn"})},t)}}}function e4({ref:e,children:t,display:n="block",density:s="default",headingLevelStart:r=1,isStreaming:i=!1,onLinkClick:o,sources:l,citationStyle:c="label",contentWidth:u=680,contentAlign:d="start",components:f,inlinePlugins:h,autolink:x,xstyle:g,className:y,style:v,"data-testid":m}){const k=Me(),b=Fa(),j=p.useMemo(()=>l?new Set(Object.keys(l)):void 0,[l]),A=p.useMemo(()=>({sourceIds:j,autolink:x}),[j,x]),M=sB(t,i),E=p.useRef(Fm()),z=p.useRef(x);z.current!==x&&(E.current=Fm(),z.current=x);const T=p.useMemo(()=>{if(n==="inline")return[];if(i){if(M==="")return E.current=Fm(),[];const F=z6(M);return FP(F,E.current,A)}return qP(t,A)},[n,M,t,i,A]),$=p.useMemo(()=>{if(n!=="inline")return[];const F=i?z6(M):t;return EP(F,A)},[n,M,t,i,A]),{token:_}=lg(),R=p.useMemo(()=>{const F=_6(_("--duration-fast-max"))??230,K=_6(_("--duration-fast-min")),Z=K!=null?Math.max(4,Math.round(K/10)):50;return Math.min(Math.ceil(F/Z),12)},[_]),N=p.useRef([]),H=p.useRef([]),B=p.useRef([]),I=M.length,O={offset:0,boundaries:p.useMemo(()=>{const F=n==="inline"?Yl(H.current):Cy(N.current),K=xP(B.current,F,R);return B.current=K,K},[n,I,R]),active:i},D=l?{sources:l,numberMap:new Map,nextNumber:1,style:c}:null;if(n==="inline"){const F=a.jsx("span",{ref:e,"data-testid":m,...ee(J("markdown",{density:s}),W($e.root,$e.inlineRoot,g),y,v),children:$.map((K,Z)=>sr(K,Z,o,O,D,b,h,f))});return H.current=$,N.current=[],F}const q=a.jsx("div",{role:"document",ref:e,"data-testid":m,...ee(J("markdown",{density:s}),W($e.root,g),y,v),children:T.map((F,K)=>xf(F,K,T.length,s,r,o,O,D,u?typeof u=="number"?`${u}px`:u:null,d,b,h,f,k))});return N.current=T,H.current=[],q}e4.displayName="Markdown";const kC=p.createContext(null);kC.displayName="CollapsibleGroupContext";const $y=p.createContext(null);$y.displayName="CollapsibleGroupPresentationContext";function QP(e){const{isCollapsible:t,value:n}=e,s=p.use(kC),r=s!=null&&n!=null,i=t===!0?{}:t||null,o=i!=null,[l,c]=p.useState(()=>r?!0:(i==null?void 0:i.isOpen)!==void 0?i.isOpen:(i==null?void 0:i.defaultIsOpen)??!0);let u;return r&&n!=null?u=s.isOpen(n):(i==null?void 0:i.isOpen)!==void 0?u=i.isOpen:u=l,{isEnabled:o,isOpen:u,toggle:()=>{var h;if(r&&n!=null){s.toggle(n);return}const f=!u;(i==null?void 0:i.isOpen)===void 0&&c(f),(h=i==null?void 0:i.onOpenChange)==null||h.call(i,f)}}}const Ic={root:{kzqmXN:"xh8yej3",$$css:!0},trigger:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kzqmXN:"xh8yej3",kkrTdU:"x1ypdohk",kMv6JI:"x9ynric",kGuDYH:"x18juvz8",k63SB2:"x2mo6ok",kMwMTN:"x1tgivj0",k9WMMc:"x1yc453h",k8WAf4:"xt970qd",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},triggerDisabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",$$css:!0},contentHidden:{k1xSpc:"x1s85apg",$$css:!0},content:{kLKAdn:"xfsso4q",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",k63SB2:"xxovm9e",kLWn49:"xw6l6zx",kMwMTN:"x1tgivj0",$$css:!0},divided:{kEafiO:"x11xkdxz x1g31smg",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}},mu={triggerCompact:{k8WAf4:"xu0wf1k",$$css:!0},triggerBalanced:{k8WAf4:"xce4md1",$$css:!0},triggerSpacious:{k8WAf4:"x8o8v82",$$css:!0},contentCompact:{kGO01o:"xy143xn",$$css:!0},contentBalanced:{kGO01o:"x1wesfrj",$$css:!0},contentSpacious:{kGO01o:"xvmdzux",$$css:!0}},JP={compact:mu.triggerCompact,balanced:mu.triggerBalanced,spacious:mu.triggerSpacious},eU={compact:mu.contentCompact,balanced:mu.contentBalanced,spacious:mu.contentSpacious};function jg({trigger:e,children:t,defaultIsOpen:n,isOpen:s,isDisabled:r=!1,onOpenChange:i,value:o,ref:l,xstyle:c,className:u,style:d,...f}){const h=s!==void 0?{isOpen:s,onOpenChange:i}:{defaultIsOpen:n??!0,onOpenChange:i},{isOpen:x,toggle:g}=QP({isCollapsible:h,value:o}),y=()=>{r||g()},v=p.use($y),m=(v==null?void 0:v.hasDividers)??!1,k=(v==null?void 0:v.density)??null,b=rd("chevronDown"),j=p.useId();return a.jsxs("div",{ref:l,...ee(J("collapsible",{density:k??void 0}),W(Ic.root,m&&Ic.divided,c),u,d),...f,children:[a.jsxs("button",{type:"button",onClick:y,"aria-disabled":r||void 0,"aria-expanded":x,"aria-controls":j,tabIndex:r?-1:void 0,...ee(J("collapsible-trigger",{density:k??void 0}),W(Ic.trigger,k!=null&&JP[k],r&&Ic.triggerDisabled)),children:[a.jsx("span",{className:"x1b2iylo xwgcxoh",children:e}),a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x11xpdln xuedmi6 xlr8y92 xv9yike x7p49u4"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x11xpdln xuedmi6 xlr8y92 xv9yike x19jd1h0"}}[!!x<<0],children:b})]}),a.jsx("div",{id:j,...ee(J("collapsible-content",{density:k??void 0}),W(Ic.content,k!=null&&eU[k],!x&&Ic.contentHidden)),children:v!=null?a.jsx($y,{value:null,children:t}):t})]})}jg.displayName="Collapsible";const t4=p.createContext(null);t4.displayName="RadioListContext";function n4({ref:e,label:t,isLabelHidden:n=!1,description:s,value:r,onChange:i,orientation:o="vertical",isDisabled:l=!1,disabledMessage:c,isRequired:u=!1,isOptional:d=!1,size:f="md",status:h,labelTooltip:x,width:g,xstyle:y,className:v,style:m,"data-testid":k,htmlName:b,children:j}){const A=p.useId(),M=b??A,E=p.useId(),z=p.useId(),T=p.useId(),$=p.useId(),_=p.useRef(null),R=l&&!!c,N=Es({placement:"above",focusTrigger:"always",isEnabled:R}),H=p.useMemo(()=>({name:M,value:r,onChange:i,isDisabled:l,hasDisabledMessage:R,isRequired:u,size:f,status:h}),[M,r,i,l,R,u,f,h]),B=p.useCallback(I=>{if(r!=="")return;const L=_.current;if(!L)return;const O=I.relatedTarget;if(O){if(L.contains(O))return}else if(document.activeElement&&document.activeElement!==I.target&&L.contains(document.activeElement))return;const D=Array.from(L.querySelectorAll('input[type="radio"]:not([disabled])'));if(D.length===0)return;const q=I.target,F=D.findIndex(se=>se===q);if(F===-1)return;const Z=F===D.length-1?D[D.length-1]:D[0];q!==Z&&Z.focus()},[r]);return a.jsxs(wc,{ref:e,"data-testid":k,label:t,isLabelHidden:n,description:s,inputID:E,labelID:z,isGroupLabel:!0,descriptionID:s?T:void 0,isOptional:d,isRequired:u,isDisabled:l,status:h?{type:h.type,message:h.message,messageID:h.message?$:void 0}:void 0,labelTooltip:x,statusVariant:"detached",width:g,xstyle:y,className:v,style:m,children:[a.jsx("div",{ref:I=>{_.current=I,N.ref(I)},role:"radiogroup","aria-labelledby":z,onFocus:B,"aria-describedby":[s?T:null,h!=null&&h.message?$:null,R?N.describedBy:null].filter(Boolean).join(" ")||void 0,"aria-invalid":(h==null?void 0:h.type)==="error"?!0:void 0,"aria-required":u||void 0,...ee(J("radio-list",{orientation:o,size:f}),{0:{className:"x78zum5 x1q0g3np x9mgr7n"},1:{className:"x78zum5 xdt5ytf x1txdalj"}}[(o==="vertical")<<0]),children:a.jsx(t4,{value:H,children:j})}),R&&N.renderTooltip(c)]})}n4.displayName="RadioList";const tU={xklqth5:"xklqth5",$$css:!0},Fr={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},radioWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},radio:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kaIpWk:"x16rqkct",k1ekBW:"xts7igz",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kB7OPa:"x9f619",$$css:!0},radioUnchecked:{kVAM5u:"xvy26l8 x70talc",kWkggS:"x10xzikg xy1ay1n",$$css:!0},radioChecked:{kVAM5u:"xad5do xaq2ahg",kWkggS:"x1ewilqj xwnx32n",$$css:!0},radioWrapperFocus:{kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",kaIpWk:"x16rqkct",$$css:!0},radioDisabled:{kSiTet:"xbyyjgo",kVAM5u:"x14i3s5s",$$css:!0},radioDisabledUnchecked:{kWkggS:"xwmxj5m",$$css:!0},innerDot:{kaIpWk:"x16rqkct",kWkggS:"x1azo05 xwvh9j7",$$css:!0}},I6={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},nU={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},sU={sm:{kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",$$css:!0},md:{kzqmXN:"x1fsd2vl",kZKoxP:"x170jfvy",$$css:!0}},rU={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",$$css:!0}};function Qp({ref:e,label:t,value:n,description:s,isDisabled:r=!1,startContent:i,endContent:o,xstyle:l,className:c,style:u,...d}){const f=p.use(t4);if(!f)throw new Error("RadioListItem must be used within an RadioList");const h=p.useId(),x=p.useId(),g=f.isDisabled||r,y=f.hasDisabledMessage&&!r,v=f.value===n,m=f.size,k=a.jsxs("div",{...W(Fr.radioWrapper,I6[m],!g&&Fr.radioWrapperFocus),children:[a.jsx("input",{id:h,type:"radio",name:f.name,value:n,checked:v,disabled:g&&!y,"aria-disabled":y?"true":void 0,form:y?"":void 0,required:f.isRequired,onChange:()=>{g||f.onChange(n)},"aria-describedby":s?x:void 0,...W(Fr.input,I6[m],g&&Fr.inputDisabled)}),a.jsx("div",{"aria-hidden":"true",...ee(J("radio",{size:m,checked:v?"checked":null,disabled:g?"disabled":null}),W(Fr.radio,nU[m],v?Fr.radioChecked:Fr.radioUnchecked,g&&Fr.radioDisabled,g&&!v&&Fr.radioDisabledUnchecked)),children:v&&a.jsx("div",{...ee(J("radio-dot",{size:m}),W(Fr.innerDot,sU[m]))})})]}),b=i!=null?a.jsxs(a.Fragment,{children:[k,i]}):k;return a.jsx("div",{ref:e,...ee(J("radio-list-item"),W(Fr.container,!g&&tU,l),c,u),...d,children:a.jsx(Td,{startContent:b,label:a.jsx("label",{htmlFor:h,...{0:{},1:{className:"xnbbluu x1h6gzvc"}}[!!g<<0],children:t}),description:s!=null?a.jsx("span",{id:x,children:s}):void 0,endContent:o,xstyle:rU.root})})}Qp.displayName="RadioListItem";const iU=50,oU=40,bC="astryx-resizable:";function Kh(e,t,n,s){const r=Math.min(n,Math.max(t,e));if(s.length>0){let i=s[0],o=Math.abs(r-i);for(let l=1;l<s.length;l++){const c=Math.abs(r-s[l]);c<o&&(i=s[l],o=c)}return Math.min(n,Math.max(t,i))}return r}function aU(e){if(typeof window>"u")return null;try{const t=localStorage.getItem(bC+e);if(t!=null){const n=JSON.parse(t);if(typeof n=="number")return n}}catch{}return null}function lU(e,t){if(!(typeof window>"u"))try{localStorage.setItem(bC+e,JSON.stringify(t))}catch{}}function cU(e){if(e==null)return 250;if(typeof e=="number")return e;if(e.endsWith("%")){const t=parseFloat(e);if(!isNaN(t)){const n=typeof window<"u"?window.innerWidth:1200;return Math.round(t/100*n)}}return 250}function wC(e){const{defaultSize:t,minSizePx:n=iU,maxSizePx:s=1/0,collapsible:r=!1,collapsedSize:i=oU,snaps:o=[],autoSaveId:l,onSizeChange:c,onCollapseChange:u}=e,d=cU(t),f=l?aU(l):null,h=f??d,[x,g]=p.useState(()=>Kh(h,n,s,o)),[y,v]=p.useState(()=>f===0&&r),m=p.useRef(x),k=p.useRef(x);p.useEffect(()=>{l&&lU(l,y?0:x)},[x,y,l]);const b=p.useCallback(()=>{r&&(m.current=x,v(!0),g(0),u==null||u(!0),c==null||c(0))},[r,x,u,c]),j=p.useCallback(()=>{v(!1);const $=m.current||d,_=Kh($,n,s,o);g(_),u==null||u(!1),c==null||c(_)},[d,n,s,o,u,c]),A=p.useCallback($=>{const _=Kh($,n,s,o);g(_),v(!1),c==null||c(_)},[n,s,o,c]),M=p.useCallback(()=>{k.current=y?0:x},[x,y]),E=p.useCallback($=>{const _=k.current+$;if(r&&_<i){y||(m.current=x,u==null||u(!0)),v(!0),g(0),c==null||c(0);return}y&&_>=i&&(v(!1),u==null||u(!1));const R=Kh(_,n,s,o);g(R),c==null||c(R)},[r,i,y,x,n,s,o,c,u]),z=p.useCallback(()=>{},[]);return{size:y?0:x,isCollapsed:y,collapse:b,expand:j,resize:A,props:{_size:y?0:x,_isCollapsed:y,_onResizeStart:M,_onResizeMove:E,_onResizeEnd:z,_minSizePx:n,_maxSizePx:s,_snaps:o,_collapsedSize:i,_collapsible:r,_isResizableProps:!0}}}function uU(e){const{regions:t,autoSaveId:n}=e,s=Object.entries(t),r=s.map(([o,l])=>wC({...l,autoSaveId:n?`${n}:${o}`:void 0})),i={};return s.forEach(([o],l)=>{i[o]=r[l]}),i}function jC(e){return"regions"in e?uU(e):wC(e)}const dU=10,fU=50;function hU(e,t,n){if(e!=="auto")return e;const s=t?"end":"start";return n?s==="start"?"end":"start":s}function pU(e){return e==="center"?null:e==="start"?-1:1}const Lt={handle:{kVAEAm:"x1n2onr6",kmuXW:"x2lah0s",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kWkggS:"x1m4xfpy",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x1a2a7pz x17nn4n9",kInvED:"xh2nty3",$$css:!0},overlay:{kVAEAm:"x10l6tqk",kY2c9j:"xhtitgo",kWkggS:"xjbqb8w",$$css:!0},overlayHorizontal:{kt4wiu:"xtijo5x",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",kzqmXN:"xkhob8h",$$css:!0},overlayVertical:{krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kZKoxP:"x5kfih4",$$css:!0},horizontal:{kzqmXN:"x1i1rx1s",kZKoxP:"x5yr21d",kkrTdU:"xicojor",$$css:!0},vertical:{kZKoxP:"xjm9jq1",kzqmXN:"xh8yej3",kkrTdU:"xyozgr7",$$css:!0},noDividerHorizontal:{kWkggS:"xjbqb8w",kzqmXN:"xnalus7",$$css:!0},noDividerVertical:{kWkggS:"xjbqb8w",kZKoxP:"xqtp20y",$$css:!0},handleHover:{kWkggS:"x1m4xfpy",$$css:!0},handleActive:{kWkggS:"x7njt3n",$$css:!0},disabled:{kkrTdU:"xt0e3qv",kfzvcC:"x47corl",$$css:!0},hitArea:{kVAEAm:"x10l6tqk",kY2c9j:"x1vjfegm",kFalU9:"x5ve5x3",kfSwDN:"x87ps6o",$$css:!0},hitAreaHorizontal:{kzqmXN:"x12xnipv",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",kkrTdU:"xicojor",$$css:!0},hitAreaVertical:{kZKoxP:"x6b6gus",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kkrTdU:"xyozgr7",$$css:!0},hitAreaCenteredY:{k87sOh:"xwa60dl",k3aq6I:"x1cb1t30",$$css:!0},pill:{kVAEAm:"x10l6tqk",kY2c9j:"xhtitgo",kfzvcC:"x47corl",kaIpWk:"xjspbzw",kWkggS:"x1m4xfpy",k1ekBW:"x1wbls7o",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",k87sOh:"xwa60dl",$$css:!0},pillHorizontal:{kzqmXN:"x1g8rjiy",kZKoxP:"x18to7ep",$$css:!0},pillVertical:{kzqmXN:"xgc8j7m",kZKoxP:"xuoj239",$$css:!0},pillHidden:{kSiTet:"xg01cxk",$$css:!0},pillVisible:{kSiTet:"x1hc1fzr",$$css:!0},pillHover:{kSiTet:"x1hc1fzr",kWkggS:"x1m4xfpy",$$css:!0},pillActive:{kSiTet:"x1hc1fzr",kWkggS:"x7njt3n",$$css:!0}},xU={kLqNvP:"x1o0tod",k3aq6I:"x11wx31z x75qhwu",$$css:!0},gU={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},mU={kLqNvP:"x1o0tod",k3aq6I:"xsqj5wx",$$css:!0},yU={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},Xh={hitAreaOffsetX:e=>[xU,{"--x-qthpiu":`translate(calc(${e} * (3px + ${jr["--spacing-1"]}) - 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${jr["--spacing-1"]}) - 6.5px), -50%)`:void 0,"--x-sj6hyi":`translate(calc(${e} * (3px + ${jr["--spacing-1"]}) + 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${jr["--spacing-1"]}) + 6.5px), -50%)`:void 0}],hitAreaOffsetY:e=>[gU,{"--x-transform":`translate(-50%, calc(${e} * (3px + ${jr["--spacing-1"]}) - 6.5px))`!=null?`translate(-50%, calc(${e} * (3px + ${jr["--spacing-1"]}) - 6.5px))`:void 0}],pillOffsetX:e=>[mU,{"--x-transform":`translate(calc(${e} * (100% + ${jr["--spacing-1"]})), -50%)`!=null?`translate(calc(${e} * (100% + ${jr["--spacing-1"]})), -50%)`:void 0}],pillOffsetY:e=>[yU,{"--x-transform":`translate(-50%, calc(${e} * (100% + ${jr["--spacing-1"]})))`!=null?`translate(-50%, calc(${e} * (100% + ${jr["--spacing-1"]})))`:void 0}]};function s4({direction:e="horizontal",position:t="inline",isReversed:n=!1,isDisabled:s=!1,hasDivider:r=!1,isAlwaysVisible:i=!0,pillPlacement:o="auto",label:l,resizable:c,children:u,xstyle:d,className:f,ref:h,...x}){const g=Me(),y=l??g("@astryx.resizable.handle.label"),v=p.useRef(null),m=p.useRef(null),[k,b]=p.useState(!1),[j,A]=p.useState(!1),[M,E]=p.useState(!1),z=e==="horizontal",T=t==="overlay",$=n?-1:1,_=hU(o,n,(c==null?void 0:c._isCollapsed)??!1),R=pU(_),N=p.useCallback(()=>{const Z=v.current;return Z&&getComputedStyle(Z).direction==="rtl"?-1:1},[]),H=j||M,B=p.useCallback(Z=>{if(s||!c)return;Z.preventDefault(),Z.stopPropagation(),b(!0),c._onResizeStart();const se=z?Z.clientX:Z.clientY,ne=z?N():1;document.body.style.cursor=z?"col-resize":"row-resize",document.body.style.userSelect="none";const ue=ie=>{const de=((z?ie.clientX:ie.clientY)-se)*ne*$;c._onResizeMove(de)},P=()=>{X(),b(!1),c._onResizeEnd(),document.body.style.cursor="",document.body.style.userSelect=""},U=()=>{X(),b(!1),document.body.style.cursor="",document.body.style.userSelect=""};function X(){window.removeEventListener("pointermove",ue),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",U),m.current=null}window.addEventListener("pointermove",ue),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",U),m.current=X},[s,c,z,N,$]),I=p.useCallback(Z=>{if(s||!c)return;const se=Z.shiftKey?fU:dU,ne=z?N():1;switch(Z.key){case"ArrowRight":case"ArrowDown":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(se*(z?ne:1)*$),c._onResizeEnd();break}case"ArrowLeft":case"ArrowUp":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(-se*(z?ne:1)*$),c._onResizeEnd();break}case"Home":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(c._minSizePx-c._size),c._onResizeEnd();break}case"End":{Z.preventDefault(),c._maxSizePx!==1/0&&(c._onResizeStart(),c._onResizeMove(c._maxSizePx-c._size),c._onResizeEnd());break}case"Enter":{Z.preventDefault(),c._collapsible&&(c._onResizeStart(),c._onResizeMove(c._isCollapsed?c._minSizePx:-c._size),c._onResizeEnd());break}}},[s,c,z,N,$]),L=p.useCallback(()=>{s||!c||!c._collapsible||(c._onResizeStart(),c._onResizeMove(c._isCollapsed?c._minSizePx:-c._size),c._onResizeEnd())},[s,c]);p.useEffect(()=>()=>{m.current&&(m.current(),document.body.style.cursor="",document.body.style.userSelect="")},[]);const O=(c==null?void 0:c._isCollapsed)??!1,D=c?O?Math.max(c._size,c._minSizePx):c._size:void 0,q=c?c._minSizePx:void 0,F=c&&c._maxSizePx!==1/0?c._maxSizePx:void 0,K=c&&O?g("@astryx.resizable.collapsed"):void 0;return a.jsxs("div",{ref:Wt(h,v),role:"separator","aria-orientation":z?"vertical":"horizontal","aria-valuenow":D,"aria-valuemin":q,"aria-valuemax":F,"aria-valuetext":K,"aria-label":y,"aria-disabled":s||void 0,tabIndex:s?-1:0,onDoubleClick:L,onFocus:()=>E(!0),onBlur:()=>E(!1),"data-resizing":k||void 0,...ee(J("resize-handle"),W(Lt.handle,T&&Lt.overlay,T&&(z?Lt.overlayHorizontal:Lt.overlayVertical),!T&&(z?Lt.horizontal:Lt.vertical),!T&&!r&&(z?Lt.noDividerHorizontal:Lt.noDividerVertical),!T&&r&&H&&!k&&Lt.handleHover,!T&&r&&k&&Lt.handleActive,s&&Lt.disabled,d),f),...x,onKeyDown:Z=>{var se;(se=x.onKeyDown)==null||se.call(x,Z),I(Z)},children:[a.jsx("div",{...W(Lt.hitArea,z?Lt.hitAreaHorizontal:Lt.hitAreaVertical,R==null?z?sd.centerInline("0px"):Lt.hitAreaCenteredY:z?Xh.hitAreaOffsetX(R):Xh.hitAreaOffsetY(R),s&&Lt.disabled),onPointerDown:B,onPointerEnter:()=>A(!0),onPointerLeave:()=>{k||A(!1)}}),u??a.jsx("div",{...ee(J("resize-handle-pill"),W(Lt.pill,z?Lt.pillHorizontal:Lt.pillVertical,_==="center"?sd.centerInline("-50%"):z?Xh.pillOffsetX(_==="start"?-1:1):Xh.pillOffsetY(_==="start"?-1:1),i?Lt.pillVisible:Lt.pillHidden,H&&!k&&Lt.pillHover,k&&Lt.pillActive))})]})}s4.displayName="ResizeHandle";const Lc={dialog:{kVAEAm:"xixxii4",kpwlN0:"x10a8y8t",kzqmXN:"xn9wirt",kZKoxP:"x1dr59a3",ks0D6T:"x1x1rfll",kskxy:"x7ab17h",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kWkggS:"xjbqb8w",kVQacm:"xb3r6kr",kI3sdo:"x1a2a7pz",kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",$$css:!0},image:{ks0D6T:"x193iq5w",kskxy:"xmz0i5r",kVIFPx:"x19kjcj4",kfzvcC:"x47corl",k1ekBW:"x11xpdln",kIyJzY:"x13dflua x12w9bfk",kAMwcw:"x9lcvmn",$$css:!0},imageDragging:{k1ekBW:"x13b0p5u",$$css:!0},controlButton:{kMwMTN:"x9e3rv5",$$css:!0}},vU={imageTransform:e=>[{k3aq6I:e!=null?"xsqj5wx":e,$$css:!0},{"--x-transform":e??void 0}]},Zh=50,L6={ArrowLeft:[Zh,0],ArrowRight:[-Zh,0],ArrowUp:[0,Zh],ArrowDown:[0,-Zh]};function SC({isOpen:e,onOpenChange:t,media:n,index:s,defaultIndex:r=0,onIndexChange:i,hasZoom:o=!1,hasAutoPlay:l=!1,xstyle:c,className:u,style:d,ref:f,onClick:h,onKeyDown:x,...g}){const y=Me(),v=p.useRef(null),m=p.useRef(null),k=p.useRef(null),b=p.useRef(null),j=s!==void 0,[A,M]=p.useState(r),E=j?s:A,z=p.useCallback(pe=>{j||M(pe),i==null||i(pe)},[j,i,M]),[T,$]=p.useState(1),[_,R]=p.useState({x:0,y:0}),[N,H]=p.useState(!1),B=p.useRef({x:0,y:0,panX:0,panY:0}),I=p.useMemo(()=>Array.isArray(n)?n:[n],[n]),L=I.length>1,O=I.length>0?I[Math.min(E,I.length-1)]:null,q=((O==null?void 0:O.type)??"image")==="video",F=L&&E>0,K=L&&E<I.length-1;bS(e),p.useEffect(()=>{$(1),R({x:0,y:0})},[E,O==null?void 0:O.src]);const Z=bc(),se=p.useRef(E),ne=p.useRef(e);p.useEffect(()=>{const pe=se.current!==E,Qe=ne.current;if(se.current=E,ne.current=e,!pe||!e||!Qe)return;const Xe=I[Math.min(E,I.length-1)],$t=`${E+1} of ${I.length}`;Z(Xe!=null&&Xe.alt?`${Xe.alt}, ${$t}`:`Image ${$t}`)},[E,e,Z,I]),Ii(()=>{const pe=v.current;pe&&(e&&!pe.open?(b.current=document.activeElement,pe.showModal()):!e&&pe.open&&(pe.close(),b.current instanceof HTMLElement&&b.current.focus()))},[e]);const ue=p.useCallback(()=>{t(!1)},[t]),P=p.useCallback(pe=>{pe.preventDefault(),ue()},[ue]),U=p.useRef(!1),X=p.useCallback(pe=>{if(U.current){U.current=!1;return}(pe.target===pe.currentTarget||pe.target===m.current)&&ue()},[ue]),ie=p.useCallback(()=>{F&&z(E-1)},[F,E,z]),te=p.useCallback(()=>{K&&z(E+1)},[K,E,z]),de=p.useCallback(pe=>{!o||q||pe===T||($(pe),R({x:0,y:0}),Z(pe>1?y("@astryx.lightbox.zoomedIn"):y("@astryx.lightbox.zoomedOut")))},[o,q,T,Z,y]),fe=p.useCallback(()=>{de(T===1?2:1)},[de,T]),he=p.useCallback(pe=>{if(o&&!q){if(pe.key==="+"||pe.key==="="){pe.preventDefault(),de(2);return}if(pe.key==="-"){pe.preventDefault(),de(1);return}if(T>1&&L6[pe.key]!==void 0){pe.preventDefault();const[Qe,Xe]=L6[pe.key];R($t=>({x:$t.x+Qe,y:$t.y+Xe}));return}}pe.key==="ArrowLeft"?(pe.preventDefault(),ie()):pe.key==="ArrowRight"&&(pe.preventDefault(),te())},[o,q,T,de,ie,te]),V=p.useCallback(pe=>{(pe.key==="Enter"||pe.key===" ")&&(pe.preventDefault(),fe())},[fe]),xe=p.useCallback(pe=>{T<=1||!o||(H(!0),U.current=!1,B.current={x:pe.clientX,y:pe.clientY,panX:_.x,panY:_.y})},[T,o,_]);p.useEffect(()=>{if(!N)return;const pe=Xe=>{U.current=!0;const $t=Xe.clientX-B.current.x,At=Xe.clientY-B.current.y;R({x:B.current.panX+$t,y:B.current.panY+At})},Qe=()=>{H(!1)};return window.addEventListener("pointermove",pe),window.addEventListener("pointerup",Qe),()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",Qe)}},[N]);const ve=T>1,ke=o&&!q,me=T===1?null:`scale(${T}) translate(${_.x/T}px, ${_.y/T}px)`;return O?a.jsx("dialog",{ref:Wt(f,v),onCancel:P,onClick:pe=>{X(pe),h==null||h(pe)},onKeyDown:pe=>{he(pe),x==null||x(pe)},"aria-label":O.alt||y("@astryx.lightbox.mediaViewer"),...ee(J("lightbox"),W(Lc.dialog,c),u,d),...g,children:a.jsxs("div",{ref:m,className:"x78zum5 xdt5ytf x6s0dn4 xl56j7k xh8yej3 x5yr21d x1n2onr6",children:[a.jsx("div",{className:"x10l6tqk xyx6v2t x1mcfs9z x1vjfegm",children:a.jsx(un,{icon:a.jsx(ze,{icon:"close",size:"sm",color:"inherit"}),label:y("@astryx.lightbox.close"),variant:"ghost",onClick:ue,xstyle:Lc.controlButton})}),L&&a.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1ybfrjj",children:a.jsx(un,{icon:a.jsx("span",{...W(sd.mirror),children:a.jsx(ze,{icon:"chevronLeft",size:"sm",color:"inherit"})}),label:y("@astryx.lightbox.previous"),variant:"ghost",isDisabled:!F,onClick:ie,xstyle:Lc.controlButton})}),a.jsxs("div",{className:"x78zum5 xdt5ytf x6s0dn4 x193iq5w xmz0i5r xb3r6kr",children:[a.jsx("div",{ref:k,role:ke?"button":void 0,tabIndex:ke?0:void 0,"aria-pressed":ke?ve:void 0,"aria-label":ke?y("@astryx.lightbox.zoom"):void 0,...{0:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr xt0e3qv x87ps6o x2lwn1j"},8:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr xt0e3qv x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk"},4:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1huxd7x x2dt3px"},12:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1huxd7x x2dt3px"},2:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1jm3nie"},10:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1jm3nie"},6:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1jm3nie"},14:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1jm3nie"},1:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},9:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},5:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},13:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},3:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},11:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},7:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},15:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"}}[!!ke<<3|!!(!q&&o&&!ve)<<2|!!(!q&&ve)<<1|!!(!q&&N)<<0],onDoubleClick:q?void 0:fe,onKeyDown:ke?V:void 0,onPointerDown:q?void 0:xe,children:q?a.jsx("video",{src:O.src,"aria-label":O.alt,controls:!0,autoPlay:l,className:"x193iq5w xmz0i5r x19kjcj4 x1a2a7pz"}):a.jsx("img",{src:O.src,alt:O.alt,draggable:!1,...W(Lc.image,N&&Lc.imageDragging,me!=null&&vU.imageTransform(me))})}),O.caption&&a.jsx("div",{className:"x9e3rv5 x18juvz8 xf74fhv x2b8uid x1xye8es x18d9i69 xrrkdod xrlsmeg x2lah0s",children:O.caption})]}),L&&a.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1mcfs9z",children:a.jsx(un,{icon:a.jsx("span",{...W(sd.mirror),children:a.jsx(ze,{icon:"chevronRight",size:"sm",color:"inherit"})}),label:y("@astryx.lightbox.next"),variant:"ghost",isDisabled:!K,onClick:te,xstyle:Lc.controlButton})}),L&&I.length>1&&a.jsxs("div",{className:"x10l6tqk xyx6v2t x1ybfrjj x9e3rv5 xjm74w1 xw6l6zx x1vjfegm",children:[E+1," / ",I.length]})]})}):null}SC.displayName="Lightbox";const Ks={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1lsbc85",kMv6JI:"xjb2p0i",kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",k63SB2:"x1pd3egz",kybGjl:"x1hl2dhg x4ohgrr",kkrTdU:"x1ypdohk",k1ekBW:"x1mpt4pi",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},buttonReset:{kWkggS:"xjbqb8w",ksu8eU:"xng3xce",kmVPX3:"x1717udv",kfzvcC:"x67bb7w",kVAEAm:"x1n2onr6",$$css:!0},hasUnderline:{kybGjl:"x1bvjpef",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},standalone:{kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0}},Gm={primary:{kMwMTN:"x1tgivj0 x4z56r7",$$css:!0},secondary:{kMwMTN:"xv1l7n4 x7ruf5d",$$css:!0},disabled:{kMwMTN:"xnbbluu",$$css:!0},placeholder:{kMwMTN:"xv1l7n4",$$css:!0},accent:{kMwMTN:"xjse4m1 x17qfo7y",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}};function kU(e){e.preventDefault()}function Sg({as:e,label:t,href:n,hasUnderline:s=!1,isDisabled:r=!1,isExternalLink:i=!1,newTabLabel:o,target:l,onClick:c,tooltip:u,isStandalone:d=!1,type:f="body",size:h,weight:x,color:g="accent",display:y="inline",maxLines:v=0,children:m,rel:k,xstyle:b,className:j,style:A,ref:M,...E}){const z=Me(),T=o??z("@astryx.link.newTab"),$=Fa(e),_=SS({href:n,onClick:c,isDisabled:r}),{target:R,rel:N}=fS(i?"_blank":l,k),H=_==="button"||_==="inert"&&n==null,B=a.jsxs(a.Fragment,{children:[a.jsx(Y,{type:f,size:h,weight:x,color:g,display:y,maxLines:v,children:m}),i&&!H&&a.jsxs(a.Fragment,{children:[a.jsx(ze,{icon:"externalLink",size:"xsm",color:"inherit"}),a.jsx(qi,{children:T})]})]});let I;return H?I=a.jsx("button",{ref:M,type:"button",onClick:c,"aria-label":t||void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,disabled:r,...ee(J("link",{color:g}),W(Ks.base,Ks.buttonReset,Gm[g],s&&Ks.hasUnderline,d&&Ks.standalone,r&&Ks.disabled,b),j,A),...E,children:B}):r?I=a.jsx("a",{ref:M,onClick:kU,"aria-label":t||void 0,"aria-disabled":!0,tabIndex:-1,...ee(J("link",{color:g}),W(Ks.base,Gm[g],s&&Ks.hasUnderline,d&&Ks.standalone,Ks.disabled,b),j,A),...E,children:B}):I=a.jsx($,{ref:M,href:n,target:R,rel:N,onClick:c,"aria-label":t||void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,...ee(J("link",{color:g}),W(Ks.base,Gm[g],s&&Ks.hasUnderline,d&&Ks.standalone,r&&Ks.disabled,b),j,A),...E,children:B}),u?a.jsx(Pi,{content:u,placement:"above",children:I}):I}Sg.displayName="Link";const r4=p.createContext(null);r4.displayName="MetadataListContext";const el={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},dl:{kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:!0},gridSingle:{k1xSpc:"xrvj5dj",kumcoG:"x1pmbctz",kOIVth:"xpec5dj",kGNEyG:"x1pha0wt",$$css:!0},gridMulti:{k1xSpc:"xrvj5dj",kumcoG:"x189bvgu",kOIVth:"x18g69wz",$$css:!0},gridStackedSingle:{k1xSpc:"xrvj5dj",kumcoG:"x1y6fwsi",kOIVth:"xjcht0a",$$css:!0},gridStackedMulti:{k1xSpc:"xrvj5dj",kumcoG:"x189bvgu",kOIVth:"x18g69wz",$$css:!0},horizontal:{k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kwnvtZ:"x1a02dak",kOIVth:"x18g69wz",$$css:!0}},bU={gridTemplate:e=>[{kumcoG:e!=null?"xqketvx":e,$$css:!0},{"--x-gridTemplateColumns":e??void 0}]},wU={position:"start"},O6={position:"top"};function CC({children:e,columns:t="single",label:n,maxNumOfItems:s,orientation:r="vertical",title:i,xstyle:o,className:l,style:c,"data-testid":u,ref:d}){const f=t==="multi"||typeof t=="number"&&t>1,h=n??(f?O6:wU),[x,g]=p.useState(!1),y=p.useId(),v=Me(),m=p.useMemo(()=>({labelConfig:r==="horizontal"?O6:h,orientation:r}),[h,r]),k=p.Children.toArray(e),b=r==="horizontal",j=b?void 0:s,A=j!=null&&k.length>j,M=A&&!x?k.slice(0,j):k,E=i!=null?a.jsx("div",{className:"xep27e5",children:i}):null,z=()=>b?el.horizontal:h.position==="top"?t==="single"||t===1?el.gridStackedSingle:el.gridStackedMulti:t==="single"||t===1?el.gridSingle:el.gridMulti,$=(()=>{if(b)return null;const _=h.position==="top";return typeof t=="number"&&t>1?_?`repeat(${t}, 1fr)`:`repeat(${t}, auto 1fr)`:!_&&h.width!=null?`${typeof h.width=="number"?`${h.width}px`:h.width} 1fr`:null})();return a.jsx(r4,{value:m,children:a.jsxs("div",{ref:d,"data-testid":u,...ee(J("metadata-list",{columns:String(t),orientation:r}),W(el.root,o),l,c),children:[E,a.jsx("dl",{id:y,...W(el.dl,z(),$!=null&&bU.gridTemplate($)),children:M}),A&&a.jsx("button",{type:"button","aria-controls":y,"aria-expanded":x,onClick:()=>g(_=>!_),className:"xjyslct x15nmkw0 x1ypdohk xqwr325 xjm74w1 xw6l6zx x1e4wzip xjb2p0i x1yc453h xqcrz7y",children:v(x?"@astryx.metadataList.showLess":"@astryx.metadataList.showMore")})]})})}CC.displayName="MetadataList";const D6={label:{kMwMTN:"xv1l7n4",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",k63SB2:"x1e4wzip",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kAzted:"xjwf9q1",kTgw9:"x13faqbe",$$css:!0},stackedWrapper:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",$$css:!0}};function gf({children:e,icon:t,label:n,xstyle:s,className:r,style:i,"data-testid":o,ref:l}){const c=p.use(r4),d=((c==null?void 0:c.labelConfig.position)??"start")==="top"||(c==null?void 0:c.orientation)==="horizontal",f=a.jsxs(a.Fragment,{children:[t!=null&&a.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s xv1l7n4",children:t}),n]});return d?a.jsxs("div",{ref:l,"data-testid":o,...ee(J("metadata-list-item"),W(D6.stackedWrapper,s),r,i),children:[a.jsx("dt",{className:"xv1l7n4 xjm74w1 xw6l6zx x1e4wzip x78zum5 x6s0dn4 x1txdalj x1ghz6dp x1717udv",children:f}),a.jsx("dd",{className:"x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv x13faqbe",children:e})]}):a.jsxs(a.Fragment,{children:[a.jsx("dt",{ref:l,"data-testid":o?`${o}-label`:void 0,...ee(J("metadata-list-item"),W(D6.label,s),r,i),children:f}),a.jsx("dd",{"data-testid":o?`${o}-value`:void 0,className:"x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv xjwf9q1 x13faqbe",children:e})]})}gf.displayName="MetadataListItem";const jU={x1iwu4tg:"x1iwu4tg",$$css:!0},SU={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},CU={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},EU={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",kmVPX3:"x1i3ajwb",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",kmVPX3:"xfawy5m",$$css:!0}},$U={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",k3aq6I:"xbryuvx",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xbryuvx",$$css:!0}},AU={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xv5t66b xi9aj42",$$css:!0},md:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",k3aq6I:"x15481yp x12xz5k6",$$css:!0}},MU={sm:{kAzted:"xisnujt",$$css:!0},md:{kAzted:"xjwf9q1",$$css:!0}},ts={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerSpread:{kjj79g:"x1qughib",kzqmXN:"xh8yej3",$$css:!0},switchWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},inputBusy:{kfzvcC:"x47corl",$$css:!0},track:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kaIpWk:"xjspbzw",k1ekBW:"x15406qy",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kB7OPa:"x9f619",kMzoRj:"xc342km x13rsnn2",ksu8eU:"xng3xce xx61lck",kVAM5u:"x1w1tqly",$$css:!0},trackFocus:{kI3sdo:"x1a2a7pz x1gj1ihy",kInvED:"x1edzap1",$$css:!0},trackOff:{kWkggS:"xspzpui x1a8ae7b x9yvj25",$$css:!0},trackOn:{kWkggS:"x1ewilqj xcgwt1n x1jzqe4",$$css:!0},trackDisabled:{kSiTet:"xbyyjgo",kVAM5u:"xmnqt3w",$$css:!0},trackDisabledOff:{kWkggS:"xspzpui",$$css:!0},thumb:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kaIpWk:"xjspbzw",k1ekBW:"xh3q6i0",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},thumbOff:{kWkggS:"x10xzikg xwvh9j7",$$css:!0},thumbOn:{kWkggS:"x10xzikg x1sir5s4",$$css:!0},labelWrapper:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kjj79g:"xl56j7k",$$css:!0}},TU={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function EC({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:r,isLoading:i=!1,value:o,isDisabled:l=!1,htmlName:c,disabledMessage:u,isOptional:d=!1,isRequired:f=!1,onFocus:h,onBlur:x,labelIcon:g,labelTooltip:y,labelPosition:v="end",labelSpacing:m="hug",status:k,size:b="md",width:j,xstyle:A,className:M,style:E,ref:z,...T}){const $=p.useId(),_=p.useId(),R=p.useId(),[,N]=p.useTransition(),[H,B]=p.useOptimistic(o),I=i||H!==o,L=H===!0,O=l&&!!u,D=Es({placement:"above",focusTrigger:"always",isEnabled:O}),q=[];n&&q.push(_),k!=null&&k.message&&q.push(R),O&&q.push(D.describedBy);const F=q.length>0?q.join(" "):void 0,K=a.jsxs("div",{...W(ts.switchWrapper,SU[b]),children:[a.jsx("input",{ref:Wt(z,D.positionRef),id:$,type:"checkbox",role:"switch",name:l?void 0:c,checked:L,disabled:l&&!O,"aria-disabled":O?"true":void 0,required:f,onChange:se=>{if(l||I)return;const ne=se.target.checked;s==null||s(ne,se),r&&!se.defaultPrevented&&N(async()=>{B(ne),await r(ne,se)})},onFocus:h,onBlur:x,"aria-describedby":F,"aria-invalid":(k==null?void 0:k.type)==="error"?!0:void 0,"aria-busy":I||void 0,...W(ts.input,CU[b],l&&ts.inputDisabled,I&&ts.inputBusy)}),a.jsx("div",{"aria-hidden":"true",...ee(J("switch",{checked:L?"checked":null,disabled:l?"disabled":null,size:b}),W(ts.track,EU[b],L?ts.trackOn:ts.trackOff,!l&&ts.trackFocus,l&&ts.trackDisabled,l&&!L&&ts.trackDisabledOff)),children:a.jsx("div",{...ee(J("switch-thumb",{checked:L?"checked":null,size:b}),W(ts.thumb,L?AU[b]:$U[b],L?ts.thumbOn:ts.thumbOff)),children:I&&a.jsx(Jt,{size:"sm"})})}),I&&a.jsx(qi,{role:"status",children:"Loading"})]}),Z=a.jsx("div",{...W(ts.labelWrapper,MU[b]),children:a.jsx(fg,{label:e,inputID:$,isLabelHidden:t,isDisabled:l,isOptional:d,isRequired:f,labelIcon:g,labelTooltip:y,description:n,descriptionID:_})});return a.jsxs("div",{...ee(J("switch-field",{labelPosition:v!=="end"?v:void 0,labelSpacing:m!=="hug"?m:void 0}),W(j!=null&&TU.width(j),A),M,E),...T,children:[a.jsxs("div",{ref:se=>{D.interactionRef(se)},...W(ts.container,m==="spread"&&ts.containerSpread,!l&&jU),children:[" ",v==="start"?a.jsxs(a.Fragment,{children:[Z,K]}):a.jsxs(a.Fragment,{children:[K,Z]})]}),(k==null?void 0:k.message)&&a.jsx("div",{className:"xtbrsbv",children:a.jsx(lh,{type:k.type,message:k.message,id:R,variant:"detached"})}),O&&D.renderTooltip(u)]})}EC.displayName="Switch";const i4=p.createContext(null);i4.displayName="SegmentedControlContext";function zU(){const e=p.use(i4);if(e==null)throw new Error("useSegmentedControlContext must be used within SegmentedControl. Wrap your SegmentedControlItem in <SegmentedControl>.");return e}const Yh={container:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1lsbc85","--_segmented-control-padding":"x18jk3ff",kmVPX3:"xpoxszi",kWkggS:"x17x4s8c",$$css:!0},fill:{k1xSpc:"x78zum5",kzqmXN:"xh8yej3",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},disabledWithMessage:{kSiTet:"xbyyjgo",$$css:!0}},NU={sm:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0},md:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0},lg:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0}};function o4({ref:e,value:t,onChange:n,label:s,size:r,layout:i="hug",isDisabled:o=!1,disabledMessage:l,children:c,xstyle:u,className:d,style:f,onKeyDown:h,onFocus:x,onBlur:g,...y}){const v=Ua(r,"md"),m=o&&!!l,k=Es({placement:"above",focusTrigger:"always",isEnabled:m}),{listRef:b,handleKeyDown:j,handleFocus:A}=Ed({itemSelector:'[role="radio"]:not([aria-disabled="true"])',hasRovingTabIndex:!0,wrap:!0,orientation:"horizontal"}),M=kS({orientation:"horizontal",isEnabled:!o}),E=p.useCallback($=>{h==null||h($),!$.defaultPrevented&&(M.onKeyDown($),j($))},[h,M,j]),z=p.useCallback($=>{var N;if(x==null||x($),$.defaultPrevented||(M.onFocus($),A($),o)||!$.currentTarget.contains($.relatedTarget))return;const _=(N=$.target)==null?void 0:N.closest('[role="radio"][data-value]');if(!_||_.getAttribute("aria-disabled")==="true")return;const R=_.dataset.value;R!=null&&R!==t&&n(R)},[x,M,A,o,n,t]),T=p.useMemo(()=>({value:t,onChange:n,size:v,layout:i,isDisabled:o,hasDisabledMessage:m}),[t,n,v,i,o,m]);return a.jsxs(i4,{value:T,children:[a.jsxs("div",{ref:Wt(e,b,k.ref),...y,role:"radiogroup","aria-label":s,"aria-disabled":o||void 0,"aria-describedby":m?k.describedBy:void 0,onKeyDown:E,onFocus:z,onBlur:ig(g,M.onBlur),...ee(J("segmented-control",{size:v}),W(Yh.container,NU[v],i==="fill"&&Yh.fill,o&&(m?Yh.disabledWithMessage:Yh.disabled),u),d,f),children:[c,M.hintElement]}),m&&k.renderTooltip(l)]})}o4.displayName="SegmentedControl";const Oc={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kg3NbH:"xrrkdod",kWkggS:"xjbqb8w",kMzoRj:"xc342km",ksu8eU:"xng3xce",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",k1ekBW:"x1vix5yk",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},hover:{kWkggS:"xe9uy6x",$$css:!0},selected:{kAXs8y:"x1kzknox",kMwMTN:"x1tgivj0 x1k5gbb1",k63SB2:"x2mo6ok",kWkggS:"x10xzikg x1jzqe4",kGVxlE:"x1i5ehqx",$$css:!0},disabled:{kkrTdU:"xt0e3qv",kMwMTN:"xnbbluu",$$css:!0},fill:{kUk6DE:"x98rzlu",kjj79g:"xl56j7k",$$css:!0},icon:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},_U={sm:{kZKoxP:"xzj98nu",kaIpWk:"xc910v0",kg3NbH:"xf314gf",kGuDYH:"x141an7d",$$css:!0},md:{kZKoxP:"x184gfjb",kaIpWk:"xc910v0",kg3NbH:"xrrkdod",$$css:!0},lg:{kZKoxP:"x1uiybsj",kaIpWk:"xc910v0",kg3NbH:"xrrkdod",$$css:!0}},RU={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function yu({ref:e,value:t,label:n,isLabelHidden:s=!1,icon:r,isDisabled:i=!1,onClick:o,xstyle:l,...c}){const u=zU(),d=u.value===t,f=i||u.isDisabled,h=d&&(u.hasDisabledMessage??!1)&&!i,x=u.size,g=u.layout==="fill",y=ig(o,()=>{!f&&!d&&u.onChange(t)}),v=r?a.jsx("span",{...W(Oc.icon,RU[x]),children:r}):null;return a.jsxs("button",{ref:e,...c,type:"button",role:"radio","aria-checked":d,"aria-disabled":f||void 0,"aria-label":s?n:void 0,"data-value":t,tabIndex:d&&!f||h?0:-1,onClick:y,...ee(J("segmented-control-item",{size:x,selected:d?"selected":null,disabled:f?"disabled":null}),W(Oc.base,_U[x],g&&Oc.fill,d&&Oc.selected,!d&&!f&&Oc.hover,f&&Oc.disabled,l)),children:[v,!s&&a.jsx("span",{children:n})]})}yu.displayName="SegmentedControlItem";function IU({selectableItems:e,isDisabled:t=!1,isOpen:n,hasSearch:s=!1,onOpen:r,onClose:i,onToggle:o,onClear:l,hasValue:c=!1,listboxId:u}){const[d,f]=p.useState(-1),[h,x]=p.useState(""),g=p.useRef(void 0),y=p.useCallback(A=>`${u}-item-${A}`,[u]),v=p.useCallback(()=>e.map((A,M)=>A.disabled?-1:M).filter(A=>A>=0),[e]),m=p.useCallback(()=>{f(-1),i()},[i]),k=p.useCallback(()=>{t||(n?m():(r(),s||f(0)))},[t,n,r,m,s]),b=p.useCallback((A,M)=>{A.disabled||f(M)},[]),j=p.useCallback(A=>{if(t)return;const M=v();switch(A.key){case"ArrowDown":if(A.preventDefault(),!n)r(),f(0);else{const E=M.indexOf(d),z=Math.min(E+1,M.length-1);f(M[z]??d)}break;case"ArrowUp":if(A.preventDefault(),!n)r(),f(e.length-1);else{const E=M.indexOf(d),z=Math.max(E-1,0);f(M[z]??d)}break;case"Enter":case" ":if(A.key===" "&&s)break;if(A.preventDefault(),n&&d>=0){const E=e[d];E&&!E.disabled&&o(E.value)}else n||(r(),s||f(0));break;case"Tab":n&&m();break;case"Escape":n&&(A.preventDefault(),m());break;case"Home":A.preventDefault(),n&&M.length>0&&f(M[0]);break;case"End":A.preventDefault(),n&&M.length>0&&f(M[M.length-1]);break;case"PageUp":A.preventDefault(),n&&M.length>0&&f(M[0]);break;case"PageDown":A.preventDefault(),n&&M.length>0&&f(M[M.length-1]);break;case"Delete":case"Backspace":!s&&!n&&l!=null&&c&&(A.preventDefault(),l());break;default:if(!s&&A.key.length===1&&!A.ctrlKey&&!A.metaKey){const E=h+A.key.toLowerCase();x(E),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const z=e.findIndex(T=>{var $;return!T.disabled&&(($=T.label)==null?void 0:$.toLowerCase().startsWith(E))});z>=0&&(n||r(),f(z))}break}},[t,n,r,m,e,d,o,v,h,s,l,c]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:y,onTriggerClick:k,onKeyDown:j,onItemMouseEnter:b}}const Wm="__xds_select_all__",kr={triggerContainer:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",kMwMTN:"x1tgivj0",kkrTdU:"x1ypdohk",$$css:!0},triggerPlaceholder:{kMwMTN:"xv1l7n4",$$css:!0},triggerGhost:{kzqmXN:"x14atkfc",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kKwaWg:"x1ilzqfv xq8i9tn",kGVxlE:"x1gnnqk1 x1irk71m x15ysqaf",k63SB2:"x1e4wzip",kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xscfbxq",k1ekBW:"xrafxwg",k3aq6I:"x3oybdh xk4oym4",$$css:!0},triggerGhostDisabled:{kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},popover:{k7Eaqz:"xrzjruh",keoZOQ:"xcsaf9d",$$css:!0},selectAllWrapper:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kkrTdU:"x1ypdohk",$$css:!0},sectionDivider:{kqGvvJ:"xsq74q5",$$css:!0},divider:{kqGvvJ:"xsq74q5",$$css:!0},item:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kaIpWk:"xh6dtrn",kkrTdU:"x1ypdohk",kWkggS:"xjbqb8w",kI3sdo:"x1a2a7pz",$$css:!0},itemHighlighted:{kWkggS:"x1lmrjuc",$$css:!0},itemDisabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},LU={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},OU={sm:{kmVPX3:"x9epnlk",$$css:!0},md:{k8WAf4:"x1vofgu7",kg3NbH:"xf314gf",$$css:!0},lg:{kmVPX3:"xlsj2fj",$$css:!0}},DU={sm:{kg3NbH:"x7a5moj",k8WAf4:"x13f7esw",$$css:!0},md:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0},lg:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0}},B6={warning:"warning",error:"error",success:"success"},H6={warning:"warning",error:"error",success:"success"},BU={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function mf(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function q6(e,t){return t?e.filter(n=>mf(n,t)):e}function $C({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:r=!1,isDisabled:i=!1,disabledMessage:o,options:l,value:c,onChange:u,changeAction:d,isLoading:f=!1,placeholder:h,size:x,variant:g="input",status:y,statusVariant:v="attached",labelTooltip:m,startIcon:k,hasClear:b=!1,hasSelectAll:j=!1,selectAllLabel:A,hasSearch:M=!1,searchPlaceholder:E,triggerDisplay:z="count",maxBadges:T=3,renderOption:$,isDefaultOpen:_=!1,"data-testid":R,htmlName:N,width:H,xstyle:B,className:I,style:L}){const O=Me(),D=h??O("@astryx.multiSelector.selectPlaceholder"),q=A??O("@astryx.multiSelector.selectAll"),F=E??O("@astryx.multiSelector.searchPlaceholder"),K=Ua(x,"md"),Z=g==="ghost"&&v==="attached"?"detached":v,se=p.useId(),ne=p.useId(),ue=p.useId(),P=p.useId(),U=p.useId(),X=p.useId(),ie=p.useRef(null),te=p.useRef(null),de=D5(),[fe,he]=p.useState(""),V=fe.length>0,[xe,ve]=p.useState(null),[,ke]=p.useTransition(),[me,pe]=p.useOptimistic(c),Qe=f||me!==c,Xe=i&&!!o,$t=Es({placement:"above",focusTrigger:"always",isEnabled:Xe}),At=Es({placement:"above",isEnabled:Z==="tooltip"&&!!(y!=null&&y.message)}),{ariaLabelledBy:en,ariaDescribedBy:rt}=h5(U,[n?ue:null,!de&&Z!=="tooltip"&&(y!=null&&y.message)?P:null,Z==="tooltip"&&(y!=null&&y.message)?At.describedBy:null,Xe?$t.describedBy:null],de),zt=p.useMemo(()=>PS(l),[l]),tn=bc(),es=p.useCallback(ce=>{const Se=zt.length,Ue=new Set(zt.map(Ce=>Ce.value)),re=ce.filter(Ce=>Ue.has(Ce)).length;re===0?tn("Selection cleared"):Se>0&&re===Se?tn("All selected"):tn(`${re} of ${Se} selected`)},[tn,zt]),hs=p.useMemo(()=>q6(zt,fe),[zt,fe]),Us=p.useMemo(()=>{const ce=xe??new Set,Se=[];let Ue=[];const re=_e=>{const dt=_e.filter(Gi=>ce.has(Gi.value)),Pt=_e.filter(Gi=>!ce.has(Gi.value));return[...dt,...Pt]},Ce=()=>{Ue.length!==0&&(Se.push(...re(Ue)),Ue=[])};for(const _e of l)if(by(_e))Ce();else if(Wp(_e)){Ce();const dt=_e.options.map(Pt=>xa(Pt)).filter(Pt=>mf(Pt,fe));Se.push(...re(dt))}else if(Gp(_e)){const dt=xa(_e);mf(dt,fe)&&Ue.push(dt)}return Ce(),j?[{value:Wm,label:q},...Se]:Se},[fe,l,xe,j,q]),vt=p.useCallback(()=>{var ce;he(""),ve(null),tn(""),(ce=ie.current)==null||ce.focus()},[tn]),kt=Md({hasLightDismiss:!0,onHide:vt,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});p.useEffect(()=>{_&&kt.show()},[]);const vr=p.useCallback(ce=>{if(he(ce),ce.length===0){tn("");return}const Se=q6(zt,ce).length;tn(Se===0?"No results found":`${Se} result${Se===1?"":"s"}`)},[tn,zt]),Vi=p.useCallback(()=>{u([]),es([]),d&&ke(async()=>{pe([]),await d([])})},[u,d,ke,pe,es]),Fs=me.length>0,ii=p.useCallback(ce=>{ce.stopPropagation(),Vi()},[Vi]),Vs=p.useCallback(ce=>{const Se=me.includes(ce)?me.filter(Ue=>Ue!==ce):[...me,ce];u(Se),es(Se),d&&ke(async()=>{pe(Se),await d(Se)})},[me,u,d,ke,pe,es]),Bn=p.useMemo(()=>hs.filter(ce=>!ce.disabled),[hs]),qr=p.useMemo(()=>Bn.length>0&&Bn.every(ce=>me.includes(ce.value)),[Bn,me]),oi=p.useMemo(()=>Bn.some(ce=>me.includes(ce.value)),[Bn,me]),pn=qr?!0:oi?"indeterminate":!1,ps=p.useCallback(()=>{let ce;if(qr){const Se=new Set(Bn.map(Ue=>Ue.value));ce=me.filter(Ue=>!Se.has(Ue))}else{const Se=new Set(me);ce=[...me];for(const Ue of Bn)Se.has(Ue.value)||ce.push(Ue.value)}u(ce),es(ce),d&&ke(async()=>{pe(ce),await d(ce)})},[qr,Bn,me,u,d,ke,pe,es]),xn=p.useCallback(ce=>{ce===Wm?ps():Vs(ce)},[ps,Vs]),{highlightedIndex:qt,getItemId:xs,onTriggerClick:ai,onKeyDown:Gs,onItemMouseEnter:li}=IU({selectableItems:Us,isDisabled:i,isOpen:kt.isOpen,hasSearch:M,onOpen:p.useCallback(()=>{ve(new Set(me)),kt.show(),M&&requestAnimationFrame(()=>{var ce;(ce=te.current)==null||ce.focus()})},[kt,M,me]),onClose:kt.hide,onToggle:xn,onClear:b?Vi:void 0,hasValue:Fs,listboxId:ne});p.useEffect(()=>{var ce,Se;!kt.isOpen||qt<0||(Se=(ce=document.getElementById(xs(qt)))==null?void 0:ce.scrollIntoView)==null||Se.call(ce,{block:"nearest"})},[kt.isOpen,qt,xs]);const gs=p.useMemo(()=>me.map(ce=>{const Se=zt.find(Ue=>Ue.value===ce);return(Se==null?void 0:Se.label)??ce}),[me,zt]),ci=p.useCallback(()=>{if(me.length===0)return a.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:D});switch(z){case"count":return a.jsxs("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:[me.length," selected"]});case"labels":{const ce=gs.slice(0,3),Se=gs.length-ce.length,Ue=Se>0?`${ce.join(", ")}, +${Se}`:ce.join(", ");return a.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:Ue})}case"badges":{const ce=gs.slice(0,T),Se=gs.length-ce.length;return a.jsxs("span",{className:"x78zum5 x1a02dak xzye2dw x6s0dn4",children:[ce.map(Ue=>a.jsx($d,{label:Ue,variant:"neutral"},Ue)),Se>0&&a.jsxs("span",{className:"x2lah0s xcr08ib xv1l7n4 x1e4wzip",children:["+",Se]})]})}}},[me,z,gs,D,T]),Ae=p.useCallback(()=>M?a.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:ce=>{ce.target!==te.current&&ce.key==="Tab"&&!ce.shiftKey&&Gs(ce)},children:a.jsx(lt,{ref:te,id:X,label:O("@astryx.multiSelector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":kt.isOpen,"aria-controls":ne,"aria-autocomplete":"list","aria-activedescendant":kt.isOpen&&qt>=0?xs(qt):void 0,value:fe,onChange:vr,onKeyDown:ce=>{if(ce.key==="ArrowDown"||ce.key==="ArrowUp"||ce.key==="PageUp"||ce.key==="PageDown"||ce.key==="Enter"||ce.key==="Escape"){Gs(ce);return}ce.key==="Tab"&&(ce.shiftKey||!V)&&Gs(ce)},placeholder:F})}):null,[M,X,ne,fe,V,F,vr,Gs,kt.isOpen,qt,xs,O]),tt=p.useCallback((ce,Se)=>{const Ue=Se===qt,re=ce.value===Wm,Ce=re?qr:me.includes(ce.value),_e=re?pn:Ce,dt=re&&pn==="indeterminate";return a.jsxs("div",{id:xs(Se),role:"option","aria-selected":Ce,"aria-label":dt?O("@astryx.multiSelector.selectAllPartiallySelected",{label:q}):void 0,"aria-disabled":ce.disabled,onClick:()=>{ce.disabled||xn(ce.value)},onMouseEnter:()=>li(ce,Se),...W(kr.item,re?DU[K]:OU[K],re&&kr.selectAllWrapper,Ue&&kr.itemHighlighted,ce.disabled&&kr.itemDisabled),children:[a.jsx("div",{inert:!0,className:"x47corl x78zum5 x2lah0s",children:a.jsx(ch,{label:"",isLabelHidden:!0,value:_e,onChange:()=>{},isDisabled:ce.disabled,size:K==="lg"?"md":K})}),$&&!re?$(ce):a.jsx("span",{...{0:{className:"x9ynric xcr08ib x1e4wzip x1tgivj0 xeuugli xb3r6kr xlyipyv xuxw1ft"},1:{className:"x9ynric xcr08ib x1e4wzip xeuugli xb3r6kr xlyipyv xuxw1ft xnbbluu"}}[!!ce.disabled<<0],children:ce.label??ce.value})]},ce.value)},[$,qt,me,qr,pn,q,xs,xn,li,K,O]),Sn=p.useCallback(()=>{const ce=[];let Se=0;const Ue=j?Us.length-1:Us.length;if(j&&Ue>0?(ce.push(tt(Us[0],0)),ce.push(a.jsx(ja,{xstyle:kr.divider},"select-all-divider")),Se=1):j&&(Se=1),Ue===0)return ce.push(a.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")),ce;const re=!!fe;let Ce=0;const _e=()=>{for(let dt=0;dt<Ce;dt++)ce.push(tt(Us[Se],Se)),Se++;Ce=0};for(let dt=0;dt<l.length;dt++){const Pt=l[dt];if(by(Pt))_e(),re||ce.push(a.jsx(ja,{xstyle:kr.divider},`divider-${dt}`));else if(Wp(Pt)){_e();const Gi=re?Pt.options.filter(Xa=>mf(xa(Xa),fe)).length:Pt.options.length;if(Gi===0)continue;const Gd=[];for(let Xa=0;Xa<Gi;Xa++)Gd.push(tt(Us[Se],Se)),Se++;Pt.title&&ce.push(a.jsx(ja,{label:Pt.title,xstyle:kr.sectionDivider},`section-divider-${dt}`)),ce.push(a.jsx("div",{role:"group","aria-label":Pt.title,children:Gd},`section-${dt}`))}else Gp(Pt)&&(!re||mf(xa(Pt),fe))&&Ce++}return _e(),ce},[l,tt,Us,fe,j]),be=y!=null&&Z!=="detached",bt=y!=null&&Z==="tooltip"&&!!y.message,nn=a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:ce=>{kt.triggerRef(ce),$t.ref(ce)},onClick:ai,"data-testid":R,...ee(J("multi-selector",{variant:g,size:K,status:(y==null?void 0:y.type)??null}),W(Ia.base,kr.triggerContainer,LU[K],g==="ghost"&&kr.triggerGhost,i&&Ia.disabled,g==="ghost"&&i&&kr.triggerGhostDisabled,me.length===0&&kr.triggerPlaceholder,g!=="ghost"&&y&&yg[y.type],g!=="ghost"&&y&&!i&&vg[y.type],g!=="ghost"&&de&&O5.inGroup,B),I,L),children:[k&&ni(k,{size:"sm",color:"secondary"}),de&&a.jsx(qi,{id:U,children:e}),a.jsx("button",{ref:ie,id:se,type:"button",role:M?void 0:"combobox","aria-haspopup":"listbox","aria-expanded":kt.isOpen,"aria-controls":ne,"aria-activedescendant":!M&&kt.isOpen&&qt>=0?xs(qt):void 0,"aria-describedby":rt,"aria-labelledby":en,"aria-required":r?"true":void 0,"aria-invalid":(y==null?void 0:y.type)==="error"?"true":void 0,"aria-busy":Qe||void 0,disabled:i&&!Xe,"aria-disabled":Xe?"true":void 0,onKeyDown:Gs,tabIndex:i&&!Xe?-1:0,className:"x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz xh6dtrn",children:a.jsx("span",{className:"x78zum5 x6s0dn4 xzye2dw x1iyjqo2 xs83m0k x1r8uery xeuugli xb3r6kr",children:ci()})}),N!=null&&c.map(ce=>a.jsx("input",{type:"hidden",name:N,value:ce,disabled:i},ce)),Qe&&a.jsx(Jt,{size:"sm"}),b&&c.length>0&&!i&&a.jsx("button",{type:"button",onClick:ii,"aria-label":O("@astryx.multiSelector.clearAll",{label:e}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:a.jsx(ze,{icon:"close",size:"sm",color:"secondary",...J("multi-selector-clear-icon")})}),a.jsx("span",{...{0:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"},2:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"},1:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"},3:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"}}[!!(!be&&kt.isOpen)<<1|!!be<<0],children:be?bt?a.jsx("button",{ref:At.ref,type:"button","aria-label":O(BU[y.type]),"aria-describedby":At.describedBy,onClick:ce=>ce.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:a.jsx(ze,{icon:B6[y.type],size:"sm",color:H6[y.type]})}):a.jsx(ze,{icon:B6[y.type],size:"sm",color:H6[y.type]}):a.jsx(ze,{icon:"chevronDown",size:"sm",color:"inherit",...J("multi-selector-indicator-icon",{state:kt.isOpen?"expanded":"collapsed"})})})]}),kt.render(a.jsxs("div",{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk",children:[Ae(),a.jsx("div",{id:ne,role:"listbox","aria-multiselectable":"true","aria-labelledby":se,children:Sn()})]}),{placement:"below",alignment:"start",xstyle:kr.popover}),bt&&At.renderTooltip((y==null?void 0:y.message)??""),Xe&&$t.renderTooltip(o)]});return de?nn:a.jsx(wc,{label:e,isLabelHidden:t,description:n,inputID:se,descriptionID:n?ue:void 0,isOptional:s,isRequired:r,isDisabled:i,status:y?{type:y.type,message:y.message,messageID:y.message?P:void 0}:void 0,statusVariant:Z,labelTooltip:m,width:H,children:nn})}$C.displayName="MultiSelector";const a4=p.createContext(null);a4.displayName="TabListContext";function HU(){const e=p.use(a4);if(e==null)throw new Error("useTabListContext must be used within TabList. Wrap your Tab/TabMenu in <TabList>.");return e}const qU="[data-tab-value],[data-tab-menu]",Km={nav:{k1xSpc:"x78zum5",kGNEyG:"x1qjc9v5",kOIVth:"x1lsbc85",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",$$css:!0},fill:{kzqmXN:"xh8yej3",$$css:!0},divider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",kGO01o:"xy143xn","--_tab-indicator-bottom":"xficto1",$$css:!0}};function AC({ref:e,value:t,onChange:n,size:s,layout:r="hug",hasDivider:i=!1,xstyle:o,className:l,style:c,children:u,onKeyDown:d,onFocus:f,onBlur:h,"aria-label":x,"aria-orientation":g,[Fp]:y,...v}){const m=Me(),k=x??m("@astryx.tabList.label"),b=Ua(s,"md"),{listRef:j,handleKeyDown:A,handleFocus:M}=Ed({itemSelector:qU,orientation:"both",hasRovingTabIndex:!0}),{hintElement:E,onKeyDown:z,onFocus:T,onBlur:$}=kS(),_=p.useMemo(()=>({value:t,onChange:n,size:b,layout:r}),[t,n,b,r]),R=p.useCallback(B=>{d==null||d(B),!B.defaultPrevented&&(z(B),A(B))},[d,z,A]),N=p.useCallback(B=>{f==null||f(B),!B.defaultPrevented&&(T(B),M(B))},[f,T,M]),H=p.useCallback(B=>{h==null||h(B),!B.defaultPrevented&&$(B)},[h,$]);return a.jsx(a4,{value:_,children:a.jsxs("nav",{ref:Wt(e,j),...v,"aria-label":k,onKeyDown:R,onFocus:N,onBlur:H,[Fp]:"",...ee(J("tab-list",{size:b}),W(Km.nav,r==="fill"&&Km.fill,i&&Km.divider,o),l,c),children:[u,E]})})}AC.displayName="TabList";const PU={x1u3b27q:"x1u3b27q",$$css:!0},Qh={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kg3NbH:"xrrkdod",kWkggS:"xjbqb8w",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"xh6dtrn",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1sodnla",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",kybGjl:"x1hl2dhg",khDVqt:"xuxw1ft",k1ekBW:"xt3l3uh",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},hoverBg:{kVAEAm:"x10l6tqk",kpwlN0:"x10a8y8t",kogj98:"x1bpp3o7",kzqmXN:"xh8yej3",kaIpWk:"xh6dtrn",kfzvcC:"x47corl",kWkggS:"xjbqb8w x1a1zr74",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0},selected:{kMwMTN:"x1tgivj0",k63SB2:"x2mo6ok",$$css:!0},icon:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},UU={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},FU={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},VU={fill:{kUk6DE:"x98rzlu",kjj79g:"xl56j7k",$$css:!0}},GU={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function Ay({as:e,ref:t,value:n,label:s,isLabelHidden:r=!1,href:i,icon:o,selectedIcon:l,endContent:c,xstyle:u,className:d,style:f,...h}){const x=HU(),g=Fa(e),y=x.value===n,v=x.size,m=x.layout==="fill",k=y&&l?l:o,b=!r&&s!=="",j=p.useCallback(()=>{x.onChange(n)},[x,n]),A=k?a.jsx("span",{...W(Qh.icon,GU[v]),children:k}):null,M={...h,...r?{"aria-label":s}:{},[Fp]:"","data-tab-value":n,"aria-current":y?"page":void 0,tabIndex:y?0:-1,...ee(J("tab",{selected:y?"selected":null}),W(Qh.base,UU[v],y&&Qh.selected,m&&VU.fill,PU,u),d,f)},E=a.jsx("span",{"aria-hidden":"true",...W(Qh.hoverBg,FU[v])}),z=a.jsx("span",{...ee(J("tab-indicator",{selected:y?"selected":null}),{0:{className:"x10l6tqk xyi47jn x1ybfrjj x1mcfs9z x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 xjbqb8w xg01cxk"},1:{className:"x10l6tqk xyi47jn x1ybfrjj x1mcfs9z x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 x1ewilqj x1hc1fzr"}}[!!y<<0])}),T=b?a.jsxs("span",{className:"xwz0xwf",children:[a.jsx("span",{className:"x1agbcgv xcrlgei",children:s}),a.jsx("span",{"aria-hidden":"true",className:"x1agbcgv xcrlgei xlshs6z x47corl x2mo6ok",children:s})]}):null,$=c?a.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s",children:c}):null;return i!=null?a.jsxs(g,{ref:t,href:i,onClick:j,...M,children:[E,A,T,$,z]}):a.jsxs("button",{ref:t,type:"button",onClick:j,...M,children:[E,A,T,$,z]})}Ay.displayName="Tab";const WU=.8,tl={wrapper:{kY2c9j:"x1vjfegm",k1xSpc:"x1lliihq",kmVPX3:"x1717udv","--_textarea-inline-padding":"x1kdpo6e",$$css:!0},textarea:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kB7OPa:"x9f619",k7Eaqz:"xeuugli",kMzoRj:"xc342km",ksu8eU:"xng3xce",k8WAf4:"xu0wf1k",kg3NbH:"x1w6f3ag",kMv6JI:"x9ynric",kGuDYH:"xjm74w1 x6pjikd",kLWn49:"xw6l6zx",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w",kI3sdo:"x1a2a7pz",k8Qsv1:"xeyghm5",kHenm0:"x288g5",$$css:!0},textareaDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},textareaWithStartIcon:{kZCmMZ:"x1b6te9z",$$css:!0},textareaWithStatus:{kwRFfy:"xp2dy4z",$$css:!0},textareaWithBusyStatus:{kwRFfy:"x1g2apga",$$css:!0},textareaWithCounter:{kGO01o:"xekm6fs",$$css:!0}},KU={sm:{$$css:!0},md:{$$css:!0},lg:{k8WAf4:"xce4md1",$$css:!0}};function MC({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:r=!1,onChange:i,changeAction:o,isLoading:l=!1,value:c,placeholder:u,rows:d=3,isDisabled:f=!1,disabledMessage:h,status:x,statusVariant:g="attached",labelTooltip:y,startIcon:v,hasSpellCheck:m=!0,onPaste:k,maxLength:b,hasAutoFocus:j=!1,size:A,htmlName:M,onFocus:E,onBlur:z,width:T,xstyle:$,className:_,style:R,ref:N,...H}){const B=Ua(A,"md"),I=Me(),L=bc(),O=p.useId(),D=p.useId(),q=p.useId(),F=p.useId(),K=p.useRef(null),Z=p.useRef(null),se=p.useRef(null),[,ne]=p.useTransition(),[ue,P]=p.useOptimistic(c),U=l||ue!==c,X=f&&!!h,ie=Es({placement:"above",focusTrigger:"always",isEnabled:X}),{statusIcon:te,describedBy:de}=jS({status:x,statusVariant:g}),fe=[n?D:null,g!=="tooltip"&&(x!=null&&x.message)?q:null,de,b!=null?F:null,X?ie.describedBy:null].filter(Boolean).join(" ")||void 0,he=p.useCallback(me=>{if(b==null)return;const pe=me>b?"over":me>=b*WU?"near":"under";pe!==se.current&&(se.current=pe,pe==="over"?L(I("@astryx.textArea.charactersOverLimit",{count:me-b}),"assertive"):pe==="near"&&L(I("@astryx.textArea.charactersRemaining",{count:b-me})))},[L,I,b]),V=me=>{if(f)return;const pe=me.target.value;he(pe.length),i==null||i(pe,me),o&&!me.defaultPrevented&&ne(async()=>{P(pe),await o(pe,me)})},xe=f||U,{onClick:ve,onMouseUp:ke}=T5({containerRef:Z,inputRef:K,disabled:xe});return a.jsxs(wc,{label:e,isLabelHidden:t,description:n,inputID:O,descriptionID:n?D:void 0,isOptional:s,isRequired:r,isDisabled:f,status:x?{type:x.type,message:x.message,messageID:x.message?q:void 0}:void 0,statusVariant:g,labelTooltip:y,width:T,children:[a.jsxs("div",{ref:me=>{Z.current=me,ie.ref(me)},onClick:ve,onMouseUp:ke,...ee(J("textarea",{size:B,status:(x==null?void 0:x.type)??null}),W(Ia.base,tl.wrapper,f&&Ia.disabled,x&&yg[x.type],x&&!f&&vg[x.type],x&&HS[x.type],$),_,R),children:[v&&a.jsx("span",{className:"x10l6tqk xctzyg x1kiyvbf x47corl x78zum5",children:ni(v,{size:"sm",color:"secondary"})}),a.jsx("textarea",{...H,ref:Wt(N,K),id:O,name:M,value:ue,onChange:V,onPaste:k,onFocus:E,onBlur:z,placeholder:u,rows:d,disabled:f&&!X,"aria-disabled":X?"true":void 0,readOnly:X||void 0,spellCheck:m,autoFocus:j,"data-autofocus":j||void 0,"aria-describedby":fe,"aria-required":r&&!s?"true":void 0,"aria-invalid":(x==null?void 0:x.type)==="error"||b!=null&&ue.length>b?"true":void 0,"aria-busy":U||void 0,...W(tl.textarea,KU[B],f&&tl.textareaDisabled,!!v&&tl.textareaWithStartIcon,(x||U)&&tl.textareaWithStatus,U&&!!te&&tl.textareaWithBusyStatus,b!=null&&tl.textareaWithCounter)}),(U||te)&&a.jsxs("span",{className:"x10l6tqk xctzyg x13oyzgk x47corl x78zum5 x6s0dn4 x1txdalj",children:[U&&a.jsx(Jt,{size:"sm"}),te]}),b!=null&&a.jsxs("div",{id:F,...{0:{className:"x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j xv1l7n4"},1:{className:"x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j xjt36v0"}}[(ue.length>b)<<0],children:[ue.length>b&&a.jsx(ze,{icon:"warning",size:"sm"}),ue.length,"/",b]})]}),X&&ie.renderTooltip(h)]})}MC.displayName="TextArea";function TC({ref:e,href:t,isDisabled:n,LinkComponent:s,linkStyleProps:r,labelContent:i,icon:o,endContent:l,removeButton:c,...u}){const d=p.useRef(null),f=p.useRef(null),{onClick:h,onMouseUp:x}=E5({containerRef:d,interactiveRef:f,href:t,disabled:n});return a.jsxs("span",{ref:Wt(e,d),onClick:n?void 0:h,onMouseUp:n?void 0:x,...u,children:[o,a.jsx(s,{ref:f,href:t,"aria-disabled":n||void 0,...r,children:i}),l,c]})}TC.displayName="TokenLink";const Xs={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",k8WAf4:"xt970qd",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"xx3sua9",kMv6JI:"xjb2p0i",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",kybGjl:"x1hl2dhg",ks0D6T:"x193iq5w",kVQacm:"xb3r6kr",$$css:!0},interactive:{kkrTdU:"x1ypdohk",k1ekBW:"x12qzo2w",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},focusVisibleOutline:{kI3sdo:"x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",$$css:!0}},Jh={sm:{kZKoxP:"xzydfjl",kGuDYH:"x141an7d",kg3NbH:"xf314gf",$$css:!0},md:{kZKoxP:"xrmxcn7",kg3NbH:"xf314gf",$$css:!0},lg:{kZKoxP:"x102lyln",kg3NbH:"xf314gf",$$css:!0}},e0={default:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},red:{kWkggS:"x1cibrc5",kMwMTN:"x1joocv1",$$css:!0},orange:{kWkggS:"x1e9xt6e",kMwMTN:"xm47u9q",$$css:!0},yellow:{kWkggS:"x1bo7t0x",kMwMTN:"xdhq94a",$$css:!0},green:{kWkggS:"x1sqjeoo",kMwMTN:"xltfdvo",$$css:!0},teal:{kWkggS:"x1jtji5o",kMwMTN:"x9x0lbs",$$css:!0},cyan:{kWkggS:"x1rgj867",kMwMTN:"x1txnczv",$$css:!0},blue:{kWkggS:"x1o0wnni",kMwMTN:"x1vvqiwl",$$css:!0},purple:{kWkggS:"x16i6n6f",kMwMTN:"x1m9wyeb",$$css:!0},pink:{kWkggS:"xnpoty2",kMwMTN:"xiuofww",$$css:!0},gray:{kWkggS:"xspzpui",kMwMTN:"xru1t7f",$$css:!0}};function On({label:e,size:t="md",color:n="default",icon:s,isDisabled:r=!1,onRemove:i,onClick:o,href:l,description:c,endContent:u,isLabelHidden:d=!1,xstyle:f,className:h,style:x,"data-testid":g,ref:y}){const v=Me(),m=Fa(),k=SS({href:l,onClick:o,isDisabled:r}),b=o??(k==="button"?()=>{}:null),j=i!=null&&a.jsx("button",{type:"button","aria-label":v("@astryx.token.remove",{label:e}),onClick:E=>{E.stopPropagation(),i(E)},disabled:r,className:"x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9",children:a.jsx(ze,{icon:"close",size:"xsm",color:"inherit"})}),A=a.jsxs(a.Fragment,{children:[s,a.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e}),u,j]}),M={"data-testid":g,"aria-label":d?e:void 0,"aria-description":c};if(k==="link")return i==null?a.jsx(m,{ref:y,href:l,"aria-disabled":r||void 0,...M,...ee(J("token",{color:n,size:t}),W(Xs.base,Jh[t],e0[n],Xs.interactive,r&&Xs.disabled,f),h,x),children:A}):a.jsx(TC,{ref:y,href:l,isDisabled:r,LinkComponent:m,icon:s,endContent:u,removeButton:j,linkStyleProps:{className:"xmper1u xln7xf2 x1heor9g x1a2a7pz xb3r6kr xeuugli"},labelContent:a.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e}),...M,...ee(J("token",{color:n,size:t}),W(Xs.base,Jh[t],e0[n],Xs.interactive,Xs.focusVisibleOutline,r&&Xs.disabled,f),h,x)});if(b!=null){const E=z=>{z.target.closest("button, a")||b(z)};return a.jsxs("span",{ref:y,onClick:r?void 0:E,...M,...ee(J("token",{color:n,size:t}),W(Xs.base,Jh[t],e0[n],Xs.interactive,Xs.focusVisibleOutline,r&&Xs.disabled,f),h,x),children:[s,a.jsx("button",{type:"button",onClick:b,disabled:r,className:"xmper1u xln7xf2 x1heor9g x1a2a7pz xb3r6kr xeuugli",children:a.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e})}),u,j]})}return a.jsx("span",{ref:y,...M,...ee(J("token",{color:n,size:t}),W(Xs.base,Jh[t],e0[n],r&&Xs.disabled,f),h,x),children:A})}On.displayName="Token";const XU=1e3,ZU=100,P6={root:{kWkggS:"xprdx6m x1j0df82 x1o55y2u",kSiTet:"xvpkmg4 x1tbh5bv",$$css:!0},animate:{kILWW9:"xpz12be",k44tkh:"xqgcaz",ko0y90:"xa4qsjk",kKVMdj:"xeuoslp x1aquc0h",kyAemX:"x193epu2",$$css:!0}},YU={0:{kaIpWk:"xwksslw",$$css:!0},1:{kaIpWk:"xx3sua9",$$css:!0},2:{kaIpWk:"xh6dtrn",$$css:!0},3:{kaIpWk:"x1hviunn",$$css:!0},4:{kaIpWk:"x1hviunn",$$css:!0},none:{kaIpWk:"x2u8bby",$$css:!0},rounded:{kaIpWk:"xjspbzw",$$css:!0}},QU={kKxzle:"xvo38ju",$$css:!0},U6={animationDelay:e=>[QU,{"--x-animationDelay":(t=>typeof t=="number"?t+"ms":t??void 0)(`${XU+ZU*e}ms`)}],dimensions:(e,t)=>[{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,kZKoxP:(typeof t=="number"?`${t}px`:t)!=null?"x16ye13r":typeof t=="number"?`${t}px`:t,$$css:!0},{"--x-width":(n=>typeof n=="number"?n+"px":n??void 0)(typeof e=="number"?`${e}px`:e),"--x-height":(n=>typeof n=="number"?n+"px":n??void 0)(typeof t=="number"?`${t}px`:t)}]};function ac({width:e="100%",height:t="100%",radius:n=3,index:s=0,"data-testid":r,xstyle:i,className:o,style:l,ref:c,...u}){return a.jsx("div",{ref:c,"aria-hidden":"true","data-testid":r,...ee(J("skeleton"),W(P6.root,P6.animate,YU[n],U6.dimensions(e,t),U6.animationDelay(s),i),o,l),...u})}ac.displayName="Skeleton";const Xm={root:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kzqmXN:"x1fu8urw",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},removeButtonOverrides:{"--_button-radius":"xh8ntw8",kZKoxP:"x1qx5ct2",k7Eaqz:"xt4ypqs",kWkggS:"x1u4601x",kMwMTN:"x9e3rv5",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0}};function JU(){return a.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5l3.5-5.5z"})})}function Jp({src:e,alt:t,label:n,onRemove:s,onClick:r,isLoading:i=!1,isDisabled:o=!1,showRemoveOn:l="hover",xstyle:c,className:u,style:d,"data-testid":f,ref:h,...x}){const g=Me(),[y,v]=p.useState(void 0),m=e!=null,k=m&&y===e,b=i&&!m,j=m&&!b&&!k,A=i&&m,M=!i&&!m||k,E=r!=null&&!o&&!i,z=s!=null&&!o,T=z&&l==="hover",{getContainerProps:$,getContentRevealProps:_}=wB({isEnabled:T}),R=n&&t?`${n} — ${t}`:n??t??g("@astryx.thumbnail.fallbackName"),N=!t,H=t!=null||n!=null||x["aria-label"]!=null||x["aria-labelledby"]!=null;Ad("Thumbnail",'`src` is set without `alt` or `label`. The image is treated as decorative and hidden from assistive technology, and the thumbnail falls back to a generic "thumbnail" name. Pass `alt` to describe the image content, or `label` (file name) to name the thumbnail.',m&&!H);const B=a.jsxs(a.Fragment,{children:[j&&a.jsx("img",{src:e,alt:t??"",role:N?"presentation":void 0,"aria-hidden":N||void 0,onError:()=>v(e),className:"xh8yej3 x5yr21d xl1xv1r x1lliihq"}),b&&a.jsx(ac,{radius:2}),M&&a.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xv9yike",children:a.jsx(JU,{})})]}),I=z?a.jsx("div",{...ee({className:"x10l6tqk x8d4r5l xy3asu9 x1vjfegm x14ju556"},T?_({isLayoutPreserved:!0}):{}),children:a.jsx(Q,{icon:a.jsx(ze,{icon:"close",size:"xsm"}),label:g("@astryx.thumbnail.remove",{accessibleName:R}),variant:"secondary",size:"sm",isIconOnly:!0,onClick:O=>{O.stopPropagation(),s(O)},xstyle:Xm.removeButtonOverrides})}):null,L=a.jsx("div",{ref:h,"data-testid":f,role:"group","aria-label":R,...ee(J("thumbnail"),W(Xm.root,o&&Xm.disabled,c),u,d),...x,children:a.jsxs("div",{...ee({0:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c"},4:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3"},2:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig"},6:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig"},1:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c xi14tyy"},5:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 xi14tyy"},3:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig xi14tyy"},7:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig xi14tyy"}}[!!E<<2|!!E<<1|!!E<<0],T?$():{}),children:[E?a.jsx("button",{type:"button",onClick:r,"aria-label":g("@astryx.thumbnail.open",{accessibleName:R}),className:"x1ypdohk x1lliihq xh8yej3 x5yr21d xh6dtrn xb3r6kr",children:B}):B,j&&a.jsx("div",{className:"x10l6tqk x10a8y8t x1pjcqnp x1er153n x47corl"}),A&&a.jsx("div",{className:"x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k x1u4601x x1pjcqnp x1vjfegm x14ju556",children:a.jsx(Jt,{size:"sm",shade:"onMedia"})}),I]})});return n!=null?a.jsx(Pi,{content:n,children:L}):L}Jp.displayName="Thumbnail";function zC({ref:e,isOpen:t,isInline:n,onOpenChange:s,title:r,description:i,cancelLabel:o,actionLabel:l,actionVariant:c="destructive",isActionLoading:u,onAction:d,width:f=400,xstyle:h,className:x,style:g,"data-testid":y,...v}){const m=Me(),k=o??m("@astryx.alertDialog.cancel"),b=p.useId(),j=p.useId(),A=p.useCallback(()=>{s(!1)},[s]);return a.jsx(mr,{...v,ref:e,isOpen:t,isInline:n,onOpenChange:s,width:f,purpose:"form",role:"alertdialog","aria-labelledby":b,"aria-describedby":j,...ee(J("alert-dialog"),{className:x,style:g}),xstyle:h,"data-testid":y,children:a.jsx(Hs,{content:a.jsxs(qs,{children:[a.jsx(ds,{level:2,id:b,children:r}),a.jsx(Y,{type:"body",color:"secondary",id:j,children:i})]}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{variant:"ghost",label:k,onClick:A}),a.jsx(Q,{variant:c,label:l,onClick:d,isLoading:u})]})})})})}zC.displayName="AlertDialog";const ef={dropdown:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kskxy:"xuyqlj2",kORKVm:"x1odjw0f","--_dropdown-menu-radius":"x1fcsqxe","--_dropdown-menu-padding":"xgory14",kmVPX3:"x9epnlk",kaIpWk:"x1n97fys",kSiTet:"x1hc1fzr",k1ekBW:"x19991ni",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0},popover:{k7Eaqz:"xrzjruh",$$css:!0},popoverBlockGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},popoverInlineGap:{keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]},eF="@astryx.dropdownMenu.label";function zd({button:e,isMenuOpen:t,onOpenChange:n,menuWidth:s,onClick:r,hasChevron:i=!0,placement:o="below",alignment:l="start",className:c,style:u,xstyle:d,"data-testid":f,...h}){const x=Me(),g=e??{label:x(eF)},y=("items"in h?h.items:void 0)??[],v=h.children,{items:m,children:k,...b}=h,j=p.useId(),A=g.size??"md",M=p.useRef(null),[E,z]=p.useState(!1),T=t!==void 0,$=T?t:E,_=p.useRef(0),R=p.useCallback(()=>{var he;_.current=Date.now(),n==null||n(!1),T||z(!1),(he=M.current)==null||he.focus()},[T,n]),N=p.useRef(!1),H=p.useCallback(()=>{n==null||n(!0),T||z(!0)},[T,n]),B=Md({onHide:R,onShow:H,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"}),I=p.useCallback(()=>{B.hide()},[B]),{listRef:L,handleKeyDown:O,focusFirst:D,focusItem:q,ownsEvent:F,getItems:K}=Ed({itemSelector:$5,boundarySelector:A5,wrap:!1,onEscape:I}),Z=C5({getItemLabels:()=>K().map(he=>he.textContent),onMatch:q,getCurrentIndex:()=>K().findIndex(he=>he===document.activeElement||he.contains(document.activeElement))});p.useEffect(()=>{T&&(t&&!B.isOpen?(N.current=!0,B.show()):!t&&B.isOpen&&B.hide())},[t,T,B]),p.useEffect(()=>{!B.isOpen||!N.current||(N.current=!1,requestAnimationFrame(()=>D()))},[B.isOpen,D]);const se=p.useCallback(he=>{if(F(he)){if(he.key==="Enter"||he.key===" "){he.preventDefault();const V=document.activeElement;V&&dg.has(V.getAttribute("role")??"")&&V.click();return}if(he.key==="Tab"){I();return}if(Z.onKeyDown(he)){he.preventDefault();return}O(he)}},[O,I,Z,F]),ne=p.useCallback(()=>{N.current=!0,B.show()},[B]),ue=p.useCallback(()=>{Date.now()-_.current<50||(r==null||r(),T?n==null||n(!t):B.isOpen?B.hide():ne())},[r,T,n,t,B,ne]),P=p.useCallback(he=>{B.isOpen||(he.key==="ArrowDown"||he.key==="Enter"||he.key===" ")&&(he.preventDefault(),ne())},[B.isOpen,ne]),U=g.isIconOnly===!0,X=g.endContent??(i&&!U?a.jsx(ze,{icon:"chevronDown",size:"sm",color:"inherit"}):void 0),ie=s?ef.popoverCustomWidth(s):ef.popover,te=o==="above"||o==="below"?ef.popoverBlockGap:ef.popoverInlineGap,de=p.useMemo(()=>({closeMenu:I,menuSize:A}),[I,A]),fe=h.items!==void 0?M5(y):v;return a.jsxs(a.Fragment,{children:[a.jsx(Q,{...g,ref:he=>{M.current=he,B.triggerRef(he);const V=g.ref;typeof V=="function"?V(he):V&&(V.current=he)},tooltip:$?void 0:g.tooltip,endContent:X,onClick:ue,onKeyDown:P,"aria-haspopup":"menu","aria-expanded":$,"aria-controls":j,"data-testid":f}),B.render(a.jsx("div",{...b,ref:L,id:j,role:"menu","aria-label":g.label,onKeyDown:se,...ee(J("dropdown-menu"),W(ef.dropdown,d),c,u),children:a.jsx(ah,{value:de,children:fe})}),{placement:o,alignment:l,xstyle:[ie,te,go[o]]})]})}zd.displayName="DropdownMenu";function Cg({items:e,label:t,variant:n="ghost",size:s,icon:r,isDisabled:i=!1,isMenuOpen:o,onOpenChange:l,xstyle:c,className:u,style:d,"data-testid":f,ref:h}){const x=Me(),g=t??x("@astryx.moreMenu.label"),y=Ua(s,"md"),v=rd("moreHorizontal");return a.jsx(zd,{className:u?`${uy("more-menu")} ${u}`:uy("more-menu"),xstyle:c,style:d,isMenuOpen:o,onOpenChange:l,button:{label:g,icon:r??v,variant:n,size:y,isDisabled:i,tooltip:g,isIconOnly:!0,ref:h},items:e,hasChevron:!1,"data-testid":f})}Cg.displayName="MoreMenu";const Wi={dialog:{kVAEAm:"xixxii4",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",ks0D6T:"x1x1rfll",kskxy:"x7ab17h",kpwlN0:"x10a8y8t",kzqmXN:"xn9wirt",kZKoxP:"xtdtrs8",kWkggS:"xjbqb8w",kVQacm:"xb3r6kr",kZeWKH:"xish69e",kFalU9:"x5ve5x3",kI3sdo:"x1a2a7pz",k1xSpc:"x1s85apg",$$css:!0},open:{k1xSpc:"x78zum5",$$css:!0},backdrop:{kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",k5sjJv:"xph5o2a",kND0Po:"x167zut7",k9an0g:"xft5bk6",kb4ib:"x15h3t91",kA5Tbj:"x1viac0w",$$css:!0},backdropOpen:{k5sjJv:"xb3n6bw",$$css:!0},drawer:{kVAEAm:"x10l6tqk",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kWkggS:"x10xzikg",kB7OPa:"x9f619",kVQacm:"xb3r6kr",k1ekBW:"x11xpdln",kIyJzY:"x80gvsz",kAMwcw:"xlr8y92",kI3sdo:"x1a2a7pz",k6CgDc:"xzg1mie",$$css:!0},drawerStart:{kLqNvP:"x1o0tod",ke9TFa:"xw8tdv1",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",k3aq6I:"x5i6ehr xttggg",$$css:!0},drawerStartOpen:{k3aq6I:"xbryuvx",$$css:!0},drawerEnd:{kt4wiu:"xtijo5x",k2ei4v:"xgbv0en",kVhnKS:"x1t7ytsu",kGJrpR:"x1j92z86",k3aq6I:"xumwmo6 x1df3fe5",$$css:!0},drawerEndOpen:{k3aq6I:"xbryuvx",$$css:!0}},tF={kzqmXN:"xn9wirt",ks0D6T:"xf68679",$$css:!0},nF={width:e=>[tF,{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(`${e}px`)}]};function l4({isOpen:e,onOpenChange:t,children:n,header:s,width:r=320,side:i="auto",label:o,"data-testid":l,xstyle:c,className:u,style:d,onClick:f,ref:h,...x}){const g=Me(),y=ug(),v=e??y.isMobileNavOpen,m=p.useId(),k=y.mobileNavId||m,b=p.useMemo(()=>t??(_=>{_?y.openMobileNav():y.closeMobileNav()}),[t,y]),j=p.useRef(null),A=p.useRef(null),[M,E]=p.useState(i==="auto"?"end":i);p.useEffect(()=>{const _=j.current;if(_){if(A.current&&(clearTimeout(A.current),A.current=null),v){if(i==="auto"){const R=document.activeElement;if(R&&R!==document.body){const N=R.getBoundingClientRect(),H=N.left+N.width/2;E(H<window.innerWidth/2?"start":"end")}}else E(i);_.open||_.showModal(),document.documentElement.style.overflow="clip"}else if(_.open){document.documentElement.style.overflow="";const R=window.matchMedia("(prefers-reduced-motion: reduce)").matches?10:250;A.current=setTimeout(()=>{_.close()},R)}return()=>{A.current&&(clearTimeout(A.current),A.current=null),document.documentElement.style.overflow="",_.open&&_.close()}}},[v,i]);const z=p.useCallback(_=>{_.preventDefault(),b(!1)},[b]),T=p.useCallback(_=>{_.target===_.currentTarget&&b(!1)},[b]),$=M==="start";return a.jsx("dialog",{ref:Wt(h,j),id:k,...ee(J("mobile-nav",{side:M}),W(Wi.dialog,v&&Wi.open,Wi.backdrop,v&&Wi.backdropOpen,c),u,d),...x,"data-testid":l,"aria-label":o??(typeof s=="string"?s:g("@astryx.mobileNav.navigation")),onClick:ig(f,T),onCancel:z,children:a.jsxs("div",{tabIndex:-1,...W(Wi.drawer,nF.width(r),$&&Wi.drawerStart,$&&v&&Wi.drawerStartOpen,!$&&Wi.drawerEnd,!$&&v&&Wi.drawerEndOpen),children:[a.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1qughib x1k15mir xf314gf x2lah0s x92x3c3 x1q0q8m5 xw8gpjh"},1:{className:"x78zum5 x6s0dn4 x1k15mir xf314gf x2lah0s x92x3c3 x1q0q8m5 xw8gpjh x13a6bvl"}}[!s<<0],children:[typeof s=="string"?a.jsx("span",{className:"x11g1kdw",children:a.jsx(ds,{level:2,children:s})}):s??null,a.jsx(Q,{variant:"ghost",label:g("@astryx.mobileNav.closeNavigation"),icon:a.jsx(ze,{icon:"close",color:"inherit"}),onClick:()=>b(!1),isIconOnly:!0})]}),a.jsx("div",{className:"x98rzlu x1odjw0f x6ikm8r xish69e xx69xxh xf314gf xce4md1",children:n})]})})}l4.displayName="MobileNav";const qo={item:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kZKoxP:"x1ueg155",kg3NbH:"xf314gf",k8WAf4:"xt970qd",kaIpWk:"xh6dtrn",kMzoRj:"xc342km",ksu8eU:"xng3xce",kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",k63SB2:"x1sodnla",kLWn49:"x1kq96og",k9WMMc:"x1yc453h",kB7OPa:"x9f619",kHE3J0:"xe9uy6x",kSReZ0:"xyxi2l3",$$css:!0},selected:{kWkggS:"x17x4s8c",k63SB2:"x1e4wzip",kHE3J0:"x1sua13m",kSReZ0:"xjtnuge",$$css:!0},disabled:{kMwMTN:"xnbbluu",kkrTdU:"x1h6gzvc",kfzvcC:"x47corl",$$css:!0},sm:{kZKoxP:"x6k0iem",kg3NbH:"x7a5moj",$$css:!0},md:{kZKoxP:"x1ueg155",kg3NbH:"xf314gf",$$css:!0},lg:{kZKoxP:"xssyfek",kg3NbH:"xf314gf",$$css:!0}},Eg=p.createContext({isCollapsed:!1,toggle:()=>{},isCollapsible:!1});Eg.displayName="SideNavCollapseContext";function c4(){return p.use(Eg)}function NC({ref:e,handleRef:t,label:n,children:s,onClick:r,...i}){const o=Me(),l=rd("chevronLeft"),{isCollapsed:c,toggle:u,isCollapsible:d}=sF(t),{isMobile:f}=ug();return!d||f?null:a.jsx(Q,{ref:e,label:n??o(c?"@astryx.sideNavCollapseButton.expandSidebar":"@astryx.sideNavCollapseButton.collapseSidebar"),variant:"ghost",...i,onClick:ig(r,u),icon:s??a.jsx("span",{...W(sd.mirror),children:a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 x11xpdln xuedmi6 xlr8y92"},1:{className:"x3nfvp2 x6s0dn4 x11xpdln xuedmi6 xlr8y92 x19jd1h0"}}[!!c<<0],children:l})}),isIconOnly:!0})}NC.displayName="SideNavCollapseButton";function sF(e){var s;const t=c4();if(e==null)return t;const n=((s=e.current)==null?void 0:s.getCollapseState())??null;return{isCollapsed:(n==null?void 0:n.isCollapsed)??!1,toggle:()=>{var r,i;(i=(r=e.current)==null?void 0:r.getCollapseState())==null||i.toggle()},isCollapsible:(n==null?void 0:n.isCollapsible)??!0}}const rF=160,Zm={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kZKoxP:"x5yr21d",kzqmXN:"x1hfn5x7",kWkggS:"xgcd1z6",kB7OPa:"x9f619",kVQacm:"xb3r6kr",$$css:!0},rootCollapsed:{kzqmXN:"xhgvbfk",$$css:!0},topbar:{k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kZKoxP:"xsdox4t",kzqmXN:"xh8yej3",kWkggS:"xgcd1z6",kB7OPa:"x9f619",kVQacm:"xb3r6kr",$$css:!0}};function u4({header:e,topContent:t,children:n,footer:s,footerIcons:r,collapsible:i=!1,resizable:o=!1,xstyle:l,className:c,style:u,"data-testid":d,ref:f,handleRef:h,...x}){const g=Me(),y=typeof i=="object"?i:{},v=!!i,m=y.hasButton??!0,k=y.defaultIsCollapsed??!1,b=y.isCollapsed,j=y.onCollapsedChange,A=typeof o=="object"?o:{},M=!!o,E=b!==void 0,[z,T]=p.useState(k),$=E?b:z,_=p.useRef(null),R=p.useRef({isCollapsed:$,toggle:()=>{},isCollapsible:v}),N=p.useCallback(ue=>{E||T(ue),j==null||j(ue)},[E,j]),H=jC({defaultSize:A.defaultWidth??260,minSizePx:A.minWidth??180,maxSizePx:A.maxWidth??480,collapsible:v,collapsedSize:rF,autoSaveId:A.autoSaveId,onSizeChange:A.onWidthChange,onCollapseChange:v?N:void 0}),B=p.useCallback(()=>{const ue=!$;R.current={...R.current,isCollapsed:ue},N(ue),M&&(ue?H.collapse():H.expand())},[$,N,M,H]),I=M&&!$;R.current={isCollapsed:$,toggle:B,isCollapsible:v};const L={isCollapsed:$,toggle:B,isCollapsible:v};p.useImperativeHandle(h,()=>({getCollapseState:()=>R.current}),[]);const O=rS();if(O==="topbar")return a.jsxs("div",{"data-testid":d,...ee(J("side-nav",{mode:"topbar"}),W(Zm.topbar,l),c,u),children:[e,a.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw xvc5jky",children:r})]});const D=!!(s||r);if(O==="drawer")return a.jsxs(l4,{header:e,"data-testid":d,children:[t,n,D&&a.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,r&&a.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:r})]})]});if(O==="drawer-content")return a.jsxs(a.Fragment,{children:[t,n,D&&a.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,r&&a.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:r})]})]});const q=!!(e||t),F=!!(s||r),K=v&&m,Z=M?{...u??{},width:$?void 0:H.size}:u,se=a.jsxs("nav",{ref:Wt(f,_),role:"navigation","aria-label":g("@astryx.sideNav.label"),"data-testid":d,...ee(J("side-nav"),W(Zm.root,$&&Zm.rootCollapsed,l),c,Z),...x,children:[q&&a.jsxs("div",{...{0:{className:"x78zum5 xdt5ytf x2lah0s x7wzq59 x13vifvy x1vjfegm xgcd1z6 x1xye8es x1wesfrj xf314gf x1txdalj"},1:{className:"x78zum5 xdt5ytf x2lah0s x7wzq59 x13vifvy x1vjfegm xgcd1z6 x1xye8es x1wesfrj xf314gf x1txdalj x6s0dn4"}}[!!$<<0],children:[e,t&&a.jsx("div",{children:t})]}),a.jsx("div",{...{0:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x1xye8es x1wesfrj"},4:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 x1xye8es x1wesfrj"},2:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf xfsso4q x1wesfrj"},6:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 xfsso4q x1wesfrj"},1:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x1xye8es xy143xn"},5:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 x1xye8es xy143xn"},3:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf xfsso4q xy143xn"},7:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 xfsso4q xy143xn"}}[!!$<<2|!!q<<1|!!F<<0],children:n}),(F||K)&&a.jsxs("div",{...{0:{className:"x78zum5 xdt5ytf x2lah0s xr1yuqi x7wzq59 x1ey2m1c xgcd1z6 x1txdalj xf314gf xfsso4q x1wesfrj"},1:{className:"x78zum5 xdt5ytf x2lah0s xr1yuqi x7wzq59 x1ey2m1c xgcd1z6 x1txdalj xf314gf x1wesfrj xexx8yu"}}[!!$<<0],children:[s,a.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 xzye2dw"},1:{className:"x78zum5 x6s0dn4 xzye2dw x3ieub6"}}[!!$<<0],children:[K&&a.jsx(NC,{}),r]})]})]}),ne=I?a.jsxs("div",{className:"x1n2onr6 x78zum5 x2lah0s x5yr21d",children:[se,a.jsx(s4,{"data-testid":"astryx-sidenav-resize-handle",direction:"horizontal",position:"overlay",pillPlacement:"end",isAlwaysVisible:!1,resizable:H.props,label:g("@astryx.sideNav.resizeSidebar")})]}):se;return v?a.jsx(Eg,{value:L,children:ne}):ne}u4.displayName="SideNav";const Dc={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kzqmXN:"xh8yej3",$$css:!0},itemCollapsed:{kjj79g:"xl56j7k",kzqmXN:"x805d0l",kg3NbH:"xnjsko4",$$css:!0},itemCollapsedSm:{kzqmXN:"x1fvqzum",$$css:!0},itemCollapsedLg:{kzqmXN:"x1m747yf",$$css:!0}},iF={isCollapsed:!1,toggle:()=>{},isCollapsible:!1};function Ym({href:e,as:t,isDisabled:n,onClick:s,ref:r,children:i,...o}){const l=Fa(t);return e&&!n?a.jsx(l,{ref:r,href:e,onClick:s,...o,children:i}):a.jsx("button",{ref:r,type:"button",onClick:s,disabled:n,...o,children:i})}function ao({as:e,label:t,icon:n,selectedIcon:s,isSelected:r=!1,isDisabled:i=!1,href:o,onClick:l,endContent:c,children:u,collapsible:d,size:f="md","data-testid":h,ref:x,xstyle:g}){const y=Me(),v=rd("chevronDown"),{isCollapsed:m}=c4(),k=rS(),{closeMobileNav:b}=ug(),j=k==="drawer"||k==="drawer-content",A=p.useId(),M=!!u,E=p.useRef(null),z=Md({hasLightDismiss:!0,hasAutoFocus:!0,hasCloseButton:!1,dialogLabel:`${t} submenu`}),T=p.useMemo(()=>typeof d=="object"?d:{},[d]),$=M&&d!==!1,_=T.isCollapsed,R=_!==void 0,[N,H]=p.useState(T.defaultIsCollapsed??!1),B=R?_:N,I=p.useCallback(()=>{var he;const fe=!B;R||H(fe),(he=T.onCollapsedChange)==null||he.call(T,fe)},[B,R,T]),L=r&&s?s:n,D=$&&(!!o||!!l)&&!m,q=fe=>{if(i){fe.preventDefault();return}if($&&!D&&!m){fe.preventDefault(),I();return}l==null||l(fe),j&&b()},F=fe=>{fe.preventDefault(),fe.stopPropagation(),I()},K=p.useRef(null),Z=p.useRef(null),se=p.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=null),Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),ne=p.useCallback(()=>{se(),K.current=setTimeout(()=>{z.show({skipAutoFocus:!0})},150)},[se,z]),ue=p.useCallback(()=>{se(),Z.current=setTimeout(()=>{z.hide()},200)},[se,z]),P=p.useCallback(()=>{ne()},[ne]),U=p.useCallback(()=>{ue()},[ue]);if(m&&!n)return null;if(m){const fe=L&&ni(L,{size:"sm",color:r?"primary":i?"disabled":"secondary"}),he=ee(J("side-nav-item",{size:f,selected:r?"selected":null}),W(qo.item,qo[f],Dc.itemCollapsed,f==="sm"&&Dc.itemCollapsedSm,f==="lg"&&Dc.itemCollapsedLg,r&&qo.selected,i&&qo.disabled));if(M)return a.jsxs("div",{...W(Dc.root,g),children:[a.jsx("button",{ref:Wt(x,z.triggerRef),type:"button",onClick:z.toggle,onMouseEnter:P,onMouseLeave:U,"aria-label":t,"data-testid":h,...z.triggerProps,...he,children:fe}),z.render(a.jsxs("div",{className:"x1litavf x1y0btm7 x14i3s5s xu0wf1k x7a5moj x11g1kdw xfb3i0g",onMouseEnter:P,onMouseLeave:U,onClick:()=>z.hide(),children:[a.jsx("div",{className:"xf314gf xu0wf1k x141an7d x2mo6ok xv1l7n4 x1ltkj2j",children:t}),a.jsx(Eg,{value:iF,children:u})]}),{placement:"end",alignment:"start"})]});const V={"aria-current":r?"page":void 0,"aria-disabled":i||void 0,"aria-label":t,"data-testid":h},xe=a.jsx(Ym,{ref:x,href:o,as:e,isDisabled:i,onClick:q,...V,...he,children:fe});return a.jsxs("div",{ref:E,...W(Dc.root,g),children:[xe,a.jsx(Pi,{content:t,placement:"end",anchorRef:E})]})}const X=a.jsxs(a.Fragment,{children:[L&&ni(L,{size:"sm",color:r?"primary":i?"disabled":"secondary"}),!m&&a.jsx("span",{className:"x98rzlu xeuugli xb3r6kr xlyipyv xuxw1ft",children:t}),!m&&c&&a.jsx("span",{className:"x2lah0s x78zum5 x6s0dn4",children:c}),!m&&$&&!D&&a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s x19jd1h0"}}[!B<<0],children:v})]}),ie=ee(J("side-nav-item",{size:f,selected:r?"selected":null}),W(qo.item,qo[f],r&&qo.selected,i&&qo.disabled));let te;if(D)te=a.jsxs("div",{"data-testid":h,...ie,children:[a.jsx(Ym,{ref:x,href:o,as:e,isDisabled:i,onClick:q,"aria-current":r?"page":void 0,className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli x1heor9g x1hl2dhg x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x1yc453h x1ypdohk",children:X}),a.jsx("button",{type:"button",onClick:F,"aria-label":B?y("@astryx.sideNavItem.expand",{label:t}):y("@astryx.sideNavItem.collapse",{label:t}),"aria-expanded":!B,"aria-controls":`${A}-children`,className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn xe9uy6x xyxi2l3",children:a.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s x19jd1h0"}}[!B<<0],children:v})})]});else{const fe={"aria-current":r?"page":void 0,"aria-disabled":i||void 0,"aria-expanded":$?!B:void 0,"aria-controls":$?`${A}-children`:void 0,"data-testid":h};te=a.jsx(Ym,{ref:x,href:o,as:e,isDisabled:i,onClick:q,...fe,...ie,children:X})}return a.jsxs("div",{ref:E,...W(Dc.root,g),children:[te,M&&!m&&a.jsx("div",{id:`${A}-children`,role:"group","aria-labelledby":`${A}-label`,"aria-hidden":B,inert:B?!0:void 0,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!B<<0],children:a.jsxs("div",{className:"xb3r6kr x2lwn1j x31w388",children:[a.jsx("span",{id:`${A}-label`,hidden:!0,children:t}),u]})})]})}ao.displayName="SideNavItem";const oF={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k8WAf4:"xu0wf1k",$$css:!0}};function $g({ref:e,title:t,subtitle:n,children:s,endContent:r,isHeaderHidden:i=!1,xstyle:o,className:l,style:c,"data-testid":u,...d}){const{isCollapsed:f}=c4(),x=`${p.useId()}-title`,g=a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"x78zum5 xdt5ytf x98rzlu xeuugli",children:[a.jsx("span",{id:x,className:"x141an7d x2mo6ok x1ltkj2j xv1l7n4 xb3r6kr xlyipyv xuxw1ft",children:t}),n&&a.jsx("span",{className:"x141an7d x1ltkj2j xv1l7n4 xb3r6kr xlyipyv xuxw1ft",children:n})]}),r&&a.jsx("span",{className:"x2lah0s x78zum5 x6s0dn4",children:r})]}),y=i||f,v=y?{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:0}:{};return a.jsxs("div",{ref:e,...ee(J("side-nav-section"),W(oF.root,o),l,c),...d,role:"group","aria-labelledby":x,"data-testid":u,children:[a.jsx("div",{...ee({className:"x78zum5 x6s0dn4 x1txdalj xf314gf xu0wf1k xt0e3qv x87ps6o"},{style:y?v:void 0}),children:g}),a.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:s})]})}$g.displayName="SideNavSection";var _C={exports:{}},Ag={},RC={exports:{}},IC={};/**
167
- * @license React
168
- * scheduler.production.js
169
- *
170
- * Copyright (c) Meta Platforms, Inc. and affiliates.
171
- *
172
- * This source code is licensed under the MIT license found in the
173
- * LICENSE file in the root directory of this source tree.
174
- */(function(e){function t(I,L){var O=I.length;I.push(L);e:for(;0<O;){var D=O-1>>>1,q=I[D];if(0<r(q,L))I[D]=L,I[O]=q,O=D;else break e}}function n(I){return I.length===0?null:I[0]}function s(I){if(I.length===0)return null;var L=I[0],O=I.pop();if(O!==L){I[0]=O;e:for(var D=0,q=I.length,F=q>>>1;D<F;){var K=2*(D+1)-1,Z=I[K],se=K+1,ne=I[se];if(0>r(Z,O))se<q&&0>r(ne,Z)?(I[D]=ne,I[se]=O,D=se):(I[D]=Z,I[K]=O,D=K);else if(se<q&&0>r(ne,O))I[D]=ne,I[se]=O,D=se;else break e}}return L}function r(I,L){var O=I.sortIndex-L.sortIndex;return O!==0?O:I.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,x=!1,g=!1,y=!1,v=!1,m=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function j(I){for(var L=n(u);L!==null;){if(L.callback===null)s(u);else if(L.startTime<=I)s(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function A(I){if(y=!1,j(I),!g)if(n(c)!==null)g=!0,M||(M=!0,R());else{var L=n(u);L!==null&&B(A,L.startTime-I)}}var M=!1,E=-1,z=5,T=-1;function $(){return v?!0:!(e.unstable_now()-T<z)}function _(){if(v=!1,M){var I=e.unstable_now();T=I;var L=!0;try{e:{g=!1,y&&(y=!1,k(E),E=-1),x=!0;var O=h;try{t:{for(j(I),f=n(c);f!==null&&!(f.expirationTime>I&&$());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var q=D(f.expirationTime<=I);if(I=e.unstable_now(),typeof q=="function"){f.callback=q,j(I),L=!0;break t}f===n(c)&&s(c),j(I)}else s(c);f=n(c)}if(f!==null)L=!0;else{var F=n(u);F!==null&&B(A,F.startTime-I),L=!1}}break e}finally{f=null,h=O,x=!1}L=void 0}}finally{L?R():M=!1}}}var R;if(typeof b=="function")R=function(){b(_)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,H=N.port2;N.port1.onmessage=_,R=function(){H.postMessage(null)}}else R=function(){m(_,0)};function B(I,L){E=m(function(){I(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var O=h;h=L;try{return I()}finally{h=O}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(I,L){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var O=h;h=I;try{return L()}finally{h=O}},e.unstable_scheduleCallback=function(I,L,O){var D=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?D+O:D):O=D,I){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=O+q,I={id:d++,callback:L,priorityLevel:I,startTime:O,expirationTime:q,sortIndex:-1},O>D?(I.sortIndex=O,t(u,I),n(c)===null&&I===n(u)&&(y?(k(E),E=-1):y=!0,B(A,O-D))):(I.sortIndex=q,t(c,I),g||x||(g=!0,M||(M=!0,R()))),I},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(I){var L=h;return function(){var O=h;h=L;try{return I.apply(this,arguments)}finally{h=O}}}})(IC);RC.exports=IC;var aF=RC.exports;/**
175
- * @license React
176
- * react-dom-client.production.js
177
- *
178
- * Copyright (c) Meta Platforms, Inc. and affiliates.
179
- *
180
- * This source code is licensed under the MIT license found in the
181
- * LICENSE file in the root directory of this source tree.
182
- */var kn=aF,LC=p,lF=a1;function oe(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function OC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function dh(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function DC(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function BC(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function F6(e){if(dh(e)!==e)throw Error(oe(188))}function cF(e){var t=e.alternate;if(!t){if(t=dh(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return F6(r),e;if(i===s)return F6(r),t;i=i.sibling}throw Error(oe(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=i;break}if(l===s){o=!0,s=r,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=r;break}if(l===s){o=!0,s=i,n=r;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==s)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function HC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=HC(e),t!==null)return t;e=e.sibling}return null}function Ls(e,t,n,s,r,i){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,s,r,i)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Ls(e.child,t,n,s,r,i))return!0;e=e.sibling}return!1}function jc(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function V6(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function qC(e){var t=[null,null],n=jc(e);return n===null||PC(t,e,n.child,{foundSelf:!1}),t}function PC(e,t,n,s){for(;n!==null;){if(n===t)s.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(s.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&PC(e,t,n.child,s))return!0;n=n.sibling}return!1}function vn(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(oe(559))}}var nu=null,My=null;function uF(e,t,n){return e===n?!0:e===t?(nu=e,!0):!1}function dF(e,t,n){return e===n?(My=e,!1):e===t?(My!==null&&(nu=e),!0):!1}function G6(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function Ty(e,t,n){for(var s=0,r=e;r;r=n(r))s++;r=0;for(var i=t;i;i=n(i))r++;for(;0<s-r;)e=n(e),s--;for(;0<r-s;)t=n(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var yt=Object.assign,fF=Symbol.for("react.element"),t0=Symbol.for("react.transitional.element"),yf=Symbol.for("react.portal"),su=Symbol.for("react.fragment"),UC=Symbol.for("react.strict_mode"),zy=Symbol.for("react.profiler"),FC=Symbol.for("react.consumer"),zi=Symbol.for("react.context"),d4=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),_y=Symbol.for("react.suspense_list"),f4=Symbol.for("react.memo"),Qo=Symbol.for("react.lazy"),Ry=Symbol.for("react.activity"),hF=Symbol.for("react.legacy_hidden"),pF=Symbol.for("react.memo_cache_sentinel"),Iy=Symbol.for("react.view_transition"),xF=Symbol.for("react.recoverable"),W6=Symbol.iterator;function tf(e){return e===null||typeof e!="object"?null:(e=W6&&e[W6]||e["@@iterator"],typeof e=="function"?e:null)}var gF=Symbol.for("react.client.reference");function Ly(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===gF?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case su:return"Fragment";case zy:return"Profiler";case UC:return"StrictMode";case Ny:return"Suspense";case _y:return"SuspenseList";case Ry:return"Activity";case Iy:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case yf:return"Portal";case zi:return e.displayName||"Context";case FC:return(e._context.displayName||"Context")+".Consumer";case d4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case f4:return t=e.displayName||null,t!==null?t:Ly(e.type)||"Memo";case Qo:t=e._payload,e=e._init;try{return Ly(e(t))}catch{}}return null}var vf=Array.isArray,Te=LC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,st=lF.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ql={pending:!1,data:null,method:null,action:null},Oy=[],ru=-1;function Ui(e){return{current:e}}function Xn(e){0>ru||(e.current=Oy[ru],Oy[ru]=null,ru--)}function Et(e,t){ru++,Oy[ru]=e.current,e.current=t}var Li=Ui(null),d1=Ui(null),Sa=Ui(null),ex=Ui(null);function tx(e,t){switch(Et(Sa,t),Et(d1,e),Et(Li,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?o8(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=o8(t),e=fA(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Xn(Li),Et(Li,e)}function id(){Xn(Li),Xn(d1),Xn(Sa)}function Dy(e){var t=e.memoizedState;t!==null&&(xd._currentValue=t.memoizedState,Et(ex,e)),t=Li.current;var n=fA(t,e.type);t!==n&&(Et(d1,e),Et(Li,n))}function nx(e){d1.current===e&&(Xn(Li),Xn(d1)),ex.current===e&&(Xn(ex),xd._currentValue=Ql)}var Qm,K6;function Vo(e){if(Qm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qm=t&&t[1]||"",K6=-1<n.stack.indexOf(`
183
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
184
- `+Qm+e+K6}var Jm=!1;function e2(e,t){if(!e||Jm)return"";Jm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(g){var h=g}Reflect.construct(e,[],f)}else{try{f.call()}catch(g){h=g}f=!1;try{var x=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),f=!0,new e}finally{f&&(x!==void 0?Object.defineProperty(e.prototype,"props",x):delete e.prototype.props)}}}else{try{throw Error()}catch(g){h=g}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(g){if(g&&h&&typeof g.stack=="string")return[g.stack,h.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
185
- `),u=l.split(`
186
- `);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var d=`
187
- `+c[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=s&&0<=r);break}}}finally{Jm=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Vo(n):""}function mF(e,t){switch(e.tag){case 26:case 27:case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return e.child!==t&&t!==null?Vo("Suspense Fallback"):Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 15:return e2(e.type,!1);case 11:return e2(e.type.render,!1);case 1:return e2(e.type,!0);case 31:return Vo("Activity");case 30:return Vo("ViewTransition");default:return""}}function X6(e){try{var t="",n=null;do t+=mF(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
188
- Error generating stack: `+s.message+`
189
- `+s.stack}}var By=Object.prototype.hasOwnProperty,h4=kn.unstable_scheduleCallback,t2=kn.unstable_cancelCallback,yF=kn.unstable_shouldYield,vF=kn.unstable_requestPaint,cr=kn.unstable_now,kF=kn.unstable_getCurrentPriorityLevel,VC=kn.unstable_ImmediatePriority,GC=kn.unstable_UserBlockingPriority,sx=kn.unstable_NormalPriority,bF=kn.unstable_LowPriority,WC=kn.unstable_IdlePriority,wF=kn.log,jF=kn.unstable_setDisableYieldValue,fh=null,ur=null;function ga(e){if(typeof wF=="function"&&jF(e),ur&&typeof ur.setStrictMode=="function")try{ur.setStrictMode(fh,e)}catch{}}var dr=Math.clz32?Math.clz32:EF,SF=Math.log,CF=Math.LN2;function EF(e){return e>>>=0,e===0?32:31-(SF(e)/CF|0)|0}var n0=256,s0=262144,r0=4194304;function al(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Mg(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=al(s):(o&=l,o!==0?r=al(o):n||(n=l&~e,n!==0&&(r=al(n))))):(l=s&~i,l!==0?r=al(l):o!==0?r=al(o):n||(n=s&~e,n!==0&&(r=al(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function hh(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function KC(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-dr(n),r=1<<s;t|=e[s],n&=~r}return t}function $F(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function XC(){var e=r0;return r0<<=1,!(r0&62914560)&&(r0=4194304),e}function n2(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ph(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function AF(e,t,n,s,r,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var d=31-dr(n),f=1<<d;l[d]=0,c[d]=-1;var h=u[d];if(h!==null)for(u[d]=null,d=0;d<h.length;d++){var x=h[d];x!==null&&(x.lane&=-536870913)}n&=~f}s!==0&&ZC(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function ZC(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-dr(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function YC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-dr(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function QC(e,t){var n=t&-t;return n=n&42?1:p4(n),n&(e.suspendedLanes|t)?0:n}function p4(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function x4(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function JC(){var e=st.p;return e!==0?e:(e=window.event,e===void 0?32:_A(e.type))}function Z6(e,t){var n=st.p;try{return st.p=e,t()}finally{st.p=n}}var zo=Math.random().toString(36).slice(2),Wn="__reactFiber$"+zo,Os="__reactProps$"+zo,Nd="__reactContainer$"+zo,Y6="__reactEvents$"+zo,MF="__reactListeners$"+zo,TF="__reactHandles$"+zo,Q6="__reactResources$"+zo,xh="__reactMarker$"+zo,rx="__reactLoad$"+zo;function Tg(e){delete e[Wn],delete e[Os],delete e[MF],delete e[TF]}function El(e){var t;if(t=e[Wn])return t;for(var n=e.parentNode;n;){if(t=n[Nd]||n[Wn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=p8(e);e!==null;){if(n=e[Wn])return n;e=p8(e)}return t}e=n,n=e.parentNode}return null}function _d(e){if(e=e[Wn]||e[Nd]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kf(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(oe(33))}function vu(e){var t=e[Q6];return t||(t=e[Q6]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function _n(e){e[xh]=!0}function eE(e){e[rx]=void 0}var tE=new Set,nE={};function Sc(e,t){od(e,t),od(e+"Capture",t)}function od(e,t){for(nE[e]=t,e=0;e<t.length;e++)tE.add(t[e])}var zF=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),J6={},e7={};function NF(e){return By.call(e7,e)?!0:By.call(J6,e)?!1:zF.test(e)?e7[e]=!0:(J6[e]=!0,!1)}var et=!1;function t7(){var e=et;return et=!1,e}function B0(e,t,n){if(NF(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function i0(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Ki(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,s)}}function nr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _F(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hy(e){if(!e._valueTracker){var t=sE(e)?"checked":"value";e._valueTracker=_F(e,t,""+e[t])}}function rE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=sE(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}var RF=/[\n"\\]/g;function Nr(e){return e.replace(RF,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function qy(e,t,n,s,r,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nr(t)):e.value!==""+nr(t)&&(e.value=""+nr(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?o==="number"&&e.value==t?s2(e,nr(e.value)):s2(e,nr(t)):n!=null?s2(e,nr(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+nr(l):e.removeAttribute("name")}function iE(e,t,n,s,r,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Hy(e);return}n=n!=null?""+nr(n):"",t=t!=null?""+nr(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Hy(e)}function s2(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ku(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+nr(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function oE(e,t,n){if(t!=null&&(t=""+nr(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+nr(n):""}function aE(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(oe(92));if(vf(s)){if(1<s.length)throw Error(oe(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=nr(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),Hy(e)}function ad(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var IF=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function n7(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||IF.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function lE(e,t,n){if(t!=null&&typeof t!="object")throw Error(oe(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",et=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&(n7(e,r,s),et=!0)}else for(var i in t)t.hasOwnProperty(i)&&n7(e,i,t[i])}function g4(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var LF=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),OF=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function H0(e){return OF.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ni(){}var Py=null;function m4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var iu=null,bu=null;function s7(e){var t=_d(e);if(t&&(e=t.stateNode)){var n=e[Os]||null;e:switch(e=t.stateNode,t.type){case"input":if(qy(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Nr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Os]||null;if(!r)throw Error(oe(90));qy(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&rE(s)}break e;case"textarea":oE(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ku(e,!!n.multiple,t,!1)}}}var r2=!1;function cE(e,t,n){if(r2)return e(t,n);r2=!0;try{var s=e(t);return s}finally{if(r2=!1,(iu!==null||bu!==null)&&(Fg(),iu&&(t=iu,e=bu,bu=iu=null,s7(t),e)))for(t=0;t<e.length;t++)s7(e[t])}}function f1(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Os]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var wo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uy=!1;if(wo)try{var nf={};Object.defineProperty(nf,"passive",{get:function(){Uy=!0}}),window.addEventListener("test",nf,nf),window.removeEventListener("test",nf,nf)}catch{Uy=!1}var ma=null,y4=null,q0=null;function uE(){if(q0)return q0;var e,t=y4,n=t.length,s,r="value"in ma?ma.value:ma.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[i-s];s++);return q0=r.slice(e,1<s?1-s:void 0)}function P0(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function o0(){return!0}function r7(){return!1}function $s(e){function t(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?o0:r7,this.isPropagationStopped=r7,this}return yt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=o0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=o0)},persist:function(){},isPersistent:o0}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zg=$s(Ga),gh=yt({},Ga,{view:0,detail:0}),DF=$s(gh),i2,o2,sf,Ng=yt({},gh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v4,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sf&&(sf&&e.type==="mousemove"?(i2=e.screenX-sf.screenX,o2=e.screenY-sf.screenY):o2=i2=0,sf=e),i2)},movementY:function(e){return"movementY"in e?e.movementY:o2}}),i7=$s(Ng),BF=yt({},Ng,{dataTransfer:0}),HF=$s(BF),qF=yt({},gh,{relatedTarget:0}),a2=$s(qF),PF=yt({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),UF=$s(PF),FF=yt({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VF=$s(FF),GF=yt({},Ga,{data:0}),o7=$s(GF),WF={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KF={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},XF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZF(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=XF[e])?!!t[e]:!1}function v4(){return ZF}var YF=yt({},gh,{key:function(e){if(e.key){var t=WF[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=P0(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?KF[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v4,charCode:function(e){return e.type==="keypress"?P0(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?P0(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),QF=$s(YF),JF=yt({},Ng,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a7=$s(JF),eV=yt({},Ga,{submitter:0}),tV=$s(eV),nV=yt({},gh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v4}),sV=$s(nV),rV=yt({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),iV=$s(rV),oV=yt({},Ng,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),aV=$s(oV),lV=yt({},Ga,{newState:0,oldState:0,source:0}),cV=$s(lV),uV=[9,13,27,32],k4=wo&&"CompositionEvent"in window,Df=null;wo&&"documentMode"in document&&(Df=document.documentMode);var dV=wo&&"TextEvent"in window&&!Df,dE=wo&&(!k4||Df&&8<Df&&11>=Df),l7=" ",c7=!1;function fE(e,t){switch(e){case"keyup":return uV.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ou=!1;function fV(e,t){switch(e){case"compositionend":return hE(t);case"keypress":return t.which!==32?null:(c7=!0,l7);case"textInput":return e=t.data,e===l7&&c7?null:e;default:return null}}function hV(e,t){if(ou)return e==="compositionend"||!k4&&fE(e,t)?(e=uE(),q0=y4=ma=null,ou=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return dE&&t.locale!=="ko"?null:t.data;default:return null}}var pV={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pV[e.type]:t==="textarea"}function pE(e,t,n,s){iu?bu?bu.push(s):bu=[s]:iu=s,t=Ex(t,"onChange"),0<t.length&&(n=new zg("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Bf=null,h1=null;function xV(e){cA(e,0)}function _g(e){var t=kf(e);if(rE(t))return e}function d7(e,t){if(e==="change")return t}var xE=!1;if(wo){var l2;if(wo){var c2="oninput"in document;if(!c2){var f7=document.createElement("div");f7.setAttribute("oninput","return;"),c2=typeof f7.oninput=="function"}l2=c2}else l2=!1;xE=l2&&(!document.documentMode||9<document.documentMode)}function h7(){Bf&&(Bf.detachEvent("onpropertychange",gE),h1=Bf=null)}function gE(e){if(e.propertyName==="value"&&_g(h1)){var t=[];pE(t,h1,e,m4(e)),cE(xV,t)}}function gV(e,t,n){e==="focusin"?(h7(),Bf=t,h1=n,Bf.attachEvent("onpropertychange",gE)):e==="focusout"&&h7()}function mV(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _g(h1)}function yV(e,t){if(e==="click")return _g(t)}function vV(e,t){if(e==="input"||e==="change")return _g(t)}function kV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xr=typeof Object.is=="function"?Object.is:kV;function p1(e,t){if(xr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!By.call(t,r)||!xr(e[r],t[r]))return!1}return!0}function Fy(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function p7(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function x7(e,t){var n=p7(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=p7(n)}}function mE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yE(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fy(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fy(e.document)}return t}function b4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var bV=wo&&"documentMode"in document&&11>=document.documentMode,au=null,Vy=null,Hf=null,Gy=!1;function g7(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gy||au==null||au!==Fy(s)||(s=au,"selectionStart"in s&&b4(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Hf&&p1(Hf,s)||(Hf=s,s=Ex(Vy,"onSelect"),0<s.length&&(t=new zg("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=au)))}function nl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var lu={animationend:nl("Animation","AnimationEnd"),animationiteration:nl("Animation","AnimationIteration"),animationstart:nl("Animation","AnimationStart"),transitionrun:nl("Transition","TransitionRun"),transitionstart:nl("Transition","TransitionStart"),transitioncancel:nl("Transition","TransitionCancel"),transitionend:nl("Transition","TransitionEnd")},u2={},vE={};wo&&(vE=document.createElement("div").style,"AnimationEvent"in window||(delete lu.animationend.animation,delete lu.animationiteration.animation,delete lu.animationstart.animation),"TransitionEvent"in window||delete lu.transitionend.transition);function Cc(e){if(u2[e])return u2[e];if(!lu[e])return e;var t=lu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in vE)return u2[e]=t[n];return e}var kE=Cc("animationend"),bE=Cc("animationiteration"),wE=Cc("animationstart"),wV=Cc("transitionrun"),jV=Cc("transitionstart"),SV=Cc("transitioncancel"),jE=Cc("transitionend"),SE=new Map,Wy="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wy.push("scrollEnd");function ri(e,t){SE.set(e,t),Sc(t,[e])}var CV=0;function jo(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ei.identifierPrefix;var n=CV++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function m7(e){if(e==null||typeof e=="string")return e;var t=null,n=Au;if(n!==null)for(var s=0;s<n.length;s++){var r=e[n[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function No(e,t){return e=m7(e),t=m7(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ix=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ar=[],cu=0,w4=0;function Rg(){for(var e=cu,t=w4=cu=0;t<e;){var n=Ar[t];Ar[t++]=null;var s=Ar[t];Ar[t++]=null;var r=Ar[t];Ar[t++]=null;var i=Ar[t];if(Ar[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}i!==0&&CE(n,r,i)}}function Ig(e,t,n,s){Ar[cu++]=e,Ar[cu++]=t,Ar[cu++]=n,Ar[cu++]=s,w4|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function j4(e,t,n,s){return Ig(e,t,n,s),ox(e)}function Ec(e,t){return Ig(e,null,null,t),ox(e)}function CE(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-dr(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function ox(e){if(50<Zf)throw Zf=0,Q0=null,Error(oe(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var uu={};function EV(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _s(e,t,n,s){return new EV(e,t,n,s)}function S4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yo(e,t){var n=e.alternate;return n===null?(n=_s(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function EE(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function U0(e,t,n,s,r,i){var o=0;if(s=e,typeof s=="function")S4(s)&&(o=1);else if(typeof s=="string")o=eW(e,n,Li.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ry:return e=_s(31,n,t,r),e.elementType=Ry,e.lanes=i,e;case su:return Jl(n.children,r,i,t);case UC:o=8,r|=24;break;case zy:return e=_s(12,n,t,r|2),e.elementType=zy,e.lanes=i,e;case Ny:return e=_s(13,n,t,r),e.elementType=Ny,e.lanes=i,e;case _y:return e=_s(19,n,t,r),e.elementType=_y,e.lanes=i,e;case hF:case Iy:return e=r|32,e=_s(30,n,t,e),e.elementType=Iy,e.lanes=i,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case zi:o=10;break e;case FC:o=9;break e;case d4:o=11;break e;case f4:o=14;break e;case Qo:o=16,s=null;break e}o=29,n=Error(oe(130,e===null?"null":typeof e,"")),s=null}return t=_s(o,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function Jl(e,t,n,s){return e=_s(7,e,s,t),e.lanes=n,e}function d2(e,t,n){return e=_s(6,e,null,t),e.lanes=n,e}function $E(e){var t=_s(18,null,null,0);return t.stateNode=e,t}function f2(e,t,n){return t=_s(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var y7=new WeakMap;function _r(e,t){if(typeof e=="object"&&e!==null){var n=y7.get(e);return n!==void 0?n:(t={value:e,source:t,stack:X6(t)},y7.set(e,t),t)}return{value:e,source:t,stack:X6(t)}}var du=[],fu=0,ax=null,x1=0,Tr=[],zr=0,La=null,_i=1,Ri="";function Yi(e,t){du[fu++]=x1,du[fu++]=ax,ax=e,x1=t}function AE(e,t,n){Tr[zr++]=_i,Tr[zr++]=Ri,Tr[zr++]=La,La=e;var s=_i;e=Ri;var r=32-dr(s)-1;s&=~(1<<r),n+=1;var i=32-dr(t)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,_i=1<<32-dr(t)+r|n<<r|s,Ri=i+e}else _i=1<<i|n<<r|s,Ri=e}function Lg(e){e.return!==null&&(Yi(e,1),AE(e,1,0))}function C4(e){for(;e===ax;)ax=du[--fu],du[fu]=null,x1=du[--fu],du[fu]=null;for(;e===La;)La=Tr[--zr],Tr[zr]=null,Ri=Tr[--zr],Tr[zr]=null,_i=Tr[--zr],Tr[zr]=null}function ME(e,t){Tr[zr++]=_i,Tr[zr++]=Ri,Tr[zr++]=La,_i=t.id,Ri=t.overflow,La=e}var In=null,St=null,qe=!1,Ca=null,Rr=!1,Ky=Error(oe(519));function Oa(e){var t=Error(oe(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw g1(_r(t,e)),Ky}function v7(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Wn]=e,t[Os]=s,n){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(n=0;n<k1.length;n++)Ve(k1[n],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),iE(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),aE(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||dA(t.textContent,n)?(s.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),s.onScroll!=null&&Ve("scroll",t),s.onScrollEnd!=null&&Ve("scrollend",t),s.onClick!=null&&(t.onclick=Ni),t=!0):t=!1,t||Oa(e,!0)}function lx(e){for(In=e.return;In;)switch(In.tag){case 5:case 31:case 13:Rr=!1;return;case 27:case 3:Rr=!0;return;default:In=In.return}}function Bc(e){if(e!==In)return!1;if(!qe)return lx(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Nv(e.type,e.memoizedProps)),n=!n),n&&St&&Oa(e),lx(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));St=h8(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));St=h8(e)}else t===27?(t=St,Wa(e.type)?(e=Lv,Lv=null,St=e):St=t):St=In?Lr(e.stateNode.nextSibling):null;return!0}function lc(){St=In=null,qe=!1}function h2(){var e=Ca;return e!==null&&(Ts===null?Ts=e:Ts.push.apply(Ts,e),Ca=null),e}function g1(e){Ca===null?Ca=[e]:Ca.push(e)}var Xy=Ui(null),$c=null,ho=null;function ya(e,t,n){Et(Xy,t._currentValue),t._currentValue=n}function vo(e){e._currentValue=Xy.current,Xn(Xy)}function F0(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Zy(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var o=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),F0(i.return,n,e),s||(o=null);break e}i=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(oe(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),F0(o,n,e),o=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,o=r.alternate,o!==null&&(o.lanes|=n),F0(r.return,n,e),o=r.child,o=o!==null?o.sibling:null):o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function cc(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(oe(387));if(o=o.memoizedProps,o!==null){var l=r.type;xr(r.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(r===ex.current){if(o=r.alternate,o===null)throw Error(oe(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(xd):e=[xd])}r=r.return}return e!==null&&Zy(t,e,n,s),t.flags|=262144,e!==null}function cx(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function uc(e){$c=e,ho=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kn(e){return TE($c,e)}function a0(e,t){return $c===null&&uc(e),TE(e,t)}function TE(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ho===null){if(e===null)throw Error(oe(308));ho=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ho=ho.next=t;return n}var $V=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},AV=kn.unstable_scheduleCallback,MV=kn.unstable_NormalPriority,cn={$$typeof:zi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function E4(){return{controller:new $V,data:new Map,refCount:0}}function mh(e){e.refCount--,e.refCount===0&&AV(MV,function(){e.controller.abort()})}function k7(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];n.indexOf(s)===-1&&n.push(s)}}}var bf=null;function TV(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var qf=null,Yy=0,dc=0,wu=null;function zV(e,t){if(qf===null){var n=qf=[];Yy=0,dc=e3(),wu={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Yy++,t.then(b7,b7),t}function b7(){if(--Yy===0&&(bf=null,qf!==null)){wu!==null&&(wu.status="fulfilled");var e=qf;qf=null,dc=0,wu=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function NV(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var w7=Te.S;Te.S=function(e,t){if(K$=cr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zV(e,t),bf!==null)for(var n=fd;n!==null;)k7(n,bf),n=n.next;if(n=e.types,n!==null){for(var s=fd;s!==null;)k7(s,n),s=s.next;if(dc!==0){s=bf,s===null&&(s=bf=[]);for(var r=0;r<n.length;r++){var i=n[r];s.indexOf(i)===-1&&s.push(i)}}}w7!==null&&w7(e,t)};var ec=Ui(null);function $4(){var e=ec.current;return e!==null?e:mt.pooledCache}function V0(e,t){t===null?Et(ec,ec.current):Et(ec,t.pool)}function zE(){var e=$4();return e===null?null:{parent:cn._currentValue,pool:e}}var Rd=Error(oe(460)),A4=Error(oe(474)),Og=Error(oe(542)),ux={then:function(){}};function j7(e){return e=e.status,e==="fulfilled"||e==="rejected"}function NE(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ni,Ni),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,C7(e),e===void 0&&!("reason"in t)?Error(oe(600)):e;default:if(typeof t.status=="string")t.then(Ni,Ni);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(oe(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,C7(e),e}throw tc=t,Rd}}function ll(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(tc=n,Rd):n}}var tc=null;function S7(){if(tc===null)throw Error(oe(459));var e=tc;return tc=null,e}function C7(e){if(e===Rd||e===Og)throw Error(oe(483))}var ju=null,m1=0;function l0(e){var t=m1;return m1+=1,ju===null&&(ju=[]),NE(ju,e,t)}function Po(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function c0(e,t){throw t.$$typeof===fF?Error(oe(525)):(e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _E(e){function t(m,k){if(e){var b=m.deletions;b===null?(m.deletions=[k],m.flags|=16):b.push(k)}}function n(m,k){if(!e)return null;for(;k!==null;)t(m,k),k=k.sibling;return null}function s(m){for(var k=new Map;m!==null;)m.key===null?k.set(m.index,m):k.set(m.key,m),m=m.sibling;return k}function r(m,k){return m=yo(m,k),m.index=0,m.sibling=null,m}function i(m,k,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<k?(m.flags|=2,k):b):(m.flags|=134217730,k)):(m.flags|=1048576,k)}function o(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function l(m,k,b,j){return k===null||k.tag!==6?(k=d2(b,m.mode,j),k.return=m,k):(k=r(k,b),k.return=m,k)}function c(m,k,b,j){var A=b.type;return A===su?(m=d(m,k,b.props.children,j,b.key),Po(m,b),m):k!==null&&(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Qo&&ll(A)===k.type)?(k=r(k,b.props),Po(k,b),k.return=m,k):(k=U0(b.type,b.key,b.props,null,m.mode,j),Po(k,b),k.return=m,k)}function u(m,k,b,j){return k===null||k.tag!==4||k.stateNode.containerInfo!==b.containerInfo||k.stateNode.implementation!==b.implementation?(k=f2(b,m.mode,j),k.return=m,k):(k=r(k,b.children||[]),k.return=m,k)}function d(m,k,b,j,A){return k===null||k.tag!==7?(k=Jl(b,m.mode,j,A),k.return=m,k):(k=r(k,b),k.return=m,k)}function f(m,k,b){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=d2(""+k,m.mode,b),k.return=m,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case t0:return b=U0(k.type,k.key,k.props,null,m.mode,b),Po(b,k),b.return=m,b;case yf:return k=f2(k,m.mode,b),k.return=m,k;case Qo:return k=ll(k),f(m,k,b)}if(vf(k)||tf(k))return k=Jl(k,m.mode,b,null),k.return=m,k;if(typeof k.then=="function")return f(m,l0(k),b);if(k.$$typeof===zi)return f(m,a0(m,k),b);c0(m,k)}return null}function h(m,k,b,j){var A=k!==null?k.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return A!==null?null:l(m,k,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case t0:return b.key===A?c(m,k,b,j):null;case yf:return b.key===A?u(m,k,b,j):null;case Qo:return b=ll(b),h(m,k,b,j)}if(vf(b)||tf(b))return A!==null?null:d(m,k,b,j,null);if(typeof b.then=="function")return h(m,k,l0(b),j);if(b.$$typeof===zi)return h(m,k,a0(m,b),j);c0(m,b)}return null}function x(m,k,b,j,A){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return m=m.get(b)||null,l(k,m,""+j,A);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case t0:return m=m.get(j.key===null?b:j.key)||null,c(k,m,j,A);case yf:return m=m.get(j.key===null?b:j.key)||null,u(k,m,j,A);case Qo:return j=ll(j),x(m,k,b,j,A)}if(vf(j)||tf(j))return m=m.get(b)||null,d(k,m,j,A,null);if(typeof j.then=="function")return x(m,k,b,l0(j),A);if(j.$$typeof===zi)return x(m,k,b,a0(k,j),A);c0(k,j)}return null}function g(m,k,b,j){for(var A=null,M=null,E=k,z=k=0,T=null;E!==null&&z<b.length;z++){E.index>z?(T=E,E=null):T=E.sibling;var $=h(m,E,b[z],j);if($===null){E===null&&(E=T);break}e&&E&&$.alternate===null&&t(m,E),k=i($,k,z),M===null?A=$:M.sibling=$,M=$,E=T}if(z===b.length)return n(m,E),qe&&Yi(m,z),A;if(E===null){for(;z<b.length;z++)E=f(m,b[z],j),E!==null&&(k=i(E,k,z),M===null?A=E:M.sibling=E,M=E);return qe&&Yi(m,z),A}for(E=s(E);z<b.length;z++)T=x(E,m,z,b[z],j),T!==null&&(e&&($=T.alternate,$!==null&&E.delete($.key===null?z:$.key)),k=i(T,k,z),M===null?A=T:M.sibling=T,M=T);return e&&E.forEach(function(_){return t(m,_)}),qe&&Yi(m,z),A}function y(m,k,b,j){if(b==null)throw Error(oe(151));for(var A=null,M=null,E=k,z=k=0,T=null,$=b.next();E!==null&&!$.done;z++,$=b.next()){E.index>z?(T=E,E=null):T=E.sibling;var _=h(m,E,$.value,j);if(_===null){E===null&&(E=T);break}e&&E&&_.alternate===null&&t(m,E),k=i(_,k,z),M===null?A=_:M.sibling=_,M=_,E=T}if($.done)return n(m,E),qe&&Yi(m,z),A;if(E===null){for(;!$.done;z++,$=b.next())$=f(m,$.value,j),$!==null&&(k=i($,k,z),M===null?A=$:M.sibling=$,M=$);return qe&&Yi(m,z),A}for(E=s(E);!$.done;z++,$=b.next())$=x(E,m,z,$.value,j),$!==null&&(e&&(T=$.alternate,T!==null&&E.delete(T.key===null?z:T.key)),k=i($,k,z),M===null?A=$:M.sibling=$,M=$);return e&&E.forEach(function(R){return t(m,R)}),qe&&Yi(m,z),A}function v(m,k,b,j){if(typeof b=="object"&&b!==null&&b.type===su&&b.key===null&&b.props.ref===void 0&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case t0:e:{for(var A=b.key;k!==null;){if(k.key===A){if(A=b.type,A===su){if(k.tag===7){n(m,k.sibling),j=r(k,b.props.children),Po(j,b),j.return=m,m=j;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Qo&&ll(A)===k.type){n(m,k.sibling),j=r(k,b.props),Po(j,b),j.return=m,m=j;break e}n(m,k);break}else t(m,k);k=k.sibling}b.type===su?(j=Jl(b.props.children,m.mode,j,b.key),Po(j,b),j.return=m,m=j):(j=U0(b.type,b.key,b.props,null,m.mode,j),Po(j,b),j.return=m,m=j)}return o(m);case yf:e:{for(A=b.key;k!==null;){if(k.key===A)if(k.tag===4&&k.stateNode.containerInfo===b.containerInfo&&k.stateNode.implementation===b.implementation){n(m,k.sibling),j=r(k,b.children||[]),j.return=m,m=j;break e}else{n(m,k);break}else t(m,k);k=k.sibling}j=f2(b,m.mode,j),j.return=m,m=j}return o(m);case Qo:return b=ll(b),v(m,k,b,j)}if(vf(b))return g(m,k,b,j);if(tf(b)){if(A=tf(b),typeof A!="function")throw Error(oe(150));return b=A.call(b),y(m,k,b,j)}if(typeof b.then=="function")return v(m,k,l0(b),j);if(b.$$typeof===zi)return v(m,k,a0(m,b),j);c0(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,k!==null&&k.tag===6?(n(m,k.sibling),j=r(k,b),j.return=m,m=j):(n(m,k),j=d2(b,m.mode,j),j.return=m,m=j),o(m)):n(m,k)}return function(m,k,b,j){try{m1=0;var A=v(m,k,b,j);return ju=null,A}catch(E){if(E===Rd||E===Og)throw E;var M=_s(29,E,null,m.mode);return M.lanes=j,M.return=m,M}finally{}}}var fc=_E(!0),RE=_E(!1),Jo=!1;function M4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $a(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,nt&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=ox(e),CE(e,null,n),t}return Ig(e,s,t,n),ox(e)}function Pf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,YC(e,n)}}function p2(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Jy=!1;function Uf(){if(Jy){var e=wu;if(e!==null)throw e}}function Ff(e,t,n,s){Jy=!1;var r=e.updateQueue;Jo=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=r.baseState;o=0,d=u=c=null,l=i;do{var h=l.lane&-536870913,x=h!==l.lane;if(x?(We&h)===h:(s&h)===h){h!==0&&h===dc&&(Jy=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,y=l;h=t;var v=n;switch(y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=yt({},f,h);break e;case 2:Jo=!0}}h=l.callback,h!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[h]:x.push(h))}else x={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=x,c=f):d=d.next=x,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;x=l,l=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,i===null&&(r.shared.lanes=0),Ha|=o,e.lanes=o,e.memoizedState=f}}function IE(e,t){if(typeof e!="function")throw Error(oe(191,e));e.call(t)}function LE(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)IE(n[e],t)}var Da=Ui(null),dx=Ui(0);function E7(e,t){e=$o,Et(dx,e),Et(Da,t),$o=e|t.baseLanes}function ev(){Et(dx,$o),Et(Da,Da.current)}function T4(){$o=dx.current,Xn(Da),Xn(dx)}var Qn=Ui(null),ls=null;function Aa(e){var t=e.alternate;Et(Zn,Zn.current&1),Et(Qn,e),ls===null&&(t===null||Da.current!==null||t.memoizedState!==null)&&(ls=e)}function tv(e){Et(Zn,Zn.current),Et(Qn,e),ls===null&&(ls=e)}function OE(e){e.tag===22?(Et(Zn,Zn.current),Et(Qn,e),ls===null&&(ls=e)):Ma()}function Ma(){Et(Zn,Zn.current),Et(Qn,Qn.current)}function rr(e){Xn(Qn),ls===e&&(ls=null),Xn(Zn)}var Zn=Ui(0);function y1(e,t){Et(Qn,Qn.current),Et(Zn,t)}function z4(e){Xn(Zn),Xn(Qn),ls===e&&(ls=null)}function fx(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Iv(n)||r3(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var So=0,De=null,ht=null,ln=null,hx=!1,Su=!1,hc=!1,px=0,v1=0,Cu=null,_V=0;function Ft(){throw Error(oe(321))}function N4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function _4(e,t,n,s,r,i){return So=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Te.H=e===null||e.memoizedState===null?p$:x$,hc=!1,i=n(s,r),hc=!1,Su&&(i=BE(t,n,s,r)),DE(e),i}function DE(e){Te.H=xx;var t=ht!==null&&ht.next!==null;if(So=0,ln=ht=De=null,hx=!1,v1=0,Cu=null,t)throw Error(oe(300));e===null||dn||(e=e.dependencies,e!==null&&cx(e)&&(dn=!0))}function BE(e,t,n,s){De=e;var r=0;do{if(Su&&(Cu=null),v1=0,Su=!1,25<=r)throw Error(oe(301));if(r+=1,ln=ht=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Te.H=qV,i=t(n,s)}while(Su);return i}function RV(){var e=Te.H,t=e.useState()[0];return t=typeof t.then=="function"?yh(t):t,e=e.useState()[0],(ht!==null?ht.memoizedState:null)!==e&&(De.flags|=1024),t}function R4(){var e=px!==0;return px=0,e}function I4(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function L4(e){if(hx){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hx=!1}So=0,ln=ht=De=null,Su=!1,v1=px=0,Cu=null}function js(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?De.memoizedState=ln=e:ln=ln.next=e,ln}function Qt(){if(ht===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=ht.next;var t=ln===null?De.memoizedState:ln.next;if(t!==null)ln=t,ht=e;else{if(e===null)throw De.alternate===null?Error(oe(467)):Error(oe(310));ht=e,e={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},ln===null?De.memoizedState=ln=e:ln=ln.next=e}return ln}function Dg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yh(e){var t=v1;return v1+=1,Cu===null&&(Cu=[]),e=NE(Cu,e,t),t=De,(ln===null?t.memoizedState:ln.next)===null&&(t=t.alternate,Te.H=t===null||t.memoizedState===null?p$:x$),e}function Bg(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yh(e);if(e.$$typeof===xF)return;if(e.$$typeof===zi)return Kn(e)}throw Error(oe(438,String(e)))}function O4(e){var t=null,n=De.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=De.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Dg(),De.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=pF;return t.index++,n}function Co(e,t){return typeof t=="function"?t(e):t}function G0(e){var t=Qt();return D4(t,ht,e)}function D4(e,t,n){var s=e.queue;if(s===null)throw Error(oe(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=o=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(We&f)===f:(So&f)===f){var h=u.revertLane;if(h===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===dc&&(d=!0);else if((So&h)===h){u=u.next,h===dc&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,o=i):c=c.next=f,De.lanes|=h,Ha|=h;f=u.action,hc&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else h={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=h,o=i):c=c.next=h,De.lanes|=f,Ha|=f;u=u.next}while(u!==null&&u!==t);if(c===null?o=i:c.next=l,!xr(i,e.memoizedState)&&(dn=!0,d&&(n=wu,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function x2(e){var t=Qt(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=e(i,o.action),o=o.next;while(o!==r);xr(i,t.memoizedState)||(dn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function HE(e,t,n){var s=De,r=Qt(),i=qe;if(i){if(n===void 0)throw Error(oe(407));n=n()}else n=t();var o=!xr((ht||r).memoizedState,n);if(o&&(r.memoizedState=n,dn=!0),r=r.queue,B4(UE.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||o||ln!==null&&(ln.memoizedState.tag&1)!==0,ld(e?9:8,{destroy:void 0},PE.bind(null,s,r,n,t),null),e){if(s.flags|=2048,mt===null)throw Error(oe(349));i||So&127||qE(s,t,n)}return n}function qE(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t=Dg(),De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function PE(e,t,n,s){t.value=n,t.getSnapshot=s,FE(t)&&VE(e)}function UE(e,t,n){return n(function(){FE(t)&&VE(e)})}function FE(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function VE(e){var t=Ec(e,2);t!==null&&Is(t,e,2)}function nv(e){var t=js();if(typeof e=="function"){var n=e;if(e=n(),hc){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Co,lastRenderedState:e},t}function GE(e,t,n,s){return e.baseState=n,D4(e,ht,typeof s=="function"?s:Co)}function IV(e,t,n,s,r){if(qg(e))throw Error(oe(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};Te.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,WE(t,i)):(i.next=n.next,t.pending=n.next=i)}}function WE(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=Te.T,o={};o.types=i!==null?i.types:null,Te.T=o;try{var l=n(r,s),c=Te.S;c!==null&&c(o,l),$7(e,t,l)}catch(u){sv(e,t,u)}finally{i!==null&&o.types!==null&&(i.types=o.types),Te.T=i}}else try{i=n(r,s),$7(e,t,i)}catch(u){sv(e,t,u)}}function $7(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){A7(e,t,s)},function(s){return sv(e,t,s)}):A7(e,t,n)}function A7(e,t,n){t.status="fulfilled",t.value=n,KE(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,WE(e,n)))}function sv(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,KE(t),t=t.next;while(t!==s)}e.action=null}function KE(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function XE(e,t){return t}function M7(e,t){if(qe){var n=mt.formState;if(n!==null){e:{var s=De;if(qe){if(St){t:{for(var r=St,i=Rr;r.nodeType!==8;){if(!i){r=null;break t}if(r=Lr(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){St=Lr(r.nextSibling),s=r.data==="F!";break e}}Oa(s)}s=!1}s&&(t=n[0])}}return n=js(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XE,lastRenderedState:t},n.queue=s,n=d$.bind(null,De,s),s.dispatch=n,s=nv(!1),i=U4.bind(null,De,!1,s.queue),s=js(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=IV.bind(null,De,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function T7(e){var t=Qt();return ZE(t,ht,e)}function ZE(e,t,n){if(t=D4(e,t,XE)[0],e=G0(Co)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=yh(t)}catch(o){throw o===Rd?Og:o}else s=t;t=Qt();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(De.flags|=2048,ld(9,{destroy:void 0},LV.bind(null,r,n),null)),[s,i,e]}function LV(e,t){e.action=t}function z7(e){var t=Qt(),n=ht;if(n!==null)return ZE(t,n,e);Qt(),t=t.memoizedState,n=Qt();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function ld(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=De.updateQueue,t===null&&(t=Dg(),De.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function YE(){return Qt().memoizedState}function W0(e,t,n,s){var r=js();De.flags|=e,r.memoizedState=ld(1|t,{destroy:void 0},n,s===void 0?null:s)}function Hg(e,t,n,s){var r=Qt();s=s===void 0?null:s;var i=r.memoizedState.inst;ht!==null&&s!==null&&N4(s,ht.memoizedState.deps)?r.memoizedState=ld(t,i,n,s):(De.flags|=e,r.memoizedState=ld(1|t,i,n,s))}function N7(e,t){W0(8390656,8,e,t)}function B4(e,t){Hg(2048,8,e,t)}function OV(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=Dg(),De.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function QE(e){var t=Qt().memoizedState;return OV({ref:t,nextImpl:e}),function(){if(nt&2)throw Error(oe(440));return t.impl.apply(void 0,arguments)}}function JE(e,t){return Hg(4,2,e,t)}function e$(e,t){return Hg(4,4,e,t)}function t$(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function n$(e,t,n){n=n!=null?n.concat([e]):null,Hg(4,4,t$.bind(null,t,e),n)}function H4(){}function s$(e,t){var n=Qt();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&N4(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function r$(e,t){var n=Qt();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&N4(t,s[1]))return s[0];if(s=e(),hc){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[s,t],s}function q4(e,t,n){return n===void 0||So&1073741824&&!(We&261930)?e.memoizedState=t:(e.memoizedState=n,e=Z$(),De.lanes|=e,Ha|=e,n)}function i$(e,t,n,s){return xr(n,t)?n:Da.current!==null?(e=q4(e,n,s),xr(e,t)||(dn=!0),e):!(So&106)||So&1073741824&&!(We&261930)?(dn=!0,e.memoizedState=n):(e=Z$(),De.lanes|=e,Ha|=e,t)}function o$(e,t,n,s,r){var i=st.p;st.p=i!==0&&8>i?i:8;var o=Te.T,l={};l.types=o!==null?o.types:null,Te.T=l,U4(e,!1,t,n);try{var c=r(),u=Te.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=NV(c,s);Vf(e,t,d,fr(e))}else Vf(e,t,s,fr(e))}catch(f){Vf(e,t,{then:function(){},status:"rejected",reason:f},fr())}finally{st.p=i,o!==null&&l.types!==null&&(o.types=l.types),Te.T=o}}function DV(){}function rv(e,t,n,s){if(e.tag!==5)throw Error(oe(476));var r=a$(e).queue;o$(e,r,t,Ql,n===null?DV:function(){return l$(e),n(s)})}function a$(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ql,baseState:Ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Co,lastRenderedState:Ql},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Co,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function l$(e){var t=a$(e);t.next===null&&(t=e.alternate.memoizedState),Vf(e,t.next.queue,{},fr())}function P4(){return Kn(xd)}function c$(){return Qt().memoizedState}function u$(){return Qt().memoizedState}function BV(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fr();e=Ea(n);var s=$a(t,e,n);s!==null&&(Is(s,t,n),Pf(s,t,n)),t={cache:E4()},e.payload=t;return}t=t.return}}function HV(e,t,n){var s=fr();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qg(e)?f$(t,n):(n=j4(e,t,n,s),n!==null&&(Is(n,e,s),h$(n,t,s)))}function d$(e,t,n){var s=fr();Vf(e,t,n,s)}function Vf(e,t,n,s){var r={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qg(e))f$(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(r.hasEagerState=!0,r.eagerState=l,xr(l,o))return Ig(e,t,r,0),mt===null&&Rg(),!1}catch{}finally{}if(n=j4(e,t,r,s),n!==null)return Is(n,e,s),h$(n,t,s),!0}return!1}function U4(e,t,n,s){if(s={lane:2,revertLane:e3(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},qg(e)){if(t)throw Error(oe(479))}else t=j4(e,n,s,2),t!==null&&Is(t,e,2)}function qg(e){var t=e.alternate;return e===De||t!==null&&t===De}function f$(e,t){Su=hx=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function h$(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,YC(e,n)}}var xx={readContext:Kn,use:Bg,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft,useEffectEvent:Ft},p$={readContext:Kn,use:Bg,useCallback:function(e,t){return js().memoizedState=[e,t===void 0?null:t],e},useContext:Kn,useEffect:N7,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,W0(4194308,4,t$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return W0(4194308,4,e,t)},useInsertionEffect:function(e,t){W0(4,2,e,t)},useMemo:function(e,t){var n=js();t=t===void 0?null:t;var s=e();if(hc){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=js();if(n!==void 0){var r=n(t);if(hc){ga(!0);try{n(t)}finally{ga(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=HV.bind(null,De,e),[s.memoizedState,e]},useRef:function(e){var t=js();return e={current:e},t.memoizedState=e},useState:function(e){e=nv(e);var t=e.queue,n=d$.bind(null,De,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:H4,useDeferredValue:function(e,t){var n=js();return q4(n,e,t)},useTransition:function(){var e=nv(!1);return e=o$.bind(null,De,e.queue,!0,!1),js().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=De,r=js();if(qe){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),mt===null)throw Error(oe(349));We&127||qE(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,N7(UE.bind(null,s,i,e),[e]),s.flags|=2048,ld(9,{destroy:void 0},PE.bind(null,s,i,n,t),null),n},useId:function(){var e=js(),t=mt.identifierPrefix;if(qe){var n=Ri,s=_i;n=(s&~(1<<32-dr(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=px++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_V++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:P4,useFormState:M7,useActionState:M7,useOptimistic:function(e){var t=js();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=U4.bind(null,De,!0,n),n.dispatch=t,[e,t]},useMemoCache:O4,useCacheRefresh:function(){return js().memoizedState=BV.bind(null,De)},useEffectEvent:function(e){var t=js(),n={impl:e};return t.memoizedState=n,function(){if(nt&2)throw Error(oe(440));return n.impl.apply(void 0,arguments)}}},x$={readContext:Kn,use:Bg,useCallback:s$,useContext:Kn,useEffect:B4,useImperativeHandle:n$,useInsertionEffect:JE,useLayoutEffect:e$,useMemo:r$,useReducer:G0,useRef:YE,useState:function(){return G0(Co)},useDebugValue:H4,useDeferredValue:function(e,t){var n=Qt();return i$(n,ht.memoizedState,e,t)},useTransition:function(){var e=G0(Co)[0],t=Qt().memoizedState;return[typeof e=="boolean"?e:yh(e),t]},useSyncExternalStore:HE,useId:c$,useHostTransitionStatus:P4,useFormState:T7,useActionState:T7,useOptimistic:function(e,t){var n=Qt();return GE(n,ht,e,t)},useMemoCache:O4,useCacheRefresh:u$,useEffectEvent:QE},qV={readContext:Kn,use:Bg,useCallback:s$,useContext:Kn,useEffect:B4,useImperativeHandle:n$,useInsertionEffect:JE,useLayoutEffect:e$,useMemo:r$,useReducer:x2,useRef:YE,useState:function(){return x2(Co)},useDebugValue:H4,useDeferredValue:function(e,t){var n=Qt();return ht===null?q4(n,e,t):i$(n,ht.memoizedState,e,t)},useTransition:function(){var e=x2(Co)[0],t=Qt().memoizedState;return[typeof e=="boolean"?e:yh(e),t]},useSyncExternalStore:HE,useId:c$,useHostTransitionStatus:P4,useFormState:z7,useActionState:z7,useOptimistic:function(e,t){var n=Qt();return ht!==null?GE(n,ht,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:O4,useCacheRefresh:u$,useEffectEvent:QE};function g2(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:yt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var iv={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=fr(),r=Ea(s);r.payload=t,n!=null&&(r.callback=n),t=$a(e,r,s),t!==null&&(Is(t,e,s),Pf(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=fr(),r=Ea(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=$a(e,r,s),t!==null&&(Is(t,e,s),Pf(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fr(),s=Ea(n);s.tag=2,t!=null&&(s.callback=t),t=$a(e,s,n),t!==null&&(Is(t,e,n),Pf(t,e,n))}};function _7(e,t,n,s,r,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!p1(n,s)||!p1(r,i):!0}function R7(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&iv.enqueueReplaceState(t,t.state,null)}function pc(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=yt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function g$(e){ix(e)}function m$(e){console.error(e)}function y$(e){ix(e)}function gx(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function I7(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function ov(e,t,n){return n=Ea(n),n.tag=3,n.payload={element:null},n.callback=function(){gx(e,t)},n}function v$(e){return e=Ea(e),e.tag=3,e}function k$(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){I7(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){I7(t,n,s),typeof r!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function PV(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&cc(t,n,r,!0),n=Qn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ls===null?Sx():n.alternate===null&&Gt===0&&(Gt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===ux?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),j2(e,s,r)),!1;case 22:return n.flags|=65536,s===ux?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),j2(e,s,r)),!1}throw Error(oe(435,n.tag))}return j2(e,s,r),Sx(),!1}if(qe)return t=Qn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Ky&&(e=Error(oe(422),{cause:s}),g1(_r(e,n)))):(s!==Ky&&(t=Error(oe(423),{cause:s}),g1(_r(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=_r(s,n),r=ov(e.stateNode,s,r),p2(e,r),Gt!==4&&(Gt=2)),!1;var i=Error(oe(520),{cause:s});if(i=_r(i,n),Xf===null?Xf=[i]:Xf.push(i),Gt!==4&&(Gt=2),t===null)return!0;s=_r(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=ov(n.stateNode,s,e),p2(n,e),!1;case 1:if(t=n.type,i=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ta===null||!Ta.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=v$(r),k$(r,e,n,s),p2(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var F4=Error(oe(461)),dn=!1;function yn(e,t,n,s){t.child=e===null?RE(t,null,n,s):fc(t,e.child,n,s)}function L7(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}else o=s;return uc(t),s=_4(e,t,n,o,i,r),l=R4(),e!==null&&!dn?(I4(e,t,r),Eo(e,t,r)):(qe&&l&&Lg(t),t.flags|=1,yn(e,t,s,r),t.child)}function O7(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!S4(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,b$(e,t,i,s,r)):(e=U0(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!G4(e,r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:p1,n(o,s)&&e.ref===t.ref)return Eo(e,t,r)}return t.flags|=1,e=yo(i,s),e.ref=t.ref,e.return=t,t.child=e}function b$(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(p1(i,s)&&e.ref===t.ref)if(dn=!1,t.pendingProps=s=i,G4(e,r))e.flags&131072&&(dn=!0);else return t.lanes=e.lanes,Eo(e,t,r)}return av(e,t,n,s,r)}function w$(e,t,n,s){var r=s.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~i}else s=0,t.child=null;return D7(e,t,i,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&V0(t,i!==null?i.cachePool:null),i!==null?E7(t,i):ev(),OE(t);else return s=t.lanes=536870912,D7(e,t,i!==null?i.baseLanes|n:n,n,s)}else i!==null?(V0(t,i.cachePool),E7(t,i),Ma(),t.memoizedState=null):(e!==null&&V0(t,null),ev(),Ma());return yn(e,t,r,n),t.child}function Gf(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function D7(e,t,n,s,r){var i=$4();return i=i===null?null:{parent:cn._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&V0(t,null),ev(),OE(t),e!==null&&cc(e,t,s,!0),t.childLanes=r,null}function K0(e,t){return t=Pg({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function B7(e,t,n){return fc(t,e.child,null,n),e=K0(t,t.pendingProps),e.flags|=2,rr(t),t.memoizedState=null,e}function UV(e,t,n){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(s.mode==="hidden")return e=K0(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gf(null,e);if(tv(t),(e=St)?(e=bA(e,Rr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:_i,overflow:Ri}:null,retryLane:536870912,hydrationErrors:null},n=$E(e),n.return=t,t.child=n,In=t,St=null)):e=null,e===null)throw Oa(t);return t.lanes=536870912,null}return K0(t,s)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(tv(t),r)if(t.flags&256)t.flags&=-257,t=B7(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(oe(558));else if(dn||cc(e,t,n,!1),r=(n&e.childLanes)!==0,dn||r){if(Da.current===null){if(s=mt,s!==null&&(o=QC(s,n),o!==0&&o!==i.retryLane))throw i.retryLane=o,Ec(e,o),Is(s,e,o),F4;Sx()}t=B7(e,t,n)}else e=i.treeContext,St=Lr(o.nextSibling),In=t,qe=!0,Ca=null,Rr=!1,e!==null&&ME(t,e),t=K0(t,s),t.flags|=134221824;return t}return e=yo(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(oe(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function av(e,t,n,s,r){return uc(t),n=_4(e,t,n,s,void 0,r),s=R4(),e!==null&&!dn?(I4(e,t,r),Eo(e,t,r)):(qe&&s&&Lg(t),t.flags|=1,yn(e,t,n,r),t.child)}function H7(e,t,n,s,r,i){return uc(t),t.updateQueue=null,n=BE(t,s,n,r),DE(e),s=R4(),e!==null&&!dn?(I4(e,t,i),Eo(e,t,i)):(qe&&s&&Lg(t),t.flags|=1,yn(e,t,n,i),t.child)}function q7(e,t,n,s,r){if(uc(t),t.stateNode===null){var i=uu,o=n.contextType;typeof o=="object"&&o!==null&&(i=Kn(o)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=iv,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},M4(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?Kn(o):uu,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(g2(t,n,o,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&iv.enqueueReplaceState(i,i.state,null),Ff(t,s,i,r),Uf(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=pc(n,l);i.props=c;var u=i.context,d=n.contextType;o=uu,typeof d=="object"&&d!==null&&(o=Kn(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==o)&&R7(t,i,s,o),Jo=!1;var h=t.memoizedState;i.state=h,Ff(t,s,i,r),Uf(),u=t.memoizedState,l||h!==u||Jo?(typeof f=="function"&&(g2(t,n,f,s),u=t.memoizedState),(c=Jo||_7(t,n,c,s,h,u,o))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=o,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,Qy(e,t),o=t.memoizedProps,d=pc(n,o),i.props=d,f=t.pendingProps,h=i.context,u=n.contextType,c=uu,typeof u=="object"&&u!==null&&(c=Kn(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||h!==c)&&R7(t,i,s,c),Jo=!1,h=t.memoizedState,i.state=h,Ff(t,s,i,r),Uf();var x=t.memoizedState;o!==f||h!==x||Jo||e!==null&&e.dependencies!==null&&cx(e.dependencies)?(typeof l=="function"&&(g2(t,n,l,s),x=t.memoizedState),(d=Jo||_7(t,n,d,s,h,x,c)||e!==null&&e.dependencies!==null&&cx(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),i.props=s,i.state=x,i.context=c,s=d):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,Gc(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=fc(t,e.child,null,r),t.child=fc(t,null,n,r)):yn(e,t,n,r),t.memoizedState=i.state,e=t.child):e=Eo(e,t,r),e}function P7(e,t,n,s){return lc(),t.flags|=256,yn(e,t,n,s),t.child}var lv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cv(e){return{baseLanes:e,cachePool:zE()}}function uv(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=or),e}function j$(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(Zn.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(r?Aa(t):Ma(),(e=St)?(e=bA(e,Rr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:_i,overflow:Ri}:null,retryLane:536870912,hydrationErrors:null},n=$E(e),n.return=t,t.child=n,In=t,St=null)):e=null,e===null)throw Oa(t);return r3(e)?t.lanes=32:t.lanes=536870912,null}return i=s.children,s=s.fallback,r?(Ma(),r=t.mode,i=Pg({mode:"hidden",children:i},r),s=Jl(s,r,n,null),i.return=t,s.return=t,i.sibling=s,t.child=i,s=t.child,s.memoizedState=cv(n),s.childLanes=uv(e,o,n),t.memoizedState=lv,Gf(null,s)):(Aa(t),V4(t,i))}var l=e.memoizedState;if(l!==null){var c=l.dehydrated;if(c!==null)return FV(e,t,i,o,s,c,l,n)}return r?(Ma(),r=s.fallback,i=t.mode,l=e.child,c=l.sibling,s=yo(l,{mode:"hidden",children:s.children}),s.subtreeFlags=l.subtreeFlags&1206910976,c!==null?r=yo(c,r):(r=Jl(r,i,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,Gf(null,s),s=t.child,r=e.child.memoizedState,r===null?r=cv(n):(i=r.cachePool,i!==null?(l=cn._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=zE(),r={baseLanes:r.baseLanes|n,cachePool:i}),s.memoizedState=r,s.childLanes=uv(e,o,n),t.memoizedState=lv,Gf(e.child,s)):(Aa(t),n=e.child,e=n.sibling,n=yo(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function V4(e,t){return t=Pg({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pg(e,t){return e=_s(22,e,null,t),e.lanes=0,e}function u0(e,t,n){return fc(t,e.child,null,n),e=V4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FV(e,t,n,s,r,i,o,l){if(n)return t.flags&256?(Aa(t),t.flags&=-257,u0(e,t,l)):t.memoizedState!==null?(Ma(),t.child=e.child,t.flags|=128,null):(Ma(),i=r.fallback,o=t.mode,r=Pg({mode:"visible",children:r.children},o),i=Jl(i,o,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,fc(t,e.child,null,l),r=t.child,r.memoizedState=cv(l),r.childLanes=uv(e,s,l),t.memoizedState=lv,Gf(null,r));if(Aa(t),r3(i)){if(s=i.nextSibling&&i.nextSibling.dataset,s)var c=s.dgst;return s=c,s!==""&&(r=Error(oe(419)),r.stack="",r.digest=s,g1({value:r,source:null,stack:null})),u0(e,t,l)}if(dn||cc(e,t,l,!1),s=(l&e.childLanes)!==0,dn||s){if(Da.current!==null)return u0(e,t,l);if(s=mt,s!==null&&(r=QC(s,l),r!==0&&r!==o.retryLane))throw o.retryLane=r,Ec(e,r),Is(s,e,r),F4;return Iv(i)||Sx(),u0(e,t,l)}return Iv(i)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,St=Lr(i.nextSibling),In=t,qe=!0,Ca=null,Rr=!1,e!==null&&ME(t,e),t=V4(t,r.children),t.flags|=134221824,t)}function U7(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),F0(e.return,t,n)}function F7(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&fx(n)===null&&(t=e),e=e.sibling}return t}function d0(e,t,n,s,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=n,o.tailMode=r,o.treeForkCount=i)}function m2(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function dv(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;s=s.children;var o=Zn.current;if(t.flags&128)return y1(t,o),null;var l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,y1(t,o),r==="backwards"&&e!==null?(m2(e),yn(e,t,s,n),m2(e)):yn(e,t,s,n),s=qe?x1:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&U7(e,n,t);else if(e.tag===19)U7(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":n=F7(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,m2(t)),d0(t,!0,r,null,i,s);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&fx(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}d0(t,!0,n,null,i,s);break;case"together":d0(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:n=F7(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),d0(t,!1,r,n,i,s)}return t.child}function V7(e,t,n){var s=t.pendingProps;return ya(t,t.type,s.value),yn(e,t,s.children,n),t.child}function Eo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ha|=t.lanes,!(n&t.childLanes))if(e!==null){if(cc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=yo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function G4(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&cx(e)))}function VV(e,t,n){switch(t.tag){case 3:tx(t,t.stateNode.containerInfo),ya(t,cn,e.memoizedState.cache),lc();break;case 27:case 5:Dy(t);break;case 4:tx(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tv(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return Aa(t),t.flags|=128,null;s=cc(e,t,n,!1);var r=t.child.childLanes;return s||n&r?j$(e,t,n):(Aa(t),e=Eo(e,t,n),e!==null?e.sibling:null)}Aa(t);break;case 19:if(t.flags&128)return dv(e,t,n);if(r=(e.flags&128)!==0,s=(n&t.childLanes)!==0,s||(cc(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return dv(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),y1(t,Zn.current),s)break;return null;case 22:return t.lanes=0,w$(e,t,n,t.pendingProps);case 24:ya(t,cn,e.memoizedState.cache)}return Eo(e,t,n)}function S$(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)dn=!0;else{if(!G4(e,n)&&!(t.flags&128))return dn=!1,VV(e,t,n);dn=!!(e.flags&131072)}else dn=!1,qe&&t.flags&1048576&&AE(t,x1,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ll(t.elementType),t.type=e,typeof e=="function")S4(e)?(s=pc(e,s),t.tag=1,t=q7(null,t,e,s,n)):(t.tag=0,t=av(null,t,e,s,n));else{if(e!=null){var r=e.$$typeof;if(r===d4){t.tag=11,t=L7(null,t,e,s,n);break e}else if(r===f4){t.tag=14,t=O7(null,t,e,s,n);break e}else if(r===zi){t.tag=10,t.type=e,t=V7(null,t,n);break e}}throw t=Ly(e)||e,Error(oe(306,t,""))}}return t;case 0:return av(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=pc(s,t.pendingProps),q7(e,t,s,r,n);case 3:e:{if(tx(t,t.stateNode.containerInfo),e===null)throw Error(oe(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,Qy(e,t),Ff(t,s,null,n);var o=t.memoizedState;if(s=o.cache,ya(t,cn,s),s!==i.cache&&Zy(t,[cn],n,!0),Uf(),s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=P7(e,t,s,n);break e}else if(s!==r){r=_r(Error(oe(424)),t),g1(r),t=P7(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(St=Lr(e.firstChild),In=t,qe=!0,Ca=null,Rr=!0,n=RE(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(lc(),s===r){t=Eo(e,t,n);break e}yn(e,t,s,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=g8(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(t.stateNode=hA(t.type,t.pendingProps,Sa.current,t)):t.memoizedState=g8(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dy(t),e===null&&qe&&(s=t.stateNode=wA(t.type,t.pendingProps,Sa.current),In=t,Rr=!0,r=St,Wa(t.type)?(Lv=r,St=Lr(s.firstChild)):St=r),yn(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((r=s=St)&&(s=BG(s,t.type,t.pendingProps,Rr),s!==null?(t.stateNode=s,In=t,St=Lr(s.firstChild),Rr=!1,r=!0):r=!1),r||Oa(t)),Dy(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Nv(r,i)?s=null:o!==null&&Nv(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=_4(e,t,RV,null,null,n),xd._currentValue=r),Gc(e,t),yn(e,t,s,n),t.child;case 6:return e===null&&qe&&((e=n=St)&&(n=HG(n,t.pendingProps,Rr),n!==null?(t.stateNode=n,In=t,St=null,e=!0):e=!1),e||Oa(t)),null;case 13:return j$(e,t,n);case 4:return tx(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=fc(t,null,s,n):yn(e,t,s,n),t.child;case 11:return L7(e,t,t.type,t.pendingProps,n);case 7:return s=t.pendingProps,Gc(e,t),yn(e,t,s,n),t.child;case 8:return yn(e,t,t.pendingProps.children,n),t.child;case 12:return yn(e,t,t.pendingProps.children,n),t.child;case 10:return V7(e,t,n);case 9:return r=t.type._context,s=t.pendingProps.children,uc(t),r=Kn(r),s=s(r),t.flags|=1,yn(e,t,s,n),t.child;case 14:return O7(e,t,t.type,t.pendingProps,n);case 15:return b$(e,t,t.type,t.pendingProps,n);case 19:return dv(e,t,n);case 31:return UV(e,t,n);case 22:return w$(e,t,n,t.pendingProps);case 24:return uc(t),s=Kn(cn),e===null?(r=$4(),r===null&&(r=mt,i=E4(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},M4(t),ya(t,cn,r)):(e.lanes&n&&(Qy(e,t),Ff(t,null,null,n),Uf()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ya(t,cn,s)):(s=i.cache,ya(t,cn,s),s!==r.cache&&Zy(t,[cn],n,!0))),yn(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:qe&&Lg(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:Gc(e,t),yn(e,t,s.children,n),t.child;case 29:throw t.pendingProps}throw Error(oe(156,t.tag))}function Xi(e){e.flags|=4}function y2(e,t,n,s,r){var i;if((i=(e.mode&32)!==0)&&(i=n===null?v8(t,s):v8(t,s)&&(s.src!==n.src||s.srcSet!==n.srcSet)),i){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(J$())e.flags|=8192;else throw tc=ux,A4}else e.flags&=-16777217}function G7(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!EA(t))if(J$())e.flags|=8192;else throw tc=ux,A4}function f0(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?XC():536870912,e.lanes|=t,cd|=t)}function rf(e,t){if(!qe)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function GV(e,t,n){var s=t.pendingProps;switch(C4(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return wt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),vo(cn),id(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Bc(t)?Xi(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,h2())),wt(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(Xi(t),i!==null?(wt(t),G7(t,i)):(wt(t),y2(t,r,null,s,n))):i?i!==e.memoizedState?(Xi(t),wt(t),G7(t,i)):(wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xi(t),wt(t),y2(t,r,e,s,n)),null;case 27:if(nx(t),n=Sa.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return wt(t),t.subtreeFlags&=-33554433,null}e=Li.current,Bc(t)?v7(t):(e=wA(r,s,n),t.stateNode=e,Xi(t))}return wt(t),t.subtreeFlags&=-33554433,null;case 5:if(nx(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return wt(t),t.subtreeFlags&=-33554433,null}if(i=Li.current,Bc(t))v7(t);else{var o=w1(Sa.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof s.is=="string"?o.createElement("select",{is:s.is}):o.createElement("select"),s.multiple?i.multiple=!0:s.size&&(i.size=s.size);break;default:i=typeof s.is=="string"?o.createElement(r,{is:s.is}):o.createElement(r)}}i[Wn]=t,i[Os]=s;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(Yn(i,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Xi(t)}}return wt(t),t.subtreeFlags&=-33554433,y2(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(oe(166));if(e=Sa.current,Bc(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=In,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[Wn]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||dA(e.nodeValue,n)),e||Oa(t,!0)}else e=w1(e).createTextNode(s),e[Wn]=t,t.stateNode=e}return wt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Bc(t),n!==null){if(e===null){if(!s)throw Error(oe(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(557));e[Wn]=t}else lc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wt(t),e=!1}else n=h2(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(rr(t),t):(rr(t),null);if(t.flags&128)throw Error(oe(558))}return wt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Bc(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(oe(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(oe(317));r[Wn]=t}else lc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wt(t),r=!1}else r=h2(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(rr(t),t):(rr(t),null)}return rr(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),f0(t,t.updateQueue),wt(t),null);case 4:return id(),e===null&&t3(t.stateNode.containerInfo),t.flags|=67108864,wt(t),null;case 10:return vo(t.type),wt(t),null;case 19:if(z4(t),s=t.memoizedState,s===null)return wt(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)rf(s,!1);else{if(Gt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fx(e),i!==null){for(t.flags|=128,rf(s,!1),e=i.updateQueue,t.updateQueue=e,f0(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)EE(n,e),n=n.sibling;return y1(t,Zn.current&1|2),qe&&Yi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&cr()>wx&&(t.flags|=128,r=!0,rf(s,!1),t.lanes=4194304)}else{if(!r)if(e=fx(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,f0(t,e),rf(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!i.alternate&&!qe)return wt(t),null}else 2*cr()-s.renderingStartTime>wx&&n!==536870912&&(t.flags|=128,r=!0,rf(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(e=s.last,e!==null?e.sibling=i:t.child=i,s.last=i)}if(s.tail!==null){e=s.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=cr(),e.sibling=null,i=Zn.current,i=r?i&1|2:i&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!n||qe?y1(t,i):(n=i,Et(Qn,t),Et(Zn,n),ls===null&&(ls=t)),qe&&Yi(t,s.treeForkCount),e}return wt(t),null;case 22:case 23:return rr(t),T4(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),n=t.updateQueue,n!==null&&f0(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Xn(ec),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),vo(cn),wt(t),null;case 25:return null;case 30:return t.flags|=33554432,wt(t),null}throw Error(oe(156,t.tag))}function WV(e,t){switch(C4(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vo(cn),id(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nx(t),null;case 31:if(t.memoizedState!==null){if(rr(t),t.alternate===null)throw Error(oe(340));lc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));lc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z4(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return id(),null;case 10:return vo(t.type),null;case 22:case 23:return rr(t),T4(),e!==null&&Xn(ec),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vo(cn),null;case 25:return null;default:return null}}function C$(e,t){switch(C4(t),t.tag){case 3:vo(cn),id();break;case 26:case 27:case 5:nx(t);break;case 4:id();break;case 31:t.memoizedState!==null&&rr(t);break;case 13:rr(t);break;case 19:z4(t);break;case 10:vo(t.type);break;case 22:case 23:rr(t),T4(),e!==null&&Xn(ec);break;case 24:vo(cn)}}function vh(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,o=n.inst;s=i(),o.destroy=s}n=n.next}while(n!==r)}}catch(l){ct(t,t.return,l)}}function Ba(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var o=s.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){ct(r,c,d)}}}s=s.next}while(s!==i)}}catch(d){ct(t,t.return,d)}}function E$(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{LE(t,n)}catch(s){ct(e,e.return,s)}}}function $$(e,t,n){n.props=pc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){ct(e,t,s)}}function $i(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,i=jo(e.memoizedProps,r);(r.ref===null||r.ref.name!==i)&&(r.ref=gA(i)),s=r.ref;break;case 7:if(e.stateNode===null){var o=new yr(e);Ls(e.child,!1,OG,o,void 0,void 0),e.stateNode=o}s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(l){ct(e,t,l)}}function Gn(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){ct(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){ct(e,t,r)}else n.current=null}function mx(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)kA(e.stateNode,t[n])}function W7(e){for(var t=e.return;t!==null&&(K4(t)&&kA(e.stateNode,t.stateNode),!W4(t));)t=t.return}function Wf(e){for(var t=e.return;t!==null&&(K4(t)&&DG(e.stateNode,t.stateNode),!W4(t));)t=t.return}function W4(e){return e.tag===5||e.tag===3||e.tag===27}function K4(e){return e&&e.tag===7&&e.stateNode!==null}function fv(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){ct(e,e.return,r)}}function v2(e,t,n){try{var s=e.stateNode;vG(s,e.type,n,t),s[Os]=t}catch(r){ct(e,e.return,r)}}function A$(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wa(e.type)||e.tag===4}function k2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||A$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hv(e,t,n,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ni)),mx(e,s),et=!0;else if(r!==4&&(r===27&&(mx(e,s),s=null,Wa(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(hv(e,t,n,s),e=e.sibling;e!==null;)hv(e,t,n,s),e=e.sibling}function yx(e,t,n,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),mx(e,s),et=!0;else if(r!==4&&(r===27&&(mx(e,s),s=null,Wa(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(yx(e,t,n,s),e=e.sibling;e!==null;)yx(e,t,n,s),e=e.sibling}function M$(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Yn(t,s,n),t[Wn]=e,t[Os]=n}catch(i){ct(e,e.return,i)}}var vx=!1,ir=null;function K7(e){(e.tag===30||e.subtreeFlags&33554432)&&(vx=!0)}var Mi=null;function X7(){var e=Mi;return Mi=null,e}var Ns=0;function Id(e,t,n,s,r){return Ns=0,T$(e.child,t,n,s,r)}function T$(e,t,n,s,r){for(var i=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(s!==null){var l=_v(o);s.push(l),l.view&&(i=!0)}else i||_v(o).view&&(i=!0);vx=!0,pA(o,Ns===0?t:t+"_"+Ns,n),Ns++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||T$(e.child,t,n,s,r)&&(i=!0));e=e.sibling}return i}function Bi(e,t){for(;e!==null;)e.tag===5?xA(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Bi(e.child,t)),e=e.sibling}function X0(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(X0(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(oe(544));var n=t.name;t=No(t.default,t.share),t!=="none"&&(Id(e,n,t,null,!1)||Bi(e.child,!1))}e=e.sibling}}function pv(e,t){if(e.tag===30){var n=e.stateNode,s=e.memoizedProps,r=jo(s,n),i=No(s.default,n.paired?s.share:s.enter);i!=="none"?Id(e,r,i,null,!1)?(X0(e),n.paired||t||ud(e,s.onEnter)):Bi(e.child,!1):X0(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)pv(e,t),e=e.sibling;else X0(e)}function xv(e){if(ir!==null&&ir.size!==0){var t=ir;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,s=n.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var i=No(n.default,n.share);if(i!=="none"&&(Id(e,s,i,null,!1)?(i=e.stateNode,r.paired=i,i.paired=r,ud(e,n.onShare)):Bi(e.child,!1)),t.delete(s),t.size===0)break}}}xv(e)}e=e.sibling}}}function gv(e){if(e.tag===30){var t=e.memoizedProps,n=jo(t,e.stateNode),s=ir!==null?ir.get(n):void 0,r=No(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(Id(e,n,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,ir.delete(n),ud(e,t.onShare)):ud(e,t.onExit):Bi(e.child,!1)),ir!==null&&xv(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)gv(e),e=e.sibling;else ir!==null&&xv(e)}function z$(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=jo(t,e.stateNode);t=No(t.default,t.update),e.flags&=-5,t!=="none"&&Id(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&z$(e);e=e.sibling}}function mv(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Bi(e.child,!1))}mv(e)}e=e.sibling}}function Z0(e){if(e.tag===30)e.stateNode.paired=null,Bi(e.child,!1),mv(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Z0(e),e=e.sibling;else mv(e)}function N$(e){for(e=e.child;e!==null;)e.tag===30?Bi(e.child,!1):e.subtreeFlags&33554432&&N$(e),e=e.sibling}function X4(e,t,n,s,r,i,o){for(var l=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(i!==null&&Ns<i.length){var u=i[Ns],d=_v(c);(u.view||d.view)&&(l=!0);var f;if(f=(e.flags&4)===0)if(d.clip)f=!0;else{f=u.rect;var h=d.rect;f=f.y!==h.y||f.x!==h.x||f.height!==h.height||f.width!==h.width}f&&(e.flags|=4),d.abs?d=!u.abs:(u=u.rect,d=d.rect,d=u.height!==d.height||u.width!==d.width),d&&(e.flags|=32)}else e.flags|=32;e.flags&4&&pA(c,Ns===0?n:n+"_"+Ns,r),l&&e.flags&4||(Mi===null&&(Mi=[]),Mi.push(c,Ns===0?s:s+"_"+Ns,t.memoizedProps)),Ns++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:X4(e,t.child,n,s,r,i,o)&&(l=!0));t=t.sibling}return l}function _$(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,s=e.stateNode,r=jo(n,s),i=No(n.default,n.update),o;o=e.memoizedState,e.memoizedState=null,s=e;var l=e.child;Ns=0,r=X4(s,l,r,r,i,o,!1),e.flags&4&&r&&ud(e,n.onUpdate)}else e.subtreeFlags&33554432&&_$(e);e=e.sibling}}var zn=!1,it=!1,ui=!1,b2=!1,Z7=typeof WeakSet=="function"?WeakSet:Set,Nn=null,di=!1,wf=!1,kx=!1,yv=!1;function KV(e,t,n){if(e=e.containerInfo,Tv=gd,e=yE(e),b4(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{s.nodeType,o.nodeType}catch{s=null;break e}var l=0,c=-1,u=-1,d=0,f=0,h=e,x=null;t:for(;;){for(var g;h!==s||i!==0&&h.nodeType!==3||(c=l+i),h!==o||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(g=h.firstChild)!==null;)x=h,h=g;for(;;){if(h===e)break t;if(x===s&&++d===i&&(c=l),x===o&&++f===r&&(u=l),(g=h.nextSibling)!==null)break;h=x,x=h.parentNode}h=g}s=c===-1||u===-1?null:{start:c,end:u}}else s=null}s=s||{start:0,end:0}}else s=null;for(zv={focusedElem:e,selectionRange:s},gd=!1,n=(n&335544064)===n,Nn=t,t=n?9270:1024;Nn!==null;){if(e=Nn,n&&(s=e.deletions,s!==null))for(i=0;i<s.length;i++)n&&gv(s[i]);if(e.alternate===null&&e.flags&2)n&&K7(e),h0(n);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&n&&gv(s),h0(n);continue}else if(s!==null&&s.memoizedState!==null){n&&K7(e),h0(n);continue}}s=e.child,e.subtreeFlags&t&&s!==null?(s.return=e,Nn=s):(n&&z$(e),h0(n))}}ir=null}function h0(e){for(;Nn!==null;){var t=Nn,n=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(r&1024&&s!==null){n=void 0,r=s.memoizedProps,s=s.memoizedState;var i=t.stateNode;try{var o=pc(t.type,r);n=i.getSnapshotBeforeUpdate(o,s),i.__reactInternalSnapshotBeforeUpdate=n}catch(l){ct(t,t.return,l)}}break;case 3:if(r&1024){if(s=t.stateNode.containerInfo,n=s.nodeType,n===9)Rv(s);else if(n===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Rv(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&s!==null&&(n=jo(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=No(r.default,r.update),r!=="none"&&Id(s,n,r,s.memoizedState=[],!0));break;default:if(r&1024)throw Error(oe(163))}if(s=t.sibling,s!==null){s.return=t.return,Nn=s;break}Nn=t.return}}function R$(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:fi(e,n),s&4&&vh(5,n);break;case 1:if(fi(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){ct(n,n.return,o)}else{var r=pc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){ct(n,n.return,o)}}s&64&&E$(n),s&512&&$i(n,n.return);break;case 3:if(fi(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{LE(e,t)}catch(o){ct(n,n.return,o)}}break;case 27:t===null&&s&4&&M$(n);case 26:case 5:fi(e,n),t===null&&s&4&&fv(n),s&512&&$i(n,n.return);break;case 12:fi(e,n);break;case 31:fi(e,n),s&4&&D$(e,n);break;case 13:fi(e,n),s&4&&B$(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=oG.bind(null,n),qG(e,n))));break;case 22:if(s=n.memoizedState!==null||zn,!s){var i=t!==null&&t.memoizedState!==null||it;t=zn,r=it,zn=s,(it=i)&&!r?(s=2,n.subtreeFlags&8772&&(s|=1),Gr(e,n,s)):fi(e,n),zn=t,it=r}break;case 30:fi(e,n),s&512&&$i(n,n.return);break;case 7:s&512&&$i(n,n.return);default:fi(e,n)}}function vv(e,t){for(e=e.child;e!==null;)I$(e,t),e=e.sibling}function I$(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var s=n.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,i=e.memoizedProps.style,o=i!=null&&i.hasOwnProperty("display")?i.display:null;r.style.display=o==null||typeof o=="boolean"?"":(""+o).trim()}}catch(c){ct(e,e.return,c)}kv(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,et=!0}catch(c){ct(e,e.return,c)}break;case 18:try{var l=e.stateNode;t?u8(l,!0):u8(e.stateNode,!1)}catch(c){ct(e,e.return,c)}break;case 22:case 23:e.memoizedState===null&&vv(e,t);break;default:vv(e,t)}}function kv(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,s=t;switch(n.tag){case 4:I$(n,s);break e;case 22:n.memoizedState===null&&kv(n,s);break e;default:kv(n,s)}}e=e.sibling}}function L$(e){var t=e.alternate;t!==null&&(e.alternate=null,L$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tg(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Nt=null,Ms=!1;function Vr(e,t,n){for(n=n.child;n!==null;)O$(e,t,n),n=n.sibling}function O$(e,t,n){if(ur&&typeof ur.onCommitFiberUnmount=="function")try{ur.onCommitFiberUnmount(fh,n)}catch{}switch(n.tag){case 26:it||Gn(n,t),Vr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!it&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:it||Gn(n,t),Wf(n);var s=Nt,r=Ms;Wa(n.type)&&(Nt=n.stateNode,Ms=!1),Vr(e,t,n),jA(n.stateNode,n.type,n.memoizedProps),Nt=s,Ms=r;break;case 5:it||Gn(n,t),Wf(n);case 6:if(n.tag===6&&Wf(n),s=Nt,r=Ms,Nt=null,Vr(e,t,n),Nt=s,Ms=r,Nt!==null)if(Ms)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(n.stateNode),et=!0}catch(i){ct(n,t,i)}else try{Nt.removeChild(n.stateNode),et=!0}catch(i){ct(n,t,i)}break;case 18:Nt!==null&&(Ms?(e=Nt,c8(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),md(e)):c8(Nt,n.stateNode));break;case 4:s=Nt,r=Ms,Nt=n.stateNode.containerInfo,Ms=!0,Vr(e,t,n),Nt=s,Ms=r;break;case 0:case 11:case 14:case 15:Ba(2,n,t),it||Ba(4,n,t),Vr(e,t,n);break;case 1:it||(Gn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&$$(n,t,s)),Vr(e,t,n);break;case 21:Vr(e,t,n);break;case 22:it=(s=it)||n.memoizedState!==null,Vr(e,t,n),it=s;break;case 30:Gn(n,t),Vr(e,t,n);break;case 7:it||Gn(n,t),Vr(e,t,n);break;default:Vr(e,t,n)}}function D$(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{md(e)}catch(n){ct(t,t.return,n)}}}function B$(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{md(e)}catch(n){ct(t,t.return,n)}}function XV(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Z7),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Z7),t;default:throw Error(oe(435,e.tag))}}function p0(e,t){var n=XV(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var r=aG.bind(null,e,s);s.then(r,r)}})}function vs(e,t,n){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var i=s[r],o=e,l=t,c=l;e:for(;c!==null;){switch(c.tag){case 27:if(Wa(c.type)){Nt=c.stateNode,Ms=!1;break e}break;case 5:Nt=c.stateNode,Ms=!1;break e;case 3:case 4:Nt=c.stateNode.containerInfo,Ms=!0;break e}c=c.return}if(Nt===null)throw Error(oe(160));O$(o,l,i),Nt=null,Ms=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)H$(t,e,n),t=t.sibling}var Yr=null;function H$(e,t,n){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var i=0;i<s.length;i++){var o=s[i];o.ref.impl=o.nextImpl}vs(t,e,n),ks(e),r&4&&(Ba(3,e,e.return),vh(3,e),Ba(5,e,e.return));break;case 1:vs(t,e,n),ks(e),r&512&&(it||s===null||Gn(s,s.return)),r&64&&zn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(i=Yr,vs(t,e,n),ks(e),r&512&&(it||s===null||Gn(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null)if(zn)e.stateNode=hA(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=i.ownerDocument||i;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[xh]||s[Wn]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),Yn(s,t,n),s[Wn]=e,_n(s),t=s;break e;case"link":if(i=y8("link","href",r).get(t+(n.href||""))){for(o=0;o<i.length;o++)if(s=i[o],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}s=r.createElement(t),Yn(s,t,n),r.head.appendChild(s);break;case"meta":if(i=y8("meta","content",r).get(t+(n.content||""))){for(o=0;o<i.length;o++)if(s=i[o],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}s=r.createElement(t),Yn(s,t,n),r.head.appendChild(s);break;default:throw Error(oe(468,t))}s[Wn]=e,_n(s),t=s}e.stateNode=t}else zn||Ov(i,e.type,e.stateNode);else e.stateNode=m8(i,n,e.memoizedProps);else r!==n?(r===null?(t=s.stateNode,t===null||it||t.parentNode.removeChild(t)):r.count--,n===null?zn||Ov(i,e.type,e.stateNode):m8(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&v2(e,e.memoizedProps,s.memoizedProps);break;case 27:vs(t,e,n),ks(e),r&512&&(it||s===null||Gn(s,s.return)),s!==null&&r&4&&v2(e,e.memoizedProps,s.memoizedProps);break;case 5:if(i=ui,ui=!1,vs(t,e,n),ui=i,ks(e),r&512&&(it||s===null||Gn(s,s.return)),e.flags&32){t=e.stateNode;try{ad(t,""),et=!0}catch(d){ct(e,e.return,d)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,v2(e,t,s!==null?s.memoizedProps:t)),r&1024&&(b2=!0);break;case 6:if(vs(t,e,n),ks(e),r&4){if(e.stateNode===null)throw Error(oe(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,et=!0}catch(d){ct(e,e.return,d)}}break;case 3:if(et=!1,ep=null,i=Yr,Yr=j1(t.containerInfo),vs(t,e,n),Yr=i,ks(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{md(t.containerInfo)}catch(d){ct(e,e.return,d)}b2&&(b2=!1,q$(e)),et=!1;break;case 4:r=ui,ui=zn,s=t7(),i=Yr,Yr=j1(e.stateNode.containerInfo),vs(t,e,n),ks(e),Yr=i,et&&wf&&(kx=!0),et=s,ui=r;break;case 12:vs(t,e,n),ks(e);break;case 31:vs(t,e,n),ks(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,p0(e,t)));break;case 13:vs(t,e,n),ks(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ug=cr()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,p0(e,t)));break;case 22:i=e.memoizedState!==null,o=s!==null&&s.memoizedState!==null;var l=zn,c=it,u=ui;zn=l||i,ui=u||i,it=c||o,vs(t,e,n),it=c,ui=u,zn=l,ks(e),r&8192&&(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,!i||s===null||o||zn||it||(t=o||it,n=zn,s=it,zn=i||zn,it=t,Go(e,2),zn=n,it=s),!i&&ui||vv(e,i)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,p0(e,n))));break;case 19:vs(t,e,n),ks(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,p0(e,t)));break;case 30:r&512&&(it||s===null||Gn(s,s.return)),r=t7(),i=wf,o=(n&335544064)===n,l=e.memoizedProps,wf=o&&No(l.default,l.update)!=="none",vs(t,e,n),ks(e),o&&s!==null&&et&&(e.flags|=4),wf=i,et=r;break;case 21:break;case 7:r&512&&(it||s===null||Gn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:vs(t,e,n),ks(e)}}function ks(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(A$(s)){n=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(K4(r)){var i=r.stateNode;s===null?s=[i]:s.push(i)}if(W4(r))break;r=r.return}var o=s;if(n==null)throw Error(oe(160));switch(n.tag){case 27:var l=n.stateNode,c=k2(e);yx(e,c,l,o);break;case 5:var u=n.stateNode;n.flags&32&&(ad(u,""),n.flags&=-33);var d=k2(e);yx(e,d,u,o);break;case 3:case 4:var f=n.stateNode.containerInfo,h=k2(e);hv(e,h,f,o);break;default:throw Error(oe(161))}}catch(x){ct(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function q$(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;q$(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gd=!0,t.reset(),gd=!1),e=e.sibling}}function Hc(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)P$(t,e),t=t.sibling;else _$(t)}function P$(e,t){var n=e.alternate;if(n===null)pv(e,!1);else switch(e.tag){case 3:if(yv=di=!1,X7(),Hc(t,e),!di&&!kx){if(e=Mi,e!==null)for(var s=0;s<e.length;s+=3){n=e[s];var r=e[s+1];xA(n,e[s+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),yv=!0}Mi=null;break;case 5:Hc(t,e);break;case 4:s=di,di=!1,Hc(t,e),di&&(kx=!0),di=s;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?pv(e,!1):Hc(t,e));break;case 30:s=di,r=X7(),di=!1,Hc(t,e),di&&(e.flags|=4);var i=e.memoizedProps,o=e.stateNode;t=jo(i,o),o=jo(n.memoizedProps,o);var l=No(i.default,i.update);l==="none"?t=!1:(i=n.memoizedState,n.memoizedState=null,n=e.child,Ns=0,t=X4(e,n,t,o,l,i,!0),Ns!==(i===null?0:i.length)&&(e.flags|=32)),e.flags&4&&t?(ud(e,e.memoizedProps.onUpdate),Mi=r):r!==null&&(r.push.apply(r,Mi),Mi=r),di=e.flags&32?!0:s;break;default:Hc(t,e)}}function fi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)R$(e,t.alternate,t),t=t.sibling}function Go(e,t){for(e=e.child;e!==null;){var n=e,s=t;switch(n.tag){case 0:case 11:case 14:case 15:Ba(4,n,n.return),Go(n,s);break;case 1:Gn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&$$(n,n.return,r),Go(n,s);break;case 27:s&2&&jA(n.stateNode,n.type,n.memoizedProps);case 5:Gn(n,n.return),n.tag!==5&&n.tag!==27||Wf(n),Go(n,s);break;case 6:Wf(n);break;case 26:Gn(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||it||r.parentNode.removeChild(r),Go(n,s);break;case 22:n.memoizedState===null&&Go(n,s);break;case 30:Gn(n,n.return),Go(n,s);break;case 7:Gn(n,n.return);default:Go(n,s)}e=e.sibling}}function Gr(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,o=i.flags,l=(n&1)!==0;switch(i.tag){case 0:case 11:case 15:Gr(r,i,n),vh(4,i);break;case 1:if(Gr(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){ct(s,s.return,d)}if(s=i,r=s.updateQueue,r!==null){var c=s.stateNode;try{var u=r.shared.hiddenCallbacks;if(u!==null)for(r.shared.hiddenCallbacks=null,r=0;r<u.length;r++)IE(u[r],c)}catch(d){ct(s,s.return,d)}}l&&o&64&&E$(i),$i(i,i.return);break;case 27:n&2&&M$(i);case 5:i.tag!==5&&i.tag!==27||W7(i),Gr(r,i,n),l&&s===null&&o&4&&fv(i),$i(i,i.return);break;case 6:W7(i);break;case 26:c=i.stateNode,i.memoizedState!==null||c===null||zn||Ov(j1(c.ownerDocument),i.type,c),Gr(r,i,n),l&&s===null&&o&4&&fv(i),$i(i,i.return);break;case 12:Gr(r,i,n);break;case 31:Gr(r,i,n),l&&o&4&&D$(r,i);break;case 13:Gr(r,i,n),l&&o&4&&B$(r,i);break;case 22:i.memoizedState===null&&Gr(r,i,n),$i(i,i.return);break;case 30:Gr(r,i,n),$i(i,i.return);break;case 7:$i(i,i.return);default:Gr(r,i,n)}t=t.sibling}}function Z4(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&mh(n))}function Y4(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mh(e))}function br(e,t,n,s){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)U$(e,t,n,s),t=t.sibling;else r&&N$(t)}function U$(e,t,n,s){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Z0(t);var i=t.flags;switch(t.tag){case 0:case 11:case 15:br(e,t,n,s),i&2048&&vh(9,t);break;case 1:br(e,t,n,s);break;case 3:br(e,t,n,s),r&&yv&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),i&2048&&(i=null,t.alternate!==null&&(i=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==i&&(t.refCount++,i!=null&&mh(i)));break;case 12:if(i&2048){br(e,t,n,s),i=t.stateNode;try{var o=t.memoizedProps,l=o.id,c=o.onPostCommit;typeof c=="function"&&c(l,t.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(u){ct(t,t.return,u)}}else br(e,t,n,s);break;case 31:br(e,t,n,s);break;case 13:br(e,t,n,s);break;case 23:break;case 22:o=t.stateNode,l=t.alternate,t.memoizedState!==null?(r&&l!==null&&l.memoizedState===null&&Z0(l),o._visibility&2?br(e,t,n,s):Kf(e,t)):(r&&l!==null&&l.memoizedState!==null&&Z0(t),o._visibility&2?br(e,t,n,s):(o._visibility|=2,Wc(e,t,n,s,(t.subtreeFlags&10256)!==0||!1))),i&2048&&Z4(l,t);break;case 24:br(e,t,n,s),i&2048&&Y4(t.alternate,t);break;case 30:r&&(i=t.alternate,i!==null&&(Bi(i.child,!0),Bi(t.child,!0))),br(e,t,n,s);break;default:br(e,t,n,s)}}function Wc(e,t,n,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=n,c=s,u=o.flags;switch(o.tag){case 0:case 11:case 15:Wc(i,o,l,c,r),vh(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?Wc(i,o,l,c,r):Kf(i,o):(d._visibility|=2,Wc(i,o,l,c,r)),r&&u&2048&&Z4(o.alternate,o);break;case 24:Wc(i,o,l,c,r),r&&u&2048&&Y4(o.alternate,o);break;default:Wc(i,o,l,c,r)}t=t.sibling}}function Kf(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:Kf(n,s),r&2048&&Z4(s.alternate,s);break;case 24:Kf(n,s),r&2048&&Y4(s.alternate,s);break;default:Kf(n,s)}t=t.sibling}}var cl=8192;function sl(e,t,n){if(e.subtreeFlags&cl)for(e=e.child;e!==null;)F$(e,t,n),e=e.sibling}function F$(e,t,n){switch(e.tag){case 26:sl(e,t,n),e.flags&cl&&(e.memoizedState!==null?tW(n,Yr,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&k8(n,e)));break;case 5:sl(e,t,n),e.flags&cl&&(e=e.stateNode,(t&335544128)===t&&k8(n,e));break;case 3:case 4:var s=Yr;Yr=j1(e.stateNode.containerInfo),sl(e,t,n),Yr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cl,cl=16777216,sl(e,t,n),cl=s):sl(e,t,n));break;case 30:if(e.flags&cl&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,ir===null&&(ir=new Map),ir.set(s,r)}sl(e,t,n);break;default:sl(e,t,n)}}function V$(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function of(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nn=s,W$(s,e)}V$(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)G$(e),e=e.sibling}function G$(e){switch(e.tag){case 0:case 11:case 15:of(e),e.flags&2048&&Ba(9,e,e.return);break;case 3:of(e);break;case 12:of(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Y0(e)):of(e);break;default:of(e)}}function Y0(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nn=s,W$(s,e)}V$(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ba(8,t,t.return),Y0(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Y0(t));break;default:Y0(t)}e=e.sibling}}function W$(e,t){for(;Nn!==null;){var n=Nn;switch(n.tag){case 0:case 11:case 15:Ba(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:mh(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Nn=s;else e:for(n=e;Nn!==null;){s=Nn;var r=s.sibling,i=s.return;if(L$(s),s===n){Nn=null;break e}if(r!==null){r.return=i,Nn=r;break e}Nn=i}}}var ZV={getCacheForType:function(e){var t=Kn(cn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Kn(cn).controller.signal}},YV=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,Ge=null,We=0,ot=0,tr=null,va=!1,Ld=!1,Q4=!1,$o=0,Gt=0,Ha=0,nc=0,bx=0,or=0,cd=0,Xf=null,Ts=null,bv=!1,Ug=0,K$=0,wx=1/0,jx=null,Ta=null,Dt=0,ei=null,xc=null,Oi=0,wv=0,jv=null,X$=null,Eu=null,$u=null,Au=null,Zf=0,Q0=null;function fr(){return nt&2&&We!==0?We&-We:Te.T!==null?e3():JC()}function Z$(){if(or===0)if(!(We&536870912)||qe){var e=s0;s0<<=1,!(s0&3932160)&&(s0=262144),or=e}else or=536870912;return e=Qn.current,e!==null&&(e.flags|=32),or}function ud(e,t){if(t!=null){var n=e.stateNode,s=n.ref;s===null&&(s=n.ref=gA(jo(e.memoizedProps,n))),$u===null&&($u=[]),$u.push(t.bind(null,s))}}function Is(e,t,n){(e===mt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(dd(e,0),ka(e,We,or,!1)),ph(e,n),(!(nt&2)||e!==mt)&&(e===mt&&(!(nt&2)&&(nc|=n),Gt===4&&ka(e,We,or,!1)),Fi(e))}function Y$(e,t,n){if(nt&6)throw Error(oe(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||hh(e,t),r=s?eG(e,t):w2(e,t,!0),i=s;do{if(r===0){Ld&&!s&&ka(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!QV(n)){r=w2(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;r=Xf;var c=l.current.memoizedState.isDehydrated;if(c&&(dd(l,o).flags|=256),o=w2(l,o,!1),o!==2&&o!==6){if(Q4&&!c){l.errorRecoveryDisabledLanes|=i,nc|=i,r=4;break e}i=Ts,Ts=r,i!==null&&(Ts===null?Ts=i:Ts.push.apply(Ts,i))}r=o}if(i=!1,r!==2)continue}}if(r===1){dd(e,0),ka(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(oe(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ka(s,t,or,!va);break e;case 2:Ts=null;break;case 3:case 5:break;default:throw Error(oe(329))}if((t&62914560)===t&&(r=Ug+300-cr(),10<r)){if(ka(s,t,or,!va),Mg(s,0,!0)!==0)break e;Oi=t,s.timeoutHandle=n3(Y7.bind(null,s,n,Ts,jx,bv,t,or,nc,cd,va,i,"Throttled",-0,0),r);break e}Y7(s,n,Ts,jx,bv,t,or,nc,cd,va,i,null,-0,0)}}break}while(!0);Fi(e)}function Y7(e,t,n,s,r,i,o,l,c,u,d,f,h,x){e.timeoutHandle=-1;var g=t.subtreeFlags,y=(i&335544064)===i;if(f=null,(y||g&8192||(g&16785408)===16785408)&&(f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ni},ir=null,F$(t,i,f),y&&(g=f,y=e.containerInfo,y=(y.nodeType===9?y:y.ownerDocument).__reactViewTransition,y!=null&&(g.count++,g.waitingForViewTransition=!0,g=S1.bind(g),y.finished.then(g,g))),g=(i&62914560)===i?Ug-cr():(i&4194048)===i?K$-cr():0,g=nW(f,g),g!==null)){Oi=i,e.cancelPendingCommit=g(J7.bind(null,e,t,i,n,s,r,o,l,c,u,d,f,null,h,x)),ka(e,i,o,!u);return}J7(e,t,i,n,s,r,o,l,c,u,d,f)}function QV(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!xr(i(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ka(e,t,n,s){t=KC(e,t),t&=~bx,t&=~nc,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-dr(r),o=1<<i;s[i]=-1,r&=~o}n!==0&&ZC(e,n,t)}function Fg(){return nt&6?!0:(kh(0),!1)}function J4(){if(Ge!==null){if(ot===0)var e=Ge.return;else e=Ge,ho=$c=null,L4(e),ju=null,m1=0,e=Ge;for(;e!==null;)C$(e.alternate,e),e=e.return;Ge=null}}function dd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wG(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Oi=0,J4(),mt=e,Ge=n=yo(e.current,null),We=t,ot=0,tr=null,va=!1,Ld=hh(e,t),Q4=!1,cd=or=bx=nc=Ha=Gt=0,Ts=Xf=null,bv=!1,$o=KC(e,t),Rg(),n}function Q$(e,t){De=null,Te.H=xx,t===Rd||t===Og?(t=S7(),ot=3):t===A4?(t=S7(),ot=4):ot=t===F4?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tr=t,Ge===null&&(Gt=1,gx(e,_r(t,e.current)))}function J$(){var e=Qn.current;return e===null?!0:(We&4194048)===We?ls===null:(We&62914560)===We||We&536870912?e===ls:!1}function eA(){var e=Te.H;return Te.H=xx,e===null?xx:e}function tA(){var e=Te.A;return Te.A=ZV,e}function Sx(){Gt=4,va||(We&4194048)!==We&&Qn.current!==null||(Ld=!0),!(Ha&134217727)&&!(nc&134217727)||mt===null||ka(mt,We,or,!1)}function w2(e,t,n){var s=nt;nt|=2;var r=eA(),i=tA();(mt!==e||We!==t)&&(jx=null,dd(e,t)),t=!1;var o=Gt;e:do try{if(ot!==0&&Ge!==null){var l=Ge,c=tr;switch(ot){case 8:J4(),o=6;break e;case 3:case 2:case 9:case 6:Qn.current===null&&(t=!0);var u=ot;if(ot=0,tr=null,hu(e,l,c,u),n&&Ld){o=0;break e}break;default:u=ot,ot=0,tr=null,hu(e,l,c,u)}}JV(),o=Gt;break}catch(d){Q$(e,d)}while(!0);return t&&e.shellSuspendCounter++,ho=$c=null,nt=s,Te.H=r,Te.A=i,Ge===null&&(mt=null,We=0,Rg()),o}function JV(){for(;Ge!==null;)nA(Ge)}function eG(e,t){var n=nt;nt|=2;var s=eA(),r=tA();mt!==e||We!==t?(jx=null,wx=cr()+500,dd(e,t)):Ld=hh(e,t);e:do try{if(ot!==0&&Ge!==null){t=Ge;var i=tr;t:switch(ot){case 1:ot=0,tr=null,hu(e,t,i,1);break;case 2:case 9:if(j7(i)){ot=0,tr=null,Q7(t);break}t=function(){ot!==2&&ot!==9||mt!==e||(ot=7),Fi(e)},i.then(t,t);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:j7(i)?(ot=0,tr=null,Q7(t)):(ot=0,tr=null,hu(e,t,i,7));break;case 5:var o=null;switch(Ge.tag){case 26:o=Ge.memoizedState;case 5:case 27:var l=Ge;if(o?EA(o):l.stateNode.complete){ot=0,tr=null;var c=l.sibling;if(c!==null)Ge=c;else{var u=l.return;u!==null?(Ge=u,Vg(u)):Ge=null}break t}}ot=0,tr=null,hu(e,t,i,5);break;case 6:ot=0,tr=null,hu(e,t,i,6);break;case 8:J4(),Gt=6;break e;default:throw Error(oe(462))}}tG();break}catch(d){Q$(e,d)}while(!0);return ho=$c=null,Te.H=s,Te.A=r,nt=n,Ge!==null?0:(mt=null,We=0,Rg(),Gt)}function tG(){for(;Ge!==null&&!yF();)nA(Ge)}function nA(e){var t=S$(e.alternate,e,$o);e.memoizedProps=e.pendingProps,t===null?Vg(e):Ge=t}function Q7(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=H7(n,t,t.pendingProps,t.type,void 0,We);break;case 11:t=H7(n,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:L4(t);var s=t;s===In&&(qe?(lx(s),s.tag===5&&s.stateNode!=null&&(St=s.stateNode)):(lx(s),qe=!0));default:C$(n,t),t=Ge=EE(t,$o),t=S$(n,t,$o)}e.memoizedProps=e.pendingProps,t===null?Vg(e):Ge=t}function hu(e,t,n,s){ho=$c=null,L4(t),ju=null,m1=0;var r=t.return;try{if(PV(e,r,t,n,We)){Gt=1,gx(e,_r(n,e.current)),Ge=null;return}}catch(i){if(r!==null)throw Ge=r,i;Gt=1,gx(e,_r(n,e.current)),Ge=null;return}t.flags&32768?(qe||s===1?e=!0:Ld||We&536870912?e=!1:(va=e=!0,(s===2||s===9||s===3||s===6)&&(s=Qn.current,s!==null&&s.tag===13&&(s.flags|=16384))),sA(t,e)):Vg(t)}function Vg(e){var t=e;do{if(t.flags&32768){sA(t,va);return}e=t.return;var n=GV(t.alternate,t,$o);if(n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Gt===0&&(Gt=5)}function sA(e,t){do{var n=WV(e.alternate,e);if(n!==null){n.flags&=32767,Ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=n}while(e!==null);Gt=6,Ge=null}function J7(e,t,n,s,r,i,o,l,c,u,d,f){e.cancelPendingCommit=null;do Gg();while(Dt!==0);if(nt&6)throw Error(oe(327));if(t!==null){if(t===e.current)throw Error(oe(177));e===mt&&(Ge=mt=null,We=0),xc=t,ei=e,Oi=n,jv=r,X$=s,nG(e,t,n,o,l,c,f)}}function nG(e,t,n,s,r,i,o){var l=t.lanes|t.childLanes;if(wv=l,l|=w4,AF(e,n,l,s,r,i),$u=null,(n&335544064)===n?(Au=TV(e),s=10262):(Au=null,s=10256),t.subtreeFlags&s||t.flags&s?(e.callbackNode=null,e.callbackPriority=0,lG(sx,function(){return $v(),null})):(e.callbackNode=null,e.callbackPriority=0),vx=!1,s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Te.T,Te.T=null,r=st.p,st.p=2,i=nt,nt|=4;try{KV(e,t,n)}finally{nt=i,st.p=r,Te.T=s}}Dt=1,vx?Eu=AG(o,e.containerInfo,Au,Sv,Cv,rG,Ev,$v,sG):(Sv(),Cv(),Ev())}function sG(e){if(Dt!==0){var t=ei.onRecoverableError;t(e,{componentStack:null})}}function rG(){Dt===3&&(Dt=0,P$(xc,ei),Dt=4)}function Sv(){if(Dt===1){Dt=0;var e=ei,t=xc,n=Oi,s=(t.flags&13878)!==0;if(t.subtreeFlags&13878||s){s=Te.T,Te.T=null;var r=st.p;st.p=2;var i=nt;nt|=4;try{wf=kx=!1,H$(t,e,n),n=zv;var o=yE(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&mE(l.ownerDocument.documentElement,l)){if(c!==null&&b4(l)){var u=c.start,d=c.end;if(d===void 0&&(d=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(d,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var x=h.getSelection(),g=l.textContent.length,y=Math.min(c.start,g),v=c.end===void 0?y:Math.min(c.end,g);!x.extend&&y>v&&(o=v,v=y,y=o);var m=x7(l,y),k=x7(l,v);if(m&&k&&(x.rangeCount!==1||x.anchorNode!==m.node||x.anchorOffset!==m.offset||x.focusNode!==k.node||x.focusOffset!==k.offset)){var b=f.createRange();b.setStart(m.node,m.offset),x.removeAllRanges(),y>v?(x.addRange(b),x.extend(k.node,k.offset)):(b.setEnd(k.node,k.offset),x.addRange(b))}}}}for(f=[],x=l;x=x.parentNode;)x.nodeType===1&&f.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var j=f[l];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}gd=!!Tv,zv=Tv=null}finally{nt=i,st.p=r,Te.T=s}}e.current=t,Dt=2}}function Cv(){if(Dt===2){Dt=0;var e=ei,t=xc,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Te.T,Te.T=null;var s=st.p;st.p=2;var r=nt;nt|=4;try{R$(e,t.alternate,t)}finally{nt=r,st.p=s,Te.T=n}}Dt=3}}function Ev(){if(Dt===4||Dt===3){Dt=0;var e=Eu;Eu=null,vF();var t=ei,n=xc,s=Oi,r=X$,i=(s&335544064)===s?10262:10256;if(n.subtreeFlags&i||n.flags&i?Dt=5:(Dt=0,xc=ei=null,rA(t,t.pendingLanes)),i=t.pendingLanes,i===0&&(Ta=null),x4(s),n=n.stateNode,ur&&typeof ur.onCommitFiberRoot=="function")try{ur.onCommitFiberRoot(fh,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=Te.T,i=st.p,st.p=2,Te.T=null;try{for(var o=t.onRecoverableError,l=0;l<r.length;l++){var c=r[l];o(c.value,{componentStack:c.stack})}}finally{Te.T=n,st.p=i}}if(r=$u,o=Au,Au=null,r!==null&&($u=null,o===null&&(o=[]),e!==null))for(c=0;c<r.length;c++)n=(0,r[c])(o),n!==void 0&&e.finished.finally(n);Oi&3&&Gg(),Fi(t),i=t.pendingLanes,s&261930&&i&42?t===Q0?Zf++:(Zf=0,Q0=t):(Zf=0,Q0=null),kh(0)}}function rA(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mh(t)))}function Gg(){return Eu!==null&&(Eu.skipTransition(),Eu=null),Sv(),Cv(),Ev(),$v()}function $v(){if(Dt!==5)return!1;var e=ei,t=wv;wv=0;var n=x4(Oi),s=Te.T,r=st.p;try{st.p=32>n?32:n,Te.T=null,n=jv,jv=null;var i=ei,o=Oi;if(Dt=0,xc=ei=null,Oi=0,nt&6)throw Error(oe(331));var l=nt;if(nt|=4,G$(i.current),U$(i,i.current,o,n),nt=l,kh(0,!1),ur&&typeof ur.onPostCommitFiberRoot=="function")try{ur.onPostCommitFiberRoot(fh,i)}catch{}return!0}finally{st.p=r,Te.T=s,rA(e,t)}}function e8(e,t,n){t=_r(n,t),t=ov(e.stateNode,t,2),e=$a(e,t,2),e!==null&&(ph(e,2),Fi(e))}function ct(e,t,n){if(e.tag===3)e8(e,e,n);else for(;t!==null;){if(t.tag===3){e8(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ta===null||!Ta.has(s))){e=_r(n,e),n=v$(2),s=$a(t,n,2),s!==null&&(k$(n,s,t,e),ph(s,2),Fi(s));break}}t=t.return}}function j2(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new YV;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(Q4=!0,r.add(n),e=iG.bind(null,e,t,n),t.then(e,e))}function iG(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,mt===e&&(We&n)===n&&(Gt===4||Gt===3&&(We&62914560)===We&&300>cr()-Ug?nt&2?bx|=n:dd(e,0):bx|=n,cd===We&&(cd=0)),Fi(e)}function iA(e,t){t===0&&(t=XC()),e=Ec(e,t),e!==null&&(ph(e,t),Fi(e))}function oG(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),iA(e,n)}function aG(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(oe(314))}s!==null&&s.delete(t),iA(e,n)}function lG(e,t){return h4(e,t)}var fd=null,Kc=null,Av=!1,Cx=!1,S2=!1,ba=0;function Fi(e){e!==Kc&&e.next===null&&(Kc===null?fd=Kc=e:Kc=Kc.next=e),Cx=!0,Av||(Av=!0,uG())}function kh(e,t){if(!S2&&Cx){S2=!0;do for(var n=!1,s=fd;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var o=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-dr(42|e)+1)-1,i&=r&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,t8(s,i))}else i=We,i=Mg(s,s===mt?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||hh(s,i)||(n=!0,t8(s,i));s=s.next}while(n);S2=!1}}function cG(){oA()}function oA(){Cx=Av=!1;var e=0;ba!==0&&bG()&&(e=ba);for(var t=cr(),n=null,s=fd;s!==null;){var r=s.next,i=aA(s,t);i===0?(s.next=null,n===null?fd=r:n.next=r,r===null&&(Kc=n)):(n=s,(e!==0||i&3)&&(Cx=!0)),s=r}Dt!==0&&Dt!==5||kh(e),ba!==0&&(ba=0)}function aA(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-dr(i),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=$F(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=mt,n=We,n=Mg(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&t2(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||hh(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&t2(s),x4(n)){case 2:case 8:n=GC;break;case 32:n=sx;break;case 268435456:n=WC;break;default:n=sx}return s=lA.bind(null,e),n=h4(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&t2(s),e.callbackPriority=2,e.callbackNode=null,2}function lA(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gg()&&e.callbackNode!==n)return null;var s=We;return s=Mg(e,e===mt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Y$(e,s,t),aA(e,cr()),e.callbackNode!=null&&e.callbackNode===n?lA.bind(null,e):null)}function t8(e,t){if(Gg())return null;Y$(e,t,!0)}function uG(){jG(function(){nt&6?h4(VC,cG):oA()})}function e3(){if(ba===0){var e=dc;e===0&&(e=n0,n0<<=1,!(n0&261888)&&(n0=256)),ba=e}return ba}function n8(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:H0(e)}function dG(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=n8((r[Os]||null).action),o=s.submitter;o&&(t=(t=o[Os]||null)?n8(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new zg("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ba!==0){var c=new FormData(r,o);rv(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=new FormData(r,o),rv(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var C2=0;C2<Wy.length;C2++){var E2=Wy[C2],fG=E2.toLowerCase(),hG=E2[0].toUpperCase()+E2.slice(1);ri(fG,"on"+hG)}ri(kE,"onAnimationEnd");ri(bE,"onAnimationIteration");ri(wE,"onAnimationStart");ri("dblclick","onDoubleClick");ri("focusin","onFocus");ri("focusout","onBlur");ri(wV,"onTransitionRun");ri(jV,"onTransitionStart");ri(SV,"onTransitionCancel");ri(jE,"onTransitionEnd");od("onMouseEnter",["mouseout","mouseover"]);od("onMouseLeave",["mouseout","mouseover"]);od("onPointerEnter",["pointerout","pointerover"]);od("onPointerLeave",["pointerout","pointerover"]);Sc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var k1="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),pG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(k1));function cA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){ix(d)}r.currentTarget=null,i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){ix(d)}r.currentTarget=null,i=c}}}}function Ve(e,t){var n=t[Y6];n===void 0&&(n=t[Y6]=new Set);var s=e+"__bubble";n.has(s)||(uA(t,e,2,!1),n.add(s))}function $2(e,t,n){var s=0;t&&(s|=4),uA(n,e,s,t)}var x0="_reactListening"+Math.random().toString(36).slice(2);function t3(e){if(!e[x0]){e[x0]=!0,tE.forEach(function(n){n!=="selectionchange"&&(pG.has(n)||$2(n,!1,e),$2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[x0]||(t[x0]=!0,$2("selectionchange",!1,t))}}function uA(e,t,n,s){switch(_A(t)){case 2:var r=oW;break;case 8:r=aW;break;default:r=l3}n=r.bind(null,t,n,e),r=void 0,!Uy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function A2(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=El(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){s=i=o;continue e}l=l.parentNode}}s=s.return}cE(function(){var u=i,d=m4(n),f=[];e:{var h=SE.get(e);if(h!==void 0){var x=zg,g=e;switch(e){case"keypress":if(P0(n)===0)break e;case"keydown":case"keyup":x=QF;break;case"focusin":g="focus",x=a2;break;case"focusout":g="blur",x=a2;break;case"beforeblur":case"afterblur":x=a2;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=i7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=HF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=sV;break;case kE:case bE:case wE:x=UF;break;case jE:x=iV;break;case"scroll":case"scrollend":x=DF;break;case"wheel":x=aV;break;case"copy":case"cut":case"paste":x=VF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=a7;break;case"submit":x=tV;break;case"toggle":case"beforetoggle":x=cV}var y=(t&4)!==0,v=!y&&(e==="scroll"||e==="scrollend"),m=y?h!==null?h+"Capture":null:h;y=[];for(var k=u,b;k!==null;){var j=k;if(b=j.stateNode,j=j.tag,j!==5&&j!==26&&j!==27||b===null||m===null||(j=f1(k,m),j!=null&&y.push(b1(k,j,b))),v)break;k=k.return}0<y.length&&(h=new x(h,g,null,n,d),f.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",x&&n!==Py&&(g=n.relatedTarget||n.fromElement)&&(El(g)||g[Nd]))break e;(h||x)&&(g=d.window===d?d:(x=d.ownerDocument)?x.defaultView||x.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=u,x=x?El(x):null,x!==null&&(v=dh(x),y=x.tag,x!==v||y!==5&&y!==27&&y!==6)&&(x=null)):(h=null,x=u),h!==x&&(y=i7,j="onMouseLeave",m="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(y=a7,j="onPointerLeave",m="onPointerEnter",k="pointer"),v=h==null?g:kf(h),b=x==null?g:kf(x),g=new y(j,k+"leave",h,n,d),g.target=v,g.relatedTarget=b,j=null,El(d)===u&&(y=new y(m,k+"enter",x,n,d),y.target=b,y.relatedTarget=v,j=y),v=j,y=h&&x?Ty(h,x,xG):null,h!==null&&s8(f,g,h,y,!1),x!==null&&v!==null&&s8(f,v,x,y,!0)))}e:{if(h=u?kf(u):window,x=h.nodeName&&h.nodeName.toLowerCase(),x==="select"||x==="input"&&h.type==="file")var A=d7;else if(u7(h))if(xE)A=vV;else{A=mV;var M=gV}else x=h.nodeName,!x||x.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&g4(u.elementType)&&(A=d7):A=yV;if(A&&(A=A(e,u))){pE(f,A,n,d);break e}M&&M(e,h,u)}switch(M=u?kf(u):window,e){case"focusin":(u7(M)||M.contentEditable==="true")&&(au=M,Vy=u,Hf=null);break;case"focusout":Hf=Vy=au=null;break;case"mousedown":Gy=!0;break;case"contextmenu":case"mouseup":case"dragend":Gy=!1,g7(f,n,d);break;case"selectionchange":if(bV)break;case"keydown":case"keyup":g7(f,n,d)}var E;if(k4)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else ou?fE(e,n)&&(z="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(dE&&n.locale!=="ko"&&(ou||z!=="onCompositionStart"?z==="onCompositionEnd"&&ou&&(E=uE()):(ma=d,y4="value"in ma?ma.value:ma.textContent,ou=!0)),M=Ex(u,z),0<M.length&&(z=new o7(z,e,null,n,d),f.push({event:z,listeners:M}),E?z.data=E:(E=hE(n),E!==null&&(z.data=E)))),(E=dV?fV(e,n):hV(e,n))&&(z=Ex(u,"onBeforeInput"),0<z.length&&(M=new o7("onBeforeInput","beforeinput",null,n,d),f.push({event:M,listeners:z}),M.data=E)),dG(f,e,u,n,d)}cA(f,t)})}function b1(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ex(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=f1(e,n),r!=null&&s.unshift(b1(e,r,i)),r=f1(e,t),r!=null&&s.push(b1(e,r,i))),e.tag===3)return s;e=e.return}return[]}function xG(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function s8(e,t,n,s,r){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=f1(n,i),u!=null&&o.unshift(b1(n,u,c))):r||(u=f1(n,i),u!=null&&o.push(b1(n,u,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gG=/\r\n?/g,mG=/\u0000|\uFFFD/g;function r8(e){return(typeof e=="string"?e:""+e).replace(gG,`
190
- `).replace(mG,"")}function dA(e,t){return t=r8(t),r8(e)===t}function at(e,t,n,s,r,i){switch(n){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||ad(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&ad(e,""+s);else return;break;case"className":i0(e,"class",s);break;case"tabIndex":i0(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":i0(e,n,s);break;case"style":lE(e,s,i);return;case"data":if(t!=="object"){i0(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=H0(s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&at(e,t,"name",r.name,r,null),at(e,t,"formEncType",r.formEncType,r,null),at(e,t,"formMethod",r.formMethod,r,null),at(e,t,"formTarget",r.formTarget,r,null)):(at(e,t,"encType",r.encType,r,null),at(e,t,"method",r.method,r,null),at(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=H0(s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Ni);return;case"onScroll":s!=null&&Ve("scroll",e);return;case"onScrollEnd":s!=null&&Ve("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));(i!=null?i.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=H0(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),B0(e,"popover",s);break;case"xlinkActuate":Ki(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ki(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ki(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ki(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ki(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ki(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ki(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ki(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ki(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":B0(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=LF.get(n)||n,B0(e,n,s);else return}et=!0}function Mv(e,t,n,s,r,i){switch(n){case"style":lE(e,s,i);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));(i!=null?i.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof s=="string")ad(e,s);else if(typeof s=="number"||typeof s=="bigint")ad(e,""+s);else return;break;case"onScroll":s!=null&&Ve("scroll",e);return;case"onScrollEnd":s!=null&&Ve("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Ni);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!nE.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),i=n.slice(2,r?n.length-7:void 0),t=e[Os]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(i,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(i,s,r);break e}et=!0,n in e?e[n]=s:s===!0?e.setAttribute(n,""):B0(e,n,s)}return}et=!0}function Yn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:at(e,t,i,o,n,null)}}r&&at(e,t,"srcSet",n.srcSet,n,null),s&&at(e,t,"src",n.src,n,null);return;case"input":Ve("invalid",e);var l=i=o=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"name":r=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(oe(137,t));break;default:at(e,t,s,d,n,null)}}iE(e,i,l,c,u,o,r,!1);return;case"select":Ve("invalid",e),s=o=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:at(e,t,r,l,n,null)}t=i,n=o,e.multiple=!!s,t!=null?ku(e,!!s,t,!1):n!=null&&ku(e,!!s,n,!0);return;case"textarea":Ve("invalid",e),i=r=s=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(oe(91));break;default:at(e,t,o,l,n,null)}aE(e,s,r,i);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:at(e,t,c,s,n,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(s=0;s<k1.length;s++)Ve(k1[s],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:at(e,t,u,s,n,null)}return;default:if(g4(t)){for(d in n)n.hasOwnProperty(d)&&(s=n[d],s!==void 0&&Mv(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&at(e,t,l,s,n,null))}var yG={};function vG(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,o=null,l=null,c=null,u=null,d=null;for(x in n){var f=n[x];if(n.hasOwnProperty(x)&&f!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=f;default:s.hasOwnProperty(x)||at(e,t,x,null,s,f)}}for(var h in s){var x=s[h];if(f=n[h],s.hasOwnProperty(h)&&(x!=null||f!=null))switch(h){case"type":x!==f&&(et=!0),i=x;break;case"name":x!==f&&(et=!0),r=x;break;case"checked":x!==f&&(et=!0),u=x;break;case"defaultChecked":x!==f&&(et=!0),d=x;break;case"value":x!==f&&(et=!0),o=x;break;case"defaultValue":x!==f&&(et=!0),l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(oe(137,t));break;default:x!==f&&at(e,t,h,x,s,f)}}qy(e,o,l,c,u,d,i,r);return;case"select":x=o=l=h=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(i)||at(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":i!==c&&(et=!0),h=i;break;case"defaultValue":i!==c&&(et=!0),l=i;break;case"multiple":i!==c&&(et=!0),o=i;default:i!==c&&at(e,t,r,i,s,c)}t=l,n=o,s=x,h!=null?ku(e,!!n,h,!1):!!s!=!!n&&(t!=null?ku(e,!!n,t,!0):ku(e,!!n,n?[]:"",!1));return;case"textarea":x=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:at(e,t,l,null,s,r)}for(o in s)if(r=s[o],i=n[o],s.hasOwnProperty(o)&&(r!=null||i!=null))switch(o){case"value":r!==i&&(et=!0),h=r;break;case"defaultValue":r!==i&&(et=!0),x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(oe(91));break;default:r!==i&&at(e,t,o,r,s,i)}oE(e,h,x);return;case"option":for(var g in n)if(h=n[g],n.hasOwnProperty(g)&&h!=null&&!s.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:at(e,t,g,null,s,h)}for(c in s)if(h=s[c],x=n[c],s.hasOwnProperty(c)&&h!==x&&(h!=null||x!=null))switch(c){case"selected":h!==x&&(et=!0),e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:at(e,t,c,h,s,x)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!=null&&!s.hasOwnProperty(y)&&at(e,t,y,null,s,h);for(u in s)if(h=s[u],x=n[u],s.hasOwnProperty(u)&&h!==x&&(h!=null||x!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(oe(137,t));break;default:at(e,t,u,h,s,x)}return;default:if(g4(t)){for(var v in n)h=n[v],n.hasOwnProperty(v)&&h!==void 0&&!s.hasOwnProperty(v)&&Mv(e,t,v,void 0,s,h);for(d in s)h=s[d],x=n[d],!s.hasOwnProperty(d)||h===x||h===void 0&&x===void 0||Mv(e,t,d,h,s,x);return}}for(var m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!s.hasOwnProperty(m)&&at(e,t,m,null,s,h);for(f in s)h=s[f],x=n[f],!s.hasOwnProperty(f)||h===x||h==null&&x==null||at(e,t,f,h,s,x)}function i8(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kG(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var r=n[s],i=r.transferSize,o=r.initiatorType,l=r.duration;if(i&&l&&i8(o)){for(o=0,l=r.responseEnd,s+=1;s<n.length;s++){var c=n[s],u=c.startTime;if(u>l)break;var d=c.transferSize,f=c.initiatorType;d&&i8(f)&&(c=c.responseEnd,o+=d*(c<l?1:(l-u)/(c-u)))}if(--s,t+=8*(i+o)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tv=null,zv=null;function w1(e){return e.nodeType===9?e:e.ownerDocument}function o8(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fA(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function hA(e,t,n,s){return n=w1(n).createElement(e),n[Wn]=s,n[Os]=t,Yn(n,e,t),_n(n),n}function Nv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var M2=null;function bG(){var e=window.event;return e&&e.type==="popstate"?e===M2?!1:(M2=e,!0):(M2=null,!1)}var n3=typeof setTimeout=="function"?setTimeout:void 0,wG=typeof clearTimeout=="function"?clearTimeout:void 0,a8=typeof Promise=="function"?Promise:void 0,l8=typeof requestAnimationFrame=="function"?requestAnimationFrame:n3,jG=typeof queueMicrotask=="function"?queueMicrotask:typeof a8<"u"?function(e){return a8.resolve(null).then(e).catch(SG)}:n3;function SG(e){setTimeout(function(){throw e})}function Wa(e){return e==="head"}function c8(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(r),md(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")z2(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,z2(n);for(var i=n.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[xh]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}else n==="body"&&z2(e.ownerDocument.body);n=r}while(n);md(t)}function u8(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function pA(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var i=t[r];0<i.width&&0<i.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function xA(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function CG(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function _v(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return CG(t,n,e)}function EG(e){return e.documentElement.clientHeight}function $G(e){this.addEventListener("load",e),this.addEventListener("error",e)}function AG(e,t,n,s,r,i,o,l,c){var u=t.nodeType===9?t:t.ownerDocument;try{var d=u.startViewTransition({update:function(){var h=u.defaultView,x=h.navigation&&h.navigation.transition,g=u.fonts.status;s();var y=[];if(g==="loaded"&&(EG(u),u.fonts.status==="loading"&&y.push(u.fonts.ready)),g=y.length,e!==null)for(var v=e.suspenseyImages,m=0,k=0;k<v.length;k++){var b=v[k];if(!b.complete){var j=b.getBoundingClientRect();if(0<j.bottom&&0<j.right&&j.top<h.innerHeight&&j.left<h.innerWidth){if(m+=$A(b),m>tp){y.length=g;break}b=new Promise($G.bind(b)),y.push(b)}}}if(0<y.length)return h=Promise.race([Promise.all(y),new Promise(function(A){return setTimeout(A,500)})]).then(r,r),(x?Promise.allSettled([x.finished,h]):h).then(i,i);if(r(),x)return x.finished.then(i,i);i()},types:n});u.__reactViewTransition=d;var f=[];return d.ready.then(function(){for(var h=u.documentElement.getAnimations({subtree:!0}),x=0;x<h.length;x++){var g=h[x],y=g.effect,v=y.pseudoElement;if(v!=null&&v.startsWith("::view-transition")){f.push(g),g=y.getKeyframes();for(var m=v=void 0,k=!0,b=0;b<g.length;b++){var j=g[b],A=j.width;if(v===void 0)v=A;else if(v!==A){k=!1;break}if(A=j.height,m===void 0)m=A;else if(m!==A){k=!1;break}delete j.width,delete j.height,j.transform==="none"&&delete j.transform}k&&v!==void 0&&m!==void 0&&(y.setKeyframes(g),k=getComputedStyle(y.target,y.pseudoElement),k.width!==v||k.height!==m)&&(k=g[0],k.width=v,k.height=m,k=g[g.length-1],k.width=v,k.height=m,y.setKeyframes(g))}}o()},function(h){u.__reactViewTransition===d&&(u.__reactViewTransition=null);try{if(typeof h=="object"&&h!==null)switch(h.name){case"InvalidStateError":(h.message==="View transition was skipped because document visibility state is hidden."||h.message==="Skipping view transition because document visibility state has become hidden."||h.message==="Skipping view transition because viewport size changed."||h.message==="Transition was aborted because of invalid state")&&(h=null)}h!==null&&c(h)}finally{s(),r(),o()}}),d.finished.finally(function(){for(var h=0;h<f.length;h++)f[h].cancel();u.__reactViewTransition===d&&(u.__reactViewTransition=null),l()}),d}catch{return s(),r(),o(),null}}function $l(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}$l.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:yt({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};$l.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),s=[],r=0;r<n.length;r++){var i=n[r].effect;i!==null&&i.target===e&&i.pseudoElement===t&&s.push(n[r])}return s};$l.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function gA(e){return{name:e,group:new $l("group",e),imagePair:new $l("image-pair",e),old:new $l("old",e),new:new $l("new",e)}}function yr(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}yr.prototype.addEventListener=function(e,t,n){var s=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(s=n.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var i=this._eventListeners;if(mA(i,e,t,n)===-1){var o=this,l=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(l=function(c){o.removeEventListener(e,t,n),typeof t=="function"?t.call(this,c):t.handleEvent(c)}),s!==null&&(r=o.removeEventListener.bind(o,e,t,n),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=hd(n),i.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:l,cleanup:r}),Ls(this._fragmentFiber.child,!1,MG,e,l,s)}this._eventListeners=i}};function MG(e,t,n,s){return vn(e).addEventListener(t,n,s),!1}yr.prototype.removeEventListener=function(e,t,n){var s=this._eventListeners;if(s!==null&&(t=mA(s,e,t,n),t!==-1)){var r=s[t];n=r.attachedListener;var i=r.cleanup;r=hd(r.optionsOrUseCapture),Ls(this._fragmentFiber.child,!1,TG,e,n,r),s.splice(t,1),i!==null&&i()}};function TG(e,t,n,s){return vn(e).removeEventListener(t,n,s),!1}function hd(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function d8(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function mA(e,t,n,s){if(e.length===0)return-1;s=d8(s);for(var r=0;r<e.length;r++){var i=e[r];if(i.type===t&&i.listener===n&&d8(i.optionsOrUseCapture)===s)return r}return-1}yr.prototype.dispatchEvent=function(e){var t=jc(this._fragmentFiber);if(t===null)return!0;t=vn(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var i=n[r];s.addEventListener(i.type,i.attachedListener,hd(i.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),n)for(r=0;r<n.length;r++)i=n[r],s.removeEventListener(i.type,i.attachedListener,hd(i.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};yr.prototype.focus=function(e){Ls(this._fragmentFiber.child,!0,yA,e,void 0,void 0)};function yA(e,t){return e.tag===6?!1:(e=vn(e),PG(e,t))}yr.prototype.focusLast=function(e){var t=[];Ls(this._fragmentFiber.child,!0,s3,t,void 0,void 0);for(var n=t.length-1;0<=n&&!yA(t[n],e);n--);};function s3(e,t){return t.push(e),!1}yr.prototype.blur=function(){var e=jc(this._fragmentFiber);e!==null&&(e=vn(e),e=w1(e).activeElement,e!==null&&Ls(this._fragmentFiber.child,!1,zG,e,void 0,void 0))};function zG(e,t){return e.tag===6?!1:(e=vn(e),e===t||e.contains(t)?(t.blur(),!0):!1)}yr.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Ls(this._fragmentFiber.child,!1,NG,e,void 0,void 0)};function NG(e,t){return e.tag===6||(e=vn(e),t.observe(e)),!1}yr.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Ls(this._fragmentFiber.child,!1,_G,e,void 0,void 0);for(var n=t=0;n<Qr.length;n++){var s=Qr[n];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):Qr[t++]=s}Qr.length=t}};function _G(e,t){return e.tag===6||(e=vn(e),t.unobserve(e)),!1}var Qr=[],T2=!1;function RG(e,t,n){Qr.push({fragmentInstance:e,observer:t,instance:n}),T2||(T2=!0,UG(function(){T2=!1;var s=Qr;Qr=[];for(var r=0;r<s.length;r++){var i=s[r];i.observer.unobserve(i.instance)}}))}yr.prototype.getClientRects=function(){var e=[];return Ls(this._fragmentFiber.child,!1,IG,e,void 0,void 0),e};function IG(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=vn(e),t.push.apply(t,e.getClientRects());return!1}yr.prototype.getRootNode=function(e){var t=jc(this._fragmentFiber);return t===null?this:vn(t).getRootNode(e)};yr.prototype.compareDocumentPosition=function(e){var t=jc(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];Ls(this._fragmentFiber.child,!1,s3,n,void 0,void 0);var s=vn(t);if(n.length===0){if(n=s,V6(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var r=s=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=qC(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=vn(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=vn(n[0]),r=vn(n[n.length-1]);var i=V6(this._fragmentFiber)?t.parentElement:s;if(i==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=i.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,i=i.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),l=r.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||l&Node.DOCUMENT_POSITION_CONTAINED_BY;return l=s&&i&&o&Node.DOCUMENT_POSITION_FOLLOWING&&l&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||i&&r===e||c||l?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!i&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||LG(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function LG(e,t,n,s,r){var i=El(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!i)e:{for(;i!==null;){if(i.tag===7&&(i===t||i.alternate===t)){n=!0;break e}i=i.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(i===null)return i=r.ownerDocument,r===i||r===i.documentElement||r===i.body;e:{for(i=t,t=jc(t);i!==null;){if(!(i.tag!==5&&i.tag!==3&&i.tag!==27||i!==t&&i.alternate!==t)){i=!0;break e}i=i.return}i=!1}return i}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!i)&&!(t=i===n)&&(t=Ty(n,i,G6),t===null?t=!1:(Ls(t,!0,uF,i,n),i=nu,nu=null,t=i!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!i)&&!(t=i===s)&&(t=Ty(s,i,G6),t===null?t=!1:(Ls(t,!0,dF,i,s),i=nu,My=nu=null,t=i!==null)),t):!1}function f8(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}yr.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(oe(566));var t=[];Ls(this._fragmentFiber.child,!1,s3,t,void 0,void 0);var n=e!==!1;if(t.length===0){var s=qC(this._fragmentFiber);if(s=n?s[1]||s[0]||jc(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=vn(s),f8(e,n);return}if(s=vn(s),s.nodeType!==9){if(s.nodeType===11){n="host"in s?s.host:null,n!==null&&n.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=n?t.length-1:0;s!==(n?-1:t.length);){var r=t[s];r.tag===6?(r=vn(r),f8(r,n)):vn(r).scrollIntoView(e),s+=n?-1:1}};function OG(e,t){return e=vn(e),vA(e,t),!1}function vA(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function kA(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];e.addEventListener(r.type,r.attachedListener,hd(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(i){for(var o=0,l=0;l<Qr.length;l++){var c=Qr[l];(c.fragmentInstance!==t||c.observer!==i||c.instance!==e)&&(Qr[o++]=c)}Qr.length=o,i.observe(e)}),vA(e,t))}function DG(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];e.removeEventListener(r.type,r.attachedListener,hd(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(i){typeof i.rootMargin=="string"?RG(t,i,e):i.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Rv(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Rv(n),Tg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function BG(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[xh])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Lr(e.nextSibling),e===null)break}return null}function HG(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Lr(e.nextSibling),e===null))return null;return e}function bA(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Lr(e.nextSibling),e===null))return null;return e}function Iv(e){return e.data==="$?"||e.data==="$~"}function r3(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qG(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Lv=null;function h8(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Lr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function p8(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function PG(e,t){function n(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return s}function UG(e){l8(function(){l8(function(t){return e(t)})})}function wA(e,t,n){switch(t=w1(n),e){case"html":if(e=t.documentElement,!e)throw Error(oe(452));return e;case"head":if(e=t.head,!e)throw Error(oe(453));return e;case"body":if(e=t.body,!e)throw Error(oe(454));return e;default:throw Error(oe(451))}}function jA(e,t,n){for(var s in n){var r=n[s];n.hasOwnProperty(s)&&r!=null&&at(e,t,s,null,yG,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Ni&&(e.onclick=null),Tg(e)}function z2(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tg(e)}var Dr=new Map,x8=new Set;function j1(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var _o=st.d;st.d={f:FG,r:VG,D:GG,C:WG,L:KG,m:XG,X:YG,S:ZG,M:QG};function FG(){var e=_o.f(),t=Fg();return e||t}function VG(e){var t=_d(e);t!==null&&t.tag===5&&t.type==="form"?l$(t):_o.r(e)}var Od=typeof document>"u"?null:document;function SA(e,t,n){var s=Od;if(s&&typeof t=="string"&&t){var r=Nr(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),x8.has(r)||(x8.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),Yn(t,"link",e),_n(t),s.head.appendChild(t)))}}function GG(e){_o.D(e),SA("dns-prefetch",e,null)}function WG(e,t){_o.C(e,t),SA("preconnect",e,t)}function KG(e,t,n){_o.L(e,t,n);var s=Od;if(s&&e&&t){var r='link[rel="preload"][as="'+Nr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Nr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Nr(n.imageSizes)+'"]')):r+='[href="'+Nr(e)+'"]';var i=r;switch(t){case"style":i=pd(e);break;case"script":i=Dd(e)}if(!(Dr.has(i)||(e=yt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Dr.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(bh(i))||t==="script"&&s.querySelector(wh(i))))){var o=s.createElement("link");Yn(o,"link",e),t==="style"&&(o[rx]=!0,o.onload=o.onerror=function(){eE(o)}),_n(o),s.head.appendChild(o)}}}function XG(e,t){_o.m(e,t);var n=Od;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Nr(s)+'"][href="'+Nr(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Dd(e)}if(!Dr.has(i)&&(e=yt({rel:"modulepreload",href:e},t),Dr.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wh(i)))return}s=n.createElement("link"),Yn(s,"link",e),_n(s),n.head.appendChild(s)}}}function ZG(e,t,n){_o.S(e,t,n);var s=Od;if(s&&e){var r=vu(s).hoistableStyles,i=pd(e);t=t||"default";var o=r.get(i);if(!o){var l={loading:0,preload:null};if(o=s.querySelector(bh(i)))l.loading=5;else{e=yt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Dr.get(i))&&i3(e,n);var c=o=s.createElement("link");_n(c),Yn(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,J0(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(i,o)}}}function YG(e,t){_o.X(e,t);var n=Od;if(n&&e){var s=vu(n).hoistableScripts,r=Dd(e),i=s.get(r);i||(i=n.querySelector(wh(r)),i||(e=yt({src:e,async:!0},t),(t=Dr.get(r))&&o3(e,t),i=n.createElement("script"),_n(i),Yn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function QG(e,t){_o.M(e,t);var n=Od;if(n&&e){var s=vu(n).hoistableScripts,r=Dd(e),i=s.get(r);i||(i=n.querySelector(wh(r)),i||(e=yt({src:e,async:!0,type:"module"},t),(t=Dr.get(r))&&o3(e,t),i=n.createElement("script"),_n(i),Yn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function g8(e,t,n,s){var r=(r=Sa.current)?j1(r):null;if(!r)throw Error(oe(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=pd(n.href),t=vu(r).hoistableStyles,s=t.get(n),s||(s={type:"style",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=pd(n.href);var i=vu(r).hoistableStyles,o=i.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=r.querySelector(bh(e)))?i._p||(o.instance=i,o.state.loading=5):(i=Dr.get(e),i||(i={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Dr.set(e,i)),JG(r,e,i,o.state))),t&&s===null)throw Error(oe(528,""));return o}if(t&&s!==null)throw Error(oe(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Dd(n),t=vu(r).hoistableScripts,s=t.get(n),s||(s={type:"script",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(oe(444,e))}}function pd(e){return'href="'+Nr(e)+'"'}function bh(e){return'link[rel="stylesheet"]['+e+"]"}function CA(e){return yt({},e,{"data-precedence":e.precedence,precedence:null})}function JG(e,t,n,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rx]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[rx]=!0,t.onload=t.onerror=eE.bind(null,t),Yn(t,"link",n),_n(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Dd(e){return'[src="'+Nr(e)+'"]'}function wh(e){return"script[async]"+e}function m8(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Nr(n.href)+'"]');if(s)return t.instance=s,_n(s),s;var r=yt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),_n(s),Yn(s,"style",r),J0(s,n.precedence,e),t.instance=s;case"stylesheet":r=pd(n.href);var i=e.querySelector(bh(r));if(i)return t.state.loading|=4,t.instance=i,_n(i),i;s=CA(n),(r=Dr.get(r))&&i3(s,r),i=(e.ownerDocument||e).createElement("link"),_n(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Yn(i,"link",s),t.state.loading|=4,J0(i,n.precedence,e),t.instance=i;case"script":return i=Dd(n.src),(r=e.querySelector(wh(i)))?(t.instance=r,_n(r),r):(s=n,(r=Dr.get(i))&&(s=yt({},n),o3(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),_n(r),Yn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(oe(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,J0(s,n.precedence,e));return t.instance}function J0(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,o=0;o<s.length;o++){var l=s[o];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function i3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function o3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ep=null;function y8(e,t,n){if(ep===null){var s=new Map,r=ep=new Map;r.set(n,s)}else r=ep,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[xh]||i[Wn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=s.get(o);l?l.push(i):s.set(o,[i])}}return s}function Ov(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function eW(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function v8(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function EA(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function $A(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function k8(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=$A(t),e.suspenseyImages.push(t)),e=sW.bind(e),t.decode().then(e,e))}function tW(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=pd(s.href),i=t.querySelector(bh(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=S1.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,_n(i);return}i=t.ownerDocument||t,s=CA(s),(r=Dr.get(r))&&i3(s,r),i=i.createElement("link"),_n(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Yn(i,"link",s),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=S1.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var tp=0;function nW(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*kG());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function AA(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)np(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function S1(){this.count--,AA(this)}function sW(){this.imgCount--,AA(this)}var $x=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$x=new Map,t.forEach(rW,e),$x=null,S1.call(e))}function rW(e,t){if(!(t.state.loading&4)){var n=$x.get(e);if(n)var s=n.get(null);else{n=new Map,$x.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var o=r[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),i=n.get(o)||s,i===s&&n.set(null,r),n.set(o,r),this.count++,s=S1.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var xd={$$typeof:zi,Provider:null,Consumer:null,_currentValue:Ql,_currentValue2:Ql,_threadCount:0};function iW(e,t,n,s,r,i,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=n2(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=n2(0),this.hiddenUpdates=n2(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function MA(e,t,n,s,r,i,o,l,c,u,d,f){return e=new iW(e,t,n,o,c,u,d,f,l),t=1,i===!0&&(t|=24),i=_s(3,null,null,t),e.current=i,i.stateNode=e,t=E4(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},M4(i),e}function TA(e){return e?(e=uu,e):uu}function zA(e,t,n,s,r,i){r=TA(r),s.context===null?s.context=r:s.pendingContext=r,s=Ea(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=$a(e,s,t),n!==null&&(Is(n,e,t),Pf(n,e,t))}function b8(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function a3(e,t){b8(e,t),(e=e.alternate)&&b8(e,t)}function NA(e){if(e.tag===13||e.tag===31){var t=Ec(e,67108864);t!==null&&Is(t,e,67108864),a3(e,67108864)}}function w8(e){if(e.tag===13||e.tag===31){var t=fr();t=p4(t);var n=Ec(e,t);n!==null&&Is(n,e,t),a3(e,t)}}var gd=!0;function oW(e,t,n,s){var r=Te.T;Te.T=null;var i=st.p;try{st.p=2,l3(e,t,n,s)}finally{st.p=i,Te.T=r}}function aW(e,t,n,s){var r=Te.T;Te.T=null;var i=st.p;try{st.p=8,l3(e,t,n,s)}finally{st.p=i,Te.T=r}}function l3(e,t,n,s){if(gd){var r=Dv(s);if(r===null)A2(e,t,s,Ax,n),j8(e,s);else if(cW(r,e,t,n,s))s.stopPropagation();else if(j8(e,s),t&4&&-1<lW.indexOf(e)){for(;r!==null;){var i=_d(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=al(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-dr(o);l.entanglements[1]|=c,o&=~c}Fi(i),!(nt&6)&&(wx=cr()+500,kh(0))}}break;case 31:case 13:l=Ec(i,2),l!==null&&Is(l,i,2),Fg(),a3(i,2)}if(i=Dv(s),i===null&&A2(e,t,s,Ax,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else A2(e,t,s,null,n)}}function Dv(e){return e=m4(e),c3(e)}var Ax=null;function c3(e){if(Ax=null,e=El(e),e!==null){var t=dh(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=DC(t),e!==null)return e;e=null}else if(n===31){if(e=BC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ax=e,null}function _A(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(kF()){case VC:return 2;case GC:return 8;case sx:case bF:return 32;case WC:return 268435456;default:return 32}default:return 32}}var Bv=!1,za=null,Na=null,_a=null,C1=new Map,E1=new Map,na=[],lW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function j8(e,t){switch(e){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":_a=null;break;case"pointerover":case"pointerout":C1.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":E1.delete(t.pointerId)}}function af(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=_d(t),t!==null&&NA(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function cW(e,t,n,s,r){switch(t){case"focusin":return za=af(za,e,t,n,s,r),!0;case"dragenter":return Na=af(Na,e,t,n,s,r),!0;case"mouseover":return _a=af(_a,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return C1.set(i,af(C1.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,E1.set(i,af(E1.get(i)||null,e,t,n,s,r)),!0}return!1}function RA(e){var t=El(e.target);if(t!==null){var n=dh(t);if(n!==null){if(t=n.tag,t===13){if(t=DC(n),t!==null){e.blockedOn=t,Z6(e.priority,function(){w8(n)});return}}else if(t===31){if(t=BC(n),t!==null){e.blockedOn=t,Z6(e.priority,function(){w8(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dv(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Py=s,n.target.dispatchEvent(s),Py=null}else return t=_d(n),t!==null&&NA(t),e.blockedOn=n,!1;t.shift()}return!0}function S8(e,t,n){sp(e)&&n.delete(t)}function uW(){Bv=!1,za!==null&&sp(za)&&(za=null),Na!==null&&sp(Na)&&(Na=null),_a!==null&&sp(_a)&&(_a=null),C1.forEach(S8),E1.forEach(S8)}function g0(e,t){e.blockedOn===t&&(e.blockedOn=null,Bv||(Bv=!0,kn.unstable_scheduleCallback(kn.unstable_NormalPriority,uW)))}var m0=null;function C8(e){m0!==e&&(m0=e,kn.unstable_scheduleCallback(kn.unstable_NormalPriority,function(){m0===e&&(m0=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(c3(s||n)===null)continue;break}var i=_d(n);i!==null&&(e.splice(t,3),t-=3,rv(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function md(e){function t(c){return g0(c,e)}za!==null&&g0(za,e),Na!==null&&g0(Na,e),_a!==null&&g0(_a,e),C1.forEach(t),E1.forEach(t);for(var n=0;n<na.length;n++){var s=na[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<na.length&&(n=na[0],n.blockedOn===null);)RA(n),n.blockedOn===null&&na.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],o=r[Os]||null;if(typeof i=="function")o||C8(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,o=i[Os]||null)l=o.formAction;else if(c3(r)!==null)continue}else l=o.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),C8(n)}}}function IA(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function u3(e){this._internalRoot=e}Wg.prototype.render=u3.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));var n=t.current,s=fr();zA(n,s,e,t,null,null)};Wg.prototype.unmount=u3.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zA(e.current,2,null,e,null,null),Fg(),t[Nd]=null}};function Wg(e){this._internalRoot=e}Wg.prototype.unstable_scheduleHydration=function(e){if(e){var t=JC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<na.length&&t!==0&&t<na[n].priority;n++);na.splice(n,0,e),n===0&&RA(e)}};var E8=LC.version;if(E8!=="19.3.0")throw Error(oe(527,E8,"19.3.0"));st.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=cF(t),e=e!==null?HC(e):null,e=e===null?null:e.stateNode,e};var dW={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var y0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!y0.isDisabled&&y0.supportsFiber)try{fh=y0.inject(dW),ur=y0}catch{}}Ag.createRoot=function(e,t){if(!OC(e))throw Error(oe(299));var n=!1,s="",r=g$,i=m$,o=y$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=MA(e,1,!1,null,null,n,s,null,r,i,o,IA),e[Nd]=t.current,t3(e),new u3(t)};Ag.hydrateRoot=function(e,t,n){if(!OC(e))throw Error(oe(299));var s=!1,r="",i=g$,o=m$,l=y$,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=MA(e,1,!0,t,n??null,s,r,c,i,o,l,IA),t.context=TA(null),n=t.current,s=fr(),s=p4(s),r=Ea(s),r.callback=null,$a(n,r,s),n=s,t.current.lanes=n,ph(t,n),Fi(t),e[Nd]=t.current,t3(e),new Wg(t)};Ag.version="19.3.0";function LA(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(LA)}catch(e){console.error(e)}}LA(),_C.exports=Ag;var OA=_C.exports;let Zs=null,$8=null;const A8=["data-theme",zs("theme")];function fW(e){const t=()=>{let s=null;for(const r of A8){const i=document.documentElement.getAttribute(r);i==null?e.removeAttribute(r):(e.setAttribute(r,i),r==="data-theme"&&(s=i))}s==="light"||s==="dark"?e.style.colorScheme=s:e.style.removeProperty("color-scheme")};t(),new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:[...A8]})}function hW(){if(Zs)return Zs;if(typeof document>"u")throw new Error("useToast: Cannot create fallback viewport during SSR. Wrap your app with <LayerProvider> or <AppShell>.");p5();const e=document.createElement("div");e.setAttribute("data-astryx-toast-fallback",""),document.body.appendChild(e),fW(e);let t;const n=new Promise(o=>{t=o}),s=()=>{const o=p.use(xg),l=p.useRef(!1);return p.useEffect(()=>{o&&!l.current&&(l.current=!0,Zs=o,t==null||t(o))},[o]),null};$8=OA.createRoot(e),$8.render(a.jsx(gg,{children:a.jsx(s,{})}));const r=[],i={addToast:o=>{Zs&&Zs!==i?Zs.addToast(o):(r.push(o),n.then(l=>{for(const c of r)l.addToast(c);r.length=0}))},removeToast:(o,l)=>{Zs&&Zs!==i&&Zs.removeToast(o,l)},findByUniqueID:o=>{if(Zs&&Zs!==i)return Zs.findByUniqueID(o)}};return Zs=i,i}let pW=0;function xW(){return`astryx-toast-${++pW}`}function jh(){const e=p.use(xg);return p.useCallback(n=>{const s=e??hW(),r=xW(),i={id:r,options:n,createdAt:Date.now()};return s.addToast(i),()=>s.removeToast(r,"manual")},[e])}const N2={base:{k1xSpc:"x1rg5ohu",kaIpWk:"x16rqkct",kmuXW:"x2lah0s",kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",$$css:!0},pulsing:{kKVMdj:"x1mta51n",k44tkh:"x1c74tu6",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},reducedMotion:{kjO2d4:"x1aquc0h",$$css:!0}},gW={success:{kWkggS:"xdsz4j9",$$css:!0},warning:{kWkggS:"x1q8g9m5",$$css:!0},error:{kWkggS:"x1pjz0fi",$$css:!0},accent:{kWkggS:"x1ewilqj",$$css:!0},neutral:{kWkggS:"x1q5y3ey",$$css:!0}};function Hi({variant:e,label:t,isPulsing:n=!1,tooltip:s,xstyle:r,className:i,style:o,ref:l,...c}){const u=a.jsx("span",{ref:l,role:"img","aria-label":t,...ee(J("statusdot",{variant:e}),W(N2.base,gW[e],n&&N2.pulsing,n&&N2.reducedMotion,r),i,o),...c});return s?a.jsx(Pi,{content:s,children:u}):u}Hi.displayName="StatusDot";/**
191
- * @license lucide-react v1.52.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const mW=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
196
- * @license lucide-react v1.52.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */function yW(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:mW(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
201
- * @license lucide-react v1.52.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const vW=e=>{let t="",n=!1;for(const s of e){if(s==="-"||s==="_"||s<=" "){n=t.length>0;continue}t.length===0?t+=s.toLowerCase():t+=n?s.toUpperCase():s,n=!1}return t};/**
206
- * @license lucide-react v1.52.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const kW=e=>{const t=vW(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
211
- * @license lucide-react v1.52.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const Hv=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
216
- * @license lucide-react v1.52.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const rl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
221
- * @license lucide-react v1.52.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */function _2(e){return e!=null}function bW(e,t={}){var h,x;const n=t.attributeNames??{},s=g=>n[g]??g,r=e.size??e.width??rl.width,i=e.size??e.height??rl.height,o=((h=e.aliases)==null?void 0:h.filter(g=>typeof g=="string"&&g.trim()!=="").map(g=>`lucide-${g}`))??[],l=[...e.name?[`lucide-${e.name}`]:[],...o],c=((x=t.className)==null?void 0:x.split(" ").filter(Boolean))??[],u=t.includeDefaultClasses===!1?Hv(...c):Hv("lucide",...l,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??rl["stroke-width"])*Number(e.size??e.width??rl.width)/Number(t.size??t.width??rl.width):t.strokeWidth??rl["stroke-width"];return["svg",{...Object.entries(rl).reduce((g,[y,v])=>(g[s(y)]=v,g),{}),..."color"in t&&t.color&&{[s("stroke")]:t.color},..."size"in t&&_2(t.size)&&{[s("width")]:t.size,[s("height")]:t.size},..."width"in t&&_2(t.width)&&{[s("width")]:t.width},..."height"in t&&_2(t.height)&&{[s("height")]:t.height},[s("stroke-width")]:d,...u&&{[s("class")]:u},[s("viewBox")]:`0 0 ${r} ${i}`,...t.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(g=>{const[y,v,m]=g,k=t.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...v}:v;return m?[y,k,m]:[y,k]})]}/**
226
- * @license lucide-react v1.52.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */function wW(e,t={}){return bW(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
231
- * @license lucide-react v1.52.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const jW=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},SW=p.createContext({}),CW=()=>p.useContext(SW),EW=p.forwardRef(({color:e,size:t,width:n,height:s,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:c,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...f},h)=>{const{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:y=!1,nonScalingStroke:v=!1,color:m="currentColor",className:k=""}=CW()??{},b=!!c||jW(f),[j,A,M=[]]=wW(d,{color:e??m,width:n??t??x,height:s??t??x,strokeWidth:r??g,absoluteStrokeWidth:i??y,nonScalingStroke:o??v,className:Hv(k,l),hasA11yProp:b,attributes:f});return p.createElement(j,{ref:h,...A},[...M.map(([E,z])=>p.createElement(E,z)),...Array.isArray(c)?c:[c]])});/**
236
- * @license lucide-react v1.52.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */function pt(e,t=[],n=[]){const s=typeof e=="string"?yW(e,t,n):e,r=p.forwardRef(({className:i,...o},l)=>p.createElement(EW,{ref:l,icon:s,className:i,...o}));return s.name&&(r.displayName=kW(s.name)),r}/**
241
- * @license lucide-react v1.52.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const DA={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};DA.node;const $W=pt(DA);/**
246
- * @license lucide-react v1.52.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const BA={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};BA.node;const AW=pt(BA);/**
251
- * @license lucide-react v1.52.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const HA={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};HA.node;const MW=pt(HA);/**
256
- * @license lucide-react v1.52.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const qA={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};qA.node;const TW=pt(qA);/**
261
- * @license lucide-react v1.52.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const PA={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};PA.node;const zW=pt(PA);/**
266
- * @license lucide-react v1.52.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const UA={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};UA.node;const NW=pt(UA);/**
271
- * @license lucide-react v1.52.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const FA={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};FA.node;const _W=pt(FA);/**
276
- * @license lucide-react v1.52.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const VA={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};VA.node;const RW=pt(VA);/**
281
- * @license lucide-react v1.52.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const GA={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};GA.node;const IW=pt(GA);/**
286
- * @license lucide-react v1.52.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const WA={name:"chevrons-left",size:24,node:[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]};WA.node;const LW=pt(WA);/**
291
- * @license lucide-react v1.52.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const KA={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};KA.node;const OW=pt(KA);/**
296
- * @license lucide-react v1.52.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const XA={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};XA.node;const DW=pt(XA);/**
301
- * @license lucide-react v1.52.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const ZA={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};ZA.node;const BW=pt(ZA);/**
306
- * @license lucide-react v1.52.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const YA={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};YA.node;const HW=pt(YA);/**
311
- * @license lucide-react v1.52.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const QA={name:"columns-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],aliases:["columns"]};QA.node;const qW=pt(QA);/**
316
- * @license lucide-react v1.52.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const JA={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};JA.node;const PW=pt(JA);/**
321
- * @license lucide-react v1.52.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const eM={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};eM.node;const UW=pt(eM);/**
326
- * @license lucide-react v1.52.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const tM={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};tM.node;const FW=pt(tM);/**
331
- * @license lucide-react v1.52.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const nM={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};nM.node;const VW=pt(nM);/**
336
- * @license lucide-react v1.52.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const sM={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};sM.node;const GW=pt(sM);/**
341
- * @license lucide-react v1.52.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const rM={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};rM.node;const WW=pt(rM);/**
346
- * @license lucide-react v1.52.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const iM={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};iM.node;const KW=pt(iM);/**
351
- * @license lucide-react v1.52.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const oM={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};oM.node;const XW=pt(oM);/**
356
- * @license lucide-react v1.52.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const aM={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};aM.node;const ZW=pt(aM);/**
361
- * @license lucide-react v1.52.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const lM={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};lM.node;const YW=pt(lM);/**
366
- * @license lucide-react v1.52.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const cM={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};cM.node;const QW=pt(cM);/**
371
- * @license lucide-react v1.52.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const uM={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};uM.node;const JW=pt(uM);/**
376
- * @license lucide-react v1.52.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const dM={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};dM.node;const eK=pt(dM);var ft={size:"1em","aria-hidden":!0},tK={close:a.jsx(eK,{...ft}),chevronDown:a.jsx(_W,{...ft}),chevronLeft:a.jsx(RW,{...ft}),chevronRight:a.jsx(IW,{...ft}),chevronsLeft:a.jsx(LW,{...ft}),chevronsRight:a.jsx(OW,{...ft}),check:a.jsx(NW,{...ft}),success:a.jsx(DW,{...ft}),error:a.jsx(BW,{...ft}),warning:a.jsx(QW,{...ft}),info:a.jsx(WW,{...ft}),calendar:a.jsx(TW,{...ft}),clock:a.jsx(HW,{...ft}),externalLink:a.jsx(FW,{...ft}),menu:a.jsx(KW,{...ft}),moreHorizontal:a.jsx(UW,{...ft}),search:a.jsx(ZW,{...ft}),arrowUp:a.jsx(MW,{...ft}),arrowDown:a.jsx($W,{...ft}),arrowsUpDown:a.jsx(AW,{...ft}),funnel:a.jsx(GW,{...ft}),eyeSlash:a.jsx(VW,{...ft}),viewColumns:a.jsx(qW,{...ft}),copy:a.jsx(PW,{...ft}),checkDouble:a.jsx(zW,{...ft}),wrench:a.jsx(JW,{...ft}),stop:a.jsx(YW,{...ft}),microphone:a.jsx(XW,{...ft})};const nK={name:"neutral",__built:!0,tokens:{"--font-size-4xs":"0.375rem","--font-size-3xs":"0.4375rem","--font-size-2xs":"0.5rem","--font-size-xs":"0.625rem","--font-size-sm":"0.75rem","--font-size-base":"0.875rem","--font-size-lg":"1.0625rem","--font-size-xl":"1.25rem","--font-size-2xl":"1.5rem","--font-size-3xl":"1.8125rem","--font-size-4xl":"2.1875rem","--font-size-5xl":"2.625rem","--text-heading-1-size":"var(--font-size-2xl)","--text-heading-1-weight":"var(--font-weight-semibold)","--text-heading-1-leading":"1.3333","--text-heading-2-size":"var(--font-size-xl)","--text-heading-2-weight":"var(--font-weight-semibold)","--text-heading-2-leading":"1.4","--text-heading-3-size":"var(--font-size-lg)","--text-heading-3-weight":"var(--font-weight-bold)","--text-heading-3-leading":"1.4118","--text-heading-4-size":"var(--font-size-base)","--text-heading-4-weight":"var(--font-weight-bold)","--text-heading-4-leading":"1.4286","--text-heading-5-size":"var(--font-size-sm)","--text-heading-5-weight":"var(--font-weight-semibold)","--text-heading-5-leading":"1.6667","--text-heading-6-size":"var(--font-size-xs)","--text-heading-6-weight":"var(--font-weight-semibold)","--text-heading-6-leading":"1.6","--text-body-size":"var(--font-size-base)","--text-body-weight":"var(--font-weight-normal)","--text-body-leading":"1.4286","--text-large-size":"var(--font-size-lg)","--text-large-weight":"var(--font-weight-semibold)","--text-large-leading":"1.4118","--text-label-size":"var(--font-size-base)","--text-label-weight":"var(--font-weight-medium)","--text-label-leading":"1.4286","--text-code-size":"var(--font-size-base)","--text-code-weight":"var(--font-weight-normal)","--text-code-leading":"1.4286","--text-supporting-size":"var(--font-size-sm)","--text-supporting-weight":"var(--font-weight-normal)","--text-supporting-leading":"1.6667","--text-display-1-size":"var(--font-size-5xl)","--text-display-1-weight":"var(--font-weight-normal)","--text-display-1-leading":"1.2381","--text-display-2-size":"var(--font-size-4xl)","--text-display-2-weight":"var(--font-weight-normal)","--text-display-2-leading":"1.2571","--text-display-3-size":"var(--font-size-3xl)","--text-display-3-weight":"var(--font-weight-normal)","--text-display-3-leading":"1.3793","--duration-fast-min":"95ms","--duration-fast":"125ms","--duration-fast-max":"165ms","--duration-medium-min":"225ms","--duration-medium":"300ms","--duration-medium-max":"400ms","--duration-slow-min":"525ms","--duration-slow":"700ms","--duration-slow-max":"935ms","--font-family-body":'Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-heading":'Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-code":'ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace',"--color-syntax-keyword":"light-dark(#700084, #efa8ff)","--color-syntax-string":"light-dark(#005600, #a6d2a2)","--color-syntax-comment":"light-dark(#737373, #a3a3a3)","--color-syntax-number":"light-dark(#6e3500, #ffb37f)","--color-syntax-function":"light-dark(#00458c, #a0caff)","--color-syntax-type":"light-dark(#700084, #efa8ff)","--color-syntax-variable":"light-dark(#171717, #e5e5e5)","--color-syntax-operator":"light-dark(#737373, #a3a3a3)","--color-syntax-constant":"light-dark(#6e3500, #ffb37f)","--color-syntax-tag":"light-dark(#89001a, #ffaeaa)","--color-syntax-attribute":"light-dark(#584400, #eec12f)","--color-syntax-property":"light-dark(#005348, #83dac9)","--color-syntax-punctuation":"light-dark(#a3a3a3, #525252)","--color-syntax-background":"light-dark(#fafafa, #0a0a0a)","--color-background-surface":"light-dark(#ffffff, #262626)","--color-background-body":"light-dark(#f1f1f1, #1b1b1b)","--color-background-card":"light-dark(#ffffff, #1b1b1b)","--color-background-popover":"light-dark(#ffffff, #1b1b1b)","--color-background-muted":"light-dark(#f1f1f1, #1b1b1b)","--color-accent":"light-dark(#262626, #ebebeb)","--color-accent-muted":"light-dark(#f1f1f1, #262626)","--color-neutral":"light-dark(#0000000F, #FFFFFF1A)","--color-overlay":"light-dark(#00000080, #000000CC)","--color-overlay-hover":"light-dark(#0000000D, #FFFFFF0D)","--color-overlay-pressed":"light-dark(#0000001A, #FFFFFF1A)","--color-text-primary":"light-dark(#171717, #fafafa)","--color-text-secondary":"light-dark(#525252, #a3a3a3)","--color-text-disabled":"light-dark(#a3a3a3, #525252)","--color-text-accent":"light-dark(#262626, #ebebeb)","--color-on-dark":"#ffffff","--color-on-light":"#171717","--color-on-accent":"light-dark(#ffffff, #171717)","--color-on-success":"light-dark(#ffffff, #171717)","--color-on-error":"light-dark(#ffffff, #171717)","--color-on-warning":"#171717","--color-icon-accent":"light-dark(#262626, #ebebeb)","--color-icon-primary":"light-dark(#171717, #fafafa)","--color-icon-secondary":"light-dark(#737373, #a3a3a3)","--color-icon-disabled":"light-dark(#a3a3a3, #525252)","--color-success":"light-dark(#007004, #9fe59b)","--color-error":"light-dark(#a50c25, #ffc6c1)","--color-warning":"light-dark(#745b00, #fdcf4f)","--color-success-muted":"light-dark(#c5e5c0, #84c9803D)","--color-error-muted":"light-dark(#facecb, #ff9e973D)","--color-warning-muted":"light-dark(#f8da9d, #deb4333D)","--color-border":"light-dark(#00000014, #FFFFFF1A)","--color-border-emphasized":"light-dark(#d4d4d4, #525252)","--color-skeleton":"light-dark(#ebebeb, #525252)","--color-shadow":"light-dark(#0000001A, #0000004D)","--color-tint-hover":"light-dark(black, white)","--color-background-red":"light-dark(#facecb, #ff9e973D)","--color-border-red":"light-dark(#e6bab8, #ff6f6c)","--color-icon-red":"light-dark(#89001a, #ff9e97)","--color-text-red":"light-dark(#89001a, #ffc6c1)","--color-background-orange":"light-dark(#fad0b5, #ffa2583D)","--color-border-orange":"light-dark(#e6bda2, #e2883e)","--color-icon-orange":"light-dark(#6e3500, #ffa258)","--color-text-orange":"light-dark(#6e3500, #ffc9a2)","--color-background-yellow":"light-dark(#f8da9d, #deb4333D)","--color-border-yellow":"light-dark(#e4c279, #c0990e)","--color-icon-yellow":"light-dark(#584400, #deb433)","--color-text-yellow":"light-dark(#584400, #fdcf4f)","--color-background-green":"light-dark(#c5e5c0, #84c9803D)","--color-border-green":"light-dark(#b2d1ac, #69ad67)","--color-icon-green":"light-dark(#0c5700, #84c980)","--color-text-green":"light-dark(#0c5700, #9fe59b)","--color-background-teal":"light-dark(#a5e3d6, #7ec6b83D)","--color-border-teal":"light-dark(#94d6c8, #63ab9d)","--color-icon-teal":"light-dark(#005348, #7ec6b8)","--color-text-teal":"light-dark(#005348, #99e2d3)","--color-background-cyan":"light-dark(#a3e0ef, #83c2d43D)","--color-border-cyan":"light-dark(#91d3e3, #67a7b8)","--color-icon-cyan":"light-dark(#00505f, #83c2d4)","--color-text-cyan":"light-dark(#00505f, #9edef0)","--color-background-blue":"light-dark(#c4ddfb, #9eb7ff3D)","--color-border-blue":"light-dark(#b1c9e7, #6d9cfe)","--color-icon-blue":"light-dark(#00458c, #9eb7ff)","--color-text-blue":"light-dark(#00458c, #c7d3ff)","--color-background-purple":"light-dark(#eccef3, #f297ff3D)","--color-border-purple":"light-dark(#d8bbdf, #dd74f0)","--color-icon-purple":"light-dark(#700084, #f297ff)","--color-text-purple":"light-dark(#700084, #fac1ff)","--color-background-pink":"light-dark(#fccadc, #ff99c33D)","--color-border-pink":"light-dark(#e7b7c8, #f273aa)","--color-icon-pink":"light-dark(#83004b, #ff99c3)","--color-text-pink":"light-dark(#83004b, #ffc3da)","--color-background-gray":"light-dark(#e5e5e5, var(--color-neutral))","--color-border-gray":"light-dark(#d4d4d4, #262626)","--color-icon-gray":"light-dark(#525252, #a3a3a3)","--color-text-gray":"light-dark(#262626, #e5e5e5)","--radius-none":"0.25rem","--radius-inner":"0.375rem","--radius-element":"0.625rem","--radius-container":"0.75rem","--radius-page":"1.75rem","--radius-full":"9999px","--shadow-low":"0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))","--shadow-med":"0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))","--shadow-high":"0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))","--shadow-inset-hover":"inset 0px 0px 0px 2px #0074e24D","--shadow-inset-selected":"inset 0px 0px 0px 2px #0074e280","--shadow-inset-success":"inset 0px 0px 0px 2px #1981004D","--shadow-inset-warning":"inset 0px 0px 0px 2px #ffce2f4D","--shadow-inset-error":"inset 0px 0px 0px 2px #e33f4a4D"},icons:tK},sK=["image/jpeg","image/png","image/gif","image/webp"];function fM(e){return"data"in e?e:{ref:e.ref}}const rK=new TextEncoder;async function iK(e){const t=await globalThis.crypto.subtle.digest("SHA-256",rK.encode(`${e.mimeType}
381
- ${e.data}`));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}const Yf=4,oK=5*1024*1024,aK=/^[A-Za-z0-9+/]*={0,2}$/;function lK(e){if(e.length>Yf)return`At most ${Yf} images per message`;for(let t=0;t<e.length;t++){const n=e[t];if(!sK.includes(n.mimeType))return`Unsupported image type: ${n.mimeType} (use JPEG, PNG, GIF or WebP)`;if(n.data===""||n.data.length%4!==0||!aK.test(n.data))return`Image ${t+1} is not valid base64`;const s=n.data.endsWith("==")?2:n.data.endsWith("=")?1:0;if(n.data.length*3/4-s>oK)return`Image ${t+1} is larger than 5 MB`}}function cK(e,t){const n=new Map(t.map(d=>[d.id,d])),s=new Map,r=new Map;for(const d of e.conversations){const f=d.home;if(f.kind==="project"&&!e.projects.some(x=>x.path===f.path))continue;const h=n.get(d.id);h!==void 0&&(r.set(d.id,d),s.set(d.id,{summary:h,children:[]}))}for(const d of t){const f=[d];let h=d;for(;!r.has(h.id);){const x=h.parent===void 0?void 0:n.get(h.parent);if(x===void 0||f.includes(x))break;f.push(x),h=x}if(r.has(h.id))for(let x=f.length-1;x>=0;x--){const g=f[x];if(s.has(g.id)||s.set(g.id,{summary:g,children:[]}),x<f.length-1){const y=s.get(f[x+1].id),v=s.get(g.id);y.children.includes(v)||y.children.push(v)}}}const i=(d,f)=>d.summary.id-f.summary.id,o=d=>l(s.get(d.id)),l=d=>({summary:d.summary,children:[...d.children].sort(i).map(l)}),c=[...r.values()].sort((d,f)=>f.createdAt-d.createdAt),u=c.filter(d=>d.archived!==!0);return{chats:u.filter(d=>d.home.kind==="chat").map(o),projects:[...e.projects].sort((d,f)=>f.addedAt-d.addedAt).map(d=>({project:d,conversations:u.filter(f=>f.home.kind==="project"&&f.home.path===d.path).map(o)})),archived:c.filter(d=>d.archived===!0).map(d=>{const f=d.home,h=f.kind==="project"?e.projects.find(x=>x.path===f.path):void 0;return{node:o(d),...h===void 0?{}:{project:h}}})}}function Di(e,t){const n=s=>{for(const r of s){if(r.summary.id===t)return r;const i=n(r.children);if(i!==void 0)return i}};return n([...e.chats,...e.projects.flatMap(s=>s.conversations)])}function uK(e,t,n){var l,c;const s=(l=e.checkouts)==null?void 0:l.find(u=>u.conversationId===n);if(s!==void 0)return s;const r=new Map(t.map(u=>[u.id,u])),i=new Set;let o=r.get(n);for(;o!==void 0&&!i.has(o.id);){i.add(o.id);const u=(c=e.checkouts)==null?void 0:c.find(d=>d.conversationId===o.id);if(u!==void 0)return u;o=o.parent===void 0?void 0:r.get(o.parent)}}function dK(e,t,n){const s=e.conversations.find(l=>l.id===n);if(s!==void 0)return s.home;const r=new Map(t.map(l=>[l.id,l])),i=new Set;let o=r.get(n);for(;o!==void 0&&!i.has(o.id);){i.add(o.id);const l=e.conversations.find(c=>c.id===o.id);if(l!==void 0)return l.home;o=o.parent===void 0?void 0:r.get(o.parent)}}function d3(e){if(e!==void 0)return e.currentAgent===void 0?e.role:e.currentAgent??void 0}const M8={"needs-answer":3,failed:2,running:1};function fK(e){let t;const n=s=>{const r=s.summary.status;r!==void 0&&(t===void 0||M8[r]>M8[t])&&(t=r);for(const i of s.children)n(i)};return n(e),t}function hK(e){let t;const n=s=>{const r=s.summary.updatedAt;r!==void 0&&(t===void 0||r>t)&&(t=r);for(const i of s.children)n(i)};return n(e),t}function Bd(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return"now";const s=Math.floor(n/60);if(s<60)return`${s}m`;const r=Math.floor(s/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}const pK=/^\s*in the working directory\s+\S+,\s*/i;function Ds(e){var n;if(e===void 0)return"Conversation";if(e.kind!=="subagent")return e.title??"New conversation";if(e.label!==void 0)return e.label;const t=(n=e.title)==null?void 0:n.replace(pK,"").trim();return t===void 0||t===""?"Subagent":t}function $1(e,t){let n=Di(e,t);for(let s=0;n!==void 0&&n.summary.parent!==void 0&&s<4;s++)n=Di(e,n.summary.parent);return n}function hM(e){const t=[],n=s=>{for(const r of s.children)r.summary.kind==="fork"&&(t.push(r),n(r))};return n(e),t}function f3(e){const t=[],n=e.children.filter(s=>s.summary.kind==="subagent");n.length>0&&t.push({owner:e.summary,label:"This conversation",tasks:[...n]});for(const s of hM(e)){const r=s.children.filter(i=>i.summary.kind==="subagent");r.length>0&&t.push({owner:s.summary,label:Ds(s.summary),tasks:[...r]})}return t}function pM(e,t,n){var s;return(((s=Di(e,t))==null?void 0:s.children)??[]).filter(r=>r.summary.forkedAt===n).map(r=>r.summary.id)}function xK(e){return e==="auto"||e==="directOnly"||e==="relayOnly"?e:void 0}const T8=1,gK=4,mK=1024;function yK(e){const t=e.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");return t==="localhost"||t.endsWith(".localhost")||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function A1(e){try{return yK(new URL(e).hostname)}catch{return!1}}const z8=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),vK=e=>{if(e.length===0)return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}};function Kg(e){if(e===void 0)return{kind:"absent"};if(!z8(e))return{kind:"malformed"};const t=e.schemaVersion;if(typeof t!="number")return{kind:"malformed"};if(t!==T8)return{kind:"unsupported"};const n=e.endpoints;if(!Array.isArray(n))return{kind:"malformed"};if(n.length>gK)return{kind:"malformed"};const s=[],r=new Map;for(const i of n){if(!z8(i))return{kind:"malformed"};const o=i.transport;if(typeof o!="string")return{kind:"malformed"};if(o!=="webSocket")continue;const l=i.role;if(l!=="direct"&&l!=="relay")return{kind:"malformed"};const c=i.url;if(typeof c!="string"||c.length>mK)return{kind:"malformed"};if(!vK(c))return{kind:"malformed"};const u=r.get(c);if(u!==void 0){if(u!==l)return{kind:"malformed"};continue}r.set(c,l),s.push({transport:"webSocket",role:l,url:c})}return s.length===0&&n.length>0?{kind:"unsupported"}:{kind:"valid",endpointSet:{schemaVersion:T8,endpoints:s}}}function xM(e){return encodeURIComponent(JSON.stringify(e))}function kK(e){try{return Kg(JSON.parse(e))}catch{return{kind:"malformed"}}}const bK="mixed content: this HTTPS page blocks the insecure ws:// connection";function R2(e,t){return t==="auto"?[...e]:t==="relayOnly"?e.filter(n=>n.role==="loopback"||n.role==="relay"||n.role==="legacy"):e.filter(n=>n.role==="loopback"||n.role==="direct")}function wK(e){return e.filter(t=>t.role==="relay"||t.role==="legacy")}const gM="Direct connection unavailable: this host cannot be reached without the relay and WebRTC did not connect.",jK=e=>{try{return new URL(e).protocol==="ws:"&&!A1(e)}catch{return!1}},SK=(e,t)=>t.pageProtocol==="https:"&&jK(e)?bK:void 0;function M1(e,t,n={}){const s=[],r=new Set,i=(o,l)=>{if(r.has(o))return;r.add(o);const c=SK(o,n);s.push({url:o,role:l,...c===void 0?{}:{unsupported:c}})};if(A1(e)&&i(e,"loopback"),t!==void 0){for(const o of t.endpoints)o.role==="relay"&&i(o.url,"relay");for(const o of t.endpoints)o.role==="direct"&&i(o.url,"direct")}else A1(e)||i(e,"legacy");return s}const N8=(e,t)=>{var n;return(n=e.find(s=>s.role===t))==null?void 0:n.url};function h3(e,t){if(A1(e))return e;const n=N8(t.endpoints,"relay");return n!==void 0?n:N8(t.endpoints,"direct")??e}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function qv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Mx=e=>e?`"${e}" `:"";function Pv(e,t=""){if(typeof e!="boolean")throw new TypeError(Mx(t)+"expected boolean, got type="+typeof e);return e}function Mu(e,t=""){if(typeof e!="number")throw new TypeError(Mx(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Mx(t)+"expected integer >= 0, got "+e);return e}function Rn(e,t,n=""){if(qv(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Mu(t,"length");const s=qv(e),r=t!==void 0?` of length ${t}`:"",i=s?`length=${e.length}`:`type=${typeof e}`,o=Mx(n)+"expected Uint8Array"+r+", got "+i;throw s?new RangeError(o):new TypeError(o)}const _8=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`)};function R8(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function CK(e,t){Rn(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function po(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ra(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function EK(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const Tu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function $K(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function AK(e){for(let t=0;t<e.length;t++)e[t]=$K(e[t]);return e}const Al=Tu?e=>e:AK;function MK(e,t){return!e.byteLength||!t.byteLength?!1:e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength}function TK(e,t){if(MK(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function zK(e,t){return _8(e,"defaults"),_8(t,"opts"),Object.assign(e,t)}function NK(e,t){if(e=Rn(e),t=Rn(t),e.length!==t.length)return!1;let n=0;for(let s=0;s<e.length;s++)n|=e[s]^t[s];return n===0}function _K(e,t,n){const s=t,r=()=>[],i=(l,c)=>s(c,...r(l)).update(l).digest(),o=s(new Uint8Array(e),...r(new Uint8Array(0)));return i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=(l,...c)=>s(l,...c),i}const RK=(e,t)=>{function n(s,...r){if(Rn(s,void 0,"key"),e.nonceLength!==void 0){const f=r[0];Rn(f,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const i=e.tagLength,o=e.nonceLength!==void 0?1:0;if(!e.withAAD){for(let f=o;f<r.length;f++)if(qv(r[f]))throw new Error("AAD not supported")}e.withAAD&&r[o]!==void 0&&Rn(r[o],void 0,"AAD");const l=t(s,...r),c=(f,h)=>{if(h!==void 0){if(f!==2)throw new Error("cipher output not supported");Rn(h,void 0,"output")}};let u=!1;return{encrypt(f,h){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,Rn(f,void 0,"data"),c(l.encrypt.length,h),l.encrypt(f,h)},decrypt(f,h){if(Rn(f,void 0,"data"),i&&f.length<i)throw new Error('"ciphertext" expected length >= tagLength='+i);return c(l.decrypt.length,h),l.decrypt(f,h)}}}return Object.assign(n,e),n};function Uv(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(Rn(t,e,"output"),n&&!Tx(t))throw new Error("invalid output, must be aligned");return t}function IK(e,t,n){Mu(e),Mu(t),Pv(n);const s=new Uint8Array(16),r=EK(s);return r.setBigUint64(0,BigInt(t),n),r.setBigUint64(8,BigInt(e),n),s}function Tx(e){return e.byteOffset%4===0}function zx(e){return Uint8Array.from(Rn(e))}const mM=e=>Uint8Array.from(e.split(""),t=>t.charCodeAt(0)),LK=Al(po(mM("expand 16-byte k"))),OK=Al(po(mM("expand 32-byte k")));function Je(e,t){return e<<t|e>>>32-t}const lf=64,DK=16,Fv=2**32-1,I8=Uint32Array.of();function BK(e,t,n,s,r,i,o,l){const c=r.length,u=new Uint8Array(lf),d=po(u),f=Tu&&Tx(r)&&Tx(i),h=f?po(r):I8,x=f?po(i):I8;if(!Tu){for(let g=0;g<c;o++){if(e(t,n,s,d,o,l),Al(d),o>=Fv)throw new Error("arx: counter overflow");const y=Math.min(lf,c-g);for(let v=0,m;v<y;v++)m=g+v,i[m]=r[m]^u[v];g+=y}return}for(let g=0;g<c;o++){if(e(t,n,s,d,o,l),o>=Fv)throw new Error("arx: counter overflow");const y=Math.min(lf,c-g);if(f&&y===lf){const v=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let m=0,k;m<DK;m++)k=v+m,x[k]=h[k]^d[m];g+=lf;continue}for(let v=0,m;v<y;v++)m=g+v,i[m]=r[m]^u[v];g+=y}}function HK(e,t){const{allowShortKeys:n,extendNonceFn:s,counterLength:r,counterRight:i,rounds:o}=zK({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return Mu(r),Mu(o),Pv(i),Pv(n),(l,c,u,d,f=0)=>{Rn(l,void 0,"key"),Rn(c,void 0,"nonce"),Rn(u,void 0,"data");const h=u.length,x=d!==void 0;if(d=Uv(h,d,!1),x&&TK(u,d),Mu(f),f<0||f>=Fv)throw new Error("arx: counter overflow");const g=[];let y=l.length,v,m;if(y===32)g.push(v=zx(l)),m=OK;else if(y===16&&n)v=new Uint8Array(32),v.set(l),v.set(l,16),m=LK,g.push(v);else throw Rn(l,32,"arx key"),new Error("invalid key size");(!Tu||!Tx(c))&&g.push(c=zx(c));let k=po(v);if(s){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const A=c.subarray(0,16);if(Tu)s(m,k,po(A),k);else{const M=Al(Uint32Array.from(m));s(M,k,po(A),k),Ra(M),Al(k)}c=c.subarray(16)}else Tu||Al(k);const b=16-r;if(b!==c.length)throw new Error(`arx: nonce must be ${b} or 16 bytes`);if(b!==12){const A=new Uint8Array(12);A.set(c,i?0:12-c.length),c=A,g.push(c)}const j=Al(po(c));try{return BK(e,m,k,j,u,d,f,o),d}finally{Ra(...g)}}}function Hn(e,t){return e[t++]&255|(e[t++]&255)<<8}class qK{constructor(t){ge(this,"blockLen",16);ge(this,"outputLen",16);ge(this,"buffer",new Uint8Array(16));ge(this,"r",new Uint16Array(10));ge(this,"h",new Uint16Array(10));ge(this,"pad",new Uint16Array(8));ge(this,"pos",0);ge(this,"finished",!1);ge(this,"destroyed",!1);t=zx(Rn(t,32,"key"));const n=Hn(t,0),s=Hn(t,2),r=Hn(t,4),i=Hn(t,6),o=Hn(t,8),l=Hn(t,10),c=Hn(t,12),u=Hn(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|s<<3)&8191,this.r[2]=(s>>>10|r<<6)&7939,this.r[3]=(r>>>7|i<<9)&8191,this.r[4]=(i>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|l<<2)&8191,this.r[7]=(l>>>11|c<<5)&8065,this.r[8]=(c>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Hn(t,16+2*d)}process(t,n,s=!1){const r=s?0:2048,{h:i,r:o}=this,l=o[0],c=o[1],u=o[2],d=o[3],f=o[4],h=o[5],x=o[6],g=o[7],y=o[8],v=o[9],m=Hn(t,n+0),k=Hn(t,n+2),b=Hn(t,n+4),j=Hn(t,n+6),A=Hn(t,n+8),M=Hn(t,n+10),E=Hn(t,n+12),z=Hn(t,n+14);let T=i[0]+(m&8191),$=i[1]+((m>>>13|k<<3)&8191),_=i[2]+((k>>>10|b<<6)&8191),R=i[3]+((b>>>7|j<<9)&8191),N=i[4]+((j>>>4|A<<12)&8191),H=i[5]+(A>>>1&8191),B=i[6]+((A>>>14|M<<2)&8191),I=i[7]+((M>>>11|E<<5)&8191),L=i[8]+((E>>>8|z<<8)&8191),O=i[9]+(z>>>5|r),D=0,q=D+T*l+$*(5*v)+_*(5*y)+R*(5*g)+N*(5*x);D=q>>>13,q&=8191,q+=H*(5*h)+B*(5*f)+I*(5*d)+L*(5*u)+O*(5*c),D+=q>>>13,q&=8191;let F=D+T*c+$*l+_*(5*v)+R*(5*y)+N*(5*g);D=F>>>13,F&=8191,F+=H*(5*x)+B*(5*h)+I*(5*f)+L*(5*d)+O*(5*u),D+=F>>>13,F&=8191;let K=D+T*u+$*c+_*l+R*(5*v)+N*(5*y);D=K>>>13,K&=8191,K+=H*(5*g)+B*(5*x)+I*(5*h)+L*(5*f)+O*(5*d),D+=K>>>13,K&=8191;let Z=D+T*d+$*u+_*c+R*l+N*(5*v);D=Z>>>13,Z&=8191,Z+=H*(5*y)+B*(5*g)+I*(5*x)+L*(5*h)+O*(5*f),D+=Z>>>13,Z&=8191;let se=D+T*f+$*d+_*u+R*c+N*l;D=se>>>13,se&=8191,se+=H*(5*v)+B*(5*y)+I*(5*g)+L*(5*x)+O*(5*h),D+=se>>>13,se&=8191;let ne=D+T*h+$*f+_*d+R*u+N*c;D=ne>>>13,ne&=8191,ne+=H*l+B*(5*v)+I*(5*y)+L*(5*g)+O*(5*x),D+=ne>>>13,ne&=8191;let ue=D+T*x+$*h+_*f+R*d+N*u;D=ue>>>13,ue&=8191,ue+=H*c+B*l+I*(5*v)+L*(5*y)+O*(5*g),D+=ue>>>13,ue&=8191;let P=D+T*g+$*x+_*h+R*f+N*d;D=P>>>13,P&=8191,P+=H*u+B*c+I*l+L*(5*v)+O*(5*y),D+=P>>>13,P&=8191;let U=D+T*y+$*g+_*x+R*h+N*f;D=U>>>13,U&=8191,U+=H*d+B*u+I*c+L*l+O*(5*v),D+=U>>>13,U&=8191;let X=D+T*v+$*y+_*g+R*x+N*h;D=X>>>13,X&=8191,X+=H*f+B*d+I*u+L*c+O*l,D+=X>>>13,X&=8191,D=(D<<2)+D|0,D=D+q|0,q=D&8191,D=D>>>13,F+=D,i[0]=q,i[1]=F,i[2]=K,i[3]=Z,i[4]=se,i[5]=ne,i[6]=ue,i[7]=P,i[8]=U,i[9]=X}finalize(){const{h:t,pad:n}=this,s=new Uint16Array(10);let r=t[1]>>>13;t[1]&=8191;for(let l=2;l<10;l++)t[l]+=r,r=t[l]>>>13,t[l]&=8191;t[0]+=r*5,r=t[0]>>>13,t[0]&=8191,t[1]+=r,r=t[1]>>>13,t[1]&=8191,t[2]+=r,s[0]=t[0]+5,r=s[0]>>>13,s[0]&=8191;for(let l=1;l<10;l++)s[l]=t[l]+r,r=s[l]>>>13,s[l]&=8191;s[9]-=8192;let i=(r^1)-1;for(let l=0;l<10;l++)s[l]&=i;i=~i;for(let l=0;l<10;l++)t[l]=t[l]&i|s[l];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let o=t[0]+n[0];t[0]=o&65535;for(let l=1;l<8;l++)o=(t[l]+n[l]|0)+(o>>>16)|0,t[l]=o&65535;Ra(s)}update(t){R8(this),Rn(t),t=zx(t);const{buffer:n,blockLen:s}=this,r=t.length;for(let i=0;i<r;){const o=Math.min(s-this.pos,r-i);if(o===s){for(;s<=r-i;i+=s)this.process(t,i);continue}n.set(t.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===s&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,Ra(this.h,this.r,this.buffer,this.pad)}digestInto(t){R8(this),CK(t,this),this.finished=!0;const{buffer:n,h:s}=this;let{pos:r}=this;if(r){for(n[r++]=1;r<16;r++)n[r]=0;this.process(n,0,!0)}this.finalize();let i=0;for(let o=0;o<8;o++)t[i++]=s[o]>>>0,t[i++]=s[o]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}}const PK=_K(32,e=>new qK(e));function UK(e,t,n,s,r,i=20){let o=e[0],l=e[1],c=e[2],u=e[3],d=t[0],f=t[1],h=t[2],x=t[3],g=t[4],y=t[5],v=t[6],m=t[7],k=r,b=n[0],j=n[1],A=n[2],M=o,E=l,z=c,T=u,$=d,_=f,R=h,N=x,H=g,B=y,I=v,L=m,O=k,D=b,q=j,F=A;for(let Z=0;Z<i;Z+=2)M=M+$|0,O=Je(O^M,16),H=H+O|0,$=Je($^H,12),M=M+$|0,O=Je(O^M,8),H=H+O|0,$=Je($^H,7),E=E+_|0,D=Je(D^E,16),B=B+D|0,_=Je(_^B,12),E=E+_|0,D=Je(D^E,8),B=B+D|0,_=Je(_^B,7),z=z+R|0,q=Je(q^z,16),I=I+q|0,R=Je(R^I,12),z=z+R|0,q=Je(q^z,8),I=I+q|0,R=Je(R^I,7),T=T+N|0,F=Je(F^T,16),L=L+F|0,N=Je(N^L,12),T=T+N|0,F=Je(F^T,8),L=L+F|0,N=Je(N^L,7),M=M+_|0,F=Je(F^M,16),I=I+F|0,_=Je(_^I,12),M=M+_|0,F=Je(F^M,8),I=I+F|0,_=Je(_^I,7),E=E+R|0,O=Je(O^E,16),L=L+O|0,R=Je(R^L,12),E=E+R|0,O=Je(O^E,8),L=L+O|0,R=Je(R^L,7),z=z+N|0,D=Je(D^z,16),H=H+D|0,N=Je(N^H,12),z=z+N|0,D=Je(D^z,8),H=H+D|0,N=Je(N^H,7),T=T+$|0,q=Je(q^T,16),B=B+q|0,$=Je($^B,12),T=T+$|0,q=Je(q^T,8),B=B+q|0,$=Je($^B,7);let K=0;s[K++]=o+M|0,s[K++]=l+E|0,s[K++]=c+z|0,s[K++]=u+T|0,s[K++]=d+$|0,s[K++]=f+_|0,s[K++]=h+R|0,s[K++]=x+N|0,s[K++]=g+H|0,s[K++]=y+B|0,s[K++]=v+I|0,s[K++]=m+L|0,s[K++]=k+O|0,s[K++]=b+D|0,s[K++]=j+q|0,s[K++]=A+F|0}const FK=HK(UK,{counterRight:!1,counterLength:4,allowShortKeys:!1}),VK=new Uint8Array(16),L8=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update(VK.subarray(n))},GK=new Uint8Array(32);function O8(e,t,n,s,r){r!==void 0&&Rn(r,void 0,"AAD");const i=e(t,n,GK),o=IK(s.length,r?r.length:0,!0),l=PK.create(i);r&&L8(l,r),L8(l,s),l.update(o);const c=l.digest();return Ra(i,o),c}const WK=e=>(t,n,s)=>({encrypt(i,o){const l=i.length;o=Uv(l+16,o,!1),o.set(i);const c=o.subarray(0,-16);e(t,n,c,c,1);const u=O8(e,t,n,c,s);return o.set(u,l),Ra(u),o},decrypt(i,o){o=Uv(i.length-16,o,!1);const l=i.subarray(0,-16),c=i.subarray(-16),u=O8(e,t,n,l,s);if(!NK(c,u))throw Ra(u),new Error("invalid tag");return o.set(i.subarray(0,-16)),e(t,n,o,o,1),Ra(u),o}}),D8=RK({blockSize:64,nonceLength:12,tagLength:16,withAAD:!0},WK(FK)),KK=e=>e/2**32|0,XK=e=>e>>>0;function Vv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Gv=e=>e?`"${e}" `:"";function Ao(e,t=""){if(typeof e!="number")throw new TypeError(Gv(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Gv(t)+"expected integer >= 0, got "+e);return e}function Or(e,t,n=""){if(Vv(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Ao(t,"length");const s=Vv(e),r=t!==void 0?` of length ${t}`:"",i=s?`length=${e.length}`:`type=${typeof e}`,o=Gv(n)+"expected Uint8Array"+r+", got "+i;throw s?new RangeError(o):new TypeError(o)}function B8(e){return Uint8Array.from(Or(e))}function ZK(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(Ao(e.outputLen),Ao(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const YK=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},H8=(e,t)=>{YK(e,t);const n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function Nx(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function yM(e,t){Or(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function _x(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Wv(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Rx(e,t){return e<<32-t|e>>>t}const vM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function kM(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const jf=vM?e=>e:e=>kM(e)>>>0;function QK(e){for(let t=0;t<e.length;t++)e[t]=kM(e[t]);return e}const qc=vM?e=>e:QK,bM=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",JK=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p3(e){if(Or(e),bM)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=JK[e[n]];return t}function q8(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function wM(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(bM)try{return Uint8Array.fromHex(e)}catch(r){throw r instanceof SyntaxError?new RangeError(r.message):r}const t=e.length,n=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(n);for(let r=0,i=0;r<n;r++,i+=2){const o=q8(e.charCodeAt(i)),l=q8(e.charCodeAt(i+1));if(o===void 0||l===void 0){const c=e[i]+e[i+1];throw new RangeError('hex string expected, got non-hex character "'+c+'" at index '+i)}s[r]=o*16+l}return s}function jM(e,t,n="opts"){return H8(e,"defaults"),t!==void 0&&H8(t,n),Object.assign(Object.create(null),e,t)}function eX(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=jM({},t,"info");const n=(r,i)=>e(i).update(r).digest(),s=e(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.canXOF=s.canXOF,n.create=r=>e(r),Object.assign(n,t),Object.freeze(n)}function tX(e=32){Ao(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const nX=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function SM(e,t,n=()=>{}){if(!Array.isArray(e))throw new TypeError(`"${t}" expected array, got type=${typeof e}`);for(let s=0;s<e.length;s++)n(e[s],`${t}[${s}]`);return e}const zu=(e,t,n)=>Or(e,t,n),CM=Ao;function Nu(e,t="object"){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`);return e}function Qf(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const sX=p3,rX=e=>wM(e),EM=Vv,$M=e=>tX(e),Ix=BigInt(0),P8=BigInt(1),iX=e=>e?`"${e}" `:"";function Xg(e,t=""){if(typeof e!="boolean")throw new TypeError(iX(t)+"expected boolean, got type="+typeof e);return e}function oX(e){if(typeof e=="bigint"){if(!sc(e))throw new RangeError("positive bigint expected, got "+e)}else CM(e);return e}function Kv(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(n+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){const n=t&&`"${t}" `;throw new RangeError(n+"expected safe integer, got "+e)}}function AM(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Ix:BigInt("0x"+e)}function MM(e){return AM(p3(e))}function Lx(e){return AM(p3(T1(Or(e)).reverse()))}function TM(e,t){if(Ao(t),t===0)throw new Error("zero output length is invalid");e=oX(e);const n=t*2,s=e.toString(16);if(s.length>n)throw new RangeError("number is too large");return wM(s.padStart(n,"0"))}function zM(e,t){return TM(e,t).reverse()}function T1(e){return Uint8Array.from(zu(e))}function sc(e){return typeof e=="bigint"&&Ix<=e}function NM(e,t,n){return sc(e)&&sc(t)&&sc(n)&&t<=e&&e<n}function Jf(e,t,n,s){if(!NM(t,n,s))throw new RangeError("expected valid "+e+": "+n+" <= n < "+s+", got "+t)}function aX(e){if(e<Ix)throw new Error("expected non-negative bigint, got "+e);return e===Ix?0:e.toString(2).length}const lX=e=>(Kv(e,"n"),(P8<<BigInt(e))-P8);function Ox(e,t={},n={},s="object"){Nu(e,s),Nu(t,"fields"),Nu(n,"optFields");function r(o,l,c){const u=s==="object"?`param "${String(o)}"`:`"${s}.${String(o)}"`,d=e[o];if(!Object.hasOwn(e,o)&&(c?d!==void 0:l!=="function"))throw new TypeError(`${u} is invalid: expected own property`);if(c&&d===void 0)return;const f=typeof d;if(f!==l||d===null)throw new TypeError(`${u} is invalid: expected ${l}, got ${f}`)}const i=(o,l)=>Object.entries(o).forEach(([c,u])=>r(c,u,l));i(t,!1),i(n,!0)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ln=BigInt(0),Rt=BigInt(1),Ml=BigInt(2),_M=BigInt(3),x3=BigInt(4),RM=BigInt(5),cX=BigInt(7),IM=BigInt(8),uX=BigInt(9),dX=BigInt(15),LM=BigInt(16),fX=BigInt("0x10000000000000000");function _t(e,t){if(t<=Ln)throw new Error("mod: expected positive modulus, got "+t);const n=e%t;return n>=Ln?n:t+n}function hX(e,t,n){if(n<=Rt)throw new Error("pow: expected modulus > 1, got "+n);if(typeof t!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof t);if(t<Ln)throw new Error("invalid exponent, negatives unsupported");if(t===Ln)return Rt;if(t===Rt)return e;let s=e%n;if(s<Ln&&(s+=n),t<fX){let l=Rt;for(;t>Ln;)t&Rt&&(l=l*s%n),s=s*s%n,t>>=Rt;return l}const r=[];for(;t>Ln;)r.push(Number(t&dX)),t>>=x3;const i=new Array(16);i[0]=Rt,i[1]=s;for(let l=2;l<16;l++)i[l]=i[l-1]*s%n;let o=i[r[r.length-1]];for(let l=r.length-2;l>=0;l--){o=o*o%n,o=o*o%n,o=o*o%n,o=o*o%n;const c=r[l];c!==0&&(o=o*i[c]%n)}return o}function Wr(e,t,n){if(n<=Rt)throw new Error("pow2: expected modulus > 1, got "+n);if(t<Ln)throw new Error("pow2: expected non-negative exponent, got "+t);let s=e;for(;t-- >Ln;)s*=s,s%=n;return s}function U8(e,t){if(e===Ln)throw new Error("invert: expected non-zero number");if(t<=Rt)throw new Error("invert: expected modulus > 1, got "+t);let n=_t(e,t),s=t,r=Ln,i=Rt;for(;n!==Ln;){const l=s/n,c=s-n*l,u=r-i*l;s=n,n=c,r=i,i=u}if(s!==Rt)throw new Error("invert: does not exist");return _t(r,t)}function g3(e,t,n){const s=e;if(!s.eql(s.sqr(t),n))throw new Error("Cannot find square root")}function m3(e,t){if((e&Rt)===Ln)throw new Error(t+": expected odd modulus, got "+e)}function OM(e,t){const n=e,s=(n.ORDER+Rt)/x3,r=n.pow(t,s);return g3(n,r,t),r}function pX(e,t){const n=e,s=(n.ORDER-RM)/IM,r=n.mul(t,Ml),i=n.pow(r,s),o=n.mul(t,i),l=n.mul(n.mul(o,Ml),i),c=n.mul(o,n.sub(l,n.ONE));return g3(n,c,t),c}function xX(e){const t=y3(e),n=DM(e),s=n(t,t.neg(t.ONE)),r=n(t,s),i=n(t,t.neg(s)),o=(e+cX)/LM;return(l,c)=>{const u=l;let d=u.pow(c,o),f=u.mul(d,s);const h=u.mul(d,r),x=u.mul(d,i),g=u.eql(u.sqr(f),c),y=u.eql(u.sqr(h),c);d=u.cmov(d,f,g),f=u.cmov(x,h,y);const v=u.eql(u.sqr(f),c),m=u.cmov(d,f,v);return g3(u,m,c),m}}function DM(e){if(e<_M)throw new Error("sqrt is not defined for small field");m3(e,"tonelliShanks");let t=e-Rt,n=0;for(;t%Ml===Ln;)t/=Ml,n++;let s=Ml;const r=y3(e);for(;Dx(r,s)===1;)if(s++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return OM;let i=r.pow(s,t);const o=(t+Rt)/Ml;return function(c,u){const d=c;if(d.is0(u))return u;if(Dx(d,u)!==1)throw new Error("Cannot find square root");let f=n,h=d.mul(d.ONE,i),x=d.pow(u,t),g=d.pow(u,o);for(;!d.eql(x,d.ONE);){if(d.is0(x))throw new Error("Cannot find square root: probably non-prime P");let y=1,v=d.sqr(x);for(;!d.eql(v,d.ONE);)if(y++,v=d.sqr(v),y===f)throw new Error("Cannot find square root");const m=Rt<<BigInt(f-y-1),k=d.pow(h,m);f=y,h=d.sqr(k),x=d.mul(x,h),g=d.mul(g,k)}return g}}function gX(e){return m3(e,"Fp.sqrt"),e%x3===_M?OM:e%IM===RM?pX:e%LM===uX?xX(e):DM(e)}const mX=(e,t)=>(_t(e,t)&Rt)===Rt,yX=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function z1(e){if(Nu(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Kv(e.BYTES,"BYTES"),Kv(e.BITS,"BITS");for(const t of yX)Qf(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=Rt)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function BM(e,t,n=!1){z1(e),SM(t,"nums"),Xg(n,"passZero");const s=e,r=new Array(t.length).fill(n?s.ZERO:void 0),i=t.reduce((l,c,u)=>s.is0(c)?l:(r[u]=l,s.mul(l,c)),s.ONE),o=s.inv(i);return t.reduceRight((l,c,u)=>s.is0(c)?l:(r[u]=s.mul(l,r[u]),s.mul(l,c)),o),r}function Dx(e,t){z1(e);const n=e;m3(n.ORDER,"FpLegendre");const s=(n.ORDER-Rt)/Ml,r=n.pow(t,s),i=n.eql(r,n.ONE),o=n.eql(r,n.ZERO),l=n.eql(r,n.neg(n.ONE));if(!i&&!o&&!l)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function vX(e,t){if(t!==void 0&&CM(t),e<=Ln)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const n=aX(e);if(t!==void 0&&t<n)throw new Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);const s=t!==void 0?t:n,r=Math.ceil(s/8);return{nBitLength:s,nByteLength:r}}const F8=new WeakMap;class V8{constructor(t,n={}){ge(this,"ORDER");ge(this,"BITS");ge(this,"BYTES");ge(this,"isLE");ge(this,"ZERO",Ln);ge(this,"ONE",Rt);ge(this,"_lengths");ge(this,"_mod");if(t<=Rt)throw new Error("invalid field: expected ORDER > 1, got "+t);let s;this.isLE=!1,n!=null&&typeof n=="object"&&(typeof n.BITS=="number"&&(s=n.BITS),typeof n.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:n.sqrt,enumerable:!0}),typeof n.isLE=="boolean"&&(this.isLE=n.isLE),n.allowedLengths&&(this._lengths=Object.freeze(n.allowedLengths.slice())),typeof n.modFromBytes=="boolean"&&(this._mod=n.modFromBytes));const{nBitLength:r,nByteLength:i}=vX(t,s);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(t){return _t(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return Ln<=t&&t<this.ORDER}is0(t){return t===Ln}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&Rt)===Rt}neg(t){return _t(-t,this.ORDER)}eql(t,n){return t===n}sqr(t){return _t(t*t,this.ORDER)}add(t,n){return _t(t+n,this.ORDER)}sub(t,n){return _t(t-n,this.ORDER)}mul(t,n){return _t(t*n,this.ORDER)}pow(t,n){return hX(t,n,this.ORDER)}div(t,n){return _t(t*U8(n,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,n){return t+n}subN(t,n){return t-n}mulN(t,n){return t*n}inv(t){return U8(t,this.ORDER)}sqrt(t){let n=F8.get(this);return n||F8.set(this,n=gX(this.ORDER)),n(this,t)}toBytes(t){return this.isLE?zM(t,this.BYTES):TM(t,this.BYTES)}fromBytes(t,n=!1){zu(t);const{_lengths:s,BYTES:r,isLE:i,ORDER:o,_mod:l}=this;if(s){if(t.length<1||!s.includes(t.length)||t.length>r)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const u=new Uint8Array(r);u.set(t,i?0:u.length-t.length),t=u}if(t.length!==r)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);let c=i?Lx(t):MM(t);if(l&&(c=_t(c,o)),!n&&!this.isValid(c))throw new Error("invalid field element: outside of range 0..ORDER");return c}invertBatch(t){return BM(this,t,!0)}cmov(t,n,s){return Xg(s,"condition"),s?n:t}}function y3(e,t={}){return Object.freeze(V8.prototype),new V8(e,t)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const v3=BigInt(0),N1=BigInt(1),kX=BigInt(4),I2=16,G8=128,bX=5,W8=2**31;function k3(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Qf(t.fromAffine,"Point.fromAffine"),Qf(t.fromBytes,"Point.fromBytes"),Qf(t.fromHex,"Point.fromHex"),Nu(t.BASE,"Point.BASE"),Nu(t.ZERO,"Point.ZERO"),z1(t.Fp),z1(t.Fn)}function wX(e,t){k3(e),HM(t,e);const n=BM(e.Fp,t.map(s=>s.Z));return t.map((s,r)=>e.fromAffine(s.toAffine(n[r])))}function jX(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw new Error("invalid window size, expected ["+n+".."+t+"], got W="+e)}function SX(e,t){const n=e*(4*t+128);if(n>W8)throw new Error("invalid window size: table would need ~"+Math.ceil(n/2**20)+" MiB, max "+W8/2**20+" MiB")}function CX(e,t){if(e!==void 0){Qf(e,"randomBytes");try{const n=e(t);if(!EM(n)||n.length!==t)return}catch{return}return e}}function HM(e,t){SM(e,"points"),e.forEach((n,s)=>{if(!(n instanceof t))throw new Error("invalid point at index "+s)})}function EX(e,t,n){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((s,r)=>{if(!(n===void 0?t.isValid(s):sc(s)&&s<n))throw new Error("invalid scalar at index "+r)})}const qM=new WeakMap;function L2(e){return qM.get(e)||1}function $X(e,t){const n=e.double(),s=[e];for(let r=1;r<t;r++)s.push(s[r-1].add(n));return s}function AX(e,t){const n=2**t,s=n/2,r=BigInt(n-1),i=[];for(;e>v3;){let o=0;e&N1&&(o=Number(e&r),o>=s&&(o-=n),e-=BigInt(o)),i.push(o),e>>=N1}return i}function MX(e,t,n){const s=2**t,r=s/2,i=BigInt(s-1),o=BigInt(t),l=[];for(let c=0;c<n;c++){let u=Number(e&i);e>>=o,u>r&&(u-=s,e+=N1),l.push(u)}if(e!==v3)throw new Error("invalid wnaf");return l}function TX(e,t,n){let s=0;for(const i of n)s=Math.max(s,i.length);let r=e;for(let i=s-1;i>=0;i--){i!==s-1&&(r=r.double());for(let o=0;o<n.length;o++){const l=n[o][i];if(l){const c=t[o][Math.abs(l)-1>>1];r=r.add(l<0?c.negate():c)}}}return r}class zX{constructor(t,n){ge(this,"Point");ge(this,"BASE");ge(this,"ZERO");ge(this,"randomBytes");ge(this,"wnafPrecomputes",new WeakMap);ge(this,"baseCanBeBlinded");ge(this,"bits");k3(t),this.randomBytes=CX(n,I2),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,n,s){const r=Math.ceil(s/n)+1,i=2**(n-1),o=[];let l=t;for(let c=0;c<r;c++){let u=l;for(let d=0;d<i;d++)o.push(u),u=u.add(l);l=o[o.length-1].double()}return{W:n,bits:s,windows:r,comp:o}}wnafCachedCT(t,n){const{W:s,windows:r,comp:i}=t,o=2**(s-1),l=MX(n,s,r);let c=this.ZERO,u=this.BASE;for(let d=0;d<r;d++){const f=l[d],h=d*o,x=Math.abs(f)-1;let g=i[h];for(let v=1;v<o;v++)g=v===x?i[h+v]:g;const y=g.negate();f===0?u=u.add(i[h]):c=c.add(f<0?y:g)}return{p:c,f:u}}getWnafPrecomputes(t,n,s,r){let i=this.wnafPrecomputes.get(n),o=i==null?void 0:i.find(l=>l.W===t&&l.bits===s);return o||(o=this.buildWnafTable(n,t,s),typeof r=="function"&&(o={...o,comp:r(o.comp)}),i||(i=[],this.wnafPrecomputes.set(n,i)),i.push(o)),o}assertPoint(t){if(!(t instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof t)}validateMulInput(t,n){if(this.assertPoint(t),!NM(n,N1,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,n,s,r){const i=L2(t);return i===1?this.fixedWindowCT(t,n,s):this.wnafCachedCT(this.getWnafPrecomputes(i,t,s,r),n)}mulCT(t,n,s){return this.validateMulInput(t,n),this.runCT(t,n,this.bits,s)}mulCTBlinded(t,n,s){if(this.validateMulInput(t,n),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");const r=this.Point.Fn.BITS+G8,i=this.randomBytes(I2);if(!EM(i)||i.length!==I2)throw new Error("randomBytes returned invalid byte array");i[0]=i[0]&63|128;const o=n+MM(i)*this.Point.Fn.ORDER;return this.runCT(t,o,r,s)}fixedWindowCT(t,n,s){const r=bX,i=1<<r,o=lX(r),l=new Array(i);l[0]=this.ZERO;for(let d=1;d<i;d++)l[d]=l[d-1].add(t);const c=Math.ceil(s/r);let u=this.ZERO;for(let d=c-1;d>=0;d--){if(d!==c-1)for(let x=0;x<r;x++)u=u.double();const f=Number(n>>BigInt(d*r)&o);let h=l[0];for(let x=1;x<i;x++)h=x===f?l[x]:h;u=u.add(h)}return{p:u,f:u}}shouldBlind(t,n){return this.randomBytes===void 0?!1:n===N1?!0:t!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(t,n,s,r){return this.shouldBlind(t,s)?this.mulCTBlinded(t,n,r):this.mulCT(t,n,r)}mulUnsafe(t,n,s){if(this.assertPoint(t),!sc(n))throw new Error("invalid scalar");const r=L2(t);if(r===1||n>=this.Point.Fn.ORDER)return NX(this.Point,[t],[n],!0);const i=this.getWnafPrecomputes(r,t,this.bits,s);return this.wnafCachedCT(i,n).p}setWindowSize(t,n){this.assertPoint(t),jX(n,this.bits);const s=Math.ceil((this.bits+G8)/n)+1;SX(s*2**(n-1),this.Point.Fp.BYTES),qM.set(t,n),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return L2(t)!==1}}function NX(e,t,n,s=!1){if(k3(e),HM(t,e),Xg(s,"allowOversized"),EX(n,e.Fn,s?e.Fn.ORDER**kX:void 0),t.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const r=t.map(o=>$X(o,4)),i=n.map(o=>AX(o,4));return TX(e.ZERO,r,i)}function K8(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return z1(t),t}else return y3(e,{isLE:n})}function _X(e,t,n={},s){if(s===void 0&&(s=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);Ox(n);for(const c of["p","n","h"]){const u=t[c];if(!(sc(u)&&u!==v3))throw new Error(`CURVE.${c} must be positive bigint`)}const r=K8(t.p,n.Fp,s),i=K8(t.n,n.Fn,s),l=["Gx","Gy","a","d"];for(const c of l)if(!r.isValid(t[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:r,Fn:i}}function RX(e,t){return function(s){const r=e(s);return{secretKey:r,publicKey:t(r)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const v0=BigInt(0),k0=BigInt(1),b0=BigInt(2),IX=BigInt(4),X8=BigInt(8);function LX(e,t,n,s){const r=e.sqr(n),i=e.sqr(s),o=e.add(e.mul(t.a,r),i),l=e.add(e.ONE,e.mul(t.d,e.mul(r,i)));return e.eql(o,l)}function OX(e,t={}){Ox(t,{},{},"extraOpts");const n=t,s=_X("edwards",e,n,n.FpFnLE),{Fp:r,Fn:i}=s;let o=s.CURVE;const{h:l}=o;if(Dx(r,o.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Dx(r,o.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Ox(n,{},{uvRatio:"function",randomBytes:"function"});const c=n.randomBytes===void 0?$M:n.randomBytes,u=b0<<BigInt(r.BYTES*8)-k0;function d(b){if(!r.isOdd)throw new Error("Field does not have .isOdd()");return r.isOdd(b)}const f=n.uvRatio===void 0?(b,j)=>{try{return{isValid:!0,value:r.sqrt(r.div(b,j))}}catch{return{isValid:!1,value:v0}}}:n.uvRatio;if(!LX(r,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");const h=r.eql(o.a,r.neg(r.ONE))?b=>r.neg(b):r.eql(o.a,r.ONE)?b=>b:b=>r.mul(o.a,b);function x(b,j,A=!1){const M=A?k0:v0;return Jf("coordinate "+b,j,M,u),j}function g(b){if(!(b instanceof y))throw new Error("EdwardsPoint expected")}const k=class k{constructor(j,A,M,E){ge(this,"X");ge(this,"Y");ge(this,"Z");ge(this,"T");this.X=x("x",j),this.Y=x("y",A),this.Z=x("z",M,!0),this.T=x("t",E),Object.freeze(this)}static CURVE(){return o}static fromAffine(j){if(j instanceof k)throw new Error("extended point not allowed");const{x:A,y:M}=j||{};return x("x",A),x("y",M),new k(A,M,r.ONE,r.mul(A,M))}static fromBytes(j,A=!1){const M=r.BYTES,{a:E,d:z}=o;j=T1(zu(j,M,"point")),Xg(A,"zip215");const T=T1(j),$=j[M-1];T[M-1]=$&-129;const _=Lx(T),R=A?u:r.ORDER;Jf("point.y",_,v0,R);const N=r.sqr(_),H=r.sub(N,r.ONE),B=r.sub(r.mulN(z,N),E);let{isValid:I,value:L}=f(H,B);if(!I)throw new Error("bad point: invalid y coordinate");const O=d(L),D=($&128)!==0;if(!A&&r.is0(L)&&D)throw new Error("bad point: x=0 and x_0=1");return D!==O&&(L=r.neg(L)),k.fromAffine({x:L,y:_})}static fromHex(j,A=!1){return k.fromBytes(rX(j),A)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(j=6,A=!0){return m.setWindowSize(this,j),A||this.multiply(b0),this}assertValidity(){const j=this,{a:A,d:M}=o;if(j.is0())throw new Error("bad point: ZERO");const{X:E,Y:z,Z:T,T:$}=j,_=r.sqr(E),R=r.sqr(z),N=r.sqr(T),H=r.sqr(N),B=r.mul(_,A),I=r.mul(r.add(B,R),N),L=r.add(H,r.mul(M,r.mul(_,R)));if(!r.eql(I,L))throw new Error("bad point: equation left != right (1)");const O=r.mul(E,z),D=r.mul(T,$);if(!r.eql(O,D))throw new Error("bad point: equation left != right (2)")}equals(j){g(j);const{X:A,Y:M,Z:E}=this,{X:z,Y:T,Z:$}=j,_=r.mul(A,$),R=r.mul(z,E),N=r.mul(M,$),H=r.mul(T,E);return r.eql(_,R)&&r.eql(N,H)}is0(){return this.equals(k.ZERO)}negate(){return new k(r.neg(this.X),this.Y,this.Z,r.neg(this.T))}double(){const{X:j,Y:A,Z:M}=this,E=r.sqr(j),z=r.sqr(A),T=r.mul(r.sqr(M),b0),$=h(E),_=r.addN(j,A),R=r.sub(r.subN(r.sqr(_),E),z),N=r.addN($,z),H=r.subN(N,T),B=r.subN($,z),I=r.mul(R,H),L=r.mul(N,B),O=r.mul(R,B),D=r.mul(H,N);return new k(I,L,D,O)}add(j){g(j);const{d:A}=o,{X:M,Y:E,Z:z,T}=this,{X:$,Y:_,Z:R,T:N}=j,H=r.mul(M,$),B=r.mul(E,_),I=r.mul(r.mulN(T,A),N),L=r.mul(z,R),O=r.sub(r.subN(r.mulN(r.addN(M,E),r.addN($,_)),H),B),D=r.subN(L,I),q=r.addN(L,I),F=r.sub(B,h(H)),K=r.mul(O,D),Z=r.mul(q,F),se=r.mul(O,F),ne=r.mul(D,q);return new k(K,Z,ne,se)}subtract(j){return g(j),this.add(j.negate())}multiply(j){if(!i.isValidNot0(j))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:A,f:M}=m.mulSecret(this,j,l,v);return v([A,M])[0]}multiplyUnsafe(j){if(!i.isValid(j))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return j===v0?k.ZERO:this.is0()||j===k0?this:m.mulUnsafe(this,j,v)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return m.mulUnsafe(this,o.n).is0()}toAffine(j){const A=this;let M=j;if(M!=null&&typeof M!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof M);const{X:E,Y:z,Z:T}=A,$=A.is0();M==null&&(M=$?r.create(X8):r.inv(T));const _=r.mul(E,M),R=r.mul(z,M),N=r.mul(T,M);if($)return{x:r.ZERO,y:r.ONE};if(!r.eql(N,r.ONE))throw new Error("invZ was invalid");return{x:_,y:R}}clearCofactor(){return l===k0?this:l===b0?this.double():l===IX?this.double().double():l===X8?this.double().double().double():this.multiplyUnsafe(l)}toBytes(){const{x:j,y:A}=this.toAffine(),M=r.toBytes(A);return M[M.length-1]|=d(j)?128:0,M}toHex(){return sX(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};ge(k,"BASE",new k(o.Gx,o.Gy,r.ONE,r.mul(o.Gx,o.Gy))),ge(k,"ZERO",new k(r.ZERO,r.ONE,r.ONE,r.ZERO)),ge(k,"Fp",r),ge(k,"Fn",i);let y=k;const v=b=>wX(y,b),m=new zX(y,c);return m.bits>=6&&y.BASE.precompute(6),Object.freeze(y.prototype),Object.freeze(y),y}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const il=BigInt(0),Sr=BigInt(1),w0=BigInt(2);function Z8(e,t){return e+t-(t>>Sr<<Sr)}function DX(e){const t=BigInt(6)*e;return(n,s,r)=>{const i=s+r,l=((t+r-s)*n+s)%e;return{x_2:l,x_3:i-l}}}function BX(e){return Ox(e,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...e})}function HX(e){const t=BX(e),{P:n,type:s,adjustScalarBytes:r,powPminus2:i,randomBytes:o}=t,l=t.scalarMultBase,c=s==="x25519";if(!c&&s!=="x448")throw new Error("invalid type");const u=o===void 0?$M:o,d=c?255:448,f=DX(n),h=c?32:56,x=BigInt(c?9:5),g=BigInt(c?121665:39081),y=c?w0**BigInt(254):w0**BigInt(447),v=c?BigInt(8)*(w0**BigInt(251)-Sr):BigInt(4)*(w0**BigInt(445)-Sr),m=y+v+Sr,k=I=>_t(I,n),b=j(x);function j(I){return zM(k(I),h)}function A(I){const L=T1(zu(I,h,"uCoordinate"));return c&&(L[31]&=127),k(Lx(L))}function M(I){return Lx(r(T1(zu(I,h,"scalar"))))}const E=new Set(c?[il,Sr,n-Sr,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[il,Sr,n-Sr]);function z(I,L){const O=A(L);if(E.has(O))throw new Error("invalid private or public key received");const D=R(O,M(I));if(D===il)throw new Error("invalid private or public key received");return j(D)}function T(I){if(l===void 0)return z(I,b);const L=M(I);Jf("scalar",L,y,m);const O=k(l(L));if(O===il)throw new Error("invalid private or public key received");return j(O)}const $=T,_=z;function R(I,L){Jf("u",I,il,n),Jf("scalar",L,y,m);const O=L,D=I;let q=Sr,F=il,K=I,Z=Sr;const se=O^O>>Sr;for(let P=BigInt(d-1);P>=il;P--){const U=Z8(n,se>>P);({x_2:q,x_3:K}=f(U,q,K)),{x_2:F,x_3:Z}=f(U,F,Z);const X=q+F,ie=k(X*X),te=q-F,de=k(te*te),fe=ie-de,he=K+Z,V=K-Z,xe=k(V*X),ve=k(he*te),ke=xe+ve,me=xe-ve;K=k(ke*ke),Z=k(D*k(me*me)),q=k(ie*de),F=k(fe*(ie+k(g*fe)))}const ne=Z8(n,O);({x_2:q,x_3:K}=f(ne,q,K)),{x_2:F,x_3:Z}=f(ne,F,Z);const ue=i(F);return k(q*ue)}const N={secretKey:h,publicKey:h,seed:h},H=I=>(I=I===void 0?u(h):I,zu(I,N.seed,"seed"),I),B={randomSecretKey:H};return Object.freeze(N),Object.freeze(B),Object.freeze({keygen:RX(H,$),getSharedSecret:_,getPublicKey:$,scalarMult:z,scalarMultBase:T,utils:B,GuBytes:b.slice(),lengths:N})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y8=BigInt(0),qX=BigInt(1),Q8=BigInt(2),PX=BigInt(3),UX=BigInt(5),FX=BigInt(8),Zg=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),VX={p:Zg,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:FX,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function PM(e){const t=BigInt(10),n=BigInt(20),s=BigInt(40),r=BigInt(80),i=Zg,l=e*e%i*e%i,c=Wr(l,Q8,i)*l%i,u=Wr(c,qX,i)*e%i,d=Wr(u,UX,i)*u%i,f=Wr(d,t,i)*d%i,h=Wr(f,n,i)*f%i,x=Wr(h,s,i)*h%i,g=Wr(x,r,i)*x%i,y=Wr(g,r,i)*x%i,v=Wr(y,t,i)*d%i;return{pow_p_5_8:Wr(v,Q8,i)*e%i,b2:l}}function GX(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const J8=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function WX(e,t){const n=Zg,s=_t(t*t*t,n),r=_t(s*s*t,n),i=PM(e*r).pow_p_5_8;let o=_t(e*s*i,n);const l=_t(t*o*o,n),c=o,u=_t(o*J8,n),d=l===e,f=l===_t(-e,n),h=l===_t(-e*J8,n);return d&&(o=c),(f||h)&&(o=u),mX(o,n)&&(o=_t(-o,n)),{isValid:d||f,value:o}}const e9=OX(VX,{uvRatio:WX}),b3=(()=>{const e=Zg,t=n=>{const{pow_p_5_8:s,b2:r}=PM(n);return _t(Wr(s,PX,e)*r,e)};return HX({P:e,type:"x25519",powPminus2:t,adjustScalarBytes:GX,scalarMultBase:n=>{const s=_t(n,e9.Fn.ORDER);if(s===Y8)return Y8;const r=e9.BASE.multiply(s);return _t((r.Z+r.Y)*t(_t(r.Z-r.Y,e)),e)}})})(),KX=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Uo(e,t,n,s,r){return e=e+t+r|0,s=Rx(s^e,16),n=n+s|0,t=Rx(t^n,12),{a:e,b:t,c:n,d:s}}function Fo(e,t,n,s,r){return e=e+t+r|0,s=Rx(s^e,8),n=n+s|0,t=Rx(t^n,7),{a:e,b:t,c:n,d:s}}function XX(e,t={},n,s,r){if(Ao(n),e<=0||e>n)throw new Error('"dkLen" must be 1..'+n+", got "+e);const{key:i,salt:o,personalization:l}=t;if(i!==void 0&&(i.length<1||i.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);o!==void 0&&Or(o,s,"salt"),l!==void 0&&Or(l,r,"personalization")}class ZX{constructor(t,n){ge(this,"buffer");ge(this,"buffer32");ge(this,"finished",!1);ge(this,"destroyed",!1);ge(this,"length",0);ge(this,"pos",0);ge(this,"blockLen");ge(this,"outputLen");ge(this,"canXOF",!1);Ao(t),Ao(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=_x(this.buffer)}update(t){Nx(this),Or(t);const{blockLen:n,buffer:s,buffer32:r}=this,i=t.length,o=t.byteOffset,l=t.buffer;for(let c=0;c<i;){this.pos===n&&(qc(r),this.compress(r,0,!1),qc(r),this.pos=0);const u=Math.min(n-this.pos,i-c),d=o+c;if(u===n&&!(d%4)&&c+u<i){const f=new Uint32Array(l,d,Math.floor((i-c)/4));qc(f);for(let h=0;c+n<i;h+=r.length,c+=n)this.length+=n,this.compress(f,h,!1);qc(f);continue}s.set(c===0&&u===i?t:t.subarray(c,c+u),this.pos),this.pos+=u,this.length+=u,c+=u}return this}digestInto(t){if(Nx(this),yM(t,this),t.byteOffset&3)throw new RangeError('"output" expected 4-byte aligned byteOffset, got '+t.byteOffset);const{pos:n,buffer32:s}=this;this.finished=!0,this.buffer.fill(0,n),qc(s),this.compress(s,0,!0),qc(s);const r=this.get(),i=t===this.buffer?s:_x(t),o=Math.floor(this.outputLen/4);for(let d=0;d<o;d++)i[d]=jf(r[d]);const l=this.outputLen%4;if(!l)return;const c=o*4,u=r[o];for(let d=0;d<l;d++)t[c+d]=u>>>8*d}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){const{buffer:n,length:s,finished:r,destroyed:i,outputLen:o,pos:l}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.buffer.set(n),t.destroyed=i,t.finished=r,t.length=s,t.pos=l,t.outputLen=o,t}clone(){return this._cloneInto()}}function YX(e,t,n,s,r,i,o,l,c,u,d,f,h,x,g,y,v,m,k,b){let j=0;for(let A=0;A<s;A++)({a:r,b:c,c:h,d:v}=Uo(r,c,h,v,n[t+e[j++]])),{a:r,b:c,c:h,d:v}=Fo(r,c,h,v,n[t+e[j++]]),{a:i,b:u,c:x,d:m}=Uo(i,u,x,m,n[t+e[j++]]),{a:i,b:u,c:x,d:m}=Fo(i,u,x,m,n[t+e[j++]]),{a:o,b:d,c:g,d:k}=Uo(o,d,g,k,n[t+e[j++]]),{a:o,b:d,c:g,d:k}=Fo(o,d,g,k,n[t+e[j++]]),{a:l,b:f,c:y,d:b}=Uo(l,f,y,b,n[t+e[j++]]),{a:l,b:f,c:y,d:b}=Fo(l,f,y,b,n[t+e[j++]]),{a:r,b:u,c:g,d:b}=Uo(r,u,g,b,n[t+e[j++]]),{a:r,b:u,c:g,d:b}=Fo(r,u,g,b,n[t+e[j++]]),{a:i,b:d,c:y,d:v}=Uo(i,d,y,v,n[t+e[j++]]),{a:i,b:d,c:y,d:v}=Fo(i,d,y,v,n[t+e[j++]]),{a:o,b:f,c:h,d:m}=Uo(o,f,h,m,n[t+e[j++]]),{a:o,b:f,c:h,d:m}=Fo(o,f,h,m,n[t+e[j++]]),{a:l,b:c,c:x,d:k}=Uo(l,c,x,k,n[t+e[j++]]),{a:l,b:c,c:x,d:k}=Fo(l,c,x,k,n[t+e[j++]]);return{v0:r,v1:i,v2:o,v3:l,v4:c,v5:u,v6:d,v7:f,v8:h,v9:x,v10:g,v11:y,v12:v,v13:m,v14:k,v15:b}}const qn=nX.slice();class QX extends ZX{constructor(n={}){n=jM({},n);const s=n.dkLen===void 0?32:n.dkLen;super(64,s);ge(this,"v0",qn[0]|0);ge(this,"v1",qn[1]|0);ge(this,"v2",qn[2]|0);ge(this,"v3",qn[3]|0);ge(this,"v4",qn[4]|0);ge(this,"v5",qn[5]|0);ge(this,"v6",qn[6]|0);ge(this,"v7",qn[7]|0);XX(s,n,32,8,8);let{key:r,personalization:i,salt:o}=n,l=0;if(r!==void 0&&(Or(r,void 0,"key"),l=r.length),this.v0^=this.outputLen|l<<8|65536|1<<24,o!==void 0){Or(o,void 0,"salt");const c=_x(B8(o));this.v4^=jf(c[0]),this.v5^=jf(c[1])}if(i!==void 0){Or(i,void 0,"personalization");const c=_x(B8(i));this.v6^=jf(c[0]),this.v7^=jf(c[1])}if(r!==void 0){const c=new Uint8Array(this.blockLen);c.set(r),this.update(c),Wv(c)}}get(){const{v0:n,v1:s,v2:r,v3:i,v4:o,v5:l,v6:c,v7:u}=this;return[n,s,r,i,o,l,c,u]}set(n,s,r,i,o,l,c,u){this.v0=n|0,this.v1=s|0,this.v2=r|0,this.v3=i|0,this.v4=o|0,this.v5=l|0,this.v6=c|0,this.v7=u|0}compress(n,s,r){const i=XK(this.length),o=KK(this.length),{v0:l,v1:c,v2:u,v3:d,v4:f,v5:h,v6:x,v7:g,v8:y,v9:v,v10:m,v11:k,v12:b,v13:j,v14:A,v15:M}=YX(KX,s,n,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,qn[0],qn[1],qn[2],qn[3],i^qn[4],o^qn[5],r?~qn[6]:qn[6],qn[7]);this.v0^=l^y,this.v1^=c^v,this.v2^=u^m,this.v3^=d^k,this.v4^=f^b,this.v5^=h^j,this.v6^=x^A,this.v7^=g^M}destroy(){this.destroyed=!0,Wv(this.buffer32),this.set(0,0,0,0,0,0,0,0)}}const rp=eX(e=>new QX(e));class t9{constructor(t,n){ge(this,"oHash");ge(this,"iHash");ge(this,"blockLen");ge(this,"outputLen");ge(this,"canXOF",!1);ge(this,"finished",!1);ge(this,"destroyed",!1);if(ZK(t),Or(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,r=new Uint8Array(s);r.set(n.length>s?t.create().update(n).digest():n);for(let i=0;i<r.length;i++)r[i]^=54;this.iHash.update(r),this.oHash=t.create();for(let i=0;i<r.length;i++)r[i]^=106;this.oHash.update(r),Wv(r)}update(t){return Nx(this),this.iHash.update(t),this}digestInto(t){Nx(this),yM(t,this),this.finished=!0;const n=t.subarray(0,this.outputLen);this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:s,finished:r,destroyed:i,blockLen:o,outputLen:l,canXOF:c}=this;return t=t,t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=l,t.canXOF=c,t.oHash=n._cloneInto(t.oHash),t.iHash=s._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const O2=(()=>{const e=(t,n,s)=>new t9(t,n).update(s).digest();return e.create=(t,n)=>new t9(t,n),e})(),JX=new TextEncoder().encode("Noise_IK_25519_ChaChaPoly_BLAKE2s"),lo=32,n9=65535,eZ=2n**64n-1n,s9=e=>rp(e,{dkLen:lo}),Bx=(...e)=>{const t=new Uint8Array(e.reduce((s,r)=>s+r.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t};function r9(e,t,n){const s=O2(rp,e,t),r=O2(rp,s,new Uint8Array([1])),i=O2(rp,s,Bx(r,new Uint8Array([2])));return[r,i]}function w3(){return _1(b3.utils.randomSecretKey())}function _1(e){if(e.length!==lo)throw new Error(`X25519 private key must be ${lo} bytes`);return{publicKey:b3.getPublicKey(e),privateKey:e}}const Hx=(e,t)=>b3.getSharedSecret(e.privateKey,t);var Lu,_l,P1,Xv;class D2{constructor(){ae(this,P1);ae(this,Lu);ae(this,_l,0n)}setKey(t){G(this,Lu,t),G(this,_l,0n)}encrypt(t,n=new Uint8Array(0)){const s=S(this,Lu);return s===void 0?t:D8(s,C(this,P1,Xv).call(this),n).encrypt(t)}decrypt(t,n=new Uint8Array(0)){const s=S(this,Lu);return s===void 0?t:D8(s,C(this,P1,Xv).call(this),n).decrypt(t)}}Lu=new WeakMap,_l=new WeakMap,P1=new WeakSet,Xv=function(){if(S(this,_l)===eZ)throw new Error("nonce exhausted");const t=new Uint8Array(12);return new DataView(t.buffer).setBigUint64(4,S(this,_l),!0),G(this,_l,S(this,_l)+1n),t};var Rl,yi;class tZ{constructor(){ae(this,Rl);ae(this,yi);ge(this,"cipher",new D2);const t=JX;G(this,yi,t.length<=lo?Bx(t,new Uint8Array(lo-t.length)):s9(t)),G(this,Rl,S(this,yi).slice())}mixKey(t){const[n,s]=r9(S(this,Rl),t);G(this,Rl,n),this.cipher.setKey(s.subarray(0,lo))}mixHash(t){G(this,yi,s9(Bx(S(this,yi),t)))}encryptAndHash(t){const n=this.cipher.encrypt(t,S(this,yi));return this.mixHash(n),n}decryptAndHash(t){const n=this.cipher.decrypt(t,S(this,yi));return this.mixHash(t),n}get handshakeHash(){return S(this,yi)}split(){const[t,n]=r9(S(this,Rl),new Uint8Array(0)),s=new D2;s.setKey(t.subarray(0,lo));const r=new D2;return r.setKey(n.subarray(0,lo)),[s,r]}}Rl=new WeakMap,yi=new WeakMap;function UM(e,t){if(e.offset+t>e.buffer.length)throw new Error("malformed Noise message");const n=e.buffer.subarray(e.offset,e.offset+t);return e.offset+=t,n}function nZ(e,t,n,s){t.push(n.ephemeral.publicKey),e.mixHash(n.ephemeral.publicKey),e.mixKey(Hx(n.ephemeral,s)),t.push(e.encryptAndHash(n.static.publicKey)),e.mixKey(Hx(n.static,s))}function sZ(e,t,n){const s=UM(t,lo).slice();return e.mixHash(s),e.mixKey(Hx(n.ephemeral,s)),e.mixKey(Hx(n.static,s)),s}const i9=(e,t)=>{if(e.length>n9)throw new Error(`${t} exceeds ${n9} bytes`)};function rZ(e,t){const n=new tZ;return n.mixHash(e),n.mixHash(t),n}function FM(e){const t=e.ephemeral??w3(),n=rZ(e.prologue,e.remoteStatic);return{writeMessage1(s){const r=[];nZ(n,r,{static:e.static,ephemeral:t},e.remoteStatic),r.push(n.encryptAndHash(s));const i=Bx(...r);return i9(i,"handshake message"),i},readMessage2(s){i9(s,"handshake message");const r={buffer:s,offset:0};sZ(n,r,{ephemeral:t,static:e.static});const i=n.decryptAndHash(UM(r,s.length-r.offset)),[o,l]=n.split();return{payload:i,result:{send:o,receive:l,handshakeHash:n.handshakeHash}}}}}const VM=new TextEncoder().encode("pinomad/1"),iZ=new TextEncoder().encode("pinomad-signal/1"),GM=new TextEncoder,WM=new TextDecoder("utf-8",{fatal:!0}),KM=e=>GM.encode(JSON.stringify(e));function oZ(e){try{return JSON.parse(WM.decode(e))}catch{throw new Error("handshake payload is not JSON")}}function XM(e){const t=oZ(e);if((t==null?void 0:t.v)!==1)throw new Error("unsupported host hello");return{v:1}}const Sf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Yg(e){let t="";for(let n=0;n<e.length;n+=3){const s=e[n],r=e[n+1],i=e[n+2];t+=Sf[s>>2]+Sf[(s&3)<<4|(r??0)>>4],r!==void 0&&(t+=Sf[(r&15)<<2|(i??0)>>6]),i!==void 0&&(t+=Sf[i&63])}return t}function Mo(e){if(e.length%4===1)throw new Error("invalid base64url");const t=new Map(Array.from(Sf,(s,r)=>[s,r])),n=[];for(let s=0;s<e.length;s+=4){const i=[...e.slice(s,s+4)].map(l=>{const c=t.get(l);if(c===void 0)throw new Error("invalid base64url");return c}),o=i.reduce((l,c,u)=>l|c<<18-u*6,0);n.push(o>>16&255),i.length>2&&n.push(o>>8&255),i.length>3&&n.push(o&255)}return new Uint8Array(n)}const j0=65518;var U1,F1,Ou;class ZM{constructor(t){ae(this,U1);ae(this,F1);ae(this,Ou,[]);G(this,U1,t.send),G(this,F1,t.receive)}seal(t){const n=GM.encode(t),s=[];for(let r=0;r<=n.length;r+=j0){const i=r+j0>=n.length,o=new Uint8Array(1+Math.min(j0,n.length-r));if(o[0]=i?0:1,o.set(n.subarray(r,r+j0),1),s.push(S(this,U1).encrypt(o)),i)break}return s}open(t){const n=S(this,F1).decrypt(t),s=n[0];if(s!==0&&s!==1)throw new Error("bad record flag");if(S(this,Ou).push(n.subarray(1)),s===1)return;const r=aZ(S(this,Ou));return G(this,Ou,[]),WM.decode(r)}}U1=new WeakMap,F1=new WeakMap,Ou=new WeakMap;function aZ(e){const t=new Uint8Array(e.reduce((s,r)=>s+r.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t}function Zv(e){let t=e.pairing;return{label:e.url,open(n){const s=new WebSocket(e.url);s.binaryType="arraybuffer";const r=FM({prologue:e.prologue??VM,static:e.device,remoteStatic:e.hostKey});let i,o=[],l=!1,c=!1;const u=(f,h)=>{l||(l=!0,n.closed(f,h))},d=f=>{s.close(),u(1008,f)};return s.onopen=()=>{var h;(h=n.opened)==null||h.call(n);const f=t===void 0?{v:1}:{v:1,pair:t};s.send(r.writeMessage1(KM(f)))},s.onmessage=f=>{var h,x;try{const g=f.data instanceof ArrayBuffer?new Uint8Array(f.data):new Uint8Array(f.data);if(i===void 0){const{payload:y,result:v}=r.readMessage2(g);XM(y),i=new ZM(v),c||(c=!0,(h=n.authenticated)==null||h.call(n)),t!==void 0&&(t=void 0,(x=e.onPaired)==null||x.call(e));const m=o;o=[];for(const k of m)for(const b of i.seal(k))s.send(b)}else{const y=i.open(g);y!==void 0&&n.message(y)}}catch(g){d(g instanceof Error?g.message:"secure channel failure")}},s.onclose=f=>u(f.code,f.reason===""?void 0:f.reason),s.onerror=()=>{},{send(f){if(i===void 0){o.push(f);return}for(const h of i.seal(f))s.send(h)},close(){s.close()}}}}}const Yv=e=>{if(typeof e!="string")return!1;try{return Mo(e).length===32}catch{return!1}},lZ=e=>{if(typeof e!="string")return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}},cZ=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.serverOrigin=="string"&&t.serverOrigin!==""&&Yv(t.hostId)};function YM(e){if(typeof e!="object"||e===null)return;const t=e;if(!lZ(t.url)||!Yv(t.hostKey)||!Yv(t.privateKey))return;const n=cZ(t.account)?t.account:void 0,s=typeof t.name=="string"&&t.name!==""?t.name:void 0,r=Kg(t.endpointSet),i=xK(t.connectionMode),o=t.rtcSignalOnly===!0?!0:void 0;return{url:t.url,hostKey:t.hostKey,privateKey:t.privateKey,...s===void 0?{}:{name:s},...n===void 0?{}:{account:n},...r.kind==="valid"?{endpointSet:r.endpointSet}:{},...i===void 0?{}:{connectionMode:i},...o===void 0?{}:{rtcSignalOnly:o}}}function e1(e,t){const n=t.endpointSet??e.endpointSet,s=t.connectionMode??e.connectionMode,r=t.rtcSignalOnly??e.rtcSignalOnly,i=t.account!==void 0||e.account===void 0?void 0:t.privateKey===e.privateKey||e.account.vouched!==!0?e.account:{serverOrigin:e.account.serverOrigin,hostId:e.account.hostId};return{...t,...t.name===void 0&&e.name!==void 0?{name:e.name}:{},...i===void 0?{}:{account:i},...n===void 0?{}:{endpointSet:n},...s===void 0?{}:{connectionMode:s},...r===void 0?{}:{rtcSignalOnly:r}}}function QM(e,t){return{...e,endpointSet:t,url:h3(e.url,t)}}function JM(e,t){const n={...e};return"connectionMode"in t&&(t.connectionMode===void 0?delete n.connectionMode:n.connectionMode=t.connectionMode),"rtcSignalOnly"in t&&(t.rtcSignalOnly===void 0?delete n.rtcSignalOnly:n.rtcSignalOnly=t.rtcSignalOnly),n}function j3(e){const t=l=>{if(l.name!==void 0)return l.name;try{return new URL(l.url).host}catch{return l.url}},n=e.map(t),s=e.map(()=>0),r=new Map;for(const l of n)r.set(l,(r.get(l)??0)+1);n.forEach((l,c)=>{r.get(l)>1&&(s[c]=6)});const i=l=>s[l]===0?n[l]:`${n[l]} · ${e[l].hostKey.slice(0,s[l])}`;for(;;){const l=new Map,c=new Set;if(e.forEach((d,f)=>{const h=l.get(i(f));h===void 0?l.set(i(f),f):(c.add(h),c.add(f))}),c.size===0)break;let u=!1;for(const d of c)s[d]>0&&s[d]<e[d].hostKey.length&&(s[d]+=1,u=!0);if(!u)break}const o=new Map;return e.forEach((l,c)=>o.set(l.hostKey,i(c))),o}function yd(){typeof Notification>"u"||Notification.permission!=="default"||Notification.requestPermission()}const uZ=100*1024*1024,dZ=4,Xc=(e,t)=>`${t}:${e}`,o9=(e,t,n)=>`${e??""}\0${Xc(t,n)}`;var V1,rs,ia,Il,oa,vi,bo,Qv,ip;class fZ{constructor(t=uZ){ae(this,bo);ae(this,V1);ae(this,rs,new Map);ae(this,ia,new Map);ae(this,Il,[]);ae(this,oa,0);ae(this,vi,new Map);G(this,V1,t)}peek(t,n="original"){const s=S(this,rs).get(Xc(t,n));return s!==void 0||n==="original"?s:S(this,rs).get(Xc(t,"original"))}get(t,n="original"){let s=Xc(t,n);!S(this,rs).has(s)&&n!=="original"&&(s=Xc(t,"original"));const r=S(this,rs).get(s);if(r!==void 0)return S(this,rs).delete(s),S(this,rs).set(s,r),r}prime(t,n,s="original"){const r=Xc(t,s),i=S(this,rs).get(r);for(i!==void 0&&G(this,oa,S(this,oa)-i.data.length),S(this,rs).delete(r),S(this,rs).set(r,n),G(this,oa,S(this,oa)+n.data.length);S(this,oa)>S(this,V1);){const o=S(this,rs).keys().next().value;if(o===void 0)break;const l=S(this,rs).get(o);S(this,rs).delete(o),G(this,oa,S(this,oa)-l.data.length)}}load(t,n,s="original",r){const i=this.get(t,s);if(i!==void 0)return Promise.resolve(i);const o=r??"",l=o9(r,t,s),c=S(this,ia).get(l)??(s==="original"?void 0:S(this,ia).get(o9(r,t,"original")));if(c!==void 0)return c;const u=new Promise((d,f)=>{S(this,Il).push({key:l,source:o,ref:t,variant:s,loader:n,resolve:d,reject:f})});return S(this,ia).set(l,u),C(this,bo,Qv).call(this),u}clear(){S(this,rs).clear(),S(this,ia).clear(),S(this,Il).length=0,G(this,oa,0),S(this,vi).clear()}}V1=new WeakMap,rs=new WeakMap,ia=new WeakMap,Il=new WeakMap,oa=new WeakMap,vi=new WeakMap,bo=new WeakSet,Qv=function(){for(;;){const t=S(this,Il).findIndex(r=>(S(this,vi).get(r.source)??0)<dZ);if(t===-1)return;const[n]=S(this,Il).splice(t,1);if(n===void 0)return;S(this,vi).set(n.source,(S(this,vi).get(n.source)??0)+1);let s;try{s=Promise.resolve(n.variant==="original"?n.loader(n.ref):n.loader(n.ref,n.variant))}catch(r){C(this,bo,ip).call(this,n),n.reject(r instanceof Error?r:new Error(String(r)));continue}s.then(r=>{this.prime(n.ref,r,r.variant??"original"),C(this,bo,ip).call(this,n),n.resolve(r)},r=>{C(this,bo,ip).call(this,n),n.reject(r instanceof Error?r:new Error(String(r)))})}},ip=function(t){S(this,ia).delete(t.key);const n=(S(this,vi).get(t.source)??1)-1;n<=0?S(this,vi).delete(t.source):S(this,vi).set(t.source,n),C(this,bo,Qv).call(this)};const sa=new fZ;async function hZ(e,t,n){return"data"in e?e:sa.load(e.ref,t,"original",n)}async function eT(e){await Promise.all(e.map(async t=>{if("data"in t)try{sa.prime(await iK(t),t)}catch{}}))}const _u=e=>`data:${e.mimeType};base64,${e.data}`,tT=p.createContext(void 0);function pZ({load:e,retryKey:t=0,source:n,children:s}){const r=p.useMemo(()=>({load:e,retryKey:t,...n===void 0?{}:{source:n}}),[e,t,n]);return a.jsx(tT.Provider,{value:r,children:s})}function xZ(e){var o;const[t,n]=p.useState(0),s=p.useRef(e.connection),r=p.useRef(void 0),i=p.useRef(void 0);return p.useEffect(()=>{if(e.connection==="connected"&&s.current!=="connected"){const l=r.current;l!==void 0&&(l.main!==void 0||l.side!==void 0)?i.current={...l}:i.current=void 0}e.connection!=="connected"&&(i.current=void 0),s.current=e.connection},[e.connection]),p.useEffect(()=>{var c,u;if(e.connection!=="connected")return;const l=i.current;if(l!==void 0){let d=!1;if(l.main!==void 0&&e.conversation!==l.main&&(l.main=void 0,d=!0),l.side!==void 0&&((c=e.side)==null?void 0:c.conversation)!==l.side&&(l.side=void 0,d=!0),!d)return;l.main===void 0&&l.side===void 0&&(i.current=void 0),n(f=>f+1)}i.current===void 0&&(r.current={...e.conversation===void 0?{}:{main:e.conversation},...((u=e.side)==null?void 0:u.conversation)===void 0?{}:{side:e.side.conversation}})},[e.connection,e.conversation,(o=e.side)==null?void 0:o.conversation]),t}function S3(e,t,n="original",s=0){const r=p.useContext(tT),i=e!==void 0&&"ref"in e?e.ref:void 0,o=i===void 0?void 0:`${(r==null?void 0:r.source)??""}:${n}:${i}`,[l,c]=p.useState(void 0),u=(r==null?void 0:r.retryKey)??0,d=r==null?void 0:r.load,f=r==null?void 0:r.source;if(p.useEffect(()=>{if(i===void 0||o===void 0)return;const g=sa.get(i,n);if(g!==void 0){c({key:o,image:g});return}if(!t||d===void 0)return;let y=!1;return c(void 0),(n==="original"?sa.load(i,d,"original",f):sa.load(i,d,n,f).catch(()=>sa.load(i,d,"original",f))).then(m=>{y||c({key:o,image:m})},()=>{y||c({key:o,failed:!0})}),()=>{y=!0}},[i,o,t,u,d,f,n,s]),e===void 0)return{status:"loading"};if("data"in e)return{status:"ready",src:_u(e)};const h=(l==null?void 0:l.key)===o?l:void 0;if(h!==void 0)return"image"in h?{status:"ready",src:_u(h.image)}:{status:"error"};if(i===void 0)return{status:"loading"};const x=sa.peek(i,n);return x!==void 0?{status:"ready",src:_u(x)}:{status:"loading"}}function nT(){const[e,t]=p.useState(null),[n,s]=p.useState(!1);return p.useEffect(()=>{if(e===null)return;if(typeof IntersectionObserver>"u"){s(!0);return}const r=new IntersectionObserver(i=>{i.some(o=>o.isIntersecting)&&(s(!0),r.disconnect())},{rootMargin:"100% 0px"});return r.observe(e),()=>r.disconnect()},[e]),[t,n]}function a9(e,t="original"){if("data"in e)return _u(e);const n=sa.peek(e.ref,t);return n===void 0?void 0:_u(n)}const gZ=e=>{const t=[],n=s=>{t.push(s.summary);for(const r of s.children)n(r)};for(const s of[...e.chats,...e.projects.flatMap(r=>r.conversations)])n(s);return t};function mZ(e,t){const n=[],s=[],r=new Map;for(const i of gZ(t)){if(r.set(i.id,i.status),e===void 0)continue;const o=e.get(i.id);if(o!==i.status&&s.push(i.id),i.status==="needs-answer"&&o!=="needs-answer"){n.push({id:i.id,title:Ds(i),body:"Waiting for your answer"});continue}(o==="running"||o==="needs-answer")&&(i.status===void 0||i.status==="failed")&&i.kind!=="subagent"&&n.push({id:i.id,title:Ds(i),body:i.status==="failed"?"Failed":"Finished"})}if(e!==void 0)for(const i of e.keys())r.has(i)||s.push(i);return{notices:n,changed:s,baseline:r}}function sT(e,t,n,s,r=!0){const i=p.useRef(void 0),o=p.useRef(new Map),l=p.useRef(s);l.current=s,p.useEffect(()=>()=>{for(const c of o.current.values())c.close();o.current.clear()},[]),p.useEffect(()=>{var h;if(!r||e.connection!=="connected")return;const{notices:c,changed:u,baseline:d}=mZ(i.current,e.organized);i.current=d;for(const x of u)(h=o.current.get(x))==null||h.close(),o.current.delete(x);if(typeof Notification>"u"||Notification.permission!=="granted")return;const f=t??"local";for(const x of c){if(document.visibilityState==="visible"&&document.hasFocus()&&n===x.id)continue;const g=new Notification(x.title,{body:x.body,tag:`pinomad-conversation-${f}-${x.id}`});o.current.set(x.id,g),g.onclose=()=>{o.current.get(x.id)===g&&o.current.delete(x.id)},g.onclick=()=>{window.focus(),l.current({hostKey:f,conversationId:x.id}),g.close(),o.current.get(x.id)===g&&o.current.delete(x.id)}}},[r,t,n,e.connection,e.organized])}function rT(e){const[t,n]=p.useState(),s=p.useRef(0),r=p.useCallback(o=>{const l=++s.current;n({id:o,failed:!1}),e.controller.switchConversation(o).then(()=>{var u;if(l!==s.current)return;const c=((u=e.view.current().conversation)==null?void 0:u.conversation.id)===o;n(c?void 0:{id:o,failed:!0})})},[e]),i=p.useCallback(()=>{s.current++,n(void 0)},[]);return{opening:t,open:r,cancel:i}}const yZ="92px";function vZ(e){var n;return(typeof document>"u"||(n=document.documentElement)==null?void 0:n.dataset.pinomadPlatform)==="darwin"?"darwin":"other"}function C3(e=vZ()){return e==="darwin"?{platform:e,reserveMacTrafficLights:!0,safeLeft:yZ}:{platform:e,reserveMacTrafficLights:!1,safeLeft:"0px"}}const kZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},iT=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:r="",altIcon:i,showAlt:o=!1,icon:l,primaryColor:c,secondaryColor:u,disableSecondaryOpacity:d=!1,...f},h)=>{const x=n!==void 0?s?Number(n)*24/Number(t):n:void 0,g=x!==void 0?{strokeWidth:x,stroke:"currentColor"}:{},y={ref:h,...kZ,width:t,height:t,color:c||e,className:r,...g,...f},m=[...o&&i?i:l].sort(([,k],[,b])=>{const j=k.opacity!==void 0;return b.opacity!==void 0?1:j?-1:0}).map(([k,b])=>{const j=b.opacity!==void 0,A=j&&!d?b.opacity:void 0,M=u?{...b.stroke!==void 0?{stroke:j?u:c||e}:{fill:j?u:c||e}}:{};return p.createElement(k,{...b,...g,...M,opacity:A,key:b.key})});return p.createElement("svg",y,m)});iT.displayName="HugeiconsIcon";const bZ=[["path",{d:"M12.001 5.00003V19.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.002 12.002L4.99998 12.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],wZ=[["path",{d:"M6.53792 2.32172C6.69664 1.89276 7.30336 1.89276 7.46208 2.32172L8.1735 4.2443C8.27331 4.51403 8.48597 4.72669 8.7557 4.8265L10.6783 5.53792C11.1072 5.69664 11.1072 6.30336 10.6783 6.46208L8.7557 7.1735C8.48597 7.27331 8.27331 7.48597 8.1735 7.7557L7.46208 9.67828C7.30336 10.1072 6.69665 10.1072 6.53792 9.67828L5.8265 7.7557C5.72669 7.48597 5.51403 7.27331 5.2443 7.1735L3.32172 6.46208C2.89276 6.30336 2.89276 5.69665 3.32172 5.53792L5.2443 4.8265C5.51403 4.72669 5.72669 4.51403 5.8265 4.2443L6.53792 2.32172Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.4039 9.64136L15.8869 11.1244M6 22H7.49759C8.70997 22 9.31617 22 9.86124 21.7742C10.4063 21.5484 10.835 21.1198 11.6923 20.2625L19.8417 12.1131C20.3808 11.574 20.6503 11.3045 20.7944 11.0137C21.0685 10.4605 21.0685 9.81094 20.7944 9.25772C20.6503 8.96695 20.3808 8.69741 19.8417 8.15832C19.3026 7.61924 19.0331 7.3497 18.7423 7.20561C18.1891 6.93146 17.5395 6.93146 16.9863 7.20561C16.6955 7.3497 16.426 7.61924 15.8869 8.15832L7.73749 16.3077C6.8802 17.165 6.45156 17.5937 6.22578 18.1388C6 18.6838 6 19.29 6 20.5024V22Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],jZ=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.37545 7.99976H7.25045M7.37482 11.9999H7.24982M7.37498 15.9999H7.24998M7.50045 7.99976C7.50045 8.13783 7.38852 8.24976 7.25045 8.24976C7.11238 8.24976 7.00045 8.13783 7.00045 7.99976C7.00045 7.86169 7.11238 7.74976 7.25045 7.74976C7.38852 7.74976 7.50045 7.86169 7.50045 7.99976ZM7.49982 11.9999C7.49982 12.138 7.38789 12.2499 7.24982 12.2499C7.11175 12.2499 6.99982 12.138 6.99982 11.9999C6.99982 11.8618 7.11175 11.7499 7.24982 11.7499C7.38789 11.7499 7.49982 11.8618 7.49982 11.9999ZM7.49998 15.9999C7.49998 16.138 7.38805 16.2499 7.24998 16.2499C7.11191 16.2499 6.99998 16.138 6.99998 15.9999C6.99998 15.8618 7.11191 15.7499 7.24998 15.7499C7.38805 15.7499 7.49998 15.8618 7.49998 15.9999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 8H17M11 12H17M11 16H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],SZ=[["path",{d:"M8 3C7.28543 3.05475 6.78159 3.18135 6.34921 3.47408C5.58736 3.98988 5.22202 4.90323 4.49134 6.72994L2.42914 11.9271C2.21522 12.4619 2.10826 12.7293 2.05413 13.0104C2 13.2915 2 13.5795 2 14.1555V15C2 17.8284 2 19.2426 2.87868 20.1213C3.75736 21 5.17157 21 8 21H16C18.8284 21 20.2426 21 21.1213 20.1213C22 19.2426 22 17.8284 22 15V14.1555C22 13.5795 22 13.2915 21.9459 13.0104C21.8917 12.7293 21.7848 12.4619 21.5709 11.9271L19.5087 6.72994C18.778 4.90323 18.4126 3.98988 17.6508 3.47408C17.2184 3.18135 16.7146 3.05475 16 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 13H5.58579C6.16263 13 6.45105 13 6.71982 13.0766C6.86747 13.1187 7.00978 13.1776 7.14394 13.2523C7.38816 13.3882 7.59211 13.5921 8 14C8.40789 14.4079 8.61184 14.6118 8.85606 14.7477C8.99022 14.8224 9.13253 14.8813 9.28018 14.9234C9.54895 15 9.83737 15 10.4142 15H13.5858C14.1626 15 14.4511 15 14.7198 14.9234C14.8675 14.8813 15.0098 14.8224 15.1439 14.7477C15.3882 14.6118 15.5921 14.4079 16 14C16.4079 13.5921 16.6118 13.3882 16.8561 13.2523C16.9902 13.1776 17.1325 13.1187 17.2802 13.0766C17.5489 13 17.8374 13 18.4142 13H21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15 7.00002C15 7.00002 12.7905 9.99999 12 10C11.2094 10 9 7 9 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M12 3V9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],CZ=[["path",{d:"M9 15C9 15 11.2095 12 12 12C12.7906 12 15 15 15 15M12 13V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20 8V15.0093C20 17.8415 20 19.2576 19.1213 20.1375C18.48 20.7797 17.5534 20.9531 16 21M4 8V15.0093C4 17.8415 4 19.2576 4.87868 20.1375C5.51998 20.7797 6.44655 20.9531 7.99999 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M19.5 3H4.5C3.56538 3 3.09808 3 2.75 3.20096C2.52197 3.33261 2.33261 3.52197 2.20096 3.75C2 4.09808 2 4.56538 2 5.5C2 6.43462 2 6.90192 2.20096 7.25C2.33261 7.47803 2.52197 7.66739 2.75 7.79904C3.09808 8 3.56538 8 4.5 8H19.5C20.4346 8 20.9019 8 21.25 7.79904C21.478 7.66739 21.6674 7.47803 21.799 7.25C22 6.90192 22 6.43462 22 5.5C22 4.56538 22 4.09808 21.799 3.75C21.6674 3.52197 21.478 3.33261 21.25 3.20096C20.9019 3 20.4346 3 19.5 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],EZ=[["path",{d:"M13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21 12H3",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15 7H9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 17H9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],$Z=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],AZ=[["path",{d:"M16.998 7.12652C17.3182 7.04393 17.654 7 18 7C20.2091 7 22 8.79086 22 11C22 13.2091 20.2091 15 18 15C17.6451 15 17.3009 14.9538 16.9733 14.867M16.998 7.12652C16.9993 7.08451 17 7.04233 17 7C17 4.79086 15.2091 3 13 3C11.0824 3 9.47994 4.34939 9.09041 6.15043M16.998 7.12652C16.9769 7.80763 16.7854 8.44584 16.4649 9M16.9733 14.867C16.9909 14.7472 17 14.6247 17 14.5C17 13.2905 16.1411 12.2816 15 12.05M16.9733 14.867C16.7957 16.0737 15.756 17 14.5 17H14C11.7909 17 10 18.7909 10 21M9.09041 6.15043C8.74377 6.05243 8.37801 6 8 6C5.79086 6 4 7.79086 4 10C4 10.3886 4.05542 10.7643 4.15878 11.1195M9.09041 6.15043C10.1015 6.43625 10.9498 7.10965 11.4649 8M4.15878 11.1195C2.9114 11.4832 2 12.6352 2 14C2 15.6569 3.34315 17 5 17C6.30622 17 7.41746 16.1652 7.82929 15M4.15878 11.1195C4.24921 11.4303 4.37632 11.7255 4.53513 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.8361 11.7435C11.3257 12.2353 10.453 12.3202 9.70713 11.9008C8.9612 11.4814 8.58031 10.6917 8.73535 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],MZ=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.1257 12H12.0007M8.125 12H8M16.125 12H16M12.2507 12C12.2507 12.1381 12.1388 12.25 12.0007 12.25C11.8627 12.25 11.7507 12.1381 11.7507 12C11.7507 11.8619 11.8627 11.75 12.0007 11.75C12.1388 11.75 12.2507 11.8619 12.2507 12ZM8.25 12C8.25 12.1381 8.13807 12.25 8 12.25C7.86193 12.25 7.75 12.1381 7.75 12C7.75 11.8619 7.86193 11.75 8 11.75C8.13807 11.75 8.25 11.8619 8.25 12ZM16.25 12C16.25 12.1381 16.1381 12.25 16 12.25C15.8619 12.25 15.75 12.1381 15.75 12C15.75 11.8619 15.8619 11.75 16 11.75C16.1381 11.75 16.25 11.8619 16.25 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],TZ=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],zZ=[["path",{d:"M2 10.5C2 9.72921 2.01346 8.97679 2.03909 8.2503C2.12282 5.87683 2.16469 4.69009 3.13007 3.71745C4.09545 2.74481 5.3157 2.6926 7.7562 2.58819C9.09517 2.5309 10.5209 2.5 12 2.5C13.4791 2.5 14.9048 2.5309 16.2438 2.58819C18.6843 2.6926 19.9046 2.74481 20.8699 3.71745C21.8353 4.69009 21.8772 5.87683 21.9609 8.2503C21.9865 8.97679 22 9.72921 22 10.5C22 11.2708 21.9865 12.0232 21.9609 12.7497C21.8772 15.1232 21.8353 16.3099 20.8699 17.2826C19.9046 18.2552 18.6843 18.3074 16.2437 18.4118C15.5098 18.4432 14.7498 18.4667 13.9693 18.4815C13.2282 18.4955 12.8576 18.5026 12.532 18.6266C12.2064 18.7506 11.9325 18.9855 11.3845 19.4553L9.20503 21.3242C9.07273 21.4376 8.90419 21.5 8.72991 21.5C8.32679 21.5 8 21.1732 8 20.7701V18.4219C7.91842 18.4186 7.83715 18.4153 7.75619 18.4118C5.31569 18.3074 4.09545 18.2552 3.13007 17.2825C2.16469 16.3099 2.12282 15.1232 2.03909 12.7497C2.01346 12.0232 2 11.2708 2 10.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5 10.5H8.5M12 7V14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],NZ=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],_Z=[["path",{d:"M9.00005 18C9.00005 18 15 13.5811 15 12C15 10.4188 9 6 9 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],RZ=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],IZ=[["path",{d:"M14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2 6.34315 2 8.22876 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 8.22876 22 6.34315 20.8284 5.17157C19.6569 4 17.7712 4 14 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 9L8.83981 10.5858C9.61327 11.2525 10 11.5858 10 12C10 12.4142 9.61327 12.7475 8.83981 13.4142L7 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 16H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],LZ=[["path",{d:"M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],OZ=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],DZ=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],BZ=[["path",{d:"M8 7L16 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 11L12 11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],HZ=[["path",{d:"M5.9925 12V18M9 14.9925L3 14.9925",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 22H9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 22C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10.6569C21 9.83935 21 9.4306 20.8478 9.06306C20.6955 8.69552 20.4065 8.40649 19.8284 7.82843L15.0919 3.09188C14.593 2.593 14.3436 2.34355 14.0345 2.19575C13.9702 2.165 13.9044 2.13772 13.8372 2.11401C13.5141 2 13.1614 2 12.4558 2C9.21082 2 7.58831 2 6.48933 2.88607C6.26732 3.06508 6.06508 3.26731 5.88608 3.48933C5.14374 4.41003 5.02332 5.69818 5.00378 8M14 2.5V3C14 5.82843 14 7.24264 14.8787 8.12132C15.7574 9 17.1716 9 20 9H20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],qZ=[["path",{d:"M13.5 16.5L15 18M14 14.5C14 15.8807 12.8807 17 11.5 17C10.1193 17 9 15.8807 9 14.5C9 13.1193 10.1193 12 11.5 12C12.8807 12 14 13.1193 14 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],PZ=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]],UZ=[["path",{d:"M2 19V7.54902C2 6.10516 2 5.38322 2.24332 4.81647C2.5467 4.10985 3.10985 3.5467 3.81647 3.24332C4.38322 3 5.09805 3 6.54902 3H7.04311C7.64819 3 8.22075 3.27394 8.60041 3.74509L10.4175 6M10.4175 6H16C17.4001 6 18.1002 6 18.635 6.27248C19.1054 6.51217 19.4878 6.89462 19.7275 7.36502C20 7.8998 20 8.59987 20 10V11M10.4175 6H7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.15802 15.5144L3.45643 14.7717C4.19029 12.9449 4.55723 12.0316 5.3224 11.5158C6.08757 11 7.07557 11 9.05157 11H17.1119C19.8004 11 21.1446 11 21.7422 11.8787C22.3397 12.7575 21.8405 14.0002 20.842 16.4856L20.5436 17.2283C19.8097 19.0551 19.4428 19.9684 18.6776 20.4842C17.9124 21 16.9244 21 14.9484 21H6.88812C4.19961 21 2.85535 21 2.25782 20.1213C1.66029 19.2425 2.15953 17.9998 3.15802 15.5144Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],FZ=[["path",{d:"M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],VZ=[["path",{d:"M8 6.50116H16.75C18.8567 6.50116 19.91 6.50116 20.6667 7.0069C20.9943 7.22584 21.2755 7.50717 21.4944 7.83484C22 8.59173 22 9.64538 22 11.7527C22 12.0122 22 12.2621 21.9997 12.5029M12 6.50116L11.3666 5.23392C10.8418 4.18406 10.3622 3.1273 9.19926 2.69106C8.6899 2.5 8.10802 2.5 6.94427 2.5C5.1278 2.5 4.21956 2.5 3.53806 2.88043C3.05227 3.15161 2.65142 3.55257 2.38032 4.03851C2 4.72021 2 5.62871 2 7.44571V10.5023C2 15.2177 2 17.5754 3.46447 19.0403C4.70529 20.2815 6.58687 20.4711 10 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"14",cy:"12.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"20",cy:"18.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 18.5C15.7909 18.5 14 16.7091 14 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 14.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],GZ=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],WZ=[["path",{d:"M6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 20C13.1046 20 14 19.1046 14 18C14 16.8954 13.1046 16 12 16C10.8954 16 10 16.8954 10 18C10 19.1046 10.8954 20 12 20Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 8C19.1046 8 20 7.10457 20 6C20 4.89543 19.1046 4 18 4C16.8954 4 16 4.89543 16 6C16 7.10457 16.8954 8 18 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.01734 8.74067C6.01734 10.4142 5.77537 12.1995 9.22051 11.9855H12.0053M17.9929 8.57617C18.1259 11.9855 16.9199 11.7648 15.7861 11.9855H12.0053M12.0053 15.7001V11.9855",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],KZ=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12C8 18 12 22 12 22C12 22 16 18 16 12C16 6 12 2 12 2C12 2 8 6 8 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 15H3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M21 9H3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],XZ=[["path",{d:"M12 8.5L3.12132 17.3787C2.72349 17.7765 2.5 18.3161 2.5 18.8787C2.5 20.0503 3.44975 21 4.62132 21C5.18393 21 5.72349 20.7765 6.12132 20.3787L15 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.1207 5.03693L20.3682 9.3197C21.014 9.97093 21.3369 10.2966 21.4435 10.6774C21.5188 10.9467 21.5188 11.2317 21.4435 11.501C21.3369 11.8819 21.014 12.2075 20.3682 12.8587C19.7223 13.51 19.3994 13.8356 19.0216 13.943C18.7546 14.019 18.4719 14.019 18.2048 13.943C17.8271 13.8356 17.5042 13.51 16.8583 12.8587L10.0245 5.96802C8.99015 4.92507 8.47297 4.40359 8.50109 3.94831C8.51495 3.7239 8.60259 3.51054 8.75017 3.34197C9.04956 3 9.78095 3 11.2437 3C12.4209 3 13.0095 3 13.5574 3.16035C13.8406 3.24325 14.1139 3.3574 14.3723 3.50071C14.8721 3.77792 15.2883 4.19759 16.1207 5.03693Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],ZZ=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],YZ=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],QZ=[["path",{d:"M15 15.5C18.5899 15.5 21.5 12.5899 21.5 9C21.5 5.41015 18.5899 2.5 15 2.5C11.4101 2.5 8.5 5.41015 8.5 9C8.5 9.41773 8.5394 9.82625 8.6147 10.2221C8.75737 10.972 8.82871 11.347 8.75558 11.5844C8.68245 11.8217 8.47202 12.032 8.05118 12.4526L3.67253 16.8283C3.094 17.4064 2.80474 17.6955 2.65237 18.0631C2.5 18.4308 2.5 18.8398 2.5 19.6576V21.5H6V19.5H8V17.5H10L11.5526 15.9485C11.9729 15.5286 12.183 15.3186 12.4201 15.2456C12.6572 15.1726 13.0316 15.2436 13.7806 15.3858C14.1756 15.4608 14.5832 15.5 15 15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 7.5C18 8.32843 17.3284 9 16.5 9C15.6716 9 15 8.32843 15 7.5C15 6.67157 15.6716 6 16.5 6C17.3284 6 18 6.67157 18 7.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],JZ=[["path",{d:"M15.9999 13.5001V17.5001C15.9999 18.9143 15.9999 19.6214 16.4392 20.0608C16.8786 20.5001 17.5857 20.5001 18.9999 20.5001C20.4141 20.5001 21.1212 20.5001 21.5605 20.0608C21.9999 19.6214 21.9999 18.9143 21.9999 17.5001V13.5001C21.9999 12.0859 21.9999 11.3788 21.5605 10.9395C21.1212 10.5001 20.4141 10.5001 18.9999 10.5001C17.5857 10.5001 16.8786 10.5001 16.4392 10.9395C15.9999 11.3788 15.9999 12.0859 15.9999 13.5001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.99988 16.5005V8.50049C3.99988 6.14347 3.99988 4.96495 4.73254 4.23272C5.46521 3.50049 6.64442 3.50049 9.00283 3.50049H16.007C18.3654 3.50049 19.5446 3.50049 20.2773 4.23272C20.8346 4.78969 20.9679 5.60486 20.9999 7.00049",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.9999 20.5005H2.51567C2.13273 20.5005 1.88367 20.1093 2.05493 19.7769L3.99988 16.5005H12.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],eY=[["path",{d:"M11.0991 3.00012C7.45013 3.00669 5.53932 3.09629 4.31817 4.31764C3.00034 5.63568 3.00034 7.75704 3.00034 11.9997C3.00034 16.2424 3.00034 18.3638 4.31817 19.6818C5.63599 20.9999 7.75701 20.9999 11.9991 20.9999C16.241 20.9999 18.3621 20.9999 19.6799 19.6818C20.901 18.4605 20.9906 16.5493 20.9972 12.8998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20.556 3.49612L11.0487 13.0586M20.556 3.49612C20.062 3.00151 16.7343 3.04761 16.0308 3.05762M20.556 3.49612C21.05 3.99074 21.0039 7.32273 20.9939 8.02714",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],tY=[["path",{d:"M6.00449 12.5V12M18.0045 12.5V12M12.0045 12.5V12M7.00449 12.5C7.00449 11.9477 6.55677 11.5 6.00449 11.5C5.4522 11.5 5.00449 11.9477 5.00449 12.5C5.00449 13.0523 5.4522 13.5 6.00449 13.5C6.55677 13.5 7.00449 13.0523 7.00449 12.5ZM19.0045 12.5C19.0045 11.9477 18.5568 11.5 18.0045 11.5C17.4522 11.5 17.0045 11.9477 17.0045 12.5C17.0045 13.0523 17.4522 13.5 18.0045 13.5C18.5568 13.5 19.0045 13.0523 19.0045 12.5ZM13.0045 12.5C13.0045 11.9477 12.5568 11.5 12.0045 11.5C11.4522 11.5 11.0045 11.9477 11.0045 12.5C11.0045 13.0523 11.4522 13.5 12.0045 13.5C12.5568 13.5 13.0045 13.0523 13.0045 12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],nY=[["path",{d:"M15.2141 5.98239L16.6158 4.58063C17.39 3.80646 18.6452 3.80646 19.4194 4.58063C20.1935 5.3548 20.1935 6.60998 19.4194 7.38415L18.0176 8.78591M15.2141 5.98239L6.98023 14.2163C5.93493 15.2616 5.41226 15.7842 5.05637 16.4211C4.70047 17.058 4.3424 18.5619 4 20C5.43809 19.6576 6.94199 19.2995 7.57889 18.9436C8.21579 18.5877 8.73844 18.0651 9.78375 17.0198L18.0176 8.78591M15.2141 5.98239L18.0176 8.78591",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 20H17",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],sY=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.5 12C19.5 11.0151 19.306 10.0398 18.9291 9.12987C18.5522 8.21993 17.9997 7.39314 17.3033 6.6967C16.6069 6.00026 15.7801 5.44781 14.8701 5.0709C13.9602 4.69399 12.9849 4.5 12 4.5L12 12H19.5Z",fill:"currentColor",key:"1"}]],rY=[["path",{d:"M12.828 6.00096C12.9388 5.68791 12.999 5.35099 12.999 5C12.999 3.34315 11.6559 2 9.99904 2C8.34219 2 6.99904 3.34315 6.99904 5C6.99904 5.35099 7.05932 5.68791 7.17008 6.00096C4.88532 6.0093 3.66601 6.09039 2.87772 6.87868C2.08951 7.66689 2.00836 8.88603 2 11.1704C2.31251 11.06 2.64876 11 2.99904 11C4.6559 11 5.99904 12.3431 5.99904 14C5.99904 15.6569 4.6559 17 2.99904 17C2.64876 17 2.31251 16.94 2 16.8296C2.00836 19.114 2.08951 20.3331 2.87772 21.1213C3.66593 21.9095 4.88508 21.9907 7.16941 21.999C7.05908 21.6865 6.99904 21.3503 6.99904 21C6.99904 19.3431 8.34219 18 9.99904 18C11.6559 18 12.999 19.3431 12.999 21C12.999 21.3503 12.939 21.6865 12.8287 21.999C15.113 21.9907 16.3322 21.9095 17.1204 21.1213C17.9086 20.333 17.9897 19.1137 17.9981 16.829C18.3111 16.9397 18.648 17 18.999 17C20.6559 17 21.999 15.6569 21.999 14C21.999 12.3431 20.6559 11 18.999 11C18.648 11 18.3111 11.0603 17.9981 11.171C17.9897 8.88627 17.9086 7.66697 17.1204 6.87868C16.3321 6.09039 15.1128 6.0093 12.828 6.00096Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],iY=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],oY=[["path",{d:"M12 4V2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20 22C20 17.5817 16.4183 14 12 14C7.58172 14 4 17.5817 4 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.375 8.25H9.25M9.5 8.25C9.5 8.38807 9.38807 8.5 9.25 8.5C9.11193 8.5 9 8.38807 9 8.25C9 8.11193 9.11193 8 9.25 8C9.38807 8 9.5 8.11193 9.5 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.875 8.25H14.75M15 8.25C15 8.38807 14.8881 8.5 14.75 8.5C14.6119 8.5 14.5 8.38807 14.5 8.25C14.5 8.11193 14.6119 8 14.75 8C14.8881 8 15 8.11193 15 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15.1538 4H8.84615C7.59095 4 6.96334 4 6.47397 4.22025C5.91693 4.47095 5.47095 4.91693 5.22025 5.47397C5 5.96334 5 6.59095 5 7.84615C5 9.85448 5 10.8586 5.3524 11.6417C5.75353 12.5329 6.46709 13.2465 7.35835 13.6476C8.14135 14 9.14552 14 11.1538 14H12.8462C14.8545 14 15.8586 14 16.6417 13.6476C17.5329 13.2465 18.2465 12.5329 18.6476 11.6417C19 10.8586 19 9.85448 19 7.84615C19 6.59095 19 5.96334 18.7797 5.47397C18.529 4.91693 18.0831 4.47095 17.526 4.22025C17.0367 4 16.4091 4 15.1538 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],aY=[["path",{d:"M15.5 15.0001L17.5 17.0001M16.5 11.5001C16.5 9.01483 14.4853 7.00011 12 7.00011C9.51472 7.00011 7.5 9.01483 7.5 11.5001C7.5 13.9854 9.51472 16.0001 12 16.0001C14.4853 16.0001 16.5 13.9854 16.5 11.5001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 21.5001C16.8623 21.5001 17.7935 21.5001 18.5391 21.2287C19.789 20.7738 20.7737 19.7891 21.2286 18.5392C21.5 17.7936 21.5 16.8624 21.5 15.0001M9 21.5001C7.13769 21.5001 6.20653 21.5001 5.46091 21.2287C4.21096 20.7738 3.22633 19.7891 2.77138 18.5392C2.5 17.7936 2.5 16.8624 2.5 15.0001M9 2.50011C7.13769 2.50011 6.20653 2.50011 5.46091 2.77149C4.21096 3.22643 3.22633 4.21107 2.77138 5.46102C2.5 6.20664 2.5 7.13779 2.5 9.00011M15 2.50011C16.8623 2.50011 17.7935 2.50011 18.5391 2.77149C19.789 3.22643 20.7737 4.21107 21.2286 5.46102C21.5 6.20664 21.5 7.13779 21.5 9.00011",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],lY=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],cY=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],uY=[["path",{d:"M2 11.5C2 12.6046 2.89543 13.5 4 13.5C5.65685 13.5 7 12.1569 7 10.5V6.5C7 4.84315 5.65685 3.5 4 3.5C2.89543 3.5 2 4.39543 2 5.5V11.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.4787 16.1937L15.2124 15.3337C14.9942 14.6289 14.8851 14.2765 14.969 13.9982C15.0369 13.7731 15.1859 13.579 15.389 13.4513C15.64 13.2935 16.0197 13.2935 16.7791 13.2935H17.1831C19.7532 13.2935 21.0382 13.2935 21.6452 12.5327C21.7145 12.4458 21.7762 12.3533 21.8296 12.2563C22.2965 11.4079 21.7657 10.2649 20.704 7.9789C19.7297 5.88111 19.2425 4.83222 18.338 4.21485C18.2505 4.15508 18.1605 4.0987 18.0683 4.04586C17.116 3.5 15.9362 3.5 13.5764 3.5H13.0646C10.2057 3.5 8.77628 3.5 7.88814 4.36053C7 5.22106 7 6.60607 7 9.37607V10.3497C7 11.8054 7 12.5332 7.25834 13.1994C7.51668 13.8656 8.01135 14.4134 9.00069 15.5089L13.0921 20.0394C13.1947 20.1531 13.246 20.2099 13.2913 20.2493C13.7135 20.6167 14.3652 20.5754 14.7344 20.1577C14.774 20.1129 14.8172 20.0501 14.9036 19.9245C15.0388 19.728 15.1064 19.6297 15.1654 19.5323C15.6928 18.6609 15.8524 17.6256 15.6108 16.6429C15.5838 16.5331 15.5488 16.4199 15.4787 16.1937Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],dY=[["path",{d:"M2 12.5C2 11.3954 2.89543 10.5 4 10.5C5.65685 10.5 7 11.8431 7 13.5V17.5C7 19.1569 5.65685 20.5 4 20.5C2.89543 20.5 2 19.6046 2 18.5V12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.4787 7.80626L15.2124 8.66634C14.9942 9.37111 14.8851 9.72349 14.969 10.0018C15.0369 10.2269 15.1859 10.421 15.389 10.5487C15.64 10.7065 16.0197 10.7065 16.7791 10.7065H17.1831C19.7532 10.7065 21.0382 10.7065 21.6452 11.4673C21.7145 11.5542 21.7762 11.6467 21.8296 11.7437C22.2965 12.5921 21.7657 13.7351 20.704 16.0211C19.7297 18.1189 19.2425 19.1678 18.338 19.7852C18.2505 19.8449 18.1605 19.9013 18.0683 19.9541C17.116 20.5 15.9362 20.5 13.5764 20.5H13.0646C10.2057 20.5 8.77628 20.5 7.88814 19.6395C7 18.7789 7 17.3939 7 14.6239V13.6503C7 12.1946 7 11.4668 7.25834 10.8006C7.51668 10.1344 8.01135 9.58664 9.00069 8.49112L13.0921 3.96056C13.1947 3.84694 13.246 3.79012 13.2913 3.75075C13.7135 3.38328 14.3652 3.42464 14.7344 3.84235C14.774 3.8871 14.8172 3.94991 14.9036 4.07554C15.0388 4.27205 15.1064 4.37031 15.1654 4.46765C15.6928 5.33913 15.8524 6.37436 15.6108 7.35715C15.5838 7.46692 15.5488 7.5801 15.4787 7.80626Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],fY=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],hY=[["path",{d:"M18.4984 19.1511C17.3377 17.4018 15.2947 16.2009 12.9313 16.0569L11.9984 16C11.6652 16.0083 11.3547 16.0194 11.0617 16.0325C8.71722 16.1376 6.66598 17.3796 5.5 19.1511",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9961 10C14.9961 11.6569 13.6529 13 11.9961 13C10.3392 13 8.99609 11.6569 8.99609 10C8.99609 8.34315 10.3392 7 11.9961 7C13.6529 7 14.9961 8.34315 14.9961 10Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],pY=1.75;function Ne(e){return function(n){return a.jsx(iT,{color:"currentColor",icon:e,strokeWidth:pY,...n})}}const xY=Ne(wZ),gY=Ne(jZ),mY=Ne(EZ),oT=Ne(SZ),yY=Ne(CZ),Qg=Ne($Z),Sh=Ne(oY),vY=Ne(AZ),kY=Ne(TZ),l9=Ne(zZ),Jv=Ne(MZ),Ro=Ne(_Z),ea=Ne(fY),aT=Ne(NZ),bY=Ne(RZ),E3=Ne(IZ),R1=Ne(LZ),$3=Ne(OZ),Hd=Ne(BZ),wY=Ne(HZ),jY=Ne(qZ),SY=Ne(FZ),I1=Ne(PZ),CY=Ne(VZ),EY=Ne(UZ),$Y=Ne(GZ),c9=Ne(WZ),AY=Ne(KZ),MY=Ne(XZ),A3=Ne(ZZ),TY=Ne(YZ),zY=Ne(QZ),NY=Ne(JZ),_Y=Ne(sY),lT=Ne(eY),Ch=Ne(tY),RY=Ne(nY),qx=Ne(bZ),IY=Ne(rY),M3=Ne(iY),LY=Ne(aY),OY=Ne(lY),Jg=Ne(cY),DY=Ne(uY),BY=Ne(dY),HY=Ne(DZ),qY=Ne(hY);function T3(e,t){return function({size:s=24,isAnimated:r=!0,className:i,ref:o,...l}){const c=p.useRef(null);return p.useImperativeHandle(o,()=>c.current,[]),p.useLayoutEffect(()=>{const u=c.current,d=u==null?void 0:u.closest("button, a, [role='menuitem']");if(!r||!u||!d)return;let f=d.matches(":hover");const h=y=>{y.relatedTarget instanceof Node&&!y.relatedTarget.isConnected&&(f=!0)},x=y=>{f||y.pointerType!=="mouse"||y.buttons!==0||d.matches(":disabled, [aria-disabled='true']")||(f=!0,u.setAttribute("data-icon-hover",""))},g=()=>{f=!1,u.removeAttribute("data-icon-hover")};return d.addEventListener("pointerenter",h),d.addEventListener("pointermove",x),d.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerenter",h),d.removeEventListener("pointermove",x),d.removeEventListener("pointerleave",g),u.removeAttribute("data-icon-hover")}},[r]),a.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:`pigui-animated-icon ${i??""}`.trim(),"data-icon-motion":r?e:void 0,...l,children:t})}}const PY=T3("new-chat",a.jsxs(a.Fragment,{children:[a.jsxs("g",{"data-icon-part":"bubble",children:[a.jsx("path",{d:"M12.5 3.00372C11.6049 2.99039 10.7047 3.01289 9.8294 3.07107C5.64639 3.34913 2.31441 6.72838 2.04024 10.9707C1.98659 11.8009 1.98659 12.6607 2.04024 13.4909C2.1401 15.036 2.82343 16.4666 3.62791 17.6746C4.09501 18.5203 3.78674 19.5758 3.30021 20.4978C2.94941 21.1626 2.77401 21.495 2.91484 21.7351C3.05568 21.9752 3.37026 21.9829 3.99943 21.9982C5.24367 22.0285 6.08268 21.6757 6.74868 21.1846C7.1264 20.9061 7.31527 20.7668 7.44544 20.7508C7.5756 20.7348 7.83177 20.8403 8.34401 21.0513C8.8044 21.2409 9.33896 21.3579 9.8294 21.3905C11.2536 21.4852 12.7435 21.4854 14.1706 21.3905C18.3536 21.1125 21.6856 17.7332 21.9598 13.4909C22.0021 12.836 22.011 12.1627 21.9866 11.5"}),a.jsx("path",{d:"M8.5 15H15.5M8.5 10H12"})]}),a.jsx("path",{"data-icon-part":"add",d:"M15 5.5H22M18.5 2L18.5 9"})]})),cT=a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z"}),a.jsx("path",{"data-icon-part":"divider",d:"M9 3V21"})]}),Px=T3("sidebar",cT),UY=T3("sidebar",a.jsx("g",{transform:"translate(24 0) scale(-1 1)",children:cT}));function z3(){var s;const e=(s=window.pinomadDesktop)==null?void 0:s.updates,[t,n]=p.useState();if(p.useEffect(()=>{if(e===void 0)return;let r=!0;e.status().then(o=>{r&&n(o)});const i=e.onStatus(o=>{r&&n(o)});return()=>{r=!1,i()}},[e]),!(e===void 0||t===void 0))return{status:t,check:()=>void e.check(),install:()=>void e.install()}}function FY(e,t){const n=t!=="/"&&(e===t||e.startsWith(`${t}/`)),s=n?t:"/",r=[{label:n?"~":"/",path:s}];let i=s==="/"?"":s;for(const o of e.slice(s.length).split("/"))o!==""&&(i=`${i}/${o}`,r.push({label:o,path:i}));return r}function u9(e){if(e==="/")return;const t=e.lastIndexOf("/");return t===0?"/":e.slice(0,t)}const B2=e=>e instanceof Error?e.message:String(e),ek=e=>`add-project-folder-${e}`;function VY(e){const t=p.useRef(""),n=p.useRef(void 0);return p.useEffect(()=>()=>clearTimeout(n.current),[]),s=>s.key.length!==1||s.key===" "||s.metaKey||s.ctrlKey||s.altKey?!1:(t.current+=s.key.toLowerCase(),clearTimeout(n.current),n.current=setTimeout(()=>t.current="",600),e(t.current),!0)}function GY({remote:e,connected:t,onAdded:n,onClose:s}){const[r,i]=p.useState({status:"loading"}),[o,l]=p.useState({}),[c,u]=p.useState(void 0),[d,f]=p.useState(!1),[h,x]=p.useState(void 0),g=p.useRef(!1);p.useEffect(()=>(g.current=!0,()=>{g.current=!1}),[]);const y=p.useRef(new Set),v=p.useRef(void 0),m=p.useRef(null),k=p.useCallback(L=>{y.current.has(L)||(y.current.add(L),l(O=>({...O,[L]:{status:"loading"}})),e.controller.listFolders(L).then(O=>{g.current&&l(D=>({...D,[L]:{status:"ok",folders:O.folders}}))},O=>{y.current.delete(L),g.current&&l(D=>({...D,[L]:{status:"error",message:B2(O)}}))}))},[e]),b=p.useCallback(()=>{i({status:"loading"}),e.controller.listFolders().then(L=>{g.current&&(y.current.add(L.path),l(O=>({...O,[L.path]:{status:"ok",folders:L.folders}})),i({status:"ok",home:L.home}),u(L.path))},L=>{g.current&&i({status:"error",message:B2(L)})})},[e]);p.useEffect(()=>b(),[b]),p.useEffect(()=>{const L=v.current;if(L===void 0||L!==c)return;const O=o[L];O===void 0||O.status==="loading"||(v.current=void 0,O.status==="ok"&&O.folders.length>0&&u(O.folders[0].path))},[o,c]),p.useEffect(()=>{if(r.status!=="ok"||!window.matchMedia("(pointer: fine)").matches)return;const L=requestAnimationFrame(()=>{var O;return(O=m.current)==null?void 0:O.focus()});return()=>cancelAnimationFrame(L)},[r.status]),p.useLayoutEffect(()=>{var O;const L=m.current;L===null||c===void 0||(L.scrollLeft=L.scrollWidth,(O=document.getElementById(ek(c)))==null||O.scrollIntoView({block:"nearest",inline:"nearest"}))},[c]);const j=r.status==="ok"?r.home:void 0,A=c===void 0||j===void 0?[]:FY(c,j),M=A.map(L=>L.path),E=M[0],z=E===void 0||E==="/"?A:[{label:"/",path:"/"},...A],T=M.join("\0");p.useEffect(()=>{for(const L of T.split("\0"))L!==""&&k(L)},[T,k]);const $=L=>{d||(v.current=void 0,x(void 0),u(L))},_=L=>{const O=L===void 0?void 0:o[L];return(O==null?void 0:O.status)==="ok"?O.folders:void 0},R=c===void 0?void 0:c===E?E:u9(c),N=VY(L=>{var D;const O=(D=_(R))==null?void 0:D.find(q=>q.name.toLowerCase().startsWith(L));O!==void 0&&$(O.path)}),H=()=>{c!==void 0&&(f(!0),x(void 0),e.controller.addProject(c).then(L=>{g.current&&n(L)},L=>{g.current&&(f(!1),x(B2(L)))}))},B=L=>{if(L.target!==L.currentTarget||c===void 0||d)return;const O=_(R)??[],D=O.findIndex(q=>q.path===c);switch(L.key){case"ArrowDown":O.length>0&&$(O[Math.min(D+1,O.length-1)].path);break;case"ArrowUp":D>0&&$(O[D-1].path);break;case"Home":O.length>0&&$(O[0].path);break;case"End":O.length>0&&$(O.at(-1).path);break;case"ArrowRight":{const q=_(c);q===void 0?v.current=c:q.length>0&&$(q[0].path);break}case"ArrowLeft":{const q=u9(c);q!==void 0&&$(q);break}case"Enter":t&&H();break;default:if(!N(L))return}L.preventDefault()},I=L=>{var O;$(L),(O=m.current)==null||O.focus()};return a.jsx(mr,{isOpen:!0,onOpenChange:L=>L?void 0:s(),purpose:"form",width:"min(780px, calc(100vw - 32px))",children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Add project",subtitle:"Choose a folder on the host.",onOpenChange:()=>s()}),content:a.jsx(qs,{children:r.status!=="ok"?a.jsx("div",{className:"flex h-[24rem] items-center justify-center",children:r.status==="loading"?a.jsx(Jt,{"aria-label":"Loading folders"}):a.jsxs(le,{gap:2,hAlign:"center",children:[a.jsx(Y,{type:"supporting",children:r.message}),a.jsx(Q,{label:"Try again",variant:"secondary",onClick:b})]})}):a.jsxs("div",{className:"overflow-hidden rounded-[var(--radius-inner)] border border-[var(--color-border)]",children:[a.jsx("div",{ref:m,role:"group","aria-label":"Folders",tabIndex:0,"aria-activedescendant":c===void 0||c===E?void 0:ek(c),onKeyDown:B,className:"group flex h-[22rem] overflow-x-auto overflow-y-hidden outline-none",children:M.map((L,O)=>a.jsx(WY,{path:L,label:A[O].label,listing:o[L],next:M[O+1],selected:c,disabled:d,onPick:I,onRetry:()=>k(L)},L))}),a.jsx("nav",{"aria-label":"Selected folder","data-testid":"picker-path","data-path":c,className:"flex h-8 min-w-0 items-center gap-0.5 border-t border-[var(--color-border)] bg-[var(--color-background-muted)] px-2 text-[13px] text-[var(--color-text-secondary)]",children:z.map((L,O)=>{const D=O===z.length-1;return a.jsxs("span",{className:`flex min-w-0 items-center gap-0.5 ${D?"shrink-0":""}`,children:[O===0?null:a.jsx(Ro,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-60"}),a.jsx("button",{type:"button",disabled:d,"aria-current":D?"location":void 0,onClick:()=>I(L.path),className:`max-w-[14rem] min-w-0 truncate rounded px-1 py-0.5 hover:bg-[var(--color-overlay-hover)] focus-visible:outline-2 focus-visible:outline-[var(--color-border-emphasized)] ${D?"text-[var(--color-text-primary)]":""}`,children:L.label})]},L.path)})})]})}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx("div",{className:"min-w-0 flex-1",children:h!==void 0?a.jsx(Y,{type:"supporting",role:"alert",maxLines:1,style:{color:"var(--danger)"},children:h}):a.jsx("div",{className:"hidden pointer-fine:block",children:a.jsx(Y,{type:"supporting",maxLines:1,children:"Arrow keys to browse, Enter to add"})})}),a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),a.jsx(Q,{label:d?"Adding…":"Add project",variant:"primary",isDisabled:!t||c===void 0||d,onClick:H})]})]})})})})}function WY({path:e,label:t,listing:n,next:s,selected:r,disabled:i,onPick:o,onRetry:l}){const c=(n==null?void 0:n.status)!=="ok"||n.folders.length===0;return a.jsx("div",{role:"listbox","aria-label":t,className:`flex shrink-0 flex-col overflow-y-auto overscroll-y-contain border-r border-[var(--color-border)] p-1 last:border-r-0 ${c?"min-w-56 flex-1":"w-56"}`,children:n===void 0||n.status==="loading"?a.jsx("div",{className:"flex flex-1 items-center justify-center",children:a.jsx(Jt,{"aria-label":`Loading ${t}`,size:"sm"})}):n.status==="error"?a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-2 text-center",children:[a.jsx(Y,{type:"supporting",children:n.message}),a.jsx(Q,{label:"Try again",size:"sm",variant:"secondary",isDisabled:i,onClick:l})]}):n.folders.length===0?a.jsx("div",{className:"flex flex-1 items-center justify-center",children:a.jsx(Y,{type:"supporting",children:"No subfolders"})}):n.folders.map(u=>{const d=u.path===r;return a.jsxs("div",{id:ek(u.path),role:"option","aria-selected":d,"aria-disabled":i||void 0,title:u.name,onMouseDown:f=>f.preventDefault(),onClick:()=>o(u.path),className:`flex h-7 shrink-0 cursor-default items-center gap-2 rounded-[7px] px-2 text-sm ${d?"bg-[var(--color-overlay-pressed)] group-focus:bg-[var(--color-accent)] group-focus:text-[var(--color-on-accent)]":u.path===s?"bg-[var(--color-overlay-pressed)]":"hover:bg-[var(--color-overlay-hover)]"}`,children:[a.jsx(I1,{"aria-hidden":"true",className:"size-4 shrink-0 opacity-70"}),a.jsx("span",{className:"min-w-0 flex-1 truncate",children:u.name}),a.jsx(Ro,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-50"})]},u.path)})})}function KY({project:e,remote:t,connected:n,onClose:s}){const r=()=>{t.controller.removeProject(e.path),s()};return a.jsx(mr,{isOpen:!0,onOpenChange:i=>i?void 0:s(),purpose:"form",width:480,children:a.jsx(Hs,{header:a.jsx(Hr,{title:`Remove project ${e.name}?`,subtitle:"The directory and its conversations are kept; only the registration is removed.",onOpenChange:()=>s()}),content:a.jsx(qs,{}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),a.jsx(Q,{label:"Remove project",variant:"primary",isDisabled:!n,onClick:r})]})})})})}function XY({summary:e,remote:t,connected:n,onClose:s}){const r=Ds(e),[i,o]=p.useState(r),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useRef(null);p.useEffect(()=>{var g;return(g=f.current)==null?void 0:g.select()},[]);const h=i.trim(),x=()=>{h===""||h===r||l||(c(!0),d(void 0),t.controller.renameConversation(e.id,h).then(()=>s(),g=>{c(!1),d(g instanceof Error?g.message:String(g))}))};return a.jsx(mr,{isOpen:!0,onOpenChange:g=>g?void 0:s(),purpose:"form",width:480,children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Rename conversation",onOpenChange:()=>s()}),content:a.jsxs(qs,{children:[a.jsx(lt,{ref:f,label:"Title",value:i,onChange:o,onEnter:x,hasAutoFocus:!0,isDisabled:l}),u===void 0?null:a.jsx(Y,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:u})]}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),a.jsx(Q,{label:"Save",variant:"primary",isDisabled:!n||l||h===""||h===r,onClick:x})]})})})})}const ZY=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],uT={off:!0,minimal:!0,low:!0,medium:!0,high:!0,xhigh:!0,max:!0},tk=Object.keys(uT),YY=e=>typeof e=="string"&&Object.prototype.hasOwnProperty.call(uT,e),QY=64,JY=e=>e<32||e>=127&&e<=159;function eQ(e){let t=e;for(;;){const s=[...(t.endsWith(".local")?t.slice(0,-6):t).trim()].filter(r=>!JY(r.codePointAt(0))).join("").slice(0,QY);if(s===t)return s;t=s}}const dT={conversations:0,index:0,devices:0,mcp:0,models:1,auth:1,settings:2,agents:6,providers:21},N3=Object.keys(dT);function H2(e){return N3.filter(t=>dT[t]<=e)}const ol=e=>`conversation:${e}`,cf=(e,t)=>`doc:${e}:${t}`,op=4401,q2={major:5},tQ={addProject:0,removeProject:0,listFolders:3,listFiles:10,listSkills:13,listCommands:17,createConversation:0,archive:0,renameConversation:4,submit:0,submission:25,withdrawQueued:14,steerQueued:14,abort:0,compact:0,runCommand:17,setModel:0,setThinkingLevel:0,setAgent:18,fork:0,answer:0,changes:0,createPairing:0,revokeDevice:0,logout:1,beginLogin:21,answerLogin:21,cancelLogin:21,saveCustomProvider:21,removeCustomProvider:21,listEndpointModels:21,updateSettings:2,createAgent:6,updateAgent:6,deleteAgent:6,setPushToken:7,image:15,beginAttachment:19,appendAttachment:19,rtcOffer:23,ping:23};function Fe(e,t){return e>=tQ[t]}const nQ={images:5,acceptAccountDevices:8,apnsPush:9,agentConversations:10,liveBranch:11,hostName:12,imageRefs:15,boundSkills:16,attachments:19,imageVariants:20,rtc:23,submitEntry:25};function Zt(e,t){return e>=nQ[t]}[...N3];function _3(e){const t=e.indexOf(".");if(t<=0||e.indexOf(".",t+1)!==-1)return;const n=e.slice(0,t),s=e.slice(t+1);try{if(Mo(n).length!==32||Mo(s).length===0)return}catch{return}return{hostKey:n,secret:s}}function fT(e){const t=e.getAll("endpointSet");if(t.length>1)return!1;if(t.length===0)return;const n=kK(t[0]);if(n.kind==="malformed")return!1;if(n.kind==="valid")return n.endpointSet.endpoints.length===0?!1:n.endpointSet}function sQ(e){let t;try{t=new URL(e.trim())}catch{return}const n=new URLSearchParams(t.hash.replace(/^#/,"")),s=n.get("pair"),r=s===null?void 0:_3(s);if(r===void 0)return;let i=n.get("url");if(i===null||i==="")if(t.protocol==="http:")i=`ws://${t.host}/`;else if(t.protocol==="https:")i=`wss://${t.host}/`;else return;else try{const l=new URL(i).protocol;if(l!=="ws:"&&l!=="wss:")return}catch{return}const o=fT(n);if(o!==!1)return{hostKey:r.hostKey,secret:r.secret,url:i,...o===void 0?{}:{endpointSet:o}}}function hT(e){const t=sQ(e);if(t===void 0)return;const n=t.endpointSet===void 0?"":`&endpointSet=${xM(t.endpointSet)}`;return`pair=${t.hostKey}.${t.secret}&url=${encodeURIComponent(t.url)}${n}`}const pT=(e,t)=>fetch(e,t),Xt=e=>({ok:!0,value:e}),Fn=(e,t)=>({ok:!1,error:{code:e,...t===void 0?{}:{status:t}}}),d9=e=>{const t=e.filter(i=>i.outcome!=="unsupported"),n=t.length>0&&t.every(i=>i.outcome==="rejected"),s=i=>t.some(o=>o.outcome===i);return{ok:!1,error:{code:n?"pair_rejected":s("timeout")?"pair_timeout":s("unreachable")?"pair_unreachable":e.some(i=>i.outcome==="unsupported")?"pair_unsupported":"pair_unreachable",...e.length===0?{}:{candidates:e}}}},S0=e=>e.code==="unauthenticated";async function rQ(e,t=pT){const n=new AbortController,s=setTimeout(()=>n.abort(),5e3);try{const r=await t(`${e.replace(/\/+$/,"")}/api/me`,{signal:n.signal,redirect:"manual"});if(r.status===401)return"enabled";if(r.status===200){const i=await r.text();let o;try{o=JSON.parse(i)}catch{return"disabled"}return typeof(o==null?void 0:o.user)=="object"&&o.user!==null?"enabled":"disabled"}return r.status===404?"disabled":"unreachable"}catch{return"unreachable"}finally{clearTimeout(s)}}function iQ(e){let t;try{t=new URL(e)}catch{return!1}const n=t.hostname,s=/^127(?:\.\d{1,3}){3}$/.test(n),r=n==="localhost"||n.endsWith(".localhost")||s||n==="::1"||n==="[::1]";return t.protocol==="https:"||t.protocol==="http:"&&r}function Rs(e){try{return new URL(e).origin}catch{return e.replace(/\/+$/,"")}}const Mr=e=>typeof e=="object"&&e!==null,f9=e=>{if(!(!Mr(e)||!Mr(e.user)||typeof e.user.username!="string"))return{user:{username:e.user.username},...e.admin===!0?{admin:!0}:{}}},oQ=new Set(["registered","revoking","revoked"]),aQ=e=>Mr(e)&&typeof e.hostId=="string"&&typeof e.name=="string"&&typeof e.state=="string"&&oQ.has(e.state),lQ=e=>Mr(e)&&typeof e.id=="number"&&(e.name===void 0||typeof e.name=="string")&&typeof e.createdAt=="number"&&typeof e.lastSeenAt=="number"&&typeof e.current=="boolean"&&(e.kickedAt===void 0||typeof e.kickedAt=="number")&&Array.isArray(e.hosts)&&e.hosts.every(aQ),h9=e=>e===void 0?{}:{device:{id:e.id,...e.name===void 0?{}:{name:e.name}}},cQ=e=>Mr(e)&&typeof e.id=="number"&&typeof e.createdAt=="number"&&typeof e.expiresAt=="number"&&(e.usedAt===void 0||typeof e.usedAt=="number")&&(e.usedBy===void 0||typeof e.usedBy=="string");function uf(e){const t=e.fetch??pT,n=Rs(e.origin),s=e.credentials.mode==="bearer"?e.credentials.token:void 0,r={redirect:"manual",...e.credentials.mode==="cookie"?{credentials:"same-origin"}:{}},i=async(l,c,u)=>{let d;try{d=await t(`${n}${l}`,{...r,method:c,headers:{...s===void 0?{}:{authorization:`Bearer ${s}`},...u===void 0?{}:{"content-type":"application/json"}},...u===void 0?{}:{body:JSON.stringify(u)}})}catch{return Fn("network")}if(d.status===0)return Fn("network");const f=await d.json().catch(()=>{});if(d.status>=200&&d.status<300)return Xt(f);const h=Mr(f)&&typeof f.error=="string"?f.error:d.status===401?"unauthenticated":"unknown";return Fn(h,d.status)},o=l=>{if(!l.ok)return l;const c=f9(l.value);if(c===void 0||!Mr(l.value)||typeof l.value.expiresAt!="number")return Fn("invalid_response");const u=l.value.token;return Xt({...c,expiresAt:l.value.expiresAt,...typeof u=="string"?{token:u}:{}})};return{origin:n,login:async(l,c,u)=>o(await i("/api/login","POST",{username:l,password:c,...h9(u)})),register:async(l,c,u,d)=>o(await i("/api/register","POST",{invite:l,username:c,password:u,...h9(d)})),me:async()=>{const l=await i("/api/me","GET");if(!l.ok)return l;const c=f9(l.value);return c===void 0?Fn("invalid_response"):Xt(c)},logout:async l=>{const c=await i("/api/logout","POST",(l==null?void 0:l.revoke)===!0?{revoke:!0}:void 0);return c.ok?Xt(void 0):c},revokeAllSessions:async()=>{const l=await i("/api/sessions/revoke-all","POST");return l.ok?Xt(void 0):l},changePassword:async(l,c)=>{const u=await i("/api/password","POST",{currentPassword:l,newPassword:c});return u.ok?Xt(void 0):u},deleteAccount:async l=>{const c=await i("/api/me/delete","POST",{password:l});return c.ok?Xt(void 0):c},createJoinToken:async()=>{const l=await i("/api/join-tokens","POST");if(!l.ok)return l;const c=l.value;return!Mr(c)||typeof c.token!="string"||typeof c.expiresAt!="number"||typeof c.command!="string"?Fn("invalid_response"):Xt({token:c.token,expiresAt:c.expiresAt,command:c.command})},lookupHostLink:async l=>{const c=await i("/api/host-link/lookup","POST",{userCode:l});if(!c.ok)return c;const u=c.value;return!Mr(u)||typeof u.hostId!="string"||typeof u.name!="string"||typeof u.os!="string"||typeof u.sourceIp!="string"||typeof u.ipDiffers!="boolean"||typeof u.expiresAt!="number"?Fn("invalid_response"):Xt({hostId:u.hostId,name:u.name,os:u.os,sourceIp:u.sourceIp,ipDiffers:u.ipDiffers,expiresAt:u.expiresAt})},confirmHostLink:async l=>{const c=await i("/api/host-link/confirm","POST",{userCode:l});return c.ok?Xt(void 0):c},denyHostLink:async l=>{const c=await i("/api/host-link/deny","POST",{userCode:l});return c.ok?Xt(void 0):c},listHosts:async()=>{const l=await i("/api/hosts","GET");if(!l.ok)return l;if(!Array.isArray(l.value))return Fn("invalid_response");const c=[];for(const u of l.value){if(!Mr(u)||typeof u.hostId!="string"||typeof u.name!="string"||typeof u.noisePublicKey!="string"||typeof u.online!="boolean"||typeof u.lastSeenAt!="number"||u.pairing!=="available"&&u.pairing!=="offline"&&u.pairing!=="host_too_old"&&u.pairing!=="key_mismatch"||u.deviceReports!==void 0&&typeof u.deviceReports!="boolean")return Fn("invalid_response");c.push({hostId:u.hostId,name:u.name,noisePublicKey:u.noisePublicKey,online:u.online,lastSeenAt:u.lastSeenAt,pairing:u.pairing,...u.deviceReports===void 0?{}:{deviceReports:u.deviceReports}})}return Xt(c)},listDevices:async()=>{const l=await i("/api/devices","GET");return l.ok?!Array.isArray(l.value)||!l.value.every(lQ)?Fn("invalid_response"):Xt(l.value.map(c=>({id:c.id,...c.name===void 0?{}:{name:c.name},createdAt:c.createdAt,lastSeenAt:c.lastSeenAt,current:c.current,...c.kickedAt===void 0?{}:{kickedAt:c.kickedAt},hosts:c.hosts.map(u=>({hostId:u.hostId,name:u.name,state:u.state}))}))):l},kickDevice:async(l,c)=>{const u=await i(`/api/devices/${l}/kick`,"POST",{password:c});return u.ok?Xt(void 0):u},requestPairing:async l=>{const c=await i(`/api/hosts/${encodeURIComponent(l)}/pairing`,"POST");if(!c.ok)return c;const u=c.value;if(!Mr(u)||typeof u.url!="string"||typeof u.hostKey!="string"||typeof u.secret!="string"||typeof u.expiresAt!="number")return Fn("invalid_response");let d;if(u.endpointSet!==void 0){const f=Kg(u.endpointSet);if(f.kind==="malformed")return Fn("invalid_response");if(f.kind==="valid"){if(f.endpointSet.endpoints.length===0)return Fn("invalid_response");d=f.endpointSet}}return Xt({url:u.url,hostKey:u.hostKey,secret:u.secret,expiresAt:u.expiresAt,...d===void 0?{}:{endpointSet:d}})},registerPushToken:async l=>{const c=await i("/api/push-tokens","POST",{apns:l.apns,environment:l.environment});return c.ok?Xt(void 0):c},removePushToken:async l=>{const c=await i("/api/push-tokens/remove","POST",{apns:l.apns,environment:l.environment});return c.ok?Xt(void 0):c},listInvites:async()=>{const l=await i("/api/invites","GET");return l.ok?!Array.isArray(l.value)||!l.value.every(cQ)?Fn("invalid_response"):Xt(l.value.map(c=>({id:c.id,createdAt:c.createdAt,expiresAt:c.expiresAt,...c.usedAt===void 0?{}:{usedAt:c.usedAt},...c.usedBy===void 0?{}:{usedBy:c.usedBy}}))):l},createInvite:async()=>{const l=await i("/api/invites","POST");if(!l.ok)return l;const c=l.value;return!Mr(c)||typeof c.code!="string"||typeof c.expiresAt!="number"?Fn("invalid_response"):Xt({code:c.code,expiresAt:c.expiresAt})},revokeInvite:async l=>{const c=await i("/api/invites/revoke","POST",{id:l});return c.ok?Xt(void 0):c}}}function uQ(e){const t=e.endpointSet===void 0?"":`&endpointSet=${xM(e.endpointSet)}`;return hT(`https://server.invalid/#pair=${e.hostKey}.${e.secret}&url=${encodeURIComponent(e.url)}${t}`)}function p9(e,t,n,s,r){const i=Rs(e),o=new Set(s.map(l=>`${Rs(l.serverOrigin)}\0${l.hostId}`));return t.map(l=>{const c=(h,x,g=!1)=>({host:l,status:h,...x===void 0?{}:{stored:x},linkable:g,autoRegister:r&&h==="unpaired"&&!o.has(`${i}\0${l.hostId}`)}),u=n.filter(h=>h.account!==void 0&&Rs(h.account.serverOrigin)===i&&h.account.hostId===l.hostId),d=u.find(h=>h.hostKey===l.noisePublicKey);if(d!==void 0)return c("paired",d);if(u.length>0)return c("key_changed",u[0]);const f=n.find(h=>h.hostKey===l.noisePublicKey);return f!==void 0?c("paired",f,f.account===void 0):c("unpaired")})}class xT extends Error{constructor(n){super(n===void 0?"pairing connection closed":`pairing connection closed (${n})`);ge(this,"code");this.name="PairingHandshakeError",n!==void 0&&(this.code=n)}}const dQ=e=>{if(e instanceof xT)return e.code===op?{code:e.code}:void 0;if(typeof e=="object"&&e!==null){const n=e.code;if(n===op)return{code:n}}const t=e instanceof Error?e.message:String(e);return/\b4401\b/.test(t)?{code:op}:void 0};function fQ(e){return new Promise((t,n)=>{let s,r=!1;const i=e.signal,o=()=>i==null?void 0:i.removeEventListener("abort",c),l=d=>{r||(r=!0,o(),s==null||s.close(),d===void 0?t():n(d))},c=()=>l(new Error("pairing attempt aborted"));if(i!=null&&i.aborted){l(new Error("pairing attempt aborted"));return}i==null||i.addEventListener("abort",c,{once:!0});const u=Zv({url:e.url,hostKey:e.hostKey,device:e.device,pairing:{secret:e.secret,name:e.name},onPaired:()=>l()});try{s=u.open({message:()=>{},closed:d=>l(new xT(d))}),r&&s.close()}catch(d){l(d instanceof Error?d:new Error(String(d)))}})}async function x9(e,t,n,s=fQ,r={}){const i=await e.requestPairing(t);if(!i.ok)return i;const o=uQ(i.value);if(o===void 0)return Fn("invalid_offer");const l=new URLSearchParams(o),c=_3(l.get("pair")),u=l.get("url");if(c===void 0||u===null)return Fn("invalid_offer");const d=Mo(c.hostKey),f=w3(),h=M1(u,i.value.endpointSet,{pageProtocol:r.pageProtocol}),x=h.map(b=>b.unsupported===void 0?void 0:{url:b.url,role:b.role,outcome:"unsupported",reason:b.unsupported}),g=h.filter(b=>b.unsupported===void 0),y=()=>x.filter(b=>b!==void 0);if(g.length===0)return d9(y());const v=r.attemptTimeoutMs??1e4;let m=!1;for(let b=0;b<h.length;b++){const j=h[b];if(j.unsupported!==void 0)continue;const A=new AbortController;let M,E=!1;const z=new Promise(($,_)=>{A.signal.addEventListener("abort",()=>_(new Error("pairing attempt aborted")),{once:!0})}),T=new Promise(($,_)=>{M=setTimeout(()=>{E=!0,A.abort(),_(new Error("pairing attempt timed out"))},v)});try{await Promise.race([s({url:j.url,hostKey:d,device:f,secret:c.secret,name:n,signal:A.signal}),z,T]),m=!0;break}catch($){if(E)x[b]={url:j.url,role:j.role,outcome:"timeout",reason:`no answer within ${v}ms`};else{const _=dQ($),R=$ instanceof Error?$.message:String($);x[b]=_===void 0?{url:j.url,role:j.role,outcome:"unreachable",reason:R}:{url:j.url,role:j.role,outcome:"rejected",reason:R,..._.code===void 0?{}:{code:_.code}}}}finally{M!==void 0&&clearTimeout(M),A.abort()}}if(!m)return d9(y());const k=i.value.endpointSet;return Xt({url:k===void 0?u:h3(u,k),hostKey:c.hostKey,privateKey:Yg(f.privateKey),account:{serverOrigin:e.origin,hostId:t,vouched:!0},...k===void 0?{}:{endpointSet:k}})}const hQ="ws://127.0.0.1:7420",rc="pinomad.device";function R3(e){if(e!==null)try{return YM(JSON.parse(e))}catch{return}}function pQ(e,t,n,s){const r=new URLSearchParams(e.replace(/^#/,"")),i=r.get("token");if(i!==null&&i!=="")return{kind:"token",url:r.get("url")??hQ,token:i};const o=r.get("pair");if(o!==null){const c=_3(o);if(c===void 0)return;const u=fT(r);return u===!1?void 0:{kind:"pair",url:r.get("url")??`${t.protocol==="https:"?"wss":"ws"}://${t.host}/`,hostKey:c.hostKey,secret:c.secret,...u===void 0?{}:{endpointSet:u}}}if(e.replace(/^#/,"")!=="")return;const l=n.find(c=>c.hostKey===s)??n[0];return l===void 0?void 0:{kind:"device",...l}}function xQ(e,t){return new URL(e).host===t.host}function gT(e){const t=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Windows/.test(e)?"Windows":/Mac/.test(e)?"Mac":/Linux/.test(e)?"Linux":void 0,n=/Edg(?:e|A|iOS)?\//.test(e)?"Edge":/Firefox\//.test(e)?"Firefox":/Chrome\//.test(e)||/HeadlessChrome\//.test(e)?"Chrome":/Safari\//.test(e)?"Safari":void 0,s=[t,n].filter(r=>r!==void 0).join(" ");return s===""?"Browser":s}async function I3(){var e,t;try{const n=await((t=(e=window.pinomadDesktop)==null?void 0:e.deviceName)==null?void 0:t.call(e));if(typeof n=="string"&&n!=="")return n}catch{}return gT(navigator.userAgent)}const gQ={darwin:"Mac",win32:"Windows",linux:"Linux"};function mQ(e,t){if(t===void 0)return gT(e);const n=gQ[t];return n===void 0?"Desktop":`${n} Desktop`}const mT="pinomad.hosts",yQ=()=>{const e=localStorage.getItem(mT);if(e===null)return[];let t;try{t=JSON.parse(e)}catch{return[]}return Array.isArray(t)?t.flatMap(n=>{const s=YM(n);return s===void 0?[]:[s]}):[]},Zc=e=>{localStorage.setItem(mT,JSON.stringify(e))};function Pc(){const e=yQ(),t=R3(localStorage.getItem(rc));if(t===void 0)return e;if(e.some(n=>n.hostKey===t.hostKey))return localStorage.removeItem(rc),e;try{Zc([...e,t]),localStorage.removeItem(rc)}catch{}return[...e,t]}const Wo={list:()=>Promise.resolve(Pc()),save:e=>{const t=Pc(),n=t.find(s=>s.hostKey===e.hostKey);return Zc([...t.filter(s=>s.hostKey!==e.hostKey),n===void 0?e:e1(n,e)]),Promise.resolve()},remove:e=>{Zc(Pc().filter(n=>n.hostKey!==e));const t=R3(localStorage.getItem(rc));return t!==void 0&&t.hostKey===e&&localStorage.removeItem(rc),Promise.resolve()},setName:(e,t)=>{const n=Pc();return n.some(s=>s.hostKey===e)&&Zc(n.map(s=>s.hostKey===e?{...s,name:t}:s)),Promise.resolve()},updateEndpoints:(e,t)=>{const n=Pc(),s=n.findIndex(i=>i.hostKey===e);if(s===-1)return Promise.resolve();const r=[...n];return r[s]=QM(n[s],t),Zc(r),Promise.resolve()},updateConnection:(e,t)=>{const n=Pc(),s=n.findIndex(i=>i.hostKey===e);if(s===-1)return Promise.resolve();const r=[...n];return r[s]=JM(n[s],t),Zc(r),Promise.resolve()}};function vQ(e){let t;const n=async()=>{const s=R3(localStorage.getItem(rc));if(s!==void 0)try{(await e.hosts.list()).some(i=>i.hostKey===s.hostKey)||await e.hosts.save(s),localStorage.removeItem(rc);return}catch(r){return console.error("Could not migrate the stored device into the desktop host list",r),s}};return{list:async()=>{const s=await(t??(t=n())),r=await e.hosts.list();return s===void 0||r.some(i=>i.hostKey===s.hostKey)?r:[...r,s]},save:s=>e.hosts.save(s),remove:s=>e.hosts.remove(s),setName:(s,r)=>e.hosts.setName(s,r),updateEndpoints:(s,r)=>e.hosts.updateEndpoints(s,r),updateConnection:(s,r)=>e.hosts.updateConnection(s,r)}}function kQ(){const e=window.pinomadDesktop;return e===void 0?Wo:vQ(e)}const bQ={store:Wo,hosts:[],focus:null,paired:e=>Wo.save(e),setName:(e,t)=>Wo.setName(e,t),endpoints:(e,t)=>Wo.updateEndpoints(e,t),setConnection:(e,t)=>Wo.updateConnection(e,t),focusHost:()=>{},focusConversation:()=>{},rememberConversation:()=>{},focusDraft:()=>{},forget:e=>Wo.remove(e),dropHost:e=>Wo.remove(e)},yT=p.createContext(bQ),Ps=()=>p.useContext(yT);function vT(e,t){const{hosts:n,setName:s}=Ps(),r=t==null?void 0:t.hostName;p.useEffect(()=>{if(e===void 0||r===void 0)return;const i=n.find(o=>o.hostKey===e);i===void 0||i.name===r||s(e,r).catch(o=>console.error("Could not store the host name",o))},[e,r,n,s])}const kT="pinomad.declinedAccountHosts",Cf=e=>`${Rs(e.serverOrigin)}\0${e.hostId}`,wQ=e=>{let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];const n=new Set,s=[];for(const r of t){if(typeof r!="object"||r===null)continue;const i=r;if(typeof i.serverOrigin!="string"||typeof i.hostId!="string")continue;const o={serverOrigin:Rs(i.serverOrigin),hostId:i.hostId},l=Cf(o);n.has(l)||(n.add(l),s.push(o))}return s};function P2(e){const t=e.getItem(kT);return t===null?[]:wQ(t)}function jQ(e=localStorage){const t=new Set,n=()=>{for(const r of t)r()},s=r=>{e.setItem(kT,JSON.stringify(r)),n()};return{list:()=>P2(e),add:r=>{const i={serverOrigin:Rs(r.serverOrigin),hostId:r.hostId},o=P2(e),l=Cf(i);o.some(c=>Cf(c)===l)||s([...o,i])},remove:r=>{const i=Cf(r),o=P2(e),l=o.filter(c=>Cf(c)!==i);l.length!==o.length&&s(l)},subscribe:r=>(t.add(r),()=>{t.delete(r)})}}const bT=jQ(),nk=new Set;function wT(e){for(const t of nk)t(e)}function SQ(e){return nk.add(e),()=>{nk.delete(e)}}const g9="pinomad.accountDeviceId",CQ=/^[A-Za-z0-9_-]{22,64}$/;function EQ(e){let t;return()=>{let n;try{n=e();const s=n.getItem(g9);if(s!==null&&CQ.test(s))return s}catch{}t??(t=Yg(crypto.getRandomValues(new Uint8Array(16))));try{n==null||n.setItem(g9,t)}catch{}return t}}const $Q=EQ(()=>localStorage),AQ={subscribe(e){if(typeof document>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},ns=e=>({ok:!1,error:{code:e}}),jT=5e3,MQ=12e4/jT,TQ=new Set(["pair_rejected","disabled"]),zQ=typeof navigator<"u"&&navigator.locks!==void 0?{request:async(e,t)=>await navigator.locks.request(e,()=>t())}:void 0,Ef=(e,t)=>`${Rs(e)}\0${t}`,U2=e=>e.account===void 0?e.hostKey:Ef(e.account.serverOrigin,e.account.hostId);function NQ(e){const t=new Set;let n={status:"checking"},s,r=e.bridge===void 0?"cookie":"bearer",i,o=!1;const l=new Set,c=e.declined??bT,u=e.autoRegister!==!1,d=new Map;let f=0,h;const x=new Map;let g;const y=new Map;SQ(P=>{for(const[U,X]of x)P!==void 0&&!U.endsWith(`\0${P}`)||(X.cancelled=!0,x.delete(U))});const v=P=>{n=P;for(const U of t)U()},m=()=>{n.status==="signed-in"&&v({...n,unsavedHosts:[...d.values()]})},k=P=>{d.set(U2(P),P),m()},b=P=>{d.delete(U2(P))&&m()},j=()=>{g==null||g(),g=void 0},A=()=>{s=void 0,o=!1,f+=1;for(const P of x.values())P.cancelled=!0;x.clear(),d.clear(),j();for(const{timer:P}of y.values())clearTimeout(P);y.clear()},M=()=>v({status:"signed-out",mode:r,...i===void 0?{}:{serverOrigin:i}}),E=()=>{A(),M()},z=(P,U,X,ie)=>({status:"signed-in",mode:r,user:U,admin:o,serverOrigin:P.origin,hosts:X,rejectedHostKeys:[...l],unsavedHosts:[...d.values()],...ie}),T=(P,U)=>s===P&&U===f,$=async P=>{var ie;let U;try{U=await e.hosts.list()}catch(te){return console.error("Could not read the paired hosts to forget them",te),!1}const X=te=>{var de;return((de=te.account)==null?void 0:de.vouched)===!0&&Rs(te.account.serverOrigin)===P};for(const te of U.filter(X))await(((ie=e.removeHost)==null?void 0:ie.call(e,te.hostKey))??e.hosts.remove(te.hostKey)).catch(de=>console.error("Could not forget a host",de));try{return!(await e.hosts.list()).some(X)}catch(te){return console.error("Could not check the forgotten hosts",te),!1}},_=async()=>(e.name??(()=>"This device"))(),R=P=>{l.delete(P)&&n.status==="signed-in"&&v({...n,rejectedHostKeys:[...l]})},N=()=>{g===void 0&&(g=(e.visibility??AQ).subscribe(()=>{s!==void 0&&n.status==="signed-in"&&F(s,n.user)}))},H=P=>P.account!==void 0&&c.list().some(U=>Rs(U.serverOrigin)===Rs(P.account.serverOrigin)&&U.hostId===P.account.hostId),B=async(P,U)=>{if(s!==P)return!1;if(H(U))return d.delete(U2(U)),m(),!1;try{await e.paired(U)}catch{return!1}return R(U.hostKey),b(U),!0},I=async P=>{let U=0;for(const X of[...d.values()]){if(!await B(P,X))return U;U+=1}return U},L=(P,U,X)=>{if(T(P,f)!==!1){if(S0(X)){E();return}TQ.has(X.code)&&c.add({serverOrigin:P.origin,hostId:U})}},O=P=>{var U;return n.status==="signed-in"?(U=n.hosts.find(X=>X.host.hostId===P))==null?void 0:U.host.name:void 0},D=(P,U)=>{const X=O(P);return X===void 0||X===""?U:{...U,name:X}},q=async(P,U,X,ie)=>{if(!u||!ie)return;const te=await I(P);if(T(P,f)){if(te>0){await F(P,U);return}for(const de of X){if(!de.autoRegister)continue;const fe=Ef(P.origin,de.host.hostId);if(x.has(fe))continue;const he=f,V={cancelled:!1,promise:Promise.resolve()},xe=async()=>{if(V.cancelled||!T(P,he))return;const ke=await e.hosts.list().catch(()=>{});if(ke===void 0||V.cancelled||!T(P,he))return;const me=p9(P.origin,[de.host],ke,c.list(),!0)[0];if((me==null?void 0:me.autoRegister)!==!0){if((me==null?void 0:me.stored)!==void 0){let $t=!0;await e.paired(me.stored).catch(At=>{$t=!1,console.error("Could not sync a host paired by another tab",At)}),$t&&s===P&&await F(P,U)}return}const pe=d.get(Ef(P.origin,de.host.hostId));if(pe!==void 0){await B(P,pe)&&s===P&&await F(P,U);return}const Qe=await x9(P,de.host.hostId,await _(),e.connect,{pageProtocol:window.location.protocol});if(V.cancelled||!T(P,he))return;if(!Qe.ok){L(P,de.host.hostId,Qe.error);return}const Xe=D(de.host.hostId,Qe.value);R(Xe.hostKey);try{await e.paired(Xe)}catch{k(Xe);return}s===P&&await F(P,U)},ve=(async()=>{const ke=e.locks??zQ;ke===void 0?await xe():await ke.request(`pinomad.autoRegister:${Rs(P.origin)}:${de.host.hostId}`,xe)})().catch(ke=>{console.error("Could not auto-register an account host",ke)}).finally(()=>{x.get(fe)===V&&x.delete(fe)});V.promise=ve,x.set(fe,V)}}},F=async(P,U)=>{var fe,he;const X=await P.listHosts();if(s!==P)return{ok:!1,error:{code:"stale"}};if(!X.ok){if(S0(X.error))return r==="bearer"&&((he=(fe=e.bridge)==null?void 0:fe.account)==null||he.clear().catch(()=>{})),E(),X;const V=n.status==="signed-in"?n.hosts:[];return v(z(P,U,V,{hostsError:X.error})),N(),X}let ie,te=!0;try{ie=await e.hosts.list()}catch{ie=[],te=!1}if(s!==P)return{ok:!1,error:{code:"stale"}};const de=p9(P.origin,X.value,ie,c.list(),te);for(const V of de)if(V.linkable&&V.stored!==void 0){const xe=V.stored;e.paired({...xe,account:{serverOrigin:P.origin,hostId:V.host.hostId}}).catch(()=>{})}return v(z(P,U,de)),N(),q(P,U,de,te),{ok:!0,value:de}};(async()=>{var ie,te;const P=e.bridge;if(P!==void 0){const de=await((ie=P.account)==null?void 0:ie.get().catch(()=>{}));if(de===void 0){E();return}i=de.serverOrigin;const fe=uf({origin:de.serverOrigin,credentials:{mode:"bearer",token:de.token},fetch:e.fetch}),he=await fe.me();if(!he.ok){S0(he.error)&&((te=P.account)==null||te.clear().catch(()=>{})),E();return}s=fe,o=he.value.admin===!0,await F(fe,he.value.user.username);return}if(await rQ(e.origin,e.fetch)!=="enabled"){v({status:"unavailable"});return}const U=uf({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch}),X=await U.me();if(!X.ok){i=e.origin,E();return}s=U,i=e.origin,o=X.value.admin===!0,await F(U,X.value.user.username)})();const Z=async P=>{var he;if(s===void 0)return ns("unauthenticated");const U=s,X=f;c.remove({serverOrigin:U.origin,hostId:P}),wT(P);const ie=d.get(Ef(U.origin,P));if(ie!==void 0)return await B(U,ie)?{ok:!0,value:ie}:ns("pairing_not_saved");const te=await x9(U,P,await _(),e.connect,{pageProtocol:window.location.protocol});if(!te.ok)return L(U,P,te.error),te;if(!T(U,X))return ns("stale");const de=D(P,te.value);R(de.hostKey);try{await e.paired(de)}catch{return k(de),ns("pairing_not_saved")}b(de);const fe=await e.hosts.list().catch(()=>[]);for(const V of fe)V.account!==void 0&&Rs(V.account.serverOrigin)===U.origin&&V.account.hostId===P&&V.hostKey!==de.hostKey&&(((he=e.removeHost)==null?void 0:he.call(e,V.hostKey))??e.hosts.remove(V.hostKey)).catch(()=>{});return n.status==="signed-in"&&s!==void 0&&await F(s,n.user),{ok:!0,value:de}},se=P=>{if(s===void 0)return;const U=s,X=f,ie={},te=y.get(P);te!==void 0&&clearTimeout(te.timer),y.set(P,{watch:ie});const de=()=>{var xe;return T(U,X)&&((xe=y.get(P))==null?void 0:xe.watch)===ie},fe=()=>n.status==="signed-in"&&n.hosts.some(xe=>xe.host.hostId===P&&xe.status==="paired"),he=()=>{var xe;((xe=y.get(P))==null?void 0:xe.watch)===ie&&y.delete(P)},V=async xe=>{if(!de()||n.status!=="signed-in"||fe())return he();if(await F(U,n.user),!!de()){if(fe()||xe===0)return he();y.set(P,{watch:ie,timer:setTimeout(()=>void V(xe-1),jT)})}};V(MQ)},ne=async(P,U)=>{var te,de;let X;if(r==="cookie")await h,X=uf({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch});else{const fe=P??i;if(fe===void 0)return ns("origin_required");if(!iQ(fe))return ns("insecure_origin");X=uf({origin:fe,credentials:{mode:"bearer"},fetch:e.fetch})}const ie=await U(X);if(!ie.ok)return ie;if(r==="bearer"){if(ie.value.token===void 0)return ns("invalid_response");X=uf({origin:X.origin,credentials:{mode:"bearer",token:ie.value.token},fetch:e.fetch}),i=X.origin,(de=(te=e.bridge)==null?void 0:te.account)==null||de.save({serverOrigin:X.origin,token:ie.value.token}).catch(fe=>console.error("Could not persist the account session",fe))}return s=X,o=ie.value.admin===!0,await F(X,ie.value.user.username),{ok:!0,value:void 0}},ue=async(P,U)=>{if(s===void 0)return ns("unauthenticated");const X=s,ie=f,te=await P(X);return T(X,ie)&&(te.ok?U==null||U():S0(te.error)&&E()),te};return{get state(){return n},subscribe:P=>(t.add(P),()=>{t.delete(P)}),login:({username:P,password:U,serverOrigin:X})=>ne(X,ie=>{var te;return ie.login(P,U,(te=e.device)==null?void 0:te.call(e))}),register:({invite:P,username:U,password:X,serverOrigin:ie})=>ne(ie,te=>{var de;return te.register(P,U,X,(de=e.device)==null?void 0:de.call(e))}),logout:async P=>{var he,V;if(s===void 0)return ns("unauthenticated");const U=s,X=(P==null?void 0:P.revoke)===!0;A(),r==="bearer"?((V=(he=e.bridge)==null?void 0:he.account)==null||V.clear().catch(()=>{}),M()):v({status:"checking"});const ie=(async()=>({forgotten:X?await $(U.origin):!0,result:await U.logout(X?{revoke:!0}:void 0)}))(),te=ie.then(()=>{});r==="cookie"&&(h=te);const{forgotten:de,result:fe}=await ie;return h===te&&(h=void 0),r==="cookie"&&s===void 0&&n.status==="checking"&&M(),de?fe.ok?{ok:!0,value:void 0}:fe:ns("hosts_not_forgotten")},revokeAll:async()=>{var U,X;if(s===void 0)return ns("unauthenticated");const P=await s.revokeAllSessions();return r==="bearer"&&((X=(U=e.bridge)==null?void 0:U.account)==null||X.clear().catch(()=>{})),E(),P.ok?{ok:!0,value:void 0}:P},refreshHosts:async()=>s===void 0||n.status!=="signed-in"?ns("unauthenticated"):F(s,n.user),changePassword:({currentPassword:P,newPassword:U})=>ue(X=>X.changePassword(P,U)),deleteAccount:({password:P})=>ue(U=>U.deleteAccount(P),()=>{var U,X;r==="bearer"&&((X=(U=e.bridge)==null?void 0:U.account)==null||X.clear().catch(()=>{})),E()}),listDevices:()=>ue(P=>P.listDevices()),kickDevice:({id:P,password:U})=>ue(X=>X.kickDevice(P,U)),createJoinToken:()=>ue(P=>P.createJoinToken()),lookupHostLink:P=>ue(U=>U.lookupHostLink(P)),confirmHostLink:P=>ue(U=>U.confirmHostLink(P)),denyHostLink:P=>ue(U=>U.denyHostLink(P)),watchForHost:se,listInvites:()=>ue(P=>P.listInvites()),createInvite:()=>ue(P=>P.createInvite()),revokeInvite:P=>ue(U=>U.revokeInvite(P)),pairHost:Z,retryUnsavedHost:async P=>{if(n.status!=="signed-in")return ns("nothing_pending");const U=P===void 0?[...d.values()]:[d.get(Ef(n.serverOrigin,P))].filter(ie=>ie!==void 0);if(U.length===0)return ns("nothing_pending");const X=s;if(X===void 0)return ns("unauthenticated");for(const ie of U)if(!await B(X,ie))return ns("pairing_not_saved");return{ok:!0,value:void 0}},hostRejected:P=>{l.add(P),n.status==="signed-in"&&v({...n,rejectedHostKeys:[...l]})}}}function _Q(){const{store:e,paired:t,dropHost:n}=Ps(),[s]=p.useState(()=>NQ({origin:window.location.origin,bridge:window.pinomadDesktop,hosts:e,paired:t,removeHost:n,name:I3,device:()=>({id:$Q(),name:mQ(navigator.userAgent,document.documentElement.dataset.pinomadPlatform)})}));return p.useSyncExternalStore(s.subscribe,()=>s.state),s}const Mn=()=>Promise.reject(new Error("no AccountProvider")),RQ={state:{status:"unavailable"},subscribe:()=>()=>{},login:Mn,register:Mn,logout:Mn,revokeAll:Mn,changePassword:Mn,deleteAccount:Mn,refreshHosts:Mn,listDevices:Mn,kickDevice:Mn,createJoinToken:Mn,lookupHostLink:Mn,confirmHostLink:Mn,denyHostLink:Mn,watchForHost:()=>{},listInvites:Mn,createInvite:Mn,revokeInvite:Mn,pairHost:Mn,retryUnsavedHost:Mn,hostRejected:()=>{}},ST=p.createContext(RQ);function IQ({children:e}){const t=_Q();return a.jsx(ST.Provider,{value:t,children:e})}function Io(){const e=p.useContext(ST);return p.useSyncExternalStore(e.subscribe,()=>e.state),e}function LQ(e){const t=DQ(e);if(t===void 0)return"unknown";if(t.family===4)return y9(t.octets);const n=HQ(t.segments);return n===void 0?qQ(t.segments):y9(n)}function m9(e){return{...e.type===void 0?{}:{type:e.type},...e.address===void 0?{}:{address:e.address},scope:LQ(e.address)}}function OQ(e,t){return{local:m9(e),remote:m9(t)}}function DQ(e){if(e===void 0)return;const t=e.trim();if(t==="")return;let n=t;if(t.startsWith("[")){const o=t.indexOf("]");if(o===-1)return;const l=t.slice(o+1);if(l!==""&&!/^:\d+$/.test(l))return;n=t.slice(1,o)}else if(t.split(":").length===2){const[o,l]=t.split(":");/^\d+$/.test(l)&&(n=o)}const s=n.indexOf("%");s!==-1&&(n=n.slice(0,s));const r=CT(n);if(r!==void 0)return{family:4,octets:r};const i=BQ(n);return i===void 0?void 0:{family:6,segments:i}}function CT(e){const t=e.split(".");if(t.length!==4)return;const n=[];for(const s of t){if(!/^(?:0|[1-9]\d{0,2})$/.test(s))return;const r=Number(s);if(r>255)return;n.push(r)}return n}function BQ(e){const t=e.split("::");if(t.length>2)return;const n=(o,l)=>{if(o==="")return[];const c=o.split(":"),u=[];for(let d=0;d<c.length;d++){const f=c[d];if(l&&d===c.length-1&&f.includes(".")){const h=CT(f);if(h===void 0)return;u.push(h[0]<<8|h[1],h[2]<<8|h[3]);continue}if(!/^[0-9a-fA-F]{1,4}$/.test(f))return;u.push(Number.parseInt(f,16))}return u};if(t.length===1){const o=n(e,!0);return(o==null?void 0:o.length)===8?o:void 0}const s=n(t[0],!1),r=n(t[1],!0);if(s===void 0||r===void 0)return;const i=8-s.length-r.length;if(!(i<1))return[...s,...new Array(i).fill(0),...r]}function HQ(e){if(!(!e.slice(0,5).every(t=>t===0)||e[5]!==65535))return[e[6]>>8,e[6]&255,e[7]>>8,e[7]&255]}function y9(e){const[t,n]=e;return t===127?"loopback":t===100&&n>=64&&n<=127?"tailnet":t===10||t===172&&n>=16&&n<=31||t===192&&n===168||t===169&&n===254?"lan":"public"}function qQ(e){return e[0]===64890&&e[1]===4444&&e[2]===41440?"tailnet":(e[0]&65024)===64512||(e[0]&65472)===65152?"lan":e.slice(0,7).every(t=>t===0)&&e[7]===1?"loopback":"public"}const ET="pinomad",PQ=65535,UQ=65536,v9=PQ;function FQ(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Array.isArray(t.stun)&&t.stun.every(n=>typeof n=="string"&&n.length>0)&&t.signalOnly===!0}function VQ(e){return e.split(/\r?\n/).filter(t=>t.startsWith("a=candidate:")).map(t=>t.slice(2))}function GQ(e,t){const n=e.split(/\r?\n/).filter(r=>r!==""&&!r.startsWith("a=candidate:")&&r!=="a=end-of-candidates"),s=[...new Set(t.map(r=>r.replace(/^a=/,"")))];return[...n,...s.map(r=>`a=${r}`),"a=end-of-candidates",""].join(`\r
382
- `)}function WQ(e){const t=e.split(/\r?\n/).find(r=>r.startsWith("a=max-message-size:"));if(t===void 0)return{kind:"bounded",bytes:UQ};const n=t.slice(19).trim();if(!/^\d+$/.test(n))return{kind:"invalid",reason:`malformed a=max-message-size: ${n}`};const s=Number(n);return Number.isSafeInteger(s)?s===0?{kind:"unlimited"}:s<v9?{kind:"invalid",reason:`a=max-message-size ${s} cannot carry a ${v9}-byte record`}:{kind:"bounded",bytes:s}:{kind:"invalid",reason:`a=max-message-size is not a safe integer: ${n}`}}const KQ=256*1024,XQ=64*1024,ZQ=1e4,YQ=2e3,$T={now:()=>typeof performance>"u"?Date.now():performance.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};function QQ(e){return{label:`webrtc:${ET}`,open(t){const n=e.clock??$T,s=e.stallMs??ZQ,r=e.prologue??VM,i=FM({prologue:r,static:e.device,remoteStatic:e.hostKey}),o=[],l=[];let c,u,d,f=!1,h=!1,x=n.now(),g,y,v=!1;const m=()=>{g!==void 0&&n.clearTimeout(g),g=void 0},k=()=>{y!==void 0&&n.clearTimeout(y),y=void 0},b=T=>{if(!h){h=!0,m(),k();try{c==null||c.close()}catch{}t.closed(1006,T)}},j=()=>{h||l.length===0||g!==void 0||(g=n.setTimeout(()=>{if(g=void 0,!h&&l.length!==0){if(n.now()-x<s){j();return}b(`the DataChannel made no progress for ${s}ms`)}},s))},A=()=>{if(h||u===void 0)return;if(l.length===0){m(),k();return}if(u.bufferedAmount>=KQ)return;let T;try{T=u.send(l[0])}catch($){b($ instanceof Error?$.message:"the DataChannel send failed");return}if(T==="rejected"){y===void 0&&(y=n.setTimeout(()=>{y=void 0,A()},50));return}k(),l.shift(),x=n.now(),j(),queueMicrotask(A)},M=T=>{h||T.length===0||(l.push(...T),x=n.now(),j(),A())},E=()=>{if(d!==void 0)for(const T of o.splice(0))M(d.seal(T))},z=T=>{var $;if(!h)try{if(d===void 0){const{payload:R,result:N}=i.readMessage2(T);XM(R),d=new ZM(N),($=t.authenticated)==null||$.call(t),E();return}const _=d.open(T);_!==void 0&&t.message(_)}catch(_){b(_ instanceof Error?_.message:"secure DataChannel failure")}};return e.platform.createPeer(e.stun).then(T=>{if(h){T.close();return}c=T,u=T.channel,u.onOpen(()=>{var _,R,N;h||f||(f=!0,(R=e.onSelectedPair)==null||R.call(e,(_=T.selectedPair)==null?void 0:_.call(T)),(N=t.opened)==null||N.call(t),v||(v=!0,M([i.writeMessage1(KM({v:1}))])))}),u.onMessage(z),u.onClosed(_=>{h||b(_===void 0?"the DataChannel closed":`the DataChannel closed: ${_}`)}),u.onBufferedAmountLow(A);let $;return e.offer(T.offerSdp).then(_=>{var N;if(h)return;const R=WQ(_);if(R.kind==="invalid")throw new Error(R.reason);$=_,T.acceptAnswer($),(N=t.signaled)==null||N.call(t)})},T=>b(T instanceof Error?T.message:String(T))).catch(T=>b(T instanceof Error?T.message:String(T))),{send(T){if(!h){if(d===void 0){o.push(T);return}M(d.seal(T))}},close(){if(!h){h=!0,m(),k();try{c==null||c.close()}catch{}}}}}}}function AT(){return typeof RTCPeerConnection<"u"}function k9(e){const t=e,n=(t==null?void 0:t.address)??(t==null?void 0:t.ip);return{...typeof(t==null?void 0:t.candidateType)=="string"?{type:t.candidateType}:{},...typeof n=="string"&&n!==""?{address:n}:{}}}async function JQ(e){try{const t=await e.getStats(),n=new Map;t.forEach(r=>n.set(r.id,r));let s;return t.forEach(r=>{if(r.type!=="transport")return;const i=r.selectedCandidatePairId;if(i===void 0)return;const o=n.get(i);(o==null?void 0:o.type)==="candidate-pair"&&(s=o)}),s===void 0&&t.forEach(r=>{if(r.type!=="candidate-pair")return;const i=r;(i.selected===!0||i.state==="succeeded"&&i.nominated===!0)&&(s=i)}),s===void 0?void 0:{local:k9(s.localCandidateId===void 0?void 0:n.get(s.localCandidateId)),remote:k9(s.remoteCandidateId===void 0?void 0:n.get(s.remoteCandidateId))}}catch{return}}function eJ(e,t,n,s,r,i){const o=()=>{if(!(s.closed||s.locallyClosed)&&s.openNotified!==!0){s.openNotified=!0;for(const c of n.open)c()}},l={send(c){return e.send(c),"queued"},get bufferedAmount(){return e.bufferedAmount},close(){e.close()},onOpen(c){n.open.push(c)},onMessage(c){n.message.push(c)},onClosed(c){n.closed.push(c)},onBufferedAmountLow(c){n.low.push(c)}};return e.binaryType="arraybuffer",e.bufferedAmountLowThreshold=XQ,e.onbufferedamountlow=()=>{for(const c of n.low)c()},e.onmessage=c=>{if(s.closed||s.locallyClosed)return;const u=c.data,d=u instanceof ArrayBuffer?new Uint8Array(u):ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):void 0;if(d===void 0){i("the DataChannel delivered a non-binary message");return}for(const f of n.message)f(d)},e.onopen=()=>{JQ(t).then(c=>{c!==void 0&&(s.selectedPair=c),o()})},e.onclose=c=>{if(s.locallyClosed||s.closed)return;const u=c.reason;r(u===""||u===void 0?"the DataChannel closed":u)},e.onerror=c=>{var d;const u=(d=c.error)==null?void 0:d.message;i(u===void 0||u===""?"the DataChannel failed":u)},t.onconnectionstatechange=()=>{t.connectionState==="failed"?i("the PeerConnection failed"):t.connectionState==="closed"&&!s.locallyClosed&&r("the PeerConnection closed")},t.oniceconnectionstatechange=()=>{t.iceConnectionState==="failed"&&i("the ICE connection failed")},l}async function tJ(e){const t=[];let n,s=!1,r,i;const o=new Promise((d,f)=>{r=d,i=f}),l=()=>{n!==void 0&&clearTimeout(n),n=void 0,e.onicecandidate=null,e.onicegatheringstatechange=null},c=d=>{s||(s=!0,l(),i(new Error(d)))},u=()=>{if(s)return;const d=e.localDescription;if(d===null){c("the browser produced no local offer description");return}const f=[...new Set([...t,...VQ(d.sdp)])];if(f.length===0){c("the browser gathered no ICE candidates");return}s=!0,l(),r(GQ(d.sdp,f))};e.onicecandidate=d=>{if(!s){if(d.candidate===null){u();return}t.push(d.candidate.candidate)}},e.onicegatheringstatechange=()=>{e.iceGatheringState==="complete"&&u()},n=setTimeout(u,YQ);try{const d=await e.createOffer();await e.setLocalDescription(d),e.iceGatheringState==="complete"&&u()}catch(d){c(d instanceof Error?d.message:String(d))}return o}async function nJ(e){const t={open:[],message:[],closed:[],low:[]},n={locallyClosed:!1,closed:!1},s=u=>{if(!(n.closed||n.locallyClosed)){n.closed=!0;for(const d of t.closed)d(u)}},r=()=>{try{o.close()}catch{}try{e.close()}catch{}},i=u=>{n.closed||n.locallyClosed||(s(u),r())},o=e.createDataChannel(ET,{ordered:!0}),l=eJ(o,e,t,n,s,i);let c;try{c=await tJ(e)}catch(u){throw n.locallyClosed=!0,r(),u}return{offerSdp:c,acceptAnswer(u){n.locallyClosed||e.setRemoteDescription({type:"answer",sdp:u}).catch(d=>{i(d instanceof Error?d.message:String(d))})},channel:l,selectedPair:()=>n.selectedPair,close(){n.locallyClosed||(n.locallyClosed=!0,r())}}}function MT(){if(AT())return{createPeer(e){const t=new RTCPeerConnection({iceServers:e.map(n=>({urls:n}))});return nJ(t)}}}function ic(e){return e===void 0||e.phase==="connecting"?"connecting":e.phase==="failed"?e.mismatch===void 0&&!e.unauthorized?"offline":"terminal":e.view.connection==="connected"?"connected":e.view.connection==="reconnecting"?"offline":"terminal"}function sJ(e){if(!(e===void 0||ic(e)!=="terminal")){if(e.phase==="failed")return e.mismatch===void 0?"rejected":"protocol_mismatch";if(e.phase!=="connecting")return e.view.connection==="outdated"||e.view.protocolMismatch!==void 0?"protocol_mismatch":e.view.unauthorized===!0?"rejected":"closed"}}var Ll,Ol,Du;class rJ{constructor(){ae(this,Ll,new Map);ae(this,Ol,new Set);ae(this,Du,0);ge(this,"subscribe",t=>(S(this,Ol).add(t),()=>{S(this,Ol).delete(t)}));ge(this,"snapshot",()=>S(this,Du))}publish(t,n){S(this,Ll).set(t,n),G(this,Du,S(this,Du)+1);for(const s of S(this,Ol))s()}remove(t){if(S(this,Ll).delete(t)){G(this,Du,S(this,Du)+1);for(const n of S(this,Ol))n()}}get(t){return S(this,Ll).get(t)}all(){return S(this,Ll)}}Ll=new WeakMap,Ol=new WeakMap,Du=new WeakMap;function iJ(){return new rJ}const em=p.createContext(void 0);function oJ(){return p.useContext(em)}function TT(){const e=oJ();return p.useSyncExternalStore((e==null?void 0:e.subscribe)??(()=>()=>{}),(e==null?void 0:e.snapshot)??(()=>0)),(e==null?void 0:e.all())??new Map}function sk(e){switch(ic(e)){case"connected":return"Connected";case"connecting":return"Connecting";case"offline":return"Offline";case"terminal":{const t=sJ(e);return t==="rejected"?"Rejected by the host":t==="protocol_mismatch"?"Protocol mismatch":"Disconnected"}}}function Ux(){const[e,t]=p.useState(""),[n,s]=p.useState(),r=()=>{const i=hT(e);if(i===void 0){s(/[#?&]token=/.test(e)?"Token links can't pair a device — paste a pairing link instead (pinomad pair, or Settings → Devices → Pair a device).":"That isn't a pairing link — paste one like http://<host>/#pair=… or pinomad://pair#pair=…");return}window.location.hash=i,window.location.reload()};return a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:2,vAlign:"end",style:{width:"100%"},children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(lt,{label:"Pairing link",isLabelHidden:!0,placeholder:"http://…/#pair=… or pinomad://pair#…",value:e,onChange:i=>{s(void 0),t(i)},onEnter:r,width:"100%"})}),a.jsx(Q,{label:"Connect",variant:"primary",isDisabled:e.trim()==="",onClick:r})]}),n===void 0?null:a.jsx(Pe,{status:"error",title:"Not a pairing link",description:n})]})}const aJ="https://app.pinomad.si";function Lo(e){const[t,n]=p.useState(()=>Date.now());return p.useEffect(()=>{const s=setInterval(()=>n(Date.now()),e);return()=>clearInterval(s)},[e]),t}function Bs(e){switch(e.code){case"invalid_credentials":return"Wrong username or password.";case"rate_limited":return"Too many attempts. Wait a few minutes and try again.";case"network":return"Can't reach the server. Check the address and your connection.";case"origin_required":return"Enter the server address.";case"insecure_origin":return"The server address must start with https://.";case"unauthenticated":return"You were signed out. Sign in again.";case"accounts_disabled":return"This server doesn't have accounts turned on.";case"host_offline":return"The host is offline.";case"host_too_old":return"The host needs an update (run pinomad upgrade on it).";case"key_mismatch":return"The host's key doesn't match its account record. Run pinomad join on it again.";case"disabled":return"The host doesn't accept account devices. Turn it on in Devices, or pair with a QR code.";case"not_joined":case"rebinding":return"The host is moving between servers. Try again after it restarts.";case"host_timeout":return"The host didn't answer in time. Try again.";case"pair_rejected":return"The host refused this device. If you revoked it before, pair it with a QR code instead.";case"pair_unreachable":return"Couldn't reach the host on any offered path. Check your network connection or Tailscale and try again.";case"pair_timeout":return"The host didn't answer on any offered path in time. Try again.";case"pair_unsupported":return"This app can't connect to any address the host offered. The page may block an insecure ws:// path; try the desktop app or a secure address.";case"pairing_not_saved":return"Paired, but this device couldn't save the pairing.";case"invalid_invite":return"This invite code isn't valid. It may have been used or revoked.";case"invite_expired":return"This invite code has expired. Ask for a new one.";case"invalid_username":return"Use 2–32 lowercase letters, digits, dots, dashes or underscores, starting with a letter or digit.";case"weak_password":return"Use a password of at least 12 characters.";case"wrong_password":return"The current password is wrong.";case"current_device":return"That's the device you're using. Sign out instead.";case"admin_account":return"The server's admin account can't be deleted.";case"username_taken":return"That username is taken.";case"forbidden":return"Only the server's admin can do this.";default:return`Something went wrong (${e.code}).`}}const zT=8;function lJ(e){return e.toUpperCase().replace(/[^A-Z]/g,"").slice(0,zT)}function NT(e){return e.length>4?`${e.slice(0,4)}-${e.slice(4)}`:e}function _T(e){return e.length===zT}const RT="pinomad.knownAccountHosts",F2=e=>`${Rs(e.serverOrigin)}\0${e.user}`,b9=e=>{let t;try{t=e.getItem(RT)}catch{return}if(t===null)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(typeof n!="object"||n===null||Array.isArray(n))return{};const s={};for(const[r,i]of Object.entries(n))Array.isArray(i)&&(s[r]=i.filter(o=>typeof o=="string"));return s},V2=(e,t)=>{try{e.setItem(RT,JSON.stringify(t))}catch(n){console.error("Could not save the known account hosts",n)}};function cJ(e=localStorage){return{arrivals:(t,n)=>{const s=b9(e);if(s===void 0)return[];const r=F2(t),i=s[r];if(i===void 0)return V2(e,{...s,[r]:[...n]}),[];const o=n.filter(l=>!i.includes(l));return o.length>0&&V2(e,{...s,[r]:[...i,...o]}),o},add:(t,n)=>{const s=b9(e),r=s==null?void 0:s[F2(t)];s===void 0||r===void 0||r.includes(n)||V2(e,{...s,[F2(t)]:[...r,n]})}}}const IT=cJ();function LT(e,t){switch(e.code){case"not_found":return t==="lookup"?"No host is waiting with this code. Check it against the host's terminal; codes expire after 10 minutes.":"This host is no longer waiting: its code expired, or it was confirmed or denied elsewhere. Run pinomad up on it again.";case"rate_limited":return"Too many wrong codes. Wait 15 minutes and try again.";case"invalid_request":return"Enter the 8-letter code from the host's terminal.";default:return Bs(e)}}function OT({knownHosts:e=IT,onSettled:t,onClose:n}){const s=Io(),[r,i]=p.useState(""),[o,l]=p.useState({kind:"entry"}),[c,u]=p.useState(),d=()=>{i(""),l({kind:"entry"})},f=()=>{if(!_T(r)||c!==void 0)return;const x=NT(r);u("lookup"),s.lookupHostLink(x).then(g=>{u(void 0),l(g.ok?{kind:"confirm",code:x,request:g.value}:{kind:"entry",error:g.error})})},h=x=>{if(o.kind!=="confirm"||c!==void 0)return;const{code:g,request:y}=o;u(x?"confirm":"deny"),(x?s.confirmHostLink(g):s.denyHostLink(g)).then(v=>{if(u(void 0),!v.ok){l({...o,error:v.error});return}x&&s.state.status==="signed-in"&&(e.add({serverOrigin:s.state.serverOrigin,user:s.state.user},y.hostId),s.watchForHost(y.hostId)),l({kind:x?"confirmed":"denied",name:y.name}),t==null||t()})};switch(o.kind){case"entry":return a.jsx(uJ,{code:r,error:o.error,isBusy:c==="lookup",onChange:x=>i(lJ(x)),onSubmit:f,...n===void 0?{}:{onCancel:n}});case"confirm":return a.jsx(fJ,{request:o.request,error:o.error,busy:c==="confirm"||c==="deny"?c:void 0,onConfirm:()=>h(!0),onDeny:()=>h(!1),onBack:d});case"confirmed":case"denied":return a.jsx(hJ,{outcome:o.kind,name:o.name,onDone:n??d})}}function uJ({code:e,error:t,isBusy:n=!1,onChange:s,onSubmit:r,onCancel:i}){return a.jsxs(le,{gap:3,style:{width:"100%"},children:[a.jsx(lt,{label:"Code from the host",description:"The host's terminal shows it, like KXHN-BWCV.",placeholder:"XXXX-XXXX",value:NT(e),onChange:s,onEnter:r,width:"100%"}),t===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't find that host",description:LT(t,"lookup")}),a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Q,{label:"Continue",variant:"primary",isLoading:n,isDisabled:!_T(e),onClick:r}),i===void 0?null:a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:i})]})]})}const w9={width:"var(--spacing-4)",height:"var(--spacing-4)"},dJ=e=>e.length>16?`${e.slice(0,8)}…${e.slice(-6)}`:e;function fJ({request:e,error:t,busy:n,onConfirm:s,onDeny:r,onBack:i}){const o=Lo(1e3),[l,c]=p.useState(!1),u=Math.max(0,Math.ceil((e.expiresAt-o)/1e3)),d=u===0;return a.jsxs(le,{gap:4,style:{width:"100%"},children:[a.jsxs(le,{gap:1,children:[a.jsx(ds,{level:3,children:"Add this host to your account?"}),a.jsx(Y,{type:"supporting",children:"Only confirm a computer you are setting up yourself right now."})]}),e.ipDiffers?a.jsx(Pe,{status:"warning",title:"This request came from a different network address than this device",description:`The host asked from ${e.sourceIp}. If you aren't setting it up on another network yourself, deny it.`}):null,a.jsxs(CC,{children:[a.jsx(gf,{label:"Name",children:a.jsx(Y,{weight:"semibold",children:e.name})}),a.jsx(gf,{label:"System",children:a.jsx(Y,{children:e.os})}),a.jsx(gf,{label:"Asked from",children:a.jsx(Y,{type:"code",children:e.sourceIp})}),a.jsx(gf,{label:"Host ID",children:a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsx(Pi,{content:e.hostId,children:a.jsx("span",{tabIndex:0,"aria-label":`Host ID ${e.hostId}`,children:a.jsx(Y,{type:"code",children:dJ(e.hostId)})})}),a.jsx(Q,{label:l?"Copied":"Copy",variant:"ghost",size:"sm",icon:l?a.jsx(ea,{"aria-hidden":"true",style:w9}):a.jsx($3,{"aria-hidden":"true",style:w9}),onClick:()=>{var f;(f=navigator.clipboard)==null||f.writeText(e.hostId).then(()=>c(!0),()=>{})}})]})})]}),d?a.jsx(Pe,{status:"warning",title:"This code has expired",description:"Run pinomad up on the host again for a new one."}):a.jsxs(Y,{type:"supporting",hasTabularNumbers:!0,children:["The host's terminal should show the same name and ID. Expires in ",Math.floor(u/60),":",String(u%60).padStart(2,"0")]}),t===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't answer the host",description:LT(t,"answer")}),a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",wrap:"wrap",children:[a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Confirm",variant:"primary",isLoading:n==="confirm",isDisabled:d||n==="deny",onClick:s}),a.jsx(Q,{label:"Deny",variant:"secondary",isLoading:n==="deny",isDisabled:n==="confirm",onClick:r})]}),a.jsx(Q,{label:"Enter another code",variant:"ghost",isDisabled:n!==void 0,onClick:i})]})]})}function hJ({outcome:e,name:t,onDone:n}){return a.jsxs(le,{gap:3,style:{width:"100%"},children:[e==="confirmed"?a.jsx(Pe,{status:"success",title:`${t} joined your account`,description:"It will appear in your hosts and connect on its own once its terminal finishes setting up."}):a.jsx(Pe,{status:"info",title:`Turned ${t} away`,description:"Its terminal will say the join was denied."}),a.jsx(ye,{children:a.jsx(Q,{label:"Done",variant:"secondary",onClick:n})})]})}const pJ=e=>`curl -fsSL https://pinomad.si/install.sh | sh -s -- up --origin ${e.replace(/\/+$/,"")}`;function DT({serverOrigin:e}){return a.jsxs(le,{gap:4,style:{width:"100%"},children:[a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"On the computer you want to add, open a terminal and run:"}),a.jsx(uh,{code:pJ(e),hasCopyButton:!0,isWrapped:!0,width:"100%"})]}),a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"It asks how your other devices should reach the host; press Enter to go through this server. Then it prints a code. Enter it here to add the host to your account:"}),a.jsx(OT,{})]}),a.jsx(xJ,{})]})}function xJ(){const e=Io(),[t,n]=p.useState(!1),[s,r]=p.useState(),[i,o]=p.useState(),[l,c]=p.useState(!1),u=()=>{c(!0),o(void 0),e.createJoinToken().then(f=>{c(!1),f.ok?r(f.value):o(f.error)})},d=f=>{n(f),f&&s===void 0&&!l&&u()};return a.jsx(jg,{trigger:a.jsx(Y,{type:"supporting",children:"Advanced: join with a one-time token"}),isOpen:t,onOpenChange:d,children:a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"For scripts: this command joins without a code to confirm. Anyone who has it can add a host."}),s===void 0?i===void 0?a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Jt,{size:"sm"}),a.jsx(Y,{type:"supporting",children:"Creating a command…"})]}):a.jsx(Pe,{status:"error",title:"Couldn't create a join command",description:Bs(i),endContent:a.jsx(Q,{label:"Try again",variant:"ghost",isLoading:l,onClick:u})}):a.jsx(gJ,{token:s,onRenew:u}),s!==void 0&&i!==void 0?a.jsx(Pe,{status:"error",title:"Couldn't create a new command",description:Bs(i)}):null]})})}function gJ({token:e,onRenew:t}){const n=Lo(1e3),s=Math.max(0,Math.ceil((e.expiresAt-n)/1e3));return a.jsxs(le,{gap:2,children:[a.jsx(uh,{code:e.command,hasCopyButton:!0,isWrapped:!0,width:"100%"}),s===0?a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Y,{type:"supporting",children:"Expired"}),a.jsx(Q,{label:"New command",variant:"secondary",size:"sm",onClick:t})]}):a.jsxs(Y,{type:"supporting",hasTabularNumbers:!0,children:["Works once · expires in ",Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]})}function L3(){const e=Io(),{state:t}=e,[n,s]=p.useState();switch(p.useEffect(()=>{t.status==="signed-in"&&s(void 0)},[t.status]),t.status){case"unavailable":return null;case"checking":return a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Jt,{size:"sm"}),a.jsx(Y,{type:"supporting",children:"Checking for an account…"})]});case"signed-out":return a.jsxs(le,{gap:3,style:{width:"100%"},children:[n===void 0?null:a.jsx(Pe,{...n}),a.jsx(mJ,{account:e,state:t})]});case"signed-in":return a.jsx(kJ,{account:e,state:t,onNotice:s})}}function mJ({account:e,state:t}){const[n,s]=p.useState(t.serverOrigin??aJ),[r,i]=p.useState(!1),o=t.mode==="bearer"?{origin:n,setOrigin:s}:void 0;return r?a.jsx(vJ,{account:e,server:o,onSignIn:()=>i(!1)}):a.jsx(yJ,{account:e,server:o,onSignUp:()=>i(!0)})}function yJ({account:e,server:t,onSignUp:n}){const s=t!==void 0,r=(t==null?void 0:t.origin)??"",[i,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(),x=i.trim()!==""&&l!==""&&(!s||r.trim()!==""),g=()=>{!x||u||(d(!0),h(void 0),e.login({username:i.trim(),password:l,...s?{serverOrigin:r.trim()}:{}}).then(y=>{d(!1),y.ok||h(y.error)}))};return a.jsxs(le,{gap:3,style:{width:"100%"},children:[a.jsxs(le,{gap:1,children:[a.jsx(ds,{level:3,children:"Sign in"}),a.jsx(Y,{type:"supporting",children:"See the hosts on your account and connect without a QR code."})]}),t===void 0?null:a.jsx(lt,{label:"Server",placeholder:"https://nomad.example.com",value:t.origin,onChange:t.setOrigin,onEnter:g,width:"100%"}),a.jsx(lt,{label:"Username",value:i,onChange:o,onEnter:g,width:"100%"}),a.jsx(lt,{label:"Password",type:"password",value:l,onChange:c,onEnter:g,width:"100%"}),f===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't sign in",description:Bs(f)}),a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Q,{label:"Sign in",variant:"primary",isLoading:u,isDisabled:!x,onClick:g}),a.jsx(Q,{label:"Create an account",variant:"ghost",onClick:n})]})]})}function vJ({account:e,server:t,onSignIn:n}){const s=t!==void 0,r=(t==null?void 0:t.origin)??"",[i,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!1),[x,g]=p.useState(),y=i.trim()!==""&&l.trim()!==""&&u!==""&&(!s||r.trim()!==""),v=()=>{!y||f||(h(!0),g(void 0),e.register({invite:i.trim(),username:l.trim(),password:u,...s?{serverOrigin:r.trim()}:{}}).then(m=>{h(!1),m.ok||g(m.error)}))};return a.jsxs(le,{gap:3,style:{width:"100%"},children:[a.jsxs(le,{gap:1,children:[a.jsx(ds,{level:3,children:"Create an account"}),a.jsx(Y,{type:"supporting",children:"You need an invite code from the server's admin."})]}),t===void 0?null:a.jsx(lt,{label:"Server",placeholder:"https://nomad.example.com",value:t.origin,onChange:t.setOrigin,onEnter:v,width:"100%"}),a.jsx(lt,{label:"Invite code",value:i,onChange:o,onEnter:v,width:"100%"}),a.jsx(lt,{label:"Username",description:"Lowercase letters, digits, dots, dashes or underscores",value:l,onChange:c,onEnter:v,width:"100%"}),a.jsx(lt,{label:"Password",description:"At least 12 characters",type:"password",value:u,onChange:d,onEnter:v,width:"100%"}),x===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't create the account",description:Bs(x)}),a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Q,{label:"Create account",variant:"primary",isLoading:f,isDisabled:!y,onClick:v}),a.jsx(Q,{label:"Sign in instead",variant:"ghost",onClick:n})]})]})}function kJ({account:e,state:t,onNotice:n}){const[s,r]=p.useState(),{focusHost:i}=Ps(),o=new URL(t.serverOrigin).host,l=c=>{var u;r(void 0),e.retryUnsavedHost((u=c.account)==null?void 0:u.hostId).then(d=>{d.ok?i(c.hostKey):r(d.error)})};return a.jsxs(le,{gap:4,style:{width:"100%"},children:[a.jsxs(le,{gap:1,children:[a.jsx(ds,{level:3,children:t.user}),a.jsxs(Y,{type:"supporting",children:["Signed in to ",o]})]}),t.unsavedHosts.map(c=>a.jsx(Pe,{status:"warning",title:"This pairing wasn't saved",description:`${c.name??c.url} will be lost when the app restarts.`,endContent:a.jsx(Q,{label:"Retry",variant:"ghost",onClick:()=>l(c)})},c.hostKey)),a.jsx(bJ,{account:e,state:t,onError:r}),s===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't pair",description:Bs(s)}),a.jsx(SJ,{account:e,serverOrigin:t.serverOrigin}),a.jsx(AJ,{account:e,hosts:t.hosts}),t.admin?a.jsx(CJ,{account:e}):null,a.jsx(NJ,{account:e}),a.jsx(RJ,{account:e,onNotice:n}),t.admin?null:a.jsx(IJ,{account:e,server:o,onNotice:n})]})}function bJ({account:e,state:t,onError:n}){const s=Lo(3e4),{focus:r,focusHost:i}=Ps(),[o,l]=p.useState(),c=u=>{l(u),n(void 0),e.pairHost(u).then(d=>{l(void 0),d.ok?i(d.value.hostKey):n(d.error)})};return a.jsxs(le,{gap:2,children:[a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Y,{weight:"semibold",children:"Hosts"}),a.jsx(Q,{label:"Refresh",variant:"ghost",size:"sm",onClick:()=>void e.refreshHosts()})]}),t.hostsError===void 0?null:a.jsx(Pe,{status:"warning",title:"Couldn't refresh hosts",description:Bs(t.hostsError)}),t.hosts.length===0?a.jsx(Y,{type:"supporting",children:"No hosts yet. Add one below."}):a.jsx(Bt,{density:"compact",children:t.hosts.map(u=>{var d;return a.jsx(jJ,{match:u,now:s,isCurrent:u.status==="paired"&&((d=u.stored)==null?void 0:d.hostKey)===(r==null?void 0:r.hostKey),isRevoked:u.stored!==void 0&&t.rejectedHostKeys.includes(u.stored.hostKey),isPairing:o===u.host.hostId,isBusy:o!==void 0,onPair:()=>c(u.host.hostId)},u.host.hostId)})})]})}const wJ={offline:"Offline",host_too_old:"Needs pinomad upgrade",key_mismatch:"Run pinomad join again"};function jJ({match:e,now:t,isCurrent:n,isRevoked:s,isPairing:r,isBusy:i,onPair:o}){const{focusHost:l}=Ps(),{host:c,status:u,stored:d}=e,f=c.online?"Online":`Last seen ${Bd(c.lastSeenAt,t)}`,h=c.pairing==="available",x=v=>a.jsx(Q,{label:v,variant:"secondary",size:"sm",isLoading:r,isDisabled:!h||i,onClick:o});let g=f,y;return s?(g="This device was refused by the host",y=x("Pair again")):u==="key_changed"?(g="The host's identity changed. Pair again only if you reinstalled it.",y=a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(On,{label:"Key changed",color:"orange",size:"sm"}),x("Pair again")]})):u==="paired"?y=n?a.jsx(On,{label:"Connected",size:"sm"}):a.jsx(Q,{label:"Connect",variant:"secondary",size:"sm",onClick:()=>l(d.hostKey)}):(h||(g=`${f} · ${wJ[c.pairing]}`),y=x("Pair")),a.jsx(Ye,{label:c.name,description:g,startContent:a.jsx(Hi,{variant:c.online?"success":"neutral",label:c.online?"Online":"Offline"}),endContent:y})}function SJ({account:e,serverOrigin:t}){const[n,s]=p.useState(!1);return n?a.jsxs(le,{gap:3,children:[a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Y,{weight:"semibold",children:"Add a host"}),a.jsx(Q,{label:"Done",variant:"ghost",size:"sm",onClick:()=>{s(!1),e.refreshHosts()}})]}),a.jsx(DT,{serverOrigin:t})]}):a.jsx(Q,{label:"Add a host",variant:"secondary",onClick:()=>s(!0)})}const t1=(e,t)=>{const n=Bd(e,t);return n==="now"?"just now":`${n} ago`};function CJ({account:e}){const t=Lo(6e4),[n,s]=p.useState(),[r,i]=p.useState(),[o,l]=p.useState(),[c,u]=p.useState(!1),d=()=>e.listInvites().then(x=>{x.ok?s(x.value):l(x.error)});p.useEffect(()=>{d()},[e]);const f=()=>{u(!0),l(void 0),e.createInvite().then(async x=>{if(u(!1),!x.ok){l(x.error);return}i(x.value),await d()})},h=x=>{l(void 0),e.revokeInvite(x).then(async g=>{g.ok||l(g.error),await d()})};return a.jsxs(le,{gap:2,children:[a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Y,{weight:"semibold",children:"Invites"}),a.jsx(Q,{label:"Create invite",variant:"secondary",size:"sm",isLoading:c,onClick:f})]}),r===void 0?null:a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"Send this code to the person you're inviting. It won't be shown again."}),a.jsx(uh,{code:r.code,hasCopyButton:!0,isWrapped:!0}),a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsxs(Y,{type:"supporting",children:["Works once · expires in ",Bd(t,r.expiresAt)]}),a.jsx(Q,{label:"Done",variant:"ghost",size:"sm",onClick:()=>i(void 0)})]})]}),n===void 0||n.length===0?n===void 0?null:a.jsx(Y,{type:"supporting",children:"No invites yet. Each one lets one person create an account."}):a.jsx(Bt,{density:"compact",children:n.map(x=>a.jsx(EJ,{invite:x,now:t,onRevoke:()=>h(x.id)},x.id))}),o===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't update invites",description:Bs(o)})]})}function EJ({invite:e,now:t,onRevoke:n}){return e.usedAt!==void 0?a.jsx(Ye,{label:e.usedBy===void 0?"Used":`Used by ${e.usedBy}`,description:`Signed up ${t1(e.usedAt,t)}`}):e.expiresAt<=t?a.jsx(Ye,{label:"Expired",description:`Created ${t1(e.createdAt,t)}`}):a.jsx(Ye,{label:"Unused",description:`Created ${t1(e.createdAt,t)} · expires in ${Bd(t,e.expiresAt)}`,endContent:a.jsx(Q,{label:"Revoke",variant:"ghost",size:"sm",onClick:n})})}const $J={registered:"registered",revoking:"waiting for the host to revoke",revoked:"revoked"};function AJ({account:e,hosts:t}){const n=Lo(6e4),[s,r]=p.useState(),[i,o]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(),f=()=>e.listDevices().then(h=>{h.ok?(r(h.value),o(void 0)):h.error.status===404?c(!0):o(h.error)});return p.useEffect(()=>{f()},[e]),l?null:a.jsxs(le,{gap:2,children:[a.jsxs(ye,{gap:2,vAlign:"center",hAlign:"between",children:[a.jsx(Y,{weight:"semibold",children:"Devices"}),a.jsx(Q,{label:"Refresh",variant:"ghost",size:"sm",onClick:()=>void f()})]}),i===void 0?null:a.jsx(Pe,{status:"warning",title:"Couldn't load devices",description:Bs(i)}),s===void 0||s.length===0?null:a.jsx(Bt,{density:"compact",children:s.map(h=>a.jsx(MJ,{device:h,now:n,isBusy:u!==void 0,onRemove:()=>d(h)},h.id))}),u===void 0?null:a.jsx(zJ,{account:e,device:u,hosts:t,onClose:h=>{d(void 0),h&&f()}})]})}function MJ({device:e,now:t,isBusy:n,onRemove:s}){const r=`Last sign-in ${t1(e.lastSeenAt,t)}`,i=e.current?a.jsx(On,{label:"This device",size:"sm"}):e.kickedAt!==void 0?a.jsx(On,{label:"Removed",color:"gray",size:"sm"}):a.jsx(Q,{label:"Remove",variant:"ghost",size:"sm",isDisabled:n,onClick:s});return a.jsx(Ye,{label:e.name??"Unknown device",description:a.jsxs(le,{gap:0,children:[a.jsx(Y,{type:"inherit",children:e.kickedAt===void 0?r:`${r} · removed ${t1(e.kickedAt,t)}`}),e.hosts.length===0?null:a.jsx(Y,{type:"inherit",children:e.hosts.map(o=>`${o.name}: ${$J[o.state]}`).join(" · ")})]}),endContent:i})}const TJ=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function zJ({account:e,device:t,hosts:n,onClose:s}){const[r,i]=p.useState(""),[o,l]=p.useState(!1),[c,u]=p.useState(),d=t.name??"this device",f=n.filter(x=>x.host.deviceReports===!1).map(x=>x.host.name),h=()=>{r===""||o||(l(!0),u(void 0),e.kickDevice({id:t.id,password:r}).then(x=>{l(!1),x.ok||x.error.code==="not_found"?s(!0):u(x.error)}))};return a.jsxs(le,{gap:2,children:[a.jsxs(Y,{weight:"semibold",children:["Remove ",d]}),a.jsxs(Y,{type:"supporting",children:["This signs ",d," out of your account and asks each host it joined through your account to revoke it. Hosts that are offline revoke it when they reconnect.",f.length===0?null:f.length===1?` The host ${f[0]} can't be asked. If ${d} joined it, revoke it in that host's Devices.`:` The hosts ${TJ(f)} can't be asked. If ${d} joined them, revoke it in each one's Devices.`]}),a.jsx(lt,{label:"Password",type:"password",value:r,onChange:i,onEnter:h,width:"100%"}),c===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't remove the device",description:Bs(c)}),a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Remove device",variant:"destructive",isLoading:o,isDisabled:r==="",onClick:h}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:()=>s(!1)})]})]})}function NJ({account:e}){const[t,n]=p.useState(!1),[s,r]=p.useState(""),[i,o]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(),[f,h]=p.useState(!1),x=s!==""&&i!=="",g=()=>{n(!1),r(""),o(""),d(void 0)},y=()=>{!x||l||(c(!0),d(void 0),e.changePassword({currentPassword:s,newPassword:i}).then(v=>{if(c(!1),!v.ok){d(v.error);return}g(),h(!0)}))};return t?a.jsxs(le,{gap:2,children:[a.jsx(Y,{weight:"semibold",children:"Change password"}),a.jsx(lt,{label:"Current password",type:"password",value:s,onChange:r,onEnter:y,width:"100%"}),a.jsx(lt,{label:"New password",description:"At least 12 characters. Your other devices will be signed out.",type:"password",value:i,onChange:o,onEnter:y,width:"100%"}),u===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't change the password",description:Bs(u)}),a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Change password",variant:"primary",isLoading:l,isDisabled:!x,onClick:y}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:g})]})]}):a.jsxs(le,{gap:1,children:[a.jsx(ye,{gap:2,children:a.jsx(Q,{label:"Change password",variant:"ghost",onClick:()=>{h(!1),n(!0)}})}),f?a.jsx(Y,{type:"supporting",children:"Password changed. Your other devices were signed out."}):null]})}function _J(e,t){if(!e.ok)return e.error.code==="hosts_not_forgotten"?"Some hosts couldn't be removed from this device, so it may still connect to them. Forget them in the host list, or revoke this device on each host.":t?"This device forgot its account hosts, but the server didn't confirm asking them to revoke it. Remove it from another device, or revoke it on each host.":"Signed out on this device, but the server didn't confirm. The session ends on its own within 30 days."}function RJ({account:e,onNotice:t}){const[n,s]=p.useState(!1),[r,i]=p.useState(!1),[o,l]=p.useState(!1),c=u=>t(u===void 0?void 0:{status:"warning",title:"Sign-out not confirmed",description:u});return p.useEffect(()=>{if(!o)return;const u=setTimeout(()=>l(!1),5e3);return()=>clearTimeout(u)},[o]),n?a.jsxs(le,{gap:2,children:[a.jsx(Y,{weight:"semibold",children:"Sign out"}),a.jsx(ch,{label:"This is a shared computer",description:"Also remove this device from the hosts it joined through your account, and forget them here. Hosts paired with a QR code stay.",value:r,onChange:i}),a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Sign out",variant:r?"destructive":"primary",onClick:()=>{c(void 0),e.logout({revoke:r}).then(u=>c(_J(u,r)))}}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:()=>{s(!1),i(!1)}})]})]}):a.jsxs(le,{gap:1,children:[a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Sign out",variant:"ghost",onClick:()=>{l(!1),s(!0)}}),a.jsx(Q,{label:o?"Sign out everywhere?":"Sign out everywhere",variant:o?"destructive":"ghost",onClick:()=>{if(!o){l(!0);return}c(void 0),e.revokeAll().then(u=>{u.ok||c("Other devices may still be signed in. Sign in and try Sign out everywhere again.")})}})]}),a.jsx(Y,{type:"supporting",children:"Signing out keeps this device paired with its hosts, unless you say it's a shared computer."})]})}function IJ({account:e,server:t,onNotice:n}){const[s,r]=p.useState(!1),[i,o]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(),f=()=>{r(!1),o(""),d(void 0)},h=()=>{i===""||l||(c(!0),d(void 0),e.deleteAccount({password:i}).then(x=>{if(x.ok){if(e.state.status!=="signed-out")return;n({status:"success",title:"Account deleted",description:"This device is still registered on your hosts. To remove it, revoke it in each host's Devices."});return}c(!1),d(x.error)}))};return s?a.jsxs(le,{gap:2,children:[a.jsx(Y,{weight:"semibold",children:"Delete account"}),a.jsxs(Y,{type:"supporting",children:["This deletes your account on ",t," and signs you out everywhere. Hosts joined to it are disconnected from the server; run pinomad join on each to connect it again. This device and your others stay registered on their hosts. To remove them, revoke them in each host's Devices."]}),a.jsx(lt,{label:"Password",type:"password",value:i,onChange:o,onEnter:h,width:"100%"}),u===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't delete the account",description:Bs(u)}),a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Delete account",variant:"destructive",isLoading:l,isDisabled:i==="",onClick:h}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:f})]})]}):a.jsx(ye,{gap:2,children:a.jsx(Q,{label:"Delete account",variant:"ghost",onClick:()=>r(!0)})})}function tm({onClose:e}){return a.jsx(mr,{isOpen:!0,onOpenChange:t=>t?void 0:e(),width:480,children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Account",onOpenChange:()=>e()}),content:a.jsx(qs,{children:a.jsx("div",{style:{padding:"var(--spacing-2)"},children:a.jsx(L3,{})})})})})}const BT={p2p:"P2P",relay:"Relay",direct:"Direct",loopback:"Local"},rk={loopback:"Local",lan:"LAN",tailnet:"Tailnet",public:"Internet",unknown:"Unknown"},LJ={signal:"Signal",ice:"ICE",noise:"Noise",warm:"Warm-up",commit:"Switch",liveness:"Liveness"};function OJ(e){if(e!==void 0){if(e.remote.scope!=="unknown")return e.remote.scope;if(e.local.scope!=="unknown")return e.local.scope}}function HT(e){const t=OJ(e);return t===void 0?void 0:rk[t]}function DJ(e){if(e.path!=="p2p")return BT[e.path];const t=HT(e.selectedPair);return t===void 0?"P2P":`P2P · ${t}`}function BJ(e){const t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function HJ(e){const t=LJ[e.stage],n=e.reason===void 0?t:`${t} — ${e.reason}`,s=HT(e.pair);return[n,BJ(e.agoMs),...s===void 0?[]:[`on ${s}`]].join(" · ")}function qJ(e){const t=[e.type,e.address].filter(n=>n!==void 0&&n.trim()!=="").join(" · ");return t===""?rk[e.scope]:`${t} (${rk[e.scope]})`}const PJ={auto:"Start on the relay, then switch to a direct peer-to-peer link once it is stable.",directOnly:"Never send conversation data through the PiNomad server. The relay is used only to set up the link.",relayOnly:"Always go through the relay; never try peer-to-peer."};function UJ(e){const t=Math.max(1,Math.ceil(e/1e3));return t>=60?`${Math.ceil(t/60)}m`:`${t}s`}function FJ(e,t){const[n,s]=p.useState();return p.useEffect(()=>{if(!t||e===void 0){s(void 0);return}const r=()=>s(e.rtcDiagnostics());r();const i=setInterval(r,1e3);return()=>clearInterval(i)},[t,e]),n}function VJ({diagnostics:e,mode:t,hostMinor:n,rtcAvailable:s,connectedSince:r}){return s?n!==void 0&&!Zt(n,"rtc")?"Not available on this host":t==="relayOnly"?"Off (Relay only)":e===void 0?"Preparing…":e.path==="p2p"||e.phase==="active"?"Active":e.phase==="cooldown"?`Cooling down · retry in ${UJ(e.cooldownRemainingMs)}`:e.phase!=="idle"?"Preparing…":e.lastFailure!==void 0?"Idle":Date.now()-r>2500?"Not available on this host":"Preparing…":"Not available in this browser"}function j9({label:e,end:t}){return a.jsxs(ye,{gap:2,style:{alignItems:"baseline"},children:[a.jsx(Y,{type:"supporting",className:"w-20 shrink-0",children:e}),a.jsx(Y,{type:"code",size:"sm",color:"secondary",hasTabularNumbers:!0,style:{wordBreak:"break-all",userSelect:"all"},children:qJ(t)})]})}function qT(){const{hosts:e,focus:t,focusHost:n}=Ps(),s=TT(),r=j3(e),i=o=>s.get(o.hostKey);return{hosts:e,focusHost:n,label:o=>r.get(o.hostKey)??o.url,isCurrent:o=>(t==null?void 0:t.hostKey)===o.hostKey,isConnected:o=>ic(i(o))==="connected",info:i,infoOf:o=>o===void 0?void 0:s.get(o)}}function PT({connected:e}){return a.jsx("span",{"aria-hidden":"true",className:"inline-flex",children:e?a.jsx(Hi,{variant:"success",label:"Connected",isPulsing:!0}):a.jsx(Hi,{variant:"neutral",label:"Not connected"})})}function GJ({onLocate:e}){const t=qT();return a.jsx(zd,{hasChevron:!1,placement:"above",alignment:"end",menuWidth:"max-content",button:{icon:a.jsx(R1,{"aria-hidden":"true"}),isIconOnly:!0,label:"Hosts",tooltip:"Hosts",size:"sm",variant:"ghost"},children:t.hosts.map(n=>a.jsx(o1,{icon:a.jsx(PT,{connected:t.isConnected(n)}),label:a.jsxs(a.Fragment,{children:[t.label(n),a.jsx("span",{"aria-hidden":"true",className:"ms-2 text-muted",children:sk(t.info(n))}),a.jsx(qi,{children:`(${sk(t.info(n)).toLowerCase()})`})]}),...e===void 0?{}:{onClick:()=>e(n.hostKey)}},n.hostKey))})}function UT({rtcAvailable:e=AT()}){var M;const t=qT(),{setConnection:n,forget:s,focus:r}=Ps(),[i,o]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState(),f=l===void 0?void 0:t.info(l);ic(f);const h=(l==null?void 0:l.hostKey)??(r==null?void 0:r.hostKey),x=t.infoOf(h),g=(x==null?void 0:x.phase)==="ready"?x.remote:void 0,y=FJ(g,ic(x)==="connected"),v=p.useRef(Date.now());p.useEffect(()=>{v.current=Date.now()},[g,h]);const m=l===void 0?void 0:t.hosts.find(E=>E.hostKey===l.hostKey)??l,k=(f==null?void 0:f.phase)==="ready"?(M=f.view.host)==null?void 0:M.protocol.minor:void 0,b=E=>{d(void 0),o(void 0),c(z=>(z==null?void 0:z.hostKey)===E.hostKey?void 0:E)},j=(E,z)=>{d(void 0),n(E.hostKey,{connectionMode:z}).then(()=>{const T=t.info(E);if(T!==void 0){if(T.phase!=="ready"){T.retry();return}T.view.connection==="closed"||T.view.connection==="outdated"?T.retry():T.remote.setConnectionMode(z)}},T=>{const $=T instanceof Error?T.message:String(T);console.error("Could not store the host connection mode",T),d($)})},A=E=>{const z=t.info(E);return ic(z)!=="connected"?sk(z):h===E.hostKey&&y!==void 0?`Connected · ${BT[y.path]}`:"Connected"};return a.jsxs(le,{gap:5,children:[t.hosts.length===0?a.jsx(Y,{type:"supporting",children:"No paired hosts."}):a.jsx(Bt,{density:"compact",children:t.hosts.map(E=>{const z=t.label(E),T=t.isConnected(E);return a.jsx(Ye,{startContent:a.jsx(PT,{connected:T}),label:z,description:A(E),endContent:a.jsxs(ye,{gap:2,vAlign:"center",children:[t.isCurrent(E)?a.jsx(On,{label:"Current",size:"sm"}):a.jsx(Q,{label:"Switch","aria-label":`Switch to ${z}`,variant:"ghost",size:"sm",onClick:()=>t.focusHost(E.hostKey)}),a.jsx(Q,{label:"Connection…","aria-label":`Connection to ${z}`,variant:"ghost",size:"sm",onClick:()=>b(E)}),a.jsx(Q,{label:"Forget…","aria-label":`Forget ${z}…`,variant:"ghost",size:"sm",onClick:()=>{c(void 0),o(E)}})]})},E.hostKey)})}),m===void 0?null:a.jsxs(le,{gap:3,role:"group","aria-label":`Connection to ${t.label(m)}`,children:[a.jsx(Y,{weight:"semibold",children:`Connection to ${t.label(m)}`}),a.jsxs(le,{gap:1,children:[a.jsx(ye,{gap:2,vAlign:"center",wrap:"wrap",children:a.jsxs(o4,{className:"shrink-0",value:m.connectionMode??"auto",onChange:E=>j(m,E),label:"Connection mode",size:"sm",children:[a.jsx(yu,{value:"auto",label:"Auto"}),a.jsx(yu,{value:"directOnly",label:"Direct only"}),a.jsx(yu,{value:"relayOnly",label:"Relay only"})]})}),a.jsx(Y,{type:"supporting",children:PJ[m.connectionMode??"auto"]})]}),u===void 0?null:a.jsx(Y,{type:"supporting",children:`Could not save the connection mode: ${u}`}),t.isConnected(m)?a.jsxs(le,{gap:1,children:[a.jsx(Y,{weight:"semibold",children:"Status"}),a.jsxs(Bt,{density:"compact",children:[a.jsx(Ye,{label:"Path",description:a.jsxs(le,{gap:1,children:[a.jsx(Y,{type:"inherit",children:y===void 0?"—":DJ(y)}),(y==null?void 0:y.path)==="p2p"&&y.selectedPair!==void 0?a.jsx(jg,{defaultIsOpen:!1,trigger:a.jsx(Y,{type:"body",size:"sm",color:"secondary",className:"block min-h-11 py-3",children:"Show addresses"}),children:a.jsxs(le,{gap:1,children:[a.jsx(j9,{label:"This device",end:y.selectedPair.local}),a.jsx(j9,{label:"Host",end:y.selectedPair.remote})]})}):null]})}),a.jsx(Ye,{label:"Peer-to-peer",description:VJ({diagnostics:y,mode:m.connectionMode??"auto",hostMinor:k,rtcAvailable:e,connectedSince:v.current})}),(y==null?void 0:y.lastFailure)===void 0?null:a.jsx(Ye,{label:"Last failure",description:a.jsx(Y,{type:"inherit",hasTabularNumbers:!0,children:HJ(y.lastFailure)})})]})]}):null,a.jsx(ye,{hAlign:"end",children:a.jsx(Q,{label:"Close",variant:"secondary",size:"sm",onClick:()=>c(void 0)})})]}),i===void 0?null:a.jsxs(le,{gap:2,role:"group","aria-label":`Forget ${t.label(i)}?`,children:[a.jsx(Y,{weight:"semibold",children:`Forget ${t.label(i)}?`}),a.jsx(Y,{type:"supporting",children:"This device needs a new pairing link to connect to it again. The host still lists this device — revoke it under Settings → Devices on that host to remove it completely."}),a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>o(void 0)}),a.jsx(Q,{label:"Forget this host",variant:"destructive",size:"sm",onClick:()=>{const E=i;o(void 0),c(void 0),s(E.hostKey).catch(z=>console.error("Could not forget the host",z))}})]})]}),a.jsxs(le,{gap:2,children:[a.jsx(ds,{level:3,children:"Pair a host"}),a.jsx(Y,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),a.jsx(Ux,{})]})]})}function n1(){const e=Io(),[t,n]=p.useState(!1);return a.jsxs(le,{gap:3,className:"mt-4 w-full max-w-md",children:[a.jsx(UT,{}),e.state.status==="unavailable"?null:a.jsx("div",{children:a.jsx(Q,{label:"Account…",variant:"ghost",size:"sm",onClick:()=>n(!0)})}),t?a.jsx(tm,{onClose:()=>n(!1)}):null]})}const WJ="pinomad.projectSidebar.expanded",FT=e=>`${WJ}.${e}`,KJ=e=>{const t=window.localStorage.getItem(FT(e));if(t===null)return{};try{const n=JSON.parse(t);return Object.fromEntries(Object.entries(n).filter(s=>typeof s[0]=="string"&&typeof s[1]=="boolean"))}catch{return{}}},S9=(e,t)=>{window.localStorage.setItem(FT(e),JSON.stringify(t))},Fx=e=>e.flatMap(t=>[t,...Fx(t.children)]);function XJ({onCollapse:e,safeLeft:t}){return a.jsx("div",{className:"pinomad-drag flex h-6 items-center px-2",style:t===void 0?void 0:{paddingLeft:t},children:a.jsx(un,{icon:a.jsx(Px,{className:"size-4"}),label:"Collapse sidebar",size:"sm",variant:"ghost",onClick:e})})}function C9({onOpenSettings:e,onOpenAccount:t,onLocateHost:n,onSelect:s}){const r=z3();return a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(ZJ,{onOpenAccount:()=>{s==null||s(),t()}})}),a.jsx(GJ,{...n===void 0?{}:{onLocate:n}}),a.jsxs("span",{className:"relative inline-flex",children:[a.jsx(un,{icon:a.jsx(OY,{"aria-hidden":"true"}),label:"Settings",tooltip:"Settings",size:"sm",variant:"ghost",onClick:()=>{s==null||s(),e()}}),(r==null?void 0:r.status.state)==="ready"?a.jsx("span",{"aria-label":"Update ready",className:"pointer-events-none absolute right-1 top-1 size-2 rounded-full bg-primary",role:"img"}):null]})]})}function ZJ({onOpenAccount:e}){const t=Io(),n=t.state.status,[s,r]=p.useState();if(p.useEffect(()=>{if(n!=="unavailable")return;let i=!0;return I3().then(o=>{i&&r(o)}),()=>{i=!1}},[n]),t.state.status==="signed-in"){const{user:i}=t.state;return a.jsx(Q,{label:i,icon:a.jsx(lS,{name:i,size:"xsm",tooltip:!1}),variant:"ghost",size:"sm",onClick:e})}return n==="signed-out"?a.jsx(Q,{label:"Sign in",icon:a.jsx(qY,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:e}):a.jsx("span",{className:"block truncate px-2 text-sm text-muted",children:s})}function YJ({title:e,expanded:t,contentId:n,onToggle:s,actions:r,pinnedActions:i=!1}){return a.jsxs("div",{className:"pigui-sidenav-section-header",children:[a.jsxs("button",{type:"button",className:"pigui-sidenav-section-toggle","aria-label":t?`Collapse ${e}`:`Expand ${e}`,"aria-expanded":t,"aria-controls":n,onClick:s,children:[a.jsx("span",{className:"pigui-sidenav-section-toggle__title",children:e}),a.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-section-toggle__chevron","data-expanded":t?"true":"false",children:a.jsx(ze,{icon:"chevronRight",size:"sm",color:"inherit"})})]}),a.jsx(ye,{className:i?void 0:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:r})]})}function ap(){return a.jsx("span",{className:"pigui-session-glyph","data-testid":"session-glyph"})}const VT={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function QJ({status:e}){const t=e==="needs-answer"?"warning":e==="failed"?"error":"success",n=VT[e];return a.jsx("span",{className:"pigui-session-glyph","aria-hidden":"true",children:a.jsx(Hi,{variant:t,label:n,tooltip:n,isPulsing:e!=="failed"})})}function E9({expanded:e,closed:t,open:n}){const s=e?n:t;return a.jsxs("span",{"aria-hidden":"true",className:"pigui-project-expansion-indicator","data-expanded":e?"true":"false",children:[a.jsx(s,{className:"pigui-project-expansion-indicator__state"}),a.jsx("span",{className:"pigui-project-expansion-indicator__chevron",children:a.jsx(ze,{icon:"chevronRight",size:"sm",color:"inherit"})})]})}function JJ({node:e,shown:t,disabled:n,remote:s,onOpen:r,onSelect:i}){const{summary:o}=e,l=fK(e),c=f3(e).reduce((x,g)=>x+g.tasks.length,0),[u,d]=p.useState(!1),f=t!==void 0&&Fx([e]).some(x=>x.summary.id===t),h=a.jsx(ao,{icon:l===void 0?a.jsx(ap,{}):a.jsx(QJ,{status:l}),label:o.title??"New conversation",isSelected:f,isDisabled:n,endContent:a.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer pigui-sidenav-actions-spacer--single",children:c===0?null:a.jsxs("span",{className:"pigui-sidenav-subagent-count",children:[a.jsx(Sh,{className:"size-3"}),c]})}),onClick:()=>{r(o.id),i==null||i()}});return a.jsxs("div",{className:"pigui-sidenav-row-with-actions pigui-sidenav-session-row",...l===void 0?{}:{"data-status":l},children:[h,l===void 0?null:a.jsx(qi,{children:VT[l]}),a.jsx(ye,{className:"pigui-sidenav-row-actions pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:a.jsx(zd,{hasChevron:!1,button:{icon:a.jsx(Ch,{"aria-hidden":"true"}),isIconOnly:!0,label:"Conversation actions",size:"sm",variant:"ghost",isDisabled:n},items:[{label:"Rename",icon:a.jsx(RY,{"aria-hidden":"true",size:16}),onClick:()=>d(!0)},{label:"Archive",icon:a.jsx(oT,{"aria-hidden":"true",size:16}),onClick:()=>void s.controller.archive(o.id,!0)}]})}),u?a.jsx(XY,{summary:o,remote:s,connected:!n,onClose:()=>d(!1)}):null]})}const $9=e=>`pinomad.sidebarMachine.${e}.expanded`,G2=":chats";function eee({machines:e,focusKey:t,draftingChat:n,shownId:s,locate:r,onNewChat:i,onDraft:o,onOpen:l,onShowMachine:c,onSelect:u}){return a.jsxs(a.Fragment,{children:[a.jsx($g,{isHeaderHidden:!0,title:"New chat",children:a.jsx(ao,{icon:a.jsx(PY,{className:"size-4"}),label:"New chat",isSelected:n,isDisabled:i===void 0,onClick:()=>{i==null||i(),u==null||u()}})}),e.map(d=>a.jsx(tee,{machine:d,shownId:d.key===t?s:void 0,locateSeq:(r==null?void 0:r.key)===d.key?r.seq:void 0,onDraft:f=>o(d.key,f),onOpen:f=>l(d.key,f),...c===void 0?{}:{onShow:()=>c(d.key)},onSelect:u},d.key))]})}function tee({machine:e,shownId:t,locateSeq:n,onDraft:s,onOpen:r,onShow:i,onSelect:o}){const{key:l,label:c,view:u,remote:d}=e,f=(u==null?void 0:u.connection)!=="connected",h=p.useId(),x=p.useRef(null),[g,y]=p.useState(()=>window.localStorage.getItem($9(l))!=="false"),v=N=>{window.localStorage.setItem($9(l),String(N)),y(N)},[m,k]=p.useState(!1),[b,j]=p.useState(),[A,M]=p.useState(()=>KJ(l)),E=u==null?void 0:u.organized,z=N=>{s(N),o==null||o()},T=p.useMemo(()=>{var N;if(!(t===void 0||E===void 0))return Fx(E.chats).some(H=>H.summary.id===t)?G2:(N=E.projects.find(({conversations:H})=>Fx(H).some(B=>B.summary.id===t)))==null?void 0:N.project.path},[E,t]);p.useEffect(()=>{T!==void 0&&(g||v(!0),M(N=>{if(N[T]!==!1)return N;const H={...N,[T]:!0};return S9(l,H),H}))},[l,T]),p.useEffect(()=>{var N,H;n!==void 0&&(v(!0),(H=(N=x.current)==null?void 0:N.scrollIntoView)==null||H.call(N,{block:"nearest"}))},[n]);const $=N=>M(H=>{const B={...H,[N]:!(H[N]??!0)};return S9(l,B),B}),_=N=>d===void 0?null:a.jsx(JJ,{node:N,shown:t,disabled:f,remote:d,onOpen:r,onSelect:o},N.summary.id),R=A[G2]??!0;return a.jsxs($g,{isHeaderHidden:!0,title:c,children:[a.jsx("div",{ref:x,children:a.jsx(YJ,{title:c,expanded:g,contentId:h,onToggle:()=>v(!g),actions:a.jsxs(a.Fragment,{children:[a.jsx(un,{icon:a.jsx(qx,{"aria-hidden":"true"}),label:`New chat on ${c}`,tooltip:"New chat",size:"sm",variant:"ghost",isDisabled:f,onClick:()=>z({kind:"chat"})}),a.jsx(un,{icon:a.jsx(SY,{"aria-hidden":"true"}),label:`Add project on ${c}`,tooltip:"Add project",size:"sm",variant:"ghost",isDisabled:f,onClick:()=>k(!0)})]})})}),a.jsx(le,{id:h,gap:.5,children:g?E===void 0?a.jsx(ao,{icon:a.jsx(ap,{}),label:"No conversations available",isDisabled:i===void 0,onClick:()=>{i==null||i(),o==null||o()}}):E.chats.length===0&&E.projects.length===0?a.jsx(ao,{icon:a.jsx(ap,{}),isDisabled:!0,label:"No conversations"}):a.jsxs(a.Fragment,{children:[E.chats.length===0?null:a.jsx("div",{className:"pigui-sidenav-row-with-actions",children:a.jsx(ao,{collapsible:{isCollapsed:!R,onCollapsedChange:()=>$(G2)},icon:a.jsx(E9,{expanded:R,closed:Jv,open:Jv}),label:"Chats",isDisabled:f,children:E.chats.map(_)})}),E.projects.map(({project:N,conversations:H})=>{const B=A[N.path]??!0;return a.jsxs("div",{className:"pigui-sidenav-row-with-actions",children:[a.jsx(ao,{collapsible:{isCollapsed:!B,onCollapsedChange:()=>$(N.path)},icon:a.jsx(E9,{expanded:B,closed:I1,open:EY}),label:N.name,isDisabled:f,endContent:a.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer"}),children:H.length===0?a.jsx(ao,{icon:a.jsx(ap,{}),isDisabled:!0,label:"No conversations"}):H.map(_)}),a.jsx(ye,{className:"pigui-sidenav-row-actions",gap:.5,vAlign:"center",children:a.jsxs(ye,{className:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:[a.jsx(un,{icon:a.jsx(qx,{"aria-hidden":"true"}),label:`New conversation in ${N.name}`,size:"sm",variant:"ghost",isDisabled:f,onClick:()=>z({kind:"project",path:N.path})}),a.jsx(zd,{hasChevron:!1,button:{icon:a.jsx(Ch,{"aria-hidden":"true"}),isIconOnly:!0,label:`Project actions for ${N.name}`,size:"sm",variant:"ghost",isDisabled:f},items:[{label:"Remove project",icon:a.jsx(HY,{"aria-hidden":"true",size:16}),onClick:()=>j(N)}]})]})})]},N.path)})]}):null}),m&&d!==void 0?a.jsx(GY,{remote:d,connected:!f,onAdded:N=>{k(!1),z({kind:"project",path:N.path})},onClose:()=>k(!1)}):null,b===void 0||d===void 0?null:a.jsx(KY,{project:b,remote:d,connected:!f,onClose:()=>j(void 0)})]})}const A9=32,M9=1024,nee=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function GT(e){return e.length>A9||!nee.test(e)?`Name must be lowercase letters, digits and hyphens (max ${A9})`:void 0}function see(e){const t=GT(e.name);if(t!==void 0)return t;const n=e.description.trim();if(n==="")return"description is required";if(n.length>M9)return`description is too long (max ${M9})`;if(e.model!==void 0){const s=e.model.indexOf("/");if(s<=0||s===e.model.length-1)return"model must be provider/modelId"}if(e.thinkingLevel!==void 0&&!YY(e.thinkingLevel))return`thinkingLevel must be one of ${tk.join(", ")}`}const L1={off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"X-High",max:"Max"},W2=(e,t)=>e!==void 0&&t!==void 0&&e.provider===t.provider&&e.modelId===t.modelId,T9=["off","minimal","low","medium","high","xhigh","max"],Vx=(e,t)=>{if(e.includes(t))return t;const n=T9.indexOf(t);return e.filter(s=>T9.indexOf(s)<=n).at(-1)??"off"},hr=(e,t)=>t===void 0?void 0:e.find(n=>n.provider===t.provider&&n.modelId===t.modelId);function ree(e,t){var i;const n=hr(e,t.model),s=(n==null?void 0:n.thinkingLevels)??["off"],r=(n==null?void 0:n.name)??((i=t.model)==null?void 0:i.modelId)??"No model";return s.length>1?`${r} · ${L1[t.level]}`:r}function iee(e,t){const n=t.trim().toLowerCase();return n===""?e:e.filter(s=>s.name.toLowerCase().includes(n)||`${s.provider}/${s.modelId}`.toLowerCase().includes(n))}function oee(e,t,n){var i;const s=n.model!==void 0&&hr(e,n.model)!==void 0?n.model:hr(e,t.model)!==void 0?t.model:e[0]===void 0?void 0:{provider:e[0].provider,modelId:e[0].modelId},r=Vx(((i=hr(e,s))==null?void 0:i.thinkingLevels)??["off"],n.level);return{model:s,level:r}}const aee=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function lee(e,t,n,s,r){var y;const i=t==null?void 0:t.roles.find(v=>v.name===e),o=i===void 0||i.model===void 0?void 0:aee(i.model),l=r.model??o??s.model,c=r.model!==void 0?"override":o!==void 0?"agent":s.model!==void 0?"default":void 0,u=r.level!==void 0?"override":(i==null?void 0:i.thinkingLevel)!==void 0?"agent":"default",d=r.level??(i==null?void 0:i.thinkingLevel)??s.thinkingLevel??"off",f=hr(n,l),h=f===void 0?d:Vx(f.thinkingLevels,d),x=(y=t==null?void 0:t.problems.find(v=>v.file===`${e}.md`))==null?void 0:y.reason,g=i===void 0?{kind:"agent-missing",agent:e,...x===void 0?{}:{reason:x}}:l===void 0?{kind:"model-missing",agent:e}:f===void 0?{kind:"model-unavailable",agent:e,model:l,source:c}:void 0;return{...l===void 0?{}:{model:l},level:h,...c===void 0?{}:{modelFrom:c},levelFrom:u,send:{agent:e,...r.model===void 0?{}:{model:r.model},...r.level===void 0?{}:{thinkingLevel:r.level}},...g===void 0?{}:{problem:g}}}const cee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Anthropic</title><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>',uee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Arcee</title><path d="M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z" fill="#008C8C"></path></svg>',dee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>',fee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baseten</title><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>',hee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Bedrock</title><defs><linearGradient id="lobe-icons-bedrock-_R_0_" x1="80%" x2="20%" y1="20%" y2="80%"><stop offset="0%" stop-color="#6350FB"></stop><stop offset="50%" stop-color="#3D8FFF"></stop><stop offset="100%" stop-color="#9AD8F8"></stop></linearGradient></defs><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z" fill="url(#lobe-icons-bedrock-_R_0_)" fill-rule="nonzero"></path></svg>',pee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>ByteDance</title><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>',xee='<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>',gee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude</title><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z" fill="#D97757" fill-rule="nonzero"></path></svg>',mee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>',yee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path d="M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z" fill="#fff"></path><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z" fill="url(#lobe-icons-codex-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-codex-_R_0_" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>',vee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cohere</title><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z" fill="#39594D" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z" fill="#D18EE2" fill-rule="evenodd"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z" fill="#FF7759"></path></svg>',kee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>',bee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Fireworks</title><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z" fill="#5019C5" fill-rule="evenodd"></path></svg>',wee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>',jee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemma</title><defs><linearGradient id="lobe-icons-gemma-_R_0_" x1="24.419%" x2="75.194%" y1="75.581%" y2="25.194%"><stop offset="0%" stop-color="#446EFF"></stop><stop offset="36.661%" stop-color="#2E96FF"></stop><stop offset="83.221%" stop-color="#B1C5FF"></stop></linearGradient></defs><path d="M12.34 5.953a8.233 8.233 0 01-.247-1.125V3.72a8.25 8.25 0 015.562 2.232H12.34zm-.69 0c.113-.373.199-.755.257-1.145V3.72a8.25 8.25 0 00-5.562 2.232h5.304zm-5.433.187h5.373a7.98 7.98 0 01-.267.696 8.41 8.41 0 01-1.76 2.65L6.216 6.14zm-.264-.187H2.977v.187h2.915a8.436 8.436 0 00-2.357 5.767H0v.186h3.535a8.436 8.436 0 002.357 5.767H2.977v.186h2.976v2.977h.187v-2.915a8.436 8.436 0 005.767 2.357V24h.186v-3.535a8.436 8.436 0 005.767-2.357v2.915h.186v-2.977h2.977v-.186h-2.915a8.436 8.436 0 002.357-5.767H24v-.186h-3.535a8.436 8.436 0 00-2.357-5.767h2.915v-.187h-2.977V2.977h-.186v2.915a8.436 8.436 0 00-5.767-2.357V0h-.186v3.535A8.436 8.436 0 006.14 5.892V2.977h-.187v2.976zm6.14 14.326a8.25 8.25 0 005.562-2.233H12.34c-.108.367-.19.743-.247 1.126v1.107zm-.186-1.087a8.015 8.015 0 00-.258-1.146H6.345a8.25 8.25 0 005.562 2.233v-1.087zm-8.186-7.285h1.107a8.23 8.23 0 001.125-.247V6.345a8.25 8.25 0 00-2.232 5.562zm1.087.186H3.72a8.25 8.25 0 002.232 5.562v-5.304a8.012 8.012 0 00-1.145-.258zm15.47-.186a8.25 8.25 0 00-2.232-5.562v5.315c.367.108.743.19 1.126.247h1.107zm-1.086.186c-.39.058-.772.144-1.146.258v5.304a8.25 8.25 0 002.233-5.562h-1.087zm-1.332 5.69V12.41a7.97 7.97 0 00-.696.267 8.409 8.409 0 00-2.65 1.76l3.346 3.346zm0-6.18v-5.45l-.012-.013h-5.451c.076.235.162.468.26.696a8.698 8.698 0 001.819 2.688 8.698 8.698 0 002.688 1.82c.228.097.46.183.696.259zM6.14 17.848V12.41c.235.078.468.167.696.267a8.403 8.403 0 012.688 1.799 8.404 8.404 0 011.799 2.688c.1.228.19.46.267.696H6.152l-.012-.012zm0-6.245V6.326l3.29 3.29a8.716 8.716 0 01-2.594 1.728 8.14 8.14 0 01-.696.259zm6.257 6.257h5.277l-3.29-3.29a8.716 8.716 0 00-1.728 2.594 8.135 8.135 0 00-.259.696zm-2.347-7.81a9.435 9.435 0 01-2.88 1.96 9.14 9.14 0 012.88 1.94 9.14 9.14 0 011.94 2.88 9.435 9.435 0 011.96-2.88 9.14 9.14 0 012.88-1.94 9.435 9.435 0 01-2.88-1.96 9.434 9.434 0 01-1.96-2.88 9.14 9.14 0 01-1.94 2.88z" fill="url(#lobe-icons-gemma-_R_0_)" fill-rule="evenodd"></path></svg>',See='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>',Cee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></svg>',Eee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>',$ee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>HuggingFace</title><path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B"></path><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E"></path><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D"></path><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45"></path><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B"></path><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E"></path></svg>',Aee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Hunyuan</title><circle cx="12" cy="12" fill="#0055E9" r="12"></circle><path d="M12 0c.518 0 1.028.033 1.528.096A6.188 6.188 0 0112.12 12.28l-.12.001c-2.99 0-5.242 2.179-5.554 5.11-.223 2.086.353 4.412 2.242 6.146C3.672 22.1 0 17.479 0 12 0 5.373 5.373 0 12 0z" fill="#A8DFF5"></path><path d="M5.286 5a2.438 2.438 0 01.682 3.38c-3.962 5.966-3.215 10.743 2.648 15.136C3.636 22.056 0 17.452 0 12c0-1.787.39-3.482 1.09-5.006.253-.435.525-.872.817-1.311A2.438 2.438 0 015.286 5z" fill="#0055E9"></path><path d="M12.98.04c.272.021.543.053.81.093.583.106 1.117.254 1.538.44 6.638 2.927 8.07 10.052 1.748 15.642a4.125 4.125 0 01-5.822-.358c-1.51-1.706-1.3-4.184.357-5.822.858-.848 3.108-1.223 4.045-2.441 1.257-1.634 2.122-6.009-2.523-7.506L12.98.039z" fill="#00BCFF"></path><path d="M13.528.096A6.187 6.187 0 0112 12.281a5.75 5.75 0 00-1.71.255c.147-.905.595-1.784 1.321-2.501.858-.848 3.108-1.223 4.045-2.441 1.27-1.651 2.14-6.104-2.676-7.554.184.014.367.033.548.056z" fill="#ECECEE"></path></svg>',Mee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>IBM</title><path clip-rule="evenodd" d="M24 16.333V17h-3.158v-.667H24zm-7.579 0V17h-3.158v-.667h3.158zm2.464 0L18.63 17l-.25-.667h.504zm-7.075 0a2.528 2.528 0 01-1.717.667h-5.04v-.667h6.757zm-7.389 0V17H0v-.667h4.421zm12-1.333v.667h-3.158V15h3.158zm2.958 0l-.246.667h-1L17.885 15h1.494zm-6.937 0c-.057.237-.148.46-.265.667H5.053V15h7.39zm-8.02 0v.667H0V15h4.421zM24 15v.667h-3.158V15H24zm-1.263-1.333v.666h-1.895v-.666h1.895zm-6.316 0v.666h-1.895v-.666h1.895zm3.453 0l-.248.666h-1.989l-.25-.666h2.487zm-7.52 0c.056.212.088.435.088.666h-2.337v-.666h2.249zm-4.143 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm19.579-1.334V13h-1.895v-.667h1.895zm-6.316 0V13h-1.895v-.667h1.895zm3.948 0l-.247.667h-2.987l-.245-.667h3.48zm-8.792 0c.218.188.405.414.55.667H6.315v-.667h5.26zm-8.42 0V13H1.264v-.667h1.895zM18.456 11l.177.539.176-.539h3.929v.667h-1.895v-.613l-.215.613H16.63l-.209-.613v.613h-1.895V11h3.929zM3.158 11v.667H1.263V11h1.895zm8.968 0a2.555 2.555 0 01-.55.667h-5.26V11h5.81zm10.61-1.333v.666h-3.709l.224-.666h3.486zm-4.722 0l.224.666h-3.712v-.666h3.488zm-5.572 0c0 .23-.032.454-.088.666h-2.249v-.666h2.337zm-4.231 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm14.419-1.334l.22.667h-4.534v-.667h4.314zm6.423 0V9h-4.536l.229-.667H24zm-11.823 0c.117.206.208.43.265.667h-7.39v-.667h7.125zm-7.756 0V9H0v-.667h4.421zM17.133 7l.224.667h-4.094V7h3.87zM24 7v.667h-4.089L20.13 7H24zM10.093 7c.662 0 1.264.253 1.717.667H5.053V7h5.04zM4.42 7v.667H0V7h4.421z"></path></svg>',Tee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Inception</title><path d="M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"></path></svg>',zee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kimi</title><path d="M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z" fill="#1783FF"></path><path d="M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z" fill="currentColor"></path></svg>',Nee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kwaipilot</title><path d="M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z" fill="url(#lobe-icons-kwaipilot-0-_R_0_)"></path><path d="M4.123 20.489l6.362-13.046c.017-.036.035-.073.055-.11l.086-.18h.005a6.697 6.697 0 015.913-3.551c2.784 0 5.171 1.7 6.184 4.116-1.622-4.485-5.92-7.69-10.963-7.69C5.327.028.108 5.247.108 11.685c0 3.514 1.556 6.666 4.015 8.804z" fill="url(#lobe-icons-kwaipilot-1-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-kwaipilot-0-_R_0_" x1="13.469" x2="12.557" y1="4.823" y2="21.302"><stop offset=".313" stop-color="#9EC0E0"></stop><stop offset="1" stop-color="#fff"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-kwaipilot-1-_R_0_" x1="13.739" x2="5.647" y1="4.229" y2="17.386"><stop stop-color="#fff"></stop><stop offset="1" stop-color="#BCD5EC"></stop></linearGradient></defs></svg>',_ee='<svg fill="#144DFF" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ling</title><path d="M9.561 0.074a0.46 0.46 0 0 1 0.517 0.011l2.848 1.357a0.222 0.222 0 0 1-0.033 0.374C9.008 3.93 6.663 5.994 5.43 7.997c-0.798 1.296-2.264 4.83-0.937 8.02 1.375 3.301 4.49 4.493 6.797 4.493 1.743 0 2.927-0.522 4.13-1.334 3.262-2.204 3.638-6.503 1.21-9.46a10 10 0 0 1 2.2 2.902 6.5 6.5 0 0 0-0.72-1.664c-0.72-1.176-1.688-2.163-3.056-2.849-3.045-1.526-9.397-0.79-10.397 5.78 0.1-4.557 3.127-7.416 5.868-8.3a9.7 9.7 0 0 1 4.654-0.314c2.029-1.639 4.272-2.376 5.075-2.601a0.53 0.53 0 0 1 0.522 0.137c0.23 0.23 0.63 0.632 1.142 1.135h0.003c0.152 0.15 0.073 0.41-0.138 0.45-1.974 0.38-3.322 0.755-4.746 1.412 1.727 0.698 3.206 1.92 4.108 3.606a0.367 0.367 0 0 1-0.199 0.52l-1.207 0.437c1.061 1.8 1.334 4.006 0.813 6.266-0.884 3.843-3.845 6.562-7.626 7.209a9.5 9.5 0 0 1-1.756 0.157 0.37 0.37 0 0 1-0.363-0.341 0.36 0.36 0 0 1-0.043-0.245l0.231-1.295c-1.055-0.074-2.045-0.248-3.036-0.648C2.077 19.094 1.46 13.297 2.304 9.785 3.4 5.23 6.766 1.78 9.561 0.074"></path></svg>',Ree='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Liquid</title><path d="M12.028 8.546l-.008.005 3.03 5.25a3.94 3.94 0 01.643 2.162c0 .754-.212 1.46-.58 2.062l6.173-1.991L11.63 0 9.304 3.872l2.724 4.674zM6.837 24l4.85-4.053h-.013c-2.219 0-4.017-1.784-4.017-3.984 0-.794.235-1.534.64-2.156l2.865-4.976-2.381-4.087L2 16.034 6.83 24h.007zM13.737 19.382h-.001L8.222 24h8.182l4.148-6.769-6.815 2.151z"></path></svg>',Iee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>',Lee='<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LongCat</title><path clip-rule="evenodd" d="M.507 19.883a.507.507 0 01-.489-.642L4.29 3.745a1.013 1.013 0 011.533-.578l5.622 3.687a1.013 1.013 0 001.11 0L18.2 3.165a1.013 1.013 0 011.532.58l4.25 15.497a.506.506 0 01-.49.64H18.07a6.297 6.297 0 001.53-4.115v-.177a6.09 6.09 0 00-1.513-4.017l-.697-3.495a.438.438 0 00-.694-.266L14.07 9.781a.748.748 0 01-.654.121 5.156 5.156 0 00-2.833 0 .746.746 0 01-.653-.121L7.302 7.81a.435.435 0 00-.688.269l-.675 3.652a5.36 5.36 0 00-1.539 3.76v.333c0 1.474.527 2.9 1.488 4.02l.032.038H.507z" fill="#29E154" fill-rule="evenodd"></path><path d="M9.213 16.843h1.52v-3.546h-1.29l-.23 3.546zm5.573 0h-1.52v-3.546h1.29l.23 3.546z"></path></svg>',Oee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Meta</title><path d="M6.897 4h-.024l-.031 2.615h.022c1.715 0 3.046 1.357 5.94 6.246l.175.297.012.02 1.62-2.438-.012-.019a48.763 48.763 0 00-1.098-1.716 28.01 28.01 0 00-1.175-1.629C10.413 4.932 8.812 4 6.896 4z" fill="url(#lobe-icons-meta-0-_R_0_)"></path><path d="M6.873 4C4.95 4.01 3.247 5.258 2.02 7.17a4.352 4.352 0 00-.01.017l2.254 1.231.011-.017c.718-1.083 1.61-1.774 2.568-1.785h.021L6.896 4h-.023z" fill="url(#lobe-icons-meta-1-_R_0_)"></path><path d="M2.019 7.17l-.011.017C1.2 8.447.598 9.995.274 11.664l-.005.022 2.534.6.004-.022c.27-1.467.786-2.828 1.456-3.845l.011-.017L2.02 7.17z" fill="url(#lobe-icons-meta-2-_R_0_)"></path><path d="M2.807 12.264l-2.533-.6-.005.022c-.177.918-.267 1.851-.269 2.786v.023l2.598.233v-.023a12.591 12.591 0 01.21-2.44z" fill="url(#lobe-icons-meta-3-_R_0_)"></path><path d="M2.677 15.537a5.462 5.462 0 01-.079-.813v-.022L0 14.468v.024a8.89 8.89 0 00.146 1.652l2.535-.585a4.106 4.106 0 01-.004-.022z" fill="url(#lobe-icons-meta-4-_R_0_)"></path><path d="M3.27 16.89c-.284-.31-.484-.756-.589-1.328l-.004-.021-2.535.585.004.021c.192 1.01.568 1.85 1.106 2.487l.014.017 2.018-1.745a2.106 2.106 0 01-.015-.016z" fill="url(#lobe-icons-meta-5-_R_0_)"></path><path d="M10.78 9.654c-1.528 2.35-2.454 3.825-2.454 3.825-2.035 3.2-2.739 3.917-3.871 3.917a1.545 1.545 0 01-1.186-.508l-2.017 1.744.014.017C2.01 19.518 3.058 20 4.356 20c1.963 0 3.374-.928 5.884-5.33l1.766-3.13a41.283 41.283 0 00-1.227-1.886z" fill="#0082FB"></path><path d="M13.502 5.946l-.016.016c-.4.43-.786.908-1.16 1.416.378.483.768 1.024 1.175 1.63.48-.743.928-1.345 1.367-1.807l.016-.016-1.382-1.24z" fill="url(#lobe-icons-meta-6-_R_0_)"></path><path d="M20.918 5.713C19.853 4.633 18.583 4 17.225 4c-1.432 0-2.637.787-3.723 1.944l-.016.016 1.382 1.24.016-.017c.715-.747 1.408-1.12 2.176-1.12.826 0 1.6.39 2.27 1.075l.015.016 1.589-1.425-.016-.016z" fill="#0082FB"></path><path d="M23.998 14.125c-.06-3.467-1.27-6.566-3.064-8.396l-.016-.016-1.588 1.424.015.016c1.35 1.392 2.277 3.98 2.361 6.971v.023h2.292v-.022z" fill="url(#lobe-icons-meta-7-_R_0_)"></path><path d="M23.998 14.15v-.023h-2.292v.022c.004.14.006.282.006.424 0 .815-.121 1.474-.368 1.95l-.011.022 1.708 1.782.013-.02c.62-.96.946-2.293.946-3.91 0-.083 0-.165-.002-.247z" fill="url(#lobe-icons-meta-8-_R_0_)"></path><path d="M21.344 16.52l-.011.02c-.214.402-.519.67-.917.787l.778 2.462a3.493 3.493 0 00.438-.182 3.558 3.558 0 001.366-1.218l.044-.065.012-.02-1.71-1.784z" fill="url(#lobe-icons-meta-9-_R_0_)"></path><path d="M19.92 17.393c-.262 0-.492-.039-.718-.14l-.798 2.522c.449.153.927.222 1.46.222.492 0 .943-.073 1.352-.215l-.78-2.462c-.167.05-.341.075-.517.073z" fill="url(#lobe-icons-meta-10-_R_0_)"></path><path d="M18.323 16.534l-.014-.017-1.836 1.914.016.017c.637.682 1.246 1.105 1.937 1.337l.797-2.52c-.291-.125-.573-.353-.9-.731z" fill="url(#lobe-icons-meta-11-_R_0_)"></path><path d="M18.309 16.515c-.55-.642-1.232-1.712-2.303-3.44l-1.396-2.336-.011-.02-1.62 2.438.012.02.989 1.668c.959 1.61 1.74 2.774 2.493 3.585l.016.016 1.834-1.914a2.353 2.353 0 01-.014-.017z" fill="url(#lobe-icons-meta-12-_R_0_)"></path><defs><linearGradient id="lobe-icons-meta-0-_R_0_" x1="75.897%" x2="26.312%" y1="89.199%" y2="12.194%"><stop offset=".06%" stop-color="#0867DF"></stop><stop offset="45.39%" stop-color="#0668E1"></stop><stop offset="85.91%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-1-_R_0_" x1="21.67%" x2="97.068%" y1="75.874%" y2="23.985%"><stop offset="13.23%" stop-color="#0064DF"></stop><stop offset="99.88%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-2-_R_0_" x1="38.263%" x2="60.895%" y1="89.127%" y2="16.131%"><stop offset="1.47%" stop-color="#0072EC"></stop><stop offset="68.81%" stop-color="#0064DF"></stop></linearGradient><linearGradient id="lobe-icons-meta-3-_R_0_" x1="47.032%" x2="52.15%" y1="90.19%" y2="15.745%"><stop offset="7.31%" stop-color="#007CF6"></stop><stop offset="99.43%" stop-color="#0072EC"></stop></linearGradient><linearGradient id="lobe-icons-meta-4-_R_0_" x1="52.155%" x2="47.591%" y1="58.301%" y2="37.004%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#007CF6"></stop></linearGradient><linearGradient id="lobe-icons-meta-5-_R_0_" x1="37.689%" x2="61.961%" y1="12.502%" y2="63.624%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-6-_R_0_" x1="34.808%" x2="62.313%" y1="68.859%" y2="23.174%"><stop offset="27.99%" stop-color="#007FF8"></stop><stop offset="91.41%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-7-_R_0_" x1="43.762%" x2="57.602%" y1="6.235%" y2="98.514%"><stop offset="0%" stop-color="#0082FB"></stop><stop offset="99.95%" stop-color="#0081FA"></stop></linearGradient><linearGradient id="lobe-icons-meta-8-_R_0_" x1="60.055%" x2="39.88%" y1="4.661%" y2="69.077%"><stop offset="6.19%" stop-color="#0081FA"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-9-_R_0_" x1="30.282%" x2="61.081%" y1="59.32%" y2="33.244%"><stop offset="0%" stop-color="#027AF3"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-10-_R_0_" x1="20.433%" x2="82.112%" y1="50.001%" y2="50.001%"><stop offset="0%" stop-color="#0377EF"></stop><stop offset="99.94%" stop-color="#0279F1"></stop></linearGradient><linearGradient id="lobe-icons-meta-11-_R_0_" x1="40.303%" x2="72.394%" y1="35.298%" y2="57.811%"><stop offset=".19%" stop-color="#0471E9"></stop><stop offset="100%" stop-color="#0377EF"></stop></linearGradient><linearGradient id="lobe-icons-meta-12-_R_0_" x1="32.254%" x2="68.003%" y1="19.719%" y2="84.908%"><stop offset="27.65%" stop-color="#0867DF"></stop><stop offset="100%" stop-color="#0471E9"></stop></linearGradient></defs></svg>',Dee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M11.49 2H2v9.492h9.492V2h-.002z" fill="#F25022"></path><path d="M22 2h-9.492v9.492H22V2z" fill="#7FBA00"></path><path d="M11.49 12.508H2V22h9.492v-9.492h-.002z" fill="#00A4EF"></path><path d="M22 12.508h-9.492V22H22v-9.492z" fill="#FFB900"></path></svg>',Bee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>',Hee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>',qee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>MoonshotAI</title><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>',Pee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nova</title><g mask="url(#lobe-icons-nova-0-_R_0_)"><mask height="23.2727" id="lobe-icons-nova-0-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:luminance" width="23.2727" x="0" y=".3636"><path d="M23.127 0.364H0v23.272h23.127z" fill="#fff"></path></mask><mask height="23.2727" id="lobe-icons-nova-1-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:alpha" width="23.2727" x="0" y=".3636"><path d="M12.993 17.295l1.115 1.122c0.051 0.051 0.067 0.127 0.04 0.194l-1.744 4.449A0.902 0.902 0 0 1 11.564 23.636c-0.371 0-0.705-0.229-0.84-0.576l-2.51-6.403-4.06 4.085a0.179 0.179 0 0 1-0.254 0l-1.024-1.029a0.182 0.182 0 0 1 0-0.256l5.011-5.042a0.945 0.945 0 0 1 0.607-0.289 0.909 0.909 0 0 1 0.896 0.574l2.176 5.549 1.132-2.892a0.18 0.18 0 0 1 0.297-0.062z m5.981-14.037l-4.061 4.085-2.509-6.403a0.902 0.902 0 0 0-1.04-0.555c-0.301 0.067-0.541 0.296-0.653 0.586l-1.731 4.416a0.182 0.182 0 0 0 0.04 0.194l1.115 1.122c0.092 0.092 0.247 0.06 0.296-0.062L11.564 3.749l2.175 5.548a0.902 0.902 0 0 0 1.48 0.31l5.034-5.066a0.182 0.182 0 0 0 0-0.256L19.229 3.256a0.179 0.179 0 0 0-0.254 0zM6.239 13.139l-2.875-1.14 5.514-2.189c0.356-0.142 0.593-0.498 0.571-0.902a0.945 0.945 0 0 0-0.288-0.611l-5.008-5.04a0.179 0.179 0 0 0-0.254 0L2.876 4.287a0.182 0.182 0 0 0 0 0.257l4.06 4.085-6.364 2.525a0.909 0.909 0 0 0 0 1.691l4.421 1.754a0.175 0.175 0 0 0 0.194-0.04l1.115-1.121a0.182 0.182 0 0 0-0.062-0.298z m16.315-1.986l-4.422-1.754a0.175 0.175 0 0 0-0.192 0.04l-1.115 1.122a0.182 0.182 0 0 0 0.061 0.298L19.761 12l-5.514 2.189a0.913 0.913 0 0 0-0.571 0.902c0.013 0.231 0.125 0.447 0.287 0.611l5.011 5.041a0.179 0.179 0 0 0 0.254 0l1.023-1.03a0.182 0.182 0 0 0 0-0.256l-4.06-4.085 6.364-2.525a0.909 0.909 0 0 0 0-1.691z" fill="#fff"></path></mask><g mask="url(#lobe-icons-nova-1-_R_0_)"><path d="M-2.12 25.182h27.235V-1.17H-2.12z" fill="url(#lobe-icons-nova-2-_R_0_)"></path></g></g><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-nova-2-_R_0_" x1="24.4822" x2="-1.5171" y1="24.824" y2="-1.0189"><stop stop-color="#ff6200"></stop><stop offset=".399" stop-color="#e433ff"></stop><stop offset=".96" stop-color="#6842ff"></stop></linearGradient></defs></svg>',Uee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>',Fee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></svg>',Vee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>',Gee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>',Wee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path></svg>',Kee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Poolside</title><g clip-path="url(#lobe-icons-poolside-0-_R_0_)"><mask height="24" id="lobe-icons-poolside-4-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:alpha" width="24" x="0" y="0"><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-1-_R_0_)"></path><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-2-_R_0_)"></path><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-3-_R_0_)"></path></mask><g mask="url(#lobe-icons-poolside-4-_R_0_)"><path d="M6.742 22.786a11.93 11.93 0 01-5.232-4.963 11.98 11.98 0 01-1.463-6.886.975.975 0 011.943.173c-.178 2.005.246 4 1.226 5.769a9.968 9.968 0 003.526 3.685l4.586-9.405c-1.795-.598-3.29-.338-3.425-.312l-.058.012a.972.972 0 01-1.054-.576c-.24-.448-.96-1.544-1.834-1.97-.873-.426-2.218-.289-2.651-.195a.977.977 0 01-1.087-1.38C4.117.792 11.315-1.686 17.262 1.215c5.946 2.9 8.422 10.093 5.529 16.038l-.01.02c-2.903 5.94-10.095 8.414-16.039 5.514zm6.338-10.773l-4.586 9.405c4.629 1.73 9.896-.192 12.304-4.558-.338-.524-.932-1.275-1.62-1.61-.888-.434-2.19-.292-2.637-.198a.989.989 0 01-.616-.055.984.984 0 01-.49-.473c-.028-.058-.739-1.438-2.355-2.51zM5.81 6.56c.747.365 1.356.944 1.81 1.49 1.406-2.15 3.314-3.774 4.787-4.82a20.81 20.81 0 011.66-1.067A10.078 10.078 0 003.882 6.077c.617.042 1.297.174 1.929.482zm12.671-2.243c.09.624.152 1.294.182 1.965.083 1.801-.021 4.296-.844 6.722.686.018 1.484.14 2.214.495.652.318 1.198.8 1.628 1.28a10.082 10.082 0 00-3.18-10.462zm-5.394 5.46a9.522 9.522 0 012.984 2.287c1.075-3.493.606-7.402.215-8.85-1.381.584-4.75 2.62-6.84 5.618a9.515 9.515 0 013.64.944z" fill="#4137FF"></path></g></g><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-1-_R_0_" x1="6.75" x2="5.625" y1="20.55" y2="20.55"><stop></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-2-_R_0_" x1="6.825" x2="7.2" y1="11.85" y2="11.137"><stop stop-opacity="0"></stop><stop offset="1"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-3-_R_0_" x1=".975" x2=".975" y1="20.512" y2="10.912"><stop></stop><stop offset=".105" stop-opacity=".9"></stop><stop offset=".904" stop-opacity=".04"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><clipPath id="lobe-icons-poolside-0-_R_0_"><path d="M0 0h24v24H0z" fill="#fff"></path></clipPath></defs></svg>',Xee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M19.713 2.825h-5.907c0-.251-.066-.503-.196-.728L12.819.728A1.46 1.46 0 0 0 11.559 0h-1.58c-.52 0-1 .275-1.26.728l-2.42 4.19a1.45 1.45 0 0 0 0 1.453l.791 1.37c.26.448.74.727 1.26.727h11.36c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-.79-1.37a1.46 1.46 0 0 0-1.26-.728zM.195 9.905l2.951 5.115a1.46 1.46 0 0 0-.531.531l-.791 1.37a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h4.84c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451L5.086 7.083a1.46 1.46 0 0 0-1.26-.728h-1.58c-.52 0-1 .276-1.26.728l-.79 1.37a1.45 1.45 0 0 0 0 1.452m15.888 13.367 2.951-5.115c.217.125.469.196.728.196h1.582c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-2.42-4.191a1.46 1.46 0 0 0-1.259-.728h-1.582c-.52 0-1 .276-1.259.728l-5.678 9.838a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h1.582c.52 0 1-.275 1.26-.728z" fill="#082dff"></path></svg>',Zee='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Reka</title><path d="M3.662.014C4.347.004 5.052.012 5.74.012h3.9q1.01.006 2.02-.006c-.005.87-.01 1.779 0 2.647-.16-.027-.593-.018-.774-.018H4.943l-1.408.001c-.263.001-.595.01-.852-.004.014 1.216.002 2.455.002 3.673v4.681c0 .185-.008.48.016.656-.834-.039-1.849-.005-2.7-.01.032-.717.008-1.576.008-2.307V3.69c-.001-.44-.023-.812.065-1.246.11-.557.377-1.07.77-1.481A3 3 0 0 1 2.756.03c.245-.022.644-.01.905-.017M23.74 11.641c-.688-.03-1.54-.007-2.237-.007H15.92c-.853.001-1.373.024-2.139-.422a3.02 3.02 0 0 1-1.4-1.842c-.146-.553-.1-1.285-.1-1.863V5.299l-.002-1.535c0-.37-.011-.794.035-1.156.053-.388.183-.763.382-1.1A3.01 3.01 0 0 1 15.102.013c.387-.022.869-.01 1.261-.01l2.224.001h1.607c.88-.001 1.449-.037 2.237.426a3.02 3.02 0 0 1 1.293 1.544c.08.217.12.395.177.615v1.027c-.072.167-.123.472-.227.719a3.04 3.04 0 0 1-1.176 1.375c-.318.204-.74.34-1.098.467l-.951.34-3.181 1.132c-.552.196-1.205.41-1.74.626-.03-.646.008-1.316-.007-1.965-.005-.2-.006-.432.01-.632.463-.189.96-.368 1.43-.547l2.719-1.038c.357-.137.717-.268 1.074-.405.174-.067.352-.135.433-.315.186-.414-.112-.74-.538-.739q-.555 0-1.106.003l-2.161-.002H16.12c-.248 0-.506-.008-.752.018-.124.008-.327.157-.362.28-.07.246-.052.597-.052.852l.003 1.055V7.5c0 .497.01 1.024-.004 1.519.334-.026.816-.01 1.164-.01H18.2c1.825 0 3.726-.027 5.547.004-.023.228-.01.686-.01.93zm-11.272.779h7.626c.361 0 .814-.013 1.165.03a3.04 3.04 0 0 1 2.45 1.907c.084.215.13.419.192.64v6.485c-.052.193-.097.395-.166.58a3.05 3.05 0 0 1-1.352 1.597c-.154.088-.241.13-.404.19-.078.028-.388.124-.43.15h-6.903c-.062-.036-.497-.172-.648-.245A3.05 3.05 0 0 1 12.444 22c-.47-1.365.06-2.953 1.31-3.685.356-.209.745-.33 1.132-.467l1.37-.486c1.465-.52 2.956-1.073 4.424-1.571-.029.83.016 1.742-.005 2.588-.121.057-.337.13-.468.18l-.894.34-2.847 1.085c-.158.06-.327.118-.481.181-.188.098-.73.226-.864.37-.36.388-.097.89.415.887.42-.003.772 0 1.15-.002l1.988.001h1.367c.256 0 .52.008.774-.013.21-.018.393-.228.416-.432.026-.229.018-.458.017-.688l-.001-1.018v-2.639c0-.516-.008-1.054.006-1.568-1.352-.03-2.79-.007-4.148-.007-1.532 0-3.117-.02-4.645.007.015-.292.006-.642.006-.939zm-4.554.015c.33-.021.705-.002 1.04-.008.847-.016 1.738.023 2.582-.002-.195.22-.434.43-.646.637l-1.017 1.002L7.04 16.84c-.435.427-.912.866-1.333 1.304.124.154.418.431.571.585l1.084 1.082 2.176 2.168q1.034 1 2.047 2.022H7.849c-.248-.236-.495-.493-.74-.735l-1.632-1.6q-.595-.569-1.18-1.147c-.27-.268-.57-.541-.775-.86a2.656 2.656 0 0 1 .338-3.262c.21-.22.454-.447.672-.66l1.58-1.548q.611-.612 1.239-1.21c.137-.134.427-.44.564-.543m-7.909-.001c.755-.032 1.53.006 2.286-.008.13-.002.273-.003.403.002-.029.317-.01.988-.01 1.338v2.557L2.686 24H.007l.002-7.917V13.61c0-.34-.018-.847-.003-1.175"></path></svg>',Yee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>sakana.ai</title><path d="M15.568 3.02c2.621-.149 5.368.572 7.88 1.323.455.136.642.493.511.962-.425 1.516-.763 3.077-1.34 4.545a17.1 17.1 0 0 1-6.447 7.982c-1.461.975-3.224 1.864-4.747 2.784-.774.431-1.528.91-2.313 1.32-.301.158-.741.006-.912-.278a.75.75 0 0 1-.082-.572c.126-.468 1.603-1.182 2.066-1.448l3.579-2.058c-1.09-1.631-2.457-2.584-4.184-3.438-.644 2.639-2.597 4.942-4.872 6.37q-.066.045-.135.084a.863.863 0 0 1-1.136-.295c-.141-.225.04-.672.253-.794 2.31-1.324 3.771-3.218 4.552-5.757-1.557-.467-3.522-.362-5.072.091-.833.244-1.463.574-2.23.953a.71.71 0 0 1-.8-.278c-.626-.937 1.02-1.5 1.699-1.763a10.94 10.94 0 0 1 6.684-.427c.16-1.959-.05-3.54-.89-5.333-.818.47-5.133 3.08-5.6 3.14A.73.73 0 0 1 1.5 9.98a.7.7 0 0 1-.263-.484.78.78 0 0 1 .181-.558c.297-.33 2.11-1.277 2.616-1.566 4.122-2.362 6.6-4.11 11.533-4.351M8.89 6.223c.921 1.992 1.411 4.3.989 6.484 2.027.813 3.96 2.242 5.13 4.107l.477-.309c2.955-2.1 4.873-4.56 6.052-8.024.332-.974.533-1.999.832-2.969-2.234-.589-4.6-1.284-6.955-1.063-2.413.164-4.356.675-6.525 1.774" fill="#e10600"></path></svg>',Qee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>',Jee='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>together.ai</title><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path></svg>',ete='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Upsate</title><path d="M19.763 0l-.373 1.297h2.594L22.354 0h-2.591zM16.192 2.27l-.376 1.298h5.52l.37-1.298h-5.514zM12.897 4.54l-.376 1.298h8.166l.37-1.298h-8.16zM2.85 6.81l-.377 1.298h17.565l.37-1.297H2.848zM3.884 9.081l-.376 1.297H19.39l.37-1.297H3.882zM4.088 24l.376-1.297H1.866L1.5 24h2.588zM7.662 21.73l.376-1.297H2.515L2.15 21.73h5.513zM10.957 19.459l.376-1.297h-8.17l-.366 1.297h8.16zM21.005 17.189l.376-1.297H3.812l-.366 1.297h17.559zM19.967 14.919l.376-1.297H4.461l-.366 1.297h15.872zM18.786 12.649l.376-1.297H4.26l-.366 1.297h14.893z" fill="url(#lobe-icons-upsate-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-upsate-_R_0_" x1="11.927" x2="11.927" y2="24"><stop offset="0" stop-color="#AEBCFE"></stop><stop offset="1" stop-color="#805DFA"></stop></linearGradient></defs></svg>',tte='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Vercel</title><path d="M12 0l12 20.785H0L12 0z"></path></svg>',nte='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>VertexAI</title><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z" fill="#4285F4"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z" fill="#669DF6" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z" fill="#AECBFA" fill-rule="evenodd"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#AECBFA"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#669DF6"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z" fill="#AECBFA"></path></svg>',ste='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>',rte='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>XiaomiMiMo</title><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>',ite='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Z.ai</title><path d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path></svg>',ote=Object.assign({"./logos/anthropic.svg":cee,"./logos/arcee-color.svg":uee,"./logos/azure-color.svg":dee,"./logos/baseten.svg":fee,"./logos/bedrock-color.svg":hee,"./logos/bytedance-color.svg":pee,"./logos/cerebras-color.svg":xee,"./logos/claude-color.svg":gee,"./logos/cloudflare-color.svg":mee,"./logos/codex-color.svg":yee,"./logos/cohere-color.svg":vee,"./logos/deepseek-color.svg":kee,"./logos/fireworks-color.svg":bee,"./logos/gemini-color.svg":wee,"./logos/gemma-color.svg":jee,"./logos/githubcopilot.svg":See,"./logos/grok.svg":Cee,"./logos/groq.svg":Eee,"./logos/huggingface-color.svg":$ee,"./logos/hunyuan-color.svg":Aee,"./logos/ibm.svg":Mee,"./logos/inception.svg":Tee,"./logos/kimi-color.svg":zee,"./logos/kwaipilot-color.svg":Nee,"./logos/ling-color.svg":_ee,"./logos/liquid.svg":Ree,"./logos/lmstudio.svg":Iee,"./logos/longcat-color.svg":Lee,"./logos/meta-color.svg":Oee,"./logos/microsoft-color.svg":Dee,"./logos/minimax-color.svg":Bee,"./logos/mistral-color.svg":Hee,"./logos/moonshot.svg":qee,"./logos/nova-color.svg":Pee,"./logos/nvidia-color.svg":Uee,"./logos/ollama.svg":Fee,"./logos/openai.svg":Vee,"./logos/opencode.svg":Gee,"./logos/openrouter.svg":Wee,"./logos/poolside-color.svg":Kee,"./logos/qwen-color.svg":Xee,"./logos/reka.svg":Zee,"./logos/sakana-color.svg":Yee,"./logos/stepfun-color.svg":Qee,"./logos/together-color.svg":Jee,"./logos/upstage-color.svg":ete,"./logos/vercel.svg":tte,"./logos/vertexai-color.svg":nte,"./logos/xai.svg":ste,"./logos/xiaomimimo.svg":rte,"./logos/zai.svg":ite}),ate=[["anthropic","anthropic"],["openai-codex","codex-color"],["openai","openai"],["github-copilot","githubcopilot"],["xai","xai"],["kimi-coding","kimi-color"],["meta","meta-color"],["openrouter","openrouter"],["google-vertex","vertexai-color"],["google","gemini-color"],["amazon-bedrock","bedrock-color"],["azure","azure-color"],["deepseek","deepseek-color"],["mistral","mistral-color"],["groq","groq"],["cerebras","cerebras-color"],["together","together-color"],["fireworks","fireworks-color"],["baseten","baseten"],["huggingface","huggingface-color"],["nvidia","nvidia-color"],["vercel-ai-gateway","vercel"],["cloudflare","cloudflare-color"],["zai","zai"],["moonshotai","moonshot"],["minimax","minimax-color"],["qwen-token-plan","qwen-color"],["xiaomi","xiaomimimo"],["ant-ling","ling-color"],["opencode","opencode"],["ollama","ollama"],["lmstudio","lmstudio"]],WT=e=>{var t;return(t=ate.find(([n])=>e===n||e.startsWith(`${n}-`)))==null?void 0:t[1]},KT=e=>{var t;return(t=ote[`./logos/${e}.svg`])==null?void 0:t.replace(/<title>.*?<\/title>/,"")},z9=e=>{const t=WT(e);return t===void 0?void 0:KT(t)},lte="11434",cte=e=>{try{return new URL(e).port}catch{return}},ute=e=>e.split(/\s+/).filter(t=>t!=="").slice(0,2).map(t=>t[0].toUpperCase()).join("");function ra({providerId:e,name:t,baseUrl:n,size:s=32}){const r=n===void 0?z9(e):cte(n)===lte?z9("ollama"):void 0,i={"--provider-logo-size":`${s}px`};return r===void 0?a.jsx("span",{className:"provider-logo","data-initials":"",style:i,"aria-hidden":"true",children:ute(t)}):a.jsx("span",{className:"provider-logo",style:i,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:r}})}const dte=[[/^claude/,"claude-color"],[/^(gpt|chatgpt|codex)|^o\d$/,"openai"],[/^gemini/,"gemini-color"],[/gemma/,"gemma-color"],[/^grok/,"grok"],[/^(qwen|qwq|qvq)/,"qwen-color"],[/^deepseek/,"deepseek-color"],[/^(kimi|moonshot)/,"kimi-color"],[/^(glm|chatglm)/,"zai"],[/^minimax/,"minimax-color"],[/^(mistral|mixtral|codestral|devstral|magistral|ministral|pixtral|voxtral)/,"mistral-color"],[/^llama|^muse$/,"meta-color"],[/^(mimo|xiaomimimo)/,"xiaomimimo"],[/^(nvidia|nemotron)/,"nvidia-color"],[/^nova$/,"nova-color"],[/^(command|c4ai|aya|cohere)$/,"cohere-color"],[/^(seed|doubao|bytedance)/,"bytedance-color"],[/^hunyuan|^hy\d$/,"hunyuan-color"],[/^(step\d*|stepfun)$/,"stepfun-color"],[/^longcat/,"longcat-color"],[/^(ling|ring)$/,"ling-color"],[/^(phi\d*|mai)$/,"microsoft-color"],[/^granite/,"ibm"],[/^solar/,"upstage-color"],[/^mercury$/,"inception"],[/^lfm/,"liquid"],[/^laguna$/,"poolside-color"],[/^trinity$/,"arcee-color"],[/^kat$/,"kwaipilot-color"],[/^(sakana|fugu|namazu)$/,"sakana-color"],[/^reka$/,"reka"]],fte=e=>{var t;for(const n of e.modelId.toLowerCase().split(/[^a-z0-9]+/)){const s=(t=dte.find(([r])=>r.test(n)))==null?void 0:t[1];if(s!==void 0)return s}return WT(e.provider)};function N9({model:e,size:t=16,reserve:n=!1}){const s=fte(e),r=s===void 0?void 0:KT(s);if(r===void 0&&!n)return null;const i={"--model-logo-size":`${t}px`};return a.jsx("span",{className:"model-logo",style:i,"aria-hidden":"true",...r===void 0?{}:{dangerouslySetInnerHTML:{__html:r}}})}function O3({models:e,selected:t,isDisabled:n=!1,agent:s,sourceHint:r,problem:i,onModelChange:o,onLevelChange:l}){const[c,u]=p.useState(""),d=p.useRef(null),f=e.find(v=>W2(v,t.model)),h=(f==null?void 0:f.thinkingLevels)??["off"],x=iee(e,c),g=s===void 0?void 0:s.kind==="pick"?s.value:s.name,y=(s==null?void 0:s.kind)==="pick"&&s.value!==void 0&&!s.roles.some(v=>v.name===s.value)?s.value:void 0;return a.jsx(NS,{alignment:"start",label:"Model and Thinking",placement:"above",width:236,hasAutoFocus:!1,onOpenChange:v=>{v&&requestAnimationFrame(()=>{var m;return(m=d.current)==null?void 0:m.focus()})},content:a.jsxs("div",{className:"flex w-full flex-col gap-1 p-1","data-testid":"model-thinking-popover",onClick:v=>v.stopPropagation(),onMouseDown:v=>v.stopPropagation(),onPointerDown:v=>v.stopPropagation(),children:[s===void 0?null:a.jsxs("div",{"aria-label":"Agent",role:"group",children:[a.jsx("p",{className:"px-2 pt-1 text-xs text-muted",children:s.kind==="pick"?"Agent · sets the system prompt":"Agent · fixed at creation"}),s.kind==="pick"?a.jsxs(Bt,{className:"max-h-48 overflow-y-auto",density:"compact",children:[y===void 0?null:a.jsx(Ye,{description:"No longer available",endContent:a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isDisabled:!0,isSelected:!0,label:y}),a.jsx(Ye,{description:"Default system prompt",endContent:s.value===void 0?a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:s.value===void 0,label:"No agent",onClick:()=>s.onChange(void 0)}),s.roles.map(v=>a.jsx(Ye,{description:v.description,endContent:s.value===v.name?a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:s.value===v.name,label:v.name,onClick:()=>s.onChange(v.name)},v.name))]}):a.jsx(Bt,{density:"compact",children:a.jsx(Ye,{...s.description===void 0?{}:{description:s.description},endContent:a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isSelected:!0,label:s.name})})]}),a.jsx(lt,{isLabelHidden:!0,label:"Search models",placeholder:"Search models",ref:d,size:"sm",value:c,width:"100%",onChange:v=>u(v)}),a.jsx(Bt,{"aria-label":"Model",className:"max-h-72 overflow-y-auto",density:"compact",children:x.map(v=>a.jsx(Ye,{description:v.provider,startContent:a.jsx(N9,{model:v,reserve:!0}),endContent:W2(v,t.model)?a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:W2(v,t.model),label:v.name,onClick:()=>o({provider:v.provider,modelId:v.modelId})},`${v.provider}/${v.modelId}`))}),h.length>1?a.jsxs("div",{"aria-label":"Thinking",role:"group",children:[a.jsx("p",{className:"px-2 pt-1 text-xs text-muted",children:"Thinking"}),a.jsx(Bt,{density:"compact",children:h.map(v=>a.jsx(Ye,{endContent:v===t.level?a.jsx(ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,label:L1[v],onClick:()=>l(v)},v))})]}):null]}),children:a.jsx(Q,{className:"min-w-0 max-w-[19rem] flex-nowrap gap-1.5 px-2 text-muted","data-testid":"model-thinking-trigger",isDisabled:n||e.length===0,label:"Model and Thinking",size:"sm",variant:"ghost",...i===void 0?{}:{tooltip:i.title},children:a.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i===void 0&&t.model!==void 0?a.jsx(N9,{model:t.model,size:14}):null,i===void 0?a.jsxs("span",{className:"truncate",children:[g===void 0?"":`@${g} · `,ree(e,t)]}):a.jsx("span",{className:"truncate text-danger",children:i.label}),r===void 0||i!==void 0?null:a.jsx("span",{className:"shrink-0 truncate text-xs text-muted",children:r}),a.jsx(ze,{icon:"chevronDown",size:"sm",color:"inherit"})]})})})}const wr="",_9=e=>`${e.provider}/${e.modelId}`,R9=e=>{const t=e.indexOf("/");if(!(t<=0||t===e.length-1))return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function hte({view:e,remote:t,connected:n,role:s,onClose:r}){const i=s!==void 0,[o,l]=p.useState((s==null?void 0:s.name)??""),[c,u]=p.useState((s==null?void 0:s.description)??""),[d,f]=p.useState((s==null?void 0:s.model)??wr),[h,x]=p.useState((s==null?void 0:s.thinkingLevel)??wr),[g,y]=p.useState((s==null?void 0:s.prompt)??""),[v,m]=p.useState(!1),[k,b]=p.useState(void 0),j=d===wr?void 0:hr(e.models,R9(d)),A=[{value:wr,label:"Don't pin — use the caller's model"},...e.models.map($=>({value:_9($),label:`${$.name} (${_9($)})`})),...d!==wr&&j===void 0?[{value:d,label:`${d} (not available)`}]:[]],M=j===void 0?tk:j.thinkingLevels,E=[{value:wr,label:"Don't pin"},...M.map($=>({value:$,label:L1[$]})),...h!==wr&&!M.includes(h)?[{value:h,label:`${L1[h]} (not supported by this model)`}]:[]],z=$=>{f($);const _=$===wr?void 0:hr(e.models,R9($)),R=_===void 0?tk:_.thinkingLevels;h!==wr&&!R.includes(h)&&x(wr)},T=()=>{const $={name:o.trim(),description:c.trim(),...d===wr?{}:{model:d},...h===wr?{}:{thinkingLevel:h},prompt:g.trim()},_=see($);if(_!==void 0){b(_);return}m(!0),b(void 0),(i?t.controller.updateAgent($):t.controller.createAgent($)).then(()=>r(),R=>{m(!1),b(R instanceof Error?R.message:String(R))})};return a.jsx(mr,{isOpen:!0,onOpenChange:$=>$?void 0:r(),purpose:"form",width:480,"aria-label":i?`Edit ${s.name}`:"New agent",children:a.jsx(Hs,{header:a.jsx(Hr,{title:i?`Edit ${s.name}`:"New agent",onOpenChange:()=>r()}),content:a.jsx(qs,{children:a.jsxs(le,{gap:4,children:[a.jsx(le,{gap:1,children:a.jsx(lt,{label:"Name",value:o,onChange:l,isDisabled:v||i,hasAutoFocus:!i,description:i?"The name is the file name and can't be changed.":void 0})}),a.jsx(lt,{label:"Description",value:c,onChange:u,isDisabled:v}),a.jsx(oc,{label:"Model",value:d,options:A,onChange:z,isDisabled:v}),a.jsx(oc,{label:"Thinking level",value:h,options:E,onChange:$=>x($),isDisabled:v}),a.jsx(MC,{label:"Prompt",value:g,onChange:y,isDisabled:v,rows:4}),k===void 0?null:a.jsx(Y,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:k})]})}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:r}),a.jsx(Q,{label:"Save",variant:"primary",isDisabled:!n||v,onClick:T})]})})})})}var wl=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(wl||{});const pte=[0,1],XT=[1,0],ZT=[2,3],YT=[3,2],xte={L:pte,M:XT,Q:ZT,H:YT},gte=/^\d*$/,mte=/^[A-Z0-9 $%*+./:-]*$/,K2="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",D3=1,B3=40,I9=3,yte=3,C0=40,vte=10,QT=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],JT=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class kte{constructor(t,n,s,r){ge(this,"size");ge(this,"mask");ge(this,"modules",[]);ge(this,"types",[]);if(this.version=t,this.ecc=n,t<D3||t>B3)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const i=Array.from({length:this.size}).fill(!1);for(let l=0;l<this.size;l++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();const o=this.addEccAndInterleave(s);if(this.drawCodewords(o),r===-1){let l=1e9;for(let c=0;c<8;c++){this.applyMask(c),this.drawFormatBits(c);const u=this.getPenaltyScore();u<l&&(r=c,l=u),this.applyMask(c)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}getModule(t,n){return t>=0&&t<this.size&&n>=0&&n<this.size&&this.modules[n][t]}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2===0,wl.Timing),this.setFunctionModule(s,6,s%2===0,wl.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),n=t.length;for(let s=0;s<n;s++)for(let r=0;r<n;r++)s===0&&r===0||s===0&&r===n-1||s===n-1&&r===0||this.drawAlignmentPattern(t[s],t[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.ecc[1]<<3|t;let s=n;for(let i=0;i<10;i++)s=s<<1^(s>>>9)*1335;const r=(n<<10|s)^21522;for(let i=0;i<=5;i++)this.setFunctionModule(8,i,Zi(r,i));this.setFunctionModule(8,7,Zi(r,6)),this.setFunctionModule(8,8,Zi(r,7)),this.setFunctionModule(7,8,Zi(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,Zi(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,Zi(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,Zi(r,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let s=0;s<12;s++)t=t<<1^(t>>>11)*7973;const n=this.version<<12|t;for(let s=0;s<18;s++){const r=Zi(n,s),i=this.size-11+s%3,o=Math.floor(s/3);this.setFunctionModule(i,o,r),this.setFunctionModule(o,i,r)}}drawFinderPattern(t,n){for(let s=-4;s<=4;s++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(s)),o=t+r,l=n+s;o>=0&&o<this.size&&l>=0&&l<this.size&&this.setFunctionModule(o,l,i!==2&&i!==4,wl.Position)}}drawAlignmentPattern(t,n){for(let s=-2;s<=2;s++)for(let r=-2;r<=2;r++)this.setFunctionModule(t+r,n+s,Math.max(Math.abs(r),Math.abs(s))!==1,wl.Alignment)}setFunctionModule(t,n,s,r=wl.Function){this.modules[n][t]=s,this.types[n][t]=r}addEccAndInterleave(t){const n=this.version,s=this.ecc;if(t.length!==lp(n,s))throw new RangeError("Invalid argument");const r=JT[s[0]][n],i=QT[s[0]][n],o=Math.floor(ik(n)/8),l=r-o%r,c=Math.floor(o/r),u=[],d=Mte(i);for(let h=0,x=0;h<r;h++){const g=t.slice(x,x+c-i+(h<l?0:1));x+=g.length;const y=Tte(g,d);h<l&&g.push(0),u.push(g.concat(y))}const f=[];for(let h=0;h<u[0].length;h++)u.forEach((x,g)=>{(h!==c-i||g>=l)&&f.push(x[h])});return f}drawCodewords(t){if(t.length!==Math.floor(ik(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let s=this.size-1;s>=1;s-=2){s===6&&(s=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const o=s-i,c=(s+1&2)===0?this.size-1-r:r;!this.types[c][o]&&n<t.length*8&&(this.modules[c][o]=Zi(t[n>>>3],7-(n&7)),n++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let s=0;s<this.size;s++){let r;switch(t){case 0:r=(s+n)%2===0;break;case 1:r=n%2===0;break;case 2:r=s%3===0;break;case 3:r=(s+n)%3===0;break;case 4:r=(Math.floor(s/3)+Math.floor(n/2))%2===0;break;case 5:r=s*n%2+s*n%3===0;break;case 6:r=(s*n%2+s*n%3)%2===0;break;case 7:r=((s+n)%2+s*n%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[n][s]&&r&&(this.modules[n][s]=!this.modules[n][s])}}getPenaltyScore(){let t=0;for(let i=0;i<this.size;i++){let o=!1,l=0;const c=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[i][u]===o?(l++,l===5?t+=I9:l>5&&t++):(this.finderPenaltyAddHistory(l,c),o||(t+=this.finderPenaltyCountPatterns(c)*C0),o=this.modules[i][u],l=1);t+=this.finderPenaltyTerminateAndCount(o,l,c)*C0}for(let i=0;i<this.size;i++){let o=!1,l=0;const c=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[u][i]===o?(l++,l===5?t+=I9:l>5&&t++):(this.finderPenaltyAddHistory(l,c),o||(t+=this.finderPenaltyCountPatterns(c)*C0),o=this.modules[u][i],l=1);t+=this.finderPenaltyTerminateAndCount(o,l,c)*C0}for(let i=0;i<this.size-1;i++)for(let o=0;o<this.size-1;o++){const l=this.modules[i][o];l===this.modules[i][o+1]&&l===this.modules[i+1][o]&&l===this.modules[i+1][o+1]&&(t+=yte)}let n=0;for(const i of this.modules)n=i.reduce((o,l)=>o+(l?1:0),n);const s=this.size*this.size,r=Math.ceil(Math.abs(n*20-s*10)/s)-1;return t+=r*vte,t}getAlignmentPatternPositions(){if(this.version===1)return[];{const t=Math.floor(this.version/7)+2,n=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,s=[6];for(let r=this.size-7;s.length<t;r-=n)s.splice(1,0,r);return s}}finderPenaltyCountPatterns(t){const n=t[1],s=n>0&&t[2]===n&&t[3]===n*3&&t[4]===n&&t[5]===n;return(s&&t[0]>=n*4&&t[6]>=n?1:0)+(s&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,s){return t&&(this.finderPenaltyAddHistory(n,s),n=0),n+=this.size,this.finderPenaltyAddHistory(n,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(t,n){n[0]===0&&(t+=this.size),n.pop(),n.unshift(t)}}function co(e,t,n){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function Zi(e,t){return(e>>>t&1)!==0}class H3{constructor(t,n,s){if(this.mode=t,this.numChars=n,this.bitData=s,n<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}getData(){return this.bitData.slice()}}const bte=[1,10,12,14],wte=[2,9,11,13],jte=[4,8,16,16];function ez(e,t){return e[Math.floor((t+7)/17)+1]}function tz(e){const t=[];for(const n of e)co(n,8,t);return new H3(jte,e.length,t)}function Ste(e){if(!nz(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let n=0;n<e.length;){const s=Math.min(e.length-n,3);co(Number.parseInt(e.substring(n,n+s),10),s*3+1,t),n+=s}return new H3(bte,e.length,t)}function Cte(e){if(!sz(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let n;for(n=0;n+2<=e.length;n+=2){let s=K2.indexOf(e.charAt(n))*45;s+=K2.indexOf(e.charAt(n+1)),co(s,11,t)}return n<e.length&&co(K2.indexOf(e.charAt(n)),6,t),new H3(wte,e.length,t)}function Ete(e){return e===""?[]:nz(e)?[Ste(e)]:sz(e)?[Cte(e)]:[tz(Ate(e))]}function nz(e){return gte.test(e)}function sz(e){return mte.test(e)}function $te(e,t){let n=0;for(const s of e){const r=ez(s.mode,t);if(s.numChars>=1<<r)return Number.POSITIVE_INFINITY;n+=4+r+s.bitData.length}return n}function Ate(e){e=encodeURI(e);const t=[];for(let n=0;n<e.length;n++)e.charAt(n)!=="%"?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}function ik(e){if(e<D3||e>B3)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function lp(e,t){return Math.floor(ik(e)/8)-QT[t[0]][e]*JT[t[0]][e]}function Mte(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let s=0;s<e-1;s++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let r=0;r<t.length;r++)t[r]=ok(t[r],n),r+1<t.length&&(t[r]^=t[r+1]);n=ok(n,2)}return t}function Tte(e,t){const n=t.map(s=>0);for(const s of e){const r=s^n.shift();n.push(0),t.forEach((i,o)=>n[o]^=ok(i,r))}return n}function ok(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285,n^=(t>>>s&1)*e;return n}function zte(e,t,n=1,s=40,r=-1,i=!0){if(!(D3<=n&&n<=s&&s<=B3)||r<-1||r>7)throw new RangeError("Invalid value");let o,l;for(o=n;;o++){const f=lp(o,t)*8,h=$te(e,o);if(h<=f){l=h;break}if(o>=s)throw new RangeError("Data too long")}for(const f of[XT,ZT,YT])i&&l<=lp(o,f)*8&&(t=f);const c=[];for(const f of e){co(f.mode[0],4,c),co(f.numChars,ez(f.mode,o),c);for(const h of f.getData())c.push(h)}const u=lp(o,t)*8;co(0,Math.min(4,u-c.length),c),co(0,(8-c.length%8)%8,c);for(let f=236;c.length<u;f^=253)co(f,8,c);const d=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((f,h)=>d[h>>>3]|=f<<7-(h&7)),new kte(o,t,d,r)}function Nte(e,t){var f;const{ecc:n="L",boostEcc:s=!1,minVersion:r=1,maxVersion:i=40,maskPattern:o=-1,border:l=1}=t||{},c=typeof e=="string"?Ete(e):Array.isArray(e)?[tz(e)]:void 0;if(!c)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const u=zte(c,xte[n],r,i,o,s),d=_te({version:u.version,maskPattern:u.mask,size:u.size,data:u.modules,types:u.types},l);return t!=null&&t.invert&&(d.data=d.data.map(h=>h.map(x=>!x))),(f=t==null?void 0:t.onEncoded)==null||f.call(t,d),d}function _te(e,t=1){if(!t)return e;const{size:n}=e,s=n+t*2;e.size=s,e.data.forEach(i=>{for(let o=0;o<t;o++)i.unshift(!1),i.push(!1)});for(let i=0;i<t;i++)e.data.unshift(Array.from({length:s},o=>!1)),e.data.push(Array.from({length:s},o=>!1));const r=wl.Border;e.types.forEach(i=>{for(let o=0;o<t;o++)i.unshift(r),i.push(r)});for(let i=0;i<t;i++)e.types.unshift(Array.from({length:s},o=>r)),e.types.push(Array.from({length:s},o=>r));return e}function Rte({view:e,remote:t,self:n}){const s=e.connection==="connected",r=n===void 0?void 0:Yg(n.publicKey),[i,o]=p.useState(),[l,c]=p.useState(),u=()=>{c(void 0),t.controller.createPairing().then(o,d=>{c(d instanceof Error?d.message:String(d))})};return a.jsxs(le,{gap:4,children:[e.devices.length===0?a.jsx(Y,{type:"supporting",children:"No paired devices."}):a.jsx(Bt,{density:"compact",children:e.devices.map(d=>a.jsx(Dte,{device:d,isSelf:d.publicKey===r,connected:s,remote:t},d.publicKey))}),a.jsx(Ite,{view:e,remote:t}),l===void 0?null:a.jsx(Pe,{status:"error",title:"Could not create a pairing offer",description:l}),i===void 0?a.jsx(Q,{label:"Pair a device",variant:"secondary",isDisabled:!s,onClick:u}):a.jsx(Bte,{url:i.url,expiresAt:i.expiresAt,onRenew:u})]})}function Ite({view:e,remote:t}){var s;const n=(s=e.host)==null?void 0:s.protocol.minor;return e.settings===null||n===void 0||!Zt(n,"acceptAccountDevices")?null:a.jsx(EC,{label:"Accept devices from your account",description:"Devices signed in to the server this host joined can pair without a QR code. Turn off to allow QR codes only.",value:e.settings.acceptAccountDevices,isDisabled:e.connection!=="connected",onChange:r=>void t.controller.updateSettings({acceptAccountDevices:r})})}const Lte={account:"via account",qr:"via QR code",local:"on this machine"},Ote=new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"});function Dte({device:e,isSelf:t,connected:n,remote:s}){const r=e.source===void 0?"":` ${Lte[e.source]}`;return a.jsx(Ye,{label:e.name,description:`Paired ${Ote.format(e.pairedAt)}${r}`,endContent:a.jsxs(ye,{gap:2,vAlign:"center",children:[t?a.jsx(On,{label:"This device",size:"sm"}):null,a.jsx(Q,{label:"Revoke",variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>void s.controller.revokeDevice(e.publicKey)})]})})}function Bte({url:e,expiresAt:t,onRenew:n}){const[s,r]=p.useState(Date.now());p.useEffect(()=>{const l=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(l)},[]);const i=Math.max(0,Math.ceil((t-s)/1e3));if(i===0)return a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Y,{type:"supporting",children:"Expired"}),a.jsx(Q,{label:"New code",variant:"secondary",size:"sm",onClick:n})]});const o=A1(e);return a.jsxs(le,{gap:3,hAlign:"center",children:[o?null:a.jsx(Hte,{text:e}),a.jsx(Y,{type:"supporting",style:{wordBreak:"break-all",userSelect:"all"},children:e}),o?a.jsx(Y,{type:"supporting",children:"This link only works on this machine — paste it into the desktop app. To pair a phone, start the host with --remote-port or --relay."}):null,a.jsxs(Y,{type:"supporting",children:["Expires in ",Math.floor(i/60),":",String(i%60).padStart(2,"0")]})]})}const X2=2;function Hte({text:e}){const t=p.useMemo(()=>{try{return Nte(e,{border:0})}catch(s){if(s instanceof Error&&s.message==="Data too long")return;throw s}},[e]);if(t===void 0)return a.jsx(Y,{type:"supporting",children:"This link is too long for a QR code. Copy it below and paste it into the app instead."});const n=t.size+X2*2;return a.jsxs("svg",{role:"img","aria-label":"Pairing QR code",viewBox:`0 0 ${n} ${n}`,width:200,height:200,style:{display:"block"},children:[a.jsx("rect",{width:n,height:n,fill:"#ffffff"}),a.jsx("path",{shapeRendering:"crispEdges",fill:"#000000",d:t.data.flatMap((s,r)=>s.map((i,o)=>i?`M${o+X2} ${r+X2}h1v1h-1z`:"")).filter(s=>s!=="").join("")})]})}const Ru=e=>e!==null&&typeof e=="object",rz=new Set(["__proto__","constructor","prototype"]);class vd extends Error{constructor(n){super(`unsafe path segment: ${String(n)}`);ge(this,"segment");this.segment=n,this.name="UnsafePathError"}}function iz(e){if(!Array.isArray(e)||e.length===0)throw new TypeError("op is not a tuple");switch(e[0]){case"r":if(e.length!==2)throw new TypeError("r arity");return;case"s":if(e.length!==3)throw new TypeError("s arity");Uc(e[1],!0);return;case"d":if(e.length!==2)throw new TypeError("d arity");Uc(e[1],!0);return;case"a":if(e.length!==3||typeof e[2]!="string")throw new TypeError("a shape");Uc(e[1],!0);return;case"t":if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw new TypeError("t shape");Uc(e[1],!0);return;case"p":{if(e.length!==5)throw new TypeError("p arity");if(Uc(e[1]),!Number.isInteger(e[2])||e[2]<0)throw new TypeError("p index");if(!Number.isInteger(e[3])||e[3]<0)throw new TypeError("p remove");if(!Array.isArray(e[4]))throw new TypeError("p items");return}case"m":if(e.length!==3)throw new TypeError("m arity");Uc(e[1]),qte(e[2]);return;default:throw new TypeError(`unknown op verb: ${String(e[0])}`)}}function Uc(e,t=!1){if(!Array.isArray(e))throw new TypeError("path is not an array");if(t&&e.length===0)throw new TypeError("path is empty");oz(e)}function qte(e){if(!Array.isArray(e))throw new TypeError("m permutation is not an array");const t=new Uint8Array(e.length);for(const n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw new TypeError("m permutation is not a bijection");t[n]=1}}function oz(e){for(const t of e)if(typeof t=="string"){if(rz.has(t))throw new vd(t)}else if(!Number.isInteger(t)||t<0)throw new vd(t)}function Pte(e,t){if(t>e.length)throw new vd(t)}class Ir extends Error{constructor(n){super(`unresolvable path: ${JSON.stringify(n)}`);ge(this,"path");this.path=n,this.name="PathError"}}function Ute(e,t){let n=e;for(const s of t){if(iz(s),s[0]==="r"){n=s[1];continue}const r=s[1];if(oz(r),s[0]==="p"){const u=r.length===0?n:cp(n,r);if(!Array.isArray(u))throw new Ir(r);u.splice(s[2],s[3]);const d=1e4;for(let f=0;f<s[4].length;f+=d)u.splice(s[2]+f,0,...s[4].slice(f,f+d));continue}if(s[0]==="m"){const u=r.length===0?n:cp(n,r);if(!Array.isArray(u)||u.length!==s[2].length)throw new Ir(r);const d=u.slice();for(let f=0;f<s[2].length;f++)u[f]=d[s[2][f]];continue}const i=cp(n,r.slice(0,-1)),o=r[r.length-1];if(Array.isArray(i)){if(typeof o!="number")throw new vd(o);Pte(i,o)}const l=u=>{Object.defineProperty(i,o,{value:u,writable:!0,enumerable:!0,configurable:!0})},c=()=>Object.hasOwn(i,o)?i[o]:void 0;switch(s[0]){case"s":l(s[2]);break;case"d":if(Array.isArray(i)){if(typeof o!="number"||o>=i.length)throw new Ir(r);i.splice(o,1)}else delete i[o];break;case"a":{const u=c();if(typeof u!="string")throw new Ir(r);l(`${u}${s[2]}`);break}case"t":{const u=c();if(typeof u!="string")throw new Ir(r);l(u.slice(s[2]));break}}}return n}function Fte(e,t){return Vte(e,[t])}function Vte(e,t){let n=e;const s=new WeakSet;for(const r of t)for(const i of r){if(iz(i),i[0]==="r"){n=i[1];continue}if(i[0]==="p"){const o=Gte(n,i,s);if(o!==void 0){n=o;continue}}n=az(n,i[0]==="p"||i[0]==="m"?i[1]:i[1].slice(0,-1),s),n=Ute(n,[i])}return n}function Gte(e,t,n){const[,s,r,i,o]=t;if(i!==0)return;let l=e;for(const f of s){if(!(typeof f=="string"?!rz.has(f)&&Ru(l)&&!Array.isArray(l):Number.isInteger(f)&&f>=0&&Array.isArray(l))||!Object.hasOwn(l,f))return;l=l[f]}if(!Array.isArray(l)||n.has(l)||r!==l.length)return;const c=l.concat(o);if(n.add(c),s.length===0)return c;const u=s.slice(0,-1),d=az(e,u,n);return Object.defineProperty(cp(d,u),s[s.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),d}function az(e,t,n){const s=o=>{if(Array.isArray(o))return o.slice();if(!Ru(o))throw new Ir(t);const l=Object.create(Object.getPrototypeOf(o)===null?null:Object.prototype);for(const c of Object.keys(o))Object.defineProperty(l,c,{value:o[c],writable:!0,enumerable:!0,configurable:!0});return l};if(!Ru(e))throw new Ir(t);let r;n.has(e)?r=e:(r=s(e),n.add(r));let i=r;for(const o of t){if(!Object.hasOwn(i,o))throw new Ir(t);if(Array.isArray(i)&&typeof o!="number")throw new vd(o);const l=i[o];if(!Ru(l))throw new Ir(t);if(n.has(l)){i=l;continue}const c=s(l);Object.defineProperty(i,o,{value:c,writable:!0,enumerable:!0,configurable:!0}),n.add(c),i=c}return r}function Wte(e,t){let n=e;for(const s of t){if(!Ru(n))throw new Ir(t);if(Array.isArray(n)&&typeof s!="number")throw new vd(s);if(!Object.hasOwn(n,s))throw new Ir(t);n=n[s]}return n}function cp(e,t){const n=Wte(e,t);if(!Ru(n))throw new Ir(t);return n}const L9=10*1024*1024,Ti=10,Kte=512*1024,Xte=/^[A-Za-z0-9_-]{22}$/;function Zte(e){return Xte.test(e)}const O9='<attachments v="1">',Yte="The user attached these files. They are read-only originals on this machine: read them with your tools when relevant, and copy one into the working directory before changing it.",D9="</attachments>";function Qte(e,t){if(e.trim()==="")return"Attachment name cannot be empty";if(!Number.isSafeInteger(t)||t<0)return"Attachment size must be a non-negative integer";if(t>L9)return`Attachment is larger than ${L9/(1024*1024)} MB`}const Jte='<file id="',ene='" name="',tne='" path="',nne='" size="',B9='"/>',sne=/^(?:0|[1-9][0-9]*)$/;function rne(e){return e.replace(/&(amp|lt|gt|quot|apos|#x[0-9A-Fa-f]+|#[0-9]+);/g,(t,n)=>{if(n==="amp")return"&";if(n==="lt")return"<";if(n==="gt")return">";if(n==="quot")return'"';if(n==="apos")return"'";const s=n.startsWith("#x")?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return s>=0&&s<=1114111?String.fromCodePoint(s):t})}function E0(e,t,n){if(!e.startsWith(n,t))return;const s=t+n.length,r=e.indexOf('"',s);if(r!==-1)return{value:e.slice(s,r),next:r}}function ine(e){const t=E0(e,0,Jte);if(t===void 0)return;const n=E0(e,t.next,ene);if(n===void 0)return;const s=E0(e,n.next,tne);if(s===void 0)return;const r=E0(e,s.next,nne);if(r===void 0||!e.startsWith(B9,r.next)||r.next+B9.length!==e.length||!Zte(t.value)||!sne.test(r.value))return;const i=Number(r.value);if(Number.isSafeInteger(i))return{id:t.value,name:rne(n.value),size:i}}function one(e){if(!e.startsWith(O9+`
383
- `)||!e.endsWith(`
384
- `+D9))return;const t=e.slice(O9.length+1,-(D9.length+1)).split(`
385
- `);if(t[0]!==Yte||t.length<2)return;const n=[];for(const s of t.slice(1)){const r=ine(s);if(r===void 0)return;n.push(r)}return n}function lz(e,t){return{label:e,open(n){const s=new URL(e);s.searchParams.set("token",t);const r=new WebSocket(s);return r.onopen=()=>{var i,o;(i=n.opened)==null||i.call(n),(o=n.authenticated)==null||o.call(n)},r.onmessage=i=>n.message(String(i.data)),r.onclose=i=>n.closed(i.code),{send:i=>r.send(i),close:()=>r.close()}}}}function O1(e){var n;const t=(n=e.docs)==null?void 0:n["pi.live"];return(t==null?void 0:t.run)!==void 0}const ane={socketOpenMs:5e3,noiseMs:5e3,helloMs:5e3,syncMs:1e4};class lne extends Error{constructor(n){super(`Could not connect to the host: ${n.map(vne).join("; ")}`);ge(this,"failures");this.name="ConnectionFailedError",this.failures=n}}class cz extends Error{constructor(n){super(`${gM} (${n})`);ge(this,"reason");this.name="DirectUnavailableError",this.reason=n}}const Z2="Remote access is unavailable: the host published no remote path and this device has no local entry.",$0=5e3,H9=15e3,cne=3e3,une=1e3,dne=300,q9=3e4,P9=25e3,fne=1e3,hne=3e4,pne=10*6e4,xne=10*6e4,U9=6e4,gne=6e4,mne=3e4,As=e=>e instanceof Error?e:new Error(String(e)),yne=e=>Array.from(crypto.getRandomValues(new Uint8Array(e)),t=>t.toString(16).padStart(2,"0")).join(""),vne=e=>{const n=`${e.candidate.role==="loopback"?"local":e.candidate.role} ${e.candidate.url}`;if(e.stage==="unsupported")return`${n} skipped (${e.reason??"unsupported"})`;const s=e.code===void 0?"":` (close ${e.code})`;return`${n} failed at ${e.stage}${s}${e.reason===void 0?"":`: ${e.reason}`}`};function kne(e){return new bne(e).ready}class up extends Error{constructor(){super("Unauthorized: this client is not allowed (wrong token, or the device is not paired or was revoked)"),this.name="UnauthorizedError"}}class Pn extends Error{constructor(){super("Disconnected from host"),this.name="DisconnectedError"}}class uz extends Error{constructor(n,s,r){const i=n>s?"client-older":"host-older";super(i==="client-older"?`Client out of date: the host speaks protocol major ${n}, this client speaks ${s}`:`Host out of date: this client speaks protocol major ${s}, the host speaks ${n}`);ge(this,"hostMajor");ge(this,"clientMajor");ge(this,"hostVersion");ge(this,"direction");this.name="ProtocolMismatchError",this.hostMajor=n,this.clientMajor=s,r!==void 0&&(this.hostVersion=r),this.direction=i}}function F9(e){return e.some(t=>{const n="data"in t?t.data:"",s="ref"in t?t.ref:"";return n===""&&s!==""})}var Cr,Bu,rn,mn,Er,Hu,Qx,ki,is,Xr,Dl,er,$r,Ze,bi,wi,Be,on,jt,os,Qi,Bl,Hl,aa,Ji,G1,ji,ql,qu,Si,la,Pl,eo,ca,Zr,Ul,Fl,Vl,Gl,ws,W1,K1,Wl,Ee,Pu,Uu,X1,Fu,ua,da,Vu,Gu,Wu,Ku,Kl,Ci,Z1,Xu,Vt,an,as,Ei,Jx,Xl,to,no,so,Ie,Zu,Y1,Q1,Yu,Qu,eg,Oe,Ju,fa,J1,ha,w,bs,ul,dp,Ko,fp,ak,dz,lk,ck,fz,uk,hp,dl,Xo,fl,hl,dk,fk,$f,pp,hk,pk,ss,hz,pz,xp,xz,Yc,Af,gz,xk,mz,yz,vz,gk,Mf,mk,yk,vk,Tf,kk,kz,gp,pl,xl,bz,gl,bk,mp,wk,wz,jk,yp,jz,vp,ml,Sz,Cz,Ez,kp,hi,$z,Sk,Ck,bp,Qc,Az,Mz,Tz,zf,Jc,yl,Zo,wp,Yo,zz,Nf,Nz,_f,_z,pi,Ek,jp,$k,Ys,Ak,Mk,Rz,Iz,Lz,gn,Oz,Sp,xi,Cp,Qs,Dz,Ep,$p,eu,Bz,Ap,Tk,zk,Hz,qz,Pz,Mp,Uz,Fz,Rf,Vz,Nk,Gz,Wz,_k,Js,Un,Rk,gi,vl,Le,Ik,Lk,Tn,sn,Kz,Xz,Tp,zp,Zz,If,Yz;class bne{constructor(t){ae(this,w);ge(this,"ready");ae(this,Cr);ae(this,Bu,new Set);ae(this,rn,new Map);ae(this,mn,new Set);ae(this,Er,new Set);ae(this,Hu,[]);ae(this,Qx,{});ae(this,ki,new Map);ae(this,is,new Map);ae(this,Xr);ae(this,Dl);ae(this,er);ae(this,$r);ae(this,Ze);ae(this,bi);ae(this,wi);ae(this,Be);ae(this,on);ae(this,jt);ae(this,os);ae(this,Qi);ae(this,Bl,0);ae(this,Hl,0);ae(this,aa,0);ae(this,Ji,0);ae(this,G1,Number.NEGATIVE_INFINITY);ae(this,ji);ae(this,ql,"loopback");ae(this,qu);ae(this,Si);ae(this,la);ae(this,Pl,0);ae(this,eo,0);ae(this,ca,!1);ae(this,Zr,new Map);ae(this,Ul,[]);ae(this,Fl);ae(this,Vl);ae(this,Gl);ae(this,ws);ae(this,W1);ae(this,K1);ae(this,Wl);ae(this,Ee);ae(this,Pu,0);ae(this,Uu,0);ae(this,X1,0);ae(this,Fu,[]);ae(this,ua);ae(this,da);ae(this,Vu,0);ae(this,Gu);ae(this,Wu);ae(this,Ku);ae(this,Kl,!1);ae(this,Ci,!1);ae(this,Z1,!1);ae(this,Xu,!1);ae(this,Vt);ae(this,an);ae(this,as);ae(this,Ei,1);ae(this,Jx,1);ae(this,Xl,new Map);ae(this,to,[]);ae(this,no,new Set);ae(this,so,new Map);ae(this,Ie,0);ae(this,Zu,!1);ae(this,Y1,[]);ae(this,Q1,{});ae(this,Yu);ae(this,Qu,0);ae(this,eg,yne(8));ae(this,Oe,!1);ae(this,Ju,!1);ae(this,fa,Promise.resolve());ae(this,J1);ae(this,ha);var r,i,o,l;G(this,Cr,t),G(this,er,t.connectionMode??"auto"),G(this,$r,t.rtc),G(this,Ze,t.clock??$T),G(this,wi,((r=t.rtc)==null?void 0:r.signalOnlyHint)===!0),G(this,K1,"candidates"in t),"candidates"in t?(G(this,Xr,[...t.candidates]),G(this,Fl,t.openTransport),G(this,Wl,t.pairing),G(this,Vl,t.legacyUrl??((i=t.candidates[0])==null?void 0:i.url)??""),G(this,Gl,t.pageProtocol)):"transport"in t?(G(this,Xr,[{url:t.transport.label,role:"legacy"}]),G(this,Fl,()=>t.transport),G(this,Vl,t.transport.label),G(this,Gl,void 0)):(G(this,Xr,M1(t.url,void 0)),G(this,Fl,()=>lz(t.url,t.token)),G(this,Vl,t.url),G(this,Gl,void 0)),G(this,Dl,R2(S(this,Xr),S(this,er))),G(this,ws,{...ane,...t.candidateTimeouts}),G(this,W1,t.roundTimeoutMs),this.ready=new Promise((c,u)=>{G(this,J1,c),G(this,ha,u)});const n=t.signal,s=(n==null?void 0:n.aborted)===!0;if(n!==void 0){const c=()=>C(this,w,zz).call(this);s?queueMicrotask(c):(n.addEventListener("abort",c,{once:!0}),G(this,Ku,()=>n.removeEventListener("abort",c)))}G(this,Gu,(o=t.network)==null?void 0:o.subscribe(()=>C(this,w,pk).call(this))),G(this,Wu,(l=t.lifecycle)==null?void 0:l.subscribe(c=>{c==="background"?C(this,w,Sz).call(this):C(this,w,Cz).call(this)})),s||C(this,w,Ko).call(this)}setConnectionMode(t){var n,s;if(t!==S(this,er)){if(G(this,er,t),G(this,Dl,R2(S(this,Xr),t)),C(this,w,Af).call(this),C(this,w,hi).call(this),C(this,w,Qc).call(this),S(this,jt)!==void 0&&C(this,w,Tf).call(this,new Pn),S(this,Be)!==void 0){const r=S(this,Be);G(this,Be,void 0),C(this,w,pl).call(this,r);try{(n=r.connection)==null||n.close()}catch{}}if(S(this,on)!==void 0){const r=S(this,on);G(this,on,void 0),r.timer!==void 0&&S(this,Ze).clearTimeout(r.timer);try{(s=r.connection)==null||s.close()}catch{}}S(this,Oe)||(C(this,w,Jc).call(this),C(this,w,yl).call(this),C(this,w,Xo).call(this),C(this,w,fl).call(this),C(this,w,hl).call(this,new Pn),S(this,Vt)!==void 0&&C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Ko).call(this))}}rtcDiagnostics(){var i;const t=S(this,Be),n=C(this,w,mp).call(this);let s;t!==void 0?s=t.phase:((i=S(this,Ee))==null?void 0:i.p2p)===!0&&S(this,Ee).phase==="ready"?s="active":S(this,jt)!==void 0?s="warm":n>0?s="cooldown":S(this,Qi)!==void 0?s="scheduled":s="idle";const r=S(this,qu);return{path:S(this,ql),phase:s,...r===void 0?{}:{lastFailure:{stage:r.stage,...r.reason===void 0?{}:{reason:r.reason},agoMs:Math.max(0,C(this,w,ss).call(this)-r.atMs),...r.pair===void 0?{}:{pair:r.pair}}},...S(this,Si)===void 0?{}:{selectedPair:S(this,Si)},cooldownRemainingMs:n}}}Cr=new WeakMap,Bu=new WeakMap,rn=new WeakMap,mn=new WeakMap,Er=new WeakMap,Hu=new WeakMap,Qx=new WeakMap,ki=new WeakMap,is=new WeakMap,Xr=new WeakMap,Dl=new WeakMap,er=new WeakMap,$r=new WeakMap,Ze=new WeakMap,bi=new WeakMap,wi=new WeakMap,Be=new WeakMap,on=new WeakMap,jt=new WeakMap,os=new WeakMap,Qi=new WeakMap,Bl=new WeakMap,Hl=new WeakMap,aa=new WeakMap,Ji=new WeakMap,G1=new WeakMap,ji=new WeakMap,ql=new WeakMap,qu=new WeakMap,Si=new WeakMap,la=new WeakMap,Pl=new WeakMap,eo=new WeakMap,ca=new WeakMap,Zr=new WeakMap,Ul=new WeakMap,Fl=new WeakMap,Vl=new WeakMap,Gl=new WeakMap,ws=new WeakMap,W1=new WeakMap,K1=new WeakMap,Wl=new WeakMap,Ee=new WeakMap,Pu=new WeakMap,Uu=new WeakMap,X1=new WeakMap,Fu=new WeakMap,ua=new WeakMap,da=new WeakMap,Vu=new WeakMap,Gu=new WeakMap,Wu=new WeakMap,Ku=new WeakMap,Kl=new WeakMap,Ci=new WeakMap,Z1=new WeakMap,Xu=new WeakMap,Vt=new WeakMap,an=new WeakMap,as=new WeakMap,Ei=new WeakMap,Jx=new WeakMap,Xl=new WeakMap,to=new WeakMap,no=new WeakMap,so=new WeakMap,Ie=new WeakMap,Zu=new WeakMap,Y1=new WeakMap,Q1=new WeakMap,Yu=new WeakMap,Qu=new WeakMap,eg=new WeakMap,Oe=new WeakMap,Ju=new WeakMap,fa=new WeakMap,J1=new WeakMap,ha=new WeakMap,w=new WeakSet,bs=function(t){return!S(this,Oe)&&S(this,Ee)===t&&!t.done&&t.generation===S(this,Pu)},ul=function(t){t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0)},dp=function(t,n,s){C(this,w,ul).call(this,t),t.timer=setTimeout(()=>{t.timer=void 0,C(this,w,bs).call(this,t)&&C(this,w,dl).call(this,t,n,void 0,`no progress within ${s}ms`)},Math.max(0,s))},Ko=function(){if(S(this,Oe)||S(this,Ee)!==void 0)return;C(this,w,Jc).call(this),C(this,w,yl).call(this),G(this,Uu,S(this,Uu)+1);const t=S(this,Uu);G(this,Ul,[...S(this,Dl)]),G(this,X1,0),G(this,Fu,[]),G(this,Kl,!1),G(this,Ci,!0);const n=S(this,ws).socketOpenMs+S(this,ws).noiseMs+S(this,ws).helloMs+S(this,ws).syncMs,s=S(this,W1)??S(this,Ul).length*n+1e3;G(this,ua,setTimeout(()=>{if(G(this,ua,void 0),S(this,Oe)||!S(this,Ci)||S(this,Uu)!==t)return;const r=S(this,Ee);G(this,Kl,!0),r!==void 0&&(C(this,w,hp).call(this,r.candidate,"round",!1,void 0,`the connection round exceeded ${s}ms`),C(this,w,Xo).call(this,r)),C(this,w,$f).call(this)},s)),C(this,w,fp).call(this)},fp=function(){if(S(this,Oe)||!S(this,Ci)||S(this,Ee)!==void 0)return;if(S(this,Kl)){C(this,w,$f).call(this);return}const t=S(this,Ul)[Cn(this,X1)._++];if(t===void 0){C(this,w,$f).call(this);return}if(t.unsupported!==void 0){C(this,w,hp).call(this,t,"unsupported",!1,void 0,t.unsupported),queueMicrotask(()=>C(this,w,fp).call(this));return}const n={candidate:t,generation:++Cn(this,Pu)._,phase:"open",done:!1};G(this,Ee,n),G(this,Zu,!1),C(this,w,dp).call(this,n,"open",S(this,ws).socketOpenMs);const s={opened:()=>{C(this,w,bs).call(this,n)&&C(this,w,ak).call(this,n,"noise",S(this,ws).noiseMs)},authenticated:()=>{C(this,w,bs).call(this,n)&&(C(this,w,ak).call(this,n,"hello",S(this,ws).helloMs),C(this,w,dz).call(this))},message:o=>{C(this,w,bs).call(this,n)&&C(this,w,lk).call(this,n,o)},closed:(o,l)=>{C(this,w,bs).call(this,n)&&C(this,w,dl).call(this,n,n.phase==="ready"?"closed":n.phase,o,l)}};let r;try{r=S(this,Fl).call(this,t,S(this,Wl))}catch(o){C(this,w,dl).call(this,n,"open",void 0,As(o).message);return}let i;try{i=r.open(s)}catch(o){C(this,w,dl).call(this,n,"open",void 0,As(o).message);return}if(!C(this,w,bs).call(this,n)){i.close();return}n.connection=i},ak=function(t,n,s){C(this,w,bs).call(this,t)&&(t.phase=n,C(this,w,dp).call(this,t,n,s))},dz=function(){if(S(this,Wl)===void 0||(G(this,Wl,void 0),S(this,Cr).onPaired===void 0))return;const t=n=>{var s,r;try{(r=(s=S(this,Cr)).onPairedError)==null||r.call(s,As(n))}catch{}};try{Promise.resolve(S(this,Cr).onPaired()).catch(t)}catch(n){t(n)}},lk=function(t,n){let s;try{s=JSON.parse(n)}catch{C(this,w,dl).call(this,t,t.phase==="ready"?"closed":t.phase,void 0,"the host sent a frame that is not JSON");return}if(!(s===null||typeof s!="object")){if(s.type==="hello"){C(this,w,ck).call(this,t,s);return}C(this,w,Nz).call(this,s)}},ck=function(t,n){var l;const s=n.protocol,r=typeof s=="number"?s:s!==null&&typeof s=="object"?s.major:void 0;if(r!==q2.major){const c=new uz(typeof r=="number"?r:Number.NaN,q2.major,n.hostVersion);G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,wp).call(this),C(this,w,Yo).call(this),C(this,w,Xo).call(this),S(this,Vt)===void 0?S(this,ha).call(this,c):(C(this,w,Un).call(this,{connection:"outdated",protocolMismatch:{hostMajor:c.hostMajor,clientMajor:c.clientMajor,...c.hostVersion===void 0?{}:{hostVersion:c.hostVersion},direction:c.direction}}),C(this,w,gi).call(this,"error",c.message));return}C(this,w,ul).call(this,t),t.phase="sync",C(this,w,dp).call(this,t,"sync",S(this,ws).syncMs);const i=s!==null&&typeof s=="object"&&typeof s.minor=="number"?s.minor:0;G(this,Ie,i),G(this,Zu,!0),G(this,bi,n.rtc!==void 0&&FQ(n.rtc)?n.rtc:void 0),((l=S(this,bi))==null?void 0:l.signalOnly)===!0&&!S(this,wi)&&(G(this,wi,!0),C(this,w,xp).call(this)),G(this,Hu,n.docs),G(this,Qx,n.toolPresentations),G(this,Y1,n.models),G(this,Q1,n.defaults??{}),G(this,Yu,n.hostVersion),S(this,Er).clear();const o=new Set(H2(i));for(const c of N3)o.has(c)?S(this,mn).add(c):(S(this,mn).delete(c),S(this,rn).delete(c),S(this,Er).delete(c));if(S(this,an)!==void 0)for(const c of C(this,w,pi).call(this,S(this,an)))S(this,mn).add(c);if(S(this,as)!==void 0)for(const c of C(this,w,pi).call(this,S(this,as)))S(this,mn).add(c);for(const c of S(this,mn))C(this,w,$k).call(this,c);if(n.endpointSet!==void 0){const c=Kg(n.endpointSet);if(c.kind==="valid"&&(S(this,K1)&&(G(this,Xr,M1(S(this,Vl),c.endpointSet,{pageProtocol:S(this,Gl)})),G(this,Dl,R2(S(this,Xr),S(this,er)))),S(this,Cr).onEndpointSet!==void 0)){const u=d=>{var f,h;try{(h=(f=S(this,Cr)).onEndpointSetError)==null||h.call(f,As(d))}catch{}};try{Promise.resolve(S(this,Cr).onEndpointSet(c.endpointSet)).catch(u)}catch(d){u(d)}}}S(this,Vt)!==void 0&&(C(this,w,Un).call(this,{session:n.session,toolPresentations:n.toolPresentations,connection:"reconnecting",host:C(this,w,Ak).call(this)}),C(this,w,Js).call(this)),C(this,w,fz).call(this,t,n,i)},fz=async function(t,n,s){try{const r=C(this,w,_z).call(this,s),i=new Set(H2(s)),o=r.filter(c=>i.has(c)&&!S(this,Er).has(c));await Promise.all(o.map(c=>C(this,w,_f).call(this,c,!0))),S(this,Vt)!==void 0&&t.p2p!==!0&&(C(this,w,Un).call(this,{connection:"connected"}),C(this,w,Js).call(this),C(this,w,zf).call(this),G(this,Ci,!1),t.phase="ready");const l=r.filter(c=>!S(this,Er).has(c));S(this,Vt)!==void 0&&t.p2p!==!0&&l.length>0&&G(this,os,{entries:[]}),await Promise.all(l.map(c=>C(this,w,_f).call(this,c,!0)))}catch{return}if(C(this,w,bs).call(this,t)){if(C(this,w,ul).call(this,t),C(this,w,zf).call(this),t.phase="ready",G(this,Ci,!1),G(this,Qu,0),G(this,Z1,!0),G(this,Xu,!1),G(this,ql,C(this,w,pz).call(this,t.candidate,t.p2p===!0)),S(this,Vt)===void 0){G(this,Vt,{session:n.session,organized:{chats:[],projects:[],archived:[]},models:C(this,w,Ys).call(this,"models")??n.models,defaults:C(this,w,Mk).call(this,n.defaults??{}),notices:[],connection:"connected",docs:[],submissions:[],toolPresentations:n.toolPresentations,devices:[],mcp:null,auth:null,providers:null,settings:null,agents:null,host:C(this,w,Ak).call(this)}),C(this,w,Js).call(this),S(this,J1).call(this,{view:C(this,w,Kz).call(this),controller:C(this,w,Xz).call(this),setConnectionMode:r=>this.setConnectionMode(r),rtcDiagnostics:()=>this.rtcDiagnostics(),close:()=>C(this,w,Yz).call(this)}),C(this,w,kk).call(this),C(this,w,uk).call(this,t);return}C(this,w,Un).call(this,{session:n.session,connection:"connected"}),C(this,w,Js).call(this),await C(this,w,Fz).call(this),C(this,w,bs).call(this,t)&&(C(this,w,kk).call(this),C(this,w,uk).call(this,t))}},uk=function(t){if(t.p2p===!0){C(this,w,kz).call(this),C(this,w,Ez).call(this),C(this,w,wk).call(this);return}C(this,w,hi).call(this),C(this,w,Yc).call(this,C(this,w,hz).call(this))},hp=function(t,n,s,r,i){var l,c;const o={candidate:t,stage:n,unauthorized:s,...r===void 0?{}:{code:r},...i===void 0?{}:{reason:i}};S(this,Fu).push(o);try{(c=(l=S(this,Cr)).onCandidateFailure)==null||c.call(l,o)}catch{}},dl=function(t,n,s,r){if(!C(this,w,bs).call(this,t))return;const i=t.phase==="ready";if(t.p2p===!0&&(C(this,w,gl).call(this,i?"liveness":"commit",r,S(this,Si)),i&&(G(this,Ji,C(this,w,ss).call(this)+U9),C(this,w,hi).call(this),C(this,w,Qc).call(this))),C(this,w,hp).call(this,t.candidate,n,s===op,s,r),C(this,w,Xo).call(this,t),C(this,w,Iz).call(this),C(this,w,fl).call(this),S(this,jt)!==void 0&&(S(this,jt).old===t||S(this,jt).standby.installed&&S(this,jt).standby===S(this,Be))&&C(this,w,Tf).call(this,new Pn),!S(this,Oe)){if(t.p2p===!0&&!i){C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Ko).call(this);return}if(i){C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Ko).call(this);return}if(S(this,Kl)){C(this,w,$f).call(this);return}queueMicrotask(()=>C(this,w,fp).call(this))}},Xo=function(t){var s;const n=S(this,Ee);if(!(n===void 0||t!==void 0&&n!==t)){if(n.p2p===!0&&G(this,Si,void 0),G(this,Ee,void 0),n.done=!0,C(this,w,ul).call(this,n),S(this,os)!==void 0){for(const r of S(this,os).entries.splice(0))r.reject(new Pn);G(this,os,void 0)}C(this,w,hl).call(this,new Pn),(s=n.connection)==null||s.close()}},fl=function(){for(const t of S(this,is).values())t.reject(new Pn);S(this,is).clear()},hl=function(t){for(const n of S(this,ki).values())for(const s of n.splice(0))s.reject(t)},dk=function(t){return t.filter(n=>n.stage!=="unsupported")},fk=function(t){const n=C(this,w,dk).call(this,t);return n.length>0&&n.every(s=>s.unauthorized)},$f=function(){if(!S(this,Ci))return;if(G(this,Ci,!1),C(this,w,Jc).call(this),C(this,w,yl).call(this),S(this,os)!==void 0){for(const i of S(this,os).entries.splice(0))i.reject(new Pn);G(this,os,void 0)}if(G(this,Ee,void 0),S(this,Oe))return;const t=[...S(this,Fu)],n=C(this,w,dk).call(this,t),s=C(this,w,fk).call(this,t),r=S(this,Ul).length===0;if(!s&&S(this,er)==="directOnly"&&S(this,$r)!==void 0&&(S(this,wi)||S(this,bi)!==void 0)&&S(this,on)===void 0&&S(this,Be)===void 0&&S(this,Ee)===void 0){C(this,w,jk).call(this);return}if(!S(this,Z1)){G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,Yo).call(this),S(this,ha).call(this,s?new up:r?new Error(Z2):C(this,w,pp).call(this,t));return}if(s){G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,Yo).call(this),C(this,w,Un).call(this,{connection:"closed",unauthorized:!0}),C(this,w,gi).call(this,"error",new up().message);return}if(n.length===0){G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,Yo).call(this),C(this,w,Un).call(this,{connection:"closed"}),C(this,w,gi).call(this,"error",r?Z2:C(this,w,pp).call(this,t).message);return}C(this,w,Un).call(this,{connection:"reconnecting"}),S(this,Xu)||(G(this,Xu,!0),C(this,w,gi).call(this,"error",C(this,w,pp).call(this,t).message)),C(this,w,hk).call(this)},pp=function(t){return C(this,w,fk).call(this,t)?new up:t.length===0?new Error(Z2):new lne(t)},hk=function(){C(this,w,yl).call(this);const{min:t,max:n}=S(this,Cr).reconnectDelayMs??{min:200,max:2e3},s=Math.min(n,t*2**Cn(this,Qu)._++),r=S(this,Vu);G(this,da,setTimeout(()=>{S(this,Vu)===r&&(G(this,da,void 0),S(this,Oe)||C(this,w,Ko).call(this))},s))},pk=function(){var t,n;if(!S(this,Oe)){if(C(this,w,Mz).call(this),((t=S(this,Ee))==null?void 0:t.p2p)===!0&&S(this,Ee).phase==="ready"){C(this,w,Sk).call(this);return}((n=S(this,Ee))==null?void 0:n.phase)!=="ready"&&(C(this,w,yl).call(this),C(this,w,Jc).call(this),C(this,w,Xo).call(this),G(this,Qu,0),C(this,w,Ko).call(this))}},ss=function(){return S(this,Ze).now()},hz=function(){return une},pz=function(t,n=!1){return n?"p2p":t.role==="legacy"?"relay":t.role},xp=function(t=!0){var s,r;const n=i=>{var o,l;try{(l=(o=S(this,$r))==null?void 0:o.onSignalOnlyError)==null||l.call(o,As(i))}catch{}};try{Promise.resolve((r=(s=S(this,$r))==null?void 0:s.onSignalOnly)==null?void 0:r.call(s,t)).catch(n)}catch(i){n(i)}},xz=function(){for(const t of S(this,ki).values())if(t.length>0)return!0;return!1},Yc=function(t){if(S(this,Oe)||S(this,$r)===void 0||S(this,er)==="relayOnly")return;C(this,w,Af).call(this);const n=++Cn(this,Bl)._;G(this,Qi,S(this,Ze).setTimeout(()=>{G(this,Qi,void 0),n===S(this,Bl)&&C(this,w,gz).call(this)},Math.max(0,t)))},Af=function(){S(this,Qi)!==void 0&&(S(this,Ze).clearTimeout(S(this,Qi)),G(this,Qi,void 0))},gz=function(){var r;if(S(this,Oe)||S(this,$r)===void 0||S(this,er)==="relayOnly"||S(this,Be)!==void 0||S(this,jt)!==void 0||S(this,on)!==void 0)return;const t=C(this,w,ss).call(this),n=Math.max(S(this,aa),S(this,Ji));if(t<n){C(this,w,Yc).call(this,n-t);return}const s=S(this,Ee);if((s==null?void 0:s.phase)==="ready"&&s.connection!==void 0&&((r=S(this,Vt))==null?void 0:r.connection)==="connected"){if(S(this,bi)===void 0)return;C(this,w,xk).call(this,s.connection,!1);return}S(this,er)==="directOnly"&&(S(this,bi)===void 0&&!S(this,wi)||C(this,w,jk).call(this))},xk=function(t,n){var u;const s=S(this,$r);if(s===void 0||S(this,Be)!==void 0||S(this,Oe))return;const r=++Cn(this,Bl)._,i={generation:r,phase:"signal",signal:t,signalOnly:n,installed:!1};G(this,Be,i),G(this,qu,void 0),i.timer=S(this,Ze).setTimeout(()=>{S(this,Be)!==i||S(this,jt)!==void 0||C(this,w,xl).call(this,i,"warm",`WebRTC preparation exceeded ${P9}ms`)},P9);const o=`rtc-${S(this,eg)}-${r}`,l=QQ({platform:s.platform,stun:((u=S(this,bi))==null?void 0:u.stun)??[],hostKey:s.hostKey,device:s.device,clock:S(this,Ze),offer:d=>C(this,w,mz).call(this,t,o,d),onSelectedPair:d=>{d!==void 0&&(i.selectedPair=OQ(d.local,d.remote))}}),c={signaled:()=>{S(this,Be)===i&&(i.phase="ice")},opened:()=>{S(this,Be)===i&&(i.phase="noise")},authenticated:()=>{var d;if(S(this,Be)===i&&(i.phase="noise",i.signalOnly)){try{(d=i.signal)==null||d.close()}catch{}i.signal=void 0}},message:d=>{var f;if(i.installed){const h=i.installed&&((f=S(this,Ee))==null?void 0:f.connection)===i.connection?S(this,Ee):void 0;h!==void 0&&C(this,w,bs).call(this,h)&&C(this,w,lk).call(this,h,d);return}C(this,w,yz).call(this,i,d)},closed:(d,f)=>{var h;if(i.installed){const x=((h=S(this,Ee))==null?void 0:h.connection)===i.connection?S(this,Ee):void 0;x!==void 0&&C(this,w,bs).call(this,x)&&C(this,w,dl).call(this,x,x.phase==="ready"?"closed":x.phase,d,f);return}S(this,Be)===i&&C(this,w,xl).call(this,i,i.phase,f??`DataChannel closed (${d})`)}};try{i.connection=l.open(c)}catch(d){C(this,w,xl).call(this,i,"signal",As(d).message)}},mz=function(t,n,s){const r=Cn(this,Ei)._++;return new Promise((i,o)=>{S(this,is).set(r,{resolve:i,reject:o});try{t.send(JSON.stringify({type:"call",id:r,method:"rtcOffer",args:{attempt:n,sdp:s}}))}catch(l){S(this,is).delete(r),o(As(l))}}).then(i=>{const o=i;if(o===null||typeof o!="object"||typeof o.sdp!="string")throw new Error("the host returned a malformed rtcOffer answer");return o.sdp})},yz=function(t,n){var r;if(S(this,Be)!==t)return;let s;try{s=JSON.parse(n)}catch{C(this,w,xl).call(this,t,"noise","the DataChannel sent a frame that is not JSON");return}if(!(s===null||typeof s!="object")){if(s.type==="hello"){t.hello=s,t.pingId===void 0&&C(this,w,vz).call(this,t);return}if(s.type==="result"&&((r=t.verify)==null?void 0:r.id)===s.id){const i=t.verify;t.verify=void 0,i.timer!==void 0&&S(this,Ze).clearTimeout(i.timer),s.ok?i.resolve():i.reject(new Error(s.error));return}}},vz=function(t){if(S(this,Be)!==t||t.hello===void 0)return;const n=Cn(this,Ei)._++;t.pingId=n,C(this,w,gk).call(this,t,n,5e3).then(()=>{S(this,Be)!==t||t.installed||(t.phase="warm",t.warmAt=C(this,w,ss).call(this),t.timer!==void 0&&S(this,Ze).clearTimeout(t.timer),t.timer=S(this,Ze).setTimeout(()=>{S(this,Be)===t&&S(this,jt)===void 0&&C(this,w,bz).call(this,t,`no idle window within ${q9}ms`)},q9),C(this,w,Mf).call(this,t))},s=>{S(this,Be)===t&&C(this,w,xl).call(this,t,"warm",As(s).message)})},gk=function(t,n,s){return S(this,Be)!==t||t.connection===void 0?Promise.reject(new Error("the RTC carrier is gone")):new Promise((r,i)=>{const o=S(this,Ze).setTimeout(()=>{var l;((l=t.verify)==null?void 0:l.id)===n&&(t.verify=void 0,i(new Error(`the RTC carrier did not answer a ping within ${s}ms`)))},s);t.verify={id:n,resolve:r,reject:i,timer:o};try{t.connection.send(JSON.stringify({type:"call",id:n,method:"ping",args:{id:`rtc-${n}`}}))}catch(l){S(this,Ze).clearTimeout(o),t.verify=void 0,i(As(l))}})},Mf=function(t){var s;if(S(this,Be)!==t||t.phase!=="warm"||t.installed||S(this,jt)!==void 0)return;if(((s=S(this,Ee))==null?void 0:s.phase)!=="ready"){C(this,w,mk).call(this,t);return}if(S(this,is).size>0||C(this,w,xz).call(this))t.idleSince=void 0;else{const r=C(this,w,ss).call(this);if(t.idleSince??(t.idleSince=r),r-t.idleSince>=dne){C(this,w,mk).call(this,t);return}}t.idleTimer!==void 0&&S(this,Ze).clearTimeout(t.idleTimer),t.idleTimer=S(this,Ze).setTimeout(()=>C(this,w,Mf).call(this,t),100)},mk=function(t){var s;if(S(this,Be)!==t||S(this,jt)!==void 0||t.hello===void 0)return;t.idleTimer!==void 0&&S(this,Ze).clearTimeout(t.idleTimer),t.idleTimer=void 0;const n={standby:t,old:S(this,Ee),entries:[],warmAt:t.warmAt??C(this,w,ss).call(this),prepared:!1,released:!1};if(G(this,jt,n),((s=n.old)==null?void 0:s.phase)==="ready"&&n.old.connection!==void 0){const r=Cn(this,Ei)._++;t.verify=void 0,C(this,w,gk).call(this,t,r,3e3).then(()=>{S(this,jt)!==n||n.released||(n.prepared=!0,C(this,w,yk).call(this,n))},i=>{S(this,jt)!==n||n.released||C(this,w,vk).call(this,n,As(i).message)})}else n.prepared=!0,C(this,w,yk).call(this,n)},yk=function(t){var o;if(S(this,jt)!==t||t.released)return;const n=t.standby,s=n.hello;if(s===void 0||n.connection===void 0){C(this,w,Tf).call(this,new Error("the RTC carrier lost its hello before handoff"));return}const r=t.old;if(r!==void 0){r.done=!0;try{(o=r.connection)==null||o.close()}catch{}}const i={candidate:{url:"webrtc",role:"direct"},generation:++Cn(this,Pu)._,phase:"sync",connection:n.connection,done:!1,p2p:!0};G(this,Ee,i),n.installed=!0,G(this,ql,"p2p"),G(this,Si,n.selectedPair),n.signalOnly&&(n.signal=void 0),C(this,w,ck).call(this,i,s)},vk=function(t,n){var r;G(this,jt,void 0),G(this,Be,void 0),C(this,w,pl).call(this,t.standby);try{(r=t.standby.connection)==null||r.close()}catch{}if(t.standby.signalOnly&&t.standby.signal!==void 0)try{t.standby.signal.close()}catch{}C(this,w,gl).call(this,"commit",n,t.standby.selectedPair),C(this,w,bk).call(this);const s=t.old;for(const i of t.entries.splice(0))s===void 0?i.reject(new Error("Not connected to the host")):C(this,w,gp).call(this,s,i);C(this,w,Yc).call(this,C(this,w,mp).call(this))},Tf=function(t){var s;const n=S(this,jt);if(n!==void 0){G(this,jt,void 0),G(this,Be,void 0),C(this,w,pl).call(this,n.standby);try{(s=n.standby.connection)==null||s.close()}catch{}if(n.standby.signalOnly&&n.standby.signal!==void 0)try{n.standby.signal.close()}catch{}for(const r of n.entries.splice(0))r.reject(t)}},kk=function(){const t=S(this,os);if(t===void 0)return;G(this,os,void 0);const n=S(this,Ee);for(const s of t.entries.splice(0))n===void 0?s.reject(new Pn):C(this,w,gp).call(this,n,s)},kz=function(){const t=S(this,jt);if(t===void 0||!t.standby.installed)return;G(this,jt,void 0),G(this,Be,void 0);const n=S(this,Ee);for(const s of t.entries.splice(0))n===void 0?s.reject(new Error("Not connected to the host")):C(this,w,gp).call(this,n,s);C(this,w,wk).call(this)},gp=function(t,n){if(!C(this,w,bs).call(this,t)||t.phase!=="ready"||t.connection===void 0){n.reject(new Error("Not connected to the host"));return}S(this,is).set(n.id,{resolve:n.resolve,reject:n.reject});try{t.connection.send(JSON.stringify(n.frame))}catch(s){S(this,is).delete(n.id),n.reject(As(s))}},pl=function(t){var n;for(const s of[t.timer,t.pingTimer,t.idleTimer,(n=t.verify)==null?void 0:n.timer])s!==void 0&&S(this,Ze).clearTimeout(s);t.timer=void 0,t.pingTimer=void 0,t.idleTimer=void 0,t.verify=void 0},xl=function(t,n,s){var i;if(S(this,Be)!==t)return;const r=S(this,jt);if(r!==void 0&&r.standby===t){C(this,w,vk).call(this,r,s);return}G(this,Be,void 0),C(this,w,pl).call(this,t);try{(i=t.connection)==null||i.close()}catch{}if(t.signalOnly&&t.signal!==void 0)try{t.signal.close()}catch{}if(C(this,w,gl).call(this,n,s,t.selectedPair),t.signalOnly&&n==="signal"&&(G(this,wi,!1),C(this,w,xp).call(this,!1)),C(this,w,bk).call(this),S(this,Vt)===void 0&&S(this,er)==="directOnly"&&S(this,Ee)===void 0){C(this,w,ml).call(this,s);return}C(this,w,Yc).call(this,C(this,w,mp).call(this))},bz=function(t,n){var s;if(S(this,Be)===t){G(this,Be,void 0),C(this,w,pl).call(this,t);try{(s=t.connection)==null||s.close()}catch{}if(t.signalOnly&&t.signal!==void 0)try{t.signal.close()}catch{}C(this,w,gl).call(this,"commit",n,t.selectedPair),C(this,w,Yc).call(this,fne)}},gl=function(t,n,s){G(this,qu,{stage:t,...n===void 0?{}:{reason:n},atMs:C(this,w,ss).call(this),...s===void 0?{}:{pair:s}})},bk=function(){G(this,Hl,S(this,Hl)+1);const t=Math.min(pne,hne*2**(S(this,Hl)-1));G(this,aa,C(this,w,ss).call(this)+t)},mp=function(){return Math.max(0,Math.max(S(this,aa),S(this,Ji))-C(this,w,ss).call(this))},wk=function(){S(this,ji)!==void 0&&S(this,Ze).clearTimeout(S(this,ji)),G(this,ji,S(this,Ze).setTimeout(()=>{var t;G(this,ji,void 0),S(this,ql)==="p2p"&&((t=S(this,Ee))==null?void 0:t.phase)==="ready"&&(G(this,Hl,0),G(this,aa,0),G(this,Ji,0))},xne))},wz=function(){G(this,Hl,0),G(this,aa,0),G(this,Ji,0)},jk=function(){const t=S(this,$r);if(t===void 0||S(this,on)!==void 0||S(this,Oe))return;if(t.openSignalTransport===void 0){C(this,w,ml).call(this,"the platform has no signal-only transport");return}const n=wK(S(this,Xr));if(n.length===0){C(this,w,ml).call(this,"no relay candidate is available for signaling");return}const s={generation:++Cn(this,Bl)._,index:0,token:0,done:!1};G(this,on,s),C(this,w,yp).call(this,s,n)},yp=function(t,n){var s;if(!(S(this,on)!==t||t.done||S(this,Oe))){for(t.timer!==void 0&&(S(this,Ze).clearTimeout(t.timer),t.timer=void 0);t.index<n.length;){const r=n[t.index++];if(r.unsupported!==void 0)continue;const i=(s=S(this,$r))==null?void 0:s.openSignalTransport;if(i===void 0){C(this,w,vp).call(this,t,"the platform has no signal-only transport");return}let o;try{o=i(r)}catch(d){C(this,w,vp).call(this,t,As(d).message);return}const l=++t.token,c=S(this,ws).socketOpenMs+S(this,ws).noiseMs+S(this,ws).helloMs;t.timer=S(this,Ze).setTimeout(()=>{var d;if(!(S(this,on)!==t||t.done||t.token!==l)){t.done=!0,t.token+=1;try{(d=t.connection)==null||d.close()}catch{}t.connection=void 0,t.done=!1,C(this,w,yp).call(this,t,n)}},c);const u={message:d=>C(this,w,jz).call(this,t,d),closed:(d,f)=>{if(t.token===l){if(S(this,on)!==t||t.done){const h=S(this,Be);(h==null?void 0:h.signalOnly)===!0&&h.signal===t.connection&&!h.installed&&h.phase!=="noise"&&h.phase!=="warm"&&C(this,w,xl).call(this,h,h.phase,"the signal-only connection closed");return}t.done=!0,t.connection=void 0,t.done=!1,C(this,w,yp).call(this,t,n)}}};try{t.connection=o.open(u)}catch{continue}return}C(this,w,vp).call(this,t,"every relay signal path failed")}},jz=function(t,n){let s;try{s=JSON.parse(n)}catch{return}if(s===null||typeof s!="object")return;if(s.type==="result"){const i=S(this,is).get(s.id);S(this,is).delete(s.id),s.ok?i==null||i.resolve(s.value):i==null||i.reject(new Error(s.error));return}if(s.type!=="signalHello"||S(this,on)!==t||t.done)return;if(t.done=!0,G(this,on,void 0),t.timer!==void 0&&S(this,Ze).clearTimeout(t.timer),t.timer=void 0,s.rtc===void 0){C(this,w,ml).call(this,"the host did not advertise WebRTC on its signal connection");return}G(this,bi,s.rtc),s.rtc.signalOnly&&C(this,w,xp).call(this);const r=t.connection;if(r===void 0){C(this,w,ml).call(this,"the signal-only connection vanished before its offer");return}C(this,w,xk).call(this,r,!0)},vp=function(t,n){S(this,on)===t&&(G(this,on,void 0),t.timer!==void 0&&S(this,Ze).clearTimeout(t.timer),t.timer=void 0,C(this,w,gl).call(this,"signal",n),G(this,wi,!1),C(this,w,ml).call(this,n))},ml=function(t){if(!S(this,Oe)){if(S(this,Vt)===void 0){G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,Yo).call(this),C(this,w,fl).call(this),C(this,w,hl).call(this,new Pn),S(this,ha).call(this,new cz(t));return}C(this,w,gi).call(this,"error",`${gM} (${t})`),C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,hk).call(this)}},Sz=function(){S(this,Oe)||(G(this,ca,!0),C(this,w,hi).call(this))},Cz=function(){var t,n;if(!S(this,Oe)){if(G(this,ca,!1),((t=S(this,Ee))==null?void 0:t.p2p)===!0&&S(this,Ee).phase==="ready"){C(this,w,Sk).call(this);return}((n=S(this,Ee))==null?void 0:n.phase)!=="ready"&&C(this,w,pk).call(this)}},Ez=function(){var n;if(C(this,w,hi).call(this),S(this,Oe)||S(this,ca)||((n=S(this,Ee))==null?void 0:n.p2p)!==!0||S(this,Ee).phase!=="ready")return;const t=C(this,w,ss).call(this);G(this,Pl,t+H9),G(this,eo,t+$0),C(this,w,kp).call(this)},kp=function(){var n;if(S(this,Oe)||S(this,ca)||((n=S(this,Ee))==null?void 0:n.p2p)!==!0||S(this,Ee).phase!=="ready")return;const t=Math.max(0,S(this,eo)-C(this,w,ss).call(this));G(this,la,S(this,Ze).setTimeout(()=>{G(this,la,void 0),C(this,w,$z).call(this)},t))},hi=function(){S(this,la)!==void 0&&S(this,Ze).clearTimeout(S(this,la)),G(this,la,void 0);for(const t of S(this,Zr).values())t.timer!==void 0&&S(this,Ze).clearTimeout(t.timer);S(this,Zr).clear()},$z=function(){const t=S(this,Ee);if(S(this,Oe)||S(this,ca)||(t==null?void 0:t.p2p)!==!0||t.phase!=="ready")return;const n=C(this,w,ss).call(this);if(n>=S(this,Pl)){C(this,w,bp).call(this,"no pong within 15000ms");return}C(this,w,Ck).call(this,!1),G(this,eo,S(this,eo)+$0),S(this,eo)<=n&&G(this,eo,n+$0),C(this,w,kp).call(this)},Sk=function(){var n;C(this,w,hi).call(this),!(((n=S(this,Ee))==null?void 0:n.p2p)!==!0||S(this,Ee).phase!=="ready"||C(this,w,Ck).call(this,!0)===void 0)&&(G(this,eo,C(this,w,ss).call(this)+$0),C(this,w,kp).call(this))},Ck=function(t){const n=S(this,Ee);if((n==null?void 0:n.connection)===void 0||n.p2p!==!0)return;const s=Cn(this,Ei)._++,r={generation:n.generation};S(this,Zr).set(s,r),t&&(r.timer=S(this,Ze).setTimeout(()=>{S(this,Zr).has(s)&&(S(this,Zr).delete(s),C(this,w,bp).call(this,"the foreground verification ping did not answer within 3000ms"))},cne));try{n.connection.send(JSON.stringify({type:"call",id:s,method:"ping",args:{id:`probe-${s}`}}))}catch(i){S(this,Zr).delete(s),r.timer!==void 0&&S(this,Ze).clearTimeout(r.timer),C(this,w,bp).call(this,As(i).message);return}return s},bp=function(t){var s;const n=S(this,Ee);if((n==null?void 0:n.p2p)===!0){C(this,w,gl).call(this,"liveness",t,S(this,Si)),G(this,Si,void 0),G(this,Ji,C(this,w,ss).call(this)+U9),C(this,w,hi).call(this),C(this,w,Qc).call(this),n.done=!0;try{(s=n.connection)==null||s.close()}catch{}S(this,Ee)===n&&G(this,Ee,void 0),C(this,w,fl).call(this),C(this,w,hl).call(this,new Pn),C(this,w,Jc).call(this),C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Ko).call(this)}},Qc=function(){S(this,ji)!==void 0&&(S(this,Ze).clearTimeout(S(this,ji)),G(this,ji,void 0))},Az=function(){return H9},Mz=function(){const t=C(this,w,ss).call(this);t-S(this,G1)<gne||(G(this,G1,t),C(this,w,wz).call(this))},Tz=function(){S(this,Ee)!==void 0&&C(this,w,ul).call(this,S(this,Ee))},zf=function(){S(this,ua)!==void 0&&(clearTimeout(S(this,ua)),G(this,ua,void 0))},Jc=function(){C(this,w,zf).call(this),C(this,w,Tz).call(this)},yl=function(){G(this,Vu,S(this,Vu)+1),S(this,da)!==void 0&&(clearTimeout(S(this,da)),G(this,da,void 0))},Zo=function(){for(const t of S(this,to))C(this,w,xi).call(this,t);C(this,w,zf).call(this),C(this,w,yl).call(this),C(this,w,Af).call(this),C(this,w,hi).call(this),C(this,w,Qc).call(this),S(this,Ee)!==void 0&&C(this,w,ul).call(this,S(this,Ee))},wp=function(){var t,n;if(C(this,w,Af).call(this),C(this,w,hi).call(this),C(this,w,Qc).call(this),S(this,jt)!==void 0&&C(this,w,Tf).call(this,new Pn),S(this,Be)!==void 0){const s=S(this,Be);G(this,Be,void 0),C(this,w,pl).call(this,s);try{(t=s.connection)==null||t.close()}catch{}if(s.signalOnly&&s.signal!==void 0)try{s.signal.close()}catch{}}if(S(this,on)!==void 0){const s=S(this,on);G(this,on,void 0),s.timer!==void 0&&S(this,Ze).clearTimeout(s.timer);try{(n=s.connection)==null||n.close()}catch{}}},Yo=function(){var t,n,s;(t=S(this,Gu))==null||t.call(this),G(this,Gu,void 0),(n=S(this,Wu))==null||n.call(this),G(this,Wu,void 0),(s=S(this,Ku))==null||s.call(this),G(this,Ku,void 0)},zz=function(){S(this,Oe)||(G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,wp).call(this),C(this,w,Yo).call(this),C(this,w,Xo).call(this),C(this,w,fl).call(this),C(this,w,hl).call(this,new Pn),C(this,w,Un).call(this,{connection:"closed"}),S(this,ha).call(this,new Error("Connection attempt aborted")))},Nf=function(t){var n,s;(s=(n=S(this,Ee))==null?void 0:n.connection)==null||s.send(JSON.stringify(t))},Nz=function(t){var n,s,r,i,o;if(!(t===null||typeof t!="object"))switch(t.type){case"snapshot":if(!S(this,mn).has(t.stream))return;S(this,rn).set(t.stream,t.value),S(this,Er).add(t.stream),S(this,so).set(t.stream,(S(this,so).get(t.stream)??0)+1),C(this,w,Js).call(this);for(const l of((n=S(this,ki).get(t.stream))==null?void 0:n.splice(0))??[])l.resolve();return;case"ops":if(!S(this,mn).has(t.stream)||!S(this,rn).has(t.stream))return;S(this,rn).set(t.stream,Fte(S(this,rn).get(t.stream),t.ops)),C(this,w,Js).call(this);return;case"ended":{S(this,mn).delete(t.stream),S(this,rn).delete(t.stream),S(this,Er).delete(t.stream);const l=new Error(`Stream ${t.stream} ended: ${t.reason}`);for(const c of((s=S(this,ki).get(t.stream))==null?void 0:s.splice(0))??[])c.endSatisfies?c.resolve():c.reject(l);S(this,an)!==void 0&&C(this,w,pi).call(this,S(this,an)).includes(t.stream)?C(this,w,zp).call(this):S(this,as)!==void 0&&C(this,w,pi).call(this,S(this,as)).includes(t.stream)&&G(this,as,void 0),C(this,w,Js).call(this);return}case"result":{const l=S(this,Zr).get(t.id);if(l!==void 0){S(this,Zr).delete(t.id),l.timer!==void 0&&S(this,Ze).clearTimeout(l.timer),t.ok&&((r=S(this,Ee))==null?void 0:r.generation)===l.generation&&G(this,Pl,Math.max(S(this,Pl),S(this,Ze).now()+C(this,w,Az).call(this))),((i=S(this,Be))==null?void 0:i.phase)==="warm"&&C(this,w,Mf).call(this,S(this,Be));return}const c=S(this,is).get(t.id);S(this,is).delete(t.id),t.ok?c==null||c.resolve(t.value):c==null||c.reject(new Error(t.error)),((o=S(this,Be))==null?void 0:o.phase)==="warm"&&C(this,w,Mf).call(this,S(this,Be));return}case"notice":C(this,w,gi).call(this,t.level,t.message);return}},_f=function(t,n=!1){return S(this,mn).has(t)?new Promise((s,r)=>{const i=S(this,ki).get(t)??[];i.push({resolve:s,reject:r,endSatisfies:n}),S(this,ki).set(t,i)}):Promise.resolve()},_z=function(t){const n=new Set(H2(t));for(const s of[S(this,an),S(this,as)])if(s!==void 0)for(const r of C(this,w,pi).call(this,s))n.add(r);return[...n]},pi=function(t){return[ol(t),...S(this,Hu).map(n=>cf(n.kind,t))]},Ek=async function(t){const n=C(this,w,pi).call(this,t).filter(i=>!S(this,mn).has(i)),s=C(this,w,pi).call(this,t).filter(i=>S(this,mn).has(i)&&!S(this,Er).has(i));for(const i of n)S(this,mn).add(i);const r=Promise.all([...n,...s].map(i=>C(this,w,_f).call(this,i)));for(const i of n)S(this,Zu)&&C(this,w,$k).call(this,i);await r},jp=function(t,n){var r;const s=new Set(n===void 0?[]:C(this,w,pi).call(this,n));for(const i of C(this,w,pi).call(this,t))if(!s.has(i)){S(this,mn).delete(i),S(this,rn).delete(i),S(this,Er).delete(i);for(const o of((r=S(this,ki).get(i))==null?void 0:r.splice(0))??[])o.resolve();C(this,w,Nf).call(this,{type:"unsubscribe",stream:i})}},$k=function(t){const n=t.startsWith("conversation:")&&Zt(S(this,Ie),"imageRefs");C(this,w,Nf).call(this,{type:"subscribe",stream:t,...n?{images:"ref"}:{}})},Ys=function(t){return S(this,rn).get(t)},Ak=function(){return{protocol:{major:q2.major,minor:S(this,Ie)},...S(this,Yu)===void 0?{}:{version:S(this,Yu)}}},Mk=function(t){const n=C(this,w,Ys).call(this,"settings");return n===void 0?t:{...n.defaultModel===null?{}:{model:n.defaultModel},...n.defaultThinkingLevel===null?{}:{thinkingLevel:n.defaultThinkingLevel}}},Rz=function(t,n){const s=C(this,w,Ys).call(this,"conversations")??[],r=new Map(s.map(o=>[o.id,o.parent]));let i=t;for(let o=0;i!==void 0&&o<8;o++){if(i===n)return!0;i=r.get(i)}return!1},Iz=function(){for(const t of S(this,to))t.phase!=="inFlight"||t.admitted||(t.phase="unknown",C(this,w,xi).call(this,t))},Lz=function(){return S(this,to).filter(t=>t.phase!=="settled").map(t=>({requestId:t.requestId,...t.conversationId===void 0?{}:{conversationId:t.conversationId},text:t.text,whenBusy:t.whenBusy,placement:t.placement,phase:t.phase,images:t.images,...t.imageViews===void 0?{}:{imageViews:t.imageViews},skills:t.skills??[],attachments:t.attachments,...t.attachmentDetails===void 0?{}:{attachmentDetails:t.attachmentDetails},...t.submissionId===void 0?{}:{submissionId:t.submissionId},...t.entry===void 0?{}:{entry:t.entry},...t.error===void 0?{}:{error:t.error}}))},gn=function(){C(this,w,Js).call(this)},Oz=function(t){C(this,w,xi).call(this,t),t.timer=setTimeout(()=>{if(t.timer=void 0,S(this,Oe)||t.phase==="settled"||t.admitted)return;t.phase==="inFlight"&&(t.phase="unknown");const n=t.timeoutResolve;t.timeoutResolve=void 0,C(this,w,gn).call(this),n==null||n()},mne)},Sp=function(t){C(this,w,Oz).call(this,t);let n;const s=new Promise(r=>{n=r});return t.timeoutResolve=n,s},xi=function(t){const n=t.timeoutResolve;t.timeoutResolve=void 0,t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0),n==null||n()},Cp=function(t){return t.phase==="settled"},Qs=function(t){C(this,w,Cp).call(this,t)||(t.phase="settled",t.error=void 0,C(this,w,xi).call(this,t))},Dz=function(t){if(t===void 0)return[];const n=S(this,rn).get(ol(t));return(n==null?void 0:n.entries)??[]},Ep=function(t){return t.entry===void 0?!1:C(this,w,Dz).call(this,t.conversationId).some(n=>String(n.id)===String(t.entry))},$p=function(t){if(t.conversationId===void 0||t.submissionId===void 0)return!1;const n=S(this,rn).get(cf("pi.inbox",t.conversationId));return((n==null?void 0:n.items)??[]).some(s=>String(s.id)===String(t.submissionId))},eu=function(t,n){t.admitted=!0,t.submissionId=n.submissionId,t.error=void 0,C(this,w,xi).call(this,t),n.entry!==void 0&&(t.entry=n.entry),t.entry!==void 0?C(this,w,Ep).call(this,t)||n.status==="done"?C(this,w,Qs).call(this,t):t.phase="inFlight":C(this,w,$p).call(this,t)?C(this,w,Qs).call(this,t):n.status==="placed"||n.status==="done"||n.status==="unanswered"?C(this,w,Qs).call(this,t):t.phase="inFlight",C(this,w,gn).call(this)},Bz=function(){for(const t of S(this,to))if(!(t.phase==="settled"||t.submissionId===void 0)){if(C(this,w,Ep).call(this,t)||C(this,w,$p).call(this,t)){C(this,w,Qs).call(this,t);continue}if(t.conversationId!==void 0&&t.submissionId!==void 0&&t.admitted&&(t.entry!==void 0||!C(this,w,$p).call(this,t))){const n=ol(t.conversationId),s=(S(this,so).get(n)??0)+(S(this,so).get(cf("pi.inbox",t.conversationId))??0);S(this,Er).has(n)&&t.checkedVersion!==s&&(t.checkedVersion=s,C(this,w,Tk).call(this,t))}}},Ap=function(t,n=!1){if(!Fe(S(this,Ie),"submission"))return Promise.reject(new Error("The host is too old for submission receipts (needs protocol 5.25); run `pinomad upgrade` on the host"));if(t.conversationId===void 0)return Promise.reject(new Error("No conversation selected"));const s={conversationId:t.conversationId,requestId:t.requestId};return n?C(this,w,Ik).call(this,"submission",s):C(this,w,Le).call(this,"submission",s)},Tk=async function(t){if(!(t.confirming||t.phase==="settled"||!Fe(S(this,Ie),"submission"))){t.confirming=!0;try{const n=await C(this,w,Ap).call(this,t);if(S(this,Oe)||C(this,w,Cp).call(this,t))return;n!==null?C(this,w,eu).call(this,t,n):t.admitted&&t.entry===void 0&&(C(this,w,Qs).call(this,t),C(this,w,gn).call(this))}catch{}finally{t.confirming=!1}}},zk=function(t){const n=t.conversationId;if(n===void 0)throw new Error("No conversation selected");return{conversationId:n,text:t.text,whenBusy:t.whenBusy,requestId:t.requestId,...t.images.length===0?{}:{images:t.images},...C(this,w,Rk).call(this,t.skills),...t.attachments.length===0?{}:{attachments:t.attachments}}},Hz=function(t){if(t.images.length>0&&!Zt(S(this,Ie),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(F9(t.images)&&!Zt(S(this,Ie),"imageRefs"))throw new Error("The host is too old for image refs (needs protocol 5.15); run `pinomad upgrade` on the host");if(t.attachments.length>Ti)throw new Error("At most "+Ti+" attachments per message");if(t.attachments.length>0&&!Zt(S(this,Ie),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")},qz=function(t,n){S(this,Oe)||(C(this,w,xi).call(this,t),t.admitted=!0,t.submissionId=n.submissionId,n.entry!==void 0&&(t.entry=n.entry),Zt(S(this,Ie),"submitEntry")?t.entry!==void 0?(t.phase="inFlight",C(this,w,Ep).call(this,t)&&C(this,w,Qs).call(this,t)):(t.phase="inFlight",t.conversationId!==void 0&&(t.checkedVersion=(S(this,so).get(ol(t.conversationId))??0)+(S(this,so).get(cf("pi.inbox",t.conversationId))??0)),C(this,w,Tk).call(this,t)):C(this,w,Qs).call(this,t),C(this,w,gn).call(this))},Pz=function(t,n){S(this,Oe)||(C(this,w,xi).call(this,t),n instanceof Pn||n instanceof Error&&n.message==="Not connected to the host"?t.phase="unknown":(t.phase="failed",t.error=n instanceof Error?n.message:String(n)),C(this,w,gn).call(this))},Mp=async function(t,n,s){if(t.phase==="settled"||S(this,Oe))return;if(s!==void 0&&t.timer===void 0){t.phase!=="failed"&&(t.phase="unknown",C(this,w,gn).call(this));return}t.phase="inFlight",t.error=void 0;const r=n?C(this,w,Ik).call(this,"submit",C(this,w,zk).call(this,t)):C(this,w,Le).call(this,"submit",C(this,w,zk).call(this,t)),i=s??C(this,w,Sp).call(this,t);C(this,w,gn).call(this);const o=(async()=>{try{const l=await r;C(this,w,qz).call(this,t,l)}catch(l){C(this,w,Pz).call(this,t,l)}})();await Promise.race([o,i])},Uz=async function(t){if(!(t.phase==="settled"||S(this,Oe))){try{C(this,w,Hz).call(this,t)}catch(n){if(S(this,Oe))return;t.phase="failed",t.error=n instanceof Error?n.message:String(n),C(this,w,gn).call(this);return}if(!t.fixed){const n=S(this,an);if(n===void 0){t.phase="failed",t.error="No conversation selected",C(this,w,gn).call(this);return}t.conversationId=n,t.fixed=!0}await C(this,w,Mp).call(this,t,!1)}},Fz=async function(){const t=S(this,to).filter(n=>n.phase==="unknown");S(this,os)===void 0&&t.some(n=>n.fixed)&&Fe(S(this,Ie),"submission")&&G(this,os,{entries:[]});for(const n of t)if(!(S(this,Oe)||n.phase!=="unknown"||!n.fixed))try{if(!Fe(S(this,Ie),"submission"))continue;const s=C(this,w,Sp).call(this,n),r=await C(this,w,Nk).call(this,n,!0,s);if(r==="deadline")continue;if(r!==null){C(this,w,eu).call(this,n,r);continue}if(n.phase!=="unknown"||n.timer===void 0)continue;await C(this,w,Mp).call(this,n,!0,s)}catch(s){if(S(this,Oe)||(C(this,w,xi).call(this,n),n.phase="unknown",C(this,w,gn).call(this),s instanceof Pn||s instanceof Error&&s.message==="Not connected to the host"))return}},Rf=function(t,n=t.images){return{text:t.text,whenBusy:t.whenBusy,images:n,skills:t.skills??[],attachments:t.attachments,...t.attachmentDetails===void 0?{}:{attachmentDetails:t.attachmentDetails}}},Vz=async function(t){const n=t.imageViews??t.images,s=[];for(const r of n)if("data"in r)s.push(r);else{const i=await C(this,w,Le).call(this,"image",{ref:r.ref});s.push({data:i.data,mimeType:i.mimeType})}return s},Nk=async function(t,n,s){const r=C(this,w,Ap).call(this,t,n),i=await Promise.race([r.then(o=>({kind:"found",found:o}),o=>({kind:"error",error:o})),s.then(()=>({kind:"deadline"}))]);if(i.kind==="deadline")return r.then(o=>{S(this,Oe)||o===null||t.phase==="settled"||C(this,w,eu).call(this,t,o)},()=>{}),"deadline";if(i.kind==="error")throw i.error;return i.found},Gz=async function(t){if(t.phase!=="unknown"&&t.phase!=="failed")return;const n=C(this,w,Sp).call(this,t);try{if(t.phase==="unknown"&&Fe(S(this,Ie),"submission")){const s=await C(this,w,Nk).call(this,t,!1,n);if(s==="deadline")return;if(s!==null){C(this,w,eu).call(this,t,s);return}if(t.phase!=="unknown"||t.timer===void 0)return}await C(this,w,Mp).call(this,t,!1,n)}catch(s){if(S(this,Oe))return;if(C(this,w,xi).call(this,t),s instanceof Pn||s instanceof Error&&s.message==="Not connected to the host"){t.phase="unknown",t.error=void 0,C(this,w,gn).call(this);return}throw t.phase="failed",t.error=s instanceof Error?s.message:String(s),C(this,w,gn).call(this),s}},Wz=async function(t){let n;const s=async()=>{if(n!==void 0)return n;try{return n=await C(this,w,Vz).call(this,t),n}catch{throw new Error("Couldn't load the original images — try again")}};if(t.phase==="queued"||t.phase==="failed"){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,gn).call(this),C(this,w,Rf).call(this,t,l)}if(t.phase!=="unknown"&&!(t.phase==="inFlight"&&t.submissionId!==void 0)||!Fe(S(this,Ie),"submission"))return;const r=await C(this,w,Ap).call(this,t);if(r===null){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,gn).call(this),C(this,w,Rf).call(this,t,l)}if(C(this,w,eu).call(this,t,r),C(this,w,Cp).call(this,t)||r.status==="placed"||r.status==="done"||r.entry!==void 0)return;if(r.status==="unanswered"){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,gn).call(this),C(this,w,Rf).call(this,t,l)}if(t.conversationId===void 0)return;const i=await s(),{outcome:o}=await C(this,w,Le).call(this,"withdrawQueued",{conversationId:t.conversationId,submissionId:r.submissionId});if(o==="sent"){C(this,w,Qs).call(this,t),C(this,w,gn).call(this);return}return C(this,w,Qs).call(this,t),C(this,w,gn).call(this),C(this,w,Rf).call(this,t,i)},_k=function(t){return S(this,Hu).flatMap(n=>{const s=cf(n.kind,t);return S(this,rn).has(s)?[{kind:n.kind,presentation:n.presentation,value:S(this,rn).get(s)}]:[]})},Js=function(){var c;if(S(this,Vt)===void 0)return;C(this,w,Bz).call(this);const t=S(this,an),n=S(this,as),s=t===void 0?void 0:S(this,rn).get(ol(t)),r=C(this,w,Ys).call(this,"conversations")??[],i=C(this,w,Ys).call(this,"index")??{projects:[],conversations:[]},o=((c=C(this,w,Ys).call(this,"devices"))==null?void 0:c.devices)??[],l=S(this,mn).has("tasks")?S(this,rn).get("tasks"):void 0;C(this,w,Un).call(this,{conversation:s,models:C(this,w,Ys).call(this,"models")??S(this,Y1),organized:cK(i,r),home:t===void 0?void 0:dK(i,r,t),checkout:t===void 0?void 0:uK(i,r,t),tasks:l,docs:t===void 0?[]:C(this,w,_k).call(this,t),submissions:C(this,w,Lz).call(this),side:n===void 0?void 0:{id:n,conversation:S(this,rn).get(ol(n)),docs:C(this,w,_k).call(this,n)},devices:o,mcp:C(this,w,Ys).call(this,"mcp")??null,auth:C(this,w,Ys).call(this,"auth")??null,providers:C(this,w,Ys).call(this,"providers")??null,settings:C(this,w,Ys).call(this,"settings")??null,agents:C(this,w,Ys).call(this,"agents")??null,defaults:C(this,w,Mk).call(this,S(this,Q1))})},Un=function(t){S(this,Vt)!==void 0&&(G(this,Vt,{...S(this,Vt),...t}),!S(this,Ju)&&(G(this,Ju,!0),queueMicrotask(()=>{G(this,Ju,!1);for(const n of S(this,Bu))n()})))},Rk=function(t){return t===void 0||!Zt(S(this,Ie),"boundSkills")?{}:{skills:t}},gi=function(t,n){S(this,Vt)!==void 0&&C(this,w,Un).call(this,{notices:[...S(this,Vt).notices,{id:Cn(this,Jx)._++,level:t,message:n}].slice(-20)})},vl=function(){if(!Fe(S(this,Ie),"beginLogin"))throw new Error("The host is too old for this (needs protocol 5.21); run `pinomad upgrade` on the host")},Le=function(t,n){var r,i;const s=S(this,jt);if(s!==void 0||S(this,os)!==void 0){const o=Cn(this,Ei)._++,l={type:"call",id:o,method:t,args:n},c=(s==null?void 0:s.entries)??S(this,os).entries;return new Promise((u,d)=>{c.push({id:o,frame:l,resolve:u,reject:d})})}return((r=S(this,Ee))==null?void 0:r.phase)!=="ready"||((i=S(this,Vt))==null?void 0:i.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,w,Lk).call(this,S(this,Ee),Cn(this,Ei)._++,t,n)},Ik=function(t,n){var s,r;return((s=S(this,Ee))==null?void 0:s.phase)!=="ready"||((r=S(this,Vt))==null?void 0:r.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,w,Lk).call(this,S(this,Ee),Cn(this,Ei)._++,t,n)},Lk=function(t,n,s,r){return!C(this,w,bs).call(this,t)||t.phase!=="ready"||t.connection===void 0?Promise.reject(new Error("Not connected to the host")):new Promise((i,o)=>{S(this,is).set(n,{resolve:i,reject:o});try{t.connection.send(JSON.stringify({type:"call",id:n,method:s,args:r}))}catch(l){S(this,is).delete(n),o(As(l))}})},Tn=function(t){return G(this,fa,S(this,fa).then(t).then(()=>{},n=>C(this,w,gi).call(this,"error",n instanceof Error?n.message:String(n)))),S(this,fa)},sn=function(t){const n=S(this,fa).then(t);return G(this,fa,n.then(()=>{},()=>{})),n},Kz=function(){return{current:()=>S(this,Vt),subscribe:t=>(S(this,Bu).add(t),()=>S(this,Bu).delete(t))}},Xz=function(){const t=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,"0")).join(""),n=()=>{if(S(this,an)===void 0)throw new Error("No conversation selected");return S(this,an)};return{addProject:s=>C(this,w,sn).call(this,()=>C(this,w,Le).call(this,"addProject",{path:s})),listFolders:s=>C(this,w,sn).call(this,()=>{if(!Fe(S(this,Ie),"listFolders"))throw new Error("The host is too old for this (needs protocol 5.3); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"listFolders",s===void 0?{}:{path:s})}),removeProject:s=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"removeProject",{path:s})),renameConversation:(s,r)=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"renameConversation"))throw new Error("The host is too old for this (needs protocol 5.4); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"renameConversation",{conversationId:s,title:r})}),createConversation:(s,r,i)=>C(this,w,Tn).call(this,async()=>{const o=(i==null?void 0:i.images)??[];if(o.length>0&&!Zt(S(this,Ie),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(F9(o)&&!Zt(S(this,Ie),"imageRefs"))throw new Error("The host is too old for image refs (needs protocol 5.15); run `pinomad upgrade` on the host");const l=(i==null?void 0:i.attachments)??[];if(l.length>Ti)throw new Error(`At most ${Ti} attachments per message`);if(l.length>0&&!Zt(S(this,Ie),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host");if((i==null?void 0:i.agent)!==void 0&&!Zt(S(this,Ie),"agentConversations"))throw new Error("The host is too old for named agents (needs protocol 5.10); run `pinomad upgrade` on the host");const{conversationId:c}=await C(this,w,Le).call(this,"createConversation",{home:s,text:r,requestId:t(),...(i==null?void 0:i.checkout)===void 0?{}:{checkout:i.checkout},...(i==null?void 0:i.model)===void 0?{}:{model:i.model},...(i==null?void 0:i.thinkingLevel)===void 0?{}:{thinkingLevel:i.thinkingLevel},...(i==null?void 0:i.agent)===void 0?{}:{agent:i.agent},...o.length===0?{}:{images:o},...C(this,w,Rk).call(this,i==null?void 0:i.skills),...l.length===0?{}:{attachments:l}});await C(this,w,Tp).call(this,c)}),archive:(s,r)=>C(this,w,Tn).call(this,async()=>{await C(this,w,Le).call(this,"archive",{conversationId:s,archived:r}),r&&s===S(this,an)&&C(this,w,zp).call(this),r&&S(this,as)!==void 0&&C(this,w,Rz).call(this,S(this,as),s)&&await C(this,w,If).call(this,void 0)}),submit:(s,r,i)=>{const o=(i==null?void 0:i.requestId)??t();if(S(this,Xl).has(o))return Promise.resolve();const l=(i==null?void 0:i.target)??S(this,an),c=l===void 0?void 0:S(this,rn).get(ol(l)),u={requestId:o,text:s,whenBusy:r,placement:c!==void 0&&O1(c)?"queue":"conversation",images:(i==null?void 0:i.images)??[],...(i==null?void 0:i.imageViews)===void 0?{}:{imageViews:i.imageViews},...(i==null?void 0:i.skills)===void 0?{}:{skills:i.skills},attachments:(i==null?void 0:i.attachments)??[],...(i==null?void 0:i.attachmentDetails)===void 0?{}:{attachmentDetails:i.attachmentDetails},phase:"queued",...l===void 0?{}:{conversationId:l},fixed:(i==null?void 0:i.target)!==void 0,admitted:!1,confirming:!1};return S(this,Xl).set(o,u),S(this,to).push(u),C(this,w,gn).call(this),C(this,w,sn).call(this,()=>C(this,w,Uz).call(this,u)).then(()=>{},()=>{})},retrySubmission:s=>{const r=S(this,Xl).get(s);return r===void 0||S(this,no).has(s)?Promise.resolve():(S(this,no).add(s),C(this,w,sn).call(this,()=>C(this,w,Gz).call(this,r)).finally(()=>S(this,no).delete(s)))},takeBackSubmission:s=>{const r=S(this,Xl).get(s);return r===void 0||S(this,no).has(s)?Promise.resolve(void 0):(S(this,no).add(s),C(this,w,sn).call(this,()=>C(this,w,Wz).call(this,r)).finally(()=>S(this,no).delete(s)))},compact:s=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"compact",{conversationId:n(),...s===void 0?{}:{instructions:s}})),runCommand:(s,r,i)=>C(this,w,Tn).call(this,()=>{if(!Fe(S(this,Ie),"runCommand"))throw new Error("The host is too old for this (needs protocol 5.17); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"runCommand",{conversationId:i??n(),name:s,...r===void 0?{}:{args:r}})}),abort:s=>{const r=s??S(this,an);return r===void 0?(C(this,w,gi).call(this,"error","No conversation selected"),Promise.resolve()):C(this,w,Le).call(this,"abort",{conversationId:r}).then(()=>{},i=>C(this,w,gi).call(this,"error",i instanceof Error?i.message:String(i)))},withdrawQueued:(s,r)=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"withdrawQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:i}=await C(this,w,Le).call(this,"withdrawQueued",{conversationId:r??n(),submissionId:s});return i}),steerQueued:(s,r)=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"steerQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:i}=await C(this,w,Le).call(this,"steerQueued",{conversationId:r??n(),submissionId:s});return i}),setThinkingLevel:s=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"setThinkingLevel",{conversationId:n(),level:s})),setModel:s=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"setModel",{conversationId:n(),model:s})),setAgent:s=>C(this,w,Tn).call(this,()=>{if(!Fe(S(this,Ie),"setAgent"))throw new Error("The host is too old for this (needs protocol 5.18); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"setAgent",{conversationId:n(),agent:s})}),toggleTasks:()=>C(this,w,Tn).call(this,async()=>{if(S(this,mn).delete("tasks")){C(this,w,Nf).call(this,{type:"unsubscribe",stream:"tasks"}),S(this,rn).delete("tasks"),C(this,w,Js).call(this);return}S(this,mn).add("tasks");const s=C(this,w,_f).call(this,"tasks");C(this,w,Nf).call(this,{type:"subscribe",stream:"tasks"}),await s}),switchConversation:s=>C(this,w,Tn).call(this,()=>C(this,w,Tp).call(this,s)),showSide:s=>C(this,w,Tn).call(this,()=>C(this,w,If).call(this,s)),clearConversation:()=>C(this,w,Tn).call(this,()=>C(this,w,Zz).call(this)),fork:(s,r,i,o)=>C(this,w,Tn).call(this,async()=>{const{conversationId:l}=await C(this,w,Le).call(this,"fork",{conversationId:n(),entryId:s,...i===void 0?{}:{removeTools:i}});(o==null?void 0:o.show)==="side"?await C(this,w,If).call(this,l):await C(this,w,Tp).call(this,l),await C(this,w,Le).call(this,"submit",{conversationId:l,text:r,whenBusy:"followUp",requestId:t()})}),answer:(s,r,i,o)=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"answer",{conversationId:o??n(),kind:s,requestId:r,answers:i})),changes:()=>C(this,w,sn).call(this,()=>C(this,w,Le).call(this,"changes",{conversationId:n()})),listFiles:(s,r)=>Fe(S(this,Ie),"listFiles")?C(this,w,Le).call(this,"listFiles",{scope:s,query:r}):Promise.reject(new Error("The host is too old for this (needs protocol 5.10); run `pinomad upgrade` on the host")),beginAttachment:(s,r)=>Fe(S(this,Ie),"beginAttachment")?C(this,w,Le).call(this,"beginAttachment",{name:s,size:r}).then(({attachmentId:i})=>i):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),appendAttachment:(s,r,i)=>Fe(S(this,Ie),"appendAttachment")?C(this,w,Le).call(this,"appendAttachment",{attachmentId:s,offset:r,data:i}):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),image:(s,r="original")=>{if(!Fe(S(this,Ie),"image"))return Promise.reject(new Error("The host is too old for this (needs protocol 5.15); run `pinomad upgrade` on the host"));const i=r!=="original"&&Zt(S(this,Ie),"imageVariants");return C(this,w,Le).call(this,"image",{ref:s,...i?{variant:r}:{}})},listSkills:s=>Fe(S(this,Ie),"listSkills")?C(this,w,Le).call(this,"listSkills",{scope:s}):Promise.reject(new Error("The host is too old for this (needs protocol 5.13); run `pinomad upgrade` on the host")),listCommands:s=>Fe(S(this,Ie),"listCommands")?C(this,w,Le).call(this,"listCommands",{conversationId:s}):Promise.reject(new Error("The host is too old for this (needs protocol 5.17); run `pinomad upgrade` on the host")),createPairing:()=>C(this,w,sn).call(this,()=>C(this,w,Le).call(this,"createPairing",{})),revokeDevice:s=>C(this,w,Tn).call(this,()=>C(this,w,Le).call(this,"revokeDevice",{publicKey:s})),logout:s=>C(this,w,Tn).call(this,()=>{if(!Fe(S(this,Ie),"logout"))throw new Error("The host is too old for this (needs protocol 5.1); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"logout",{providerId:s})}),beginLogin:(s,r)=>C(this,w,sn).call(this,async()=>(C(this,w,vl).call(this),(await C(this,w,Le).call(this,"beginLogin",{providerId:s,method:r})).loginId)),answerLogin:(s,r,i)=>C(this,w,sn).call(this,async()=>{C(this,w,vl).call(this),await C(this,w,Le).call(this,"answerLogin",{loginId:s,promptId:r,value:i})}),cancelLogin:s=>C(this,w,sn).call(this,async()=>{C(this,w,vl).call(this),await C(this,w,Le).call(this,"cancelLogin",{loginId:s})}),saveCustomProvider:(s,r)=>C(this,w,sn).call(this,async()=>{C(this,w,vl).call(this),await C(this,w,Le).call(this,"saveCustomProvider",r===void 0?{provider:s}:{provider:s,apiKey:r})}),removeCustomProvider:s=>C(this,w,sn).call(this,async()=>{C(this,w,vl).call(this),await C(this,w,Le).call(this,"removeCustomProvider",{providerId:s})}),listEndpointModels:async s=>(C(this,w,vl).call(this),(await C(this,w,Le).call(this,"listEndpointModels",s)).models),updateSettings:s=>C(this,w,Tn).call(this,()=>{if(!Fe(S(this,Ie),"updateSettings"))throw new Error("The host is too old for this (needs protocol 5.2); run `pinomad upgrade` on the host");if(s.acceptAccountDevices!==void 0&&!Zt(S(this,Ie),"acceptAccountDevices"))throw new Error("The host is too old for this (needs protocol 5.8); run `pinomad upgrade` on the host");if(s.hostName!==void 0&&!Zt(S(this,Ie),"hostName"))throw new Error("The host is too old for this (needs protocol 5.12); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"updateSettings",{patch:s})}),createAgent:s=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"createAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"createAgent",{role:s})}),updateAgent:s=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"updateAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"updateAgent",{role:s})}),deleteAgent:s=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"deleteAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"deleteAgent",{name:s})}),setPushToken:s=>C(this,w,sn).call(this,async()=>{if(!Fe(S(this,Ie),"setPushToken"))throw new Error("The host is too old for this (needs protocol 5.7); run `pinomad upgrade` on the host");if(s!==null&&typeof s!="string"&&!Zt(S(this,Ie),"apnsPush"))throw new Error("The host is too old for this (needs protocol 5.9); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"setPushToken",{token:s})})}},Tp=async function(t){const n=S(this,an);t!==n&&(await C(this,w,Ek).call(this,t),G(this,an,t),n!==void 0&&C(this,w,jp).call(this,n,S(this,as)),C(this,w,Js).call(this))},zp=function(){const t=S(this,an);t!==void 0&&(G(this,an,void 0),C(this,w,jp).call(this,t,S(this,as)),C(this,w,Js).call(this))},Zz=async function(){C(this,w,zp).call(this),await C(this,w,If).call(this,void 0)},If=async function(t){const n=S(this,as);t!==n&&(t!==void 0&&await C(this,w,Ek).call(this,t),G(this,as,t),n!==void 0&&C(this,w,jp).call(this,n,S(this,an)),C(this,w,Js).call(this))},Yz=function(){S(this,Oe)||(G(this,Oe,!0),C(this,w,Zo).call(this),C(this,w,wp).call(this),C(this,w,Yo).call(this),C(this,w,Xo).call(this),C(this,w,fl).call(this),C(this,w,hl).call(this,new Pn),C(this,w,Un).call(this,{connection:"closed"}))};const Np={width:"var(--spacing-4)",height:"var(--spacing-4)"},Ok=e=>e instanceof Error?e.message:String(e),Qz=e=>void window.open(e,"_blank","noopener,noreferrer");function wne({providerId:e,method:t,logins:n,remote:s,connected:r,intro:i,signIn:o,onDone:l,onCancel:c}){const[u,d]=p.useState(),[f,h]=p.useState(!1),[x,g]=p.useState(!1),[y,v]=p.useState(),m=u===void 0?void 0:n.find(N=>N.id===u),k=p.useRef(void 0),b=p.useRef(0),j=p.useRef(!1),A=()=>{const N=++b.current;h(!0),g(!1),v(void 0),s.controller.beginLogin(e,t).then(H=>{if(N!==b.current){s.controller.cancelLogin(H).catch(()=>{});return}k.current=H,d(H),h(!1)},H=>{N===b.current&&(g(H instanceof Pn),v(Ok(H)),h(!1))})};p.useEffect(()=>(j.current=!0,t==="api_key"&&b.current===0&&A(),()=>{j.current=!1,queueMicrotask(()=>{if(j.current)return;b.current++;const N=k.current;k.current=void 0,N!==void 0&&s.controller.cancelLogin(N).catch(()=>{})})}),[]);const M=x&&!f&&u===void 0?n.find(N=>N.providerId===e&&N.method===t&&N.state==="running"):void 0;p.useEffect(()=>{M!==void 0&&(k.current=M.id,d(M.id),v(void 0))},[M==null?void 0:M.id]);const E=p.useRef(!1);m!==void 0&&(E.current=!0);const z=u!==void 0&&m===void 0&&E.current;p.useEffect(()=>{z&&(k.current=void 0,c())},[z]);const T=m==null?void 0:m.state;p.useEffect(()=>{T===void 0||T==="running"||(k.current=void 0,T==="succeeded"?l():T==="cancelled"&&c())},[T]);const[$,_]=p.useState(),R=()=>{const N=k.current;if(N===void 0)return c();k.current=void 0,_(void 0),s.controller.cancelLogin(N).then(c,H=>{k.current=N,_(Ok(H))})};return u===void 0?t==="api_key"&&y===void 0?a.jsx(A0,{label:"Starting…"}):a.jsxs(le,{gap:3,children:[i,y===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't start the login",description:y}),a.jsxs(ye,{gap:2,wrap:"wrap",children:[a.jsx(Q,{label:t==="api_key"?"Try again":o??"Sign in",variant:"primary",isLoading:f,isDisabled:!r,onClick:A}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:c})]})]}):m===void 0?a.jsx(A0,{label:"Starting…"}):m.state==="failed"?a.jsx(Pe,{status:"error",title:t==="api_key"?"The key wasn't saved":"Sign-in failed",description:m.error,endContent:a.jsx(Q,{label:"Try again",size:"sm",isDisabled:!r,isLoading:f,onClick:A})}):m.state!=="running"?a.jsx(A0,{label:m.state==="succeeded"?"Saved":"Cancelled"}):a.jsxs(le,{gap:4,children:[a.jsx(Cne,{events:m.events}),m.prompt===void 0?a.jsxs(le,{gap:3,children:[a.jsx(A0,{label:jne(m.events)}),a.jsx(Sne,{error:$,onCancel:R})]}):a.jsx(Mne,{prompt:m.prompt,connected:r,onAnswer:N=>s.controller.answerLogin(m.id,m.prompt.id,N),cancelError:$,onCancel:R},m.prompt.id)]})}const jne=e=>{const t=e.findLast(n=>n.type==="progress"||n.type==="device_code");return(t==null?void 0:t.type)==="progress"?t.message:(t==null?void 0:t.type)==="device_code"?"Waiting for you to approve…":"Working…"};function A0({label:e}){return a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Jt,{size:"sm"}),a.jsx(Y,{type:"supporting",role:"status",children:e})]})}function Sne({error:e,onCancel:t}){return a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:t}),e===void 0?null:a.jsx(D1,{message:e})]})}function D1({message:e}){return a.jsx(Y,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:e})}function Cne({events:e}){const t=e.findLastIndex(r=>r.type==="auth_url"),n=e.findLastIndex(r=>r.type==="device_code"),s=e.map((r,i)=>({event:r,index:i})).filter(({event:r,index:i})=>r.type==="info"||r.type==="auth_url"&&i===t||r.type==="device_code"&&i===n);return s.length===0?null:a.jsx(le,{gap:4,children:s.map(({event:r,index:i})=>a.jsx(Ene,{event:r},i))})}function Ene({event:e}){switch(e.type){case"info":return a.jsxs(le,{gap:1,children:[a.jsx(Y,{as:"p",type:"supporting",children:e.message}),e.links===void 0||e.links.length===0?null:a.jsx(ye,{gap:3,wrap:"wrap",children:e.links.map(t=>a.jsx(Sg,{href:t.url,isExternalLink:!0,children:t.label??t.url},t.url))})]});case"auth_url":return a.jsxs(le,{gap:2,children:[a.jsx(Y,{as:"p",children:e.instructions??"Open the sign-in page and approve access."}),a.jsx(ye,{gap:2,children:a.jsx(Q,{label:"Open sign-in page",icon:a.jsx(lT,{"aria-hidden":"true",style:Np}),size:"sm",onClick:()=>Qz(e.url)})})]});case"device_code":return a.jsx(Ane,{code:e.userCode,url:e.verificationUri});case"progress":return null}}const $ne=e=>{try{const t=new URL(e);return{host:t.host,display:`${t.host}${t.pathname==="/"?"":t.pathname}`}}catch{return{host:e,display:e}}};function Ane({code:e,url:t}){const[n,s]=p.useState(!1),{host:r,display:i}=$ne(t);return a.jsxs("ol",{className:"providers-steps",children:[a.jsx("li",{children:a.jsxs(le,{gap:2,children:[a.jsx(Y,{children:"Copy this code."}),a.jsxs(ye,{gap:3,vAlign:"center",wrap:"wrap",children:[a.jsx("span",{className:"providers-code",children:e}),a.jsx(Q,{label:n?"Copied":"Copy",size:"sm",icon:n?a.jsx(ea,{"aria-hidden":"true",style:Np}):a.jsx($3,{"aria-hidden":"true",style:Np}),onClick:()=>{var o;(o=navigator.clipboard)==null||o.writeText(e).then(()=>s(!0),()=>{})}})]})]})}),a.jsx("li",{children:a.jsxs(le,{gap:2,children:[a.jsxs(Y,{children:["Enter it at ",a.jsx("span",{className:"providers-mono",children:i})]}),a.jsx(ye,{gap:2,children:a.jsx(Q,{label:`Open ${r}`,icon:a.jsx(lT,{"aria-hidden":"true",style:Np}),size:"sm",onClick:()=>Qz(t)})})]})})]})}const V9=e=>e.message.replace(/:\s*$/,"");function Mne({prompt:e,connected:t,onAnswer:n,cancelError:s,onCancel:r}){var y;const[i,o]=p.useState(e.type==="select"?((y=e.options[0])==null?void 0:y.id)??"":""),[l,c]=p.useState(!1),[u,d]=p.useState(),f=e.type==="secret"||e.type==="manual_code"||e.type==="select",h=t&&!l&&(!f||i.trim()!==""),x=v=>{v.preventDefault(),h&&(c(!0),d(void 0),n(e.type==="text"?i:i.trim()).catch(m=>{d(Ok(m)),c(!1)}))},g=u===void 0?void 0:{type:"error",message:u};return a.jsx("form",{onSubmit:x,autoComplete:"off",children:a.jsxs(le,{gap:3,children:[e.type==="select"?a.jsx(n4,{label:V9(e),value:i,onChange:o,isDisabled:!t,status:g,children:e.options.map(v=>a.jsx(Qp,{value:v.id,label:v.label,description:v.description},v.id))}):a.jsx(lt,{label:V9(e),type:e.type==="secret"?"password":"text",value:i,onChange:v=>{o(v),d(void 0)},placeholder:e.placeholder,hasAutoFocus:!0,isDisabled:!t,status:g,width:"100%"}),a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsx(Q,{label:"Continue",variant:"primary",type:"submit",isLoading:l,isDisabled:!h}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:r}),s===void 0?null:a.jsx(D1,{message:s})]})]})})}const Tne={"openai-completions":"OpenAI Chat Completions","openai-responses":"OpenAI Responses","anthropic-messages":"Anthropic Messages","google-generative-ai":"Google Gemini"},Y2=e=>e instanceof Error?e.message:String(e),zne=e=>e.toLowerCase().normalize("NFKD").replace(new RegExp("\\p{M}","gu"),"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Nne=e=>{if(e.trim()==="")return"Enter the base URL";try{const t=new URL(e.trim());if(t.protocol!=="http:"&&t.protocol!=="https:")return"Use an http:// or https:// URL"}catch{return"Enter a full URL, like http://localhost:11434/v1"}},M0=(e,t)=>[...e,...t.filter((n,s)=>!e.includes(n)&&t.indexOf(n)===s)];function _ne({existing:e,providers:t,remote:n,connected:s,onDone:r,onCancel:i,onRemoved:o}){const l=e==null?void 0:e.custom,[c,u]=p.useState((e==null?void 0:e.name)??""),[d,f]=p.useState((l==null?void 0:l.api)??"openai-completions"),[h,x]=p.useState((l==null?void 0:l.baseUrl)??""),[g,y]=p.useState(!1),[v,m]=p.useState(""),[k,b]=p.useState([...(l==null?void 0:l.models)??[]]),[j,A]=p.useState([...(l==null?void 0:l.models)??[]]),[M,E]=p.useState(""),[z,T]=p.useState(!1),[$,_]=p.useState(),[R,N]=p.useState(!1),[H,B]=p.useState(),[I,L]=p.useState(!1),[O,D]=p.useState(!1),[q,F]=p.useState(!1),[K,Z]=p.useState(),se=(e==null?void 0:e.id)??zne(c),ne=Nne(h),ue=$!==void 0?{type:"warning",message:$}:I&&j.length===0?{type:"error",message:"Add at least one model"}:void 0,P=c.trim()===""?I?"Name it so it's recognizable in the model picker":void 0:e!==void 0?void 0:se===""?"Use at least one letter or digit (a–z, 0–9) in the name":t.some(V=>V.id===se)?`“${se}” is already a provider on this host; choose another name`:void 0,U=p.useRef({api:d,baseUrl:h,apiKey:v,checked:j});U.current={api:d,baseUrl:h,apiKey:v,checked:j};const X=p.useRef(0),ie=async V=>{if(y(!0),ne!==void 0)return;const xe=++X.current,ve=U.current,ke=()=>{const me=U.current;return xe===X.current&&me.api===ve.api&&me.baseUrl===ve.baseUrl&&me.apiKey===ve.apiKey};T(!0),_(void 0);try{const me=await n.controller.listEndpointModels({api:d,baseUrl:h.trim(),...v===""?{}:{apiKey:v},...e===void 0?{}:{providerId:e.id}});if(!ke())return;if(me.length===0){V&&_("The endpoint listed no models. Add model IDs by hand.");return}b(pe=>M0(pe,me)),U.current.checked.length===0&&A(M0([],me))}catch(me){V&&ke()&&_(`${Y2(me)} Add model IDs by hand.`)}finally{xe===X.current&&T(!1)}},te=p.useRef(!1);p.useEffect(()=>{e===void 0||!s||te.current||(te.current=!0,ie(!1))},[s]);const de=()=>{const V=M.trim();V!==""&&(b(xe=>M0(xe,[V])),A(xe=>M0(xe,[V])),E(""))},fe=async V=>{if(V.preventDefault(),L(!0),y(!0),!(c.trim()===""||P!==void 0||ne!==void 0||j.length===0)){N(!0),B(void 0);try{await n.controller.saveCustomProvider({id:se,name:c.trim(),api:d,baseUrl:h.trim(),models:k.filter(xe=>j.includes(xe))},v===""?void 0:v),r()}catch(xe){B(Y2(xe)),N(!1)}}},he=async V=>{F(!0),Z(void 0);try{await n.controller.removeCustomProvider(V),o()}catch(xe){Z(Y2(xe)),D(!1),F(!1)}};return a.jsxs("form",{onSubmit:V=>void fe(V),autoComplete:"off",children:[a.jsxs(le,{gap:3,children:[a.jsx(lt,{label:"Name",value:c,onChange:u,placeholder:"Ollama on studio",hasAutoFocus:e===void 0,isDisabled:!s,width:"100%",status:P===void 0?void 0:{type:"error",message:P}}),a.jsx(oc,{label:"API format",options:ZY.map(V=>({value:V,label:Tne[V]})),value:d,onChange:V=>f(V),description:"Ollama, LM Studio, vLLM and most gateways speak OpenAI Chat Completions.",isDisabled:!s,width:"100%"}),a.jsx("div",{onBlur:()=>y(!0),children:a.jsx(lt,{label:"Base URL",value:h,onChange:x,placeholder:"http://localhost:11434/v1",isDisabled:!s,width:"100%",status:g&&ne!==void 0?{type:"error",message:ne}:void 0})}),a.jsx(lt,{label:"API key",type:"password",isOptional:!0,value:v,onChange:m,placeholder:(e==null?void 0:e.stored)===void 0?"Not needed for local servers":"Leave empty to keep the stored key",isDisabled:!s,width:"100%"}),a.jsxs("div",{className:"endpoint-models",children:[a.jsx($C,{label:"Models",description:"Checked models appear in the model picker.",options:k,value:j,onChange:A,placeholder:z?"Fetching models…":"No models yet",hasSearch:!0,hasSelectAll:!0,isLoading:z,isDisabled:!s,width:"100%",status:ue===void 0?void 0:{type:ue.type}}),a.jsx(un,{label:"Fetch models",tooltip:"Fetch models from the endpoint",icon:a.jsx(M3,{}),isLoading:z,isDisabled:!s,onClick:()=>void ie(!0)}),ue===void 0?null:a.jsx("div",{className:"endpoint-models__status",children:a.jsx(lh,{type:ue.type,message:ue.message})}),a.jsx("div",{className:"endpoint-models__add",onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),de())},children:a.jsx(lt,{label:"Add model ID",isLabelHidden:!0,value:M,onChange:E,placeholder:"Add a model ID the endpoint doesn't list",isDisabled:!s,width:"100%"})}),a.jsx(un,{label:"Add model",icon:a.jsx(qx,{}),isDisabled:!s||M.trim()==="",onClick:de})]}),a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[e===void 0?null:a.jsx(Q,{label:"Remove endpoint…",variant:"ghost",isDisabled:!s,onClick:()=>D(!0)}),K===void 0?null:a.jsx(D1,{message:K}),a.jsx("div",{style:{marginInlineStart:"auto"},children:a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[H===void 0?null:a.jsx(D1,{message:H}),a.jsx(Q,{label:"Cancel",variant:"ghost",onClick:i}),a.jsx(Q,{label:e===void 0?"Add endpoint":"Save changes",variant:"primary",type:"submit",isLoading:R,isDisabled:!s})]})})]})]}),e===void 0?null:a.jsx(zC,{isOpen:O,onOpenChange:D,title:`Remove ${e.name}?`,description:"Its models disappear from the model picker, and conversations using them stop.",actionLabel:"Remove endpoint",isActionLoading:q,onAction:()=>void he(e.id)})]})}const qd=e=>{const t=/^(.*?)\s*\((.+)\)\s*$/.exec(e.name);if(t===null)return e.name;const n=t[2].replace(/\s*subscription$/i,"").trim();return n===""?t[1]:n},Jz=e=>{const t=qd(e.oauth);return t===e.name?"Subscription":t},eN=e=>{const t=e.custom;if(t!==void 0)return`${t.models.length} model${t.models.length===1?"":"s"} · ${t.baseUrl}`;const n=e.stored;return n===void 0?`From the host's environment · ${e.ambient??""}`:n.kind==="api_key"?"API key":n.subscription&&e.oauth!==void 0?`${qd(e.oauth)} subscription`:"Signed in"},tN=e=>e.stored!==void 0||e.ambient!==void 0||e.custom!==void 0,_p={at:"home"},Rne=a.jsx(Ro,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)",color:"var(--color-text-secondary)"}});function Ine({view:e,remote:t}){var s;const n=e.connection==="connected";return e.providers!==null?a.jsx(Lne,{providers:e.providers,remote:t,connected:n}):e.auth===null?a.jsx(Pe,{status:"warning",title:"This host is too old for logins",description:"Run `pinomad upgrade` on the host."}):Fe(((s=e.host)==null?void 0:s.protocol.minor)??0,"beginLogin")?a.jsx(Y,{as:"p",type:"supporting",children:"Loading…"}):a.jsxs(le,{gap:3,children:[a.jsx(Pe,{status:"warning",title:"Run `pinomad upgrade` on the host to add providers here"}),e.auth.logins.length===0?a.jsx(Y,{as:"p",type:"supporting",children:"No stored logins."}):e.auth.logins.map(r=>a.jsx(Gne,{login:r,connected:n,remote:t},r.providerId))]})}function Lne({providers:e,remote:t,connected:n}){const[s,r]=p.useState(_p),i=()=>r(_p),o=p.useRef(null),l=p.useRef(!0);p.useEffect(()=>{var f;if(l.current){l.current=!1;return}(f=o.current)==null||f.scrollIntoView({block:"nearest"})},[s]);const c=f=>f===void 0?void 0:e.providers.find(h=>h.id===f),u=(s.at==="provider"||s.at==="custom"&&s.id!==void 0)&&c(s.id)===void 0;p.useEffect(()=>{u&&r(_p)},[u]);let d;switch(u?"home":s.at){case"home":d=a.jsx(One,{providers:e.providers,connected:n,go:r});break;case"subscription":d=a.jsx(Dne,{providers:e.providers,connected:n,onBack:i,onPick:f=>r({at:"provider",id:f,method:"oauth",from:s})});break;case"key":d=a.jsx(Bne,{providers:e.providers,connected:n,onBack:i,onPick:f=>r({at:"provider",id:f,method:"api_key",from:s})});break;case"custom":{const f=s.at==="custom"?c(s.id):void 0;d=a.jsx(q3,{title:f===void 0?"Custom endpoint":`Edit ${f.name}`,onBack:i,children:a.jsx(_ne,{existing:f,providers:e.providers,remote:t,connected:n,onDone:i,onCancel:i,onRemoved:i})});break}case"provider":{const f=s;d=a.jsx(qne,{provider:c(f.id),method:f.method,providers:e,remote:t,connected:n,onBack:()=>r(f.from),onHome:i},`${f.id}:${f.method??"manage"}`);break}}return a.jsx("div",{ref:o,style:{scrollMarginBlockStart:"var(--spacing-6)"},children:d})}function q3({title:e,onBack:t,children:n}){return a.jsxs(le,{gap:4,children:[a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(un,{label:"Back",icon:a.jsx(Qg,{}),variant:"ghost",size:"sm",onClick:t}),a.jsx(ds,{level:3,children:e})]}),n]})}function One({providers:e,connected:t,go:n}){const s=e.filter(tN),r=e.filter(c=>{var u;return((u=c.oauth)==null?void 0:u.subscription)===!0}).slice(0,5),i=e.filter(c=>c.apiKey!==void 0&&c.custom===void 0),o=["google","deepseek","mistral","groq","openrouter"].map(c=>i.find(u=>u.id===c)).filter(c=>c!==void 0),l=o.length>0?o:i.slice(0,5);return a.jsxs(le,{gap:6,children:[s.length>0?a.jsx(Bt,{density:"compact",header:a.jsx(Y,{type:"supporting",weight:"semibold",children:"Connected"}),children:s.map(c=>{var u;return a.jsx(Ye,{label:c.name,description:eN(c),startContent:a.jsx(ra,{providerId:c.id,name:c.name,baseUrl:(u=c.custom)==null?void 0:u.baseUrl}),endContent:Rne,onClick:()=>n(c.custom===void 0?{at:"provider",id:c.id,from:_p}:{at:"custom",id:c.id})},c.id)})}):null,a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",weight:"semibold",children:s.length>0?"Add another":"Connect a model provider"}),a.jsxs("div",{className:"providers-paths",children:[a.jsx(Q2,{title:"Subscription",body:"Use a plan you already pay for.",foot:[...new Set(r.map(c=>qd(c.oauth).split(/[\s/]/)[0]))].join(", "),logos:r.map(c=>a.jsx(ra,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"subscription"})}),a.jsx(Q2,{title:"API key",body:"Pay per token with a key from the provider.",foot:`${i.length} providers`,logos:l.map(c=>a.jsx(ra,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"key"})}),a.jsx(Q2,{title:"Custom endpoint",body:"Your own server or gateway.",foot:"Ollama, LM Studio, vLLM, any OpenAI- or Anthropic-compatible URL",logos:[a.jsx(ra,{providerId:"ollama",name:"Ollama",size:28},"ollama"),a.jsx(ra,{providerId:"lmstudio",name:"LM Studio",size:28},"lmstudio")],disabled:!t,onClick:()=>n({at:"custom"})})]})]})]})}function Q2({title:e,body:t,foot:n,logos:s,disabled:r,onClick:i}){return a.jsxs("button",{type:"button",className:"providers-tile providers-path",onClick:i,disabled:r,children:[a.jsx("span",{className:"providers-logo-stack",children:s}),a.jsxs("span",{className:"providers-path__text",children:[a.jsx("span",{className:"providers-path__title",children:e}),a.jsx("span",{className:"providers-path__body",children:t}),a.jsx("span",{className:"providers-tile__sub",children:n})]})]})}function nN({provider:e,sub:t,connectedBy:n,disabled:s,onClick:r}){var i;return a.jsxs("button",{type:"button",className:"providers-tile",onClick:r,disabled:s,children:[a.jsxs("span",{className:"providers-tile__top",children:[a.jsx(ra,{providerId:e.id,name:e.name,size:36}),((i=e.stored)==null?void 0:i.kind)===n?a.jsx(On,{label:"Connected",color:"green",size:"sm"}):null]}),a.jsx("span",{className:"providers-tile__name",children:e.name}),t===void 0?null:a.jsx("span",{className:"providers-tile__sub",children:t})]})}function Dne({providers:e,connected:t,onBack:n,onPick:s}){const r=e.filter(o=>o.oauth!==void 0),i=[...r.filter(o=>o.oauth.subscription),...r.filter(o=>!o.oauth.subscription)];return a.jsxs(q3,{title:"Sign in with an account",onBack:n,children:[a.jsx(Y,{as:"p",type:"supporting",children:"Use a plan you already pay for. Requests count against the plan instead of per-token billing."}),a.jsx("div",{className:"providers-tiles",children:i.map(o=>a.jsx(nN,{provider:o,sub:o.oauth.subscription?Jz(o):"Account sign-in",connectedBy:"oauth",disabled:!t,onClick:()=>s(o.id)},o.id))})]})}function Bne({providers:e,connected:t,onBack:n,onPick:s}){const[r,i]=p.useState(""),o=e.filter(u=>u.apiKey!==void 0&&u.custom===void 0),l=r.trim().toLowerCase(),c=o.filter(u=>l===""||`${u.name} ${u.id}`.toLowerCase().includes(l));return a.jsxs(q3,{title:"API key",onBack:n,children:[a.jsx(lt,{label:"Filter providers",isLabelHidden:!0,placeholder:`Filter ${o.length} providers`,value:r,onChange:i,hasClear:!0,width:"100%"}),c.length===0?a.jsx(Y,{as:"p",type:"supporting",children:`No provider matches “${r.trim()}”. If it speaks an OpenAI- or Anthropic-compatible API, add it as a custom endpoint.`}):a.jsx("div",{className:"providers-tiles",children:c.map(u=>a.jsx(nN,{provider:u,connectedBy:"api_key",disabled:!t,onClick:()=>s(u.id)},u.id))})]})}const Hne=(e,t)=>{var n;return t==="api_key"?"API key":((n=e.oauth)==null?void 0:n.subscription)===!0?Jz(e):"Account sign-in"};function qne({provider:e,method:t,providers:n,remote:s,connected:r,onBack:i,onHome:o}){var f,h;const l=((f=e.oauth)==null?void 0:f.subscription)===!0||e.apiKey===void 0?"oauth":"api_key",[c,u]=p.useState(t??(tN(e)?void 0:l)),d=t===void 0?()=>u(void 0):i;return a.jsxs(le,{gap:5,children:[a.jsxs(ye,{gap:3,vAlign:"center",children:[a.jsx(un,{label:"Back",icon:a.jsx(Qg,{}),variant:"ghost",size:"sm",onClick:i}),a.jsx(ra,{providerId:e.id,name:e.name,size:40}),a.jsxs(le,{gap:0,style:{minInlineSize:0},children:[a.jsx(ds,{level:3,children:e.name}),a.jsx(Y,{type:"supporting",children:c===void 0?eN(e):Hne(e,c)})]})]}),c===void 0?a.jsx(Fne,{provider:e,remote:s,connected:r,onLogin:u,onRemoved:o}):a.jsxs(le,{gap:4,children:[a.jsx(Une,{provider:e,method:c}),a.jsx(wne,{providerId:e.id,method:c,logins:n.logins,remote:s,connected:r,intro:c==="oauth"?a.jsx(Y,{as:"p",children:Pne(e.oauth)}):void 0,signIn:((h=e.oauth)==null?void 0:h.loginLabel)??(e.oauth===void 0?void 0:`Sign in with ${qd(e.oauth)}`),onDone:o,onCancel:d},c)]})]})}const G9=e=>e.subscription?`Use ${qd(e)} instead`:"Sign in to your account instead",Pne=e=>(e==null?void 0:e.subscription)===!0?`Use your ${qd(e)} plan. Requests count against the plan, not per-token billing.`:"Sign in to your account; there's no key to copy.";function Une({provider:e,method:t}){const n=e.stored;if(n===void 0)return e.ambient===void 0?null:a.jsx(Y,{as:"p",type:"supporting",children:`${e.ambient} is set in the host's environment. A credential saved here takes precedence over it.`});const s=n.kind==="api_key"?"the stored API key":"the stored sign-in";return a.jsx(Y,{as:"p",type:"supporting",children:n.kind===t?`Replaces ${s}.`:`Replaces ${s}; a provider keeps one credential.`})}function Fne({provider:e,remote:t,connected:n,onLogin:s,onRemoved:r}){const[i,o]=p.useState(!1),[l,c]=p.useState(),u=e.stored,d=e.oauth;if(u===void 0)return a.jsxs(le,{gap:3,children:[a.jsx(Y,{as:"p",type:"supporting",children:`Set as ${e.ambient??"an environment variable"} where the host runs. Remove it there, or save a credential here to override it.`}),a.jsxs(ye,{gap:2,wrap:"wrap",children:[e.apiKey===void 0?null:a.jsx(Q,{label:"Save a key here",size:"sm",isDisabled:!n,onClick:()=>s("api_key")}),d===void 0?null:a.jsx(Q,{label:G9(d),variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>s("oauth")})]})]});const f=u.kind==="api_key";if(i)return a.jsxs(le,{gap:2,children:[a.jsx(Y,{as:"p",type:"supporting",children:f?`Removes the key from this host. Conversations using ${e.name} models stop until you add another.`:`Signs this host out of ${e.name}. Conversations using its models stop until you sign in again.`}),a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsx(Q,{label:f?"Remove key":"Log out",variant:"destructive",size:"sm",isDisabled:!n,clickAction:()=>t.controller.logout(e.id).then(r,g=>{c(g instanceof Error?g.message:String(g))})}),a.jsx(Q,{label:"Cancel",variant:"ghost",size:"sm",onClick:()=>o(!1)}),l===void 0?null:a.jsx(D1,{message:l})]})]});const h=f?"oauth":"api_key",x=h==="oauth"?d!==void 0:e.apiKey!==void 0;return a.jsxs(le,{gap:3,children:[e.ambient===void 0?null:a.jsx(Y,{as:"p",type:"supporting",children:`${e.ambient} is also set where the host runs; the stored credential takes precedence.`}),a.jsxs(ye,{gap:2,wrap:"wrap",children:[a.jsx(Q,{label:f?"Replace key":"Sign in again",size:"sm",isDisabled:!n,onClick:()=>s(u.kind)}),a.jsx(Q,{label:f?"Remove key…":"Log out…",variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>o(!0)})]}),x?a.jsx("div",{children:a.jsx(Q,{label:h==="api_key"||d===void 0?"Use an API key instead":G9(d),variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>s(h)})}):null]})}const Vne=e=>e.subscription?"Subscription connected":e.kind==="api_key"?"API key configured":"OAuth connected";function Gne({login:e,connected:t,remote:n}){const[s,r]=p.useState(!1);return a.jsxs(pg,{padding:4,children:[a.jsxs(ye,{gap:3,vAlign:"start",children:[a.jsx(ra,{providerId:e.providerId,name:e.name}),a.jsxs(le,{gap:1,style:{flex:1,minInlineSize:0},children:[a.jsx(ds,{level:3,children:e.name}),a.jsx(Y,{as:"p",type:"supporting",children:Vne(e)})]}),s?null:a.jsx(Cg,{icon:a.jsx(Ch,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!t,items:[{label:"Log out…",onClick:()=>r(!0)}]})]}),s?a.jsxs(le,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[a.jsx(Y,{as:"p",type:"supporting",children:`Removes the stored ${e.name} credential from the host.`}),a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Q,{label:"Log out",variant:"destructive",size:"sm",isDisabled:!t,onClick:()=>void n.controller.logout(e.providerId)}),a.jsx(Q,{label:"Cancel",variant:"ghost",size:"sm",onClick:()=>r(!1)})]})]}):null]})}function sN({update:e}){if(e===void 0)return a.jsx(Y,{type:"supporting",children:"Checking for updates…"});const{status:t}=e;switch(t.state){case"checking":return a.jsx(Y,{type:"supporting",children:"Checking for updates…"});case"available":case"downloading":{const n=t.progressPercent===void 0?"":` ${Math.round(t.progressPercent)}%`;return a.jsx(Y,{type:"supporting",children:`Downloading PiNomad ${t.availableVersion??""}…${n}`})}case"ready":return a.jsx(Q,{label:"Restart to update",variant:"primary",onClick:()=>e.install()});case"error":return a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Y,{type:"supporting",children:t.message}),a.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>e.check()})]});case"disabled":return a.jsx(Y,{type:"supporting",children:t.reason??"Updates are unavailable in this build."});default:return a.jsx(Y,{type:"supporting",children:`PiNomad ${t.currentVersion} is up to date; no newer release found.`})}}function Wne(){const e=z3();return e===void 0?null:a.jsxs(le,{gap:3,children:[a.jsx(Y,{children:`PiNomad ${e.status.currentVersion}`}),e.status.state==="idle"?a.jsx("div",{children:a.jsx(Q,{label:"Check for updates",variant:"secondary",onClick:()=>e.check()})}):a.jsx(sN,{update:e})]})}const Gx=[{id:"hosts",title:"Hosts",icon:R1,group:"device"},{id:"updates",title:"Updates",icon:M3,group:"device"},{id:"providers",title:"Providers",icon:zY,group:"host"},{id:"models",title:"Models",icon:Jg,group:"host"},{id:"agents",title:"Agents",icon:Sh,group:"host"},{id:"mcp",title:"MCP",icon:IY,group:"host"},{id:"chats",title:"Chats",icon:Jv,group:"host"},{id:"devices",title:"Devices",icon:NY,group:"host"},{id:"archived",title:"Archived",icon:mY,group:"host"},{id:"about",title:"About",icon:TY,group:"host"}],rN=e=>Gx.find(t=>t.id===e).title,Kne=e=>{var t;return((t=Gx.find(n=>n.id===e))==null?void 0:t.group)==="host"},W9=e=>a.jsx(e,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}});function Xne({machines:e,initialKey:t,onClose:n}){var A,M;const s=Pa("(max-width: 640px)"),[r,i]=p.useState(void 0),[o,l]=p.useState(t),c=e.find(E=>E.key===o)??e[0],u=c==null?void 0:c.view,d=c==null?void 0:c.remote,f=u!==void 0&&d!==void 0,h=(u==null?void 0:u.connection)==="connected",x=((A=window.pinomadDesktop)==null?void 0:A.updates)!==void 0,g=e.length>1,y=r??(h?"providers":"hosts"),v=((M=u==null?void 0:u.settings)==null?void 0:M.hostName)??(c==null?void 0:c.label)??"This host",m=[{title:"This device",sections:Gx.filter(E=>E.group==="device"&&(E.id!=="updates"||x))},...f||g?[{title:g?"Host":v,sections:Gx.filter(E=>E.group==="host")}]:[]],k=!g||c===void 0?null:a.jsx(oc,{label:"Host",isLabelHidden:!0,size:"sm",variant:"ghost",placement:"below",startIcon:a.jsx(R1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),value:c.key,options:e.map(E=>({value:E.key,label:E.label})),onChange:l}),b=a.jsx(x5,{padding:2,width:"calc(var(--spacing-10) * 7)",hasDivider:!0,children:a.jsx(u4,{"aria-label":"Settings sections",style:{width:"100%"},children:a.jsx(le,{gap:3,children:m.map(E=>{var z;return a.jsxs($g,{title:E.title,children:[((z=E.sections[0])==null?void 0:z.group)==="host"?k:null,E.sections.map(T=>a.jsx(ao,{label:T.title,icon:W9(T.icon),isSelected:T.id===y,onClick:()=>i(T.id)},T.id))]},E.title)})})})}),j=a.jsx(le,{gap:4,children:m.map(E=>{var z;return a.jsxs(le,{gap:1,children:[a.jsx(Y,{type:"supporting",weight:"semibold",children:E.title}),((z=E.sections[0])==null?void 0:z.group)==="host"?k:null,a.jsx(Bt,{density:"compact","aria-label":E.title,children:E.sections.map(T=>a.jsx(Ye,{label:T.title,startContent:W9(T.icon),endContent:a.jsx(Ro,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}}),onClick:()=>i(T.id)},T.id))})]},E.title)})});return a.jsx(mr,{"aria-label":"Settings",isOpen:!0,onOpenChange:E=>E?void 0:n(),purpose:"form",width:"calc(var(--spacing-10) * 22)",maxHeight:"90dvh",variant:s?"fullscreen":"standard",padding:4,children:a.jsx(Hs,{padding:4,style:{height:s?"100dvh":"min(85dvh, calc(var(--spacing-10) * 17))"},header:a.jsx(Hr,{title:s&&r!==void 0?rN(r):"Settings",startContent:s&&r!==void 0?a.jsx(un,{label:"Back",icon:a.jsx(Qg,{}),variant:"ghost",style:{marginBlock:"calc(-1 * var(--spacing-2))"},onClick:()=>i(void 0)}):void 0,onOpenChange:()=>n(),hasDivider:!0}),start:s?void 0:b,content:a.jsx(qs,{padding:s?4:6,children:s&&r===void 0?j:a.jsx(Zne,{...u===void 0?{}:{view:u},...d===void 0?{}:{remote:d},...(c==null?void 0:c.device)===void 0?{}:{device:c.device},...(c==null?void 0:c.hostKey)===void 0?{}:{hostKey:c.hostKey},connected:h,...(c==null?void 0:c.retry)===void 0?{}:{onReconnect:c.retry},section:y,showTitle:!s},Kne(y)?`host:${(c==null?void 0:c.key)??"none"}`:void 0)})})})}function Zne({view:e,remote:t,device:n,hostKey:s,connected:r,onReconnect:i,section:o,showTitle:l}){const{title:c,supporting:u,body:d}=Yne(e,t,n,s,r,i,o),f=`settings-${o}-heading`;return a.jsxs(le,{as:"section",...l?{"aria-labelledby":f}:{"aria-label":c},gap:3,children:[a.jsxs(le,{gap:2,children:[l?a.jsx(ds,{level:2,id:f,children:c}):null,u]}),d]})}function Yne(e,t,n,s,r,i,o){if(o==="hosts")return{title:"Hosts",supporting:a.jsx(Y,{as:"p",type:"supporting",children:"The hosts this device has paired with. It stays connected to all of them."}),body:a.jsx(UT,{})};if(o==="updates")return{title:"Updates",body:a.jsx(Wne,{})};if(e===void 0||t===void 0)return{title:rN(o),body:a.jsx(Y,{as:"p",type:"supporting",children:"This host isn't connected. Its settings appear once it is."})};switch(o){case"devices":return{title:"Devices",supporting:a.jsx(Y,{as:"p",type:"supporting",children:"Paired devices can reach this host over the secure channel."}),body:a.jsx(Rte,{view:e,remote:t,self:n})};case"providers":return{title:"Providers",supporting:a.jsxs(Y,{as:"p",type:"supporting",children:["Credentials are stored on the host in"," ",a.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/auth.json"]})," and shared by every paired device."]}),body:a.jsx(Ine,{view:e,remote:t})};case"models":return{title:"Models",supporting:a.jsx(Y,{as:"p",type:"supporting",children:"Used when a new conversation doesn't pick its own model."}),body:a.jsx(Qne,{view:e,remote:t,connected:r})};case"agents":return{title:"Agents",supporting:a.jsxs(Y,{as:"p",type:"supporting",children:["Named agents the model can delegate to with ",a.jsx("code",{children:"subagent"})," — mention one with ",a.jsx("code",{children:"@name"}),"."," ","Each is a Markdown file in"," ",a.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/agents/"]}),"; edits to those files apply immediately."]}),body:a.jsx(rse,{view:e,remote:t,connected:r})};case"mcp":return{title:"MCP",body:a.jsx(tse,{view:e})};case"chats":return{title:"Chats",supporting:a.jsx(Y,{as:"p",type:"supporting",children:"How queued messages are delivered when the agent reaches the next turn."}),body:a.jsx(Jne,{view:e,remote:t,connected:r})};case"archived":return{title:"Archived",supporting:a.jsx(Y,{as:"p",type:"supporting",children:"Archived conversations are hidden from the sidebar. Restoring one brings it back with its forks and subagents; a worktree removed on archive is checked out again from its branch."}),body:a.jsx(ese,{view:e,remote:t,connected:r})};case"about":return{title:"About",body:a.jsx(nse,{view:e,remote:t,connected:r})}}}function Qne({view:e,remote:t,connected:n}){const s=e.settings;return s===null?a.jsx(Pe,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."}):a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsx(O3,{models:e.models,selected:{model:s.defaultModel??void 0,level:s.defaultThinkingLevel??"off"},isDisabled:!n,onModelChange:r=>void t.controller.updateSettings({defaultModel:r}),onLevelChange:r=>void t.controller.updateSettings({defaultThinkingLevel:r})}),s.custom.includes("defaultModel")||s.custom.includes("defaultThinkingLevel")?a.jsx(Q,{label:"Use pi's defaults",variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({defaultModel:null,defaultThinkingLevel:null})}):null]})}function Jne({view:e,remote:t,connected:n}){const s=e.settings;return s===null?a.jsx(Pe,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."}):a.jsxs(le,{gap:4,children:[a.jsx(K9,{title:"Steer messages",value:s.steeringMode,customized:s.custom.includes("steeringMode"),disabled:!n,onChange:r=>void t.controller.updateSettings({steeringMode:r}),onReset:()=>void t.controller.updateSettings({steeringMode:null})}),a.jsx(K9,{title:"Follow-up messages",value:s.followUpMode,customized:s.custom.includes("followUpMode"),disabled:!n,onChange:r=>void t.controller.updateSettings({followUpMode:r}),onReset:()=>void t.controller.updateSettings({followUpMode:null})})]})}function ese({view:e,remote:t,connected:n}){const s=Lo(6e4),r=e.organized.archived;return r.length===0?a.jsx(Y,{as:"p",type:"supporting",children:"No archived conversations."}):a.jsx(Bt,{density:"compact",children:r.map(({node:i,project:o})=>{const l=i.summary.title??"New conversation",c=hK(i);return a.jsx(Ye,{label:l,description:[(o==null?void 0:o.name)??"Chat",c===void 0?void 0:Bd(c,s)].filter(u=>u!==void 0).join(" · "),endContent:a.jsx(Q,{label:`Restore ${l}`,icon:a.jsx(yY,{"aria-hidden":"true"}),variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.archive(i.summary.id,!1),children:"Restore"})},i.summary.id)})})}function tse({view:e}){const t=e.mcp;return t===null?a.jsx(Y,{as:"p",type:"supporting",children:"Loading…"}):a.jsxs(le,{gap:3,children:[a.jsx(Y,{as:"p",type:"supporting",style:{userSelect:"all"},children:t.configPath}),t.servers.length===0?a.jsx(Y,{as:"p",type:"supporting",children:"No servers configured."}):a.jsx(Bt,{density:"compact",children:t.servers.map(n=>a.jsx(Ye,{label:n.name,endContent:a.jsx(On,{label:n.state,size:"sm"})},n.name))})]})}function nse({view:e,remote:t,connected:n}){const s=e.host,r=e.settings,i=r!==null&&Zt((s==null?void 0:s.protocol.minor)??0,"hostName");return a.jsxs(le,{gap:3,children:[i?a.jsx(sse,{settings:r,remote:t,connected:n}):null,a.jsxs(Bt,{density:"compact",children:[a.jsx(Ye,{label:"Host version",description:(s==null?void 0:s.version)??"Source checkout"}),a.jsx(Ye,{label:"Protocol",description:s===void 0?"—":`${s.protocol.major}.${s.protocol.minor}`}),a.jsx(Ye,{label:"Data directory",description:a.jsx("span",{style:{wordBreak:"break-all",userSelect:"all"},children:e.session.directory})}),a.jsx(Ye,{label:"Settings file",description:a.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/settings.json"]})})]}),a.jsx(Y,{as:"p",type:"supporting",children:"Edit the settings file by hand only while the host is stopped."})]})}function sse({settings:e,remote:t,connected:n}){const s=e.hostName??"",[r,i]=p.useState(s);p.useEffect(()=>i(s),[s]);const o=eQ(r),l=n&&o!==""&&o!==s,c=()=>void t.controller.updateSettings({hostName:o});return a.jsxs(le,{gap:1,children:[a.jsx(lt,{label:"Host name",value:r,onChange:i,onEnter:l?c:void 0,isDisabled:!n,description:"How paired devices name this machine. Without a custom name the hostname is used.",status:r!==""&&o===""?{type:"error",message:"The name needs at least one displayable character"}:void 0,width:"100%"}),a.jsxs(ye,{gap:2,hAlign:"end",children:[e.custom.includes("hostName")?a.jsx(Q,{label:"Use machine name",variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({hostName:null})}):null,a.jsx(Q,{label:"Save",variant:"secondary",size:"sm",isDisabled:!l,onClick:c})]})]})}function K9({title:e,value:t,customized:n,disabled:s,onChange:r,onReset:i}){return a.jsxs(le,{gap:1,children:[a.jsx(Y,{children:e}),a.jsxs(ye,{gap:2,vAlign:"center",wrap:"wrap",children:[a.jsxs(o4,{className:"shrink-0",value:t,onChange:o=>r(o),label:e,size:"sm",isDisabled:s,children:[a.jsx(yu,{value:"one-at-a-time",label:"One at a time"}),a.jsx(yu,{value:"all",label:"All at once"})]}),n?a.jsx(Q,{label:"Use pi's default",variant:"ghost",size:"sm",isDisabled:s,onClick:i}):null]})]})}function rse({view:e,remote:t,connected:n}){const s=e.agents,[r,i]=p.useState(void 0);return s===null?a.jsx(Pe,{status:"warning",title:"This host is too old for named agents",description:"Run `pinomad upgrade` on the host."}):a.jsxs(le,{gap:3,children:[a.jsx(ye,{gap:2,vAlign:"center",children:a.jsx(Q,{label:"New agent",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>i({mode:"create"})})}),s.roles.length===0&&s.problems.length===0?a.jsx(Y,{as:"p",type:"supporting",children:"No named agents yet."}):null,s.roles.map(o=>a.jsx(ose,{role:o,view:e,remote:t,connected:n,onEdit:()=>i({mode:"edit",role:o})},o.name)),s.problems.map(o=>a.jsx(ase,{problem:o,remote:t,connected:n},o.file)),r===void 0?null:a.jsx(hte,{view:e,remote:t,connected:n,...r.mode==="edit"?{role:r.role}:{},onClose:()=>i(void 0)})]})}const ise=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function ose({role:e,view:t,remote:n,connected:s,onEdit:r}){const[i,o]=p.useState(!1),[l,c]=p.useState(void 0),u=e.model===void 0?void 0:hr(t.models,ise(e.model)),d=()=>{n.controller.deleteAgent(e.name).catch(f=>{c(f instanceof Error?f.message:String(f))})};return a.jsxs(pg,{padding:4,children:[a.jsxs(ye,{gap:3,vAlign:"start",children:[a.jsxs(le,{gap:1,style:{flex:1,minInlineSize:0},children:[a.jsx(ds,{level:3,children:e.name}),a.jsx(Y,{as:"p",type:"supporting",children:e.description}),e.model===void 0&&e.thinkingLevel===void 0?null:a.jsxs(ye,{gap:1,wrap:"wrap",children:[e.model===void 0?null:a.jsx(On,{label:(u==null?void 0:u.name)??e.model,size:"sm"}),e.thinkingLevel===void 0?null:a.jsx(On,{label:L1[e.thinkingLevel],size:"sm"}),e.model!==void 0&&u===void 0?a.jsx(On,{label:"Model not available",color:"orange",size:"sm"}):null]})]}),i?null:a.jsx(ye,{gap:1,vAlign:"center",children:a.jsx(Cg,{icon:a.jsx(Ch,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!s,items:[{label:"Edit…",onClick:r},{label:"Delete…",onClick:()=>o(!0)}]})})]}),i?a.jsxs(le,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[a.jsx(Y,{as:"p",type:"supporting",children:"Conversations already using this agent keep their copy."}),a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Q,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!s,onClick:d}),a.jsx(Q,{label:"Cancel",variant:"ghost",size:"sm",onClick:()=>o(!1)})]})]}):null,l===void 0?null:a.jsx(Y,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:l})]})}function ase({problem:e,remote:t,connected:n}){const[s,r]=p.useState(!1),[i,o]=p.useState(void 0),l=GT(e.file.slice(0,-3))===void 0,c=()=>{t.controller.deleteAgent(e.file.slice(0,-3)).catch(u=>{o(u instanceof Error?u.message:String(u))})};return a.jsxs(pg,{padding:4,children:[a.jsxs(ye,{gap:3,vAlign:"start",children:[a.jsxs(le,{gap:1,style:{flex:1,minInlineSize:0},children:[a.jsx(ds,{level:3,children:e.file}),a.jsx(ye,{gap:1,wrap:"wrap",children:a.jsx(On,{label:"Not loaded",color:"orange",size:"sm"})}),a.jsx(Y,{as:"p",type:"supporting",children:e.reason}),a.jsx(Y,{as:"p",type:"supporting",children:"Fix this file on the host."})]}),s||!l?null:a.jsx(ye,{gap:1,vAlign:"center",children:a.jsx(Cg,{icon:a.jsx(Ch,{"aria-hidden":"true"}),label:`${e.file} actions`,size:"sm",variant:"ghost",isDisabled:!n,items:[{label:"Delete…",onClick:()=>r(!0)}]})})]}),s?a.jsx(le,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Q,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!n,onClick:c}),a.jsx(Q,{label:"Cancel",variant:"ghost",size:"sm",onClick:()=>r(!1)})]})}):null,i===void 0?null:a.jsx(Y,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:i})]})}const iN="pinomad.sidebar.open",lse=()=>typeof window>"u"||window.localStorage.getItem(iN)!=="false",cse={sidebarOpen:!0,toggleSidebar:()=>{},openNav:()=>{}},oN=p.createContext(cse),use=()=>p.useContext(oN);function aN({machines:e,focusKey:t,draftingChat:n,shownId:s,onDraft:r,onOpen:i,onNewChat:o,onShowMachine:l,narrow:c,children:u}){const[d,f]=p.useState(lse),[h,x]=p.useState(!1),[g,y]=p.useState(!1),[v,m]=p.useState(!1),[k,b]=p.useState(),j=e.find(_=>_.key===t),A=C3(),M=A.reserveMacTrafficLights&&!c&&d,E=p.useCallback(()=>{f(_=>(window.localStorage.setItem(iN,String(!_)),!_))},[]),z=p.useCallback(()=>x(!0),[]),T=_=>{const R=e.find(N=>N.hostKey===_);R!==void 0&&b(N=>({key:R.key,seq:((N==null?void 0:N.seq)??0)+1}))},$=a.jsx(eee,{machines:e,focusKey:t,draftingChat:n,shownId:s,...k===void 0?{}:{locate:k},onDraft:r,...o===void 0?{}:{onNewChat:o},onOpen:i,...l===void 0?{}:{onShowMachine:l},onSelect:()=>x(!1)});return a.jsx(gg,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:a.jsxs(oN.Provider,{value:{sidebarOpen:d,toggleSidebar:E,openNav:z},children:[a.jsx(iS,{className:"pigui-app-layout text-foreground",contentPadding:0,mobileNav:!1,variant:"elevated",sideNav:c||!d?void 0:a.jsx(u4,{resizable:{defaultWidth:260,minWidth:240,maxWidth:320,autoSaveId:"pinomad-app-shell"},header:a.jsx(XJ,{onCollapse:E,safeLeft:M?A.safeLeft:void 0}),footer:a.jsx(C9,{onOpenSettings:()=>y(!0),onOpenAccount:()=>m(!0),onLocateHost:T}),children:$}),children:u}),c&&((j==null?void 0:j.view)===void 0||j.view.unauthorized===!0)?a.jsxs("div",{className:"pinomad-drag fixed inset-x-0 top-0 z-30 flex h-10 items-center gap-1 px-3",style:A.reserveMacTrafficLights?{paddingLeft:A.safeLeft}:void 0,children:[a.jsx(un,{icon:a.jsx(Px,{className:"size-4"}),label:"Open navigation",size:"sm",variant:"ghost",onClick:z}),a.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"})]}):null,c?a.jsxs(l4,{className:"pigui-app-layout text-foreground",isOpen:h,onOpenChange:x,header:a.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"}),children:[$,a.jsx(C9,{onOpenSettings:()=>y(!0),onOpenAccount:()=>m(!0),onLocateHost:T,onSelect:()=>x(!1)})]}):null,g?a.jsx(Xne,{machines:e,...t===void 0?{}:{initialKey:t},onClose:()=>y(!1)}):null,v?a.jsx(tm,{onClose:()=>m(!1)}):null,e.map(_=>_.view===void 0?null:a.jsx(fse,{machineKey:_.key,source:e.length>1?_.label:void 0,notices:_.view.notices},_.key))]})})}function dse({narrow:e,title:t,agent:n,parentSummary:s,onBackToParent:r,showOverview:i,overviewOpen:o,onOverviewChange:l,panelOpen:c,onPanelChange:u,liveActivity:d}){const{sidebarOpen:f,toggleSidebar:h,openNav:x}=use(),g=C3(),y=g.reserveMacTrafficLights&&!e&&f,v=g.reserveMacTrafficLights&&!y?g.safeLeft:void 0;return a.jsxs("div",{className:"pinomad-drag flex h-10 shrink-0 items-center gap-1 border-b border-border px-3",style:v===void 0?void 0:{paddingLeft:v},children:[e?a.jsx(un,{icon:a.jsx(Px,{className:"size-4"}),label:"Open navigation",size:"sm",variant:"ghost",onClick:x}):f?null:a.jsx(un,{icon:a.jsx(Px,{className:"size-4"}),label:"Expand sidebar",size:"sm",variant:"ghost",onClick:h}),a.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-normal",children:s===void 0?a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"truncate",children:t}),n===void 0?null:a.jsxs("span",{className:"shrink-0 text-muted",children:["@",n]})]}):a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Q,{label:Ds(s),"aria-label":`Back to ${Ds(s)}`,variant:"ghost",size:"sm",onClick:()=>r(s.id)}),a.jsx("span",{"aria-hidden":"true",className:"text-muted",children:"›"}),a.jsx("span",{className:"truncate",children:t}),n===void 0?null:a.jsxs("span",{className:"shrink-0 text-muted",children:["@",n]})]})}),i?a.jsx(un,{"aria-pressed":o,className:o?"bg-[var(--color-overlay-pressed)]":void 0,icon:a.jsx(gY,{className:"size-4"}),label:"Overview",size:"sm",tooltip:o?"Hide overview":"Show overview",variant:"ghost",onClick:()=>l(!o)}):null,a.jsxs("span",{className:"relative",children:[a.jsx(un,{"aria-pressed":c,icon:a.jsx(UY,{className:"size-4"}),label:"Side panel",size:"sm",tooltip:c?"Hide side panel":"Show side panel",variant:"ghost",onClick:()=>u(!c)}),!c&&d?a.jsx("span",{"aria-label":"Live activity",className:"pointer-events-none absolute right-1 top-1 size-2 rounded-full bg-primary",role:"img"}):null]})]})}function fse({machineKey:e,source:t,notices:n}){const s=jh(),r=p.useRef(void 0);return p.useEffect(()=>{var o;const i=(o=n[n.length-1])==null?void 0:o.id;if(r.current===void 0){r.current=i??-1;return}for(const l of n)l.id<=r.current||s({body:t===void 0?l.message:`${t}: ${l.message}`,type:l.level==="error"?"error":"info",uniqueID:`${e}:${l.id}`});i!==void 0&&(r.current=i)},[e,n,t,s]),null}const hse=new RegExp("\\p{White_Space}","u"),pse=/[\p{Alphabetic}\p{N}_$]/u,xse=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function lN(e,t){const n=new Set(t),s=[];for(let r=0;r<e.length;r+=1){if(e.charCodeAt(r)!==36||r>0&&!hse.test(e[r-1]))continue;let i=r+1;for(;i<e.length&&xse(e.charCodeAt(i));)i+=1;n.has(e.slice(r+1,i))&&(i<e.length&&pse.test(String.fromCodePoint(e.codePointAt(i)))||s.push({start:r,end:i}))}return s}const gse={text:"",bindings:[]},cN=(e,t,n)=>t>=0&&e.startsWith(`$${n}`,t);function Dk(e,t){const n=[];let s=0;for(const r of[...t].sort((i,o)=>i.start-o.start))r.start<s||!cN(e,r.start,r.name)||(n.push(r),s=r.end);return n}function mse(e,t,n){const s=e.text;if(t===s&&n===void 0)return e;let r=0;for(;r<s.length&&r<t.length&&s[r]===t[r];)r+=1;let i=0;for(;i<s.length-r&&i<t.length-r&&s[s.length-1-i]===t[t.length-1-i];)i+=1;const o=s.length-i,l=t.length-s.length,c=[];for(const u of e.bindings){let d;u.end<=r?d=u.start:u.start>=o?d=u.start+l:(u.start<r||u.end>o)&&(d=u.start),d!==void 0&&cN(t,d,u.name)&&c.push({start:d,end:d+1+u.name.length,name:u.name})}if(n!==void 0){const u=n.length+1,d=t.length-i;let f=-1;for(let h=t.indexOf(`$${n}`);h!==-1&&h<=d;h=t.indexOf(`$${n}`,h+1))h+u>=r&&(f=h);if(f!==-1){const h={start:f,end:f+u,name:n},x=c.filter(g=>g.end<=h.start||g.start>=h.end);return{text:t,bindings:Dk(t,[...x,h])}}}return{text:t,bindings:Dk(t,c)}}function yse(e,t){return t.length===0?{text:e,bindings:[]}:{text:e,bindings:lN(e,t).map(({start:n,end:s})=>({start:n,end:s,name:e.slice(n+1,s)}))}}const vse=new RegExp("\\p{White_Space}","u"),kse=/[\p{Alphabetic}\p{N}_$-]/u;function P3(e){const{text:t}=e,n=[];let s="",r=0;for(const i of Dk(t,e.bindings))s+=t.slice(r,i.start),s!==""&&!vse.test(s.at(-1))&&(s+=" "),s+=t.slice(i.start,i.end),r=i.end,r<t.length&&kse.test(String.fromCodePoint(t.codePointAt(r)))&&(s+=" "),n.includes(i.name)||n.push(i.name);return s+=t.slice(r),{text:s,skills:n}}function uN(e){const t=[],n=[];for(const s of e)s.type.startsWith("image/")?t.push(s):n.push(s);return{images:t,others:n}}function dN(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(e<10*1024?1:0)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function bse(e){let t="";for(let s=0;s<e.length;s+=32768)t+=String.fromCharCode(...e.subarray(s,s+32768));return btoa(t)}function wse(e){return Math.max(0,Ti-e)}function jse(e){return Qte(e.name,e.size)}class fN extends Error{constructor(){super("Upload cancelled"),this.name="UploadCancelled"}}async function Sse(e,t,n,s){let r=n.attachmentId,i=n.received;if(r===void 0&&(r=await e.beginAttachment(t.name,t.size),s.onId(r)),t.size===0)return s.onProgress(0,!0),{attachmentId:r,received:0};for(;i<t.size;){if(s.isCancelled())throw new fN;const o=Math.min(i+Kte,t.size),l=bse(new Uint8Array(await t.slice(i,o).arrayBuffer())),c=await e.appendAttachment(r,i,l);if(c.complete)return s.onProgress(t.size,!0),{attachmentId:r,received:t.size};if(c.received<=i)throw new Error("Upload made no progress");i=c.received,s.onProgress(i,!1)}return s.onProgress(t.size,!0),{attachmentId:r,received:t.size}}const Cse=1568;function Ese(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s+=32768)n+=String.fromCharCode(...t.subarray(s,s+32768));return btoa(n)}async function $se(e){let t;try{t=await createImageBitmap(e)}catch{throw new Error(`Couldn't read ${e.name}`)}const n=Math.min(1,Cse/Math.max(t.width,t.height)),s=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),i=document.createElement("canvas");i.width=s,i.height=r;const o=i.getContext("2d");o.fillStyle="#ffffff",o.fillRect(0,0,s,r),o.drawImage(t,0,0,s,r),t.close();const l=await new Promise((d,f)=>i.toBlob(h=>h===null?f(new Error(`Couldn't read ${e.name}`)):d(h),"image/jpeg",.85)),c={data:Ese(await l.arrayBuffer()),mimeType:"image/jpeg"},u=lK([c]);if(u!==void 0)throw new Error(u);return c}const Ase=()=>({draft:gse,images:[],preparing:0,imageError:null,fileEntries:[],fileError:null,home:{kind:"chat"},checkoutMode:"worktree",agent:void 0,overrides:{},submitting:!1});var ed,td,Mt,ro,io,eh,He,xt,kl,Bk;class Mse{constructor(t){ae(this,He);ae(this,ed);ae(this,td,new Set);ae(this,Mt,Ase());ae(this,ro,0);ae(this,io,0);ae(this,eh,1);ge(this,"subscribe",t=>(S(this,td).add(t),()=>{S(this,td).delete(t)}));ge(this,"snapshot",()=>S(this,Mt));G(this,ed,t)}attachRemote(t){S(this,ed).setRemote(t)}setDraft(t){C(this,He,xt).call(this,{draft:t})}restoreDraft(t,n){this.setDraft(yse(t,n))}setHome(t){C(this,He,xt).call(this,{home:t})}setCheckoutMode(t){C(this,He,xt).call(this,{checkoutMode:t})}setAgent(t){C(this,He,xt).call(this,{agent:t,overrides:{}})}setOverrides(t){C(this,He,xt).call(this,{overrides:t})}beginSubmit(){return S(this,Mt).submitting?!1:(C(this,He,xt).call(this,{submitting:!0}),!0)}endSubmit(){S(this,Mt).submitting&&C(this,He,xt).call(this,{submitting:!1})}addImages(t,n){if(!n){C(this,He,xt).call(this,{imageError:"This model doesn't accept images"});return}const s=t.filter(l=>l.type.startsWith("image/")),r=Math.max(0,Yf-S(this,io)),i=s.slice(0,r);if(s.length>r?C(this,He,xt).call(this,{imageError:"At most 4 images per message"}):s.length<t.length?C(this,He,xt).call(this,{imageError:"Only images can be attached"}):C(this,He,xt).call(this,{imageError:null}),i.length===0)return;G(this,io,S(this,io)+i.length);const o=S(this,ro);C(this,He,xt).call(this,{preparing:S(this,Mt).preparing+i.length}),Promise.all(i.map(l=>$se(l))).then(async l=>{S(this,ro)===o&&(await eT(l),S(this,ro)===o&&C(this,He,xt).call(this,{images:[...S(this,Mt).images,...l],preparing:S(this,Mt).preparing-i.length}))},l=>{S(this,ro)===o&&(G(this,io,S(this,io)-i.length),C(this,He,xt).call(this,{imageError:l instanceof Error?l.message:String(l),preparing:S(this,Mt).preparing-i.length}))})}restoreImages(t){const n=t.slice(0,Yf);G(this,ro,S(this,ro)+1),G(this,io,n.length),C(this,He,xt).call(this,{images:[...n],preparing:0,imageError:t.length>Yf?"At most 4 images per message":null})}removeImage(t){G(this,io,S(this,io)-1),C(this,He,xt).call(this,{images:S(this,Mt).images.filter((n,s)=>s!==t)})}clearImages(){G(this,ro,S(this,ro)+1),G(this,io,0),C(this,He,xt).call(this,{images:[],preparing:0,imageError:null})}addFiles(t,n){if(!n){C(this,He,xt).call(this,{fileError:"Attaching files needs a host on protocol 5.19; run `pinomad upgrade` on the host"});return}const s=t.filter(c=>!c.type.startsWith("image/"));if(s.length===0)return;s.length<t.length&&C(this,He,xt).call(this,{fileError:"Images are attached from Add images…"});const r=wse(S(this,Mt).fileEntries.length);if(r===0){C(this,He,xt).call(this,{fileError:`At most ${Ti} files per message`});return}const i=[];let o=s.length>r?`At most ${Ti} files per message`:void 0;for(const c of s.slice(0,r)){const u=jse(c);if(u!==void 0){o=`${c.name}: ${u}`;continue}i.push(c)}if(C(this,He,xt).call(this,{fileError:o??null}),i.length===0)return;const l=i.map(c=>({key:`file-${Cn(this,eh)._++}`,name:c.name,size:c.size,status:"uploading",received:0,file:c}));C(this,He,xt).call(this,{fileEntries:[...S(this,Mt).fileEntries,...l]});for(const c of l)C(this,He,Bk).call(this,c.key,c.file,void 0,0)}retryFile(t){const n=S(this,Mt).fileEntries.find(s=>s.key===t);(n==null?void 0:n.file)!==void 0&&(C(this,He,kl).call(this,t,{status:"uploading",error:void 0}),C(this,He,Bk).call(this,t,n.file,n.attachmentId,n.received))}removeFile(t){C(this,He,xt).call(this,{fileEntries:S(this,Mt).fileEntries.filter(n=>n.key!==t)})}restoreFiles(t){C(this,He,xt).call(this,{fileEntries:t.slice(0,Ti).map(n=>({key:`file-${Cn(this,eh)._++}`,name:n.name,size:n.size,status:"done",attachmentId:n.id,received:n.size})),fileError:t.length>Ti?`At most ${Ti} files per message`:null})}clearFiles(){C(this,He,xt).call(this,{fileEntries:[],fileError:null})}get uploading(){return S(this,Mt).fileEntries.some(t=>t.status==="uploading")}get failed(){return S(this,Mt).fileEntries.some(t=>t.status==="failed")}ids(){return S(this,Mt).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[t.attachmentId]:[])}details(){return S(this,Mt).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[{id:t.attachmentId,name:t.name,size:t.size}]:[])}}ed=new WeakMap,td=new WeakMap,Mt=new WeakMap,ro=new WeakMap,io=new WeakMap,eh=new WeakMap,He=new WeakSet,xt=function(t){G(this,Mt,{...S(this,Mt),...t});for(const n of S(this,td))n()},kl=function(t,n){C(this,He,xt).call(this,{fileEntries:S(this,Mt).fileEntries.map(s=>s.key===t?{...s,...n}:s)})},Bk=async function(t,n,s,r){const i=S(this,ed).remote;if(i===void 0){C(this,He,kl).call(this,t,{status:"failed",error:"Host is not connected"});return}try{await Sse(i.controller,n,{...s===void 0?{}:{attachmentId:s},received:r},{onId:o=>C(this,He,kl).call(this,t,{attachmentId:o}),onProgress:(o,l)=>C(this,He,kl).call(this,t,{received:o,...l?{status:"done"}:{}}),isCancelled:()=>!S(this,Mt).fileEntries.some(o=>o.key===t)}),S(this,Mt).fileEntries.some(o=>o.key===t)&&C(this,He,kl).call(this,t,{status:"done"})}catch(o){if(o instanceof fN||!S(this,Mt).fileEntries.some(u=>u.key===t))return;const l=o instanceof Error?o.message:String(o),c=/expired|not found/i.test(l);C(this,He,kl).call(this,t,{status:"failed",error:l,...c?{attachmentId:void 0,received:0}:{}})}};var th,nh;class U3{constructor(){ae(this,th,new Map);ae(this,nh)}setRemote(t){G(this,nh,t)}get remote(){return S(this,nh)}slot(t){let n=S(this,th).get(t);return n===void 0&&(n=new Mse(this),S(this,th).set(t,n)),n}}th=new WeakMap,nh=new WeakMap;const Hk="new",Tse=e=>`conversation:${e}`,qk=p.createContext(void 0);function F3(e=Hk){const t=p.useContext(qk),n=p.useRef(void 0);n.current??(n.current=new U3);const s=t??n.current;return p.useMemo(()=>s.slot(e),[e,s])}function Pd(e){return p.useSyncExternalStore(e.subscribe,e.snapshot)}const zse=()=>()=>{},Nse=()=>{};function _se(e){return p.useSyncExternalStore((e==null?void 0:e.subscribe)??zse,(e==null?void 0:e.snapshot)??Nse)}function nm(){const e=p.useRef(void 0);return e.current??(e.current=new U3),p.useMemo(()=>e.current.slot("local"),[])}const hN="pinomad.lastNewHost";function Rse(e){const t=e.getItem(hN);return t===null||t===""?void 0:t}function Ise(e,t){e.setItem(hN,t)}function Lse({hosts:e,lastNewHost:t,connected:n}){if(e.length===0)return;const s=new Set(e.map(o=>o.hostKey)),r=t!==void 0&&s.has(t)?t:void 0;if(r!==void 0&&n(r))return r;const i=e.find(o=>n(o.hostKey));return i!==void 0?i.hostKey:r??e[0].hostKey}function Ose({children:e}){var y;const{hosts:t,focus:n,focusConversation:s,focusDraft:r,focusHost:i}=Ps(),o=TT(),l=Pa("(max-width: 1023px)"),c=n===null?void 0:o.get(n.hostKey),u=(y=_se(c==null?void 0:c.composer.slot(Hk)))==null?void 0:y.home,d=p.useMemo(()=>new Map(t.map(v=>[v.hostKey,_1(Mo(v.privateKey))])),[t]),f=j3(t),h=t.map(v=>{const m=o.get(v.hostKey),k=(m==null?void 0:m.phase)==="ready"?m:void 0,b=d.get(v.hostKey);return{key:v.hostKey,hostKey:v.hostKey,label:f.get(v.hostKey)??v.url,...k===void 0?{}:{view:k.view,remote:k.remote},...b===void 0?{}:{device:b},...m===void 0?{}:{retry:m.retry}}}),x=(v,m)=>{var k;(k=o.get(v))==null||k.composer.slot(Hk).setHome(m),r(v)},g=()=>{const v=Lse({hosts:t,lastNewHost:Rse(window.localStorage),connected:m=>ic(o.get(m))==="connected"});v!==void 0&&x(v,{kind:"chat"})};return a.jsx(aN,{machines:h,focusKey:n==null?void 0:n.hostKey,draftingChat:(n===null||n.conversationId===void 0)&&(u==null?void 0:u.kind)==="chat",shownId:n==null?void 0:n.conversationId,onDraft:x,onOpen:(v,m)=>s({hostKey:v,conversationId:m}),onNewChat:g,onShowMachine:i,narrow:l,children:e})}function Dse({value:e,onChange:t,isDisabled:n=!1}){return a.jsx("div",{className:"inline-flex max-w-full shrink-0","data-testid":"checkout-strategy-picker",children:a.jsx(Pi,{content:"Use a Git worktree; when off, work in the project folder.",isEnabled:!n,children:a.jsx(ch,{isDisabled:n,label:"worktree",size:"sm",value:e==="worktree",onChange:s=>t(s?"worktree":"local")})})})}const Bse=150,Hse=(e,t)=>`${e}${t}`;function qse(e){let t=0,n;const s=new Map,r=o=>s.get(o)===t,i=(o,l)=>{s.get(o)===l&&s.delete(o)};return{request(o,l,c){if(n!==void 0&&(clearTimeout(n.timer),n=void 0),r(o))return;const u=t;n={cacheKey:o,timer:setTimeout(()=>{n=void 0,!(u!==t||r(o))&&(s.set(o,u),c().then(d=>{i(o,u),u===t&&e(o,l,d.files)},()=>{i(o,u)}))},Bse)}},cancel(){t+=1,n!==void 0&&(clearTimeout(n.timer),n=void 0)}}}const X9=5e3,Pse=e=>({id:`agent:${e.name}`,label:e.name,auxiliaryData:{kind:"agent",group:"Agents",description:e.description,insert:`@${e.name} `}}),Z9=e=>({id:`file:${e}`,label:e,auxiliaryData:{kind:"file",group:"Files",insert:`@./${e} `}}),Y9=e=>e.auxiliaryData;function V3(e,t,n){const s=(e==null?void 0:e.roles)??[],[r,i]=p.useState({byKey:{}}),o=p.useRef(n);o.current=n;const l=p.useRef(void 0);l.current??(l.current=qse((u,d,f)=>{i(h=>{const x=Date.now(),g={};for(const[y,v]of Object.entries(h.byKey))x-v.at<X9&&(g[y]=v);return g[u]={files:f,at:x},{byKey:g,latest:{scope:d,files:f}}})})),p.useEffect(()=>()=>{var u;return(u=l.current)==null?void 0:u.cancel()},[]),p.useEffect(()=>{var u;r.latest!==void 0&&((u=t.current)==null||u.emitInput())},[r]);const c=n!==void 0;return p.useMemo(()=>{if(s.length===0&&!c)return;const u=l.current,d={bootstrap:()=>[],search:h=>{const x=h.toLowerCase(),g=s.filter(b=>b.name.includes(x)).map(Pse),y=o.current;if(y===void 0)return g;const v=h.startsWith("./")?h.slice(2):h,m=Hse(y.key,v),k=r.byKey[m];return k!==void 0&&Date.now()-k.at<X9?[...g,...k.files.map(Z9)]:(u.request(m,y.key,()=>y.list(v)),r.latest!==void 0&&r.latest.scope===y.key?[...g,...r.latest.files.map(Z9)]:g)},cancel:()=>u.cancel()},f=s.length>0&&c?"Agents and files":s.length>0?"Named agents":"Files";return[{character:"@",searchSource:d,menuLabel:f,emptySearchResultsText:`No matching ${s.length>0&&c?"agents or files":s.length>0?"agents":"files"}`,renderItem:h=>{const x=Y9(h),g=(x==null?void 0:x.kind)==="file"?Hd:Sh;return a.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(g,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),a.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[a.jsx("span",{className:`truncate ${(x==null?void 0:x.description)===void 0?"min-w-0":"max-w-[60%] shrink-0"}`,children:h.label}),(x==null?void 0:x.description)===void 0?null:a.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:x.description})]})]})},onSelect:h=>{var x;return((x=Y9(h))==null?void 0:x.insert)??""}}]},[s,r,c])}const Use=5e3,Fse=64;var sh,pa,rh,nd,ih,oo,oh,Pk;class pN{constructor(t,n,s,r={}){ae(this,oh);ae(this,sh);ae(this,pa);ae(this,rh);ae(this,nd);ae(this,ih);ae(this,oo,new Map);G(this,sh,t),G(this,pa,n),G(this,rh,s),G(this,nd,r.now??Date.now),G(this,ih,r.ttlMs??Use)}keyOf(t){return S(this,pa).call(this,t)}snapshot(t){var n;return(n=S(this,oo).get(S(this,pa).call(this,t)))==null?void 0:n.items}request(t,n=!1){const s=C(this,oh,Pk).call(this,S(this,pa).call(this,t));if(s.inflight!==void 0||!n&&s.items!==void 0&&S(this,nd).call(this)-s.at<S(this,ih))return;const r=S(this,sh).call(this,t);s.inflight=r,r.then(i=>{if(s.inflight===r){s.items=S(this,rh).call(this,i),s.at=S(this,nd).call(this);for(const o of s.listeners)o()}},()=>{}).finally(()=>{s.inflight===r&&(s.inflight=void 0)})}subscribe(t,n){const s=C(this,oh,Pk).call(this,S(this,pa).call(this,t)).listeners;return s.add(n),()=>s.delete(n)}}sh=new WeakMap,pa=new WeakMap,rh=new WeakMap,nd=new WeakMap,ih=new WeakMap,oo=new WeakMap,oh=new WeakSet,Pk=function(t){let n=S(this,oo).get(t);if(n===void 0&&(n={at:0,listeners:new Set},S(this,oo).set(t,n),S(this,oo).size>Fse)){for(const[s,r]of S(this,oo))if(s!==t&&r.inflight===void 0&&r.listeners.size===0){S(this,oo).delete(s);break}}return n};const Vse=()=>()=>{};function xN(e,t,n){const s=t===void 0?void 0:e.keyOf(t),r=p.useSyncExternalStore(p.useCallback(u=>s===void 0?Vse:e.subscribe(t,u),[e,s]),p.useCallback(()=>s===void 0?void 0:e.snapshot(t),[e,s])),i=p.useRef(t);i.current=t;const o=p.useRef(n);o.current=n;const l=p.useCallback((u=!1)=>{const d=i.current;o.current&&d!==void 0&&e.request(d,u)},[e]),c=p.useRef(!1);return p.useEffect(()=>{if(!n){c.current=!0;return}const u=i.current;u!==void 0&&e.request(u,c.current),c.current=!1},[e,n,s]),{items:n?r:void 0,request:l}}const Gse="pinomad-skill-mention",Wse=()=>typeof CSS<"u"&&typeof Highlight=="function"&&"highlights"in CSS;let J2;const Kse=()=>(J2??(J2=new Highlight),CSS.highlights.set(Gse,J2),J2);function Xse(e){const t=[];let n=0;const s=r=>{var i;for(const o of r.childNodes)if(o.nodeType===Node.TEXT_NODE){const l=o.data.length;t.push({node:o,start:n,end:n+l}),n+=l}else if(o instanceof HTMLElement)if(o.hasAttribute("data-astryx-token")){const l=((i=o.getAttribute("data-astryx-token-value"))==null?void 0:i.length)??0;t.push({start:n,end:n+l}),n+=l}else o.tagName==="BR"?(t.push({start:n,end:n+1}),n+=1):s(o)};return s(e),t}function Zse(e,t){if(t.length===0)return[];const n=Xse(e),s=[];for(const{start:r,end:i}of t){const o=n.find(u=>u.node!==void 0&&u.start<=r&&r<u.end),l=n.find(u=>u.node!==void 0&&u.start<i&&i<=u.end);if((o==null?void 0:o.node)===void 0||(l==null?void 0:l.node)===void 0)continue;const c=document.createRange();c.setStart(o.node,r-o.start),c.setEnd(l.node,i-l.start),s.push(c)}return s}function Yse(e,t){if(!Wse())return()=>{};const n=Zse(e,t);if(n.length===0)return()=>{};const s=Kse();for(const r of n)s.add(r);return()=>{for(const r of n)s.delete(r)}}const gN=e=>e.kind==="conversation"?`conversation:${e.conversationId}`:e.kind==="project"?`project:${e.path}:${e.checkout}`:"chat";class Qse extends pN{constructor(t,n={}){super(t,gN,s=>s.skills,n)}}const Q9=new WeakMap;function mN(e){let t=Q9.get(e);return t===void 0&&(t=new Qse(n=>e.controller.listSkills(n)),Q9.set(e,t)),t}function Jse(e,t,n){const{items:s,request:r}=xN(mN(e),t,n);return{skills:s,request:r}}const ere=e=>({id:`skill:${e.name}`,label:e.name,auxiliaryData:{group:e.source==="project"?"Project":"User",description:e.description}});function tre(e,t){const n=t.toLowerCase();return e.flatMap((s,r)=>{const i=s.name.toLowerCase(),o=i.startsWith(n)?0:i.includes(n)?1:s.description.toLowerCase().includes(n)?2:-1;return o<0?[]:[{skill:s,index:r,tier:o}]}).sort((s,r)=>s.tier-r.tier||s.index-r.index).map(({skill:s})=>ere(s))}function G3(e,t,n,s,r){const i=mN(e),o=t===void 0?void 0:gN(t),{skills:l,request:c}=Jse(e,t,s);p.useEffect(()=>{var x;l!==void 0&&((x=n.current)==null||x.emitInput())},[l,n]);const u=p.useRef(l);u.current=l;const d=p.useRef(t);d.current=t;const f=p.useRef(r);return f.current=r,{trigger:p.useMemo(()=>!s||t===void 0?void 0:{character:"$",searchSource:{bootstrap:()=>[],search:g=>{const y=d.current;return y!==void 0&&i.request(y),tre(u.current??[],g)},cancel:()=>{}},menuLabel:"Skills",emptySearchResultsText:"No matching skills",renderItem:g=>{const y=g.auxiliaryData;return a.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(Jg,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),a.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[a.jsx("span",{className:`truncate ${(y==null?void 0:y.description)===void 0?"min-w-0":"max-w-[60%] shrink-0"}`,children:g.label}),(y==null?void 0:y.description)===void 0?null:a.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:y.description})]})]})},onSelect:g=>(f.current(g.label),`$${g.label} `)},[s,i,o,l]),request:c}}function W3(e){const t=nm(),n=e??t,s=Pd(n).draft,r=p.useRef(void 0),i=p.useCallback(c=>{const u=r.current;r.current=void 0,n.setDraft(mse(n.snapshot().draft,c,u))},[n]),o=p.useCallback(c=>{r.current=c},[]),l=p.useCallback((c,u)=>{r.current=void 0,n.restoreDraft(c,u)},[n]);return{value:s.text,draft:s,setValue:i,pick:o,restore:l}}function K3(e,t){p.useEffect(()=>{var s;const n=(s=e.current)==null?void 0:s.editable();if(!(n==null||t.bindings.length===0))return Yse(n,t.bindings)},[e,t])}function nre({text:e,names:t}){const n=p.useMemo(()=>t.length===0?[]:lN(e,t),[e,t]);if(n.length===0)return a.jsx(a.Fragment,{children:e});const s=[];let r=0;return n.forEach((i,o)=>{i.start>r&&s.push(e.slice(r,i.start)),s.push(a.jsx("mark",{className:"chat-skill-mention",children:e.slice(i.start,i.end)},o)),r=i.end}),r<e.length&&s.push(e.slice(r)),a.jsx(a.Fragment,{children:s})}function yN({entry:e,onRetry:t,onRemove:n}){const s=e.size===0?100:Math.min(100,Math.round(e.received/e.size*100));return a.jsxs("div",{className:"file-chip","data-status":e.status,"data-testid":"file-attachment-chip",title:e.error??e.name,children:[a.jsx(Hd,{"aria-hidden":"true",className:"file-chip__icon"}),a.jsx("span",{className:"file-chip__name",children:e.name}),a.jsx("span",{className:"file-chip__size",children:e.status==="failed"?"Failed":e.status==="uploading"?`${s}%`:dN(e.size)}),e.status==="failed"&&t!==void 0?a.jsx("button",{type:"button",className:"file-chip__action","aria-label":`Retry ${e.name}`,title:"Retry upload",onClick:()=>t(e.key),children:a.jsx(M3,{"aria-hidden":"true"})}):null,n===void 0?null:a.jsx("button",{type:"button",className:"file-chip__action","aria-label":`Remove ${e.name}`,title:"Remove",onClick:()=>n(e.key),children:a.jsx(kY,{"aria-hidden":"true"})}),e.status==="uploading"?a.jsx("span",{className:"file-chip__bar","aria-hidden":"true",children:a.jsx("span",{style:{width:`${s}%`}})}):null]})}function sre({attachments:e,testId:t="message-attachments"}){return e.length===0?null:a.jsx("div",{className:"flex flex-wrap justify-end gap-2","data-testid":t,children:e.map((n,s)=>a.jsxs("div",{className:"file-chip","data-status":"done",title:n.name,children:[a.jsx(Hd,{"aria-hidden":"true",className:"file-chip__icon"}),a.jsx("span",{className:"file-chip__name",children:n.name}),a.jsx("span",{className:"file-chip__size",children:dN(n.size)})]},`${n.id}:${s}`))})}function vN(e,t,n){const s=nm(),r=n??s;p.useEffect(()=>{r.attachRemote(e)},[r,e]);const i=Pd(r);return{entries:i.fileEntries,get uploading(){return i.fileEntries.some(o=>o.status==="uploading")},get failed(){return i.fileEntries.some(o=>o.status==="failed")},error:i.fileError,add:o=>r.addFiles(o,t),retry:o=>r.retryFile(o),remove:o=>r.removeFile(o),restore:o=>r.restoreFiles(o),clear:()=>r.clearFiles(),ids:()=>r.ids(),details:()=>r.details()}}function X3({inputRef:e,onFiles:t,accept:n}){return a.jsx("input",{ref:e,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,...n===void 0?{}:{accept:n},onChange:s=>{t([...s.target.files??[]]),s.target.value=""}})}function kN({inputRef:e,onFiles:t}){return a.jsx(X3,{inputRef:e,onFiles:t,accept:"image/*"})}function bN({images:e,pending:t,onRemove:n,files:s}){if(!(e.length===0&&!t&&s===void 0))return a.jsxs("div",{className:"flex flex-wrap gap-2","data-testid":"composer-attachments",children:[e.map((r,i)=>a.jsx(Jp,{src:_u(r),alt:`Image ${i+1}`,onRemove:()=>n(i)},i)),t?a.jsx(Jp,{isLoading:!0,alt:"Preparing image"}):null,s]})}function wN(e,t){const n=nm(),s=t??n,r=Pd(s),i=p.useRef(e);return i.current=e,{images:r.images,pending:r.preparing>0,error:r.imageError,add:o=>s.addImages(o,i.current),restore:o=>s.restoreImages(o),remove:o=>s.removeImage(o),clear:()=>s.clearImages()}}const J9="pinomad.draft.model";function jN(e){return e===void 0?J9:`${J9}.${e}`}function rre(e,t){try{const n=localStorage.getItem(jN(t));if(n===null)return;const s=JSON.parse(n);if(typeof s.provider=="string"&&typeof s.modelId=="string"&&typeof s.thinkingLevel=="string"&&e.some(r=>r.provider===s.provider&&r.modelId===s.modelId))return s}catch{}}function ire(e,t,n){const[s,r]=p.useState(()=>{var b;const y=rre(e.models,t),v=y!==void 0?{provider:y.provider,modelId:y.modelId}:e.defaults.model??(e.models[0]===void 0?void 0:{provider:e.models[0].provider,modelId:e.models[0].modelId}),m=((b=hr(e.models,v))==null?void 0:b.thinkingLevels)??["off"],k=(y==null?void 0:y.thinkingLevel)??e.defaults.thinkingLevel??"off";return{model:v,level:Vx(m,k)}}),i=nm(),o=n??i,l=Pd(o),c=l.agent,u=l.overrides,d=(y,v)=>{localStorage.setItem(jN(t),JSON.stringify({...y,thinkingLevel:v}))},f=c===void 0?void 0:lee(c,e.agents,e.models,e.defaults,u),h=oee(e.models,e.defaults,s),x=f??h,g=x.level;return{pick:x,agent:c,resolution:f,setModel:y=>{var m;if(c!==void 0){o.setOverrides({...u,model:y});return}const v=Vx(((m=hr(e.models,y))==null?void 0:m.thinkingLevels)??["off"],g);r({model:y,level:v}),d(y,v)},setLevel:y=>{if(c!==void 0){o.setOverrides({...u,level:y});return}r(v=>({...v,level:y})),x.model!==void 0&&d(x.model,y)},setAgent:y=>{o.setAgent(y)}}}function SN({isDisabled:e=!1,onOpenChange:t,children:n}){return a.jsx(zd,{button:{label:"More actions",variant:"ghost",size:"sm",isIconOnly:!0,icon:a.jsx(qx,{"aria-hidden":"true"}),isDisabled:e},hasChevron:!1,menuWidth:288,onOpenChange:t,placement:"above",children:n})}function Ai({icon:e,label:t,hint:n,isDisabled:s,onClick:r}){return a.jsx(o1,{icon:a.jsx(e,{"aria-hidden":"true",className:"size-4 text-muted"}),label:a.jsxs("span",{className:"flex min-w-0 items-baseline gap-3",children:[a.jsx("span",{className:"shrink-0",children:t}),n===void 0?null:a.jsx("span",{className:"ml-auto min-w-0 truncate text-xs text-muted",children:n})]}),isDisabled:s,onClick:r})}function df(e){return(e==null?void 0:e.querySelector('[aria-multiline="true"]'))??null}function ew(e){var i;const t=window.getSelection();if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s=null;for(let o=n.nextNode();o!==null;o=n.nextNode())s=o;const r=document.createRange();s===null?(r.selectNodeContents(e),r.collapse(!1)):(r.setStart(s,((i=s.textContent)==null?void 0:i.length)??0),r.collapse(!0)),t.removeAllRanges(),t.addRange(r)}function ore({disabled:e=!1,placeholder:t,inputRef:n,onSubmitRequest:s,value:r,onValueChange:i,onFiles:o,triggers:l}){const c=p.useRef(null),u=p.useRef(null),d=p.useRef(r);d.current=r,p.useEffect(()=>{if(n)return n.current={focus:()=>{var h;return(h=u.current)==null?void 0:h.focus()},focusAtEnd:()=>{const h=df(c.current);h&&(h.focus(),ew(h))},emitInput:()=>{const h=df(c.current);h!==null&&(document.activeElement===h||h.contains(document.activeElement))&&h.dispatchEvent(new Event("input",{bubbles:!0}))},editable:()=>df(c.current),openTrigger:h=>{requestAnimationFrame(()=>{const x=df(c.current);if(!x)return;x.focus(),ew(x);const g=d.current,y=g===""||/[ \n]$/.test(g)?h:` ${h}`;document.execCommand("insertText",!1,y)})}},()=>{n.current=null}},[n]),p.useEffect(()=>{const h=df(c.current);h&&(t?h.setAttribute("aria-placeholder",t):h.removeAttribute("aria-placeholder"),e?h.setAttribute("aria-disabled","true"):h.removeAttribute("aria-disabled"))},[t,e]);const f=h=>{h.nativeEvent.isComposing||h.nativeEvent.keyCode===229||h.key==="Enter"&&(h.shiftKey||(h.preventDefault(),s()))};return a.jsx(U5,{ref:c,className:"prompt-input__input",handleRef:u,hasHistory:!1,isDisabled:e,label:"Prompt",pasteAsToken:!1,placeholder:t,value:r,onChange:h=>i==null?void 0:i(h),onKeyDown:f,...o===void 0?{}:{onFiles:o},...l===void 0?{}:{triggers:[...l]}})}function Z3({value:e,status:t="ready",className:n="",placeholder:s,inputRef:r,isDisabled:i=!1,submitDisabled:o=!1,attachments:l,hasAttachments:c,onFiles:u,triggers:d,startActions:f,endActions:h,footer:x,error:g,onSubmit:y,onStop:v,onValueChange:m,...k}){const j=(t==="streaming"||t==="submitted")&&!e.trim()&&c!==!0&&!!v,A=!o&&(!!e.trim()||c===!0),M=()=>{A&&(y==null||y())},E=T=>{u===void 0||!T.dataTransfer.types.includes("Files")||T.preventDefault()},z=T=>{if(u===void 0||!T.dataTransfer.types.includes("Files"))return;T.preventDefault();const $=[...T.dataTransfer.files];$.length>0&&u($)};return a.jsxs("div",{className:`prompt-input ${n}`.trim(),"data-slot":"prompt-input","data-status":t,onDragOver:E,onDrop:z,...k,children:[a.jsx(ZS,{elevation:"low",...l===void 0?{}:{drawer:a.jsx(YS,{children:l})},footerActions:f,input:a.jsx(ore,{disabled:i,inputRef:r,placeholder:s,value:e,onValueChange:m,onSubmitRequest:M,onFiles:u,triggers:d}),isStopShown:j&&!i,placeholder:s,sendActions:h,sendButton:a.jsx(F5,{className:"pigui-pressable",isDisabled:i||!j&&!A,onSend:M}),status:g?{type:"error",message:g}:void 0,value:e,onChange:T=>m==null?void 0:m(T),onStop:v,onSubmit:M}),x?a.jsx("div",{className:"prompt-input__footer","data-slot":"prompt-input-footer",children:x}):null]})}function CN(e,t){const s=[t.agents&&t.files?"@ agent or file":t.agents?"@ agent":t.files?"@ file":void 0,t.commands?"/ command":void 0,t.skills?"$ skill":void 0].filter(r=>r!==void 0);return[e,...s].join(" · ")}function are(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"138 138 310 270",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M 368 244 C 384 278 372 326 348 353 C 322 382 287 398 255 396 C 234 395 221 387 228 368 C 230 362 223 365 215 366 C 185 369 165 359 159 346 C 154 337 157 337 168 335 C 197 332 211 308 221 282 C 231 254 253 244 283 233 C 318 219 350 212 362 232 Z",stroke:"currentColor",strokeWidth:"13",strokeLinejoin:"round"}),a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"M 214 234 C 213 199 224 176 246 165 C 267 153 282 147 296 149 C 317 151 333 172 343 194 C 300 201 254 226 214 234 Z"}),a.jsx("path",{d:"M 195 239 C 229 241 262 226 306 209 C 347 193 385 177 410 185 C 437 191 438 210 425 229 C 414 244 397 257 377 267 C 373 246 365 227 350 223 C 331 217 311 226 285 236 C 255 246 238 251 227 271 C 216 291 215 305 200 312 C 172 311 153 302 149 287 C 142 264 164 244 195 239 Z"}),a.jsx("ellipse",{cx:"304",cy:"272",rx:"9.5",ry:"15.5"}),a.jsx("ellipse",{cx:"343",cy:"269",rx:"9.5",ry:"15.5"})]})]})}function lre(e){switch(e.kind){case"agent-missing":return{label:`@${e.agent} unavailable`,title:`Agent @${e.agent} is not defined on this host${e.reason===void 0?"":` — ${e.reason}`}`};case"model-missing":return{label:`No model for @${e.agent}`,title:`Agent @${e.agent} pins no model and the host has no default`};case"model-unavailable":{const t=`${e.model.provider}/${e.model.modelId}`,n=e.source==="agent"?`@${e.agent}'s model`:e.source==="default"?"the host default":"the picked model";return{label:`${t} unavailable`,title:`${t} (${n}) is not in the host's model list`}}}}function cre({view:e,remote:t,hostKey:n,draft:s,onDraft:r,onCreated:i,connected:o,machine:l}){var de,fe,he;const c=F3(),u=Pd(c),d=W3(c),{value:f,setValue:h}=d,x=u.submitting,g=u.checkoutMode,y=V=>c.setCheckoutMode(V),v=p.useRef(null),{pick:m,setModel:k,setLevel:b,agent:j,setAgent:A,resolution:M}=ire(e,n,c),E=hr(e.models,m.model),z=(E==null?void 0:E.images)===!0,{images:T,pending:$,error:_,add:R,remove:N,clear:H}=wN(z,c),B=p.useRef(null),I=(de=e.host)==null?void 0:de.protocol.minor,L=I!==void 0&&Zt(I,"attachments")&&Fe(I,"beginAttachment"),O=vN(t,L,c),D=p.useRef(null),[q,F]=p.useState(void 0),K=V=>{const{images:xe,others:ve}=uN(V);F(void 0),xe.length>0&&R(xe),ve.length>0&&O.add(ve)},Z=((fe=e.agents)==null?void 0:fe.roles)??[],se=I!==void 0&&Zt(I,"agentConversations")&&(Z.length>0||j!==void 0),ne=s.kind==="project"&&I!==void 0&&Fe(I,"listFiles")?{key:`project:${s.path}:${g}`,list:V=>t.controller.listFiles({kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"},V)}:void 0,ue=V3(e.agents,v,ne),P=G3(t,s.kind==="project"?{kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"}:{kind:"chat"},v,o&&I!==void 0&&Fe(I,"listSkills"),d.pick);K3(v,d.draft);const U=[...ue??[],...P.trigger===void 0?[]:[P.trigger]],X=M==null?void 0:M.problem,ie=j===void 0||M===void 0?void 0:M.modelFrom!=="override"&&M.levelFrom!=="override"?`from @${j}`:M.modelFrom!=="override"?`model from @${j}`:M.levelFrom!=="override"?`level from @${j}`:void 0,te=z||!o?void 0:`${(E==null?void 0:E.name)??((he=m.model)==null?void 0:he.modelId)??"This model"} can't see images`;return a.jsx("section",{className:"flex h-full min-h-0 flex-col items-center overflow-y-auto px-6 py-8","data-testid":"draft-home",children:a.jsxs("div",{className:"mx-auto my-auto flex w-full max-w-[44rem] flex-col items-center justify-center gap-6",children:[a.jsx(are,{className:"size-14 text-foreground"}),a.jsx("h2",{className:"text-center text-3xl font-normal tracking-tight text-foreground max-lg:text-2xl",children:"Build something useful with PiNomad"}),a.jsxs("div",{className:"flex w-full flex-col gap-3",children:[a.jsx(kN,{inputRef:B,onFiles:R}),a.jsx(X3,{inputRef:D,onFiles:K}),O.uploading?a.jsx(Y,{type:"supporting",children:"Uploading files…"}):null,a.jsx(Z3,{value:f,inputRef:v,onValueChange:h,onFocus:P.request,triggers:U.length===0?void 0:U,status:x?"submitted":"ready",onSubmit:()=>{var pe;const V=P3(d.draft),xe=V.text.trim();if(xe===""&&T.length===0&&O.entries.length===0||O.uploading||O.failed||$||x||X!==void 0||!c.beginSubmit())return;yd();const ve=(pe=t.view.current().conversation)==null?void 0:pe.conversation.id,ke=T,me=O.ids();t.controller.createConversation(s,xe,{...s.kind==="project"&&g==="local"?{checkout:"project"}:{},...M===void 0?{...m.model===void 0?{}:{model:m.model},thinkingLevel:m.level}:M.send,...ke.length===0?{}:{images:ke},skills:V.skills,...me.length===0?{}:{attachments:me}}).then(()=>{var Xe;const Qe=(Xe=t.view.current().conversation)==null?void 0:Xe.conversation.id;Qe!==void 0&&Qe!==ve&&(d.restore("",[]),H(),O.clear(),i())}).finally(()=>c.endSubmit())},isDisabled:!o,submitDisabled:X!==void 0||O.uploading||O.failed,placeholder:CN("Do anything with Pi",{agents:Z.length>0,files:ne!==void 0,commands:!1,skills:P.trigger!==void 0}),attachments:bN({images:T,pending:$,onRemove:N,...O.entries.length===0?{}:{files:a.jsx(a.Fragment,{children:O.entries.map(V=>a.jsx(yN,{entry:V,onRetry:O.retry,onRemove:O.remove},V.key))})}}),hasAttachments:T.length>0||O.entries.length>0,onFiles:K,error:_??O.error??q,startActions:a.jsxs(a.Fragment,{children:[a.jsxs(SN,{isDisabled:!o,children:[a.jsx(Ai,{icon:A3,label:"Add images…",hint:te??"Or paste or drop",isDisabled:!z,onClick:()=>{var V;return(V=B.current)==null?void 0:V.click()}}),L?a.jsx(Ai,{icon:Hd,label:"Attach files…",hint:"Up to 10 · 10 MB each",onClick:()=>{var V;return(V=D.current)==null?void 0:V.click()}}):null,P.trigger===void 0?null:a.jsx(Ai,{icon:Jg,label:"Use a skill…",hint:"Or type $",onClick:()=>{var V;return(V=v.current)==null?void 0:V.openTrigger("$")}}),Z.length===0?null:a.jsx(Ai,{icon:Sh,label:"Mention an agent…",hint:"Or type @",onClick:()=>{var V;return(V=v.current)==null?void 0:V.openTrigger("@")}})]}),a.jsx(O3,{models:e.models,selected:{model:m.model,level:m.level},isDisabled:!o,agent:se?{kind:"pick",roles:Z,value:j,onChange:A}:void 0,sourceHint:ie,...X===void 0?{}:{problem:lre(X)},onModelChange:k,onLevelChange:b})]}),footer:a.jsxs("span",{className:"pigui-draft-footer flex w-full min-w-0 flex-wrap items-center gap-y-1",children:[l===void 0||l.options.length<2?null:a.jsx(oc,{isLabelHidden:!0,label:"Machine",placement:"below",variant:"ghost",size:"sm",value:l.value,startIcon:a.jsx(R1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:l.options.map(V=>({...V,icon:a.jsx(R1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})})),onChange:V=>{V!==l.value&&l.onChange(V)}}),a.jsx(oc,{isLabelHidden:!0,label:"Project",placeholder:"No project",placement:"below",variant:"ghost",size:"sm",isDisabled:!o,value:s.kind==="chat"?"chat":s.path,startIcon:s.kind==="chat"?a.jsx(l9,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}):a.jsx(I1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:[{value:"chat",label:"No project",icon:a.jsx(l9,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})},...e.organized.projects.map(V=>({value:V.project.path,label:V.project.name,icon:a.jsx(I1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})}))],onChange:V=>r(V==="chat"?{kind:"chat"}:{kind:"project",path:V})}),s.kind==="project"?a.jsx(Dse,{value:g,onChange:y,isDisabled:!o}):null]})})]})]})})}const tw=new WeakMap;function ure(e){let t=tw.get(e);return t===void 0&&(t=new pN(n=>e.controller.listCommands(n),n=>`conversation:${n}`,n=>n.commands),tw.set(e,t)),t}const dre=e=>new RegExp("^\\/\\P{White_Space}*$","u").test(e);function fre(e,t){return e.filter(n=>n.name.startsWith(t)).map(n=>({id:`command:${n.name}`,label:n.name,auxiliaryData:n}))}function hre(e,t,n,s,r){const{items:i,request:o}=xN(ure(e),t,s),l=p.useRef(i);l.current=i;const c=p.useRef(o);c.current=o;const u=s&&dre(r),d=p.useMemo(()=>{if(!u)return;let f="";return{character:"/",searchSource:{bootstrap:()=>[],search:x=>(f=x,c.current(),fre(l.current??[],x)),cancel:()=>{}},menuLabel:"Commands",emptySearchResultsText:"No matching commands",renderItem:x=>{const g=x.auxiliaryData;return a.jsxs("span",{"aria-disabled":g.disabled===void 0?void 0:!0,className:`flex w-full min-w-0 items-center gap-2 ${g.disabled===void 0?"":"opacity-50"}`,children:[a.jsx(E3,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),a.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[a.jsxs("span",{className:"max-w-[60%] shrink-0 truncate",children:["/",g.name,g.argumentHint===void 0?null:a.jsxs("span",{className:"text-muted",children:[" ",g.argumentHint]})]}),a.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:g.disabled??g.description})]})]})},onSelect:x=>{const g=x.auxiliaryData;return g.disabled===void 0?`/${g.name} `:`/${f}`}}},[u,i]);return p.useEffect(()=>{var f;d!==void 0&&((f=n.current)==null||f.emitInput())},[d,n]),{trigger:d,commands:i,request:o}}const Wx='<skill name="',nw='" location="',sw=`">
386
- References are relative to `,rw=`
387
- </skill>`,ey=`
388
-
389
- `,pre=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function xre(e,t){if(!e.startsWith(Wx,t))return-1;let n=t+Wx.length;const s=n;for(;n<e.length&&pre(e.charCodeAt(n));)n+=1;if(n===s||!e.startsWith(nw,n))return-1;n+=nw.length;const r=n;for(;n<e.length&&e[n]!=='"'&&e[n]!==`
390
- `;)n+=1;if(n===r||!e.startsWith(sw,n))return-1;n+=sw.length;const i=e.indexOf(`
391
- `,n);if(i-n<2||e[i-1]!=="."||e[i+1]!==`
392
- `)return-1;const o=e.indexOf(rw,i+1);return o===-1?-1:o+rw.length}function gre(e){const t=[];let n=0;for(;;){const s=xre(e,n);if(s===-1||!e.startsWith(ey,s)||s+ey.length===e.length)return{text:e.slice(n),skills:t};t.push(e.slice(n+Wx.length,e.indexOf('"',n+Wx.length))),n=s+ey.length}}function Y3(e){const t=[];let n="";if(typeof e=="string")n=e;else for(const r of e){if(r.type!=="text"||typeof r.text!="string")continue;const i=one(r.text);i!==void 0?t.push(...i):n+=r.text}const s=gre(n);return{text:s.text,skills:s.skills,attachments:t}}function mre(e){return typeof e=="string"||!Array.isArray(e)?0:e.filter(t=>t.type==="image").length}function yre(e){return typeof e=="string"||!Array.isArray(e)?[]:e.flatMap(t=>{if(t.type!=="image"||t.mimeType===void 0)return[];const n=t.mimeType;return typeof t.data=="string"&&t.data!==""?[{data:t.data,mimeType:n}]:typeof t.ref=="string"&&t.ref!==""?[{ref:t.ref,mimeType:n}]:[]})}const vre=e=>e.docs["pi.live"]??{},Q3=e=>e.docs["pi.agent"]??{};function kre(e){var r;const t=vre(e),n=t.generation,s=(r=t.compactions)==null?void 0:r[0];return(n==null?void 0:n.retry)!==void 0?`Retrying (attempt ${n.attempt+1}): ${n.retry.error}`:(n==null?void 0:n.deferred)!==void 0?"Waiting for deferred response...":s!==void 0?s.retry?`Retrying ${s.reason} compaction (attempt ${s.attempt+1})...`:`Compacting (${s.reason})...`:""}function bre(e,t=[]){const s=(e.docs["pi.inbox"]??{items:[]}).items.map(o=>{const l=o.mode==="write"?void 0:Y3(o.content);return{id:o.id,mode:o.mode,text:o.mode==="write"?`<${String(o.entry.kind)}>`:l.text,imageCount:o.mode==="write"?0:mre(o.content),attachmentCount:(l==null?void 0:l.attachments.length)??0,status:"sent"}}),r=new Set(s.map(o=>String(o.id))),i=t.flatMap(o=>{if(o.phase==="settled"||o.placement!=="queue")return[];if(o.conversationId!==void 0&&o.conversationId!==e.conversation.id)return[];if(o.submissionId!==void 0&&r.has(String(o.submissionId)))return[];const l=o.phase==="unknown"?"unknown":o.phase==="failed"?"failed":"sending";return[{requestId:o.requestId,mode:o.whenBusy,text:o.text,imageCount:o.images.length,attachmentCount:(o.attachmentDetails??o.attachments).length,status:l,local:{...o.error===void 0?{}:{error:o.error}}}]});return[...s,...i]}function wre(e,t){const s=(e.docs["pi.inbox"]??{items:[]}).items.find(i=>i.id===t);if(s===void 0||s.mode!=="steer"&&s.mode!=="followUp")return;const r=Y3(s.content);return{text:r.text,images:yre(s.content),skills:r.skills,attachments:r.attachments}}function jre(e){const t=e.docs["pi.usage"];return t===void 0?[]:[...Object.entries(t.models),...Object.entries(t.tools)].map(([n,s])=>({key:n,input:s.input,output:s.output,cost:s.cost.total}))}const Sre=new RegExp("\\p{White_Space}","u"),ty=(e,t)=>Sre.test(e[t]);function Cre(e,t){if(e.charCodeAt(0)!==47)return;let n=1;for(;n<e.length&&!ty(e,n);)n+=1;const s=e.slice(1,n);if(s===""||!t.some(o=>o.name===s))return;let r=n,i=e.length;for(;r<i&&ty(e,r);)r+=1;for(;i>r&&ty(e,i-1);)i-=1;return r===i?{name:s}:{name:s,args:e.slice(r,i)}}function Ere({body:e,tag:t,narrow:n=!1,isPending:s=!1,isEditDisabled:r=!1,editTooltip:i,status:o,isLocal:l=!1,onSteer:c,onRetry:u,onEdit:d,onWithdraw:f,className:h,...x}){return a.jsxs("div",{className:`chat-queued-message flex min-w-0 items-center gap-2 rounded-lg border border-border bg-surface py-1.5 pl-3 pr-2 text-sm ${n?"flex-wrap":""} ${h??""}`.trim(),"data-testid":"chat-queued-message",...x,children:[a.jsx("p",{className:"chat-queued-message__body min-w-0 flex-1 truncate","data-slot":"queued-message-body",title:e,children:e}),o===void 0?null:a.jsx("span",{className:"shrink-0","data-slot":"queued-message-status",children:o}),a.jsx("span",{className:"shrink-0 text-xs font-medium text-muted","data-slot":"queued-message-tag",children:t}),c===void 0&&u===void 0&&d===void 0&&f===void 0?null:a.jsxs("div",{className:`flex shrink-0 items-center gap-1${n?" w-full justify-end":""}`,children:[c===void 0?null:a.jsx(Q,{label:"Steer the run with this message",variant:"secondary",size:"sm",isDisabled:s,onClick:c,children:"Steer"}),u===void 0?null:a.jsx(Q,{label:"Retry this message",variant:"secondary",size:"sm",isDisabled:s,onClick:u,children:"Retry"}),d===void 0?null:a.jsx(Q,{label:l?"Edit this message":"Edit queued message",variant:"ghost",size:"sm",isDisabled:s||r,tooltip:r?i:void 0,onClick:d,children:"Edit"}),f===void 0?null:a.jsx(Q,{label:"Withdraw queued message",variant:"ghost",size:"sm",isDisabled:s,onClick:f,children:"Withdraw"})]})]})}const $re={steer:"Steer",followUp:"Follow-up",write:"Write"};function Are({status:e}){const t=e==="failed"?"error":e==="unknown"?"sending":e,n=a.jsx(bg,{status:t});return e!=="unknown"?n:a.jsx(w5,{locale:"en",overrides:{en:{"@astryx.chat.status.sending":"Not confirmed"}},children:n})}function Mre({items:e,canAct:t,busy:n,editDisabled:s,editTooltip:r,editRetryId:i,narrow:o,pendingIds:l,pendingRequestIds:c,onSteer:u,onRetry:d,onEdit:f,onWithdraw:h}){if(e.length===0)return null;const x=g=>{const y=[...g.imageCount===0?[]:[`${g.imageCount} ${g.imageCount===1?"image":"images"}`],...g.attachmentCount===0?[]:[`${g.attachmentCount} ${g.attachmentCount===1?"file":"files"}`]];if(y.length===0)return g.text;const v=y.join(" · ");return g.text===""?v:`${g.text} · ${v}`};return a.jsx("div",{className:"mx-auto mb-3 grid w-full gap-1.5","data-testid":"queued-message-list",children:e.map(g=>{const y=g.id===void 0,v=!y&&t&&g.mode!=="write",m=y&&(g.status==="unknown"||g.status==="failed"),k=y?g.status==="failed":v,b=y?g.requestId!==void 0&&c.has(g.requestId):l.has(g.id);return a.jsx(Ere,{"data-testid":y?"local-queued-message":"chat-queued-message",body:x(g),tag:$re[g.mode],status:a.jsx(Are,{status:g.status}),isLocal:y,narrow:o,isPending:b,isEditDisabled:k&&s&&(y||g.id!==i),editTooltip:s?r:void 0,onSteer:v&&g.mode==="followUp"&&n?()=>u(g):void 0,onRetry:m?()=>d(g):void 0,onEdit:k?()=>f(g):void 0,onWithdraw:v?()=>h(g):void 0},y?`local:${g.requestId}`:g.id)})})}async function Tre(e,t,n){try{return await Promise.all(e.map(s=>hZ(s,t,n)))}catch{return}}function zre({view:e,remote:t,conversation:n,busy:s,narrow:r,takeBack:i,onTakeBack:o,externalEditLocked:l=!1,onEditorStateChange:c,source:u}){var Gs,li,gs,ci,Ae,tt,Sn,be,bt,nn,ce,Se,Ue;const d=F3(Tse(n.conversation.id)),f=W3(d),{value:h,setValue:x}=f,[g,y]=p.useState(0),[v,m]=p.useState(!1),k=p.useRef(e.connection);k.current=e.connection;const b=jh(),j=Q3(n),A=kre(n),M=e.connection!=="connected",E=n.conversation.id,z=p.useRef(null),T=((Gs=e.home)==null?void 0:Gs.kind)!=="chat"&&Fe(((li=e.host)==null?void 0:li.protocol.minor)??0,"listFiles")?{key:`conversation:${n.conversation.id}`,list:re=>t.controller.listFiles({kind:"conversation",conversationId:n.conversation.id},re)}:void 0,$=V3(e.agents,z,T),_=G3(t,{kind:"conversation",conversationId:n.conversation.id},z,!M&&Fe(((gs=e.host)==null?void 0:gs.protocol.minor)??0,"listSkills"),f.pick);K3(z,f.draft);const R=Fe(((ci=e.host)==null?void 0:ci.protocol.minor)??0,"listCommands"),N=hre(t,n.conversation.id,z,!M&&R,h),H=[...$??[],..._.trigger===void 0?[]:[_.trigger],...N.trigger===void 0?[]:[N.trigger]],B=bre(n,e.submissions??[]),I=((Ae=e.agents)==null?void 0:Ae.roles)??[],L=(tt=Di(e.organized,n.conversation.id))==null?void 0:tt.summary,O=L==null?void 0:L.role,D=d3(L),q=L!==void 0&&L.kind!=="subagent"&&e.agents!==null&&Fe(((Sn=e.host)==null?void 0:Sn.protocol.minor)??0,"setAgent"),F=hr(e.models,j.model),K=(F==null?void 0:F.images)===!0,{images:Z,pending:se,error:ne,add:ue,restore:P,remove:U,clear:X}=wN(K,d),ie=Zt(((be=e.host)==null?void 0:be.protocol.minor)??0,"attachments")&&Fe(((bt=e.host)==null?void 0:bt.protocol.minor)??0,"beginAttachment"),te=vN(t,ie,d),de=p.useRef(null),[fe,he]=p.useState(void 0),V=re=>{const{images:Ce,others:_e}=uN(re);he(void 0),Ce.length>0&&ue(Ce),_e.length>0&&te.add(_e)},[xe,ve]=p.useState(void 0);p.useEffect(()=>ve(void 0),[h,Z.length,te.entries.length]);const ke=N.commands===void 0?"Loading…":N.commands.length===0?"None on this host":h.trim()!==""||Z.length>0||te.entries.length>0||se||te.uploading?"Clear the message first":void 0,me=p.useRef(null),pe=K||M?void 0:`${(F==null?void 0:F.name)??((nn=j.model)==null?void 0:nn.modelId)??"This model"} can't see images`,[Qe,Xe]=p.useState([]),$t=p.useRef(new Set),[At,en]=p.useState([]),rt=p.useRef(new Set),[zt,tn]=p.useState(!1),es=(re,Ce)=>$t.current.has(re)?!1:($t.current.add(re),Xe(_e=>[..._e,{id:re,kind:Ce}]),!0),hs=re=>{$t.current.delete(re),Xe(Ce=>Ce.filter(_e=>_e.id!==re))},Us=new Set(Qe.map(re=>re.id)),vt=Qe.some(re=>re.kind==="edit"),kt=h.trim()!==""||Z.length>0||te.entries.length>0||se,vr=kt||vt||v||zt||l,Vi=kt?"Clear the composer to edit":vr?"Finish the current edit first":void 0,Fs=vt||v||zt||l;p.useEffect(()=>{c==null||c({occupied:kt,locked:vt||v||zt})},[kt,vt,v,zt,c]);const ii=!M&&Fe(((ce=e.host)==null?void 0:ce.protocol.minor)??0,"withdrawQueued"),Vs=re=>{b({body:re instanceof Error?re.message:String(re),type:"error"})},Bn=async(re,Ce)=>{if(!rt.current.has(re)){rt.current.add(re),en(_e=>[..._e,re]);try{await Ce()}catch(_e){Vs(_e)}finally{rt.current.delete(re),en(_e=>_e.filter(dt=>dt!==re))}}},qr=re=>{Bn(re,()=>t.controller.retrySubmission(re))},oi=re=>{vr||(tn(!0),Bn(re,async()=>{const Ce=await t.controller.takeBackSubmission(re);Ce!==void 0&&(f.restore(Ce.text,Ce.skills),P(Ce.images.flatMap(_e=>"data"in _e?[_e]:[])),te.restore(Ce.attachmentDetails??[]),y(_e=>_e+1))}).finally(()=>tn(!1)))},pn=async re=>{const Ce=re.id;if(!(Ce===void 0||!es(Ce,"withdraw")))try{await t.controller.withdrawQueued(Ce,E)==="sent"&&b({body:"Already sent — can't withdraw"})}catch(_e){Vs(_e)}finally{hs(Ce)}},ps=async re=>{const Ce=re.id;if(!(Ce===void 0||!es(Ce,"steer")))try{await t.controller.steerQueued(Ce,E)}catch(_e){Vs(_e)}finally{hs(Ce)}},xn=p.useRef(null),qt=async re=>{if(es(re.id,"edit"))try{const Ce=await Tre(re.input.images,_e=>t.controller.image(_e),u);if(Ce===void 0){xn.current=null,m(!1),b({body:"Couldn't load the original images — try again",type:"error"});return}await eT(Ce),re.input={...re.input,images:Ce},await t.controller.withdrawQueued(re.id,re.conversationId)==="withdrawn"?(f.restore(re.input.text,re.input.skills),P(Ce),te.restore(re.input.attachments),xn.current=null,m(!1),y(_e=>_e+1)):(xn.current=null,m(!1),b({body:"Already sent — can't withdraw"}))}catch(Ce){Vs(Ce),k.current=t.view.current().connection,k.current==="connected"?(xn.current=null,m(!1)):m(!0)}finally{hs(re.id)}},xs=async re=>{var Pt;if(re.id===void 0){re.requestId!==void 0&&oi(re.requestId);return}const _e=(((Pt=xn.current)==null?void 0:Pt.id)===re.id&&xn.current.conversationId===E?xn.current.input:void 0)??wre(n,re.id);if(_e===void 0)return;const dt={conversationId:E,id:re.id,input:_e};xn.current=dt,await qt(dt)};p.useEffect(()=>{if(e.connection!=="connected"||!v)return;const re=xn.current;re===null||re.conversationId!==E||$t.current.has(re.id)||qt(re)},[e.connection,v,E]),p.useEffect(()=>{var re;g>0&&((re=z.current)==null||re.focusAtEnd())},[g]),p.useEffect(()=>{i!==void 0&&(f.restore(i.text,i.skills),P(i.images.flatMap(re=>"data"in re?[re]:[])),te.restore(i.attachmentDetails??[]),y(re=>re+1),o==null||o())},[i]);const ai=re=>{var Xa,fb;const Ce=P3(f.draft),_e=Ce.text.trim();if(Fs||te.uploading||_e===""&&Z.length===0&&te.entries.length===0||se)return;const dt=N.commands===void 0?void 0:Cre(Ce.text,N.commands);if(dt!==void 0){const Ah=(fb=(Xa=N.commands)==null?void 0:Xa.find(kR=>kR.name===dt.name))==null?void 0:fb.disabled;if(Ah!==void 0){ve(Ah);return}if(Z.length>0){ve("Commands can't include images");return}if(te.entries.length>0){ve("Commands can't include files");return}t.controller.runCommand(dt.name,dt.args),x("");return}if(yd(),te.failed){he("Some files failed to upload — retry or remove them");return}const Pt=Z,Gi=te.ids(),Gd=te.details();t.controller.submit(_e,re,{images:Pt,...Pt.some(Ah=>!("data"in Ah))?{imageViews:Pt}:{},skills:Ce.skills,...Gi.length===0?{}:{attachments:Gi},...Gd.length===0?{}:{attachmentDetails:Gd}}),x(""),X(),te.clear(),he(void 0)};return a.jsxs(a.Fragment,{children:[A===""&&!te.uploading?null:a.jsx(Y,{type:"supporting",children:te.uploading?"Uploading files…":A}),a.jsx(Mre,{items:B,canAct:ii,busy:s,editDisabled:vr,editTooltip:Vi,editRetryId:v?(Se=xn.current)==null?void 0:Se.id:void 0,narrow:r,pendingIds:Us,pendingRequestIds:new Set(At),onSteer:re=>void ps(re),onRetry:re=>{re.requestId!==void 0&&qr(re.requestId)},onEdit:re=>void xs(re),onWithdraw:re=>void pn(re)}),a.jsx(kN,{inputRef:me,onFiles:Fs?()=>{}:ue}),a.jsx(X3,{inputRef:de,onFiles:Fs?()=>{}:V}),a.jsx(Z3,{value:h,inputRef:z,status:s?"streaming":"ready",isDisabled:M||Fs,placeholder:s?"Steer the running turn…":CN("Ask",{agents:I.length>0,files:T!==void 0,commands:R,skills:_.trigger!==void 0}),onValueChange:x,onSubmit:()=>ai("steer"),onFocus:()=>{_.request(),N.request()},triggers:H.length===0?void 0:H,onStop:s?()=>void t.controller.abort():void 0,attachments:bN({images:Z,pending:se,onRemove:U,...te.entries.length===0?{}:{files:a.jsx(a.Fragment,{children:te.entries.map(re=>a.jsx(yN,{entry:re,onRetry:te.retry,onRemove:te.remove},re.key))})}}),hasAttachments:Z.length>0||te.entries.length>0,onFiles:Fs?void 0:V,error:xe??ne??te.error??fe,submitDisabled:te.uploading||te.failed,startActions:a.jsxs(a.Fragment,{children:[a.jsxs(SN,{isDisabled:M||Fs,onOpenChange:re=>{re&&N.request(!0)},children:[a.jsx(Ai,{icon:A3,label:"Add images…",hint:pe??"Or paste or drop",isDisabled:!K,onClick:()=>{var re;return(re=me.current)==null?void 0:re.click()}}),ie?a.jsx(Ai,{icon:Hd,label:"Attach files…",hint:"Up to 10 · 10 MB each",onClick:()=>{var re;return(re=de.current)==null?void 0:re.click()}}):null,_.trigger===void 0?null:a.jsx(Ai,{icon:Jg,label:"Use a skill…",hint:"Or type $",onClick:()=>{var re;return(re=z.current)==null?void 0:re.openTrigger("$")}}),I.length===0?null:a.jsx(Ai,{icon:Sh,label:"Mention an agent…",hint:"Or type @",onClick:()=>{var re;return(re=z.current)==null?void 0:re.openTrigger("@")}}),R?a.jsx(Ai,{icon:E3,label:"Run a command…",hint:ke??"Or type /",isDisabled:ke!==void 0,onClick:()=>{var re;return(re=z.current)==null?void 0:re.openTrigger("/")}}):a.jsx(Ai,{icon:oT,label:"Compact conversation",hint:"Frees up context",onClick:()=>void t.controller.compact(void 0)})]}),a.jsx(O3,{models:e.models,selected:{model:j.model,level:j.thinkingLevel??"off"},isDisabled:M,agent:q?{kind:"pick",roles:I,value:D,onChange:re=>{t.controller.setAgent(re??null).catch(Vs)}}:O===void 0?void 0:{kind:"fixed",name:O,description:(Ue=I.find(re=>re.name===O))==null?void 0:Ue.description},onModelChange:re=>void t.controller.setModel(re),onLevelChange:re=>void t.controller.setThinkingLevel(re)})]}),endActions:s&&(h.trim()!==""||Z.length>0||te.entries.length>0)?a.jsx(Q,{label:"Follow-up",variant:"ghost",size:r?"md":"sm",tooltip:"Queue after the running turn",isDisabled:M||se||Fs||te.uploading||te.failed,onClick:()=>ai("followUp")}):null})]})}function Nre(e,t){return e!==void 0&&e.conversationId===t?e.draft:void 0}function _re(e,t){return!t&&e!==void 0&&e.images.length===0&&e.attachments.length===0}function Tl(e,t,n){return e>=t&&e<=n}function EN(e){return e===8205}function Rre(e){return Tl(e,55296,56319)}function iw(e){return Tl(e,127462,127487)}function $N(e){return Tl(e,65024,65039)}function AN(e){return Tl(e,768,879)||Tl(e,6832,6911)||Tl(e,7616,7679)||Tl(e,65056,65071)}function Rp(e){return e>65535?2:1}function ow(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(AN(n)||$N(n))t+=Rp(n);else break}return t}function MN(e,t){const n=e.codePointAt(t);let s=t+Rp(n);for(s=ow(e,s);s<e.length-1&&EN(e.codePointAt(s));){const r=e.codePointAt(s+1);s+=1+Rp(r),s=ow(e,s)}return iw(n)&&s<e.length&&iw(e.codePointAt(s))&&(s+=Rp(e.codePointAt(s))),s}function TN(e){return e>=768&&(Rre(e)||AN(e)||$N(e)||EN(e))}function Ire(e,t){let n=0,s=0;for(;s<e.length;)if(s=MN(e,s),++n>=t)return!0;return!1}function Lre(e,t){let n=0,s=0;for(;s<e.length;)if(s=MN(e,s),++n>t)return!1;return!0}function Ore(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(TN(e.charCodeAt(n)))return Ire(e,t);if(++n>=t)return!0}}function Dre(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(TN(e.charCodeAt(n)))return Lre(e,t);if(++n>t)return!1}}function ut(e){return Array.isArray(e)}function Br(e){return je(typeof e,"bigint")}function Ac(e){return je(typeof e,"boolean")}function zN(e){if(fn(e)||!B1(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function B1(e){return je(typeof e,"function")}function NN(e){return Number.isInteger(e)}function Eh(e){return je(e,null)}function Dn(e){return Number.isFinite(e)}function Bre(e){return Kt(e)&&!ut(e)}function Kt(e){return je(typeof e,"object")&&!Eh(e)}function bn(e){return je(typeof e,"string")}function _N(e){return je(typeof e,"symbol")}function fn(e){return je(e,void 0)}function je(e,t){return e===t}function RN(e,t){return e>t}function IN(e,t){return e<t}function Ud(e,t){return e<=t}function sm(e,t){return e>=t}function Hre(e,t){if(Br(e)||Br(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!Dn(e)||NN(e)&&1/t%1===0)return!0;const s=e%t;return Math.min(Math.abs(s),Math.abs(s-t),Math.abs(s+t))<n}function qre(e){if(!Kt(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return Eh(t)?!1:je(typeof t.constructor,"function")&&!(je(t.constructor,globalThis.Object)||je(t.constructor.name,"Object"))}function LN(e){return Br(e)||Ac(e)||Eh(e)||Dn(e)||bn(e)||fn(e)}function Pre(e,t){return Dre(e,t)}function Ure(e,t){return Ore(e,t)}function Jn(e,t,n){return e.every((s,r)=>r<t||n(s,r))}function ON(e,t){return e.some((n,s)=>t(n,s))}function Fre(e,t){let n=!1;return e.forEach((s,r)=>{t(s,r)&&(n=!0)}),n}function DN(e,t){return e.reduce((n,s,r)=>t(s,r)?++n:n,0)}function rm(e){return je(e,"__proto__")||je(e,"constructor")||je(e,"prototype")}function we(e,t){return rm(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function gc(e){return Object.entries(e)}function wn(e){return Object.getOwnPropertyNames(e)}function Vre(e){return Object.getOwnPropertySymbols(e)}function Gre(e,t){if(!Kt(t))return!1;const n=wn(e);return je(n.length,wn(t).length)&&n.every(s=>im(e[s],t[s]))}function Wre(e,t){return ut(t)&&je(e.length,t.length)&&e.every((n,s)=>im(e[s],t[s]))}function im(e,t){return ut(e)?Wre(e,t):Kt(e)?Gre(e,t):je(e,t)}function Kre(e){return e instanceof Boolean}function Xre(e){return e instanceof Number}function Zre(e){return e instanceof String}function BN(e){return globalThis.ArrayBuffer.isView(e)}function HN(e){return e instanceof globalThis.RegExp}function Yre(e){return e instanceof globalThis.Date}function Qre(e){return e instanceof globalThis.Set}function Jre(e){return e instanceof globalThis.Map}const eie={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function qN(){return eie}function tie(e){return we(e,"~kind")||we(e,"~unsafe")}function nie(e){const t={};for(const n of wn(e)){if(rm(n))continue;const s=Object.getOwnPropertyDescriptor(e,n);s.value=mc(s.value),je(s.enumerable,!0)?t[n]=s.value:Object.defineProperty(t,n,s)}return t}function sie(e){const t={};for(const n of wn(e))rm(n)||(t[n]=mc(e[n]));for(const n of Vre(e))t[n]=mc(e[n]);return t}function rie(e){return qre(e)?e:tie(e)?nie(e):sie(e)}function iie(e){return e.map(t=>mc(t))}function oie(e){return e.slice()}function aie(e){return new RegExp(e.source,e.flags)}function lie(e){return new Map(mc([...e.entries()]))}function cie(e){return new Set(mc([...e.values()]))}function mc(e){return BN(e)?oie(e):HN(e)?aie(e):Jre(e)?lie(e):Qre(e)?cie(e):ut(e)?iie(e):Kt(e)?rie(e):e}function uie(e){return mc(e)}function die(e,t){for(const n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function fie(e,t){return{...e,...t}}function Ka(e,t,n={}){const s=fie(t,n),r=die(s,e);return r}function PN(e,t,n){const s=qN(),r=uie(e);for(const i of Object.keys(t))Object.defineProperty(r,i,{configurable:!0,writable:!0,enumerable:s.enumerableKind,value:t[i]});for(const i of Object.keys(n))Object.defineProperty(r,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return r}function hie(e){return Kt(e)}function pie(e){return PN(e,{"~optional":!0},{})}function xie(e,t){return PN(pie(e),{},t)}function Mc(e,t){return Ka({"~kind":"Array"},{type:"array",items:e},t)}function gie(e,t={}){return xie(e,t)}function xo(e){return gie(e)}function mie(e){return hie(e)&&we(e,"~optional")}function yie(e){return wn(e).filter(t=>!mie(e[t]))}function Cs(e,t={}){const n=yie(e),s=n.length>0?{required:n}:{};return Ka({"~kind":"Object"},{type:"object",...s,properties:e},t)}function J3(e){return Ka({"~kind":"Unknown"},{},e)}function UN(e,t){var n;return((n=t[e.length])==null?void 0:n.call(t,...e))??(()=>{throw Error("Invalid Arguments")})()}function vie(){throw new Error("Unreachable")}function kie(e){const t=new Set;let n=e;for(;n&&n!==Object.prototype;){for(const s of Reflect.ownKeys(n))s!=="constructor"&&typeof s!="symbol"&&t.add(s);n=Object.getPrototypeOf(n)}return[...t]}function bie(e){return typeof e=="number"}var us;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(us||(us={}));let pu=BigInt("14695981039346656037");const[wie,jie]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Sie=Array.from({length:256}).map((e,t)=>BigInt(t)),FN=new Float64Array(1),VN=new DataView(FN.buffer),GN=new Uint8Array(FN.buffer);function jn(e){pu=pu^Sie[e],pu=pu*wie%jie}function Cie(e){jn(us.Array);for(const t of e)qa(t)}function Eie(e){jn(us.BigInt),VN.setBigInt64(0,e);for(const t of GN)jn(t)}function aw(e){jn(us.Boolean),jn(e?1:0)}function $ie(e){jn(us.Constructor),qa(e.toString())}function Aie(e){jn(us.Date),qa(e.getTime())}function Mie(e){jn(us.Function),qa(e.toString())}function Tie(e){jn(us.Null)}function lw(e){jn(us.Number),VN.setFloat64(0,e,!0);for(const t of GN)jn(t)}function zie(e){jn(us.Object);for(const t of kie(e).sort())qa(t),qa(e[t])}function Nie(e){jn(us.RegExp),Uk(e.toString())}const _ie=new TextEncoder;function Uk(e){jn(us.String);for(const t of _ie.encode(e))jn(t)}function Rie(e){jn(us.Symbol),qa(e.toString())}function Iie(e){jn(us.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)jn(t[n])}function Lie(e){return jn(us.Undefined)}function qa(e){return BN(e)?Iie(e):Yre(e)?Aie(e):HN(e)?Nie(e):Kre(e)?aw(e.valueOf()):Zre(e)?Uk(e.valueOf()):Xre(e)?lw(e.valueOf()):bie(e)?lw(e):ut(e)?Cie(e):Ac(e)?aw(e):Br(e)?Eie(e):zN(e)?$ie(e):Eh(e)?Tie():Kt(e)?zie(e):bn(e)?Uk(e):_N(e)?Rie(e):fn(e)?Lie():B1(e)?Mie(e):vie()}function Oie(e){return pu=BigInt("14695981039346656037"),qa(e),pu}function Die(e){return Oie(e).toString(16).padStart(16,"0")}function Bie(e){return Ka({"~kind":"Boolean"},{type:"boolean"},e)}class Hie extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function qie(e){return Br(e)?"bigint":Ac(e)?"boolean":Dn(e)?"number":bn(e)?"string":(()=>{throw new Hie(e)})()}function ar(e,t){return Ka({"~kind":"Literal"},{type:qie(e),const:e},t)}function Iu(e){return Ka({"~kind":"Number"},{type:"number"},e)}function cs(e){return Ka({"~kind":"String"},{type:"string"},e)}function om(e,t={}){return Ka({"~kind":"Union"},{anyOf:e},t)}function Fk(e,t){return Array.from({length:t-e+1},(n,s)=>String.fromCharCode(e+s))}[...Fk(97,122),...Fk(65,90)];const Pie="0",Uie=Fk(49,57);[...Uie];function Fie(e){return we(e,"~refine")&&ut(e["~refine"])&&Jn(e["~refine"],0,t=>Kt(t)&&we(t,"check")&&we(t,"error")&&B1(t.check)&&B1(t.error))}function gr(e){return Kt(e)&&!ut(e)}function Kx(e){return Ac(e)}function Ht(e){return gr(e)||Kx(e)}function Vie(e){return we(e,"additionalItems")&&Ht(e.additionalItems)}function Gie(e){return we(e,"additionalProperties")&&Ht(e.additionalProperties)}function Wie(e){return we(e,"allOf")&&ut(e.allOf)&&e.allOf.every(t=>Ht(t))}function Vk(e){return we(e,"$anchor")&&bn(e.$anchor)}function Kie(e){return we(e,"anyOf")&&ut(e.anyOf)&&e.anyOf.every(t=>Ht(t))}function Xie(e){return we(e,"const")}function eb(e){return we(e,"contains")&&Ht(e.contains)}function Zie(e){return we(e,"dependencies")&&Kt(e.dependencies)&&Object.values(e.dependencies).every(t=>Ht(t)||ut(t)&&t.every(n=>bn(n)))}function Yie(e){return we(e,"dependentRequired")&&Kt(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>ut(t)&&t.every(n=>bn(n)))}function Qie(e){return we(e,"dependentSchemas")&&Kt(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Ht(t))}function yc(e){return we(e,"$dynamicAnchor")&&bn(e.$dynamicAnchor)}function Jie(e){return we(e,"$dynamicRef")&&bn(e.$dynamicRef)}function eoe(e){return we(e,"else")&&Ht(e.else)}function toe(e){return we(e,"enum")&&ut(e.enum)}function noe(e){return we(e,"exclusiveMaximum")&&(Dn(e.exclusiveMaximum)||Br(e.exclusiveMaximum))}function soe(e){return we(e,"exclusiveMinimum")&&(Dn(e.exclusiveMinimum)||Br(e.exclusiveMinimum))}function roe(e){return we(e,"format")&&bn(e.format)}function si(e){return we(e,"$id")&&bn(e.$id)}function ioe(e){return we(e,"if")&&Ht(e.if)}function tb(e){return we(e,"items")&&(Ht(e.items)||ut(e.items)&&e.items.every(t=>Ht(t)))}function ooe(e){return tb(e)&&ut(e.items)}function aoe(e){return we(e,"maximum")&&(Dn(e.maximum)||Br(e.maximum))}function loe(e){return we(e,"maxContains")&&Dn(e.maxContains)}function coe(e){return we(e,"maxItems")&&Dn(e.maxItems)}function uoe(e){return we(e,"maxLength")&&Dn(e.maxLength)}function doe(e){return we(e,"maxProperties")&&Dn(e.maxProperties)}function foe(e){return we(e,"minimum")&&(Dn(e.minimum)||Br(e.minimum))}function WN(e){return we(e,"minContains")&&Dn(e.minContains)}function hoe(e){return we(e,"minItems")&&Dn(e.minItems)}function poe(e){return we(e,"minLength")&&Dn(e.minLength)}function xoe(e){return we(e,"minProperties")&&Dn(e.minProperties)}function goe(e){return we(e,"multipleOf")&&(Dn(e.multipleOf)||Br(e.multipleOf))}function moe(e){return we(e,"not")&&Ht(e.not)}function yoe(e){return we(e,"oneOf")&&ut(e.oneOf)&&e.oneOf.every(t=>Ht(t))}function voe(e){return we(e,"pattern")&&(bn(e.pattern)||e.pattern instanceof RegExp)}function KN(e){return we(e,"patternProperties")&&Kt(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Ht(t))}function XN(e){return we(e,"prefixItems")&&ut(e.prefixItems)&&e.prefixItems.every(t=>Ht(t))}function ZN(e){return we(e,"properties")&&Kt(e.properties)&&Object.values(e.properties).every(t=>Ht(t))}function koe(e){return we(e,"propertyNames")&&(Kt(e.propertyNames)||Ht(e.propertyNames))}function boe(e){return we(e,"$recursiveAnchor")&&Ac(e.$recursiveAnchor)}function Gk(e){return boe(e)&&je(e.$recursiveAnchor,!0)}function woe(e){return we(e,"$recursiveRef")&&bn(e.$recursiveRef)}function joe(e){return we(e,"$ref")&&bn(e.$ref)}function YN(e){return we(e,"required")&&ut(e.required)&&e.required.every(t=>bn(t))}function Soe(e){return we(e,"then")&&Ht(e.then)}function Coe(e){return we(e,"type")&&(bn(e.type)||ut(e.type)&&e.type.every(t=>bn(t)))}function Eoe(e){return we(e,"uniqueItems")&&Ac(e.uniqueItems)}function $oe(e){return we(e,"unevaluatedItems")&&Ht(e.unevaluatedItems)}function Aoe(e){return we(e,"unevaluatedProperties")&&Ht(e.unevaluatedProperties)}class Fd{constructor(){const t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){const t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(const n of t)n.GetIndices().forEach(s=>this.GetIndices().add(s)),n.GetKeys().forEach(s=>this.GetKeys().add(s));return!0}}function Moe(e,t,n,s){return Jn(n["~refine"],0,(r,i)=>r.check(s))}function Toe(e){return tb(e)&&ut(e.items)}function zoe(e,t,n,s){return Toe(n)?Jn(s,0,(i,o)=>IN(o,n.items.length)||Tc(e,t,n.additionalItems,i)&&t.AddIndex(o)):!0}function nb(e){return new RegExp(e,"u")}function Noe(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function _oe(e){const t=[];return KN(e)&&t.push(...wn(e.patternProperties)),ZN(e)&&t.push(...wn(e.properties).map(Noe)),je(t.length,0)?"(?!)":`(${t.join("|")})`}function Roe(e,t,n,s){const r=nb(_oe(n));return Jn(wn(s),0,(o,l)=>r.test(o)||Tc(e,t,n.additionalProperties,s[o])&&t.AddKey(o))}function Ioe(e,t,n,s){const r=n.allOf.reduce((i,o)=>{const l=new Fd;return hn(e,l,o,s)?[...i,l]:i},[]);return je(r.length,n.allOf.length)&&t.Merge(r)}function Loe(e,t,n,s){const r=n.anyOf.reduce((i,o)=>{const l=new Fd;return hn(e,l,o,s)?[...i,l]:i},[]);return RN(r.length,0)&&t.Merge(r)}function Ooe(e,t,n,s){return n}function Doe(e,t,n,s){return LN(n.const)?je(s,n.const):im(s,n.const)}function Boe(e){return!(WN(e)&&je(e.minContains,0))}function Hoe(e,t,n,s){return Boe(n)?!je(s.length,0)&&Fre(s,(r,i)=>hn(e,t,n.contains,r)&&t.AddIndex(i)):!0}function qoe(e,t,n,s){const r=je(wn(s).length,0),i=Jn(gc(n.dependencies),0,([o,l])=>!we(s,o)||(ut(l)?l.every(c=>we(s,c)):hn(e,t,l,s)));return r||i}function Poe(e,t,n,s){const r=je(wn(s).length,0),i=Jn(gc(n.dependentRequired),0,([o,l])=>!we(s,o)||l.every(c=>we(s,c)));return r||i}function Uoe(e,t,n,s){const r=je(wn(s).length,0),i=Jn(gc(n.dependentSchemas),0,([o,l])=>!we(s,o)||hn(e,t,l,s));return r||i}function Foe(e,t,n,s){const r=e.DynamicRef(n)??!1;return Ht(r)&&hn(e,t,r,s)}function Voe(e,t,n,s){return ON(n.enum,r=>LN(r)?je(s,r):im(s,r))}function Goe(e,t,n,s){return IN(s,n.exclusiveMaximum)}function Woe(e,t,n,s){return RN(s,n.exclusiveMinimum)}const Koe=[0,31,28,31,30,31,30,31,31,30,31,30,31],Xoe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Zoe(e){return e%4===0&&(e%100!==0||e%400===0)}function QN(e){const t=Xoe.exec(e);if(!t)return!1;const n=+t[1],s=+t[2],r=+t[3];return s>=1&&s<=12&&r>=1&&r<=(s===2&&Zoe(n)?29:Koe[s])}const Yoe=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function JN(e,t=!0){const n=Yoe.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;const s=+n[1],r=+n[2],i=+n[3];if(s>23||r>59||i>60)return!1;if(n[5]){const d=+n[6],f=+n[7];if(d>23||f>59)return!1}if(i<60)return!0;const o=n[5]==="-"?-1:1,l=+(n[6]||0),c=+(n[7]||0);return((s*60+r-o*(l*60+c))%1440+1440)%1440===1439}function Qoe(e){const t=e.split(/T/i);return t.length===2&&QN(t[0])&&JN(t[1])}const Joe=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function eae(e){return Joe.test(e)}const tae=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function nae(e){return tae.test(e)}const sae=new RegExp("^(?!-).*(?<!-)$"),rae=/^(?!..--)/,iae=/^[a-zA-Z0-9-]*$/,sb=/[^\p{ASCII}]/u,oae=/[0-9]/,aae=/[\u{0660}-\u{0669}]/u,lae=/[\u{06f0}-\u{06f9}]/u,cae=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,uae=/[\u{002d}\u{002b}]/u,e_=new RegExp("\\p{Mn}","u"),dae=new RegExp("\\p{Mc}","u"),fae=/[\p{Mn}\p{Mc}\p{Me}]/u,t_=new RegExp("\\p{L}","u"),hae=new RegExp("\\p{Nd}","u"),pae=new RegExp("\\p{Script=Greek}","u"),n_=new RegExp("\\p{Script=Hebrew}","u"),xae=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,gae=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,cw=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,mae=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,yae=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,vae=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,kae=new RegExp([oae,lae].map(e=>e.source).join("|"),"u"),bae=new RegExp([t_,uae,cae,hae,e_,dae,yae,vae].map(e=>e.source).join("|"),"u");function wae(e){return sae.test(e)&&rae.test(e)&&iae.test(e)}const Jr=36,s1=1,H1=26,jae=38,Sae=700,s_=72,r_=128;function ny(){throw null}function i_(e){return e.toLowerCase().startsWith("xn--")}function o_(e,t,n){e=n?Math.floor(e/Sae):e>>1,e+=Math.floor(e/t);let s=0;for(;e>(Jr-s1)*H1>>1;)e=Math.floor(e/(Jr-s1)),s+=Jr;return s+Math.floor((Jr-s1+1)*e/(e+jae))}function a_(e){const t=[];let n=r_,s=0,r=s_;const i=e.lastIndexOf("-");if(i>0)for(let l=0;l<i;l++){const c=e.charCodeAt(l);c>=128&&ny(),t.push(c)}let o=i<0?0:i+1;for(;o<e.length;){const l=s;let c=1,u=Jr;for(;;){o>=e.length&&ny();const f=e.charCodeAt(o++);let h;f>=97&&f<=122?h=f-97:f>=48&&f<=57?h=f-48+26:ny(),s+=h*c;const x=u<=r?s1:u>=r+H1?H1:u-r;if(h<x)break;c*=Jr-x,u+=Jr}const d=t.length+1;r=o_(s-l,d,l===0),n+=Math.floor(s/d),s%=d,t.splice(s,0,n),s++}return String.fromCodePoint(...t)}function uw(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}const Cae=new RegExp(sb.source,"gu");function Eae(e){const t=e.replace(Cae,""),n=t.length,s=n>0?[t,"-"]:[],r=Array.from(e,u=>u.codePointAt(0));let i=r_,o=0,l=s_,c=n;for(;c<r.length;){let u=1/0;for(const d of r)d>=i&&d<u&&(u=d);o+=(u-i)*(c+1),i=u;for(const d of r)if(d<i&&o++,d===i){let f=o;for(let h=Jr;;h+=Jr){const x=h<=l?s1:h>=l+H1?H1:h-l;if(f<x)break;const g=x+(f-x)%(Jr-x);s.push(uw(g)),f=Math.floor((f-x)/(Jr-x))}s.push(uw(f)),l=o_(o,c+1,c===n),o=0,c++}o++,i++}return s.join("")}const $ae=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,dw=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Aae=/^(?:R|AL|AN)$/;function Mae(e){if(i_(e))try{return Wk(a_(e.slice(4).toLowerCase()))}catch{return!1}return Wk(e)}function l_(e){const t=String.fromCodePoint(e);return kae.test(t)?"EN":aae.test(t)?"AN":e_.test(t)?"NSM":n_.test(t)?"R":gae.test(t)?"AL":t_.test(t)?"L":"ON"}function Wk(e){for(const t of e)if(Aae.test(l_(t.codePointAt(0))))return!0;return!1}function c_(e){let t=!1,n=dw,s=!1,r=!1,i=!0;for(const o of e){const l=l_(o.codePointAt(0));if(i){if(l!=="L"&&l!=="R"&&l!=="AL")return!1;t=l==="R"||l==="AL",n=t?$ae:dw,i=!1}if(!n.test(l))return!1;l==="EN"?s=!0:l==="AN"&&(r=!0)}return!(t&&s&&r)}function Tae(e){return sb.test(e)&&Eae(e).length+4>63}function zae(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function u_(e){if(Tae(e)||Wk(e)&&!c_(e))return!1;const t=[...e],n=t.map(i=>i.codePointAt(0)),s=n.length;if(zae(t)||fae.test(t[0]))return!1;let r=!1;for(let i=0;i<s;i++){const o=n[i],l=t[i];if(mae.test(l)||!bae.test(l))return!1;xae.test(l)&&(r=!0);const c=n[i-1],u=n[i+1];switch(o){case 183:if(c!==108||u!==108)return!1;break;case 885:if(!u||!pae.test(t[i+1]))return!1;break;case 1523:case 1524:if(!c||!n_.test(t[i-1]))return!1;break;case 8204:if(!c||c<128&&!cw.test(t[i-1]))return!1;break;case 8205:if(!c||!cw.test(t[i-1]))return!1;break}}return!(e.includes("・")&&!r)}function d_(e){if(!i_(e))return!1;try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const n=a_(t);return sb.test(n)?u_(n):!1}catch{return!1}}function Nae(e){return e.length>0&&e.length<=63}function _ae(e){return Nae(e)&&(d_(e)||wae(e))}function Rae(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>_ae(t))}function Iae(e){return e.length>0&&e.length<=63}function Lae(e){return Iae(e)&&(d_(e)||u_(e))}function Oae(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function Dae(e){if(e.length===0||e.includes(" "))return!1;const t=Oae(e);if(t.length>253)return!1;const n=t.split("."),s=n.some(r=>Mae(r));return n.every(r=>Lae(r)&&(!s||c_(r)))}function Bae(e){return Rae(e)}const Hae=new RegExp('^(?:[A-Za-z0-9!#$%&\'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+(?:\\.[A-Za-z0-9!#$%&\'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+)*|"(?:[^"\\\\]|\\\\.)*")@[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-)(?:\\.[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-))*$',"iu");function qae(e){return Hae.test(e.normalize("NFC"))}function Pae(e){return Dae(e)}const Uae=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Fae(e){return Uae.test(e)}const Vae=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function Gae(e){return Vae.test(e)}const Wae=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,Kae=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function Xae(e){return!Wae.test(e)&&!Kae.test(e)&&URL.canParse(e,"http://example.com")}const Zae=2048,Yae=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,Qae=/[\x00-\x20<>\^`{|}\\]/,Jae=/%(?![0-9a-fA-F]{2})/;function ele(e){return e.length<Zae?e.replace(Yae,"[::1]"):e}function tle(e){return Qae.test(e)||Jae.test(e)?!1:URL.canParse(ele(e))}const nle=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function sle(e){return nle.test(e)}const rle=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ile(e){return rle.test(e)}function ole(e){try{return new RegExp(e,"u"),!0}catch{return!1}}const ale=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function lle(e){return ale.test(e)}const cle=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ule(e){return cle.test(e)}const dle=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function fle(e){return dle.test(e)}const hle=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ple(e){return hle.test(e)}function xle(e){return URL.canParse(e)}const gle=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function mle(e){return gle.test(e)}const Ot=new Map;function yle(){Ot.clear()}function vle(e,t){var n;return((n=Ot.get(e))==null?void 0:n(t))??!0}function kle(){yle(),Ot.set("date-time",Qoe),Ot.set("date",QN),Ot.set("duration",eae),Ot.set("email",nae),Ot.set("hostname",Bae),Ot.set("idn-email",qae),Ot.set("idn-hostname",Pae),Ot.set("ipv4",Fae),Ot.set("ipv6",Gae),Ot.set("iri-reference",Xae),Ot.set("iri",tle),Ot.set("json-pointer-uri-fragment",sle),Ot.set("json-pointer",ile),Ot.set("regex",ole),Ot.set("relative-json-pointer",lle),Ot.set("time",JN),Ot.set("uri-reference",ule),Ot.set("uri-template",fle),Ot.set("uri",ple),Ot.set("url",xle),Ot.set("uuid",mle)}kle();function ble(e,t,n,s){return vle(n.format,s)}function wle(e,t,n,s){const r=Soe(n)?n.then:!0,i=eoe(n)?n.else:!0;return hn(e,t,n.if,s)?hn(e,t,r,s):hn(e,t,i,s)}function jle(e,t,n,s){return Jn(n.items,0,(r,i)=>Ud(s.length,i)||Tc(e,t,r,s[i])&&t.AddIndex(i))}function Sle(e,t,n,s){const r=XN(n)?n.prefixItems.length:0;return Jn(s,r,(i,o)=>Tc(e,t,n.items,i)&&t.AddIndex(o))}function Cle(e,t,n,s){return ooe(n)?jle(e,t,n,s):Sle(e,t,n,s)}function Ele(e){return eb(e)}function $le(e,t,n,s){if(!Ele(n))return!0;const r=DN(s,i=>hn(e,t,n.contains,i));return Ud(r,n.maxContains)}function Ale(e,t,n,s){return Ud(s,n.maximum)}function Mle(e,t,n,s){return Ud(s.length,n.maxItems)}function Tle(e,t,n,s){return Pre(s,n.maxLength)}function zle(e,t,n,s){return Ud(wn(s).length,n.maxProperties)}function Nle(e){return eb(e)}function _le(e,t,n,s){if(!Nle(n))return!0;const r=DN(s,(i,o)=>hn(e,t,n.contains,i)&&t.AddIndex(o));return sm(r,n.minContains)}function Rle(e,t,n,s){return sm(s,n.minimum)}function Ile(e,t,n,s){return sm(s.length,n.minItems)}function Lle(e,t,n,s){return Ure(s,n.minLength)}function Ole(e,t,n,s){return sm(wn(s).length,n.minProperties)}function Dle(e,t,n,s){return Hre(s,n.multipleOf)}function Ble(e,t,n,s){const r=new Fd;return!hn(e,r,n.not,s)&&t.Merge([r])}function Hle(e,t,n,s){const r=n.oneOf.reduce((i,o)=>{const l=new Fd;return hn(e,l,o,s)?[...i,l]:i},[]);return je(r.length,1)&&t.Merge(r)}function qle(e,t,n,s){return(bn(n.pattern)?nb(n.pattern):n.pattern).test(s)}function Ple(e,t,n,s){return Jn(gc(n.patternProperties),0,([r,i])=>{const o=nb(r);return Jn(gc(s),0,([l,c])=>!o.test(l)||Tc(e,t,i,c)&&t.AddKey(l))})}function Ule(e,t,n,s){return je(s.length,0)||Jn(n.prefixItems,0,(r,i)=>Ud(s.length,i)||Tc(e,t,r,s[i])&&t.AddIndex(i))}function Fle(e,t){return e.includes(t)||qN().exactOptionalPropertyTypes}function Vle(e,t){return fn(e[t])}function Gle(e,t,n,s){const r=YN(n)?n.required:[];return Jn(gc(n.properties),0,([o,l])=>{const c=!we(s,o)||Tc(e,t,l,s[o])&&t.AddKey(o);return Fle(r,o)?c:Vle(s,o)||c})}function Wle(e,t,n,s){return Jn(wn(s),0,(r,i)=>hn(e,t,n.propertyNames,r))}function Kle(e,t,n,s){const r=e.RecursiveRef(n)??!1;return Ht(r)&&hn(e,t,r,s)}function Xle(e,t,n,s){const r=e.Ref(n)??!1,i=new Fd,o=Ht(r)&&hn(e,i,r,s);return o&&t.Merge([i]),o}function Zle(e,t,n,s){return Jn(n.required,0,r=>we(s,r))}function f_(e,t,n,s,r){return je(n,"object")?Bre(r):je(n,"array")?ut(r):je(n,"boolean")?Ac(r):je(n,"integer")?NN(r):je(n,"number")?Dn(r):je(n,"null")?Eh(r):je(n,"string")?bn(r):je(n,"bigint")?Br(r):je(n,"constructor")?zN(r):je(n,"function")?B1(r):je(n,"symbol")?_N(r):je(n,"undefined")||je(n,"void")?fn(r):!0}function Yle(e,t,n,s,r){return ON(n,i=>f_(e,t,i,s,r))}function Qle(e,t,n,s){return ut(n.type)?Yle(e,t,n.type,n,s):f_(e,t,n.type,n,s)}function Jle(e,t,n,s){const r=t.GetIndices();return Jn(s,0,(i,o)=>(r.has(o)||hn(e,t,n.unevaluatedItems,i))&&t.AddIndex(o))}function ece(e,t,n,s){const r=t.GetKeys();return Jn(gc(s),0,([i,o])=>r.has(i)||hn(e,t,n.unevaluatedProperties,o)&&t.AddKey(i))}function tce(e){return!je(e.uniqueItems,!1)}function nce(e,t,n,s){if(!tce(n))return!0;const r=new Set(s.map(Die)).size,i=s.length;return je(r,i)}function Tc(e,t,n,s){return t.Push()&&hn(e,t,n,s)&&t.Pop()}function hn(e,t,n,s){e.Push(n);const r=Kx(n)?Ooe(e,t,n):(!Coe(n)||Qle(e,t,n,s))&&(!(Kt(s)&&!ut(s))||(!YN(n)||Zle(e,t,n,s))&&(!Gie(n)||Roe(e,t,n,s))&&(!Zie(n)||qoe(e,t,n,s))&&(!Yie(n)||Poe(e,t,n,s))&&(!Qie(n)||Uoe(e,t,n,s))&&(!KN(n)||Ple(e,t,n,s))&&(!ZN(n)||Gle(e,t,n,s))&&(!koe(n)||Wle(e,t,n,s))&&(!xoe(n)||Ole(e,t,n,s))&&(!doe(n)||zle(e,t,n,s)))&&(!ut(s)||(!Vie(n)||zoe(e,t,n,s))&&(!eb(n)||Hoe(e,t,n,s))&&(!tb(n)||Cle(e,t,n,s))&&(!loe(n)||$le(e,t,n,s))&&(!coe(n)||Mle(e,t,n,s))&&(!WN(n)||_le(e,t,n,s))&&(!hoe(n)||Ile(e,t,n,s))&&(!XN(n)||Ule(e,t,n,s))&&(!Eoe(n)||nce(e,t,n,s)))&&(!bn(s)||(!uoe(n)||Tle(e,t,n,s))&&(!poe(n)||Lle(e,t,n,s))&&(!roe(n)||ble(e,t,n,s))&&(!voe(n)||qle(e,t,n,s)))&&(!(Dn(s)||Br(s))||(!noe(n)||Goe(e,t,n,s))&&(!soe(n)||Woe(e,t,n,s))&&(!aoe(n)||Ale(e,t,n,s))&&(!foe(n)||Rle(e,t,n,s))&&(!goe(n)||Dle(e,t,n,s)))&&(!joe(n)||Xle(e,t,n,s))&&(!woe(n)||Kle(e,t,n,s))&&(!Jie(n)||Foe(e,t,n,s))&&(!Xie(n)||Doe(e,t,n,s))&&(!toe(n)||Voe(e,t,n,s))&&(!ioe(n)||wle(e,t,n,s))&&(!moe(n)||Ble(e,t,n,s))&&(!Wie(n)||Ioe(e,t,n,s))&&(!Kie(n)||Loe(e,t,n,s))&&(!yoe(n)||Hle(e,t,n,s))&&(!$oe(n)||!ut(s)||Jle(e,t,n,s))&&(!Aoe(n)||!Kt(s)||ece(e,t,n,s))&&(!Fie(n)||Moe(e,t,n,s));return e.Pop(n),r}function sce(e,t){return Kt(t)&&!rm(e)?t[e]:void 0}function rce(e,t){return e.reduce((n,s)=>sce(s,n),t)}function ice(e){if(je(e.length,0))return[];const t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function oce(e,t){const n=ice(t);return rce(n,e)}const am="https://json-schema.org";function h_(e,t){if(Kt(e)&&yc(e)&&je(e.$dynamicAnchor,t))return e;if(Kt(e))for(const n of wn(e)){const s=h_(e[n],t);if(s)return s}}function Kk(e,t,n){if(je(e,n))return t.href;const s=gr(e)&&si(e)?new URL(e.$id,t.href):t;if(ut(e))for(const r of e){const i=Kk(r,s,n);if(!fn(i))return i}else if(Kt(e))for(const r of wn(e)){const i=Kk(e[r],s,n);if(!fn(i))return i}}function ace(e,t,n){if(je(e.$id,n.hash))return e;const s=new URL(n.href,t.href);if(je(t.pathname,s.pathname))return n.hash.startsWith("#")?p_(e,n):e}function lce(e,t,n){const s=new URL(`#${e.$anchor}`,t.href),r=new URL(n.href,t.href);return je(s.href,r.href)?e:void 0}function cce(e,t,n){const s=new URL(`#${e.$dynamicAnchor}`,t.href),r=new URL(n.href,t.href);return je(s.href,r.href)?e:void 0}function p_(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;const n=decodeURIComponent(t.hash.slice(1));return n.startsWith("/")?oce(e,n):void 0}function uce(e,t,n){if(si(e)){const s=ace(e,t,n);if(!fn(s))return s}if(Vk(e)){const s=lce(e,t,n);if(!fn(s))return s}if(yc(e)){const s=cce(e,t,n);if(!fn(s))return s}return p_(e,n)}function dce(e,t,n){return e.reduce((s,r)=>{const i=lm(r,t,n);return fn(i)?s:i},void 0)}function fce(e){return je(e,"const")||je(e,"enum")}function hce(e,t,n){return wn(e).reduce((s,r)=>{if(fce(r))return s;const i=lm(e[r],t,n);return fn(i)?s:i},void 0)}function lm(e,t,n){const s=gr(e)&&si(e)?new URL(e.$id,t.href):t;if(gr(e)){const r=uce(e,s,n);if(!fn(r))return r}if(ut(e))return dce(e,s,n);if(Kt(e))return hce(e,s,n)}function pce(e,t,n){return Kk(e,new URL(t||".",am),n)}function xce(e,t,n,s){const r=cm(e,t,n,s,!1);return gr(r)&&si(r)?r:void 0}function fw(e){return e.href.split("#")[0]}function gce(e,t){return we(e,t)?e[t]:void 0}function mce(e,t,n){return lm(e,t,n)}function yce(e,t,n){const s=fw(n);if(je(s,fw(t))||!we(e,s))return;const r=e[s],i=gr(r)&&si(r)?new URL(r.$id,s):new URL(s);return je(n.hash,"")?r:lm(r,i,n)}function vce(e,t,n,s,r){if(!s.$ref.startsWith("#")||we(e,"$schema"))return;const i=pce(t,n,r);if(!(fn(i)||je(i,n)))return{target:r,base:i,root:t}}function kce(e,t,n){const s=e[t];if(gr(s))return{target:n,base:t,root:s}}function bce(e,t,n,s,r){const i=r?kce(e.context,s,n):void 0;return fn(i)?vce(e.root,e.lexicalSchema,e.referenceBase,t,n):i}function wce(e,t,n,s,r,i){if(si(r))return;const o=xce(e,t,n,s);if(!(!o||i.includes(o)))return{target:r,resource:o}}function cm(e,t,n,s,r=!0){const i=new URL(n||".",am),o=r&&si(t)?new URL(t.$id,i):i,l=new URL(s,o.href);return gce(e,s)??mce(t,o,l)??yce(e,o,l)}function jce(e,t,n,s,r,i){const o=new URL(n||".",am),l=r.$dynamicRef.startsWith("#")?s:t,c=cm(e,l,n,r.$dynamicRef,!1);if(fn(c)){const f=new URL(r.$dynamicRef,o).hash;if(!f.startsWith("#/")&&f.startsWith("#")){const h=decodeURIComponent(f.slice(1));return i.find(g=>je(g.$dynamicAnchor,h))??h_(t,h)}return}return!gr(c)||!yc(c)||new URL(r.$dynamicRef,o).hash.startsWith("#/")?c:i.find(f=>je(f.$dynamicAnchor,c.$dynamicAnchor))??c}function Sce(e,t){const n=e.inRetrievedFrame?e.lexicalSchema:e.root,s=t.$ref.startsWith("#")?e.lexicalSchema:n,r=cm(e.context,s,e.referenceBase,t.$ref,!1);if(!r||!gr(r))return{schema:r};const i=new URL(t.$ref,e.referenceBase).href.split("#")[0],o=!je(i,e.resourceBase),l=bce(e,t,r,i,o),c=o?wce(e.context,e.root,e.referenceBase,i,r,e.ids):void 0;return{schema:r,retrievedResource:l,resolvedResource:c}}function Cce(e,t){const n=Gk(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return cm(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function Ece(e,t){return jce(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var Tt=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)},gt,Ip,x_,Xk,T0,hw,pw,xw,gw,sy,ry,Zk,Yk,mw,g_;class $ce{constructor(t,n){gt.add(this),this.context=t,this.schema=n,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return Tt(this,gt,"m",Xk).call(this,this.ids)}Push(t){if(!gr(t))return;si(t)&&Tt(this,gt,"m",Zk).call(this,t),Vk(t)&&this.anchors.push(t),Gk(t)&&this.recursiveAnchors.push(t),yc(t)&&this.dynamicAnchors.push(t);const n=this.retrievedResources.get(t);n&&this.retrievedFrames.push({schema:n.root,base:n.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(t){gr(t)&&(si(t)&&Tt(this,gt,"m",Yk).call(this,t),Vk(t)&&this.anchors.pop(),Gk(t)&&this.recursiveAnchors.pop(),yc(t)&&this.dynamicAnchors.pop(),this.retrievedResources.has(t)&&this.retrievedFrames.pop(),Tt(this,gt,"m",g_).call(this,t))}Ref(t){const n=Sce(Tt(this,gt,"m",Ip).call(this),t);return Tt(this,gt,"m",x_).call(this,n),n.schema}RecursiveRef(t){const n=Cce(Tt(this,gt,"m",Ip).call(this),t);return n&&(this.pendingResource=!0),n}DynamicRef(t){const n=Ece(Tt(this,gt,"m",Ip).call(this),t);return n&&(this.pendingResource=!0),n}}gt=new WeakSet,Ip=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:Tt(this,gt,"m",pw).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:Tt(this,gt,"m",hw).call(this),resourceBase:Tt(this,gt,"m",T0).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},x_=function(t){fn(t.schema)||(this.pendingResource=!0),fn(t.resolvedResource)||Tt(this,gt,"m",mw).call(this,t.resolvedResource.target,t.resolvedResource.resource),fn(t.retrievedResource)||this.retrievedResources.set(t.retrievedResource.target,{base:t.retrievedResource.base,root:t.retrievedResource.root})},Xk=function(t){const n=this.retrievedFrames[this.retrievedFrames.length-1],s=n?new URL(n.base):new URL(am);return(n?t.slice(n.idDepth):t).reduce((i,o)=>new URL(o.$id,i),s).href},T0=function(){const t=this.retrievedFrames[this.retrievedFrames.length-1];return t?this.resourceIds.slice(t.resourceDepth).reduce((n,s)=>new URL(s.$id,n),new URL(t.base)).href:Tt(this,gt,"m",Xk).call(this,this.resourceIds)},hw=function(){if(this.retrievedFrames.length>0)return Tt(this,gt,"m",T0).call(this);const t=this.ids[this.ids.length-1];return t&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t.$id)?this.LexicalBaseURL():Tt(this,gt,"m",T0).call(this)},pw=function(){const t=this.retrievedFrames[this.retrievedFrames.length-1];return t?this.ids.length>t.idDepth?this.ids[this.ids.length-1]:t.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},xw=function(t){t.forEach(n=>Tt(this,gt,"m",sy).call(this,n,!1))},gw=function(t){t.forEach(n=>Tt(this,gt,"m",ry).call(this,n,!1))},sy=function e(t,n=!0){if(Kx(t))return;if(ut(t))return Tt(this,gt,"m",xw).call(this,t);if(!gr(t))return;const s=t;if(!(!n&&si(s))){!n&&yc(s)&&this.dynamicAnchors.push(s);for(const r of wn(s))Tt(this,gt,"m",e).call(this,s[r],!1)}},ry=function e(t,n=!0){if(Kx(t))return;if(ut(t))return Tt(this,gt,"m",gw).call(this,t);if(!gr(t))return;const s=t;if(!(!n&&si(s))){!n&&yc(s)&&this.dynamicAnchors.pop();for(const r of wn(s))Tt(this,gt,"m",e).call(this,s[r],!1)}},Zk=function(t){this.ids.push(t);const n=this.pendingResource;this.pendingResource=!1,n&&this.resourceIds.push(t),Tt(this,gt,"m",sy).call(this,t,!0)},Yk=function(t){this.ids.pop(),this.resourceIds.length>0&&je(this.resourceIds[this.resourceIds.length-1],t)&&this.resourceIds.pop(),Tt(this,gt,"m",ry).call(this,t,!0)},mw=function(t,n){Tt(this,gt,"m",Zk).call(this,n),this.resolvedResources.set(t,n)},g_=function(t){if(!this.resolvedResources.has(t))return;const n=this.resolvedResources.get(t);Tt(this,gt,"m",Yk).call(this,n),this.resolvedResources.delete(t)};function Ace(...e){const[t,n,s]=UN(e,{3:(o,l,c)=>[o,l,c],2:(o,l)=>[{},o,l]}),r=new $ce(t,n),i=new Fd;return hn(r,i,n,s)}function z0(...e){const[t,n,s]=UN(e,{3:(r,i,o)=>[r,i,o],2:(r,i)=>[{},r,i]});return Ace(t,n,s)}BigInt(Number.MAX_SAFE_INTEGER);BigInt(Number.MIN_SAFE_INTEGER);const Mce=Cs({type:ar("insert"),path:cs(),value:J3()}),Tce=Object({type:ar("update"),path:cs(),value:J3()}),zce=Cs({type:ar("delete"),path:cs()});om([Mce,Tce,zce]);const Nce=Cs({text:cs({minLength:1}),status:om([ar("pending"),ar("in_progress"),ar("completed")])}),_ce=Cs({items:Mc(Nce)}),Rce=Cs({label:cs({minLength:1}),description:xo(cs())}),Ice=Cs({question:cs({minLength:1}),header:cs({minLength:1,maxLength:16}),options:Mc(Rce,{minItems:2,maxItems:4}),multiSelect:xo(Bie())}),Lce=Cs({selected:Mc(cs()),other:xo(cs())}),Oce=om([Cs({outcome:ar("answered"),answers:Mc(Lce),at:Iu()}),Cs({outcome:ar("dismissed"),at:Iu()}),Cs({outcome:ar("cancelled"),at:Iu()})]),Dce=Cs({id:cs({minLength:1}),questions:Mc(Ice,{minItems:1,maxItems:4}),askedAt:Iu(),resolution:xo(Oce)}),Bce=Cs({requests:Mc(Dce)}),Hce=Cs({patch:cs()}),qce=Cs({id:xo(Iu()),name:cs(),args:cs(),status:om([ar("running"),ar("ok"),ar("error"),ar("cancelled")]),durationMs:xo(Iu()),error:xo(cs()),details:xo(J3())}),Pce=Cs({code:xo(cs()),calls:Mc(qce)});function Vd(e,t){return e==="pinomad.todo"&&z0(_ce,t)?{type:"pinomad.todo",value:t}:e==="pinomad.question"&&z0(Bce,t)?{type:"pinomad.question",value:t}:e==="pinomad.diff"&&z0(Hce,t)?{type:"pinomad.diff",value:t}:e==="pinomad.codemode"&&z0(Pce,t)?{type:"pinomad.codemode",value:t}:{type:"fallback",value:t}}const Uce=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,Fce=/^\+\s*\d+ /,Vce=/^-\s*\d+ /;function Gce(e){let t=0,n=0,s=0,r=0,i=!1;for(const o of e.split(`
393
- `)){const l=Uce.exec(o);if(l){s=Number.parseInt(l[2]??"1",10),r=Number.parseInt(l[4]??"1",10),i=!0;continue}if(!i)continue;if(s===0&&r===0){i=!1;continue}const c=o.charAt(0);c===" "?(s-=1,r-=1):c==="-"?(s-=1,n+=1):c==="+"&&(r-=1,t+=1)}return{additions:t,deletions:n}}function Wce(e){let t=0,n=0;for(const s of e.split(`
394
- `))Fce.test(s)?t+=1:Vce.test(s)&&(n+=1);return{additions:t,deletions:n}}function Kce(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(typeof t!="object"||t===null)return;const n=t.details;if(typeof n!="object"||n===null)return;const{patch:s,diff:r}=n,i=typeof s=="string"?Gce(s):typeof r=="string"?Wce(r):void 0;return i!==void 0&&(i.additions>0||i.deletions>0)?i:void 0}function rb(e){return e.pinomad}function Xce(e){var n;const t=(n=e.pinomad)==null?void 0:n.answerStartedAt;if(!(typeof t!="number"||!Number.isFinite(t))&&!(typeof e.timestamp!="number"||t<e.timestamp))return t}function Lp(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Zce(e){return typeof e=="string"?e:e.flatMap(t=>t.type==="text"&&t.text!==void 0?[t.text]:[]).join("")}function m_(e){return typeof e=="string"?[]:e.flatMap(t=>{if(t.type!=="image"||t.mimeType===void 0)return[];const n=t.mimeType;return typeof t.data=="string"&&t.data!==""?[{data:t.data,mimeType:n}]:typeof t.ref=="string"&&t.ref!==""?[{ref:t.ref,mimeType:n}]:[]})}const zl=e=>e.type==="toolCall"&&e.id!==void 0;function Yce(e,t){if(e!==void 0){if(t==="codemode"&&typeof e=="object"&&e!==null){const n=e.code;if(typeof n=="string")return n}return JSON.stringify(e)}}function Qce(e){if(typeof e!="object"||e===null)return;const t=e.conversationId;return typeof t=="number"?t:void 0}function Jce(e,t){const n=e.status==="ok"?"output-available":(e.status==="error","output-error"),s=e.status==="error"?e.error:n==="output-error"?"Cancelled":void 0,r=e.details===void 0?void 0:Vd(t[e.name],e.details),i=(r==null?void 0:r.type)==="pinomad.diff"?{kind:"diff",patch:r.value.patch}:void 0;return{state:n,toolName:e.name,argsText:e.args,...s===void 0?{}:{output:s},...e.durationMs===void 0?{}:{durationMs:e.durationMs},...i===void 0?{}:{pinomad:i}}}function eue(e){const t=e.summary;return{state:e.status!=="done"?"input-available":t===void 0||t.isError?"output-error":"output-available",toolCallId:e.callId,toolName:e.name,argsText:JSON.stringify(e.arguments),...(t==null?void 0:t.error)===void 0?{}:{output:t.error},...(t==null?void 0:t.durationMs)===void 0?{}:{durationMs:t.durationMs}}}function tue(e,t,n,s,r){const i=e.id,o=t.results.get(i),l=t.partial?void 0:n.get(i),c=(l==null?void 0:l.name)??e.name,u=Yce(e.arguments,c);let d,f;o!==void 0?(d=o.isError===!0?"output-error":"output-available",f=Zce(o.content)):(l==null?void 0:l.status)==="running"?(d="input-available",f=l.output):t.partial===!0?d="input-streaming":t.msg.stopReason!=="toolUse"?(d="output-error",f="Not run: the answer was interrupted."):(d="input-available",f=l==null?void 0:l.output);const h=(o==null?void 0:o.details)??(l==null?void 0:l.details),x=h===void 0?void 0:Vd(r[c??""],h),g=o!==void 0&&o.isError!==!0?Kce({details:o.details}):void 0,y=o===void 0?[]:m_(o.content),v=Qce(h);let m,k;if((x==null?void 0:x.type)==="pinomad.diff")m={kind:"diff",patch:x.value.patch};else if(v!==void 0){const b=h;m={kind:"subagent",conversationId:v,...f===void 0?{}:{output:f},...typeof b.model=="string"?{model:b.model}:{},...typeof b.startedAt=="number"?{startedAt:b.startedAt}:{},...typeof(o==null?void 0:o.timestamp)=="number"?{endedAt:o.timestamp}:{}}}return c==="codemode"&&o===void 0?k=(s.get(i)??[]).map(eue):(x==null?void 0:x.type)==="pinomad.codemode"&&(k=x.value.calls.map(b=>Jce(b,r))),{state:d,toolCallId:i,...c===void 0?{}:{toolName:c},...u===void 0?{}:{argsText:u},...f===void 0?{}:{output:f},...g===void 0?{}:{diffStat:g},...y.length===0?{}:{images:y},...k===void 0||k.length===0?{}:{children:k},...m===void 0?{}:{pinomad:m}}}function nue(e){const t=e==null?void 0:e.calls;return Array.isArray(t)&&t.some(n=>n.name==="todo_write"&&n.status==="ok")}function sue(e){const t=[];for(const n of e)if(zl(n)){const s=t[t.length-1];(s==null?void 0:s.kind)==="tools"?s.blocks.push(n):t.push({kind:"tools",blocks:[n]})}else n.type==="thinking"?t.push({kind:"thinking",block:n}):n.type==="text"&&t.push({kind:"text",block:n});return t}function rue(e,t,n,s,r){var I,L,O;const i=new Map(((I=s?n.tools:void 0)==null?void 0:I.map(D=>[D.callId,D]))??[]),o=new Map;if(s)for(const D of n.nestedTools??[]){if(D.name.startsWith("pi."))continue;const q=o.get(D.parentCallId);q===void 0?o.set(D.parentCallId,[D]):q.push(D)}const l=s?(L=n.generation)==null?void 0:L.message:void 0,c=new Map,u=[...t.assistants.map(({id:D,msg:q,results:F})=>({id:D,msg:q,results:F})),...l===void 0?[]:[{id:"live",msg:l,partial:!0,results:c}]],d=u[u.length-1],f=t.assistants[t.assistants.length-1],h=!s,g=(d===void 0?[]:d.msg.content.filter(D=>D.type==="text")).map(D=>D.text??"").join(""),y=(d==null?void 0:d.msg.content.some(zl))===!0,v=g!==""&&(h||!y),m=(D,q)=>zl(q)&&!D.results.has(q.id)&&(D.partial===!0||D.msg.stopReason==="toolUse"),k=u.some(D=>D.msg.content.some(q=>m(D,q))),b=d==null?void 0:d.msg.content[d.msg.content.length-1];let j;h?j="settled":v?j="answering":k||b!==void 0&&zl(b)?j="acting":u.length>0?j="thinking":j="hidden";const A=j==="thinking"||j==="acting",M=[];for(const D of u){const q=D===d,F=D.msg.content;sue(F).forEach((K,Z)=>{if(K.kind==="tools"){const ne=K.blocks.filter(P=>m(D,P)),ue=A&&ne.length>0;M.push({kind:"tools",id:`${D.id}-tools-${Z}`,tools:K.blocks.map(P=>tue(P,D,i,o,r)),live:ue,...ue&&ne[0]!==void 0?{activeToolCallId:ne[0].id}:{}});return}if(K.kind==="text"){q&&v||M.push({kind:"interim",id:`${D.id}-text-${Z}`,text:K.block.text??""});return}const se=F.indexOf(K.block);M.push({kind:"thinking",id:`${D.id}-thinking-${Z}`,text:K.block.thinking??"",live:A&&D.partial===!0&&se===F.length-1})})}let E;for(const D of u)for(const q of D.msg.content){if(!zl(q))continue;const F=D.results.get(q.id);F===void 0||typeof F.timestamp!="number"||(q.name==="todo_write"?F.isError!==!0:q.name==="codemode"&&nue(F.details))&&(E=F.timestamp)}const z=(f==null?void 0:f.msg.stopReason)==="aborted",T=h&&(f==null?void 0:f.msg.stopReason)==="error",$=f===void 0?void 0:Lp(f.msg.timestamp),_=f===void 0?void 0:Lp(f.msg.durationMs),R=h&&$!==void 0?Lp($+(_??0)):void 0,N=(O=u[0])==null?void 0:O.msg.timestamp,H=typeof(d==null?void 0:d.msg.provider)=="string"&&typeof d.msg.model=="string"?{provider:d.msg.provider,modelId:d.msg.model}:void 0;let B;if(h&&N!==void 0){let D;v?D=(d===void 0?void 0:Xce(d.msg))??(d===u[0]||d==null?void 0:d.msg.timestamp):D=t.lastTs??(d==null?void 0:d.msg.timestamp),B=D===void 0?void 0:D-N}return{kind:"run",id:e,cot:{phase:j,...T===!0?{outcome:"failed"}:{},...N===void 0?{}:{anchorMs:N},...B===void 0?{}:{elapsedMs:B},...E===void 0?{}:{todoWrittenAtMs:E},...H===void 0?{}:{model:H},steps:M,...v?{answer:{text:g,streaming:(d==null?void 0:d.partial)===!0}}:{}},interrupted:z,...h&&!z&&T!==!0&&f!==void 0?{forkEntryId:f.id}:{},...T===!0?{failure:(f==null?void 0:f.msg.errorMessage)??"The run failed."}:{},...R===void 0?{}:{endedAt:R}}}function iue(e,t,n,s=[],r={}){var h;const i=[],o=e.docs["pi.live"]??{};let l,c=0;const u=x=>{var g;if(l!==void 0){if(l.assistants.length>0||l.orphans.size>0||x){const y=((g=l.assistants[0])==null?void 0:g.id)??`open-${c++}`;i.push(rue(`run-${y}`,l,o,x,t))}l=void 0}};for(const x of e.entries){const g=(h=x.model)==null?void 0:h[0],y=String(x.id);if(x.kind==="pi.user"&&(g==null?void 0:g.role)==="user"){u(!1);const v=Y3(g.content),m=Lp(g.timestamp);i.push({kind:"user",id:y,text:v.text,images:m_(g.content),skills:v.skills,attachments:v.attachments,...m===void 0?{}:{timestamp:m}})}else if(x.kind==="pi.compaction")u(!1),i.push({kind:"compaction",id:y});else if(x.kind==="pi.reset")u(!1),i.push({kind:"reset",id:y});else if(x.kind==="pi.assistant"&&(g==null?void 0:g.role)==="assistant"){l??(l={assistants:[],orphans:new Map});const v=new Map;for(const m of g.content){if(!zl(m))continue;const k=l.orphans.get(m.id);k!==void 0&&(l.orphans.delete(m.id),v.set(m.id,k))}l.assistants.push({id:y,msg:g,results:v}),l.lastTs=g.timestamp??l.lastTs}else if(x.kind==="pi.tool-result"&&(g==null?void 0:g.role)==="toolResult"&&g.toolCallId!==void 0){l??(l={assistants:[],orphans:new Map});const v=l.assistants.findLast(m=>!m.results.has(g.toolCallId)&&m.msg.content.some(k=>zl(k)&&k.id===g.toolCallId));v===void 0?l.orphans.set(g.toolCallId,g):v.results.set(g.toolCallId,g),l.lastTs=g.timestamp??l.lastTs}}l??(l=n?{assistants:[],orphans:new Map}:void 0),u(n);let d;for(const x of i)x.kind==="user"&&x.local===void 0&&(d=x);d!==void 0&&(d.status="delivered");const f=e.conversation.id;for(const x of s){const g=x.placement==="conversation"||r.mergeQueuedSubmissions===!0&&x.placement==="queue";if(x.phase==="settled"||!g||x.conversationId!==void 0&&x.conversationId!==f)continue;const y=x.phase==="unknown"?"unknown":x.phase==="failed"?"failed":"sending";i.push({kind:"user",id:`local:${x.requestId}`,text:x.text,images:x.imageViews??x.images.flatMap(v=>"data"in v?[v]:[]),attachments:x.attachmentDetails??[],skills:x.skills,status:y,local:{requestId:x.requestId,...x.error===void 0?{}:{error:x.error}}})}return i}function oue(e){const t=e[e.length-1];if(!((t==null?void 0:t.kind)!=="run"||t.failure===void 0))for(let n=e.length-2;n>=0;n--){const s=e[n];if(s.kind!=="compaction")return s.kind!=="user"||s.text.trim()===""&&s.images.length===0&&s.attachments.length===0?void 0:{text:s.text,images:s.images,skills:s.skills,attachments:s.attachments,requestId:`retry:${t.id}`}}}function aue(e){const t=[],n=[];for(const s of e.steps){if(s.kind!=="tools"){n.push(s);continue}const r=[];if(s.tools.forEach((i,o)=>{if(i.toolName!=="subagent"){r.push(i);return}t.push({key:`${s.id}/${i.toolCallId??o}`,tool:i})}),r.length!==0)if(s.activeToolCallId!==void 0&&!r.some(i=>i.toolCallId===s.activeToolCallId)){const i=r.find(o=>o.state==="input-streaming"||o.state==="input-available");if(i===void 0){const{activeToolCallId:o,...l}=s;n.push({...l,tools:r,live:!1})}else n.push({...s,tools:r,...i.toolCallId===void 0?{}:{activeToolCallId:i.toolCallId}})}else n.push({...s,tools:r})}return{view:{...e,steps:n},subagents:t}}const yw={};function $h(e,t){const n=p.useRef(yw);return n.current===yw&&(n.current=e(t)),n}const iy=uj[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],lue=iy&&iy!==p.useLayoutEffect?iy:e=>e();function vc(e){const t=$h(cue).current;return t.next=e,lue(t.effect),t.trampoline}function cue(){const e={next:void 0,callback:uue,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function uue(){}function ib(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}function Qk(e,t,n,s){const r=$h(y_).current;return fue(r,e,t,n,s)&&v_(r,[e,t,n,s]),r.callback}function due(e){const t=$h(y_).current;return hue(t,e)&&v_(t,e),t.callback}function y_(){return{callback:null,cleanup:null,refs:[]}}function fue(e,t,n,s,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==r}function hue(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function v_(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const i=t[r];if(i!=null)switch(typeof i){case"function":{const o=i(n);typeof o=="function"&&(s[r]=o);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const i=t[r];if(i!=null)switch(typeof i){case"function":{const o=s[r];typeof o=="function"?o():i(null);break}case"object":{i.current=null;break}}}}}}}const pue=parseInt(p.version,10);function xue(e){return pue>=e}function vw(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(xue(19)?n==null?void 0:n.ref:t.ref)??null}function Jk(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function gue(e,t){const n={};for(const s in e){const r=e[s];if(t!=null&&t.hasOwnProperty(s)){const i=t[s](r);i!=null&&Object.assign(n,i);continue}r===!0?n[`data-${s.toLowerCase()}`]="":r&&(n[`data-${s.toLowerCase()}`]=r.toString())}return n}function mue(e,t){return typeof e=="function"?e(t):e}function yue(e,t){return typeof e=="function"?e(t):e}const r1={};function k_(e,t,n,s,r){let i={...e5(e,r1)};return t&&(i=Op(i,t)),n&&(i=Op(i,n)),s&&(i=Op(i,s)),i}function vue(e){if(e.length===0)return r1;if(e.length===1)return e5(e[0],r1);let t={...e5(e[0],r1)};for(let n=1;n<e.length;n+=1)t=Op(t,e[n]);return t}function Op(e,t){return b_(t)?t(e):kue(e,t)}function kue(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Jk(e.style,s);break}case"className":{e[n]=w_(e.className,s);break}default:bue(n,s)?e[n]=wue(e[n],s):e[n]=s}}return e}function bue(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&s===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function b_(e){return typeof e=="function"}function e5(e,t){return b_(e)?e(t):e??r1}function wue(e,t){return t?e?n=>{if(jue(n)){const r=n;t5(r);const i=t(r);return r.baseUIHandlerPrevented||e==null||e(r),i}const s=t(n);return e==null||e(n),s}:t:e}function t5(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function w_(e,t){return t?e?t+" "+e:t:e}function jue(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const jl=Object.freeze({});function ob(e,t,n={}){const s=t.render,r=Sue(t,n);if(n.enabled===!1)return null;const i=n.state??jl;return Cue(e,s,r,i)}function Sue(e,t={}){const{className:n,style:s,render:r}=e,{state:i=jl,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?mue(n,i):void 0,f=u?yue(s,i):void 0,h=u?gue(i,c):jl,x=u?Jk(h,Array.isArray(l)?vue(l):l)??jl:jl;return typeof document<"u"&&(u?Array.isArray(o)?x.ref=due([x.ref,vw(r),...o]):x.ref=Qk(x.ref,vw(r),o):Qk(null,null)),u?(d!==void 0&&(x.className=w_(x.className,d)),f!==void 0&&(x.style=Jk(x.style,f)),x):jl}function Cue(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const r=k_(n,t.props);return r.ref=n.ref,p.cloneElement(t,r)}if(e&&typeof e=="string")return Eue(e,n);throw new Error(ib(8))}function Eue(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}function $ue({controlled:e,default:t,name:n,state:s="value"}){const{current:r}=p.useRef(e!==void 0),[i,o]=p.useState(t),l=r?e:i,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const Aue=()=>{},lr=typeof document<"u"?p.useLayoutEffect:Aue,Mue={...uj};let kw=0;function Tue(e,t="mui"){const[n,s]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(kw+=1,s(`${t}-${kw}`))},[n,t]),r}const bw=Mue.useId;function zue(e,t){if(bw!==void 0){const n=bw();return`${t}-${n}`}return Tue(e,t)}function Nue(e){return zue(e,"base-ui")}const _ue="none",Rue="trigger-press";function j_(e,t,n,s){let r=!1,i=!1;const o=jl;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){i=!0},get isCanceled(){return r},get isPropagationAllowed(){return i},trigger:n,...o}}const Iue=[];function S_(e){p.useEffect(e,Iue)}const N0=null;class Lue{constructor(){ge(this,"callbacks",[]);ge(this,"callbacksCount",0);ge(this,"nextId",1);ge(this,"startId",1);ge(this,"isScheduled",!1);ge(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)(r=n[i])==null||r.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const _0=new Lue;class Yt{constructor(){ge(this,"currentId",N0);ge(this,"cancel",()=>{this.currentId!==N0&&(_0.cancel(this.currentId),this.currentId=N0)});ge(this,"disposeEffect",()=>this.cancel)}static create(){return new Yt}static request(t){return _0.request(t)}static cancel(t){return _0.cancel(t)}request(t){this.cancel(),this.currentId=_0.request(()=>{this.currentId=N0,t()})}}function C_(){const e=$h(Yt.create).current;return S_(e.disposeEffect),e}function Oue(e){return e==null?e:"current"in e?e.current:e}function E_(e,t=!1,n=!0){const s=C_();return vc((r,i=null)=>{s.cancel();const o=Oue(e);o!=null&&(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?r():s.request(()=>{function l(){o&&Promise.all(o.getAnimations().map(c=>c.finished)).then(()=>{i!=null&&i.aborted||a1.flushSync(r)}).catch(()=>{if(n){if(i!=null&&i.aborted)return;a1.flushSync(r)}else o.getAnimations().length>0&&o.getAnimations().some(c=>c.pending||c.playState!=="finished")&&l()})}t?s.request(l):l()}))})}function Due(e,t=!1,n=!1){const[s,r]=p.useState(e&&t?"idle":void 0),[i,o]=p.useState(e);return e&&!i&&(o(!0),r("starting")),!e&&i&&s!=="ending"&&!n&&r("ending"),!e&&!i&&s==="ending"&&r(void 0),lr(()=>{if(!e&&i&&s!=="ending"&&n){const l=Yt.request(()=>{r("ending")});return()=>{Yt.cancel(l)}}},[e,i,s,n]),lr(()=>{if(!e||t)return;const l=Yt.request(()=>{a1.flushSync(()=>{r(void 0)})});return()=>{Yt.cancel(l)}},[t,e]),lr(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&r("starting");const l=Yt.request(()=>{r("idle")});return()=>{Yt.cancel(l)}},[t,e,i,r,s]),p.useMemo(()=>({mounted:i,setMounted:o,transitionStatus:s}),[i,s])}function Bue(e){const{open:t,defaultOpen:n,onOpenChange:s,disabled:r}=e,i=t!==void 0,[o,l]=$ue({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:c,setMounted:u,transitionStatus:d}=Due(o,!0,!0),[f,h]=p.useState(o),[{height:x,width:g},y]=p.useState({height:void 0,width:void 0}),v=Nue(),[m,k]=p.useState(),b=m??v,[j,A]=p.useState(!1),[M,E]=p.useState(!1),z=p.useRef(null),T=p.useRef(null),$=p.useRef(null),_=p.useRef(null),R=E_(_,!1),N=vc(H=>{const B=!o,I=j_(Rue,H.nativeEvent);if(s(B,I),I.isCanceled)return;const L=_.current;T.current==="css-animation"&&L!=null&&L.style.removeProperty("animation-name"),!j&&!M&&(T.current!=null&&T.current!=="css-animation"&&!c&&B&&u(!0),T.current==="css-animation"&&(!f&&B&&h(!0),!c&&B&&u(!0))),l(B),T.current==="none"&&c&&!B&&u(!1)});return lr(()=>{i&&T.current==="none"&&!M&&!o&&u(!1)},[i,M,o,t,u]),p.useMemo(()=>({abortControllerRef:z,animationTypeRef:T,disabled:r,handleTrigger:N,height:x,mounted:c,open:o,panelId:b,panelRef:_,runOnceAnimationsFinish:R,setDimensions:y,setHiddenUntilFound:A,setKeepMounted:E,setMounted:u,setOpen:l,setPanelIdState:k,setVisible:h,transitionDimensionRef:$,transitionStatus:d,visible:f,width:g}),[z,T,r,N,x,c,o,b,_,R,y,A,E,u,l,h,$,d,f,g])}const $_=p.createContext(void 0);function A_(){const e=p.useContext($_);if(e===void 0)throw new Error(ib(15));return e}let Xx=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Hue={[Xx.startingStyle]:""},que={[Xx.endingStyle]:""},M_={transitionStatus(e){return e==="starting"?Hue:e==="ending"?que:null}};let i1=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Xx.startingStyle]="startingStyle",e[e.endingStyle=Xx.endingStyle]="endingStyle",e}({}),Pue=function(e){return e.panelOpen="data-panel-open",e}({});const Uue={[i1.open]:""},Fue={[i1.closed]:""},Vue={open(e){return e?{[Pue.panelOpen]:""}:null}},Gue={open(e){return e?Uue:Fue}},T_={...Gue,...M_},um=p.forwardRef(function(t,n){const{render:s,className:r,defaultOpen:i=!1,disabled:o=!1,onOpenChange:l,open:c,...u}=t,d=vc(l),f=Bue({open:c,defaultOpen:i,onOpenChange:d,disabled:o}),h=p.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),x=p.useMemo(()=>({...f,onOpenChange:d,state:h}),[f,d,h]),g=ob("div",t,{state:h,ref:n,props:u,stateAttributesMapping:T_});return a.jsx($_.Provider,{value:x,children:g})});function Wue(){return typeof window<"u"}function Kue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xue(e){return Wue()?e instanceof HTMLElement||e instanceof Kue(e).HTMLElement:!1}const Zue=p.createContext(void 0);function Yue(e=!1){const t=p.useContext(Zue);if(t===void 0&&!e)throw new Error(ib(16));return t}function Que(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:r=0,isNativeButton:i}=e,o=s&&t!==!1,l=s&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(u.tabIndex=r,!i&&n&&(u.tabIndex=t?r:-1)),(i&&(t||o)||!i&&n)&&(u["aria-disabled"]=n),i&&(!t||l)&&(u.disabled=n),u},[s,n,t,o,l,i,r])}}function Jue(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:r=!0}=e,i=p.useRef(null),o=Yue(!0)!==void 0,l=vc(()=>{const h=i.current;return!!((h==null?void 0:h.tagName)==="A"&&(h!=null&&h.href))}),{props:c}=Que({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:s,isNativeButton:r}),u=p.useCallback(()=>{const h=i.current;ede(h)&&o&&t&&c.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,c.disabled,o]);lr(u,[u]);const d=p.useCallback((h={})=>{const{onClick:x,onMouseDown:g,onKeyUp:y,onKeyDown:v,onPointerDown:m,...k}=h;return k_({type:r?"button":void 0,onClick(j){if(t){j.preventDefault();return}x==null||x(j)},onMouseDown(j){t||g==null||g(j)},onKeyDown(j){if(t||(t5(j),v==null||v(j)),j.baseUIHandlerPrevented)return;const A=j.target===j.currentTarget&&!r&&!l()&&!t,M=j.key==="Enter",E=j.key===" ";A&&((E||M)&&j.preventDefault(),M&&(x==null||x(j)))},onKeyUp(j){t||(t5(j),y==null||y(j)),!j.baseUIHandlerPrevented&&j.target===j.currentTarget&&!r&&!t&&j.key===" "&&(x==null||x(j))},onPointerDown(j){if(t){j.preventDefault();return}m==null||m(j)}},r?void 0:{role:"button"},c,k)},[t,c,r,l]),f=vc(h=>{i.current=h,u()});return{getButtonProps:d,buttonRef:f}}function ede(e){return Xue(e)&&e.tagName==="BUTTON"}const tde={...Vue,...M_},dm=p.forwardRef(function(t,n){const{panelId:s,open:r,handleTrigger:i,state:o,disabled:l}=A_(),{className:c,disabled:u=l,id:d,render:f,nativeButton:h=!0,...x}=t,{getButtonProps:g,buttonRef:y}=Jue({disabled:u,focusableWhenDisabled:!0,native:h}),v=p.useMemo(()=>({"aria-controls":r?s:void 0,"aria-expanded":r,disabled:u,onClick:i}),[s,u,r,i]);return ob("button",t,{state:o,ref:[n,y],props:[v,x,g],stateAttributesMapping:tde})});let nde=function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e}({});function sde(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:s,height:r,hiddenUntilFound:i,keepMounted:o,id:l,mounted:c,onOpenChange:u,open:d,panelRef:f,runOnceAnimationsFinish:h,setDimensions:x,setMounted:g,setOpen:y,setVisible:v,transitionDimensionRef:m,visible:k,width:b}=e,j=p.useRef(!1),A=p.useRef(null),M=p.useRef(d),E=p.useRef(d),z=C_(),T=p.useMemo(()=>n.current==="css-animation"?!k:!d&&!c,[d,c,k,n]),$=vc(R=>{if(!R)return;if(n.current==null||m.current==null){const B=getComputedStyle(R),I=B.animationName!=="none"&&B.animationName!=="",L=B.transitionDuration!=="0s"&&B.transitionDuration!=="";I&&L||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),R.getAttribute(nde.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?m.current="width":m.current="height"}if(n.current!=="css-transition")return;(r===void 0||b===void 0)&&(x({height:R.scrollHeight,width:R.scrollWidth}),E.current&&R.style.setProperty("transition-duration","0s"));let N=-1,H=-1;return N=Yt.request(()=>{E.current=!1,H=Yt.request(()=>{setTimeout(()=>{R.style.removeProperty("transition-duration")})})}),()=>{Yt.cancel(N),Yt.cancel(H)}}),_=Qk(s,f,$);return lr(()=>{if(n.current!=="css-transition")return;const R=f.current;if(!R)return;let N=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const H={"justify-content":R.style.justifyContent,"align-items":R.style.alignItems,"align-content":R.style.alignContent,"justify-items":R.style.justifyItems};Object.keys(H).forEach(B=>{R.style.setProperty(B,"initial","important")}),!E.current&&!o&&R.setAttribute(i1.startingStyle,""),x({height:R.scrollHeight,width:R.scrollWidth}),N=Yt.request(()=>{Object.entries(H).forEach(([B,I])=>{I===""?R.style.removeProperty(B):R.style.setProperty(B,I)})})}else{if(R.scrollHeight===0&&R.scrollWidth===0)return;x({height:R.scrollHeight,width:R.scrollWidth});const H=new AbortController;t.current=H;const B=H.signal;let I=null;const L=i1.endingStyle;return I=new MutationObserver(O=>{O.some(q=>q.type==="attributes"&&q.attributeName===L)&&(I==null||I.disconnect(),I=null,h(()=>{x({height:0,width:0}),R.style.removeProperty("content-visibility"),g(!1),t.current===H&&(t.current=null)},B))}),I.observe(R,{attributes:!0,attributeFilter:[L]}),()=>{I==null||I.disconnect(),z.cancel(),t.current===H&&(H.abort(),t.current=null)}}return()=>{Yt.cancel(N)}},[t,n,z,i,o,c,d,f,h,x,g]),lr(()=>{if(n.current!=="css-animation")return;const R=f.current;R&&(A.current=R.style.animationName||A.current,R.style.setProperty("animation-name","none"),x({height:R.scrollHeight,width:R.scrollWidth}),!M.current&&!j.current&&R.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,h(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,d,f,h,x,g,v,k]),S_(()=>{const R=Yt.request(()=>{M.current=!1});return()=>Yt.cancel(R)}),lr(()=>{if(!i)return;const R=f.current;if(!R)return;let N=-1,H=-1;return d&&j.current&&(R.style.transitionDuration="0s",x({height:R.scrollHeight,width:R.scrollWidth}),N=Yt.request(()=>{j.current=!1,H=Yt.request(()=>{setTimeout(()=>{R.style.removeProperty("transition-duration")})})})),()=>{Yt.cancel(N),Yt.cancel(H)}},[i,d,f,x]),lr(()=>{const R=f.current;R&&i&&T&&(R.setAttribute("hidden","until-found"),n.current==="css-transition"&&R.setAttribute(i1.startingStyle,""))},[i,T,n,f]),p.useEffect(function(){const N=f.current;if(!N)return;function H(B){j.current=!0,y(!0),u(!0,j_(_ue,B))}return N.addEventListener("beforematch",H),()=>{N.removeEventListener("beforematch",H)}},[u,f,y]),p.useMemo(()=>({props:{hidden:T,id:l,ref:_}}),[T,l,_])}let ww=function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e}({});function rde(e){const t=$h(ide,e).current;return t.next=e,lr(t.effect),t}function ide(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ode(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,i=rde(n),o=vc(r),l=E_(s,n);p.useEffect(()=>{t&&l(()=>{n===i.current&&o()})},[t,n,o,l,i])}const fm=p.forwardRef(function(t,n){const{className:s,hiddenUntilFound:r,keepMounted:i,render:o,id:l,...c}=t,{abortControllerRef:u,animationTypeRef:d,height:f,mounted:h,onOpenChange:x,open:g,panelId:y,panelRef:v,runOnceAnimationsFinish:m,setDimensions:k,setHiddenUntilFound:b,setKeepMounted:j,setMounted:A,setPanelIdState:M,setOpen:E,setVisible:z,state:T,transitionDimensionRef:$,visible:_,width:R,transitionStatus:N}=A_(),H=r??!1,B=i??!1;lr(()=>{if(l)return M(l),()=>{M(void 0)}},[l,M]),lr(()=>{b(H)},[b,H]),lr(()=>{j(B)},[j,B]);const{props:I}=sde({abortControllerRef:u,animationTypeRef:d,externalRef:n,height:f,hiddenUntilFound:H,id:y,keepMounted:B,mounted:h,onOpenChange:x,open:g,panelRef:v,runOnceAnimationsFinish:m,setDimensions:k,setMounted:A,setOpen:E,setVisible:z,transitionDimensionRef:$,visible:_,width:R});ode({open:g&&N==="idle",ref:v,onComplete(){g&&k({height:void 0,width:void 0})}});const L=p.useMemo(()=>({...T,transitionStatus:N}),[T,N]),O=ob("div",t,{state:L,ref:[n,v],props:[I,{style:{[ww.collapsiblePanelHeight]:f===void 0?"auto":`${f}px`,[ww.collapsiblePanelWidth]:R===void 0?"auto":`${R}px`}},c],stateAttributesMapping:T_});return B||H||!B&&h?O:null});function ade(e){const t=Math.floor(Math.max(0,e)/6e4);if(t<1)return"Updated just now";if(t<60)return`Updated ${t}m ago`;const n=Math.floor(t/60);return n<24?`Updated ${n}h ago`:`Updated ${Math.floor(n/24)}d ago`}function lde({atMs:e}){const t=Lo(3e4);return a.jsx("span",{className:"todo-card__updated",children:ade(t-e)})}const cde={pending:"Not started",in_progress:"In progress",completed:"Done"};function ude({status:e}){const t={"aria-label":cde[e],role:"img",className:"todo-card__status"};return e==="completed"?a.jsx(aT,{...t}):e==="in_progress"?a.jsx(_Y,{...t}):a.jsx(bY,{...t})}function dde(e){let t;for(const n of e){const s=n.kind==="run"?n.cot.todoWrittenAtMs:void 0;s!==void 0&&(t===void 0||s>t)&&(t=s)}return t}function fde({todo:e,writtenThisRun:t,updatedAtMs:n}){const s=(e==null?void 0:e.items)??[],r=s.length,i=s.filter(f=>f.status==="completed").length,o=i===r,[l,c]=p.useState();if(r===0||!t&&o)return null;const u=l??!o,d=s.find(f=>f.status==="in_progress")??s.find(f=>f.status==="pending");return a.jsx("section",{className:"todo-card","data-slot":"todo-card","aria-label":"Todo",children:a.jsxs(um,{open:u,onOpenChange:c,children:[a.jsxs("div",{className:"todo-card__header",children:[a.jsxs(dm,{className:"todo-card__trigger",children:[o?a.jsx(aT,{"aria-label":"All done",role:"img",className:"todo-card__done"}):null,a.jsxs("span",{className:"todo-card__title",children:["Todo ",i,"/",r]}),!u&&d!==void 0?a.jsxs(a.Fragment,{children:[" ",a.jsxs("span",{className:"todo-card__current",children:["· ",d.text]})]}):null,a.jsx(Ro,{"aria-hidden":"true",className:"chat-step__chevron"})]}),n===void 0?null:a.jsx(lde,{atMs:n})]}),a.jsx(fm,{className:"todo-card__panel",children:a.jsx("ol",{className:"todo-card__items",children:s.map((f,h)=>a.jsxs("li",{className:"todo-card__item","data-status":f.status,children:[a.jsx(ude,{status:f.status}),f.status==="completed"?a.jsx("s",{children:f.text}):a.jsx("span",{children:f.text})]},h))})})]})})}function hde(e){return e.toolName==="todo_write"&&e.state==="output-available"}function pde(e){const t=[];let n;for(const s of e){if(s.kind==="interim"){n=void 0,t.push({kind:"interim",key:`segment-${t.length}`,text:s.text});continue}n===void 0&&(n={kind:"trace",key:`segment-${t.length}`,steps:[],counted:[],live:!1},t.push(n)),n.steps.push(s),n.live||(n.live=s.live),s.kind==="tools"&&n.counted.push(...s.tools.filter(r=>!hde(r)))}return t}const xde=300,gde=700;function mde(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function z_({children:e,className:t="",dwellMs:n=gde,pageKey:s="",...r}){const i=Math.max(n,xde),[o,l]=p.useState({key:s,node:e}),[c,u]=p.useState(null),d=p.useRef({key:s,node:e}),f=p.useRef({key:s,node:e}),h=p.useRef(Date.now()),x=p.useRef(null);return p.useEffect(()=>{if(f.current={key:s,node:e},s===d.current.key){d.current=f.current;return}const g=()=>{const v=d.current;d.current=f.current,h.current=Date.now(),l(f.current),u(mde()?null:v.node)};if(x.current!==null)return;const y=i-(Date.now()-h.current);if(y<=0){g();return}x.current=window.setTimeout(()=>{x.current=null,f.current.key!==d.current.key&&g()},y)},[e,i,s]),p.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]),a.jsx("span",{className:`chat-inline-pager ${t}`.trim(),"data-slot":"chat-inline-pager",...r,children:a.jsxs("span",{className:"chat-inline-pager__flip",children:[c?a.jsx("span",{className:"chat-inline-pager__page","data-motion":"out",children:c}):null,a.jsx("span",{className:"chat-inline-pager__page","data-motion":c?"in":void 0,onAnimationEnd:g=>{g.target===g.currentTarget&&u(null)},children:s===o.key?e:o.node})]})})}const yde=/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;function vde(e){if(/^\*{1,2}$/.test(e))return"";const t=e.split("**");return t.length%2===0?t.slice(0,-1).join("**")+t[t.length-1]:e}function kde(e){return e.replace(/(^|\n)\*\*([^*\n]+)\*\*(?=\n|$)/g,"$1$2")}function bde(e){return e.split(yde).map((t,n)=>t.startsWith("**")&&t.endsWith("**")&&t.length>4?a.jsx("strong",{children:t.slice(2,-2)},n):t.startsWith("*")&&t.endsWith("*")&&t.length>2&&!t.startsWith("**")?a.jsx("em",{children:t.slice(1,-1)},n):t.startsWith("`")&&t.endsWith("`")&&t.length>2?a.jsx("code",{children:t.slice(1,-1)},n):t)}function wde({text:e,unwrapLines:t=!1,className:n,...s}){let r=vde(e);return t&&(r=kde(r)),a.jsx("span",{className:`chat-thought-md ${n??""}`.trim(),...s,children:bde(r)})}function ab({children:e,className:t="",...n}){return a.jsx("span",{className:`text-shimmer ${t}`.trim(),"data-slot":"text-shimmer",...n,children:e})}function jde(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?"briefly":`${Math.round(e/1e3)}s`}function Sde({className:e="",dwellMs:t,step:n,...s}){const r=n.text.trim(),i=jde(n.durationMs),o=a.jsx(z_,{dwellMs:t,pageKey:n.live?"live":"settled",children:n.live?a.jsx(ab,{className:"chat-step__label",children:"Thinking…"}):a.jsx("span",{className:"chat-step__label",children:i?a.jsxs(a.Fragment,{children:["Thought ",a.jsx("span",{className:"chat-step__meta",children:i})]}):"Thought"})}),l=a.jsx("span",{"aria-hidden":"true",className:"chat-tool-kind","data-kind":"thinking","data-slot":"chat-tool-kind",children:a.jsx(vY,{})});return r?a.jsxs(um,{className:`chat-step ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[a.jsxs(dm,{className:"chat-step__trigger",children:[l,o,a.jsx(Ro,{"aria-hidden":"true",className:"chat-step__chevron"})]}),a.jsx(fm,{keepMounted:!0,className:"chat-step__panel",children:a.jsx("div",{className:"chat-step__body",children:a.jsx(wde,{text:n.text})})})]}):a.jsxs("p",{className:`chat-step chat-step--plain ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[l,o]})}const Cde=["path","file_path","filePath","command","cmd","query","pattern","url","name","description","task"],jw=120;function Ede(e){if(!(typeof e!="object"||e===null))for(const t of Cde){const n=e[t];if(typeof n=="string"&&n.length>0)return n.length>jw?`${n.slice(0,jw)}…`:n}}function ko(e){if(!(e!=null&&e.startsWith("mcp__")))return e;const t=e.slice(5),n=t.indexOf("__");return n===-1?t:`${t.slice(0,n)}/${t.slice(n+2)}`}function lb(e){if(!e)return;let t;try{t=JSON.parse(e)}catch{return}return Ede(t)}function N_(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}const $de={bash:"shell",shell:"shell",sh:"shell",terminal:"shell",cmd:"shell",grep:"search",find:"search",glob:"search",ls:"search",search:"search",web_search:"web",websearch:"web",webfetch:"web",web_fetch:"web",web:"web",browser:"web",read:"file",read_file:"file",cat:"file",edit:"edit",write:"edit",write_file:"edit",str_replace:"edit"};function __(e){return(e??"").trim().toLowerCase().replace(/-/g,"_")}function Zx(e){return $de[__(e)]??"tool"}function Ade(e){const t=new Set(e.map(n=>Zx(n.toolName)));return t.size===1?[...t][0]:"tool"}function Mde({images:e,testId:t="message-images"}){const[n,s]=p.useState(void 0);return e.length===0?null:a.jsxs("div",{className:"flex flex-wrap justify-end gap-2","data-testid":t,children:[e.map((r,i)=>a.jsx(Tde,{image:r,index:i,onOpen:()=>s(i)},i)),n===void 0?null:a.jsx(R_,{images:e,index:n,onIndexChange:s,onClose:()=>s(void 0)})]})}function Tde({image:e,index:t,onOpen:n}){const[s,r]=nT(),i=S3(e,r,"thumbnail");return a.jsx("div",{ref:s,children:a.jsx(Jp,{src:i.status==="ready"?i.src:void 0,isLoading:i.status==="loading",alt:`Image ${t+1}`,onClick:n})})}const zde="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";function R_({images:e,index:t,onIndexChange:n,onClose:s}){const[r,i]=p.useState(0),o=e[t],l=S3(o,!0,"original",r);if(l.status==="error")return a.jsx(mr,{isOpen:!0,width:420,onOpenChange:u=>u?void 0:s(),children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Image unavailable",onOpenChange:()=>s()}),content:a.jsx(qs,{children:a.jsxs(le,{gap:3,padding:3,children:[a.jsx("div",{role:"alert",children:a.jsx(Y,{children:"Couldn't load the original image."})}),a.jsx("div",{children:a.jsx(Q,{label:"Try again",onClick:()=>i(u=>u+1)})})]})})})});const c=e.map((u,d)=>({src:d===t&&l.status==="ready"?l.src:a9(u,"thumbnail")??a9(u,"preview")??zde,alt:`Image ${d+1}`}));return a.jsx(SC,{isOpen:!0,media:c,index:t,onIndexChange:n,onOpenChange:u=>{u||s()}})}const Nde={shell:E3,search:LY,web:AY,file:jY,edit:xY,tool:MY};function Dp({className:e="",kind:t,...n}){const s=Nde[t];return a.jsx("span",{"aria-hidden":"true",className:`chat-tool-kind ${e}`.trim(),"data-kind":t,"data-slot":"chat-tool-kind",...n,children:a.jsx(s,{})})}const _de={"input-streaming":"running","input-available":"running","output-available":"complete","output-error":"error"};function I_(e){var t,n;return e.argsText!=null||e.output!=null||(((t=e.children)==null?void 0:t.length)??0)>0||e.detail!=null||(((n=e.images)==null?void 0:n.length)??0)>0}function L_({tool:e,className:t,...n}){var s,r;return a.jsxs("div",{className:t,...n,children:[e.detail!==void 0&&e.detail!==null?e.detail:a.jsxs(a.Fragment,{children:[e.argsText!=null?a.jsx("pre",{className:"chat-tool__section","data-slot":"chat-tool-args",children:e.argsText}):null,e.output!==void 0?a.jsx("pre",{className:"chat-tool__section","data-slot":"chat-tool-result",children:e.output}):null]}),(s=e.children)!=null&&s.length?a.jsx("ol",{className:"chat-tool-step__list","data-slot":"chat-tool-children",children:e.children.map((i,o)=>a.jsxs("li",{className:"chat-tool-step__item",children:[a.jsx(Dp,{kind:Zx(i.toolName)}),a.jsx(O_,{tools:[i]})]},i.toolCallId??o))}):null,(r=e.images)==null?void 0:r.map((i,o)=>a.jsx(Rde,{image:i},o))]})}function Rde({image:e}){const[t,n]=nT(),[s,r]=p.useState(!1),i=S3(e,n,"preview");return i.status==="loading"?a.jsx("div",{ref:t,"data-testid":"tool-image-loading",children:a.jsx(ac,{height:160,width:"100%"})}):i.status==="error"?a.jsx("div",{ref:t,role:"img","aria-label":"Image unavailable",className:"flex h-40 w-full items-center justify-center text-muted",children:a.jsx(A3,{"aria-hidden":"true",className:"size-6"})}):a.jsxs("div",{ref:t,children:[a.jsx("button",{type:"button","aria-label":"View image",className:"block min-h-11 min-w-11 max-w-full cursor-zoom-in",onClick:()=>r(!0),children:a.jsx("img",{src:i.src,alt:"",style:{maxWidth:"100%"}})}),s?a.jsx(R_,{images:[e],index:0,onIndexChange:()=>{},onClose:()=>r(!1)}):null]})}function Ide(e,t){const n=I_(e)?a.jsx(L_,{tool:e}):void 0;return{name:ko(e.toolName)??"tool",status:_de[e.state],target:lb(e.argsText),...e.diffStat?{additions:e.diffStat.additions,deletions:e.diffStat.deletions}:{},duration:N_(e.durationMs),errorMessage:e.state==="output-error"?e.output:void 0,key:e.toolCallId??`tool-${t}`,resultDetail:n}}function O_({tools:e,className:t="",...n}){return e.length?a.jsx("div",{className:`chat-tool ${t}`.trim(),"data-slot":"chat-tool-group","data-tool-count":e.length,"data-state":e.length===1?e[0].state:void 0,...n,children:a.jsx(nC,{calls:e.map(Ide)})}):null}const ff={past:"Ran",noun:["command","commands"]},oy={past:"Read",noun:["file","files"]},Sw={past:"Edited",noun:["file","files"]},Cw={past:"Wrote",noun:["file","files"]},Ew={past:"Searched",noun:["pattern","patterns"]},$w={past:"Searched",noun:["path","paths"]},Lde={past:"Listed",noun:["directory","directories"]},Aw={past:"Searched",noun:["web page","web pages"]},R0={past:"Fetched",noun:["page","pages"]},Ode={bash:ff,shell:ff,sh:ff,terminal:ff,cmd:ff,read:oy,read_file:oy,cat:oy,edit:Sw,str_replace:Sw,write:Cw,write_file:Cw,grep:Ew,find:$w,glob:$w,ls:Lde,search:Ew,web_search:Aw,websearch:Aw,webfetch:R0,web_fetch:R0,web:R0,browser:R0},D_={past:"Used",noun:["tool","tools"]};function Mw(e){return Ode[__(e)]??D_}const Tw=72;function Dde(e){return e.length<=Tw?e:e.includes("/")&&!e.includes(" ")?`…${e.slice(-71)}`:`${e.slice(0,Tw-1)}…`}function zw(e,[t,n]){return e!==1?`${e} ${n}`:`${t==="tool"?"a":"1"} ${t}`}function B_(e){if(e.length===1){const[n]=e,s=Mw(n.toolName),r=lb(n.argsText);return r?`${s.past} ${Dde(r)}`:s===D_?`Used ${ko(n.toolName)??"a tool"}`:`${s.past} ${zw(1,s.noun)}`}const t=new Map;for(const n of e){const s=Mw(n.toolName),r=`${s.past}:${s.noun[1]}`,i=t.get(r)??{verb:s,count:0};i.count+=1,t.set(r,i)}return[...t.values()].map(({verb:n,count:s},r)=>{const i=`${n.past} ${zw(s,n.noun)}`;return r===0?i:i.charAt(0).toLowerCase()+i.slice(1)}).join(", ")}function H_(e){const t=e.filter(s=>s.state==="output-error").length,n=e.reduce((s,r)=>r.diffStat?{additions:((s==null?void 0:s.additions)??0)+r.diffStat.additions,deletions:((s==null?void 0:s.deletions)??0)+r.diffStat.deletions}:s,void 0);return{failed:t,diffStat:n}}function q_({failed:e,diffStat:t}){return a.jsxs(a.Fragment,{children:[t?a.jsxs(a.Fragment,{children:[" ",a.jsxs("span",{className:"chat-step__meta","data-slot":"chat-tool-diff-stat",children:[a.jsxs("span",{className:"text-success",children:["+",t.additions]})," ",a.jsxs("span",{className:"text-danger",children:["-",t.deletions]})]})]}):null,e>0?a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"chat-step__meta chat-step__meta--error",children:e===1?"1 failed":`${e} failed`})]}):null]})}function P_(e){const t=[];for(const n of e.children??[])t.push(n,...P_(n));return t}function Bde({className:e="",dwellMs:t,step:n,...s}){const{tools:r}=n,{failed:i,diffStat:o}=H_(r),l=r.flatMap(P_),c=l.length,u=l.filter(v=>v.state==="output-error").length,d=r.reduce((v,m)=>v+(m.durationMs??0),0),f=r.find(v=>v.toolCallId===n.activeToolCallId)??r[r.length-1];let h,x=f;for(;x;){const v=(x.children??[]).filter(k=>k.state==="input-available"),m=v[v.length-1];if(!m)break;h=m,x=m}const g=n.live?Zx(f==null?void 0:f.toolName):Ade(r),y=n.live?`running:${(f==null?void 0:f.toolCallId)??"none"}`:"settled";return a.jsxs(um,{className:`chat-step chat-tool-step ${e}`.trim(),"data-slot":"chat-tool-step",...s,children:[a.jsxs(dm,{className:"chat-step__trigger",children:[a.jsx(z_,{dwellMs:t,pageKey:y,children:n.live?a.jsxs("span",{className:"chat-tool-step__page",children:[a.jsx(Dp,{kind:g}),a.jsx(ab,{className:"chat-step__label",children:f!=null&&f.toolName?h!=null&&h.toolName?`Running ${ko(f.toolName)} › ${ko(h.toolName)}…`:`Running ${ko(f.toolName)}…`:"Running…"})]}):a.jsxs("span",{className:"chat-tool-step__page",children:[a.jsx(Dp,{kind:g}),a.jsx("span",{className:"chat-step__label",children:B_(r)}),c>0?a.jsx("span",{className:"chat-step__meta","data-slot":"chat-tool-nested-count",children:c===1?"1 nested call":`${c} nested calls`}):null,u>0?a.jsx("span",{className:"chat-step__meta chat-step__meta--error","data-slot":"chat-tool-nested-failed",children:u===1?"1 nested failed":`${u} nested failed`}):null,a.jsx(q_,{failed:i,diffStat:o}),d>0?a.jsx("span",{className:"chat-step__meta",children:N_(d)}):null]})}),a.jsx(Ro,{"aria-hidden":"true",className:"chat-step__chevron"})]}),a.jsx(fm,{keepMounted:!0,className:"chat-step__panel",children:r.length===1?I_(r[0])?a.jsx("div",{className:"chat-tool-step__detail","data-slot":"chat-tool-step-detail",children:a.jsx(L_,{tool:r[0]})}):null:a.jsx("ol",{className:"chat-tool-step__list",children:r.map((v,m)=>a.jsxs("li",{className:"chat-tool-step__item",children:[a.jsx(Dp,{kind:Zx(v.toolName)}),a.jsx(O_,{tools:[v]})]},v.toolCallId??m))})})]})}function Hde(e){if(e===void 0||!Number.isFinite(e)||e<0)return;const t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t}s`;if(t<3600){const i=Math.floor(t/60),o=t%60;return`${i}m ${o}s`}const n=Math.floor(t/3600),s=Math.floor(t%3600/60),r=t%60;return`${n}h ${s}m ${r}s`}function qde(e){const t=Math.max(0,e)/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${(t%60).toFixed(1)}s`}function Pde({children:e,className:t="",phase:n,...s}){return n==="hidden"?null:a.jsx("div",{className:`chain-of-thought ${t}`.trim(),"data-phase":n,"data-slot":"chain-of-thought",...s,children:e})}function Ude({startedAtMs:e,running:t}){const[n,s]=p.useState(()=>Date.now()),[r,i]=p.useState(t);return t&&!r&&i(!0),p.useEffect(()=>{if(!t)return;s(Date.now());const o=window.setInterval(()=>s(Date.now()),100);return()=>{window.clearInterval(o),s(Date.now())}},[t]),e===void 0||!r?null:a.jsxs(a.Fragment,{children:[" ",a.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-clock",children:["· ",qde(n-e)]})]})}function Fde(e){const t=e.findLast(s=>s.live);if((t==null?void 0:t.kind)==="thinking")return"Thinking…";if((t==null?void 0:t.kind)!=="tools")return;const n=t.tools.find(s=>s.toolCallId===t.activeToolCallId)??t.tools[t.tools.length-1];return n!=null&&n.toolName?`Running ${ko(n.toolName)}…`:"Running…"}function Nw({className:e="",clock:t,counted:n,live:s=!1,steps:r,tail:i,waiting:o,...l}){const c=n.filter(x=>x.state==="output-available"||x.state==="output-error"),u=s?Fde(r)??o:void 0,d=r.some(x=>x.kind==="thinking"&&!x.live),f=c.length>0?B_(c):u!==void 0?void 0:d?"Thought":"Updated the todo list",h=a.jsxs(a.Fragment,{children:[f===void 0?null:a.jsx("span",{className:"chat-trace__label",children:f}),a.jsx(q_,{...H_(c)}),u===void 0?null:a.jsxs(a.Fragment,{children:[f===void 0?null:a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"chat-step__meta",children:"·"})," "]}),a.jsx(ab,{className:"chat-trace__label","data-slot":"chat-trace-current",children:u})]}),i===void 0?null:a.jsxs(a.Fragment,{children:[" ",a.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-tail",children:["· ",i]})]}),t===void 0?null:a.jsx(Ude,{...t})]});return r.length===0?a.jsx("div",{className:`chat-trace ${e}`.trim(),"data-slot":"chat-trace",...l,children:a.jsx("p",{className:"chain-of-thought__label",children:h})}):a.jsxs(um,{className:`chat-trace ${e}`.trim(),"data-slot":"chat-trace",...l,children:[a.jsxs(dm,{className:"chain-of-thought__trigger","data-slot":"chat-trace-trigger",children:[h,a.jsx(Ro,{"aria-hidden":"true",className:"chat-step__chevron"})]}),a.jsx(fm,{keepMounted:!0,className:"chain-of-thought__content","data-slot":"chain-of-thought-content",children:a.jsx("ol",{className:"chain-of-thought__steps","data-slot":"chain-of-thought-steps",children:r.map(x=>a.jsx("li",{className:"chain-of-thought__step","data-slot":"chain-of-thought-step",children:x.kind==="thinking"?a.jsx(Sde,{step:x}):a.jsx(Bde,{step:x})},x.id))})})]})}const n5=p.createContext(!1);function Vde(e){var l;if(!e||/^[#?]/.test(e)||e.startsWith("//")||e.includes("\\")||/^(mailto|tel|data|javascript):/i.test(e)||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e))return null;const[t,n=""]=e.split("#",2),s=/:(\d+)(?::\d+)?$/.exec(t??""),r=s?t.slice(0,s.index):t??"";if(!r||r.endsWith("/"))return null;const i=Number(((l=/^L(\d+)(?:-L?\d+)?$/.exec(n))==null?void 0:l[1])??(s==null?void 0:s[1])),o=r.slice(r.lastIndexOf("/")+1);return{path:r,name:o,...Number.isSafeInteger(i)&&i>0?{line:i}:{}}}function Gde(e){return typeof e=="string"?e:Array.isArray(e)&&e.every(t=>typeof t=="string")?e.join(""):null}function Wde({href:e,children:t}){const n=Vde(e);if(!n){const i=/^https?:\/\//.test(e);return a.jsx(Sg,{color:"accent",hasUnderline:!0,href:e,type:"inherit",...i?{target:"_blank",rel:"noopener noreferrer"}:{},children:a.jsx(n5.Provider,{value:!0,children:t})})}const s=Gde(t),r=s!==null&&(s===e||s===n.path||n.line!==void 0&&s===`${n.path}:${n.line}`);return a.jsxs("a",{className:"chat-file-link","data-slot":"chat-file-link",href:e,title:n.line?`${n.path}:${n.line}`:n.path,children:[a.jsx(Hd,{"aria-hidden":!0,className:"chat-file-link__icon"}),a.jsx(n5.Provider,{value:!0,children:r?n.line?`${n.name}:${n.line}`:n.name:t})]})}const U_=3,F_=p.createContext(void 0);function V_({children:e}){const t=p.useContext(F_),n=p.useContext(n5),s=a.jsx(R5,{className:"chat-inline-code","data-slot":"chat-inline-code",children:e}),r=typeof e=="string"?e.trim():e;return!n&&typeof r=="string"&&(t!=null&&t.has(r))?a.jsx("a",{href:r,className:"chat-inline-code-link","data-slot":"chat-inline-code-link",title:r,children:s}):s}const G_={inlineCode:V_},W_={inlineCode:V_,link:Wde};function K_({children:e,fileLinks:t=!1,linkedInlineCode:n,className:s="",...r}){return a.jsx("div",{className:`chat-markdown ${s}`.trim(),"data-slot":"chat-markdown","data-testid":"markdown-renderer",...r,children:a.jsx(F_.Provider,{value:t?n:void 0,children:a.jsx(e4,{components:t?W_:G_,density:"compact",headingLevelStart:U_,children:e})})})}function Kde({children:e,isStreaming:t=!1,fileLinks:n=!1,className:s="",...r}){return a.jsx("div",{className:`chat-markdown chat-markdown--stream ${s}`.trim(),"data-is-streaming":String(!!t),"data-slot":"chat-stream-markdown","data-testid":"stream-markdown-renderer",...r,children:a.jsx(e4,{components:n?W_:G_,density:"compact",headingLevelStart:U_,isStreaming:t,children:e})})}function Xde({children:e,className:t="",...n}){return a.jsx(V5,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-user",sender:"user",...n,children:e})}function Zde({children:e,className:t="",...n}){return a.jsx(V5,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-assistant",sender:"assistant",...n,children:e})}function Yde({children:e,className:t="",...n}){return a.jsx(JS,{className:t||void 0,"data-slot":"chat-message-bubble",...n,children:e})}function Qde({children:e,className:t="",...n}){return a.jsx("div",{className:`chat-message__body ${t}`.trim(),"data-slot":"chat-message-body",...n,children:e})}function Jde({children:e,className:t="",...n}){return a.jsx("div",{className:`chat-message__content ${t}`.trim(),"data-slot":"chat-message-content",...n,children:e})}function hm({"aria-label":e,tooltip:t,onPress:n,children:s,className:r="",...i}){return a.jsx("button",{"aria-label":e,className:`chat-message__action ${r}`.trim(),"data-slot":"chat-message-action",title:t,type:"button",onClick:n,...i,children:s})}function kc({children:e,className:t="",...n}){return a.jsx("div",{className:`chat-message__actions ${t}`.trim(),"data-slot":"chat-message-actions",...n,children:e})}function efe(e){return a.jsx(hm,{...e,children:a.jsx($3,{"aria-hidden":"true",size:16})})}function tfe(e){return a.jsx(hm,{...e,children:a.jsx(BY,{"aria-hidden":"true",size:16})})}function nfe(e){return a.jsx(hm,{...e,children:a.jsx(DY,{"aria-hidden":"true",size:16})})}kc.Copy=efe;kc.ThumbsUp=tfe;kc.ThumbsDown=nfe;const wa={User:Xde,Assistant:Zde,Bubble:Yde,Body:Qde,Content:Jde,Action:hm},sfe=new Set(["ECONNREFUSED","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","ECONNRESET","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_SOCKET"]);function rfe(e){if(typeof e=="string")return e;if(e instanceof Error)return e.message;if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return""}function X_(e,t=0){if(t>4)return{message:""};const n=rfe(e);if(!e||typeof e!="object")return{message:n};const s=e,r=ife(s),i=typeof s.code=="string"&&sfe.has(s.code)?s.code:void 0,o=X_(s.cause,t+1),l=o.message&&!n.includes(o.message)?o.message:"";return{status:r??o.status,networkCode:i??o.networkCode,message:[n,l].filter(Boolean).join(" ")}}function ife(e){if(typeof e.statusCode=="number")return e.statusCode;if(typeof e.status=="number")return e.status;const t=e.$metadata;if(_w(t)&&typeof t.httpStatusCode=="number")return t.httpStatusCode;const n=e.$response;if(_w(n)&&typeof n.statusCode=="number")return n.statusCode}function _w(e){return typeof e=="object"&&e!==null}const ofe=/network.?error|connection.?error|connection.?refused|connection.?lost|other side closed|fetch failed|getaddrinfo|ENOTFOUND|EAI_AGAIN|upstream.?connect|reset before headers|socket hang up|socket connection was closed|timed? out|timeout|terminated|websocket.?closed|websocket.?error|ended without|stream ended before message_stop|stream ended before a terminal response event|http2 request did not get a response|ECONNREFUSED|ETIMEDOUT|ECONNRESET|UND_ERR_/i,afe=/invalid_grant|oauth refresh failed|refresh.?token/i;function lfe(e){return e.status===401||/\b401\b/.test(e.message)?"auth":e.status===403||/\b403\b/.test(e.message)||/\b(?:plan|subscription|entitlement)\b/i.test(e.message)?"entitlement":e.networkCode||ofe.test(e.message)?"network":/invalid.?api.?key|authentication_error|unauthorized/i.test(e.message)||afe.test(e.message)?"auth":"unknown"}function cfe(e){return lfe(X_(e))}function ufe(e){const t=cfe(e);return t==="auth"?{title:"Provider authentication failed",description:"The provider rejected the credentials. Sign in again or update them in Provider settings, then retry. You can also choose another model."}:t==="entitlement"?{title:"This model is not included in your subscription plan",description:"Test the connection in Settings → Providers."}:/\b429\b|rate.?limit|quota.?exceeded/i.test(e)?{title:"Provider limit reached",description:"Wait a moment, or choose another model and retry."}:{title:"Run failed",description:/[{}\n]/.test(e)?"The provider could not complete this request. Check the error details, then retry or choose another model.":e}}function dfe({error:e,onRetry:t,onOpenProviderSettings:n,modelControl:s,className:r,...i}){const[o,l]=p.useState(!1),[c,u]=p.useState(!1),d=p.useRef(!1),[f,h]=p.useState(null),x=ufe(e),g=async()=>{if(!(!t||d.current)){d.current=!0,l(!0),h(null);try{await t()}catch(y){h(y instanceof Error?y.message:"Retry could not start.")}finally{d.current=!1,l(!1)}}};return a.jsxs(le,{className:r,gap:2,...i,children:[a.jsx(Pe,{status:"error",title:x.title,description:x.description}),a.jsxs(ye,{gap:2,wrap:"wrap",children:[n?a.jsx(Q,{label:"Provider settings",size:"sm",variant:"secondary",onClick:n}):null,s,t?a.jsx(Q,{label:"Retry request",size:"sm",variant:"secondary",isDisabled:o,onClick:()=>void g()}):null]}),f?a.jsx(Y,{role:"alert",style:{color:"var(--danger)"},children:f}):null,a.jsx(jg,{trigger:a.jsx(Y,{type:"body",size:"sm",color:"secondary",children:"Error details"}),isOpen:c,onOpenChange:u,children:c?a.jsx(Y,{as:"div",type:"body",size:"sm",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e}):null})]})}const ffe={time:{hour:"numeric",minute:"2-digit"},date:{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},year:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},full:{dateStyle:"full",timeStyle:"long"}},Rw=new Map;function Iw(e,t,n){const s=`\0${n}`;let r=Rw.get(s);return r===void 0&&(r=new Intl.DateTimeFormat(t,ffe[n]),Rw.set(s,r)),r.format(e)}function hfe(e,t=Date.now(),n){if(!Number.isFinite(e))return;const s=new Date(e),r=new Date(t);if(Number.isNaN(s.getTime())||Number.isNaN(r.getTime()))return;const i=s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()&&s.getDate()===r.getDate(),o=s.getFullYear()===r.getFullYear();return{label:Iw(s,n,i?"time":o?"date":"year"),full:Iw(s,n,"full"),iso:s.toISOString()}}const Lw={done:"Done",failed:"Failed",running:"Running"};function Z_(e){const t=Math.max(0,Math.floor(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function pfe({startedAt:e}){const t=Lo(1e3);return a.jsx(a.Fragment,{children:Z_(t-e)})}function xfe({tool:e,summary:t,openInPanel:n}){const s=rb(e),r=(s==null?void 0:s.kind)==="subagent"?s:void 0,i=e.state==="output-available"?"done":e.state==="output-error"?"failed":"running",o=t!==void 0?Ds(t):lb(e.argsText)??"Subagent",l=r==null?void 0:r.startedAt,c=r==null?void 0:r.endedAt,u=[Lw[i],(t==null?void 0:t.role)===void 0?void 0:`@${t.role}`,r==null?void 0:r.model,l===void 0?void 0:i==="running"?a.jsx(pfe,{startedAt:l},"elapsed"):c===void 0?void 0:Z_(c-l)];return a.jsxs(le,{className:"pigui-subagent-card rounded-lg border border-border p-3",gap:1,"data-slot":"subagent-card","data-status":i,children:[a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Hi,{variant:i==="failed"?"error":i==="running"?"success":"neutral",label:Lw[i],isPulsing:i==="running"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:o}),r===void 0?null:a.jsx(Q,{label:"View",variant:"ghost",size:"sm",onClick:()=>n(r.conversationId,"tasks")})]}),a.jsx("div",{className:"text-xs text-muted",children:u.map((d,f)=>d===void 0||d===""?null:f===0?a.jsx("span",{children:d},f):a.jsxs("span",{children:[" · ",d]},f))}),i==="running"&&(t==null?void 0:t.activity)!==void 0?a.jsxs("div",{className:"text-xs text-muted",children:["→ ",ko(t.activity.tool)??t.activity.tool,t.activity.target===void 0?"":` ${t.activity.target}`]}):null,i==="failed"&&e.output!==void 0&&e.output!==""?a.jsx("div",{className:"text-xs text-muted",children:e.output}):null]})}function gfe({tools:e,summaryOf:t,openInPanel:n}){return e.length===0?null:a.jsx(le,{gap:2,className:"pigui-subagent-cards",children:e.map(({key:s,tool:r})=>{const i=rb(r);return a.jsx(xfe,{tool:r,summary:(i==null?void 0:i.kind)==="subagent"?t==null?void 0:t(i.conversationId):void 0,openInPanel:n},s)})})}const ay=(e,t,n)=>e.startsWith(`${t} ${n}`)?e.slice(t.length+1+n.length):e.slice(t.length+1);function Y_(e){const t=[];let n,s=0,r=0,i=!1;const o=c=>({path:c,isNew:!1,isDeleted:!1,binary:!1,additions:0,deletions:0,lines:[]}),l=()=>{n!==void 0&&(n.path===""&&n.oldPath!==void 0&&(n.path=n.oldPath),t.push(n))};for(const c of e.split(`
395
- `)){if((s>0||r>0)&&n!==void 0){c.startsWith("\\")?n.lines.push({kind:"ctx",text:c}):c.startsWith("+")?(n.additions+=1,n.lines.push({kind:"add",text:c}),r-=1):c.startsWith("-")?(n.deletions+=1,n.lines.push({kind:"del",text:c}),s-=1):(n.lines.push({kind:"ctx",text:c}),s-=1,r-=1);continue}if(c.startsWith("@@")){const u=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/.exec(c);n!==void 0&&u!==null&&(s=u[2]===void 0?1:Number(u[2]),r=u[4]===void 0?1:Number(u[4]),n.lines.push({kind:"meta",text:c}));continue}if(c.startsWith("diff --git ")){l();const u=/^diff --git a\/(\S+) b\/(\S+)$/.exec(c);n=o((u==null?void 0:u[2])??c.slice(11)),i=!0;continue}if(c.startsWith("--- ")){n!==void 0&&i?(i=!1,c==="--- /dev/null"?n.isNew=!0:n.oldPath=ay(c,"---","a/")):(l(),n=o(""),c==="--- /dev/null"?n.isNew=!0:n.oldPath=ay(c,"---","a/"));continue}n!==void 0&&(c.startsWith("+++ ")?c==="+++ /dev/null"?n.isDeleted=!0:n.path=ay(c,"+++","b/"):c.startsWith("new file mode")?n.isNew=!0:c.startsWith("deleted file mode")?n.isDeleted=!0:c.startsWith("rename from ")?n.oldPath=c.slice(12):c.startsWith("rename to ")?n.path=c.slice(10):c.startsWith("copy from ")?n.oldPath=c.slice(10):c.startsWith("copy to ")?n.path=c.slice(8):(c.startsWith("Binary files")||c.startsWith("GIT binary patch"))&&(n.binary=!0))}return l(),t}const mfe={fontFamily:"var(--font-family-code)",fontSize:"var(--font-size-sm)",lineHeight:"var(--line-height-sm, 1.5)",overflowX:"auto",whiteSpace:"pre",borderRadius:"var(--radius-sm, 6px)"},yfe={add:{backgroundColor:"var(--color-success-muted)",color:"var(--color-text-primary)"},del:{backgroundColor:"var(--color-error-muted)",color:"var(--color-text-primary)"},ctx:{color:"var(--color-text-secondary)"},meta:{color:"var(--color-text-accent)",backgroundColor:"var(--color-background-muted)"}};function Q_({patch:e}){const t=p.useMemo(()=>Y_(e),[e]);return t.length===0?a.jsx(Y,{type:"supporting",children:"No changes."}):a.jsx(le,{gap:2,children:t.map((n,s)=>a.jsxs(le,{gap:0,children:[a.jsxs(ye,{gap:2,vAlign:"center",padding:1,children:[a.jsx(Y,{type:"supporting",weight:"semibold",maxLines:1,children:n.oldPath!==void 0&&n.oldPath!==n.path?`${n.oldPath} → ${n.path}`:n.path}),n.isNew?a.jsx(On,{label:"new",color:"green",size:"sm"}):null,n.isDeleted?a.jsx(On,{label:"deleted",color:"red",size:"sm"}):null,a.jsxs(Y,{type:"supporting",children:["+",n.additions," −",n.deletions]})]}),n.binary===!0?a.jsx(Y,{type:"supporting",children:"Binary file"}):n.lines.length===0?null:a.jsx("div",{style:mfe,children:n.lines.map((r,i)=>a.jsx("div",{style:yfe[r.kind],children:r.text},i))})]},`${n.path}-${s}`))})}function vfe(e){return e.kind==="diff"?a.jsx(Q_,{patch:e.patch}):void 0}function kfe(e){const t=n=>{var o;const s=rb(n),r=s===void 0?void 0:vfe(s),i=(o=n.children)==null?void 0:o.map(t);return r===void 0&&i===void 0?n:{...n,...r===void 0?{}:{detail:r},...i===void 0?{}:{children:i}}};return{...e,steps:e.steps.map(n=>n.kind==="tools"?{...n,tools:n.tools.map(t)}:n)}}function bfe({entry:e,connected:t,openInPanel:n,onFork:s,canFork:r=!0,forksAt:i,summaryOf:o,onRetry:l,onRetrySubmission:c,onEditSubmission:u,submissionEditDisabled:d,submissionEditTooltip:f,localEditAttachmentsUnsupported:h,todo:x,today:g}){switch(e.kind){case"user":return a.jsx(wfe,{entry:e,onRetrySubmission:c,onEditSubmission:u,submissionEditDisabled:d,submissionEditTooltip:f,localEditAttachmentsUnsupported:h,today:g});case"run":return a.jsx(jfe,{entry:e,connected:t,openInPanel:n,onFork:s,canFork:r,forksAt:i,summaryOf:o,onRetry:l,todo:x,today:g});case"compaction":return a.jsx(Xp,{variant:"divider",children:"Earlier context summarized"});case"reset":return a.jsx(Xp,{variant:"divider",children:"New context"})}}function wfe({entry:e,onRetrySubmission:t,onEditSubmission:n,submissionEditDisabled:s=!1,submissionEditTooltip:r,localEditAttachmentsUnsupported:i=!1,today:o}){const l=e.local,c=l!==void 0&&(e.status==="unknown"||e.status==="failed"),u=l!==void 0&&e.status==="failed",d=i&&l!==void 0&&(e.images.length>0||e.attachments.length>0),f=s||d,h=d?"Open in main to edit a message with attachments":r,x=e.status==="failed"?"error":e.status==="unknown"?"sending":e.status,g=e.text===""?null:a.jsx(kc,{className:"chat-message__copy",children:a.jsx(kc.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var v;(v=navigator.clipboard)==null||v.writeText(e.text)}})}),y=a.jsx(bg,{...e.timestamp===void 0?{}:{timestamp:a.jsx(J_,{timestamp:e.timestamp,today:o})},...x===void 0?{}:{status:x},className:"chat-message__metadata"});return a.jsx(wa.User,{"data-slot":l===void 0?"chat-message-user":"chat-message-local",children:a.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.attachments.length===0?null:a.jsx(sre,{attachments:e.attachments,...l===void 0?{}:{testId:"local-message-attachments"}}),e.images.length===0?null:a.jsx(Mde,{images:e.images,...l===void 0?{}:{testId:"local-message-images"}}),e.text===""?null:a.jsx(wa.Bubble,{children:a.jsx(wa.Content,{children:a.jsx(nre,{text:e.text,names:e.skills})})}),a.jsxs("div",{className:"chat-message__metadata-row",children:[g,e.status==="unknown"?a.jsx(w5,{locale:"en",overrides:{en:{"@astryx.chat.status.sending":"Not confirmed"}},children:y}):y,(l==null?void 0:l.error)===void 0?null:a.jsx("span",{className:"chat-message__local-error",title:l.error,children:l.error}),l===void 0||!c||t===void 0?null:a.jsx(Q,{label:"Retry",variant:"ghost",size:"sm",className:"chat-message__local-action",onClick:()=>t(l.requestId)}),l===void 0||!u||n===void 0?null:a.jsx(Q,{label:"Edit",variant:"ghost",size:"sm",className:"chat-message__local-action",isDisabled:f,...f&&h!==void 0?{tooltip:h}:{},onClick:()=>n(l.requestId)})]})]})})}function J_({timestamp:e,today:t}){const n=hfe(e,t);return n===void 0?null:a.jsx("time",{className:"chat-message__time","data-slot":"chat-message-time",dateTime:n.iso,title:n.full,children:n.label})}function jfe({entry:e,connected:t,openInPanel:n,onFork:s,canFork:r=!0,forksAt:i,summaryOf:o,onRetry:l,todo:c,today:u}){const{view:d,subagents:f}=p.useMemo(()=>aue(e.cot),[e.cot]),h=p.useMemo(()=>kfe(d),[d]),x=h.answer,g=e.forkEntryId===void 0?[]:(i==null?void 0:i(e.forkEntryId))??[],y=h.phase==="settled"?e.endedAt:void 0,v=h.phase==="settled"&&(y!==void 0||x!==void 0||e.forkEntryId!==void 0&&(r||g.length>0));return a.jsx(wa.Assistant,{children:a.jsxs(wa.Body,{children:[e.interrupted?a.jsx("p",{className:"mb-1",children:a.jsx(On,{label:"interrupted",color:"orange",size:"sm"})}):null,a.jsx(Sfe,{view:h}),a.jsx(gfe,{tools:f,summaryOf:o,openInPanel:n}),x===void 0?null:a.jsx(wa.Content,{children:x.streaming?a.jsx(Kde,{isStreaming:!0,children:x.text}):a.jsx(K_,{children:x.text})}),e.failure===void 0?null:a.jsx(dfe,{error:e.failure,onRetry:l}),v?a.jsxs(kc,{className:"chat-message__actions--persist",children:[y===void 0?null:a.jsx(bg,{timestamp:a.jsx(J_,{timestamp:y,today:u})}),x===void 0?null:a.jsx(kc.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var m;(m=navigator.clipboard)==null||m.writeText(x.text)}}),e.forkEntryId===void 0?null:g.length>0?a.jsxs("button",{type:"button",className:"pigui-fork-chip","aria-label":`${g.length} ${g.length===1?"fork":"forks"}`,title:"Open in Threads",disabled:!t,onClick:()=>n(g[0],"threads"),children:[a.jsx(c9,{"aria-hidden":"true"}),g.length," ",g.length===1?"fork":"forks"]}):r?a.jsx(wa.Action,{"aria-label":"Fork",tooltip:"Continue from here in a new conversation",disabled:!t,onPress:()=>s(e.forkEntryId),children:a.jsx(c9,{"aria-hidden":"true",className:"size-4"})}):null]}):null,a.jsx(fde,{todo:c==null?void 0:c.state,writtenThisRun:h.todoWrittenAtMs!==void 0,...(c==null?void 0:c.updatedAtMs)===void 0?{}:{updatedAtMs:c.updatedAtMs}})]})})}function Sfe({view:e}){var d;const t=p.useMemo(()=>pde(e.steps),[e.steps]);if(e.phase==="hidden")return null;const n=e.phase==="thinking"||e.phase==="acting";if(!n&&t.length===0)return null;const s=e.phase==="settled"?Hde(e.elapsedMs):void 0,r=s===void 0?void 0:e.outcome==="failed"?`Failed after ${s}`:s,i=n||e.phase==="answering"?{startedAtMs:e.anchorMs,running:n}:void 0,o=e.phase==="thinking"?"Thinking…":"Working…",l=n&&((d=t.at(-1))==null?void 0:d.kind)!=="trace",c=l?t.length:t.findLastIndex(f=>f.kind==="trace"),u={...n?{live:!0,waiting:o}:{},...r===void 0?{}:{tail:r},...i===void 0?{}:{clock:i}};return a.jsxs(Pde,{phase:e.phase,children:[t.map((f,h)=>f.kind==="interim"?a.jsx(wa.Content,{"data-slot":"chat-interim-output",children:a.jsx(K_,{children:f.text})},f.key):a.jsx(Nw,{steps:f.steps,counted:f.counted,...h===c?u:{}},f.key)),l?a.jsx(Nw,{steps:[],counted:[],...u},`segment-${c}`):null]})}const eR=typeof window<"u"&&typeof document<"u";function cb(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function Cfe(e){const t=new Date(e);return t.setHours(24,0,0,0),Math.max(1,t.getTime()-e)}const xu=new Set;let q1=cb(Date.now()),Nl;function tR(){const e=cb(Date.now());if(e!==q1){q1=e;for(const t of xu)t()}nR()}function nR(){Nl!==void 0&&clearTimeout(Nl),Nl=void 0,!(!eR||xu.size===0)&&(Nl=window.setTimeout(tR,Cfe(Date.now())))}function Ow(){document.visibilityState==="visible"&&tR()}function Efe(e){return eR?(xu.add(e),xu.size===1&&(q1=cb(Date.now()),document.addEventListener("visibilitychange",Ow),nR()),()=>{xu.delete(e),xu.size===0&&(Nl!==void 0&&clearTimeout(Nl),Nl=void 0,document.removeEventListener("visibilitychange",Ow))}):()=>{}}function $fe(){return q1}function Afe(){return q1}function Mfe(){return p.useSyncExternalStore(Efe,$fe,Afe)}function sR({conversation:e,toolPresentations:t,connected:n,canFork:s,openInPanel:r,onFork:i,forksAt:o,summaryOf:l,ownOnly:c,forkSource:u,onRetry:d,onRetrySubmission:f,onEditSubmission:h,submissionEditDisabled:x,submissionEditTooltip:g,localEditAttachmentsUnsupported:y,docs:v,submissions:m,mergeQueuedSubmissions:k}){const b=O1(e),j=Mfe(),A=p.useMemo(()=>c?{...e,entries:e.entries.filter(R=>R.conversationId===e.conversation.id)}:e,[e,c]),M=p.useMemo(()=>iue(A,t,b,m??[],{mergeQueuedSubmissions:k}),[A,t,b,m,k]),E=p.useMemo(()=>oue(M),[M]),z=p.useMemo(()=>Tfe(v),[v]),T=p.useMemo(()=>dde(M),[M]),$=p.useMemo(()=>z===void 0?void 0:{state:z,...T===void 0?{}:{updatedAtMs:T}},[z,T]),_=M.findLastIndex(R=>R.kind==="run");return M.length===0&&!c?null:a.jsx(QS,{isStreaming:b,gap:0,children:a.jsxs("div",{className:"mx-auto flex w-full max-w-[44rem] flex-col gap-8 px-4 pb-6 pt-2",children:[c?a.jsxs(Xp,{variant:"divider",children:["Forked from ",u]}):null,M.map((R,N)=>a.jsx(bfe,{entry:R,connected:n,openInPanel:r,onFork:i,canFork:s,forksAt:o,summaryOf:l,onRetrySubmission:f,onEditSubmission:h,submissionEditDisabled:x,submissionEditTooltip:g,localEditAttachmentsUnsupported:y,today:j,...N===_&&$!==void 0?{todo:$}:{},onRetry:d!==void 0&&n&&E!==void 0&&N===M.length-1?()=>d(E):void 0},R.id))]})})}function Tfe(e){for(const t of e??[]){if(t.value===null)continue;const n=Vd(t.presentation,t.value);if(n.type==="pinomad.todo")return n.value}}function zfe(){return a.jsxs("div",{role:"status",className:"chat-skeleton mx-auto mt-auto flex w-full max-w-[44rem] flex-col gap-8 px-4 pb-6 pt-2",children:[a.jsx("span",{className:"sr-only",children:"Loading conversation…"}),a.jsx(Dw,{width:200,index:0}),a.jsx(Bw,{lines:["100%","100%",220],index:1}),a.jsx(Dw,{width:150,index:5}),a.jsx(Bw,{lines:["100%","100%","100%",160],index:6})]})}function Dw({width:e,index:t}){return a.jsx("div",{"aria-hidden":"true",className:"flex justify-end",children:a.jsx(ac,{width:e,height:40,radius:4,index:t})})}function Bw({lines:e,index:t}){return a.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-2.5",children:[a.jsx("div",{className:"pb-1",children:a.jsx(ac,{width:128,height:28,radius:"rounded",index:t})}),e.map((n,s)=>a.jsx(ac,{width:n,height:12,radius:"rounded",index:t+s+1},s))]})}function Nfe(){return a.jsx("div",{"aria-hidden":"true",className:"chat-skeleton",children:a.jsx(ac,{height:92,radius:4})})}function _fe({missing:e,connected:t,onRetry:n}){return e?a.jsx(pr,{title:"Conversation not found",description:"It was archived or deleted on another device."}):a.jsx(pr,{title:"Couldn't open this conversation",description:t?"The host didn't send it.":"The connection dropped before it arrived.",actions:a.jsx(Q,{label:"Try again",variant:"secondary",onClick:n,isDisabled:!t})})}function Rfe(e){return e.flatMap(t=>{const n=Vd(t.presentation,t.value);return n.type!=="pinomad.question"?[]:n.value.requests.filter(s=>s.resolution===void 0).map(s=>({kind:t.kind,request:s}))})}function Ife(e,t,n){return Array.from({length:e},(s,r)=>({selected:t[r]??[],...n[r]===void 0||n[r].trim()===""?{}:{other:n[r]}}))}const Hw="cubic-bezier(0.32, 0.72, 0, 1)",qw=280,Lf=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Lfe(e){const t=p.useRef(null),[n,s]=p.useState(0),r=p.useRef(n);r.current=n;const i=p.useRef(!1),o=p.useRef(null),l=p.useRef(!1),c=p.useRef(void 0),u=p.useCallback(y=>{var v,m;return((m=(v=t.current)==null?void 0:v.children[y])==null?void 0:m.offsetHeight)??0},[]),d=p.useCallback((y,v)=>{if(Lf()||Math.abs(y.offsetHeight-v)<1){y.style.transition="",y.style.height=`${v}px`;return}y.style.height=`${y.offsetHeight}px`,y.style.transition=`height ${qw}ms ${Hw}`,y.style.height=`${v}px`},[]),f=p.useCallback((y=!1)=>{const v=t.current;if(v===null||v.clientWidth===0||i.current)return;const m=Math.min(e-1,Math.max(0,v.scrollLeft/v.clientWidth)),k=Math.floor(m),b=u(k),j=u(Math.min(k+1,e-1)),A=b+(j-b)*(m-k);if(y&&l.current&&m===k){d(v,A);return}v.style.transition="",v.style.height=`${A}px`},[e,u,d]),h=p.useCallback(()=>{const y=t.current;o.current=null,y!==null&&!i.current&&s(Math.min(e-1,Math.max(0,Math.round(y.scrollLeft/Math.max(y.clientWidth,1)))))},[e]),x=p.useCallback(()=>{const y=t.current;if(y===null||y.clientWidth===0)return;window.clearTimeout(c.current),c.current=window.setTimeout(h,150),y.scrollTop!==0&&(y.scrollTop=0),f();const v=y.scrollLeft/y.clientWidth;if(o.current!==null){if(Math.abs(v-o.current)>.01)return;o.current=null}i.current||s(Math.min(e-1,Math.max(0,Math.round(v))))},[e,f,h]),g=p.useCallback(y=>{var j,A;const v=t.current;if(v===null)return;const m=Math.min(e-1,Math.max(0,y)),k=Math.abs(m-r.current);if(k<=1||Lf()){k>0&&!Lf()&&(o.current=m),v.scrollTo({left:m*v.clientWidth,behavior:Lf()?"instant":"smooth"}),s(m);return}const b=Math.sign(m-r.current);i.current=!0,v.style.height=`${v.offsetHeight}px`,v.scrollTo({left:m*v.clientWidth,behavior:"instant"}),s(m),d(v,u(m)),(A=(j=v.children[m])==null?void 0:j.firstElementChild)==null||A.animate([{opacity:0,transform:`translateX(${b*24}px)`},{opacity:1,transform:"none"}],{duration:220,easing:Hw}),window.setTimeout(()=>{i.current=!1,f(!0)},qw)},[e,u,d,f]);return p.useLayoutEffect(()=>f(),[f]),p.useEffect(()=>{let y=!0;return document.fonts.ready.then(()=>requestAnimationFrame(()=>{y&&(l.current=!0)})),()=>{y=!1}},[]),p.useEffect(()=>{const y=t.current;if(y===null)return;let v=y.clientWidth;const m=new ResizeObserver(()=>{if(y.clientWidth!==v){v=y.clientWidth,y.scrollTo({left:r.current*v,behavior:"instant"}),f();return}f(!0)});for(const k of y.children)m.observe(k);return y.addEventListener("scrollend",h),()=>{m.disconnect(),y.removeEventListener("scrollend",h),window.clearTimeout(c.current)}},[f,h]),{ref:t,index:n,go:g,onScroll:x}}const mi="\0other",Ofe=250;function rR({docs:e,remote:t,connected:n,target:s}){const r=Rfe(e);return r.length===0?null:a.jsx(le,{gap:2,padding:2,"data-testid":"pending-questions",children:r.map(({kind:i,request:o})=>a.jsx(Dfe,{kind:i,request:o,remote:t,connected:n,target:s},o.id))})}function Dfe({kind:e,request:t,remote:n,connected:s,target:r}){const i=t.questions.length,[o,l]=p.useState(()=>t.questions.map(()=>[])),[c,u]=p.useState(()=>t.questions.map(()=>"")),[d,f]=p.useState(()=>t.questions.map(()=>!1)),[h,x]=p.useState(!1),g=p.useRef(!1),y=(L,O)=>l(D=>D.map((q,F)=>F===L?O:q)),v=(L,O)=>u(D=>D.map((q,F)=>F===L?O:q)),m=(L,O)=>f(D=>D.map((q,F)=>F===L?O:q)),k=L=>{var O;return(((O=o[L])==null?void 0:O.length)??0)>0||d[L]===!0&&(c[L]??"").trim()!==""},b=Lfe(i),j=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(j.current),[]);const[A,M]=p.useState(null),E=b.index===i-1,z=t.questions.every((L,O)=>k(O)),T=E||z?"submit":k(b.index)?"next":"skip",$=A??T,_=()=>{window.clearTimeout(j.current),M(null)},R=L=>{_(),b.go(L)},N=p.useRef(null),H=()=>R(b.index+1),B=()=>{if(g.current||!s)return;g.current=!0,x(!0);const L=Ife(i,o,c.map((O,D)=>d[D]===!0?O:""));n.controller.answer(e,t.id,L,r).catch(()=>{g.current=!1,x(!1)})},I=L=>(O,D)=>{var q;if(D||((q=t.questions[L])==null?void 0:q.multiSelect)===!0||O===mi||L+1>=i){_();return}window.clearTimeout(j.current),M(F=>F??T),j.current=window.setTimeout(()=>{b.go(L+1),M(null)},Lf()?0:Ofe)};return a.jsxs("section",{className:"question-card","aria-label":"The agent asks",onKeyDown:Hfe(b.index,R),children:[a.jsx("div",{ref:b.ref,className:"question-card__pager",onScroll:b.onScroll,onWheel:L=>{Math.abs(L.deltaX)>Math.abs(L.deltaY)&&_()},onTouchStart:L=>{var O;N.current=((O=L.touches[0])==null?void 0:O.clientX)??null},onTouchMove:L=>{var D;const O=(D=L.touches[0])==null?void 0:D.clientX;N.current!==null&&O!==void 0&&Math.abs(O-N.current)>8&&_()},children:t.questions.map((L,O)=>a.jsx("div",{className:"question-card__page",role:"group","aria-roledescription":"question","aria-label":`${O+1} of ${i}: ${L.header}`,inert:O!==b.index,children:a.jsx(Bfe,{question:L,selected:o[O]??[],other:c[O]??"",otherOn:d[O]===!0,onSelect:D=>y(O,D),onOther:D=>v(O,D),onOtherOn:D=>m(O,D),onPointerPick:I(O),onOtherEnter:O+1<i?H:B})},O))}),a.jsxs("div",{className:"question-card__footer",children:[a.jsx("div",{className:"question-card__back",children:b.index>0?a.jsx(Q,{label:"Back",variant:"ghost",onClick:()=>R(b.index-1)}):null}),i>1?a.jsx("div",{className:"question-card__segments",role:"tablist","aria-label":"Questions",children:t.questions.map((L,O)=>a.jsx("button",{type:"button",role:"tab",className:"question-card__segment","aria-selected":O===b.index,"aria-label":`${L.header}, ${k(O)?"answered":"not answered"}`,"data-current":O===b.index||void 0,"data-answered":k(O)||void 0,tabIndex:O===b.index?0:-1,onClick:()=>R(O)},O))}):a.jsx("span",{}),a.jsx("div",{className:"question-card__action","data-ghost":$==="skip"||void 0,children:$==="submit"?a.jsx(Q,{label:"Submit",variant:"primary",isDisabled:!s||h,onClick:B}):$==="next"?a.jsx(Q,{label:"Next",variant:"secondary",onClick:H}):a.jsx(Q,{label:"Skip",variant:"ghost",onClick:H})})]})]})}function Bfe({question:e,selected:t,other:n,otherOn:s,onSelect:r,onOther:i,onOtherOn:o,onPointerPick:l,onOtherEnter:c}){const u=e.multiSelect===!0,d=p.useRef(Number.NEGATIVE_INFINITY),f=p.useRef(null),h=g=>{o(g),g&&requestAnimationFrame(()=>{var v;const y=(v=f.current)==null?void 0:v.querySelector("input");y==null||y.focus({preventScroll:!0}),y==null||y.setSelectionRange(y.value.length,y.value.length)})},x=g=>g.description===void 0||g.description===""?{}:{description:g.description};return a.jsxs(le,{gap:1,children:[a.jsx(Y,{type:"body",weight:"medium",className:"question-card__question",children:e.question}),a.jsx("div",{className:"question-card__options",onPointerDown:()=>{d.current=performance.now()},onClick:g=>{const y=g.target;if(!(y instanceof HTMLInputElement)||y.type!=="radio"||performance.now()-d.current>1e3)return;d.current=Number.NEGATIVE_INFINITY;const v=y.value===mi?s:t[0]===y.value;v&&(y.value===mi?o(!1):r([])),l(y.value,v)},children:u?a.jsxs(G5,{label:e.header,isLabelHidden:!0,density:"compact",value:s?[...t,mi]:t,onChange:g=>{r(g.filter(y=>y!==mi)),g.includes(mi)!==s&&h(!s)},children:[e.options.map(g=>a.jsx(Zp,{label:g.label,value:g.label,...x(g)},g.label)),a.jsx(Zp,{label:"Other",value:mi})]}):a.jsxs(n4,{label:e.header,isLabelHidden:!0,size:"sm",value:s?mi:t[0]??"",onChange:g=>{if(g===mi){r([]),h(!0);return}r([g]),o(!1)},children:[e.options.map(g=>a.jsx(Qp,{label:g.label,value:g.label,...x(g)},g.label)),a.jsx(Qp,{label:"Other",value:mi})]})}),s?a.jsx("div",{ref:f,className:"question-card__other",onKeyDown:g=>{g.key==="Enter"&&!g.nativeEvent.isComposing&&(g.preventDefault(),c())},children:a.jsx(lt,{label:"Other answer",isLabelHidden:!0,value:n,onChange:i,placeholder:"Your answer…"})}):null]})}function Hfe(e,t){return n=>{if(!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)&&!(n.metaKey||n.ctrlKey||n.altKey)){if(n.key==="ArrowRight")t(e+1);else if(n.key==="ArrowLeft")t(e-1);else return;n.preventDefault()}}}const qfe={"needs-answer":"warning",failed:"error",running:"success"},Pfe={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function iR({status:e}){return e===void 0?null:a.jsx("span",{"aria-hidden":"true",children:a.jsx(Hi,{variant:qfe[e],label:Pfe[e],isPulsing:e!=="failed"})})}function Pw({view:e,remote:t,shownId:n,tab:s,onTabChange:r,openInPanel:i,onOpenInMain:o}){var y,v;const l=Lo(6e4),c=n===void 0?void 0:$1(e.organized,n),u=e.side!==void 0&&c!==void 0&&((y=$1(e.organized,e.side.id))==null?void 0:y.summary.id)===c.summary.id?e.side:void 0,d=u===void 0||(v=Di(e.organized,u.id))==null?void 0:v.summary,f=c===void 0?[]:hM(c),h=c===void 0?[]:f3(c),x=h.reduce((m,k)=>m+k.tasks.length,0),g=()=>void t.controller.showSide(void 0);return a.jsxs(le,{className:"h-full min-h-0",gap:0,children:[a.jsxs(AC,{value:s,onChange:m=>r(m),layout:"fill",hasDivider:!0,children:[a.jsx(Ay,{value:"threads",label:"Threads",endContent:f.length===0?void 0:a.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted",children:f.length})}),a.jsx(Ay,{value:"tasks",label:"Tasks",endContent:x===0?void 0:a.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted",children:x})})]}),s==="threads"?u!==void 0&&(d==null?void 0:d.kind)==="fork"?a.jsx(Ufe,{view:e,remote:t,side:u,summary:d,onBack:g,onOpenInMain:o,openInPanel:i},u.id):a.jsx(Uw,{children:f.length===0?a.jsx(Y,{type:"supporting",className:"p-3 text-muted",children:"No threads yet"}):a.jsx(Bt,{density:"compact",children:f.map(m=>a.jsx(Fw,{summary:m.summary,now:l,onOpen:()=>i(m.summary.id,"threads")},m.summary.id))})}):u!==void 0&&(d==null?void 0:d.kind)==="subagent"?a.jsx(Ffe,{view:e,remote:t,side:u,summary:d,onBack:g,openInPanel:i}):a.jsx(Uw,{children:h.length===0?a.jsx(Y,{type:"supporting",className:"p-3 text-muted",children:"No tasks yet"}):h.map(m=>a.jsx(Bt,{density:"compact",header:a.jsx("div",{className:"px-3 pt-2",children:a.jsx(Y,{type:"label",weight:"semibold",children:m.label})}),children:m.tasks.map(k=>a.jsx(Fw,{summary:k.summary,now:l,onOpen:()=>i(k.summary.id,"tasks")},k.summary.id))},m.owner.id))})]})}function Uw({children:e}){return a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e})}function Fw({summary:e,now:t,onOpen:n}){const s=d3(e);return a.jsx(Ye,{label:e.kind!=="fork"||s===void 0?Ds(e):a.jsxs("span",{className:"inline-flex min-w-0 items-baseline gap-1.5",children:[a.jsx("span",{className:"truncate",children:Ds(e)}),a.jsxs("span",{className:"shrink-0 text-xs text-muted",children:["@",s]})]}),description:e.status==="running"&&e.activity!==void 0?`→ ${ko(e.activity.tool)??e.activity.tool}${e.activity.target===void 0?"":` ${e.activity.target}`}`:void 0,startContent:a.jsx(iR,{status:e.status}),endContent:e.updatedAt===void 0?void 0:a.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted",children:Bd(e.updatedAt,t)}),onClick:n})}function oR({back:e,title:t,status:n,onBack:s,extra:r}){return a.jsxs(ye,{className:"shrink-0 gap-1 border-b border-border px-2 py-1",vAlign:"center",children:[a.jsx(un,{icon:a.jsx(Qg,{className:"size-4","aria-hidden":"true"}),label:e,size:"sm",variant:"ghost",onClick:s}),a.jsx(iR,{status:n}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:t}),r]})}function aR({view:e,remote:t,side:n,openInPanel:s,ownOnly:r,forkSource:i,onRetry:o,onRetrySubmission:l,onEditSubmission:c,submissionEditDisabled:u,submissionEditTooltip:d,localEditAttachmentsUnsupported:f}){return n.conversation===void 0?null:a.jsx(sR,{conversation:n.conversation,docs:n.docs,submissions:e.submissions,mergeQueuedSubmissions:!0,toolPresentations:e.toolPresentations,connected:e.connection==="connected",canFork:!1,openInPanel:s,onFork:()=>{},ownOnly:r,forkSource:i,summaryOf:h=>{var x;return(x=Di(e.organized,h))==null?void 0:x.summary},forksAt:h=>pM(e.organized,n.id,h),onRetry:o,onRetrySubmission:l,onEditSubmission:c,submissionEditDisabled:u,submissionEditTooltip:d,localEditAttachmentsUnsupported:f})}function Ufe({view:e,remote:t,side:n,summary:s,onBack:r,onOpenInMain:i,openInPanel:o}){var $,_,R,N;const l=n.conversation,c=l!==void 0&&O1(l),u=W3(),{value:d,setValue:f}=u,h=p.useRef(null),x=jh(),[g,y]=p.useState(),[v,m]=p.useState(!1),k=d.trim()!=="",b=k||v,j=k?"Clear the composer to edit":"Finish the current edit first";p.useEffect(()=>{g!==void 0&&(u.restore(g.text,g.skills),y(void 0),m(!1))},[g]);const A=V3(e.agents,h,(($=e.home)==null?void 0:$.kind)!=="chat"&&Fe(((_=e.host)==null?void 0:_.protocol.minor)??0,"listFiles")?{key:`conversation:${n.id}`,list:H=>t.controller.listFiles({kind:"conversation",conversationId:n.id},H)}:void 0),M=G3(t,{kind:"conversation",conversationId:n.id},h,e.connection==="connected"&&Fe(((R=e.host)==null?void 0:R.protocol.minor)??0,"listSkills"),u.pick);K3(h,u.draft);const E=[...A??[],...M.trigger===void 0?[]:[M.trigger]],z=()=>{if(v)return;const H=P3(u.draft),B=H.text.trim();B!==""&&(yd(),t.controller.submit(B,"followUp",{target:n.id,skills:H.skills}),f(""))},T=s.parent===void 0||(N=Di(e.organized,s.parent))==null?void 0:N.summary;return a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[a.jsx(oR,{back:"Back to threads",title:Ds(s),status:s.status,onBack:r,extra:a.jsx(Q,{label:"Open in main",variant:"secondary",size:"sm",onClick:()=>i(n.id)})}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[a.jsx(aR,{view:e,remote:t,side:n,openInPanel:o,ownOnly:!0,forkSource:Ds(T),onRetry:async({text:H,images:B,skills:I,attachments:L,requestId:O})=>{yd(),await t.controller.submit(H,"followUp",{target:n.id,requestId:O,images:B.map(fM),...B.some(D=>!("data"in D))?{imageViews:B}:{},skills:I,...L.length===0?{}:{attachments:L.map(D=>D.id)},...L.length===0?{}:{attachmentDetails:L}})},onRetrySubmission:H=>{t.controller.retrySubmission(H).catch(()=>{})},onEditSubmission:H=>{var I;const B=(I=e.submissions)==null?void 0:I.find(L=>L.requestId===H);_re(B,b)&&(m(!0),t.controller.takeBackSubmission(H).then(L=>{L!==void 0?y(L):m(!1)}).catch(L=>{m(!1),x({body:L instanceof Error?L.message:String(L),type:"error"})}))},submissionEditDisabled:b,submissionEditTooltip:b?j:void 0,localEditAttachmentsUnsupported:!0}),a.jsx(rR,{docs:n.docs,remote:t,connected:e.connection==="connected",target:n.id})]}),a.jsx("div",{className:"shrink-0 border-t border-border p-2",children:a.jsx(Z3,{value:d,inputRef:h,placeholder:"Reply in this thread…",status:c?"streaming":"ready",isDisabled:e.connection!=="connected"||v,onSubmit:z,onStop:()=>void t.controller.abort(n.id),onValueChange:f,onFocus:M.request,triggers:E.length===0?void 0:E})})]})}function Ffe({view:e,remote:t,side:n,summary:s,onBack:r,openInPanel:i}){return a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[a.jsx(oR,{back:"Back to tasks",title:Ds(s),status:s.status,onBack:r}),a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:a.jsx(aR,{view:e,remote:t,side:n,openInPanel:i})}),a.jsx("div",{className:"shrink-0 border-t border-border p-2 text-center text-xs text-muted",children:"Read-only · subagent"})]})}function Vw({view:e,remote:t,shownId:n,narrow:s,open:r,onOpenChange:i,tab:o,onTabChange:l,openInPanel:c,onOpenInMain:u}){const d=jC({defaultSize:440,minSizePx:360,maxSizePx:720,autoSaveId:"pinomad-side-panel"});return s?a.jsx(mr,{isOpen:r,onOpenChange:i,variant:"fullscreen",children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Side panel",onOpenChange:i}),content:a.jsx(qs,{padding:0,children:a.jsx(Pw,{view:e,remote:t,shownId:n,tab:o,onTabChange:l,openInPanel:c,onOpenInMain:u})})})}):r?a.jsxs("div",{className:"relative h-full shrink-0 border-l border-border",style:{width:d.size},"aria-label":"Side panel",role:"complementary",children:[a.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:a.jsx(Pw,{view:e,remote:t,shownId:n,tab:o,onTabChange:l,openInPanel:c,onOpenInMain:u})}),a.jsx(s4,{direction:"horizontal",position:"overlay",isReversed:!0,label:"Resize side panel",resizable:d.props})]}):null}const Vfe=e=>e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite;function Gfe(e,t){var n;if(!(t===void 0||!(t>0)))for(let s=e.entries.length-1;s>=0;s-=1){const r=e.entries[s];if(r.kind==="pi.compaction"||r.kind==="pi.reset")return;if(r.kind!=="pi.assistant")continue;const i=(n=r.model)==null?void 0:n[0];if((i==null?void 0:i.role)!=="assistant"||i.stopReason==="aborted"||i.stopReason==="error")continue;const o=i.usage?Vfe(i.usage):0;if(o>0)return{used:o,window:t}}}const Wfe=80,I0=e=>e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${Math.round(e)}`,Gw=e=>e<.01?"<$0.01":`$${e.toFixed(2)}`,Ww=2*Math.PI*6;function Kfe({usage:e}){const t=e===void 0?void 0:Math.round(e.used/e.window*100),n=t!==void 0&&t>=Wfe,s=t===void 0?"—":`${t}%`,r=e===void 0?"Context usage unknown":`Context ${t}% used, ${I0(e.used)} of ${I0(e.window)} tokens`,i=e===void 0?"No usage data yet":`${I0(e.used)} / ${I0(e.window)}`,o=e===void 0?0:Math.min(1,e.used/e.window);return a.jsx(Pi,{content:i,placement:"above",alignment:"end",children:a.jsxs("span",{className:`inline-flex h-7 items-center gap-1.5 px-1 text-xs ${n?"text-warning":"text-muted"}`,...t===void 0?{"aria-label":r}:{role:"meter","aria-label":r,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,t)},tabIndex:0,"data-testid":"context-meter",children:[a.jsxs("svg",{"aria-hidden":"true",className:"size-4 -rotate-90",viewBox:"0 0 16 16",children:[a.jsx("circle",{className:"stroke-current opacity-25",cx:"8",cy:"8",fill:"none",r:"6",strokeWidth:"2"}),a.jsx("circle",{className:"stroke-current",cx:"8",cy:"8",fill:"none",r:"6",strokeDasharray:Ww,strokeDashoffset:Ww*(1-o),strokeWidth:"2"})]}),a.jsx("span",{className:"tabular-nums",children:s})]})})}const Xfe={pending:"pending",in_progress:"in progress",completed:"completed"};function Zfe({doc:e}){if(e.value===null)return null;const t=Vd(e.presentation,e.value),n=t.type==="pinomad.todo"?"Todo":t.type==="pinomad.question"?"Questions":e.kind,s=t.type==="pinomad.todo"?a.jsx(Yfe,{doc:t.value}):t.type==="pinomad.question"?a.jsx(Jfe,{doc:t.value}):a.jsx(e1e,{value:t.value});return a.jsxs(le,{gap:1,children:[a.jsx(Y,{type:"label",weight:"semibold",children:n}),s]})}function Yfe({doc:e}){return a.jsx(Bt,{density:"compact",children:e.items.length===0?a.jsx(Ye,{label:"Empty"}):e.items.map((t,n)=>a.jsx(Ye,{label:t.text,startContent:a.jsx(On,{label:Xfe[t.status],size:"sm"})},n))})}function Qfe(e,t){const n=e.resolution;if(n===void 0)return{label:"pending"};if(n.outcome==="dismissed")return{label:"answered in chat",color:"gray"};if(n.outcome==="cancelled")return{label:"cancelled",color:"gray"};const s=n.answers[t];if(s===void 0||s.selected.length===0&&s.other===void 0)return{label:"skipped",color:"gray"};const r=[s.selected.join(", "),...s.other===void 0?[]:[`other: "${s.other}"`]].filter(i=>i!=="").join("; ");return{label:r===""?"skipped":r,color:"green"}}function Jfe({doc:e}){return a.jsx(Bt,{density:"compact",children:e.requests.length===0?a.jsx(Ye,{label:"Empty"}):e.requests.flatMap(t=>t.questions.map((n,s)=>{const r=Qfe(t,s);return a.jsx(Ye,{label:n.question,description:r.label,startContent:a.jsx(On,{label:n.header,size:"sm"})},`${t.id}-${s}`)}))})}function e1e({value:e}){const t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.entries(e):[["value",e]];return a.jsx(Bt,{density:"compact",children:t.map(([n,s])=>a.jsx(Ye,{label:n,description:t1e(s)},n))})}function t1e(e){const t=JSON.stringify(e);return t.length<=120?t:`${t.slice(0,117)}...`}const Kw=3;function n1e(e,t,n,s,r){const[i,o]=p.useState({kind:"loading"}),l=p.useRef(0);return p.useEffect(()=>{if(!r||n||!s)return;const c=++l.current;e.controller.changes().then(u=>{if(c!==l.current)return;if(!u.available)return o({kind:"unavailable",branch:u.branch});const d=Y_(u.patch);o({kind:"ready",files:d.length,additions:d.reduce((f,h)=>f+h.additions,0),deletions:d.reduce((f,h)=>f+h.deletions,0),truncated:u.truncated,branch:u.branch})},()=>{c===l.current&&o({kind:"failed"})})},[e,t,n,s,r]),p.useEffect(()=>o({kind:"loading"}),[t]),i}const L0=e=>e.toLocaleString("en-US"),lR="pinomad.overview.collapsed";function Xw(){try{return JSON.parse(window.localStorage.getItem(lR)??"{}")}catch{return{}}}const cR="flex shrink-0 flex-col gap-0.5 rounded-[var(--radius-element)] bg-[var(--color-background-popover)] px-2.5 shadow-[var(--pigui-overview-card-elevation)]";function pm({section:e,title:t,summary:n,children:s}){const[r,i]=p.useState(()=>Xw()[e]===!0),[o,l]=p.useState(!1),c=p.useId(),u=()=>{window.localStorage.setItem(lR,JSON.stringify({...Xw(),[e]:!r})),i(!r),l(!0)};return a.jsxs("section",{className:`${cR} pt-1 ${r?"pb-1":"pb-1.5"}`,children:[a.jsx("h2",{className:"-mx-1.5",children:a.jsxs("button",{type:"button","aria-expanded":!r,"aria-controls":c,className:"flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-xs font-medium text-muted hover:bg-surface-hover hover:text-foreground focus-visible:bg-surface-hover",onClick:u,children:[a.jsx("span",{className:"shrink-0",children:t}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-end font-normal tabular-nums",children:r?n:null}),a.jsx(Ro,{"aria-hidden":!0,className:`size-3.5 shrink-0 motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out ${r?"":"rotate-90"}`})]})}),a.jsx("div",{id:c,hidden:r,className:`flex flex-col gap-0.5 ${o?"motion-safe:animate-[pigui-overview-reveal_150ms_ease-out]":""}`,children:s})]})}function To({icon:e,iconLabel:t,children:n,end:s,title:r,onClick:i}){const o=a.jsxs(a.Fragment,{children:[e===void 0?null:a.jsx("span",{...t===void 0?{"aria-hidden":!0}:{role:"img","aria-label":t},className:"flex size-4 shrink-0 items-center justify-center text-muted",children:e}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:n}),s===void 0?null:a.jsx("span",{className:"shrink-0 tabular-nums",children:s})]}),l="-mx-1.5 flex h-8 items-center gap-2.5 rounded-md px-1.5 text-sm";return i===void 0?a.jsx("div",{className:l,title:r,children:o}):a.jsx("button",{type:"button",className:`${l} hover:bg-surface-hover focus-visible:bg-surface-hover`,title:r,onClick:i,children:o})}function s1e({view:e,remote:t,conversation:n,busy:s,onOpenChanges:r}){var x,g,y;const i=Q3(n).cwd,o=e.home,l=(o==null?void 0:o.kind)==="chat",c=e.checkout!==void 0,u=(o==null?void 0:o.kind)==="project"?((x=e.organized.projects.find(v=>v.project.path===o.path))==null?void 0:x.project.name)??o.path.split("/").at(-1):l?"Chat folder":i==null?void 0:i.split("/").at(-1),d=n1e(t,n.conversation.id,s,e.connection==="connected",!l),f=(g=e.host)==null?void 0:g.protocol.minor,h=f!==void 0&&Zt(f,"liveBranch")?d.kind==="ready"||d.kind==="unavailable"?d.branch:void 0:(y=e.checkout)==null?void 0:y.branch;return a.jsxs(pm,{section:"workspace",title:"Workspace",summary:l||d.kind==="unavailable"?h:a.jsx(uR,{stat:d}),children:[i===void 0?null:a.jsx(To,{icon:c?a.jsx(CY,{className:"size-4"}):a.jsx(I1,{className:"size-4"}),iconLabel:l?void 0:c?"Git worktree":"Project folder",title:i,children:a.jsxs("span",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"min-w-0 truncate",children:u}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-right text-muted [direction:rtl]",children:`‎${i}`})]})}),h===void 0?null:a.jsx(To,{icon:a.jsx($Y,{className:"size-4"}),children:h}),l?null:a.jsx(r1e,{stat:d,onOpen:r})]})}function uR({stat:e}){return e.kind==="loading"?a.jsx("span",{className:"text-muted",children:"…"}):e.kind==="failed"?a.jsx("span",{className:"text-muted",children:"—"}):e.files===0?a.jsx("span",{className:"text-muted",children:"None"}):e.additions===0&&e.deletions===0?a.jsxs("span",{className:"text-muted",children:[e.files," file",e.files===1?"":"s"]}):a.jsxs("span",{"aria-label":`${L0(e.additions)} added, ${L0(e.deletions)} removed${e.truncated?" at least":""}`,children:[a.jsxs("span",{className:"text-success",children:["+",L0(e.additions),e.truncated?"+":""]})," ",a.jsxs("span",{className:"text-danger",children:["−",L0(e.deletions),e.truncated?"+":""]})]})}function r1e({stat:e,onOpen:t}){return e.kind==="unavailable"?null:a.jsx(To,{icon:a.jsx(wY,{className:"size-4"}),end:a.jsx(uR,{stat:e}),onClick:t,children:"Changes"})}function i1e({view:e,conversation:t}){const n=hr(e.models,Q3(t).model),s=Gfe(t,n==null?void 0:n.contextWindow),r=jre(t).reduce((o,l)=>o+l.cost,0),i=s===void 0?"—":`${Math.round(s.used/s.window*100)}%`;return a.jsxs(pm,{section:"usage",title:"Usage",summary:r>0?`${i} · ${Gw(r)}`:i,children:[a.jsx(To,{end:a.jsx(Kfe,{usage:s}),children:"Context"}),r>0?a.jsx(To,{end:a.jsx("span",{className:"text-muted",children:Gw(r)}),children:"Spent"}):null]})}const o1e=new Set(["running","needs-answer"]);function a1e({view:e,conversation:t,onOpenTasks:n}){const s=$1(e.organized,t.conversation.id),r=s===void 0?[]:f3(s).flatMap(d=>d.tasks.map(f=>f.summary));if(r.length===0)return null;const i=r.filter(d=>o1e.has(d.status)),o=r.filter(d=>d.status==="failed").length,l=r.length-i.length-o,c=i.length-Kw,u=[c>0?`${c} more running`:void 0,l>0?`${l} done`:void 0,o>0?`${o} failed`:void 0].filter(d=>d!==void 0);return a.jsxs(pm,{section:"subagents",title:"Subagents",summary:i.length>0?`${i.length} running`:u.join(" · "),children:[i.slice(0,Kw).map(d=>a.jsx(To,{icon:a.jsx(Hi,{variant:d.status==="needs-answer"?"warning":"success",label:d.status==="needs-answer"?"Waiting for your answer":"Running",isPulsing:!0}),end:d.activity===void 0?void 0:a.jsx("span",{className:"text-xs text-muted",children:ko(d.activity.tool)??d.activity.tool}),onClick:()=>n(d.id),children:Ds(d)},d.id)),u.length===0?null:a.jsx(To,{icon:null,onClick:()=>n(),children:a.jsx("span",{className:"text-muted",children:u.join(" · ")})})]})}const l1e={connecting:"warning",connected:"success",failed:"error",disabled:"neutral"};function c1e({view:e}){const t=e.mcp;if(t===null||t.servers.length===0&&t.errors.length===0)return null;const n=t.servers.filter(r=>r.state==="failed").length+t.errors.length,s=t.servers.filter(r=>r.state==="connected").length;return a.jsxs(pm,{section:"sources",title:"Sources",summary:n>0?a.jsxs("span",{className:"text-danger",children:[n," problem",n===1?"":"s"]}):`${s} connected`,children:[t.servers.map(r=>a.jsx(To,{icon:a.jsx(Hi,{variant:l1e[r.state],label:r.state,isPulsing:r.state==="connecting"}),title:r.error,end:a.jsx("span",{className:"text-xs text-muted",children:r.state==="connected"?`${r.tools} tool${r.tools===1?"":"s"}`:r.state}),children:r.name},r.name)),t.errors.map((r,i)=>a.jsx(To,{icon:a.jsx(Hi,{variant:"error",label:"config error"}),title:r,children:a.jsx("span",{className:"text-danger",children:r})},i))]})}function u1e({view:e,remote:t}){const n=e.docs.filter(s=>{if(s.value===null)return!1;const r=Vd(s.presentation,s.value).type;return r!=="pinomad.todo"&&r!=="pinomad.question"});return n.length===0?null:a.jsx(a.Fragment,{children:n.map(s=>a.jsx("section",{className:`${cR} py-2`,children:a.jsx(Zfe,{doc:s,remote:t,connected:e.connection==="connected"})},s.kind))})}function d1e({view:e,remote:t,conversation:n,narrow:s,busy:r,onOpenChanges:i,onOpenTasks:o,onClose:l}){return a.jsxs("aside",{"aria-label":"Overview",className:`pigui-overview absolute end-3 top-3 z-20 flex max-h-[calc(100%-1.5rem)] ${s?"w-[min(20rem,calc(100%-1.5rem))]":"w-[var(--pigui-overview-width)]"} flex-col gap-[var(--pigui-overview-gap)] overflow-y-auto rounded-[calc(var(--radius-element)+var(--pigui-overview-gap))] bg-[var(--color-background-muted)] p-[var(--pigui-overview-gap)] shadow-[var(--pigui-overview-elevation)]`,onKeyDown:c=>{c.key==="Escape"&&(c.stopPropagation(),l())},children:[a.jsx(s1e,{view:e,remote:t,conversation:n,busy:r,onOpenChanges:i}),a.jsx(i1e,{view:e,conversation:n}),a.jsx(a1e,{view:e,conversation:n,onOpenTasks:o}),a.jsx(c1e,{view:e}),a.jsx(u1e,{view:e,remote:t})]})}const Yx="pinomad.focus",Zw="pinomad.activeHost",f1e=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,h1e=e=>{let t;try{t=JSON.parse(e)}catch{return}if(typeof t!="object"||t===null)return;const n=t;if(!(typeof n.hostKey!="string"||n.hostKey===""))return n.conversationId===void 0?{hostKey:n.hostKey}:f1e(n.conversationId)?{hostKey:n.hostKey,conversationId:n.conversationId}:void 0};function p1e(e,t){if(t.length===0)return;const n=new Set(t.map(i=>i.hostKey)),s=e.getItem(Yx);if(s!==null){const i=h1e(s);if(i!==void 0&&n.has(i.hostKey))return i}const r=e.getItem(Zw);return r!==null&&n.has(r)?(e.setItem(Yx,JSON.stringify({hostKey:r})),e.removeItem(Zw),{hostKey:r}):{hostKey:t[0].hostKey}}function x1e(e,t){(t==null?void 0:t.conversationId)!==void 0&&e.set(t.hostKey,t.conversationId)}function g1e(e,t){const n=e.get(t);return n===void 0?{hostKey:t}:{hostKey:t,conversationId:n}}function m1e(e,t,n){if((t==null?void 0:t.conversationId)!==void 0&&e.set(t.hostKey,t.conversationId),(t==null?void 0:t.hostKey)===n){const s=t.conversationId??e.get(n);return s===void 0?{hostKey:n}:{hostKey:n,conversationId:s}}return e.delete(n),{hostKey:n}}function y1e(e,t){if(t===void 0){e.removeItem(Yx);return}e.setItem(Yx,JSON.stringify(t.conversationId===void 0?{hostKey:t.hostKey}:{hostKey:t.hostKey,conversationId:t.conversationId}))}function ub({hostKey:e}){const t=Io(),{state:n}=t,{focusHost:s}=Ps(),[r,i]=p.useState(!1),[o,l]=p.useState();if(p.useEffect(()=>t.hostRejected(e),[t,e]),n.status!=="signed-in")return null;const c=n.hosts.find(d=>{var f;return((f=d.stored)==null?void 0:f.hostKey)===e});if(c===void 0)return null;const u=()=>{i(!0),l(void 0),t.pairHost(c.host.hostId).then(d=>{i(!1),d.ok?s(d.value.hostKey):l(d.error)})};return a.jsxs(le,{gap:2,hAlign:"center",children:[a.jsx(Q,{label:"Pair again with your account",variant:"primary",isLoading:r,isDisabled:c.host.pairing!=="available",onClick:u}),o===void 0?null:a.jsx(Pe,{status:"error",title:"Couldn't pair",description:Bs(o)})]})}const v1e="https://pinomad.si/docs/";function k1e({state:e}){const[t,n]=p.useState(!1),[s,r]=p.useState(!1);return a.jsxs(le,{gap:6,style:{width:"100%",maxWidth:520},children:[a.jsxs(le,{gap:2,children:[a.jsx(ds,{level:2,children:"Add your first host"}),a.jsx(Y,{type:"supporting",children:"A host is the computer that runs your agents: a Mac or Linux machine. The command installs PiNomad with its own Node, joins the host to your account and keeps it running as a service. The host then shows up here and connects on its own."})]}),a.jsx(DT,{serverOrigin:e.serverOrigin}),e.hostsError===void 0?null:a.jsx(Pe,{status:"warning",title:"Couldn't check for new hosts",description:Bs(e.hostsError)}),a.jsxs(le,{gap:2,children:[a.jsxs(Y,{type:"supporting",children:["Not using an account?"," ",a.jsx(Sg,{href:v1e,isExternalLink:!0,children:"Pair a host directly"})]}),s?a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),a.jsx(Ux,{})]}):a.jsx(ye,{children:a.jsx(Q,{label:"Have a pairing link?",variant:"ghost",size:"sm",onClick:()=>r(!0)})}),a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsxs(Y,{type:"supporting",children:["Signed in as ",e.user," on ",new URL(e.serverOrigin).host]}),a.jsx(Q,{label:"Account…",variant:"ghost",size:"sm",onClick:()=>n(!0)})]})]}),t?a.jsx(tm,{onClose:()=>n(!1)}):null]})}const b1e=1e4;function w1e(){const e=Io(),t=e.state.status==="signed-in";return p.useEffect(()=>{if(!t)return;const n=setInterval(()=>{document.visibilityState==="visible"&&e.refreshHosts()},b1e);return()=>clearInterval(n)},[e,t]),e.state.status==="signed-in"&&e.state.hosts.length===0?a.jsx(k1e,{state:e.state}):e.state.status==="unavailable"?a.jsxs(le,{gap:4,hAlign:"center",style:{width:"100%",maxWidth:420},children:[a.jsx(pr,{title:"No host link",description:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),a.jsx(Ux,{})]}):a.jsxs(le,{gap:6,style:{width:"100%",maxWidth:420},children:[a.jsx(L3,{}),a.jsxs(le,{gap:2,children:[a.jsx(Y,{type:"supporting",children:"Or paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),a.jsx(Ux,{})]})]})}const dR="/host-link",Yw=()=>{window.location.pathname===dR&&history.replaceState(null,"","/")};function j1e(){const[e,t]=p.useState(()=>window.location.pathname===dR);if(!e)return null;const n=()=>{Yw(),t(!1)};return a.jsx(mr,{isOpen:!0,onOpenChange:s=>s?void 0:n(),width:480,children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Add a host",onOpenChange:n}),content:a.jsx(qs,{children:a.jsx("div",{style:{padding:"var(--spacing-2)"},children:a.jsx(S1e,{onSettled:Yw,onClose:n})})})})})}function S1e({onSettled:e,onClose:t}){const{state:n}=Io();switch(n.status){case"checking":return a.jsxs(ye,{gap:2,vAlign:"center",children:[a.jsx(Jt,{size:"sm"}),a.jsx(Y,{type:"supporting",children:"Checking for an account…"})]});case"unavailable":return a.jsxs(le,{gap:3,children:[a.jsx(Y,{children:"Confirm a host on the server it's joining: open the address its terminal printed."}),a.jsx(ye,{children:a.jsx(Q,{label:"Close",variant:"secondary",onClick:t})})]});case"signed-out":return a.jsxs(le,{gap:3,children:[a.jsx(Y,{type:"supporting",children:"Sign in to the account the host is joining, then enter the code from its terminal."}),a.jsx(L3,{})]});case"signed-in":return a.jsxs(le,{gap:3,children:[a.jsxs(Y,{type:"supporting",children:["Enter the code the host's terminal shows to add it to ",n.user,"'s account."]}),a.jsx(OT,{onSettled:e,onClose:t})]})}}function C1e({knownHosts:e=IT}){const{state:t}=Io(),n=jh(),[s,r]=p.useState(!1);return p.useEffect(()=>{var o;if(t.status!=="signed-in"||t.hostsError!==void 0)return;const i=e.arrivals({serverOrigin:t.serverOrigin,user:t.user},t.hosts.map(l=>l.host.hostId));for(const l of i){const c=((o=t.hosts.find(u=>u.host.hostId===l))==null?void 0:o.host.name)??"A host";n({body:`New host ${c} joined your account. Didn't add it? Check Account.`,uniqueID:`new-host:${l}`,isAutoHide:!1,endContent:a.jsx(Q,{label:"Account",variant:"ghost",size:"sm",onClick:()=>r(!0)})})}},[e,t,n]),s?a.jsx(tm,{onClose:()=>r(!1)}):null}const E1e=15e3,$1e={subscribe(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}},A1e={subscribe(e){if(typeof document>"u")return()=>{};const t=()=>e(document.visibilityState==="hidden"?"background":"foreground");return document.addEventListener("visibilitychange",t),document.visibilityState==="hidden"&&e("background"),()=>document.removeEventListener("visibilitychange",t)}};function fR(e,t,n){const[s,r]=p.useState({status:"connecting"});return p.useEffect(()=>{let i,o=!1;r({status:"connecting"});const l=new AbortController,c="candidates"in e;let u,d;const f=new Set,h=()=>{for(const m of f)m.close();f.clear()};if(!c){u="transport"in e?e.transport:lz(e.url,e.token);const m=u;d={label:m.label,open(k){let b;b=m.open({message:k.message,opened:k.opened,authenticated:k.authenticated,closed:(A,M)=>{b!==void 0&&f.delete(b),k.closed(A,M)}});const j=b;return f.add(j),{send:A=>j.send(A),close:()=>{f.delete(j)&&j.close()}}}}}const x=(n==null?void 0:n.connect)??kne,g=(n==null?void 0:n.timeoutMs)??E1e;let y;if(!c&&u!==void 0){const m=u.label;y=setTimeout(()=>{o=!0,l.abort(),h(),r({status:"failed",error:`No response from ${m} within ${g/1e3} seconds. Check that the host is running and that this device can reach it (same network, or Tailscale connected).`,unauthorized:!1})},g)}const v=c?{...e,signal:l.signal,network:e.network??$1e,lifecycle:e.lifecycle??A1e,...(n==null?void 0:n.timeoutMs)===void 0?{}:{roundTimeoutMs:n.timeoutMs}}:{...e,transport:d,signal:l.signal,candidateTimeouts:{socketOpenMs:g+1e3,noiseMs:g+1e3,helloMs:g+1e3,syncMs:g+1e3},roundTimeoutMs:g+1e3};return x({reconnectDelayMs:{min:200,max:2e3},...v}).then(m=>{if(y!==void 0&&clearTimeout(y),o){m.close();return}i=m,r({status:"ready",remote:m})},m=>{y!==void 0&&clearTimeout(y),o||r({status:"failed",error:m instanceof Error?m.message:String(m),unauthorized:m instanceof up,...m instanceof uz?{mismatch:m}:{},...m instanceof cz?{direct:m}:{}})}),()=>{o=!0,y!==void 0&&clearTimeout(y),l.abort(),h(),i==null||i.close()}},[t]),s}function hR(e){return p.useSyncExternalStore(e.view.subscribe,e.view.current)}function pR({hostKey:e,device:t,target:n,candidates:s,stored:r,pairing:i,rtcPlatform:o,onPaired:l,onEndpointSet:c,setConnection:u}){const d=Mo(e),f=o===void 0?void 0:{platform:o,hostKey:d,device:t,signalOnlyHint:(r==null?void 0:r.rtcSignalOnly)===!0,openSignalTransport:h=>Zv({url:h.url,hostKey:d,device:t,prologue:iZ}),onSignalOnly:h=>{u(e,{rtcSignalOnly:h}).catch(x=>console.error("Could not store the host's RTC hint",x))},onSignalOnlyError:h=>console.error("Could not store the host's RTC hint",h)};return{candidates:s,legacyUrl:n.url,pageProtocol:window.location.protocol,...(r==null?void 0:r.connectionMode)===void 0?{}:{connectionMode:r.connectionMode},...i===void 0?{}:{pairing:i},...f===void 0?{}:{rtc:f},...l===void 0?{}:{onPaired:l},openTransport:(h,x)=>Zv({url:h.url,hostKey:d,device:t,...x===void 0?{}:{pairing:x}}),onEndpointSet:c}}const M1e={height:"100dvh",width:"100%",backgroundColor:"var(--color-background-body)",color:"var(--color-text-primary)"};function ti({children:e}){const t=C3().reserveMacTrafficLights;return a.jsxs(le,{style:M1e,isScrollable:!0,children:[t?a.jsx("div",{"aria-hidden":"true",className:"pinomad-drag fixed inset-x-0 top-0 h-10"}):null,a.jsx(le,{minHeight:"100%",style:{flexShrink:0},hAlign:"center",vAlign:"center",padding:6,children:e})]})}const Qw="pinomad.reloadedForProtocol";function xR(e){return e===void 0?Qw:`${Qw}.${e}`}function db({wsUrl:e,mismatch:t,hostKey:n}){var c;const s=xR(n),r=z3(),i=((c=window.pinomadDesktop)==null?void 0:c.updates)!==void 0,[o]=p.useState(()=>t.direction==="client-older"&&i||!xQ(e,window.location)||sessionStorage.getItem(s)===String(t.hostMajor)?!1:(sessionStorage.setItem(s,String(t.hostMajor)),window.location.reload(),!0));if(p.useEffect(()=>{var u,d;t.direction==="client-older"&&((d=(u=window.pinomadDesktop)==null?void 0:u.updates)==null||d.check())},[t.direction]),o)return null;const l=t.hostVersion===void 0?"":` Host version: ${t.hostVersion}.`;return t.direction==="client-older"?a.jsxs(le,{gap:4,children:[a.jsx(Pe,{status:"error",container:"section",title:"Client out of date",description:`The host speaks a newer protocol. ${i?"Update the app.":"Reload the page, or update the app."}${l}`}),i?a.jsx(sN,{update:r}):null]}):a.jsx(Pe,{status:"error",container:"section",title:"Host out of date",description:`This client speaks a newer protocol. Upgrade the host (pinomad upgrade).${l}`})}function T1e(e,t,n,s={}){var f,h;const{open:r,cancel:i,onUnavailable:o}=s,l=t.connection==="connected",c=(f=t.conversation)==null?void 0:f.conversation.id,u=(h=t.side)==null?void 0:h.id,d=p.useRef(void 0);p.useEffect(()=>{if(l){if(n===void 0){d.current=void 0,i==null||i(),(c!==void 0||u!==void 0)&&e.controller.clearConversation();return}if(c===n){d.current=n;return}if(d.current===n&&c===void 0){d.current=void 0,o==null||o();return}r!==void 0?r(n):e.controller.switchConversation(n)}},[i,l,o,r,e,c,u,n])}function z1e({hosts:e,focus:t,connect:n,renderWorkbench:s}){return a.jsx(a.Fragment,{children:e.map(r=>a.jsx(N1e,{host:r,focused:(t==null?void 0:t.hostKey)===r.hostKey,focusTarget:(t==null?void 0:t.hostKey)===r.hostKey?t.conversationId:void 0,renderWorkbench:s,...n===void 0?{}:{connect:n}},r.hostKey))})}function N1e({host:e,focused:t,focusTarget:n,connect:s,renderWorkbench:r}){const{endpoints:i,setConnection:o}=Ps(),l=p.useContext(em),[c,u]=p.useState(0),d=p.useCallback(()=>u(k=>k+1),[]),f=p.useMemo(()=>new U3,[]),h=p.useMemo(()=>_1(Mo(e.privateKey)),[e.privateKey]),x=p.useMemo(()=>({url:e.url,endpointSet:e.endpointSet}),[e.url,e.endpointSet]),g=p.useMemo(()=>M1(x.url,x.endpointSet,{pageProtocol:window.location.protocol}),[x]),y=p.useMemo(()=>MT(),[]),v=p.useMemo(()=>pR({hostKey:e.hostKey,device:h,target:x,candidates:g,stored:e,rtcPlatform:y,setConnection:o,onEndpointSet:k=>{i(e.hostKey,k).catch(b=>console.error("Could not store the host's remote endpoints",b))}}),[g,h,i,e,y,o,x]),m=fR(v,`${e.hostKey} ${e.privateKey} ${c}`,s===void 0?void 0:{connect:s});return p.useEffect(()=>{if(!(l===void 0||m.status==="ready")){if(m.status==="connecting"){l.publish(e.hostKey,{phase:"connecting",retry:d,composer:f});return}l.publish(e.hostKey,{phase:"failed",error:m.error,unauthorized:m.unauthorized,...m.mismatch===void 0?{}:{mismatch:m.mismatch},retry:d,composer:f})}},[f,e.hostKey,l,d,m]),p.useEffect(()=>()=>{l==null||l.remove(e.hostKey)},[e.hostKey,l]),p.useEffect(()=>{f.setRemote(m.status==="ready"?m.remote:void 0)},[f,m]),m.status==="ready"?a.jsx(qk.Provider,{value:f,children:a.jsx(I1e,{host:e,remote:m.remote,device:h,composer:f,focused:t,focusTarget:n,retry:d,renderWorkbench:r})}):t?a.jsx(qk.Provider,{value:f,children:m.status==="connecting"?a.jsx(ti,{children:a.jsx(pr,{title:"Connecting",description:e.url})}):a.jsx(_1e,{host:e,state:m,retry:d})}):null}function _1e({host:e,state:t,retry:n}){const{forget:s}=Ps();return t.mismatch!==void 0?a.jsxs(ti,{children:[a.jsx(db,{wsUrl:e.url,mismatch:t.mismatch,hostKey:e.hostKey}),a.jsx(n1,{})]}):t.unauthorized?a.jsxs(ti,{children:[a.jsxs(le,{gap:4,hAlign:"center",children:[a.jsx(pr,{title:"This device isn't paired",description:"It isn't paired with the host, or was revoked."}),a.jsx(ub,{hostKey:e.hostKey}),a.jsx(Q,{label:"Forget this host",variant:"secondary",onClick:()=>void s(e.hostKey)})]}),a.jsx(n1,{})]}):a.jsxs(ti,{children:[a.jsx(le,{gap:4,hAlign:"center",children:a.jsx(R1e,{state:t,retry:n})}),a.jsx(n1,{})]})}function R1e({state:e,retry:t}){return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{status:"error",title:e.direct===void 0?"Could not connect to the host":"Direct connection unavailable",description:e.direct===void 0?e.error:"This host can't be reached without the relay, and the peer-to-peer link didn't connect."}),e.direct===void 0?null:a.jsx(Y,{type:"supporting",style:{textAlign:"center"},children:`Details: ${e.direct.reason}`}),a.jsx(Q,{label:"Retry",variant:"secondary",onClick:t})]})}function I1e({host:e,remote:t,device:n,composer:s,focused:r,focusTarget:i,retry:o,renderWorkbench:l}){var k;const c=hR(t),u=p.useContext(em),{focusConversation:d,focusDraft:f,forget:h}=Ps();p.useEffect(()=>{u==null||u.publish(e.hostKey,{phase:"ready",remote:t,view:c,retry:o,composer:s})},[s,e.hostKey,u,t,o,c]),p.useEffect(()=>()=>{u==null||u.remove(e.hostKey)},[e.hostKey,u]),vT(e.hostKey,c.settings);const{opening:x,open:g,cancel:y}=rT(t),v=p.useCallback(()=>f(e.hostKey),[f,e.hostKey]);if(T1e(t,c,i,{open:g,cancel:y,onUnavailable:v}),sT(c,e.hostKey,r&&i!==void 0?(k=c.conversation)==null?void 0:k.conversation.id:void 0,d),!r)return null;const m=a.jsxs(le,{gap:4,hAlign:"center",children:[a.jsx(pr,{title:"This device isn't paired",description:"It isn't paired with the host, or was revoked."}),a.jsx(ub,{hostKey:e.hostKey}),a.jsx(Q,{label:"Forget this host",variant:"secondary",onClick:()=>void h(e.hostKey)})]});return l({host:e,remote:t,device:n,rejected:m,retry:o,opening:x,cancelOpening:y,openConversation:g})}const L1e={flex:1,minHeight:0},gR=e=>e.some(t=>t.summary.status==="running"||t.summary.status==="needs-answer"||gR(t.children)),mR="pinomad.overview.open",O1e=()=>typeof window<"u"&&window.localStorage.getItem(mR)==="true";function D1e(){const[e]=p.useState(kQ),t=p.useMemo(iJ,[]),n=p.useRef(new Map),s=p.useRef(new Map),[r,i]=p.useState();p.useEffect(()=>{let E=!0;return e.list().catch(z=>(console.error("Could not load the paired-host list",z),[])).then(z=>{if(!E)return;let T=[...z];for(const _ of s.current.values()){const R=T.find(N=>N.hostKey===_.hostKey);T=[...T.filter(N=>N.hostKey!==_.hostKey),R===void 0?_:e1(R,_)]}s.current.clear();const $=p1e(localStorage,T)??null;x1e(n.current,$),i({hosts:T,focus:$,address:pQ(window.location.hash,window.location,T,($==null?void 0:$.hostKey)??null)})}),()=>{E=!1}},[e]),p.useEffect(()=>{const E=()=>{window.location.hash!==""&&window.location.reload()};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]);const o=p.useCallback(E=>g1e(n.current,E),[]),l=p.useCallback(E=>{history.replaceState(null,"",window.location.pathname+window.location.search),i(z=>z===void 0?z:{...z,address:void 0,focus:o(E)})},[o]),c=p.useCallback(E=>{i(z=>z===void 0||!z.hosts.some(T=>T.hostKey===E.hostKey)?z:(n.current.set(E.hostKey,E.conversationId),{...z,focus:{...E}}))},[]),u=p.useCallback(E=>{i(z=>(z===void 0||!z.hosts.some(T=>T.hostKey===E.hostKey)||n.current.set(E.hostKey,E.conversationId),z))},[]),d=p.useCallback(E=>{n.current.delete(E),i(z=>z===void 0?z:{...z,focus:{hostKey:E}})},[]),f=p.useCallback(async(E,z)=>{n.current.delete(E),z&&history.replaceState(null,"",window.location.pathname+window.location.search),await e.remove(E).catch(T=>{console.error("Could not remove the host",T)}),i(T=>{var R;if(T===void 0)return T;const $=T.hosts.filter(N=>N.hostKey!==E),_=z?void 0:T.address;return((R=T.focus)==null?void 0:R.hostKey)!==E?{...T,hosts:$,address:_}:{...T,hosts:$,address:_,focus:$[0]===void 0?null:o($[0].hostKey)}})},[o,e]),h=p.useCallback(E=>f(E,!1),[f]),x=p.useCallback(async E=>{const T=(await e.list().catch(()=>(r==null?void 0:r.hosts)??[])).find($=>$.hostKey===E)??(r==null?void 0:r.hosts.find($=>$.hostKey===E));(T==null?void 0:T.account)!==void 0&&(bT.add(T.account),wT(T.account.hostId)),await f(E,!0)},[r==null?void 0:r.hosts,f,e]),g=p.useCallback(async E=>{await e.save(E),i(z=>{if(z===void 0){const $=s.current.get(E.hostKey);return s.current.set(E.hostKey,$===void 0?E:e1($,E)),z}const T=z.hosts.find($=>$.hostKey===E.hostKey);return{...z,focus:z.focus??{hostKey:E.hostKey},hosts:[...z.hosts.filter($=>$.hostKey!==E.hostKey),T===void 0?E:e1(T,E)]}})},[e]),y=p.useCallback(async(E,z)=>{await e.setName(E,z),i(T=>T===void 0?T:{...T,hosts:T.hosts.map($=>$.hostKey===E?{...$,name:z}:$)})},[e]),v=p.useCallback(async(E,z)=>{await e.updateEndpoints(E,z),i(T=>T===void 0?T:{...T,hosts:T.hosts.map($=>$.hostKey===E?QM($,z):$)})},[e]),m=p.useCallback(async(E,z)=>{await e.updateConnection(E,z),i(T=>T===void 0?T:{...T,hosts:T.hosts.map($=>$.hostKey===E?JM($,z):$)})},[e]),k=p.useMemo(()=>r===void 0?{store:e,hosts:[],focus:null,paired:()=>Promise.resolve(),setName:()=>Promise.resolve(),endpoints:()=>Promise.resolve(),setConnection:()=>Promise.resolve(),focusHost:()=>{},focusConversation:()=>{},rememberConversation:()=>{},focusDraft:()=>{},forget:()=>Promise.resolve(),dropHost:()=>Promise.resolve()}:{store:e,hosts:r.hosts,focus:r.focus,paired:g,setName:y,endpoints:v,setConnection:m,focusHost:l,focusConversation:c,rememberConversation:u,focusDraft:d,forget:x,dropHost:h},[h,v,c,d,l,x,r,g,u,m,y,e]);if(p.useEffect(()=>{r!==void 0&&y1e(localStorage,r.focus??void 0)},[r==null?void 0:r.focus]),r===void 0)return a.jsx(ti,{children:null});const{address:b,focus:j,hosts:A}=r,M=E=>{history.replaceState(null,"",window.location.pathname+window.location.search),i(z=>z===void 0?z:{...z,address:void 0,focus:m1e(n.current,z.focus,E.hostKey)})};return a.jsx(yT.Provider,{value:k,children:a.jsx(em.Provider,{value:t,children:a.jsxs(IQ,{children:[(b==null?void 0:b.kind)==="token"?a.jsx(yR,{options:b,connectionKey:`${b.url} ${b.token}`,label:b.url}):(b==null?void 0:b.kind)==="pair"?a.jsx(B1e,{address:b,onPairedHost:M}):A.length===0?a.jsx(ti,{children:a.jsx(w1e,{})}):a.jsx(Ose,{children:a.jsx(z1e,{hosts:A,focus:j,renderWorkbench:({host:E,remote:z,device:T,rejected:$,retry:_,opening:R,cancelOpening:N,openConversation:H})=>a.jsx(vR,{remote:z,wsUrl:E.url,rejected:$,device:T,hostKey:E.hostKey,onReconnect:_,notify:!1,framed:!1,hostOpening:R,hostOpen:H,hostCancelOpening:N})})}),a.jsx(j1e,{}),a.jsx(gg,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:a.jsx(C1e,{})})]})})})}function B1e({address:e,onPairedHost:t}){const[n,s]=p.useState(!1),r=()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()};if(n)return a.jsx(H1e,{address:e,...t===void 0?{}:{onPairedHost:t}});const i=new URL(e.url);return a.jsx(ti,{children:a.jsxs(le,{gap:4,hAlign:"center",style:{maxWidth:420},children:[a.jsx(pr,{title:"Pair with this host?",description:`This device will pair with ${i.host}.`}),a.jsx(Y,{type:"supporting",style:{wordBreak:"break-all"},children:e.url}),a.jsxs(ye,{gap:2,children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:r}),a.jsx(Q,{label:"Pair",variant:"primary",onClick:()=>s(!0)})]})]})})}function H1e({address:e,connect:t,onPairedHost:n}){const{hosts:s,paired:r,endpoints:i,setConnection:o,forget:l}=Ps(),c=p.useMemo(()=>s.find(z=>z.hostKey===e.hostKey),[s,e]),[u,d]=p.useState(),f=p.useRef(!1),[h,x]=p.useState(!1),g=p.useMemo(()=>e.kind==="pair"&&c!==void 0?_1(Mo(c.privateKey)):e.kind==="device"?_1(Mo(e.privateKey)):w3(),[e,c]),[y,v]=p.useState();p.useEffect(()=>{if(e.kind!=="pair")return;let z=!0;return I3().then(T=>{z&&v(T)}),()=>{z=!1}},[e]);const m=p.useMemo(()=>({url:(c==null?void 0:c.url)??e.url,endpointSet:(c==null?void 0:c.endpointSet)??e.endpointSet}),[e,c]),k=p.useMemo(()=>M1(m.url,m.endpointSet,{pageProtocol:window.location.protocol}),[m]),b=e.kind==="pair"&&!h&&y!==void 0?{secret:e.secret,name:y}:void 0,j=p.useMemo(()=>MT(),[]),A=p.useMemo(()=>{if(!(e.kind==="pair"&&y===void 0))return pR({hostKey:e.hostKey,device:g,target:m,candidates:k,stored:c,rtcPlatform:j,...b===void 0?{}:{pairing:b},setConnection:o,onPaired:()=>{if(f.current)return;f.current=!0,x(!0);const z=e.endpointSet,T={url:z===void 0?e.url:h3(e.url,z),hostKey:e.hostKey,privateKey:Yg(g.privateKey),...z===void 0?{}:{endpointSet:z}},$=c===void 0?T:e1(c,T);r($).then(()=>n==null?void 0:n($),_=>{console.error("Could not save the paired host",_),d($)}),history.replaceState(null,"",window.location.pathname+window.location.search)},onEndpointSet:z=>{i(e.hostKey,z).catch(T=>console.error("Could not store the host's remote endpoints",T))}})},[e,k,g,i,n,r,y,b,j,o,c,m]);if(A===void 0)return a.jsx(ti,{children:null});const M=e.kind==="pair"?a.jsxs(le,{gap:4,hAlign:"center",children:[a.jsx(pr,{title:"This pairing code was used or has expired",description:"Generate a new QR on the host: run bun run pair, or open Settings → Devices → Pair a device."}),s.length===0?null:a.jsx(Q,{label:"Use saved pairing",variant:"secondary",onClick:()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()}})]}):a.jsxs(le,{gap:4,hAlign:"center",children:[a.jsx(pr,{title:"This device isn't paired",description:"It isn't paired with the host, or was revoked."}),a.jsx(ub,{hostKey:e.hostKey}),a.jsx(Q,{label:"Forget this host",variant:"secondary",onClick:()=>void l(e.hostKey)})]}),E=u===void 0?void 0:a.jsx(Pe,{status:"warning",container:"section",title:"This pairing wasn't saved",description:"It will be lost when the app restarts.",endContent:a.jsx(Q,{label:"Retry",variant:"ghost",onClick:()=>{r(u).then(()=>{d(void 0),n==null||n(u)},z=>console.error("Could not save the paired host",z))}})});return a.jsx(yR,{options:A,connectionKey:e.hostKey,label:m.url,rejected:M,device:g,notice:E,hostKey:e.hostKey,...t===void 0?{}:{connect:t}})}function yR({options:e,connectionKey:t,label:n,rejected:s,device:r,notice:i,hostKey:o,connect:l}){const[c,u]=p.useState(0),d=fR(e,`${t} ${c}`,l===void 0?void 0:{connect:l});return d.status==="connecting"?a.jsx(ti,{children:a.jsx(pr,{title:"Connecting",description:n})}):d.status==="failed"?a.jsxs(ti,{children:[i===void 0?null:a.jsx("div",{className:"w-full max-w-md",children:i}),d.mismatch!==void 0?a.jsx(db,{wsUrl:n,mismatch:d.mismatch,...o===void 0?{}:{hostKey:o}}):s!==void 0&&d.unauthorized?s:a.jsxs(le,{gap:4,hAlign:"center",children:[a.jsx(Pe,{status:"error",title:d.direct===void 0?"Could not connect to the host":"Direct connection unavailable",description:d.direct===void 0?d.error:"This host can't be reached without the relay, and the peer-to-peer link didn't connect."}),d.direct===void 0?null:a.jsx(Y,{type:"supporting",style:{textAlign:"center"},children:`Details: ${d.direct.reason}`}),d.direct===void 0?null:a.jsx(Y,{type:"supporting",style:{textAlign:"center"},children:"Change this host's connection mode under Hosts below, then retry."}),a.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>u(c+1)})]}),a.jsx(n1,{})]}):a.jsx(vR,{remote:d.remote,wsUrl:n,rejected:s,device:r,notice:i,hostKey:o,onReconnect:()=>u(c+1)})}function vR({remote:e,wsUrl:t,rejected:n,device:s,notice:r,hostKey:i,onReconnect:o,notify:l=!0,framed:c=!0,hostOpening:u,hostOpen:d,hostCancelOpening:f}){var xn,qt,xs,ai,Gs,li,gs,ci;const h=hR(e),{hosts:x,focus:g,focusConversation:y,focusDraft:v,rememberConversation:m}=Ps(),k=p.useRef(g);k.current=g;const b=p.useRef(!0);p.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),vT(i,h.settings);const[j,A]=p.useState(!0),M=c?j:g!==null&&g.hostKey===i&&g.conversationId===void 0,E=F3(),z=Pd(E).home;p.useEffect(()=>{c&&A(h.conversation===void 0)},[c,(xn=h.conversation)==null?void 0:xn.conversation.id]);const T=rT(e),$=u??T.opening,_=d??T.open,R=f??T.cancel,N=p.useCallback(Ae=>{c&&A(!1),i!==void 0?y({hostKey:i,conversationId:Ae}):_(Ae)},[y,c,i,_]);sT(h,i,M||(qt=h.conversation)==null?void 0:qt.conversation.id,Ae=>{i===void 0?(A(!1),_(Ae.conversationId)):y(Ae)},l);const H=!M&&$!==void 0&&((xs=h.conversation)==null?void 0:xs.conversation.id)!==$.id,B=H&&$.failed,I=M||H?void 0:h.conversation;p.useEffect(()=>{B&&h.connection==="connected"&&_($.id)},[B,_,$==null?void 0:$.id,h.connection]);const L=M?void 0:H?$.id:!c&&i!==void 0?g==null?void 0:g.conversationId:(ai=h.conversation)==null?void 0:ai.conversation.id,O=I!==void 0&&O1(I),D=Pa("(max-width: 1023px)"),[q,F]=p.useState(O1e),K=Ae=>{window.localStorage.setItem(mR,String(Ae)),F(Ae)},[Z,se]=p.useState(!1),[ne,ue]=p.useState("threads"),[P,U]=p.useState(),[X,ie]=p.useState(),[te,de]=p.useState({occupied:!1,locked:!1}),fe=jh(),he=I==null?void 0:I.conversation.id,V=Nre(P,he),xe=X!==void 0&&X===he,ve=te.occupied||te.locked||X!==void 0,ke=te.occupied?"Clear the composer to edit":ve?"Finish the current edit first":void 0,me=p.useCallback((Ae,tt)=>{ue(tt),se(!0),e.controller.showSide(Ae)},[e]),pe=Ae=>{if(Ae!==void 0)return me(Ae,"tasks");e.controller.showSide(void 0),ue("tasks"),se(!0)},Qe=p.useCallback(Ae=>{N(Ae),e.controller.showSide(void 0),D&&se(!1)},[e,D,N]),Xe=L===void 0||(Gs=$1(h.organized,L))==null?void 0:Gs.summary.id;p.useEffect(()=>{e.controller.showSide(void 0)},[Xe]);const $t=j3(x),At=i===void 0||c?void 0:{value:i,options:x.map(Ae=>({value:Ae.hostKey,label:$t.get(Ae.hostKey)??Ae.url})),onChange:v},en=z.kind==="chat"?"New chat":`New conversation in ${F1e(h.organized,z.path)}`,rt=L===void 0||(li=Di(h.organized,L))==null?void 0:li.summary,zt=rt===void 0?void 0:rt.kind==="subagent"?rt.role:d3(rt),tn=L===void 0?void 0:$1(h.organized,L),es=tn!==void 0&&gR(tn.children),hs=rt==null?void 0:rt.parent,Us=hs===void 0||(gs=Di(h.organized,hs))==null?void 0:gs.summary,vt=p.useMemo(()=>(Ae,tt="original")=>e.controller.image(Ae,tt),[e]),kt=xZ(h),vr=(rt==null?void 0:rt.kind)==="conversation",Vi=p.useCallback(Ae=>rt===void 0?[]:pM(h.organized,rt.id,Ae),[h.organized,rt]),Fs=p.useCallback(Ae=>{var tt;return(tt=Di(h.organized,Ae))==null?void 0:tt.summary},[h.organized]),ii=Ae=>{R(),i!==void 0&&v(i),E.setHome(Ae),c&&A(!0)},[Vs,Bn]=p.useState(),[qr,oi]=p.useState(!1);if(p.useEffect(()=>{h.connection==="connected"&&sessionStorage.removeItem(xR(i))},[i,h.connection]),h.unauthorized===!0&&n!==void 0)return a.jsxs(ti,{children:[n,a.jsx(n1,{})]});const pn=a.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[a.jsx(dse,{narrow:D,title:M?en:Ds(rt),...zt===void 0?{}:{agent:zt},parentSummary:Us,onBackToParent:N,showOverview:L!==void 0,overviewOpen:q,onOverviewChange:K,panelOpen:Z,onPanelChange:se,liveActivity:es}),r,a.jsx(U1e,{view:h,wsUrl:t,hostKey:i}),a.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1",children:[a.jsxs("div",{className:"@container relative flex min-h-0 min-w-0 flex-1 flex-col",children:[L===void 0?a.jsx(cre,{view:h,remote:e,hostKey:i,draft:z,onDraft:ii,...At===void 0?{}:{machine:At},onCreated:()=>{var be,bt,nn;const Ae=(be=e.view.current().conversation)==null?void 0:be.conversation.id;if(Ae===void 0)return;i!==void 0&&Ise(window.localStorage,i);const tt=i===void 0||((bt=k.current)==null?void 0:bt.hostKey)===i&&k.current.conversationId===void 0;if(!b.current){i!==void 0&&m({hostKey:i,conversationId:Ae});return}if(tt){N(Ae),D||K(!0);return}const Sn=((nn=k.current)==null?void 0:nn.hostKey)===i&&k.current.conversationId!==void 0;i!==void 0&&!Sn&&m({hostKey:i,conversationId:Ae})},connected:h.connection==="connected"}):a.jsx(rC,{className:`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-out${q&&!D?" pigui-overview-clearance":""}`,style:L1e,composer:a.jsx("div",{className:"mx-auto w-full max-w-[44rem]",children:I===void 0?B?null:a.jsx(Nfe,{}):a.jsxs(le,{gap:1,children:[a.jsx(rR,{docs:h.docs,remote:e,connected:h.connection==="connected"}),a.jsx(zre,{view:h,remote:e,conversation:I,busy:O,narrow:D,takeBack:V,externalEditLocked:xe,onEditorStateChange:de,source:i,onTakeBack:()=>{U(void 0),ie(void 0)}})]})}),emptyState:B?a.jsx(_fe,{missing:rt===void 0,connected:h.connection==="connected",onRetry:()=>_($.id)}):a.jsx(pr,{title:"Nothing here yet",description:"Ask the agent something. Every client sees it."}),children:I===void 0?B?null:a.jsx(zfe,{}):a.jsx(sR,{conversation:I,docs:h.docs,submissions:h.submissions,toolPresentations:h.toolPresentations,connected:h.connection==="connected",canFork:vr,openInPanel:me,onFork:Bn,forksAt:Vi,summaryOf:Fs,submissionEditDisabled:ve,submissionEditTooltip:ke,onRetry:(rt==null?void 0:rt.kind)==="subagent"?void 0:async({text:Ae,images:tt,skills:Sn,attachments:be,requestId:bt})=>{yd(),await e.controller.submit(Ae,"followUp",{requestId:bt,images:tt.map(fM),...tt.some(nn=>!("data"in nn))?{imageViews:tt}:{},skills:Sn,...be.length===0?{}:{attachments:be.map(nn=>nn.id)},...be.length===0?{}:{attachmentDetails:be}})},onRetrySubmission:Ae=>{e.controller.retrySubmission(Ae).catch(()=>{})},onEditSubmission:Ae=>{const tt=he;ve||tt===void 0||(ie(tt),e.controller.takeBackSubmission(Ae).then(Sn=>{Sn!==void 0?U({conversationId:tt,draft:Sn}):ie(void 0)}).catch(Sn=>{ie(void 0),fe({body:Sn instanceof Error?Sn.message:String(Sn),type:"error"})}))}})},`${i??"local"}:${L}`),q&&I!==void 0?a.jsx(d1e,{view:h,remote:e,conversation:I,narrow:D,busy:O1(I),onOpenChanges:()=>oi(!0),onOpenTasks:pe,onClose:()=>K(!1)}):null]}),D?null:a.jsx(Vw,{view:h,remote:e,shownId:L,narrow:!1,open:Z,onOpenChange:se,tab:ne,onTabChange:ue,openInPanel:me,onOpenInMain:Qe})]})]}),ps=a.jsxs(a.Fragment,{children:[D?a.jsx(Vw,{view:h,remote:e,shownId:L,narrow:!0,open:Z,onOpenChange:se,tab:ne,onTabChange:ue,openInPanel:me,onOpenInMain:Qe}):null,Vs===void 0?null:a.jsx(q1e,{entryId:Vs,remote:e,connected:h.connection==="connected",onClose:()=>Bn(void 0),onForked:()=>{ue("threads"),se(!0)}}),qr&&I!==void 0&&a.jsx(P1e,{view:h,remote:e,busy:O,onClose:()=>oi(!1)})]});return a.jsx(pZ,{load:vt,retryKey:kt,...i===void 0?{}:{source:i},children:c?a.jsxs(aN,{machines:[{key:i??"local",label:((ci=h.settings)==null?void 0:ci.hostName)??t,view:h,remote:e,...i===void 0?{}:{hostKey:i},...s===void 0?{}:{device:s},...o===void 0?{}:{retry:o}}],focusKey:i??"local",draftingChat:M&&z.kind==="chat",shownId:L,onDraft:(Ae,tt)=>ii(tt),onOpen:(Ae,tt)=>N(tt),onNewChat:()=>ii({kind:"chat"}),narrow:D,children:[pn,ps]}):a.jsxs(a.Fragment,{children:[pn,ps]})})}function q1e({entryId:e,remote:t,connected:n,onClose:s,onForked:r}){const[i,o]=p.useState("Continue from here."),l=()=>{yd(),t.controller.fork(e,i.trim(),void 0,{show:"side"}),r(),s()};return a.jsx(mr,{isOpen:!0,onOpenChange:c=>c?void 0:s(),purpose:"form",width:480,children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Fork from this answer",subtitle:"The fork sees the conversation up to here and works in the same files.",onOpenChange:()=>s()}),content:a.jsx(qs,{children:a.jsx(lt,{label:"First message",value:i,onChange:o})}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),a.jsx(Q,{label:"Fork",variant:"primary",isDisabled:!n||i.trim()==="",onClick:l})]})})})})}function P1e({view:e,remote:t,busy:n,onClose:s}){const[r,i]=p.useState(),o=p.useMemo(()=>()=>void t.controller.changes().then(i).catch(()=>{}),[t]);p.useEffect(o,[o]);const l=p.useRef(n);p.useEffect(()=>{l.current&&!n&&o(),l.current=n},[n,o]);const c=e.checkout===void 0;return a.jsx(mr,{isOpen:!0,onOpenChange:u=>u?void 0:s(),width:720,children:a.jsx(Hs,{header:a.jsx(Hr,{title:"Changes",onOpenChange:()=>s()}),content:a.jsx(qs,{children:a.jsx(le,{gap:2,padding:3,children:r===void 0?a.jsx(Y,{type:"supporting",children:"Loading…"}):r.available?a.jsxs(a.Fragment,{children:[c?a.jsx(Y,{type:"supporting",children:"These are the project directory's uncommitted changes, shared with other conversations working there."}):null,r.truncated?a.jsx(Y,{type:"supporting",children:"The diff is truncated; the rest is not shown."}):null,a.jsx(Q_,{patch:r.patch})]}):a.jsx(Y,{type:"supporting",children:r.reason})})}),footer:a.jsx(Va,{children:a.jsxs(ye,{gap:2,hAlign:"end",children:[a.jsx(Q,{label:"Refresh",variant:"secondary",isDisabled:e.connection!=="connected",onClick:o}),a.jsx(Q,{label:"Close",variant:"primary",onClick:s})]})})})})}function U1e({view:e,wsUrl:t,hostKey:n}){return e.connection==="outdated"?e.protocolMismatch===void 0?null:a.jsx(db,{wsUrl:t,mismatch:e.protocolMismatch,...n===void 0?{}:{hostKey:n}}):e.connection==="reconnecting"?a.jsx(Pe,{status:"warning",container:"section",title:"Host connection lost",description:"Reconnecting… the view keeps the last state the host sent."}):e.connection==="closed"?a.jsx(Pe,{status:"error",container:"section",title:"Disconnected from the host"}):null}function F1e(e,t){var n;return((n=e.projects.find(s=>s.project.path===t))==null?void 0:n.project.name)??t.split("/").at(-1)??t}OA.createRoot(document.getElementById("root")).render(a.jsx(p.StrictMode,{children:a.jsx(ES,{theme:nK,children:a.jsx(D1e,{})})}));