@openagt/dashboard 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/person.d.ts +22 -0
- package/dist/dashboard/person.d.ts.map +1 -0
- package/dist/dashboard/person.js +29 -0
- package/dist/dashboard/person.js.map +1 -0
- package/dist/dashboard/send-skills.d.ts +51 -0
- package/dist/dashboard/send-skills.d.ts.map +1 -0
- package/dist/dashboard/send-skills.js +122 -0
- package/dist/dashboard/send-skills.js.map +1 -0
- package/dist/dashboard-bundle/assets/astro-BZ97kZFP.js +1 -0
- package/dist/dashboard-bundle/assets/c-DWGmR78Y.js +1 -0
- package/dist/dashboard-bundle/assets/c-SSSlmE39.js +1 -0
- package/dist/dashboard-bundle/assets/core-Db3h5Pv3.js +12 -0
- package/dist/dashboard-bundle/assets/cpp-CJIxL8VH.js +1 -0
- package/dist/dashboard-bundle/assets/cpp-Cts1PyIS.js +1 -0
- package/dist/dashboard-bundle/assets/csharp-dmMxLVLW.js +1 -0
- package/dist/dashboard-bundle/assets/css-BGIxQoYs.js +1 -0
- package/dist/dashboard-bundle/assets/css-DUjzNfgv.js +1 -0
- package/dist/dashboard-bundle/assets/diff-woXpYk--.js +1 -0
- package/dist/dashboard-bundle/assets/docker-IyjqRm3v.js +1 -0
- package/dist/dashboard-bundle/assets/dotenv-CuH5my32.js +1 -0
- package/dist/dashboard-bundle/assets/engine-javascript-DbNy5Fxf.js +141 -0
- package/dist/dashboard-bundle/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/dashboard-bundle/assets/everforest-light-Df2xbC6M.js +1 -0
- package/dist/dashboard-bundle/assets/fish-BJitypiv.js +1 -0
- package/dist/dashboard-bundle/assets/go-rLFTqkRN.js +1 -0
- package/dist/dashboard-bundle/assets/graphql-DAzSVzvB.js +1 -0
- package/dist/dashboard-bundle/assets/graphql-DEIChqxY.js +1 -0
- package/dist/dashboard-bundle/assets/html-DSw1lh5G.js +1 -0
- package/dist/dashboard-bundle/assets/html-WQKKblVZ.js +1 -0
- package/dist/dashboard-bundle/assets/ini-B5eOa1yu.js +1 -0
- package/dist/dashboard-bundle/assets/java-BtIQNnN0.js +1 -0
- package/dist/dashboard-bundle/assets/java-DxlWrXwe.js +1 -0
- package/dist/dashboard-bundle/assets/javascript-BzbQS41l.js +1 -0
- package/dist/dashboard-bundle/assets/javascript-Yelw-5ZN.js +1 -0
- package/dist/dashboard-bundle/assets/json-B88Oqtu5.js +1 -0
- package/dist/dashboard-bundle/assets/json-CaljABEy.js +1 -0
- package/dist/dashboard-bundle/assets/json5-BR5RXkoi.js +1 -0
- package/dist/dashboard-bundle/assets/jsonc-CYpm1nAK.js +1 -0
- package/dist/dashboard-bundle/assets/jsx-D3KKoC5L.js +1 -0
- package/dist/dashboard-bundle/assets/jsx-hEbJ82HF.js +1 -0
- package/dist/dashboard-bundle/assets/kotlin-DhhofPvG.js +1 -0
- package/dist/dashboard-bundle/assets/less-DVTAwKKz.js +1 -0
- package/dist/dashboard-bundle/assets/lua-BJObVtAx.js +1 -0
- package/dist/dashboard-bundle/assets/lua-DjuecEsk.js +1 -0
- package/dist/dashboard-bundle/assets/main-BJq8FqaM.js +141 -0
- package/dist/dashboard-bundle/assets/main-NY2yoID8.css +2 -0
- package/dist/dashboard-bundle/assets/make-Dixweg8N.js +1 -0
- package/dist/dashboard-bundle/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/dashboard-bundle/assets/mdx-DQZ5AkYe.js +1 -0
- package/dist/dashboard-bundle/assets/module-BidWGbHQ.js +25 -0
- package/dist/dashboard-bundle/assets/php-D7kNSOJl.js +1 -0
- package/dist/dashboard-bundle/assets/postcss-D_Wz94rJ.js +1 -0
- package/dist/dashboard-bundle/assets/powershell-QtSnmXcu.js +1 -0
- package/dist/dashboard-bundle/assets/prisma-DMgNhnYS.js +1 -0
- package/dist/dashboard-bundle/assets/proto-DB4EqR-F.js +1 -0
- package/dist/dashboard-bundle/assets/python-gzcpVVnB.js +1 -0
- package/dist/dashboard-bundle/assets/ruby-DjBfgIB7.js +1 -0
- package/dist/dashboard-bundle/assets/rust-DpiIf5JO.js +1 -0
- package/dist/dashboard-bundle/assets/sass-DXrisJhu.js +1 -0
- package/dist/dashboard-bundle/assets/scss-8bKmll0B.js +1 -0
- package/dist/dashboard-bundle/assets/shellscript-BiGZg9Om.js +1 -0
- package/dist/dashboard-bundle/assets/shellscript-CqHdAlCp.js +1 -0
- package/dist/dashboard-bundle/assets/sql-BOsskAmu.js +1 -0
- package/dist/dashboard-bundle/assets/sql-CNu3Or2W.js +1 -0
- package/dist/dashboard-bundle/assets/svelte-CdeT-Ich.js +1 -0
- package/dist/dashboard-bundle/assets/swift-CyEgAFGc.js +1 -0
- package/dist/dashboard-bundle/assets/toml-CcmNWLt0.js +1 -0
- package/dist/dashboard-bundle/assets/tsx-5f3ulCja.js +1 -0
- package/dist/dashboard-bundle/assets/tsx-BOvsFOI6.js +1 -0
- package/dist/dashboard-bundle/assets/typescript-Utq2Cl8c.js +1 -0
- package/dist/dashboard-bundle/assets/typescript-j_1H8WHN.js +1 -0
- package/dist/dashboard-bundle/assets/vue-BqdMUtqy.js +1 -0
- package/dist/dashboard-bundle/assets/xml-CoDIzWF0.js +1 -0
- package/dist/dashboard-bundle/assets/xml-WY0zc4PG.js +1 -0
- package/dist/dashboard-bundle/assets/yaml-CxbubiML.js +1 -0
- package/dist/dashboard-bundle/assets/yaml-DijMHRDA.js +1 -0
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +3 -3
- package/dist/dashboard-rpc/index.d.ts +2 -1
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +4 -2
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/person.d.ts +5 -0
- package/dist/dashboard-rpc/person.d.ts.map +1 -0
- package/dist/dashboard-rpc/person.js +12 -0
- package/dist/dashboard-rpc/person.js.map +1 -0
- package/dist/dashboard-rpc/skills.d.ts +22 -19
- package/dist/dashboard-rpc/skills.d.ts.map +1 -1
- package/dist/dashboard-rpc/skills.js +38 -10
- package/dist/dashboard-rpc/skills.js.map +1 -1
- package/dist/module-types/dashboard/components/DriverModelMenu.d.ts +11 -1
- package/dist/module-types/dashboard/components/FileIcon.d.ts +2 -1
- package/dist/module-types/dashboard/components/file-icons.generated.d.ts +6 -0
- package/dist/module-types/dashboard/components/ui/row-item.d.ts +9 -0
- package/dist/module-types/dashboard/lib/effort.d.ts +1 -0
- package/dist/module-types/dashboard/lib/highlight.d.ts +16 -0
- package/dist/module-types/dashboard/lib/use-narrow.d.ts +6 -0
- package/dist/module-types/dashboard/module/index.d.ts +2 -0
- package/dist/module-types/src/dashboard/person.d.ts +21 -0
- package/dist/module-types/src/dashboard/send-skills.d.ts +50 -0
- package/dist/module-types/src/dashboard-rpc/index.d.ts +2 -1
- package/dist/module-types/src/dashboard-rpc/person.d.ts +4 -0
- package/dist/module-types/src/dashboard-rpc/skills.d.ts +22 -19
- package/dist/module-types/src/store/git-host.d.ts +11 -1
- package/dist/module.css +4 -4
- package/dist/store/git-host.d.ts +11 -1
- package/dist/store/git-host.d.ts.map +1 -1
- package/dist/store/git-host.js +14 -0
- package/dist/store/git-host.js.map +1 -1
- package/package.json +14 -12
- package/dist/dashboard-bundle/assets/main-D_Zblh1r.css +0 -2
- package/dist/dashboard-bundle/assets/main-DjPcbCa9.js +0 -141
- package/dist/dashboard-bundle/assets/module-D4-RTmfM.js +0 -24
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/typescript-Utq2Cl8c.js","assets/typescript-j_1H8WHN.js","assets/tsx-5f3ulCja.js","assets/tsx-BOvsFOI6.js","assets/javascript-Yelw-5ZN.js","assets/javascript-BzbQS41l.js","assets/jsx-hEbJ82HF.js","assets/jsx-D3KKoC5L.js","assets/json-CaljABEy.js","assets/json-B88Oqtu5.js","assets/html-WQKKblVZ.js","assets/html-DSw1lh5G.js","assets/css-BGIxQoYs.js","assets/vue-BqdMUtqy.js","assets/svelte-CdeT-Ich.js","assets/postcss-D_Wz94rJ.js","assets/astro-BZ97kZFP.js","assets/xml-CoDIzWF0.js","assets/xml-WY0zc4PG.js","assets/java-BtIQNnN0.js","assets/css-DUjzNfgv.js","assets/scss-8bKmll0B.js","assets/yaml-CxbubiML.js","assets/yaml-DijMHRDA.js","assets/shellscript-BiGZg9Om.js","assets/shellscript-CqHdAlCp.js","assets/ruby-DjBfgIB7.js","assets/c-SSSlmE39.js","assets/cpp-Cts1PyIS.js","assets/graphql-DEIChqxY.js","assets/lua-DjuecEsk.js","assets/sql-CNu3Or2W.js","assets/java-DxlWrXwe.js","assets/c-DWGmR78Y.js","assets/cpp-CJIxL8VH.js","assets/php-D7kNSOJl.js","assets/lua-BJObVtAx.js","assets/sql-BOsskAmu.js","assets/graphql-DAzSVzvB.js","assets/core-Db3h5Pv3.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-CZI7_Jkm.js";import{t as r}from"./react-dom-cJyBB_A4.js";import{t as i}from"./jsx-runtime-By8HlURe.js";var a=[`claude-code`,`codex`];function o(e){return e!==void 0&&a.includes(e)}var s={"claude-code":`Claude Code`,codex:`Codex`};function c(e){return e===`claude-web`||e===`github-actions`?`claude-code`:o(e)?e:void 0}var l=[`nothing`,`commit`,`branch`,`pr`,`merge`],u={nothing:`Off`,commit:`Commit`,branch:`Publish branch`,pr:`Open PR`,merge:`Merge on green`};function d(e,t=!0){return t?e?l:[`nothing`,`commit`,`branch`]:[`nothing`,`commit`]}function f(e){return e?`branch`:`commit`}function p(e,t,n=!0){return e===void 0?`commit`:d(t,n).includes(e)?e:f(n)}var m={humanIntervention:`notifyHumanIntervention`,newActivity:`notifyNewActivity`},h={browser:!0,categories:{humanIntervention:!0,newActivity:!1}};function g(e){return e.notifyBrowser??h.browser}function _(e,t){return e[m[t]]??h.categories[t]}var v=50;function y(e){try{let t=new URL(e.trim());if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let[n,r]=t.hash.slice(1).split(`.`);return!n||r&&t.protocol!==`https:`?null:{url:t.origin,door:t.origin+t.pathname,code:n,...r?{pin:r}:{}}}catch{return null}}var b=/^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;function x(e){return e===`localhost`||e===`::1`||e===`[::1]`||b.test(e)}function S(e){try{let t=new URL(e);return t.protocol===`http:`&&x(t.hostname)}catch{return!1}}var C=`/_rpc`;function w(e){return async(...t)=>{let n=t.length;for(;n>0&&t[n-1]===void 0;)n--;let r=await fetch(`${C}/${e}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.slice(0,n))}),i=await r.text(),a;try{a=i?JSON.parse(i):{}}catch{throw Error(`${e} got a non-JSON reply (${r.status})`)}if(!r.ok)throw Error(a.error??`${e} failed (${r.status})`);return a.ret}}async function T(e,t){let n=new URLSearchParams({projectId:e,...t?{agentId:t}:{}}),r=new AbortController,i=await fetch(`${C}/events?${n.toString()}`,{signal:r.signal});if(!i.ok||!i.body)throw Error(`could not subscribe to events (${i.status})`);let a,o,s=!1,c=e=>{s||(s=!0,o?.(e))};return(async()=>{let e=i.body.getReader(),t=new TextDecoder,n=``;try{for(;;){let{done:r,value:i}=await e.read();if(r)break;n+=t.decode(i,{stream:!0});let o=n.indexOf(`
|
|
3
|
+
|
|
4
|
+
`);for(;o>=0;o=n.indexOf(`
|
|
5
|
+
|
|
6
|
+
`)){let e=n.slice(0,o);n=n.slice(o+2);let t=e.split(`
|
|
7
|
+
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t)try{a?.(JSON.parse(t))}catch{}}}c()}catch(e){c(r.signal.aborted?void 0:e instanceof Error?e:Error(String(e)))}})(),{listen:e=>{a=e},onClose:e=>{o=e,s&&e()},close:()=>{s||r.abort(),c()}}}var E=`settings`;function D(e){return/^[a-z][a-z0-9]*$/.test(e)}var O=`project`;function k(e){let[t=``,n=``]=e.split(`?`),r=new URLSearchParams(n).get(O),i=r?{scope:r}:{},a=t.split(`/`).filter(Boolean).map(P),[o,s]=a;return o===E?{view:`settings`,projectId:null,agentId:null,...i}:o?D(o)?{projectId:null,agentId:null,page:o,pagePath:a.slice(1),...i}:{projectId:o,agentId:s??null,...r?{scope:o}:{}}:{projectId:null,agentId:null,...i}}function A(e){let t=!e.view&&!e.page?e.projectId:null,n=e.scope?t??e.scope:null;return M(e)+(n?`?${O}=${encodeURIComponent(n)}`:``)}function j(e,t){let[n=``,r=``]=e.split(`?`),i=new URLSearchParams(t);i.delete(O);for(let[e,t]of new URLSearchParams(r))i.set(e,t);let a=i.toString();return a?`${n}?${a}`:n}function M({view:e,projectId:t,agentId:n,page:r,pagePath:i}){if(e===`settings`)return`/${E}`;if(r)return[``,r,...i??[]].map(encodeURIComponent).join(`/`);if(!t)return`/`;let a=encodeURIComponent(t);return n?`/${a}/${encodeURIComponent(n)}`:`/${a}`}function N(e,t=typeof window>`u`?``:window.location.search){let n=new URLSearchParams(t).get(O);return A({projectId:null,agentId:null,page:e,...n?{scope:n}:{}})}function P(e){try{return decodeURIComponent(e)}catch{return e}}function F(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=F(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function I(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=F(e))&&(r&&(r+=` `),r+=t);return r}var L=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,R=I,z=(e,t)=>n=>{if(t?.variants==null)return R(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=L(t)||L(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 R(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)},B=`-`,V=e=>{let t=W(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(B);return n[0]===``&&n.length!==1&&n.shift(),ee(n,t)||U(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},ee=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?ee(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(B);return t.validators.find(({validator:e})=>e(a))?.classGroupId},H=/^\[(.+)\]$/,U=e=>{if(H.test(e)){let t=H.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},W=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ie(Object.entries(e.classGroups),n).forEach(([e,n])=>{te(n,r,e,t)}),r},te=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:ne(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(re(e)){te(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{te(i,ne(t,e),n,r)})})},ne=(e,t)=>{let n=e;return t.split(B).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},re=e=>e.isThemeGetter,ie=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,ae=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},oe=`!`,se=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(oe);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},ce=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},le=e=>({cache:ae(e.cacheSize),parseClassName:se(e),...V(e)}),ue=/\s+/,de=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(ue),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=ce(c).join(`:`),h=l?m+oe:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function fe(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=pe(t))&&(r&&(r+=` `),r+=n);return r}var pe=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=pe(e[r]))&&(n&&(n+=` `),n+=t);return n};function me(e,...t){let n,r,i,a=o;function o(o){return n=le(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=de(e,n);return i(e,a),a}return function(){return a(fe.apply(null,arguments))}}var G=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},he=/^\[(?:([a-z-]+):)?(.+)\]$/i,ge=/^\d+\/\d+$/,_e=new Set([`px`,`full`,`screen`]),ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ye=/\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$/,be=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Se=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ce=e=>Te(e)||_e.has(e)||ge.test(e),we=e=>Re(e,`length`,ze),Te=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>Re(e,`number`,Te),De=e=>!!e&&Number.isInteger(Number(e)),Oe=e=>e.endsWith(`%`)&&Te(e.slice(0,-1)),ke=e=>he.test(e),Ae=e=>ve.test(e),je=new Set([`length`,`size`,`percentage`]),Me=e=>Re(e,je,Be),Ne=e=>Re(e,`position`,Be),Pe=new Set([`image`,`url`]),Fe=e=>Re(e,Pe,He),Ie=e=>Re(e,``,Ve),Le=()=>!0,Re=(e,t,n)=>{let r=he.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},ze=e=>ye.test(e)&&!be.test(e),Be=()=>!1,Ve=e=>xe.test(e),He=e=>Se.test(e),Ue=me(()=>{let e=G(`colors`),t=G(`spacing`),n=G(`blur`),r=G(`brightness`),i=G(`borderColor`),a=G(`borderRadius`),o=G(`borderSpacing`),s=G(`borderWidth`),c=G(`contrast`),l=G(`grayscale`),u=G(`hueRotate`),d=G(`invert`),f=G(`gap`),p=G(`gradientColorStops`),m=G(`gradientColorStopPositions`),h=G(`inset`),g=G(`margin`),_=G(`opacity`),v=G(`padding`),y=G(`saturate`),b=G(`scale`),x=G(`sepia`),S=G(`skew`),C=G(`space`),w=G(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,ke,t],O=()=>[ke,t],k=()=>[``,Ce,we],A=()=>[`auto`,Te,ke],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,ke],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[Te,ke];return{cacheSize:500,separator:`:`,theme:{colors:[Le],spacing:[Ce,we],blur:[`none`,``,Ae,ke],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,Ae,ke],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Oe,we],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,ke]}],container:[`container`],columns:[{columns:[Ae]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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`],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:[...j(),ke]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,De,ke]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,ke]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,De,ke]}],"grid-cols":[{"grid-cols":[Le]}],"col-start-end":[{col:[`auto`,{span:[`full`,De,ke]},ke]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Le]}],"row-start-end":[{row:[`auto`,{span:[De,ke]},ke]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,ke]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,ke]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,ke,t]}],"min-w":[{"min-w":[ke,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[ke,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[Ae]},Ae]}],h:[{h:[ke,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[ke,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[ke,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[ke,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,Ae,we]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Ee]}],"font-family":[{font:[Le]}],"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:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,ke]}],"line-clamp":[{"line-clamp":[`none`,Te,Ee]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Ce,ke]}],"list-image":[{"list-image":[`none`,ke]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,ke]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Ce,we]}],"underline-offset":[{"underline-offset":[`auto`,Ce,ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,ke]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,ke]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),Ne]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,Me]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Fe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Ce,ke]}],"outline-w":[{outline:[Ce,we]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Ce,we]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,Ae,Ie]}],"shadow-color":[{shadow:[Le]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,Ae,ke]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,ke]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,ke]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,ke]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[De,ke]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,ke]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],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`,ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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`,ke]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Ce,we,Ee]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function K(...e){return Ue(I(e))}var q=e(i(),1),We=z(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-[var(--color-primary)] text-[var(--color-primary-foreground)] hover:opacity-90`,outline:`border border-[var(--color-border)] bg-transparent hover:bg-[var(--color-accent)] hover:text-[var(--color-accent-foreground)]`,ghost:`hover:bg-[var(--color-accent)] hover:text-[var(--color-accent-foreground)]`,destructive:`bg-[var(--color-danger)] text-[var(--color-background)] hover:opacity-90`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3`,xs:`h-7 gap-1 px-2 text-xs`,icon:`h-9 w-9`,"icon-sm":`h-7 w-7`}},defaultVariants:{variant:`default`,size:`default`}});function Ge({className:e,variant:t,size:n,...r}){return(0,q.jsx)(`button`,{className:K(We({variant:t,size:n}),e),...r})}var Ke=w(`onMachines`),qe=w(`sendAddMachine`),Je=w(`sendRemoveMachine`),Ye=w(`onMachinesReachable`),Xe=w(`onMachineVersions`),Ze=w(`sendProjectToMachine`),Qe=w(`onProjectOnMachine`),J=e(n(),1),$e=null,et=new Set;function tt(e){if($e!==e){$e=e;for(let e of et)e()}}function nt(){return $e}function rt(e){return et.add(e),()=>et.delete(e)}function it(){return(0,J.useSyncExternalStore)(rt,nt,()=>null)}var at=[],ot=null,st=0,ct=0,lt=!1,ut=new Set;function dt(e){return ut.add(e),()=>ut.delete(e)}function ft(){let e=++st;return ct++,Ke().then(t=>{if(e===st){ot=t;for(let e of ut)e()}},()=>{}).finally(()=>ct--)}function pt(){ot===null&&ct===0&&ft(),!(lt||typeof window>`u`)&&(lt=!0,window.addEventListener(`focus`,()=>void ft()))}async function mt(e,t){let n=await qe(e,t);return n.ok&&await ft(),n}async function ht(e){let t=await Je(e).catch(()=>({ok:!1,error:`The machine could not be removed.`}));return t.ok&&nt()===e&&tt(null),await ft(),t}function gt(){let e=(0,J.useSyncExternalStore)(dt,()=>ot??at,()=>at);return(0,J.useEffect)(pt,[]),e}var _t=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yt={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`},bt=(0,J.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,J.createElement)(`svg`,{ref:c,...yt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vt(`lucide`,i),...s},[...o.map(([e,t])=>(0,J.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xt=(e,t)=>{let n=(0,J.forwardRef)(({className:n,...r},i)=>(0,J.createElement)(bt,{ref:i,iconNode:t,className:vt(`lucide-${_t(e)}`,n),...r}));return n.displayName=`${e}`,n},St=xt(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ct=xt(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wt=xt(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Tt=xt(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Et=xt(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Dt=xt(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ot=xt(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function kt(e){if(!e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function At(e,t=`—`){let n=kt(e);return n?n.toLocaleString():t}function jt(e,t=`—`){let n=kt(e);return n?n.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):t}function Mt(e,t=`—`){let n=kt(e);if(!n)return t;let r=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:o<365?`${Math.floor(o/7)}w ago`:`${Math.floor(o/365)}y ago`}function Nt(e,t=`—`){let n=kt(e);if(!n)return t;let r=Math.round((Date.now()-n.getTime())/1e3);if(r<60)return`just now`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);if(a<24)return`${a}h ago`;let o=Math.round(a/24);return o<=7?`${o}d ago`:n.toLocaleDateString()}function Pt(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function Ft(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function It(e,t){return`${e} ${t}${e===1?``:`s`}`}function Lt(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return It(t,`second`);let n=Math.floor(t/60);if(n<60)return It(n,`minute`);let r=Math.floor(n/60);return r<24?It(r,`hour`):It(Math.floor(r/24),`day`)}function Rt(e){return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}).toLowerCase().replace(/\s+/g,``)}function zt(e){let t=new Date(e);return`${t.toLocaleDateString(void 0,{weekday:`long`})} ${Rt(t)}`}function Bt(e){let t=new Date(e),n=t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),r=Intl.DateTimeFormat().resolvedOptions().timeZone;return`Quota resets on ${n}, ${Rt(t)} (${r})`}function Vt(){let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(null);return{busy:e,error:n,reset:(0,J.useCallback)(()=>r(null),[]),run:(0,J.useCallback)(async(e,n=`Something went wrong.`)=>{t(!0),r(null);try{let t=await e();return Ht(t)?(r(t.error??n),{ok:!1}):{ok:!0,value:t}}catch(e){return r(e instanceof Error?e.message:n),{ok:!1}}finally{t(!1)}},[])}}function Ht(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1}function Ut({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:K(`flex h-9 w-full min-w-0 rounded-md border border-border bg-transparent px-3 py-1 text-sm shadow-sm outline-none transition-colors`,`placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function Wt({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(t);return[i?e:a,J.useCallback(e=>{i||o(e)},[])]}var Gt={};function Kt(e,t){let n=J.useRef(Gt);return n.current===Gt&&(n.current=e(t)),n}function qt(e,t,n,r){let i=Kt(Yt).current;return Xt(i,e,t,n,r)&&Qt(i,[e,t,n,r]),i.callback}function Jt(e){let t=Kt(Yt).current;return Zt(t,e)&&Qt(t,e),t.callback}function Yt(){return{callback:null,cleanup:null,refs:[]}}function Xt(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Zt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Qt(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 $t=J[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],en=$t&&$t!==J.useLayoutEffect?$t:e=>e();function Y(e){let t=Kt(tn).current;return t.next=e,en(t.effect),t.trampoline}function tn(){let e={next:void 0,callback:nn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function nn(){}var rn={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function an(){}var on=Object.freeze([]),sn=Object.freeze({}),cn={...J},ln=0;function un(e,t=`mui`){let[n,r]=J.useState(e),i=e||n;return J.useEffect(()=>{n??(ln+=1,r(`${t}-${ln}`))},[n,t]),i}var dn=cn.useId;function fn(e,t){if(dn!==void 0){let n=dn();return e??(t?`${t}-${n}`:n)}return un(e,t)}function pn(e){return fn(e,`base-ui`)}function mn(){return typeof window<`u`}function hn(e){return vn(e)?(e.nodeName||``).toLowerCase():`#document`}function gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _n(e){return((vn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function vn(e){return mn()?e instanceof Node||e instanceof gn(e).Node:!1}function yn(e){return mn()?e instanceof Element||e instanceof gn(e).Element:!1}function bn(e){return mn()?e instanceof HTMLElement||e instanceof gn(e).HTMLElement:!1}function xn(e){return!mn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof gn(e).ShadowRoot}function Sn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Nn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cn(e){return/^(table|td|th)$/.test(hn(e))}function wn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Tn=/transform|translate|scale|rotate|perspective|filter/,En=/paint|layout|strict|content/,Dn=e=>!!e&&e!==`none`,On;function kn(e){let t=yn(e)?Nn(e):e;return Dn(t.transform)||Dn(t.translate)||Dn(t.scale)||Dn(t.rotate)||Dn(t.perspective)||!jn()&&(Dn(t.backdropFilter)||Dn(t.filter))||Tn.test(t.willChange||``)||En.test(t.contain||``)}function An(e){let t=Fn(e);for(;bn(t)&&!Mn(t);){if(kn(t))return t;if(wn(t))return null;t=Fn(t)}return null}function jn(){return On??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),On}function Mn(e){return/^(html|body|#document)$/.test(hn(e))}function Nn(e){return gn(e).getComputedStyle(e)}function Pn(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fn(e){if(hn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xn(e)&&e.host||_n(e);return xn(t)?t.host:t}function In(e){let t=Fn(e);return Mn(t)?(e.ownerDocument||e).body:bn(t)&&Sn(t)?t:In(t)}function Ln(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=In(e),i=r===e.ownerDocument?.body,a=gn(r);if(i){let e=Rn(a);return t.concat(a,a.visualViewport||[],Sn(r)?r:[],e&&n?Ln(e):[])}else return t.concat(r,Ln(r,[],n))}function Rn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var zn=typeof navigator<`u`,Bn=Yn(),Vn=Zn(),Hn=Xn(),Un=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Wn=Bn.platform===`MacIntel`&&Bn.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Bn.platform);zn&&/firefox/i.test(Hn);var Gn=zn&&/apple/i.test(navigator.vendor);zn&&/Edg/i.test(Hn);var Kn=zn&&/android/i.test(Vn)||/android/i.test(Hn),qn=zn&&Vn.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,Jn=Hn.includes(`jsdom/`);function Yn(){if(!zn)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 Xn(){if(!zn)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Zn(){if(!zn)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var Qn=`data-base-ui-focusable`,$n=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,er=`ArrowLeft`,tr=`ArrowRight`,nr=`ArrowUp`,rr=`ArrowDown`;function ir(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ar(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&xn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function or(e){return`composedPath`in e?e.composedPath()[0]:e.target}function sr(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 cr(e){return e.matches(`html,body`)}function lr(e){return e?.ownerDocument||document}function ur(e){return bn(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function dr(e){return e?e.getAttribute(`role`)===`combobox`&&ur(e):!1}function fr(e){if(!e||Jn)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function pr(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var mr=e(r());function hr(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...hr(e,t.id,n)])}function gr(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 _r(e){e.preventDefault(),e.stopPropagation()}function vr(e){return`nativeEvent`in e}function yr(e){return e.mozInputSource===0&&e.isTrusted?!0:Kn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function br(e){return Jn?!1:!Kn&&e.width===0&&e.height===0||Kn&&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 xr(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Sr(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Cr(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var wr=[`top`,`right`,`bottom`,`left`],Tr=Math.min,Er=Math.max,Dr=Math.round,Or=Math.floor,kr=e=>({x:e,y:e}),Ar={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function jr(e,t,n){return Er(e,Tr(t,n))}function Mr(e,t){return typeof e==`function`?e(t):e}function Nr(e){return e.split(`-`)[0]}function Pr(e){return e.split(`-`)[1]}function Fr(e){return e===`x`?`y`:`x`}function Ir(e){return e===`y`?`height`:`width`}function Lr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Rr(e){return Fr(Lr(e))}function zr(e,t,n){n===void 0&&(n=!1);let r=Pr(e),i=Rr(e),a=Ir(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Jr(o)),[o,Jr(o)]}function Br(e){let t=Jr(e);return[Vr(e),t,Vr(t)]}function Vr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Hr=[`left`,`right`],Ur=[`right`,`left`],Wr=[`top`,`bottom`],Gr=[`bottom`,`top`];function Kr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ur:Hr:t?Hr:Ur;case`left`:case`right`:return t?Wr:Gr;default:return[]}}function qr(e,t,n,r){let i=Pr(e),a=Kr(Nr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Vr)))),a}function Jr(e){let t=Nr(e);return Ar[t]+e.slice(t.length)}function Yr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Xr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Yr(e)}function Zr(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 Qr(e,t,n){return Math.floor(e/t)!==n}function $r(e,t){return t<0||t>=e.current.length}function ei(e,t){return ni(e,{disabledIndices:t})}function ti(e,t){return ni(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ni(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&si(e,a,r));return a}function ri(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!si(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===`ArrowUp`){let n=g(`up`);if(n!==void 0)u&&_r(t),d=n;else{if(u&&_r(t),l===-1)d=c;else if(d=ni(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}$r(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&_r(t),l===-1?d=s:(d=ni(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=ni(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),$r(e,d)&&(d=l)):(u&&_r(t),d=n)}if(n===`both`){let n=Or(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&_r(t),l%a===a-1?r&&(d=ni(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=ni(e,{startingIndex:l,disabledIndices:o}),r&&Qr(d,a,n)&&(d=ni(e,{startingIndex:l-l%a-1,disabledIndices:o}))),Qr(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&_r(t),l%a===0?r&&(d=ni(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=ni(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&Qr(d,a,n)&&(d=ni(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),Qr(d,a,n)&&(d=l));let s=Or(c/a)===n;$r(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:ni(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function ii(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function ai(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function oi(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function si(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var ci=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),li=typeof Element>`u`,ui=li?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,di=!li&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},fi=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):fi(e.parentNode))},pi=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},mi=function(e,t,n){if(fi(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ci));return t&&ui.call(e,ci)&&r.unshift(e),r=r.filter(n),r},hi=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!fi(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=hi(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{ui.call(a,ci)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!fi(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=hi(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},gi=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},_i=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||pi(e))&&!gi(e)?0:e.tabIndex},vi=function(e,t){var n=_i(e);return n<0&&t&&!gi(e)?0:n},yi=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},bi=function(e){return e.tagName===`INPUT`},xi=function(e){return bi(e)&&e.type===`hidden`},Si=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ci=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},wi=function(e){if(!e.name)return!0;var t=e.form||di(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ci(r,e.form);return!i||i===e},Ti=function(e){return bi(e)&&e.type===`radio`},Ei=function(e){return Ti(e)&&!wi(e)},Di=function(e){var t=e&&di(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=di(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Oi=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},ki=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=ui.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(ui.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=di(e);if(s&&!s.shadowRoot&&r(s)===!0)return Oi(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(Di(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Oi(e);return!1},Ai=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return ui.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ji=function(e,t){return!(t.disabled||xi(t)||ki(t,e)||Si(t)||Ai(t))},Mi=function(e,t){return!(Ei(t)||_i(t)<0||!ji(e,t))},Ni=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Pi=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=vi(a,i),s=i?Pi(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(yi).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Fi=function(e,t){return t||={},Pi(t.getShadowRoot?hi([e],t.includeContainer,{filter:Mi.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ni}):mi(e,t.includeContainer,Mi.bind(null,t)))},Ii=function(e,t){return t||={},t.getShadowRoot?hi([e],t.includeContainer,{filter:ji.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):mi(e,t.includeContainer,ji.bind(null,t))},Li=function(e,t){if(t||={},!e)throw Error(`No node provided`);return ui.call(e,ci)!==!1&&Mi(t,e)},Ri=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function zi(e,t){let n=Fi(e,Ri()),r=n.length;if(r===0)return;let i=ir(lr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Bi(e){return zi(lr(e).body,1)||e}function Vi(e){return zi(lr(e).body,-1)||e}function Hi(e,t){if(!e)return null;let n=Fi(lr(e).body,Ri()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Ui(e){return Hi(e,1)}function Wi(e){return Hi(e,-1)}function Gi(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!ar(n,r)}function Ki(e){Fi(e,Ri()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function qi(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Ji=`ArrowUp`,Yi=`ArrowDown`,Xi=`ArrowLeft`,Zi=`ArrowRight`,Qi=`Home`,$i=new Set([Xi,Zi]),ea=new Set([Xi,Zi,Qi,`End`]),ta=new Set([Ji,Yi]),na=new Set([Ji,Yi,Qi,`End`]),ra=new Set([...$i,...ta]),ia=new Set([...ra,Qi,`End`]),aa=new Set([Ji,Yi,Xi,Zi,Qi,`End`]),oa=`Shift`,sa=new Set([oa,`Control`,`Alt`,`Meta`]);function ca(e){return bn(e)&&e.tagName===`INPUT`}function la(e){return!!(ca(e)&&e.selectionStart!=null||bn(e)&&e.tagName===`TEXTAREA`)}function ua(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=da(e,t,`left`),a=fa(e),o=fa(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=da(e,t,`top`),r=fa(e),i=fa(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function da(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function fa(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var X=typeof document<`u`?J.useLayoutEffect:()=>{},pa=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ma(){return J.useContext(pa)}function ha(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),o=J.useRef(0),s=Kt(_a).current,c=Kt(ga).current,[l,u]=J.useState(0),d=J.useRef(l),f=Y((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=Y(e=>{c.delete(e),d.current+=1,u(d.current)}),m=J.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(va).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);X(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),X(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),X(()=>()=>{n.current=[]},[n]),X(()=>()=>{r&&(r.current=[])},[r]);let h=Y(e=>(s.add(e),()=>{s.delete(e)}));X(()=>{s.forEach(e=>e(m))},[s,m]);let g=J.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,q.jsx)(pa.Provider,{value:g,children:t})}function ga(){return new Map}function _a(){return new Set}function va(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ya(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var ba=`data-composite-item-active`,xa=[];function Sa(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d=!1,disabledIndices:f,modifierKeys:p=xa}=e,[m,h]=J.useState(0),g=n>1,_=J.useRef(null),v=qt(_,l),y=J.useRef([]),b=J.useRef(!1),x=s??m,S=Y((e,t=!1)=>{if((c??h)(e),t){let t=y.current[e];ua(_.current,t,o,a)}}),C=Y(e=>{if(e.size===0||b.current)return;b.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&S(r),ua(_.current,n,o,a)}),w=J.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:v,onFocus(e){!_.current||!la(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let s=u?ia:ra;if(!s.has(e.key)||Ca(e,p)||!_.current)return;let c=o===`rtl`,l=c?Xi:Zi,m={horizontal:l,vertical:Yi,both:l}[a],h=c?Zi:Xi,v={horizontal:h,vertical:Ji,both:h}[a];if(la(e.target)&&!ya(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==m&&t>0)return}let b=x,C=ei(y,f),w=ti(y,f);if(g){let o=t||Array.from({length:y.current.length},()=>({width:1,height:1})),s=ii(o,n,i),l=s.findIndex(e=>e!=null&&!si(y,e,f)),u=s.reduce((e,t,n)=>t!=null&&!si(y,t,f)?n:e,-1);b=s[ri({current:s.map(e=>e?y.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:oi([...f||y.current.map((e,t)=>si(y,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:ai(x>w?C:x,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Yi],both:[l,Yi]}[a],E={horizontal:[h],vertical:[Ji],both:[h,Ji]}[a],D=g?s:{horizontal:u?ea:$i,vertical:u?na:ta,both:s}[a];u&&(e.key===`Home`?b=C:e.key===`End`&&(b=w)),b===x&&(T.includes(e.key)||E.includes(e.key))&&(b=r&&b===w&&T.includes(e.key)?C:r&&b===C&&E.includes(e.key)?w:ni(y,{startingIndex:b,decrement:E.includes(e.key),disabledIndices:f})),b!==x&&!$r(y,b)&&(d&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))}}),[n,i,o,f,y,u,x,g,t,r,v,p,S,a,d]);return J.useMemo(()=>({props:w,highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:y,disabledIndices:f,onMapChange:C,relayKeyboardEvent:w.onKeyDown}),[w,x,S,y,f,C])}function Ca(e,t){for(let n of sa.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var wa=J.createContext(void 0);function Ta(e=!1){let t=J.useContext(wa);if(t===void 0&&!e)throw Error(Cr(16));return t}var Ea=19;function Da(e){return Ea>=e}function Oa(e){if(!J.isValidElement(e))return null;let t=e,n=t.props;return(Da(19)?n?.ref:t.ref)??null}function ka(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Aa(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 ja(e,t){return typeof e==`function`?e(t):e}function Ma(e,t){return typeof e==`function`?e(t):e}var Na={};function Pa(e,t,n,r,i){let a={...Ba(e,Na)};return t&&(a=Ia(a,t)),n&&(a=Ia(a,n)),r&&(a=Ia(a,r)),i&&(a=Ia(a,i)),a}function Fa(e){if(e.length===0)return Na;if(e.length===1)return Ba(e[0],Na);let t={...Ba(e[0],Na)};for(let n=1;n<e.length;n+=1)t=Ia(t,e[n]);return t}function Ia(e,t){return za(t)?t(e):La(e,t)}function La(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ka(e.style,r);break;case`className`:e[n]=Ua(e.className,r);break;default:Ra(n,r)?e[n]=Va(e[n],r):e[n]=r}}return e}function Ra(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 za(e){return typeof e==`function`}function Ba(e,t){return za(e)?e(t):e??Na}function Va(e,t){return t?e?n=>{if(Wa(n)){let r=n;Ha(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function Ha(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ua(e,t){return t?e?t+` `+e:t:e}function Wa(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var Ga={style:{transition:`none`}},Ka=`data-base-ui-click-trigger`,qa={fallbackAxisSide:`none`},Ja={fallbackAxisSide:`end`},Ya={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Z(e,t,n={}){let r=t.render,i=Xa(t,n);return n.enabled===!1?null:Za(e,r,i,n.state??sn)}function Xa(e,t={}){let{className:n,style:r,render:i}=e,{state:a=sn,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ja(n,a):void 0,d=l?Ma(r,a):void 0,f=l?Aa(a,c):sn,p=l?ka(f,Array.isArray(s)?Fa(s):s)??sn:sn;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Jt([p.ref,Oa(i),...o]):p.ref=qt(p.ref,Oa(i),o):qt(null,null)),l?(u!==void 0&&(p.className=Ua(p.className,u)),d!==void 0&&(p.style=ka(p.style,d)),p):sn}function Za(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Pa(n,t.props);return e.ref=n.ref,J.cloneElement(t,e)}if(e&&typeof e==`string`)return Qa(e,n);throw Error(Cr(8))}function Qa(e,t){return e===`button`?(0,J.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,J.createElement)(`img`,{alt:``,...t,key:t.key}):J.createElement(e,t)}var $a=J.createContext(void 0);function eo(){return J.useContext($a)?.direction??`ltr`}function to(e){let{render:t,className:n,refs:r=on,props:i=on,state:a=sn,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:c,orientation:l,dense:u,itemSizes:d,loopFocus:f,cols:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=Sa({itemSizes:d,cols:p,loopFocus:f,dense:u,orientation:l,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:eo(),disabledIndices:v,modifierKeys:y}),k=Z(x,e,{state:a,ref:r,props:[C,...i,S],stateAttributesMapping:o}),A=J.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,q.jsx)(wa.Provider,{value:A,children:(0,q.jsx)(ha,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}function no(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var ro=J.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:an,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function io(){return J.useContext(ro)}var ao=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),oo={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},so={valid(e){return e===null?null:e?{[ao.valid]:``}:{[ao.invalid]:``}}},co=J.createContext({invalid:void 0,name:void 0,validityData:{state:oo,errors:[],error:``,value:``,initialValue:null},setValidityData:an,disabled:void 0,touched:!1,setTouched:an,dirty:!1,setDirty:an,filled:!1,setFilled:an,focused:!1,setFocused:an,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=sn)=>e,getInputValidationProps:(e=sn)=>e,inputRef:{current:null},commit:async()=>{}}});function lo(e=!0){let t=J.useContext(co);if(t.setValidityData===an&&!e)throw Error(Cr(28));return t}function uo(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=io(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=lo(),f=Y(e.getValue);X(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),X(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:no(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,mr.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),X(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var fo=J.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function po(e=!1){let t=J.useContext(fo);if(!t&&!e)throw Error(Cr(86));return t}var mo=J.createContext({controlId:void 0,setControlId:an,labelId:void 0,setLabelId:an,messageIds:[],setMessageIds:an,getDescriptionProps:e=>e});function ho(){return J.useContext(mo)}function go(e,t){let n=J.useRef(e),r=Y(t);X(()=>{n.current!==e&&r(n.current)},[e,r]),X(()=>{n.current=e},[e])}var _o=J.createContext({disabled:void 0,readOnly:void 0,required:void 0,name:void 0,checkedValue:``,setCheckedValue:an,onValueChange:an,touched:!1,setTouched:an,registerControlRef:an});function vo(){return J.useContext(_o)}var yo=[oa],bo=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,name:u,inputRef:d,id:f,...p}=e,{setTouched:m,setFocused:h,shouldValidateOnChange:g,validationMode:_,name:v,disabled:y,state:b,validation:x,setDirty:S,setFilled:C,validityData:w}=lo(),{labelId:T}=ho(),{clearErrors:E}=io(),D=po(!0),O=y||i,k=v??u,A=pn(f),[j,M]=Wt({controlled:c,default:l,name:`RadioGroup`,state:`value`}),N=Y(s),P=Y((e,t)=>{N(e,t),!t.isCanceled&&M(e)}),F=J.useRef(null),I=Y(e=>{F.current==null&&e!=null&&(F.current=e)});uo({id:A,commit:x.commit,value:j,controlRef:F,name:k,getValue:()=>j??null}),go(j,()=>{E(k),S(j!==w.initialValue),C(j!=null),g()?x.commit(j):x.commit(j,!0)});let[L,R]=J.useState(!1),z=Y(e=>{ar(e.currentTarget,e.relatedTarget)||(m(!0),h(!1),_===`onBlur`&&x.commit(j))}),B=Y(e=>{e.key.startsWith(`Arrow`)&&(m(!0),R(!0),h(!0))}),V=J.useMemo(()=>j==null?``:typeof j==`string`?j:JSON.stringify(j),[j]),ee=Pa({value:V,ref:qt(x.inputRef,d),id:A,name:V?k:void 0,disabled:O,readOnly:a,required:o,"aria-labelledby":p[`aria-labelledby`]??D?.legendId,"aria-hidden":!0,tabIndex:-1,style:rn,onChange:an,onFocus(){F.current?.focus()}},x.getInputValidationProps),H=J.useMemo(()=>({...b,disabled:O??!1,required:o??!1,readOnly:a??!1}),[b,O,a,o]),U=J.useMemo(()=>({...b,checkedValue:j,disabled:O,validation:x,name:k,onValueChange:N,readOnly:a,registerControlRef:I,required:o,setCheckedValue:P,setTouched:R,touched:L}),[j,O,x,b,k,N,a,I,o,P,R,L]),W={role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":O||void 0,"aria-readonly":a||void 0,"aria-labelledby":T,onFocus(){h(!0)},onBlur:z,onKeyDownCapture:B};return(0,q.jsxs)(_o.Provider,{value:U,children:[(0,q.jsx)(to,{render:n,className:r,state:H,props:[W,x.getValidationProps,p],refs:[t],stateAttributesMapping:so,enableHomeAndEndKeys:!1,modifierKeys:yo}),(0,q.jsx)(`input`,{...ee})]})}),xo=`none`,So=`trigger-press`,Co=`trigger-hover`,wo=`trigger-focus`,To=`outside-press`,Eo=`item-press`,Do=`close-press`,Oo=`track-press`,ko=`input-change`,Ao=`focus-out`,jo=`escape-key`,Mo=`list-navigation`,No=`keyboard`,Po=`drag`,Fo=`cancel-open`,Io=`sibling-open`,Lo=`disabled`,Ro=`imperative-action`,zo=`window-resize`;function Q(e,t,n,r){let i=!1,a=!1,o=r??sn;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}}function Bo(e,t,n){let r=n??sn;return{reason:e,event:t??new Event(`base-ui`),...r}}var Vo=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Ho={[Vo.startingStyle]:``},Uo={[Vo.endingStyle]:``},Wo={transitionStatus(e){return e===`starting`?Ho:e===`ending`?Uo:null}},Go=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Ko={checked(e){return e?{[Go.checked]:``}:{[Go.unchecked]:``}},...Wo,...so};function qo(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:J.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 Jo(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=J.useRef(null),o=Ta(!0)!==void 0,s=Y(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=qo({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=J.useCallback(()=>{let e=a.current;Yo(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return X(l,[l]),{getButtonProps:J.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Pa({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ha(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Ha(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:Y(e=>{a.current=e,l()})}}function Yo(e){return bn(e)&&e.tagName===`BUTTON`}var Xo=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Zo(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=ma(),f=J.useRef(-1),[p,m]=J.useState(a??(i===Xo.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=J.useRef(null),g=J.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return X(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),X(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),J.useMemo(()=>({ref:g,index:p}),[p,g])}function Qo(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ta(),{ref:i,index:a}=Zo(e),o=n===a,s=J.useRef(null),c=qt(i,s);return{compositeProps:J.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function $o(e){let{render:t,className:n,state:r=sn,props:i=on,refs:a=on,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=Qo({metadata:o});return Z(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}var es=J.createContext({disabled:!1});function ts(){return J.useContext(es)}function ns(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=ho(),o=pn(t);return X(()=>{if(!(!n&&!t||a===an)){if(n){let e=r?.current;yn(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var rs=J.createContext(void 0);function is(){let e=J.useContext(rs);if(e===void 0)throw Error(Cr(52));return e}var as=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,value:s,inputRef:c,nativeButton:l=!1,id:u,...d}=e,{disabled:f,readOnly:p,required:m,checkedValue:h,setCheckedValue:g,touched:_,setTouched:v,validation:y,registerControlRef:b}=vo(),{setDirty:x,validityData:S,setTouched:C,setFilled:w,state:T,disabled:E}=lo(),D=ts(),{labelId:O,getDescriptionProps:k}=ho(),A=E||D.disabled||f||i,j=p||a,M=m||o,N=h===s,P=J.useRef(null),F=J.useRef(null),I=qt(c,F);X(()=>{F.current?.checked&&w(!0)},[w]);let L=pn(),R=ns({id:u,implicit:!1,controlRef:P}),z={role:`radio`,"aria-checked":N,"aria-required":M||void 0,"aria-disabled":A||void 0,"aria-readonly":j||void 0,"aria-labelledby":O,[ba]:N?``:void 0,id:L,disabled:A,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){e.defaultPrevented||A||j||(e.preventDefault(),F.current?.click())},onFocus(e){e.defaultPrevented||A||j||!_||(F.current?.click(),v(!1))}},{getButtonProps:B,buttonRef:V}=Jo({disabled:A,native:l}),ee=J.useMemo(()=>({type:`radio`,ref:I,id:R,tabIndex:-1,style:rn,"aria-hidden":!0,disabled:A,checked:N,required:M,readOnly:j,onChange(e){if(e.nativeEvent.defaultPrevented||A||j||s===void 0)return;let t=Q(xo,e.nativeEvent);t.isCanceled||(C(!0),x(s!==S.initialValue),w(!0),g(s,t))},onFocus(){P.current?.focus()}}),[N,A,R,I,j,M,g,x,C,w,S.initialValue,s]),H=J.useMemo(()=>({...T,required:M,disabled:A,readOnly:j,checked:N}),[T,A,j,N,M]),U=J.useMemo(()=>H,[H]),W=g!==an,te=[t,b,P,V],ne=[z,k,y?.getValidationProps??sn,d,B],re=Z(`span`,e,{enabled:!W,state:H,ref:te,props:ne,stateAttributesMapping:Ko});return(0,q.jsxs)(rs.Provider,{value:U,children:[W?(0,q.jsx)($o,{tag:`span`,render:n,className:r,state:H,refs:te,props:ne,stateAttributesMapping:Ko}):re,(0,q.jsx)(`input`,{...ee})]})});function os(e){let t=Kt(ss,e).current;return t.next=e,X(t.effect),t}function ss(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var cs=[];function ls(e){J.useEffect(e,cs)}var us=null;globalThis.requestAnimationFrame;var ds=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)}},fs=class e{static create(){return new e}static request(e){return ds.request(e)}static cancel(e){return ds.cancel(e)}currentId=us;request(e){this.cancel(),this.currentId=ds.request(()=>{this.currentId=us,e()})}cancel=()=>{this.currentId!==us&&(ds.cancel(this.currentId),this.currentId=us)};disposeEffect=()=>this.cancel};function ps(){let e=Kt(fs.create).current;return ls(e.disposeEffect),e}function ms(e){return e==null?e:`current`in e?e.current:e}function hs(e,t=!1,n=!0){let r=ps();return Y((i,a=null)=>{r.cancel();let o=ms(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||mr.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;mr.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function gs(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=os(n),o=Y(i),s=hs(r,n);J.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function _s(e,t=!1,n=!1){let[r,i]=J.useState(e&&t?`idle`:void 0),[a,o]=J.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),X(()=>{if(!e&&a&&r!==`ending`&&n){let e=fs.request(()=>{i(`ending`)});return()=>{fs.cancel(e)}}},[e,a,r,n]),X(()=>{if(!e||t)return;let n=fs.request(()=>{mr.flushSync(()=>{i(void 0)})});return()=>{fs.cancel(n)}},[t,e]),X(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=fs.request(()=>{i(`idle`)});return()=>{fs.cancel(n)}},[t,e,a,i,r]),J.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var vs=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=is(),s=o.checked,{transitionStatus:c,setMounted:l}=_s(s),u=J.useMemo(()=>({...o,transitionStatus:c}),[o,c]),d=J.useRef(null),f=i||s,p=Z(`span`,e,{enabled:f,ref:[t,d],state:u,props:a,stateAttributesMapping:Ko});return gs({open:s,ref:d,onComplete(){s||l(!1)}}),f?p:null});function ys({className:e,disabled:t=!1,onKeyDown:n,...r}){return(0,q.jsx)(bo,{"data-slot":`radio-group`,disabled:t,className:K(`grid gap-2`,e),onKeyDown:e=>{e.target.closest(`[role="radio"]`)||e.preventBaseUIHandler(),n?.(e)},...r})}function bs({className:e,disabled:t,...n}){return(0,q.jsx)(as,{"data-slot":`radio-group-item`,...t===void 0?{}:{disabled:t},className:K(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-transparent`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(vs,{className:`h-2 w-2 rounded-full bg-primary`})})}function xs({value:e,disabled:t,className:n,children:r}){let i=(0,J.useId)();return(0,q.jsxs)(`label`,{id:i,"data-slot":`radio-group-option`,className:K(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm leading-snug has-[[data-disabled]]:opacity-50`,n),children:[(0,q.jsx)(bs,{value:e,disabled:t,"aria-labelledby":i}),r]})}var Ss=J.createContext(void 0);function Cs(e){let t=J.useContext(Ss);if(t===void 0&&!e)throw Error(Cr(33));return t}var ws=J.createContext(void 0);function Ts(e){let t=J.useContext(ws);if(t===void 0&&!e)throw Error(Cr(36));return t}var Es=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Vo.startingStyle]=`startingStyle`,e[e.endingStyle=Vo.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),Ds=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Os={[Ds.popupOpen]:``},ks={[Ds.popupOpen]:``,[Ds.pressed]:``},As={[Es.open]:``},js={[Es.closed]:``},Ms={[Es.anchorHidden]:``},Ns={open(e){return e?Os:null}},Ps={open(e){return e?ks:null}},Fs={open(e){return e?As:js},anchorHidden(e){return e?Ms:null}},Is=J.createContext(void 0);function Ls(e=!0){let t=J.useContext(Is);if(t===void 0&&!e)throw Error(Cr(25));return t}var Rs=J.createContext(void 0);function zs(){let e=J.useContext(Rs);if(e===void 0)throw Error(Cr(30));return e}var Bs={type:`regular-item`};function Vs(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:o,itemMetadata:s,nodeId:c}=e,l=J.useRef(null),u=Ls(!0),d=u!==void 0,{events:f}=a.useState(`floatingTreeRoot`),{getButtonProps:p,buttonRef:m}=Jo({disabled:n,focusableWhenDisabled:!0,native:o}),h=J.useCallback(e=>Pa({id:i,role:`menuitem`,tabIndex:r?0:-1,onMouseMove(e){c&&f.emit(`itemhover`,{nodeId:c,target:e.currentTarget})},onMouseEnter(){s.type===`submenu-trigger`&&s.setActive()},onKeyUp(e){e.key===` `&&a.context.typingRef.current&&e.preventBaseUIHandler()},onClick(e){t&&f.emit(`close`,{domEvent:e,reason:Eo})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1)return}l.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&s.type===`regular-item`&&l.current.click()}},e,p),[i,r,p,t,f,a,d,u,s,c]),g=qt(l,m);return J.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var Hs=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),Us={checked(e){return e?{[Hs.checked]:``}:{[Hs.unchecked]:``}},...Wo},Ws=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,...f}=e,p=Zo({label:a}),m=Cs(!0),h=pn(i),{store:g}=Ts(),_=g.useState(`isActive`,p.index),v=g.useState(`itemProps`),[y,b]=Wt({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:x,itemRef:S}=Vs({closeOnClick:c,disabled:s,highlighted:_,id:h,store:g,nativeButton:o,nodeId:m?.nodeId,itemMetadata:Bs}),C=J.useMemo(()=>({disabled:s,highlighted:_,checked:y}),[s,_,y]),w=Z(`div`,e,{state:C,stateAttributesMapping:Us,props:[v,{role:`menuitemcheckbox`,"aria-checked":y,onClick:Y(e=>{let t={...Q(Eo,e.nativeEvent),preventUnmountOnClose:()=>{}};d?.(!y,t),!t.isCanceled&&b(e=>!e)})},f,x],ref:[S,t,p.ref]});return(0,q.jsx)(Rs.Provider,{value:C,children:w})}),Gs=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=zs(),s=J.useRef(null),{transitionStatus:c,setMounted:l}=_s(o.checked);return gs({open:o.checked,ref:s,onComplete(){o.checked||l(!1)}}),Z(`span`,e,{state:J.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:c}),[o.checked,o.disabled,o.highlighted,c]),ref:[t,s],stateAttributesMapping:Us,props:{"aria-hidden":!0,...a},enabled:i||o.checked})}),Ks=J.createContext(void 0);function qs(){let e=J.useContext(Ks);if(e===void 0)throw Error(Cr(31));return e}var Js=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,[a,o]=J.useState(void 0),s=J.useMemo(()=>({setLabelId:o}),[o]),c=Z(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":a,...i}});return(0,q.jsx)(Ks.Provider,{value:s,children:c})}),Ys=J.forwardRef(function(e,t){let{className:n,render:r,id:i,...a}=e,o=pn(i),{setLabelId:s}=qs();return X(()=>(s(o),()=>{s(void 0)}),[s,o]),Z(`div`,e,{ref:t,props:{id:o,role:`presentation`,...a}})}),Xs=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,...l}=e,u=Zo({label:a}),d=Cs(!0),f=pn(i),{store:p}=Ts(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),{getItemProps:g,itemRef:_}=Vs({closeOnClick:c,disabled:s,highlighted:m,id:f,store:p,nativeButton:o,nodeId:d?.nodeId,itemMetadata:Bs});return Z(`div`,e,{state:J.useMemo(()=>({disabled:s,highlighted:m}),[s,m]),props:[h,l,g],ref:[_,t,u.ref]})}),Zs=0,Qs=class e{static create(){return new e}currentId=Zs;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Zs,t()},e)}isStarted(){return this.currentId!==Zs}clear=()=>{this.currentId!==Zs&&(clearTimeout(this.currentId),this.currentId=Zs)};disposeEffect=()=>this.clear};function $s(){let e=Kt(Qs.create).current;return ls(e.disposeEffect),e}function ec(){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 tc=class{nodesRef={current:[]};events=ec();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)}},nc=J.createContext(null),rc=J.createContext(null),ic=()=>J.useContext(nc)?.id||null,ac=e=>{let t=J.useContext(rc);return e??t};function oc(e){let t=fn(),n=ac(e),r=ic();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function sc(e){let{children:t,id:n}=e,r=ic();return(0,q.jsx)(nc.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function cc(e){let{children:t,externalTree:n}=e,r=Kt(()=>n??new tc).current;return(0,q.jsx)(rc.Provider,{value:r,children:t})}function lc(e){return`data-base-ui-${e}`}lc(`safe-polygon`),`${$n}`;function uc(e,t,n){if(n&&!xr(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var dc=J.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Qs,currentIdRef:{current:null},currentContextRef:{current:null}});function fc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=J.useRef(n),a=J.useRef(n),o=J.useRef(null),s=J.useRef(null),c=$s();return(0,q.jsx)(dc.Provider,{value:J.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function pc(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=J.useContext(dc),[p,m]=J.useState(!1);return X(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),X(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:uc(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Q(xo))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),X(()=>()=>{u.current=null},[u]),J.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function mc(e){return e?.ownerDocument||document}var hc=J.forwardRef(function(e,t){let[n,r]=J.useState();X(()=>{Gn&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:rn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),gc=0;function _c(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(gc);let a=()=>e?.focus({preventScroll:n});i?a():gc=requestAnimationFrame(a)}var vc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function yc(e){return e===`inert`?vc.inert:e===`aria-hidden`?vc[`aria-hidden`]:vc.none}var bc=new WeakSet,xc={},Sc=0,Cc=e=>e&&(e.host||Cc(e.parentNode)),wc=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Cc(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Tc(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=wc(t,e),s=new Set,c=new Set(o),l=[];xc[i]||(xc[i]=new WeakMap);let u=xc[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(hn(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=yc(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&bc.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Sc+=1,()=>{l.forEach(e=>{let t=yc(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!bc.has(e)&&a&&e.removeAttribute(a),bc.delete(e)),r||e.removeAttribute(i)}),--Sc,Sc||(vc.inert=new WeakMap,vc[`aria-hidden`]=new WeakMap,vc.none=new WeakMap,bc=new WeakSet,xc={})}}function Ec(e,t=!1,n=!1){let r=lr(e[0]).body;return Tc(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var Dc=J.createContext(null),Oc=()=>J.useContext(Dc),kc=lc(`portal`);function Ac(e={}){let{ref:t,container:n,componentProps:r=sn,elementProps:i,elementState:a}=e,o=fn(),s=Oc()?.portalNode,[c,l]=J.useState(null),[u,d]=J.useState(null),f=J.useRef(null);X(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(vn(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=Z(`div`,r,{ref:[t,d],state:a,props:[{id:o,[kc]:``},i]});return{portalNode:u,portalSubtree:c&&p?mr.createPortal(p,c):null}}var jc=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=Ac({container:r,ref:t,componentProps:e,elementProps:s}),u=J.useRef(null),d=J.useRef(null),f=J.useRef(null),p=J.useRef(null),[m,h]=J.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;J.useEffect(()=>{if(!c||g)return;function e(e){c&&Gi(e)&&(e.type===`focusin`?qi:Ki)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),J.useEffect(()=>{!c||_||qi(c)},[_,c]);let y=J.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,q.jsxs)(J.Fragment,{children:[l,(0,q.jsxs)(Dc.Provider,{value:y,children:[v&&c&&(0,q.jsx)(hc,{"data-type":`outside`,ref:u,onFocus:e=>{Gi(e,c)?f.current?.focus():Vi(m?m.domReference:null)?.focus()}}),v&&c&&(0,q.jsx)(`span`,{"aria-owns":c.id,style:Ya}),c&&mr.createPortal(n,c),v&&c&&(0,q.jsx)(hc,{"data-type":`outside`,ref:d,onFocus:e=>{Gi(e,c)?p.current?.focus():(Bi(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Q(`focus-out`,e.nativeEvent)))}})]})]})});function Mc(e,t){let n=gn(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Nc=20,Pc=[];function Fc(){Pc=Pc.filter(e=>e.isConnected)}function Ic(e){Fc(),e&&hn(e)!==`body`&&(Pc.push(e),Pc.length>Nc&&(Pc=Pc.slice(-20)))}function Lc(){return Fc(),Pc[Pc.length-1]}function Rc(e){if(!e)return null;let t=Ri();return Li(e,t)?e:Fi(e,t)[0]||e}function zc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Nn(e).display!==`none`}function Bc(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Ri(),r=Ii(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Li(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Vc(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=Y(()=>x.current.floatingContext?.nodeId),C=Y(d),w=a===!1,T=dr(v)&&w,E=os(i),D=os(a),O=os(o),k=os(u),A=ac(h),j=Oc(),M=J.useRef(null),N=J.useRef(null),P=J.useRef(!1),F=J.useRef(!1),I=J.useRef(!1),L=J.useRef(-1),R=J.useRef(``),z=J.useRef(``),B=$s(),V=$s(),ee=ps(),H=j!=null,U=pr(y),W=Y((e=U)=>e?Fi(e,Ri()):[]),te=Y(e=>{let t=W(e);return E.current.map(()=>t).filter(Boolean).flat()});J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&ar(U,ir(lr(U)))&&W().length===0&&!T&&_r(e)}let t=lr(U);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,U,c,E,T,W,te]),J.useEffect(()=>{if(r||!y)return;function e(e){let t=or(e),n=W().indexOf(t);n!==-1&&(L.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,W]),J.useEffect(()=>{if(r||!_)return;let e=lr(U);function t(){I.current=!1}function n(e){let t=or(e),n=ar(y,t)||ar(v,t)||ar(j?.portalNode,t);I.current=!n,z.current=e.pointerType||`keyboard`}function i(){z.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,U,_,j]),J.useEffect(()=>{if(r||!l)return;function e(){F.current=!0,V.start(0,()=>{F.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=or(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(ar(v,t)||ar(y,t)||ar(t,y)||ar(j?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>ar(e,t))||t?.hasAttribute(lc(`focus-guard`))||A&&(hr(A.nodesRef.current,i).find(e=>ar(e.context?.elements.floating,t)||ar(e.context?.elements.domReference,t))||gr(A.nodesRef.current,i).find(e=>[e.context?.elements.floating,pr(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&U&&Bc(U,E),s&&n!==v&&!zc(r)&&ir(lr(U))===lr(U).body){if(bn(U)&&(U.focus(),s===`popup`)){ee.request(()=>{U.focus()});return}let e=L.current,t=W(),n=t[e]||t[t.length-1]||U;bn(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!F.current&&(T||t!==Lc())&&(P.current=!0,g.setOpen(!1,Q(Ao,e)))})}function n(){I.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let i=bn(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),j&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,U,c,A,j,g,l,s,W,T,S,E,x,B,V,ee]);let ne=J.useRef(null),re=J.useRef(null),ie=qt(ne,m,j?.beforeInsideRef),ae=qt(re,j?.afterInsideRef);J.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${lc(`portal`)}]`)||[]),t=(A?gr(A.nodesRef.current,S()):[]).find(e=>dr(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ec([y,t,...e,...C(),M.current,N.current,ne.current,re.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,ms(p),ms(f),T?v:null].filter(e=>e!=null),c||T);return()=>{n()}},[_,r,v,y,c,E,j,T,A,S,C,f,p]),X(()=>{if(!_||r||!bn(U))return;let e=ir(lr(U));queueMicrotask(()=>{let t=te(U),n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||U:ms(r),i=i||t[0]||U,!ar(U,e)&&_c(i,{preventScroll:i===U})})},[r,_,U,w,te,D,k]),X(()=>{if(r||!U)return;let e=lr(U);Ic(ir(e));function t(e){if(e.open||(R.current=Mc(e.nativeEvent,z.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(yr(e.nativeEvent)||br(e.nativeEvent))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,rn),H&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(R.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||Lc();return e&&e.isConnected?e:n}let r=v||Lc()||n;return ms(t)||r}return()=>{b.off(`openchange`,t);let r=ir(e),a=ar(y,r)||A&&hr(A.nodesRef.current,S(),!1).some(e=>ar(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Rc(o),i=typeof O.current!=`boolean`;O.current&&!P.current&&bn(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,U,O,x,b,A,H,v,S]),J.useEffect(()=>{queueMicrotask(()=>{P.current=!1})},[r]),J.useEffect(()=>{if(r||!_)return;function e(e){or(e)?.closest(`[data-base-ui-click-trigger]`)&&(F.current=!0)}let t=lr(U);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,U]),X(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,g,l,v]),X(()=>{if(!(r||!U))return Bc(U,E),()=>{queueMicrotask(Fc)}},[r,U,E]);let oe=!r&&(!c||!T)&&(H||c);return(0,q.jsxs)(J.Fragment,{children:[oe&&(0,q.jsx)(hc,{"data-type":`inside`,ref:ie,onFocus:e=>{if(c){let e=te();_c(e[e.length-1])}else j?.portalNode&&(P.current=!1,Gi(e,j.portalNode)?Bi(v)?.focus():ms(p??j.beforeOutsideRef)?.focus())}}),n,oe&&(0,q.jsx)(hc,{"data-type":`inside`,ref:ae,onFocus:e=>{c?_c(te()[0]):j?.portalNode&&(l&&(P.current=!0),Gi(e,j.portalNode)?Vi(v)?.focus():ms(f??j.afterOutsideRef)?.focus())}})]})}function Hc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=J.useRef(void 0),d=ps(),f=$s(),p=J.useMemo(()=>({onPointerDown(e){u.current=e.pointerType},onMouseDown(e){let t=u.current,i=e.nativeEvent,p=n.select(`open`);if(e.button!==0||a===`click`||xr(t,!0)&&s)return;let m=r.current.openEvent,h=m?.type,g=n.select(`domReferenceElement`)!==e.currentTarget,_=p&&g||!(p&&o&&(!(m&&c)||h===`click`||h===`mousedown`));if(ur(i.target)){let e=Q(So,i,i.target);_&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(_,e);return}let v=e.currentTarget;d.request(()=>{let e=Q(So,i,v);_&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(_,e)})},onClick(e){if(a===`mousedown-only`)return;let t=u.current;if(a===`mousedown`&&t){u.current=void 0;return}if(xr(t,!0)&&s)return;let i=n.select(`open`),d=r.current.openEvent,p=n.select(`domReferenceElement`)!==e.currentTarget,m=i&&p||!(i&&o&&(!(d&&c)||Sr(d))),h=Q(So,e.nativeEvent,e.currentTarget);m&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,h)}):n.setOpen(m,h)},onKeyDown(){u.current=void 0}}),[r,a,s,n,c,o,d,f,l]);return J.useMemo(()=>i?{reference:p}:sn,[i,p])}function Uc(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 Wc(e){return e!=null&&e.clientX!=null}function Gc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=J.useRef(!1),f=J.useRef(null),[p,m]=J.useState(),[h,g]=J.useState([]),_=Y((e,t)=>{d.current||o.current.openEvent&&!Wc(o.current.openEvent)||n.set(`positionReference`,Uc(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=Y(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=xr(p)?i:r,b=J.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=gn(i);function t(n){let r=or(n);ar(i,r)?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Wc(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);J.useEffect(()=>b(),[b,h]),J.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),J.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),X(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=J.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return J.useMemo(()=>s?{reference:x}:{},[s,x])}function Kc(e,t,n){let{reference:r,floating:i}=e,a=Lr(t),o=Rr(t),s=Ir(o),c=Nr(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}}let m=Pr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function qc(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}=Mr(t,e),p=Xr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Zr(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=Zr(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 Jc=50,Yc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:qc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Kc(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<Jc&&(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}=Kc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Xc=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}=Mr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Nr(r),_=Lr(o),v=Nr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Jr(o)]:Br(o)),x=p!==`none`;!d&&x&&b.push(...qr(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=zr(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`&&_!==Lr(t))||T.every(e=>Lr(e.placement)!==_||e.overflows[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=Lr(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 Zc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qc(e){return wr.some(t=>e[t]>=0)}var $c=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Mr(e,t);switch(i){case`referenceHidden`:{let e=Zc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Qc(e)}}}case`escaped`:{let e=Zc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Qc(e)}}}default:return{}}}}},el=new Set([`left`,`top`]);async function tl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Nr(n),s=Pr(n),c=Lr(n)===`y`,l=el.has(o)?-1:1,u=a&&c?-1:1,d=Mr(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 nl=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 tl(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}}}}},rl=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}=Mr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Lr(i),p=Fr(f),m=u[p],h=u[f],g=(e,t)=>jr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},il=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}=Mr(e,t),u={x:n,y:r},d=Lr(i),f=Fr(d),p=u[f],m=u[d],h=Mr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=el.has(Nr(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}}}},al=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Mr(e,t),c=await i.detectOverflow(t,s),l=Nr(n),u=Pr(n),d=Lr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Tr(p-c[m],g),y=Tr(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Er(c.left,c.right):S=p-2*Er(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ol(e){let t=Nn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bn(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Dr(n)!==a||Dr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sl(e){return yn(e)?e:e.contextElement}function cl(e){let t=sl(e);if(!bn(t))return kr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ol(t),o=(a?Dr(n.width):n.width)/r,s=(a?Dr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ll=kr(0);function ul(e){let t=gn(e);return!jn()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===gn(e)}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sl(e),o=kr(1);t&&(r?yn(r)&&(o=cl(r)):o=cl(e));let s=dl(a,n,r)?ul(a):kr(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&&r){let e=gn(a),t=yn(r)?gn(r):r,n=e,i=Rn(n);for(;i&&t!==n;){let e=cl(i),t=i.getBoundingClientRect(),r=Nn(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=gn(i),i=Rn(n)}}return Zr({width:u,height:d,x:c,y:l})}function pl(e,t){let n=Pn(e).scrollLeft;return t?t.left+n:fl(_n(e)).left+n}function ml(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pl(e,n),y:n.top+t.scrollTop}}function hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=_n(r),s=t?wn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=kr(1),u=kr(0),d=bn(r);if((d||!a)&&((hn(r)!==`body`||Sn(o))&&(c=Pn(r)),d)){let e=fl(r);l=cl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ml(o,c):kr(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 gl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _l(e){let t=Pn(e),n=e.ownerDocument.body,r=Er(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Er(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+pl(e),o=-t.scrollTop;return Nn(n).direction===`rtl`&&(a+=Er(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var vl=25;function yl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=gn(e),a=_n(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!jn()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(pl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=vl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function bl(e,t){let n=fl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=yl(e,n,t);else if(t===`document`)r=_l(_n(e));else if(yn(t))r=bl(t,n);else{let n=ul(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zr(r)}function Sl(e,t){let n=t.get(e);if(n)return n;let r=Ln(e,[],!1).filter(e=>yn(e)&&hn(e)!==`body`),i=null,a=Nn(e).position===`fixed`,o=a?Fn(e):e;for(;yn(o)&&!Mn(o);){let e=Nn(o),t=kn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Fn(o)}return t.set(e,r),r}function Cl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?wn(t)?[]:Sl(t,this._c):[].concat(n),r],o=xl(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=xl(t,a[e],i);s=Er(n.top,s),c=Tr(n.right,c),l=Tr(n.bottom,l),u=Er(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function wl(e){let{width:t,height:n}=ol(e);return{width:t,height:n}}function Tl(e,t,n){let r=bn(t),i=_n(t),a=n===`fixed`,o=fl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=kr(0);if((r||!a)&&((hn(t)!==`body`||Sn(i))&&(s=Pn(t)),r)){let e=fl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=pl(i));let l=i&&!r&&!a?ml(i,s):kr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function El(e){return Nn(e).position===`static`}function Dl(e,t){if(!bn(e)||Nn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return _n(e)===n&&(n=n.ownerDocument.body),n}function Ol(e,t){let n=gn(e);if(wn(e))return n;if(!bn(e)){let t=Fn(e);for(;t&&!Mn(t);){if(yn(t)&&!El(t))return t;t=Fn(t)}return n}let r=Dl(e,t);for(;r&&Cn(r)&&El(r);)r=Dl(r,t);return r&&Mn(r)&&El(r)&&!kn(r)?n:r||An(e)||n}var kl=async function(e){let t=this.getOffsetParent||Ol,n=this.getDimensions,r=await n(e.floating);return{reference:Tl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Al(e){return Nn(e).direction===`rtl`}var jl={convertOffsetParentRelativeRectToViewportRelativeRect:hl,getDocumentElement:_n,getClippingRect:Cl,getOffsetParent:Ol,getElementRects:kl,getClientRects:gl,getDimensions:wl,getScale:cl,isElement:yn,isRTL:Al};function Ml(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nl(e,t,n){let r=null,i,a=_n(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Or(d),h=Or(a.clientWidth-(u+f)),g=Or(a.clientHeight-(d+p)),_=Or(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Er(0,Tr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ml(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=gn(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Pl(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=sl(e),u=i||a?[...l?Ln(l):[],...t?Ln(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nl(l,n,a):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?fl(e):null;c&&g();function g(){let t=fl(e);h&&!Ml(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 Fl=nl,Il=rl,Ll=Xc,Rl=al,zl=$c,Bl=il,Vl=(e,t,n)=>{let r=new Map,i=n??{},a={...jl,...i.platform,_c:r};return Yc(e,t,{...i,platform:a})},Hl=typeof document<`u`?J.useLayoutEffect:function(){};function Ul(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(!Ul(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)&&!Ul(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Wl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gl(e,t){let n=Wl(e);return Math.round(t*n)/n}function Kl(e){let t=J.useRef(e);return Hl(()=>{t.current=e}),t}function ql(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]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);Ul(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=Kl(c),D=Kl(i),O=Kl(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Vl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ul(w.current,t)&&(w.current=t,mr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Hl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Hl(()=>(A.current=!0,()=>{A.current=!1}),[]),Hl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Gl(M.floating,u.x),r=Gl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Wl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Jl=(e,t)=>{let n=Fl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yl=(e,t)=>{let n=Il(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xl=(e,t)=>({fn:Bl(e).fn,options:[e,t]}),Zl=(e,t)=>{let n=Ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ql=(e,t)=>{let n=Rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},$l=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},eu={intentional:`onClick`,sloppy:`onPointerDown`};function tu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function nu(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=ac(_),y=Y(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=J.useRef(!1),{escapeKey:S,outsidePress:C}=tu(g),w=J.useRef(null),T=$s(),E=$s(),D=Y(()=>{E.clear(),c.current.insideReactTree=!1}),O=J.useRef(!1),k=J.useRef(``),A=Y(e=>{k.current=e.pointerType}),j=Y(()=>{let e=k.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),M=Y(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?hr(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Q(jo,vr(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),N=Y(e=>{let t=j();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),P=Y(()=>{c.current.insideReactTree=!0,E.start(0,D)}),F=Y((e,t=!1)=>{if(N(e)){D();return}if(c.current.insideReactTree){D();return}if(j()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=or(e),i=`[${lc(`inert`)}]`,a=lr(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>ar(e,r))))return;let s=yn(r)?r:null;for(;s&&!Mn(s);){let e=Fn(s);if(Mn(e)||!yn(e))break;s=e}if(a.length&&yn(r)&&!cr(r)&&!ar(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!ar(s,e)))return;if(bn(r)&&!(`touches`in e)){let t=Mn(r),n=Nn(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&hr(v.nodesRef.current,l).some(t=>sr(e,t.context?.elements.floating));if(sr(e,n.select(`floatingElement`))||sr(e,n.select(`domReferenceElement`))||u)return;let d=v?hr(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Q(To,e)),D()}),I=Y(e=>{j()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||sr(e,n.select(`floatingElement`))||sr(e,n.select(`domReferenceElement`))||F(e)}),L=Y(e=>{if(j()!==`sloppy`||!n.select(`open`)||!l||sr(e,n.select(`floatingElement`))||sr(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),R=Y(e=>{let t=or(e);function n(){L(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),z=Y(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=or(e);function r(){e.type===`pointerdown`?I(e):F(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),B=Y(e=>{if(j()!==`sloppy`||!w.current||sr(e,n.select(`floatingElement`))||sr(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(F(e),T.clear(),w.current=null)}),V=Y(e=>{let t=or(e);function n(){B(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ee=Y(e=>{j()!==`sloppy`||!w.current||sr(e,n.select(`floatingElement`))||sr(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&F(e),T.clear(),w.current=null)}),H=Y(e=>{let t=or(e);function n(){ee(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});J.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new Qs;function t(e){n.setOpen(!1,Q(xo,e))}function s(){e.clear(),O.current=!0}function d(){e.start(jn()?5:0,()=>{O.current=!1})}let f=lr(i);f.addEventListener(`pointerdown`,A,!0),u&&(f.addEventListener(`keydown`,M),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,z,!0),f.addEventListener(`pointerdown`,z,!0),f.addEventListener(`touchstart`,R,!0),f.addEventListener(`touchmove`,V,!0),f.addEventListener(`touchend`,H,!0),f.addEventListener(`mousedown`,z,!0));let p=[];return h&&(yn(o)&&(p=Ln(o)),yn(i)&&(p=p.concat(Ln(i))),!yn(a)&&a&&a.contextElement&&(p=p.concat(Ln(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,A,!0),u&&(f.removeEventListener(`keydown`,M),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,z,!0),f.removeEventListener(`pointerdown`,z,!0),f.removeEventListener(`touchstart`,R,!0),f.removeEventListener(`touchmove`,V,!0),f.removeEventListener(`touchend`,H,!0),f.removeEventListener(`mousedown`,z,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,M,F,z,I,R,V,H,A,n]),J.useEffect(D,[b,D]);let U=J.useMemo(()=>({onKeyDown:M,...p&&{[eu[m]]:e=>{n.setOpen(!1,Q(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Q(`trigger-press`,e.nativeEvent))}}}}),[M,n,p,m]),W=Y(e=>{let t=or(e.nativeEvent);!ar(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),te=J.useMemo(()=>({onKeyDown:M,onPointerDown:W,onMouseDown:W,onMouseUp:W,onClickCapture:P,onMouseDownCapture:P,onPointerDownCapture:P,onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,W,P]);return J.useMemo(()=>l?{reference:U,floating:te,trigger:U}:{},[l,U,te])}var ru=Symbol(`NOT_FOUND`);function iu(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function au(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var ou=e=>Array.isArray(e)?e:[e];function su(e){let t=Array.isArray(e[0])?e[0]:e;return au(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function cu(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function lu(e){let t;return{get(n){return t&&e(t.key,n)?t.value:ru},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function uu(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return ru}function i(t,i){r(t)===ru&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var du=(e,t)=>e===t;function fu(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function pu(e,t){let{equalityCheck:n=du,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=fu(n),o=0,s=r<=1?lu(a):uu(r,a);function c(){let t=s.get(arguments);if(t===ru){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var mu=class{constructor(e){this.value=e}deref(){return this.value}},hu=typeof WeakRef>`u`?mu:WeakRef,gu=0,_u=1;function vu(){return{s:gu,v:void 0,o:null,p:null}}function yu(e){return e instanceof hu?e.deref():e}function bu(e,t={}){let n=vu(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=vu(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=vu(),e.set(n,t)):t=r}}let s=t,c;if(t.s===_u)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=yu(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new hu(c):c}return s.s=_u,s.v=c,c}return o.clearCache=()=>{n=vu(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function xu(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),iu(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=bu,argsMemoizeOptions:u=[]}={...n,...a},d=ou(c),f=ou(u),p=su(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=cu(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}xu({memoize:pu,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Cr(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},Su=t((e=>{var t=n();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=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Cu=t(((e,t)=>{t.exports=Su()})),wu=t((e=>{var t=n(),r=Cu();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Tu=t(((e,t)=>{t.exports=wu()})),Eu=Cu(),Du=Tu(),Ou=Da(19)?Au:ju;function ku(e,t,n,r,i){return Ou(e,t,n,r,i)}function Au(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Eu.useSyncExternalStore)(e.subscribe,a,a)}function ju(e,t,n,r,i){return(0,Du.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mu=class e{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(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},Nu=class extends Mu{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){J.useDebugValue(e),X(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){X(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){X(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){J.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),X(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{J.useDebugValue(e);let i=this.selectors[e];return ku(this,i,t,n,r)};useContextCallback(e,t){J.useDebugValue(e);let n=Y(t??an);this.context[e]=n}useStateSetter(e){let t=J.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)}})}},Pu={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},Fu=class extends Nu{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ec(),nested:t,noEmit:n,triggerElements:i},Pu)}setOpen=(e,t)=>{if((!e||!this.state.open||Sr(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function Iu(e,t){let n=J.useRef(null);return J.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function Lu(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Iu(e,n),o=Y(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return X(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Ru(e){let t=e.useState(`open`);X(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function zu(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=_s(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=Y(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return gs({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Bu=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function Vu(){return new Fu({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Bu,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function Hu(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:Vu(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:sn,inactiveTriggerProps:sn,popupProps:sn}}var Uu={open:$(e=>e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:$(e=>e.activeTriggerId),activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Wu(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=fn(),a=ic()!=null,o=Kt(()=>new Fu({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new Bu,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return X(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=yn(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.context.noEmit=e.noEmit||!1,o}function Gu(e={}){let{nodeId:t,externalTree:n}=e,r=Wu(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=J.useState(null),c=J.useRef(null),l=ac(n);X(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=ql({...e,elements:{...a,...o&&{reference:o}}}),d=J.useCallback(e=>{let t=yn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=J.useState(null),[m,h]=J.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,yn(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=J.useCallback(e=>{(yn(e)||e===null)&&(c.current=e,p(e)),(yn(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!yn(e))&&u.refs.setReference(e)},[u.refs,p]),_=J.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=J.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=J.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=J.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return X(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),J.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function Ku(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=fn(),o=ic()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Kt(()=>new Fu({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return X(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};yn(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var qu=qn&&Gn;function Ju(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=J.useRef(!1),c=$s(),l=J.useRef(!0);J.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=gn(e);function r(){!n.select(`open`)&&bn(e)&&e===ir(lr(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),qu&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),qu&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),J.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=J.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=or(e.nativeEvent);if(o&&yn(t)){if(qu&&!e.relatedTarget){if(!l.current&&!ur(t))return}else if(!fr(t))return}n.setOpen(!0,Q(wo,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=yn(t)&&t.hasAttribute(lc(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=ir(o?o.ownerDocument:document);!t&&s===o||ar(i.current.floatingContext?.refs.floating.current,s)||ar(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Q(wo,r))})}}),[i,n,o,c]);return J.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var Yu=lc(`safe-polygon`),Xu=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${$n}`;function Zu(e){return e?!!e.closest(Xu):!1}function Qu(e){let t=J.useRef(void 0),n=J.useRef(!1),r=J.useRef(void 0),i=J.useRef(!0),a=J.useRef(!1),o=J.useRef(()=>{}),s=J.useRef(!1),c=$s(),l=$s(),u=J.useRef(void 0);return J.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var $u=new Set([`click`,`mousedown`]);function ed(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=Qu(n),v=ac(l),y=ic(),b=Y(()=>d.current?!0:o.current.openEvent?$u.has(o.current.openEvent.type):!1),x=Y(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=J.useCallback((e,t=!0)=>{let r=td(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Q(Co,e))):t&&(g.clear(),n.setOpen(!1,Q(Co,e)))},[c,f,n,u,g]),C=Y(()=>{m.current(),f.current=void 0}),w=Y(()=>{if(p.current){let e=lr(i).body;e.style.pointerEvents=``,e.removeAttribute(Yu),p.current=!1}}),T=Y(e=>{if(!Zu(or(e))){d.current=!1;return}d.current=!0});X(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),J.useEffect(()=>()=>{C()},[C]),J.useEffect(()=>w,[w]),X(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&yn(a)&&i){p.current=!0;let e=lr(i).body;e.setAttribute(Yu,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),J.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function td(e,t){return t&&!xr(t)?0:typeof e==`function`?e():e}function nd(e){return typeof e==`function`?e():e}var rd={current:null};function id(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=rd,externalTree:f,isActiveTrigger:p=!0}=t,m=ac(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=Qu(n),T=os(s),E=os(o),D=os(l);p&&(w.current=T.current?.__options);let O=Y(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),k=J.useCallback((e,t=!0)=>{let r=uc(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,Q(Co,e))):t&&(S.clear(),n.setOpen(!1,Q(Co,e)))},[E,_,n,h,S]),A=Y(()=>{b.current(),_.current=void 0}),j=Y(()=>{if(y.current){let e=lr(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(Yu),y.current=!1}});J.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let M=Y(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e)}})(e)});return J.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!yn(e))return;function t(e){if(S.clear(),v.current=!1,c&&!xr(h.current)||nd(D.current)>0&&!uc(E.current,`open`))return;let t=uc(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>ar(t,e.target)))&&(!r||!ar(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,Q(Co,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Q(Co,e,o))}function i(e){if(O()){j();return}b.current();let t=lr(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!ar(n.select(`floatingElement`),e.relatedTarget))&&k(e)}}function o(e){M(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[A,j,v,r,E,k,n,a,T,M,p,O,c,u,h,D,C,x,S,d,m,b,_]),J.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>ar(t,e.target)))&&(!i||!ar(i,e.target));if(c&&!xr(h.current)||o&&!s||nd(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Q(Co,t,r))}h.current===`touch`?mr.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start(nd(D.current),l))}}},[v,c,n,h,D,C,x])}function ad(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=J.useCallback(t=>od(t,e,`reference`),t),o=J.useCallback(t=>od(t,e,`floating`),n),s=J.useCallback(t=>od(t,e,`item`),r),c=J.useCallback(t=>od(t,e,`trigger`),i);return J.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function od(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[Qn]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&sd(a,s,i,r)}return sd(a,e,i,r),a}function sd(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var cd=`Escape`;function ld(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ud(e,t){return ld(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function dd(e,t,n){return ld(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function fd(e,t,n){return ld(t,n?e===er:e===tr,e===rr)}function pd(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===cd:ld(t,n?e===tr:e===er,e===nr)}function md(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,scrollItemIntoView:w=!0,itemSizes:T,dense:E=!1,id:D,resetOnPointerLeave:O=!0,externalTree:k}=t,A=os(pr(i)),j=ic(),M=ac(k);X(()=>{o.current.orientation=x},[o,x]);let N=dr(a),P=J.useRef(_),F=J.useRef(d??-1),I=J.useRef(null),L=J.useRef(!0),R=Y(e=>{l(F.current===-1?null:F.current,e)}),z=J.useRef(R),B=J.useRef(!!i),V=J.useRef(r),ee=J.useRef(!1),H=J.useRef(!1),U=os(b),W=os(r),te=os(w),ne=os(d),re=os(O),ie=Y(()=>{function e(e){g?M?.events.emit(`virtualfocus`,e):_c(e,{sync:ee.current,preventScroll:!0})}let t=s.current[F.current],n=H.current;t&&e(t),(ee.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[F.current]||t;if(!r)return;t||e(r);let i=te.current;i&&oe&&(n||!L.current)&&r.scrollIntoView?.(typeof i==`boolean`?{block:`nearest`,inline:`nearest`}:i)})});X(()=>{u&&(r&&i?(F.current=d??-1,P.current&&d!=null&&(H.current=!0,R())):B.current&&(F.current=-1,z.current()))},[u,r,i,d,R]),X(()=>{if(u){if(!r){ee.current=!1;return}if(i)if(c==null){if(ee.current=!1,ne.current!=null)return;if(B.current&&(F.current=-1,ie()),(!V.current||!B.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(F.current=I.current==null||dd(I.current,x,h)||m?ei(s):ti(s),I.current=null,R())};t()}}else $r(s,c)||(F.current=c,ie(),H.current=!1)}},[u,r,i,c,ne,m,s,x,h,R,ie,U]),X(()=>{if(!u||i||!M||g||!B.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=ir(lr(i)),r=e.some(e=>e.context&&ar(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[u,i,M,j,g]),X(()=>{z.current=R,V.current=r,B.current=!!i}),X(()=>{r||(I.current=null,P.current=_)},[r,_]);let ae=c!=null,oe=J.useMemo(()=>{function e(e){if(!W.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&F.current!==t&&(F.current=t,R(e))}return{onFocus(t){ee.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){ee.current=!0,H.current=!1,v&&e(t)},onPointerLeave(e){if(!W.current||!L.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;!v||s.current.includes(t)||re.current&&(F.current=-1,R(e),g||A.current?.focus({preventScroll:!0}))}}},[W,A,v,s,R,re,g]),se=J.useCallback(()=>S??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation,[j,M,S]),ce=Y(e=>{if(L.current=!1,ee.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(m&&pd(e.key,x,h,C)){ud(e.key,se())||_r(e),n.setOpen(!1,Q(Mo,e.nativeEvent)),bn(a)&&(g?M?.events.emit(`virtualfocus`,a):a.focus());return}let t=F.current,i=ei(s,b),o=ti(s,b);if(N||(e.key===`Home`&&(_r(e),F.current=i,R(e)),e.key===`End`&&(_r(e),F.current=o,R(e))),C>1){let t=T||Array.from({length:s.current.length},()=>({width:1,height:1})),n=ii(t,C,E),r=n.findIndex(e=>e!=null&&!si(s,e,b)),a=n.reduce((e,t,n)=>t!=null&&!si(s,t,b)?n:e,-1),c=n[ri({current:n.map(e=>e==null?null:s.current[e])},{event:e,orientation:x,loopFocus:p,rtl:h,cols:C,disabledIndices:oi([...(typeof b==`function`?null:b)||s.current.map((e,t)=>si(s,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:ai(F.current>o?i:F.current,t,n,C,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(F.current=c,R(e)),x===`both`)return}if(ud(e.key,x)){if(_r(e),r&&!g&&ir(e.currentTarget.ownerDocument)===e.currentTarget){F.current=dd(e.key,x,h)?i:o,R(e);return}dd(e.key,x,h)?p?t>=o?f&&t!==s.current.length?F.current=-1:(ee.current=!1,F.current=i):F.current=ni(s,{startingIndex:t,disabledIndices:b}):F.current=Math.min(o,ni(s,{startingIndex:t,disabledIndices:b})):p?t<=i?f&&t!==-1?F.current=s.current.length:(ee.current=!1,F.current=o):F.current=ni(s,{startingIndex:t,decrement:!0,disabledIndices:b}):F.current=Math.max(i,ni(s,{startingIndex:t,decrement:!0,disabledIndices:b})),$r(s,F.current)&&(F.current=-1),R(e)}}),le=J.useMemo(()=>g&&r&&ae&&{"aria-activedescendant":`${D}-${c}`},[g,r,ae,D,c]),ue=J.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...N?{}:le,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=or(e.nativeEvent);if(t&&!ar(A.current,t))return;_r(e),n.setOpen(!1,Q(Ao,e.nativeEvent)),bn(a)&&a.focus();return}ce(e)},onPointerMove(){L.current=!0}}),[le,ce,A,x,N,n,r,g,a]),de=J.useMemo(()=>{function e(e){_===`auto`&&yr(e.nativeEvent)&&(P.current=!g)}function t(e){P.current=_,_===`auto`&&br(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(e){let t=n.select(`open`);L.current=!1;let r=e.key.startsWith(`Arrow`),i=fd(e.key,se(),h),a=ud(e.key,x),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return ce(e);if(!(!t&&!y&&r)){if(o){let t=ud(e.key,se());I.current=m&&t?null:e.key}if(m){i&&(_r(e),t?(F.current=ei(s,U.current),R(e)):n.setOpen(!0,Q(Mo,e.nativeEvent,e.currentTarget)));return}a&&(ne.current!=null&&(F.current=ne.current),_r(e),!t&&y?n.setOpen(!0,Q(Mo,e.nativeEvent,e.currentTarget)):ce(e),t&&R(e))}},onFocus(e){n.select(`open`)&&!g&&(F.current=-1,R(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,U,_,s,m,R,n,y,x,se,h,ne,g]),fe=J.useMemo(()=>({...le,...de}),[le,de]);return J.useMemo(()=>u?{reference:fe,floating:ue,item:oe,trigger:de}:{},[u,fe,ue,de,oe])}var hd=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function gd(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=fn(),u=a?.id||l,d=J.useMemo(()=>pr(o)?.id||i,[o,i]),f=hd.get(c)??c,p=ic()!=null,m=J.useMemo(()=>f===`tooltip`||c===`label`?sn:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=J.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=J.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=J.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return J.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function _d(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.context.dataRef,{listRef:a,activeIndex:o,onMatch:s,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=on,selectedIndex:p=null}=t,m=$s(),h=J.useRef(``),g=J.useRef(p??o??-1),_=J.useRef(null);X(()=>{r&&(m.clear(),_.current=null,h.current=``)},[r,m]),X(()=>{r&&h.current===``&&(g.current=p??o??-1)},[r,p,o]);let v=Y(e=>{e?i.current.typing||(i.current.typing=e,c?.(e)):i.current.typing&&(i.current.typing=e,c?.(e))}),y=Y(e=>{function t(e,t,n){let r=u?u(t,n):t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let n=a.current;if(h.current.length>0&&h.current[0]!==` `&&(t(n,n,h.current)===-1?v(!1):e.key===` `&&_r(e)),n==null||f.includes(e.key)||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;r&&e.key!==` `&&(_r(e),v(!0)),n.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(d,()=>{h.current=``,g.current=_.current,v(!1)});let i=g.current,o=t(n,[...n.slice((i||0)+1),...n.slice(0,(i||0)+1)],h.current);o===-1?e.key!==` `&&(h.current=``,v(!1)):(s?.(o),_.current=o)}),b=J.useMemo(()=>({onKeyDown:y}),[y]),x=J.useMemo(()=>({onKeyDown:y,onKeyUp(e){e.key===` `&&v(!1)}}),[y,v]);return J.useMemo(()=>l?{reference:b,floating:x}:{},[l,b,x])}function vd(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function yd(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function bd(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Qs,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=or(f),v=f.type===`mouseleave`,y=ar(s.floating,_),b=ar(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=yd(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&yn(f.relatedTarget)&&ar(s.floating,f.relatedTarget)||d&&hr(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break;default:}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]];default:return[]}}if(!vd([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}vd([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var xd=J.createContext(void 0);function Sd(e){let t=J.useContext(xd);if(t===void 0&&!e)throw Error(Cr(69));return t}function Cd(e){return e===`starting`?Ga:sn}var wd={...Fs,...Wo},Td=J.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o}=Ts(),{side:s,align:c}=Cs(),l=Sd(!0)!=null,u=o.useState(`open`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`mounted`),m=o.useState(`instantType`),h=o.useState(`activeTriggerElement`),g=o.useState(`parent`),_=o.useState(`lastOpenChangeReason`),v=o.useState(`rootId`),y=o.useState(`floatingRootContext`),b=o.useState(`floatingTreeRoot`),x=o.useState(`closeDelay`),S=o.useState(`activeTriggerElement`);gs({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){o.setOpen(!1,Q(e.reason,e.domEvent))}return b.events.on(`close`,e),()=>{b.events.off(`close`,e)}},[b.events,o]);let C=o.useState(`hoverEnabled`),w=o.useState(`disabled`);ed(y,{enabled:C&&!w&&g.type!==`context-menu`&&g.type!==`menubar`,closeDelay:x});let T=Z(`div`,e,{state:J.useMemo(()=>({transitionStatus:d,side:s,align:c,open:u,nested:g.type===`menu`,instant:m}),[d,s,c,u,g.type,m]),ref:[t,o.context.popupRef],stateAttributesMapping:wd,props:[f,{onKeyDown(e){l&&aa.has(e.key)&&e.stopPropagation()}},Cd(d),a,{"data-rootownerid":v}]}),E=g.type===void 0||g.type===`context-menu`;return(h||g.type===`menubar`&&_!==`outside-press`)&&(E=!0),(0,q.jsx)(Vc,{context:y,modal:!1,disabled:!p,returnFocus:i===void 0?E:i,initialFocus:g.type!==`menu`,restoreFocus:!0,externalTree:g.type===`menubar`?void 0:b,previousFocusableElement:S,nextFocusableElement:g.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:T})}),Ed=J.createContext(void 0);function Dd(){let e=J.useContext(Ed);if(e===void 0)throw Error(Cr(32));return e}var Od=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Ts();return i.useState(`mounted`)||n?(0,q.jsx)(Ed.Provider,{value:n,children:(0,q.jsx)(jc,{ref:t,...r})}):null});function kd(e){return Da(19)?e:e?`true`:void 0}var Ad=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`}=Mr(e,t)||{};if(l==null)return{};let f=Xr(u),p={x:n,y:r},m=Rr(i),h=Ir(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,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=jr(k,j,A),N=!c.arrow&&Pr(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),jd=(e,t)=>({...Ad(e),options:[e,t]}),Md={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 $l().fn(e)).data?.referenceHidden||a}}}},Nd={sideX:`left`,sideY:`top`},Pd={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=gn(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Nd};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=mc(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Nr(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`:Nd.sideX,g=f===`top`?`bottom`:Nd.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Fd(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 Id(e,t,n){let{rects:r,placement:i}=e;return{side:Fd(t,Nr(i),n),align:Pr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ld(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,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=J.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=Y(E),O=E?D:t,k=os(t),A=eo()===`rtl`,j=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":A?`left`:`right`,"inline-start":A?`right`:`left`}[r],M=a===`center`?j:`${j}-${a}`,N=c,P=+(r===`bottom`),F=+(r===`top`),I=+(r===`right`),L=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+L,bottom:N+F,left:N+I}:N&&={top:(N.top||0)+P,right:(N.right||0)+L,bottom:(N.bottom||0)+F,left:(N.left||0)+I};let R={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},z=J.useRef(null),B=os(i),V=os(o),ee=[Jl(e=>{let t=Id(e,r,A),n=typeof B.current==`function`?B.current(t):B.current,i=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,A,r])],H=w===`none`&&C!==`shift`,U=!H&&(l||g||C===`shift`),W=C===`none`?null:Zl({...R,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),te=H?null:Yl(e=>{let t=mc(e.elements.floating).documentElement;return{...R,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:U,limiter:l||g?void 0:Xl(e=>{if(!z.current)return{};let{width:t,height:n}=z.current.getBoundingClientRect(),r=Lr(Nr(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[R,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?ee.push(te,W):ee.push(W,te),ee.push(Ql({...R,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),jd(()=>({element:z.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Nr(a),l=Lr(c),u=z.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(Id(e,r,A)):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`,U&&l===`y`&&b?S:x),{}}},Md,v),X(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ne=J.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:re,elements:ie,x:ae,y:oe,middlewareData:se,update:ce,placement:le,context:ue,isPositioned:de,floatingStyles:fe}=Gu({rootContext:p,placement:M,middleware:ee,strategy:n,whileElementsMounted:f?void 0:(...e)=>Pl(...e,ne),nodeId:_,externalTree:b}),{sideX:pe,sideY:me}=se.adaptiveOrigin||Nd,G=de?n:`fixed`,he=J.useMemo(()=>v?{position:G,[pe]:ae,[me]:oe}:{position:G,...fe},[v,G,pe,ae,me,oe,fe]),ge=J.useRef(null);X(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(Rd(t)?t.current:t)||null;n!==ge.current&&(re.setPositionReference(n),ge.current=n)},[m,re,O,k]),J.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&Rd(e)&&e.current!==ge.current&&(re.setPositionReference(e.current),ge.current=e.current)},[m,re,O,k]),J.useEffect(()=>{if(f&&m&&ie.domReference&&ie.floating)return Pl(ie.domReference,ie.floating,ce,ne)},[f,m,ie,ce,ne]);let _e=Nr(le),ve=Fd(r,_e,A),ye=Pr(le)||`center`,be=!!se.hide?.referenceHidden;X(()=>{y&&m&&de&&S(_e)},[y,m,de,_e]);let xe=J.useMemo(()=>({position:`absolute`,top:se.arrow?.y,left:se.arrow?.x}),[se.arrow]),Se=se.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:he,arrowStyles:xe,arrowRef:z,arrowUncentered:Se,side:ve,align:ye,physicalSide:_e,anchorHidden:be,refs:re,context:ue,isPositioned:de,update:ce}),[he,xe,z,Se,ve,ye,_e,be,re,ue,de,ce])}function Rd(e){return e!=null&&`current`in e}var zd=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
8
|
+
0% 0%,
|
|
9
|
+
100% 0%,
|
|
10
|
+
100% 100%,
|
|
11
|
+
0% 100%,
|
|
12
|
+
0% 0%,
|
|
13
|
+
${e.left}px ${e.top}px,
|
|
14
|
+
${e.left}px ${e.bottom}px,
|
|
15
|
+
${e.right}px ${e.bottom}px,
|
|
16
|
+
${e.right}px ${e.top}px,
|
|
17
|
+
${e.left}px ${e.top}px
|
|
18
|
+
)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Bd=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=qa,...g}=e,{store:_}=Ts(),v=Dd(),y=Ls(!0),b=_.useState(`parent`),x=_.useState(`floatingRootContext`),S=_.useState(`floatingTreeRoot`),C=_.useState(`mounted`),w=_.useState(`open`),T=_.useState(`modal`),E=_.useState(`activeTriggerElement`),D=_.useState(`lastOpenChangeReason`),O=_.useState(`floatingNodeId`),k=_.useState(`floatingParentNodeId`),A=n,j=c,M=l,N=s;b.type===`context-menu`&&(A=n??b.context?.anchor,N??=`start`,!o&&N!==`center`&&(M=e.alignOffset??2,j=e.sideOffset??-5));let P=o,F=N;b.type===`menu`?(P??=`inline-end`,F??=`start`):b.type===`menubar`&&(P??=`bottom`,F??=`start`);let I=b.type===`context-menu`,L=Ld({anchor:A,floatingRootContext:x,positionMethod:y?`fixed`:r,mounted:C,side:P,sideOffset:j,align:F,alignOffset:M,arrowPadding:I?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:O,keepMounted:v,disableAnchorTracking:m,collisionAvoidance:h,shiftCrossAxis:I,externalTree:S}),R=J.useMemo(()=>{let e={};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!C,style:{...L.positionerStyles,...e}}},[w,C,L.positionerStyles]);J.useEffect(()=>{function e(e){e.open?(e.parentNodeId===O&&_.set(`hoverEnabled`,!1),e.nodeId!==O&&e.parentNodeId===_.select(`floatingParentNodeId`)&&_.setOpen(!1,Q(Io))):e.parentNodeId===O&&e.reason!==`sibling-open`&&_.set(`hoverEnabled`,!0)}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[_,S.events,O]),J.useEffect(()=>{if(_.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==_.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;_.setOpen(!1,Q(t))}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[S.events,_]),J.useEffect(()=>{function e(e){!w||e.nodeId!==_.select(`floatingParentNodeId`)||e.target&&E&&E!==e.target&&_.setOpen(!1,Q(Io))}return S.events.on(`itemhover`,e),()=>{S.events.off(`itemhover`,e)}},[S.events,w,E,_]),J.useEffect(()=>{let e={open:w,nodeId:O,parentNodeId:k,reason:_.select(`lastOpenChangeReason`)};S.events.emit(`menuopenchange`,e)},[S.events,w,_,O,k]);let z=J.useMemo(()=>({open:w,side:L.side,align:L.align,anchorHidden:L.anchorHidden,nested:b.type===`menu`}),[w,L.side,L.align,L.anchorHidden,b.type]),B=J.useMemo(()=>({side:L.side,align:L.align,arrowRef:L.arrowRef,arrowUncentered:L.arrowUncentered,arrowStyles:L.arrowStyles,nodeId:L.context.nodeId}),[L.side,L.align,L.arrowRef,L.arrowUncentered,L.arrowStyles,L.context.nodeId]),V=Z(`div`,e,{state:z,stateAttributesMapping:Fs,ref:[t,_.useStateSetter(`positionerElement`)],props:[R,g]}),ee=C&&b.type!==`menu`&&(b.type!==`menubar`&&T&&D!==`trigger-hover`||b.type===`menubar`&&b.context.modal),H=null;return b.type===`menubar`?H=b.context.contentElement:b.type===void 0&&(H=E),(0,q.jsxs)(Ss.Provider,{value:B,children:[ee&&(0,q.jsx)(zd,{ref:b.type===`context-menu`||b.type===`nested-context-menu`?b.context.internalBackdropRef:null,inert:kd(!w),cutout:H}),(0,q.jsx)(sc,{id:O,children:(0,q.jsx)(ha,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:V})})]})}),Vd={},Hd={},Ud=``;function Wd(e){if(typeof document>`u`)return!1;let t=mc(e);return gn(t).innerWidth-t.documentElement.clientWidth>0}function Gd(e){let t=mc(e),n=t.documentElement,r=t.body,i=Sn(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function Kd(e){let t=mc(e),n=t.documentElement,r=t.body,i=gn(n),a=0,o=0,s=fs.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(Un&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Vd={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ud=n.style.scrollBehavior,Hd={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=Sn(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Vd),Object.assign(r.style,Hd),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ud)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var qd=new class{lockCount=0;restore=null;timeoutLock=Qs.create();timeoutUnlock=Qs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=mc(e).documentElement,n=gn(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=an;return}let r=Wn||!Wd(e);this.restore=r?Gd(e):Kd(e)}};function Jd(e=!0,t=null){X(()=>{if(e)return qd.acquire(t)},[e,t])}var Yd=J.createContext(null);function Xd(e){let t=J.useContext(Yd);if(t===null&&!e)throw Error(Cr(5));return t}function Zd(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Qd(e){let[t,n]=J.useState(null),r=Y((t,r)=>{e||n(r)}),i=J.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=Zd(r);return J.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}var $d={...Uu,disabled:$(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:$(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),allowMouseEnter:$(e=>e.parent.type===`menu`?e.parent.store.select(`allowMouseEnter`):e.allowMouseEnter),stickIfOpen:$(e=>e.stickIfOpen),parent:$(e=>e.parent),rootId:$(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:$(e=>e.activeIndex),isActive:$((e,t)=>e.activeIndex===t),hoverEnabled:$(e=>e.hoverEnabled),instantType:$(e=>e.instantType),lastOpenChangeReason:$(e=>e.openChangeReason),floatingTreeRoot:$(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:$(e=>e.floatingNodeId),floatingParentNodeId:$(e=>e.floatingParentNodeId),itemProps:$(e=>e.itemProps),closeDelay:$(e=>e.closeDelay),keyboardEventRelay:$(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},ef=class e extends Nu{constructor(e){super({...tf(),...e},{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:new Bu},$d),this.observe($(e=>e.allowMouseEnter),(e,t)=>{this.state.parent.type===`menu`&&e!==t&&this.state.parent.store.set(`allowMouseEnter`,e)}),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){return Kt(()=>t??new e(n)).current}unsubscribeParentListener=null};function tf(){return{...Hu(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new tc,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:sn,keyboardEventRelay:void 0,closeDelay:0}}var nf=J.createContext(void 0);function rf(){return J.useContext(nf)}function af(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!0,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Ls(!0),_=Ts(!0),v=Xd(!0),y=rf(),b=J.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=ef.useStore(f?.store,{parent:b}),S=x.useState(`floatingTreeRoot`),C=oc(S),w=ic();X(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]),x.useControlledProp(`open`,n,a),x.useControlledProp(`activeTriggerId`,p,m),x.useContextCallback(`onOpenChangeComplete`,i);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`modal`),A=x.useState(`disabled`),j=x.useState(`lastOpenChangeReason`),M=x.useState(`parent`),N=x.useState(`activeIndex`),P=x.useState(`payload`),F=x.useState(`floatingParentNodeId`),I=J.useRef(null),L=F!=null,R;x.useSyncedValues({disabled:o,modal:M.type===void 0?s:void 0,rootId:fn()});let{openMethod:z,triggerProps:B,reset:V}=Qd(T);Ru(x);let{forceUnmount:ee}=zu(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0}),V()}),H=J.useRef(M.type!==`context-menu`),U=$s();J.useEffect(()=>{if(T||(I.current=null),M.type===`context-menu`){if(!T){U.clear(),H.current=!1;return}U.start(500,()=>{H.current=!0})}},[U,T,M.type]),Jd(T&&k&&j!==`trigger-hover`&&z!==`touch`,D),X(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let W=J.useRef(!0),te=$s(),ne=Y((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:L};R?.emit(`openchange`,i);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!W.current)return;if(!e&&N!==null){let e=x.context.itemDomElements.current[N];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(W.current=!1,te.start(300,()=>{W.current=!0})):(W.current=!0,te.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0&&a?.isTrusted,s=!e&&(n===`escape-key`||n==null);function c(){let r={open:e,openChangeReason:n};I.current=t.event??null;let i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),x.update(r)}n===`trigger-hover`?mr.flushSync(c):c(),M.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),re=J.useCallback(e=>{let t=Q(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),ie=J.useCallback(()=>{x.setOpen(!1,re(Ro))},[x,re]);J.useImperativeHandle(u,()=>({unmount:ee,close:ie}),[ee,ie]);let ae;M.type===`context-menu`&&(ae=M.context),J.useImperativeHandle(ae?.positionerRef,()=>D,[D]),J.useImperativeHandle(ae?.actionsRef,()=>({setOpen:ne}),[ne]);let oe=Ku({popupStore:x,onOpenChange:ne});R=oe.context.events,J.useEffect(()=>{let e=({open:e,eventDetails:t})=>ne(e,t);return R.on(`setOpen`,e),()=>{R?.off(`setOpen`,e)}},[R,ne]);let se=nu(oe,{enabled:!A,bubbles:d&&M.type===`menu`,outsidePress(){return M.type!==`context-menu`||I.current?.type===`contextmenu`||H.current},externalTree:L?S:void 0}),ce=gd(oe,{role:`menu`}),le=eo(),ue=J.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),de=md(oe,{enabled:!A,listRef:x.context.itemDomElements,activeIndex:N,nested:M.type!==void 0,loopFocus:c,orientation:l,parentOrientation:M.type===`menubar`?M.context.orientation:void 0,rtl:le===`rtl`,disabledIndices:on,onNavigate:ue,openOnArrowKeyDown:M.type!==`context-menu`,externalTree:L?S:void 0,focusItemOnHover:h}),fe=J.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:pe,getFloatingProps:me,getItemProps:G,getTriggerProps:he}=ad([se,ce,de,_d(oe,{listRef:x.context.itemLabels,activeIndex:N,resetMs:500,onMatch:e=>{T&&e!==N&&x.set(`activeIndex`,e)},onTypingChange:fe})]),ge=J.useMemo(()=>{let e=Pa(pe(),{onMouseEnter(){x.set(`hoverEnabled`,!0)},onMouseMove(){x.set(`allowMouseEnter`,!0)}},B);return delete e.role,e},[pe,x,B]),_e=J.useMemo(()=>{let e=he();if(!e)return e;let{role:t,"aria-controls":n,...r}=e;return r},[he]),ve=ps(),ye=J.useMemo(()=>me({onMouseEnter(){M.type===`menu`&&ve.request(()=>x.set(`hoverEnabled`,!1))},onMouseMove(){x.set(`allowMouseEnter`,!0)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[me,M.type,ve,x]),be=J.useMemo(()=>G(),[G]);x.useSyncedValues({floatingRootContext:oe,activeTriggerProps:ge,inactiveTriggerProps:_e,popupProps:ye,itemProps:be});let xe=J.useMemo(()=>({store:x,parent:b}),[x,b]),Se=(0,q.jsx)(ws.Provider,{value:xe,children:typeof t==`function`?t({payload:P}):t});return M.type===void 0||M.type===`context-menu`?(0,q.jsx)(cc,{externalTree:S,children:Se}):Se}function of(e){let{closeParentOnEsc:t=!1}=e,n=Ts().store,r=J.useMemo(()=>({parentMenu:n}),[n]);return(0,q.jsx)(nf.Provider,{value:r,children:(0,q.jsx)(af,{...e,closeParentOnEsc:t})})}function sf(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}function cf(e){if(bn(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Mn(e))return cf(Fn(e))}function lf(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,mc(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:sn,[t,n,r])}var uf=2,df=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,...f}=e,p=Ts(!0),m=u?.store??p?.store;if(!m)throw Error(Cr(85));let h=pn(o),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=J.useRef(null),b=pf(),x=Ta(!0),S=ac(),C=J.useMemo(()=>S??new tc,[S]),{registerTrigger:w,isMountedByThisTrigger:T}=Lu(h,y,m,{payload:d,closeDelay:l,parent:b,floatingTreeRoot:C,floatingNodeId:oc(C),floatingParentNodeId:ic(),keyboardEventRelay:x?.relayKeyboardEvent}),E=m.useState(`disabled`),D=i||E||b.type===`menubar`&&b.context.disabled,{getButtonProps:O,buttonRef:k}=Jo({disabled:D,native:a});J.useEffect(()=>{!v&&b.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,v,b.type]);let A=J.useRef(null),j=$s(),M=Y(e=>{if(!A.current)return;j.clear(),m.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(ar(A.current,t)||ar(m.select(`positionerElement`),t)||t===A.current||t!=null&&cf(t)===m.select(`rootId`))return;let n=sf(A.current);e.clientX>=n.left-uf&&e.clientX<=n.right+uf&&e.clientY>=n.top-uf&&e.clientY<=n.bottom+uf||C.events.emit(`close`,{domEvent:e,reason:Fo})});J.useEffect(()=>{v&&m.select(`lastOpenChangeReason`)===`trigger-hover`&&mc(A.current).addEventListener(`mouseup`,M,{once:!0})},[v,M,m]);let N=b.type===`menubar`&&b.context.hasSubmenuOpen,P=id(_,{enabled:(s??N??!1)&&!D&&b.type!==`context-menu`&&(b.type!==`menubar`||N&&!T),handleClose:bd({blockPointerEvents:b.type!==`menubar`}),mouseOnly:!0,move:!1,restMs:b.type===void 0?c:void 0,delay:{close:l},triggerElementRef:y,externalTree:C,isActiveTrigger:g}),F=ff(v,m.select(`lastOpenChangeReason`)),I=Hc(_,{enabled:!D&&b.type!==`context-menu`,event:v&&b.type===`menubar`?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0&&F}),L=Ju(_,{enabled:!D&&(b.type!==`menubar`&&v||N)}),R=lf({open:v,enabled:b.type===`menubar`,mouseDownAction:`open`}),z=ad([I,L]),B=b.type===`menubar`,V=J.useMemo(()=>({disabled:D,open:v}),[D,v]),ee=m.useState(`triggerProps`,T),H=[A,t,k,w,y],U=[z.getReferenceProps(),P??sn,ee,{"aria-haspopup":`menu`,id:h,onMouseDown:e=>{m.select(`open`)||(j.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),mc(e.currentTarget).addEventListener(`mouseup`,M,{once:!0}))}},B?{role:`menuitem`}:{},R,f,O],W=J.useRef(null),te=Y(e=>{mr.flushSync(()=>{m.setOpen(!1,Q(Ao,e.nativeEvent,e.currentTarget))}),Wi(W.current)?.focus()}),ne=Y(e=>{let t=m.select(`positionerElement`);if(t&&Gi(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{mr.flushSync(()=>{m.setOpen(!1,Q(Ao,e.nativeEvent,e.currentTarget))});let n=Ui(y.current);for(;n!==null&&ar(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=Bi(n),n===e)break}n?.focus()}}),re=Z(`button`,e,{enabled:!B,stateAttributesMapping:Ps,state:V,ref:H,props:U});return B?(0,q.jsx)($o,{tag:`button`,render:n,className:r,state:V,refs:H,props:U,stateAttributesMapping:Ps}):v?(0,q.jsxs)(J.Fragment,{children:[(0,q.jsx)(hc,{ref:W,onFocus:te},`${h}-pre-focus-guard`),(0,q.jsx)(J.Fragment,{children:re},h),(0,q.jsx)(hc,{ref:m.context.triggerFocusTargetRef,onFocus:ne},`${h}-post-focus-guard`)]}):(0,q.jsx)(J.Fragment,{children:re},h)});function ff(e,t){let n=$s(),[r,i]=J.useState(!1);return X(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function pf(){let e=Ls(!0),t=Ts(!0),n=Xd(!0);return J.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var mf=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return Z(`div`,e,{state:J.useMemo(()=>({orientation:i}),[i]),ref:t,props:[{role:`separator`,"aria-orientation":i},a]})}),hf=J.forwardRef(function(e,t){let{render:n,className:r,label:i,id:a,nativeButton:o=!1,openOnHover:s=!0,delay:c=100,closeDelay:l=0,disabled:u=!1,...d}=e,f=Zo(),p=Cs(),{store:m}=Ts(),h=pn(a),g=m.useState(`open`),_=m.useState(`floatingRootContext`),v=m.useState(`floatingTreeRoot`),y=Iu(h,m),b=J.useCallback(e=>{let t=y(e);return e!==null&&m.select(`open`)&&m.select(`activeTriggerId`)==null&&m.update({activeTriggerId:h,activeTriggerElement:e,closeDelay:l}),t},[y,l,m,h]),x=J.useRef(null),S=J.useCallback(e=>{x.current=e,m.set(`activeTriggerElement`,e)},[m]),C=rf();if(!C?.parentMenu)throw Error(Cr(37));m.useSyncedValue(`closeDelay`,l);let w=C.parentMenu,T=w.useState(`itemProps`),E=w.useState(`isActive`,f.index),D=J.useMemo(()=>({type:`submenu-trigger`,setActive:()=>w.set(`activeIndex`,f.index)}),[w,f.index]),O=m.useState(`disabled`),k=u||O,{getItemProps:A,itemRef:j}=Vs({closeOnClick:!1,disabled:k,highlighted:E,id:h,store:m,nativeButton:o,itemMetadata:D,nodeId:p?.nodeId}),M=m.useState(`hoverEnabled`),N=m.useState(`allowMouseEnter`),P=id(_,{enabled:M&&s&&!k,handleClose:bd({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:N?c:void 0,delay:{open:N?c:10**10,close:l},triggerElementRef:x,externalTree:v}),F=ad([Hc(_,{enabled:!k,event:`mousedown`,toggle:!s,ignoreMouse:s,stickIfOpen:!1})]),I=m.useState(`triggerProps`,!0);return delete I.id,Z(`div`,e,{state:J.useMemo(()=>({disabled:k,highlighted:E,open:g}),[k,E,g]),stateAttributesMapping:Ns,props:[F.getReferenceProps(),P,I,T,{tabIndex:g||E?0:-1,onBlur(){E&&w.set(`activeIndex`,null)}},d,A],ref:[t,f.ref,j,b,S]})}),gf=J.createContext(void 0);function _f(){let e=J.useContext(gf);if(e===void 0)throw Error(Cr(53));return e}var vf=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});function yf(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=n===`x`?`Inline`:`Block`;return n===`x`&&t===`margin`?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}var bf=function(e){return e.orientation=`data-orientation`,e.hovering=`data-hovering`,e.scrolling=`data-scrolling`,e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),xf=`base-ui-disable-scrollbar`,Sf={className:xf,element:(0,q.jsx)(`style`,{href:xf,precedence:`base-ui:low`,children:`.${xf}{scrollbar-width:none}.${xf}::-webkit-scrollbar{display:none}`})},Cf=function(e){return e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),wf={hasOverflowX:e=>e?{[Cf.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[Cf.hasOverflowY]:``}:null,overflowXStart:e=>e?{[Cf.overflowXStart]:``}:null,overflowXEnd:e=>e?{[Cf.overflowXEnd]:``}:null,overflowYStart:e=>e?{[Cf.overflowYStart]:``}:null,overflowYEnd:e=>e?{[Cf.overflowYEnd]:``}:null,cornerHidden:()=>null},Tf={width:0,height:0},Ef={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Df=J.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,...a}=e,[o,s]=J.useState(!1),[c,l]=J.useState(!1),[u,d]=J.useState(!1),[f,p]=J.useState(Tf),[m,h]=J.useState(Tf),[g,_]=J.useState(!1),[v,y]=J.useState(Ef),b=pn(),x=J.useRef(null),S=J.useRef(null),C=J.useRef(null),w=J.useRef(null),T=J.useRef(null),E=J.useRef(null),D=J.useRef(null),O=J.useRef(!1),k=J.useRef(0),A=J.useRef(0),j=J.useRef(0),M=J.useRef(0),N=J.useRef(`vertical`),P=$s(),F=$s(),I=J.useRef({x:0,y:0}),[L,R]=J.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),z=Of(i),B=Y(e=>{let t=e.x-I.current.x,n=e.y-I.current.y;I.current=e,n!==0&&(d(!0),P.start(500,()=>{d(!1)})),t!==0&&(l(!0),F.start(500,()=>{l(!1)}))}),V=Y(e=>{e.button===0&&(O.current=!0,k.current=e.clientY,A.current=e.clientX,N.current=e.currentTarget.getAttribute(bf.orientation),S.current&&(j.current=S.current.scrollTop,M.current=S.current.scrollLeft),T.current&&N.current===`vertical`&&T.current.setPointerCapture(e.pointerId),E.current&&N.current===`horizontal`&&E.current.setPointerCapture(e.pointerId))}),ee=Y(e=>{if(!O.current)return;let t=e.clientY-k.current,n=e.clientX-A.current;if(S.current){let r=S.current.scrollHeight,i=S.current.clientHeight,a=S.current.scrollWidth,o=S.current.clientWidth;if(T.current&&C.current&&N.current===`vertical`){let n=yf(C.current,`padding`,`y`),a=yf(T.current,`margin`,`y`),o=T.current.offsetHeight,s=t/(C.current.offsetHeight-o-n-a);S.current.scrollTop=j.current+s*(r-i),e.preventDefault(),d(!0),P.start(500,()=>{d(!1)})}if(E.current&&w.current&&N.current===`horizontal`){let t=yf(w.current,`padding`,`x`),r=yf(E.current,`margin`,`x`),i=E.current.offsetWidth,s=n/(w.current.offsetWidth-i-t-r);S.current.scrollLeft=M.current+s*(a-o),e.preventDefault(),l(!0),F.start(500,()=>{l(!1)})}}}),H=Y(e=>{O.current=!1,T.current&&N.current===`vertical`&&T.current.releasePointerCapture(e.pointerId),E.current&&N.current===`horizontal`&&E.current.releasePointerCapture(e.pointerId)});function U(e){let t=e.pointerType===`touch`;if(_(t),!t){let t=ar(x.current,e.target);s(t)}}let W=J.useMemo(()=>({hasOverflowX:!L.scrollbarXHidden,hasOverflowY:!L.scrollbarYHidden,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:L.cornerHidden}),[L.scrollbarXHidden,L.scrollbarYHidden,L.cornerHidden,v]),te={role:`presentation`,onPointerEnter:U,onPointerMove:U,onPointerDown({pointerType:e}){_(e===`touch`)},onPointerLeave(){s(!1)},style:{position:`relative`,[vf.scrollAreaCornerHeight]:`${f.height}px`,[vf.scrollAreaCornerWidth]:`${f.width}px`}},ne=Z(`div`,e,{state:W,ref:[t,x],props:[te,a],stateAttributesMapping:wf}),re=J.useMemo(()=>({handlePointerDown:V,handlePointerMove:ee,handlePointerUp:H,handleScroll:B,cornerSize:f,setCornerSize:p,thumbSize:m,setThumbSize:h,touchModality:g,cornerRef:D,scrollingX:c,setScrollingX:l,scrollingY:u,setScrollingY:d,hovering:o,setHovering:s,viewportRef:S,rootRef:x,scrollbarYRef:C,scrollbarXRef:w,thumbYRef:T,thumbXRef:E,rootId:b,hiddenState:L,setHiddenState:R,overflowEdges:v,setOverflowEdges:y,viewportState:W,overflowEdgeThreshold:z}),[V,ee,H,B,f,m,g,D,c,l,u,d,o,s,S,x,C,w,T,E,b,L,v,W,z]);return(0,q.jsxs)(gf.Provider,{value:re,children:[Sf.element,ne]})});function Of(e){if(typeof e==`number`){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}var kf=J.createContext(void 0);function Af(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function jf(e,t){if(typeof IntersectionObserver>`u`)return()=>{};let n=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}var Mf=function(e){return e.scrollAreaOverflowXStart=`--scroll-area-overflow-x-start`,e.scrollAreaOverflowXEnd=`--scroll-area-overflow-x-end`,e.scrollAreaOverflowYStart=`--scroll-area-overflow-y-start`,e.scrollAreaOverflowYEnd=`--scroll-area-overflow-y-end`,e}({}),Nf=!1;function Pf(){Nf||Un||(typeof CSS<`u`&&`registerProperty`in CSS&&[Mf.scrollAreaOverflowXStart,Mf.scrollAreaOverflowXEnd,Mf.scrollAreaOverflowYStart,Mf.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),Nf=!0)}var Ff=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{viewportRef:a,scrollbarYRef:o,scrollbarXRef:s,thumbYRef:c,thumbXRef:l,cornerRef:u,setCornerSize:d,setThumbSize:f,rootId:p,setHiddenState:m,hiddenState:h,handleScroll:g,setHovering:_,setOverflowEdges:v,overflowEdges:y,overflowEdgeThreshold:b}=_f(),x=eo(),S=J.useRef(!0),C=$s(),w=$s();function T(){let e=a.current,t=o.current,n=s.current,r=c.current,i=l.current,p=u.current;if(!e)return;let h=e.scrollHeight,g=e.scrollWidth,_=e.clientHeight,y=e.clientWidth,S=e.scrollTop,C=e.scrollLeft;if(h===0||g===0)return;let w=_>=h,T=y>=g,E=y/g,D=_/h,O=Math.max(0,g-y),k=Math.max(0,h-_),A=0,j=0;T||(A=Af(x===`rtl`?-C:C,0,O),j=O-A);let M=w?0:Af(S,0,k),N=w?0:k-M,P=T?0:y,F=w?0:_,I=yf(n,`padding`,`x`),L=yf(t,`padding`,`y`),R=yf(i,`margin`,`x`),z=yf(r,`margin`,`y`),B=P-I-R,V=F-L-z,ee=n?Math.min(n.offsetWidth,B):B,H=t?Math.min(t.offsetHeight,V):V,U=Math.max(16,ee*E),W=Math.max(16,H*D);if(f(e=>e.height===W&&e.width===U?e:{width:U,height:W}),t&&r){let e=t.offsetHeight-W-L-z,n=h-_,i=n===0?0:S/n,a=Math.min(e,Math.max(0,i*e));r.style.transform=`translate3d(0,${a}px,0)`}if(n&&i){let e=n.offsetWidth-U-I-R,t=g-y,r=t===0?0:C/t,a=x===`rtl`?Af(r*e,-e,0):Af(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let te=Af(A,0,O),ne=Af(j,0,O),re=Af(M,0,k),ie=Af(N,0,k),ae=[[Mf.scrollAreaOverflowXStart,te],[Mf.scrollAreaOverflowXEnd,ne],[Mf.scrollAreaOverflowYStart,re],[Mf.scrollAreaOverflowYEnd,ie]];for(let[t,n]of ae)e.style.setProperty(t,`${n}px`);if(p){if(T||w)d({width:0,height:0});else if(!T&&!w){let e=t?.offsetWidth||0,r=n?.offsetHeight||0;d({width:e,height:r})}}m(e=>{let t=w||T;return e.scrollbarYHidden===w&&e.scrollbarXHidden===T&&e.cornerHidden===t?e:{scrollbarYHidden:w,scrollbarXHidden:T,cornerHidden:t}});let oe={xStart:!T&&te>b.xStart,xEnd:!T&&ne>b.xEnd,yStart:!w&&re>b.yStart,yEnd:!w&&ie>b.yEnd};v(e=>e.xStart===oe.xStart&&e.xEnd===oe.xEnd&&e.yStart===oe.yStart&&e.yEnd===oe.yEnd?e:oe)}let E=Y(()=>{mr.flushSync(T)});X(()=>{if(a.current)return Pf(),jf(a.current,E)},[E,a]),X(()=>{queueMicrotask(E)},[E,h,x]),X(()=>{a.current?.matches(`:hover`)&&_(!0)},[a,_]),J.useEffect(()=>{let e=a.current;if(typeof ResizeObserver>`u`||!e)return;let t=new ResizeObserver(E);return t.observe(e),w.start(0,()=>{Promise.all(e.getAnimations({subtree:!0}).map(e=>e.finished)).then(E).catch(()=>{})}),()=>{t.disconnect(),w.clear()}},[E,a,w]);function D(){S.current=!1}let O={role:`presentation`,...p&&{"data-id":`${p}-viewport`},...(!h.scrollbarXHidden||!h.scrollbarYHidden)&&{tabIndex:0},className:Sf.className,style:{overflow:`scroll`},onScroll(){a.current&&(E(),S.current||g({x:a.current.scrollLeft,y:a.current.scrollTop}),C.start(100,()=>{S.current=!0}))},onWheel:D,onTouchMove:D,onPointerMove:D,onPointerEnter:D,onKeyDown:D},k=J.useMemo(()=>({hasOverflowX:!h.scrollbarXHidden,hasOverflowY:!h.scrollbarYHidden,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.cornerHidden}),[h.scrollbarXHidden,h.scrollbarYHidden,h.cornerHidden,y]),A=Z(`div`,e,{ref:[t,a],state:k,props:[O,i],stateAttributesMapping:wf}),j=J.useMemo(()=>({computeThumbPosition:E}),[E]);return(0,q.jsx)(kf.Provider,{value:j,children:A})}),If=J.createContext(void 0);function Lf(){let e=J.useContext(If);if(e===void 0)throw Error(Cr(54));return e}var Rf=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({}),zf=J.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,...o}=e,{hovering:s,scrollingX:c,scrollingY:l,hiddenState:u,overflowEdges:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,rootId:y,thumbSize:b}=_f(),x=J.useMemo(()=>({hovering:s,scrolling:{horizontal:c,vertical:l}[i],orientation:i,hasOverflowX:!u.scrollbarXHidden,hasOverflowY:!u.scrollbarYHidden,overflowXStart:d.xStart,overflowXEnd:d.xEnd,overflowYStart:d.yStart,overflowYEnd:d.yEnd,cornerHidden:u.cornerHidden}),[s,c,l,i,u,d]),S=eo();J.useEffect(()=>{let e=m.current,t=i===`vertical`?f.current:p.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),i===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(i===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;i===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[i,p,f,m]);let C={...y&&{"data-id":`${y}-scrollbar`},onPointerDown(e){if(e.button===0&&e.currentTarget===e.target&&m.current){if(h.current&&f.current&&i===`vertical`){let t=yf(h.current,`margin`,`y`),n=yf(f.current,`padding`,`y`),r=h.current.offsetHeight,i=f.current.getBoundingClientRect(),a=e.clientY-i.top-r/2-n+t/2,o=m.current.scrollHeight,s=m.current.clientHeight,c=a/(f.current.offsetHeight-r-n-t)*(o-s);m.current.scrollTop=c}if(g.current&&p.current&&i===`horizontal`){let t=yf(g.current,`margin`,`x`),n=yf(p.current,`padding`,`x`),r=g.current.offsetWidth,i=p.current.getBoundingClientRect(),a=e.clientX-i.left-r/2-n+t/2,o=m.current.scrollWidth,s=m.current.clientWidth,c=a/(p.current.offsetWidth-r-n-t),l;S===`rtl`?(l=(1-c)*(o-s),m.current.scrollLeft<=0&&(l=-l)):l=c*(o-s),m.current.scrollLeft=l}_(e)}},onPointerUp:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,...i===`vertical`&&{top:0,bottom:`var(${vf.scrollAreaCornerHeight})`,insetInlineEnd:0,[Rf.scrollAreaThumbHeight]:`${b.height}px`},...i===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${vf.scrollAreaCornerWidth})`,bottom:0,[Rf.scrollAreaThumbWidth]:`${b.width}px`}}},w=Z(`div`,e,{ref:[t,i===`vertical`?f:p],state:x,props:[C,o],stateAttributesMapping:wf}),T=J.useMemo(()=>({orientation:i}),[i]),E=i===`vertical`?u.scrollbarYHidden:u.scrollbarXHidden;return a||!E?(0,q.jsx)(If.Provider,{value:T,children:w}):null}),Bf=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{thumbYRef:a,thumbXRef:o,handlePointerDown:s,handlePointerMove:c,handlePointerUp:l,setScrollingX:u,setScrollingY:d}=_f(),{orientation:f}=Lf(),p=J.useMemo(()=>({orientation:f}),[f]);return Z(`div`,e,{ref:[t,f===`vertical`?a:o],state:p,props:[{onPointerDown:s,onPointerMove:c,onPointerUp(e){f===`vertical`&&d(!1),f===`horizontal`&&u(!1),l(e)},style:{...f===`vertical`&&{height:`var(${Rf.scrollAreaThumbHeight})`},...f===`horizontal`&&{width:`var(${Rf.scrollAreaThumbWidth})`}}},i]})}),Vf=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:o,hiddenState:s}=_f(),c=Z(`div`,e,{ref:[t,a],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},i]});return s.cornerHidden?null:c});function Hf({className:e,children:t,viewportClassName:n,...r}){return(0,q.jsxs)(Df,{"data-slot":`scroll-area`,className:K(`relative`,e),...r,children:[(0,q.jsx)(Ff,{"data-slot":`scroll-area-viewport`,className:K(`w-full rounded-[inherit] outline-none`,n??`h-full`),children:t}),(0,q.jsx)(Uf,{}),(0,q.jsx)(Vf,{})]})}function Uf({className:e,...t}){return(0,q.jsx)(zf,{"data-slot":`scroll-area-scrollbar`,orientation:`vertical`,className:K(`flex h-full w-2.5 touch-none select-none border-l border-l-transparent p-px`,e),...t,children:(0,q.jsx)(Bf,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground/70`})})}var Wf=`min-w-[13rem] rounded-md border border-[var(--color-border)] bg-[var(--color-card)] text-[var(--color-card-foreground)] shadow-md outline-none`;function Gf({children:e}){return(0,q.jsx)(Hf,{viewportClassName:`max-h-[var(--available-height)]`,children:(0,q.jsx)(`div`,{className:`p-1`,children:e})})}var Kf=`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-[var(--color-accent)] data-[highlighted]:text-[var(--color-accent-foreground)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,qf=af,Jf=Js,Yf=of,Xf=`data-[popup-open]:bg-[var(--color-accent)] data-[popup-open]:text-[var(--color-accent-foreground)]`;function Zf({className:e,...t}){return(0,q.jsx)(df,{className:typeof e==`function`?e:K(Xf,e),...t})}function Qf({className:e,sideOffset:t=6,align:n=`start`,children:r,...i}){return(0,q.jsx)(Od,{children:(0,q.jsx)(Bd,{sideOffset:t,align:n,className:`z-50 outline-none`,children:(0,q.jsx)(Td,{className:K(Wf,e),...i,children:(0,q.jsx)(Gf,{children:r})})})})}function $f({className:e,...t}){return(0,q.jsx)(Xs,{className:K(Kf,e),...t})}function ep({className:e,children:t,closeOnClick:n=!1,...r}){return(0,q.jsxs)(Ws,{className:K(Kf,e),closeOnClick:n,...r,children:[(0,q.jsx)(`span`,{className:`mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:(0,q.jsx)(Gs,{children:(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`})})}),t]})}function tp({className:e,children:t,...n}){return(0,q.jsxs)(hf,{className:K(Kf,`data-[popup-open]:bg-[var(--color-accent)]`,e),...n,children:[t,(0,q.jsx)(Tt,{className:`ml-auto h-3.5 w-3.5 shrink-0 opacity-70`})]})}function np({className:e,children:t,...n}){return(0,q.jsx)(Od,{children:(0,q.jsx)(Bd,{side:`right`,align:`start`,sideOffset:2,className:`z-50 outline-none`,children:(0,q.jsx)(Td,{className:K(Wf,e),...n,children:(0,q.jsx)(Gf,{children:t})})})})}function rp({className:e,...t}){return(0,q.jsx)(mf,{className:K(`-mx-1 my-1 h-px bg-[var(--color-border)]`,e),...t})}function ip({className:e,...t}){return(0,q.jsx)(Ys,{className:K(`px-2 py-1.5 text-xs font-semibold text-[var(--color-muted-foreground)]`,e),...t})}var ap=J.createContext(void 0);function op(e){let t=J.useContext(ap);if(t===void 0&&!e)throw Error(Cr(72));return t}var sp={...Uu,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeDelay:$(e=>e.closeDelay)},cp=class e extends Nu{constructor(e){super({...lp(),...e},{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Bu},sp)}setOpen=(e,t)=>{let n=t.reason,r=n===Co,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;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?mr.flushSync(o):o()};static useStore(t,n){let r=Kt(()=>t??new e(n)).current,i=Ku({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function lp(){return{...Hu(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function up(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=cp.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;X(()=>{m&&t&&p.setOpen(!1,Q(Lo))},[m,t,p]),p.useSyncedValue(`disabled`,t),Ru(p);let{forceUnmount:v,transitionStatus:y}=zu(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=J.useRef(null);X(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),X(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=J.useCallback(()=>{p.setOpen(!1,dp(p,Ro))},[p]);J.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=ad([Ju(T,{enabled:!t}),nu(T,{enabled:!t,referencePress:!0}),Gc(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=J.useMemo(()=>E(),[E]),A=J.useMemo(()=>O(),[O]),j=J.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,q.jsx)(ap.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function dp(e,t){let n=Q(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var fp=J.createContext(void 0);function pp(){return J.useContext(fp)}var mp=J.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=op(!0),f=i?.store??d;if(!f)throw Error(Cr(82));let p=pn(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=J.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=Lu(p,_,f,{payload:a,closeDelay:y}),S=pp(),{delayRef:C,isInstantPhase:w,hasProvider:T}=pc(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),k=f.useState(`disableHoverablePopup`),A=id(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!k&&O!==`both`?bd():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),j=J.useMemo(()=>({open:g}),[g]),M=f.useState(`triggerProps`,x);return Z(`button`,e,{state:j,ref:[t,b,_],props:[A,M,{id:p},u],stateAttributesMapping:Ns})}),hp=J.createContext(void 0);function gp(){let e=J.useContext(hp);if(e===void 0)throw Error(Cr(70));return e}var _p=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Ac({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,q.jsxs)(J.Fragment,{children:[c,s&&mr.createPortal(n,s)]})}),vp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return op().useState(`mounted`)||n?(0,q.jsx)(hp.Provider,{value:n,children:(0,q.jsx)(_p,{ref:t,...r})}):null}),yp=J.createContext(void 0);function bp(){let e=J.useContext(yp);if(e===void 0)throw Error(Cr(71));return e}var xp=J.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=Ja,...g}=e,_=op(),v=gp(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=Ld({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:Pd}),D=J.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=J.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),k=J.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),A=Z(`div`,e,{state:O,props:[D,Cd(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:Fs});return(0,q.jsx)(yp.Provider,{value:k,children:A})});function Sp(e){let t=Nn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bn(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Dr(n)!==a||Dr(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Cp=typeof ResizeObserver<`u`,wp=()=>!0;function Tp(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=wp,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=J.useRef(!0),d=hs(t,!0,!1),f=ps(),p=J.useRef(null),m=Y(o),h=Y(s),g=J.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:sn},[c,l]);X(()=>{if(!i||!a()||!Cp){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=Ep(t,`position`,`static`),o=Ep(t,`transform`,`none`),s=Ep(t,`scale`,`1`),c=Ep(n,`--available-width`,`max-content`),l=Ep(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=Sp(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=Sp(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function Ep(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var Dp={...Fs,...Wo},Op=J.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=op(),{side:o,align:s}=bp(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=eo();gs({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}Tp({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return ed(g,{enabled:!b,closeDelay:x}),Z(`div`,e,{state:J.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,Cd(d),i],stateAttributesMapping:Dp})}),kp=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=J.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=J.useMemo(()=>({open:t,close:n}),[t,n]);return(0,q.jsx)(fp.Provider,{value:i,children:(0,q.jsx)(fc,{delay:a,timeoutMs:r,children:e.children})})},Ap=up;function jp(e){return(0,q.jsx)(mp,{delay:0,...e})}function Mp({className:e,sideOffset:t=6,side:n,align:r,children:i,...a}){return(0,q.jsx)(vp,{children:(0,q.jsx)(xp,{className:`z-50`,sideOffset:t,...n?{side:n}:{},...r?{align:r}:{},children:(0,q.jsx)(Op,{role:`tooltip`,className:K(`rounded-md border border-border bg-card px-2 py-1 text-xs text-card-foreground shadow-md`,e),...a,children:i})})})}function Np({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(mf,{orientation:t,"data-slot":`separator`,className:K(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}function Pp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-md bg-accent`,e),...t})}var Fp=J.createContext(void 0);function Ip(e){let t=J.useContext(Fp);if(e===!1&&t===void 0)throw Error(Cr(27));return t}var Lp={...Fs,...Wo},Rp=J.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=Ip(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return Z(`div`,e,{state:J.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:Lp,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),zp=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=Ip(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Q(Do,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=Jo({disabled:i,native:a});return Z(`button`,e,{state:J.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),Bp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Ip(),s=pn(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Z(`p`,e,{ref:t,props:[{id:s},a]})}),Vp=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Hp=function(e){return e[e.open=Es.open]=`open`,e[e.closed=Es.closed]=`closed`,e[e.startingStyle=Es.startingStyle]=`startingStyle`,e[e.endingStyle=Es.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Up=J.createContext(void 0);function Wp(){let e=J.useContext(Up);if(e===void 0)throw Error(Cr(26));return e}var Gp={...Fs,...Wo,nestedDialogOpen(e){return e?{[Hp.nestedDialogOpen]:``}:null}},Kp=J.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=Ip(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);Wp(),gs({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e!==`touch`||s.context.popupRef.current}let S=i===void 0?x:i,C=h>0,w=Z(`div`,e,{state:J.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){aa.has(e.key)&&e.stopPropagation()},style:{[Vp.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:Gp});return(0,q.jsx)(Vc,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),qp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Ip(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,q.jsx)(Up.Provider,{value:n,children:(0,q.jsxs)(jc,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(zd,{ref:i.context.internalBackdropRef,inert:kd(!open)}),e.children]})}):null});function Jp(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=Qd(i);Ru(t);let{forceUnmount:d}=zu(i,t,()=>{u()}),f=Y(e=>{let n=Q(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=J.useCallback(()=>{t.setOpen(!1,f(Ro))},[t,f]);J.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Ku({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=J.useState(0),_=h===0,v=gd(m),y=nu(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=or(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||ar(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});Jd(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=ad([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),J.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=J.useMemo(()=>b(l),[b,l]),w=J.useMemo(()=>S(l),[S,l]),T=J.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var Yp={...Uu,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},Xp=class extends Nu{constructor(e){super(Zp(e),{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),triggerElements:new Bu,onOpenChange:void 0,onOpenChangeComplete:void 0},Yp)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function Zp(e={}){return{...Hu(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function Qp(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=Ip(!0),p=!!f,m=Kt(()=>l?.store??new Xp({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);Jp({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=J.useMemo(()=>({store:m}),[m]);return(0,q.jsx)(Fp.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var $p=J.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Ip(),s=pn(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),Z(`h2`,e,{ref:t,props:[{id:s},a]})}),em=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,...l}=e,u=Ip(!0),d=c?.store??u?.store;if(!d)throw Error(Cr(79));let f=pn(o),p=d.useState(`floatingRootContext`),m=d.useState(`isOpenedByTrigger`,f),h=J.useRef(null),{registerTrigger:g,isMountedByThisTrigger:_}=Lu(f,h,d,{payload:s}),{getButtonProps:v,buttonRef:y}=Jo({disabled:i,native:a}),b=ad([Hc(p,{enabled:p!=null})]),x=J.useMemo(()=>({disabled:i,open:m}),[i,m]),S=d.useState(`triggerProps`,_);return Z(`button`,e,{state:x,ref:[y,t,g,h],props:[b.getReferenceProps(),S,{[Ka]:``,id:f},l,v],stateAttributesMapping:Ns})}),tm=new Map,nm=500;function rm(e,t){tm.delete(e),tm.set(e,t),tm.size>nm&&tm.delete(tm.keys().next().value)}function im(e){e===void 0?tm.clear():tm.delete(e)}var am=new Set;function om(e,t){tm.has(e)||am.has(e)||(am.add(e),t().then(t=>{tm.has(e)||rm(e,t)}).catch(()=>{}).finally(()=>am.delete(e)))}function sm(e,t,n,r,i){let a=e&&typeof i==`object`?i.remember:void 0,[o,s]=(0,J.useState)(()=>a!==void 0&&tm.has(a)?tm.get(a):t),[c,l]=(0,J.useState)(()=>a!==void 0&&tm.has(a)),u=(0,J.useRef)(t),d=(0,J.useRef)({live:!1}),f=(0,J.useRef)(r),p=(0,J.useCallback)((e,t)=>t().then(t=>{e.live&&(e.key!==void 0&&rm(e.key,t),s(t),l(!0))}).catch(()=>{}),[]);(0,J.useEffect)(()=>{let t=e&&typeof i==`object`?i.remember:void 0,a={live:!0,...t===void 0?{}:{key:t}};if(d.current=a,t!==void 0&&tm.has(t)?(s(tm.get(t)),l(!0)):(i!==`previous`&&s(u.current),l(!1)),f.current=r,!e)return()=>void(a.live=!1);let o=()=>void p(a,e);if(o(),n===null)return()=>void(a.live=!1);let c=setInterval(o,n);return()=>{a.live=!1,clearInterval(c)}},r);let m=(0,J.useCallback)(()=>e?p(d.current,e):Promise.resolve(),r);if(!cm(f.current,r)){let t=e&&typeof i==`object`?i.remember:void 0;return t!==void 0&&tm.has(t)?{value:tm.get(t),reload:m,loaded:!0}:{value:i===`previous`?o:u.current,reload:m,loaded:!1}}return{value:o,reload:m,loaded:c}}function cm(e,t){return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))}function lm(e,t,n,r){return sm(e,t,null,n,r).value}function um(e,t,n,r,i){return sm(e,t,n,r,i)}function dm({label:e,description:t}){return(0,q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`leading-tight`,children:e}),t&&(0,q.jsx)(`span`,{className:`text-xs font-normal text-[var(--color-muted-foreground)]`,children:t})]})}function fm({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex min-h-16 w-full min-w-0 rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm outline-none transition-colors`,`placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}function pm({open:e,onOpenChange:t,title:n,children:r}){return(0,q.jsx)(Qp,{open:e,onOpenChange:t,children:(0,q.jsxs)(qp,{children:[(0,q.jsx)(Rp,{className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-[1px]`}),(0,q.jsxs)(Kp,{className:`fixed left-1/2 top-1/2 z-50 w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-4 text-card-foreground shadow-lg outline-none`,children:[(0,q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,q.jsx)($p,{className:`text-sm font-semibold`,children:n}),(0,q.jsx)(zp,{"aria-label":`Close`,className:`rounded p-0.5 text-muted-foreground outline-none hover:text-foreground`,children:(0,q.jsx)(Ot,{className:`h-4 w-4`,"aria-hidden":!0})})]}),r]})]})})}function mm({onClose:e,onAdded:t}){let[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=y(n),d=u!==null,f=async()=>{if(!d||o)return;s(!0),l(null);let r=await mt(n,i.trim()||void 0).catch(()=>({ok:!1,error:`The machine could not be saved.`}));if(s(!1),!r.ok)return l(r.error);t(),e()};return(0,q.jsx)(pm,{open:!0,onOpenChange:t=>{t||e()},title:`Add a machine`,children:(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),f())},children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On the other machine, open Settings, find Devices, and press Add device. Copy the link under the code and paste it here. It works once, and for a short time.`}),(0,q.jsx)(Ut,{type:`text`,value:n,placeholder:`http://studio.local:4201/…`,autoFocus:!0,onChange:e=>r(e.target.value),className:`h-8 bg-background px-2 font-mono text-xs`}),(0,q.jsx)(Ut,{type:`text`,value:i,maxLength:60,placeholder:u?`Name (optional) — defaults to ${new URL(u.url).host}`:`Name (optional)`,onChange:e=>a(e.target.value),className:`h-8 bg-background px-2`}),n.trim()!==``&&!d&&(0,q.jsx)(`p`,{className:`text-xs text-warning`,children:`That is not the link another machine gives for a new device.`}),c&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:c}),(0,q.jsxs)(`div`,{className:`mt-1 flex items-center justify-end gap-2`,children:[(0,q.jsx)(Ge,{type:`button`,variant:`ghost`,size:`sm`,onClick:e,children:`Cancel`}),(0,q.jsx)(Ge,{type:`button`,size:`sm`,disabled:!d||o,onClick:()=>void f(),children:o?`Adding…`:`Add machine`})]})]})})}var hm=`oa.pending-draft`;function gm(){try{return globalThis.sessionStorage}catch{return}}function _m(e){gm()?.setItem(hm,e)}function vm(){let e=gm();if(!e)return null;let t=e.getItem(hm);return t!==null&&e.removeItem(hm),t}var ym=w(`onModels`);function bm(){return lm(ym,void 0,[],{remember:`models`})}function xm(e){return a.map(t=>{let n=e?.[t],r=n?`error`in n?n.error:`No models listed`:`Asking ${s[t]}…`;return{value:t,label:s[t],models:(n?.models??[]).map(e=>({value:e.id,label:e.name})),modelsNote:r}})}function Sm(e,t){return(e?.models.find(e=>e.id===t)??e?.models.find(e=>e.resolvedId===t))?.name??t}function Cm(e,t){for(let n of Object.values(e??{})){let e=Sm(n,t);if(e!==t)return e}return t}function wm(e,t,n){if(!t||!n)return[];let r=e?.[t]?.models??[];return(r.find(e=>e.id===n)??r.find(e=>e.resolvedId===n))?.efforts??[]}function Tm(e,t,n){if(!t||!n)return;let r=e?.[t]?.models??[];return(r.find(e=>e.id===n)??r.find(e=>e.resolvedId===n))?.contextWindow}function Em(){return xm(bm())}function Dm({text:e,label:t,className:n}){let[r,i]=(0,J.useState)(!1),a=(0,J.useRef)(void 0);(0,J.useEffect)(()=>()=>clearTimeout(a.current),[]);let o=()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),clearTimeout(a.current),a.current=setTimeout(()=>i(!1),1500)})},s=r?Ct:Et;return(0,q.jsxs)(Ap,{children:[(0,q.jsx)(jp,{render:(0,q.jsx)(`button`,{type:`button`,onClick:o,"aria-label":t,className:K(`inline-flex shrink-0 items-center rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground`,r&&`text-success`,n)}),children:(0,q.jsx)(s,{className:`h-3 w-3`,"aria-hidden":!0})}),(0,q.jsx)(Mp,{children:r?`Copied`:t})]})}function Om({text:e,compact:t=!1}){return(0,q.jsx)(`div`,{className:t?`space-y-1.5 text-xs leading-relaxed`:`space-y-2.5 text-sm leading-5`,children:Hm(e.replace(/\r\n/g,`
|
|
19
|
+
`).split(`
|
|
20
|
+
`),t)})}function km(e){if(e.startsWith(`+`)&&!e.startsWith(`+++`))return`text-success`;if(e.startsWith(`-`)&&!e.startsWith(`---`))return`text-danger`;if(e.startsWith(`@@`))return`text-muted-foreground`}function Am(e,t,n){let r=e.join(`
|
|
21
|
+
`);return(0,q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-muted/50`,children:[(0,q.jsxs)(`div`,{className:`flex h-7 items-center justify-between gap-2 border-b border-border/70 px-2 text-[11px] text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`truncate font-mono`,children:t}),(0,q.jsx)(Dm,{text:r,label:`Copy the code`})]}),(0,q.jsx)(`pre`,{className:`overflow-x-auto p-2 text-xs`,children:(0,q.jsx)(`code`,{children:t===`diff`?e.map((t,n)=>(0,q.jsx)(`span`,{className:km(t),children:n<e.length-1?`${t}\n`:t},n)):r})})]},n)}function jm(e){let t=e.trim().split(`|`);return t[0]?.trim()===``&&t.shift(),t[t.length-1]?.trim()===``&&t.pop(),t.map(e=>e.trim())}function Mm(e){return jm(e).length>0&&jm(e).every(e=>/^:?-+:?$/.test(e))}function Nm(e){return e.replace(/^[ \t]*/,e=>e.replace(/\t/g,` `))}function Pm(e){return/^ */.exec(Nm(e))[0].length}function Fm(e,t){let n=0;for(let r=0;n<e.length;n++){let i=e[n]===` `?1:e[n]===` `?4:0;if(i===0||r+i>t)break;r+=i}return e.slice(n)}function Im(e){let t=/^[ \t]*[-*]\s+(.*)$/.exec(e);if(t)return{indent:Pm(e),ordered:!1,start:1,text:t[1]};let n=/^[ \t]*(\d{1,3})[.)]\s+(.*)$/.exec(e);return n?{indent:Pm(e),ordered:!0,start:Number(n[1]),text:n[2]}:null}function Lm(e){return/^\s*(?:([-*_])\1{2,}|([-*_])(?: \2){2,})\s*$/.test(e)}function Rm(e){return/^\s*```/.test(e)}var zm=12;function Bm(e,t){let n=Im(e[t]).indent,r=t+1,i=!1;for(let a=t+1;a<e.length;a++){let t=e[a];if(i){Rm(t)&&(i=!1),r=a+1;continue}if(!t.trim())continue;let o=Pm(t)>=n+2,s=Im(t)!==null&&!Lm(t);if(!o&&!s)break;o&&Rm(t)&&(i=!0),r=a+1}return r}function Vm(e,t,n,r){let i=[],a=Im(e[0]),o=a.ordered,s=a.start,c=[],l=null,u=[],d=1/0,f=!1,p=[],m=()=>{f&&(f=!1,p.at(-1)[1]=u.length-1)},h=()=>{if(l===null)return;m();let e=/^\[([ xX])\]\s+(.*)$/.exec(l),r=u.map(()=>d);for(let[e,t]of p){let n=t=>t>e&&!Rm(u[t]),i=d;for(let r=e;r<=t;r++)n(r)&&u[r].trim()&&(i=Math.min(i,Pm(u[r])));for(let a=e;a<=t;a++)n(a)&&(r[a]=i)}let i=u.length>0?Hm(u.map((e,t)=>Fm(e,r[t])),t,n+1):null;c.push(e?(0,q.jsxs)(`li`,{className:`list-none -ml-4 flex items-start gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e[1].toLowerCase()===`x`,readOnly:!0,className:`mt-1`}),i?(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsx)(`span`,{children:Ym(e[2])}),i]}):(0,q.jsx)(`span`,{children:Ym(e[2])})]},c.length):(0,q.jsxs)(`li`,{className:i?`space-y-1`:void 0,children:[Ym(l),i]},c.length)),l=null,u=[],d=1/0,p=[]},g=()=>{h(),c.length!==0&&(i.push(o?(0,q.jsx)(`ol`,{start:s,className:`ml-6 list-decimal space-y-1 [&>li]:pl-1`,children:c},`${r}-${i.length}`):(0,q.jsx)(`ul`,{className:`ml-6 list-disc space-y-1 [&>li]:pl-1`,children:c},`${r}-${i.length}`)),c=[])};for(let t of e){if(f){u.push(t),Rm(t)&&m();continue}let e=Im(t);e&&e.indent<a.indent+2?(e.ordered!==o&&(g(),o=e.ordered,s=e.start),h(),l=e.text):t.trim()?(u.push(t),d=Math.min(d,Pm(t)),Rm(t)&&(f=!0,p.push([u.length-1,u.length-1]))):u.length>0&&u.push(t)}return g(),i}function Hm(e,t=!1,n=0){let r=[],i=null,a=[],o=0,s=()=>{if(a.length===0)return;let e=a;if(a=[],e.length>=2&&Mm(e[1])){let t=jm(e[0]),n=e.slice(2).map(jm);r.push((0,q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,q.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsx)(`tr`,{children:t.map((e,t)=>(0,q.jsx)(`th`,{className:`border-b border-border px-2 py-1 text-left font-semibold`,children:Ym(e)},t))})}),(0,q.jsx)(`tbody`,{children:n.map((e,n)=>(0,q.jsx)(`tr`,{children:t.map((t,n)=>(0,q.jsx)(`td`,{className:`border-b border-border/50 px-2 py-1 align-top`,children:Ym(e[n]??``)},n))},n))})]})},o++))}else for(let t of e)r.push((0,q.jsx)(`p`,{children:Ym(t)},o++))};for(let c=0;c<e.length;c++){let l=e[c],u=/^\s*```\s*([\w+-]*)/.exec(l);if(u){i===null?(s(),i={lines:[],language:u[1].toLowerCase()}):(r.push(Am(i.lines,i.language,o++)),i=null);continue}if(i!==null){i.lines.push(l);continue}if(/^\s*\|.*\|\s*$/.test(l)){a.push(l);continue}s();let d=/^(#{1,6})\s+(.*)$/.exec(l);if(d){let e=d[1].length,n=t?[`text-sm`,`text-sm`,`text-xs`,`text-xs`,`text-xs`,`text-xs`]:[`text-lg`,`text-base`,`text-sm`,`text-sm`,`text-sm`,`text-sm`];r.push((0,q.jsx)(`p`,{className:`font-semibold ${n[e-1]}`,children:Ym(d[2])},o++));continue}if(Lm(l)){r.push((0,q.jsx)(`hr`,{className:`border-border`},o++));continue}if(n<zm&&/^\s*>/.test(l)){let i=c;for(;i<e.length&&/^\s*>/.test(e[i]);)i++;let a=e.slice(c,i).map(e=>e.replace(/^\s*>\s?/,``));r.push((0,q.jsx)(`blockquote`,{className:`space-y-1.5 border-l-2 border-border pl-3 text-muted-foreground`,children:Hm(a,t,n+1)},o++)),c=i-1;continue}if(n<zm&&Im(l)){let i=Bm(e,c);for(let a of Vm(e.slice(c,i),t,n,o++))r.push(a);c=i-1;continue}l.trim()&&r.push((0,q.jsx)(`p`,{children:Ym(l)},o++))}return s(),i!==null&&r.push(Am(i.lines,i.language,o++)),r}var Um=`text-primary underline underline-offset-2 break-all`,Wm=`rounded-[5px] border-[0.5px] border-foreground/10 bg-foreground/5 px-[3px] py-px text-[0.9em] text-(--code-foreground)`,Gm=`whitespace-nowrap rounded bg-primary/10 px-1.5 text-primary hover:bg-primary/15`,Km=(0,J.createContext)(void 0);function qm({number:e}){let t=(0,J.useContext)(Km);return t?(0,q.jsxs)(`a`,{href:`${t}/issues/${e}`,target:`_blank`,rel:`noreferrer`,className:Gm,children:[`#`,e]}):`#${e}`}function Jm(e,t,n){return(0,q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:Um,children:t},n)}function Ym(e){let t=[],n=/(`[^`]+`|\[[^\]]+\]\((?:https?:\/\/)?[^\s):]+\)|\*\*[^*]+\*\*|\*[^*]+\*|https?:\/\/[^\s<>)\]]+|(?<![\w/&#])#\d+\b)/g,r=0,i,a=0;for(;i=n.exec(e);){i.index>r&&t.push((0,q.jsx)(J.Fragment,{children:e.slice(r,i.index)},a++));let n=i[0];if(n.startsWith("`"))t.push((0,q.jsx)(`code`,{className:Wm,children:n.slice(1,-1)},a++));else if(n.startsWith(`[`)){let e=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(n),r=/^\[([^\]]+)\]\(([^\s):]+)\)$/.exec(n);e?t.push(Jm(e[2],e[1],a++)):r?t.push((0,q.jsx)(`code`,{title:r[2],className:Wm,children:r[1]},a++)):t.push((0,q.jsx)(J.Fragment,{children:n},a++))}else n.startsWith(`**`)?t.push((0,q.jsx)(`strong`,{children:Ym(n.slice(2,-2))},a++)):n.startsWith(`*`)?t.push((0,q.jsx)(`em`,{children:Ym(n.slice(1,-1))},a++)):n.startsWith(`#`)?t.push((0,q.jsx)(qm,{number:n.slice(1)},a++)):t.push(Jm(n,n,a++));r=i.index+n.length}return r<e.length&&t.push((0,q.jsx)(J.Fragment,{children:e.slice(r)},a++)),t}function Xm(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:o,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Ip(),d=!!u,f=Kt(()=>s?.store??new Xp({open:n??r,activeTriggerId:c===void 0?l:c,modal:!0,disablePointerDismissal:!0,nested:d,role:`alertdialog`})).current;f.useControlledProp(`open`,n,r),f.useControlledProp(`activeTriggerId`,c,l),f.useSyncedValue(`nested`,d),f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a);let p=f.useState(`payload`);Jp({store:f,actionsRef:o,parentContext:u?.store.context,onOpenChange:i,triggerIdProp:c});let m=J.useMemo(()=>({store:f}),[f]);return(0,q.jsx)(Fp.Provider,{value:m,children:typeof t==`function`?t({payload:p}):t})}function Zm({trigger:e,open:t,onOpenChange:n,title:r,body:i,confirmLabel:a,confirmBusyLabel:o=`Working…`,onConfirm:s,onSuccess:c,fallbackError:l=`Something went wrong.`,destructive:u=!0}){let[d,f]=(0,J.useState)(!1),p=t??d,m=n??f,{busy:h,error:g,run:_,reset:v}=Vt();return(0,q.jsxs)(Xm,{open:p,onOpenChange:e=>{h||(m(e),e&&v())},children:[e&&(0,q.jsx)(em,{render:e}),(0,q.jsxs)(qp,{children:[(0,q.jsx)(Rp,{className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-[1px]`}),(0,q.jsxs)(Kp,{className:`fixed left-1/2 top-1/2 z-50 w-[min(26rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-lg`,children:[(0,q.jsx)($p,{className:`text-sm font-semibold`,children:r}),(0,q.jsx)(Bp,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:i}),g&&(0,q.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:g}),(0,q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,q.jsx)(zp,{render:(0,q.jsx)(Ge,{variant:`outline`,size:`sm`,disabled:h,children:`Cancel`})}),(0,q.jsx)(Ge,{variant:u?`destructive`:`default`,size:`sm`,disabled:h,onClick:()=>{_(s,l).then(e=>{e.ok&&(m(!1),queueMicrotask(()=>c?.()))})},className:K(h&&`cursor-progress`),children:h?o:a})]})]})]})]})}var Qm=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function $m(e){return J.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[Qm.checked]:``}:{[Qm.unchecked]:``}},...so}),[e.indeterminate])}var eh=J.createContext(void 0);function th(e=!0){let t=J.useContext(eh);if(t===void 0&&!e)throw Error(Cr(3));return t}var nh=J.createContext(void 0);function rh(){let e=J.useContext(nh);if(e===void 0)throw Error(Cr(14));return e}var ih=`data-parent`,ah=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,disabled:a=!1,id:o,indeterminate:s=!1,inputRef:c,name:l,onCheckedChange:u,parent:d=!1,readOnly:f=!1,render:p,required:m=!1,uncheckedValue:h,value:g,nativeButton:_=!1,...v}=e,{clearErrors:y}=io(),{disabled:b,name:x,setDirty:S,setFilled:C,setFocused:w,setTouched:T,state:E,validationMode:D,validityData:O,shouldValidateOnChange:k,validation:A}=lo(),j=ts(),{labelId:M,controlId:N,setControlId:P,getDescriptionProps:F}=ho(),I=th(),L=I?.parent,R=L&&I.allValues,z=b||j.disabled||I?.disabled||a,B=x??l,V=g??B,ee=pn(),H=pn(),U=N;R?U=d?H:`${L.id}-${V}`:o&&(U=o);let W={};R&&(d?W=I.parent.getParentProps():V&&(W=I.parent.getChildProps(V)));let te=Y(u),{checked:ne=n,indeterminate:re=s,onCheckedChange:ie,...ae}=W,oe=I?.value,se=I?.setValue,ce=I?.defaultValue,le=J.useRef(null),{getButtonProps:ue,buttonRef:de}=Jo({disabled:z,native:_}),fe=I?.validation??A,[pe,me]=Wt({controlled:V&&oe&&!d?oe.includes(V):ne,default:V&&ce&&!d?ce.includes(V):i,name:`Checkbox`,state:`checked`});X(()=>{if(P!==an)return P(U),()=>{P(void 0)}},[U,I,P,d]),uo({enabled:!I,id:ee,commit:fe.commit,value:pe,controlRef:le,name:B,getValue:()=>pe});let G=J.useRef(null),he=qt(c,G,fe.inputRef);X(()=>{G.current&&(G.current.indeterminate=re,pe&&C(!0))},[pe,re,C]),go(pe,()=>{I&&!d||(y(B),C(pe),S(pe!==O.initialValue),k()?fe.commit(pe):fe.commit(pe,!0))});let ge=Pa({checked:pe,disabled:z,name:d?void 0:B,id:U??void 0,required:m,ref:he,style:rn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Q(xo,e.nativeEvent);if(ie?.(t,n),te(t,n),!n.isCanceled&&(me(t),V&&oe&&se&&!d)){let e=t?[...oe,V]:oe.filter(e=>e!==V);se(e,n)}},onFocus(){le.current?.focus()}},g===void 0?sn:{value:(I?pe&&g:g)||``},F,I?fe.getValidationProps:fe.getInputValidationProps),_e=R?!!ne:pe,ve=R&&re||s;J.useEffect(()=>{L&&V&&L.disabledStatesRef.current.set(V,z)},[L,z,V]);let ye=J.useMemo(()=>({...E,checked:_e,disabled:z,readOnly:f,required:m,indeterminate:ve}),[E,_e,z,f,m,ve]),be=$m(ye),xe=Z(`span`,e,{state:ye,ref:[de,le,t,I?.registerControlRef],props:[{id:ee,role:`checkbox`,"aria-checked":re?`mixed`:pe,"aria-readonly":f||void 0,"aria-required":m||void 0,"aria-labelledby":M,[ih]:d?``:void 0,onFocus(){w(!0)},onBlur(){let e=G.current;e&&(T(!0),w(!1),D===`onBlur`&&fe.commit(I?oe:e.checked))},onClick(e){f||z||(e.preventDefault(),G.current?.click())}},F,fe.getValidationProps,v,ae,ue],stateAttributesMapping:be});return(0,q.jsxs)(nh.Provider,{value:ye,children:[xe,!pe&&!I&&B&&!d&&h!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:B,value:h}),(0,q.jsx)(`input`,{...ge})]})}),oh=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=rh(),s=o.checked||o.indeterminate,{transitionStatus:c,setMounted:l}=_s(s),u=J.useRef(null),d=J.useMemo(()=>({...o,transitionStatus:c}),[o,c]);gs({open:s,ref:u,onComplete(){s||l(!1)}});let f=$m(o),p=J.useMemo(()=>({...f,...Wo,...so}),[f]),m=i||s,h=Z(`span`,e,{enabled:m,ref:[t,u],state:d,stateAttributesMapping:p,props:a});return m?h:null});function sh({className:e,disabled:t=!1,...n}){return(0,q.jsx)(ah,{disabled:t,className:K(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-border bg-transparent`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(oh,{className:`flex items-center justify-center text-current`,children:(0,q.jsx)(Ct,{className:`h-3 w-3`,strokeWidth:3,"aria-hidden":!0})})})}var ch=w(`onModules`),lh=w(`runModuleCommand`),uh=w(`runComputerCommand`),dh=w(`readModule`);function fh({className:e,...t}){return(0,q.jsx)(`span`,{className:K(`inline-flex items-center rounded-full border border-[var(--color-border)] px-2 py-0.5 text-xs font-medium`,e),...t})}function ph({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`rounded-lg border border-border bg-card text-card-foreground`,e),...t})}function mh({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`flex flex-col gap-1 px-4 pt-4`,e),...t})}function hh({className:e,...t}){return(0,q.jsx)(`h3`,{className:K(`text-sm font-semibold`,e),...t})}function gh({icon:e,children:t,segment:n,onOpen:r,className:i}){return(0,q.jsx)(hh,{className:K(`text-base`,i),children:(0,q.jsxs)(`a`,{href:N(n),onClick:e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),r())},className:`group -mx-1 inline-flex items-center gap-2 rounded px-1 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,children:[e,t,(0,q.jsx)(St,{className:`h-3.5 w-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 max-md:opacity-100`,"aria-hidden":!0})]})})}function _h({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`p-4`,e),...t})}var vh=J.createContext(void 0);function yh(){let e=J.useContext(vh);if(e===void 0)throw Error(Cr(63));return e}var bh=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),xh={...so,checked(e){return e?{[bh.checked]:``}:{[bh.unchecked]:``}}},Sh=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:l,readOnly:u=!1,required:d=!1,disabled:f=!1,render:p,uncheckedValue:m,...h}=e,{clearErrors:g}=io(),{state:_,setTouched:v,setDirty:y,validityData:b,setFilled:x,setFocused:S,shouldValidateOnChange:C,validationMode:w,disabled:T,name:E,validation:D}=lo(),{labelId:O}=ho(),k=T||f,A=E??s,j=Y(l),M=J.useRef(null),N=qt(M,o,D.inputRef),P=J.useRef(null),F=pn(),I=ns({id:a,implicit:!1,controlRef:P}),[L,R]=Wt({controlled:n,default:!!i,name:`Switch`,state:`checked`});uo({id:F,commit:D.commit,value:L,controlRef:P,name:A,getValue:()=>L}),X(()=>{M.current&&x(M.current.checked)},[M,x]),go(L,()=>{g(A),y(L!==b.initialValue),x(L),C()?D.commit(L):D.commit(L,!0)});let{getButtonProps:z,buttonRef:B}=Jo({disabled:k,native:c}),V={id:F,role:`switch`,"aria-checked":L,"aria-readonly":u||void 0,"aria-labelledby":O,onFocus(){k||S(!0)},onBlur(){let e=M.current;!e||k||(v(!0),S(!1),w===`onBlur`&&D.commit(e.checked))},onClick(e){u||k||(e.preventDefault(),M?.current?.click())}},ee=J.useMemo(()=>Pa({checked:L,disabled:k,id:I,name:A,required:d,style:rn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:N,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Q(xo,e.nativeEvent);j?.(t,n),!n.isCanceled&&R(t)},onFocus(){P.current?.focus()}},D.getInputValidationProps),[L,k,N,I,A,j,d,R,D]),H=J.useMemo(()=>({..._,checked:L,disabled:k,readOnly:u,required:d}),[_,L,k,u,d]),U=Z(`span`,e,{state:H,ref:[t,P,B],props:[V,D.getValidationProps,h,z],stateAttributesMapping:xh});return(0,q.jsxs)(vh.Provider,{value:H,children:[U,!L&&A&&m!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:A,value:m}),(0,q.jsx)(`input`,{...ee})]})}),Ch=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=lo(),o=yh();return Z(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:xh,props:i})});function wh({className:e,disabled:t=!1,...n}){return(0,q.jsx)(Sh,{disabled:t,className:K(`inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted p-0.5`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary data-[checked]:bg-primary`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(Ch,{className:`block h-3.5 w-3.5 rounded-full bg-foreground/70 transition-transform data-[checked]:translate-x-4 data-[checked]:bg-primary-foreground`})})}function Th({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,q.jsx)(`table`,{"data-slot":`table`,className:K(`w-full caption-bottom text-left text-sm`,e),...t})})}function Eh({className:e,...t}){return(0,q.jsx)(`thead`,{"data-slot":`table-header`,className:K(`text-xs text-muted-foreground [&_tr]:border-b [&_tr]:border-border [&_tr:hover]:bg-transparent`,e),...t})}function Dh({className:e,...t}){return(0,q.jsx)(`tbody`,{"data-slot":`table-body`,className:K(`[&_tr:last-child]:border-0`,e),...t})}function Oh({className:e,...t}){return(0,q.jsx)(`tr`,{"data-slot":`table-row`,className:K(`border-b border-border transition-colors hover:bg-accent/60`,e),...t})}function kh({className:e,...t}){return(0,q.jsx)(`th`,{"data-slot":`table-head`,className:K(`h-9 whitespace-nowrap px-3 text-left align-middle font-normal first:pl-0 last:pr-0`,e),...t})}function Ah({className:e,...t}){return(0,q.jsx)(`td`,{"data-slot":`table-cell`,className:K(`px-3 py-2 align-middle first:pl-0 last:pr-0`,e),...t})}function jh({className:e,...t}){return(0,q.jsx)(`label`,{"data-slot":`label`,className:K(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm leading-snug has-[[data-disabled]]:opacity-50`,e),...t})}function Mh(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}var Nh=J.createContext(null),Ph=J.createContext(null);function Fh(){let e=J.useContext(Nh);if(e===null)throw Error(Cr(60));return e}function Ih(){let e=J.useContext(Ph);if(e===null)throw Error(Cr(61));return e}var Lh=(e,t)=>Object.is(e,t);function Rh(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function zh(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&Rh(e,t,n))}function Bh(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&Rh(e,t,n))}function Vh(e,t,n){return e.filter(e=>!Rh(e,t,n))}function Hh(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Uh(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Wh(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Hh(e)}function Gh(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Hh(e.value):Hh(e)}function Kh(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??Wh(e,n);if(Array.isArray(t)){let r=Uh(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:Wh(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:Wh(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return Wh(e,n)}function qh(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>Wh(e,t)).join(`, `)}var Jh={id:$(e=>e.id),modal:$(e=>e.modal),multiple:$(e=>e.multiple),items:$(e=>e.items),itemToStringLabel:$(e=>e.itemToStringLabel),itemToStringValue:$(e=>e.itemToStringValue),isItemEqualToValue:$(e=>e.isItemEqualToValue),value:$(e=>e.value),open:$(e=>e.open),mounted:$(e=>e.mounted),forceMount:$(e=>e.forceMount),transitionStatus:$(e=>e.transitionStatus),touchModality:$(e=>e.touchModality),activeIndex:$(e=>e.activeIndex),selectedIndex:$(e=>e.selectedIndex),isActive:$((e,t)=>e.activeIndex===t),isSelected:$((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Rh(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null||Rh(i,n,r)}),isSelectedByFocus:$((e,t)=>e.selectedIndex===t),popupProps:$(e=>e.popupProps),triggerProps:$(e=>e.triggerProps),triggerElement:$(e=>e.triggerElement),positionerElement:$(e=>e.positionerElement),listElement:$(e=>e.listElement),scrollUpArrowVisible:$(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$(e=>e.scrollDownArrowVisible),hasScrollArrows:$(e=>e.hasScrollArrows),serializedValue:$(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:Gh(n,r)})};function Yh(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=Lh,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=io(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=lo(),{controlId:j}=ho(),M=ns({id:t}),N=k||l,P=O??c,[F,I]=Wt({controlled:n,default:_?r??on:r,name:`Select`,state:`value`}),[L,R]=Wt({controlled:a,default:o,name:`Select`,state:`open`}),z=J.useRef([]),B=J.useRef([]),V=J.useRef(null),ee=J.useRef(null),H=J.useRef(0),U=J.useRef(null),W=J.useRef([]),te=J.useRef(!1),ne=J.useRef(!1),re=J.useRef(null),ie=J.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ae=J.useRef(!1),{mounted:oe,setMounted:se,transitionStatus:ce}=_s(L),le=Kt(()=>new Mu({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:oe,transitionStatus:ce,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ue=ku(le,Jh.activeIndex),de=ku(le,Jh.selectedIndex),fe=ku(le,Jh.triggerElement),pe=ku(le,Jh.positionerElement),me=J.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:Gh(F,y),[_,F,y]),G=os(le.state.triggerElement);uo({id:M,commit:A.commit,value:F,controlRef:G,name:P,getValue:()=>F});let he=J.useRef(F);X(()=>{F!==he.current&&le.set(`forceMount`,!0)},[le,F]),X(()=>{D(F!==null)},[F,D]),X(function(){if(L)return;let e=W.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){le.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Bh(e,n,b);le.set(`selectedIndex`,r===-1?null:r);return}let t=Bh(e,F,b);le.set(`selectedIndex`,t===-1?null:t)},[_,L,F,W,b,le]),go(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ge=Y((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&le.state.activeIndex!==null)){let e=z.current[le.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),_e=Y(()=>{se(!1),le.set(`activeIndex`,null),h?.(!1)});gs({enabled:!p,open:L,ref:V,onComplete(){L||_e()}}),J.useImperativeHandle(p,()=>({unmount:_e}),[_e]);let ve=Y((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),ye=Y(()=>{let e=le.state.listElement||V.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;le.state.scrollUpArrowVisible!==r&&le.set(`scrollUpArrowVisible`,r),le.state.scrollDownArrowVisible!==i&&le.set(`scrollDownArrowVisible`,i)}),be=Wu({open:L,onOpenChange:ge,elements:{reference:fe,floating:pe}}),{getReferenceProps:xe,getFloatingProps:Se,getItemProps:Ce}=ad([Hc(be,{enabled:!u&&!N,event:`mousedown`}),nu(be,{bubbles:!1}),md(be,{enabled:!u&&!N,listRef:z,activeIndex:ue,selectedIndex:de,disabledIndices:on,onNavigate(e){e===null&&!L||le.set(`activeIndex`,e)},focusItemOnHover:!1}),_d(be,{enabled:!u&&!N&&(L||!_),listRef:B,activeIndex:ue,selectedIndex:de,onMatch(e){L?le.set(`activeIndex`,e):ve(W.current[e],Q(`none`))},onTypingChange(e){te.current=e}})]);Mh(()=>{le.update({popupProps:Se(),triggerProps:xe()})}),X(()=>{le.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:oe,transitionStatus:ce,popupProps:Se(),triggerProps:xe(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[le,M,f,_,F,L,oe,ce,Se,xe,g,v,y,b]);let we=J.useMemo(()=>({store:le,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:ve,setOpen:ge,listRef:z,popupRef:V,scrollHandlerRef:ee,handleScrollArrowVisibility:ye,scrollArrowsMountedCountRef:H,getItemProps:Ce,events:be.context.events,valueRef:U,valuesRef:W,labelsRef:B,typingRef:te,selectionRef:ie,selectedItemTextRef:re,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:ae,initialValueRef:he}),[le,P,d,N,u,_,v,y,x,ve,ge,Ce,be.context.events,A,h,ye]),Te=qt(m,A.inputRef),Ee=_&&Array.isArray(F)&&F.length>0,De=J.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=Gh(e,y);return(0,q.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,q.jsx)(Nh.Provider,{value:we,children:(0,q.jsxs)(Ph.Provider,{value:be,children:[S,(0,q.jsx)(`input`,{...A.getInputValidationProps({onFocus(){le.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Q(xo,e.nativeEvent);function r(){if(_)return;let e=W.current.find(e=>Gh(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),ve(e,n),T()&&A.commit(e))}le.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:me,disabled:N,required:d&&!Ee,readOnly:u,ref:Te,style:rn,tabIndex:-1,"aria-hidden":!0}),De]})})}var Xh=2,Zh={...Ps,...so,value:()=>null},Qh=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=lo(),{labelId:f}=ho(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=Fh(),x=d||y||i,S=ku(p,Jh.open),C=ku(p,Jh.value),w=ku(p,Jh.triggerProps),T=ku(p,Jh.positionerElement),E=ku(p,Jh.listElement),D=ku(p,Jh.serializedValue),O=os(T),k=J.useRef(null),A=$s(),j=$s(),{getButtonProps:M,buttonRef:N}=Jo({disabled:x,native:a}),P=qt(t,k,N,Y(e=>{p.set(`triggerElement`,e)})),F=$s(),I=$s();J.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=J.useMemo(()=>E?.id??pr(T)?.id,[E,T]),R=Pa(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,Q(Ao,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=mc(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(ar(k.current,t)||ar(O.current,t)||t===k.current)return;let n=sf(k.current);e.clientX>=n.left-Xh&&e.clientX<=n.right+Xh&&e.clientY>=n.top-Xh&&e.clientY<=n.bottom+Xh||m(!1,Q(Fo,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=J.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return Z(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:Zh,props:R})}),$h={value:()=>null},eg=J.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=Fh(),c=ku(o,Jh.value),l=ku(o,Jh.items),u=ku(o,Jh.itemToStringLabel),d=ku(o,Jh.serializedValue),f=J.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?qh(c,u):Kh(c,l,u));return Z(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:$h})}),tg=J.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Fh(),o=ku(a,Jh.open);return Z(`span`,e,{state:J.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:Ns})}),ng=J.createContext(void 0),rg=J.forwardRef(function(e,t){let{store:n}=Fh(),r=ku(n,Jh.mounted),i=ku(n,Jh.forceMount);return r||i?(0,q.jsx)(ng.Provider,{value:!0,children:(0,q.jsx)(jc,{ref:t,...e})}):null}),ig=J.createContext(void 0);function ag(){let e=J.useContext(ig);if(!e)throw Error(Cr(59));return e}function og(e,t){e&&Object.assign(e.style,t)}var sg={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},cg={position:`fixed`},lg=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=qa,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=Fh(),D=Ih(),O=ku(v,Jh.open),k=ku(v,Jh.mounted),A=ku(v,Jh.modal),j=ku(v,Jh.value),M=ku(v,Jh.touchModality),N=ku(v,Jh.positionerElement),P=ku(v,Jh.triggerElement),F=ku(v,Jh.isItemEqualToValue),I=J.useRef(null),L=J.useRef(null),[R,z]=J.useState(h),B=k&&R&&!M;!k&&R!==h&&z(h),X(()=>{k||(Jh.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),Jh.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),J.useImperativeHandle(x,()=>B),Jd((B||A)&&O&&!M,P);let V=Ld({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??B,collisionAvoidance:g,keepMounted:!0}),ee=B?`none`:V.side,H=B?cg:V.positionerStyles,U=J.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...H,...e}}},[O,k,H]),W=J.useMemo(()=>({open:O,side:ee,align:V.align,anchorHidden:V.anchorHidden}),[O,ee,V.align,V.anchorHidden]),te=Z(`div`,e,{ref:[t,Y(e=>{v.set(`positionerElement`,e)})],state:W,stateAttributesMapping:Fs,props:[U,_]}),ne=J.useRef(0),re=Y(e=>{if(e.size===0&&ne.current===0||C.current.length===0)return;let t=ne.current;if(ne.current=e.size,e.size===t)return;let n=Q(xo);if(t!==0&&!v.state.multiple&&j!==null&&Bh(C.current,j,F)===-1){let e=w.current,t=e!=null&&zh(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>zh(C.current,e,F));(e.length!==j.length||e.some(e=>!zh(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&B){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};og(N,e),og(T.current,e)}}),ie=J.useMemo(()=>({...V,side:ee,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[V,ee,B,z]);return(0,q.jsx)(ha,{elementsRef:y,labelsRef:b,onMapChange:re,children:(0,q.jsxs)(ig.Provider,{value:ie,children:[k&&A&&(0,q.jsx)(zd,{inert:kd(!O),cutout:P}),te]})})});function ug(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var dg={...Fs,...Wo},fg=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=Fh(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=ag(),x=Sd(!0)!=null,S=Ih(),C=$s(),w=ku(a,Jh.id),T=ku(a,Jh.open),E=ku(a,Jh.mounted),D=ku(a,Jh.popupProps),O=ku(a,Jh.transitionStatus),k=ku(a,Jh.triggerElement),A=ku(a,Jh.positionerElement),j=ku(a,Jh.listElement),M=J.useRef(0),N=J.useRef(!1),P=J.useRef(0),F=J.useRef(!1),I=J.useRef({}),L=ps(),R=Y(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=mc(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});J.useImperativeHandle(m,()=>R,[R]),gs({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=J.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);X(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),X(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,og(A,I.current))},[E,_,A,o]),X(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=mc(k),i=gn(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let B=d.scrollHeight-d.clientHeight,V=P>=B;V&&(D=Math.min(y,o.height)-(P-B));let ee=a.top<20||a.bottom>y-20||D<Math.min(f,_),H=(i.visualViewport?.scale??1)!==1&&Un;if(ee||H){F.current=!0,og(A,I.current),mr.flushSync(()=>v(!1));return}if(V){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),J.useEffect(()=>{if(!_||!A||!E)return;let e=gn(A);function t(e){c(!1,Q(zo,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let B={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&aa.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(ug(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:sg}},V=Z(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:dg,props:[D,B,Cd(O),{className:!j&&_?Sf.className:void 0},i]});return(0,q.jsxs)(J.Fragment,{children:[Sf.element,(0,q.jsx)(Vc,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:V})]})}),pg=J.createContext(void 0);function mg(){let e=J.useContext(pg);if(!e)throw Error(Cr(57));return e}var hg=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=J.useRef(null),u=Zo({label:a,textRef:l,indexGuessBehavior:Xo.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=Fh(),x=$s(),S=ku(d,Jh.isActive,u.index),C=ku(d,Jh.isSelected,u.index,i),w=ku(d,Jh.isSelectedByFocus,u.index),T=ku(d,Jh.isItemEqualToValue),E=u.index,D=E!==-1,O=J.useRef(null),k=os(E);X(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),X(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Rh(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=J.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=J.useRef(null),N=J.useRef(`mouse`),P=J.useRef(!1),{getButtonProps:F,buttonRef:I}=Jo({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[],r=C?Vh(n,i,T):[...n,i];m(r,Q(Eo,e))}else m(i,Q(Eo,e)),p(!1,Q(Eo,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||ug(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=Z(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),B=J.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,q.jsx)(pg.Provider,{value:B,children:z})})),gg=J.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=mg();return n||r?(0,q.jsx)(_g,{...e,ref:t}):null}),_g=J.memo(J.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=mg(),s=J.useRef(null),{transitionStatus:c,setMounted:l}=_s(o),u=J.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=Z(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:Wo});return gs({open:o,ref:s,onComplete(){o||l(!1)}}),d})),vg=J.memo(J.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=mg(),{selectedItemTextRef:o}=Fh(),{className:s,render:c,...l}=e;return Z(`div`,e,{ref:[J.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})})),yg=Yh;function bg(e){return(0,q.jsx)(eg,{"data-slot":`select-value`,...e})}function xg({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(Qh,{"data-slot":`select-trigger`,className:K(`inline-flex min-w-0 max-w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-border bg-background text-left text-sm shadow-sm outline-none transition-colors`,`hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t===`sm`?`h-8 px-2`:`h-9 px-3`,typeof e==`string`?e:void 0),...r,children:[(0,q.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),(0,q.jsx)(tg,{className:`shrink-0 text-muted-foreground`,children:(0,q.jsx)(wt,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]})}function Sg({className:e,sideOffset:t=4,align:n=`start`,children:r,...i}){return(0,q.jsx)(rg,{children:(0,q.jsx)(lg,{sideOffset:t,align:n,alignItemWithTrigger:!1,className:`z-50 outline-none`,children:(0,q.jsx)(fg,{"data-slot":`select-content`,className:K(`max-h-[min(var(--available-height),20rem)] min-w-[var(--anchor-width)] max-w-[var(--available-width)] overflow-y-auto rounded-md border border-border bg-card p-1 text-card-foreground shadow-md outline-none`,typeof e==`string`?e:void 0),...i,children:r})})})}function Cg({className:e,children:t,...n}){return(0,q.jsxs)(hg,{"data-slot":`select-item`,className:K(`relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none`,`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,typeof e==`string`?e:void 0),...n,children:[(0,q.jsx)(vg,{children:t}),(0,q.jsx)(gg,{className:`absolute right-2 flex items-center`,children:(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]})}var wg=J.createContext(void 0);function Tg(e){let t=J.useContext(wg);if(t===void 0&&!e)throw Error(Cr(47));return t}function Eg(){return{...Hu(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}var Dg={...Uu,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),openMethod:$(e=>e.openMethod),openChangeReason:$(e=>e.openChangeReason),modal:$(e=>e.modal),stickIfOpen:$(e=>e.stickIfOpen),titleElementId:$(e=>e.titleElementId),descriptionElementId:$(e=>e.descriptionElementId),openOnHover:$(e=>e.openOnHover),closeDelay:$(e=>e.closeDelay)},Og=class e extends Nu{constructor(e){let t={...Eg(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),stickIfOpenTimeout:new Qs,triggerElements:new Bu},Dg)}setOpen=(e,t)=>{let n=t.reason===Co,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),mr.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Kt(()=>t??new e(n)).current;return ls(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function kg({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Og.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=Qd(d);Ru(u);let{forceUnmount:v}=zu(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});Jd(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),J.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=J.useCallback(e=>{let t=Q(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=J.useCallback(()=>{u.setOpen(!1,y(Ro))},[u,y]);J.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Ku({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=ad([nu(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),gd(x)]),T=J.useMemo(()=>S(g),[S,g]),E=J.useMemo(()=>w(g),[w,g]),D=J.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:ic()!=null});let O=J.useMemo(()=>({store:u}),[u]);return(0,q.jsx)(wg.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function Ag(e){return Tg(!0)?(0,q.jsx)(kg,{props:e}):(0,q.jsx)(cc,{children:(0,q.jsx)(kg,{props:e})})}var jg=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=Tg(!0),m=o?.store??p?.store;if(!m)throw Error(Cr(74));let h=pn(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=J.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=Lu(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=id(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:bd(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=ad([Hc(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=J.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=Jo({disabled:i,native:a}),j=J.useMemo(()=>({open(e){return e&&S===`trigger-press`?Ps.open(e):Ns.open(e)}}),[S]),M=Z(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Ka]:``,id:h},f,k],stateAttributesMapping:j}),N=J.useRef(null),P=Y(e=>{mr.flushSync(()=>{m.setOpen(!1,Q(Ao,e.nativeEvent,e.currentTarget))}),Wi(N.current)?.focus()}),F=Y(e=>{let t=m.select(`positionerElement`);if(t&&Gi(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{mr.flushSync(()=>{m.setOpen(!1,Q(Ao,e.nativeEvent,e.currentTarget))});let n=Ui(y.current);for(;n!==null&&ar(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=Bi(n),n===e)break}n?.focus()}});return g?(0,q.jsxs)(J.Fragment,{children:[(0,q.jsx)(hc,{ref:N,onFocus:P}),(0,q.jsx)(J.Fragment,{children:M},h),(0,q.jsx)(hc,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,q.jsx)(J.Fragment,{children:M},h)}),Mg=J.createContext(void 0);function Ng(){let e=J.useContext(Mg);if(e===void 0)throw Error(Cr(45));return e}var Pg=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Tg();return i.useState(`mounted`)||n?(0,q.jsx)(Mg.Provider,{value:n,children:(0,q.jsx)(jc,{ref:t,...r,renderGuards:!1})}):null}),Fg=J.createContext(void 0);function Ig(){let e=J.useContext(Fg);if(!e)throw Error(Cr(46));return e}var Lg=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,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=Ja,...g}=e,{store:_}=Tg(),v=Ng(),y=oc(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=J.useRef(null),A=hs(E,!1,!1),j=Ld({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:Pd}),M=J.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=J.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);X(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=J.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=J.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=Z(`div`,e,{state:F,props:[N.props,Cd(O),g],ref:[t,I],stateAttributesMapping:Fs});return(0,q.jsxs)(Fg.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,q.jsx)(zd,{ref:_.context.internalBackdropRef,inert:kd(!S),cutout:w}),(0,q.jsx)(sc,{id:y,children:L})]})}),Rg={...Fs,...Wo},zg=J.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=Tg(),c=Ig(),l=Sd(!0)!=null,u=eo(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);gs({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);ed(T,{enabled:D&&!E,closeDelay:O});function k(e){return e!==`touch`||s.context.popupRef.current}let A=i===void 0?k:i,j=J.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=J.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}Tp({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:J.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=Z(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&aa.has(e.key)&&e.stopPropagation()}},Cd(m),o],stateAttributesMapping:Rg});return(0,q.jsx)(Vc,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:bn(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})}),Bg=`data-[popup-open]:bg-[var(--color-accent)] data-[popup-open]:text-[var(--color-accent-foreground)]`,Vg=Ag;function Hg({className:e,...t}){return(0,q.jsx)(jg,{className:typeof e==`function`?e:K(Bg,e),...t})}function Ug({className:e,sideOffset:t=6,align:n=`start`,children:r,...i}){return(0,q.jsx)(Pg,{children:(0,q.jsx)(Lg,{sideOffset:t,align:n,className:`z-50 outline-none`,children:(0,q.jsx)(zg,{className:K(`rounded-md border border-[var(--color-border)] bg-[var(--color-card)] text-[var(--color-card-foreground)] shadow-md outline-none`,e),...i,children:(0,q.jsx)(Hf,{viewportClassName:`max-h-[var(--available-height)]`,children:(0,q.jsx)(`div`,{className:`p-3`,children:r})})})})})}function Wg(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gg(e,t){return e-t}function Kg(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gg)}function qg(e,t,n,r,i,a){let o=e;return o=Af(o,n,r),i&&(o=Kg(a,t,Af(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jg(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Yg={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},Xg=J.createContext(void 0);function Zg(){let e=J.useContext(Xg);if(e===void 0)throw Error(Cr(62));return e}function Qg(e){return`key`in e?No:ko}function $g(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wg(e,t):!1}var e_=J.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,name:m,onValueChange:h,onValueCommitted:g,orientation:_=`horizontal`,step:v=1,thumbCollisionBehavior:y=`push`,thumbAlignment:b=`center`,value:x,...S}=e,C=pn(o),w=Y(h),T=Y(g),{clearErrors:E}=io(),{state:D,disabled:O,name:k,setTouched:A,setDirty:j,validityData:M,shouldValidateOnChange:N,validation:P}=lo(),{labelId:F}=ho(),I=n??F,L=O||a,R=k??m,[z,B]=Wt({controlled:x,default:i??f,name:`Slider`}),V=J.useRef(null),ee=J.useRef(null),H=J.useRef([]),U=J.useRef(null),W=J.useRef(null),te=J.useRef(-1),ne=J.useRef(null),re=J.useRef(null),ie=J.useRef(`none`),ae=os(s),[oe,se]=J.useState(-1),[ce,le]=J.useState(-1),[ue,de]=J.useState(!1),[fe,pe]=J.useState(()=>new Map),[me,G]=J.useState([void 0,void 0]),he=Y(e=>{se(e),e!==-1&&le(e)});uo({id:C,commit:P.commit,value:z,controlRef:ee,name:R,getValue:()=>z}),go(z,()=>{E(R),N()?P.commit(z):P.commit(z,!0);let e=M.initialValue,t;t=Array.isArray(z)&&Array.isArray(e)?!Wg(z,e):z!==e,j(t)});let ge=Y(e=>{e&&(ee.current=e)}),_e=Array.isArray(z),ve=J.useMemo(()=>_e?z.slice().sort(Gg):[Af(z,f,d)],[d,f,_e,z]),ye=Y((e,t)=>{if(Number.isNaN(e)||$g(e,z))return;let n=t??Q(`none`,void 0,void 0,{activeThumbIndex:-1});ie.current=n.reason;let r=new event.constructor(event.type,event);Object.defineProperty(r,"target",{writable:!0,value:{value:e,name:R}}),n.event=r,re.current=e,w(e,n),!n.isCanceled&&B(e)}),be=Y((e,t,n)=>{let r=qg(e,t,f,d,_e,ve);if(Jg(r,v,p)){let e=Qg(n);ye(r,Q(e,n.nativeEvent,void 0,{activeThumbIndex:t})),A(!0);let i=re.current??r;T(i,Bo(e,n.nativeEvent))}});X(()=>{let e=ir(mc(V.current));L&&e&&V.current?.contains(e)&&e.blur()},[L]),L&&oe!==-1&&he(-1);let xe=J.useMemo(()=>({...D,activeThumbIndex:oe,disabled:L,dragging:ue,orientation:_,max:d,min:f,minStepsBetweenValues:p,step:v,values:ve}),[D,oe,L,ue,d,f,p,_,v,ve]),Se=J.useMemo(()=>({active:oe,controlRef:ee,disabled:L,dragging:ue,validation:P,formatOptionsRef:ae,handleInputChange:be,indicatorPosition:me,inset:b!==`center`,labelId:I,largeStep:c,lastUsedThumbIndex:ce,lastChangedValueRef:re,lastChangeReasonRef:ie,locale:l,max:d,min:f,minStepsBetweenValues:p,name:R,onValueCommitted:T,orientation:_,pressedInputRef:U,pressedThumbCenterOffsetRef:W,pressedThumbIndexRef:te,pressedValuesRef:ne,registerFieldControlRef:ge,renderBeforeHydration:b===`edge`,setActive:he,setDragging:de,setIndicatorPosition:G,setValue:ye,state:xe,step:v,thumbCollisionBehavior:y,thumbMap:fe,thumbRefs:H,values:ve}),[oe,ee,I,L,ue,P,ae,be,me,c,ce,re,ie,l,d,f,p,R,T,_,U,W,te,ne,ge,he,de,G,ye,xe,v,y,b,fe,H,ve]),Ce=Z(`div`,e,{state:xe,ref:[t,V],props:[{"aria-labelledby":I,id:C,role:`group`},P.getValidationProps,S],stateAttributesMapping:Yg});return(0,q.jsx)(Xg.Provider,{value:Se,children:(0,q.jsx)(ha,{elementsRef:H,onMapChange:pe,children:Ce})})}),t_=new Map;function n_(e,t){let n=JSON.stringify({locale:e,options:t}),r=t_.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return t_.set(n,i),i}function r_(e,t,n){return e==null?``:n_(t,n).format(e)}function i_(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function a_(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function o_(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(a_(t)))}function s_({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=Af(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=Af(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=Af(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function c_({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=Af(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=s_({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=Af(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:s_({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=Af(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var l_=2;function u_(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function d_(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var f_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{disabled:a,dragging:o,validation:s,inset:c,lastChangedValueRef:l,lastChangeReasonRef:u,max:d,min:f,minStepsBetweenValues:p,onValueCommitted:m,orientation:h,pressedInputRef:g,pressedThumbCenterOffsetRef:_,pressedThumbIndexRef:v,pressedValuesRef:y,registerFieldControlRef:b,renderBeforeHydration:x,setActive:S,setDragging:C,setValue:w,state:T,step:E,thumbCollisionBehavior:D,thumbRefs:O,values:k}=Zg(),A=eo(),j=k.length>1,M=h===`vertical`,N=J.useRef(null),P=J.useRef(null),F=Y(e=>{e&&P.current==null&&(P.current??=getComputedStyle(e))}),I=J.useRef(null),L=J.useRef(0),R=J.useRef(0),z=os(k),B=Y(e=>{v.current!==e&&(v.current=e);let t=O.current[e];if(!t){_.current=null,g.current=null;return}g.current=t.querySelector(`input[type="range"]`)}),V=Y(e=>{let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=u_(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=_.current??0,m=e.x-u,h=e.y-u,g=Af(((M?i-h-s.end:(A===`rtl`?o-m:m-a)-s.start)-c)/l,0,1),b=(d-f)*g+f;if(b=o_(b,E,f),b=Af(b,f,d),!j)return{value:b,thumbIndex:0,didSwap:!1};let x=v.current;if(x<0)return null;let S=c_({behavior:D,values:k,currentValues:z.current??k,initialValues:y.current,pressedIndex:x,nextValue:b,min:f,max:d,step:E,minStepsBetweenValues:p});return D===`swap`&&S.didSwap?B(S.thumbIndex):v.current=S.thumbIndex,S}),ee=Y(e=>{y.current=j?k.slice():null,z.current=k;let t=v.current,n=t;if(t>-1&&t<k.length){if(k[t]===d){let e=t;for(;e>0&&k[e-1]===d;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(yn(a)){let o=i_(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&B(n),c){let e=O.current[n];if(yn(e)){let t=e.getBoundingClientRect();R.current=t[M?`height`:`width`]/2}}}),H=Y(e=>{O.current?.[e]?.querySelector(`input[type="range"]`)?.focus({preventScroll:!0})}),U=Y(e=>{let t=d_(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){W(e);return}let n=V(t);n!=null&&Jg(n.value,E,p)&&(!o&&L.current>l_&&C(!0),w(n.value,Q(Po,e,void 0,{activeThumbIndex:n.thumbIndex})),z.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&H(n.thumbIndex))});function W(e){S(-1),C(!1),g.current=null,_.current=null,v.current=-1;let t=d_(e,I),n=t==null?null:V(t);if(n!=null){let t=u.current;s.commit(l.current??n.value),m(l.current??n.value,Bo(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),I.current=null,y.current=null,ne()}let te=Y(e=>{if(a)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=d_(e,I);if(n!=null){ee(n);let t=V(n);if(t==null)return;H(t.thumbIndex),w(t.value,Q(Oo,e,void 0,{activeThumbIndex:t.thumbIndex})),z.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&H(t.thumbIndex)}L.current=0;let r=mc(N.current);r.addEventListener(`touchmove`,U,{passive:!0}),r.addEventListener(`touchend`,W,{passive:!0})}),ne=Y(()=>{let e=mc(N.current);e.removeEventListener(`pointermove`,U),e.removeEventListener(`pointerup`,W),e.removeEventListener(`touchmove`,U),e.removeEventListener(`touchend`,W),y.current=null}),re=ps();return J.useEffect(()=>{let e=N.current;return e?(e.addEventListener(`touchstart`,te,{passive:!0}),()=>{e.removeEventListener(`touchstart`,te),re.cancel(),ne()}):()=>ne()},[ne,te,N,re]),J.useEffect(()=>{a&&ne()},[a,ne]),Z(`div`,e,{state:T,ref:[t,b,N,F],props:[{"data-base-ui-slider-control":x?``:void 0,onPointerDown(e){let t=N.current;if(!t||a||e.defaultPrevented||!yn(e.target)||e.button!==0)return;let n=d_(e,I);if(n!=null){ee(n);let r=V(n);if(r==null)return;ar(O.current[r.thumbIndex],ir(mc(t)))?e.preventDefault():re.request(()=>{H(r.thumbIndex)}),C(!0),_.current??(w(r.value,Q(Oo,e.nativeEvent,void 0,{activeThumbIndex:r.thumbIndex})),z.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&H(r.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let r=mc(N.current);r.addEventListener(`pointermove`,U,{passive:!0}),r.addEventListener(`pointerup`,W,{once:!0})},tabIndex:-1},i],stateAttributesMapping:Yg})}),p_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=Zg();return Z(`div`,e,{state:a,ref:t,props:[{style:{position:`relative`}},i],stateAttributesMapping:Yg})});function m_(e,t,n){return(e-t)*100/(n-t)}var h_=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),g_=`PageUp`,__=`PageDown`,v_=new Set([Ji,Yi,Xi,Zi,Qi,`End`,g_,__]);function y_(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${r_(e[t],r,n)} start range`:`${r_(e[t],r,n)} end range`:n?r_(e[t],r,n):void 0}function b_(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}var x_=J.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,disabled:c=!1,getAriaLabel:l,getAriaValueText:u,id:d,index:f,inputRef:p,onBlur:m,onFocus:h,onKeyDown:g,tabIndex:_,...v}=e,y=pn(d),{active:b,lastUsedThumbIndex:x,controlRef:S,disabled:C,validation:w,formatOptionsRef:T,handleInputChange:E,inset:D,labelId:O,largeStep:k,locale:A,max:j,min:M,minStepsBetweenValues:N,name:P,orientation:F,pressedInputRef:I,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:B,setIndicatorPosition:V,state:ee,step:H,values:U}=Zg(),W=eo(),te=c||C,ne=U.length>1,re=F===`vertical`,ie=W===`rtl`,{setTouched:ae,setFocused:oe,validationMode:se}=lo(),ce=J.useRef(null),le=J.useRef(null),ue=pn(),de=ns(),fe=ne?ue:de,{ref:pe,index:me}=Zo({metadata:J.useMemo(()=>({inputId:fe}),[fe])}),G=ne?f??me:0,he=G===U.length-1,ge=U[G],_e=m_(ge,M,j),[ve,ye]=J.useState(!1),[be,xe]=J.useState();ls(()=>ye(!0));let Se=x>=0&&x<U.length?x:-1,Ce=Y(()=>{let e=S.current,t=ce.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=re?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*_e/100)/r[i]*100;xe(o),G===0?V(e=>[o,e[1]]):he&&V(e=>[e[0],o])});X(()=>{D&&queueMicrotask(Ce)},[Ce,D]),X(()=>{D&&Ce()},[Ce,D,_e]);let we=J.useCallback(()=>{let e=re?`bottom`:`insetInlineStart`,t=re?`left`:`top`,n;return ne?b===G?n=2:Se===G&&(n=1):b===G&&(n=1),D?{"--position":`${be}%`,visibility:z&&!ve||be===void 0?`hidden`:void 0,position:`absolute`,[e]:`var(--position)`,[t]:`50%`,translate:`${(re||!ie?-1:1)*50}% ${(re?1:-1)*50}%`,zIndex:n}:Number.isFinite(_e)?{position:`absolute`,[e]:`${_e}%`,[t]:`50%`,translate:`${(re||!ie?-1:1)*50}% ${(re?1:-1)*50}%`,zIndex:n}:rn},[b,G,D,ve,be,ne,z,ie,Se,_e,re]),Te;F===`vertical`&&(Te=ie?`vertical-rl`:`vertical-lr`);let Ee=Pa({"aria-label":typeof l==`function`?l(G):o,"aria-labelledby":s??O,"aria-describedby":a,"aria-orientation":F,"aria-valuenow":ge,"aria-valuetext":typeof u==`function`?u(r_(ge,A,T.current??void 0),ge,G):y_(U,G,T.current??void 0,A),disabled:te,id:fe,max:j,min:M,name:P,onChange(e){E(e.target.valueAsNumber,G,e)},onFocus(){B(G),oe(!0)},onBlur(){ce.current&&(B(-1),ae(!0),oe(!1),se===`onBlur`&&w.commit(qg(ge,G,M,j,ne,U)))},onKeyDown(e){if(!v_.has(e.key))return;aa.has(e.key)&&e.stopPropagation();let t=null,n=o_(ge,H,M);switch(e.key){case Ji:t=b_(n,e.shiftKey?k:H,1,M,j);break;case Zi:t=b_(n,e.shiftKey?k:H,ie?-1:1,M,j);break;case Yi:t=b_(n,e.shiftKey?k:H,-1,M,j);break;case Xi:t=b_(n,e.shiftKey?k:H,ie?1:-1,M,j);break;case g_:t=b_(n,k,1,M,j);break;case __:t=b_(n,k,-1,M,j);break;case`End`:t=j,ne&&(t=Number.isFinite(U[G+1])?U[G+1]-H*N:j);break;case Qi:t=M,ne&&(t=Number.isFinite(U[G-1])?U[G-1]+H*N:M);break;default:break}t!==null&&(E(t,G,e),e.preventDefault())},step:H,style:{...rn,width:`100%`,height:`100%`,writingMode:Te},tabIndex:_??void 0,type:`range`,value:ge??``},w.getInputValidationProps),De=qt(le,w.inputRef,p);return Z(`div`,e,{state:ee,ref:[t,pe,ce],props:[{[h_.index]:G,children:(0,q.jsxs)(J.Fragment,{children:[r,(0,q.jsx)(`input`,{ref:De,...Ee}),D&&!ve&&z&&he&&(0,q.jsx)(`script`,{dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:y,onBlur:m,onFocus:h,onPointerDown(e){if(R.current=G,ce.current!=null){let t=F===`horizontal`?`x`:`y`,n=i_(ce.current),r=(F===`horizontal`?e.clientX:e.clientY)-n[t];L.current=r}le.current!=null&&I.current!==le.current&&(I.current=le.current)},style:we(),suppressHydrationWarning:z||void 0,tabIndex:-1},v],stateAttributesMapping:Yg})});function S_(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&!a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function C_(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var w_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{indicatorPosition:a,inset:o,max:s,min:c,orientation:l,renderBeforeHydration:u,state:d,values:f}=Zg(),[p,m]=J.useState(!1);ls(()=>m(!0));let h=l===`vertical`,g=f.length>1,_=o?S_(h,g,a[0],a[1],u,p):C_(h,g,m_(f[0],c,s),m_(f[f.length-1],c,s));return Z(`div`,e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":u?``:void 0,style:_,suppressHydrationWarning:u||void 0},i],stateAttributesMapping:Yg})}),T_=`h-3.5 w-3.5 rounded-full border border-primary bg-card shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1`;function E_({value:e,onValueChange:t,min:n=0,max:r=10,className:i,"aria-label":a}){return(0,q.jsx)(e_,{value:e,onValueChange:e=>{Array.isArray(e)&&e.length===2&&t([e[0],e[1]])},min:n,max:r,step:1,className:K(`w-full`,i),children:(0,q.jsx)(f_,{className:`flex w-full touch-none select-none items-center py-1.5`,children:(0,q.jsxs)(p_,{className:`relative h-1 w-full rounded-full bg-[var(--color-muted)]`,children:[(0,q.jsx)(w_,{className:`rounded-full bg-primary`}),(0,q.jsx)(x_,{"aria-label":a?`${a} minimum`:`Minimum`,className:T_}),(0,q.jsx)(x_,{"aria-label":a?`${a} maximum`:`Maximum`,className:T_})]})})})}function D_({added:e,removed:t,className:n,zeros:r=!1}){let i=e=>r||e>0;return(0,q.jsxs)(`span`,{className:K(`shrink-0 font-mono text-[10px] tabular-nums`,n),children:[i(e)&&(0,q.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),i(e)&&i(t)&&` `,i(t)&&(0,q.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function O_(e){let[t,n]=J.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=J.useRef(null),i=J.useRef(null),a=J.useRef(null),o=J.useRef(null),s=J.useRef(!0),c=J.useRef(null),l=fn(),u=J.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,q.jsx)(Is.Provider,{value:u,children:(0,q.jsx)(ws.Provider,{value:void 0,children:(0,q.jsx)(af,{...e})})})}var k_=500,A_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{setAnchor:a,actionsRef:o,internalBackdropRef:s,backdropRef:c,positionerRef:l,allowMouseUpTriggerRef:u,initialCursorPointRef:d,rootId:f}=Ls(!1),{store:p}=Ts(!1),m=p.useState(`open`),h=J.useRef(null),g=J.useRef(null),_=$s(),v=$s(),y=J.useRef(!1);function b(e,t,n){let r=n.type.startsWith(`touch`);d.current={x:e,y:t},a({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),y.current=!1,o.current?.setOpen(!0,Q(So,n)),v.start(k_,()=>{y.current=!0})}function x(e){u.current=!0,_r(e),b(e.clientX,e.clientY,e.nativeEvent),mc(h.current).addEventListener(`mouseup`,e=>{if(u.current=!1,!y.current)return;v.clear(),y.current=!1;let t=or(e);ar(l.current,t)||f&&t&&cf(t)===f||o.current?.setOpen(!1,Q(Fo,e))},{once:!0})}function S(e){if(u.current=!1,e.touches.length===1){e.stopPropagation();let t=e.touches[0];g.current={x:t.clientX,y:t.clientY},_.start(k_,()=>{g.current&&b(g.current.x,g.current.y,e.nativeEvent)})}}function C(e){if(_.isStarted()&&g.current&&e.touches.length===1){let t=e.touches[0],n=Math.abs(t.clientX-g.current.x),r=Math.abs(t.clientY-g.current.y);(n>10||r>10)&&_.clear()}}function w(){_.clear(),g.current=null}return J.useEffect(()=>{function e(e){let t=or(e);(ar(h.current,t)||ar(s.current,t)||ar(c.current,t))&&e.preventDefault()}let t=mc(h.current);return t.addEventListener(`contextmenu`,e),()=>{t.removeEventListener(`contextmenu`,e)}},[c,s]),Z(`div`,e,{state:J.useMemo(()=>({open:m}),[m]),ref:[h,t],props:[{onContextMenu:x,onTouchStart:S,onTouchMove:C,onTouchEnd:w,onTouchCancel:w,style:{WebkitTouchCallout:`none`}},i],stateAttributesMapping:Ps})}),j_=O_,M_=A_,N_=(0,J.createContext)({title:null,actions:null});function P_({children:e}){let{title:t}=(0,J.useContext)(N_);return t?(0,mr.createPortal)(e,t):null}function F_({children:e}){let{actions:t}=(0,J.useContext)(N_);return t?(0,mr.createPortal)(e,t):null}var I_=`file`,L_={"package.json":`nodejs`,"package-lock.json":`nodejs`,"pnpm-lock.yaml":`pnpm`,"pnpm-workspace.yaml":`pnpm`,"yarn.lock":`yarn`,"bun.lockb":`bun`,".npmrc":`npm`,".nvmrc":`nodejs`,"tsconfig.json":`tsconfig`,"jsconfig.json":`jsconfig`,"vite.config.ts":`vite`,"vite.config.js":`vite`,"vitest.config.ts":`vitest`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,".prettierrc":`prettier`,"tailwind.config.js":`tailwindcss`,"tailwind.config.ts":`tailwindcss`,"readme.md":`readme`,license:`license`,"license.md":`license`,"changelog.md":`changelog`,"contributing.md":`contributing`,"agents.md":`agent`,dockerfile:`docker`,"docker-compose.yml":`docker`,"compose.yaml":`docker`,makefile:`makefile`,".gitignore":`git`,".gitattributes":`git`,".gitmodules":`git`,".editorconfig":`editorconfig`,".env.local":`tune`,".env.example":`tune`,"go.mod":`go-mod`,"go.sum":`go-mod`,"requirements.txt":`python-misc`,"pyproject.toml":`python-misc`,gemfile:`gemfile`},R_={ts:`typescript`,tsx:`react_ts`,mts:`typescript`,cts:`typescript`,"d.ts":`typescript-def`,js:`javascript`,jsx:`react`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,json5:`json`,md:`markdown`,mdx:`mdx`,txt:`document`,pdf:`pdf`,csv:`table`,html:`html`,htm:`html`,xml:`xml`,vue:`vue`,svelte:`svelte`,astro:`astro`,css:`css`,scss:`sass`,sass:`sass`,less:`less`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,webp:`image`,svg:`svg`,ico:`image`,avif:`image`,bmp:`image`,mp4:`video`,mp3:`audio`,woff:`font`,woff2:`font`,ttf:`font`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`settings`,env:`tune`,lock:`lock`,log:`log`,zip:`zip`,sh:`console`,bash:`console`,zsh:`console`,fish:`console`,ps1:`powershell`,bat:`console`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`h`,cpp:`cpp`,hpp:`hpp`,cs:`csharp`,php:`php`,lua:`lua`,dart:`dart`,ex:`elixir`,exs:`elixir`,zig:`zig`,sql:`database`,graphql:`graphql`,gql:`graphql`,prisma:`prisma`,proto:`proto`,wasm:`webassembly`},z_={toml:`toml_light`,pnpm:`pnpm_light`,bun:`bun_light`},B_={agent:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff5252" d="M2.636 24H6v-8H2.636a.63.63 0 0 0-.636.625v6.75a.63.63 0 0 0 .636.625M26 16v8h3.364c.351 0 .636-.355.636-.7v-6.675a.63.63 0 0 0-.636-.625zM17.417 6H14.69a.63.63 0 0 0-.636.625V12H8.69a.63.63 0 0 0-.636.625L8 25.375c0 .345.305.625.637.625h14.727a.63.63 0 0 0 .636-.625v-12.75a.63.63 0 0 0-.636-.625h-5.31V6.625A.63.63 0 0 0 17.416 6m-5.363 8c1.781 0 2.674 2.154 1.414 3.414s-3.414.368-3.414-1.414a2 2 0 0 1 2-2M22 24H10v-2h12zm-1.946-10c1.781 0 2.674 2.154 1.414 3.414s-3.414.368-3.414-1.414a2 2 0 0 1 2-2"/></svg>`,astro:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7c4dff" d="M12.106 25.849c-1.262-1.156-1.63-3.586-1.105-5.346a5.18 5.18 0 0 0 3.484 1.66 9.68 9.68 0 0 0 5.882-.734c.215-.106.413-.247.648-.39a3.5 3.5 0 0 1 .16 1.555 4.26 4.26 0 0 1-1.798 3.021c-.404.3-.832.569-1.25.852a2.613 2.613 0 0 0-1.15 3.372l.048.161a3.4 3.4 0 0 1-1.5-1.285 3.6 3.6 0 0 1-.578-1.962 9 9 0 0 0-.05-1.037c-.114-.831-.504-1.204-1.238-1.225a1.45 1.45 0 0 0-1.507 1.18c-.012.056-.028.112-.046.178M4.901 20a17.75 17.75 0 0 1 7.4-2l2.913-8.38a.765.765 0 0 1 1.527 0L19.7 18a14.24 14.24 0 0 1 7.399 2S20.704 2.877 20.692 2.842C20.51 2.33 20.202 2 19.787 2h-7.619c-.415 0-.71.33-.904.842z"/></svg>`,audio:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ef5350" d="M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2m6 10h-4v8a4 4 0 1 1-4-4 3.96 3.96 0 0 1 2 .555V8h6Z"/></svg>`,bun:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#fff8e1" d="M30 17.045a9.8 9.8 0 0 0-.32-2.306l-.004.034a11.2 11.2 0 0 0-5.762-6.786c-3.495-1.89-5.243-3.326-6.8-3.811h.003c-1.95-.695-3.949.82-5.825 1.927-4.52 2.481-9.573 5.45-9.28 11.417.008-.029.017-.052.026-.08a9.97 9.97 0 0 0 3.934 7.257l-.01-.006C13.747 31.473 30.05 27.292 30 17.045"/><path fill="#37474f" d="M19.855 20.236A.8.8 0 0 0 19.26 20h-6.514a.8.8 0 0 0-.596.236.51.51 0 0 0-.137.463 4.37 4.37 0 0 0 1.641 2.339 4.2 4.2 0 0 0 2.349.926 4.2 4.2 0 0 0 2.343-.926 4.37 4.37 0 0 0 1.642-2.339.5.5 0 0 0-.132-.463Z"/><ellipse cx="22.5" cy="18.5" fill="#f8bbd0" rx="2.5" ry="1.5"/><ellipse cx="9.5" cy="18.5" fill="#f8bbd0" rx="2.5" ry="1.5"/><circle cx="10" cy="16" r="2" fill="#37474f"/><circle cx="22" cy="16" r="2" fill="#37474f"/><path fill="#455a64" d="M9.996 18A2 2 0 1 0 8 15.996V16a2 2 0 0 0 1.996 2"/><circle cx="9" cy="15" r="1" fill="#fafafa"/><circle cx="21" cy="15" r="1" fill="#fafafa"/></svg>`,bun_light:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#fff8e1" d="M15.696 27.002a13.73 13.73 0 0 1-9.071-3.062 8.86 8.86 0 0 1-3.6-6.505c-.252-5.091 3.813-7.747 8.748-10.455.28-.165.537-.322.793-.48a7.8 7.8 0 0 1 3.52-1.5 2 2 0 0 1 .695.118 14.8 14.8 0 0 1 2.95 1.576c.972.6 2.182 1.348 3.707 2.173a10.14 10.14 0 0 1 5.274 6.147A8.8 8.8 0 0 1 29 17.035a8.15 8.15 0 0 1-2.525 5.959 15.6 15.6 0 0 1-10.778 4.008Z"/><path fill="#37474f" d="M16.087 6a1 1 0 0 1 .358.06l.038.013.037.012a14.5 14.5 0 0 1 2.684 1.46 72 72 0 0 0 3.767 2.205 9.17 9.17 0 0 1 4.767 5.493A8 8 0 0 1 28 17.055a7.18 7.18 0 0 1-2.234 5.233 14.6 14.6 0 0 1-10.07 3.714 12.74 12.74 0 0 1-8.415-2.816l-.027-.024-.029-.023a7.98 7.98 0 0 1-3.202-5.758c-.223-4.516 3.431-6.89 8.231-9.525l.027-.015.027-.015q.389-.231.783-.474A7.4 7.4 0 0 1 16.087 6m0-2c-1.618 0-3.248 1.19-4.795 2.103-4.52 2.481-9.56 5.41-9.267 11.376a9.9 9.9 0 0 0 3.942 7.215 14.77 14.77 0 0 0 9.73 3.308c7.122 0 14.335-4.134 14.303-10.957a9.6 9.6 0 0 0-.322-2.29 11.16 11.16 0 0 0-5.764-6.768c-3.495-1.89-5.242-3.326-6.798-3.811A3 3 0 0 0 16.086 4Z"/><path fill="#37474f" d="M19.855 20.236A.8.8 0 0 0 19.26 20h-6.514a.8.8 0 0 0-.596.236.51.51 0 0 0-.137.463 4.37 4.37 0 0 0 1.641 2.339 4.2 4.2 0 0 0 2.349.926 4.2 4.2 0 0 0 2.343-.926 4.37 4.37 0 0 0 1.642-2.339.5.5 0 0 0-.132-.463Z"/><ellipse cx="22.5" cy="18.5" fill="#f8bbd0" rx="2.5" ry="1.5"/><ellipse cx="9.5" cy="18.5" fill="#f8bbd0" rx="2.5" ry="1.5"/><circle cx="10" cy="16" r="2" fill="#37474f"/><circle cx="22" cy="16" r="2" fill="#37474f"/><path fill="#455a64" d="M9.996 18A2 2 0 1 0 8 15.996V16a2 2 0 0 0 1.996 2"/><circle cx="9" cy="15" r="1" fill="#fafafa"/><circle cx="21" cy="15" r="1" fill="#fafafa"/></svg>`,c:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>`,changelog:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#8bc34a" d="M13 3a9 9 0 0 0-9 9H1l4 4 4-4H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.95 8.95 0 0 0 13 21a9 9 0 0 0 0-18m-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"/></svg>`,console:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,contributing:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ffca28" d="M17 9H7V7h10m0 6H7v-2h10m-3 6H7v-2h7M12 3a1 1 0 0 1 1 1 1 1 0 0 1-1 1 1 1 0 0 1-1-1 1 1 0 0 1 1-1m7 0h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2"/></svg>`,cpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,csharp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,css:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>`,dart:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#4fc3f7" d="M16.83 2a1.3 1.3 0 0 0-.916.377l-.013.01L7.323 7.34l8.556 8.55v.005l10.283 10.277 1.96-3.529-7.068-16.96-3.299-3.297A1.3 1.3 0 0 0 16.828 2Z"/><path fill="#01579b" d="m7.343 7.32-4.955 8.565-.01.013a1.297 1.297 0 0 0 .004 1.835l.005.005 4.106 4.107 16.064 6.314 3.632-2.015-.098-.098-.025.002L15.995 15.97h-.012z"/><path fill="#01579b" d="m7.321 7.324 8.753 8.755h.013L26.16 26.156l3.835-.73L30 14.089l-4.049-3.965a6.5 6.5 0 0 0-3.618-1.612l.002-.043L7.323 7.325Z"/><path fill="#64b5f6" d="m7.332 7.335 8.758 8.75v.013l10.079 10.071L25.436 30H14.09l-3.967-4.048a6.5 6.5 0 0 1-1.611-3.618l-.045.004Z"/></svg>`,database:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>`,docker:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M21.81 10.25c-.06-.04-.56-.43-1.64-.43-.28 0-.56.03-.84.08-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17-.18.27c-.24.36-.43.77-.51 1.19-.2.8-.08 1.56.33 2.21-.49.28-1.29.35-1.46.35H2.62c-.34 0-.62.28-.62.63 0 1.15.18 2.3.58 3.38.45 1.19 1.13 2.07 2 2.61.98.6 2.59.94 4.42.94.79 0 1.61-.07 2.42-.22 1.12-.2 2.2-.59 3.19-1.16A8.3 8.3 0 0 0 16.78 16c1.05-1.17 1.67-2.5 2.12-3.65h.19c1.14 0 1.85-.46 2.24-.85.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43 0h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47 0h1.75c.1 0 .17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08 0-.15.07-.15.16v1.58c0 .09.06.16.15.16m2.44 0h1.77c.08 0 .15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16M6.28 9h1.76c.08 0 .16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09 0-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47 0h1.75c.1 0 .17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08 0-.15.06-.15.16v1.57c0 .09.06.18.15.18m2.44 0h1.77c.08 0 .15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08 0-.15.06-.15.16v1.57c0 .09.07.18.15.18m0-2.28h1.77c.08 0 .15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08 0-.15.06-.15.17v1.56c0 .08.07.16.15.16m2.46 4.52h1.76c.09 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16"/></svg>`,document:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,editorconfig:`<svg xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" image-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 3473 3473"><path fill="#ede7f6" d="M989.342 1977.409c41.146-26.835 75.137-93.922 54.564-141.33-56.353 24.151-53.67 79.61-54.564 141.33m636.877 153.851c44.724-14.311 87.66-64.402 63.509-116.283-34.886 24.151-57.248 57.247-63.51 116.284z"/><g fill="#fafafa"><path d="M374.827 2871.899c0 56.352 14.312 117.178 53.67 138.645 144.907 81.4 652.977 17.89 825.614-20.573 90.343-20.573 163.692-87.66 248.668-124.334 191.421-83.187 330.067-150.274 483.025-262.085 110.916-81.399 287.131-310.388 305.915-447.245l-151.169-33.991c-3.578 153.852-38.463 188.737-175.32 224.517-92.132 25.046-271.925 30.413-365.846 14.312-124.334-20.574-180.687-85.871-237.04-160.114-109.128-144.907 24.151-245.985-148.485-255.824-181.582 222.728-501.81 62.614-642.244 40.252-59.93 86.765-200.366 650.294-198.577 779.1 86.766-29.517 141.33 2.684 219.15 33.097 275.503 106.444 34.885 200.366-75.137 172.636-75.137-17.89-98.394-67.086-142.224-98.393m360.48-1285.383c111.81 21.468 211.1 67.982 305.915 115.39 154.747 76.926 182.476 66.192 196.788 173.53 1.789 19.68-1.789 30.413 54.564 48.303 94.816 29.518-54.564-23.257 199.471-22.362 151.169.894 497.337 61.72 609.148 132.384 46.513 29.519 37.568 67.087 194.999 62.615-1.79-185.16-50.986-461.557-123.44-631.51-88.554-205.733-205.733-237.04-444.561-313.966-139.54-44.725-549.217-93.922-676.235-15.207-118.967 74.243-141.33 162.798-252.246 318.439-32.202 45.619-43.83 80.504-64.403 132.384"/><path d="M1720.14 1966.675c89.45 36.674-4.472 273.714-128.806 216.466-40.252-113.6 55.458-178.003 81.398-228.99-53.67-8.05-206.627-32.2-252.246-15.206-59.036 22.363-72.454 148.486-42.041 207.522 143.118 280.87 775.523 220.94 708.436 2.684-26.835-88.555-51.88-102.867-142.224-133.28-72.454-24.15-144.907-49.196-224.517-49.196m-1124.374-31.307c71.56 68.875 233.462 79.61 338.117 84.976 13.418-138.646 25.046-242.407 135.963-234.356 54.564 74.242 25.94 161.902-31.307 218.255 97.5-.894 153.852-74.242 139.54-180.687-82.293-59.036-331.856-177.109-457.084-194.104-34.885 37.569-120.756 243.301-125.229 305.916"/></g><path d="M427.602 2820.913c59.036-5.367 212.889 39.357 225.412 89.449-95.71 11.628-217.361 2.683-225.412-89.45zm-52.775 50.986c43.83 31.307 67.087 80.504 142.224 98.393 110.022 27.73 350.64-66.192 75.137-172.636-77.82-30.413-132.384-62.614-219.15-33.096-1.789-128.807 138.646-692.336 198.577-779.101 140.435 22.362 460.662 182.476 642.244-40.252 172.636 9.84 39.357 110.917 148.485 255.824 56.353 74.243 112.706 139.54 237.04 160.114 93.921 16.1 273.714 10.734 365.846-14.312 136.857-35.78 171.742-70.665 175.32-224.517l151.17 33.99c-18.785 136.858-195 365.847-305.916 447.246-152.958 111.81-291.604 178.898-483.025 262.085-84.976 36.674-158.325 103.761-248.668 124.334-172.637 38.463-680.707 101.972-825.614 20.574-39.358-21.468-53.67-82.294-53.67-138.646M1626.22 2131.26c6.261-59.037 28.623-92.133 63.508-116.284 24.152 51.88-18.784 101.972-63.508 116.284m93.921-164.586c79.61 0 152.063 25.045 224.517 49.197 90.344 30.412 115.39 44.724 142.224 133.279 67.087 218.255-565.318 278.186-708.436-2.684-30.413-59.036-16.995-185.16 42.041-207.522 45.619-16.995 198.577 7.156 252.246 15.207-25.94 50.986-121.65 115.389-81.398 228.99 124.334 57.247 218.255-179.793 128.806-216.467m-730.798 10.734c.894-61.72-1.79-117.179 54.564-141.33 20.573 47.408-13.418 114.495-54.564 141.33m-393.576-42.041c4.473-62.615 90.344-268.347 125.229-305.916 125.228 16.995 374.791 135.068 457.084 194.104 14.312 106.445-42.04 179.793-139.54 180.687 57.247-56.353 85.87-144.013 31.307-218.255-110.917-8.05-122.545 95.71-135.963 234.356-104.655-5.367-266.558-16.1-338.117-84.976m-89.449-71.56c-33.096-91.238-33.096-233.462 107.339-245.09l-71.56 199.471c-18.783 42.936-18.783 33.096-35.779 45.62zm228.99-277.292c20.573-51.88 32.201-86.765 64.403-132.384 110.917-155.641 133.279-244.196 252.246-318.439 127.018-78.715 536.694-29.518 676.235 15.207 238.828 76.926 356.007 108.233 444.561 313.966 72.454 169.953 121.65 446.35 123.44 631.51-157.43 4.472-148.486-33.096-195-62.615-111.81-70.664-457.978-131.49-609.147-132.384-254.035-.895-104.655 51.88-199.471 22.362-56.353-17.89-52.775-28.624-54.564-48.302-14.312-107.34-42.041-96.605-196.788-173.531-94.816-47.408-194.104-93.922-305.915-115.39m1583.247-43.83c-16.995-56.352 14.312-52.775 68.876-91.238 31.307-22.362 56.353-45.619 94.816-67.086 144.013-80.504 412.36-93.922 526.854 1.789 46.514 38.463 122.545 113.6 110.917 211.994-24.151 195.893-158.325 303.232-268.347 392.68-111.811 91.239-297.865 185.16-490.18 122.546-16.101-39.358-3.578-288.92-22.363-381.053-16.995-82.293-8.05-91.238 39.358-140.435 139.54-144.907 441.878-250.457 613.62-126.123 72.454 53.67 51.88 74.243 89.449 115.39 46.513-50.092-40.252-218.256-360.48-207.522-217.36 7.156-311.282 177.109-402.52 169.058m-1302.377-508.964c4.472-124.335 118.967-381.948 233.461-471.397 138.646-107.338 283.554-208.416 496.442-87.66 52.775 29.519 50.092 44.725 55.459 118.073 4.472 70.665-1.79 96.605-19.679 153.852-141.33 456.19-259.402 194.105-712.014 302.338 16.995-148.485 145.802-280.87 217.361-349.746 122.545-118.967 211.1-195.893 395.365-170.847 50.986 84.976 56.352 138.646-5.367 237.934-82.293 132.385-102.867 124.334-90.344 214.678 64.403-16.101 84.082-78.715 113.6-141.33 179.793-375.686-81.398-421.305-241.512-352.429-107.339 45.62-298.76 256.719-361.374 383.736-12.523 25.046-25.94 57.248-37.568 84.977zm708.436 18.784c18.784-111.811 129.7-139.54 129.7-483.92 0-148.485-182.475-281.764-421.304-182.475-204.838 84.082-236.145 148.485-345.273 313.071-102.867 155.642-99.289 326.49-187.843 470.502-25.94 41.147-49.197 55.458-77.82 96.605-20.574 30.413-35.78 68.876-56.354 104.655-42.04 68.876-84.976 118.968-118.967 201.26-107.339 2.684-197.682 4.473-208.416 115.39-14.312 152.063 57.247 189.632 57.247 246.879-.894 61.72-251.351 684.285-181.581 1055.498 19.679 101.972 86.765 102.867 194.104 115.39 258.508 31.307 593.942 20.573 825.614-72.454l420.41-201.26c106.445-59.931 285.343-173.532 364.953-256.72 56.353-58.141 85.87-107.338 134.173-176.214 66.192-96.605 67.981-94.816 82.293-226.306 87.66 16.101 251.352 54.564 305.916 101.972-6.262 61.72-36.674 32.202-36.674 87.66 34.885.895 93.027-42.935 107.339-91.238-36.675-53.67-75.138-44.724-127.913-87.66 42.042-33.096 118.073-48.302 176.215-72.453 125.229-51.88 339.012-209.311 391.787-352.43 42.04-115.389 10.734-307.704-57.248-382.841-71.559-78.715-237.934-118.967-373.897-118.967-161.902 0-329.172 116.283-459.767 166.375-50.092-43.83-53.67-93.922-90.344-142.224-42.04-57.248-315.755-200.366-446.35-228.095"/><path fill="#efebe9" d="M2318.554 1542.686c91.238 8.05 185.16-161.902 402.52-169.058 320.228-10.734 406.993 157.43 360.48 207.521-37.569-41.146-16.995-61.72-89.45-115.389-171.741-124.334-474.079-18.784-613.62 126.123-47.407 49.197-56.352 58.142-39.357 140.435 18.785 92.133 6.262 341.695 22.362 381.053 192.316 62.614 378.37-31.307 490.181-122.545 110.022-89.45 244.196-196.788 268.347-392.681 11.628-98.394-64.403-173.531-110.917-211.994-114.494-95.71-382.841-82.293-526.854-1.79-38.463 21.468-63.51 44.725-94.816 67.087-54.564 38.464-85.871 34.886-68.876 91.238m-1302.377-508.964 43.83-77.821c11.628-27.73 25.045-59.93 37.568-84.977 62.614-127.017 254.035-338.117 361.374-383.736 160.114-68.876 421.305-23.257 241.512 352.43-29.518 62.614-49.197 125.228-113.6 141.329-12.523-90.344 8.05-82.293 90.344-214.678 61.72-99.288 56.353-152.958 5.367-237.934-184.265-25.046-272.82 51.88-395.365 170.847-71.56 68.876-200.366 201.26-217.361 349.746 452.612-108.233 570.685 153.852 712.014-302.338 17.89-57.247 24.151-83.187 19.679-153.852-5.367-73.348-2.684-88.554-55.459-118.073-212.888-120.756-357.796-19.678-496.442 87.66-114.494 89.45-228.989 347.062-233.461 471.397"/><path fill="#eee" d="M506.317 1863.808c16.996-12.523 16.996-2.683 35.78-45.619l71.559-199.47c-140.435 11.627-140.435 153.851-107.339 245.09z"/><path fill="#efebe9" d="M653.014 2910.362c-12.523-50.092-166.376-94.816-225.412-89.45 8.05 92.133 129.701 101.078 225.412 89.45"/></svg>`,elixir:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#9575cd" d="M12.173 22.681c-3.86 0-6.99-3.64-6.99-8.13 0-3.678 2.773-8.172 4.916-10.91 1.014-1.296 2.93-2.322 2.93-2.322s-.982 5.239 1.683 7.319c2.366 1.847 4.106 4.25 4.106 6.363 0 4.232-2.784 7.68-6.645 7.68"/></svg>`,eslint:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#3f51b5" d="M22.713 4H9.287a.5.5 0 0 0-.432.248l-6.708 11.5a.5.5 0 0 0 0 .504l6.708 11.5a.5.5 0 0 0 .432.248h13.426a.5.5 0 0 0 .432-.248l6.708-11.5a.5.5 0 0 0 0-.504l-6.708-11.5A.5.5 0 0 0 22.713 4m-6.937 20.888-7.5-3.75A.5.5 0 0 1 8 20.691v-9.382a.5.5 0 0 1 .276-.447l7.5-3.75a.5.5 0 0 1 .448 0l7.5 3.75a.5.5 0 0 1 .276.447v9.382a.5.5 0 0 1-.276.447l-7.5 3.75a.5.5 0 0 1-.448 0"/><path fill="#7986cb" d="M22 19.441v-6.882a.5.5 0 0 0-.276-.447l-5.5-2.75a.5.5 0 0 0-.448 0l-5.5 2.75a.5.5 0 0 0-.276.447v6.882a.5.5 0 0 0 .276.447l5.5 2.75a.5.5 0 0 0 .448 0l5.5-2.75a.5.5 0 0 0 .276-.447"/></svg>`,file:`<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8.668 6h3.6641l-3.6641-3.668v3.668m-4.668-4.668h5.332l4 4v8c0 0.73828-0.59375 1.3359-1.332 1.3359h-8c-0.73828 0-1.332-0.59766-1.332-1.3359v-10.664c0-0.74219 0.59375-1.3359 1.332-1.3359m3.332 1.3359h-3.332v10.664h8v-6h-4.668z" fill="#90a4ae" /></svg>`,font:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M24 28h4L18 4h-4L4 28h4l8-19.422"/><path fill="#f44336" d="M8 20h16v4H8z"/></svg>`,gemfile:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e53935" d="M21.184 10.016V10H10.881l.016.033-.016-.017L8 14l8.032 10L24 14z"/><path fill="#e53935" d="m16 3.455 11 6.286v12.518l-11 6.286-11-6.286V9.741zM16 0 2 8v16l14 8 14-8V8z"/></svg>`,git:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e64a19" d="M13.172 2.828 11.78 4.22l1.91 1.91 2 2A2.986 2.986 0 0 1 20 10.81a3.25 3.25 0 0 1-.31 1.31l2.06 2a2.68 2.68 0 0 1 3.37.57 2.86 2.86 0 0 1 .88 2.117 3.02 3.02 0 0 1-.856 2.109A2.9 2.9 0 0 1 23 19.81a2.93 2.93 0 0 1-2.13-.87 2.694 2.694 0 0 1-.56-3.38l-2-2.06a3 3 0 0 1-.31.12V20a3 3 0 0 1 1.44 1.09 2.92 2.92 0 0 1 .56 1.72 2.88 2.88 0 0 1-.878 2.128 2.98 2.98 0 0 1-2.048.871 2.981 2.981 0 0 1-2.514-4.719A3 3 0 0 1 16 20v-6.38a2.96 2.96 0 0 1-1.44-1.09 2.9 2.9 0 0 1-.56-1.72 2.9 2.9 0 0 1 .31-1.31l-3.9-3.9-7.579 7.572a4 4 0 0 0-.001 5.658l10.342 10.342a4 4 0 0 0 5.656 0l10.344-10.344a4 4 0 0 0 0-5.656L18.828 2.828a4 4 0 0 0-5.656 0"/></svg>`,go:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>`,"go-mod":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#ec407a" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>`,graphql:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M6 20h20v2H6z"/><circle cx="7" cy="21" r="3" fill="#ec407a"/><circle cx="16" cy="27" r="3" fill="#ec407a"/><circle cx="25" cy="21" r="3" fill="#ec407a"/><path fill="#ec407a" d="M6 10h20v2H6z"/><circle cx="7" cy="11" r="3" fill="#ec407a"/><circle cx="16" cy="5" r="3" fill="#ec407a"/><circle cx="25" cy="11" r="3" fill="#ec407a"/><path fill="#ec407a" d="M6 12h2v10H6zm18-2h2v12h-2z"/><path fill="#ec407a" d="m5.014 19.41 11.674 6.866L15.674 28 4 21.134z"/><path fill="#ec407a" d="M26.688 21.724 15.014 28.59 14 26.866 25.674 20zM5.124 10.382l11.415-7.29 1.077 1.686L6.2 12.068z"/><path fill="#ec407a" d="m25.798 12.067-11.415-7.29 1.077-1.685 11.415 7.29zM6.2 19.932l11.416 7.29-1.077 1.686-11.415-7.29z"/><path fill="#ec407a" d="m26.875 21.619-11.415 7.29-1.077-1.687 11.415-7.289zM5.877 22.6 16.04 3.686l1.762.946L7.638 23.546z"/><path fill="#ec407a" d="M24.361 23.545 14.197 4.633l1.761-.947 10.165 18.913z"/></svg>`,h:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M18.5 11a5.49 5.49 0 0 0-4.5 2.344V4H8v24h6V17a2 2 0 0 1 4 0v11h6V16.5a5.5 5.5 0 0 0-5.5-5.5"/></svg>`,hpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 6V2h-2v4h-6V2h-2v4h-4v2h4v4h2V8h6v4h2V8h4V6zm-15.5 5A5.49 5.49 0 0 0 8 13.344V4H2v24h6V17a2 2 0 0 1 4 0v11h6V16.5a5.5 5.5 0 0 0-5.5-5.5"/></svg>`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>`,image:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#26a69a" d="M8.5 6h4l-4-4zM3.875 1H9.5l4 4v8.6c0 .773-.616 1.4-1.375 1.4h-8.25c-.76 0-1.375-.627-1.375-1.4V2.4c0-.777.612-1.4 1.375-1.4M4 13.6h8V8l-2.625 2.8L8 9.4zm1.25-7.7c-.76 0-1.375.627-1.375 1.4s.616 1.4 1.375 1.4c.76 0 1.375-.627 1.375-1.4S6.009 5.9 5.25 5.9"/></svg>`,java:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>`,javascript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,jsconfig:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#757575" d="M15 2H6a2.006 2.006 0 0 0-2 2v22a2.006 2.006 0 0 0 2 2h6v-4H6v-2h6v-2H6v-2h6v-2H6v-2h6v-2h2V4l8 8h2v-1Z" data-mit-no-recolor="true"/><path fill="#ffca28" d="M12 12v18h18V12zm8 12a2.006 2.006 0 0 1-2 2h-2a2.006 2.006 0 0 1-2-2v-2h2v2h2v-8h2zm8-6h-4v2h2a2.006 2.006 0 0 1 2 2v2a2.006 2.006 0 0 1-2 2h-4v-2h4v-2h-2a2.006 2.006 0 0 1-2-2v-2a2.006 2.006 0 0 1 2-2h4z"/></svg>`,json:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>`,kotlin:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="file-icon-kotlin-a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#file-icon-kotlin-a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>`,less:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0277bd" d="M8 3a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2H3v2h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h2v-2H8v-5a2 2 0 0 0-2-2 2 2 0 0 0 2-2V5h2V3m6 0a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1v2h-1a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2v-2h2v-5a2 2 0 0 1 2-2 2 2 0 0 1-2-2V5h-2V3z"/></svg>`,license:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff5722" d="M8 1a5.5 5.5 0 0 0-4 9.26V15l4-1.5 4 1.5v-4.74A5.49 5.49 0 0 0 8 1m0 1.5a4 4 0 1 1 0 8 4 4 0 0 1 0-8m0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4"/></svg>`,lock:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffd54f" d="M25 12h-3V8a6 6 0 0 0-12 0v4H7a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V13a1 1 0 0 0-1-1M14 8a2 2 0 0 1 4 0v4h-4Zm2 17a4 4 0 1 1 4-4 4 4 0 0 1-4 4"/></svg>`,log:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#afb42b" d="M19 5v9h-5v5H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10l6-6V5c0-1.1-.9-2-2-2m-7 11H7v-2h5zm5-4H7V8h10z"/></svg>`,lua:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="M30 6a3.86 3.86 0 0 1-1.167 2.833 4.024 4.024 0 0 1-5.666 0A3.86 3.86 0 0 1 22 6a3.86 3.86 0 0 1 1.167-2.833 4.024 4.024 0 0 1 5.666 0A3.86 3.86 0 0 1 30 6m-9.208 5.208A10.6 10.6 0 0 0 13 8a10.6 10.6 0 0 0-7.792 3.208A10.6 10.6 0 0 0 2 19a10.6 10.6 0 0 0 3.208 7.792A10.6 10.6 0 0 0 13 30a10.6 10.6 0 0 0 7.792-3.208A10.6 10.6 0 0 0 24 19a10.6 10.6 0 0 0-3.208-7.792m-1.959 7.625a4.024 4.024 0 0 1-5.666 0 4.024 4.024 0 0 1 0-5.666 4.024 4.024 0 0 1 5.666 0 4.024 4.024 0 0 1 0 5.666"/></svg>`,makefile:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ef5350" d="m29.5 24.02-1.6-.92a4.4 4.4 0 0 0 .09-.9A1.3 1.3 0 0 0 28 22a5.6 5.6 0 0 0-.1-1.1l1.6-.92a.493.493 0 0 0 .18-.68l-1.5-2.6a.45.45 0 0 0-.18-.18V6.01a2.006 2.006 0 0 0-2-2H4a2.006 2.006 0 0 0-2 2V22a2.006 2.006 0 0 0 2 2h10.53l-.03.02a.493.493 0 0 0-.18.68l1.5 2.6a.493.493 0 0 0 .68.18l1.6-.92a5.9 5.9 0 0 0 1.9 1.09v1.85a.495.495 0 0 0 .5.5h3a.495.495 0 0 0 .5-.5v-1.85a5.9 5.9 0 0 0 1.9-1.09l1.6.92a.493.493 0 0 0 .68-.18l1.5-2.6a.493.493 0 0 0-.18-.68M24 22.01a1.99 1.99 0 0 1-.88 1.65l-.18.11a2.04 2.04 0 0 1-1.88 0l-.18-.11a1.99 1.99 0 0 1-.88-1.65V22a2 2 0 0 1 .88-1.66l.18-.11a2.04 2.04 0 0 1 1.88 0l.18.11A2 2 0 0 1 24 22Zm2-4.63-.1.06a5.9 5.9 0 0 0-1.9-1.09V14.5a.495.495 0 0 0-.5-.5h-3a.495.495 0 0 0-.5.5v1.85a5.9 5.9 0 0 0-1.9 1.09l-1.6-.92a.493.493 0 0 0-.68.18l-1.5 2.6a.493.493 0 0 0 .18.68l1.6.92A5.6 5.6 0 0 0 16 22v.01L4 22V10.01h22Z"/></svg>`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`,mdx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`,nodejs:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#8bc34a" d="M16 20.003v2h4a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-2v-2h4v-2h-4a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2v2Z"/><path fill="#8bc34a" d="m16 3.003-12 7v14l4 2h6v-13.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v11.5H8l-2-1.034V11.15l10-5.833 10 5.833v11.703l-10 5.833-1.745-1.022L13 29.253l3 1.75 12-7v-14Z"/></svg>`,npm:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e53935" d="M4 4v24h24V4Zm20 20h-4V12h-4v12H8V8h16Z"/></svg>`,pdf:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ef5350" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m4.93 10.44c.41.9.93 1.64 1.53 2.15l.41.32c-.87.16-2.07.44-3.34.93l-.11.04.5-1.04c.45-.87.78-1.66 1.01-2.4m6.48 3.81c.18-.18.27-.41.28-.66.03-.2-.02-.39-.12-.55-.29-.47-1.04-.69-2.28-.69l-1.29.07-.87-.58c-.63-.52-1.2-1.43-1.6-2.56l.04-.14c.33-1.33.64-2.94-.02-3.6a.85.85 0 0 0-.61-.24h-.24c-.37 0-.7.39-.79.77-.37 1.33-.15 2.06.22 3.27v.01c-.25.88-.57 1.9-1.08 2.93l-.96 1.8-.89.49c-1.2.75-1.77 1.59-1.88 2.12-.04.19-.02.36.05.54l.03.05.48.31.44.11c.81 0 1.73-.95 2.97-3.07l.18-.07c1.03-.33 2.31-.56 4.03-.75 1.03.51 2.24.74 3 .74.44 0 .74-.11.91-.3m-.41-.71.09.11c-.01.1-.04.11-.09.13h-.04l-.19.02c-.46 0-1.17-.19-1.9-.51.09-.1.13-.1.23-.1 1.4 0 1.8.25 1.9.35M7.83 17c-.65 1.19-1.24 1.85-1.69 2 .05-.38.5-1.04 1.21-1.69zm3.02-6.91c-.23-.9-.24-1.63-.07-2.05l.07-.12.15.05c.17.24.19.56.09 1.1l-.03.16-.16.82z"/></svg>`,php:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>`,pnpm:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e0e0e0" d="M2 22h8v8H2zm10 0h8v8h-8zm10 0h8v8h-8zM12 12h8v8h-8z"/><path fill="#ffb300" d="M2 2h8v8H2zm10 0h8v8h-8zm10 0h8v8h-8zm0 10h8v8h-8z"/></svg>`,pnpm_light:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#757575" d="M2 22h8v8H2zm10 0h8v8h-8zm10 0h8v8h-8zM12 12h8v8h-8z"/><path fill="#ffb300" d="M2 2h8v8H2zm10 0h8v8h-8zm10 0h8v8h-8zm0 10h8v8h-8z"/></svg>`,powershell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>`,prettier:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#f44336" d="M2 8h4v1H2zm0 6h4v1H2zm9-10h3v1h-3zM2 2h3v1H2z"/><path fill="#f9a825" d="M9 2h3v1H9zm1 4h4v1h-4zm-5 6h1v1H5zm-3-2h6v1H2z"/><path fill="#26a69a" d="M2 12h3v1H2zm7-4h5v1H9zM2 4h4v1H2zm3-2h4v1H5z"/><path fill="#ba68c8" d="M2 6h3v1H2zm7-2h2v1H9zm-1 6h4v1H8z"/></svg>`,prisma:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bfa5" d="m27.777 22.617-.459-.946L18.43 3.26a2.25 2.25 0 0 0-1.914-1.256A2 2 0 0 0 16.379 2a2.23 2.23 0 0 0-1.891 1.042L4.348 19.056a2.2 2.2 0 0 0 .025 2.417l4.957 7.488A2.34 2.34 0 0 0 11.29 30a2.4 2.4 0 0 0 .655-.092l14.387-4.149a2.32 2.32 0 0 0 1.458-1.234 2.21 2.21 0 0 0-.013-1.908m-3.538.604-11.268 3.25 4.075-19.033 7.568 15.671-.376.098Z"/></svg>`,proto:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bfa5" d="M16 27 2 19v-5l14 8z"/><path fill="#ffeb3b" d="m30 14-14 8v5l14-8z"/><path fill="#ff5722" d="M16 6 2 14v5l14-8z"/><path fill="#00e676" d="m30 19-14-8V6l14 8z"/><path fill="#03a9f4" d="M16 27 2 19v-5l14 8z"/></svg>`,python:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>`,"python-misc":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#757575" d="M15 2H6a2.006 2.006 0 0 0-2 2v22a2.006 2.006 0 0 0 2 2h16a2 2 0 0 0 2-2V11Zm3 22H6v-2h12Zm0-4H6v-2h12Zm0-4H6v-2h12Zm-4-4V4l8 8Z"/><path fill="#fbc02d" d="M30.714 16H28v5h-9v7.714A1.286 1.286 0 0 0 20.286 30h6.428A1.286 1.286 0 0 0 28 28.714V26h-6v-1h8.714A1.286 1.286 0 0 0 32 23.714v-6.428A1.286 1.286 0 0 0 30.714 16M24 28h3v1h-3Z" style="isolation:isolate"/><path fill="#0288d1" d="M25.714 12h-6.428A1.286 1.286 0 0 0 18 13.286V16h6v1h-8.714A1.286 1.286 0 0 0 14 18.286v6.428A1.286 1.286 0 0 0 15.286 26H18v-6h9v-6.714A1.286 1.286 0 0 0 25.714 12M22 14h-3v-1h3Z" style="isolation:isolate"/></svg>`,react:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,react_ts:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,readme:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 1C4.136 1 1 4.136 1 8s3.136 7 7 7 7-3.136 7-7-3.136-7-7-7m1 11H7V7.5h2zm0-6H7V4h2z"/></svg>`,ruby:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>`,rust:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>`,sass:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>`,settings:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.49.49 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.6.6 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1q.09.03.18.03c.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73s-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"/></svg>`,svelte:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><path fill="#ff5722" d="M175.94 24.328c-13.037.252-26.009 3.872-37.471 11.174L79.912 72.818a67.13 67.13 0 0 0-30.355 44.906 70.8 70.8 0 0 0 6.959 45.445 67.2 67.2 0 0 0-10.035 25.102 71.54 71.54 0 0 0 12.236 54.156c23.351 33.41 69.468 43.311 102.81 22.07l58.559-37.158a67.36 67.36 0 0 0 30.355-44.906 70.77 70.77 0 0 0-6.982-45.422 67.65 67.65 0 0 0 10.059-25.102 71.63 71.63 0 0 0-12.236-54.156v-.18c-15.324-21.925-40.453-33.727-65.342-33.246zm5.137 28.68a46.5 46.5 0 0 1 36.09 19.969 42.98 42.98 0 0 1 7.365 32.557 45 45 0 0 1-1.393 5.455l-1.123 3.37-2.986-2.247a75.9 75.9 0 0 0-22.902-11.45l-2.244-.651.201-2.246a13.16 13.16 0 0 0-2.379-8.711 13.99 13.99 0 0 0-14.953-5.412 12.8 12.8 0 0 0-3.594 1.572l-58.578 37.25a12.24 12.24 0 0 0-5.502 8.15 13.1 13.1 0 0 0 2.246 9.834 14.03 14.03 0 0 0 14.93 5.569 13.5 13.5 0 0 0 3.594-1.573l22.453-14.234a41.8 41.8 0 0 1 11.898-5.232 46.48 46.48 0 0 1 49.914 18.502 43.02 43.02 0 0 1 7.363 32.557 40.42 40.42 0 0 1-18.254 27.078l-58.58 37.316a43 43 0 0 1-11.898 5.23A46.545 46.545 0 0 1 82.81 227.14a42.98 42.98 0 0 1-7.341-32.557 38 38 0 0 1 1.39-5.41l1.102-3.37 3.008 2.246a75.9 75.9 0 0 0 22.836 11.361l2.244.65-.201 2.247a13.25 13.25 0 0 0 2.447 8.644 14.03 14.03 0 0 0 15.043 5.569 13.1 13.1 0 0 0 3.592-1.573l58.467-37.316a12.17 12.17 0 0 0 5.502-8.173 12.96 12.96 0 0 0-2.246-9.811 14.03 14.03 0 0 0-15.043-5.568 12.8 12.8 0 0 0-3.592 1.57l-22.453 14.258a42.9 42.9 0 0 1-11.877 5.209 46.52 46.52 0 0 1-49.846-18.5 43.02 43.02 0 0 1-7.297-32.557A40.42 40.42 0 0 1 96.798 96.98l58.646-37.316a42.8 42.8 0 0 1 11.811-5.21 46.5 46.5 0 0 1 13.822-1.444z"/></svg>`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffb300" d="M29.168 14.03a2.7 2.7 0 0 0-1.968-.83 2.51 2.51 0 0 0-1.929.8h-4.443l3.078-3.078a2.835 2.835 0 0 0 2.857-2.842 2.6 2.6 0 0 0-.831-1.969 2.82 2.82 0 0 0-2.014-.788 2.67 2.67 0 0 0-1.968.788 2.36 2.36 0 0 0-.812 1.922L18 11.17V6.726a2.51 2.51 0 0 0 .8-1.929 2.7 2.7 0 0 0-.832-1.968 2.745 2.745 0 0 0-3.936 0 2.7 2.7 0 0 0-.832 1.968 2.51 2.51 0 0 0 .8 1.93v4.443l-3.138-3.138a2.36 2.36 0 0 0-.812-1.922 2.66 2.66 0 0 0-1.968-.788 2.83 2.83 0 0 0-2.014.788 2.6 2.6 0 0 0-.831 1.969 2.74 2.74 0 0 0 .831 2.013 2.8 2.8 0 0 0 2.026.829l3.078 3.078H6.729a2.51 2.51 0 0 0-1.929-.8 2.7 2.7 0 0 0-1.968.831 2.745 2.745 0 0 0 0 3.937 2.7 2.7 0 0 0 1.968.832 2.51 2.51 0 0 0 1.929-.8h4.443l-3.078 3.077a2.835 2.835 0 0 0-2.857 2.842 2.6 2.6 0 0 0 .831 1.969 2.82 2.82 0 0 0 2.014.788 2.67 2.67 0 0 0 1.968-.788 2.36 2.36 0 0 0 .812-1.922L14 20.827v4.444a2.51 2.51 0 0 0-.8 1.929 2.784 2.784 0 0 0 4.768 1.968A2.7 2.7 0 0 0 18.8 27.2a2.51 2.51 0 0 0-.8-1.929v-4.444l3.138 3.138a2.36 2.36 0 0 0 .812 1.922 2.66 2.66 0 0 0 1.968.788 2.83 2.83 0 0 0 2.014-.788 2.6 2.6 0 0 0 .831-1.969 2.74 2.74 0 0 0-.831-2.013 2.8 2.8 0 0 0-2.026-.829L20.828 18h4.443a2.51 2.51 0 0 0 1.93.8 2.784 2.784 0 0 0 1.967-4.769Z"/></svg>`,swift:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff6e40" d="M17.087 19.721c-2.36 1.36-5.59 1.5-8.86.1a13.8 13.8 0 0 1-6.23-5.32c.67.55 1.46 1 2.3 1.4 3.37 1.57 6.73 1.46 9.1 0-3.37-2.59-6.24-5.96-8.37-8.71-.45-.45-.78-1.01-1.12-1.51 8.28 6.05 7.92 7.59 2.41-1.01 4.89 4.94 9.43 7.74 9.43 7.74.16.09.25.16.36.22.1-.25.19-.51.26-.78.79-2.85-.11-6.12-2.08-8.81 4.55 2.75 7.25 7.91 6.12 12.24-.03.11-.06.22-.05.39 2.24 2.83 1.64 5.78 1.35 5.22-1.21-2.39-3.48-1.65-4.62-1.17"/></svg>`,table:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m7 1.5V9h5.5zm4 7.5h-4v2h1l-2 1.67L10 13h1v-2H7v2h1l3 2.5L8 18H7v2h4v-2h-1l2-1.67L14 18h-1v2h4v-2h-1l-3-2.5 3-2.5h1z"/></svg>`,tailwindcss:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#4db6ac" d="M23.5 12H8c.89-2.3 4.02-4 7.75-4s6.86 1.7 7.75 4M14 12h15.5c-.89 2.3-4.02 4-7.75 4s-6.86-1.7-7.75-4m3.5 8H2c.89-2.3 4.02-4 7.75-4s6.86 1.7 7.75 4M8 20h15.5c-.89 2.3-4.02 4-7.75 4S8.89 22.3 8 20"/></svg>`,toml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#cfd8dc" d="M4 6V4h8v2H9v7H7V6z"/><path fill="#ef5350" d="M4 1v1H2v12h2v1H1V1zm8 0v1h2v12h-2v1h3V1z"/></svg>`,toml_light:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#455a64" d="M4 6V4h8v2H9v7H7V6z"/><path fill="#ef5350" d="M4 1v1H2v12h2v1H1V1zm8 0v1h2v12h-2v1h3V1z"/></svg>`,tsconfig:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#757575" d="M15 2H6a2.006 2.006 0 0 0-2 2v22a2.006 2.006 0 0 0 2 2h6v-4H6v-2h6v-2H6v-2h6v-2H6v-2h6v-2h2V4l8 8h2v-1Z" data-mit-no-recolor="true"/><path fill="#0288d1" d="M12 12v18h18V12Zm8 6h-2v8h-2v-8h-2v-2h6Zm8 0h-4v2h2a2.006 2.006 0 0 1 2 2v2a2.006 2.006 0 0 1-2 2h-4v-2h4v-2h-2a2.006 2.006 0 0 1-2-2v-2a2.006 2.006 0 0 1 2-2h4Z"/></svg>`,tune:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#fbc02d" d="M12 10h10v2H12z"/><path fill="#fbc02d" d="M16 4h2v8h-2zm4 18h10v2H20zm4 2h2v4h-2zm0-20h2v14h-2zM2 18h10v2H2z"/><path fill="#fbc02d" d="M6 18h2v10H6zM6 4h2v10H6zm10 12h2v12h-2z"/></svg>`,typescript:`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,"typescript-def":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="#0288d1"><path d="M2 2v12h12V2zm1 1h10v10H3z"/><path d="M5 7v1h1v4h1V8h1V7zm5 0a1.003 1.003 0 0 0-1 1v1a1.003 1.003 0 0 0 1 1h1v1H9v1h2a1.003 1.003 0 0 0 1-1v-1a1.003 1.003 0 0 0-1-1h-1V8h2V7z"/></g></svg>`,video:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff9800" d="m24 6 2 6h-4l-2-6h-3l2 6h-4l-2-6h-3l2 6H8L6 6H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h22a3 3 0 0 0 3-3V6Z"/></svg>`,vite:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#a0f" d="M29.313 12h-6.664a1.427 1.427 0 0 1-1.1-2.24l4.398-6.676A.703.703 0 0 0 25.397 2H8.428a.62.62 0 0 0-.55.289l-5.77 8.627A.703.703 0 0 0 2.658 12h8.175a1.427 1.427 0 0 1 1.099 2.24l-4.48 6.676A.702.702 0 0 0 8 22l6.695.002A1.34 1.34 0 0 1 16 23.375v5.934a.652.652 0 0 0 1.168.433l12.694-16.586a.725.725 0 0 0-.55-1.156"/></svg>`,vitest:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00e676" d="M15.438 29.636a.685.685 0 0 1-1.029.213L2.274 20.755A.65.65 0 0 1 2 20.187V9.175a.715.715 0 0 1 1.166-.568l7.404 5.612a1.47 1.47 0 0 0 2.125-.497l6.102-11.367A.72.72 0 0 1 19.414 2h9.872a.76.76 0 0 1 .617 1.137l-14.465 26.57Z"/></svg>`,vue:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>`,webassembly:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7c4dff" d="M22 18h4v4h-4z"/><path fill="#7c4dff" d="M20 2a4 4 0 0 1-8 0H2v28h28V2Zm-2 24h-2v2h-4v-2h-2v2H6v-2H4V16h2v10h4V16h2v10h4V16h2Zm10 2h-2v-4h-4v4h-2V18h2v-2h4v2h2Z"/></svg>`,xml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>`,yaml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>`,yarn:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M27.575 23.967a9.9 9.9 0 0 0-3.751 1.726 22.6 22.6 0 0 1-5.537 2.504 1.55 1.55 0 0 1-.931.52 59 59 0 0 1-6.11.548c-1.102.008-1.777-.282-1.965-.735a1.49 1.49 0 0 1 .82-1.965 3.6 3.6 0 0 1-.486-.359c-.163-.162-.334-.487-.385-.367-.213.52-.324 1.794-.897 2.366-.786.795-2.273.53-3.153.069-.965-.513.069-1.718.069-1.718a.69.69 0 0 1-.94-.324 4.6 4.6 0 0 1-.632-2.794 5.2 5.2 0 0 1 1.674-2.76 8.84 8.84 0 0 1 .624-4.17 9.9 9.9 0 0 1 3-3.469S7.136 11.015 7.82 9.177c.444-1.196.623-1.187.769-1.239a3.44 3.44 0 0 0 1.375-.811 4.99 4.99 0 0 1 4.178-1.607s1.094-3.357 2.12-2.7a17.4 17.4 0 0 1 1.452 2.735s1.213-.71 1.35-.445a10.74 10.74 0 0 1 .495 5.81 13.3 13.3 0 0 1-2.46 5.127c-.129.214 1.47.889 2.477 3.683.932 2.554.103 4.699.248 4.938.026.043.034.06.034.06s1.068.085 3.213-1.24a8.05 8.05 0 0 1 4.05-1.52 1.026 1.026 0 0 1 .453 2Z"/></svg>`,zig:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f9a825" d="M2 8h6v4H2zm8 0h12v4H10zm0 12h12v4H10zm14 0h2v4h-2zM8 20l-3 4H2V12h4v8zm14-8h-6l-6 8h6z"/><path fill="#f9a825" d="M16 20h-6l-6 8m12-16h6l6-8m2 4v16h-4V12h-2l3-4z"/></svg>`,zip:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#afb42b" d="M14 17h-2v-2h-2v-2h2v2h2m0-6h-2v2h2v2h-2v-2h-2V9h2V7h-2V5h2v2h2m5-4H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2"/></svg>`};function V_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=L_[t];if(n)return n;for(let e=t.indexOf(`.`,1);e!==-1;e=t.indexOf(`.`,e+1)){let n=R_[t.slice(e+1)];if(n)return n}return I_}var H_=({icon:e,className:t})=>(0,q.jsx)(`span`,{"aria-hidden":!0,className:K(`inline-flex size-4 shrink-0 [&>svg]:size-full`,t),dangerouslySetInnerHTML:{__html:B_[e]}});function U_({path:e,className:t}){let n=V_(e),r=z_[n];return r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H_,{icon:r,className:K(t,`dark:hidden`)}),(0,q.jsx)(H_,{icon:n,className:K(t,`hidden dark:inline-flex`)})]}):(0,q.jsx)(H_,{icon:n,className:t})}function W_({icon:e,label:t,busyLabel:n=`Starting…`,ariaLabel:r,menuAriaLabel:i,tooltip:a,tooltipClassName:o,prompt:s,configureDescription:c,onStart:l,onConfigure:u,busy:d=!1,starting:f=!1,disabled:p=!1,variant:m=`outline`,size:h=`xs`,className:g}){let _=()=>{_m(s),u()};return(0,q.jsxs)(`div`,{className:`inline-flex shrink-0 items-center`,children:[(0,q.jsxs)(Ap,{children:[(0,q.jsxs)(jp,{render:(0,q.jsx)(Ge,{type:`button`,variant:m,size:h,disabled:p||d,onClick:l,...r?{"aria-label":r}:{},className:K(`rounded-r-none`,m===`outline`&&`border-r-0`,g)}),children:[f?(0,q.jsx)(Dt,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}):e,t!==void 0&&(f?n:t)]}),(0,q.jsx)(Mp,{...o?{className:o}:{},children:a})]}),(0,q.jsxs)(qf,{children:[(0,q.jsx)(Zf,{type:`button`,disabled:p,"aria-label":i,className:K(We({variant:m,size:h}),`w-auto rounded-l-none px-1.5`,m==="default"&&`border-l border-[var(--color-primary-foreground)]/25`,g),children:(0,q.jsx)(wt,{className:`h-3 w-3`,"aria-hidden":!0})}),(0,q.jsx)(Qf,{align:`end`,className:`max-w-[20rem]`,children:(0,q.jsx)($f,{onClick:_,className:`items-start`,children:(0,q.jsx)(dm,{label:`Configure first, then run`,description:c})})})]})]})}var G_=`modulepreload`,K_=function(e){return`/`+e},q_={},J_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=K_(t,n),t=s(t),t in q_)return;q_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:G_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Y_=50,X_={pages:[],cards:[],linkActions:[],panels:[],runSlots:[],settings:[],loaded:!1},Z_=new Map;function Q_(e){let t=Z_.get(e);return t||(t=J_(()=>import(e).then(t=>{let n=t.default;if(!(!n||typeof n!=`object`)){if(n.stylesheet){let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=new URL(n.stylesheet,new URL(e,window.location.href)).href,document.head.appendChild(t)}return n}},t=>{console.warn(`[openagent] the module at ${e} did not load:`,t)}),[]),Z_.set(e,t)),t}var $_=[];function ev(e,t){return(e.order??Y_)-(t.order??Y_)||e.package.localeCompare(t.package)}function tv(e=0){let{value:t,loaded:n}=um(ch,$_,3e4,[e]),[r,i]=(0,J.useState)(X_);return(0,J.useEffect)(()=>{if(!n)return;let e=!0;return Promise.all(t.map(async e=>({module:e,definition:await Q_(e.url)}))).then(t=>{if(!e)return;let n=[],r=[],a=[],o=[],s=[],c=[],l,u;for(let{module:e,definition:i}of t){for(let t of i?.pages??[])!D(t.segment)||n.some(e=>e.segment===t.segment)||n.push({...t,package:e.package,projects:e.projects});for(let t of i?.cards??[])r.push({...t,package:e.package,projects:e.projects});for(let t of i?.linkActions??[])a.push({...t,package:e.package,projects:e.projects});for(let t of i?.panels??[])o.push({...t,package:e.package,projects:e.projects});for(let t of i?.settings??[])c.push({...t,package:e.package,projects:e.projects});i?.usageLimit&&(l??={...i.usageLimit,package:e.package,projects:e.projects}),i?.schedule&&(u??={...i.schedule,package:e.package,projects:e.projects});let t=i?.run;t?.summary&&s.push({...t,package:e.package,projects:e.projects})}r.sort(ev),c.sort(ev),i({pages:n,cards:r,linkActions:a,panels:o,runSlots:s,settings:c,...l?{usageLimit:l}:{},...u?{schedule:u}:{},loaded:!0})}),()=>{e=!1}},[t,n]),r}var nv=(0,J.createContext)(X_);function rv(){return(0,J.useContext)(nv)}var iv={openAgent(){},openPage(){},async startRun(){return{ok:!1,error:`no dashboard to start a run from`}},configureRun(){},async agents(){return[]},async machines(){return{version:`unknown`,machines:[]}},async addMachine(){return{ok:!1,error:`no dashboard to save a machine in`}},async removeMachine(){return{ok:!1,error:`no dashboard to remove a machine from`}},async watchScreen(){},async sendToScreen(){return!1}},av=(0,J.createContext)(null);function ov(e){return{...(0,J.useContext)(av)??iv,package:e}}function sv({projects:e,targets:t,resetKey:n,label:r,tooltip:i,disabled:a=!1,size:o=`sm`,variant:s=`outline`}){let{linkActions:c}=rv(),l=(0,J.useContext)(av),u=c.filter(t=>e.some(e=>t.projects.includes(e))),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(new Set),[h,g]=(0,J.useState)(null);(0,J.useEffect)(()=>{m(new Set),g(null)},[n??e.join(`
|
|
22
|
+
`)]);let _=e=>`${e.package}\n${e.label}`,v=async e=>{if(d!==null)return;f(_(e)),g(null);let n={ok:!0};try{let r=typeof t==`function`?await t():t,i=vy({...l??iv,package:e.package},{acts:!0});for(let{projectId:t,links:a}of r)if(!(!e.projects.includes(t)||a.length===0)&&(n=await e.run(i,t,a),!n.ok))break}catch(e){n={ok:!1,error:e instanceof Error?e.message:String(e)}}f(null),n.ok?m(t=>new Set(t).add(_(e))):g(n.error)};return u.length===0?null:(0,q.jsxs)(q.Fragment,{children:[u.map(e=>{let t=e.icon,n=p.has(_(e)),c=n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),` `,(0,q.jsx)(`span`,{className:`max-md:min-w-0 max-md:truncate`,children:e.doneLabel??e.label})]}):(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsx)(t,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,q.jsx)(`span`,{className:`max-md:min-w-0 max-md:truncate`,children:r?r(e):e.label})]}),l={variant:s,size:o,className:`gap-1.5 md:shrink-0 max-md:min-w-0`,disabled:a||d!==null||n,onClick:()=>void v(e)};return i?(0,q.jsxs)(Ap,{children:[(0,q.jsx)(jp,{render:(0,q.jsx)(Ge,{...l}),children:c}),(0,q.jsx)(Mp,{children:i})]},_(e)):(0,q.jsx)(Ge,{...l,children:c},_(e))}),h&&(0,q.jsx)(`p`,{role:`alert`,className:`basis-full text-xs text-danger`,children:h})]})}function cv({title:e,description:t,action:n,children:r}){return(0,q.jsxs)(ph,{children:[(0,q.jsxs)(mh,{className:K(n!==void 0&&`flex flex-row items-start justify-between gap-3`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,q.jsx)(hh,{children:e}),t&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),n!==void 0&&(0,q.jsx)(`div`,{className:`shrink-0`,children:n})]}),(0,q.jsx)(_h,{children:(0,q.jsx)(`div`,{className:`divide-y divide-border`,children:r})})]})}function lv({label:e,description:t,control:n,dimmed:r=!1}){return(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-3 first:pt-0 last:pb-0`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:K(`text-sm`,r&&`text-muted-foreground`),children:e}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),(0,q.jsx)(`div`,{className:`shrink-0`,children:n})]})}var uv=`(no value)`;function dv({label:e,description:t,value:n,options:r,onChange:i}){if(r.length===0)return null;let a=(r.some(e=>e.value===n)?r:[...r,{value:n,label:n}]).map(e=>({value:e.value===``?uv:e.value,label:e.label,disabled:e.disabled===!0}));return(0,q.jsx)(lv,{label:e,description:t,control:(0,q.jsxs)(yg,{items:a,value:n===``?uv:n,onValueChange:e=>i(e===uv?``:e),children:[(0,q.jsx)(xg,{size:`sm`,"aria-label":e,className:`max-w-[min(16rem,45vw)]`,children:(0,q.jsx)(bg,{})}),(0,q.jsx)(Sg,{align:`end`,children:a.map(e=>(0,q.jsx)(Cg,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})})}var fv=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(fv||{}),pv=[0,1],mv=[1,0],hv=[2,3],gv=[3,2],_v={L:pv,M:mv,Q:hv,H:gv},vv=/^\d*$/,yv=/^[A-Z0-9 $%*+./:-]*$/,bv=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,xv=1,Sv=40,Cv=3,wv=3,Tv=40,Ev=10,Dv=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Ov=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],kv=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<xv||e>Sv)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,fv.Timing),this.setFunctionModule(e,6,e%2==0,fv.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,jv(r,e));this.setFunctionModule(8,7,jv(r,6)),this.setFunctionModule(8,8,jv(r,7)),this.setFunctionModule(7,8,jv(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,jv(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,jv(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,jv(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=jv(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,fv.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,fv.Alignment)}setFunctionModule(e,t,n,r=fv.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==Kv(t,n))throw RangeError(`Invalid argument`);let r=Ov[n[0]][t],i=Dv[n[0]][t],a=Math.floor(Gv(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=qv(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=Jv(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(Gv(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=jv(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=Cv:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Tv),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Tv}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=Cv:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Tv),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Tv}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=wv)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Ev,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function Av(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function jv(e,t){return(e>>>t&1)!=0}var Mv=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},Nv=[1,10,12,14],Pv=[2,9,11,13],Fv=[4,8,16,16];function Iv(e,t){return e[Math.floor((t+7)/17)+1]}function Lv(e){let t=[];for(let n of e)Av(n,8,t);return new Mv(Fv,e.length,t)}function Rv(e){if(!Vv(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);Av(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new Mv(Nv,e.length,t)}function zv(e){if(!Hv(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n;for(n=0;n+2<=e.length;n+=2){let r=bv.indexOf(e.charAt(n))*45;r+=bv.indexOf(e.charAt(n+1)),Av(r,11,t)}return n<e.length&&Av(bv.indexOf(e.charAt(n)),6,t),new Mv(Pv,e.length,t)}function Bv(e){return e===``?[]:Vv(e)?[Rv(e)]:Hv(e)?[zv(e)]:[Lv(Wv(e))]}function Vv(e){return vv.test(e)}function Hv(e){return yv.test(e)}function Uv(e,t){let n=0;for(let r of e){let e=Iv(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function Wv(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function Gv(e){if(e<xv||e>Sv)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function Kv(e,t){return Math.floor(Gv(e)/8)-Dv[t[0]][e]*Ov[t[0]][e]}function qv(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=Yv(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=Yv(n,2)}return t}function Jv(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=Yv(t,e))}return n}function Yv(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function Xv(e,t,n=1,r=40,i=-1,a=!0){if(!(xv<=n&&n<=r&&r<=Sv)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=Kv(o,t)*8,i=Uv(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[mv,hv,gv])a&&s<=Kv(o,e)*8&&(t=e);let c=[];for(let t of e){Av(t.mode[0],4,c),Av(t.numChars,Iv(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=Kv(o,t)*8;Av(0,Math.min(4,l-c.length),c),Av(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)Av(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new kv(o,t,u,i)}function Zv(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?Bv(e):Array.isArray(e)?[Lv(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=Xv(c,_v[n],i,a,o,r),u=Qv({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function Qv(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=fv.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function $v({text:e,label:t}){let{data:n,size:r}=Zv(e,{ecc:`M`,border:2}),i=``;return n.forEach((e,t)=>{e.forEach((e,n)=>{e&&(i+=`M${n} ${t}h1v1h-1z`)})}),(0,q.jsx)(`svg`,{role:`img`,"aria-label":t,viewBox:`0 0 ${r} ${r}`,shapeRendering:`crispEdges`,className:`h-56 w-56 max-w-full rounded-md bg-white`,children:(0,q.jsx)(`path`,{d:i,fill:`black`})})}function ey(e,t){let[n,r]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(!e||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(([e])=>e&&r(e.contentRect.width<t));return n.observe(e),()=>n.disconnect()},[e,t]),n}var ty={typescript:()=>J_(()=>import(`./typescript-Utq2Cl8c.js`),__vite__mapDeps([0,1])),tsx:()=>J_(()=>import(`./tsx-5f3ulCja.js`),__vite__mapDeps([2,3])),javascript:()=>J_(()=>import(`./javascript-Yelw-5ZN.js`),__vite__mapDeps([4,5])),jsx:()=>J_(()=>import(`./jsx-hEbJ82HF.js`),__vite__mapDeps([6,7])),json:()=>J_(()=>import(`./json-CaljABEy.js`),__vite__mapDeps([8,9])),jsonc:()=>J_(()=>import(`./jsonc-CYpm1nAK.js`),[]),json5:()=>J_(()=>import(`./json5-BR5RXkoi.js`),[]),html:()=>J_(()=>import(`./html-WQKKblVZ.js`),__vite__mapDeps([10,11,5,12])),vue:()=>J_(()=>import(`./vue-BqdMUtqy.js`),__vite__mapDeps([13,9,5,1,12,11])),svelte:()=>J_(()=>import(`./svelte-CdeT-Ich.js`),__vite__mapDeps([14,5,1,12,15])),astro:()=>J_(()=>import(`./astro-BZ97kZFP.js`),__vite__mapDeps([16,9,5,1,12,15,3])),xml:()=>J_(()=>import(`./xml-CoDIzWF0.js`),__vite__mapDeps([17,18,19])),css:()=>J_(()=>import(`./css-DUjzNfgv.js`),__vite__mapDeps([20,12])),scss:()=>J_(()=>import(`./scss-8bKmll0B.js`),__vite__mapDeps([21,12])),sass:()=>J_(()=>import(`./sass-DXrisJhu.js`),[]),less:()=>J_(()=>import(`./less-DVTAwKKz.js`),[]),markdown:()=>J_(()=>import(`./markdown-BYOwaDjH.js`),[]),mdx:()=>J_(()=>import(`./mdx-DQZ5AkYe.js`),[]),yaml:()=>J_(()=>import(`./yaml-CxbubiML.js`),__vite__mapDeps([22,23])),toml:()=>J_(()=>import(`./toml-CcmNWLt0.js`),[]),ini:()=>J_(()=>import(`./ini-B5eOa1yu.js`),[]),dotenv:()=>J_(()=>import(`./dotenv-CuH5my32.js`),[]),shellscript:()=>J_(()=>import(`./shellscript-BiGZg9Om.js`),__vite__mapDeps([24,25])),fish:()=>J_(()=>import(`./fish-BJitypiv.js`),[]),powershell:()=>J_(()=>import(`./powershell-QtSnmXcu.js`),[]),python:()=>J_(()=>import(`./python-gzcpVVnB.js`),[]),ruby:()=>J_(()=>import(`./ruby-DjBfgIB7.js`),__vite__mapDeps([26,5,12,27,28,29,1,3,7,11,30,18,19,31,25,23])),go:()=>J_(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>J_(()=>import(`./rust-DpiIf5JO.js`),[]),java:()=>J_(()=>import(`./java-DxlWrXwe.js`),__vite__mapDeps([32,19])),kotlin:()=>J_(()=>import(`./kotlin-DhhofPvG.js`),[]),swift:()=>J_(()=>import(`./swift-CyEgAFGc.js`),[]),c:()=>J_(()=>import(`./c-DWGmR78Y.js`),__vite__mapDeps([33,27])),cpp:()=>J_(()=>import(`./cpp-CJIxL8VH.js`),__vite__mapDeps([34,28,27])),csharp:()=>J_(()=>import(`./csharp-dmMxLVLW.js`),[]),php:()=>J_(()=>import(`./php-D7kNSOJl.js`),__vite__mapDeps([35,9,5,12,11,18,19,31])),lua:()=>J_(()=>import(`./lua-BJObVtAx.js`),__vite__mapDeps([36,30,27])),sql:()=>J_(()=>import(`./sql-BOsskAmu.js`),__vite__mapDeps([37,31])),graphql:()=>J_(()=>import(`./graphql-DAzSVzvB.js`),__vite__mapDeps([38,29,5,1,3,7])),prisma:()=>J_(()=>import(`./prisma-DMgNhnYS.js`),[]),proto:()=>J_(()=>import(`./proto-DB4EqR-F.js`),[]),docker:()=>J_(()=>import(`./docker-IyjqRm3v.js`),[]),make:()=>J_(()=>import(`./make-Dixweg8N.js`),[]),diff:()=>J_(()=>import(`./diff-woXpYk--.js`),[])},ny={ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,json:`json`,jsonc:`jsonc`,json5:`json5`,html:`html`,htm:`html`,vue:`vue`,svelte:`svelte`,astro:`astro`,xml:`xml`,svg:`xml`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,markdown:`markdown`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`ini`,env:`dotenv`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,fish:`fish`,ps1:`powershell`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cs:`csharp`,php:`php`,lua:`lua`,sql:`sql`,graphql:`graphql`,gql:`graphql`,prisma:`prisma`,proto:`proto`,dockerfile:`docker`,makefile:`make`,diff:`diff`,patch:`diff`},ry=2e5;function iy(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`);return ny[n===-1?t:t.slice(n+1)]}var ay,oy=new Map;function sy(){return ay??=Promise.all([J_(()=>import(`./core-Db3h5Pv3.js`),__vite__mapDeps([39,40])),J_(()=>import(`./engine-javascript-DbNy5Fxf.js`),[])]).then(([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>e({themes:[J_(()=>import(`./everforest-light-Df2xbC6M.js`),[]),J_(()=>import(`./everforest-dark-sB-x3p7T.js`),[])],langs:[],engine:t()})),ay}async function cy(e){let t=await sy();return oy.has(e)||oy.set(e,ty[e]().then(e=>t.loadLanguage(...e.default))),await oy.get(e),t}function ly(e,t){let n=iy(t),[r,i]=(0,J.useState)(null);return(0,J.useEffect)(()=>{if(!n||e.length>ry)return;let t=!0;return cy(n).then(r=>{if(!t)return;let a=r.codeToTokensWithThemes(e,{lang:n,themes:{light:`everforest-light`,dark:`everforest-dark`}});i({text:e,language:n,lines:a.map(e=>e.map(e=>({text:e.content,light:e.variants.light?.color,dark:e.variants.dark?.color})))})}).catch(()=>{}),()=>{t=!1}},[e,n]),r&&r.text===e&&r.language===n?r.lines:null}function uy({pieces:e}){return e.map((e,t)=>(0,q.jsx)(`span`,{style:{"--light":e.light,"--dark":e.dark},className:`text-(color:--light) dark:text-(color:--dark)`,children:e.text},t))}var dy={};function fy(e){let{schedule:t,pages:n,loaded:r}=rv(),i=(0,J.useContext)(av)??iv,a=e.map(e=>e.id).join(`,`),{value:o}=um(async()=>{if(!r)return dy;let n=t?vy({...i,package:t.package}):void 0,a=await Promise.all(e.map(async e=>!t||!n||!t.projects.includes(e.id)?[e.id,[]]:t.read(n,e).then(t=>[e.id,t],()=>void 0)));return Object.fromEntries(a.filter(e=>e!==void 0))},dy,1e4,[r,t?.package,t?.projects.join(`,`),a],`previous`),s=Object.fromEntries(e.flatMap(e=>o[e.id]?[[e.id,o[e.id]]]:[]));if(!t)return{commands:s,open:()=>{}};let c=n.find(e=>e.segment===t.page)?.label??t.page;return{page:{segment:t.page,label:c,href:N(t.page)},commands:s,open:()=>i.openPage(t.page)}}function py(e){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`/`))return;let[t,...n]=e.split(`/`).filter(Boolean);if(!(!t||!D(t)||n.length===0))return{segment:t,rest:n}}function my(e){let t=e.match(/(?<![\w./:@-])[a-z][a-z0-9]*\/[^\s()[\]<>"'`]+/g)??[];return[...new Set(t.map(e=>e.replace(/[.,;:!?]+$/,``)).filter(e=>py(e)!==void 0))]}var hy={};function gy(e){let{pages:t}=rv(),n=(0,J.useContext)(av)??iv,r=e.map(({projectId:e,paths:t})=>`${e}\n${[...t].sort().join(`
|
|
23
|
+
`)}`).join(`
|
|
24
|
+
|
|
25
|
+
`),i=t.filter(e=>e.names!==void 0),{value:a}=um(async()=>{let t={};return await Promise.all(e.flatMap(({projectId:e,paths:r})=>i.filter(t=>t.projects.includes(e)).map(async i=>{let a=r.filter(e=>py(e)?.segment===i.segment);if(a.length===0)return;let o=await i.names(vy({...n,package:i.package}),e,a).catch(()=>({}));for(let n of a){let r=o[n];r&&typeof r.title==`string`&&r.title.trim()!==``&&(t[`${e}\n${n}`]={title:r.title,href:typeof r.href==`string`?r.href:n})}}))),t},hy,6e4,[r,i.map(e=>e.package).join(`,`)],`previous`);return(e,t)=>{let r=a[`${e}\n${t}`],i=r&&py(r.href);return r&&i?{title:r.title,open:()=>n.openPage(i.segment,[e,...i.rest])}:void 0}}function _y(e){return e}function vy(e,t={}){return{...e,runCommand:(n,r,i)=>lh(n,e.package,r,i,t.acts??!1),act:(t,n,r)=>lh(t,e.package,n,r,!0),runComputerCommand:(t,n)=>uh(e.package,t,n),read:(t,n,r={})=>dh(t,e.package,n,r)}}var yy=(0,J.createContext)(null);function by(){let e=(0,J.useContext)(yy);if(!e)throw Error(`useModuleHost is only available inside a module page`);return`runCommand`in e?e:vy(e)}export{Zm as $,At as $t,Vg as A,N as An,Ap as At,Dh as B,d as Bn,rp as Bt,F_ as C,Ze as Cn,qp as Ct,M_ as D,z as Dn,Rp as Dt,j_ as E,K as En,zp as Et,Cg as F,x as Fn,ep as Ft,wh as G,Hf as Gt,kh as H,a as Hn,np as Ht,xg as I,v as In,Qf as It,mh as J,xs as Jt,ph as K,ys as Kt,bg as L,g as Ln,Jf as Lt,Hg as M,T as Mn,kp as Mt,yg as N,w as Nn,jp as Nt,D_ as O,A as On,Pp as Ot,Sg as P,S as Pn,qf as Pt,sh as Q,Mt as Qt,jh as R,_ as Rn,$f as Rt,U_ as S,Qe as Sn,Qp as St,P_ as T,We as Tn,Bp as Tt,Eh as U,s as Un,tp as Ut,Ah as V,p as Vn,Yf as Vt,Oh as W,c as Wn,Zf as Wt,gh as X,Ut as Xt,hh as Y,Z as Yt,fh as Z,Vt as Zt,ov as _,gt as _n,im as _t,my as a,zt as an,xm as at,rv as b,Xe as bn,um as bt,uy as c,Dt as cn,Sm as ct,$v as d,wt as dn,_m as dt,jt as en,Xm as et,lv as f,Ct as fn,vm as ft,av as g,ht as gn,dm as gt,sv as h,mt as hn,fm as ht,by as i,Nt as in,Cm as it,Ug as j,k as jn,Mp as jt,E_ as k,j as kn,Np as kt,ly as l,Et as ln,Em as lt,dv as m,xt as mn,pm as mt,_y as n,Lt as nn,Om as nt,gy as o,Bt as on,Tm as ot,cv as p,St as pn,mm as pt,_h as q,bs as qt,vy as r,Ft as rn,Dm as rt,fy as s,Ot as sn,wm as st,yy as t,Pt as tn,Km as tt,ey as u,Tt as un,bm as ut,nv as v,tt as vn,om as vt,N_ as w,Ge as wn,Kp as wt,W_ as x,Ye as xn,$p as xt,tv as y,it as yn,lm as yt,Th as z,u as zn,ip as zt};
|