@economic/agents-playground 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/assets/{architectureDiagram-3BPJPVTR-GUAdWEmT.js → architectureDiagram-3BPJPVTR-D8tR5wlz.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-Ja6jUrix.js → blockDiagram-GPEHLZMM-m2UjnbEQ.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-2UybwBD7.js → c4Diagram-AAUBKEIU-CZUMj02O.js} +1 -1
- package/dist/assets/channel-CYJ9CpWi.js +1 -0
- package/dist/assets/{chunk-2J33WTMH-CqBql00C.js → chunk-2J33WTMH-C-h9XHiN.js} +1 -1
- package/dist/assets/{chunk-3OPIFGDE-DLE954S0.js → chunk-3OPIFGDE-Suqj7-eK.js} +1 -1
- package/dist/assets/{chunk-5ZQYHXKU-CIXMC7H5.js → chunk-5ZQYHXKU-BDj_WSIO.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-D_qwlLqa.js → chunk-727SXJPM-Cx21sn43.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-BL9z35JC.js → chunk-AQP2D5EJ-CVKFCnwF.js} +1 -1
- package/dist/assets/{chunk-CSCIHK7Q-BIEyv3Kb.js → chunk-CSCIHK7Q-f6gpv8hv.js} +2 -2
- package/dist/assets/{chunk-L5ZTLDWV-HNLEK3Eg.js → chunk-L5ZTLDWV-DwGwhkp3.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-D8wse2uV.js → chunk-ND2GUHAM-B26vogSg.js} +1 -1
- package/dist/assets/{chunk-NZK2D7GU-V_WiEVCU.js → chunk-NZK2D7GU-D45NPMcH.js} +1 -1
- package/dist/assets/{chunk-O5CBEL6O-C6f2hDI-.js → chunk-O5CBEL6O-CiuRaQYp.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-Dvou9Rr1.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-Dvou9Rr1.js +1 -0
- package/dist/assets/{dagre-BM42HDAG-CkrDHS9q.js → dagre-BM42HDAG-CXmNPcYk.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-BxX4rmZB.js → diagram-2AECGRRQ-L3ctMTu7.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-Dr--iyET.js → diagram-5GNKFQAL-K2WCnZ8q.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-D7XBIhBH.js → diagram-KO2AKTUF-C4zJ2WX8.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-B0CdgpBH.js → diagram-LMA3HP47-B3NHb7IR.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-C5inEgNN.js → diagram-OG6HWLK6-DeucNSc_.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-W_1QeLIe.js → erDiagram-TEJ5UH35-0PzYt82j.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-X7zRJPNJ.js → flowDiagram-I6XJVG4X-DkjX5DZF.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-DRhKONsv.js → ganttDiagram-6RSMTGT7-2gmi5Sgv.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PVQCEYII-IrVxrQX3.js → gitGraphDiagram-PVQCEYII-9lZv175y.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-9p7IaQY7.js → highlighted-body-OFNGDK62-Cq8HtngO.js} +1 -1
- package/dist/assets/{index-DIPvEojL.js → index-BN-4K-iy.js} +9 -9
- package/dist/assets/index-CAqlMvgw.css +2 -0
- package/dist/assets/{infoDiagram-5YYISTIA-BwvKCMPl.js → infoDiagram-5YYISTIA-Dkm8HLsk.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-DiGAFXn3.js → ishikawaDiagram-YF4QCWOH-sHwxLXPL.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-DSZmjR3t.js → journeyDiagram-JHISSGLW-Bz2jAsli.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-CwQDFtYq.js → kanban-definition-UN3LZRKU-DmxDYbPB.js} +1 -1
- package/dist/assets/{line-BY6XOqO6.js → line-BnrU3xyY.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-Bx5T61Gj.js +1 -0
- package/dist/assets/{mindmap-definition-RKZ34NQL-CZT7cSIm.js → mindmap-definition-RKZ34NQL-vTgGplHm.js} +1 -1
- package/dist/assets/{pieDiagram-4H26LBE5-CiahOla2.js → pieDiagram-4H26LBE5-i3VSQ_MS.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-D_Y7dxGV.js → quadrantDiagram-W4KKPZXB-D-TfUmVL.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-bf5UiKzN.js → requirementDiagram-4Y6WPE33-DzVzYzd9.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-DlT9BygU.js → sankeyDiagram-5OEKKPKP-OWzr-E_q.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-BQXmAa-z.js → sequenceDiagram-3UESZ5HK-17MkrfUw.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-CZxVw12E.js → stateDiagram-AJRCARHV-DKgsIGkA.js} +1 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-DkcZNYHL.js +1 -0
- package/dist/assets/{timeline-definition-PNZ67QCA-e8V6jwEo.js → timeline-definition-PNZ67QCA-s2pNN-F3.js} +1 -1
- package/dist/assets/{vennDiagram-CIIHVFJN-BZ59EJLi.js → vennDiagram-CIIHVFJN-DwBO7C2G.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-BkCHP5w8.js → wardleyDiagram-YWT4CUSO-B3izZUrd.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-C-63N49O.js → xychartDiagram-2RQKCTM6-Ct4sYA1Y.js} +1 -1
- package/dist/index.html +9 -9
- package/package.json +1 -1
- package/dist/assets/channel-l1PU7tFv.js +0 -1
- package/dist/assets/classDiagram-4FO5ZUOK-BVJ36BJy.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-BVJ36BJy.js +0 -1
- package/dist/assets/index-BO5zAqh3.css +0 -2
- package/dist/assets/mermaid-GHXKKRXX-RtlXh8PG.js +0 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-DTvBmncV.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BKhkKBsm.js","assets/chunk-Cyuzqnbw.js","assets/html-Kpl3bQKd.js","assets/css-D7o5g6xi.js","assets/javascript-DywGHrES.js","assets/angular-ts-CYPbMJCA.js","assets/scss-CPnU-uuv.js","assets/apl-D7bENxmy.js","assets/json-BbGuGINB.js","assets/xml-DI0syHFL.js","assets/java-BIlOlX09.js","assets/astro-B1l9MDUT.js","assets/postcss-BunjpCQr.js","assets/tsx-0GViXbh-.js","assets/typescript-C03X-V26.js","assets/blade-BlkqRXu6.js","assets/html-derivative-BEEWNZ8Y.js","assets/sql-hpBkusIy.js","assets/bsl-DJOyloKD.js","assets/sdbl-DzilZtvS.js","assets/c-Y1DAQKNJ.js","assets/cairo-CDc8os0h.js","assets/python-DkGugaUl.js","assets/cobol-BoXxFQjh.js","assets/coffee-Dl-rf7k6.js","assets/cpp-CVIk4zoB.js","assets/glsl-dHcuwXfH.js","assets/regexp-zLCDTged.js","assets/crystal-CvUuUt6_.js","assets/shellscript-IH5A6LQB.js","assets/edge-CmXZi-az.js","assets/elixir-BoRIkjDi.js","assets/elm-BN_gLVH_.js","assets/erb-DuMAGb6i.js","assets/ruby-CUQsVT6d.js","assets/graphql-CdhToEZf.js","assets/jsx-NH_i07l1.js","assets/haml-Dmb1YmHj.js","assets/lua-SpZ12qGF.js","assets/yaml-DtN9Ue11.js","assets/erlang-Dej7b2OY.js","assets/markdown-Bk5jPFPK.js","assets/fortran-fixed-form-RVbzjQ2q.js","assets/fortran-free-form-EhmKDVgM.js","assets/fsharp-DKW21_Cq.js","assets/gdresource-b7MixKdf.js","assets/gdscript-DbNIuFFJ.js","assets/gdshader-C7BToOo8.js","assets/git-commit-BU_RZ1WH.js","assets/diff-COJGj3FI.js","assets/git-rebase-DfgjiXG9.js","assets/glimmer-js--VVKNatA.js","assets/glimmer-ts-Bfa_wiNC.js","assets/hack-CSl79E5u.js","assets/handlebars-Du8DtnRB.js","assets/http-CTnm0cit.js","assets/hurl-CpwzV4SP.js","assets/csv-aQe9eWwB.js","assets/hxml-B_tSdhCX.js","assets/haxe-BZXihDV-.js","assets/jinja-CaXggA6f.js","assets/jison-UUT3aynj.js","assets/julia-R8NNmfP1.js","assets/r-B1OEipip.js","assets/just-BhhHYlS8.js","assets/perl-BLMySlFJ.js","assets/latex-D5k_uhWv.js","assets/tex-C3KbjgWU.js","assets/liquid-Q0_hzjly.js","assets/marko-D_aeUD__.js","assets/less-BGJv5CZz.js","assets/mdc-BSifqehP.js","assets/nextflow-Bbiyy34d.js","assets/nextflow-groovy-Dc_ddanL.js","assets/nginx-BNb4NZk1.js","assets/nim-BuixXxPS.js","assets/php-Czf_fybR.js","assets/pug-CsZglf8T.js","assets/qml-BPgOJK7U.js","assets/razor-oFpUW61Z.js","assets/csharp-Ct8U2NOr.js","assets/rst-U6Eu7ipE.js","assets/cmake-CbIxKMg_.js","assets/sas-CNBFrLhc.js","assets/shaderlab-QzRPXpa3.js","assets/hlsl-BxIm9IaD.js","assets/shellsession-BebtDBlY.js","assets/soy-CdbyEXp6.js","assets/sparql-BQ8pLLZr.js","assets/turtle-CA3RhB-1.js","assets/stata-DVbvk3qH.js","assets/surrealql-CiJ5GSG5.js","assets/svelte-DzNm5V2w.js","assets/templ-CsM0tTsw.js","assets/go-BJwz_mda.js","assets/ts-tags-Bf-FGGvT.js","assets/twig-VJ4-Ntm0.js","assets/vue-D3dSYZKz.js","assets/vue-html-n-yWadYX.js","assets/vue-vine-B67Dz05t.js","assets/stylus-BrO8Mu5X.js","assets/xsl-C2_ECGp9.js","assets/dagre-BM42HDAG-
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./chunk-Cyuzqnbw.js";import{t as a}from"./preload-helper-zJ_50EbN.js";import{_ as o,g as s,h as c,p as l}from"./src-D-NMWEou.js";import{$ as u,C as d,E as f,I as p,L as m,N as h,P as g,Q as _,S as v,T as y,V as b,W as x,X as S,Z as C,_ as w,b as T,c as E,g as ee,l as D,m as O,n as k,p as te,q as ne,r as A,s as j,t as re,u as M,x as ie}from"./chunk-CSCIHK7Q-BIEyv3Kb.js";import{$ as ae,J as oe,K as se,Q as ce,S as le,X as ue,Y as de,Z as fe,a as pe,d as me,et as he,f as ge,g as _e,h as ve,i as ye,nt as be,o as xe,q as Se,rt as Ce,tt as we,u as Te,v as Ee,x as De,y as Oe}from"./chunk-5ZQYHXKU-CIXMC7H5.js";import{t as ke}from"./line-BY6XOqO6.js";import{i as Ae,n as je,r as Me,t as Ne}from"./chunk-BSJP7CBP-DIpfLhEz.js";import{n as Pe}from"./chunk-L5ZTLDWV-HNLEK3Eg.js";import{i as Fe,n as Ie}from"./chunk-NZK2D7GU-V_WiEVCU.js";import{i as Le,n as Re,o as ze}from"./chunk-O5CBEL6O-C6f2hDI-.js";import{t as Be}from"./rough.esm-CSKSodPl.js";import{a as Ve,i as He,r as Ue,s as We}from"./chunk-3OPIFGDE-DLE954S0.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ge=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=A(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M=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&&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)},ie={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ie,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,M)}catch(e){M(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),Ke=i(((e,t)=>{t.exports=Ge()})),qe=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Je=i(((e,t)=>{t.exports=qe()})),Ye=i((e=>{var t=Ke();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,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})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.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})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),Xe=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ye()})),Ze=i((e=>{var t=Je(),n=Ke(),r=Xe();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},M=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=M[ie],M[ie]=null,ie--)}function se(e,t){ie++,M[ie]=e.current,e.current=t}var ce=ae(null),le=ae(null),ue=ae(null),de=ae(null);function fe(e,t){switch(se(ue,t),se(le,e),se(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?of(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=of(t),e=sf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(ce),se(ce,e)}function pe(){oe(ce),oe(le),oe(ue)}function me(e){e.memoizedState!==null&&se(de,e);var t=ce.current,n=sf(t,e.type);t!==n&&(se(le,e),se(ce,n))}function he(e){le.current===e&&(oe(ce),oe(le)),de.current===e&&(oe(de),gp._currentValue=re)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BKhkKBsm.js","assets/chunk-Cyuzqnbw.js","assets/html-Kpl3bQKd.js","assets/css-D7o5g6xi.js","assets/javascript-DywGHrES.js","assets/angular-ts-CYPbMJCA.js","assets/scss-CPnU-uuv.js","assets/apl-D7bENxmy.js","assets/json-BbGuGINB.js","assets/xml-DI0syHFL.js","assets/java-BIlOlX09.js","assets/astro-B1l9MDUT.js","assets/postcss-BunjpCQr.js","assets/tsx-0GViXbh-.js","assets/typescript-C03X-V26.js","assets/blade-BlkqRXu6.js","assets/html-derivative-BEEWNZ8Y.js","assets/sql-hpBkusIy.js","assets/bsl-DJOyloKD.js","assets/sdbl-DzilZtvS.js","assets/c-Y1DAQKNJ.js","assets/cairo-CDc8os0h.js","assets/python-DkGugaUl.js","assets/cobol-BoXxFQjh.js","assets/coffee-Dl-rf7k6.js","assets/cpp-CVIk4zoB.js","assets/glsl-dHcuwXfH.js","assets/regexp-zLCDTged.js","assets/crystal-CvUuUt6_.js","assets/shellscript-IH5A6LQB.js","assets/edge-CmXZi-az.js","assets/elixir-BoRIkjDi.js","assets/elm-BN_gLVH_.js","assets/erb-DuMAGb6i.js","assets/ruby-CUQsVT6d.js","assets/graphql-CdhToEZf.js","assets/jsx-NH_i07l1.js","assets/haml-Dmb1YmHj.js","assets/lua-SpZ12qGF.js","assets/yaml-DtN9Ue11.js","assets/erlang-Dej7b2OY.js","assets/markdown-Bk5jPFPK.js","assets/fortran-fixed-form-RVbzjQ2q.js","assets/fortran-free-form-EhmKDVgM.js","assets/fsharp-DKW21_Cq.js","assets/gdresource-b7MixKdf.js","assets/gdscript-DbNIuFFJ.js","assets/gdshader-C7BToOo8.js","assets/git-commit-BU_RZ1WH.js","assets/diff-COJGj3FI.js","assets/git-rebase-DfgjiXG9.js","assets/glimmer-js--VVKNatA.js","assets/glimmer-ts-Bfa_wiNC.js","assets/hack-CSl79E5u.js","assets/handlebars-Du8DtnRB.js","assets/http-CTnm0cit.js","assets/hurl-CpwzV4SP.js","assets/csv-aQe9eWwB.js","assets/hxml-B_tSdhCX.js","assets/haxe-BZXihDV-.js","assets/jinja-CaXggA6f.js","assets/jison-UUT3aynj.js","assets/julia-R8NNmfP1.js","assets/r-B1OEipip.js","assets/just-BhhHYlS8.js","assets/perl-BLMySlFJ.js","assets/latex-D5k_uhWv.js","assets/tex-C3KbjgWU.js","assets/liquid-Q0_hzjly.js","assets/marko-D_aeUD__.js","assets/less-BGJv5CZz.js","assets/mdc-BSifqehP.js","assets/nextflow-Bbiyy34d.js","assets/nextflow-groovy-Dc_ddanL.js","assets/nginx-BNb4NZk1.js","assets/nim-BuixXxPS.js","assets/php-Czf_fybR.js","assets/pug-CsZglf8T.js","assets/qml-BPgOJK7U.js","assets/razor-oFpUW61Z.js","assets/csharp-Ct8U2NOr.js","assets/rst-U6Eu7ipE.js","assets/cmake-CbIxKMg_.js","assets/sas-CNBFrLhc.js","assets/shaderlab-QzRPXpa3.js","assets/hlsl-BxIm9IaD.js","assets/shellsession-BebtDBlY.js","assets/soy-CdbyEXp6.js","assets/sparql-BQ8pLLZr.js","assets/turtle-CA3RhB-1.js","assets/stata-DVbvk3qH.js","assets/surrealql-CiJ5GSG5.js","assets/svelte-DzNm5V2w.js","assets/templ-CsM0tTsw.js","assets/go-BJwz_mda.js","assets/ts-tags-Bf-FGGvT.js","assets/twig-VJ4-Ntm0.js","assets/vue-D3dSYZKz.js","assets/vue-html-n-yWadYX.js","assets/vue-vine-B67Dz05t.js","assets/stylus-BrO8Mu5X.js","assets/xsl-C2_ECGp9.js","assets/dagre-BM42HDAG-CXmNPcYk.js","assets/chunk-O5CBEL6O-CiuRaQYp.js","assets/src-D-NMWEou.js","assets/chunk-5ZQYHXKU-BDj_WSIO.js","assets/dist-D4B_Bs5p.js","assets/chunk-CSCIHK7Q-f6gpv8hv.js","assets/preload-helper-zJ_50EbN.js","assets/dagre-Bx709z4p.js","assets/graphlib-B8gBHxth.js","assets/chunk-3OPIFGDE-Suqj7-eK.js","assets/chunk-L5ZTLDWV-DwGwhkp3.js","assets/chunk-NZK2D7GU-D45NPMcH.js","assets/rough.esm-CSKSodPl.js","assets/chunk-BSJP7CBP-DIpfLhEz.js","assets/cose-bilkent-S5V4N54A-BPg4WNhP.js","assets/cytoscape.esm-h6BdjjI9.js","assets/c4Diagram-AAUBKEIU-CZUMj02O.js","assets/chunk-ND2GUHAM-B26vogSg.js","assets/flowDiagram-I6XJVG4X-DkjX5DZF.js","assets/channel-CYJ9CpWi.js","assets/chunk-2J33WTMH-C-h9XHiN.js","assets/chunk-55IACEB6-QyFAFTWp.js","assets/chunk-FMBD7UC4-C9D6P7Uq.js","assets/erDiagram-TEJ5UH35-0PzYt82j.js","assets/gitGraphDiagram-PVQCEYII-9lZv175y.js","assets/mermaid-parser.core-PBFdhlkk.js","assets/chunk-NNHCCRGN-DlpIbxXb.js","assets/chunk-4BX2VUAB-C0kf5ycP.js","assets/chunk-QZHKN3VN-CyVdgm44.js","assets/ganttDiagram-6RSMTGT7-2gmi5Sgv.js","assets/linear-BktLjFGX.js","assets/defaultLocale-C8Fc0cco.js","assets/init-D6jRqBbL.js","assets/infoDiagram-5YYISTIA-Dkm8HLsk.js","assets/pieDiagram-4H26LBE5-i3VSQ_MS.js","assets/path-BWPyau1x.js","assets/ordinal-hYBb2elL.js","assets/arc-8BWbC-0s.js","assets/array-BifhSqXX.js","assets/quadrantDiagram-W4KKPZXB-D-TfUmVL.js","assets/xychartDiagram-2RQKCTM6-Ct4sYA1Y.js","assets/line-BnrU3xyY.js","assets/requirementDiagram-4Y6WPE33-DzVzYzd9.js","assets/sequenceDiagram-3UESZ5HK-17MkrfUw.js","assets/classDiagram-4FO5ZUOK-Dvou9Rr1.js","assets/chunk-727SXJPM-Cx21sn43.js","assets/classDiagram-v2-Q7XG4LA2-Dvou9Rr1.js","assets/stateDiagram-AJRCARHV-DKgsIGkA.js","assets/chunk-AQP2D5EJ-CVKFCnwF.js","assets/stateDiagram-v2-BHNVJYJU-DkcZNYHL.js","assets/journeyDiagram-JHISSGLW-Bz2jAsli.js","assets/timeline-definition-PNZ67QCA-s2pNN-F3.js","assets/mindmap-definition-RKZ34NQL-vTgGplHm.js","assets/kanban-definition-UN3LZRKU-DmxDYbPB.js","assets/sankeyDiagram-5OEKKPKP-OWzr-E_q.js","assets/diagram-LMA3HP47-B3NHb7IR.js","assets/diagram-2AECGRRQ-L3ctMTu7.js","assets/blockDiagram-GPEHLZMM-m2UjnbEQ.js","assets/diagram-5GNKFQAL-K2WCnZ8q.js","assets/architectureDiagram-3BPJPVTR-D8tR5wlz.js","assets/diagram-KO2AKTUF-C4zJ2WX8.js","assets/ishikawaDiagram-YF4QCWOH-sHwxLXPL.js","assets/vennDiagram-CIIHVFJN-DwBO7C2G.js","assets/diagram-OG6HWLK6-DeucNSc_.js","assets/wardleyDiagram-YWT4CUSO-B3izZUrd.js","assets/highlighted-body-OFNGDK62-Cq8HtngO.js","assets/angular-html-DrvEcI8G.js","assets/html-x4KE3xEi.js","assets/css-Dflf0SUa.js","assets/javascript-i_rUTyCW.js","assets/angular-ts-D8CUV3s9.js","assets/scss-DdIrFDxD.js","assets/apl-PcM4Dp7k.js","assets/json-DS5j4FfK.js","assets/xml-C33zriiW.js","assets/java-Cst_eZTE.js","assets/astro-DcteBnKj.js","assets/postcss-BXeXVLqQ.js","assets/tsx-DFvk7AwW.js","assets/typescript-DHTLvXzV.js","assets/blade-6YnoPBU8.js","assets/html-derivative-CWPAmHEG.js","assets/sql-DCFvu5RM.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/c-PpPxyn8g.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-IOjEjPmG.js","assets/coffee-B5TREocO.js","assets/cpp-C4ceAJBi.js","assets/glsl-MPwHyiXQ.js","assets/regexp-Bu0flJgP.js","assets/crystal-CgtjlE18.js","assets/shellscript-BbTp1yjG.js","assets/edge-DoVTVjme.js","assets/elixir-CzgPtVDf.js","assets/elm-Cm7sFdI1.js","assets/erb-p0q977En.js","assets/ruby-BA7kcl5p.js","assets/graphql-NW854Khs.js","assets/jsx-CFyhNHav.js","assets/haml-qGg_91I2.js","assets/lua-VoGSg0xb.js","assets/yaml-w0rMsuN4.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdscript-Cp2uCuqX.js","assets/gdshader-CBce3t8t.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-D2tSwjJb.js","assets/glimmer-js-JMWzPMQ2.js","assets/glimmer-ts-DG5GCT78.js","assets/hack-C4J_0T1S.js","assets/handlebars-BU7OV8YS.js","assets/http-HvMG3K54.js","assets/hurl-CLh1t2ES.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-ISwn25cN.js","assets/jison-D9Fg2JgN.js","assets/julia-BRnC1exM.js","assets/r-D2d3McyU.js","assets/just-BWbKChh7.js","assets/perl-CAUsHq6V.js","assets/latex-DoFV6f5B.js","assets/tex-B0f_hYr8.js","assets/liquid-BGxpJKqJ.js","assets/marko-E8KxKzjy.js","assets/less-DVTAwKKz.js","assets/mdc-ytrN0-8H.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-CgHaWcsO.js","assets/nim-xKCzf2o0.js","assets/php-Cn4rjz2P.js","assets/pug-DD9HHTGS.js","assets/qml-DcW_sT3t.js","assets/razor-30Cugjh2.js","assets/csharp-oqKa8noW.js","assets/rst-BIOjc2k6.js","assets/cmake-Bj61d0ZC.js","assets/sas-BHVT2N5I.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-BmAC8SMF.js","assets/soy-B5vCsGAN.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-h02h04e7.js","assets/surrealql-DxccxuMd.js","assets/svelte-CsxBlEum.js","assets/templ-DmkwoHql.js","assets/go-rLFTqkRN.js","assets/ts-tags-CTs7_HT0.js","assets/twig-DgtEA5Er.js","assets/vue-CUpaeZ-j.js","assets/vue-html-DQch_7VQ.js","assets/vue-vine-BCPDker4.js","assets/stylus-B6D30XZt.js","assets/xsl-BFS2wyMt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./chunk-Cyuzqnbw.js";import{t as a}from"./preload-helper-zJ_50EbN.js";import{_ as o,g as s,h as c,p as l}from"./src-D-NMWEou.js";import{$ as u,C as d,E as f,I as p,L as m,N as h,P as g,Q as _,S as v,T as y,V as b,W as x,X as S,Z as C,_ as w,b as T,c as E,g as ee,l as D,m as O,n as k,p as te,q as ne,r as A,s as j,t as re,u as M,x as ie}from"./chunk-CSCIHK7Q-f6gpv8hv.js";import{$ as ae,J as oe,K as se,Q as ce,S as le,X as ue,Y as de,Z as fe,a as pe,d as me,et as he,f as ge,g as _e,h as ve,i as ye,nt as be,o as xe,q as Se,rt as Ce,tt as we,u as Te,v as Ee,x as De,y as Oe}from"./chunk-5ZQYHXKU-BDj_WSIO.js";import{t as ke}from"./line-BnrU3xyY.js";import{i as Ae,n as je,r as Me,t as Ne}from"./chunk-BSJP7CBP-DIpfLhEz.js";import{n as Pe}from"./chunk-L5ZTLDWV-DwGwhkp3.js";import{i as Fe,n as Ie}from"./chunk-NZK2D7GU-D45NPMcH.js";import{i as Le,n as Re,o as ze}from"./chunk-O5CBEL6O-CiuRaQYp.js";import{t as Be}from"./rough.esm-CSKSodPl.js";import{a as Ve,i as He,r as Ue,s as We}from"./chunk-3OPIFGDE-Suqj7-eK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ge=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=A(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M=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&&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)},ie={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ie,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,M)}catch(e){M(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),Ke=i(((e,t)=>{t.exports=Ge()})),qe=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Je=i(((e,t)=>{t.exports=qe()})),Ye=i((e=>{var t=Ke();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,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})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.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})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),Xe=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ye()})),Ze=i((e=>{var t=Je(),n=Ke(),r=Xe();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},M=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=M[ie],M[ie]=null,ie--)}function se(e,t){ie++,M[ie]=e.current,e.current=t}var ce=ae(null),le=ae(null),ue=ae(null),de=ae(null);function fe(e,t){switch(se(ue,t),se(le,e),se(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?of(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=of(t),e=sf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(ce),se(ce,e)}function pe(){oe(ce),oe(le),oe(ue)}function me(e){e.memoizedState!==null&&se(de,e);var t=ce.current,n=sf(t,e.type);t!==n&&(se(le,e),se(ce,n))}function he(e){le.current===e&&(oe(ce),oe(le)),de.current===e&&(oe(de),gp._currentValue=re)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -184,7 +184,7 @@ ${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.t
|
|
|
184
184
|
`;return t&&t.length>0?t[0]:null}getAllStreamMetadata(){return this.sql`select id, status, request_id, created_at from cf_ai_chat_stream_metadata`||[]}insertStaleStream(e,t,n){let r=Date.now()-n;this.sql`
|
|
185
185
|
insert into cf_ai_chat_stream_metadata (id, request_id, status, created_at)
|
|
186
186
|
values (${e}, ${t}, 'streaming', ${r})
|
|
187
|
-
`}};rm.CHUNK_MAX_BYTES=18e5,qp.STREAM_RESUME_NONE;var im=i(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n})),am=i((e=>{var t=Ke();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),om=i(((e,t)=>{t.exports=am()})),eee=e(im(),1),sm=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},cm=(e,t,n)=>(sm(e,t,`read from private field`),n?n.call(e):t.get(e)),lm=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},um=(e,t,n,r)=>(sm(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function tee(e,t){return t==null?e:(0,eee.default)(e,t)}var dm,fm,pm,mm,hm,gm,_m,vm,ym,nee=class{constructor(e=[]){lm(this,dm,void 0),lm(this,fm,`ready`),lm(this,pm,void 0),lm(this,mm,new Set),lm(this,hm,new Set),lm(this,gm,new Set),this.pushMessage=e=>{um(this,dm,cm(this,dm).concat(e)),cm(this,_m).call(this)},this.popMessage=()=>{um(this,dm,cm(this,dm).slice(0,-1)),cm(this,_m).call(this)},this.replaceMessage=(e,t)=>{um(this,dm,[...cm(this,dm).slice(0,e),this.snapshot(t),...cm(this,dm).slice(e+1)]),cm(this,_m).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?tee(e,t):e;return cm(this,mm).add(n),()=>{cm(this,mm).delete(n)}},this[`~registerStatusCallback`]=e=>(cm(this,hm).add(e),()=>{cm(this,hm).delete(e)}),this[`~registerErrorCallback`]=e=>(cm(this,gm).add(e),()=>{cm(this,gm).delete(e)}),lm(this,_m,()=>{cm(this,mm).forEach(e=>e())}),lm(this,vm,()=>{cm(this,hm).forEach(e=>e())}),lm(this,ym,()=>{cm(this,gm).forEach(e=>e())}),um(this,dm,e)}get status(){return cm(this,fm)}set status(e){um(this,fm,e),cm(this,vm).call(this)}get error(){return cm(this,pm)}set error(e){um(this,pm,e),cm(this,ym).call(this)}get messages(){return cm(this,dm)}set messages(e){um(this,dm,[...e]),cm(this,_m).call(this)}};dm=new WeakMap,fm=new WeakMap,pm=new WeakMap,mm=new WeakMap,hm=new WeakMap,gm=new WeakMap,_m=new WeakMap,vm=new WeakMap,ym=new WeakMap;var bm,xm=class extends Vp{constructor({messages:e,...t}){let n=new nee(e);super({...t,state:n}),lm(this,bm,void 0),this[`~registerMessagesCallback`]=(e,t)=>cm(this,bm)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>cm(this,bm)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>cm(this,bm)[`~registerErrorCallback`](e),um(this,bm,n)}};bm=new WeakMap;function ree({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,N.useRef)(`chat`in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});`chat`in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t;return(t=r.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=r.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=r.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=r.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=r.current).sendAutomaticallyWhen?.call(t,e)??!1}},a=(0,N.useRef)(`chat`in n?n.chat:new xm(i));(`chat`in n&&n.chat!==a.current||`id`in n&&a.current.id!==n.id)&&(a.current=`chat`in n?n.chat:new xm(i));let o=(0,N.useSyncExternalStore)((0,N.useCallback)(t=>a.current[`~registerMessagesCallback`](t,e),[e,a.current.id]),()=>a.current.messages,()=>a.current.messages),s=(0,N.useSyncExternalStore)(a.current[`~registerStatusCallback`],()=>a.current.status,()=>a.current.status),c=(0,N.useSyncExternalStore)(a.current[`~registerErrorCallback`],()=>a.current.error,()=>a.current.error),l=(0,N.useCallback)(e=>{typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,N.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var iee=class{constructor(e){this._resumeResolver=null,this._resumeNoneResolver=null,this._expectToolContinuation=!1,this._abortToolContinuation=null,this._activeServerTurnId=null,this._cancelAttachedStream=null,this.agent=e.agent,this.prepareBody=e.prepareBody,this.activeRequestIds=e.activeRequestIds,this.cancelOnClientAbort=e.cancelOnClientAbort??!1}setCancelOnClientAbort(e){this.cancelOnClientAbort=e}cancelActiveServerTurn(){let e=this._activeServerTurnId,t=!1;e&&(this.sendCancelFrame(e),this._cancelAttachedStream?.(),this.clearActiveServerTurn(e),t=!0);let n=this.abortActiveToolContinuation();return t||n}sendCancelFrame(e){try{this.agent.send(JSON.stringify({id:e,type:`cf_agent_chat_request_cancel`}))}catch{}}setActiveServerTurn(e,t){this._activeServerTurnId=e,this._cancelAttachedStream=t}clearActiveServerTurn(e){this._activeServerTurnId===e&&(this._activeServerTurnId=null,this._cancelAttachedStream=null)}expectToolContinuation(){this._expectToolContinuation=!0}abortActiveToolContinuation(){return this._abortToolContinuation?.()??!1}isAwaitingResume(){return this._resumeResolver!==null||this._resumeNoneResolver!==null}handleStreamResuming(e){return this._resumeResolver?(this._resumeResolver(e),!0):!1}handleStreamResumeNone(){return this._resumeNoneResolver?(this._resumeNoneResolver(),!0):!1}handleServerTurnCompleted(e){this.clearActiveServerTurn(e)}observeServerTurn(e){this.setActiveServerTurn(e,null)}async sendMessages(e){let t=Up(8),n=new AbortController,r=!1,i=!1,a={};this.prepareBody&&(a=await this.prepareBody({messages:e.messages,trigger:e.trigger,messageId:e.messageId})),e.body&&(a={...a,...e.body});let o=JSON.stringify({messages:e.messages,trigger:e.trigger,...a});this.activeRequestIds?.add(t);let s=this.agent,c=this.activeRequestIds,l=(e,i=!1,a=!0)=>{if(!r){r=!0,a&&this.clearActiveServerTurn(t);try{e()}catch{}i||c?.delete(t),n.abort()}},u=Error(`Aborted`);u.name=`AbortError`,this.setActiveServerTurn(t,()=>r?!1:(l(()=>f.error(u),!0),!0));let d=()=>{r||(this.cancelOnClientAbort?(i&&this.sendCancelFrame(t),l(()=>f.error(u),i)):l(()=>f.error(u),!1,!i))},f,p=new ReadableStream({start(e){f=e,s.addEventListener(`message`,n=>{try{let r=JSON.parse(n.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==t)return;if(r.error){l(()=>e.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let t=JSON.parse(r.body);e.enqueue(t)}catch{}r.done&&l(()=>e.close())}catch{}},{signal:n.signal}),s.addEventListener(`close`,()=>{l(()=>e.close(),!1,!1)},{signal:n.signal})},cancel(){d()}});return e.abortSignal&&(e.abortSignal.addEventListener(`abort`,d,{once:!0}),e.abortSignal.aborted&&d()),r?p:(i=!0,s.send(JSON.stringify({id:t,init:{method:`POST`,body:o},type:`cf_agent_use_chat_request`})),p)}async reconnectToStream(e){if(this._expectToolContinuation)return this._expectToolContinuation=!1,this._createToolContinuationStream();let t=this.activeRequestIds;return new Promise(e=>{let n=!1,r,i=t=>{n||(n=!0,this._resumeResolver=null,this._resumeNoneResolver=null,r&&clearTimeout(r),e(t))};this._resumeNoneResolver=()=>i(null),this._resumeResolver=e=>{let n=e.id;t?.add(n);let r=this._createResumeStream(n);this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n})),i(r)};try{this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{}r=setTimeout(()=>i(null),5e3)})}_createToolContinuationStream(){let e=this.agent,t=this.activeRequestIds,n=new AbortController,r=Error(`Aborted`);r.name=`AbortError`;let i=!1,a=null,o,s=null,c=null,l=(e,t)=>{if(e===void 0&&t===void 0){this._resumeResolver=null,this._resumeNoneResolver=null;return}e&&this._resumeResolver===e&&(this._resumeResolver=null),t&&this._resumeNoneResolver===t&&(this._resumeNoneResolver=null)},u=(e,r,o,s=!1)=>{if(!i){i=!0,this._abortToolContinuation=null,l(r,o);try{e()}catch{}a&&!s&&t?.delete(a),n.abort()}};this._abortToolContinuation=()=>{if(i)return!1;if(a===null)return u(()=>o.error(r),s,c),!0;try{e.send(JSON.stringify({type:`cf_agent_chat_request_cancel`,id:a}))}catch{}return u(()=>o.error(r),s,c,!0),!0};let d=this;return new ReadableStream({start(r){o=r;let i,f=()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},p=n=>{a||(a=n.id,t?.add(a),l(p,f),i&&clearTimeout(i),e.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:a})))};s=p,c=f,i=setTimeout(()=>u(()=>r.close(),p,f),5e3),d._resumeResolver=p,d._resumeNoneResolver=f,e.addEventListener(`message`,e=>{try{let t=JSON.parse(e.data);if(t.type!==`cf_agent_use_chat_response`||a==null||t.id!==a)return;if(t.error){u(()=>r.error(Error(t.body||`Stream error`)),p,f);return}if(t.body?.trim())try{let e=JSON.parse(t.body);r.enqueue(e)}catch{}t.done&&u(()=>r.close(),p,f)}catch{}},{signal:n.signal}),e.addEventListener(`close`,()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},{signal:n.signal});try{e.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{u(()=>r.close())}},cancel(){a&&d.cancelOnClientAbort?(d.sendCancelFrame(a),u(()=>{},s,c,!0)):u(()=>{},s,c)}})}_createResumeStream(e){let t=this.agent,n=this.activeRequestIds,r=new AbortController,i=Error(`Aborted`);i.name=`AbortError`;let a=!1,o=(t,i=!1,o=!0)=>{if(!a){a=!0,o&&this.clearActiveServerTurn(e);try{t()}catch{}i||n?.delete(e),r.abort()}};this.setActiveServerTurn(e,()=>a?!1:(o(()=>s.error(i),!0),!0));let s,c=this;return new ReadableStream({start(n){s=n,t.addEventListener(`message`,t=>{try{let r=JSON.parse(t.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==e)return;if(r.error){o(()=>n.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let e=JSON.parse(r.body);n.enqueue(e)}catch{}r.done&&o(()=>n.close())}catch{}},{signal:r.signal}),t.addEventListener(`close`,()=>{o(()=>n.close(),!1,!1)},{signal:r.signal})},cancel(){c.cancelOnClientAbort?(c.sendCancelFrame(e),o(()=>{},!0)):o(()=>{},!1,!1)}})}},Sm=new Set;function Cm(e,t){Sm.has(e)||(Sm.add(e),console.warn(`[@cloudflare/ai-chat] Deprecated: ${t}`))}function wm(e){if(!e)return;let t=Object.entries(e).filter(([e,t])=>t.execute).map(([e,t])=>(t.inputSchema&&!t.parameters&&console.warn(`[useAgentChat] Tool "${e}" uses deprecated 'inputSchema'. Please migrate to 'parameters'.`),{name:e,description:t.description,parameters:t.parameters??t.inputSchema}));return t.length>0?t:void 0}var Tm=new Map;function aee(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`)return{index:t,message:n}}return null}function oee(e,t){let n=e.findIndex(e=>e.id===t);if(n<0||n===e.length-1)return e;let r=[...e],[i]=r.splice(n,1);return i?(r.push(i),r):e}function see(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id)),r=e.filter(e=>!n.has(e.id));return r.length===0?t:[...r,...t]}function cee(e){let{agent:t,getInitialMessages:n,messages:r,onToolCall:i,onData:a,experimental_automaticToolResolution:o,tools:s,toolsRequiringConfirmation:c,autoContinueAfterToolResult:l=!0,autoSendAfterAllConfirmationsResolved:u=!0,resume:d=!0,cancelOnClientAbort:f=!1,body:p,prepareSendMessagesRequest:m,...h}=e;c&&Cm(`useAgentChat.toolsRequiringConfirmation`,`The 'toolsRequiringConfirmation' option is deprecated. Use needsApproval on server-side tools instead. Will be removed in the next major version.`),o&&Cm(`useAgentChat.experimental_automaticToolResolution`,`The 'experimental_automaticToolResolution' option is deprecated. Use the onToolCall callback instead. Will be removed in the next major version.`),e.autoSendAfterAllConfirmationsResolved!==void 0&&Cm(`useAgentChat.autoSendAfterAllConfirmationsResolved`,`The 'autoSendAfterAllConfirmationsResolved' option is deprecated. Use sendAutomaticallyWhen from AI SDK instead. Will be removed in the next major version.`);let g=(0,N.useMemo)(()=>c||(s?Object.entries(s).filter(([e,t])=>!t.execute).map(([e])=>e):[]),[c,s]),_=(0,N.useRef)(i);_.current=i;let v=(0,N.useRef)(a);v.current=a;let y=t.getHttpUrl(),b=y?new URL(y):null;b&&b.searchParams.delete(`_pk`);let x=b?.toString()??null,S=Array.isArray(t.path)?JSON.stringify(t.path.map(e=>[e.agent,e.name])):JSON.stringify([[t.agent??``,t.name??``]]),C=b?`${b.origin}${b.pathname}|${S}`:null,w=S,T=(0,N.useRef)(null),E=(0,N.useRef)(null),ee=(0,N.useRef)(null),D=S,O=Array.isArray(t.path)&&ee.current!==null&&ee.current!==S;(T.current===null||E.current!==t||O)&&(T.current=C??D),E.current=t,ee.current=S;let k=(0,N.useRef)(t);k.current=t;async function te({url:t}){if(!t)return[];let n=new URL(t);n.pathname+=`/get-messages`;let r=await fetch(n.toString(),{credentials:e.credentials,headers:e.headers});if(!r.ok)return console.warn(`Failed to fetch initial messages: ${r.status} ${r.statusText}`),[];let i=await r.text();if(!i.trim())return[];try{return JSON.parse(i)}catch(e){return console.warn(`Failed to parse initial messages JSON:`,e),[]}}let ne=n||te;function A(e,t){if(Tm.has(t))return Tm.get(t);let n=ne(e);return Tm.set(t,n),n}let j=n!==null&&(n||x)?A({agent:t.agent,name:t.name,url:x??void 0},w):null,re=j?(0,N.use)(j):r??[];(0,N.useEffect)(()=>{if(j)return Tm.set(w,j),()=>{Tm.get(w)===j&&Tm.delete(w)}},[w,j]);let M=(0,N.useRef)(s);M.current=s;let ie=(0,N.useRef)(m);ie.current=m;let ae=(0,N.useRef)(p);ae.current=p;let oe=(0,N.useRef)(new Set),se=(0,N.useRef)(new Set),ce=(0,N.useRef)(new Set),le=(0,N.useRef)(null);le.current===null&&(le.current=new iee({agent:k.current,activeRequestIds:oe.current,cancelOnClientAbort:f,prepareBody:async({messages:e,trigger:t,messageId:n})=>{let r={},i=ae.current;if(i&&(r={...typeof i==`function`?await i():i}),M.current){let e=wm(M.current);e&&(r.clientTools=e)}if(ie.current){let i=await ie.current({id:k.current._pk,messages:e,trigger:t,messageId:n});i.body&&Object.assign(r,i.body)}return r}})),le.current.agent=k.current,le.current.setCancelOnClientAbort(f);let ue=le.current,de=ree({...h,onData:a,messages:re,transport:ue,id:T.current,resume:d}),{messages:fe,setMessages:pe,addToolResult:me,addToolApprovalResponse:he,sendMessage:ge,resumeStream:_e,status:ve,stop:ye}=de,be=(0,N.useRef)(ve);be.current=ve;let xe=(0,N.useRef)(!1),Se=(0,N.useRef)(!1),Ce=(0,N.useRef)(null),we=(0,N.useRef)(null),Te=(0,N.useRef)(0),[Ee,De]=(0,N.useState)(!1),Oe=(0,N.useCallback)(()=>{Te.current++,Se.current=!1,xe.current=!1,Ce.current=null,we.current&&=(clearTimeout(we.current),null),De(!1)},[]),ke=(0,N.useCallback)(()=>{!Se.current||be.current!==`ready`||we.current||(we.current=setTimeout(()=>{if(we.current=null,!Se.current||be.current!==`ready`)return;Se.current=!1;let e=Te.current;ue.expectToolContinuation(),_e().catch(e=>{console.error(`[useAgentChat] Tool continuation resume failed:`,e)}).finally(()=>{Te.current===e&&(xe.current=!1,De(!1))})},0))},[ue,_e]),Ae=(0,N.useCallback)(()=>{!l||xe.current||(++Te.current,xe.current=!0,Se.current=!0,De(!0),ke())},[l,ke]);(0,N.useEffect)(()=>{if(ve===`error`&&Se.current){Oe();return}ke()},[Oe,ke,ve]);let je=(0,N.useCallback)(async()=>{try{ue.cancelActiveServerTurn(),await ye()}finally{ue.abortActiveToolContinuation()}},[ye,ue]),Me=(0,N.useRef)(new Set),Ne=(0,N.useRef)(!1),[Pe,Fe]=(0,N.useState)(0),[Ie,Le]=(0,N.useState)(new Map),Re=(0,N.useRef)(fe);Re.current=fe;let ze=(0,N.useRef)(re);ze.current=re;let Be=(0,N.useRef)(null),Ve=(0,N.useCallback)(()=>{Be.current=w},[w]);(0,N.useEffect)(()=>{j&&Be.current!==w&&(Ve(),pe(e=>see(ze.current,e)))},[w,j,Ve,pe]);let He=(0,N.useRef)(new Map),Ue=(0,N.useRef)(null),We=(0,N.useCallback)(e=>{let t=Ue.current;if(!t)return[...e];let n=Re.current.find(e=>e.id===t.assistantId)??e.find(e=>e.id===t.assistantId);return n?[...e.filter(e=>e.id!==t.assistantId),n]:[...e]},[]),Ge=(0,N.useCallback)(()=>{if(be.current!==`streaming`)return;let e=aee(Re.current);e&&(Ue.current?.assistantId!==e.message.id&&(Ue.current={assistantId:e.message.id,anchorMessageId:Re.current[e.index-1]?.id??null}),pe(e=>{let t=Ue.current;return t?oee(e,t.assistantId):e}))},[pe]),Ke=(0,N.useCallback)(e=>{let t=Ue.current;!t||e!==void 0&&t.assistantId!==e||(Ue.current=null,pe(e=>{let n=e.findIndex(e=>e.id===t.assistantId);if(n<0)return e;let r=[...e],[i]=r.splice(n,1);if(!i)return e;if(t.anchorMessageId===null)r.unshift(i);else{let e=r.findIndex(e=>e.id===t.anchorMessageId);r.splice(e>=0?e+1:n,0,i)}return r}))},[pe]),qe=(0,N.useCallback)(e=>{pe(t=>{let n=t[t.length-1];if(!n||n.role!==`assistant`||n.id!==e)return t;ce.current.add(e);let r=[...t];return r[r.length-1]={...n,parts:[]},r})},[pe]),Je=(0,N.useCallback)(e=>{let t=e.parts,n=t.filter((e,n)=>e.type!==`text`||!(`text`in e)||!e.text?!0:!t.some((t,r)=>r<=n||t.type!==`text`||!(`text`in t)||!t.text?!1:t.text.startsWith(e.text)));return n.length===t.length?e:{...e,parts:n}},[]);(0,N.useEffect)(()=>{if(ce.current.size===0)return;let e=new Set(fe.filter(e=>ce.current.has(e.id)&&e.role===`assistant`&&Je(e)!==e).map(e=>e.id));e.size!==0&&pe(t=>{let n=!1,r=t.map(t=>{if(!e.has(t.id))return t;let r=Je(t);return r!==t&&(n=!0),r});return n?r:t})},[fe,Je,pe]);let Ye=(0,N.useCallback)(()=>{Ve(),pe([]),Le(new Map),tt(new Set),Oe(),Me.current.clear(),He.current.clear(),se.current.clear(),ce.current.clear(),Ue.current=null},[Ve,pe,Oe]),Xe=(0,N.useCallback)(async(e,t)=>{let n=ge(e,t);return e!==void 0&&!(typeof e==`object`&&e&&`messageId`in e&&e.messageId!=null)&&Ge(),n},[ge,Ge]),Ze=fe[fe.length-1],Qe=(()=>{if(!Ze||Ze.role!==`assistant`)return{messageId:void 0,toolCallIds:new Set};let e=new Set;for(let t of Ze.parts??[])jp(t)&&t.state===`input-available`&&g.includes(Np(t))&&e.add(t.toolCallId);return{messageId:Ze.id,toolCallIds:e}})(),$e=(0,N.useRef)(Qe);$e.current=Qe;let[et,tt]=(0,N.useState)(()=>new Set),nt=(0,N.useCallback)(e=>{tt(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]);(0,N.useEffect)(()=>{if(!o||Ne.current)return;let e=fe[fe.length-1];if(!e||e.role!==`assistant`)return;let t=e.parts.filter(e=>jp(e)&&e.state===`input-available`&&!Me.current.has(e.toolCallId));if(t.length>0){let e=M.current,n=t.filter(t=>jp(t)&&!g.includes(Np(t))&&e?.[Np(t)]?.execute);n.length>0&&(Ne.current=!0,(async()=>{try{let t=[];for(let r of n)if(jp(r)){let n=null,i=Np(r),a=e?.[i];if(a?.execute&&r.input!==void 0)try{n=await a.execute(r.input)}catch(e){n=`Error executing tool: ${e instanceof Error?e.message:String(e)}`}Me.current.add(r.toolCallId),t.push({toolCallId:r.toolCallId,toolName:i,output:n})}if(t.length>0){let n=wm(e);for(let e of t)k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e.toolCallId,toolName:e.toolName,output:e.output,autoContinue:l,clientTools:n}));await Promise.all(t.map(e=>me({tool:e.toolName,toolCallId:e.toolCallId,output:e.output}))),Le(e=>{let n=new Map(e);for(let e of t)n.set(e.toolCallId,e.output);return n}),Ae()}}finally{Ne.current=!1,Fe(e=>e+1)}})())}},[fe,o,me,g,l,Ae,Pe]);let rt=(0,N.useCallback)((e,t,n,r,i)=>{let a=r===`output-error`?!1:l;k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e,toolName:t,output:n,...r?{state:r}:{},...i===void 0?{}:{errorText:i},autoContinue:a,clientTools:M.current?wm(M.current):void 0})),r!==`output-error`&&Le(t=>new Map(t).set(e,n)),a&&Ae()},[l,Ae]),it=(0,N.useCallback)((e,t)=>{k.current.send(JSON.stringify({type:`cf_agent_tool_approval`,toolCallId:e,approved:t,autoContinue:l})),l&&Ae()},[l,Ae]);(0,N.useEffect)(()=>{let e=_.current;if(!e)return;let t=fe[fe.length-1];if(!t||t.role!==`assistant`)return;let n=t.parts.filter(e=>jp(e)&&e.state===`input-available`&&!Me.current.has(e.toolCallId));for(let t of n)if(jp(t)){let n=t.toolCallId,r=Np(t);Me.current.add(n),tt(e=>{if(e.has(n))return e;let t=new Set(e);return t.add(n),t});let i=e=>{rt(e.toolCallId,r,e.output,e.state,e.errorText),me({tool:r,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},a;try{a=e({toolCall:{toolCallId:n,toolName:r,input:t.input},addToolOutput:i})}catch(e){throw nt(n),e}Promise.resolve(a).finally(()=>{nt(n)})}},[fe,rt,me,nt]);let at=(0,N.useRef)({status:`idle`}),[ot,st]=(0,N.useState)(!1),[ct,lt]=(0,N.useState)(!1);(0,N.useEffect)(()=>{let e=He.current;function n(t){if(typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`cf_agent_chat_clear`:at.current=Kp(at.current,{type:`clear`}).state,st(!1),lt(!1),Ye();break;case`cf_agent_chat_recovering`:lt(!!n.recovering);break;case`cf_agent_chat_messages`:pe(We(n.messages));break;case`cf_agent_message_updated`:pe(e=>{let t=n.message,r=e.findIndex(e=>e.id===t.id);if(r<0){let n=new Set(t.parts.filter(e=>`toolCallId`in e&&e.toolCallId).map(e=>e.toolCallId));n.size>0&&(r=e.findIndex(e=>e.parts.some(e=>`toolCallId`in e&&n.has(e.toolCallId))))}if(r>=0){let n=[...e];return n[r]={...t,id:e[r].id},n}return e});break;case`cf_agent_stream_resume_none`:ue.handleStreamResumeNone();break;case`cf_agent_stream_resuming`:{let e=xe.current&&!ue.isAwaitingResume();if(!d&&!ue.isAwaitingResume()&&!e||(xe.current||se.current.add(n.id),ue.handleStreamResuming(n))||oe.current.has(n.id))return;e&&(Se.current=!1,Ce.current=n.id,we.current&&=(clearTimeout(we.current),null)),at.current=Kp(at.current,{type:`resume-fallback`,streamId:n.id,messageId:Up()}).state,ue.observeServerTurn(n.id),st(!0),lt(!1),k.current.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n.id}));break}case`cf_agent_use_chat_response`:{if(oe.current.has(n.id)){if(n.body?.trim())try{let t=JSON.parse(n.body);t.type===`start`&&typeof t.messageId==`string`&&(e.set(n.id,t.messageId),n.replay&&se.current.has(n.id)&&(se.current.delete(n.id),qe(t.messageId)))}catch{}(n.done||n.replayComplete)&&se.current.delete(n.id),n.done&&(at.current.status===`observing`&&at.current.streamId===n.id&&(at.current={status:`idle`},st(!1)),ue.handleServerTurnCompleted(n.id),Ke(e.get(n.id)),e.delete(n.id),oe.current.delete(n.id));return}let t;if(n.replay&&at.current.status!==`observing`&&!se.current.has(n.id))return;if(n.body?.trim())try{t=JSON.parse(n.body),n.replay&&se.current.has(n.id)&&typeof t.messageId==`string`&&t.type===`start`&&(se.current.delete(n.id),qe(t.messageId)),typeof t.type==`string`&&t.type.startsWith(`data-`)&&v.current&&v.current(t)}catch(e){console.warn(`[useAgentChat] Failed to parse stream chunk:`,e instanceof Error?e.message:e,`body:`,n.body?.slice(0,100))}(n.done||n.replayComplete)&&se.current.delete(n.id),n.done&&(ue.handleServerTurnCompleted(n.id),lt(!1));let r=n.done&&Ce.current===n.id,i=Kp(at.current,{type:`response`,streamId:n.id,messageId:Up(),chunkData:t,done:n.done,error:n.error,replay:n.replay,replayComplete:n.replayComplete,continuation:n.continuation,currentMessages:n.continuation?Re.current:void 0});at.current=i.state,i.messagesUpdate&&pe(i.messagesUpdate),st(i.isStreaming),r&&Oe();break}}}return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),at.current={status:`idle`},st(!1),lt(!1),Ue.current=null,e.clear()}},[t,pe,d,ue,We,Oe,qe,Ke,Ye]);let ut=async e=>{let{toolCallId:t}=e,n=`tool`in e?e.tool:``,r=`output`in e?e.output:void 0;if(k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:t,toolName:n,output:r,autoContinue:l,clientTools:M.current?wm(M.current):void 0})),Le(e=>new Map(e).set(t,r)),me(e),l&&Ae(),!l){if(!u){ge();return}let e=$e.current?.toolCallIds;if(!e){ge();return}let n=e.size===1&&e.has(t);e.has(t)&&e.delete(t),(n||e.size===0)&&ge()}},dt=e=>{let{id:t,approved:n}=e,r;for(let e of Re.current){for(let n of e.parts)if(`toolCallId`in n&&`approval`in n&&n.approval?.id===t){r=n.toolCallId;break}if(r)break}r?it(r,n):console.warn(`[useAgentChat] addToolApprovalResponse: Could not find toolCallId for approval ID "${t}". Server will not be notified, which may cause duplicate messages.`),he(e)},ft=(0,N.useMemo)(()=>Ie.size===0?fe:fe.map(e=>({...e,parts:e.parts.map(e=>!(`toolCallId`in e)||!(`state`in e)||e.state!==`input-available`||!Ie.has(e.toolCallId)?e:{...e,state:`output-available`,output:Ie.get(e.toolCallId)})})),[fe,Ie]);(0,N.useEffect)(()=>{let e=new Set;for(let t of fe)for(let n of t.parts)`toolCallId`in n&&n.toolCallId&&e.add(n.toolCallId);Le(t=>{if(t.size===0)return t;let n=!1;for(let r of t.keys())if(!e.has(r)){n=!0;break}if(!n)return t;let r=new Map;for(let[n,i]of t)e.has(n)&&r.set(n,i);return r});for(let t of Me.current)e.has(t)||Me.current.delete(t)},[fe]);let pt=(0,N.useCallback)(e=>{let t=e.toolName??``;rt(e.toolCallId,t,e.output,e.state,e.errorText),me({tool:t,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},[rt,me]),mt=ft[ft.length-1],ht=(()=>{if(et.size===0&&!s||!mt||mt.role!==`assistant`)return!1;for(let e of mt.parts){if(!jp(e)||e.state!==`input-available`)continue;let t=Np(e);if(!g.includes(t)&&(et.has(e.toolCallId)||s?.[t]?.execute))return!0}return!1})(),gt=ot||ht,_t=ve===`streaming`||gt;return{...de,messages:ft,isServerStreaming:gt,isStreaming:_t,isRecovering:ct,isToolContinuation:Ee,sendMessage:Xe,stop:je,addToolOutput:pt,addToolResult:ut,addToolApprovalResponse:dt,clearHistory:()=>{Ye(),t.send(JSON.stringify({type:`cf_agent_chat_clear`}))},setMessages:e=>{let n;n=typeof e==`function`?e(Re.current):e,n.length===0&&Ve(),pe(n),t.send(JSON.stringify({messages:n,type:`cf_agent_chat_messages`}))}}}function lee(e){return e?{headers:{Authorization:`Bearer ${e}`},protocols:[`bearer`,e]}:{}}function Em(e){let{enabled:t,host:n,agentName:r,actorId:i,name:a,sub:o,authToken:s,onError:c,onOpen:l,onClose:u}=e;return Rt({enabled:t,host:n,agent:r,name:i?`${i}:${a}`:a,sub:o,onOpen:l,onClose:u,onError:c,...lee(s)})}function Dm(e){let{toolContext:t,welcomeMessage:n,...r}=e,i=Em({...r,enabled:r.enabled??!!r.name}),a=i.state?.status??`connecting`,o=cee({agent:i,body:t??{},getInitialMessages:r.name&&a===`connected`?void 0:null}),s=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{n&&a===`connected`&&o.messages.length===0&&!s.current&&(s.current=!0,o.setMessages([{id:`welcome-message`,role:`assistant`,parts:[{type:`text`,text:n}]}]))},[a,o.messages.length,n]),{status:a,agent:i,chat:o,submitMessageFeedback:async(e,t,n)=>{await i.call(`submitMessageFeedback`,[e,t,n])},getMessageFeedback:async()=>await i.call(`getMessageFeedback`)}}function uee(e){let{toolContext:t,welcomeMessage:n,...r}=e,[i,a]=(0,N.useState)(),[o,s]=(0,N.useState)([]),c=Em(r),l=(0,N.useCallback)(async()=>{s((await c.call(`getChats`)).map(e=>{let t={...e,name:e.durable_object_name};return delete t.durable_object_name,t}))},[c]),u=c.state?.status;(0,N.useEffect)(()=>{u===`connected`&&l().catch(console.error)},[u,l]);let d=async()=>(await l(),o),f=async()=>{let e=await c.call(`createChat`);return a(e),await l(),e},p=e=>{a(e)},m=async e=>{await c.call(`deleteChat`,[e]),a(void 0),await l()},h=!!i&&c.state?.status===`connected`,g=Dm({...r,enabled:!!i,sub:i?[{agent:c.state?.subAgentName??``,name:i}]:void 0,getInitialMessages:h?void 0:null,toolContext:t,welcomeMessage:n});return{currentChatName:i,chats:o,status:(i?g.agent.state?.status:c.state?.status)??`connecting`,assistant:{getChats:d,createChat:f,openChat:p,deleteChat:m},chat:g}}function Om({status:e,chatKey:t,submitMessageFeedback:n,getMessageFeedback:r}){let[i,a]=(0,N.useState)({}),o=(0,N.useRef)(n),s=(0,N.useRef)(r);o.current=n,s.current=r;let c=(0,N.useCallback)(()=>{s.current().then(e=>a(e??{})).catch(()=>{})},[]);return(0,N.useEffect)(()=>{e===`connected`?c():a({})},[e,t,c]),{feedback:i,onFeedback:(0,N.useCallback)((e,t,n)=>{a(r=>({...r,[e]:{rating:t,comment:n}})),Promise.resolve(o.current(e,t,n)).catch(()=>c())},[c])}}function km(){return typeof window<`u`}function Am(e){return Nm(e)?(e.nodeName||``).toLowerCase():`#document`}function jm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mm(e){return((Nm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Nm(e){return km()?e instanceof Node||e instanceof jm(e).Node:!1}function Pm(e){return km()?e instanceof Element||e instanceof jm(e).Element:!1}function Fm(e){return km()?e instanceof HTMLElement||e instanceof jm(e).HTMLElement:!1}function Im(e){return!km()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof jm(e).ShadowRoot}function Lm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function dee(e){return/^(table|td|th)$/.test(Am(e))}function Rm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var fee=/transform|translate|scale|rotate|perspective|filter/,pee=/paint|layout|strict|content/,zm=e=>!!e&&e!==`none`,Bm;function Vm(e){let t=Pm(e)?Wm(e):e;return zm(t.transform)||zm(t.translate)||zm(t.scale)||zm(t.rotate)||zm(t.perspective)||!Hm()&&(zm(t.backdropFilter)||zm(t.filter))||fee.test(t.willChange||``)||pee.test(t.contain||``)}function mee(e){let t=Km(e);for(;Fm(t)&&!Um(t);){if(Vm(t))return t;if(Rm(t))return null;t=Km(t)}return null}function Hm(){return Bm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Bm}function Um(e){return/^(html|body|#document)$/.test(Am(e))}function Wm(e){return jm(e).getComputedStyle(e)}function Gm(e){return Pm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Km(e){if(Am(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Im(e)&&e.host||Mm(e);return Im(t)?t.host:t}function qm(e){let t=Km(e);return Um(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fm(t)&&Lm(t)?t:qm(t)}function Jm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qm(e),i=r===e.ownerDocument?.body,a=jm(r);if(i){let e=Ym(a);return t.concat(a,a.visualViewport||[],Lm(r)?r:[],e&&n?Jm(e):[])}else return t.concat(r,Jm(r,[],n))}function Ym(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xm={...N},Zm={};function Qm(e,t){let n=N.useRef(Zm);return n.current===Zm&&(n.current=e(t)),n}var $m=Xm.useInsertionEffect,hee=$m&&$m!==Xm.useLayoutEffect?$m:e=>e();function eh(e){let t=Qm(gee).current;return t.next=e,hee(t.effect),t.trampoline}function gee(){let e={next:void 0,callback:_ee,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function _ee(){}var th=typeof document<`u`?N.useLayoutEffect:()=>{};function nh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var rh={};function ih(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ah(t);let a=ah(e);return t&&(a=oh(a,t)),n&&(a=oh(a,n)),r&&(a=oh(a,r)),i&&(a=oh(a,i)),a}function vee(e){if(e.length===0)return rh;if(e.length===1)return ah(e[0]);let t=ah(e[0]);for(let n=1;n<e.length;n+=1)t=oh(t,e[n]);return t}function ah(e){return ch(e)?{...lh(e,rh)}:yee(e)}function oh(e,t){return ch(t)?lh(t,e):bee(e,t)}function yee(e){let t={...e};for(let e in t){let n=t[e];sh(e,n)&&(t[e]=uh(n))}return t}function bee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=nh(e.style,r);break;case`className`:e[n]=fh(e.className,r);break;default:sh(n,r)?e[n]=xee(e[n],r):e[n]=r}}return e}function sh(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ch(e){return typeof e==`function`}function lh(e,t){return ch(e)?e(t):e??rh}function xee(e,t){return t?e?(...n)=>{let r=n[0];if(ph(r)){let i=r;dh(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:uh(t):e}function uh(e){return e&&((...t)=>{let n=t[0];return ph(n)&&dh(n),e(...t)})}function dh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fh(e,t){return t?e?t+` `+e:t:e}function ph(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function mh(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var hh=mh(`https://base-ui.com/production-error`,`Base UI`),gh=N.createContext(void 0);function _h(e=!1){let t=N.useContext(gh);if(t===void 0&&!e)throw Error(hh(16));return t}function vh(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:N.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function yh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=N.useRef(null),s=_h(!0),c=a??s!==void 0,{props:l}=vh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=N.useCallback(()=>{let e=o.current;bh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return th(u,[u]),{getButtonProps:N.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ih({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(dh(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=bh(a),l=!i&&xh(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(dh(e),a?.(e),e.target===e.currentTarget&&i&&c&&bh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:eh(e=>{o.current=e,u()})}}function bh(e){return Fm(e)&&e.tagName===`BUTTON`}function xh(e){return!!(e?.tagName===`A`&&e?.href)}function Sh(e,t,n,r){let i=Qm(wh).current;return Th(i,e,t,n,r)&&Dh(i,[e,t,n,r]),i.callback}function Ch(e){let t=Qm(wh).current;return Eh(t,e)&&Dh(t,e),t.callback}function wh(){return{callback:null,cleanup:null,refs:[]}}function Th(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Eh(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Dh(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var See=19;function Oh(e){return See>=e}function kh(e){if(!N.isValidElement(e))return null;let t=e,n=t.props;return(Oh(19)?n?.ref:t.ref)??null}function Ah(){}Object.freeze([]);var jh=Object.freeze({});function Cee(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function wee(e,t){return typeof e==`function`?e(t):e}function Mh(e,t){return typeof e==`function`?e(t):e}function Nh(e,t,n={}){let r=t.render,i=Tee(t,n);return n.enabled===!1?null:Oee(e,r,i,n.state??jh)}function Tee(e,t={}){let{className:n,style:r,render:i}=e,{state:a=jh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?wee(n,a):void 0,d=l?Mh(r,a):void 0,f=l?Cee(a,c):jh,p=l&&s?Eee(s):void 0,m=l?nh(f,p)??{}:jh;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Ch([m.ref,kh(i),...o]):m.ref=Sh(m.ref,kh(i),o):Sh(null,null)),l?(u!==void 0&&(m.className=fh(m.className,u)),d!==void 0&&(m.style=nh(m.style,d)),m):jh}function Eee(e){return Array.isArray(e)?vee(e):ih(void 0,e)}var Dee=Symbol.for(`react.lazy`);function Oee(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ih(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Dee&&(i=N.Children.toArray(t)[0]),N.cloneElement(i,e)}if(e&&typeof e==`string`)return kee(e,n);throw Error(hh(8))}function kee(e,t){return e===`button`?(0,N.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,N.createElement)(`img`,{alt:``,...t,key:t.key}):N.createElement(e,t)}var Aee=N.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=yh({disabled:i,focusableWhenDisabled:a,native:o});return Nh(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Ph(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ph(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Fh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ph(e))&&(r&&(r+=` `),r+=t);return r}var Ih=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Lh=Fh,Rh=(e,t)=>n=>{if(t?.variants==null)return Lh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ih(t)||Ih(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Lh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},jee=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Mee=(e,t)=>({classGroupId:e,validator:t}),zh=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bh=`-`,Vh=[],Nee=`arbitrary..`,Pee=e=>{let t=Iee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Fee(e);let n=e.split(Bh);return Hh(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?jee(i,t):t:i||Vh}return n[e]||Vh}}},Hh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Hh(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Bh):e.slice(t).join(Bh),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Fee=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Nee+r:void 0})(),Iee=e=>{let{theme:t,classGroups:n}=e;return Lee(n,t)},Lee=(e,t)=>{let n=zh();for(let r in e){let i=e[r];Uh(i,n,r,t)}return n},Uh=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Wh(i,t,n,r)}},Wh=(e,t,n,r)=>{if(typeof e==`string`){Gh(e,t,n);return}if(typeof e==`function`){Kh(e,t,n,r);return}qh(e,t,n,r)},Gh=(e,t,n)=>{let r=e===``?t:Jh(t,e);r.classGroupId=n},Kh=(e,t,n,r)=>{if(Yh(e)){Uh(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Mee(n,e))},qh=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Uh(o,Jh(t,a),n,r)}},Jh=(e,t)=>{let n=e,r=t.split(Bh),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=zh(),n.nextPart.set(t,i)),n=i}return n},Yh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Xh=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Zh=`!`,Qh=`:`,$h=[],eg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),tg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Qh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Zh)?(c=s.slice(0,-1),l=!0):s.startsWith(Zh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return eg(t,l,c,u)};if(t){let e=t+Qh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):eg($h,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ng=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},rg=e=>({cache:Xh(e.cacheSize),parseClassName:tg(e),sortModifiers:ng(e),postfixLookupClassGroupIds:ig(e),...Pee(e)}),ig=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ag=/\s+/,og=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ag),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Zh:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},sg=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=cg(n))&&(i&&(i+=` `),i+=r);return i},cg=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=cg(e[r]))&&(n&&(n+=` `),n+=t);return n},lg=(e,...t)=>{let n,r,i,a,o=o=>(n=rg(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=og(e,n);return i(e,a),a};return a=o,(...e)=>a(sg(...e))},ug=[],dg=e=>{let t=t=>t[e]||ug;return t.isThemeGetter=!0,t},fg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_g=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bg=e=>mg.test(e),xg=e=>!!e&&!Number.isNaN(Number(e)),Sg=e=>!!e&&Number.isInteger(Number(e)),Cg=e=>e.endsWith(`%`)&&xg(e.slice(0,-1)),wg=e=>hg.test(e),Tg=()=>!0,Ree=e=>gg.test(e)&&!_g.test(e),Eg=()=>!1,zee=e=>vg.test(e),Bee=e=>yg.test(e),Vee=e=>!Dg(e)&&!Mg(e),Hee=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Uee=e=>Ig(e,Bg,Eg),Dg=e=>fg.test(e),Og=e=>Ig(e,Vg,Ree),kg=e=>Ig(e,Zee,xg),Wee=e=>Ig(e,Ug,Tg),Gee=e=>Ig(e,Hg,Eg),Ag=e=>Ig(e,Rg,Eg),Kee=e=>Ig(e,zg,Bee),jg=e=>Ig(e,Wg,zee),Mg=e=>pg.test(e),Ng=e=>Lg(e,Vg),qee=e=>Lg(e,Hg),Pg=e=>Lg(e,Rg),Jee=e=>Lg(e,Bg),Yee=e=>Lg(e,zg),Fg=e=>Lg(e,Wg,!0),Xee=e=>Lg(e,Ug,!0),Ig=(e,t,n)=>{let r=fg.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lg=(e,t,n=!1)=>{let r=pg.exec(e);return r?r[1]?t(r[1]):n:!1},Rg=e=>e===`position`||e===`percentage`,zg=e=>e===`image`||e===`url`,Bg=e=>e===`length`||e===`size`||e===`bg-size`,Vg=e=>e===`length`,Zee=e=>e===`number`,Hg=e=>e===`family-name`,Ug=e=>e===`number`||e===`weight`,Wg=e=>e===`shadow`,Gg=lg(()=>{let e=dg(`color`),t=dg(`font`),n=dg(`text`),r=dg(`font-weight`),i=dg(`tracking`),a=dg(`leading`),o=dg(`breakpoint`),s=dg(`container`),c=dg(`spacing`),l=dg(`radius`),u=dg(`shadow`),d=dg(`inset-shadow`),f=dg(`text-shadow`),p=dg(`drop-shadow`),m=dg(`blur`),h=dg(`perspective`),g=dg(`aspect`),_=dg(`ease`),v=dg(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Mg,Dg],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Mg,Dg,c],T=()=>[bg,`full`,`auto`,...w()],E=()=>[Sg,`none`,`subgrid`,Mg,Dg],ee=()=>[`auto`,{span:[`full`,Sg,Mg,Dg]},Sg,Mg,Dg],D=()=>[Sg,`auto`,Mg,Dg],O=()=>[`auto`,`min`,`max`,`fr`,Mg,Dg],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],A=()=>[bg,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[bg,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[bg,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Mg,Dg],ie=()=>[...b(),Pg,Ag,{position:[Mg,Dg]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,Jee,Uee,{size:[Mg,Dg]}],se=()=>[Cg,Ng,Og],ce=()=>[``,`none`,`full`,l,Mg,Dg],le=()=>[``,xg,Ng,Og],ue=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],fe=()=>[xg,Cg,Pg,Ag],pe=()=>[``,`none`,m,Mg,Dg],me=()=>[`none`,xg,Mg,Dg],he=()=>[`none`,xg,Mg,Dg],ge=()=>[xg,Mg,Dg],_e=()=>[bg,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[wg],breakpoint:[wg],color:[Tg],container:[wg],"drop-shadow":[wg],ease:[`in`,`out`,`in-out`],font:[Vee],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[wg],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[wg],shadow:[wg],spacing:[`px`,xg],text:[wg],"text-shadow":[wg],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,bg,Dg,Mg,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Mg,Dg]}],"container-named":[Hee],columns:[{columns:[xg,Dg,Mg,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Sg,`auto`,Mg,Dg]}],basis:[{basis:[bg,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[xg,bg,`auto`,`initial`,`none`,Dg]}],grow:[{grow:[``,xg,Mg,Dg]}],shrink:[{shrink:[``,xg,Mg,Dg]}],order:[{order:[Sg,`first`,`last`,`none`,Mg,Dg]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,...A()]}],"font-size":[{text:[`base`,n,Ng,Og]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xee,Wee]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Cg,Dg]}],"font-family":[{font:[qee,Gee,t]}],"font-features":[{"font-features":[Dg]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Mg,Dg]}],"line-clamp":[{"line-clamp":[xg,`none`,Mg,kg]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Mg,Dg]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Mg,Dg]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ue(),`wavy`]}],"text-decoration-thickness":[{decoration:[xg,`from-font`,`auto`,Mg,Og]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[xg,`auto`,Mg,Dg]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Sg,Mg,Dg]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Mg,Dg]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Mg,Dg]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Sg,Mg,Dg],radial:[``,Mg,Dg],conic:[Sg,Mg,Dg]},Yee,Kee]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":le()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ue(),`hidden`,`none`]}],"divide-style":[{divide:[...ue(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...ue(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[xg,Mg,Dg]}],"outline-w":[{outline:[``,xg,Ng,Og]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,Fg,jg]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Fg,jg]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:le()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[xg,Og]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Fg,jg]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[xg,Mg,Dg]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[xg]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Mg,Dg]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[xg]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Mg,Dg]}],filter:[{filter:[``,`none`,Mg,Dg]}],blur:[{blur:pe()}],brightness:[{brightness:[xg,Mg,Dg]}],contrast:[{contrast:[xg,Mg,Dg]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Fg,jg]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,xg,Mg,Dg]}],"hue-rotate":[{"hue-rotate":[xg,Mg,Dg]}],invert:[{invert:[``,xg,Mg,Dg]}],saturate:[{saturate:[xg,Mg,Dg]}],sepia:[{sepia:[``,xg,Mg,Dg]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Mg,Dg]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[xg,Mg,Dg]}],"backdrop-contrast":[{"backdrop-contrast":[xg,Mg,Dg]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,xg,Mg,Dg]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xg,Mg,Dg]}],"backdrop-invert":[{"backdrop-invert":[``,xg,Mg,Dg]}],"backdrop-opacity":[{"backdrop-opacity":[xg,Mg,Dg]}],"backdrop-saturate":[{"backdrop-saturate":[xg,Mg,Dg]}],"backdrop-sepia":[{"backdrop-sepia":[``,xg,Mg,Dg]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Mg,Dg]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[xg,`initial`,Mg,Dg]}],ease:[{ease:[`linear`,`initial`,_,Mg,Dg]}],delay:[{delay:[xg,Mg,Dg]}],animate:[{animate:[`none`,v,Mg,Dg]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Mg,Dg]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Mg,Dg,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":[`translate-none`],zoom:[{zoom:[Sg,Mg,Dg]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Mg,Dg]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Mg,Dg]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[xg,Ng,Og,kg]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Kg(...e){return Gg(Fh(e))}var Qee=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qg=i(((e,t)=>{t.exports=Qee()})),I=qg(),$ee=Rh(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Jg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,I.jsx)(Aee,{"data-slot":`button`,className:Kg($ee({variant:t,size:n,className:e})),...r})}var Yg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ete=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),tte=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xg=e=>{let t=tte(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},nte=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},rte=(0,N.createContext)({}),ite=()=>(0,N.useContext)(rte),ate=(0,N.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ite()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,N.createElement)(`svg`,{ref:c,...Zg,width:t??l??Zg.width,height:t??l??Zg.height,stroke:e??f,strokeWidth:m,className:Yg(`lucide`,p,i),...!a&&!nte(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Qg=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(ate,{ref:i,iconNode:t,className:Yg(`lucide-${ete(Xg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xg(e),n},ote=Qg(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ste=Qg(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),cte=Qg(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),$g=Qg(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),lte=Qg(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ute=Qg(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),e_=Qg(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),t_=Qg(`circle-x`,[[`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`}]]),dte=Qg(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),n_=Qg(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),fte=Qg(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),pte=Qg(`eye-off`,[[`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`}]]),mte=Qg(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),hte=Qg(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),gte=Qg(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),r_=Qg(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),_te=Qg(`mic`,[[`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`}]]),vte=Qg(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),yte=Qg(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bte=Qg(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),i_=Qg(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),xte=Qg(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Ste=Qg(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Cte=Qg(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),wte=Qg(`wrench`,[[`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`}]]),a_=Qg(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),o_={damping:.7,stiffness:.05,mass:1.25},Tte=70,s_=1e3/60,c_=350,l_=!1;globalThis.document?.addEventListener(`mousedown`,()=>{l_=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{l_=!1}),globalThis.document?.addEventListener(`click`,()=>{l_=!1});var Ete=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!l_)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Tte}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=f_(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/s_;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:f_(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=u_(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=u_(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=f_(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:c_})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function u_(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var d_=new Map;function f_(...e){let t={...o_},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return d_.has(r)||d_.set(r,Object.freeze(t)),n?`instant`:d_.get(r)}var p_=(0,N.createContext)(null),m_=typeof window<`u`?N.useLayoutEffect:N.useEffect;function h_({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Ete({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),m_(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(p_.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=g_();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(h_||={});function g_(){let e=(0,N.useContext)(p_);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var __=({className:e,...t})=>(0,I.jsx)(h_,{className:Kg(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),v_=({className:e,...t})=>(0,I.jsx)(h_.Content,{className:Kg(`flex flex-col gap-8 p-4`,e),...t}),y_=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=g_(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,I.jsx)(Jg,{className:Kg(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,I.jsx)(ote,{className:`size-4`})})};function b_(e){return Nh(e.defaultTagName??`div`,e,e)}var Dte=Rh(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function Ote({className:e,orientation:t,...n}){return(0,I.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Kg(Dte({orientation:t}),e),...n})}function kte({className:e,render:t,...n}){return b_({defaultTagName:`div`,props:ih({className:Kg(`flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var x_=[],S_=void 0;function Ate(){return S_}function jte(e){x_.push(e)}function C_(e){let t=(t,n)=>{let r=Qm(Nte).current,i;try{S_=r;for(let e of x_)e.before(r);i=e(t,n);for(let e of x_)e.after(r);r.didInitialize=!0}finally{S_=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mte(e){return N.forwardRef(C_(e))}function Nte(){return{didInitialize:!1}}function w_(e){let t=N.useRef(!0);t.current&&(t.current=!1,e())}var T_=N.createContext(void 0);function E_(e){let t=N.useContext(T_);if(t===void 0&&!e)throw Error(hh(72));return t}var Pte=[];function D_(e){N.useEffect(e,Pte)}var O_=0,k_=class e{static create(){return new e}currentId=O_;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=O_,t()},e)}isStarted(){return this.currentId!==O_}clear=()=>{this.currentId!==O_&&(clearTimeout(this.currentId),this.currentId=O_)};disposeEffect=()=>this.clear};function A_(){let e=Qm(k_.create).current;return D_(e.disposeEffect),e}var j_=typeof navigator<`u`,M_=V_(),N_=U_(),P_=H_(),F_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),I_=M_.platform===`MacIntel`&&M_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(M_.platform);j_&&/firefox/i.test(P_);var L_=j_&&/apple/i.test(navigator.vendor);j_&&/Edg/i.test(P_);var R_=j_&&/android/i.test(N_)||/android/i.test(P_),z_=j_&&N_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,B_=P_.includes(`jsdom/`);function V_(){if(!j_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function H_(){if(!j_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function U_(){if(!j_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function W_(e){e.preventDefault(),e.stopPropagation()}function G_(e){return`nativeEvent`in e}function K_(e){return e.pointerType===``&&e.isTrusted?!0:R_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function q_(e){return B_?!1:!R_&&e.width===0&&e.height===0||R_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function J_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Y_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var X_=`data-base-ui-focusable`,Z_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Q_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Im(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ev(e){return`composedPath`in e?e.composedPath()[0]:e.target}function tv(e,t){if(!Pm(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if($_(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function nv(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function rv(e){return e.matches(`html,body`)}function iv(e){return Fm(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function av(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Z_}`)!=null}function ov(e){return e?e.getAttribute(`role`)===`combobox`&&iv(e):!1}function sv(e){if(!e||B_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function cv(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Fte(e,t){return t!=null&&!J_(t)?0:typeof e==`function`?e():e}function lv(e,t,n){let r=Fte(e,n);return typeof r==`number`?r:r?.[t]}function uv(e){return typeof e==`function`?e():e}function dv(e,t){return t||e===`click`||e===`mousedown`}function Ite(e){return e?.includes(`mouse`)&&e!==`mousedown`}var fv=`none`,pv=`trigger-press`,mv=`trigger-hover`,hv=`trigger-focus`,Lte=`outside-press`,Rte=`close-press`,gv=`focus-out`,zte=`escape-key`,Bte=`disabled`,_v=`imperative-action`;function vv(e,t,n,r){let i=!1,a=!1,o=r??jh;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var yv=N.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new k_,currentIdRef:{current:null},currentContextRef:{current:null}});function Vte(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=N.useRef(n),a=N.useRef(n),o=N.useRef(null),s=N.useRef(null),c=A_();return(0,I.jsx)(yv.Provider,{value:N.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Hte(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=N.useContext(yv),[f,p]=N.useState(!1);return th(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),th(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:lv(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,vv(fv))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),th(()=>()=>{l.current=null},[l]),N.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function bv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function xv(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Sv(e){let t=Qm(Ute,e).current;return t.next=e,th(t.effect),t}function Ute(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Cv=null;globalThis.requestAnimationFrame;var wv=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Tv=class e{static create(){return new e}static request(e){return wv.request(e)}static cancel(e){return wv.cancel(e)}currentId=Cv;request(e){this.cancel(),this.currentId=wv.request(()=>{this.currentId=Cv,e()})}cancel=()=>{this.currentId!==Cv&&(wv.cancel(this.currentId),this.currentId=Cv)};disposeEffect=()=>this.cancel};function Ev(){let e=Qm(Tv.create).current;return D_(e.disposeEffect),e}function Dv(e){return e?.ownerDocument||document}var Ov={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},kv={...Ov,position:`fixed`,top:0,left:0},Wte={...Ov,position:`absolute`},Av=N.forwardRef(function(e,t){let[n,r]=N.useState();th(()=>{L_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,I.jsx)(`span`,{...e,ref:t,style:kv,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Gte=[`top`,`right`,`bottom`,`left`],jv=Math.min,Mv=Math.max,Nv=Math.round,Pv=Math.floor,Fv=e=>({x:e,y:e}),Kte={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Iv(e,t,n){return Mv(e,jv(t,n))}function Lv(e,t){return typeof e==`function`?e(t):e}function Rv(e){return e.split(`-`)[0]}function zv(e){return e.split(`-`)[1]}function Bv(e){return e===`x`?`y`:`x`}function Vv(e){return e===`y`?`height`:`width`}function Hv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Uv(e){return Bv(Hv(e))}function qte(e,t,n){n===void 0&&(n=!1);let r=zv(e),i=Uv(e),a=Vv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qv(o)),[o,qv(o)]}function Jte(e){let t=qv(e);return[Wv(e),t,Wv(t)]}function Wv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Gv=[`left`,`right`],Kv=[`right`,`left`],Yte=[`top`,`bottom`],Xte=[`bottom`,`top`];function Zte(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Kv:Gv:t?Gv:Kv;case`left`:case`right`:return t?Yte:Xte;default:return[]}}function Qte(e,t,n,r){let i=zv(e),a=Zte(Rv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Wv)))),a}function qv(e){let t=Rv(e);return Kte[t]+e.slice(t.length)}function $te(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$te(e)}function Yv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ene(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Xv(e,t=e?Wm(e):null){return!e||!e.isConnected||!t||ene(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var tne=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function nne(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Im(n)?n.host:null}function Zv(e){for(let t of Array.from(e.children))if(Am(t)===`summary`)return t;return null}function rne(e,t){let n=Zv(t);return!!n&&(e===n||$_(n,e))}function Qv(e){let t=e?Am(e):``;return e!=null&&e.matches(tne)&&(t!==`summary`||e.parentElement!=null&&Am(e.parentElement)===`details`&&Zv(e.parentElement)===e)&&(t!==`details`||Zv(e)==null)&&(t!==`input`||e.type!==`hidden`)}function $v(e){if(!Qv(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=nne(t)){let n=t!==e,r=Am(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Am(t)===`details`&&!t.open&&!rne(e,t)||t.hasAttribute(`hidden`)||!r&&!ine(t,n))return!1}return!0}function ine(e,t){let n=Wm(e);return t?n.display!==`none`:Xv(e,n)}function ey(e){let t=e.tabIndex;if(t<0){let t=Am(e);if(t===`details`||t===`audio`||t===`video`||Fm(e)&&e.isContentEditable)return 0}return t}function ty(e){if(Am(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ane(e,t){let n=ty(e);if(!n)return!0;let r=t.find(e=>{let t=ty(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ty(e);return t?.name===n.name&&t.form===n.form})===n}function ny(e){if(Fm(e)&&Am(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Fm(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ry(e,t){ny(e).forEach(e=>{Qv(e)&&t.push(e),ry(e,t)})}function iy(e,t,n){ny(e).forEach(e=>{Fm(e)&&e.matches(t)&&n.push(e),iy(e,t,n)})}function ay(e){return $v(e)&&ey(e)>=0}function oy(e){let t=[];return ry(e,t),t.filter($v)}function sy(e){let t=oy(e);return t.filter(e=>ey(e)>=0&&ane(e,t))}function cy(e,t){let n=sy(e),r=n.length;if(r===0)return;let i=Q_(Dv(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ly(e){return cy(Dv(e).body,1)||e}function uy(e){return cy(Dv(e).body,-1)||e}function dy(e,t){if(!e)return null;let n=sy(Dv(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function one(e){return dy(e,1)}function sne(e){return dy(e,-1)}function fy(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$_(n,r)}function cne(e){sy(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function py(e){let t=[];iy(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function my(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...my(e,t.id,n)])}function hy(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function gy(e){return`data-base-ui-${e}`}var _y=0;function vy(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(_y);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Ah;let o=requestAnimationFrame(a);return _y=o,()=>{_y===o&&(cancelAnimationFrame(o),_y=0)}}var yy={inert:new WeakMap,"aria-hidden":new WeakMap},by=`data-base-ui-inert`,xy={inert:new WeakSet,"aria-hidden":new WeakSet},Sy=new WeakMap,Cy=0;function wy(e){return xy[e]}function Ty(e){return e?Im(e)?e.host:Ty(e.parentNode):null}var Ey=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ty(t);return e.contains(n)?n:null}).filter(e=>e!=null),Dy=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Oy=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Am(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function ky(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Ey(t,e),u=i?Ey(t,a):[],d=new Set(u),f=i?Oy(t,Dy(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=yy[o],n=wy(o);c=n,s=e;let r=Ey(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Oy(t,Dy(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Sy.get(e)||0)+1;Sy.set(e,t),m.push(e),t===1&&e.setAttribute(by,``)}),Cy+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Sy.get(e)||0)-1;Sy.set(e,t),t||e.removeAttribute(by)}),--Cy,Cy||(yy.inert=new WeakMap,yy[`aria-hidden`]=new WeakMap,xy.inert=new WeakSet,xy[`aria-hidden`]=new WeakSet,Sy=new WeakMap)}}function Ay(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=Dv(e[0]).body;return ky(e,o,n,r,{mark:i,markerIgnoreElements:a})}var jy=0;function My(e,t=`mui`){let[n,r]=N.useState(e),i=e||n;return N.useEffect(()=>{n??(jy+=1,r(`${t}-${jy}`))},[n,t]),i}var Ny=Xm.useId;function Py(e,t){if(Ny!==void 0){let n=Ny();return e??(t?`${t}-${n}`:n)}return My(e,t)}var Fy={style:{transition:`none`}},Iy=`data-base-ui-click-trigger`,Ly={fallbackAxisSide:`end`},Ry={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zy=e(Xe()),By=N.createContext(null),Vy=()=>N.useContext(By),Hy=gy(`portal`);function Uy(e={}){let{ref:t,container:n,componentProps:r=jh,elementProps:i}=e,a=Py(),o=Vy()?.portalNode,[s,c]=N.useState(null),[l,u]=N.useState(null),d=eh(e=>{e!==null&&u(e)}),f=N.useRef(null);th(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Nm(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=Nh(`div`,r,{ref:[t,d],props:[{id:a,[Hy]:``},i]});return{portalNode:l,portalSubtree:s&&p?zy.createPortal(p,s):null}}var Wy=N.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=Uy({container:o,ref:t,componentProps:e,elementProps:c}),d=N.useRef(null),f=N.useRef(null),p=N.useRef(null),m=N.useRef(null),[h,g]=N.useState(null),_=N.useRef(!1),v=h?.modal,y=h?.open,b=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;N.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&fy(e)&&(e.type===`focusin`?_.current&&=(py(l),!1):(cne(l),_.current=!0))}return xv(bv(l,`focusin`,e,!0),bv(l,`focusout`,e,!0))},[l,v]),N.useEffect(()=>{!l||y!==!1||(py(l),_.current=!1)},[y,l]);let x=N.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,I.jsxs)(N.Fragment,{children:[u,(0,I.jsxs)(By.Provider,{value:x,children:[b&&l&&(0,I.jsx)(Av,{"data-type":`outside`,ref:d,onFocus:e=>{fy(e,l)?p.current?.focus():uy(h?h.domReference:null)?.focus()}}),b&&l&&(0,I.jsx)(`span`,{"aria-owns":l.id,style:Ry}),l&&zy.createPortal(a,l),b&&l&&(0,I.jsx)(Av,{"data-type":`outside`,ref:f,onFocus:e=>{fy(e,l)?m.current?.focus():(ly(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,vv(`focus-out`,e.nativeEvent)))}})]})]})});function Gy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Ky=class{nodesRef={current:[]};events=Gy();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qy=N.createContext(null),Jy=N.createContext(null),Yy=()=>N.useContext(qy)?.id||null,Xy=e=>{let t=N.useContext(Jy);return e??t};function Zy(e){let t=Py(),n=Xy(e),r=Yy();return th(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qy(e){let{children:t,id:n}=e,r=Yy();return(0,I.jsx)(qy.Provider,{value:N.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $y(e){let{children:t,externalTree:n}=e,r=Qm(()=>n??new Ky).current;return(0,I.jsx)(Jy.Provider,{value:r,children:t})}function eb(e){return e==null?e:`current`in e?e.current:e}function tb(e,t){let n=jm(ev(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var nb=20,rb=[];function ib(){rb=rb.filter(e=>e.deref()?.isConnected)}function ab(e){ib(),e&&Am(e)!==`body`&&(rb.push(new WeakRef(e)),rb.length>nb&&(rb=rb.slice(-20)))}function ob(){return ib(),rb[rb.length-1]?.deref()}function sb(e){return e?ay(e)?e:sy(e)[0]||e:null}function cb(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=oy(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ay(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function lb(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=eh(()=>b.current.floatingContext?.nodeId),S=i===!1,C=ov(_)&&S,w=N.useRef([`content`]),T=Sv(i),E=Sv(a),ee=Sv(l),D=Xy(p),O=Vy(),k=N.useRef(!1),te=N.useRef(!1),ne=N.useRef(!1),A=N.useRef(null),j=N.useRef(``),re=N.useRef(``),M=N.useRef(null),ie=N.useRef(null),ae=Sh(M,f,O?.beforeInsideRef),oe=Sh(ie,O?.afterInsideRef),se=A_(),ce=A_(),le=Ev(),ue=O!=null,de=cv(v),fe=eh((e=de)=>e?sy(e):[]),pe=eh(()=>m?.().filter(e=>e!=null)??[]);N.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&$_(de,Q_(Dv(de)))&&fe().length===0&&!C&&W_(e)}return bv(Dv(de),`keydown`,e)},[r,de,s,C,fe]),N.useEffect(()=>{if(r||!g)return;let e=Dv(de);function t(){ne.current=!1}function n(e){let t=ev(e),n=pe();ne.current=!($_(v,t)||$_(_,t)||$_(O?.portalNode,t)||n.some(e=>e===t||$_(e,t))),re.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}function i(){re.current=`keyboard`}return xv(bv(e,`pointerdown`,n,!0),bv(e,`pointerup`,t,!0),bv(e,`pointercancel`,t,!0),bv(e,`keydown`,i,!0))},[r,v,_,de,g,O,pe]),N.useEffect(()=>{if(r||!c)return;let e=Dv(de);function t(){te.current=!0,ce.start(0,()=>{te.current=!1})}function n(e){let t=ev(e);ay(t)&&(A.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=ev(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=pe(),f=n?.hasAttribute(gy(`focus-guard`))&&[M.current,ie.current,O?.beforeInsideRef.current,O?.afterInsideRef.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,eb(d),eb(u)].includes(n),p=!($_(_,n)||$_(v,n)||$_(n,v)||$_(O?.portalNode,n)||l.some(e=>e===n||$_(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>$_(e,n))||f||D&&(my(D.nodesRef.current,a).find(e=>$_(e.context?.elements.floating,n)||$_(e.context?.elements.domReference,n))||hy(D.nodesRef.current,a).find(e=>[e.context?.elements.floating,cv(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&de&&cb(de,w),o&&r!==_&&!Xv(i)&&Q_(e)===e.body){if(Fm(de)&&(de.focus(),o===`popup`)){le.request(()=>{de.focus()});return}let e=fe(),t=A.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||de;Fm(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!te.current&&(C||n!==ob())&&(k.current=!0,h.setOpen(!1,vv(gv,t)))})}function a(){ne.current||(b.current.insideReactTree=!0,se.start(0,()=>{b.current.insideReactTree=!1}))}let l=Fm(_)?_:null;if(!(!v&&!l))return xv(l&&bv(l,`focusout`,i),l&&bv(l,`pointerdown`,t),v&&bv(v,`focusin`,n),v&&bv(v,`focusout`,i),v&&O&&bv(v,`focusout`,a,!0))},[r,_,v,de,s,D,O,h,c,o,fe,C,x,w,b,se,ce,le,u,d,pe]),N.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(O?.portalNode?.querySelectorAll(`[${gy(`portal`)}]`)||[]),t=(D?hy(D.nodesRef.current,x()):[]).find(e=>ov(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ay([v,...e,M.current,ie.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,...pe(),t,eb(d),eb(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Ay([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,O,C,D,x,u,d,pe]),th(()=>{if(!g||r||!Fm(de))return;let e=Dv(de),t=Q_(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1||$_(de,t))return;let i=null,a=()=>(i??=fe(de),i[0]||de),o;o=r===!0||r===null?a():eb(r),o||=a();let s=$_(de,Q_(e));vy(o,{preventScroll:o===de,shouldFocus(){if(s)return!0;let t=Q_(e);return!(t!==o&&$_(de,t))}})})},[r,g,de,fe,T,ee]),th(()=>{if(r||!de)return;let e=Dv(de);ab(Q_(e));function t(e){if(e.open||(j.current=tb(e.nativeEvent,re.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(k.current=!0),e.reason===`outside-press`)if(e.nested)k.current=!1;else if(K_(e.nativeEvent)||q_(e.nativeEvent))k.current=!1;else{let e=!1;Dv(de).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?k.current=!1:k.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(j.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`)return _?.isConnected?_:ob()||null;let n=_?.isConnected?_:ob();return eb(t)||n||null}return()=>{y.off(`openchange`,t);let r=Q_(e),i=pe(),a=$_(v,r)||i.some(e=>e===r||$_(e,r))||D&&my(D.nodesRef.current,x(),!1).some(e=>$_(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=sb(s),n=typeof o!=`boolean`;o&&!k.current&&Fm(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),k.current=!1})}},[r,v,de,E,y,D,_,x,pe]),th(()=>{if(!F_||g||!v)return;let e=Q_(Dv(v));!Fm(e)||!iv(e)||$_(v,e)&&e.blur()},[g,v]),th(()=>{if(!(r||!O))return O.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{O.setFocusManagerState(null)}},[r,O,s,g,h,c,_]),th(()=>{if(!(r||!de))return cb(de,w),()=>{queueMicrotask(ib)}},[r,de,w]);let me=!r&&(s?!C:!0)&&(ue||s);return(0,I.jsxs)(N.Fragment,{children:[me&&(0,I.jsx)(Av,{"data-type":`inside`,ref:ae,onFocus:e=>{if(s){let e=fe();vy(e[e.length-1])}else O?.portalNode&&(k.current=!1,fy(e,O.portalNode)?ly(_)?.focus():eb(d??O.beforeOutsideRef)?.focus())}}),n,me&&(0,I.jsx)(Av,{"data-type":`inside`,ref:oe,onFocus:e=>{s?vy(fe()[0]):O?.portalNode&&(c&&(k.current=!0),fy(e,O.portalNode)?uy(_)?.focus():eb(u??O.afterOutsideRef)?.focus())}})]})}function ub(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=pv}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=N.useRef(void 0),f=Ev(),p=A_(),m=N.useMemo(()=>{function e(e,t,n,r){let i=vv(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||J_(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=ev(o);if(iv(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}J_(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return N.useMemo(()=>n?{reference:m}:jh,[n,m])}function db(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function fb(e){return e!=null&&e.clientX!=null}function pb(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=N.useRef(!1),u=N.useRef(null),[d,f]=N.useState(),[p,m]=N.useState([]),h=eh(e=>{i.set(`positionReference`,e)}),g=eh((e,t,n)=>{l.current||c.current.openEvent&&!fb(c.current.openEvent)||i.set(`positionReference`,db(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=eh(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=J_(d)?o:a;N.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=jm(o);function r(t){$_(o,ev(t))?e():g(t.clientX,t.clientY)}return!c.current.openEvent||fb(c.current.openEvent)?u.current=bv(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),N.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),N.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),N.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=N.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return N.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var mb={intentional:`onClick`,sloppy:`onPointerDown`};function hb(){return!1}function gb(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function _b(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=hb,referencePressEvent:s=`sloppy`,bubbles:c,externalTree:l}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=Xy(l),h=eh(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=eh(()=>a),{escapeKey:y,outsidePress:b}=gb(c),x=N.useRef(!1),S=N.useRef(!1),C=N.useRef(!1),w=N.useRef(!1),T=N.useRef(``),E=N.useRef(null),ee=A_(),D=A_(),O=eh(()=>{D.clear(),p.current.insideReactTree=!1}),k=eh(e=>{let t=p.current.floatingContext?.nodeId;return(m?my(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),te=eh(e=>nv(e,u.select(`floatingElement`))||nv(e,u.select(`domReferenceElement`))),ne=eh(e=>{o()&&u.setOpen(!1,vv(pv,e.nativeEvent))}),A=eh(e=>{if(!d||!n||!r||e.key!==`Escape`||w.current||!y&&k(`__escapeKeyBubbles`))return;let t=vv(zte,G_(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),j=eh(()=>{p.current.insideReactTree=!0,D.start(0,O)}),re=eh(e=>{if(!d||!n||e.button!==0)return;let t=ev(e.nativeEvent);$_(u.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),M=eh(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});N.useEffect(()=>{if(!d||!n)return;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new k_,t=new k_;function i(){e.clear(),w.current=!0}function a(){e.start(Hm()?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&my(m.nodesRef.current,t).some(t=>nv(e,t.context?.elements.floating));return te(e)||n}function D(e){if(l(e)){e.type!==`click`&&!te(e)&&(t.clear(),C.current=!1),O();return}if(p.current.insideReactTree){O();return}let n=ev(e),r=`[${gy(`inert`)}]`,i=Pm(n)?n.getRootNode():null,a=Array.from((Im(i)?i:Dv(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>$_(e,n))))return;let s=Pm(n)?n:null;for(;s&&!Um(s);){let e=Km(s);if(Um(e)||!Pm(e))break;s=e}if(!(a.length&&Pm(n)&&!rv(n)&&!$_(n,u.select(`floatingElement`))&&a.every(e=>!$_(s,e)))){if(Fm(n)&&!(`touches`in e)){let t=Um(n),r=Wm(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||k(`__outsidePressBubbles`)||(u.setOpen(!1,vv(Lte,e)),O())}}}function ne(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||te(e)||D(e)}function j(e){if(c()!==`sloppy`||!u.select(`open`)||!n||te(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ee.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function re(e,t){let n=ev(e);if(!n)return;let r=bv(n,e.type,()=>{t(e),r()})}function M(e){T.current=`touch`,re(e,j)}function ie(e){ee.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&re(e,e=>{e.type===`pointerdown`?ne(e):D(e)})}function ae(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,O())}}}function oe(e){if(c()!==`sloppy`||!E.current||te(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(D(e),ee.clear(),E.current=null)}function se(e){re(e,oe)}function ce(e){c()!==`sloppy`||!E.current||te(e)||(E.current.dismissOnTouchEnd&&D(e),ee.clear(),E.current=null)}function le(e){re(e,ce)}let ue=Dv(f),de=xv(r&&xv(bv(ue,`keydown`,A),bv(ue,`compositionstart`,i),bv(ue,`compositionend`,a)),_&&xv(bv(ue,`click`,ie,!0),bv(ue,`pointerdown`,ie,!0),bv(ue,`pointerup`,ae,!0),bv(ue,`pointercancel`,ae,!0),bv(ue,`mousedown`,ie,!0),bv(ue,`mouseup`,ae,!0),bv(ue,`touchstart`,M,!0),bv(ue,`touchmove`,se,!0),bv(ue,`touchend`,le,!0)));return()=>{de(),e.clear(),t.clear(),s(),C.current=!1}},[p,f,r,_,g,d,n,y,b,A,O,v,k,te,m,u,ee]),N.useEffect(O,[g,O]);let ie=N.useMemo(()=>({onKeyDown:A,[mb[s]]:ne,...s!==`intentional`&&{onClick:ne}}),[A,ne,s]),ae=N.useMemo(()=>({onKeyDown:A,onPointerDown:M,onMouseDown:M,onClickCapture:j,onMouseDownCapture(e){j(),re(e)},onPointerDownCapture(e){j(),re(e)},onMouseUpCapture:j,onTouchEndCapture:j,onTouchMoveCapture:j}),[A,j,re,M]);return N.useMemo(()=>n?{reference:ie,floating:ae,trigger:ie}:{},[n,ie,ae])}function vb(e,t,n){let{reference:r,floating:i}=e,a=Hv(t),o=Uv(t),s=Vv(o),c=Rv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(zv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function yb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lv(t,e),p=Jv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var bb=50,xb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<bb&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=vb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Sb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rv(r),_=Hv(o),v=Rv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qv(o)]:Jte(o)),x=p!==`none`;!d&&x&&b.push(...Qte(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qte(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Hv(t))||T.every(e=>Hv(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Cb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wb(e){return Gte.some(t=>e[t]>=0)}var Tb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Lv(e,t);switch(i){case`referenceHidden`:{let e=Cb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wb(e)}}}case`escaped`:{let e=Cb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wb(e)}}}default:return{}}}}},Eb=new Set([`left`,`top`]);async function Db(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rv(n),s=zv(n),c=Hv(n)===`y`,l=Eb.has(o)?-1:1,u=a&&c?-1:1,d=Lv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ob=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Db(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hv(Rv(i)),p=Bv(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Iv(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Iv(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ab=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lv(e,t),u={x:n,y:r},d=Hv(i),f=Bv(d),p=u[f],m=u[d],h=Lv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Eb.has(Rv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},jb=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Lv(e,t),u=await o.detectOverflow(t,l),d=Rv(i),f=zv(i),p=Hv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=jv(h-u[g],v),x=jv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Mv(u.left,0),t=Mv(u.right,0),n=Mv(u.top,0),r=Mv(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Mv(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Mv(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Mb(e){let t=Wm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Fm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nv(n)!==a||Nv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Nb(e){return Pm(e)?e:e.contextElement}function Pb(e){let t=Nb(e);if(!Fm(t))return Fv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Mb(t),o=(a?Nv(n.width):n.width)/r,s=(a?Nv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var lne=Fv(0);function Fb(e){let t=jm(e);return!Hm()||!t.visualViewport?lne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function une(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jm(e)?!1:t}function Ib(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Nb(e),o=Fv(1);t&&(r?Pm(r)&&(o=Pb(r)):o=Pb(e));let s=une(a,n,r)?Fb(a):Fv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=jm(a),t=r&&Pm(r)?jm(r):r,n=e,i=Ym(n);for(;i&&r&&t!==n;){let e=Pb(i),t=i.getBoundingClientRect(),r=Wm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=jm(i),i=Ym(n)}}return Yv({width:u,height:d,x:c,y:l})}function Lb(e,t){let n=Gm(e).scrollLeft;return t?t.left+n:Ib(Mm(e)).left+n}function Rb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lb(e,n),y:n.top+t.scrollTop}}function dne(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Mm(r),s=t?Rm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fv(1),u=Fv(0),d=Fm(r);if((d||!d&&!a)&&((Am(r)!==`body`||Lm(o))&&(c=Gm(r)),d)){let e=Ib(r);l=Pb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rb(o,c):Fv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function fne(e){return Array.from(e.getClientRects())}function pne(e){let t=Mm(e),n=Gm(e),r=e.ownerDocument.body,i=Mv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Mv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Lb(e),s=-n.scrollTop;return Wm(r).direction===`rtl`&&(o+=Mv(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var zb=25;function mne(e,t){let n=jm(e),r=Mm(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Hm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Lb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=zb&&(a-=o)}else l<=zb&&(a+=l);return{width:a,height:o,x:s,y:c}}function hne(e,t){let n=Ib(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fm(e)?Pb(e):Fv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Bb(e,t,n){let r;if(t===`viewport`)r=mne(e,n);else if(t===`document`)r=pne(Mm(e));else if(Pm(t))r=hne(t,n);else{let n=Fb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yv(r)}function Vb(e,t){let n=Km(e);return n===t||!Pm(n)||Um(n)?!1:Wm(n).position===`fixed`||Vb(n,t)}function gne(e,t){let n=t.get(e);if(n)return n;let r=Jm(e,[],!1).filter(e=>Pm(e)&&Am(e)!==`body`),i=null,a=Wm(e).position===`fixed`,o=a?Km(e):e;for(;Pm(o)&&!Um(o);){let t=Wm(o),n=Vm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Lm(o)&&!n&&Vb(e,o))?r=r.filter(e=>e!==o):i=t,o=Km(o)}return t.set(e,r),r}function _ne(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Rm(t)?[]:gne(t,this._c):[].concat(n),r],o=Bb(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Bb(t,a[e],i);s=Mv(n.top,s),c=jv(n.right,c),l=jv(n.bottom,l),u=Mv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vne(e){let{width:t,height:n}=Mb(e);return{width:t,height:n}}function yne(e,t,n){let r=Fm(t),i=Mm(t),a=n===`fixed`,o=Ib(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fv(0);function l(){c.x=Lb(i)}if(r||!r&&!a)if((Am(t)!==`body`||Lm(i))&&(s=Gm(t)),r){let e=Ib(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rb(i,s):Fv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Hb(e){return Wm(e).position===`static`}function Ub(e,t){if(!Fm(e)||Wm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Mm(e)===n&&(n=n.ownerDocument.body),n}function Wb(e,t){let n=jm(e);if(Rm(e))return n;if(!Fm(e)){let t=Km(e);for(;t&&!Um(t);){if(Pm(t)&&!Hb(t))return t;t=Km(t)}return n}let r=Ub(e,t);for(;r&&dee(r)&&Hb(r);)r=Ub(r,t);return r&&Um(r)&&Hb(r)&&!Vm(r)?n:r||mee(e)||n}var bne=async function(e){let t=this.getOffsetParent||Wb,n=this.getDimensions,r=await n(e.floating);return{reference:yne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xne(e){return Wm(e).direction===`rtl`}var Sne={convertOffsetParentRelativeRectToViewportRelativeRect:dne,getDocumentElement:Mm,getClippingRect:_ne,getOffsetParent:Wb,getElementRects:bne,getClientRects:fne,getDimensions:vne,getScale:Pb,isElement:Pm,isRTL:xne};function Gb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cne(e,t){let n=null,r,i=Mm(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Pv(d),h=Pv(i.clientWidth-(u+f)),g=Pv(i.clientHeight-(d+p)),_=Pv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Mv(0,jv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Gb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Kb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Nb(e),u=i||a?[...l?Jm(l):[],...t?Jm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Cne(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ib(e):null;c&&g();function g(){let t=Ib(e);h&&!Gb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wne=Ob,Tne=kb,Ene=Sb,Dne=jb,One=Tb,kne=Ab,Ane=(e,t,n)=>{let r=new Map,i={platform:Sne,...n},a={...i.platform,_c:r};return xb(e,t,{...i,platform:a})},qb=typeof document<`u`?N.useLayoutEffect:function(){};function Jb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Jb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Yb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xb(e,t){let n=Yb(e);return Math.round(t*n)/n}function Zb(e){let t=N.useRef(e);return qb(()=>{t.current=e}),t}function jne(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=N.useState(r);Jb(f,r)||p(r);let[m,h]=N.useState(null),[g,_]=N.useState(null),v=N.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=N.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=N.useRef(null),C=N.useRef(null),w=N.useRef(u),T=c!=null,E=Zb(c),ee=Zb(i),D=Zb(l),O=N.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),Ane(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!Jb(w.current,t)&&(w.current=t,zy.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);qb(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=N.useRef(!1);qb(()=>(k.current=!0,()=>{k.current=!1}),[]),qb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let te=N.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ne=N.useMemo(()=>({reference:b,floating:x}),[b,x]),A=N.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=Xb(ne.floating,u.x),r=Xb(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Yb(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:O,refs:te,elements:ne,floatingStyles:A}),[u,O,te,ne,A])}var Mne=(e,t)=>{let n=wne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nne=(e,t)=>{let n=Tne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pne=(e,t)=>({fn:kne(e).fn,options:[e,t]}),Fne=(e,t)=>{let n=Ene(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ine=(e,t)=>{let n=Dne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lne=(e,t)=>{let n=One(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qb=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(hh(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Rne=i((e=>{var t=Ke(),n=om();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),zne=i(((e,t)=>{t.exports=Rne()})),$b=om(),Bne=zne(),Vne=Oh(19)?Une:Wne;function ex(e,t,n,r,i){return Vne(e,t,n,r,i)}function Hne(e,t,n,r,i){let a=N.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$b.useSyncExternalStore)(e.subscribe,a,a)}jte({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,$b.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Une(e,t,n,r,i){let a=Ate();if(!a)return Hne(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function Wne(e,t,n,r,i){return(0,Bne.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gne=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ex(this,e,t,n,r)}},tx=class extends Gne{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){N.useDebugValue(e);let n=this;th(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;th(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;th(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){N.useDebugValue(e);let n=this,r=t!==void 0;th(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return N.useDebugValue(e),ex(this,this.selectors[e],t,n,r)}useContextCallback(e,t){N.useDebugValue(e);let n=eh(t??Ah);this.context[e]=n}useStateSetter(e){let t=N.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Kne={open:Qb(e=>e.open),transitionStatus:Qb(e=>e.transitionStatus),domReferenceElement:Qb(e=>e.domReferenceElement),referenceElement:Qb(e=>e.positionReference??e.referenceElement),floatingElement:Qb(e=>e.floatingElement),floatingId:Qb(e=>e.floatingId)},nx=class extends tx{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gy(),nested:n,triggerElements:i},Kne),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Y_(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function qne(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=N.useRef(null);r===void 0&&f.current===null&&(f.current=new nx({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),th(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Pm(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function rx(e,t=!1,n=!1){let[r,i]=N.useState(e&&t?`idle`:void 0),[a,o]=N.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),th(()=>{if(!e&&a&&r!==`ending`&&n){let e=Tv.request(()=>{i(`ending`)});return()=>{Tv.cancel(e)}}},[e,a,r,n]),th(()=>{if(!e||t)return;let n=Tv.request(()=>{i(void 0)});return()=>{Tv.cancel(n)}},[t,e]),th(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Tv.request(()=>{i(`idle`)});return()=>{Tv.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var ix=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Jne={[ix.startingStyle]:``},Yne={[ix.endingStyle]:``},ax={transitionStatus(e){return e===`starting`?Jne:e===`ending`?Yne:null}};function ox(e,t=!1,n=!0){let r=Ev();return eh((i,a=null)=>{r.cancel();let o=eb(e);if(o==null)return;let s=o,c=()=>{zy.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=ix.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function sx(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=eh(i),o=ox(r,n,!1);N.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var cx={tabIndex:-1,[X_]:``};function lx(e,t,n=!1){let r=Py(),i=Yy()!=null,a=N.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return qne({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function Xne(e,t){let n=N.useRef(null),r=N.useRef(null);return N.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function ux(e,t,n){let r=n?.id??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function dx(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Xne(e,n),o=eh(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return th(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function fx(e){let t=e.useState(`open`);th(()=>{if(!t){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let n=e.context.triggerElements.size,r={};if(e.state.triggerCount!==n&&(r.triggerCount=n),!e.select(`activeTriggerId`)&&n===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;r.activeTriggerId=e,r.activeTriggerElement=n}}(r.triggerCount!==void 0||r.activeTriggerId!==void 0)&&e.update(r)},[t,e,e.useState(`triggerCount`)])}function px(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=rx(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=eh(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),s=t.useState(`preventUnmountingOnClose`);return sx({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}function mx(e,t){e.useSyncedValues(t),th(()=>()=>{e.update({activeTriggerProps:jh,inactiveTriggerProps:jh,popupProps:jh})},[e])}function hx(e,t){th(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),th(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var gx=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Zne(){return new nx({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new gx,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function _x(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Zne(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:jh,inactiveTriggerProps:jh,popupProps:jh}}function vx(e,t,n=!1){return new nx({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var yx=Qb(e=>e.triggerIdProp??e.activeTriggerId),bx=Qb(e=>e.openProp??e.open),xx=Qb(e=>(e.popupElement?.id??e.floatingId)||void 0);function Sx(e,t){return t!==void 0&&bx(e)&&yx(e)===t}function Qne(e,t){return Sx(e,t)?!0:t!==void 0&&bx(e)&&yx(e)==null&&e.triggerCount===1}var Cx={open:bx,mounted:Qb(e=>e.mounted),transitionStatus:Qb(e=>e.transitionStatus),floatingRootContext:Qb(e=>e.floatingRootContext),triggerCount:Qb(e=>e.triggerCount),preventUnmountingOnClose:Qb(e=>e.preventUnmountingOnClose),payload:Qb(e=>e.payload),activeTriggerId:yx,activeTriggerElement:Qb(e=>e.mounted?e.activeTriggerElement:null),popupId:xx,isTriggerActive:Qb((e,t)=>t!==void 0&&yx(e)===t),isOpenedByTrigger:Qb((e,t)=>Sx(e,t)),isMountedByTrigger:Qb((e,t)=>t!==void 0&&yx(e)===t&&e.mounted),triggerProps:Qb((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Qb((e,t)=>Qne(e,t)?xx(e):void 0),popupProps:Qb(e=>e.popupProps),popupElement:Qb(e=>e.popupElement),positionerElement:Qb(e=>e.positionerElement)};function $ne(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Py(),a=Yy()!=null,o=Qm(()=>new nx({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new gx,floatingId:i,syncOnly:!1,nested:a})).current;return th(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Pm(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function ere(e={}){let{nodeId:t,externalTree:n}=e,r=$ne(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=N.useState(null),[f,p]=N.useState(void 0),[m,h]=N.useState(void 0),g=N.useRef(null),_=Xy(n),v=N.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=jne({...e,elements:{...v,...u&&{reference:u}}}),b=Pm(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=N.useCallback(e=>{let t=Pm(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=N.useCallback(e=>{(Pm(e)||e===null)&&(g.current=e,p(e)),(Pm(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!Pm(e))&&y.refs.setReference(e)},[y.refs,p]),w=N.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=N.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=N.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),ee=N.useMemo(()=>({...y,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return th(()=>{s&&(g.current=s)},[s]),th(()=>{i.context.dataRef.current.floatingContext=ee;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=ee)}),N.useMemo(()=>({...y,context:ee,refs:T,elements:E,rootStore:i}),[y,T,E,ee,i])}var wx=z_&&L_;function tre(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=N.useRef(!1),c=N.useRef(null),l=N.useRef(!0),u=A_();N.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=jm(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&Fm(e)&&e===Q_(Dv(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return xv(bv(t,`blur`,r),wx&&bv(t,`keydown`,a,!0),wx&&bv(t,`pointerdown`,o,!0))},[i,n]),N.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Pm(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=N.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=ev(t.nativeEvent);if(Pm(a)){if(wx&&!t.relatedTarget){if(!l.current&&!iv(a))return}else if(!sv(a))return}let o=tv(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,vv(hv,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,vv(hv,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Pm(n)&&n.hasAttribute(gy(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Q_(Dv(e));!n&&t===e||$_(o.current.floatingContext?.refs.floating.current,t)||$_(e,t)||a||tv(n??t,i.context.triggerElements)||i.setOpen(!1,vv(hv,r))})}}},[o,r,i,u]);return N.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var nre=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new k_,this.restTimeout=new k_,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Tx=new WeakMap;function Ex(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Tx.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Tx.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Dx(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Tx.get(n);a&&a!==e&&Ex(a),Ex(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Tx.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ox(e){let t=e.context.dataRef.current,n=Qm(()=>t.hoverInteractionState??nre.create()).current;return t.hoverInteractionState||=n,D_(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function kx(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Xy(),d=Yy(),f=Ox(a),p=A_(),m=eh(()=>dv(l.current.openEvent?.type,f.interactedInside)),h=eh(()=>Ite(l.current.openEvent?.type)),g=eh(()=>{Ex(f)});th(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),N.useEffect(()=>g,[g]),th(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&Pm(c)&&s){let e=c,t=s,n=Dv(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r;return Dx(f,{scopeElement:f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),N.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&my(u.nodesRef.current,d).length>0)}function t(e){let t=lv(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,vv(mv,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=ev(e);if(!av(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,_),g()}function h(n){if(e()&&u){u.events.on(`floating.closed`,_);return}if(tv(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&Pm(o)&&my(u.nodesRef.current,r,!1).some(e=>$_(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),m()||t(n)}}function _(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,_),a.setOpen(!1,vv(mv,t)),u.events.emit(`floating.closed`,t)})}let v=s;return xv(v&&bv(v,`mouseenter`,c),v&&bv(v,`mouseleave`,h),v&&bv(v,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,_)})},[n,s,a,l,r,i,m,g,f,u,d,p])}var rre={current:null};function Ax(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=rre,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p}=t,m=`rootStore`in e?e.rootStore:e,{dataRef:h,events:g}=m.context,_=Xy(l),v=Ox(m),y=N.useRef(!1),b=Sv(i),x=Sv(r),S=Sv(o),C=Sv(n),w=Sv(p),T=Sv(f),E=eh(()=>dv(h.current.openEvent?.type,v.interactedInside)),ee=eh(()=>w.current?.()!==!1),D=eh((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!$_(e,t);if(!Pm(n))return!1;let i=n;return r.hasMatchingElement(e=>$_(e,i))&&(!e||!$_(e,i))}),O=eh(()=>{v.handler&&=(Dv(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),k=eh(()=>{Ex(v)});return u&&(v.handleCloseOptions=b.current?.__options),N.useEffect(()=>O,[O]),N.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===mv,O(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,O]),N.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=lv(x.current,`close`,v.pointerType);n?v.openChangeTimeout.start(n,()=>{m.setOpen(!1,vv(mv,e)),_?.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,vv(mv,e)),_?.events.emit(`floating.closed`,e))}let t=c.current??(u?m.select(`domReferenceElement`):null);if(!Pm(t))return;function r(e){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!J_(v.pointerType))return;let t=uv(S.current),n=lv(x.current,`open`,v.pointerType),r=ev(e),i=e.currentTarget??null,o=m.select(`domReferenceElement`),s=i;if(Pm(r)&&!m.context.triggerElements.hasElement(r)){for(let e of m.context.triggerElements.elements())if($_(e,r)){s=e;break}}Pm(i)&&Pm(o)&&!m.context.triggerElements.hasElement(i)&&$_(i,o)&&(s=o);let c=s==null?!1:D(o,s,r),l=m.select(`open`),u=T.current?.()??m.select(`transitionStatus`)===`ending`,d=!l&&u&&y.current,f=!c&&Pm(s)&&Pm(o)&&$_(o,s)&&d,p=t>0&&!n,h=c&&(l||d)||f,g=!l||c;if(h){ee()&&m.setOpen(!0,vv(mv,e,s));return}p||(n?v.openChangeTimeout.start(n,()=>{g&&ee()&&m.setOpen(!0,vv(mv,e,s))}):g&&ee()&&m.setOpen(!0,vv(mv,e,s)))}function i(t){if(E()){k();return}O();let n=Dv(m.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let r=h.current.floatingContext??d?.();if(!tv(t.relatedTarget,m.context.triggerElements)){if(b.current&&r){m.select(`open`)||v.openChangeTimeout.clear();let i=c.current;v.handler=b.current({...r,tree:_,x:t.clientX,y:t.clientY,onClose(){k(),O(),C.current&&!E()&&i===m.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,v.handler),v.handler(t);return}(v.pointerType!==`touch`||!$_(m.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?xv(bv(t,`mousemove`,r,{once:!0}),bv(t,`mouseenter`,r),bv(t,`mouseleave`,i)):xv(bv(t,`mouseenter`,r),bv(t,`mouseleave`,i))},[O,k,h,x,m,n,b,v,u,D,E,a,s,S,c,_,C,d,T,ee]),N.useMemo(()=>{if(!n)return;function e(e){v.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=m.select(`domReferenceElement`),i=m.select(`open`),o=D(r,n,e.target);if(a&&!J_(v.pointerType))return;if(i&&o&&v.handleCloseOptions?.blockPointerEvents){let e=m.select(`floatingElement`);e&&Dx(v,{scopeElement:v.handleCloseOptions?.getScope?.()??n.ownerDocument.body,referenceElement:n,floatingElement:e})}let s=uv(S.current);if(i&&!o||s===0||!o&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;v.restTimeout.clear();function c(){if(v.restTimeoutPending=!1,E())return;let e=m.select(`open`);!v.blockMouseMove&&(!e||o)&&ee()&&m.setOpen(!0,vv(mv,t,n))}v.pointerType===`touch`?zy.flushSync(()=>{c()}):o&&i?c():(v.restTimeoutPending=!0,v.restTimeout.start(s,c))}}},[n,v,E,D,a,m,S,ee])}var jx=.1,ire=jx*jx,Mx=.5;function Nx(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Px(e,t,n,r,i,a,o,s,c,l){let u=!1;return Nx(e,t,n,r,i,a)&&(u=!u),Nx(e,t,i,a,o,s)&&(u=!u),Nx(e,t,o,s,c,l)&&(u=!u),Nx(e,t,c,l,n,r)&&(u=!u),u}function Fx(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ix(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Lx(e={}){let{blockPointerEvents:t=!1}=e,n=new k_,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*ire;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ev(r),g=r.type===`mouseleave`,_=$_(u,h),v=$_(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Pm(r.relatedTarget)&&$_(u,r.relatedTarget))return;function y(){return!!(s&&my(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,ee=(T?x:S).left,D=(T?x:S).right,O=(E?x:S).top,k=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let te=!1;switch(c){case`top`:te=Ix(d,f,ee,x.top+1,D,S.bottom-1);break;case`bottom`:te=Ix(d,f,ee,S.top+1,D,x.bottom-1);break;case`left`:te=Ix(d,f,S.right-1,k,x.left+1,O);break;case`right`:te=Ix(d,f,x.right-1,k,S.left+1,O);break;default:}if(te)return;if(l&&!Fx(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let ne=!1;switch(c){case`top`:{let n=T?Mx/2:Mx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Mx+1,o=C||T?S.bottom-Mx:S.top,s=C?T?S.bottom-Mx:S.top:S.bottom-Mx;ne=Px(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Mx/2:Mx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Mx,o=C||T?S.top+Mx:S.bottom,s=C?T?S.top+Mx:S.bottom:S.top+Mx;ne=Px(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Mx/2:Mx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Mx+1,o=w||E?S.right-Mx:S.left,s=w?E?S.right-Mx:S.left:S.right-Mx;ne=Px(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Mx/2:Mx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Mx,o=w||E?S.left+Mx:S.right,s=w?E?S.left+Mx:S.right:S.left+Mx;ne=Px(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}ne?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Rx={...Cx,disabled:Qb(e=>e.disabled),instantType:Qb(e=>e.instantType),isInstantPhase:Qb(e=>e.isInstantPhase),trackCursorAxis:Qb(e=>e.trackCursorAxis),disableHoverablePopup:Qb(e=>e.disableHoverablePopup),lastOpenChangeReason:Qb(e=>e.openChangeReason),closeOnClick:Qb(e=>e.closeOnClick),closeDelay:Qb(e=>e.closeDelay),hasViewport:Qb(e=>e.hasViewport)},zx=class e extends tx{constructor(e,t,n=!1){let r=new gx,i={...Bx(),...e};i.floatingRootContext=vx(r,t,n),super(i,{popupRef:N.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Rx)}setOpen=(e,t)=>{let n=t.reason,r=n===mv,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0),ux(r,e,t.trigger),this.update(r)};r?zy.flushSync(o):o()};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,vv(pv,e))}static useStore(t,n){return lx(t,(t,r)=>new e(n,t,r)).store}};function Bx(){return{..._x(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Vx=C_(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zx.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});w_(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),p.useSyncedValue(`disabled`,t),fx(p);let{forceUnmount:y,transitionStatus:b}=px(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=N.useRef(null);th(()=>{m&&t&&p.setOpen(!1,vv(Bte))},[m,t,p]),th(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),th(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=N.useCallback(()=>{p.setOpen(!1,vv(_v))},[p]);N.useImperativeHandle(o,()=>({unmount:y,close:T}),[y,T]);let E=h||_||!t&&a!==`none`;return(0,I.jsxs)(T_.Provider,{value:p,children:[E&&(0,I.jsx)(Hx,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Hx({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=_b(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=pb(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return mx(e,{activeTriggerProps:N.useMemo(()=>ih(a.reference,i.reference),[a.reference,i.reference]),inactiveTriggerProps:N.useMemo(()=>ih(a.trigger,i.trigger),[a.trigger,i.trigger]),popupProps:N.useMemo(()=>ih(cx,a.floating,i.floating),[a.floating,i.floating])}),null}var Ux=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=ix.startingStyle]=`startingStyle`,e[e.endingStyle=ix.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Wx=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Gx={[Wx.popupOpen]:``},Kx={[Wx.popupOpen]:``,[Wx.pressed]:``},qx={[Ux.open]:``},Jx={[Ux.closed]:``},Yx={[Ux.anchorHidden]:``},Xx={open(e){return e?Gx:null}},Zx={open(e){return e?Kx:null}},Qx={open(e){return e?qx:Jx},anchorHidden(e){return e?Yx:null}};function $x(e){return Py(e,`base-ui`)}var eS=N.createContext(void 0);function tS(){return N.useContext(eS)}var nS=function(e){return e[e.popupOpen=Wx.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),rS=`data-base-ui-tooltip-trigger`;function iS(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Pm(n))return n}}let t=e.target;return Pm(t)?t:null}function aS(e){let t=e;for(;t;){if(t.hasAttribute(rS))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&Pm(n.host)?n.host:null}return null}var oS=Mte(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=E_(!0),m=a?.store??p;if(!m)throw Error(hh(82));let h=$x(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=N.useRef(null),b=c??600,x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=dx(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=tS(),{delayRef:T,isInstantPhase:E,hasProvider:ee}=Hte(v,{open:_}),D=Ox(v);m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=s??O,te=Sv(k),ne=m.useState(`trackCursorAxis`),A=m.useState(`disableHoverablePopup`),j=N.useRef(!1),re=A_(),M=N.useRef(void 0);function ie(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return ee&&(n=t===0?0:c??e??b),n}function ae(e){let t=y.current;if(!t||!e)return!1;let n=aS(e);return n!==null&&n!==t&&$_(t,n)}function oe(e){let t=ae(e);return j.current=t,t&&(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1,re.clear()),t}let se=Ax(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!A&&ne!==`both`?Lx():null,restMs:ie,delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return u==null&&ee&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!j.current}}),ce=tre(v,{enabled:!k}).reference,le=e=>{let t=j.current,n=iS(e),r=oe(n),i=y.current,a=i&&n&&$_(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,vv(mv,e));return}if(t&&!r&&a&&!te.current&&!m.select(`open`)&&i&&J_(M.current)){let t=()=>{!j.current&&!te.current&&!m.select(`open`)&&m.setOpen(!0,vv(mv,e,i))},n=ie();n===0?(re.clear(),t()):re.start(n,t)}},ue=m.useState(`triggerProps`,C);return Nh(`button`,e,{state:{open:_},ref:[t,S,y],props:[se,ce,C||ne!==`none`?ue:void 0,{onMouseOver(e){le(e.nativeEvent)},onFocus(e){ae(iS(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){j.current=!1,re.clear(),M.current=void 0},onPointerEnter(e){M.current=e.pointerType},onPointerDown(e){M.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[nS.triggerDisabled]:k?``:void 0,[rS]:k?void 0:``},f],stateAttributesMapping:Xx})}),sS=N.createContext(void 0);function cS(){let e=N.useContext(sS);if(e===void 0)throw Error(hh(70));return e}var lS=N.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=Uy({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,I.jsxs)(N.Fragment,{children:[l,c&&zy.createPortal(n,c)]})}),uS=N.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return E_().useState(`mounted`)||n?(0,I.jsx)(sS.Provider,{value:n,children:(0,I.jsx)(lS,{ref:t,...r})}):null}),dS=N.createContext(void 0);function fS(){let e=N.useContext(dS);if(e===void 0)throw Error(hh(71));return e}var pS=N.createContext(void 0);function mS(){return N.useContext(pS)?.direction??`ltr`}var hS=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Lv(e,t)||{};if(l==null)return{};let f=Jv(u),p={x:n,y:r},m=Uv(i),h=Vv(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,ee=Math.min(f[v],E),D=Math.min(f[y],E),O=ee,k=w-g[h]-D,te=w/2-g[h]/2+T,ne=Iv(O,te,k),A=!c.arrow&&zv(i)!=null&&te!==ne&&a.reference[h]/2-(te<O?ee:D)-g[h]/2<0,j=A?te<O?te-O:te-k:0;return{[m]:p[m]+j,data:{[m]:ne,centerOffset:te-ne-j,...A&&{alignmentOffset:j}},reset:A}}}),gS=(e,t)=>({...hS(e),options:[e,t]}),_S={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Lne().fn(e)).data?.referenceHidden||a}}}},vS={sideX:`left`,sideY:`top`},yS={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=jm(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:vS};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Dv(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Rv(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:vS.sideX,g=f===`top`?`bottom`:vS.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function bS(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function xS(e,t,n){let{rects:r,placement:i}=e;return{side:bS(t,Rv(i),n),align:zv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function SS(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,inline:f,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=N.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,ee=typeof t==`function`?t:void 0,D=eh(ee),O=ee?D:t,k=Sv(t),te=Sv(h),ne=mS()===`rtl`,A=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":ne?`left`:`right`,"inline-start":ne?`right`:`left`}[r],j=a===`center`?A:`${A}-${a}`,re=c,M=+(r===`bottom`),ie=+(r===`top`),ae=+(r===`right`),oe=+(r===`left`);typeof re==`number`?re={top:re+M,right:re+oe,bottom:re+ie,left:re+ae}:re&&={top:(re.top||0)+M,right:(re.right||0)+oe,bottom:(re.bottom||0)+ie,left:(re.left||0)+ae};let se={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:re},ce=N.useRef(null),le=Sv(i),ue=Sv(o),de=typeof i==`function`?0:i,fe=typeof o==`function`?0:o,pe=[];f&&pe.push(f),pe.push(Mne(e=>{let t=xS(e,r,ne),n=typeof le.current==`function`?le.current(t):le.current,i=typeof ue.current==`function`?ue.current(t):ue.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[de,fe,ne,r]));let me=T===`none`&&w!==`shift`,he=!me&&(l||_||w===`shift`),ge=w===`none`?null:Fne({...se,padding:{top:re.top+1,right:re.right+1,bottom:re.bottom+1,left:re.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),_e=me?null:Nne(e=>{let t=Dv(e.elements.floating).documentElement;return{...se,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:he,limiter:l||_?void 0:Pne(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=Hv(Rv(e.placement)),i=r===`y`?t:n,a=r===`y`?re.left+re.right:re.top+re.bottom;return{offset:i/2+a/2}})}},[se,l,_,re,T]);w===`shift`||T===`shift`||a===`center`?pe.push(_e,ge):pe.push(ge,_e),pe.push(Ine({...se,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!te.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=jm(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),gS(e=>({element:ce.current||Dv(e.elements.floating).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Rv(a),l=Hv(c),u=ce.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(xS(e,r,ne)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,he&&l===`y`&&b?S:x),{}}},_S,y),th(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,m]);let ve=N.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ye,elements:be,x:xe,y:Se,middlewareData:Ce,update:we,placement:Te,context:Ee,isPositioned:De,floatingStyles:Oe}=ere({rootContext:m,open:p?h:void 0,placement:j,middleware:pe,strategy:n,whileElementsMounted:p?void 0:(...e)=>Kb(...e,ve),nodeId:v,externalTree:x}),{sideX:ke,sideY:Ae}=Ce.adaptiveOrigin||vS,je=De?n:`fixed`,Me=N.useMemo(()=>{let e=y?{position:je,[ke]:xe,[Ae]:Se}:{position:je,...Oe};return De||(e.opacity=0),e},[y,je,ke,xe,Ae,Se,Oe,De]),Ne=N.useRef(null);th(()=>{if(!h)return;let e=k.current,t=typeof e==`function`?e():e,n=(CS(t)?t.current:t)||null;n!==Ne.current&&(ye.setPositionReference(n),Ne.current=n)},[h,ye,O,k]),N.useEffect(()=>{if(!h)return;let e=k.current;typeof e!=`function`&&CS(e)&&e.current!==Ne.current&&(ye.setPositionReference(e.current),Ne.current=e.current)},[h,ye,O,k]),N.useEffect(()=>{if(p&&h&&be.domReference&&be.floating)return Kb(be.domReference,be.floating,we,ve)},[p,h,be,we,ve]);let Pe=Rv(Te),Fe=bS(r,Pe,ne),Ie=zv(Te)||`center`,Le=!!Ce.hide?.referenceHidden;th(()=>{b&&h&&De&&C(Pe)},[b,h,De,Pe]);let Re=N.useMemo(()=>({position:`absolute`,top:Ce.arrow?.y,left:Ce.arrow?.x}),[Ce.arrow]),ze=Ce.arrow?.centerOffset!==0;return N.useMemo(()=>({positionerStyles:Me,arrowStyles:Re,arrowRef:ce,arrowUncentered:ze,side:Fe,align:Ie,physicalSide:Pe,anchorHidden:Le,refs:ye,context:Ee,isPositioned:De,update:we}),[Me,Re,ce,ze,Fe,Ie,Pe,Le,ye,Ee,De,we])}function CS(e){return e!=null&&`current`in e}function wS(e){return e===`starting`?Fy:jh}function TS(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Nh(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},wS(r),i],stateAttributesMapping:Qx})}var ES=N.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ly,style:g,..._}=e,v=E_(),y=cS(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),ee=SS({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?yS:void 0}),D=TS(e,N.useMemo(()=>({open:b,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,ee.side,ee.align,ee.anchorHidden,S,T]),{styles:ee.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,I.jsx)(dS.Provider,{value:ee,children:D})}),DS={...Qx,...ax},OS=N.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=E_(),{side:s,align:c}=fS(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);sx({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),kx(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Nh(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,wS(d),a],stateAttributesMapping:DS})}),kS=N.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=E_(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=fS();return Nh(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Qx})}),AS=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=N.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=N.useMemo(()=>({open:t,close:n}),[t,n]);return(0,I.jsx)(eS.Provider,{value:i,children:(0,I.jsx)(Vte,{delay:a,timeoutMs:r,children:e.children})})};function jS(e){return Oh(19)?e:e?`true`:void 0}function MS({delay:e=0,...t}){return(0,I.jsx)(AS,{"data-slot":`tooltip-provider`,delay:e,...t})}function NS({...e}){return(0,I.jsx)(Vx,{"data-slot":`tooltip`,...e})}function PS({...e}){return(0,I.jsx)(oS,{"data-slot":`tooltip-trigger`,...e})}function FS({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,I.jsx)(uS,{children:(0,I.jsx)(ES,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,I.jsxs)(OS,{"data-slot":`tooltip-content`,className:Kg(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,I.jsx)(kS,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var IS={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},LS={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},RS={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},zS=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],BS=[12288,12288,65281,65376,65504,65510],VS=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HS=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],US=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],WS=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},GS=19968,[KS,qS]=JS(US);function JS(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(GS>=i&&GS<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var YS=e=>e<161||e>1114109?!1:WS(zS,e),XS=e=>e<12288||e>65510?!1:WS(BS,e),ZS=e=>e<8361||e>65518?!1:WS(VS,e),QS=e=>e<32||e>10630?!1:WS(HS,e),$S=e=>e>=KS&&e<=qS?!0:e<4352||e>262141?!1:WS(US,e);function eC(e){return YS(e)?`ambiguous`:XS(e)?`fullwidth`:ZS(e)?`halfwidth`:QS(e)?`narrow`:$S(e)?`wide`:`neutral`}function tC(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function nC(e){return tC(e),eC(e)}function rC(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function iC(e){if(!e||e<4352)return!1;switch(nC(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!rC(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999?null:!1;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function aC(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function oC(e){return e!==null&&e>=65024&&e<=65038}var sC=lC(/\p{P}|\p{S}/u),cC=lC(/\s/);function lC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function uC(e){return!!(e&LS.characterGroupWhitespace)}function dC(e){return(e&AC.cjkPunctuation)===LS.characterGroupPunctuation}function fC(e){return!!(e&AC.cjk)}function pC(e){return e===AC.ivs}function mC(e){return!!(e&AC.cjkOrIvs)}function hC(e){return e===AC.nonEmojiGeneralUseVS}function gC(e){return!!(e&AC.spaceOrPunctuation)}var _C=kC(/[A-Za-z]/),vC=kC(/[\dA-Za-z]/),yC=kC(/[#-'*+\--9=?A-Z^-~]/);function bC(e){return e!==null&&(e<32||e===127)}var xC=kC(/\d/),SC=kC(/[\dA-Fa-f]/),CC=kC(/[!-/:-@[-`{-~]/);function wC(e){return e!==null&&e<-2}function TC(e){return e!==null&&(e<0||e===32)}function EC(e){return e===-2||e===-1||e===32}var DC=kC(/\p{P}|\p{S}/u),OC=kC(/\s/);function kC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var AC;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(AC||={});function jC(e){if(e===IS.eof||TC(e)||cC(e))return LS.characterGroupWhitespace;let t=0;if(e>=4352){if(oC(e))return AC.nonEmojiGeneralUseVS;switch(iC(e)){case null:return AC.ivs;case!0:t|=AC.cjk;break}}return sC(e)&&(t|=LS.characterGroupPunctuation),t}function MC(e,t,n){if(!hC(e))return e;let r=t(),i=jC(r);return!r||uC(i)?e:aC(r,n)?AC.cjkPunctuation:NC(i)}function NC(e){return e&~AC.ivs}function PC(e){return!!(e&&e>=55296&&e<=56319)}function FC(e){return!!(e&&e>=56320&&e<=57343)}function IC(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function LC(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var RC=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=LC(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function zC(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function BC(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function VC(e,t){return e.length>0?(BC(e,e.length,0,t),e):t}function HC(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var UC={name:`attention`,resolveAll:are,tokenize:ore};function are(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};WC(d,-c),WC(f,c),o={type:c>1?RS.strongSequence:RS.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?RS.strongSequence:RS.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?RS.strongText:RS.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?RS.strong:RS.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=VC(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=VC(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=VC(l,HC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=VC(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=VC(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,BC(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ore(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=FC(a)?IC(a,r(),i):a,s=jC(o),c=new RC(o,r(),i),l=MC(s,c.value.bind(c),o),u;return d;function d(t){return t===IS.asterisk||IS.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=jC(PC(a)?zC(a,r(),i):a),d=dC(l),p=d||uC(l),m=dC(c),h=m||uC(c),g=mC(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||fC(c))||n.includes(o);return s._open=!!(u===IS.asterisk?_:_&&(gC(l)||!v)),s._close=!!(u===IS.asterisk?v:v&&(gC(c)||!_)),t(a)}}function WC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function sre(){return{text:{[IS.asterisk]:UC,[IS.underscore]:UC},insideSpan:{null:[UC]}}}function cre(){let e=this.data();(e.micromarkExtensions||=[]).push(sre())}function lre(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[IS.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[IS.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&BC(o,o.length,0,HC(s,e.slice(r+1,n),t)),BC(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),BC(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=RS.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=FC(o)?IC(o,i(),a):o,c=jC(s),l=new RC(s,i(),a),u=MC(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return IS.tilde,s===IS.tilde&&d[d.length-1][1].type!==RS.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=jC(s);if(o===IS.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=jC(PC(o)?zC(o,i(),a):o),p=dC(u)||uC(u),h=dC(d)||uC(d),g=fC(u)||pC(c);return l._open=!h||d===LS.attentionSideAfter&&(p||g),l._close=!p||c===LS.attentionSideAfter&&(h||fC(d)),n(o)}}}function ure(e){let t=this.data();(t.micromarkExtensions||=[]).push(lre(e))}var GC=(function(e){if(e==null)return mre;if(typeof e==`function`)return KC(e);if(typeof e==`object`)return Array.isArray(e)?dre(e):fre(e);if(typeof e==`string`)return pre(e);throw Error(`Expected function, string, or object as test`)});function dre(e){let t=[],n=-1;for(;++n<e.length;)t[n]=GC(e[n]);return KC(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fre(e){let t=e;return KC(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pre(e){return KC(t);function t(t){return t&&t.type===e}}function KC(e){return t;function t(t,n,r){return!!(hre(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function mre(){return!0}function hre(e){return typeof e==`object`&&!!e&&`type`in e}function gre(e){return e}var qC=[],JC=`skip`;function YC(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=GC(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+gre(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=qC,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=_re(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function _re(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?qC:[e]}function XC(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),YC(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var vre=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),yre=/^(https?:\/\/|mailto:|www\.)/i,bre=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},xre=e=>{let t=0;for(let n of e){if(vre.has(n))return t;t+=n.length}return null},Sre=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Cre=e=>({type:`text`,value:e}),wre=()=>e=>{XC(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!bre(e)||!yre.test(e.url))return;let r=xre(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=Sre(i,e),s=Cre(a);return n.children.splice(t,1,o,s),t+1})};function Tre(){let e=[cre],t=[wre,ure];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var ZC=Tre(),QC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ere(e){return $C(e)}function $C(e){return Array.isArray(e)?Dre(e):e instanceof RegExp?e:typeof e==`object`?Ore(e):e}function Dre(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=$C(e[n]);return t}function Ore(e){let t={};for(let n in e)t[n]=$C(e[n]);return t}function ew(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function tw(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?tw(e.substring(0,e.length-1)):e.substr(~t+1)}var nw=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,rw=class{static hasCaptures(e){return e===null?!1:(nw.lastIndex=0,nw.test(e))}static replaceCaptures(e,t,n){return e.replace(nw,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function iw(e,t){return e<t?-1:+(e>t)}function aw(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=iw(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function ow(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function sw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var cw=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},lw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(jre(e),t)}static createFromParsedTheme(e,t){return Nre(e,t)}_cachedMatchRoot=new cw(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>kre(e.parent,t.parentScopes));return n?new dw(n.fontStyle,n.foreground,n.background):null}},uw=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function kre(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Are(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Are(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var dw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function jre(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&ow(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&ow(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Mre(l,u,e,o,s,c)}}return n}var Mre=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},fw=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(fw||{});function Nre(e,t){e.sort((e,t)=>{let n=iw(e.scope,t.scope);return n!==0||(n=aw(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Pre(t),o=new dw(n,a.getId(r),a.getId(i)),s=new Ire(new pw(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new lw(a,o,s)}var Pre=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Fre=Object.freeze([]),pw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Fre,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Ire=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pw.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(aw(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pw(e,t,n,r,i))}},mw=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Rre(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Lre(e){return e}function Rre(e){return e}function hw(e,t){let n=[],r=zre(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(gw(i)){let e=[];do e.push(i),i=r.next();while(gw(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function gw(e){return!!e&&!!e.match(/[\w\.:]+/)}function zre(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function _w(e){typeof e.dispose==`function`&&e.dispose()}var vw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Bre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vre=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Hre=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Vre;for(let n of e)Ure(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof vw){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ure(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof vw?bw({baseGrammar:a,selfGrammar:i},r):yw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new vw(e))}function yw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];xw([r],t,n)}}function bw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&xw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&xw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function xw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ew({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&xw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Sw(i);switch(a.kind){case 0:bw({...t,selfGrammar:t.baseGrammar},n);break;case 1:bw(t,n);break;case 2:yw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?yw(a.ruleName,i,n):bw(i,n)}else a.kind===4?n.add(new Bre(a.scopeName,a.ruleName)):n.add(new vw(a.scopeName));break}}}var Wre=class{kind=0},Gre=class{kind=1},Kre=class{constructor(e){this.ruleName=e}kind=2},qre=class{constructor(e){this.scopeName=e}kind=3},Jre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Sw(e){if(e===`$base`)return new Wre;if(e===`$self`)return new Gre;let t=e.indexOf(`#`);return t===-1?new qre(e):t===0?new Kre(e.substring(1)):new Jre(e.substring(0,t),e.substring(t+1))}var Yre=/\\(\d+)/,Cw=/\\(\d+)/g,Xre=-1,ww=-2;function Tw(e){return e}function Ew(e){return e}var Dw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=rw.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=rw.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${tw(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:rw.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:rw.replaceCaptures(this._contentName,e,t)}},Zre=class extends Dw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Qre=class extends Dw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Mw(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ow=class extends Dw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},kw=class extends Dw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Mw(i,this.id),this.beginCaptures=a,this._end=new Mw(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nw;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Aw=class extends Dw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Mw(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Mw(o,ww),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nw;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Nw,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},jw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Zre(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Qre(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ew({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Ow(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Aw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new kw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Sw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Ow||e instanceof kw||e instanceof Aw)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Mw=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Yre.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Cw.lastIndex=0,this.source.replace(Cw,(e,t)=>sw(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Nw=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Pw(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Pw(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Pw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
187
|
+
`}};rm.CHUNK_MAX_BYTES=18e5,qp.STREAM_RESUME_NONE;var im=i(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n})),am=i((e=>{var t=Ke();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),om=i(((e,t)=>{t.exports=am()})),eee=e(im(),1),sm=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},cm=(e,t,n)=>(sm(e,t,`read from private field`),n?n.call(e):t.get(e)),lm=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},um=(e,t,n,r)=>(sm(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function tee(e,t){return t==null?e:(0,eee.default)(e,t)}var dm,fm,pm,mm,hm,gm,_m,vm,ym,nee=class{constructor(e=[]){lm(this,dm,void 0),lm(this,fm,`ready`),lm(this,pm,void 0),lm(this,mm,new Set),lm(this,hm,new Set),lm(this,gm,new Set),this.pushMessage=e=>{um(this,dm,cm(this,dm).concat(e)),cm(this,_m).call(this)},this.popMessage=()=>{um(this,dm,cm(this,dm).slice(0,-1)),cm(this,_m).call(this)},this.replaceMessage=(e,t)=>{um(this,dm,[...cm(this,dm).slice(0,e),this.snapshot(t),...cm(this,dm).slice(e+1)]),cm(this,_m).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?tee(e,t):e;return cm(this,mm).add(n),()=>{cm(this,mm).delete(n)}},this[`~registerStatusCallback`]=e=>(cm(this,hm).add(e),()=>{cm(this,hm).delete(e)}),this[`~registerErrorCallback`]=e=>(cm(this,gm).add(e),()=>{cm(this,gm).delete(e)}),lm(this,_m,()=>{cm(this,mm).forEach(e=>e())}),lm(this,vm,()=>{cm(this,hm).forEach(e=>e())}),lm(this,ym,()=>{cm(this,gm).forEach(e=>e())}),um(this,dm,e)}get status(){return cm(this,fm)}set status(e){um(this,fm,e),cm(this,vm).call(this)}get error(){return cm(this,pm)}set error(e){um(this,pm,e),cm(this,ym).call(this)}get messages(){return cm(this,dm)}set messages(e){um(this,dm,[...e]),cm(this,_m).call(this)}};dm=new WeakMap,fm=new WeakMap,pm=new WeakMap,mm=new WeakMap,hm=new WeakMap,gm=new WeakMap,_m=new WeakMap,vm=new WeakMap,ym=new WeakMap;var bm,xm=class extends Vp{constructor({messages:e,...t}){let n=new nee(e);super({...t,state:n}),lm(this,bm,void 0),this[`~registerMessagesCallback`]=(e,t)=>cm(this,bm)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>cm(this,bm)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>cm(this,bm)[`~registerErrorCallback`](e),um(this,bm,n)}};bm=new WeakMap;function ree({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,N.useRef)(`chat`in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});`chat`in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t;return(t=r.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=r.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=r.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=r.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=r.current).sendAutomaticallyWhen?.call(t,e)??!1}},a=(0,N.useRef)(`chat`in n?n.chat:new xm(i));(`chat`in n&&n.chat!==a.current||`id`in n&&a.current.id!==n.id)&&(a.current=`chat`in n?n.chat:new xm(i));let o=(0,N.useSyncExternalStore)((0,N.useCallback)(t=>a.current[`~registerMessagesCallback`](t,e),[e,a.current.id]),()=>a.current.messages,()=>a.current.messages),s=(0,N.useSyncExternalStore)(a.current[`~registerStatusCallback`],()=>a.current.status,()=>a.current.status),c=(0,N.useSyncExternalStore)(a.current[`~registerErrorCallback`],()=>a.current.error,()=>a.current.error),l=(0,N.useCallback)(e=>{typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,N.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var iee=class{constructor(e){this._resumeResolver=null,this._resumeNoneResolver=null,this._expectToolContinuation=!1,this._abortToolContinuation=null,this._activeServerTurnId=null,this._cancelAttachedStream=null,this.agent=e.agent,this.prepareBody=e.prepareBody,this.activeRequestIds=e.activeRequestIds,this.cancelOnClientAbort=e.cancelOnClientAbort??!1}setCancelOnClientAbort(e){this.cancelOnClientAbort=e}cancelActiveServerTurn(){let e=this._activeServerTurnId,t=!1;e&&(this.sendCancelFrame(e),this._cancelAttachedStream?.(),this.clearActiveServerTurn(e),t=!0);let n=this.abortActiveToolContinuation();return t||n}sendCancelFrame(e){try{this.agent.send(JSON.stringify({id:e,type:`cf_agent_chat_request_cancel`}))}catch{}}setActiveServerTurn(e,t){this._activeServerTurnId=e,this._cancelAttachedStream=t}clearActiveServerTurn(e){this._activeServerTurnId===e&&(this._activeServerTurnId=null,this._cancelAttachedStream=null)}expectToolContinuation(){this._expectToolContinuation=!0}abortActiveToolContinuation(){return this._abortToolContinuation?.()??!1}isAwaitingResume(){return this._resumeResolver!==null||this._resumeNoneResolver!==null}handleStreamResuming(e){return this._resumeResolver?(this._resumeResolver(e),!0):!1}handleStreamResumeNone(){return this._resumeNoneResolver?(this._resumeNoneResolver(),!0):!1}handleServerTurnCompleted(e){this.clearActiveServerTurn(e)}observeServerTurn(e){this.setActiveServerTurn(e,null)}async sendMessages(e){let t=Up(8),n=new AbortController,r=!1,i=!1,a={};this.prepareBody&&(a=await this.prepareBody({messages:e.messages,trigger:e.trigger,messageId:e.messageId})),e.body&&(a={...a,...e.body});let o=JSON.stringify({messages:e.messages,trigger:e.trigger,...a});this.activeRequestIds?.add(t);let s=this.agent,c=this.activeRequestIds,l=(e,i=!1,a=!0)=>{if(!r){r=!0,a&&this.clearActiveServerTurn(t);try{e()}catch{}i||c?.delete(t),n.abort()}},u=Error(`Aborted`);u.name=`AbortError`,this.setActiveServerTurn(t,()=>r?!1:(l(()=>f.error(u),!0),!0));let d=()=>{r||(this.cancelOnClientAbort?(i&&this.sendCancelFrame(t),l(()=>f.error(u),i)):l(()=>f.error(u),!1,!i))},f,p=new ReadableStream({start(e){f=e,s.addEventListener(`message`,n=>{try{let r=JSON.parse(n.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==t)return;if(r.error){l(()=>e.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let t=JSON.parse(r.body);e.enqueue(t)}catch{}r.done&&l(()=>e.close())}catch{}},{signal:n.signal}),s.addEventListener(`close`,()=>{l(()=>e.close(),!1,!1)},{signal:n.signal})},cancel(){d()}});return e.abortSignal&&(e.abortSignal.addEventListener(`abort`,d,{once:!0}),e.abortSignal.aborted&&d()),r?p:(i=!0,s.send(JSON.stringify({id:t,init:{method:`POST`,body:o},type:`cf_agent_use_chat_request`})),p)}async reconnectToStream(e){if(this._expectToolContinuation)return this._expectToolContinuation=!1,this._createToolContinuationStream();let t=this.activeRequestIds;return new Promise(e=>{let n=!1,r,i=t=>{n||(n=!0,this._resumeResolver=null,this._resumeNoneResolver=null,r&&clearTimeout(r),e(t))};this._resumeNoneResolver=()=>i(null),this._resumeResolver=e=>{let n=e.id;t?.add(n);let r=this._createResumeStream(n);this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n})),i(r)};try{this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{}r=setTimeout(()=>i(null),5e3)})}_createToolContinuationStream(){let e=this.agent,t=this.activeRequestIds,n=new AbortController,r=Error(`Aborted`);r.name=`AbortError`;let i=!1,a=null,o,s=null,c=null,l=(e,t)=>{if(e===void 0&&t===void 0){this._resumeResolver=null,this._resumeNoneResolver=null;return}e&&this._resumeResolver===e&&(this._resumeResolver=null),t&&this._resumeNoneResolver===t&&(this._resumeNoneResolver=null)},u=(e,r,o,s=!1)=>{if(!i){i=!0,this._abortToolContinuation=null,l(r,o);try{e()}catch{}a&&!s&&t?.delete(a),n.abort()}};this._abortToolContinuation=()=>{if(i)return!1;if(a===null)return u(()=>o.error(r),s,c),!0;try{e.send(JSON.stringify({type:`cf_agent_chat_request_cancel`,id:a}))}catch{}return u(()=>o.error(r),s,c,!0),!0};let d=this;return new ReadableStream({start(r){o=r;let i,f=()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},p=n=>{a||(a=n.id,t?.add(a),l(p,f),i&&clearTimeout(i),e.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:a})))};s=p,c=f,i=setTimeout(()=>u(()=>r.close(),p,f),5e3),d._resumeResolver=p,d._resumeNoneResolver=f,e.addEventListener(`message`,e=>{try{let t=JSON.parse(e.data);if(t.type!==`cf_agent_use_chat_response`||a==null||t.id!==a)return;if(t.error){u(()=>r.error(Error(t.body||`Stream error`)),p,f);return}if(t.body?.trim())try{let e=JSON.parse(t.body);r.enqueue(e)}catch{}t.done&&u(()=>r.close(),p,f)}catch{}},{signal:n.signal}),e.addEventListener(`close`,()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},{signal:n.signal});try{e.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{u(()=>r.close())}},cancel(){a&&d.cancelOnClientAbort?(d.sendCancelFrame(a),u(()=>{},s,c,!0)):u(()=>{},s,c)}})}_createResumeStream(e){let t=this.agent,n=this.activeRequestIds,r=new AbortController,i=Error(`Aborted`);i.name=`AbortError`;let a=!1,o=(t,i=!1,o=!0)=>{if(!a){a=!0,o&&this.clearActiveServerTurn(e);try{t()}catch{}i||n?.delete(e),r.abort()}};this.setActiveServerTurn(e,()=>a?!1:(o(()=>s.error(i),!0),!0));let s,c=this;return new ReadableStream({start(n){s=n,t.addEventListener(`message`,t=>{try{let r=JSON.parse(t.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==e)return;if(r.error){o(()=>n.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let e=JSON.parse(r.body);n.enqueue(e)}catch{}r.done&&o(()=>n.close())}catch{}},{signal:r.signal}),t.addEventListener(`close`,()=>{o(()=>n.close(),!1,!1)},{signal:r.signal})},cancel(){c.cancelOnClientAbort?(c.sendCancelFrame(e),o(()=>{},!0)):o(()=>{},!1,!1)}})}},Sm=new Set;function Cm(e,t){Sm.has(e)||(Sm.add(e),console.warn(`[@cloudflare/ai-chat] Deprecated: ${t}`))}function wm(e){if(!e)return;let t=Object.entries(e).filter(([e,t])=>t.execute).map(([e,t])=>(t.inputSchema&&!t.parameters&&console.warn(`[useAgentChat] Tool "${e}" uses deprecated 'inputSchema'. Please migrate to 'parameters'.`),{name:e,description:t.description,parameters:t.parameters??t.inputSchema}));return t.length>0?t:void 0}var Tm=new Map;function aee(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`)return{index:t,message:n}}return null}function oee(e,t){let n=e.findIndex(e=>e.id===t);if(n<0||n===e.length-1)return e;let r=[...e],[i]=r.splice(n,1);return i?(r.push(i),r):e}function see(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id)),r=e.filter(e=>!n.has(e.id));return r.length===0?t:[...r,...t]}function cee(e){let{agent:t,getInitialMessages:n,messages:r,onToolCall:i,onData:a,experimental_automaticToolResolution:o,tools:s,toolsRequiringConfirmation:c,autoContinueAfterToolResult:l=!0,autoSendAfterAllConfirmationsResolved:u=!0,resume:d=!0,cancelOnClientAbort:f=!1,body:p,prepareSendMessagesRequest:m,...h}=e;c&&Cm(`useAgentChat.toolsRequiringConfirmation`,`The 'toolsRequiringConfirmation' option is deprecated. Use needsApproval on server-side tools instead. Will be removed in the next major version.`),o&&Cm(`useAgentChat.experimental_automaticToolResolution`,`The 'experimental_automaticToolResolution' option is deprecated. Use the onToolCall callback instead. Will be removed in the next major version.`),e.autoSendAfterAllConfirmationsResolved!==void 0&&Cm(`useAgentChat.autoSendAfterAllConfirmationsResolved`,`The 'autoSendAfterAllConfirmationsResolved' option is deprecated. Use sendAutomaticallyWhen from AI SDK instead. Will be removed in the next major version.`);let g=(0,N.useMemo)(()=>c||(s?Object.entries(s).filter(([e,t])=>!t.execute).map(([e])=>e):[]),[c,s]),_=(0,N.useRef)(i);_.current=i;let v=(0,N.useRef)(a);v.current=a;let y=t.getHttpUrl(),b=y?new URL(y):null;b&&b.searchParams.delete(`_pk`);let x=b?.toString()??null,S=Array.isArray(t.path)?JSON.stringify(t.path.map(e=>[e.agent,e.name])):JSON.stringify([[t.agent??``,t.name??``]]),C=b?`${b.origin}${b.pathname}|${S}`:null,w=S,T=(0,N.useRef)(null),E=(0,N.useRef)(null),ee=(0,N.useRef)(null),D=S,O=Array.isArray(t.path)&&ee.current!==null&&ee.current!==S;(T.current===null||E.current!==t||O)&&(T.current=C??D),E.current=t,ee.current=S;let k=(0,N.useRef)(t);k.current=t;async function te({url:t}){if(!t)return[];let n=new URL(t);n.pathname+=`/get-messages`;let r=await fetch(n.toString(),{credentials:e.credentials,headers:e.headers});if(!r.ok)return console.warn(`Failed to fetch initial messages: ${r.status} ${r.statusText}`),[];let i=await r.text();if(!i.trim())return[];try{return JSON.parse(i)}catch(e){return console.warn(`Failed to parse initial messages JSON:`,e),[]}}let ne=n||te;function A(e,t){if(Tm.has(t))return Tm.get(t);let n=ne(e);return Tm.set(t,n),n}let j=n!==null&&(n||x)?A({agent:t.agent,name:t.name,url:x??void 0},w):null,re=j?(0,N.use)(j):r??[];(0,N.useEffect)(()=>{if(j)return Tm.set(w,j),()=>{Tm.get(w)===j&&Tm.delete(w)}},[w,j]);let M=(0,N.useRef)(s);M.current=s;let ie=(0,N.useRef)(m);ie.current=m;let ae=(0,N.useRef)(p);ae.current=p;let oe=(0,N.useRef)(new Set),se=(0,N.useRef)(new Set),ce=(0,N.useRef)(new Set),le=(0,N.useRef)(null);le.current===null&&(le.current=new iee({agent:k.current,activeRequestIds:oe.current,cancelOnClientAbort:f,prepareBody:async({messages:e,trigger:t,messageId:n})=>{let r={},i=ae.current;if(i&&(r={...typeof i==`function`?await i():i}),M.current){let e=wm(M.current);e&&(r.clientTools=e)}if(ie.current){let i=await ie.current({id:k.current._pk,messages:e,trigger:t,messageId:n});i.body&&Object.assign(r,i.body)}return r}})),le.current.agent=k.current,le.current.setCancelOnClientAbort(f);let ue=le.current,de=ree({...h,onData:a,messages:re,transport:ue,id:T.current,resume:d}),{messages:fe,setMessages:pe,addToolResult:me,addToolApprovalResponse:he,sendMessage:ge,resumeStream:_e,status:ve,stop:ye}=de,be=(0,N.useRef)(ve);be.current=ve;let xe=(0,N.useRef)(!1),Se=(0,N.useRef)(!1),Ce=(0,N.useRef)(null),we=(0,N.useRef)(null),Te=(0,N.useRef)(0),[Ee,De]=(0,N.useState)(!1),Oe=(0,N.useCallback)(()=>{Te.current++,Se.current=!1,xe.current=!1,Ce.current=null,we.current&&=(clearTimeout(we.current),null),De(!1)},[]),ke=(0,N.useCallback)(()=>{!Se.current||be.current!==`ready`||we.current||(we.current=setTimeout(()=>{if(we.current=null,!Se.current||be.current!==`ready`)return;Se.current=!1;let e=Te.current;ue.expectToolContinuation(),_e().catch(e=>{console.error(`[useAgentChat] Tool continuation resume failed:`,e)}).finally(()=>{Te.current===e&&(xe.current=!1,De(!1))})},0))},[ue,_e]),Ae=(0,N.useCallback)(()=>{!l||xe.current||(++Te.current,xe.current=!0,Se.current=!0,De(!0),ke())},[l,ke]);(0,N.useEffect)(()=>{if(ve===`error`&&Se.current){Oe();return}ke()},[Oe,ke,ve]);let je=(0,N.useCallback)(async()=>{try{ue.cancelActiveServerTurn(),await ye()}finally{ue.abortActiveToolContinuation()}},[ye,ue]),Me=(0,N.useRef)(new Set),Ne=(0,N.useRef)(!1),[Pe,Fe]=(0,N.useState)(0),[Ie,Le]=(0,N.useState)(new Map),Re=(0,N.useRef)(fe);Re.current=fe;let ze=(0,N.useRef)(re);ze.current=re;let Be=(0,N.useRef)(null),Ve=(0,N.useCallback)(()=>{Be.current=w},[w]);(0,N.useEffect)(()=>{j&&Be.current!==w&&(Ve(),pe(e=>see(ze.current,e)))},[w,j,Ve,pe]);let He=(0,N.useRef)(new Map),Ue=(0,N.useRef)(null),We=(0,N.useCallback)(e=>{let t=Ue.current;if(!t)return[...e];let n=Re.current.find(e=>e.id===t.assistantId)??e.find(e=>e.id===t.assistantId);return n?[...e.filter(e=>e.id!==t.assistantId),n]:[...e]},[]),Ge=(0,N.useCallback)(()=>{if(be.current!==`streaming`)return;let e=aee(Re.current);e&&(Ue.current?.assistantId!==e.message.id&&(Ue.current={assistantId:e.message.id,anchorMessageId:Re.current[e.index-1]?.id??null}),pe(e=>{let t=Ue.current;return t?oee(e,t.assistantId):e}))},[pe]),Ke=(0,N.useCallback)(e=>{let t=Ue.current;!t||e!==void 0&&t.assistantId!==e||(Ue.current=null,pe(e=>{let n=e.findIndex(e=>e.id===t.assistantId);if(n<0)return e;let r=[...e],[i]=r.splice(n,1);if(!i)return e;if(t.anchorMessageId===null)r.unshift(i);else{let e=r.findIndex(e=>e.id===t.anchorMessageId);r.splice(e>=0?e+1:n,0,i)}return r}))},[pe]),qe=(0,N.useCallback)(e=>{pe(t=>{let n=t[t.length-1];if(!n||n.role!==`assistant`||n.id!==e)return t;ce.current.add(e);let r=[...t];return r[r.length-1]={...n,parts:[]},r})},[pe]),Je=(0,N.useCallback)(e=>{let t=e.parts,n=t.filter((e,n)=>e.type!==`text`||!(`text`in e)||!e.text?!0:!t.some((t,r)=>r<=n||t.type!==`text`||!(`text`in t)||!t.text?!1:t.text.startsWith(e.text)));return n.length===t.length?e:{...e,parts:n}},[]);(0,N.useEffect)(()=>{if(ce.current.size===0)return;let e=new Set(fe.filter(e=>ce.current.has(e.id)&&e.role===`assistant`&&Je(e)!==e).map(e=>e.id));e.size!==0&&pe(t=>{let n=!1,r=t.map(t=>{if(!e.has(t.id))return t;let r=Je(t);return r!==t&&(n=!0),r});return n?r:t})},[fe,Je,pe]);let Ye=(0,N.useCallback)(()=>{Ve(),pe([]),Le(new Map),tt(new Set),Oe(),Me.current.clear(),He.current.clear(),se.current.clear(),ce.current.clear(),Ue.current=null},[Ve,pe,Oe]),Xe=(0,N.useCallback)(async(e,t)=>{let n=ge(e,t);return e!==void 0&&!(typeof e==`object`&&e&&`messageId`in e&&e.messageId!=null)&&Ge(),n},[ge,Ge]),Ze=fe[fe.length-1],Qe=(()=>{if(!Ze||Ze.role!==`assistant`)return{messageId:void 0,toolCallIds:new Set};let e=new Set;for(let t of Ze.parts??[])jp(t)&&t.state===`input-available`&&g.includes(Np(t))&&e.add(t.toolCallId);return{messageId:Ze.id,toolCallIds:e}})(),$e=(0,N.useRef)(Qe);$e.current=Qe;let[et,tt]=(0,N.useState)(()=>new Set),nt=(0,N.useCallback)(e=>{tt(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]);(0,N.useEffect)(()=>{if(!o||Ne.current)return;let e=fe[fe.length-1];if(!e||e.role!==`assistant`)return;let t=e.parts.filter(e=>jp(e)&&e.state===`input-available`&&!Me.current.has(e.toolCallId));if(t.length>0){let e=M.current,n=t.filter(t=>jp(t)&&!g.includes(Np(t))&&e?.[Np(t)]?.execute);n.length>0&&(Ne.current=!0,(async()=>{try{let t=[];for(let r of n)if(jp(r)){let n=null,i=Np(r),a=e?.[i];if(a?.execute&&r.input!==void 0)try{n=await a.execute(r.input)}catch(e){n=`Error executing tool: ${e instanceof Error?e.message:String(e)}`}Me.current.add(r.toolCallId),t.push({toolCallId:r.toolCallId,toolName:i,output:n})}if(t.length>0){let n=wm(e);for(let e of t)k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e.toolCallId,toolName:e.toolName,output:e.output,autoContinue:l,clientTools:n}));await Promise.all(t.map(e=>me({tool:e.toolName,toolCallId:e.toolCallId,output:e.output}))),Le(e=>{let n=new Map(e);for(let e of t)n.set(e.toolCallId,e.output);return n}),Ae()}}finally{Ne.current=!1,Fe(e=>e+1)}})())}},[fe,o,me,g,l,Ae,Pe]);let rt=(0,N.useCallback)((e,t,n,r,i)=>{let a=r===`output-error`?!1:l;k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e,toolName:t,output:n,...r?{state:r}:{},...i===void 0?{}:{errorText:i},autoContinue:a,clientTools:M.current?wm(M.current):void 0})),r!==`output-error`&&Le(t=>new Map(t).set(e,n)),a&&Ae()},[l,Ae]),it=(0,N.useCallback)((e,t)=>{k.current.send(JSON.stringify({type:`cf_agent_tool_approval`,toolCallId:e,approved:t,autoContinue:l})),l&&Ae()},[l,Ae]);(0,N.useEffect)(()=>{let e=_.current;if(!e)return;let t=fe[fe.length-1];if(!t||t.role!==`assistant`)return;let n=t.parts.filter(e=>jp(e)&&e.state===`input-available`&&!Me.current.has(e.toolCallId));for(let t of n)if(jp(t)){let n=t.toolCallId,r=Np(t);Me.current.add(n),tt(e=>{if(e.has(n))return e;let t=new Set(e);return t.add(n),t});let i=e=>{rt(e.toolCallId,r,e.output,e.state,e.errorText),me({tool:r,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},a;try{a=e({toolCall:{toolCallId:n,toolName:r,input:t.input},addToolOutput:i})}catch(e){throw nt(n),e}Promise.resolve(a).finally(()=>{nt(n)})}},[fe,rt,me,nt]);let at=(0,N.useRef)({status:`idle`}),[ot,st]=(0,N.useState)(!1),[ct,lt]=(0,N.useState)(!1);(0,N.useEffect)(()=>{let e=He.current;function n(t){if(typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`cf_agent_chat_clear`:at.current=Kp(at.current,{type:`clear`}).state,st(!1),lt(!1),Ye();break;case`cf_agent_chat_recovering`:lt(!!n.recovering);break;case`cf_agent_chat_messages`:pe(We(n.messages));break;case`cf_agent_message_updated`:pe(e=>{let t=n.message,r=e.findIndex(e=>e.id===t.id);if(r<0){let n=new Set(t.parts.filter(e=>`toolCallId`in e&&e.toolCallId).map(e=>e.toolCallId));n.size>0&&(r=e.findIndex(e=>e.parts.some(e=>`toolCallId`in e&&n.has(e.toolCallId))))}if(r>=0){let n=[...e];return n[r]={...t,id:e[r].id},n}return e});break;case`cf_agent_stream_resume_none`:ue.handleStreamResumeNone();break;case`cf_agent_stream_resuming`:{let e=xe.current&&!ue.isAwaitingResume();if(!d&&!ue.isAwaitingResume()&&!e||(xe.current||se.current.add(n.id),ue.handleStreamResuming(n))||oe.current.has(n.id))return;e&&(Se.current=!1,Ce.current=n.id,we.current&&=(clearTimeout(we.current),null)),at.current=Kp(at.current,{type:`resume-fallback`,streamId:n.id,messageId:Up()}).state,ue.observeServerTurn(n.id),st(!0),lt(!1),k.current.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n.id}));break}case`cf_agent_use_chat_response`:{if(oe.current.has(n.id)){if(n.body?.trim())try{let t=JSON.parse(n.body);t.type===`start`&&typeof t.messageId==`string`&&(e.set(n.id,t.messageId),n.replay&&se.current.has(n.id)&&(se.current.delete(n.id),qe(t.messageId)))}catch{}(n.done||n.replayComplete)&&se.current.delete(n.id),n.done&&(at.current.status===`observing`&&at.current.streamId===n.id&&(at.current={status:`idle`},st(!1)),ue.handleServerTurnCompleted(n.id),Ke(e.get(n.id)),e.delete(n.id),oe.current.delete(n.id));return}let t;if(n.replay&&at.current.status!==`observing`&&!se.current.has(n.id))return;if(n.body?.trim())try{t=JSON.parse(n.body),n.replay&&se.current.has(n.id)&&typeof t.messageId==`string`&&t.type===`start`&&(se.current.delete(n.id),qe(t.messageId)),typeof t.type==`string`&&t.type.startsWith(`data-`)&&v.current&&v.current(t)}catch(e){console.warn(`[useAgentChat] Failed to parse stream chunk:`,e instanceof Error?e.message:e,`body:`,n.body?.slice(0,100))}(n.done||n.replayComplete)&&se.current.delete(n.id),n.done&&(ue.handleServerTurnCompleted(n.id),lt(!1));let r=n.done&&Ce.current===n.id,i=Kp(at.current,{type:`response`,streamId:n.id,messageId:Up(),chunkData:t,done:n.done,error:n.error,replay:n.replay,replayComplete:n.replayComplete,continuation:n.continuation,currentMessages:n.continuation?Re.current:void 0});at.current=i.state,i.messagesUpdate&&pe(i.messagesUpdate),st(i.isStreaming),r&&Oe();break}}}return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),at.current={status:`idle`},st(!1),lt(!1),Ue.current=null,e.clear()}},[t,pe,d,ue,We,Oe,qe,Ke,Ye]);let ut=async e=>{let{toolCallId:t}=e,n=`tool`in e?e.tool:``,r=`output`in e?e.output:void 0;if(k.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:t,toolName:n,output:r,autoContinue:l,clientTools:M.current?wm(M.current):void 0})),Le(e=>new Map(e).set(t,r)),me(e),l&&Ae(),!l){if(!u){ge();return}let e=$e.current?.toolCallIds;if(!e){ge();return}let n=e.size===1&&e.has(t);e.has(t)&&e.delete(t),(n||e.size===0)&&ge()}},dt=e=>{let{id:t,approved:n}=e,r;for(let e of Re.current){for(let n of e.parts)if(`toolCallId`in n&&`approval`in n&&n.approval?.id===t){r=n.toolCallId;break}if(r)break}r?it(r,n):console.warn(`[useAgentChat] addToolApprovalResponse: Could not find toolCallId for approval ID "${t}". Server will not be notified, which may cause duplicate messages.`),he(e)},ft=(0,N.useMemo)(()=>Ie.size===0?fe:fe.map(e=>({...e,parts:e.parts.map(e=>!(`toolCallId`in e)||!(`state`in e)||e.state!==`input-available`||!Ie.has(e.toolCallId)?e:{...e,state:`output-available`,output:Ie.get(e.toolCallId)})})),[fe,Ie]);(0,N.useEffect)(()=>{let e=new Set;for(let t of fe)for(let n of t.parts)`toolCallId`in n&&n.toolCallId&&e.add(n.toolCallId);Le(t=>{if(t.size===0)return t;let n=!1;for(let r of t.keys())if(!e.has(r)){n=!0;break}if(!n)return t;let r=new Map;for(let[n,i]of t)e.has(n)&&r.set(n,i);return r});for(let t of Me.current)e.has(t)||Me.current.delete(t)},[fe]);let pt=(0,N.useCallback)(e=>{let t=e.toolName??``;rt(e.toolCallId,t,e.output,e.state,e.errorText),me({tool:t,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},[rt,me]),mt=ft[ft.length-1],ht=(()=>{if(et.size===0&&!s||!mt||mt.role!==`assistant`)return!1;for(let e of mt.parts){if(!jp(e)||e.state!==`input-available`)continue;let t=Np(e);if(!g.includes(t)&&(et.has(e.toolCallId)||s?.[t]?.execute))return!0}return!1})(),gt=ot||ht,_t=ve===`streaming`||gt;return{...de,messages:ft,isServerStreaming:gt,isStreaming:_t,isRecovering:ct,isToolContinuation:Ee,sendMessage:Xe,stop:je,addToolOutput:pt,addToolResult:ut,addToolApprovalResponse:dt,clearHistory:()=>{Ye(),t.send(JSON.stringify({type:`cf_agent_chat_clear`}))},setMessages:e=>{let n;n=typeof e==`function`?e(Re.current):e,n.length===0&&Ve(),pe(n),t.send(JSON.stringify({messages:n,type:`cf_agent_chat_messages`}))}}}function lee(e){return e?{headers:{Authorization:`Bearer ${e}`},protocols:[`bearer`,e]}:{}}function Em(e){let{enabled:t,host:n,agentName:r,actorId:i,name:a,sub:o,authToken:s,onError:c,onOpen:l,onClose:u}=e,[d,f]=(0,N.useState)(void 0),[p,m]=(0,N.useState)(`connecting`),h=Rt({enabled:t,host:n,agent:r,name:i?`${i}:${a}`:a,sub:o,onOpen:e=>{l?.(e)},onClose:e=>{e.code>=3e3?m(`unauthorized`):m(`disconnected`),u?.(e)},onMessage:e=>{let t=JSON.parse(e.data);t.type===`connection_status`?(t.status===`unauthorized`&&h.close(3e3),m(t.status)):t.type===`agent_type`&&f(t.agentType)},onError:e=>{m(`disconnected`),c?.(e)},...lee(s)});return{agent:h,status:p,type:d}}function Dm(e){let{toolContext:t,welcomeMessage:n,...r}=e,{agent:i,status:a}=Em({...r,enabled:r.enabled??!!r.name}),o=cee({agent:i,body:t??{},getInitialMessages:r.name&&a===`connected`?void 0:null}),s=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{n&&a===`connected`&&o.messages.length===0&&!s.current&&(s.current=!0,o.setMessages([{id:`welcome-message`,role:`assistant`,parts:[{type:`text`,text:n}]}]))},[a,o.messages.length,n]),{status:a,agent:i,chat:o,submitMessageFeedback:async(e,t,n)=>{await i.call(`submitMessageFeedback`,[e,t,n])},getMessageFeedback:async()=>await i.call(`getMessageFeedback`)}}function uee(e){let{toolContext:t,welcomeMessage:n,initialChatId:r,...i}=e,[a,o]=(0,N.useState)(r),[s,c]=(0,N.useState)([]),{agent:l,status:u}=Em(i),d=(0,N.useCallback)(async()=>{c((await l.call(`getChats`)).map(e=>{let t={...e,name:e.durable_object_name};return delete t.durable_object_name,t}))},[l]);(0,N.useEffect)(()=>{u===`connected`&&d().catch(console.error)},[u,d]);let f=async()=>(await d(),s),p=async()=>{let e=await l.call(`createChat`);return o(e),await d(),e},m=e=>{o(e)},h=async e=>{await l.call(`deleteChat`,[e]),o(void 0),await d()},g=l.state?.subAgentName??``,_=!!a&&!!g,v=_&&l.state?.status===`connected`,y=Dm({...i,enabled:_,sub:_?[{agent:g,name:a}]:void 0,getInitialMessages:v?void 0:null,toolContext:t,welcomeMessage:n});return{currentChatName:a,chats:s,status:_&&y.status!==`connecting`?y.status:u,assistant:{getChats:f,createChat:p,openChat:m,deleteChat:h},chat:y}}function Om({status:e,chatKey:t,submitMessageFeedback:n,getMessageFeedback:r}){let[i,a]=(0,N.useState)({}),o=(0,N.useRef)(n),s=(0,N.useRef)(r);o.current=n,s.current=r;let c=(0,N.useCallback)(()=>{s.current().then(e=>a(e??{})).catch(()=>{})},[]);return(0,N.useEffect)(()=>{e===`connected`?c():a({})},[e,t,c]),{feedback:i,onFeedback:(0,N.useCallback)((e,t,n)=>{a(r=>({...r,[e]:{rating:t,comment:n}})),Promise.resolve(o.current(e,t,n)).catch(()=>c())},[c])}}function km(){return typeof window<`u`}function Am(e){return Nm(e)?(e.nodeName||``).toLowerCase():`#document`}function jm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mm(e){return((Nm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Nm(e){return km()?e instanceof Node||e instanceof jm(e).Node:!1}function Pm(e){return km()?e instanceof Element||e instanceof jm(e).Element:!1}function Fm(e){return km()?e instanceof HTMLElement||e instanceof jm(e).HTMLElement:!1}function Im(e){return!km()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof jm(e).ShadowRoot}function Lm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function dee(e){return/^(table|td|th)$/.test(Am(e))}function Rm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var fee=/transform|translate|scale|rotate|perspective|filter/,pee=/paint|layout|strict|content/,zm=e=>!!e&&e!==`none`,Bm;function Vm(e){let t=Pm(e)?Wm(e):e;return zm(t.transform)||zm(t.translate)||zm(t.scale)||zm(t.rotate)||zm(t.perspective)||!Hm()&&(zm(t.backdropFilter)||zm(t.filter))||fee.test(t.willChange||``)||pee.test(t.contain||``)}function mee(e){let t=Km(e);for(;Fm(t)&&!Um(t);){if(Vm(t))return t;if(Rm(t))return null;t=Km(t)}return null}function Hm(){return Bm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Bm}function Um(e){return/^(html|body|#document)$/.test(Am(e))}function Wm(e){return jm(e).getComputedStyle(e)}function Gm(e){return Pm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Km(e){if(Am(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Im(e)&&e.host||Mm(e);return Im(t)?t.host:t}function qm(e){let t=Km(e);return Um(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fm(t)&&Lm(t)?t:qm(t)}function Jm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qm(e),i=r===e.ownerDocument?.body,a=jm(r);if(i){let e=Ym(a);return t.concat(a,a.visualViewport||[],Lm(r)?r:[],e&&n?Jm(e):[])}else return t.concat(r,Jm(r,[],n))}function Ym(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xm={...N},Zm={};function Qm(e,t){let n=N.useRef(Zm);return n.current===Zm&&(n.current=e(t)),n}var $m=Xm.useInsertionEffect,hee=$m&&$m!==Xm.useLayoutEffect?$m:e=>e();function eh(e){let t=Qm(gee).current;return t.next=e,hee(t.effect),t.trampoline}function gee(){let e={next:void 0,callback:_ee,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function _ee(){}var th=typeof document<`u`?N.useLayoutEffect:()=>{};function nh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var rh={};function ih(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ah(t);let a=ah(e);return t&&(a=oh(a,t)),n&&(a=oh(a,n)),r&&(a=oh(a,r)),i&&(a=oh(a,i)),a}function vee(e){if(e.length===0)return rh;if(e.length===1)return ah(e[0]);let t=ah(e[0]);for(let n=1;n<e.length;n+=1)t=oh(t,e[n]);return t}function ah(e){return ch(e)?{...lh(e,rh)}:yee(e)}function oh(e,t){return ch(t)?lh(t,e):bee(e,t)}function yee(e){let t={...e};for(let e in t){let n=t[e];sh(e,n)&&(t[e]=uh(n))}return t}function bee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=nh(e.style,r);break;case`className`:e[n]=fh(e.className,r);break;default:sh(n,r)?e[n]=xee(e[n],r):e[n]=r}}return e}function sh(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ch(e){return typeof e==`function`}function lh(e,t){return ch(e)?e(t):e??rh}function xee(e,t){return t?e?(...n)=>{let r=n[0];if(ph(r)){let i=r;dh(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:uh(t):e}function uh(e){return e&&((...t)=>{let n=t[0];return ph(n)&&dh(n),e(...t)})}function dh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fh(e,t){return t?e?t+` `+e:t:e}function ph(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function mh(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var hh=mh(`https://base-ui.com/production-error`,`Base UI`),gh=N.createContext(void 0);function _h(e=!1){let t=N.useContext(gh);if(t===void 0&&!e)throw Error(hh(16));return t}function vh(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:N.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function yh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=N.useRef(null),s=_h(!0),c=a??s!==void 0,{props:l}=vh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=N.useCallback(()=>{let e=o.current;bh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return th(u,[u]),{getButtonProps:N.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ih({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(dh(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=bh(a),l=!i&&xh(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(dh(e),a?.(e),e.target===e.currentTarget&&i&&c&&bh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:eh(e=>{o.current=e,u()})}}function bh(e){return Fm(e)&&e.tagName===`BUTTON`}function xh(e){return!!(e?.tagName===`A`&&e?.href)}function Sh(e,t,n,r){let i=Qm(wh).current;return Th(i,e,t,n,r)&&Dh(i,[e,t,n,r]),i.callback}function Ch(e){let t=Qm(wh).current;return Eh(t,e)&&Dh(t,e),t.callback}function wh(){return{callback:null,cleanup:null,refs:[]}}function Th(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Eh(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Dh(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var See=19;function Oh(e){return See>=e}function kh(e){if(!N.isValidElement(e))return null;let t=e,n=t.props;return(Oh(19)?n?.ref:t.ref)??null}function Ah(){}Object.freeze([]);var jh=Object.freeze({});function Cee(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function wee(e,t){return typeof e==`function`?e(t):e}function Mh(e,t){return typeof e==`function`?e(t):e}function Nh(e,t,n={}){let r=t.render,i=Tee(t,n);return n.enabled===!1?null:Oee(e,r,i,n.state??jh)}function Tee(e,t={}){let{className:n,style:r,render:i}=e,{state:a=jh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?wee(n,a):void 0,d=l?Mh(r,a):void 0,f=l?Cee(a,c):jh,p=l&&s?Eee(s):void 0,m=l?nh(f,p)??{}:jh;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Ch([m.ref,kh(i),...o]):m.ref=Sh(m.ref,kh(i),o):Sh(null,null)),l?(u!==void 0&&(m.className=fh(m.className,u)),d!==void 0&&(m.style=nh(m.style,d)),m):jh}function Eee(e){return Array.isArray(e)?vee(e):ih(void 0,e)}var Dee=Symbol.for(`react.lazy`);function Oee(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ih(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Dee&&(i=N.Children.toArray(t)[0]),N.cloneElement(i,e)}if(e&&typeof e==`string`)return kee(e,n);throw Error(hh(8))}function kee(e,t){return e===`button`?(0,N.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,N.createElement)(`img`,{alt:``,...t,key:t.key}):N.createElement(e,t)}var Aee=N.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=yh({disabled:i,focusableWhenDisabled:a,native:o});return Nh(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Ph(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ph(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Fh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ph(e))&&(r&&(r+=` `),r+=t);return r}var Ih=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Lh=Fh,Rh=(e,t)=>n=>{if(t?.variants==null)return Lh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ih(t)||Ih(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Lh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},jee=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Mee=(e,t)=>({classGroupId:e,validator:t}),zh=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bh=`-`,Vh=[],Nee=`arbitrary..`,Pee=e=>{let t=Iee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Fee(e);let n=e.split(Bh);return Hh(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?jee(i,t):t:i||Vh}return n[e]||Vh}}},Hh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Hh(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Bh):e.slice(t).join(Bh),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Fee=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Nee+r:void 0})(),Iee=e=>{let{theme:t,classGroups:n}=e;return Lee(n,t)},Lee=(e,t)=>{let n=zh();for(let r in e){let i=e[r];Uh(i,n,r,t)}return n},Uh=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Wh(i,t,n,r)}},Wh=(e,t,n,r)=>{if(typeof e==`string`){Gh(e,t,n);return}if(typeof e==`function`){Kh(e,t,n,r);return}qh(e,t,n,r)},Gh=(e,t,n)=>{let r=e===``?t:Jh(t,e);r.classGroupId=n},Kh=(e,t,n,r)=>{if(Yh(e)){Uh(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Mee(n,e))},qh=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Uh(o,Jh(t,a),n,r)}},Jh=(e,t)=>{let n=e,r=t.split(Bh),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=zh(),n.nextPart.set(t,i)),n=i}return n},Yh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Xh=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Zh=`!`,Qh=`:`,$h=[],eg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),tg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Qh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Zh)?(c=s.slice(0,-1),l=!0):s.startsWith(Zh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return eg(t,l,c,u)};if(t){let e=t+Qh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):eg($h,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ng=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},rg=e=>({cache:Xh(e.cacheSize),parseClassName:tg(e),sortModifiers:ng(e),postfixLookupClassGroupIds:ig(e),...Pee(e)}),ig=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ag=/\s+/,og=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ag),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Zh:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},sg=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=cg(n))&&(i&&(i+=` `),i+=r);return i},cg=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=cg(e[r]))&&(n&&(n+=` `),n+=t);return n},lg=(e,...t)=>{let n,r,i,a,o=o=>(n=rg(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=og(e,n);return i(e,a),a};return a=o,(...e)=>a(sg(...e))},ug=[],dg=e=>{let t=t=>t[e]||ug;return t.isThemeGetter=!0,t},fg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_g=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bg=e=>mg.test(e),xg=e=>!!e&&!Number.isNaN(Number(e)),Sg=e=>!!e&&Number.isInteger(Number(e)),Cg=e=>e.endsWith(`%`)&&xg(e.slice(0,-1)),wg=e=>hg.test(e),Tg=()=>!0,Ree=e=>gg.test(e)&&!_g.test(e),Eg=()=>!1,zee=e=>vg.test(e),Bee=e=>yg.test(e),Vee=e=>!Dg(e)&&!Mg(e),Hee=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Uee=e=>Ig(e,Bg,Eg),Dg=e=>fg.test(e),Og=e=>Ig(e,Vg,Ree),kg=e=>Ig(e,Zee,xg),Wee=e=>Ig(e,Ug,Tg),Gee=e=>Ig(e,Hg,Eg),Ag=e=>Ig(e,Rg,Eg),Kee=e=>Ig(e,zg,Bee),jg=e=>Ig(e,Wg,zee),Mg=e=>pg.test(e),Ng=e=>Lg(e,Vg),qee=e=>Lg(e,Hg),Pg=e=>Lg(e,Rg),Jee=e=>Lg(e,Bg),Yee=e=>Lg(e,zg),Fg=e=>Lg(e,Wg,!0),Xee=e=>Lg(e,Ug,!0),Ig=(e,t,n)=>{let r=fg.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lg=(e,t,n=!1)=>{let r=pg.exec(e);return r?r[1]?t(r[1]):n:!1},Rg=e=>e===`position`||e===`percentage`,zg=e=>e===`image`||e===`url`,Bg=e=>e===`length`||e===`size`||e===`bg-size`,Vg=e=>e===`length`,Zee=e=>e===`number`,Hg=e=>e===`family-name`,Ug=e=>e===`number`||e===`weight`,Wg=e=>e===`shadow`,Gg=lg(()=>{let e=dg(`color`),t=dg(`font`),n=dg(`text`),r=dg(`font-weight`),i=dg(`tracking`),a=dg(`leading`),o=dg(`breakpoint`),s=dg(`container`),c=dg(`spacing`),l=dg(`radius`),u=dg(`shadow`),d=dg(`inset-shadow`),f=dg(`text-shadow`),p=dg(`drop-shadow`),m=dg(`blur`),h=dg(`perspective`),g=dg(`aspect`),_=dg(`ease`),v=dg(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Mg,Dg],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Mg,Dg,c],T=()=>[bg,`full`,`auto`,...w()],E=()=>[Sg,`none`,`subgrid`,Mg,Dg],ee=()=>[`auto`,{span:[`full`,Sg,Mg,Dg]},Sg,Mg,Dg],D=()=>[Sg,`auto`,Mg,Dg],O=()=>[`auto`,`min`,`max`,`fr`,Mg,Dg],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],A=()=>[bg,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[bg,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[bg,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Mg,Dg],ie=()=>[...b(),Pg,Ag,{position:[Mg,Dg]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,Jee,Uee,{size:[Mg,Dg]}],se=()=>[Cg,Ng,Og],ce=()=>[``,`none`,`full`,l,Mg,Dg],le=()=>[``,xg,Ng,Og],ue=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],fe=()=>[xg,Cg,Pg,Ag],pe=()=>[``,`none`,m,Mg,Dg],me=()=>[`none`,xg,Mg,Dg],he=()=>[`none`,xg,Mg,Dg],ge=()=>[xg,Mg,Dg],_e=()=>[bg,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[wg],breakpoint:[wg],color:[Tg],container:[wg],"drop-shadow":[wg],ease:[`in`,`out`,`in-out`],font:[Vee],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[wg],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[wg],shadow:[wg],spacing:[`px`,xg],text:[wg],"text-shadow":[wg],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,bg,Dg,Mg,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Mg,Dg]}],"container-named":[Hee],columns:[{columns:[xg,Dg,Mg,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Sg,`auto`,Mg,Dg]}],basis:[{basis:[bg,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[xg,bg,`auto`,`initial`,`none`,Dg]}],grow:[{grow:[``,xg,Mg,Dg]}],shrink:[{shrink:[``,xg,Mg,Dg]}],order:[{order:[Sg,`first`,`last`,`none`,Mg,Dg]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,...A()]}],"font-size":[{text:[`base`,n,Ng,Og]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xee,Wee]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Cg,Dg]}],"font-family":[{font:[qee,Gee,t]}],"font-features":[{"font-features":[Dg]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Mg,Dg]}],"line-clamp":[{"line-clamp":[xg,`none`,Mg,kg]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Mg,Dg]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Mg,Dg]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ue(),`wavy`]}],"text-decoration-thickness":[{decoration:[xg,`from-font`,`auto`,Mg,Og]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[xg,`auto`,Mg,Dg]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Sg,Mg,Dg]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Mg,Dg]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Mg,Dg]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Sg,Mg,Dg],radial:[``,Mg,Dg],conic:[Sg,Mg,Dg]},Yee,Kee]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":le()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ue(),`hidden`,`none`]}],"divide-style":[{divide:[...ue(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...ue(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[xg,Mg,Dg]}],"outline-w":[{outline:[``,xg,Ng,Og]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,Fg,jg]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Fg,jg]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:le()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[xg,Og]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Fg,jg]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[xg,Mg,Dg]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[xg]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Mg,Dg]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[xg]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Mg,Dg]}],filter:[{filter:[``,`none`,Mg,Dg]}],blur:[{blur:pe()}],brightness:[{brightness:[xg,Mg,Dg]}],contrast:[{contrast:[xg,Mg,Dg]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Fg,jg]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,xg,Mg,Dg]}],"hue-rotate":[{"hue-rotate":[xg,Mg,Dg]}],invert:[{invert:[``,xg,Mg,Dg]}],saturate:[{saturate:[xg,Mg,Dg]}],sepia:[{sepia:[``,xg,Mg,Dg]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Mg,Dg]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[xg,Mg,Dg]}],"backdrop-contrast":[{"backdrop-contrast":[xg,Mg,Dg]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,xg,Mg,Dg]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xg,Mg,Dg]}],"backdrop-invert":[{"backdrop-invert":[``,xg,Mg,Dg]}],"backdrop-opacity":[{"backdrop-opacity":[xg,Mg,Dg]}],"backdrop-saturate":[{"backdrop-saturate":[xg,Mg,Dg]}],"backdrop-sepia":[{"backdrop-sepia":[``,xg,Mg,Dg]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Mg,Dg]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[xg,`initial`,Mg,Dg]}],ease:[{ease:[`linear`,`initial`,_,Mg,Dg]}],delay:[{delay:[xg,Mg,Dg]}],animate:[{animate:[`none`,v,Mg,Dg]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Mg,Dg]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Mg,Dg,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":[`translate-none`],zoom:[{zoom:[Sg,Mg,Dg]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Mg,Dg]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Mg,Dg]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[xg,Ng,Og,kg]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Kg(...e){return Gg(Fh(e))}var Qee=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qg=i(((e,t)=>{t.exports=Qee()})),I=qg(),$ee=Rh(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Jg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,I.jsx)(Aee,{"data-slot":`button`,className:Kg($ee({variant:t,size:n,className:e})),...r})}var Yg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ete=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),tte=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xg=e=>{let t=tte(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},nte=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},rte=(0,N.createContext)({}),ite=()=>(0,N.useContext)(rte),ate=(0,N.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ite()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,N.createElement)(`svg`,{ref:c,...Zg,width:t??l??Zg.width,height:t??l??Zg.height,stroke:e??f,strokeWidth:m,className:Yg(`lucide`,p,i),...!a&&!nte(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Qg=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(ate,{ref:i,iconNode:t,className:Yg(`lucide-${ete(Xg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xg(e),n},ote=Qg(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ste=Qg(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),cte=Qg(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),$g=Qg(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),lte=Qg(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ute=Qg(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),e_=Qg(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),t_=Qg(`circle-x`,[[`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`}]]),dte=Qg(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),n_=Qg(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),fte=Qg(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),pte=Qg(`eye-off`,[[`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`}]]),mte=Qg(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),hte=Qg(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),gte=Qg(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),r_=Qg(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),_te=Qg(`mic`,[[`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`}]]),vte=Qg(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),yte=Qg(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bte=Qg(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),i_=Qg(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),xte=Qg(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Ste=Qg(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Cte=Qg(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),wte=Qg(`wrench`,[[`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`}]]),a_=Qg(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),o_={damping:.7,stiffness:.05,mass:1.25},Tte=70,s_=1e3/60,c_=350,l_=!1;globalThis.document?.addEventListener(`mousedown`,()=>{l_=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{l_=!1}),globalThis.document?.addEventListener(`click`,()=>{l_=!1});var Ete=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!l_)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Tte}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=f_(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/s_;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:f_(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=u_(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=u_(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=f_(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:c_})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function u_(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var d_=new Map;function f_(...e){let t={...o_},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return d_.has(r)||d_.set(r,Object.freeze(t)),n?`instant`:d_.get(r)}var p_=(0,N.createContext)(null),m_=typeof window<`u`?N.useLayoutEffect:N.useEffect;function h_({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Ete({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),m_(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(p_.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=g_();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(h_||={});function g_(){let e=(0,N.useContext)(p_);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var __=({className:e,...t})=>(0,I.jsx)(h_,{className:Kg(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),v_=({className:e,...t})=>(0,I.jsx)(h_.Content,{className:Kg(`flex flex-col gap-8 p-4`,e),...t}),y_=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=g_(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,I.jsx)(Jg,{className:Kg(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,I.jsx)(ote,{className:`size-4`})})};function b_(e){return Nh(e.defaultTagName??`div`,e,e)}var Dte=Rh(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function Ote({className:e,orientation:t,...n}){return(0,I.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Kg(Dte({orientation:t}),e),...n})}function kte({className:e,render:t,...n}){return b_({defaultTagName:`div`,props:ih({className:Kg(`flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var x_=[],S_=void 0;function Ate(){return S_}function jte(e){x_.push(e)}function C_(e){let t=(t,n)=>{let r=Qm(Nte).current,i;try{S_=r;for(let e of x_)e.before(r);i=e(t,n);for(let e of x_)e.after(r);r.didInitialize=!0}finally{S_=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mte(e){return N.forwardRef(C_(e))}function Nte(){return{didInitialize:!1}}function w_(e){let t=N.useRef(!0);t.current&&(t.current=!1,e())}var T_=N.createContext(void 0);function E_(e){let t=N.useContext(T_);if(t===void 0&&!e)throw Error(hh(72));return t}var Pte=[];function D_(e){N.useEffect(e,Pte)}var O_=0,k_=class e{static create(){return new e}currentId=O_;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=O_,t()},e)}isStarted(){return this.currentId!==O_}clear=()=>{this.currentId!==O_&&(clearTimeout(this.currentId),this.currentId=O_)};disposeEffect=()=>this.clear};function A_(){let e=Qm(k_.create).current;return D_(e.disposeEffect),e}var j_=typeof navigator<`u`,M_=V_(),N_=U_(),P_=H_(),F_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),I_=M_.platform===`MacIntel`&&M_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(M_.platform);j_&&/firefox/i.test(P_);var L_=j_&&/apple/i.test(navigator.vendor);j_&&/Edg/i.test(P_);var R_=j_&&/android/i.test(N_)||/android/i.test(P_),z_=j_&&N_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,B_=P_.includes(`jsdom/`);function V_(){if(!j_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function H_(){if(!j_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function U_(){if(!j_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function W_(e){e.preventDefault(),e.stopPropagation()}function G_(e){return`nativeEvent`in e}function K_(e){return e.pointerType===``&&e.isTrusted?!0:R_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function q_(e){return B_?!1:!R_&&e.width===0&&e.height===0||R_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function J_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Y_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var X_=`data-base-ui-focusable`,Z_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Q_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Im(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ev(e){return`composedPath`in e?e.composedPath()[0]:e.target}function tv(e,t){if(!Pm(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if($_(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function nv(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function rv(e){return e.matches(`html,body`)}function iv(e){return Fm(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function av(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Z_}`)!=null}function ov(e){return e?e.getAttribute(`role`)===`combobox`&&iv(e):!1}function sv(e){if(!e||B_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function cv(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Fte(e,t){return t!=null&&!J_(t)?0:typeof e==`function`?e():e}function lv(e,t,n){let r=Fte(e,n);return typeof r==`number`?r:r?.[t]}function uv(e){return typeof e==`function`?e():e}function dv(e,t){return t||e===`click`||e===`mousedown`}function Ite(e){return e?.includes(`mouse`)&&e!==`mousedown`}var fv=`none`,pv=`trigger-press`,mv=`trigger-hover`,hv=`trigger-focus`,Lte=`outside-press`,Rte=`close-press`,gv=`focus-out`,zte=`escape-key`,Bte=`disabled`,_v=`imperative-action`;function vv(e,t,n,r){let i=!1,a=!1,o=r??jh;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var yv=N.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new k_,currentIdRef:{current:null},currentContextRef:{current:null}});function Vte(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=N.useRef(n),a=N.useRef(n),o=N.useRef(null),s=N.useRef(null),c=A_();return(0,I.jsx)(yv.Provider,{value:N.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Hte(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=N.useContext(yv),[f,p]=N.useState(!1);return th(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),th(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:lv(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,vv(fv))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),th(()=>()=>{l.current=null},[l]),N.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function bv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function xv(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Sv(e){let t=Qm(Ute,e).current;return t.next=e,th(t.effect),t}function Ute(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Cv=null;globalThis.requestAnimationFrame;var wv=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Tv=class e{static create(){return new e}static request(e){return wv.request(e)}static cancel(e){return wv.cancel(e)}currentId=Cv;request(e){this.cancel(),this.currentId=wv.request(()=>{this.currentId=Cv,e()})}cancel=()=>{this.currentId!==Cv&&(wv.cancel(this.currentId),this.currentId=Cv)};disposeEffect=()=>this.cancel};function Ev(){let e=Qm(Tv.create).current;return D_(e.disposeEffect),e}function Dv(e){return e?.ownerDocument||document}var Ov={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},kv={...Ov,position:`fixed`,top:0,left:0},Wte={...Ov,position:`absolute`},Av=N.forwardRef(function(e,t){let[n,r]=N.useState();th(()=>{L_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,I.jsx)(`span`,{...e,ref:t,style:kv,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Gte=[`top`,`right`,`bottom`,`left`],jv=Math.min,Mv=Math.max,Nv=Math.round,Pv=Math.floor,Fv=e=>({x:e,y:e}),Kte={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Iv(e,t,n){return Mv(e,jv(t,n))}function Lv(e,t){return typeof e==`function`?e(t):e}function Rv(e){return e.split(`-`)[0]}function zv(e){return e.split(`-`)[1]}function Bv(e){return e===`x`?`y`:`x`}function Vv(e){return e===`y`?`height`:`width`}function Hv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Uv(e){return Bv(Hv(e))}function qte(e,t,n){n===void 0&&(n=!1);let r=zv(e),i=Uv(e),a=Vv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qv(o)),[o,qv(o)]}function Jte(e){let t=qv(e);return[Wv(e),t,Wv(t)]}function Wv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Gv=[`left`,`right`],Kv=[`right`,`left`],Yte=[`top`,`bottom`],Xte=[`bottom`,`top`];function Zte(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Kv:Gv:t?Gv:Kv;case`left`:case`right`:return t?Yte:Xte;default:return[]}}function Qte(e,t,n,r){let i=zv(e),a=Zte(Rv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Wv)))),a}function qv(e){let t=Rv(e);return Kte[t]+e.slice(t.length)}function $te(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$te(e)}function Yv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ene(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Xv(e,t=e?Wm(e):null){return!e||!e.isConnected||!t||ene(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var tne=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function nne(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Im(n)?n.host:null}function Zv(e){for(let t of Array.from(e.children))if(Am(t)===`summary`)return t;return null}function rne(e,t){let n=Zv(t);return!!n&&(e===n||$_(n,e))}function Qv(e){let t=e?Am(e):``;return e!=null&&e.matches(tne)&&(t!==`summary`||e.parentElement!=null&&Am(e.parentElement)===`details`&&Zv(e.parentElement)===e)&&(t!==`details`||Zv(e)==null)&&(t!==`input`||e.type!==`hidden`)}function $v(e){if(!Qv(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=nne(t)){let n=t!==e,r=Am(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Am(t)===`details`&&!t.open&&!rne(e,t)||t.hasAttribute(`hidden`)||!r&&!ine(t,n))return!1}return!0}function ine(e,t){let n=Wm(e);return t?n.display!==`none`:Xv(e,n)}function ey(e){let t=e.tabIndex;if(t<0){let t=Am(e);if(t===`details`||t===`audio`||t===`video`||Fm(e)&&e.isContentEditable)return 0}return t}function ty(e){if(Am(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ane(e,t){let n=ty(e);if(!n)return!0;let r=t.find(e=>{let t=ty(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ty(e);return t?.name===n.name&&t.form===n.form})===n}function ny(e){if(Fm(e)&&Am(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Fm(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ry(e,t){ny(e).forEach(e=>{Qv(e)&&t.push(e),ry(e,t)})}function iy(e,t,n){ny(e).forEach(e=>{Fm(e)&&e.matches(t)&&n.push(e),iy(e,t,n)})}function ay(e){return $v(e)&&ey(e)>=0}function oy(e){let t=[];return ry(e,t),t.filter($v)}function sy(e){let t=oy(e);return t.filter(e=>ey(e)>=0&&ane(e,t))}function cy(e,t){let n=sy(e),r=n.length;if(r===0)return;let i=Q_(Dv(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ly(e){return cy(Dv(e).body,1)||e}function uy(e){return cy(Dv(e).body,-1)||e}function dy(e,t){if(!e)return null;let n=sy(Dv(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function one(e){return dy(e,1)}function sne(e){return dy(e,-1)}function fy(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$_(n,r)}function cne(e){sy(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function py(e){let t=[];iy(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function my(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...my(e,t.id,n)])}function hy(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function gy(e){return`data-base-ui-${e}`}var _y=0;function vy(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(_y);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Ah;let o=requestAnimationFrame(a);return _y=o,()=>{_y===o&&(cancelAnimationFrame(o),_y=0)}}var yy={inert:new WeakMap,"aria-hidden":new WeakMap},by=`data-base-ui-inert`,xy={inert:new WeakSet,"aria-hidden":new WeakSet},Sy=new WeakMap,Cy=0;function wy(e){return xy[e]}function Ty(e){return e?Im(e)?e.host:Ty(e.parentNode):null}var Ey=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ty(t);return e.contains(n)?n:null}).filter(e=>e!=null),Dy=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Oy=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Am(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function ky(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Ey(t,e),u=i?Ey(t,a):[],d=new Set(u),f=i?Oy(t,Dy(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=yy[o],n=wy(o);c=n,s=e;let r=Ey(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Oy(t,Dy(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Sy.get(e)||0)+1;Sy.set(e,t),m.push(e),t===1&&e.setAttribute(by,``)}),Cy+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Sy.get(e)||0)-1;Sy.set(e,t),t||e.removeAttribute(by)}),--Cy,Cy||(yy.inert=new WeakMap,yy[`aria-hidden`]=new WeakMap,xy.inert=new WeakSet,xy[`aria-hidden`]=new WeakSet,Sy=new WeakMap)}}function Ay(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=Dv(e[0]).body;return ky(e,o,n,r,{mark:i,markerIgnoreElements:a})}var jy=0;function My(e,t=`mui`){let[n,r]=N.useState(e),i=e||n;return N.useEffect(()=>{n??(jy+=1,r(`${t}-${jy}`))},[n,t]),i}var Ny=Xm.useId;function Py(e,t){if(Ny!==void 0){let n=Ny();return e??(t?`${t}-${n}`:n)}return My(e,t)}var Fy={style:{transition:`none`}},Iy=`data-base-ui-click-trigger`,Ly={fallbackAxisSide:`end`},Ry={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zy=e(Xe()),By=N.createContext(null),Vy=()=>N.useContext(By),Hy=gy(`portal`);function Uy(e={}){let{ref:t,container:n,componentProps:r=jh,elementProps:i}=e,a=Py(),o=Vy()?.portalNode,[s,c]=N.useState(null),[l,u]=N.useState(null),d=eh(e=>{e!==null&&u(e)}),f=N.useRef(null);th(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Nm(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=Nh(`div`,r,{ref:[t,d],props:[{id:a,[Hy]:``},i]});return{portalNode:l,portalSubtree:s&&p?zy.createPortal(p,s):null}}var Wy=N.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=Uy({container:o,ref:t,componentProps:e,elementProps:c}),d=N.useRef(null),f=N.useRef(null),p=N.useRef(null),m=N.useRef(null),[h,g]=N.useState(null),_=N.useRef(!1),v=h?.modal,y=h?.open,b=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;N.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&fy(e)&&(e.type===`focusin`?_.current&&=(py(l),!1):(cne(l),_.current=!0))}return xv(bv(l,`focusin`,e,!0),bv(l,`focusout`,e,!0))},[l,v]),N.useEffect(()=>{!l||y!==!1||(py(l),_.current=!1)},[y,l]);let x=N.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,I.jsxs)(N.Fragment,{children:[u,(0,I.jsxs)(By.Provider,{value:x,children:[b&&l&&(0,I.jsx)(Av,{"data-type":`outside`,ref:d,onFocus:e=>{fy(e,l)?p.current?.focus():uy(h?h.domReference:null)?.focus()}}),b&&l&&(0,I.jsx)(`span`,{"aria-owns":l.id,style:Ry}),l&&zy.createPortal(a,l),b&&l&&(0,I.jsx)(Av,{"data-type":`outside`,ref:f,onFocus:e=>{fy(e,l)?m.current?.focus():(ly(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,vv(`focus-out`,e.nativeEvent)))}})]})]})});function Gy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Ky=class{nodesRef={current:[]};events=Gy();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qy=N.createContext(null),Jy=N.createContext(null),Yy=()=>N.useContext(qy)?.id||null,Xy=e=>{let t=N.useContext(Jy);return e??t};function Zy(e){let t=Py(),n=Xy(e),r=Yy();return th(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qy(e){let{children:t,id:n}=e,r=Yy();return(0,I.jsx)(qy.Provider,{value:N.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $y(e){let{children:t,externalTree:n}=e,r=Qm(()=>n??new Ky).current;return(0,I.jsx)(Jy.Provider,{value:r,children:t})}function eb(e){return e==null?e:`current`in e?e.current:e}function tb(e,t){let n=jm(ev(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var nb=20,rb=[];function ib(){rb=rb.filter(e=>e.deref()?.isConnected)}function ab(e){ib(),e&&Am(e)!==`body`&&(rb.push(new WeakRef(e)),rb.length>nb&&(rb=rb.slice(-20)))}function ob(){return ib(),rb[rb.length-1]?.deref()}function sb(e){return e?ay(e)?e:sy(e)[0]||e:null}function cb(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=oy(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ay(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function lb(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=eh(()=>b.current.floatingContext?.nodeId),S=i===!1,C=ov(_)&&S,w=N.useRef([`content`]),T=Sv(i),E=Sv(a),ee=Sv(l),D=Xy(p),O=Vy(),k=N.useRef(!1),te=N.useRef(!1),ne=N.useRef(!1),A=N.useRef(null),j=N.useRef(``),re=N.useRef(``),M=N.useRef(null),ie=N.useRef(null),ae=Sh(M,f,O?.beforeInsideRef),oe=Sh(ie,O?.afterInsideRef),se=A_(),ce=A_(),le=Ev(),ue=O!=null,de=cv(v),fe=eh((e=de)=>e?sy(e):[]),pe=eh(()=>m?.().filter(e=>e!=null)??[]);N.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&$_(de,Q_(Dv(de)))&&fe().length===0&&!C&&W_(e)}return bv(Dv(de),`keydown`,e)},[r,de,s,C,fe]),N.useEffect(()=>{if(r||!g)return;let e=Dv(de);function t(){ne.current=!1}function n(e){let t=ev(e),n=pe();ne.current=!($_(v,t)||$_(_,t)||$_(O?.portalNode,t)||n.some(e=>e===t||$_(e,t))),re.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}function i(){re.current=`keyboard`}return xv(bv(e,`pointerdown`,n,!0),bv(e,`pointerup`,t,!0),bv(e,`pointercancel`,t,!0),bv(e,`keydown`,i,!0))},[r,v,_,de,g,O,pe]),N.useEffect(()=>{if(r||!c)return;let e=Dv(de);function t(){te.current=!0,ce.start(0,()=>{te.current=!1})}function n(e){let t=ev(e);ay(t)&&(A.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=ev(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=pe(),f=n?.hasAttribute(gy(`focus-guard`))&&[M.current,ie.current,O?.beforeInsideRef.current,O?.afterInsideRef.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,eb(d),eb(u)].includes(n),p=!($_(_,n)||$_(v,n)||$_(n,v)||$_(O?.portalNode,n)||l.some(e=>e===n||$_(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>$_(e,n))||f||D&&(my(D.nodesRef.current,a).find(e=>$_(e.context?.elements.floating,n)||$_(e.context?.elements.domReference,n))||hy(D.nodesRef.current,a).find(e=>[e.context?.elements.floating,cv(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&de&&cb(de,w),o&&r!==_&&!Xv(i)&&Q_(e)===e.body){if(Fm(de)&&(de.focus(),o===`popup`)){le.request(()=>{de.focus()});return}let e=fe(),t=A.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||de;Fm(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!te.current&&(C||n!==ob())&&(k.current=!0,h.setOpen(!1,vv(gv,t)))})}function a(){ne.current||(b.current.insideReactTree=!0,se.start(0,()=>{b.current.insideReactTree=!1}))}let l=Fm(_)?_:null;if(!(!v&&!l))return xv(l&&bv(l,`focusout`,i),l&&bv(l,`pointerdown`,t),v&&bv(v,`focusin`,n),v&&bv(v,`focusout`,i),v&&O&&bv(v,`focusout`,a,!0))},[r,_,v,de,s,D,O,h,c,o,fe,C,x,w,b,se,ce,le,u,d,pe]),N.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(O?.portalNode?.querySelectorAll(`[${gy(`portal`)}]`)||[]),t=(D?hy(D.nodesRef.current,x()):[]).find(e=>ov(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ay([v,...e,M.current,ie.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,...pe(),t,eb(d),eb(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Ay([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,O,C,D,x,u,d,pe]),th(()=>{if(!g||r||!Fm(de))return;let e=Dv(de),t=Q_(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1||$_(de,t))return;let i=null,a=()=>(i??=fe(de),i[0]||de),o;o=r===!0||r===null?a():eb(r),o||=a();let s=$_(de,Q_(e));vy(o,{preventScroll:o===de,shouldFocus(){if(s)return!0;let t=Q_(e);return!(t!==o&&$_(de,t))}})})},[r,g,de,fe,T,ee]),th(()=>{if(r||!de)return;let e=Dv(de);ab(Q_(e));function t(e){if(e.open||(j.current=tb(e.nativeEvent,re.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(k.current=!0),e.reason===`outside-press`)if(e.nested)k.current=!1;else if(K_(e.nativeEvent)||q_(e.nativeEvent))k.current=!1;else{let e=!1;Dv(de).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?k.current=!1:k.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(j.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`)return _?.isConnected?_:ob()||null;let n=_?.isConnected?_:ob();return eb(t)||n||null}return()=>{y.off(`openchange`,t);let r=Q_(e),i=pe(),a=$_(v,r)||i.some(e=>e===r||$_(e,r))||D&&my(D.nodesRef.current,x(),!1).some(e=>$_(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=sb(s),n=typeof o!=`boolean`;o&&!k.current&&Fm(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),k.current=!1})}},[r,v,de,E,y,D,_,x,pe]),th(()=>{if(!F_||g||!v)return;let e=Q_(Dv(v));!Fm(e)||!iv(e)||$_(v,e)&&e.blur()},[g,v]),th(()=>{if(!(r||!O))return O.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{O.setFocusManagerState(null)}},[r,O,s,g,h,c,_]),th(()=>{if(!(r||!de))return cb(de,w),()=>{queueMicrotask(ib)}},[r,de,w]);let me=!r&&(s?!C:!0)&&(ue||s);return(0,I.jsxs)(N.Fragment,{children:[me&&(0,I.jsx)(Av,{"data-type":`inside`,ref:ae,onFocus:e=>{if(s){let e=fe();vy(e[e.length-1])}else O?.portalNode&&(k.current=!1,fy(e,O.portalNode)?ly(_)?.focus():eb(d??O.beforeOutsideRef)?.focus())}}),n,me&&(0,I.jsx)(Av,{"data-type":`inside`,ref:oe,onFocus:e=>{s?vy(fe()[0]):O?.portalNode&&(c&&(k.current=!0),fy(e,O.portalNode)?uy(_)?.focus():eb(u??O.afterOutsideRef)?.focus())}})]})}function ub(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=pv}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=N.useRef(void 0),f=Ev(),p=A_(),m=N.useMemo(()=>{function e(e,t,n,r){let i=vv(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||J_(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=ev(o);if(iv(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}J_(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return N.useMemo(()=>n?{reference:m}:jh,[n,m])}function db(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function fb(e){return e!=null&&e.clientX!=null}function pb(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=N.useRef(!1),u=N.useRef(null),[d,f]=N.useState(),[p,m]=N.useState([]),h=eh(e=>{i.set(`positionReference`,e)}),g=eh((e,t,n)=>{l.current||c.current.openEvent&&!fb(c.current.openEvent)||i.set(`positionReference`,db(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=eh(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=J_(d)?o:a;N.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=jm(o);function r(t){$_(o,ev(t))?e():g(t.clientX,t.clientY)}return!c.current.openEvent||fb(c.current.openEvent)?u.current=bv(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),N.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),N.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),N.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=N.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return N.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var mb={intentional:`onClick`,sloppy:`onPointerDown`};function hb(){return!1}function gb(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function _b(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=hb,referencePressEvent:s=`sloppy`,bubbles:c,externalTree:l}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=Xy(l),h=eh(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=eh(()=>a),{escapeKey:y,outsidePress:b}=gb(c),x=N.useRef(!1),S=N.useRef(!1),C=N.useRef(!1),w=N.useRef(!1),T=N.useRef(``),E=N.useRef(null),ee=A_(),D=A_(),O=eh(()=>{D.clear(),p.current.insideReactTree=!1}),k=eh(e=>{let t=p.current.floatingContext?.nodeId;return(m?my(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),te=eh(e=>nv(e,u.select(`floatingElement`))||nv(e,u.select(`domReferenceElement`))),ne=eh(e=>{o()&&u.setOpen(!1,vv(pv,e.nativeEvent))}),A=eh(e=>{if(!d||!n||!r||e.key!==`Escape`||w.current||!y&&k(`__escapeKeyBubbles`))return;let t=vv(zte,G_(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),j=eh(()=>{p.current.insideReactTree=!0,D.start(0,O)}),re=eh(e=>{if(!d||!n||e.button!==0)return;let t=ev(e.nativeEvent);$_(u.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),M=eh(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});N.useEffect(()=>{if(!d||!n)return;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new k_,t=new k_;function i(){e.clear(),w.current=!0}function a(){e.start(Hm()?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&my(m.nodesRef.current,t).some(t=>nv(e,t.context?.elements.floating));return te(e)||n}function D(e){if(l(e)){e.type!==`click`&&!te(e)&&(t.clear(),C.current=!1),O();return}if(p.current.insideReactTree){O();return}let n=ev(e),r=`[${gy(`inert`)}]`,i=Pm(n)?n.getRootNode():null,a=Array.from((Im(i)?i:Dv(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>$_(e,n))))return;let s=Pm(n)?n:null;for(;s&&!Um(s);){let e=Km(s);if(Um(e)||!Pm(e))break;s=e}if(!(a.length&&Pm(n)&&!rv(n)&&!$_(n,u.select(`floatingElement`))&&a.every(e=>!$_(s,e)))){if(Fm(n)&&!(`touches`in e)){let t=Um(n),r=Wm(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||k(`__outsidePressBubbles`)||(u.setOpen(!1,vv(Lte,e)),O())}}}function ne(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||te(e)||D(e)}function j(e){if(c()!==`sloppy`||!u.select(`open`)||!n||te(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ee.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function re(e,t){let n=ev(e);if(!n)return;let r=bv(n,e.type,()=>{t(e),r()})}function M(e){T.current=`touch`,re(e,j)}function ie(e){ee.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&re(e,e=>{e.type===`pointerdown`?ne(e):D(e)})}function ae(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,O())}}}function oe(e){if(c()!==`sloppy`||!E.current||te(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(D(e),ee.clear(),E.current=null)}function se(e){re(e,oe)}function ce(e){c()!==`sloppy`||!E.current||te(e)||(E.current.dismissOnTouchEnd&&D(e),ee.clear(),E.current=null)}function le(e){re(e,ce)}let ue=Dv(f),de=xv(r&&xv(bv(ue,`keydown`,A),bv(ue,`compositionstart`,i),bv(ue,`compositionend`,a)),_&&xv(bv(ue,`click`,ie,!0),bv(ue,`pointerdown`,ie,!0),bv(ue,`pointerup`,ae,!0),bv(ue,`pointercancel`,ae,!0),bv(ue,`mousedown`,ie,!0),bv(ue,`mouseup`,ae,!0),bv(ue,`touchstart`,M,!0),bv(ue,`touchmove`,se,!0),bv(ue,`touchend`,le,!0)));return()=>{de(),e.clear(),t.clear(),s(),C.current=!1}},[p,f,r,_,g,d,n,y,b,A,O,v,k,te,m,u,ee]),N.useEffect(O,[g,O]);let ie=N.useMemo(()=>({onKeyDown:A,[mb[s]]:ne,...s!==`intentional`&&{onClick:ne}}),[A,ne,s]),ae=N.useMemo(()=>({onKeyDown:A,onPointerDown:M,onMouseDown:M,onClickCapture:j,onMouseDownCapture(e){j(),re(e)},onPointerDownCapture(e){j(),re(e)},onMouseUpCapture:j,onTouchEndCapture:j,onTouchMoveCapture:j}),[A,j,re,M]);return N.useMemo(()=>n?{reference:ie,floating:ae,trigger:ie}:{},[n,ie,ae])}function vb(e,t,n){let{reference:r,floating:i}=e,a=Hv(t),o=Uv(t),s=Vv(o),c=Rv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(zv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function yb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lv(t,e),p=Jv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var bb=50,xb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<bb&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=vb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Sb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rv(r),_=Hv(o),v=Rv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qv(o)]:Jte(o)),x=p!==`none`;!d&&x&&b.push(...Qte(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qte(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Hv(t))||T.every(e=>Hv(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Cb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wb(e){return Gte.some(t=>e[t]>=0)}var Tb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Lv(e,t);switch(i){case`referenceHidden`:{let e=Cb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wb(e)}}}case`escaped`:{let e=Cb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wb(e)}}}default:return{}}}}},Eb=new Set([`left`,`top`]);async function Db(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rv(n),s=zv(n),c=Hv(n)===`y`,l=Eb.has(o)?-1:1,u=a&&c?-1:1,d=Lv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ob=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Db(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hv(Rv(i)),p=Bv(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Iv(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Iv(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ab=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lv(e,t),u={x:n,y:r},d=Hv(i),f=Bv(d),p=u[f],m=u[d],h=Lv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Eb.has(Rv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},jb=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Lv(e,t),u=await o.detectOverflow(t,l),d=Rv(i),f=zv(i),p=Hv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=jv(h-u[g],v),x=jv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Mv(u.left,0),t=Mv(u.right,0),n=Mv(u.top,0),r=Mv(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Mv(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Mv(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Mb(e){let t=Wm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Fm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nv(n)!==a||Nv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Nb(e){return Pm(e)?e:e.contextElement}function Pb(e){let t=Nb(e);if(!Fm(t))return Fv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Mb(t),o=(a?Nv(n.width):n.width)/r,s=(a?Nv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var lne=Fv(0);function Fb(e){let t=jm(e);return!Hm()||!t.visualViewport?lne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function une(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jm(e)?!1:t}function Ib(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Nb(e),o=Fv(1);t&&(r?Pm(r)&&(o=Pb(r)):o=Pb(e));let s=une(a,n,r)?Fb(a):Fv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=jm(a),t=r&&Pm(r)?jm(r):r,n=e,i=Ym(n);for(;i&&r&&t!==n;){let e=Pb(i),t=i.getBoundingClientRect(),r=Wm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=jm(i),i=Ym(n)}}return Yv({width:u,height:d,x:c,y:l})}function Lb(e,t){let n=Gm(e).scrollLeft;return t?t.left+n:Ib(Mm(e)).left+n}function Rb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lb(e,n),y:n.top+t.scrollTop}}function dne(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Mm(r),s=t?Rm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fv(1),u=Fv(0),d=Fm(r);if((d||!d&&!a)&&((Am(r)!==`body`||Lm(o))&&(c=Gm(r)),d)){let e=Ib(r);l=Pb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rb(o,c):Fv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function fne(e){return Array.from(e.getClientRects())}function pne(e){let t=Mm(e),n=Gm(e),r=e.ownerDocument.body,i=Mv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Mv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Lb(e),s=-n.scrollTop;return Wm(r).direction===`rtl`&&(o+=Mv(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var zb=25;function mne(e,t){let n=jm(e),r=Mm(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Hm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Lb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=zb&&(a-=o)}else l<=zb&&(a+=l);return{width:a,height:o,x:s,y:c}}function hne(e,t){let n=Ib(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fm(e)?Pb(e):Fv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Bb(e,t,n){let r;if(t===`viewport`)r=mne(e,n);else if(t===`document`)r=pne(Mm(e));else if(Pm(t))r=hne(t,n);else{let n=Fb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yv(r)}function Vb(e,t){let n=Km(e);return n===t||!Pm(n)||Um(n)?!1:Wm(n).position===`fixed`||Vb(n,t)}function gne(e,t){let n=t.get(e);if(n)return n;let r=Jm(e,[],!1).filter(e=>Pm(e)&&Am(e)!==`body`),i=null,a=Wm(e).position===`fixed`,o=a?Km(e):e;for(;Pm(o)&&!Um(o);){let t=Wm(o),n=Vm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Lm(o)&&!n&&Vb(e,o))?r=r.filter(e=>e!==o):i=t,o=Km(o)}return t.set(e,r),r}function _ne(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Rm(t)?[]:gne(t,this._c):[].concat(n),r],o=Bb(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Bb(t,a[e],i);s=Mv(n.top,s),c=jv(n.right,c),l=jv(n.bottom,l),u=Mv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vne(e){let{width:t,height:n}=Mb(e);return{width:t,height:n}}function yne(e,t,n){let r=Fm(t),i=Mm(t),a=n===`fixed`,o=Ib(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fv(0);function l(){c.x=Lb(i)}if(r||!r&&!a)if((Am(t)!==`body`||Lm(i))&&(s=Gm(t)),r){let e=Ib(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rb(i,s):Fv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Hb(e){return Wm(e).position===`static`}function Ub(e,t){if(!Fm(e)||Wm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Mm(e)===n&&(n=n.ownerDocument.body),n}function Wb(e,t){let n=jm(e);if(Rm(e))return n;if(!Fm(e)){let t=Km(e);for(;t&&!Um(t);){if(Pm(t)&&!Hb(t))return t;t=Km(t)}return n}let r=Ub(e,t);for(;r&&dee(r)&&Hb(r);)r=Ub(r,t);return r&&Um(r)&&Hb(r)&&!Vm(r)?n:r||mee(e)||n}var bne=async function(e){let t=this.getOffsetParent||Wb,n=this.getDimensions,r=await n(e.floating);return{reference:yne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xne(e){return Wm(e).direction===`rtl`}var Sne={convertOffsetParentRelativeRectToViewportRelativeRect:dne,getDocumentElement:Mm,getClippingRect:_ne,getOffsetParent:Wb,getElementRects:bne,getClientRects:fne,getDimensions:vne,getScale:Pb,isElement:Pm,isRTL:xne};function Gb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cne(e,t){let n=null,r,i=Mm(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Pv(d),h=Pv(i.clientWidth-(u+f)),g=Pv(i.clientHeight-(d+p)),_=Pv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Mv(0,jv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Gb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Kb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Nb(e),u=i||a?[...l?Jm(l):[],...t?Jm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Cne(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ib(e):null;c&&g();function g(){let t=Ib(e);h&&!Gb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wne=Ob,Tne=kb,Ene=Sb,Dne=jb,One=Tb,kne=Ab,Ane=(e,t,n)=>{let r=new Map,i={platform:Sne,...n},a={...i.platform,_c:r};return xb(e,t,{...i,platform:a})},qb=typeof document<`u`?N.useLayoutEffect:function(){};function Jb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Jb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Yb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xb(e,t){let n=Yb(e);return Math.round(t*n)/n}function Zb(e){let t=N.useRef(e);return qb(()=>{t.current=e}),t}function jne(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=N.useState(r);Jb(f,r)||p(r);let[m,h]=N.useState(null),[g,_]=N.useState(null),v=N.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=N.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=N.useRef(null),C=N.useRef(null),w=N.useRef(u),T=c!=null,E=Zb(c),ee=Zb(i),D=Zb(l),O=N.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),Ane(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!Jb(w.current,t)&&(w.current=t,zy.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);qb(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=N.useRef(!1);qb(()=>(k.current=!0,()=>{k.current=!1}),[]),qb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let te=N.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ne=N.useMemo(()=>({reference:b,floating:x}),[b,x]),A=N.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=Xb(ne.floating,u.x),r=Xb(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Yb(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:O,refs:te,elements:ne,floatingStyles:A}),[u,O,te,ne,A])}var Mne=(e,t)=>{let n=wne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nne=(e,t)=>{let n=Tne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pne=(e,t)=>({fn:kne(e).fn,options:[e,t]}),Fne=(e,t)=>{let n=Ene(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ine=(e,t)=>{let n=Dne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lne=(e,t)=>{let n=One(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qb=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(hh(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Rne=i((e=>{var t=Ke(),n=om();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),zne=i(((e,t)=>{t.exports=Rne()})),$b=om(),Bne=zne(),Vne=Oh(19)?Une:Wne;function ex(e,t,n,r,i){return Vne(e,t,n,r,i)}function Hne(e,t,n,r,i){let a=N.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$b.useSyncExternalStore)(e.subscribe,a,a)}jte({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,$b.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Une(e,t,n,r,i){let a=Ate();if(!a)return Hne(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function Wne(e,t,n,r,i){return(0,Bne.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gne=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ex(this,e,t,n,r)}},tx=class extends Gne{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){N.useDebugValue(e);let n=this;th(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;th(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;th(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){N.useDebugValue(e);let n=this,r=t!==void 0;th(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return N.useDebugValue(e),ex(this,this.selectors[e],t,n,r)}useContextCallback(e,t){N.useDebugValue(e);let n=eh(t??Ah);this.context[e]=n}useStateSetter(e){let t=N.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Kne={open:Qb(e=>e.open),transitionStatus:Qb(e=>e.transitionStatus),domReferenceElement:Qb(e=>e.domReferenceElement),referenceElement:Qb(e=>e.positionReference??e.referenceElement),floatingElement:Qb(e=>e.floatingElement),floatingId:Qb(e=>e.floatingId)},nx=class extends tx{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gy(),nested:n,triggerElements:i},Kne),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Y_(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function qne(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=N.useRef(null);r===void 0&&f.current===null&&(f.current=new nx({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),th(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Pm(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function rx(e,t=!1,n=!1){let[r,i]=N.useState(e&&t?`idle`:void 0),[a,o]=N.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),th(()=>{if(!e&&a&&r!==`ending`&&n){let e=Tv.request(()=>{i(`ending`)});return()=>{Tv.cancel(e)}}},[e,a,r,n]),th(()=>{if(!e||t)return;let n=Tv.request(()=>{i(void 0)});return()=>{Tv.cancel(n)}},[t,e]),th(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Tv.request(()=>{i(`idle`)});return()=>{Tv.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var ix=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Jne={[ix.startingStyle]:``},Yne={[ix.endingStyle]:``},ax={transitionStatus(e){return e===`starting`?Jne:e===`ending`?Yne:null}};function ox(e,t=!1,n=!0){let r=Ev();return eh((i,a=null)=>{r.cancel();let o=eb(e);if(o==null)return;let s=o,c=()=>{zy.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=ix.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function sx(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=eh(i),o=ox(r,n,!1);N.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var cx={tabIndex:-1,[X_]:``};function lx(e,t,n=!1){let r=Py(),i=Yy()!=null,a=N.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return qne({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function Xne(e,t){let n=N.useRef(null),r=N.useRef(null);return N.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function ux(e,t,n){let r=n?.id??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function dx(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Xne(e,n),o=eh(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return th(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function fx(e){let t=e.useState(`open`);th(()=>{if(!t){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let n=e.context.triggerElements.size,r={};if(e.state.triggerCount!==n&&(r.triggerCount=n),!e.select(`activeTriggerId`)&&n===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;r.activeTriggerId=e,r.activeTriggerElement=n}}(r.triggerCount!==void 0||r.activeTriggerId!==void 0)&&e.update(r)},[t,e,e.useState(`triggerCount`)])}function px(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=rx(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=eh(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),s=t.useState(`preventUnmountingOnClose`);return sx({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}function mx(e,t){e.useSyncedValues(t),th(()=>()=>{e.update({activeTriggerProps:jh,inactiveTriggerProps:jh,popupProps:jh})},[e])}function hx(e,t){th(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),th(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var gx=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Zne(){return new nx({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new gx,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function _x(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Zne(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:jh,inactiveTriggerProps:jh,popupProps:jh}}function vx(e,t,n=!1){return new nx({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var yx=Qb(e=>e.triggerIdProp??e.activeTriggerId),bx=Qb(e=>e.openProp??e.open),xx=Qb(e=>(e.popupElement?.id??e.floatingId)||void 0);function Sx(e,t){return t!==void 0&&bx(e)&&yx(e)===t}function Qne(e,t){return Sx(e,t)?!0:t!==void 0&&bx(e)&&yx(e)==null&&e.triggerCount===1}var Cx={open:bx,mounted:Qb(e=>e.mounted),transitionStatus:Qb(e=>e.transitionStatus),floatingRootContext:Qb(e=>e.floatingRootContext),triggerCount:Qb(e=>e.triggerCount),preventUnmountingOnClose:Qb(e=>e.preventUnmountingOnClose),payload:Qb(e=>e.payload),activeTriggerId:yx,activeTriggerElement:Qb(e=>e.mounted?e.activeTriggerElement:null),popupId:xx,isTriggerActive:Qb((e,t)=>t!==void 0&&yx(e)===t),isOpenedByTrigger:Qb((e,t)=>Sx(e,t)),isMountedByTrigger:Qb((e,t)=>t!==void 0&&yx(e)===t&&e.mounted),triggerProps:Qb((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Qb((e,t)=>Qne(e,t)?xx(e):void 0),popupProps:Qb(e=>e.popupProps),popupElement:Qb(e=>e.popupElement),positionerElement:Qb(e=>e.positionerElement)};function $ne(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Py(),a=Yy()!=null,o=Qm(()=>new nx({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new gx,floatingId:i,syncOnly:!1,nested:a})).current;return th(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Pm(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function ere(e={}){let{nodeId:t,externalTree:n}=e,r=$ne(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=N.useState(null),[f,p]=N.useState(void 0),[m,h]=N.useState(void 0),g=N.useRef(null),_=Xy(n),v=N.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=jne({...e,elements:{...v,...u&&{reference:u}}}),b=Pm(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=N.useCallback(e=>{let t=Pm(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=N.useCallback(e=>{(Pm(e)||e===null)&&(g.current=e,p(e)),(Pm(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!Pm(e))&&y.refs.setReference(e)},[y.refs,p]),w=N.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=N.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=N.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),ee=N.useMemo(()=>({...y,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return th(()=>{s&&(g.current=s)},[s]),th(()=>{i.context.dataRef.current.floatingContext=ee;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=ee)}),N.useMemo(()=>({...y,context:ee,refs:T,elements:E,rootStore:i}),[y,T,E,ee,i])}var wx=z_&&L_;function tre(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=N.useRef(!1),c=N.useRef(null),l=N.useRef(!0),u=A_();N.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=jm(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&Fm(e)&&e===Q_(Dv(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return xv(bv(t,`blur`,r),wx&&bv(t,`keydown`,a,!0),wx&&bv(t,`pointerdown`,o,!0))},[i,n]),N.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Pm(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=N.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=ev(t.nativeEvent);if(Pm(a)){if(wx&&!t.relatedTarget){if(!l.current&&!iv(a))return}else if(!sv(a))return}let o=tv(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,vv(hv,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,vv(hv,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Pm(n)&&n.hasAttribute(gy(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Q_(Dv(e));!n&&t===e||$_(o.current.floatingContext?.refs.floating.current,t)||$_(e,t)||a||tv(n??t,i.context.triggerElements)||i.setOpen(!1,vv(hv,r))})}}},[o,r,i,u]);return N.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var nre=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new k_,this.restTimeout=new k_,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Tx=new WeakMap;function Ex(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Tx.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Tx.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Dx(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Tx.get(n);a&&a!==e&&Ex(a),Ex(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Tx.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ox(e){let t=e.context.dataRef.current,n=Qm(()=>t.hoverInteractionState??nre.create()).current;return t.hoverInteractionState||=n,D_(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function kx(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Xy(),d=Yy(),f=Ox(a),p=A_(),m=eh(()=>dv(l.current.openEvent?.type,f.interactedInside)),h=eh(()=>Ite(l.current.openEvent?.type)),g=eh(()=>{Ex(f)});th(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),N.useEffect(()=>g,[g]),th(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&Pm(c)&&s){let e=c,t=s,n=Dv(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r;return Dx(f,{scopeElement:f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),N.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&my(u.nodesRef.current,d).length>0)}function t(e){let t=lv(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,vv(mv,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=ev(e);if(!av(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,_),g()}function h(n){if(e()&&u){u.events.on(`floating.closed`,_);return}if(tv(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&Pm(o)&&my(u.nodesRef.current,r,!1).some(e=>$_(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),m()||t(n)}}function _(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,_),a.setOpen(!1,vv(mv,t)),u.events.emit(`floating.closed`,t)})}let v=s;return xv(v&&bv(v,`mouseenter`,c),v&&bv(v,`mouseleave`,h),v&&bv(v,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,_)})},[n,s,a,l,r,i,m,g,f,u,d,p])}var rre={current:null};function Ax(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=rre,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p}=t,m=`rootStore`in e?e.rootStore:e,{dataRef:h,events:g}=m.context,_=Xy(l),v=Ox(m),y=N.useRef(!1),b=Sv(i),x=Sv(r),S=Sv(o),C=Sv(n),w=Sv(p),T=Sv(f),E=eh(()=>dv(h.current.openEvent?.type,v.interactedInside)),ee=eh(()=>w.current?.()!==!1),D=eh((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!$_(e,t);if(!Pm(n))return!1;let i=n;return r.hasMatchingElement(e=>$_(e,i))&&(!e||!$_(e,i))}),O=eh(()=>{v.handler&&=(Dv(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),k=eh(()=>{Ex(v)});return u&&(v.handleCloseOptions=b.current?.__options),N.useEffect(()=>O,[O]),N.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===mv,O(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,O]),N.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=lv(x.current,`close`,v.pointerType);n?v.openChangeTimeout.start(n,()=>{m.setOpen(!1,vv(mv,e)),_?.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,vv(mv,e)),_?.events.emit(`floating.closed`,e))}let t=c.current??(u?m.select(`domReferenceElement`):null);if(!Pm(t))return;function r(e){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!J_(v.pointerType))return;let t=uv(S.current),n=lv(x.current,`open`,v.pointerType),r=ev(e),i=e.currentTarget??null,o=m.select(`domReferenceElement`),s=i;if(Pm(r)&&!m.context.triggerElements.hasElement(r)){for(let e of m.context.triggerElements.elements())if($_(e,r)){s=e;break}}Pm(i)&&Pm(o)&&!m.context.triggerElements.hasElement(i)&&$_(i,o)&&(s=o);let c=s==null?!1:D(o,s,r),l=m.select(`open`),u=T.current?.()??m.select(`transitionStatus`)===`ending`,d=!l&&u&&y.current,f=!c&&Pm(s)&&Pm(o)&&$_(o,s)&&d,p=t>0&&!n,h=c&&(l||d)||f,g=!l||c;if(h){ee()&&m.setOpen(!0,vv(mv,e,s));return}p||(n?v.openChangeTimeout.start(n,()=>{g&&ee()&&m.setOpen(!0,vv(mv,e,s))}):g&&ee()&&m.setOpen(!0,vv(mv,e,s)))}function i(t){if(E()){k();return}O();let n=Dv(m.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let r=h.current.floatingContext??d?.();if(!tv(t.relatedTarget,m.context.triggerElements)){if(b.current&&r){m.select(`open`)||v.openChangeTimeout.clear();let i=c.current;v.handler=b.current({...r,tree:_,x:t.clientX,y:t.clientY,onClose(){k(),O(),C.current&&!E()&&i===m.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,v.handler),v.handler(t);return}(v.pointerType!==`touch`||!$_(m.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?xv(bv(t,`mousemove`,r,{once:!0}),bv(t,`mouseenter`,r),bv(t,`mouseleave`,i)):xv(bv(t,`mouseenter`,r),bv(t,`mouseleave`,i))},[O,k,h,x,m,n,b,v,u,D,E,a,s,S,c,_,C,d,T,ee]),N.useMemo(()=>{if(!n)return;function e(e){v.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=m.select(`domReferenceElement`),i=m.select(`open`),o=D(r,n,e.target);if(a&&!J_(v.pointerType))return;if(i&&o&&v.handleCloseOptions?.blockPointerEvents){let e=m.select(`floatingElement`);e&&Dx(v,{scopeElement:v.handleCloseOptions?.getScope?.()??n.ownerDocument.body,referenceElement:n,floatingElement:e})}let s=uv(S.current);if(i&&!o||s===0||!o&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;v.restTimeout.clear();function c(){if(v.restTimeoutPending=!1,E())return;let e=m.select(`open`);!v.blockMouseMove&&(!e||o)&&ee()&&m.setOpen(!0,vv(mv,t,n))}v.pointerType===`touch`?zy.flushSync(()=>{c()}):o&&i?c():(v.restTimeoutPending=!0,v.restTimeout.start(s,c))}}},[n,v,E,D,a,m,S,ee])}var jx=.1,ire=jx*jx,Mx=.5;function Nx(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Px(e,t,n,r,i,a,o,s,c,l){let u=!1;return Nx(e,t,n,r,i,a)&&(u=!u),Nx(e,t,i,a,o,s)&&(u=!u),Nx(e,t,o,s,c,l)&&(u=!u),Nx(e,t,c,l,n,r)&&(u=!u),u}function Fx(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ix(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Lx(e={}){let{blockPointerEvents:t=!1}=e,n=new k_,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*ire;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ev(r),g=r.type===`mouseleave`,_=$_(u,h),v=$_(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Pm(r.relatedTarget)&&$_(u,r.relatedTarget))return;function y(){return!!(s&&my(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,ee=(T?x:S).left,D=(T?x:S).right,O=(E?x:S).top,k=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let te=!1;switch(c){case`top`:te=Ix(d,f,ee,x.top+1,D,S.bottom-1);break;case`bottom`:te=Ix(d,f,ee,S.top+1,D,x.bottom-1);break;case`left`:te=Ix(d,f,S.right-1,k,x.left+1,O);break;case`right`:te=Ix(d,f,x.right-1,k,S.left+1,O);break;default:}if(te)return;if(l&&!Fx(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let ne=!1;switch(c){case`top`:{let n=T?Mx/2:Mx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Mx+1,o=C||T?S.bottom-Mx:S.top,s=C?T?S.bottom-Mx:S.top:S.bottom-Mx;ne=Px(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Mx/2:Mx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Mx,o=C||T?S.top+Mx:S.bottom,s=C?T?S.top+Mx:S.bottom:S.top+Mx;ne=Px(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Mx/2:Mx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Mx+1,o=w||E?S.right-Mx:S.left,s=w?E?S.right-Mx:S.left:S.right-Mx;ne=Px(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Mx/2:Mx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Mx,o=w||E?S.left+Mx:S.right,s=w?E?S.left+Mx:S.right:S.left+Mx;ne=Px(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}ne?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Rx={...Cx,disabled:Qb(e=>e.disabled),instantType:Qb(e=>e.instantType),isInstantPhase:Qb(e=>e.isInstantPhase),trackCursorAxis:Qb(e=>e.trackCursorAxis),disableHoverablePopup:Qb(e=>e.disableHoverablePopup),lastOpenChangeReason:Qb(e=>e.openChangeReason),closeOnClick:Qb(e=>e.closeOnClick),closeDelay:Qb(e=>e.closeDelay),hasViewport:Qb(e=>e.hasViewport)},zx=class e extends tx{constructor(e,t,n=!1){let r=new gx,i={...Bx(),...e};i.floatingRootContext=vx(r,t,n),super(i,{popupRef:N.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Rx)}setOpen=(e,t)=>{let n=t.reason,r=n===mv,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0),ux(r,e,t.trigger),this.update(r)};r?zy.flushSync(o):o()};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,vv(pv,e))}static useStore(t,n){return lx(t,(t,r)=>new e(n,t,r)).store}};function Bx(){return{..._x(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Vx=C_(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zx.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});w_(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),p.useSyncedValue(`disabled`,t),fx(p);let{forceUnmount:y,transitionStatus:b}=px(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=N.useRef(null);th(()=>{m&&t&&p.setOpen(!1,vv(Bte))},[m,t,p]),th(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),th(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=N.useCallback(()=>{p.setOpen(!1,vv(_v))},[p]);N.useImperativeHandle(o,()=>({unmount:y,close:T}),[y,T]);let E=h||_||!t&&a!==`none`;return(0,I.jsxs)(T_.Provider,{value:p,children:[E&&(0,I.jsx)(Hx,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Hx({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=_b(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=pb(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return mx(e,{activeTriggerProps:N.useMemo(()=>ih(a.reference,i.reference),[a.reference,i.reference]),inactiveTriggerProps:N.useMemo(()=>ih(a.trigger,i.trigger),[a.trigger,i.trigger]),popupProps:N.useMemo(()=>ih(cx,a.floating,i.floating),[a.floating,i.floating])}),null}var Ux=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=ix.startingStyle]=`startingStyle`,e[e.endingStyle=ix.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Wx=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Gx={[Wx.popupOpen]:``},Kx={[Wx.popupOpen]:``,[Wx.pressed]:``},qx={[Ux.open]:``},Jx={[Ux.closed]:``},Yx={[Ux.anchorHidden]:``},Xx={open(e){return e?Gx:null}},Zx={open(e){return e?Kx:null}},Qx={open(e){return e?qx:Jx},anchorHidden(e){return e?Yx:null}};function $x(e){return Py(e,`base-ui`)}var eS=N.createContext(void 0);function tS(){return N.useContext(eS)}var nS=function(e){return e[e.popupOpen=Wx.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),rS=`data-base-ui-tooltip-trigger`;function iS(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Pm(n))return n}}let t=e.target;return Pm(t)?t:null}function aS(e){let t=e;for(;t;){if(t.hasAttribute(rS))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&Pm(n.host)?n.host:null}return null}var oS=Mte(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=E_(!0),m=a?.store??p;if(!m)throw Error(hh(82));let h=$x(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=N.useRef(null),b=c??600,x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=dx(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=tS(),{delayRef:T,isInstantPhase:E,hasProvider:ee}=Hte(v,{open:_}),D=Ox(v);m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=s??O,te=Sv(k),ne=m.useState(`trackCursorAxis`),A=m.useState(`disableHoverablePopup`),j=N.useRef(!1),re=A_(),M=N.useRef(void 0);function ie(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return ee&&(n=t===0?0:c??e??b),n}function ae(e){let t=y.current;if(!t||!e)return!1;let n=aS(e);return n!==null&&n!==t&&$_(t,n)}function oe(e){let t=ae(e);return j.current=t,t&&(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1,re.clear()),t}let se=Ax(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!A&&ne!==`both`?Lx():null,restMs:ie,delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return u==null&&ee&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!j.current}}),ce=tre(v,{enabled:!k}).reference,le=e=>{let t=j.current,n=iS(e),r=oe(n),i=y.current,a=i&&n&&$_(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,vv(mv,e));return}if(t&&!r&&a&&!te.current&&!m.select(`open`)&&i&&J_(M.current)){let t=()=>{!j.current&&!te.current&&!m.select(`open`)&&m.setOpen(!0,vv(mv,e,i))},n=ie();n===0?(re.clear(),t()):re.start(n,t)}},ue=m.useState(`triggerProps`,C);return Nh(`button`,e,{state:{open:_},ref:[t,S,y],props:[se,ce,C||ne!==`none`?ue:void 0,{onMouseOver(e){le(e.nativeEvent)},onFocus(e){ae(iS(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){j.current=!1,re.clear(),M.current=void 0},onPointerEnter(e){M.current=e.pointerType},onPointerDown(e){M.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[nS.triggerDisabled]:k?``:void 0,[rS]:k?void 0:``},f],stateAttributesMapping:Xx})}),sS=N.createContext(void 0);function cS(){let e=N.useContext(sS);if(e===void 0)throw Error(hh(70));return e}var lS=N.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=Uy({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,I.jsxs)(N.Fragment,{children:[l,c&&zy.createPortal(n,c)]})}),uS=N.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return E_().useState(`mounted`)||n?(0,I.jsx)(sS.Provider,{value:n,children:(0,I.jsx)(lS,{ref:t,...r})}):null}),dS=N.createContext(void 0);function fS(){let e=N.useContext(dS);if(e===void 0)throw Error(hh(71));return e}var pS=N.createContext(void 0);function mS(){return N.useContext(pS)?.direction??`ltr`}var hS=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Lv(e,t)||{};if(l==null)return{};let f=Jv(u),p={x:n,y:r},m=Uv(i),h=Vv(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,ee=Math.min(f[v],E),D=Math.min(f[y],E),O=ee,k=w-g[h]-D,te=w/2-g[h]/2+T,ne=Iv(O,te,k),A=!c.arrow&&zv(i)!=null&&te!==ne&&a.reference[h]/2-(te<O?ee:D)-g[h]/2<0,j=A?te<O?te-O:te-k:0;return{[m]:p[m]+j,data:{[m]:ne,centerOffset:te-ne-j,...A&&{alignmentOffset:j}},reset:A}}}),gS=(e,t)=>({...hS(e),options:[e,t]}),_S={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Lne().fn(e)).data?.referenceHidden||a}}}},vS={sideX:`left`,sideY:`top`},yS={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=jm(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:vS};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Dv(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Rv(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:vS.sideX,g=f===`top`?`bottom`:vS.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function bS(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function xS(e,t,n){let{rects:r,placement:i}=e;return{side:bS(t,Rv(i),n),align:zv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function SS(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,inline:f,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=N.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,ee=typeof t==`function`?t:void 0,D=eh(ee),O=ee?D:t,k=Sv(t),te=Sv(h),ne=mS()===`rtl`,A=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":ne?`left`:`right`,"inline-start":ne?`right`:`left`}[r],j=a===`center`?A:`${A}-${a}`,re=c,M=+(r===`bottom`),ie=+(r===`top`),ae=+(r===`right`),oe=+(r===`left`);typeof re==`number`?re={top:re+M,right:re+oe,bottom:re+ie,left:re+ae}:re&&={top:(re.top||0)+M,right:(re.right||0)+oe,bottom:(re.bottom||0)+ie,left:(re.left||0)+ae};let se={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:re},ce=N.useRef(null),le=Sv(i),ue=Sv(o),de=typeof i==`function`?0:i,fe=typeof o==`function`?0:o,pe=[];f&&pe.push(f),pe.push(Mne(e=>{let t=xS(e,r,ne),n=typeof le.current==`function`?le.current(t):le.current,i=typeof ue.current==`function`?ue.current(t):ue.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[de,fe,ne,r]));let me=T===`none`&&w!==`shift`,he=!me&&(l||_||w===`shift`),ge=w===`none`?null:Fne({...se,padding:{top:re.top+1,right:re.right+1,bottom:re.bottom+1,left:re.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),_e=me?null:Nne(e=>{let t=Dv(e.elements.floating).documentElement;return{...se,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:he,limiter:l||_?void 0:Pne(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=Hv(Rv(e.placement)),i=r===`y`?t:n,a=r===`y`?re.left+re.right:re.top+re.bottom;return{offset:i/2+a/2}})}},[se,l,_,re,T]);w===`shift`||T===`shift`||a===`center`?pe.push(_e,ge):pe.push(ge,_e),pe.push(Ine({...se,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!te.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=jm(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),gS(e=>({element:ce.current||Dv(e.elements.floating).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Rv(a),l=Hv(c),u=ce.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(xS(e,r,ne)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,he&&l===`y`&&b?S:x),{}}},_S,y),th(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,m]);let ve=N.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ye,elements:be,x:xe,y:Se,middlewareData:Ce,update:we,placement:Te,context:Ee,isPositioned:De,floatingStyles:Oe}=ere({rootContext:m,open:p?h:void 0,placement:j,middleware:pe,strategy:n,whileElementsMounted:p?void 0:(...e)=>Kb(...e,ve),nodeId:v,externalTree:x}),{sideX:ke,sideY:Ae}=Ce.adaptiveOrigin||vS,je=De?n:`fixed`,Me=N.useMemo(()=>{let e=y?{position:je,[ke]:xe,[Ae]:Se}:{position:je,...Oe};return De||(e.opacity=0),e},[y,je,ke,xe,Ae,Se,Oe,De]),Ne=N.useRef(null);th(()=>{if(!h)return;let e=k.current,t=typeof e==`function`?e():e,n=(CS(t)?t.current:t)||null;n!==Ne.current&&(ye.setPositionReference(n),Ne.current=n)},[h,ye,O,k]),N.useEffect(()=>{if(!h)return;let e=k.current;typeof e!=`function`&&CS(e)&&e.current!==Ne.current&&(ye.setPositionReference(e.current),Ne.current=e.current)},[h,ye,O,k]),N.useEffect(()=>{if(p&&h&&be.domReference&&be.floating)return Kb(be.domReference,be.floating,we,ve)},[p,h,be,we,ve]);let Pe=Rv(Te),Fe=bS(r,Pe,ne),Ie=zv(Te)||`center`,Le=!!Ce.hide?.referenceHidden;th(()=>{b&&h&&De&&C(Pe)},[b,h,De,Pe]);let Re=N.useMemo(()=>({position:`absolute`,top:Ce.arrow?.y,left:Ce.arrow?.x}),[Ce.arrow]),ze=Ce.arrow?.centerOffset!==0;return N.useMemo(()=>({positionerStyles:Me,arrowStyles:Re,arrowRef:ce,arrowUncentered:ze,side:Fe,align:Ie,physicalSide:Pe,anchorHidden:Le,refs:ye,context:Ee,isPositioned:De,update:we}),[Me,Re,ce,ze,Fe,Ie,Pe,Le,ye,Ee,De,we])}function CS(e){return e!=null&&`current`in e}function wS(e){return e===`starting`?Fy:jh}function TS(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Nh(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},wS(r),i],stateAttributesMapping:Qx})}var ES=N.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ly,style:g,..._}=e,v=E_(),y=cS(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),ee=SS({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?yS:void 0}),D=TS(e,N.useMemo(()=>({open:b,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,ee.side,ee.align,ee.anchorHidden,S,T]),{styles:ee.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,I.jsx)(dS.Provider,{value:ee,children:D})}),DS={...Qx,...ax},OS=N.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=E_(),{side:s,align:c}=fS(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);sx({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),kx(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Nh(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,wS(d),a],stateAttributesMapping:DS})}),kS=N.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=E_(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=fS();return Nh(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Qx})}),AS=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=N.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=N.useMemo(()=>({open:t,close:n}),[t,n]);return(0,I.jsx)(eS.Provider,{value:i,children:(0,I.jsx)(Vte,{delay:a,timeoutMs:r,children:e.children})})};function jS(e){return Oh(19)?e:e?`true`:void 0}function MS({delay:e=0,...t}){return(0,I.jsx)(AS,{"data-slot":`tooltip-provider`,delay:e,...t})}function NS({...e}){return(0,I.jsx)(Vx,{"data-slot":`tooltip`,...e})}function PS({...e}){return(0,I.jsx)(oS,{"data-slot":`tooltip-trigger`,...e})}function FS({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,I.jsx)(uS,{children:(0,I.jsx)(ES,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,I.jsxs)(OS,{"data-slot":`tooltip-content`,className:Kg(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,I.jsx)(kS,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var IS={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},LS={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},RS={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},zS=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],BS=[12288,12288,65281,65376,65504,65510],VS=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HS=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],US=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],WS=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},GS=19968,[KS,qS]=JS(US);function JS(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(GS>=i&&GS<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var YS=e=>e<161||e>1114109?!1:WS(zS,e),XS=e=>e<12288||e>65510?!1:WS(BS,e),ZS=e=>e<8361||e>65518?!1:WS(VS,e),QS=e=>e<32||e>10630?!1:WS(HS,e),$S=e=>e>=KS&&e<=qS?!0:e<4352||e>262141?!1:WS(US,e);function eC(e){return YS(e)?`ambiguous`:XS(e)?`fullwidth`:ZS(e)?`halfwidth`:QS(e)?`narrow`:$S(e)?`wide`:`neutral`}function tC(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function nC(e){return tC(e),eC(e)}function rC(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function iC(e){if(!e||e<4352)return!1;switch(nC(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!rC(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999?null:!1;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function aC(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function oC(e){return e!==null&&e>=65024&&e<=65038}var sC=lC(/\p{P}|\p{S}/u),cC=lC(/\s/);function lC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function uC(e){return!!(e&LS.characterGroupWhitespace)}function dC(e){return(e&AC.cjkPunctuation)===LS.characterGroupPunctuation}function fC(e){return!!(e&AC.cjk)}function pC(e){return e===AC.ivs}function mC(e){return!!(e&AC.cjkOrIvs)}function hC(e){return e===AC.nonEmojiGeneralUseVS}function gC(e){return!!(e&AC.spaceOrPunctuation)}var _C=kC(/[A-Za-z]/),vC=kC(/[\dA-Za-z]/),yC=kC(/[#-'*+\--9=?A-Z^-~]/);function bC(e){return e!==null&&(e<32||e===127)}var xC=kC(/\d/),SC=kC(/[\dA-Fa-f]/),CC=kC(/[!-/:-@[-`{-~]/);function wC(e){return e!==null&&e<-2}function TC(e){return e!==null&&(e<0||e===32)}function EC(e){return e===-2||e===-1||e===32}var DC=kC(/\p{P}|\p{S}/u),OC=kC(/\s/);function kC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var AC;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(AC||={});function jC(e){if(e===IS.eof||TC(e)||cC(e))return LS.characterGroupWhitespace;let t=0;if(e>=4352){if(oC(e))return AC.nonEmojiGeneralUseVS;switch(iC(e)){case null:return AC.ivs;case!0:t|=AC.cjk;break}}return sC(e)&&(t|=LS.characterGroupPunctuation),t}function MC(e,t,n){if(!hC(e))return e;let r=t(),i=jC(r);return!r||uC(i)?e:aC(r,n)?AC.cjkPunctuation:NC(i)}function NC(e){return e&~AC.ivs}function PC(e){return!!(e&&e>=55296&&e<=56319)}function FC(e){return!!(e&&e>=56320&&e<=57343)}function IC(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function LC(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var RC=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=LC(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function zC(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function BC(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function VC(e,t){return e.length>0?(BC(e,e.length,0,t),e):t}function HC(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var UC={name:`attention`,resolveAll:are,tokenize:ore};function are(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};WC(d,-c),WC(f,c),o={type:c>1?RS.strongSequence:RS.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?RS.strongSequence:RS.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?RS.strongText:RS.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?RS.strong:RS.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=VC(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=VC(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=VC(l,HC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=VC(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=VC(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,BC(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ore(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=FC(a)?IC(a,r(),i):a,s=jC(o),c=new RC(o,r(),i),l=MC(s,c.value.bind(c),o),u;return d;function d(t){return t===IS.asterisk||IS.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=jC(PC(a)?zC(a,r(),i):a),d=dC(l),p=d||uC(l),m=dC(c),h=m||uC(c),g=mC(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||fC(c))||n.includes(o);return s._open=!!(u===IS.asterisk?_:_&&(gC(l)||!v)),s._close=!!(u===IS.asterisk?v:v&&(gC(c)||!_)),t(a)}}function WC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function sre(){return{text:{[IS.asterisk]:UC,[IS.underscore]:UC},insideSpan:{null:[UC]}}}function cre(){let e=this.data();(e.micromarkExtensions||=[]).push(sre())}function lre(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[IS.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[IS.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&BC(o,o.length,0,HC(s,e.slice(r+1,n),t)),BC(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),BC(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=RS.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=FC(o)?IC(o,i(),a):o,c=jC(s),l=new RC(s,i(),a),u=MC(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return IS.tilde,s===IS.tilde&&d[d.length-1][1].type!==RS.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=jC(s);if(o===IS.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=jC(PC(o)?zC(o,i(),a):o),p=dC(u)||uC(u),h=dC(d)||uC(d),g=fC(u)||pC(c);return l._open=!h||d===LS.attentionSideAfter&&(p||g),l._close=!p||c===LS.attentionSideAfter&&(h||fC(d)),n(o)}}}function ure(e){let t=this.data();(t.micromarkExtensions||=[]).push(lre(e))}var GC=(function(e){if(e==null)return mre;if(typeof e==`function`)return KC(e);if(typeof e==`object`)return Array.isArray(e)?dre(e):fre(e);if(typeof e==`string`)return pre(e);throw Error(`Expected function, string, or object as test`)});function dre(e){let t=[],n=-1;for(;++n<e.length;)t[n]=GC(e[n]);return KC(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fre(e){let t=e;return KC(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pre(e){return KC(t);function t(t){return t&&t.type===e}}function KC(e){return t;function t(t,n,r){return!!(hre(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function mre(){return!0}function hre(e){return typeof e==`object`&&!!e&&`type`in e}function gre(e){return e}var qC=[],JC=`skip`;function YC(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=GC(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+gre(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=qC,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=_re(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function _re(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?qC:[e]}function XC(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),YC(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var vre=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),yre=/^(https?:\/\/|mailto:|www\.)/i,bre=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},xre=e=>{let t=0;for(let n of e){if(vre.has(n))return t;t+=n.length}return null},Sre=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Cre=e=>({type:`text`,value:e}),wre=()=>e=>{XC(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!bre(e)||!yre.test(e.url))return;let r=xre(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=Sre(i,e),s=Cre(a);return n.children.splice(t,1,o,s),t+1})};function Tre(){let e=[cre],t=[wre,ure];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var ZC=Tre(),QC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ere(e){return $C(e)}function $C(e){return Array.isArray(e)?Dre(e):e instanceof RegExp?e:typeof e==`object`?Ore(e):e}function Dre(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=$C(e[n]);return t}function Ore(e){let t={};for(let n in e)t[n]=$C(e[n]);return t}function ew(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function tw(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?tw(e.substring(0,e.length-1)):e.substr(~t+1)}var nw=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,rw=class{static hasCaptures(e){return e===null?!1:(nw.lastIndex=0,nw.test(e))}static replaceCaptures(e,t,n){return e.replace(nw,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function iw(e,t){return e<t?-1:+(e>t)}function aw(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=iw(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function ow(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function sw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var cw=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},lw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(jre(e),t)}static createFromParsedTheme(e,t){return Nre(e,t)}_cachedMatchRoot=new cw(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>kre(e.parent,t.parentScopes));return n?new dw(n.fontStyle,n.foreground,n.background):null}},uw=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function kre(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Are(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Are(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var dw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function jre(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&ow(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&ow(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Mre(l,u,e,o,s,c)}}return n}var Mre=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},fw=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(fw||{});function Nre(e,t){e.sort((e,t)=>{let n=iw(e.scope,t.scope);return n!==0||(n=aw(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Pre(t),o=new dw(n,a.getId(r),a.getId(i)),s=new Ire(new pw(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new lw(a,o,s)}var Pre=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Fre=Object.freeze([]),pw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Fre,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Ire=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pw.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(aw(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pw(e,t,n,r,i))}},mw=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Rre(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Lre(e){return e}function Rre(e){return e}function hw(e,t){let n=[],r=zre(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(gw(i)){let e=[];do e.push(i),i=r.next();while(gw(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function gw(e){return!!e&&!!e.match(/[\w\.:]+/)}function zre(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function _w(e){typeof e.dispose==`function`&&e.dispose()}var vw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Bre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vre=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Hre=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Vre;for(let n of e)Ure(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof vw){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ure(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof vw?bw({baseGrammar:a,selfGrammar:i},r):yw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new vw(e))}function yw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];xw([r],t,n)}}function bw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&xw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&xw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function xw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ew({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&xw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Sw(i);switch(a.kind){case 0:bw({...t,selfGrammar:t.baseGrammar},n);break;case 1:bw(t,n);break;case 2:yw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?yw(a.ruleName,i,n):bw(i,n)}else a.kind===4?n.add(new Bre(a.scopeName,a.ruleName)):n.add(new vw(a.scopeName));break}}}var Wre=class{kind=0},Gre=class{kind=1},Kre=class{constructor(e){this.ruleName=e}kind=2},qre=class{constructor(e){this.scopeName=e}kind=3},Jre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Sw(e){if(e===`$base`)return new Wre;if(e===`$self`)return new Gre;let t=e.indexOf(`#`);return t===-1?new qre(e):t===0?new Kre(e.substring(1)):new Jre(e.substring(0,t),e.substring(t+1))}var Yre=/\\(\d+)/,Cw=/\\(\d+)/g,Xre=-1,ww=-2;function Tw(e){return e}function Ew(e){return e}var Dw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=rw.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=rw.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${tw(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:rw.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:rw.replaceCaptures(this._contentName,e,t)}},Zre=class extends Dw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Qre=class extends Dw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Mw(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ow=class extends Dw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},kw=class extends Dw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Mw(i,this.id),this.beginCaptures=a,this._end=new Mw(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nw;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Aw=class extends Dw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Mw(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Mw(o,ww),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nw;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Nw,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},jw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Zre(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Qre(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ew({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Ow(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Aw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new kw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Sw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Ow||e instanceof kw||e instanceof Aw)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Mw=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Yre.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Cw.lastIndex=0,this.source.replace(Cw,(e,t)=>sw(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Nw=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Pw(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Pw(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Pw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
188
188
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Fw=class{constructor(e,t){this.languageId=e,this.tokenType=t}},$re=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Fw(e,8),this._embeddedLanguagesMatcher=new eie(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Fw(0,0);_getBasicScopeAttributes=new cw(e=>new Fw(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},eie=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>sw(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Iw=!1,Lw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Rw(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=tie(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Lw(i,!0);f()}return new Lw(i,!1);function f(){let o=nie(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Xre){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Vw(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof kw){let r=o;Vw(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Aw){let r=o;Vw(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Vw(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function tie(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Aw&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=aie(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ww){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Vw(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function nie(e,t,n,r,i,a){let o=rie(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=iie(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function rie(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=zw(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function iie(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=zw(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function zw(e,t,n,r,i){return Iw?{ruleScanner:e.compile(t,n),findOptions:Bw(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function aie(e,t,n,r,i){return Iw?{ruleScanner:e.compileWhile(t,n),findOptions:Bw(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Bw(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Vw(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Rw(e,p,n&&d.start===0,d.start,f,i,!1,0),_w(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new oie(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var oie=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function sie(e,t,n,r,i,a,o,s){return new lie(e,t,n,r,i,a,o,s)}function Hw(e,t,n,r,i){let a=hw(t,Uw),o=jw.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Uw(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(cie(t[r],e))return n=r+1,!0;return!1})}function cie(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var lie=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new $re(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ww(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=hw(e,Uw);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Hw(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Hw(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Tw(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ew(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ww(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=jw.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Kw.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=mw.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Gw.createRootAndLookUpScopeName(a,r,this):Gw.createRoot(`unknown`,r),t=new Kw(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
189
189
|
`;let a=this.createOnigString(e),o=a.content.length,s=new die(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Rw(this,a,i,0,t,s,!0,r);return _w(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ww(e,t){return e=Ere(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Gw=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=uw.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new uw(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new uw(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),mw.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Kw=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Gw.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ew(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Gw.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Tw(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Gw.fromExtension(r,n.contentNameScopesList))}},uie=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):hw(e,Uw).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>hw(e,Uw).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},die=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=mw.set(n,0,Lre(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=mw.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},fie=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,sie(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},qw=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new fie(lw.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(lw.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new uie(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Hre(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Jw=Kw.NULL,Yw=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Xw=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Xw.prototype.normal={},Xw.prototype.property={},Xw.prototype.space=void 0;function Zw(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Xw(n,r,t)}function Qw(e){return e.toLowerCase()}var $w=class{constructor(e,t){this.attribute=t,this.property=e}};$w.prototype.attribute=``,$w.prototype.booleanish=!1,$w.prototype.boolean=!1,$w.prototype.commaOrSpaceSeparated=!1,$w.prototype.commaSeparated=!1,$w.prototype.defined=!1,$w.prototype.mustUseProperty=!1,$w.prototype.number=!1,$w.prototype.overloadedBoolean=!1,$w.prototype.property=``,$w.prototype.spaceSeparated=!1,$w.prototype.space=void 0;var eT=r({boolean:()=>tT,booleanish:()=>nT,commaOrSpaceSeparated:()=>sT,commaSeparated:()=>oT,number:()=>iT,overloadedBoolean:()=>rT,spaceSeparated:()=>aT}),pie=0,tT=cT(),nT=cT(),rT=cT(),iT=cT(),aT=cT(),oT=cT(),sT=cT();function cT(){return 2**++pie}var lT=Object.keys(eT),uT=class extends $w{constructor(e,t,n,r){let i=-1;if(super(e,t),dT(this,`space`,r),typeof n==`number`)for(;++i<lT.length;){let e=lT[i];dT(this,lT[i],(n&eT[e])===eT[e])}}};uT.prototype.defined=!0;function dT(e,t,n){n&&(e[t]=n)}function fT(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new uT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Qw(r)]=r,n[Qw(a.attribute)]=r}return new Xw(t,n,e.space)}var pT=fT({properties:{ariaActiveDescendant:null,ariaAtomic:nT,ariaAutoComplete:null,ariaBusy:nT,ariaChecked:nT,ariaColCount:iT,ariaColIndex:iT,ariaColSpan:iT,ariaControls:aT,ariaCurrent:null,ariaDescribedBy:aT,ariaDetails:null,ariaDisabled:nT,ariaDropEffect:aT,ariaErrorMessage:null,ariaExpanded:nT,ariaFlowTo:aT,ariaGrabbed:nT,ariaHasPopup:null,ariaHidden:nT,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:aT,ariaLevel:iT,ariaLive:null,ariaModal:nT,ariaMultiLine:nT,ariaMultiSelectable:nT,ariaOrientation:null,ariaOwns:aT,ariaPlaceholder:null,ariaPosInSet:iT,ariaPressed:nT,ariaReadOnly:nT,ariaRelevant:null,ariaRequired:nT,ariaRoleDescription:aT,ariaRowCount:iT,ariaRowIndex:iT,ariaRowSpan:iT,ariaSelected:nT,ariaSetSize:iT,ariaSort:null,ariaValueMax:iT,ariaValueMin:iT,ariaValueNow:iT,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function mT(e,t){return t in e?e[t]:t}function hT(e,t){return mT(e,t.toLowerCase())}var mie=fT({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:oT,acceptCharset:aT,accessKey:aT,action:null,allow:null,allowFullScreen:tT,allowPaymentRequest:tT,allowUserMedia:tT,alpha:tT,alt:null,as:null,async:tT,autoCapitalize:null,autoComplete:aT,autoFocus:tT,autoPlay:tT,blocking:aT,capture:null,charSet:null,checked:tT,cite:null,className:aT,closedBy:null,colorSpace:null,cols:iT,colSpan:iT,command:null,commandFor:null,content:null,contentEditable:nT,controls:tT,controlsList:aT,coords:iT|oT,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tT,defer:tT,dir:null,dirName:null,disabled:tT,download:rT,draggable:nT,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tT,formTarget:null,headers:aT,height:iT,hidden:rT,high:iT,href:null,hrefLang:null,htmlFor:aT,httpEquiv:aT,id:null,imageSizes:null,imageSrcSet:null,inert:tT,inputMode:null,integrity:null,is:null,isMap:tT,itemId:null,itemProp:aT,itemRef:aT,itemScope:tT,itemType:aT,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tT,low:iT,manifest:null,max:null,maxLength:iT,media:null,method:null,min:null,minLength:iT,multiple:tT,muted:tT,name:null,nonce:null,noModule:tT,noValidate:tT,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:tT,optimum:iT,pattern:null,ping:aT,placeholder:null,playsInline:tT,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tT,referrerPolicy:null,rel:aT,required:tT,reversed:tT,rows:iT,rowSpan:iT,sandbox:aT,scope:null,scoped:tT,seamless:tT,selected:tT,shadowRootClonable:tT,shadowRootCustomElementRegistry:tT,shadowRootDelegatesFocus:tT,shadowRootMode:null,shadowRootSerializable:tT,shape:null,size:iT,sizes:null,slot:null,span:iT,spellCheck:nT,src:null,srcDoc:null,srcLang:null,srcSet:null,start:iT,step:null,style:null,tabIndex:iT,target:null,title:null,translate:null,type:null,typeMustMatch:tT,useMap:null,value:nT,width:iT,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:aT,axis:null,background:null,bgColor:null,border:iT,borderColor:null,bottomMargin:iT,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tT,declare:tT,event:null,face:null,frame:null,frameBorder:null,hSpace:iT,leftMargin:iT,link:null,longDesc:null,lowSrc:null,marginHeight:iT,marginWidth:iT,noResize:tT,noHref:tT,noShade:tT,noWrap:tT,object:null,profile:null,prompt:null,rev:null,rightMargin:iT,rules:null,scheme:null,scrolling:nT,standby:null,summary:null,text:null,topMargin:iT,valueType:null,version:null,vAlign:null,vLink:null,vSpace:iT,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:tT,disablePictureInPicture:tT,disableRemotePlayback:tT,exportParts:oT,part:aT,prefix:null,property:null,results:iT,security:null,unselectable:null},space:`html`,transform:hT}),hie=fT({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:sT,accentHeight:iT,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:iT,amplitude:iT,arabicForm:null,ascent:iT,attributeName:null,attributeType:null,azimuth:iT,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:iT,by:null,calcMode:null,capHeight:iT,className:aT,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:iT,diffuseConstant:iT,direction:null,display:null,dur:null,divisor:iT,dominantBaseline:null,download:tT,dx:null,dy:null,edgeMode:null,editable:null,elevation:iT,enableBackground:null,end:null,event:null,exponent:iT,externalResourcesRequired:null,fill:null,fillOpacity:iT,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oT,g2:oT,glyphName:oT,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:iT,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:iT,horizOriginX:iT,horizOriginY:iT,id:null,ideographic:iT,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:iT,k:iT,k1:iT,k2:iT,k3:iT,k4:iT,kernelMatrix:sT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:iT,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:iT,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:iT,overlineThickness:iT,paintOrder:null,panose1:null,path:null,pathLength:iT,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:aT,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:iT,pointsAtY:iT,pointsAtZ:iT,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sT,rev:sT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sT,requiredFeatures:sT,requiredFonts:sT,requiredFormats:sT,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:iT,specularExponent:iT,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:iT,strikethroughThickness:iT,string:null,stroke:null,strokeDashArray:sT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:iT,strokeOpacity:iT,strokeWidth:null,style:null,surfaceScale:iT,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sT,tabIndex:iT,tableValues:null,target:null,targetX:iT,targetY:iT,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:iT,underlineThickness:iT,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:iT,values:null,vAlphabetic:iT,vMathematical:iT,vectorEffect:null,vHanging:iT,vIdeographic:iT,version:null,vertAdvY:iT,vertOriginX:iT,vertOriginY:iT,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:iT,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:mT}),gT=fT({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),_T=fT({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:hT}),vT=fT({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),gie={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},_ie=/[A-Z]/g,yT=/-[a-z]/g,vie=/^data[-\w.:]+$/i;function bT(e,t){let n=Qw(t),r=t,i=$w;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&vie.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(yT,bie);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!yT.test(e)){let n=e.replace(_ie,yie);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=uT}return new i(r,t)}function yie(e){return`-`+e.toLowerCase()}function bie(e){return e.charAt(1).toUpperCase()}var xT=Zw([pT,mie,gT,_T,vT],`html`),ST=Zw([pT,hie,gT,_T,vT],`svg`),CT={}.hasOwnProperty;function wT(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&CT.call(t,e)){let n=String(t[e]);i=CT.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var xie=/["&'<>`]/g,Sie=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Cie=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,wie=/[|\\{}()[\]^$+*?.]/g,TT=new WeakMap;function Tie(e,t){if(e=e.replace(t.subset?Eie(t.subset):xie,r),t.subset||t.escapeOnly)return e;return e.replace(Sie,n).replace(Cie,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Eie(e){let t=TT.get(e);return t||(t=Die(e),TT.set(e,t)),t}function Die(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(wie,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Oie=/[\dA-Fa-f]/;function kie(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Oie.test(String.fromCharCode(t))?r:r+`;`}var Aie=/\d/;function jie(e,t,n){let r=`&#`+String(e);return n&&t&&!Aie.test(String.fromCharCode(t))?r:r+`;`}var Mie=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ET={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Nie=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],DT={}.hasOwnProperty,OT={},kT;for(kT in ET)DT.call(ET,kT)&&(OT[ET[kT]]=kT);var Pie=/[^\dA-Za-z]/;function Fie(e,t,n,r){let i=String.fromCharCode(e);if(DT.call(OT,i)){let e=OT[i],a=`&`+e;return n&&Mie.includes(e)&&!Nie.includes(e)&&(!r||t&&t!==61&&Pie.test(String.fromCharCode(t)))?a:a+`;`}return``}function Iie(e,t,n){let r=kie(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Fie(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=jie(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function AT(e,t){return Tie(e,Object.assign({format:Iie},t))}var Lie=/^>|^->|<!--|-->|--!>|<!-$/g,Rie=[`>`],zie=[`<`,`>`];function Bie(e,t,n,r){return r.settings.bogusComments?`<?`+AT(e.value,Object.assign({},r.settings.characterReferences,{subset:Rie}))+`>`:`<!--`+e.value.replace(Lie,i)+`-->`;function i(e){return AT(e,Object.assign({},r.settings.characterReferences,{subset:zie}))}}function Vie(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function jT(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function MT(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function NT(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function PT(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function FT(e){return e.join(` `).trim()}var Hie=/[ \t\n\f\r]/g;function IT(e){return typeof e==`object`?e.type===`text`?LT(e.value):!1:LT(e)}function LT(e){return e.replace(Hie,``)===``}var RT=BT(1),zT=BT(-1),Uie=[];function BT(e){return t;function t(t,n,r){let i=t?t.children:Uie,a=(n||0)+e,o=i[a];if(!r)for(;o&&IT(o);)a+=e,o=i[a];return o}}var Wie={}.hasOwnProperty;function VT(e){return t;function t(t,n,r){return Wie.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var HT=VT({body:Kie,caption:UT,colgroup:UT,dd:Xie,dt:Yie,head:UT,html:Gie,li:Jie,optgroup:Zie,option:Qie,p:qie,rp:WT,rt:WT,tbody:eae,td:GT,tfoot:tae,th:GT,thead:$ie,tr:nae});function UT(e,t,n){let r=RT(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&IT(r.value.charAt(0)))}function Gie(e,t,n){let r=RT(n,t);return!r||r.type!==`comment`}function Kie(e,t,n){let r=RT(n,t);return!r||r.type!==`comment`}function qie(e,t,n){let r=RT(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Jie(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Yie(e,t,n){let r=RT(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Xie(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function WT(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Zie(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Qie(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function $ie(e,t,n){let r=RT(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function eae(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function tae(e,t,n){return!RT(n,t)}function nae(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function GT(e,t,n){let r=RT(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var rae=VT({body:oae,colgroup:sae,head:aae,html:iae,tbody:cae});function iae(e){let t=RT(e,-1);return!t||t.type!==`comment`}function aae(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function oae(e){let t=RT(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&IT(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function sae(e,t,n){let r=zT(n,t),i=RT(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&HT(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function cae(e,t,n){let r=zT(n,t),i=RT(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&HT(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var KT={name:[[`
|
|
190
190
|
\f\r &/=>`.split(``),`
|
|
@@ -637,8 +637,8 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
637
637
|
L0,20`)},`requirement_arrow`),requirement_contains:c((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:c((e,t,n)=>{let{themeVariables:r}=T(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${i}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0
|
|
638
638
|
L20,10
|
|
639
639
|
M20,10
|
|
640
|
-
L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:c((e,t,n)=>{let{themeVariables:r}=T(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},VR=xue,Cue={common:j,getConfig:T,insertCluster:He,insertEdge:LR,insertEdgeLabel:jR,insertMarkers:VR,insertNode:Ve,interpolateToCurve:me,labelHelper:We,log:s,positionEdgeLabel:NR},HR={},UR=c(e=>{for(let t of e)HR[t.name]=t},`registerLayoutLoaders`);c(()=>{UR([{name:`dagre`,loader:c(async()=>await a(()=>import(`./dagre-BM42HDAG-CkrDHS9q.js`),__vite__mapDeps([102,103,104,1,105,106,107,108,109,110,111,112,113,114,115])),`loader`)},{name:`cose-bilkent`,loader:c(async()=>await a(()=>import(`./cose-bilkent-S5V4N54A-BPg4WNhP.js`),__vite__mapDeps([116,1,117,104])),`loader`)}])},`registerDefaultLayoutLoaders`)();var wue=c(async(e,t)=>{if(!(e.layoutAlgorithm in HR))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=HR[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,Cue,{algorithm:n.algorithm})},`render`),Tue=c((e=``,{fallback:t=`dagre`}={})=>{if(e in HR)return e;if(t in HR)return s.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),WR=`comm`,GR=`rule`,KR=`decl`,Eue=`@import`,Due=`@namespace`,Oue=`@keyframes`,kue=`@layer`,Aue=Math.abs,qR=String.fromCharCode;function JR(e){return e.trim()}function YR(e,t,n){return e.replace(t,n)}function XR(e,t){return e.charCodeAt(t)|0}function ZR(e,t,n){return e.slice(t,n)}function QR(e){return e.length}function $R(e){return e.length}function ez(e,t){return t.push(e),e}var tz=1,nz=1,rz=0,iz=0,az=0,oz=``;function sz(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:tz,column:nz,length:o,return:``,siblings:s}}function jue(){return az}function Mue(){return az=iz>0?XR(oz,--iz):0,nz--,az===10&&(nz=1,tz--),az}function cz(){return az=iz<rz?XR(oz,iz++):0,nz++,az===10&&(nz=1,tz++),az}function lz(){return XR(oz,iz)}function uz(){return iz}function dz(e,t){return ZR(oz,e,t)}function fz(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Nue(e){return tz=nz=1,rz=QR(oz=e),iz=0,[]}function Pue(e){return oz=``,e}function pz(e){return JR(dz(iz-1,mz(e===91?e+2:e===40?e+1:e)))}function Fue(e){for(;(az=lz())&&az<33;)cz();return fz(e)>2||fz(az)>3?``:` `}function Iue(e,t){for(;--t&&cz()&&!(az<48||az>102||az>57&&az<65||az>70&&az<97););return dz(e,uz()+(t<6&&lz()==32&&cz()==32))}function mz(e){for(;cz();)switch(az){case e:return iz;case 34:case 39:e!==34&&e!==39&&mz(az);break;case 40:e===41&&mz(e);break;case 92:cz();break}return iz}function Lue(e,t){for(;cz()&&e+az!==57&&!(e+az===84&&lz()===47););return`/*`+dz(t,iz-1)+`*`+qR(e===47?e:cz())}function Rue(e){for(;!fz(lz());)cz();return dz(e,iz)}function zue(e){return Pue(hz(``,null,null,null,[``],e=Nue(e),0,[0],e))}function hz(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=cz()){case 40:m!=108&&XR(w,d-1)==58?(v++,w+=`(`):w+=pz(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=pz(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=qR(y);break}w+=Fue(m);break;case 92:w+=Iue(uz()-1,7);continue;case 47:switch(lz()){case 42:case 47:ez(Bue(Lue(cz(),uz()),t,n,c),c),(fz(m||1)==5||fz(lz()||1)==5)&&QR(w)&&ZR(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=QR(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=qR(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=YR(w,/\f/g,``)),p>0&&(QR(w)-d||h===0)&&ez(p>32?_z(w+`;`,r,n,d-1,c):_z(YR(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(ez(C=gz(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)hz(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(XR(w,3)===110)break;case 108:if(XR(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?hz(e,C,C,r&&ez(gz(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):hz(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+QR(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Mue()==125)continue}switch(w+=qR(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(QR(w)-1)*_,_=1;break;case 64:lz()===45&&(w+=pz(cz())),f=lz(),u=d=QR(b=w+=Rue(uz())),y++;break;case 45:m===45&&QR(w)==2&&(h=0)}}return a}function gz(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=$R(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=ZR(e,f+1,f=Aue(g=o[h])),b=e;v<m;++v)(b=JR(g>0?p[v]+` `+y:YR(y,/&\f/g,p[v])))&&(c[_++]=b);return sz(e,t,n,i===0?GR:s,c,l,u,d)}function Bue(e,t,n,r){return sz(e,t,n,WR,qR(jue()),ZR(e,2,-2),0,r)}function _z(e,t,n,r,i){return sz(e,t,n,KR,ZR(e,0,r),ZR(e,r+1,-1),r,i)}function vz(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Vue(e,t,n,r){switch(e.type){case kue:if(e.children.length)break;case Eue:case Due:case KR:return e.return=e.return||e.value;case WR:return``;case Oue:return e.return=e.value+`{`+vz(e.children,r)+`}`;case GR:if(!QR(e.value=e.props.join(`,`)))return``}return QR(n=vz(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Hue(e){var t=$R(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var yz=`c4`,Uue={id:yz,detector:c(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-2UybwBD7.js`);return{diagram:e}},__vite__mapDeps([118,106,1,104,105,107,108,119]));return{id:yz,diagram:e}},`loader`)},bz=`flowchart`,Wue={id:bz,detector:c((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-X7zRJPNJ.js`);return{diagram:e}},__vite__mapDeps([120,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115,124,119]));return{id:bz,diagram:e}},`loader`)},xz=`flowchart-v2`,Gue={id:xz,detector:c((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-X7zRJPNJ.js`);return{diagram:e}},__vite__mapDeps([120,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115,124,119]));return{id:xz,diagram:e}},`loader`)},Sz=`er`,Kue={id:Sz,detector:c(e=>/^\s*erDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-W_1QeLIe.js`);return{diagram:e}},__vite__mapDeps([125,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115]));return{id:Sz,diagram:e}},`loader`)},Cz=`gitGraph`,que={id:Cz,detector:c(e=>/^\s*gitGraph/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-IrVxrQX3.js`);return{diagram:e}},__vite__mapDeps([126,127,108,128,104,1,105,106,107,129,130]));return{id:Cz,diagram:e}},`loader`)},wz=`gantt`,Jue={id:wz,detector:c(e=>/^\s*gantt/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-DRhKONsv.js`);return{diagram:e}},__vite__mapDeps([131,1,106,132,104,133,134,105,107,108]));return{id:wz,diagram:e}},`loader`)},Tz=`info`,Yue={id:Tz,detector:c(e=>/^\s*info/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-BwvKCMPl.js`);return{diagram:e}},__vite__mapDeps([135,127,108,128,104,1,107]));return{id:Tz,diagram:e}},`loader`)},Ez=`pie`,Xue={id:Ez,detector:c(e=>/^\s*pie/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-CiahOla2.js`);return{diagram:e}},__vite__mapDeps([136,106,1,127,108,128,104,137,138,134,139,140,105,107,129]));return{id:Ez,diagram:e}},`loader`)},Dz=`quadrantChart`,Zue={id:Dz,detector:c(e=>/^\s*quadrantChart/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-D_Y7dxGV.js`);return{diagram:e}},__vite__mapDeps([141,132,104,1,133,134,107,108]));return{id:Dz,diagram:e}},`loader`)},Oz=`xychart`,Que={id:Oz,detector:c(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-C-63N49O.js`);return{diagram:e}},__vite__mapDeps([142,103,104,1,105,106,107,108,132,133,134,138,143,137,140]));return{id:Oz,diagram:e}},`loader`)},kz=`requirement`,$ue={id:kz,detector:c(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-bf5UiKzN.js`);return{diagram:e}},__vite__mapDeps([144,103,104,1,105,106,107,108,122,111,112,113,114,123,115]));return{id:kz,diagram:e}},`loader`)},Az=`sequence`,ede={id:Az,detector:c(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-BQXmAa-z.js`);return{diagram:e}},__vite__mapDeps([145,106,1,104,105,107,108,119,130]));return{id:Az,diagram:e}},`loader`)},jz=`class`,tde={id:jz,detector:c((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-BVJ36BJy.js`);return{diagram:e}},__vite__mapDeps([146,103,104,1,105,106,107,108,122,111,112,113,114,123,147,124,119,115]));return{id:jz,diagram:e}},`loader`)},Mz=`classDiagram`,nde={id:Mz,detector:c((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-BVJ36BJy.js`);return{diagram:e}},__vite__mapDeps([148,103,104,1,105,106,107,108,122,111,112,113,114,123,147,124,119,115]));return{id:Mz,diagram:e}},`loader`)},Nz=`state`,rde={id:Nz,detector:c((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-CZxVw12E.js`);return{diagram:e}},__vite__mapDeps([149,103,104,1,105,106,107,108,143,137,140,109,110,122,111,112,113,114,123,150,115]));return{id:Nz,diagram:e}},`loader`)},Pz=`stateDiagram`,ide={id:Pz,detector:c((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-DTvBmncV.js`);return{diagram:e}},__vite__mapDeps([151,103,104,1,105,106,107,108,122,111,112,113,114,123,150,115]));return{id:Pz,diagram:e}},`loader`)},Fz=`journey`,ade={id:Fz,detector:c(e=>/^\s*journey/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-DSZmjR3t.js`);return{diagram:e}},__vite__mapDeps([152,104,1,139,106,137,107,108,124,119]));return{id:Fz,diagram:e}},`loader`)},Iz={draw:c((e,t,n)=>{s.debug(`rendering svg for syntax error
|
|
641
|
-
`);let r=MF(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),E(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},ode=Iz,sde={db:{},renderer:Iz,parser:{parse:c(()=>{},`parse`)}},Lz=`flowchart-elk`,cde={id:Lz,detector:c((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-
|
|
640
|
+
L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:c((e,t,n)=>{let{themeVariables:r}=T(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},VR=xue,Cue={common:j,getConfig:T,insertCluster:He,insertEdge:LR,insertEdgeLabel:jR,insertMarkers:VR,insertNode:Ve,interpolateToCurve:me,labelHelper:We,log:s,positionEdgeLabel:NR},HR={},UR=c(e=>{for(let t of e)HR[t.name]=t},`registerLayoutLoaders`);c(()=>{UR([{name:`dagre`,loader:c(async()=>await a(()=>import(`./dagre-BM42HDAG-CXmNPcYk.js`),__vite__mapDeps([102,103,104,1,105,106,107,108,109,110,111,112,113,114,115])),`loader`)},{name:`cose-bilkent`,loader:c(async()=>await a(()=>import(`./cose-bilkent-S5V4N54A-BPg4WNhP.js`),__vite__mapDeps([116,1,117,104])),`loader`)}])},`registerDefaultLayoutLoaders`)();var wue=c(async(e,t)=>{if(!(e.layoutAlgorithm in HR))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=HR[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,Cue,{algorithm:n.algorithm})},`render`),Tue=c((e=``,{fallback:t=`dagre`}={})=>{if(e in HR)return e;if(t in HR)return s.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),WR=`comm`,GR=`rule`,KR=`decl`,Eue=`@import`,Due=`@namespace`,Oue=`@keyframes`,kue=`@layer`,Aue=Math.abs,qR=String.fromCharCode;function JR(e){return e.trim()}function YR(e,t,n){return e.replace(t,n)}function XR(e,t){return e.charCodeAt(t)|0}function ZR(e,t,n){return e.slice(t,n)}function QR(e){return e.length}function $R(e){return e.length}function ez(e,t){return t.push(e),e}var tz=1,nz=1,rz=0,iz=0,az=0,oz=``;function sz(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:tz,column:nz,length:o,return:``,siblings:s}}function jue(){return az}function Mue(){return az=iz>0?XR(oz,--iz):0,nz--,az===10&&(nz=1,tz--),az}function cz(){return az=iz<rz?XR(oz,iz++):0,nz++,az===10&&(nz=1,tz++),az}function lz(){return XR(oz,iz)}function uz(){return iz}function dz(e,t){return ZR(oz,e,t)}function fz(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Nue(e){return tz=nz=1,rz=QR(oz=e),iz=0,[]}function Pue(e){return oz=``,e}function pz(e){return JR(dz(iz-1,mz(e===91?e+2:e===40?e+1:e)))}function Fue(e){for(;(az=lz())&&az<33;)cz();return fz(e)>2||fz(az)>3?``:` `}function Iue(e,t){for(;--t&&cz()&&!(az<48||az>102||az>57&&az<65||az>70&&az<97););return dz(e,uz()+(t<6&&lz()==32&&cz()==32))}function mz(e){for(;cz();)switch(az){case e:return iz;case 34:case 39:e!==34&&e!==39&&mz(az);break;case 40:e===41&&mz(e);break;case 92:cz();break}return iz}function Lue(e,t){for(;cz()&&e+az!==57&&!(e+az===84&&lz()===47););return`/*`+dz(t,iz-1)+`*`+qR(e===47?e:cz())}function Rue(e){for(;!fz(lz());)cz();return dz(e,iz)}function zue(e){return Pue(hz(``,null,null,null,[``],e=Nue(e),0,[0],e))}function hz(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=cz()){case 40:m!=108&&XR(w,d-1)==58?(v++,w+=`(`):w+=pz(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=pz(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=qR(y);break}w+=Fue(m);break;case 92:w+=Iue(uz()-1,7);continue;case 47:switch(lz()){case 42:case 47:ez(Bue(Lue(cz(),uz()),t,n,c),c),(fz(m||1)==5||fz(lz()||1)==5)&&QR(w)&&ZR(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=QR(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=qR(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=YR(w,/\f/g,``)),p>0&&(QR(w)-d||h===0)&&ez(p>32?_z(w+`;`,r,n,d-1,c):_z(YR(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(ez(C=gz(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)hz(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(XR(w,3)===110)break;case 108:if(XR(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?hz(e,C,C,r&&ez(gz(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):hz(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+QR(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Mue()==125)continue}switch(w+=qR(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(QR(w)-1)*_,_=1;break;case 64:lz()===45&&(w+=pz(cz())),f=lz(),u=d=QR(b=w+=Rue(uz())),y++;break;case 45:m===45&&QR(w)==2&&(h=0)}}return a}function gz(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=$R(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=ZR(e,f+1,f=Aue(g=o[h])),b=e;v<m;++v)(b=JR(g>0?p[v]+` `+y:YR(y,/&\f/g,p[v])))&&(c[_++]=b);return sz(e,t,n,i===0?GR:s,c,l,u,d)}function Bue(e,t,n,r){return sz(e,t,n,WR,qR(jue()),ZR(e,2,-2),0,r)}function _z(e,t,n,r,i){return sz(e,t,n,KR,ZR(e,0,r),ZR(e,r+1,-1),r,i)}function vz(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Vue(e,t,n,r){switch(e.type){case kue:if(e.children.length)break;case Eue:case Due:case KR:return e.return=e.return||e.value;case WR:return``;case Oue:return e.return=e.value+`{`+vz(e.children,r)+`}`;case GR:if(!QR(e.value=e.props.join(`,`)))return``}return QR(n=vz(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Hue(e){var t=$R(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var yz=`c4`,Uue={id:yz,detector:c(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-CZUMj02O.js`);return{diagram:e}},__vite__mapDeps([118,106,1,104,105,107,108,119]));return{id:yz,diagram:e}},`loader`)},bz=`flowchart`,Wue={id:bz,detector:c((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DkjX5DZF.js`);return{diagram:e}},__vite__mapDeps([120,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115,124,119]));return{id:bz,diagram:e}},`loader`)},xz=`flowchart-v2`,Gue={id:xz,detector:c((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DkjX5DZF.js`);return{diagram:e}},__vite__mapDeps([120,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115,124,119]));return{id:xz,diagram:e}},`loader`)},Sz=`er`,Kue={id:Sz,detector:c(e=>/^\s*erDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-0PzYt82j.js`);return{diagram:e}},__vite__mapDeps([125,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115]));return{id:Sz,diagram:e}},`loader`)},Cz=`gitGraph`,que={id:Cz,detector:c(e=>/^\s*gitGraph/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-9lZv175y.js`);return{diagram:e}},__vite__mapDeps([126,127,108,128,104,1,105,106,107,129,130]));return{id:Cz,diagram:e}},`loader`)},wz=`gantt`,Jue={id:wz,detector:c(e=>/^\s*gantt/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-2gmi5Sgv.js`);return{diagram:e}},__vite__mapDeps([131,1,106,132,104,133,134,105,107,108]));return{id:wz,diagram:e}},`loader`)},Tz=`info`,Yue={id:Tz,detector:c(e=>/^\s*info/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-Dkm8HLsk.js`);return{diagram:e}},__vite__mapDeps([135,127,108,128,104,1,107]));return{id:Tz,diagram:e}},`loader`)},Ez=`pie`,Xue={id:Ez,detector:c(e=>/^\s*pie/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-i3VSQ_MS.js`);return{diagram:e}},__vite__mapDeps([136,106,1,127,108,128,104,137,138,134,139,140,105,107,129]));return{id:Ez,diagram:e}},`loader`)},Dz=`quadrantChart`,Zue={id:Dz,detector:c(e=>/^\s*quadrantChart/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-D-TfUmVL.js`);return{diagram:e}},__vite__mapDeps([141,132,104,1,133,134,107,108]));return{id:Dz,diagram:e}},`loader`)},Oz=`xychart`,Que={id:Oz,detector:c(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-Ct4sYA1Y.js`);return{diagram:e}},__vite__mapDeps([142,103,104,1,105,106,107,108,132,133,134,138,143,137,140]));return{id:Oz,diagram:e}},`loader`)},kz=`requirement`,$ue={id:kz,detector:c(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-DzVzYzd9.js`);return{diagram:e}},__vite__mapDeps([144,103,104,1,105,106,107,108,122,111,112,113,114,123,115]));return{id:kz,diagram:e}},`loader`)},Az=`sequence`,ede={id:Az,detector:c(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-17MkrfUw.js`);return{diagram:e}},__vite__mapDeps([145,106,1,104,105,107,108,119,130]));return{id:Az,diagram:e}},`loader`)},jz=`class`,tde={id:jz,detector:c((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-Dvou9Rr1.js`);return{diagram:e}},__vite__mapDeps([146,103,104,1,105,106,107,108,122,111,112,113,114,123,147,124,119,115]));return{id:jz,diagram:e}},`loader`)},Mz=`classDiagram`,nde={id:Mz,detector:c((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-Dvou9Rr1.js`);return{diagram:e}},__vite__mapDeps([148,103,104,1,105,106,107,108,122,111,112,113,114,123,147,124,119,115]));return{id:Mz,diagram:e}},`loader`)},Nz=`state`,rde={id:Nz,detector:c((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-DKgsIGkA.js`);return{diagram:e}},__vite__mapDeps([149,103,104,1,105,106,107,108,143,137,140,109,110,122,111,112,113,114,123,150,115]));return{id:Nz,diagram:e}},`loader`)},Pz=`stateDiagram`,ide={id:Pz,detector:c((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-DkcZNYHL.js`);return{diagram:e}},__vite__mapDeps([151,103,104,1,105,106,107,108,122,111,112,113,114,123,150,115]));return{id:Pz,diagram:e}},`loader`)},Fz=`journey`,ade={id:Fz,detector:c(e=>/^\s*journey/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-Bz2jAsli.js`);return{diagram:e}},__vite__mapDeps([152,104,1,139,106,137,107,108,124,119]));return{id:Fz,diagram:e}},`loader`)},Iz={draw:c((e,t,n)=>{s.debug(`rendering svg for syntax error
|
|
641
|
+
`);let r=MF(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),E(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},ode=Iz,sde={db:{},renderer:Iz,parser:{parse:c(()=>{},`parse`)}},Lz=`flowchart-elk`,cde={id:Lz,detector:c((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DkjX5DZF.js`);return{diagram:e}},__vite__mapDeps([120,103,104,1,105,106,107,108,121,122,111,112,113,114,123,115,124,119]));return{id:Lz,diagram:e}},`loader`)},Rz=`timeline`,lde={id:Rz,detector:c(e=>/^\s*timeline/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./timeline-definition-PNZ67QCA-s2pNN-F3.js`);return{diagram:e}},__vite__mapDeps([153,104,1,139,106,137,105,107,108]));return{id:Rz,diagram:e}},`loader`)},zz=`mindmap`,ude={id:zz,detector:c(e=>/^\s*mindmap/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./mindmap-definition-RKZ34NQL-vTgGplHm.js`);return{diagram:e}},__vite__mapDeps([154,103,104,1,105,106,107,108,122,111,112,113,114,123,115]));return{id:zz,diagram:e}},`loader`)},Bz=`kanban`,dde={id:Bz,detector:c(e=>/^\s*kanban/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./kanban-definition-UN3LZRKU-DmxDYbPB.js`);return{diagram:e}},__vite__mapDeps([155,103,104,1,105,106,107,108,111,112,113,114,124]));return{id:Bz,diagram:e}},`loader`)},Vz=`sankey`,fde={id:Vz,detector:c(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sankeyDiagram-5OEKKPKP-OWzr-E_q.js`);return{diagram:e}},__vite__mapDeps([156,104,1,138,134,107,108]));return{id:Vz,diagram:e}},`loader`)},Hz=`packet`,pde={id:Hz,detector:c(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-LMA3HP47-B3NHb7IR.js`);return{diagram:e}},__vite__mapDeps([157,127,108,128,104,1,105,106,107,129]));return{id:Hz,diagram:e}},`loader`)},Uz=`radar`,mde={id:Uz,detector:c(e=>/^\s*radar-beta/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-2AECGRRQ-L3ctMTu7.js`);return{diagram:e}},__vite__mapDeps([158,127,108,128,104,1,105,106,107,129]));return{id:Uz,diagram:e}},`loader`)},Wz=`block`,hde={id:Wz,detector:c(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./blockDiagram-GPEHLZMM-m2UjnbEQ.js`);return{diagram:e}},__vite__mapDeps([159,103,104,1,105,106,107,108,143,137,140,110,121,115,124,112]));return{id:Wz,diagram:e}},`loader`)},Gz=`treeView`,gde={id:Gz,detector:c(e=>/^\s*treeView-beta/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-5GNKFQAL-K2WCnZ8q.js`);return{diagram:e}},__vite__mapDeps([160,127,108,128,104,1,105,106,107,129,130]));return{id:Gz,diagram:e}},`loader`)},Kz=`architecture`,_de={id:Kz,detector:c(e=>/^\s*architecture/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./architectureDiagram-3BPJPVTR-D8tR5wlz.js`);return{diagram:e}},__vite__mapDeps([161,1,103,104,105,106,107,108,127,128,117,129]));return{id:Kz,diagram:e}},`loader`)},qz=`eventmodeling`,vde={id:qz,detector:c(e=>/^\s*eventmodeling/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-KO2AKTUF-C4zJ2WX8.js`);return{diagram:e}},__vite__mapDeps([162,127,108,128,104,1,105,106,107,129]));return{id:qz,diagram:e}},`loader`)},Jz=`ishikawa`,yde={id:Jz,detector:c(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-YF4QCWOH-sHwxLXPL.js`);return{diagram:e}},__vite__mapDeps([163,104,1,105,106,107,108,114]));return{id:Jz,diagram:e}},`loader`)},Yz=`venn`,bde={id:Yz,detector:c(e=>/^\s*venn-beta/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./vennDiagram-CIIHVFJN-DwBO7C2G.js`);return{diagram:e}},__vite__mapDeps([164,104,1,105,106,107,108,114]));return{id:Yz,diagram:e}},`loader`)},Xz=`treemap`,xde={id:Xz,detector:c(e=>/^\s*treemap/.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-OG6HWLK6-DeucNSc_.js`);return{diagram:e}},__vite__mapDeps([165,127,108,128,104,1,133,138,134,105,106,107,122,129,113]));return{id:Xz,diagram:e}},`loader`)},Zz=`wardley-beta`,Sde={id:Zz,detector:c(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:c(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./wardleyDiagram-YWT4CUSO-B3izZUrd.js`);return{diagram:e}},__vite__mapDeps([166,127,108,128,104,1,105,106,107,129]));return{id:Zz,diagram:e}},`loader`)},Qz=!1,$z=c(()=>{Qz||(Qz=!0,h(`error`,sde,e=>e.toLowerCase().trim()===`error`),h(`---`,{db:{clear:c(()=>{},`clear`)},styles:{},renderer:{draw:c(()=>{},`draw`)},parser:{parse:c(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:c(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),g(cde,ude,_de),g(Uue,dde,nde,tde,Kue,Jue,Yue,Xue,$ue,ede,Gue,Wue,lde,que,ide,rde,ade,Zue,fde,pde,Que,hde,vde,gde,mde,yde,xde,bde,Sde))},`addDiagrams`),Cde=c(async()=>{s.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(O).map(async([e,{detector:t,loader:n}])=>{if(n)try{v(e)}catch{try{let{diagram:e,id:r}=await n();h(r,e,t)}catch(t){throw s.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete O[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){s.error(`Failed to load ${e.length} external diagrams`);for(let t of e)s.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),wde=`graphics-document document`;function eB(e,t){e.attr(`role`,wde),t!==``&&e.attr(`aria-roledescription`,t)}c(eB,`setA11yDiagramInfo`);function tB(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}c(tB,`addSVGa11yTitleDescription`);var nB=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{c(this,`Diagram`)}static async fromText(t,n={}){let r=T(),i=te(t,r);t=xe(t)+`
|
|
642
642
|
`;try{v(i)}catch{let e=d(i);if(!e)throw new re(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();h(t,n)}let{db:a,parser:o,renderer:s,init:c}=v(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},rB=[],Tde=c(()=>{rB.forEach(e=>{e()}),rB=[]},`attachFunctions`),Ede=c(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function iB(e){let t=e.match(w);if(!t)return{text:e,metadata:{}};let n=TR(t[1],{schema:wR})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}c(iB,`extractFrontMatter`);var Dde=c(e=>e.replace(/\r\n?/g,`
|
|
643
643
|
`).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),Ode=c(e=>{let{text:t,metadata:n}=iB(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),kde=c(e=>{let t=_e.detectInit(e)??{},n=_e.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:ve(e),directive:t}},`processDirectives`);function aB(e){let t=Ode(Dde(e)),n=kde(t.text),r=ye(t.config,n.directive);return e=Ede(n.text),{code:e,title:t.title,config:r}}c(aB,`preprocessDiagram`);function oB(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}c(oB,`toBase64`);var Ade=5e4,jde=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,Mde=`sandbox`,Nde=`loose`,Pde=`http://www.w3.org/2000/svg`,Fde=`http://www.w3.org/1999/xlink`,Ide=`http://www.w3.org/1999/xhtml`,Lde=`100%`,Rde=`100%`,zde=`border:0;margin:0;`,Bde=`margin:0`,Vde=`allow-top-navigation-by-user-activation allow-popups`,Hde=`The "iframe" tag is not supported by your browser.`,Ude=[`foreignobject`],Wde=[`dominant-baseline`];function sB(e){let t=aB(e);return p(),k(t.config??{}),t}c(sB,`processAndSetConfigs`);async function cB(e,t){$z();try{let{code:t,config:n}=sB(e);return{diagramType:(await _B(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}c(cB,`parse`);var lB=c((e,t,n=[])=>`.${e} ${t} ${m(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),Gde=c((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=y(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{ER(e.styles)||r.forEach(t=>{n.insertRule(lB(e.id,t,e.styles),n.cssRules.length)}),ER(e.textStyles)||n.insertRule(lB(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=D(t)+`
|
|
644
644
|
`}else r+=`${e.themeCSS}
|
|
@@ -754,14 +754,14 @@ ${e}</tr>
|
|
|
754
754
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${J$(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Y$(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+J$(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Y$(e);if(i===null)return J$(n);e=i;let a=`<img src="${e}" alt="${J$(n)}"`;return t&&(a+=` title="${J$(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:J$(e.text)}},n1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},r1=class e{options;renderer;textRenderer;constructor(e){this.options=e||g$,this.options.renderer=this.options.renderer||new t1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new n1}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},i1=class{options;block;constructor(e){this.options=e||g$}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?e1.lex:e1.lexInline}provideParser(e=this.block){return e?r1.parse:r1.parseInline}},a1=new class{defaults=h$();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=r1;Renderer=t1;TextRenderer=n1;Lexer=e1;Tokenizer=$$;Hooks=i1;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new t1(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $$(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new i1;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];i1.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&i1.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return e1.lex(e,t??this.defaults)}parser(e,t){return r1.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?e1.lex:e1.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?r1.parse:r1.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?e1.lex:e1.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?r1.parse:r1.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
755
755
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+J$(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function o1(e,t){return a1.parse(e,t)}o1.options=o1.setOptions=function(e){return a1.setOptions(e),o1.defaults=a1.defaults,_$(o1.defaults),o1},o1.getDefaults=h$,o1.defaults=g$,o1.use=function(...e){return a1.use(...e),o1.defaults=a1.defaults,_$(o1.defaults),o1},o1.walkTokens=function(e,t){return a1.walkTokens(e,t)},o1.parseInline=a1.parseInline,o1.Parser=r1,o1.parser=r1.parse,o1.Renderer=t1,o1.TextRenderer=n1,o1.Lexer=e1,o1.lexer=e1.lex,o1.Tokenizer=$$,o1.Hooks=i1,o1.parse=o1,o1.options,o1.setOptions,o1.use,o1.walkTokens,o1.parseInline,r1.parse,e1.lex;var Che=300,whe=`300px`,The=500;function Ehe(e={}){let{immediate:t=!1,debounceDelay:n=Che,rootMargin:r=whe,idleTimeout:i=The}=e,[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,N.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,N.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var s1=/\s/,Dhe=/^\s+$/,Ohe=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),khe=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,Ahe=e=>e.some(e=>khe(e)&&Ohe.has(e.tagName)),jhe=e=>{let t=[],n=``,r=!1;for(let i of e){let e=s1.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},Mhe=e=>{let t=[],n=``;for(let r of e)s1.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},Nhe=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},Phe=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(Ahe(t))return JC;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?Mhe(c):jhe(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,Dhe.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return Nhe(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},Fhe=0;function c1(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=Fhe++,i=()=>e=>{let r={count:0,newIndex:0};YC(e,`text`,(e,i)=>Phe(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}c1();var l1=(0,N.createContext)(!1),Ihe=()=>(0,N.useContext)(l1),u1=(...e)=>Gg(Fh(e)),Lhe=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Rhe=e=>e?(...t)=>Lhe(e,Gg(Fh(t))):u1,d1=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},f1=(0,N.createContext)(u1),p1=()=>(0,N.useContext)(f1),zhe=u1(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Bhe=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},m1=(0,N.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=p1(),c=(0,N.useMemo)(()=>s(zhe),[s]),l=(0,N.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Bhe(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,I.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,I.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,I.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,I.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
756
756
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,I.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Vhe=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,I.jsx)(`div`,{className:p1()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),h1=(0,N.createContext)({code:``}),g1=()=>(0,N.useContext)(h1),Hhe=({language:e})=>{let t=p1();return(0,I.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,I.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Uhe=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
757
|
-
`;)t--;return e.slice(0,t)},Whe=(0,N.lazy)(()=>a(()=>import(`./highlighted-body-OFNGDK62-
|
|
757
|
+
`;)t--;return e.slice(0,t)},Whe=(0,N.lazy)(()=>a(()=>import(`./highlighted-body-OFNGDK62-Cq8HtngO.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([167,1]))),Ghe=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=p1(),l=(0,N.useMemo)(()=>Uhe(e),[e]),u=(0,N.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
758
758
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,I.jsx)(h1.Provider,{value:{code:e},children:(0,I.jsxs)(Vhe,{isIncomplete:i,language:t,children:[(0,I.jsx)(Hhe,{language:t}),r?(0,I.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,I.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,I.jsx)(N.Suspense,{fallback:(0,I.jsx)(m1,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,I.jsx)(Whe,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},_1={CheckIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,I.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,I.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,I.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,I.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,I.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},v1=(0,N.createContext)(_1),Khe=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},y1=({icons:e,children:t})=>{let n=(0,N.useRef)(e),r=(0,N.useRef)(e?{..._1,...e}:_1);Khe(n.current,e)||(n.current=e,r.current=e?{..._1,...e}:_1);let i=r.current;return(0,I.jsx)(v1.Provider,{value:i,children:t})},b1=()=>(0,N.useContext)(v1),x1={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},S1=(0,N.createContext)(x1),C1=()=>(0,N.useContext)(S1),w1=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=p1(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:d}=g1(),{isAnimating:f}=(0,N.useContext)(N0),p=C1(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=b1(),_=c?g.CheckIcon:g.CopyIcon;return(0,I.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,I.jsx)(_,{size:14})})},T1={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},qhe=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=p1(),{code:c}=g1(),{isAnimating:l}=(0,N.useContext)(N0),u=C1(),d=b1(),f=a??c,p=`file.${n&&n in T1?T1[n]:`txt`}`;return(0,I.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{d1(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,I.jsx)(d.DownloadIcon,{size:14})})},E1=()=>{let{Loader2Icon:e}=b1(),t=p1();return(0,I.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,I.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,I.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,I.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},Jhe=/\.[^/.]+$/,Yhe=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=b1(),c=p1(),l=(0,N.useRef)(null),[u,d]=(0,N.useState)(!1),[f,p]=(0,N.useState)(!1),m=C1(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,N.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,N.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,N.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(Jhe,``)}.${i}`}d1(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,I.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,I.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,I.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,I.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,I.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,I.jsx)(s,{size:14})})]}):null},D1=0,O1=()=>{D1+=1,D1===1&&(document.body.style.overflow=`hidden`)},k1=()=>{D1=Math.max(0,D1-1),D1===0&&(document.body.style.overflow=``)},Xhe=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=b1(),c=p1(),[l,u]=(0,N.useState)(!1),d=C1(),f=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,N.useCallback)(()=>{r(),n()},[r,n]);return(0,N.useEffect)(()=>{if(t){O1();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),k1()}}},[t,n]),t?(0,I.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,I.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,I.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,I.jsx)(s,{size:16})}),(0,I.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,I.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,I.jsx)(o,{size:20}),(0,I.jsx)(`span`,{children:d.openExternalLink})]}),(0,I.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,I.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,I.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,I.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{size:14}),(0,I.jsx)(`span`,{children:d.copied})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{size:14}),(0,I.jsx)(`span`,{children:d.copyLink})]})}),(0,I.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,I.jsx)(o,{size:14}),(0,I.jsx)(`span`,{children:d.openLink})]})]})]})}):null},A1=(0,N.createContext)(null),j1=()=>(0,N.useContext)(A1),Zhe=()=>j1()?.code??null,M1=()=>j1()?.mermaid??null,Qhe=e=>{var t;let n=j1();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},$he=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),ege=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=p1(),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u}=(0,N.useContext)(N0),d=b1(),f=M1(),p=C1(),m=async t=>{try{if(t===`mmd`){d1(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){d1(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){d1(`diagram.png`,await $he(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,I.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,I.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,I.jsx)(d.DownloadIcon,{size:14})}),s?(0,I.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,I.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,I.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,I.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},tge=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=b1(),c=p1(),[l,u]=(0,N.useState)(!1),{isAnimating:d,controls:f}=(0,N.useContext)(N0),p=C1(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,N.useEffect)(()=>{if(l){O1();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),k1()}}},[l]),(0,N.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,I.jsx)(o,{size:14})}),l?(0,zy.createPortal)((0,I.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,I.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,I.jsx)(s,{size:20})}),(0,I.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,I.jsx)(I0,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},N1=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},P1=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
759
759
|
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
760
760
|
`)},nge=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
761
761
|
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
762
762
|
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
763
763
|
`)},F1=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},I1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>F1(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?F1(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>F1(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
764
|
-
`)},L1=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=p1(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f}=(0,N.useContext)(N0),p=C1(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=N1(t),o=({csv:P1,tsv:nge,md:I1}[e]||I1)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=b1(),g=c?h.CheckIcon:h.CopyIcon;return(0,I.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,I.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,I.jsx)(g,{height:14,width:14})}),o?(0,I.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},R1=({children:e,className:t,onDownload:n,onError:r})=>{let i=p1(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c}=(0,N.useContext)(N0),l=C1(),u=b1(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=N1(t),a=e===`csv`?P1(i):I1(i);d1(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,I.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,I.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,I.jsx)(u.DownloadIcon,{size:14})}),a?(0,I.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,I.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,I.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},rge=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=b1(),o=p1(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(N0),u=C1(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){O1();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),k1()}}},[s]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,I.jsx)(i,{size:14})}),s?(0,zy.createPortal)((0,I.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,I.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,I.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,I.jsx)(L1,{}):null,r?(0,I.jsx)(R1,{}):null,(0,I.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,I.jsx)(a,{size:20})})]}),(0,I.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,I.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},ige=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=p1(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,I.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,I.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,I.jsx)(L1,{}):null,l?(0,I.jsx)(R1,{}):null,u?(0,I.jsx)(rge,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,I.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,I.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},age=/startLine=(\d+)/,oge=/\bnoLineNumbers\b/,sge=(0,N.lazy)(()=>a(()=>import(`./mermaid-GHXKKRXX-RtlXh8PG.js`).then(e=>({default:e.Mermaid})),[])),cge=/language-([^\s]+)/;function z1(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function B1(e,t){return e.className===t.className&&z1(e.node,t.node)}var V1=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,H1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},U1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},W1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},G1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`ol`,{className:p1()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>B1(e,t));G1.displayName=`MarkdownOl`;var K1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`li`,{className:p1()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&z1(e.node,t.node));K1.displayName=`MarkdownLi`;var q1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`ul`,{className:p1()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>B1(e,t));q1.displayName=`MarkdownUl`;var J1=(0,N.memo)(({className:e,node:t,...n})=>(0,I.jsx)(`hr`,{className:p1()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>B1(e,t));J1.displayName=`MarkdownHr`;var Y1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`span`,{className:p1()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>B1(e,t));Y1.displayName=`MarkdownStrong`;var X1=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=p1(),{linkSafety:o}=(0,N.useContext)(N0),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,I.jsx)(Xhe,{...p})]}):(0,I.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>B1(e,t)&&e.href===t.href);X1.displayName=`MarkdownA`;var Z1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h1`,{className:p1()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>B1(e,t));Z1.displayName=`MarkdownH1`;var Q1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h2`,{className:p1()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>B1(e,t));Q1.displayName=`MarkdownH2`;var $1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h3`,{className:p1()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>B1(e,t));$1.displayName=`MarkdownH3`;var e0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h4`,{className:p1()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>B1(e,t));e0.displayName=`MarkdownH4`;var t0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h5`,{className:p1()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>B1(e,t));t0.displayName=`MarkdownH5`;var n0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h6`,{className:p1()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>B1(e,t));n0.displayName=`MarkdownH6`;var r0=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,N.useContext)(N0);return(0,I.jsx)(ige,{className:t,showControls:V1(i,`table`),showCopy:H1(i,`copy`),showDownload:H1(i,`download`),showFullscreen:H1(i,`fullscreen`),...r,children:e})},(e,t)=>B1(e,t));r0.displayName=`MarkdownTable`;var i0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`thead`,{className:p1()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>B1(e,t));i0.displayName=`MarkdownThead`;var a0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`tbody`,{className:p1()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>B1(e,t));a0.displayName=`MarkdownTbody`;var o0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`tr`,{className:p1()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>B1(e,t));o0.displayName=`MarkdownTr`;var s0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`th`,{className:p1()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>B1(e,t));s0.displayName=`MarkdownTh`;var c0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`td`,{className:p1()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>B1(e,t));c0.displayName=`MarkdownTd`;var l0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`blockquote`,{className:p1()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>B1(e,t));l0.displayName=`MarkdownBlockquote`;var u0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`sup`,{className:p1()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>B1(e,t));u0.displayName=`MarkdownSup`;var d0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`sub`,{className:p1()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>B1(e,t));d0.displayName=`MarkdownSub`;var f0=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===G1){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,I.jsx)(`section`,{className:t,...r,children:i}):null}return(0,I.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>B1(e,t));f0.displayName=`MarkdownSection`;var p0=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=p1(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(N0),l=M1(),u=Ihe(),d=(t?.match(cge))?.at(1)??``,f=Qhe(d);if(a)return(0,I.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(age),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&oge.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,I.jsx)(N.Suspense,{fallback:(0,I.jsx)(E1,{}),children:(0,I.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=V1(s,`mermaid`),n=W1(s,`download`),r=W1(s,`copy`),a=W1(s,`fullscreen`),c=W1(s,`panZoom`),l=e&&(n||r||a);return(0,I.jsx)(N.Suspense,{fallback:(0,I.jsx)(E1,{}),children:(0,I.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,I.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,I.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,I.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,I.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,I.jsx)(ege,{chart:v,config:o?.config}):null,r?(0,I.jsx)(w1,{code:v}):null,a?(0,I.jsx)(tge,{chart:v,config:o?.config}):null]})}):null,(0,I.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,I.jsx)(sge,{chart:v,config:o?.config,showControls:c})})]})})}let y=V1(s,`code`),b=U1(s,`download`),x=U1(s,`copy`);return(0,I.jsx)(Ghe,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,I.jsxs)(I.Fragment,{children:[b?(0,I.jsx)(qhe,{code:v,language:d}):null,x?(0,I.jsx)(w1,{}):null]}):null})},(e,t)=>e.className===t.className&&z1(e.node,t.node));p0.displayName=`MarkdownCode`;var m0=(0,N.memo)(Yhe,(e,t)=>e.className===t.className&&z1(e.node,t.node));m0.displayName=`MarkdownImg`;var h0=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,I.jsx)(I.Fragment,{children:e})}return(0,I.jsx)(`p`,{...n,children:e})},(e,t)=>B1(e,t));h0.displayName=`MarkdownParagraph`;var lge={ol:G1,li:K1,ul:q1,hr:J1,strong:Y1,a:X1,h1:Z1,h2:Q1,h3:$1,h4:e0,h5:t0,h6:n0,table:r0,thead:i0,tbody:a0,tr:o0,th:s0,td:c0,blockquote:l0,code:p0,img:m0,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:u0,sub:d0,p:h0,section:f0},uge=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,dge=/\p{L}/u;function g0(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(uge.test(e))return`rtl`;if(dge.test(e))return`ltr`}return`ltr`}var fge=/^[ \t]{0,3}(`{3,}|~{3,})/,pge=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,_0=e=>{let t=e.split(`
|
|
764
|
+
`)},L1=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=p1(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f}=(0,N.useContext)(N0),p=C1(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=N1(t),o=({csv:P1,tsv:nge,md:I1}[e]||I1)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=b1(),g=c?h.CheckIcon:h.CopyIcon;return(0,I.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,I.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,I.jsx)(g,{height:14,width:14})}),o?(0,I.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,I.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},R1=({children:e,className:t,onDownload:n,onError:r})=>{let i=p1(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c}=(0,N.useContext)(N0),l=C1(),u=b1(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=N1(t),a=e===`csv`?P1(i):I1(i);d1(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,I.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,I.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,I.jsx)(u.DownloadIcon,{size:14})}),a?(0,I.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,I.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,I.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},rge=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=b1(),o=p1(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(N0),u=C1(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){O1();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),k1()}}},[s]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,I.jsx)(i,{size:14})}),s?(0,zy.createPortal)((0,I.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,I.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,I.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,I.jsx)(L1,{}):null,r?(0,I.jsx)(R1,{}):null,(0,I.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,I.jsx)(a,{size:20})})]}),(0,I.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,I.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},ige=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=p1(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,I.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,I.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,I.jsx)(L1,{}):null,l?(0,I.jsx)(R1,{}):null,u?(0,I.jsx)(rge,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,I.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,I.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},age=/startLine=(\d+)/,oge=/\bnoLineNumbers\b/,sge=(0,N.lazy)(()=>a(()=>import(`./mermaid-GHXKKRXX-Bx5T61Gj.js`).then(e=>({default:e.Mermaid})),[])),cge=/language-([^\s]+)/;function z1(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function B1(e,t){return e.className===t.className&&z1(e.node,t.node)}var V1=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,H1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},U1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},W1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},G1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`ol`,{className:p1()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>B1(e,t));G1.displayName=`MarkdownOl`;var K1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`li`,{className:p1()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&z1(e.node,t.node));K1.displayName=`MarkdownLi`;var q1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`ul`,{className:p1()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>B1(e,t));q1.displayName=`MarkdownUl`;var J1=(0,N.memo)(({className:e,node:t,...n})=>(0,I.jsx)(`hr`,{className:p1()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>B1(e,t));J1.displayName=`MarkdownHr`;var Y1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`span`,{className:p1()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>B1(e,t));Y1.displayName=`MarkdownStrong`;var X1=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=p1(),{linkSafety:o}=(0,N.useContext)(N0),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,I.jsx)(Xhe,{...p})]}):(0,I.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>B1(e,t)&&e.href===t.href);X1.displayName=`MarkdownA`;var Z1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h1`,{className:p1()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>B1(e,t));Z1.displayName=`MarkdownH1`;var Q1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h2`,{className:p1()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>B1(e,t));Q1.displayName=`MarkdownH2`;var $1=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h3`,{className:p1()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>B1(e,t));$1.displayName=`MarkdownH3`;var e0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h4`,{className:p1()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>B1(e,t));e0.displayName=`MarkdownH4`;var t0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h5`,{className:p1()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>B1(e,t));t0.displayName=`MarkdownH5`;var n0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`h6`,{className:p1()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>B1(e,t));n0.displayName=`MarkdownH6`;var r0=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,N.useContext)(N0);return(0,I.jsx)(ige,{className:t,showControls:V1(i,`table`),showCopy:H1(i,`copy`),showDownload:H1(i,`download`),showFullscreen:H1(i,`fullscreen`),...r,children:e})},(e,t)=>B1(e,t));r0.displayName=`MarkdownTable`;var i0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`thead`,{className:p1()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>B1(e,t));i0.displayName=`MarkdownThead`;var a0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`tbody`,{className:p1()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>B1(e,t));a0.displayName=`MarkdownTbody`;var o0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`tr`,{className:p1()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>B1(e,t));o0.displayName=`MarkdownTr`;var s0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`th`,{className:p1()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>B1(e,t));s0.displayName=`MarkdownTh`;var c0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`td`,{className:p1()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>B1(e,t));c0.displayName=`MarkdownTd`;var l0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`blockquote`,{className:p1()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>B1(e,t));l0.displayName=`MarkdownBlockquote`;var u0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`sup`,{className:p1()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>B1(e,t));u0.displayName=`MarkdownSup`;var d0=(0,N.memo)(({children:e,className:t,node:n,...r})=>(0,I.jsx)(`sub`,{className:p1()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>B1(e,t));d0.displayName=`MarkdownSub`;var f0=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===G1){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,I.jsx)(`section`,{className:t,...r,children:i}):null}return(0,I.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>B1(e,t));f0.displayName=`MarkdownSection`;var p0=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=p1(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(N0),l=M1(),u=Ihe(),d=(t?.match(cge))?.at(1)??``,f=Qhe(d);if(a)return(0,I.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(age),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&oge.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,I.jsx)(N.Suspense,{fallback:(0,I.jsx)(E1,{}),children:(0,I.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=V1(s,`mermaid`),n=W1(s,`download`),r=W1(s,`copy`),a=W1(s,`fullscreen`),c=W1(s,`panZoom`),l=e&&(n||r||a);return(0,I.jsx)(N.Suspense,{fallback:(0,I.jsx)(E1,{}),children:(0,I.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,I.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,I.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,I.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,I.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,I.jsx)(ege,{chart:v,config:o?.config}):null,r?(0,I.jsx)(w1,{code:v}):null,a?(0,I.jsx)(tge,{chart:v,config:o?.config}):null]})}):null,(0,I.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,I.jsx)(sge,{chart:v,config:o?.config,showControls:c})})]})})}let y=V1(s,`code`),b=U1(s,`download`),x=U1(s,`copy`);return(0,I.jsx)(Ghe,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,I.jsxs)(I.Fragment,{children:[b?(0,I.jsx)(qhe,{code:v,language:d}):null,x?(0,I.jsx)(w1,{}):null]}):null})},(e,t)=>e.className===t.className&&z1(e.node,t.node));p0.displayName=`MarkdownCode`;var m0=(0,N.memo)(Yhe,(e,t)=>e.className===t.className&&z1(e.node,t.node));m0.displayName=`MarkdownImg`;var h0=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,I.jsx)(I.Fragment,{children:e})}return(0,I.jsx)(`p`,{...n,children:e})},(e,t)=>B1(e,t));h0.displayName=`MarkdownParagraph`;var lge={ol:G1,li:K1,ul:q1,hr:J1,strong:Y1,a:X1,h1:Z1,h2:Q1,h3:$1,h4:e0,h5:t0,h6:n0,table:r0,thead:i0,tbody:a0,tr:o0,th:s0,td:c0,blockquote:l0,code:p0,img:m0,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:u0,sub:d0,p:h0,section:f0},uge=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,dge=/\p{L}/u;function g0(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(uge.test(e))return`rtl`;if(dge.test(e))return`ltr`}return`ltr`}var fge=/^[ \t]{0,3}(`{3,}|~{3,})/,pge=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,_0=e=>{let t=e.split(`
|
|
765
765
|
`),n=null,r=0;for(let e of t){let t=fge.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},mge=e=>{let t=e.split(`
|
|
766
766
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&pge.test(t))return!0}return!1},hge=()=>e=>{XC(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},v0=[],y0={allowDangerousHtml:!0},b0=new WeakMap,x0=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=b0.get(e);n||(n=e.name,b0.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=b0.get(r);e||(e=r.name,b0.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},S0=e=>{let t=gge(e),n=e.children||``;return Cge(t.runSync(t.parse(n),n),e)},gge=e=>{let t=x0.get(e);if(t)return t;let n=vge(e);return x0.set(e,n),n},_ge=e=>e.some(e=>Array.isArray(e)?e[0]===cK:e===cK),vge=e=>{let t=e.rehypePlugins||v0,n=e.remarkPlugins||v0,r=_ge(t)?n:[...n,hge],i=e.remarkRehypeOptions?{...y0,...e.remarkRehypeOptions}:y0;return Fme().use(Fpe).use(r).use(_me,i).use(t)},yge=e=>e,bge=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},xge=(e,t)=>{for(let n in FQ)if(Object.hasOwn(FQ,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=FQ[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Sge=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},Cge=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||yge;XC(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return bge(c,s,a,e.value),s;if(e.type===`element`&&(xge(e,t),Sge(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Ufe(e,{Fragment:I.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0})},wge=/\[\^[\w-]{1,200}\](?!:)/,Tge=/\[\^[\w-]{1,200}\]:/,Ege=/<(\w+)[\s>]/,Dge=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),C0=new Map,w0=new Map,Oge=e=>{let t=e.toLowerCase(),n=C0.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return C0.set(t,r),r},kge=e=>{let t=e.toLowerCase(),n=w0.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return w0.set(t,r),r},T0=(e,t)=>{if(Dge.has(t.toLowerCase()))return 0;let n=e.match(Oge(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},E0=(e,t)=>{let n=e.match(kge(t));return n?n.length:0},Age=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},jge=e=>{let t=wge.test(e),n=Tge.test(e);if(t||n)return[e];let r=e1.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=T0(t,e),o=E0(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(Ege);if(e){let n=e[1];T0(t,n)>E0(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(Age(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},Mge=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
767
767
|
|
|
@@ -780,9 +780,9 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
780
780
|
|
|
781
781
|
---
|
|
782
782
|
|
|
783
|
-
`),r=e.parts.filter(e=>e.type===`source-url`||e.type===`source-document`).map(e=>e.type===`source-url`?{href:e.url,title:e.title??e.url}:{href:`#${e.sourceId}`,title:e.title}),i=e.parts.filter(jp),a={key:e.id,from:e.role,versions:[{id:e.id,content:t}]};return r.length>0&&(a.sources=r),n&&(a.reasoning={content:n,duration:0}),i.length>0&&(a.tools=i),a})}function lEe({onAuthTokenSubmit:e}){let[t,n]=(0,N.useState)(``);return(0,I.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,I.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unauthorized`}),(0,I.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`You are not authorized to connect to this agent.`})]}),e&&(0,I.jsxs)(`form`,{className:`flex w-full max-w-sm items-center gap-2`,onSubmit:n=>{n.preventDefault();let r=t.trim();r&&e(r)},children:[(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs placeholder:text-muted-foreground placeholder:text-xs`,placeholder:`Add a token to reconnect...`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value)}),(0,I.jsx)(Jg,{disabled:!t.trim(),size:`sm`,type:`submit`,children:`Reconnect`})]})]})}function U9({messages:e,chatStatus:t,sendMessage:n,connectionStatus:r,hasChat:i=!0,onNewChat:a,onAuthTokenSubmit:o,feedback:s,onFeedback:c}){let[l,u]=(0,N.useState)(``),[d,f]=(0,N.useState)(!0),[p,m]=(0,N.useState)(!0),[h,g]=(0,N.useState)(!0),_=(0,N.useMemo)(()=>cEe(e),[e]),v=t===`streaming`||t===`submitted`,y=_.at(-1)?.key,b=!l.trim()||t===`streaming`||t===`submitted`,x=(0,N.useCallback)(e=>{let t=e.text?.trim();t&&(n?.({role:`user`,parts:[{type:`text`,text:t}]}),u(``))},[n]),S=(0,N.useCallback)(e=>u(e.target.value),[]),C=(0,N.useCallback)(e=>u(t=>t?`${t} ${e}`:e),[]),w=(0,N.useMemo)(()=>{if(t!==`submitted`&&t!==`streaming`)return!1;let e=_.at(-1);return!e||e.from===`user`?!0:!(e.versions.some(e=>e.content.trim().length>0)||e.reasoning?.content.trim())},[t,_]);return r===`unauthorized`?(0,I.jsx)(lEe,{onAuthTokenSubmit:o}):r===`disconnected`?(0,I.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,I.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),(0,I.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`Could not reach the agent. Check the URL and make sure it's running.`})]})}):i?(0,I.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,I.jsxs)(__,{children:[(0,I.jsxs)(v_,{children:[_.map(({versions:e,...t})=>(0,I.jsxs)(Kge,{defaultBranch:0,children:[(0,I.jsx)(qge,{children:e.map(e=>(0,I.jsx)(L0,{from:t.from,children:(0,I.jsxs)(`div`,{children:[d&&t.tools?.map(e=>(0,I.jsxs)(PTe,{children:[e.type===`dynamic-tool`?(0,I.jsx)(N9,{type:e.type,state:e.state,toolName:e.toolName}):(0,I.jsx)(N9,{type:e.type,state:e.state}),(0,I.jsxs)(RTe,{children:[(0,I.jsx)(zTe,{input:e.input}),(0,I.jsx)(BTe,{output:e.output,errorText:e.errorText})]})]},e.toolCallId)),t.sources?.length&&(0,I.jsxs)(PCe,{children:[(0,I.jsx)(FCe,{count:t.sources.length}),(0,I.jsx)(ICe,{children:t.sources.map(e=>(0,I.jsx)(LCe,{href:e.href,title:e.title},e.href))})]}),p&&t.reasoning&&(0,I.jsxs)(w7,{duration:t.reasoning.duration,children:[(0,I.jsx)(T7,{}),(0,I.jsx)(E7,{children:t.reasoning.content})]}),(0,I.jsx)(R0,{children:(0,I.jsx)(H0,{children:e.content})}),t.from===`assistant`&&c&&h&&!(t.key===y&&v)&&(0,I.jsx)($ge,{messageId:t.key,feedback:s?.[t.key],onFeedback:c})]})},`${t.key}-${e.id}`))}),e.length>1&&(0,I.jsxs)(Jge,{children:[(0,I.jsx)(Yge,{}),(0,I.jsx)(Zge,{}),(0,I.jsx)(Xge,{})]})]},t.key)),w&&(0,I.jsx)(L0,{from:`assistant`,children:(0,I.jsx)(R0,{children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,I.jsx)(b2,{className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,I.jsx)(y_,{})]}),(0,I.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,I.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,I.jsxs)(gve,{globalDrop:!0,multiple:!0,onSubmit:x,children:[(0,I.jsx)(_ve,{children:(0,I.jsx)(vve,{onChange:S,value:l})}),(0,I.jsxs)(yve,{children:[(0,I.jsxs)(bve,{children:[(0,I.jsx)(zCe,{className:`shrink-0`,onTranscriptionChange:C,size:`icon-sm`,variant:`ghost`}),(0,I.jsxs)(nEe,{children:[(0,I.jsx)(rEe,{render:(0,I.jsx)(Jg,{size:`icon-sm`,variant:`ghost`,"aria-label":`Display settings`}),children:(0,I.jsx)(yte,{className:`size-4`})}),(0,I.jsx)(iEe,{className:`w-52`,align:`start`,side:`top`,children:(0,I.jsxs)(`div`,{className:`grid gap-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h4`,{className:`text-sm font-medium`,children:`Display options`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Toggle what you see in the chat.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-tools`,children:`Show tool outputs`}),(0,I.jsx)(H9,{id:`show-tools`,checked:d,onCheckedChange:f})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-reasoning`,children:`Show reasoning`}),(0,I.jsx)(H9,{id:`show-reasoning`,checked:p,onCheckedChange:m})]}),c&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-feedback`,children:`Show feedback`}),(0,I.jsx)(H9,{id:`show-feedback`,checked:h,onCheckedChange:g})]})]})})]})]}),(0,I.jsx)(xve,{disabled:b,status:t})]})]})})})]}):(0,I.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 px-4 text-muted-foreground`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Start a new chat to begin.`}),a&&(0,I.jsxs)(Jg,{onClick:a,children:[(0,I.jsx)(r_,{className:`size-4`}),`New chat`]})]})}function uEe(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function W9(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function dEe({host:e,agentName:t,userId:n,authToken:r,onAgentStatusChange:i,onAuthTokenChange:a,toolContext:o={},welcomeMessage:s}){let{currentChatName:c,status:l,assistant:u,chat:d,chats:f}=uee({host:e,agentName:t,name:n,authToken:r,toolContext:o,welcomeMessage:s}),{feedback:p,onFeedback:m}=Om({status:l,chatKey:c,submitMessageFeedback:d.submitMessageFeedback,getMessageFeedback:d.getMessageFeedback});(0,N.useEffect)(()=>{let e=uEe();e&&u.openChat(e)},[]),(0,N.useEffect)(()=>{i(l)},[l]);async function h(){W9(await u.createChat()),await u.getChats()}function g(e){u.openChat(e),W9(e)}async function _(e){u.deleteChat(e),await u.getChats()}let v=(0,N.useCallback)(e=>{let t=(d?.chat.messages?.length??0)===0;d?.chat.sendMessage?.(e),t&&setTimeout(()=>{u.getChats()},3e3)},[d,u]);return(0,I.jsxs)(`div`,{className:`w-full h-full flex`,children:[(0,I.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-r border-border bg-muted/30`,children:[(0,I.jsxs)(`div`,{className:`border-b border-border p-2 flex justify-between`,children:[(0,I.jsxs)(Jg,{className:`cursor-pointer`,onClick:()=>h(),children:[(0,I.jsx)(r_,{className:`size-4`}),`New chat`]}),(0,I.jsx)(Jg,{size:`icon-sm`,variant:`ghost`,onClick:()=>u.getChats(),children:(0,I.jsx)(vte,{className:`size-4`})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:f.length===0?(0,I.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No conversations yet.`}):(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.map(e=>{let t=e.name===c;return(0,I.jsxs)(`li`,{className:Kg(`relative group border border-border rounded-md`,{"border-gray-300":t}),children:[(0,I.jsxs)(`button`,{className:Kg(`w-full cursor-pointer rounded-md px-2 py-1.5 text-left transition-colors`,t?`bg-accent text-accent-foreground`:`hover:bg-accent`),onClick:()=>g(e.name),children:[(0,I.jsx)(`span`,{className:`truncate text-xs font-medium flex items-center mt-1`,children:e.title??(0,I.jsxs)(I.Fragment,{children:[`Untitled`,(0,I.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:new Date(e.updated_at).toLocaleString()})]})}),(0,I.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.summary})]}),(0,I.jsx)(Jg,{className:`absolute right-0 top-0 mt-0.5 mr-0.5 items-center justify-center invisible group-hover:visible bg-gray-50 text-gray-500 cursor-pointer flex`,size:`icon-sm`,variant:`ghost`,onClick:async()=>await _(e.name),children:(0,I.jsx)(Cte,{className:`size-4`})})]},e.name)})})})]}),(0,I.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,I.jsx)(U9,{messages:d?.chat.messages??[],chatStatus:d.chat.status??`ready`,sendMessage:v,connectionStatus:l,hasChat:!!c,onNewChat:()=>void h(),onAuthTokenSubmit:a,feedback:p,onFeedback:m})})]})}function fEe(e){return(0,I.jsx)(`p`,{children:`Not implemented yet.`})}function pEe(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function mEe(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function hEe({host:e,agentName:t,authToken:n,userId:r,onAgentStatusChange:i,onAuthTokenChange:a,toolContext:o={},welcomeMessage:s}){let c=(0,N.useMemo)(()=>{let e=pEe()??Up();return mEe(e),e},[]),{status:l,chat:u,submitMessageFeedback:d,getMessageFeedback:f}=Dm({host:e,agentName:t,name:`${r}:${c}`,authToken:n,toolContext:o,welcomeMessage:s}),{feedback:p,onFeedback:m}=Om({status:l,chatKey:c,submitMessageFeedback:d,getMessageFeedback:f});return(0,N.useEffect)(()=>{i(l)},[l]),(0,I.jsx)(`div`,{className:`w-full h-full flex`,children:(0,I.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,I.jsx)(U9,{messages:u?.messages??[],chatStatus:u?.status??`ready`,sendMessage:u?.sendMessage,connectionStatus:l,onAuthTokenSubmit:a,feedback:p,onFeedback:m})})})}function gEe(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _Ee=e=>{switch(e){case`success`:return bEe;case`info`:return SEe;case`warning`:return xEe;case`error`:return CEe;default:return null}},vEe=Array(12).fill(0),yEe=({visible:e,className:t})=>N.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},N.createElement(`div`,{className:`sonner-spinner`},vEe.map((e,t)=>N.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),bEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),xEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),SEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),CEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),wEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},N.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),N.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),TEe=()=>{let[e,t]=N.useState(document.hidden);return N.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},G9=1,K9=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:G9++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(DEe(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||G9++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},EEe=(e,t)=>{let n=t?.id||G9++;return K9.addToast({title:e,...t,id:n}),n},DEe=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,q9=Object.assign(EEe,{success:K9.success,info:K9.info,warning:K9.warning,error:K9.error,custom:K9.custom,message:K9.message,promise:K9.promise,dismiss:K9.dismiss,loading:K9.loading},{getHistory:()=>K9.toasts,getToasts:()=>K9.getActiveToasts()});gEe(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function J9(e){return e.label!==void 0}var OEe=3,kEe=`24px`,AEe=`16px`,Y9=4e3,jEe=356,MEe=14,NEe=45,PEe=200;function X9(...e){return e.filter(Boolean).join(` `)}function FEe(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var IEe=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,ee]=N.useState(null),[D,O]=N.useState(null),[k,te]=N.useState(!1),[ne,A]=N.useState(!1),[j,re]=N.useState(!1),[M,ie]=N.useState(!1),[ae,oe]=N.useState(!1),[se,ce]=N.useState(0),[le,ue]=N.useState(0),de=N.useRef(n.duration||y||Y9),fe=N.useRef(null),pe=N.useRef(null),me=c===0,he=c+1<=o,ge=n.type,_e=n.dismissible!==!1,ve=n.className||``,ye=n.descriptionClassName||``,be=N.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),xe=N.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Se=N.useMemo(()=>n.duration||y||Y9,[n.duration,y]),Ce=N.useRef(0),we=N.useRef(0),Te=N.useRef(0),Ee=N.useRef(null),[De,Oe]=b.split(`-`),ke=N.useMemo(()=>s.reduce((e,t,n)=>n>=be?e:e+t.height,0),[s,be]),Ae=TEe(),je=n.invert||t,Me=ge===`loading`;we.current=N.useMemo(()=>be*x+ke,[be,ke]),N.useEffect(()=>{de.current=Se},[Se]),N.useEffect(()=>{te(!0)},[]),N.useEffect(()=>{let e=pe.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),N.useLayoutEffect(()=>{if(!k)return;let e=pe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ne=N.useCallback(()=>{A(!0),ce(we.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},PEe)},[n,d,a,we]);N.useEffect(()=>{if(n.promise&&ge===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ae?(()=>{if(Te.current<Ce.current){let e=new Date().getTime()-Ce.current;de.current-=e}Te.current=new Date().getTime()})():de.current!==1/0&&(Ce.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ne()},de.current)),()=>clearTimeout(e)},[u,i,n,ge,Ae,Ne]),N.useEffect(()=>{n.delete&&(Ne(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ne,n.delete]);function Pe(){return w?.loading?N.createElement(`div`,{className:X9(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ge===`loading`},w.loading):N.createElement(yEe,{className:X9(C?.loader,n?.classNames?.loader),visible:ge===`loading`})}let Fe=n.icon||w?.[ge]||_Ee(ge);return N.createElement(`li`,{tabIndex:0,ref:pe,className:X9(_,ve,C?.toast,n?.classNames?.toast,C?.default,C?.[ge],n?.classNames?.[ge]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":ae,"data-removed":ne,"data-visible":he,"data-y-position":De,"data-x-position":Oe,"data-index":c,"data-front":me,"data-swiping":j,"data-dismissible":_e,"data-type":ge,"data-invert":je,"data-swipe-out":M,"data-swipe-direction":D,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ne?se:we.current}px`,"--initial-height":S?`auto`:`${le}px`,...m,...n.style},onDragEnd:()=>{re(!1),ee(null),Ee.current=null},onPointerDown:e=>{e.button!==2&&(Me||!_e||(fe.current=new Date,ce(we.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(re(!0),Ee.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(M||!_e)return;Ee.current=null;let e=Number(pe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(pe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-fe.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=NEe||a>.11){ce(we.current),n.onDismiss==null||n.onDismiss.call(n,n),O(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ne(),ie(!0);return}else{var o,s;(o=pe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=pe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}oe(!1),re(!1),ee(null)},onPointerMove:t=>{var n,r;if(!Ee.current||!_e||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ee.current.y,a=t.clientX-Ee.current.x,o=e.swipeDirections??FEe(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&ee(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&oe(!0),(n=pe.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=pe.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},xe&&!n.jsx&&ge!==`loading`?N.createElement(`button`,{"aria-label":T,"data-disabled":Me,"data-close-button":!0,onClick:Me||!_e?()=>{}:()=>{Ne(),n.onDismiss==null||n.onDismiss.call(n,n)},className:X9(C?.closeButton,n?.classNames?.closeButton)},w?.close??wEe):null,(ge||n.icon||n.promise)&&n.icon!==null&&(w?.[ge]!==null||n.icon)?N.createElement(`div`,{"data-icon":``,className:X9(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Pe():null,n.type===`loading`?null:Fe):null,N.createElement(`div`,{"data-content":``,className:X9(C?.content,n?.classNames?.content)},N.createElement(`div`,{"data-title":``,className:X9(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?N.createElement(`div`,{"data-description":``,className:X9(v,ye,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),N.isValidElement(n.cancel)?n.cancel:n.cancel&&J9(n.cancel)?N.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{J9(n.cancel)&&_e&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ne())},className:X9(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,N.isValidElement(n.action)?n.action:n.action&&J9(n.action)?N.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{J9(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ne())},className:X9(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Z9(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function LEe(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?AEe:kEe;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var REe=N.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=OEe,toastOptions:g,dir:_=Z9(),gap:v=MEe,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=N.useState([]),C=N.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=N.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=N.useState([]),[ee,D]=N.useState(!1),[O,k]=N.useState(!1),[te,ne]=N.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),A=N.useRef(null),j=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),re=N.useRef(null),M=N.useRef(!1),ie=N.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||K9.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return N.useEffect(()=>K9.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{zy.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),N.useEffect(()=>{if(d!==`system`){ne(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ne(`dark`):ne(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ne(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ne(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),N.useEffect(()=>{x.length<=1&&D(!1)},[x]),N.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;D(!0),(t=A.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===A.current||A.current?.contains(document.activeElement))&&D(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),N.useEffect(()=>{if(A.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,M.current=!1)}},[A.current]),N.createElement(`section`,{ref:t,"aria-label":`${b} ${j}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?N.createElement(`ol`,{key:t,dir:_===`auto`?Z9():_,tabIndex:-1,ref:A,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${jEe}px`,"--gap":`${v}px`,...m,...LEe(l,u)},onBlur:e=>{M.current&&!e.currentTarget.contains(e.relatedTarget)&&(M.current=!1,re.current&&=(re.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M.current||(M.current=!0,re.current=e.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{O||D(!1)},onDragEnd:()=>D(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>N.createElement(IEe,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:O,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ie,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:ee,swipeDirections:e.swipeDirections}))):null}))}),zEe=`playground:url`,BEe=`playground:body`,VEe=`playground:query`,HEe=`playground:userId`,UEe=`playground:token`,WEe=`playground:welcomeMessage`;function GEe(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}function KEe(e){if(!e||e===`{}`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t;for(let e of Object.values(n))if(typeof e!=`string`)return null;return n}function Q9(e){try{let t=new URL(e.includes(`://`)?e:`http://${e}`),n=t.pathname.split(`/`).filter(Boolean);return n[0]===`agents`&&n[1]?{host:t.host,agent:n[1]}:null}catch{return null}}function qEe(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function JEe(e){return e?Q9(e)||(q9.error(`Invalid agent URL — expected http://<host>/agents/<name>`),null):null}function YEe(){let e=new URLSearchParams(window.location.search);if(!e.has(`chat`))return;e.delete(`chat`);let t=e.toString();history.replaceState(null,``,t?`?${t}`:window.location.pathname)}function XEe(){return localStorage.getItem(`playground:url`)??``}function ZEe(){return localStorage.getItem(`playground:userId`)??``}function QEe(){return localStorage.getItem(`playground:token`)??``}function $9(){return localStorage.getItem(`playground:welcomeMessage`)??``}function $Ee(){return localStorage.getItem(`playground:body`)??``}function eDe(){return localStorage.getItem(`playground:query`)??``}function tDe(){let[e,t]=(0,N.useState)(XEe),[n,r]=(0,N.useState)(e),[i,a]=(0,N.useState)(ZEe),[o,s]=(0,N.useState)(QEe),[c,l]=(0,N.useState)($9),[u,d]=(0,N.useState)($Ee),[f,p]=(0,N.useState)(eDe),m=(0,N.useCallback)(e=>{localStorage.setItem(HEe,e),a(e)},[]),h=(0,N.useCallback)(e=>{localStorage.setItem(UEe,e),s(e)},[]),g=(0,N.useCallback)(e=>{localStorage.setItem(WEe,e),l(e)},[]),_=(0,N.useCallback)(e=>{localStorage.setItem(BEe,e),d(e)},[]),v=(0,N.useCallback)(e=>{localStorage.setItem(VEe,e),p(e)},[]);return{agentUrl:e,urlDraft:n,setUrlDraft:r,commitUrl:(0,N.useCallback)(()=>{let i=n.trim();return JEe(i)?(i!==e&&YEe(),localStorage.setItem(zEe,i),t(i),r(i),!0):!1},[n,e]),connection:(0,N.useMemo)(()=>e?Q9(e):null,[e]),userId:i,setUserId:m,token:o,setToken:h,welcomeMessage:c,setWelcomeMessage:g,body:u,setBody:_,query:f,setQuery:v,toolContext:(0,N.useMemo)(()=>{let e=u.trim();if(e)try{return JSON.parse(e)}catch{return}},[u]),connectionParams:(0,N.useMemo)(()=>f?KEe(f.trim())??void 0:void 0,[f])}}var nDe=`{
|
|
783
|
+
`),r=e.parts.filter(e=>e.type===`source-url`||e.type===`source-document`).map(e=>e.type===`source-url`?{href:e.url,title:e.title??e.url}:{href:`#${e.sourceId}`,title:e.title}),i=e.parts.filter(jp),a={key:e.id,from:e.role,versions:[{id:e.id,content:t}]};return r.length>0&&(a.sources=r),n&&(a.reasoning={content:n,duration:0}),i.length>0&&(a.tools=i),a})}function lEe({onAuthTokenSubmit:e}){let[t,n]=(0,N.useState)(``);return(0,I.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,I.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unauthorized`}),(0,I.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`You are not authorized to connect to this agent.`})]}),e&&(0,I.jsxs)(`form`,{className:`flex w-full max-w-sm items-center gap-2`,onSubmit:n=>{n.preventDefault();let r=t.trim();r&&e(r)},children:[(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs placeholder:text-muted-foreground placeholder:text-xs`,placeholder:`Add a token to reconnect...`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value)}),(0,I.jsx)(Jg,{disabled:!t.trim(),size:`sm`,type:`submit`,children:`Reconnect`})]})]})}function U9({messages:e,chatStatus:t,sendMessage:n,connectionStatus:r,hasChat:i=!0,onNewChat:a,onAuthTokenSubmit:o,feedback:s,onFeedback:c}){let[l,u]=(0,N.useState)(``),[d,f]=(0,N.useState)(!0),[p,m]=(0,N.useState)(!0),[h,g]=(0,N.useState)(!0),_=(0,N.useMemo)(()=>cEe(e),[e]),v=t===`streaming`||t===`submitted`,y=_.at(-1)?.key,b=!l.trim()||t===`streaming`||t===`submitted`,x=(0,N.useCallback)(e=>{let t=e.text?.trim();t&&(n?.({role:`user`,parts:[{type:`text`,text:t}]}),u(``))},[n]),S=(0,N.useCallback)(e=>u(e.target.value),[]),C=(0,N.useCallback)(e=>u(t=>t?`${t} ${e}`:e),[]),w=(0,N.useMemo)(()=>{if(t!==`submitted`&&t!==`streaming`)return!1;let e=_.at(-1);return!e||e.from===`user`?!0:!(e.versions.some(e=>e.content.trim().length>0)||e.reasoning?.content.trim())},[t,_]);return r===`unauthorized`?(0,I.jsx)(lEe,{onAuthTokenSubmit:o}):r===`disconnected`?(0,I.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,I.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),(0,I.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`Could not reach the agent. Check the URL and make sure it's running.`})]})}):i?(0,I.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,I.jsxs)(__,{children:[(0,I.jsxs)(v_,{children:[_.map(({versions:e,...t})=>(0,I.jsxs)(Kge,{defaultBranch:0,children:[(0,I.jsx)(qge,{children:e.map(e=>(0,I.jsx)(L0,{from:t.from,children:(0,I.jsxs)(`div`,{children:[d&&t.tools?.map(e=>(0,I.jsxs)(PTe,{children:[e.type===`dynamic-tool`?(0,I.jsx)(N9,{type:e.type,state:e.state,toolName:e.toolName}):(0,I.jsx)(N9,{type:e.type,state:e.state}),(0,I.jsxs)(RTe,{children:[(0,I.jsx)(zTe,{input:e.input}),(0,I.jsx)(BTe,{output:e.output,errorText:e.errorText})]})]},e.toolCallId)),t.sources?.length&&(0,I.jsxs)(PCe,{children:[(0,I.jsx)(FCe,{count:t.sources.length}),(0,I.jsx)(ICe,{children:t.sources.map(e=>(0,I.jsx)(LCe,{href:e.href,title:e.title},e.href))})]}),p&&t.reasoning&&(0,I.jsxs)(w7,{duration:t.reasoning.duration,children:[(0,I.jsx)(T7,{}),(0,I.jsx)(E7,{children:t.reasoning.content})]}),(0,I.jsx)(R0,{children:(0,I.jsx)(H0,{children:e.content})}),t.from===`assistant`&&c&&h&&!(t.key===y&&v)&&(0,I.jsx)($ge,{messageId:t.key,feedback:s?.[t.key],onFeedback:c})]})},`${t.key}-${e.id}`))}),e.length>1&&(0,I.jsxs)(Jge,{children:[(0,I.jsx)(Yge,{}),(0,I.jsx)(Zge,{}),(0,I.jsx)(Xge,{})]})]},t.key)),w&&(0,I.jsx)(L0,{from:`assistant`,children:(0,I.jsx)(R0,{children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,I.jsx)(b2,{className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,I.jsx)(y_,{})]}),(0,I.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,I.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,I.jsxs)(gve,{globalDrop:!0,multiple:!0,onSubmit:x,children:[(0,I.jsx)(_ve,{children:(0,I.jsx)(vve,{onChange:S,value:l})}),(0,I.jsxs)(yve,{children:[(0,I.jsxs)(bve,{children:[(0,I.jsx)(zCe,{className:`shrink-0`,onTranscriptionChange:C,size:`icon-sm`,variant:`ghost`}),(0,I.jsxs)(nEe,{children:[(0,I.jsx)(rEe,{render:(0,I.jsx)(Jg,{size:`icon-sm`,variant:`ghost`,"aria-label":`Display settings`}),children:(0,I.jsx)(yte,{className:`size-4`})}),(0,I.jsx)(iEe,{className:`w-52`,align:`start`,side:`top`,children:(0,I.jsxs)(`div`,{className:`grid gap-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h4`,{className:`text-sm font-medium`,children:`Display options`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Toggle what you see in the chat.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-tools`,children:`Show tool outputs`}),(0,I.jsx)(H9,{id:`show-tools`,checked:d,onCheckedChange:f})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-reasoning`,children:`Show reasoning`}),(0,I.jsx)(H9,{id:`show-reasoning`,checked:p,onCheckedChange:m})]}),c&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`text-sm`,htmlFor:`show-feedback`,children:`Show feedback`}),(0,I.jsx)(H9,{id:`show-feedback`,checked:h,onCheckedChange:g})]})]})})]})]}),(0,I.jsx)(xve,{disabled:b,status:t})]})]})})})]}):(0,I.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 px-4 text-muted-foreground`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Start a new chat to begin.`}),a&&(0,I.jsxs)(Jg,{onClick:a,children:[(0,I.jsx)(r_,{className:`size-4`}),`New chat`]})]})}function uEe(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function W9(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function dEe({host:e,agentName:t,userId:n,authToken:r,onAgentStatusChange:i,onAuthTokenChange:a,toolContext:o={},welcomeMessage:s}){let{currentChatName:c,status:l,assistant:u,chat:d,chats:f}=uee({host:e,agentName:t,name:n,authToken:r,toolContext:o,welcomeMessage:s,initialChatId:uEe()}),{feedback:p,onFeedback:m}=Om({status:l,chatKey:c,submitMessageFeedback:d.submitMessageFeedback,getMessageFeedback:d.getMessageFeedback});(0,N.useEffect)(()=>{i(l)},[l]);async function h(){W9(await u.createChat()),await u.getChats()}function g(e){u.openChat(e),W9(e)}async function _(e){u.deleteChat(e),await u.getChats()}let v=(0,N.useCallback)(e=>{let t=(d?.chat.messages?.length??0)===0;d?.chat.sendMessage?.(e),t&&setTimeout(()=>{u.getChats()},3e3)},[d,u]);return(0,I.jsxs)(`div`,{className:`w-full h-full flex`,children:[(0,I.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-r border-border bg-muted/30`,children:[(0,I.jsxs)(`div`,{className:`border-b border-border p-2 flex justify-between`,children:[(0,I.jsxs)(Jg,{className:`cursor-pointer`,onClick:()=>h(),children:[(0,I.jsx)(r_,{className:`size-4`}),`New chat`]}),(0,I.jsx)(Jg,{size:`icon-sm`,variant:`ghost`,onClick:()=>u.getChats(),children:(0,I.jsx)(vte,{className:`size-4`})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:f.length===0?(0,I.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No conversations yet.`}):(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.map(e=>{let t=e.name===c;return(0,I.jsxs)(`li`,{className:Kg(`relative group border border-border rounded-md`,{"border-gray-300":t}),children:[(0,I.jsxs)(`button`,{className:Kg(`w-full cursor-pointer rounded-md px-2 py-1.5 text-left transition-colors`,t?`bg-accent text-accent-foreground`:`hover:bg-accent`),onClick:()=>g(e.name),children:[(0,I.jsx)(`span`,{className:`truncate text-xs font-medium flex items-center mt-1`,children:e.title??(0,I.jsxs)(I.Fragment,{children:[`Untitled`,(0,I.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:new Date(e.updated_at).toLocaleString()})]})}),(0,I.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.summary})]}),(0,I.jsx)(Jg,{className:`absolute right-0 top-0 mt-0.5 mr-0.5 items-center justify-center invisible group-hover:visible bg-gray-50 text-gray-500 cursor-pointer flex`,size:`icon-sm`,variant:`ghost`,onClick:async()=>await _(e.name),children:(0,I.jsx)(Cte,{className:`size-4`})})]},e.name)})})})]}),(0,I.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,I.jsx)(U9,{messages:d?.chat.messages??[],chatStatus:d.chat.status??`ready`,sendMessage:v,connectionStatus:l,hasChat:!!c,onNewChat:()=>void h(),onAuthTokenSubmit:a,feedback:p,onFeedback:m})})]})}function fEe(e){return(0,I.jsx)(`p`,{children:`Not implemented yet.`})}function pEe(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function mEe(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function hEe({host:e,agentName:t,authToken:n,userId:r,onAgentStatusChange:i,onAuthTokenChange:a,toolContext:o={},welcomeMessage:s}){let c=(0,N.useMemo)(()=>{let e=pEe()??Up();return mEe(e),e},[]),{status:l,chat:u,submitMessageFeedback:d,getMessageFeedback:f}=Dm({host:e,agentName:t,name:`${r}:${c}`,authToken:n,toolContext:o,welcomeMessage:s}),{feedback:p,onFeedback:m}=Om({status:l,chatKey:c,submitMessageFeedback:d,getMessageFeedback:f});return(0,N.useEffect)(()=>{i(l)},[l]),(0,I.jsx)(`div`,{className:`w-full h-full flex`,children:(0,I.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,I.jsx)(U9,{messages:u?.messages??[],chatStatus:u?.status??`ready`,sendMessage:u?.sendMessage,connectionStatus:l,onAuthTokenSubmit:a,feedback:p,onFeedback:m})})})}function gEe(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _Ee=e=>{switch(e){case`success`:return bEe;case`info`:return SEe;case`warning`:return xEe;case`error`:return CEe;default:return null}},vEe=Array(12).fill(0),yEe=({visible:e,className:t})=>N.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},N.createElement(`div`,{className:`sonner-spinner`},vEe.map((e,t)=>N.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),bEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),xEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),SEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),CEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},N.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),wEe=N.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},N.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),N.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),TEe=()=>{let[e,t]=N.useState(document.hidden);return N.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},G9=1,K9=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:G9++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(DEe(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||G9++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},EEe=(e,t)=>{let n=t?.id||G9++;return K9.addToast({title:e,...t,id:n}),n},DEe=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,q9=Object.assign(EEe,{success:K9.success,info:K9.info,warning:K9.warning,error:K9.error,custom:K9.custom,message:K9.message,promise:K9.promise,dismiss:K9.dismiss,loading:K9.loading},{getHistory:()=>K9.toasts,getToasts:()=>K9.getActiveToasts()});gEe(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function J9(e){return e.label!==void 0}var OEe=3,kEe=`24px`,AEe=`16px`,Y9=4e3,jEe=356,MEe=14,NEe=45,PEe=200;function X9(...e){return e.filter(Boolean).join(` `)}function FEe(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var IEe=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,ee]=N.useState(null),[D,O]=N.useState(null),[k,te]=N.useState(!1),[ne,A]=N.useState(!1),[j,re]=N.useState(!1),[M,ie]=N.useState(!1),[ae,oe]=N.useState(!1),[se,ce]=N.useState(0),[le,ue]=N.useState(0),de=N.useRef(n.duration||y||Y9),fe=N.useRef(null),pe=N.useRef(null),me=c===0,he=c+1<=o,ge=n.type,_e=n.dismissible!==!1,ve=n.className||``,ye=n.descriptionClassName||``,be=N.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),xe=N.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Se=N.useMemo(()=>n.duration||y||Y9,[n.duration,y]),Ce=N.useRef(0),we=N.useRef(0),Te=N.useRef(0),Ee=N.useRef(null),[De,Oe]=b.split(`-`),ke=N.useMemo(()=>s.reduce((e,t,n)=>n>=be?e:e+t.height,0),[s,be]),Ae=TEe(),je=n.invert||t,Me=ge===`loading`;we.current=N.useMemo(()=>be*x+ke,[be,ke]),N.useEffect(()=>{de.current=Se},[Se]),N.useEffect(()=>{te(!0)},[]),N.useEffect(()=>{let e=pe.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),N.useLayoutEffect(()=>{if(!k)return;let e=pe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ne=N.useCallback(()=>{A(!0),ce(we.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},PEe)},[n,d,a,we]);N.useEffect(()=>{if(n.promise&&ge===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ae?(()=>{if(Te.current<Ce.current){let e=new Date().getTime()-Ce.current;de.current-=e}Te.current=new Date().getTime()})():de.current!==1/0&&(Ce.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ne()},de.current)),()=>clearTimeout(e)},[u,i,n,ge,Ae,Ne]),N.useEffect(()=>{n.delete&&(Ne(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ne,n.delete]);function Pe(){return w?.loading?N.createElement(`div`,{className:X9(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ge===`loading`},w.loading):N.createElement(yEe,{className:X9(C?.loader,n?.classNames?.loader),visible:ge===`loading`})}let Fe=n.icon||w?.[ge]||_Ee(ge);return N.createElement(`li`,{tabIndex:0,ref:pe,className:X9(_,ve,C?.toast,n?.classNames?.toast,C?.default,C?.[ge],n?.classNames?.[ge]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":ae,"data-removed":ne,"data-visible":he,"data-y-position":De,"data-x-position":Oe,"data-index":c,"data-front":me,"data-swiping":j,"data-dismissible":_e,"data-type":ge,"data-invert":je,"data-swipe-out":M,"data-swipe-direction":D,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ne?se:we.current}px`,"--initial-height":S?`auto`:`${le}px`,...m,...n.style},onDragEnd:()=>{re(!1),ee(null),Ee.current=null},onPointerDown:e=>{e.button!==2&&(Me||!_e||(fe.current=new Date,ce(we.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(re(!0),Ee.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(M||!_e)return;Ee.current=null;let e=Number(pe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(pe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-fe.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=NEe||a>.11){ce(we.current),n.onDismiss==null||n.onDismiss.call(n,n),O(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ne(),ie(!0);return}else{var o,s;(o=pe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=pe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}oe(!1),re(!1),ee(null)},onPointerMove:t=>{var n,r;if(!Ee.current||!_e||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ee.current.y,a=t.clientX-Ee.current.x,o=e.swipeDirections??FEe(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&ee(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&oe(!0),(n=pe.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=pe.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},xe&&!n.jsx&&ge!==`loading`?N.createElement(`button`,{"aria-label":T,"data-disabled":Me,"data-close-button":!0,onClick:Me||!_e?()=>{}:()=>{Ne(),n.onDismiss==null||n.onDismiss.call(n,n)},className:X9(C?.closeButton,n?.classNames?.closeButton)},w?.close??wEe):null,(ge||n.icon||n.promise)&&n.icon!==null&&(w?.[ge]!==null||n.icon)?N.createElement(`div`,{"data-icon":``,className:X9(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Pe():null,n.type===`loading`?null:Fe):null,N.createElement(`div`,{"data-content":``,className:X9(C?.content,n?.classNames?.content)},N.createElement(`div`,{"data-title":``,className:X9(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?N.createElement(`div`,{"data-description":``,className:X9(v,ye,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),N.isValidElement(n.cancel)?n.cancel:n.cancel&&J9(n.cancel)?N.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{J9(n.cancel)&&_e&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ne())},className:X9(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,N.isValidElement(n.action)?n.action:n.action&&J9(n.action)?N.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{J9(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ne())},className:X9(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Z9(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function LEe(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?AEe:kEe;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var REe=N.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=OEe,toastOptions:g,dir:_=Z9(),gap:v=MEe,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=N.useState([]),C=N.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=N.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=N.useState([]),[ee,D]=N.useState(!1),[O,k]=N.useState(!1),[te,ne]=N.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),A=N.useRef(null),j=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),re=N.useRef(null),M=N.useRef(!1),ie=N.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||K9.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return N.useEffect(()=>K9.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{zy.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),N.useEffect(()=>{if(d!==`system`){ne(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ne(`dark`):ne(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ne(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ne(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),N.useEffect(()=>{x.length<=1&&D(!1)},[x]),N.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;D(!0),(t=A.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===A.current||A.current?.contains(document.activeElement))&&D(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),N.useEffect(()=>{if(A.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,M.current=!1)}},[A.current]),N.createElement(`section`,{ref:t,"aria-label":`${b} ${j}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?N.createElement(`ol`,{key:t,dir:_===`auto`?Z9():_,tabIndex:-1,ref:A,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${jEe}px`,"--gap":`${v}px`,...m,...LEe(l,u)},onBlur:e=>{M.current&&!e.currentTarget.contains(e.relatedTarget)&&(M.current=!1,re.current&&=(re.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M.current||(M.current=!0,re.current=e.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{O||D(!1)},onDragEnd:()=>D(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>N.createElement(IEe,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:O,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ie,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:ee,swipeDirections:e.swipeDirections}))):null}))}),zEe=`playground:url`,BEe=`playground:body`,VEe=`playground:query`,HEe=`playground:userId`,UEe=`playground:token`,WEe=`playground:welcomeMessage`;function GEe(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}function KEe(e){if(!e||e===`{}`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t;for(let e of Object.values(n))if(typeof e!=`string`)return null;return n}function Q9(e){try{let t=new URL(e.includes(`://`)?e:`http://${e}`),n=t.pathname.split(`/`).filter(Boolean);return n[0]===`agents`&&n[1]?{host:t.host,agent:n[1]}:null}catch{return null}}function qEe(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function JEe(e){return e?Q9(e)||(q9.error(`Invalid agent URL — expected http://<host>/agents/<name>`),null):null}function YEe(){let e=new URLSearchParams(window.location.search);if(!e.has(`chat`))return;e.delete(`chat`);let t=e.toString();history.replaceState(null,``,t?`?${t}`:window.location.pathname)}function XEe(){return localStorage.getItem(`playground:url`)??``}function ZEe(){return localStorage.getItem(`playground:userId`)??``}function QEe(){return localStorage.getItem(`playground:token`)??``}function $9(){return localStorage.getItem(`playground:welcomeMessage`)??``}function $Ee(){return localStorage.getItem(`playground:body`)??``}function eDe(){return localStorage.getItem(`playground:query`)??``}function tDe(){let[e,t]=(0,N.useState)(XEe),[n,r]=(0,N.useState)(e),[i,a]=(0,N.useState)(ZEe),[o,s]=(0,N.useState)(QEe),[c,l]=(0,N.useState)($9),[u,d]=(0,N.useState)($Ee),[f,p]=(0,N.useState)(eDe),m=(0,N.useCallback)(e=>{localStorage.setItem(HEe,e),a(e)},[]),h=(0,N.useCallback)(e=>{localStorage.setItem(UEe,e),s(e)},[]),g=(0,N.useCallback)(e=>{localStorage.setItem(WEe,e),l(e)},[]),_=(0,N.useCallback)(e=>{localStorage.setItem(BEe,e),d(e)},[]),v=(0,N.useCallback)(e=>{localStorage.setItem(VEe,e),p(e)},[]);return{agentUrl:e,urlDraft:n,setUrlDraft:r,commitUrl:(0,N.useCallback)(()=>{let i=n.trim();return JEe(i)?(i!==e&&YEe(),localStorage.setItem(zEe,i),t(i),r(i),!0):!1},[n,e]),connection:(0,N.useMemo)(()=>e?Q9(e):null,[e]),userId:i,setUserId:m,token:o,setToken:h,welcomeMessage:c,setWelcomeMessage:g,body:u,setBody:_,query:f,setQuery:v,toolContext:(0,N.useMemo)(()=>{let e=u.trim();if(e)try{return JSON.parse(e)}catch{return}},[u]),connectionParams:(0,N.useMemo)(()=>f?KEe(f.trim())??void 0:void 0,[f])}}var nDe=`{
|
|
784
784
|
"timezone": "Europe/Copenhagen",
|
|
785
785
|
"tokens": {
|
|
786
786
|
"X-EconomicToken": "token_123"
|
|
787
787
|
}
|
|
788
|
-
}`;function rDe({body:e,onChange:t}){let[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(e),o=(0,N.useCallback)(t=>{t&&a(e),r(t)},[e]),s=(0,N.useCallback)(()=>{let e=i.trim();if(e&&e!==`{}`)try{JSON.parse(e)}catch{q9.error(`Invalid JSON — check the syntax and try again.`);return}t(e),r(!1)},[i,t]),c=GEe(e);return(0,I.jsxs)(n2,{open:n,onOpenChange:o,children:[(0,I.jsxs)(NS,{children:[(0,I.jsxs)(PS,{render:(0,I.jsx)(r2,{render:(0,I.jsx)(Jg,{"aria-label":`Request body`,title:`Request body — JSON merged into each chat request (tool execution context)`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,I.jsx)(bte,{className:`size-4`}),c&&(0,I.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,I.jsx)(FS,{children:(0,I.jsx)(`p`,{children:`Request body params`})})]}),(0,I.jsxs)(i2,{className:`!w-2xl !max-w-2xl`,children:[(0,I.jsx)(a2,{children:(0,I.jsx)(s2,{children:`Request body`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`JSON object merged into the body of every chat request. Available in tool`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`execute`}),` functions via`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`experimental_context`}),`.`]}),(0,I.jsx)(_2,{className:`font-mono text-xs min-h-32 max-h-72 break-all w-full`,placeholder:nDe,value:i,onChange:e=>a(e.target.value),spellCheck:!1})]}),(0,I.jsx)(o2,{showCloseButton:!0,children:(0,I.jsx)(Jg,{size:`sm`,onClick:s,children:`Save`})})]})]})}function iDe({userId:e,onUserIdChange:t,token:n,onTokenChange:r,welcomeMessage:i,onWelcomeMessageChange:a}){let[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(e),[u,d]=(0,N.useState)(n),[f,p]=(0,N.useState)(i),[m,h]=(0,N.useState)(!1),g=(0,N.useCallback)(t=>{t&&(l(e),d(n),p(i)),s(t)},[e,n,i]),_=(0,N.useCallback)(()=>{let e=c.trim();if(!e){q9.error(`User ID is required.`);return}t(e),r(u.trim()),a(f.trim()),s(!1)},[c,u,f,t,r,a]);return(0,I.jsxs)(n2,{open:o,onOpenChange:g,children:[(0,I.jsxs)(NS,{children:[(0,I.jsxs)(PS,{render:(0,I.jsx)(r2,{render:(0,I.jsx)(Jg,{"aria-label":`Connection settings`,title:`Connection settings — user ID and auth token`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,I.jsx)(hte,{className:`size-4`}),(!!e||!!n)&&(0,I.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,I.jsx)(FS,{children:(0,I.jsx)(`p`,{children:`Connection settings`})})]}),(0,I.jsxs)(i2,{className:`!w-2xl !max-w-2xl`,children:[(0,I.jsx)(a2,{children:(0,I.jsx)(s2,{children:`Connection settings`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Configure your User ID and auth token for the WebSocket connection. Changes take effect on the next connection after saving, such as starting a new chat or refreshing the page.`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-user-id`,children:[`User ID `,(0,I.jsx)(`span`,{className:`text-destructive font-normal`,children:`(required)`})]}),(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs`,id:`params-user-id`,onChange:e=>l(e.target.value),placeholder:`e.g. user_123`,spellCheck:!1,value:c})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-token`,children:[`Auth Token `,(0,I.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs pr-10`,id:`params-token`,onChange:e=>d(e.target.value),placeholder:`Bearer token for authentication`,spellCheck:!1,type:m?`text`:`password`,value:u}),(0,I.jsx)(Jg,{className:`absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7`,onClick:()=>h(e=>!e),size:`icon-sm`,type:`button`,variant:`ghost`,children:m?(0,I.jsx)(pte,{className:`size-4`}):(0,I.jsx)(mte,{className:`size-4`})})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-welcome-message`,children:[`Welcome Message `,(0,I.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,I.jsx)(_2,{className:`text-xs min-h-16 max-h-32`,id:`params-welcome-message`,onChange:e=>p(e.target.value),placeholder:`Hello! How can I help you today?`,spellCheck:!1,value:f})]})]}),(0,I.jsx)(o2,{showCloseButton:!0,children:(0,I.jsx)(Jg,{size:`sm`,onClick:_,children:`Save`})})]})]})}function aDe({config:e,connectionStatus:t,agentType:n,agentName:r}){let i=(0,N.useRef)(!1);return(0,I.jsxs)(`header`,{className:`flex h-20 items-center justify-between border-b border-zinc-200 bg-zinc-50/50 px-6 py-6`,children:[(0,I.jsx)(`div`,{className:`flex items-center`,children:e.agentUrl?(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`mb-0 flex items-center text-sm font-semibold`,children:[(0,I.jsx)(`div`,{className:[`mr-2 h-2 w-2 rounded-full`,t===`connected`&&`bg-green-500`,t===`connecting`&&`bg-amber-400 animate-pulse`,(t===`disconnected`||t===`unauthorized`)&&`bg-red-500 animate-pulse`,!t&&`bg-muted-foreground/50`].filter(Boolean).join(` `)}),t===`connected`&&(e.userId?`Connected to ${r} as ${e.userId}`:"Connected to ${agentName}"),t===`connecting`&&`Connecting...`,t===`disconnected`&&`Unable to connect to agent`,t===`unauthorized`&&`Unauthorized to connect to agent`,!t&&`Not connected`]}),(0,I.jsx)(`input`,{className:`-ml-1.5 field-sizing-content rounded-md py-1 pr-10 pl-2 text-xs text-muted-foreground hover:bg-white hover:text-foreground hover:outline hover:outline-zinc-200 focus:bg-white focus:text-foreground focus:outline focus:outline-zinc-300`,value:e.urlDraft,onChange:t=>e.setUrlDraft(t.target.value),onKeyDown:t=>{t.key===`Enter`?(i.current=e.commitUrl(),t.currentTarget.blur()):t.key===`Escape`&&(e.setUrlDraft(e.agentUrl),t.currentTarget.blur())},onBlur:()=>{if(i.current){i.current=!1;return}e.setUrlDraft(e.agentUrl)}})]}):(0,I.jsxs)(`div`,{className:`flex items-center`,children:[(0,I.jsx)(`div`,{className:`mr-3 h-2 w-2 rounded-full bg-muted-foreground/50`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`mb-0 text-sm font-semibold text-muted-foreground`,children:`Not Connected`}),(0,I.jsx)(`input`,{className:`-ml-1.5 field-sizing-content rounded-md py-1 pr-10 pl-2 text-xs text-muted-foreground hover:bg-white hover:text-foreground hover:outline hover:outline-zinc-200 focus:bg-white focus:text-foreground focus:outline focus:outline-zinc-300`,placeholder:`http://localhost:8787/agents/my-agent`,value:e.urlDraft,onChange:t=>e.setUrlDraft(t.target.value),onKeyDown:t=>{t.key===`Enter`&&(e.commitUrl(),t.currentTarget.blur())}})]})]})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Agent type: `,n.charAt(0).toUpperCase()+n.slice(1)]}):null,(0,I.jsx)(iDe,{userId:e.userId,onUserIdChange:e.setUserId,token:e.token,onTokenChange:e.setToken,welcomeMessage:e.welcomeMessage,onWelcomeMessageChange:e.setWelcomeMessage}),(0,I.jsx)(rDe,{body:e.body,onChange:e.setBody})]})]})}function oDe(){let e=tDe(),[t,n]=(0,N.useState)(void 0),r=e.connection?.host??``,i=e.connection?qEe(e.connection.agent):``,a=!!(e.connection&&e.userId),o=Em({host:r,agentName:i,name:e.userId,authToken:e.token||void 0,enabled:a}),s={host:r,agentName:i,userId:e.userId,authToken:e.token||void 0,toolContext:e.toolContext,connectionParams:e.connectionParams,welcomeMessage:e.welcomeMessage||void 0,onAgentStatusChange:n,onAuthTokenChange:e.setToken};return(0,I.jsxs)(`div`,{className:`flex flex-col h-screen w-screen relative overflow-hidden`,children:[(0,I.jsx)(aDe,{config:e,connectionStatus:t,agentType:o
|
|
788
|
+
}`;function rDe({body:e,onChange:t}){let[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(e),o=(0,N.useCallback)(t=>{t&&a(e),r(t)},[e]),s=(0,N.useCallback)(()=>{let e=i.trim();if(e&&e!==`{}`)try{JSON.parse(e)}catch{q9.error(`Invalid JSON — check the syntax and try again.`);return}t(e),r(!1)},[i,t]),c=GEe(e);return(0,I.jsxs)(n2,{open:n,onOpenChange:o,children:[(0,I.jsxs)(NS,{children:[(0,I.jsxs)(PS,{render:(0,I.jsx)(r2,{render:(0,I.jsx)(Jg,{"aria-label":`Request body`,title:`Request body — JSON merged into each chat request (tool execution context)`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,I.jsx)(bte,{className:`size-4`}),c&&(0,I.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,I.jsx)(FS,{children:(0,I.jsx)(`p`,{children:`Request body params`})})]}),(0,I.jsxs)(i2,{className:`!w-2xl !max-w-2xl`,children:[(0,I.jsx)(a2,{children:(0,I.jsx)(s2,{children:`Request body`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`JSON object merged into the body of every chat request. Available in tool`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`execute`}),` functions via`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`experimental_context`}),`.`]}),(0,I.jsx)(_2,{className:`font-mono text-xs min-h-32 max-h-72 break-all w-full`,placeholder:nDe,value:i,onChange:e=>a(e.target.value),spellCheck:!1})]}),(0,I.jsx)(o2,{showCloseButton:!0,children:(0,I.jsx)(Jg,{size:`sm`,onClick:s,children:`Save`})})]})]})}function iDe({userId:e,onUserIdChange:t,token:n,onTokenChange:r,welcomeMessage:i,onWelcomeMessageChange:a}){let[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(e),[u,d]=(0,N.useState)(n),[f,p]=(0,N.useState)(i),[m,h]=(0,N.useState)(!1),g=(0,N.useCallback)(t=>{t&&(l(e),d(n),p(i)),s(t)},[e,n,i]),_=(0,N.useCallback)(()=>{let e=c.trim();if(!e){q9.error(`User ID is required.`);return}t(e),r(u.trim()),a(f.trim()),s(!1)},[c,u,f,t,r,a]);return(0,I.jsxs)(n2,{open:o,onOpenChange:g,children:[(0,I.jsxs)(NS,{children:[(0,I.jsxs)(PS,{render:(0,I.jsx)(r2,{render:(0,I.jsx)(Jg,{"aria-label":`Connection settings`,title:`Connection settings — user ID and auth token`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,I.jsx)(hte,{className:`size-4`}),(!!e||!!n)&&(0,I.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,I.jsx)(FS,{children:(0,I.jsx)(`p`,{children:`Connection settings`})})]}),(0,I.jsxs)(i2,{className:`!w-2xl !max-w-2xl`,children:[(0,I.jsx)(a2,{children:(0,I.jsx)(s2,{children:`Connection settings`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Configure your User ID and auth token for the WebSocket connection. Changes take effect on the next connection after saving, such as starting a new chat or refreshing the page.`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-user-id`,children:[`User ID `,(0,I.jsx)(`span`,{className:`text-destructive font-normal`,children:`(required)`})]}),(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs`,id:`params-user-id`,onChange:e=>l(e.target.value),placeholder:`e.g. user_123`,spellCheck:!1,value:c})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-token`,children:[`Auth Token `,(0,I.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(g2,{autoComplete:`off`,className:`font-mono text-xs pr-10`,id:`params-token`,onChange:e=>d(e.target.value),placeholder:`Bearer token for authentication`,spellCheck:!1,type:m?`text`:`password`,value:u}),(0,I.jsx)(Jg,{className:`absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7`,onClick:()=>h(e=>!e),size:`icon-sm`,type:`button`,variant:`ghost`,children:m?(0,I.jsx)(pte,{className:`size-4`}):(0,I.jsx)(mte,{className:`size-4`})})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-welcome-message`,children:[`Welcome Message `,(0,I.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,I.jsx)(_2,{className:`text-xs min-h-16 max-h-32`,id:`params-welcome-message`,onChange:e=>p(e.target.value),placeholder:`Hello! How can I help you today?`,spellCheck:!1,value:f})]})]}),(0,I.jsx)(o2,{showCloseButton:!0,children:(0,I.jsx)(Jg,{size:`sm`,onClick:_,children:`Save`})})]})]})}function aDe({config:e,connectionStatus:t,agentType:n,agentName:r}){let i=(0,N.useRef)(!1);return(0,I.jsxs)(`header`,{className:`flex h-20 items-center justify-between border-b border-zinc-200 bg-zinc-50/50 px-6 py-6`,children:[(0,I.jsx)(`div`,{className:`flex items-center`,children:e.agentUrl?(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`mb-0 flex items-center text-sm font-semibold`,children:[(0,I.jsx)(`div`,{className:[`mr-2 h-2 w-2 rounded-full`,t===`connected`&&`bg-green-500`,t===`connecting`&&`bg-amber-400 animate-pulse`,(t===`disconnected`||t===`unauthorized`)&&`bg-red-500 animate-pulse`,!t&&`bg-muted-foreground/50`].filter(Boolean).join(` `)}),t===`connected`&&(e.userId?`Connected to ${r} as ${e.userId}`:"Connected to ${agentName}"),t===`connecting`&&`Connecting...`,t===`disconnected`&&`Unable to connect to agent`,t===`unauthorized`&&`Unauthorized to connect to agent`,!t&&`Not connected`]}),(0,I.jsx)(`input`,{className:`-ml-1.5 field-sizing-content rounded-md py-1 pr-10 pl-2 text-xs text-muted-foreground hover:bg-white hover:text-foreground hover:outline hover:outline-zinc-200 focus:bg-white focus:text-foreground focus:outline focus:outline-zinc-300`,value:e.urlDraft,onChange:t=>e.setUrlDraft(t.target.value),onKeyDown:t=>{t.key===`Enter`?(i.current=e.commitUrl(),t.currentTarget.blur()):t.key===`Escape`&&(e.setUrlDraft(e.agentUrl),t.currentTarget.blur())},onBlur:()=>{if(i.current){i.current=!1;return}e.setUrlDraft(e.agentUrl)}})]}):(0,I.jsxs)(`div`,{className:`flex items-center`,children:[(0,I.jsx)(`div`,{className:`mr-3 h-2 w-2 rounded-full bg-muted-foreground/50`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`mb-0 text-sm font-semibold text-muted-foreground`,children:`Not Connected`}),(0,I.jsx)(`input`,{className:`-ml-1.5 field-sizing-content rounded-md py-1 pr-10 pl-2 text-xs text-muted-foreground hover:bg-white hover:text-foreground hover:outline hover:outline-zinc-200 focus:bg-white focus:text-foreground focus:outline focus:outline-zinc-300`,placeholder:`http://localhost:8787/agents/my-agent`,value:e.urlDraft,onChange:t=>e.setUrlDraft(t.target.value),onKeyDown:t=>{t.key===`Enter`&&(e.commitUrl(),t.currentTarget.blur())}})]})]})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Agent type: `,n.charAt(0).toUpperCase()+n.slice(1)]}):null,(0,I.jsx)(iDe,{userId:e.userId,onUserIdChange:e.setUserId,token:e.token,onTokenChange:e.setToken,welcomeMessage:e.welcomeMessage,onWelcomeMessageChange:e.setWelcomeMessage}),(0,I.jsx)(rDe,{body:e.body,onChange:e.setBody})]})]})}function oDe(){let e=tDe(),[t,n]=(0,N.useState)(void 0),r=e.connection?.host??``,i=e.connection?qEe(e.connection.agent):``,a=!!(e.connection&&e.userId),{type:o}=Em({host:r,agentName:i,name:e.userId,authToken:e.token||void 0,enabled:a}),s={host:r,agentName:i,userId:e.userId,authToken:e.token||void 0,toolContext:e.toolContext,connectionParams:e.connectionParams,welcomeMessage:e.welcomeMessage||void 0,onAgentStatusChange:n,onAuthTokenChange:e.setToken};return(0,I.jsxs)(`div`,{className:`flex flex-col h-screen w-screen relative overflow-hidden`,children:[(0,I.jsx)(aDe,{config:e,connectionStatus:t,agentType:o,agentName:i}),(0,I.jsx)(`main`,{className:`flex-1 min-h-0`,children:a?o===`assistant`?(0,I.jsx)(dEe,{...s}):o===`chat`?(0,I.jsx)(hEe,{...s}):o===`agent`?(0,I.jsx)(fEe,{...s}):null:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Enter an agent URL and User ID to connect.`})})]})}(0,$e.createRoot)(document.getElementById(`app`)).render((0,I.jsx)(N.StrictMode,{children:(0,I.jsxs)(MS,{children:[(0,I.jsx)(REe,{}),(0,I.jsx)(oDe,{})]})}));export{Ke as _,Tue as a,LR as c,NR as d,wR as f,qg as g,ice as h,I0 as i,jR as l,MF as m,Zhe as n,wue as o,TR as p,N0 as r,gue as s,m1 as t,VR as u};
|