@coristen/widget 0.1.10 → 0.1.11
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/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/website-chat.d.ts +1 -5
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var x1=Object.create;var{getPrototypeOf:y1,defineProperty:Il,getOwnPropertyNames:R1}=Object;var Gm=Object.prototype.hasOwnProperty;function v1(e){return this[e]}var T1,E1,zm=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?T1??=new WeakMap:E1??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?x1(y1(e)):{};let s=t||!e||!e.__esModule||!Gm.call(e,"default")?Il(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of R1(e))if(!Gm.call(s,i))Il(s,i,{get:v1.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var P1=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var A1=(e)=>e;function M1(e,t){this[e]=A1.bind(null,t)}var ds=(e,t)=>{for(var o in t)Il(e,o,{get:t[o],enumerable:!0,configurable:!0,set:M1.bind(t,o)})};import*as Xo from"react";var Ni=P1(function(W2){function L2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var D2=typeof Object.is==="function"?Object.is:L2,F2=Xo.useState,O2=Xo.useEffect,N2=Xo.useLayoutEffect,B2=Xo.useDebugValue;function H2(e,t){var o=t(),r=F2({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return N2(function(){n.value=o,n.getSnapshot=t,hu(n)&&a({inst:n})},[e,o,t]),O2(function(){return hu(n)&&a({inst:n}),e(function(){hu(n)&&a({inst:n})})},[e]),B2(o),o}function hu(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!D2(e,o)}catch(r){return!0}}function V2(e,t){return t()}var U2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?V2:H2;W2.useSyncExternalStore=Xo.useSyncExternalStore!==void 0?Xo.useSyncExternalStore:U2});var dr={};ds(dr,{android:()=>op,apple:()=>Hl,ios:()=>Bl,linux:()=>e2,mac:()=>rp,windows:()=>QI});var gr={};ds(gr,{blink:()=>o2,gecko:()=>t2,webkit:()=>Vl});var Ul={};ds(Ul,{voiceOver:()=>r2});var Ca={};ds(Ca,{jsdom:()=>n2});import{Component as aw,cloneElement as sw,useCallback as Om,useEffect as vr,useMemo as iw,useRef as ns,useState as Jo}from"react";import{ConvexProvider as cw,ConvexReactClient as lw}from"convex/react";import{useEffect as os,useRef as Mh,useState as Rr}from"react";import{useMutation as $n,useQuery as rs}from"convex/react";import{jsx as U1}from"react/jsx-runtime";var _o=34,en=200,k1=6,L1=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function D1(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return Math.abs(t)}function qm(e,t){let o=[];for(let r=0;r<t;r++)o.push(D1(e+":"+r));return o}function Zm(e,t,o){t/=100,o/=100;let r=(i)=>(i+e/30)%12,n=t*Math.min(o,1-o),a=(i)=>o-n*Math.max(-1,Math.min(r(i)-3,Math.min(9-r(i),1))),s=(i)=>Math.round(i*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}function F1(e){let[t]=qm(e,1),o=t%360;return{fill:Zm(o,85,30),stroke:Zm(o,90,65)}}function O1(e){let[t,o]=qm(e,2),r=t%360*(Math.PI/180),n=o%100/100*0.4-0.2,a=Math.cos(r),s=Math.sin(r),i=[];for(let c=0;c<_o;c++){let u=[];for(let l=0;l<_o;l++){let m=l/(_o-1)*2-1,p=c/(_o-1)*2-1,f=(m*a+p*s+1+n)/2;u.push(Math.max(0,Math.min(1,f)))}i.push(u)}return i}function N1(e){let t=[];for(let o=0;o<_o;o++){let r=[];for(let n=0;n<_o;n++){let a=L1[o%4][n%4]/16;r.push(e[o][n]>=a?1:0)}t.push(r)}return t}function B1(e){let t=[];for(let o=0;o<_o;o++){let r=e[o],n=[],a=0;while(a<_o)if(r[a]===1){let c=a;while(a<_o&&r[a]===1)a++;n.push({start:c,len:a-c})}else a++;if(n.length===0)continue;let s=`M${n[0].start} ${o}`,i=n[0].start;s+=`h${n[0].len}`,i+=n[0].len;for(let c=1;c<n.length;c++){let u=n[c].start-i;s+=`m${u} 0h${n[c].len}`,i=n[c].start+n[c].len}t.push(s)}return t.join("")}function H1(e){let{fill:t,stroke:o}=F1(e),r=O1(e),n=N1(r),a=B1(n),i=en/_o*(k1/6),c=_o/2,u=`translate(${en/2},${en/2})scale(${i})translate(-${c},-${c})`;return[`<svg width="${en}" height="${en}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,`<rect width="${en}" height="${en}" fill="${t}"/>`,`<path fill="none" stroke="${o}" transform="${u}" d="${a}"/>`,"</svg>"].join("")}function V1(e){let t=H1(e);return`data:image/svg+xml,${encodeURIComponent(t)}`}function vn({seed:e,size:t=40,className:o,style:r}){let n=V1(e);return U1("img",{src:n,alt:"",width:t,height:t,className:o,style:{borderRadius:"50%",...r}})}import*as gs from"react";import*as tn from"react";import{createContext as W1}from"react";var jm=W1({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Oe=tn.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:p="regular",mirrored:d=!1,...f}=tn.useContext(jm);return tn.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||d?"scale(-1, 1)":void 0,...f,...u},!!o&&tn.createElement("title",null,o),i,c.get(a!=null?a:p))});Oe.displayName="IconBase";import*as pt from"react";var Xm=new Map([["bold",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),pt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var hs=gs.forwardRef((e,t)=>gs.createElement(Oe,{ref:t,...e,weights:Xm}));hs.displayName="ArrowUpIcon";import*as Is from"react";import*as dt from"react";var $m=new Map([["bold",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M216.49,56.48,177,96h19a12,12,0,0,1,0,24H148a12,12,0,0,1-12-12V60a12,12,0,0,1,24,0V79l39.51-39.52a12,12,0,0,1,17,17ZM108,136H60a12,12,0,0,0,0,24H79L39.51,199.51a12,12,0,0,0,17,17L96,177v19a12,12,0,0,0,24,0V148A12,12,0,0,0,108,136Z"}))],["duotone",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),dt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["fill",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M120,144v48a8,8,0,0,1-13.66,5.66L88,179.31,53.66,213.66a8,8,0,0,1-11.32-11.32L76.69,168,58.34,149.66A8,8,0,0,1,64,136h48A8,8,0,0,1,120,144ZM213.66,42.34a8,8,0,0,0-11.32,0L168,76.69,149.66,58.34A8,8,0,0,0,136,64v48a8,8,0,0,0,8,8h48a8,8,0,0,0,5.66-13.66L179.31,88l34.35-34.34A8,8,0,0,0,213.66,42.34Z"}))],["light",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M212.24,52.24,158.48,106H192a6,6,0,0,1,0,12H144a6,6,0,0,1-6-6V64a6,6,0,0,1,12,0V97.52l53.76-53.76a6,6,0,0,1,8.48,8.48ZM112,138H64a6,6,0,0,0,0,12H97.52L43.76,203.76a6,6,0,1,0,8.48,8.48L106,158.48V192a6,6,0,0,0,12,0V144A6,6,0,0,0,112,138Z"}))],["regular",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["thin",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M210.83,50.83,153.66,108H192a4,4,0,0,1,0,8H144a4,4,0,0,1-4-4V64a4,4,0,0,1,8,0v38.34l57.17-57.17a4,4,0,1,1,5.66,5.66ZM112,140H64a4,4,0,0,0,0,8h38.34L45.17,205.17a4,4,0,0,0,5.66,5.66L108,153.66V192a4,4,0,0,0,8,0V144A4,4,0,0,0,112,140Z"}))]]);var bs=Is.forwardRef((e,t)=>Is.createElement(Oe,{ref:t,...e,weights:$m}));bs.displayName="ArrowsInSimpleIcon";import*as Cs from"react";import*as gt from"react";var Ym=new Map([["bold",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),gt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]);var Ss=Cs.forwardRef((e,t)=>Cs.createElement(Oe,{ref:t,...e,weights:Ym}));Ss.displayName="ArrowsOutSimpleIcon";import*as ws from"react";import*as ht from"react";var Km=new Map([["bold",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),ht.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var xs=ws.forwardRef((e,t)=>ws.createElement(Oe,{ref:t,...e,weights:Km}));xs.displayName="BinocularsIcon";import*as ys from"react";import*as It from"react";var Jm=new Map([["bold",It.createElement(It.Fragment,null,It.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",It.createElement(It.Fragment,null,It.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),It.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",It.createElement(It.Fragment,null,It.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",It.createElement(It.Fragment,null,It.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",It.createElement(It.Fragment,null,It.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",It.createElement(It.Fragment,null,It.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var Rs=ys.forwardRef((e,t)=>ys.createElement(Oe,{ref:t,...e,weights:Jm}));Rs.displayName="CaretLeftIcon";import*as vs from"react";import*as bt from"react";var Qm=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),bt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var Ts=vs.forwardRef((e,t)=>vs.createElement(Oe,{ref:t,...e,weights:Qm}));Ts.displayName="CaretRightIcon";import*as Es from"react";import*as Ct from"react";var ef=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Ct.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var Ps=Es.forwardRef((e,t)=>Es.createElement(Oe,{ref:t,...e,weights:ef}));Ps.displayName="ClockCounterClockwiseIcon";import*as As from"react";import*as St from"react";var tf=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var on=As.forwardRef((e,t)=>As.createElement(Oe,{ref:t,...e,weights:tf}));on.displayName="FileTextIcon";import*as Ms from"react";import*as wt from"react";var of=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var ks=Ms.forwardRef((e,t)=>Ms.createElement(Oe,{ref:t,...e,weights:of}));ks.displayName="GlobeIcon";import*as Ls from"react";import*as xt from"react";var rf=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var Ds=Ls.forwardRef((e,t)=>Ls.createElement(Oe,{ref:t,...e,weights:rf}));Ds.displayName="ImageIcon";import*as Fs from"react";import*as yt from"react";var nf=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),yt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var Os=Fs.forwardRef((e,t)=>Fs.createElement(Oe,{ref:t,...e,weights:nf}));Os.displayName="PaperclipIcon";import*as Ns from"react";import*as Rt from"react";var af=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var Tn=Ns.forwardRef((e,t)=>Ns.createElement(Oe,{ref:t,...e,weights:af}));Tn.displayName="PlusIcon";import*as Bs from"react";import*as vt from"react";var sf=new Map([["bold",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),vt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Ao=Bs.forwardRef((e,t)=>Bs.createElement(Oe,{ref:t,...e,weights:sf}));Ao.displayName="XIcon";import{makeFunctionReference as Go}from"convex/server";var Mo={welcomeSuggestions:Go("conversations:welcomeSuggestions"),workspace:Go("conversations:workspace"),visitorProfile:Go("conversations:visitorProfile"),openWebsite:Go("conversations:openWebsite"),visitorConversations:Go("conversations:visitorConversations"),customerMessages:Go("conversations:customerMessages"),startCustomer:Go("conversations:startCustomer"),sendCustomer:Go("conversations:sendCustomer"),retryAgentResponse:Go("conversations:retryAgentResponse"),generateAttachmentUploadUrl:Go("conversations:generateAttachmentUploadUrl"),markCustomerRead:Go("conversations:markCustomerRead")};import{useEffect as AC,useRef as MC,useState as Ja}from"react";function ta(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var cf={};function Wt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Hs(t);let a=Hs(e);if(t)a=oa(a,t);if(o)a=oa(a,o);if(r)a=oa(a,r);if(n)a=oa(a,n);return a}function lf(e){if(e.length===0)return cf;if(e.length===1)return Hs(e[0]);let t=Hs(e[0]);for(let o=1;o<e.length;o+=1)t=oa(t,e[o]);return t}function Hs(e){if(mf(e))return{...e(cf)};return _1(e)}function oa(e,t){if(mf(t))return t(e);return G1(e,t)}function _1(e){let t={...e};for(let o in t){let r=t[o];if(uf(o,r))t[o]=ff(r)}return t}function G1(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=ta(e.style,r);break}case"className":{e[o]=bl(e.className,r);break}default:if(uf(o,r))e[o]=z1(e[o],r);else e[o]=r}}return e}function uf(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function mf(e){return typeof e==="function"}function z1(e,t){if(!t)return e;if(!e)return ff(t);return(...o)=>{let r=o[0];if(pf(r)){let a=r;ra(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function ff(e){if(!e)return e;return(...t)=>{let o=t[0];if(pf(o))ra(o);return e(...t)}}function ra(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function bl(e,t){if(t){if(e)return t+" "+e;return t}return e}function pf(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as kr from"react";import*as gf from"react";var df={};function qe(e,t){let o=gf.useRef(df);if(o.current===df)o.current=e(t);return o}function ko(e,t,o,r){let n=qe(If).current;if(Z1(n,e,t,o,r))bf(n,[e,t,o,r]);return n.callback}function hf(e){let t=qe(If).current;if(q1(t,e))bf(t,e);return t.callback}function If(){return{callback:null,cleanup:null,refs:[]}}function Z1(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function q1(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function bf(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as Sf from"react";import*as Cf from"react";var j1=parseInt(Cf.version,10);function En(e){return j1>=e}function Cl(e){if(!Sf.isValidElement(e))return null;let t=e,o=t.props;return(En(19)?o?.ref:t.ref)??null}function Ye(){}var pr=Object.freeze([]),We=Object.freeze({});function wf(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function xf(e,t){return typeof e==="function"?e(t):e}function yf(e,t){return typeof e==="function"?e(t):e}import{createElement as Rf}from"react";function ke(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=na(r);let n=X1(t,o,r);if(o.enabled===!1)return null;let a=o.state??We;return K1(e,r,n,a)}function X1(e,t,o){let{className:r,style:n}=e,{state:a=We,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?xf(r,a):void 0,m=u?yf(n,a):void 0,p=u?wf(a,c):We,d=u&&i?$1(i):void 0,f=u?ta(p,d)??{}:We;if(typeof document<"u")if(!u)ko(null,null);else if(Array.isArray(s))f.ref=hf([f.ref,Cl(o),...s]);else f.ref=ko(f.ref,Cl(o),s);if(!u)return We;if(l!==void 0)f.className=bl(f.className,l);if(m!==void 0)f.style=ta(f.style,m);return f}function $1(e){if(Array.isArray(e))return lf(e);return Wt(void 0,e)}var Y1=Symbol.for("react.lazy");function na(e){if(e?.$$typeof!==Y1)return e;let t=kr.Children.toArray(e)[0];return kr.isValidElement(t)?t:e}function K1(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Wt(o,t.props);return n.ref=o.ref,kr.cloneElement(t,n)}return J1(e,o)}function J1(e,t){if(e==="button")return Rf("button",{type:"button",...t,key:t.key});if(e==="img")return Rf("img",{alt:"",...t,key:t.key});return kr.createElement(e,t)}function Pn(e){return ke(e.defaultTagName??"div",e,e)}function vf(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=vf(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Tf(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=vf(e))&&(r&&(r+=" "),r+=t);return r}var Ef=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,Pf=Tf,jt=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return Pf(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let p=Ef(l)||Ef(m);return n[u][p]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,p]=l;if(p===void 0)return u;return u[m]=p,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:p,...d}=l;return Object.entries(d).every((f)=>{let[h,I]=f;return Array.isArray(I)?I.includes({...a,...i}[h]):{...a,...i}[h]===I})?[...u,m,p]:u},[]);return Pf(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var rr=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Vs=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},Lr=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var Q1=[],rn=Vs(rr("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),eI=Vs(rr(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var tI=(()=>{let e=rn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=rn[n];i<rn[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(rn[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=rn[n];s<rn[n+1];s++)o[r++]=a,a+=t[a]}return o})(),oI=rr("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),rI=Vs(rr("123333359346463635126536711576")),nI=rr("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),aI=rr("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),sI=Lr("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),iI=(()=>{let e=new Int32Array(319).fill(-1),t=Lr("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Lr("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),cI="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),Af=Lr("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),lI=Lr("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),uI=Lr("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),Mf=new Int32Array(995),kf=new Int32Array(995),Lf=new Int32Array(995),Sl="",wl=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<Af.length;r++)for(let n of cI[uI[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),wl[a*2]=Sl.length,wl[a*2+1]=n.length,Sl+=n;Mf[o]=Af[r],kf[o]=lI[r],Lf[o]=a,o++}}var mI=Lr("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),fI=Vs(rr("1::24444432:442:44:44>222222:44:4421322511111311111114")),pI=Lr("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),dI=rr("ij"),gI=rr(""),hI=rr("1"),II="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Df={GROUP_COUNT:384,customValidatorNames:Q1,edgeStart:rn,labelStart:eI,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:tI,nodeGroup:oI,nodeVlist:iI,vlistPat:rI,vlistOps:nI,vlistRef:aI,vlistGroup:sI,litAnchor:Mf,litGroup:kf,litPool:Lf,poolOffsets:wl,poolText:Sl,adjGid:mI,adjStart:fI,adjTgt:pI,patGid:dI,patTgt:gI,postfixLookupGroups:hI,orderSensitiveModifiers:II};var bI="line"in Error();var xl=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},Us=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},Ff=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:p,vlistGroup:d,litAnchor:f,litGroup:h,litPool:I,poolOffsets:g,poolText:C,adjGid:w,adjStart:b,adjTgt:S,patGid:x,patTgt:y,postfixLookupGroups:R,customValidatorNames:v,orderSensitiveModifiers:L}=e,W=new Int32Array(r).fill(-1);for(let F=0;F<w.length;F++)W[w[F]]=F;let M=0;for(let F=0;F+1<b.length;F++){let Z=b[F+1]-b[F];if(Z>M)M=Z}let B=32;while(B<2*(1+M+x.length))B<<=1;let D=new Int32Array(p.length+1);for(let F=0;F<p.length;F++)D[F+1]=D[F]+l[p[F]+1]-l[p[F]];let E=new Uint8Array(r);for(let F=0;F<R.length;F++)E[R[F]]=1;let N=n.length-1,K=new Uint8Array(N),A=0,O=!0;for(let F=0;F<f.length;F++){K[f[F]]=1;let Z=g[I[F]*2+1];if(Z>A)A=Z;let te=C.charCodeAt(g[I[F]*2]);if(te===91||te===40)O=!1}let Y=1;while(Y<f.length*2)Y<<=1;let G=new Int32Array(Y).fill(-1);for(let F=0;F<f.length;F++){let Z=g[I[F]*2],te=(xl(C,Z,Z+g[I[F]*2+1])^Math.imul(f[F],2654435761)|0)&Y-1;while(G[te]!==-1)te=te+1&Y-1;G[te]=F}let k=(F,Z,te,ye)=>{let Be=(xl(Z,te,ye)^Math.imul(F,2654435761)|0)&Y-1,De=ye-te;for(;;){let je=G[Be];if(je===-1)return-1;if(f[je]===F&&g[I[je]*2+1]===De){let ft=g[I[je]*2],Ke=!0;for(let Pe=0;Pe<De;Pe++)if(C.charCodeAt(ft+Pe)!==Z.charCodeAt(te+Pe)){Ke=!1;break}if(Ke)return h[je]}Be=Be+1&Y-1}},re=o.cacheSize??8192,U=o.prefix??e.prefix??"",j=U===""?"":U+":",_=j.length,ne=(v??[]).map((F)=>{let Z=t&&t[F];if(!Z)throw Error("cn: missing validator "+F);return Z}),be=/\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$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,le=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ce=0,Ee=-1,ie=-1,xe=-1,Se=-1,Le=(F)=>F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===95,Ne=(F)=>/\s/.test(String.fromCharCode(F)),ae=(F,Z,te)=>{if(Ce=0,Ee=-1,te-Z<3)return;let ye=F.charCodeAt(Z),Be=F.charCodeAt(te-1);if(ye===91&&Be===93)Ce=1;else if(ye===40&&Be===41)Ce=2;else return;xe=Z+1,Se=te-1;let De=Z+1;if(Le(F.charCodeAt(De))){De++;while(De<te-1){let je=F.charCodeAt(De);if(!Le(je)&&je!==45)break;De++}if(De<te-2&&F.charCodeAt(De)===58)Ee=Z+1,ie=De,xe=De+1}},V=(F,Z,te,ye)=>{if(te-Z!==ye.length)return!1;for(let Be=0;Be<ye.length;Be++)if(F.charCodeAt(Z+Be)!==ye.charCodeAt(Be))return!1;return!0},T=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,J=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z=(F)=>!!F&&!Number.isNaN(Number(F)),ue=(F,Z,te)=>{if(te-Z<11||!V(F,Z,Z+10,"@container"))return!1;if(F.charCodeAt(Z+10)===47)return te-Z>=12;let ye=F.charCodeAt(Z+11);return ye===115&&te-Z>=17&&V(F,Z+10,Z+16,"-size/")||ye===110&&te-Z>=19&&V(F,Z+10,Z+18,"-normal/")},P=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],H="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((F)=>F.split(" ")),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],X=(F,Z,te,ye)=>{if(F>=10){if(F>=25)return ne[F-25](Z.slice(te,ye));let Be=F-10;if(Ce!==P[Be])return!1;if(Ee>=0){for(let De of H[Be])if(V(Z,Ee,ie,De))return!0;return!1}switch(me[Be]){case 0:return!1;case 1:return!0;case 2:{let De=Z.slice(xe,Se);return be.test(De)&&!ee.test(De)}case 3:return z(Z.slice(xe,Se));case 4:return le.test(Z.slice(xe,Se));default:return ce.test(Z.slice(xe,Se))}}switch(F){case 0:return!0;case 1:return Ce===0;case 2:return Ce===1;case 3:return Ce===2;case 4:return T.test(Z.slice(te,ye));case 5:return z(Z.slice(te,ye));case 6:{let Be=Z.slice(te,ye);return!!Be&&Number.isInteger(Number(Be))}case 7:return ye>te&&Z.charCodeAt(ye-1)===37&&z(Z.slice(te,ye-1));case 8:return J.test(Z.slice(te,ye));default:return ue(Z,te,ye)}},oe=new Set(typeof L==="string"?L.split(" "):L),de=(F,Z,te,ye,Be,De)=>{let je=xl(Z,te,ye)^(Be?2654435769:0)|0,ft=F.get(je);if(ft!==void 0)e:for(let Ue=0;Ue<ft.length;Ue++){let $e=ft[Ue];if($e.imp!==Be||$e.k.length!==ye-te)continue;for(let Ut=0;Ut<$e.k.length;Ut++)if($e.k.charCodeAt(Ut)!==Z.charCodeAt(te+Ut))continue e;return $e.id}else F.set(je,ft=[]);let Ke=Z.slice(te,ye),Pe=De(Ke);return ft.push({k:Ke,imp:Be,id:Pe}),Pe},ge=new Map,he=new Map,Ae=2,Xe=4096,ct=(F,Z)=>{let te=[],ye=0,Be=0,De=0;for(let Pe=0;Pe<F.length;Pe++){let Ue=F.charCodeAt(Pe);if(ye===0&&Be===0&&Ue===58)te.push(F.slice(De,Pe)),De=Pe+1;else if(Ue===91)ye++;else if(Ue===93)ye--;else if(Ue===40)Be++;else if(Ue===41)Be--}te.push(F.slice(De));let je=te[0];if(te.length>1){let Pe=[],Ue=[];for(let $e of te)if($e.charCodeAt(0)===91||oe.has($e)){if(Ue.length)Pe.push(...Ue.sort()),Ue=[];Pe.push($e)}else Ue.push($e);if(Ue.length)Pe.push(...Ue.sort());je=Pe.join(":")}let ft=Z?je+" !":je,Ke=he.get(ft);if(Ke===void 0)he.set(ft,Ke=Ae++);return Ke},io=new Map,co=r,Ho=r+4096,qt=()=>co++,_t=2097152,go=8192,bo=new Int32Array(go),Qt=Array(go).fill(null),Xr=new Int32Array(go),$r=new Int32Array(go),_e=new Uint8Array(go),Nt=0,we=(F,Z,te,ye,Be,De,je,ft)=>{let Ke=F;if(Qt[F]!==null)if(Qt[F|1]===null)Ke=F|1;else if((Nt++&3)===0)Ke=F|Nt>>2&1;else return;Qt[Ke]=Z.slice(te,ye),bo[Ke]=Be,Xr[Ke]=De,$r[Ke]=je,_e[Ke]=ft},ve=()=>Qt.fill(null),Ve=256,Bt=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Gt,lo,Vt,Co]=Bt,Vo=new Uint8Array(Ve),vo=new Uint8Array(Ve),wn=()=>{Ve*=2,Bt=Bt.map((Z)=>{let te=new Int32Array(Ve);return te.set(Z),te}),[Gt,lo,Vt,Co]=Bt;let F=new Uint8Array(Ve);F.set(Vo),Vo=F,vo=new Uint8Array(Ve)},Qo=64,Yr=new Int32Array(Qo),Kr=new Int32Array(Qo),ol=new Int32Array(r),Tr=2048,Bm=21,rl=new Float64Array(Tr),ss=new Int32Array(Tr),Er=0,nl=(F,Z)=>{if(F===0&&Z<r){if(ol[Z]===Er)return 1;return ol[Z]=Er,0}let te=F*2097152+Z+1,ye=Math.imul(te,2654435761)>>>Bm;for(;;){if(ss[ye]!==Er)break;if(rl[ye]===te)return 1;ye=ye+1&Tr-1}return rl[ye]=te,ss[ye]=Er,0},is=(F,Z,te,ye,Be)=>{if(te-Z>=2&&F.charCodeAt(Z)===91&&F.charCodeAt(te-1)===93){let De=-1;for(let je=Z+1;je<te-1;je++)if(F.charCodeAt(je)===58){De=je;break}if(De===-1||De===Z+1)return-1;return de(io,F,Z+1,De,0,qt)}if(ye>=0&&c[ye]>=0)return c[ye];for(let De=Be-1;De>=0;De--){let je=Kr[De];if(je>te)continue;let ft=Yr[De],Ke=te-je;if(K[ft]===1&&Ke>0&&Ke<=A){let zt=F.charCodeAt(je);if(O===!1||zt!==91&&zt!==40){let Ar=k(ft,F,je,te);if(Ar>=0)return Ar}}let Pe=u[ft];if(Pe<0)continue;let Ue=p[Pe],$e=l[Ue],Ut=l[Ue+1];if($e===Ut)continue;ae(F,je,te);let eo=D[Pe]-$e;for(let zt=$e;zt<Ut;zt++)if(X(m[zt],F,je,te))return d[eo+zt]}return-1},cs=(F)=>{let Z=F.length,te=0,ye=0,Be=!1;if(Ae>Xe||ge.size>Xe)ge=new Map,he=new Map,Ae=2,ve();if(co>Ho)io=new Map,co=r,ve();let De=0;while(De<Z){let Pe=F.charCodeAt(De);if(Pe===32||Pe>=9&&Pe<=13||Pe>=160&&Ne(Pe)){if(Pe!==32)Be=!0;De++;continue}let Ue=De,$e=0;while(De<Z){if(Pe=F.charCodeAt(De),Pe<=32){if(Pe===32)break;if(Pe>=9&&Pe<=13){Be=!0;break}}else if(Pe>=160&&Ne(Pe)){Be=!0;break}$e=Math.imul($e^Pe,16777619),De++}let Ut=De,eo=Ut-Ue;if(te===Ve)wn();let zt=te++;Gt[zt]=Ue,lo[zt]=Ut,ye+=eo,$e^=Math.imul(eo,2654435761);let Ar=$e^$e>>>15|0,er=Ar&8190;{let ot=-1;if(bo[er]===Ar&&Qt[er]!==null&&Qt[er].length===eo)ot=er;else if(bo[er|1]===Ar&&Qt[er|1]!==null&&Qt[er|1].length===eo)ot=er|1;if(ot>=0){let Wo=Qt[ot],mr=!0;for(let fr=0;fr<eo;fr++)if(Wo.charCodeAt(fr)!==F.charCodeAt(Ue+fr)){mr=!1;break}if(mr){Vt[zt]=Xr[ot],Co[zt]=$r[ot],Vo[zt]=_e[ot];continue}}}let yn=Ue;if(_!==0){if(Ut-Ue<=_||!F.startsWith(j,Ue)){Vt[zt]=-1,we(er,F,Ue,Ut,Ar,-1,0,0);continue}yn=Ue+_}let sl=0,il=0,Qn=-1,cl=-1;for(let ot=yn;ot<Ut;ot++){let Wo=F.charCodeAt(ot);if(sl===0&&il===0){if(Wo===58){Qn=ot;continue}if(Wo===47){cl=ot;continue}}if(Wo===91)sl++;else if(Wo===93)sl--;else if(Wo===40)il++;else if(Wo===41)il--}let Um=Qn>=yn?Qn+1:yn,To=Um,Eo=Ut,ea=!1,Wm=0;if(Eo>To&&F.charCodeAt(Eo-1)===33)ea=!0,Eo--;else if(Eo>To&&F.charCodeAt(To)===33)ea=!0,To++,Wm=1;let Jr=-1;if(cl>Um){if(Jr=cl+Wm,Jr>=Eo)Jr=-1}let ll=To;if(Eo-To>1&&F.charCodeAt(To)===45)ll=To+1;let tr=0,Mr=0,Rn=0,_m=-1,or=0;if(u[0]>=0||K[0]===1)Yr[0]=0,Kr[0]=ll,or=1;let ul=-1,ml=0;for(let ot=ll;ot<Eo;ot++){if(ot===Jr)ul=Mr<Rn?-1:tr,ml=or;if(tr!==-1){let Wo=F.charCodeAt(ot),mr=-1;if(Mr<Rn)if(s.charCodeAt(Mr)===Wo){if(Mr++,Mr===Rn)mr=tr=_m}else tr=-1;else{let fr=n[tr],ps=n[tr+1],gl=-1;for(let Qr=fr;Qr<ps;Qr++){let hl=a[Qr];if(s.charCodeAt(hl)===Wo){if(a[Qr+1]-hl===1)mr=gl=i[Qr];else Mr=hl+1,Rn=a[Qr+1],_m=i[Qr],gl=tr;break}}tr=gl}if(mr>=0&&(u[mr]>=0||K[mr]===1)&&ot+1<Eo&&F.charCodeAt(ot+1)===45){if(or===Qo){Qo*=2;let fr=new Int32Array(Qo);fr.set(Yr),Yr=fr;let ps=new Int32Array(Qo);ps.set(Kr),Kr=ps}Yr[or]=mr,Kr[or]=ot+2,or++}}}if(Jr===Eo)ul=Mr<Rn?-1:tr,ml=or;let fl=Mr<Rn?-1:tr,Po,fs=!1;if(Jr>=0){if(fs=!0,Po=is(F,To,Jr,ul,ml),Po!==-1&&Po<r&&E[Po]){let ot=is(F,To,Eo,fl,or);if(ot!==-1&&ot!==Po)Po=ot,fs=!1}else if(Po===-1)Po=is(F,To,Eo,fl,or),fs=!1}else Po=is(F,To,Eo,fl,or);let pl=0,dl=0;if(Po===-1)Vt[zt]=-1;else dl=fs?1:0,pl=yn>=Qn?ea?1:0:de(ge,F,yn,Qn,ea?1:0,(ot)=>ct(ot,ea)),Vt[zt]=Po,Vo[zt]=dl,Co[zt]=pl;we(er,F,Ue,Ut,Ar,Po,pl,dl)}if(te===0)return"";if(te===1)return Gt[0]===0&&lo[0]===Z?F:F.slice(Gt[0],lo[0]);if(te*B>Tr){while(te*B>Tr)Tr<<=1,Bm--;rl=new Float64Array(Tr),ss=new Int32Array(Tr)}if(Ae>=_t||co>=_t)throw Error("cn: too many distinct classes in one merge");if(Er=Er+1|0,Er===0)ol.fill(0),ss.fill(0),Er=1;let je=!1;for(let Pe=te-1;Pe>=0;Pe--){let Ue=Vt[Pe];if(Ue===-1){vo[Pe]=1;continue}let $e=Co[Pe];if(nl($e,Ue)===1){vo[Pe]=0,je=!0;continue}if(vo[Pe]=1,Ue<r){let Ut=W[Ue];if(Ut>=0)for(let eo=b[Ut];eo<b[Ut+1];eo++)nl($e,S[eo]);if(Vo[Pe]&1){for(let eo=0;eo<x.length;eo++)if(x[eo]===Ue)nl($e,y[eo])}}}if(!je&&!Be&&Z===ye+te-1)return F;let ft="",Ke=0;while(Ke<te){if(!vo[Ke]){Ke++;continue}let Pe=Gt[Ke],Ue=lo[Ke],$e=Ke+1;while($e<te&&vo[$e]&&Gt[$e]===Ue+1&&F.charCodeAt(Ue)===32)Ue=lo[$e],$e++;if(ft.length>0)ft+=" ";ft+=F.slice(Pe,Ue),Ke=$e}return ft},Pr=16384,ur=new Int32Array(Pr*2),ls=0,Uo=1,Kn=Object.create(null),Hm=Object.create(null),xn=new Map,Vm=new Map,us=0,ms=0,Jn=()=>{ls^=Pr,Uo=Uo+1|0,ms=0},C1=(F)=>{let Z=Kn[F];if(Z!==void 0)return Z;let te=Us(F,0,F.length),ye=(te&16383)+ls,Be=ur[ye]===(te^Uo)||ur[ye^Pr]===(te^Uo-1);if(Be){if(Z=Hm[F],Z!==void 0)return Kn[F]=Z,Z}if(Z=cs(F),Be){if(Kn[F]=Z,++us>re)us=0,Hm=Kn,Kn=Object.create(null),Jn()}else if(ur[ye]=te^Uo,++ms>Pr)Jn();return Z},S1=(F)=>{let Z=xn.get(F);if(Z!==void 0)return Z;let te=Us(F,0,F.length),ye=(te&16383)+ls,Be=ur[ye]===(te^Uo)||ur[ye^Pr]===(te^Uo-1);if(Be){if(Z=Vm.get(F),Z!==void 0)return xn.set(F,Z),Z}if(Z=cs(F),Be){if(xn.set(F,Z),++us>re)us=0,Vm=xn,xn=new Map,Jn()}else if(ur[ye]=te^Uo,++ms>Pr)Jn();return Z},w1=(F)=>{let Z=Us(F,0,F.length),te=(Z&16383)+ls;if(ur[te]===(Z^Uo)||ur[te^Pr]===(Z^Uo-1))return!0;if(ur[te]=Z^Uo,++ms>Pr)Jn();return!1},al=re===0?cs:bI?(F)=>{let Z=xn.get(F);return Z!==void 0?Z:S1(F)}:C1;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?al(arguments[0]):al(Of.apply(null,arguments))},mergeString:al,seenBefore:re===0?()=>!1:w1,mergeUncached:cs}},Ws=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Ws(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},CI=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Ws(n,t);if(a){if(o)o+=" ";o+=a}}return o},Of=function(){return CI(arguments,!1)};var Nf=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,p=(g,C,w)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let b=Us(g,0,g.length)&4094;if(c[b]===g&&u[b]===C)return l[b];if(c[b|1]===g&&u[b|1]===C)return l[b|1];let S=e(w?C+" "+g:g),x=c[b]===""?b:b|(c[b|1]===""?1:m++&1);return c[x]=g,u[x]=C,l[x]=S,S},d=(g,C,w,b)=>{let S=0;if(C){if(C!==g.a0)return!1;S=1}if(w){if(w!==(S===0?g.a0:g.a1))return!1;S++}if(b){if(b!==(S===0?g.a0:S===1?g.a1:g.a2))return!1;S++}return S===g.t},f=(g,C)=>{let w=g.a,b=0;for(let S=0;S<C.length;S++){let x=C[S];if(!x)continue;if(x!==w[b])return!1;b++}return b===g.t},h=(g,C)=>{let w=g.length,b=i===null?null:i.n;if(!C){if(b!==null&&f(b,g))return i=b,b.r;if(i!==null&&i!==b&&f(i,g))return i.r}let S="",x=-1,y=0,R=!1;for(let W=0;W<w;W++){let M=g[W];if(!M)continue;if(typeof M!=="string"){if(M=g[W]=Ws(M,!0),!M)continue;R=!0}if(x<0)S=M,x=W;y++}if(y===0)return"";if(y===1)return e(S);if(R){if(b!==null&&f(b,g))return i=b,b.r;if(i!==null&&i!==b&&f(i,g))return i.r}let v=n.get(S);if(v===void 0){if(v=a.get(S),v!==void 0)n.set(S,v)}let L=null;if(v!==void 0){if(v.skip>0){v.skip--,i=null;let M=S;for(let B=x+1;B<w;B++){let D=g[B];if(D)M+=" "+D}return p(M,"",!1)}let W=v.e;e:for(let M=0;M<W.length;M++){let B=W[M];if(B.t!==y)continue;let D=B.a,E=1;for(let N=x+1;N<w;N++){let K=g[N];if(K&&K!==D[E++])continue e}L=B;break}if(L!==null)v.miss=0}if(L===null){let W=S,M=[S];for(let D=x+1;D<w;D++){let E=g[D];if(!E)continue;W+=" "+E,M.push(E)}if(!o(W))return r(W);if(L={r:e(W),t:M.length,a0:M[0],a1:M[1],a2:M[2]??"",a:M,n:null},v===void 0)n.set(S,v={e:[],miss:0,skip:0,at:0});else if(++v.miss>16)v.miss=16,v.skip=1024,v.e.length=0,v.at=0;let B=v.e;if(B.length<256)B.push(L);else B[v.at]=L,v.at=v.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==L)i.n=L;return i=L,L.r},I=(g)=>Array.isArray(g)?h(g.slice(),!1):e(Ws(g,!0));return function(g,C,w){let b=arguments.length;if((b|1)===3){let y=i;if(y!==null){let R=y.n;if(R!==null&&d(R,g,C,w))return i=R,R.r;if(y!==R&&d(y,g,C,w))return y.r}if(b===2&&typeof C==="string"&&C!==""){let R=n.get(g);if(R!==void 0&&R.skip>0)return R.skip--,i=null,p(C,g,!0)}return h([g,C,w],!0)}if(b===1)return typeof g==="string"?e(g):I(g);let S=i;if(S!==null){let y=S.n;if(y!==null){let R=y.a,v=0,L=!0;for(let W=0;W<b;W++){let M=arguments[W];if(!M)continue;if(M!==R[v]){L=!1;break}v++}if(L&&v===y.t)return i=y,y.r}if(S!==y){let R=S.a,v=0,L=!0;for(let W=0;W<b;W++){let M=arguments[W];if(!M)continue;if(M!==R[v]){L=!1;break}v++}if(L&&v===S.t)return S.r}}let x=[];for(let y=0;y<b;y++)x.push(arguments[y]);return h(x,!0)}};var yl=Ff(Df),fe=Nf(yl.mergeString,yl),mHe=yl.merge;import*as Gf from"react";import*as kn from"react";function _s(){return typeof window<"u"}function Tt(e){if(Gs(e))return(e.nodeName||"").toLowerCase();return"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nr(e){var t;return(t=(Gs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gs(e){if(!_s())return!1;return e instanceof Node||e instanceof ze(e).Node}function He(e){if(!_s())return!1;return e instanceof Element||e instanceof ze(e).Element}function Ge(e){if(!_s())return!1;return e instanceof HTMLElement||e instanceof ze(e).HTMLElement}function zo(e){if(!_s()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function an(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=Xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Bf(e){return/^(table|td|th)$/.test(Tt(e))}function aa(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var SI=/transform|translate|scale|rotate|perspective|filter/,wI=/paint|layout|strict|content/,nn=(e)=>!!e&&e!=="none",Rl;function zs(e){let t=He(e)?Xt(e):e;return nn(t.transform)||nn(t.translate)||nn(t.scale)||nn(t.rotate)||nn(t.perspective)||!Zs()&&(nn(t.backdropFilter)||nn(t.filter))||SI.test(t.willChange||"")||wI.test(t.contain||"")}function Hf(e){let t=Lo(e);while(Ge(t)&&!Do(t)){if(zs(t))return t;else if(aa(t))return null;t=Lo(t)}return null}function Zs(){if(Rl==null)Rl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Rl}function Do(e){return/^(html|body|#document)$/.test(Tt(e))}function Xt(e){return ze(e).getComputedStyle(e)}function sa(e){if(He(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lo(e){if(Tt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||zo(e)&&e.host||nr(e);return zo(t)?t.host:t}function Vf(e){let t=Lo(e);if(Do(t))return(e.ownerDocument||e).body;if(Ge(t)&&an(t))return t;return Vf(t)}function Dr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=Vf(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=ze(n);if(a){let i=qs(s);return t.concat(s,s.visualViewport||[],an(n)?n:[],i&&o?Dr(i):[])}else return t.concat(n,Dr(n,[],o))}function qs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as xI from"react";var ia={...xI};var vl=ia.useInsertionEffect,yI=vl&&vl!==ia.useLayoutEffect?vl:(e)=>e();function se(e){let t=qe(RI).current;return t.next=e,yI(t.effect),t.trampoline}function RI(){let e={next:void 0,callback:vI,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function vI(){}import*as Uf from"react";var TI=()=>{},q=typeof document<"u"?Uf.useLayoutEffect:TI;function EI(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var PI=EI("https://base-ui.com/production-error","Base UI"),Je=PI;import*as js from"react";var AI=js.createContext(void 0);function An(e=!1){let t=js.useContext(AI);if(t===void 0&&!e)throw Error(Je(16));return t}import*as Wf from"react";function _f(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:Wf.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function Re(e){return e?.ownerDocument||document}function Mn(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(ze(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function uo(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=kn.useRef(null),i=An(!0),c=a??i!==void 0,{props:u}=_f({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=kn.useCallback(()=>{let d=s.current;if(!Tl(d))return;if(c&&t&&u.disabled===void 0&&d.disabled)d.disabled=!1},[t,u.disabled,c]);q(l,[l]);let m=kn.useCallback((d={})=>{let{onClick:f,onMouseDown:h,onKeyUp:I,onKeyDown:g,onPointerDown:C,...w}=d;return Wt({onClick(b){if(t){b.preventDefault();return}f?.(b)},onMouseDown(b){if(!t)h?.(b)},onKeyDown(b){if(t)return;if(ra(b),g?.(b),b.baseUIHandlerPrevented)return;let S=b.target===b.currentTarget,x=b.currentTarget,y=Tl(x),R=!n&&MI(x),v=S&&(n?y:!R),L=b.key==="Enter",W=b.key===" ",M=x.getAttribute("role"),B=M?.startsWith("menuitem")||M==="option"||M==="gridcell";if(S&&c&&W){if(b.defaultPrevented&&B)return;if(b.preventDefault(),!n||y)b.preventBaseUIHandler(),Mn(x,b);return}if(!v||n||!W&&!L){if(S&&R&&W)b.preventDefault();return}if(b.defaultPrevented)return;if(b.preventDefault(),L)b.preventBaseUIHandler(),Mn(x,b)},onKeyUp(b){if(t)return;if(ra(b),I?.(b),b.target===b.currentTarget&&n&&c&&Tl(b.currentTarget)&&b.key===" "){b.preventDefault();return}if(b.baseUIHandlerPrevented)return;if(b.target===b.currentTarget&&!n&&!c&&!b.defaultPrevented&&b.key===" ")b.preventBaseUIHandler(),Mn(b.currentTarget,b)},onPointerDown(b){if(t){b.preventDefault();return}C?.(b)}},n?{type:"button"}:{role:"button"},u,w)},[t,u,c,n]),p=se((d)=>{s.current=d,l()});return{getButtonProps:m,buttonRef:p}}function Tl(e){return Ge(e)&&e.tagName==="BUTTON"}function MI(e){return Ge(e)&&e.tagName==="A"&&Boolean(e.href)}var El=Gf.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=uo({disabled:a,focusableWhenDisabled:s,native:i});return ke("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as LI}from"react/jsx-runtime";var kI=jt("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:e,variant:t="default",size:o="default",...r}){return LI(El,{"data-slot":"button",className:fe(kI({variant:t,size:o,className:e})),...r})}import{jsx as Fr}from"react/jsx-runtime";var DI=jt("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function Ln({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return Fr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:fe(DI({size:o,orientation:r}),e),...n})}var FI=jt("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function ca({className:e,variant:t="icon",...o}){return Fr("div",{"data-slot":"attachment-media","data-variant":t,className:fe(FI({variant:t}),e),...o})}function la({className:e,...t}){return Fr("div",{"data-slot":"attachment-content",className:fe("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function ua({className:e,...t}){return Fr("span",{"data-slot":"attachment-title",className:fe("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function ma({className:e,...t}){return Fr("span",{"data-slot":"attachment-description",className:fe("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function Xs({className:e,...t}){return Fr("div",{"data-slot":"attachment-actions",className:fe("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function zf({className:e,variant:t,size:o="icon-xs",...r}){return Fr(mt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:fe(e),...r})}function $s({className:e,...t}){return Fr("div",{"data-slot":"attachment-group",className:fe("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as Ys from"react";var Pl=Ys.createContext(void 0);function Zf(e){let t=Ys.useContext(Pl);if(t===void 0&&!e)throw Error(Je(33));return t}import*as Ks from"react";var fa=Ks.createContext(void 0);function ho(e){let t=Ks.useContext(fa);if(t===void 0&&!e)throw Error(Je(36));return t}var sn="data-starting-style",pa="data-ending-style";var OI={[sn]:""},NI={[pa]:""},Dn={transitionStatus(e){if(e==="starting")return OI;if(e==="ending")return NI;return null}};var Al="data-open",Ml="data-closed",BI=sn,HI=pa,qf="data-anchor-hidden";var Qs="data-popup-open",Xf="data-pressed";var VI={[Qs]:""},UI={[Qs]:"",[Xf]:""},WI={[Al]:""},_I={[Ml]:""},GI={[qf]:""},Yf={open(e){if(e)return VI;return null}},kl={open(e){if(e)return UI;return null}},da={open(e){if(e)return WI;return _I},anchorHidden(e){if(e)return GI;return null}},ei={...da,...Dn};import*as ti from"react";var zI=ti.createContext(void 0);function Fn(e=!0){let t=ti.useContext(zI);if(t===void 0&&!e)throw Error(Je(25));return t}var ga="none",oi="trigger-press",mo="trigger-hover",ha="trigger-focus",Ll="outside-press",Dl="item-press",ZI="close-press";var On="focus-out",Fl="escape-key";var ri="list-navigation",Kf="keyboard",qI="pointer";var jI="cancel-open",Ia="sibling-open";var Jf="imperative-action";import*as ba from"react";var Ol=ba.createContext(null);function Nl(e="root"){let t=ba.useContext(Ol),o=ba.useContext(fa);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var XI={visible:!0,ref:null};function $I(){return XI}function Qf(e,t,o="root"){let r=Nl(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??$I)({label:e.label,children:e.children,render:e.render}),s=ko(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as Nn from"react";import*as np from"react";function YI(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:KI,platform:JI,maxTouchPoints:ep}=YI(),cn=KI.toLowerCase(),ln=JI.toLowerCase();var Bl=/^i(os$|p)/.test(ln)||ln==="macintel"&&ep>1,tp="android",op=ln===tp||cn.includes(tp),rp=!Bl&&ln.startsWith("mac"),QI=ln.startsWith("win"),e2=!op&&/^(linux|chrome os)/.test(ln),Hl=rp||Bl;var Vl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),t2=!Vl&&cn.includes("firefox"),o2=!Vl&&cn.includes("chrom");var r2=Hl;var n2=/jsdom|happydom/.test(cn);function a2(e){e.preventDefault()}function ap(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=ho(),l=Fn(!0),m=c.type==="submenu-trigger",p=m?u.parentVirtualFocus:u.virtualFocus,f=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:h}=a.useState("floatingTreeRoot"),I=a.useState("open"),g=l!==void 0,C=!p&&I&&o?0:-1;return np.useMemo(()=>({id:r,role:"menuitem",tabIndex:C,"aria-selected":f,onMouseDown:p?a2:void 0,onKeyDown(w){if(w.key===" "&&s?.current)w.preventDefault()},onMouseMove(w){if(!n)return;h.emit("itemhover",{nodeId:n,target:w.currentTarget})},onClick(w){if(t)h.emit("close",{domEvent:w.nativeEvent,reason:Dl})},onMouseUp(w){if(l){let b=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,g&&b&&Math.abs(w.clientX-b.x)<=1&&Math.abs(w.clientY-b.y)<=1)return;if(g&&!dr.mac&&w.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!g||w.button===2)){if(c.type==="regular-item")Mn(i.current,w,{detail:1,pointerType:"mouse"})}}}),[t,C,r,h,n,a.context.allowMouseUpTriggerRef,s,i,l,g,c.type,f,p])}var sp={type:"regular-item"};function ip(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=Nn.useRef(null),{getButtonProps:m,buttonRef:p}=uo({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),d=ap({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),f=Nn.useCallback((I)=>Wt(d,{onMouseEnter(g){if(c.type!=="submenu-trigger")return;c.setActive(g.nativeEvent)}},I,m),[d,m,c]),h=ko(l,p);return Nn.useMemo(()=>({getItemProps:f,itemRef:h}),[f,h])}import*as un from"react";import*as ni from"react";var Wl=ni.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function cp(){return ni.useContext(Wl)}function ai(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=cp(),l=un.useRef(-1),[m,p]=un.useState(a==null&&t?()=>{if(l.current===-1){let I=u.current;u.current+=1,l.current=I}return l.current}:-1),d=a??m,f=un.useRef(null),h=un.useCallback((I)=>{let g=f.current;if(g)i(g);if(f.current=I,I)s(I,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return q(()=>{if(a!=null)return;return c((I)=>{let g=f.current?I.get(f.current)?.index:null;if(g!=null)p(g)})},[a,c]),{ref:h,index:d}}import*as ci from"react";import*as si from"react";function ii(){let[,e]=si.useState({});return si.useCallback(()=>{e({})},[])}var lp=0;function s2(e,t="mui"){let o=ci.useRef(void 0),r=ii(),n=e??o.current;return ci.useEffect(()=>{if(o.current==null){if(lp+=1,o.current=`${t}-${lp}`,e==null)r()}},[e,t,r]),n}var up=ia.useId;function ar(e,t){if(up!==void 0){let o=up();return e??(t?`${t}-${o}`:o)}return s2(e,t)}function fo(e){return ar(e,"base-ui")}function Me(e,t,o,r){let n=!1,a=!1,s=r??We;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function mp(e,t,o){let r=o??We;return{reason:e,event:t??new Event("base-ui"),...r}}import*as _l from"react";import*as fp from"react";function Or(e){fp.useEffect(e,pr)}var li=null,q9e=globalThis.requestAnimationFrame;class pp{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var ui=new pp;class Fo{static create(){return new Fo}static request(e){return ui.request(e)}static cancel(e){return ui.cancel(e)}currentId=li;request(e){this.cancel(),this.currentId=ui.request(()=>{this.currentId=li,e()})}cancel=()=>{if(this.currentId!==li)ui.cancel(this.currentId),this.currentId=li};disposeEffect=()=>this.cancel}function hr(){let e=qe(Fo.create).current;return Or(e.disposeEffect),e}function dp(e,t=!1,o=!1,r=!1){let[n,a]=_l.useState(e&&t?"idle":void 0),[s,i]=_l.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return q(()=>{if(!e&&s&&n!=="ending"&&o){let c=Fo.request(()=>{a("ending")});return()=>{Fo.cancel(c)}}return},[e,s,n,o]),q(()=>{if(!e||t||n===void 0)return;let c=Fo.request(()=>{a(void 0)});return()=>{Fo.cancel(c)}},[t,e,n]),q(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=Fo.request(()=>{a("idle")});return()=>{Fo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as gp from"react";import*as zl from"react-dom";function Zo(e){if(e==null)return e;return"current"in e?e.current:e}function Gl(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var mi=null;function i2(e){if(!mi){let t=[];mi=t,queueMicrotask(()=>{mi=null,zl.flushSync(()=>{for(let o of t)o()})})}mi.push(e)}function Bn(e,t=!1,o=!1){let r=hr();return se((n,a=null)=>{r.cancel();let s=Zo(e);if(s==null)return;let i=s,c=()=>{if(!o){zl.flushSync(n);return}i2(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(Gl(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(Gl(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=sn;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function Nr(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=se(a),i=Bn(r,o,n);gp.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as Zl from"react";import{jsx as c2}from"react/jsx-runtime";var l2=Zl.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:p}=ho(),d=ai({guess:!0,label:s}),f=fo(a),h=p.useState("disabled"),I=p.useState("isActive",d.index),g=p.useState("floatingNodeId"),C=p.useState("itemProps"),w=c||h,{getItemProps:b,itemRef:S}=ip({closeOnClick:u,disabled:w,highlighted:I,id:f,store:p,nativeButton:i,nodeId:g,itemMetadata:sp});return ke("div",t,{state:{disabled:w,highlighted:I},props:[C,m,b],ref:[S,o,d.ref]})}),hp=Zl.forwardRef(function(t,o){let r=Qf(t,o);if(!r.visible)return null;return c2(l2,{...t,ref:r.ref})});import*as In from"react";import*as $t from"react";function Te(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function lt(e){let t=qe(u2,e).current;return t.next=e,q(t.effect),t}function u2(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Sa=0;class to{static create(){return new to}currentId=Sa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Sa,t()},e)}isStarted(){return this.currentId!==Sa}clear=()=>{if(this.currentId!==Sa)clearTimeout(this.currentId),this.currentId=Sa};disposeEffect=()=>this.clear}function rt(){let e=qe(to.create).current;return Or(e.disposeEffect),e}import*as pi from"react";var Ip={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},fi={...Ip,position:"fixed",margin:0,top:0,left:0},R7e={...Ip,position:"absolute"};import{jsx as m2}from"react/jsx-runtime";var qo=pi.forwardRef(function(t,o){let[r,n]=pi.useState();return q(()=>{if(Ul.voiceOver&&gr.webkit)n("button")},[]),m2("span",{...t,ref:o,style:fi,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});function nt(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function pe(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&zo(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e,t){let o=e;while(o){if(He(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(zo(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var wa="data-base-ui-focusable";var ql="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",xa="ArrowLeft",ya="ArrowRight",jl="ArrowUp",di="ArrowDown";var O7e=Qs,Xl="data-trigger-disabled";function Br(e,t){if(!He(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(Xl);for(let[,r]of t.entries())if(pe(r,o))return!r.hasAttribute(Xl);return!1}function gi(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function bp(e){return e.matches("html,body")}function br(e){return Ge(e)&&e.matches(ql)}function $l(e){return Ir(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ql}`)!=null}function Ra(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&br(e)}function Hr(e){if(!e||Ca.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function va(e){if(!e)return null;return e.hasAttribute(wa)?e:e.querySelector(`[${wa}]`)||e}function wo(e){e.preventDefault(),e.stopPropagation()}function Cp(e){return"nativeEvent"in e}function Vr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(dr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function Hn(e){if(Ca.jsdom)return!1;return!dr.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(dr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Cr(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Sp(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var{min:Ur,max:jo,round:Ea,floor:Pa}=Math,sr=(e)=>({x:e,y:e}),p2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ii(e,t,o){return jo(e,Ur(t,o))}function ir(e,t){return typeof e==="function"?e(t):e}function po(e){return e.split("-")[0]}function xo(e){return e.split("-")[1]}function bi(e){return e==="x"?"y":"x"}function Aa(e){return e==="y"?"height":"width"}function Io(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Ma(e){return bi(Io(e))}function yp(e,t,o){if(o===void 0)o=!1;let r=xo(e),n=Ma(e),a=Aa(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=Ta(s);return[s,Ta(s)]}function Rp(e){let t=Ta(e);return[hi(e),t,hi(t)]}function hi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var wp=["left","right"],xp=["right","left"],d2=["top","bottom"],g2=["bottom","top"];function h2(e,t,o){switch(e){case"top":case"bottom":if(o)return t?xp:wp;return t?wp:xp;case"left":case"right":return t?d2:g2;default:return[]}}function vp(e,t,o,r){let n=xo(e),a=h2(po(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(hi))}return a}function Ta(e){let t=po(e);return p2[t]+e.slice(t.length)}function I2(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function Ci(e){return typeof e!=="number"?I2(e):{top:e,right:e,bottom:e,left:e}}function mn(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function Si(e,t){return t<0||t>=e.length}function wi(e,t){return Kl(e.current,{disabledIndices:t})}function Yl(e,t){return Kl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tp(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>Kl(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let p=r?-1:e.length;if(a&&t!==p)l=-1;else l=r?c:i,m=!0}else l=u();return{index:Si(e,l)?-1:l,wrapped:m}}function Kl(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&Jl(e,a,r));return a}function Jl(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!fn(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function b2(e){return e.visibility==="hidden"||e.visibility==="collapse"}function fn(e,t=e?Xt(e):null){if(!e||!e.isConnected||!t||b2(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var C2='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function S2(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return zo(o)?o.host:null}function eu(e){for(let t of Array.from(e.children))if(Tt(t)==="summary")return t;return null}function w2(e,t){let o=eu(t);return!!o&&(e===o||pe(o,e))}function Ep(e){let t=e?Tt(e):"";return e!=null&&e.matches(C2)&&(t!=="summary"||e.parentElement!=null&&Tt(e.parentElement)==="details"&&eu(e.parentElement)===e)&&(t!=="details"||eu(e)==null)&&(t!=="input"||e.type!=="hidden")}function tu(e){if(!Ep(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=S2(t)){let o=t!==e,r=Tt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Tt(t)==="details"&&!t.open&&!w2(e,t)||t.hasAttribute("hidden")||!r&&!x2(t,o))return!1}return!0}function x2(e,t){let o=Xt(e);if(!t)return fn(e,o);return o.display!=="none"}function Pp(e){let t=e.tabIndex;if(t<0){let o=Tt(e);if(o==="details"||o==="audio"||o==="video"||Ge(e)&&e.isContentEditable)return 0}return t}function Ql(e){if(Tt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function Ap(e,t){let o=Ql(e);if(!o)return!0;let r=t.find((n)=>{let a=Ql(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=Ql(n);return a?.name===o.name&&a.form===o.form})===o}function Mp(e){if(Ge(e)&&Tt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(Ge(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function ou(e,t){Mp(e).forEach((o)=>{if(Ep(o))t.push(o);ou(o,t)})}function kp(e,t,o){Mp(e).forEach((r)=>{if(Ge(r)&&r.matches(t))o.push(r);kp(r,t,o)})}function ka(e){return tu(e)&&Pp(e)>=0}function ru(e){let t=[];return ou(e,t),t.filter(tu)}function La(e){let t=ru(e);return t.filter((o)=>Pp(o)>=0&&Ap(o,t))}function Lp(e,t){let o=La(e),r=o.length;if(r===0)return;let n=nt(Re(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function xi(e){return Lp(Re(e).body,1)||e}function yi(e){return Lp(Re(e).body,-1)||e}function Dp(e,t,o){if(!e)return null;let r=[];ou(Re(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(tu);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!pe(o,i)&&ka(i)&&Ap(i,a))return i}return r[n]}function Sr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!pe(o,r)}function Fp(e){La(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function nu(e){let t=[];kp(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function Oo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...Oo(e,n.id,o)])}function au(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function cr(e){return`data-base-ui-${e}`}var Ri=0;function Vn(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(Ri);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return Ri=s,()=>{if(Ri===s)cancelAnimationFrame(s),Ri=0}}var Op="data-base-ui-inert",Da=new WeakMap,vi=new WeakSet,Fa=new WeakMap,su=0;function Vp(e){if(!e)return null;return zo(e)?e.host:Vp(e.parentNode)}var Np=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=Vp(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),Bp=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},Hp=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(Tt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function y2(e,t,o,{mark:r=!0}){let n=Np(t,e),a=r?Hp(t,Bp(n),new Set(n)):[],s=[],i=[];if(o){let c=Np(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);Hp(t,Bp(u),new Set(u)).forEach((m)=>{let p=m.getAttribute("aria-hidden"),d=p!==null&&p!=="false",f=(Da.get(m)||0)+1;if(Da.set(m,f),s.push(m),f===1&&d)vi.add(m);if(!d)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Fa.get(c)||0)+1;if(Fa.set(c,u),i.push(c),u===1)c.setAttribute(Op,"")});return su+=1,()=>{if(s.forEach((c)=>{let u=(Da.get(c)||0)-1;if(Da.set(c,u),!u){if(!vi.has(c))c.removeAttribute("aria-hidden");vi.delete(c)}}),r)i.forEach((c)=>{let u=(Fa.get(c)||0)-1;if(Fa.set(c,u),!u)c.removeAttribute(Op)});if(su-=1,!su)Da=new WeakMap,vi=new WeakSet,Fa=new WeakMap}}function iu(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=Re(e[0]).body;return y2(e,n,o,{mark:r})}import*as it from"react";import*as lu from"react-dom";var Up=500,Wp=500,_p={style:{transition:"none"}},Ti="data-base-ui-click-trigger";var Gp="[data-base-ui-swipe-ignore]",zp="[data-swipe-ignore]",Zp={fallbackAxisSide:"none"},qp={fallbackAxisSide:"end"},jp={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as cu,jsxs as Xp}from"react/jsx-runtime";var $p=it.createContext(null),uu=()=>it.useContext($p),R2=cr("portal");function Ei(e={}){let{ref:t,container:o,componentProps:r=We,elementProps:n}=e,a=ar(),i=uu()?.portalNode,[c,u]=it.useState(null),[l,m]=it.useState(null),p=se((I)=>{if(I!==null)m(I)}),d=it.useRef(null);q(()=>{if(o===null){if(d.current)d.current=null,m(null),u(null);return}let I=(o&&(Gs(o)?o:o.current))??i??document.body;if(I==null){if(d.current)d.current=null,m(null),u(null);return}if(d.current!==I)d.current=I,m(null),u(I)},[o,i]);let f=ke("div",r,{ref:[t,p],props:[{id:a,[R2]:""},n]}),h=c&&f?lu.createPortal(f,c):null;return{node:l,nodeId:it.isValidElement(f)?f.props.id:void 0,subtree:h}}var Oa=it.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:p}=Ei({container:i,ref:o,componentProps:t,elementProps:u}),d=it.useRef(null),f=it.useRef(null),h=it.useRef(null),I=it.useRef(null),[g,C]=it.useState(null),w=it.useRef(!1),b=g?.modal,S=g?.open,x=!!g&&!g.modal&&g.open&&!!l;it.useEffect(()=>{if(!l||b)return;function R(v){if(l&&v.relatedTarget&&Sr(v))if(v.type==="focusin"){if(w.current)nu(l),w.current=!1}else Fp(l),w.current=!0}return Zt(Te(l,"focusin",R,!0),Te(l,"focusout",R,!0))},[l,b]),q(()=>{if(!l||S!==!0||!w.current)return;nu(l),w.current=!1},[S,l]);let y=it.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:h,afterInsideRef:I,portalNode:l,setFocusManagerState:C}),[l]);return Xp(it.Fragment,{children:[p,Xp($p.Provider,{value:y,children:[x&&l&&cu(qo,{"data-type":"outside",ref:d,onFocus:(R)=>{if(Sr(R,l))h.current?.focus();else{let v=g?g.domReference:null;yi(v)?.focus()}}}),x&&l&&cu("span",{role:c,"aria-owns":m,style:jp}),l&&lu.createPortal(s,l),x&&l&&cu(qo,{"data-type":"outside",ref:f,onFocus:(R)=>{if(Sr(R,l))I.current?.focus();else{let v=g?g.domReference:null;if(xi(v)?.focus(),g?.closeOnFocusOut)g?.onOpenChange(!1,Me(On,R.nativeEvent))}}})]})]})});import*as Wr from"react";function Pi(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class pn{nodesRef={current:[]};events=Pi();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as Yp}from"react/jsx-runtime";var Kp=Wr.createContext(null),Jp=Wr.createContext(null),yo=()=>Wr.useContext(Kp)?.id||null,oo=(e)=>{let t=Wr.useContext(Jp);return e??t};function Na(e){let t=ar(),o=oo(e),r=yo();return q(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function mu(e){let{children:t,id:o}=e,r=yo();return Yp(Kp.Provider,{value:Wr.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function fu(e){let{children:t,externalTree:o}=e,r=qe(()=>o??new pn).current;return Yp(Jp.Provider,{value:r,children:t})}import{jsx as Qp,jsxs as v2}from"react/jsx-runtime";function T2(e,t){let o=ze(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Vr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var ed=20,_r=[];function pu(){_r=_r.filter((e)=>e.deref()?.isConnected)}function td(e){if(pu(),e&&Tt(e)!=="body"){if(_r.push(new WeakRef(e)),_r.length>ed)_r=_r.slice(-ed)}}function od(){return pu(),_r[_r.length-1]?.deref()}function E2(e){if(!e)return null;if(ka(e))return e;return La(e)[0]||e}function rd(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=ru(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return ka(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function Ba(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:d,externalTree:f,getInsideElements:h}=e,I=t.useState("open"),g=t.useState("domReferenceElement"),C=t.useState("floatingElement"),{events:w,dataRef:b}=t.context,S=se(()=>b.current.floatingContext?.nodeId),x=n===!1,y=Ra(g)&&x,R=lt(n),v=lt(a),L=lt(s),W=lt(l),M=lt(I),B=oo(f),D=uu(),E=$t.useRef(!1),N=$t.useRef(!1),K=$t.useRef(!1),A=$t.useRef(null),O=$t.useRef(""),Y=$t.useRef(""),G=$t.useRef(null),k=$t.useRef(null),re=ko(G,d,D?.beforeInsideRef),U=ko(k,D?.afterInsideRef),j=rt(),_=rt(),ne=hr(),be=D!=null,ee=va(C),ce=se((ie=ee)=>ie?La(ie):[]),le=se(()=>h?.().filter((ie)=>ie!=null)??[]);$t.useEffect(()=>{if(r||!c)return;function ie(Se){if(Se.key==="Tab"){if(pe(ee,nt(Re(ee)))&&ce().length===0&&!y)wo(Se)}}let xe=Re(ee);return Te(xe,"keydown",ie)},[r,ee,c,y,ce]),$t.useEffect(()=>{if(r||!I)return;let ie=Re(ee);function xe(){K.current=!1}function Se(Ne){let ae=Ze(Ne),V=le(),T=pe(C,ae)||pe(g,ae)||pe(D?.portalNode,ae)||V.some((J)=>J===ae||pe(J,ae));if(K.current=!T,Y.current=Ne.pointerType||"keyboard",Ir(ae,`[${Ti}]`))N.current=!0,_.start(0,()=>{N.current=!1})}function Le(){Y.current="keyboard"}return Zt(Te(ie,"pointerdown",Se,!0),Te(ie,"pointerup",xe,!0),Te(ie,"pointercancel",xe,!0),Te(ie,"keydown",Le,!0),xe)},[r,C,g,ee,I,D,_,le]),$t.useEffect(()=>{if(r||!u)return;let ie=Re(ee);function xe(){N.current=!0,_.start(0,()=>{N.current=!1})}function Se(V){let T=Ze(V);if(ka(T))A.current=T}function Le(V){let{relatedTarget:T,currentTarget:J}=V,z=Ze(V);if(c&&T==null&&z!=null&&pe(C,z))td(z);queueMicrotask(()=>{let ue=S(),P=t.context.triggerElements,H=le(),me=T?.hasAttribute(cr("focus-guard"))&&[G.current,k.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,Zo(p),Zo(m)].includes(T),X=!(pe(g,T)||pe(C,T)||pe(T,C)||pe(D?.portalNode,T)||H.some((oe)=>oe===T||pe(oe,T))||P.hasMatchingElement((oe)=>pe(oe,T))||me||B&&(Oo(B.nodesRef.current,ue).find((oe)=>pe(oe.context?.elements.floating,T)||pe(oe.context?.elements.domReference,T))||au(B.nodesRef.current,ue).find((oe)=>[oe.context?.elements.floating,va(oe.context?.elements.floating)].includes(T)||oe.context?.elements.domReference===T)));if(J===g&&ee)rd(ee);if(i&&J!==g&&!fn(z)&&nt(ie)===ie.body){if(Ge(ee)){if(ee.focus(),i==="popup"){ne.request(()=>{ee.focus()});return}}let oe=ce(),de=A.current,ge=(de&&oe.includes(de)?de:null)||oe[oe.length-1]||ee;if(Ge(ge))ge.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}if((y?!0:!c)&&T&&X&&!N.current&&(y||T!==od()))E.current=!0,t.setOpen(!1,Me(On,V))})}function Ne(){if(K.current)return;b.current.insideReactTree=!0,j.start(0,()=>{b.current.insideReactTree=!1})}let ae=Ge(g)?g:null;if(!C&&!ae)return;return Zt(ae&&Te(ae,"focusout",Le),ae&&Te(ae,"pointerdown",xe),C&&Te(C,"focusin",Se),C&&Te(C,"focusout",Le),C&&D&&Te(C,"focusout",Ne,!0))},[r,g,C,ee,c,B,D,t,u,i,ce,y,S,b,j,_,ne,m,p,le]),$t.useEffect(()=>{if(r||!C||!I)return;let ie=Array.from(D?.portalNode?.querySelectorAll(`[${cr("portal")}]`)||[]),Se=(B?au(B.nodesRef.current,S()):[]).find((J)=>Ra(J.context?.elements.domReference||null))?.context?.elements.domReference,Ne=[...[C,...ie,G.current,k.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,...le()],Se,Zo(p),Zo(m),y?g:null].filter((J)=>J!=null),ae=iu(Ne,{ariaHidden:c||y,mark:!1}),V=[C,...ie].filter((J)=>J!=null),T=iu(V);return()=>{T(),ae()}},[I,r,g,C,c,D,y,B,S,m,p,le]),q(()=>{if(!I||r||!Ge(ee))return;O.current="",Y.current="";let ie=Re(ee),xe=nt(ie);queueMicrotask(()=>{let Se=R.current,Le=typeof Se==="function"?Se(W.current||""):Se;if(Le===void 0||Le===!1)return;if(pe(ee,xe))return;let ae=null,V=()=>{if(ae==null)ae=ce(ee);return ae[0]||ee},T;if(Le===!0||Le===null)T=V();else T=Zo(Le);T=T||V();let J=pe(ee,nt(ie)),z=b.current.openEvent,ue=z?.type==="mousedown"&&Vr(z);Vn(T,{sync:ue,preventScroll:T===ee,shouldFocus(){if(!M.current)return!1;if(J)return!0;let P=nt(ie);return!(P!==T&&pe(ee,P))}})})},[r,I,ee,ce,R,W,M,b]);let Ce=$t.useRef(null);q(()=>{if(r||!ee){Ce.current=null;return}if(Ce.current)Ce.current.cancelled=!0,Ce.current=null;let ie=Re(ee),xe=nt(ie),Se=W.current==null;td(xe);function Le(ae){if(!ae.open)O.current=T2(ae.nativeEvent,Y.current);if(ae.reason===On&&ae.triggerElement?.hasAttribute(cr("focus-guard"))||ae.reason===mo&&ae.nativeEvent.type==="mouseleave")E.current=!0;if(ae.reason!==Ll)return;if(ae.nested)E.current=!1;else if(Vr(ae.nativeEvent)||Hn(ae.nativeEvent))E.current=!1;else{let V=!1;if(Re(ee).createElement("div").focus({get preventScroll(){return V=!0,!1}}),V)E.current=!1;else E.current=!0}}w.on("openchange",Le);function Ne(ae){let V=v.current,T=typeof V==="function"?V(ae):V;if(T===void 0||T===!1)return null;if(T===null)T=!0;let J=g?.isConnected?g:null,z=xe?.isConnected&&Tt(xe)!=="body"?xe:null,ue=Se?z||J:J||z;if(!ue)ue=od()||null;if(typeof T==="boolean")return ue;return Zo(T)||ue||null}return()=>{w.off("openchange",Le);let ae=nt(ie),V=le(),T=pe(C,ae)||V.some((H)=>H===ae||pe(H,ae))||B&&Oo(B.nodesRef.current,S(),!1).some((H)=>pe(H.context?.elements.floating,ae)),J=v.current,z=O.current,ue=Ne(z),P={cancelled:!1};Ce.current=P,queueMicrotask(()=>{if(Ce.current===P)Ce.current=null;let H=E2(ue),me=L.current??typeof J!=="boolean";if(!P.cancelled&&J&&!E.current&&Ge(H)&&(!me&&H!==ae&&ae!==ie.body?T:!0)){let X={preventScroll:!0};if(z==="keyboard")X.focusVisible=!0;H.focus(X)}E.current=!1})}},[r,C,ee,v,L,W,w,B,g,S,le]),q(()=>{if(!gr.webkit||I||!C)return;let ie=nt(Re(C));if(!Ge(ie)||!br(ie))return;if(pe(C,ie))ie.blur()},[I,C]),q(()=>{if(r||!D)return;return D.setFocusManagerState({modal:c,closeOnFocusOut:u,open:I,onOpenChange:t.setOpen,domReference:g}),()=>{D.setFocusManagerState(null)}},[r,D,c,I,t,u,g]),q(()=>{if(r||!ee)return;return rd(ee),()=>{queueMicrotask(pu)}},[r,ee]);let Ee=!r&&(c?!y:!0)&&(be||c);return v2($t.Fragment,{children:[Ee&&Qp(qo,{"data-type":"inside",ref:re,onFocus:(ie)=>{if(c){let xe=ce();Vn(xe[xe.length-1])}else if(D?.portalNode)if(E.current=!1,Sr(ie,D.portalNode))xi(g)?.focus();else Zo(p??D.beforeOutsideRef)?.focus()}}),o,Ee&&Qp(qo,{"data-type":"inside",ref:U,onFocus:(ie)=>{if(c)Vn(ce()[0]);else if(D?.portalNode){if(u)E.current=!0;if(Sr(ie,D.portalNode))yi(g)?.focus();else Zo(m??D.afterOutsideRef)?.focus()}}})]})}import*as Ha from"react";function Va(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=oi}=t,u=e.context.dataRef,l=Ha.useRef(void 0),m=hr(),p=rt(),d=Ha.useMemo(()=>{function f(I,g,C,w){let b=Me(c,g,C);if(I&&w==="touch"&&i>0)p.start(i,()=>{e.setOpen(!0,b)});else e.setOpen(I,b)}function h(I,g,C){let w=u.current.openEvent,b=e.select("domReferenceElement")!==g;if(I&&b)return!0;if(!I)return!0;if(!n)return!0;if(w&&(typeof s==="function"?s():s))return!C(w.type);return!1}return{onPointerDown(I){l.current=Cr(I.pointerType,!0)&&Hn(I.nativeEvent)?"virtual":I.pointerType},onMouseDown(I){let g=l.current,C=I.nativeEvent,w=e.select("open");if(I.button!==0||r==="click"||Cr(g,!0)&&a)return;let b=h(w,I.currentTarget,(R)=>R==="click"||R==="mousedown"),S=Ze(C),x=br(S);if(x||g==="virtual"){f(b,C,x?S:I.currentTarget,g);return}let y=I.currentTarget;m.request(()=>{f(b,C,y,g)})},onClick(I){if(r==="mousedown-only")return;let g=l.current;if(r==="mousedown"&&g){l.current=void 0;return}if(Cr(g,!0)&&a)return;let C=e.select("open"),w=h(C,I.currentTarget,(b)=>b==="click"||b==="mousedown"||b==="keydown"||b==="keyup");f(w,I.nativeEvent,I.currentTarget,g)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,p,i]);return Ha.useMemo(()=>o?{reference:d}:We,[o,d])}import*as ro from"react";function P2(){return!1}function A2(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Ua(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=P2,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:p}=e.context,d=oo(c),f=se(typeof n==="function"?n:()=>!1),h=typeof n==="function"?f:n,I=h!==!1,g=se(()=>a),{escapeKey:C,outsidePress:w}=A2(i),b=ro.useRef(!1),S=ro.useRef(!1),x=ro.useRef(!1),y=ro.useRef(!1),R=ro.useRef(!1),v=ro.useRef(""),L=ro.useRef(null),W=rt(),M=rt(),B=rt(),D=se(()=>{M.clear(),m.current.insideReactTree=!1}),E=se((U)=>{let j=m.current.floatingContext?.nodeId;return(d?Oo(d.nodesRef.current,j):[]).some((ne)=>ne.context?.open&&!ne.context.dataRef.current[U])}),N=se((U)=>gi(U,e.select("floatingElement"))||gi(U,e.select("domReferenceElement"))),K=se((U)=>{if(!s())return;e.setOpen(!1,Me(oi,U.nativeEvent))}),A=se((U)=>{if(!u||!o||!r||U.key!=="Escape")return;let j=Cp(U)?U.nativeEvent:U;if(R.current||j.isComposing)return;if(!C&&E("__escapeKeyBubbles"))return;let _=Me(Fl,j);if(e.setOpen(!1,_),!_.isCanceled)U.preventDefault();if(!C&&!_.isPropagationAllowed)U.stopPropagation()}),O=se(()=>{m.current.insideReactTree=!0,M.start(0,D)}),Y=se((U)=>{if(!u||!o||U.button!==0)return;let j=Ze(U.nativeEvent);if(!pe(e.select("floatingElement"),j))return;if(!b.current)b.current=!0,S.current=!1}),G=se((U)=>{if(!u||!o)return;if(!(U.defaultPrevented||U.nativeEvent.defaultPrevented))return;if(b.current)S.current=!0});ro.useEffect(()=>{function U(j){if(!j.open)y.current=!1}return p.on("openchange",U),()=>{p.off("openchange",U)}},[p]),ro.useEffect(()=>D,[D]),ro.useEffect(()=>{if(!u||!o){if(!u)y.current=!1,R.current=!1,v.current="",L.current=null;return D}m.current.__escapeKeyBubbles=C,m.current.__outsidePressBubbles=w;let U=new to,j=Re(l);function _(){B.clear(),R.current=!0}function ne(){R.current=!0,B.start(gr.webkit?5:0,()=>{R.current=!1})}function be(){x.current=!0,U.start(0,()=>{x.current=!1})}function ee(){b.current=!1,S.current=!1}function ce(){let P=v.current,H=P==="pen"||!P?"mouse":P,me=g(),X=typeof me==="function"?me():me;if(typeof X==="string")return X;return X[H]}function le(P){let H=ce();return H==="intentional"&&P.type!=="click"||H==="sloppy"&&P.type==="click"}function Ce(P){let H=m.current.floatingContext?.nodeId,me=d&&Oo(d.nodesRef.current,H).some((X)=>gi(P,X.context?.elements.floating));return N(P)||me}function Ee(P){if(le(P)){if(P.type!=="click"&&!N(P))U.clear(),x.current=!1;D();return}if(m.current.insideReactTree){D();return}let H=Ze(P),me=`[${cr("inert")}]`,X=He(H)?H.getRootNode():null,oe=Array.from((zo(X)?X:Re(e.select("floatingElement"))).querySelectorAll(me)),de=e.context.triggerElements;if(H&&(de.hasElement(H)||de.hasMatchingElement((he)=>pe(he,H))))return;let ge=He(H)?H:null;while(ge&&!Do(ge)){let he=Lo(ge);if(Do(he)||!He(he))break;ge=he}if(oe.length&&He(H)&&!bp(H)&&!pe(H,e.select("floatingElement"))&&oe.every((he)=>!pe(ge,he)))return;if(Ge(H)&&!("touches"in P)){let he=Do(H),Ae=Xt(H),Xe=/auto|scroll/,ct=he||Xe.test(Ae.overflowX),io=he||Xe.test(Ae.overflowY),co=ct&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,Ho=io&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,qt=Ae.direction==="rtl",_t=Ho&&(qt?P.offsetX<=H.offsetWidth-H.clientWidth:P.offsetX>H.clientWidth),go=co&&P.offsetY>H.clientHeight;if(_t||go)return}if(Ce(P))return;if(ce()==="intentional"){if(P.detail!==0&&!Vr(P)&&!y.current)return;if(x.current){U.clear(),x.current=!1;return}}if(typeof h==="function"&&!h(P))return;if(E("__outsidePressBubbles"))return;e.setOpen(!1,Me(Ll,P)),D()}function ie(P){if(ce()!=="sloppy"||P.pointerType==="touch"||!e.select("open")||!o||N(P))return;Ee(P)}function xe(P){if(ce()!=="sloppy"||!e.select("open")||!o||N(P))return;let H=P.touches[0];if(H)L.current={startTime:Date.now(),startX:H.clientX,startY:H.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},W.start(1000,()=>{if(L.current)L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1})}function Se(P,H){let me=Ze(P);if(!me)return;let X=Te(me,P.type,()=>{H(P),X()})}function Le(P){v.current="touch",Se(P,xe)}function Ne(P){if(W.clear(),P.type==="pointerdown"){if(P.button===0)y.current=!0;v.current=P.pointerType}if(P.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;Se(P,(H)=>{if(H.type==="pointerdown")ie(H);else Ee(H)})}function ae(P){if(P.type==="pointercancel")y.current=!1;if(!b.current)return;let H=S.current;if(ee(),ce()!=="intentional")return;if(P.type==="pointercancel"){if(H)be();return}if(Ce(P))return;if(H){be();return}if(typeof h==="function"&&!h(P))return;U.clear(),x.current=!0,D()}function V(P){if(ce()!=="sloppy"||!L.current||N(P))return;let H=P.touches[0];if(!H)return;let me=Math.abs(H.clientX-L.current.startX),X=Math.abs(H.clientY-L.current.startY),oe=Math.sqrt(me*me+X*X);if(oe>5)L.current.dismissOnTouchEnd=!0;if(oe>10)Ee(P),W.clear(),L.current=null}function T(P){Se(P,V)}function J(P){if(ce()!=="sloppy"||!L.current||N(P))return;if(L.current.dismissOnTouchEnd)Ee(P);W.clear(),L.current=null}function z(P){Se(P,J)}let ue=Zt(r&&Zt(Te(j,"keydown",A),Te(j,"compositionstart",_),Te(j,"compositionend",ne)),I&&Zt(Te(j,"click",Ne,!0),Te(j,"pointerdown",Ne,!0),Te(j,"pointerup",ae,!0),Te(j,"pointercancel",ae,!0),Te(j,"mousedown",Ne,!0),Te(j,"mouseup",ae,!0),Te(j,"touchstart",Le,{capture:!0,passive:!0}),Te(j,"touchmove",T,{capture:!0,passive:!0}),Te(j,"touchend",z,{capture:!0,passive:!0})));return()=>{ue(),U.clear(),ee(),x.current=!1}},[m,l,r,I,h,u,o,C,w,A,D,g,E,N,d,e,W,B]);let k=ro.useMemo(()=>({onKeyDown:A,onPointerDown:K,onClick:K}),[A,K]),re=ro.useMemo(()=>({onKeyDown:A,onPointerDown:G,onMouseDown:G,onClickCapture:O,onMouseDownCapture(U){O(),Y(U)},onPointerDownCapture(U){O(),Y(U)},onMouseUpCapture:O,onTouchEndCapture:O,onTouchMoveCapture:O}),[A,O,Y,G]);return ro.useMemo(()=>o?{reference:k,floating:re,trigger:k}:{},[o,k,re])}import*as gu from"react";import*as M2 from"react-dom";function Wa(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),q(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(He(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as du from"react";function nd(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=se(n),{mounted:c,setMounted:u,transitionStatus:l}=dp(t,!1,!1,s),m=t?!1:r;q(()=>{if(t)i(!1)},[t,i]);let p=du.useRef(c),d=du.useRef(!1),f=ii(),h=()=>{p.current=!1,u(!1),a()};q(()=>{if(p.current=c,d.current){if(d.current=!1,!t&&c)h()}});let I=se(()=>{if(!p.current)return;if(t){d.current=!0,f();return}h()});return Nr({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)I()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:I}}var Ai={tabIndex:-1,[wa]:""};function sd(e){return(t)=>t==="touch"?e.current:!0}function id(e,t=!1){let o=ar(),r=yo()!=null,n=qe(()=>e(o,r)).current;return Wa({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function Mi({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function ad(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function k2(e,t){let o=gu.useRef(null);return se((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),ad(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ad(t)})}function ki(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function cd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Li(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=k2(e,o),s=se((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=se((c)=>{if(a(c),c)s(c)});return q(()=>(i(t.current),()=>i(null)),[i,t,o,e]),q(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function Di(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=gu.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");q(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let p=e.context.triggerElements.getById(l);if(!p){for(let[d,f]of e.context.triggerElements.entries())if(f===e.state.activeTriggerElement){u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,p!==e.state.activeTriggerElement)u.activeTriggerElement=p}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let p=e.context.triggerElements.entries().next();if(!p.done){let[d,f]=p.value;u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let p=Me(ga);if(e.setOpen(!1,p),!p.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function Fi(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=nd({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return qe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function Oi(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:We,inactiveTriggerProps:We,popupProps:We})},[e])}function ld(e,t){q(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),q(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class _a{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Su=zm(Ni(),1);import*as pd from"react";import*as Gr from"react";var G2=Ni();function z2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z2=typeof Object.is==="function"?Object.is:z2,q2=G2.useSyncExternalStore,j2=Gr.useRef,X2=Gr.useEffect,$2=Gr.useMemo,Y2=Gr.useDebugValue;var Iu=function(e,t,o,r,n){var a=j2(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=$2(function(){function c(d){if(!u){if(u=!0,l=d,d=r(d),n!==void 0&&s.hasValue){var f=s.value;if(n(f,d))return m=f}return m=d}if(f=m,Z2(l,d))return f;var h=r(d);if(n!==void 0&&n(f,h))return l=d,f;return l=d,m=h}var u=!1,l,m,p=o===void 0?null:o;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,o,r,n]);var i=q2(e,a[0],a[1]);return X2(function(){s.hasValue=!0,s.value=i},[i]),Y2(i),i};import*as ud from"react";var bu=[],Cu=void 0;function md(){return Cu}function fd(e){bu.push(e)}function Ga(e){let t=(o,r)=>{let n=qe(K2).current,a;try{Cu=n;for(let s of bu)s.before(n);a=e(o,r);for(let s of bu)s.after(n);n.didInitialize=!0}finally{Cu=void 0}return a};return t.displayName=e.displayName||e.name,t}function Bi(e){return ud.forwardRef(Ga(e))}function K2(){return{didInitialize:!1}}var J2=En(19),Q2=J2?tb:ob;function Hi(e,t,o,r,n){return Q2(e,t,o,r,n)}function eb(e,t,o,r,n){let a=pd.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return Su.useSyncExternalStore(e.subscribe,a,a)}fd({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};Su.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function tb(e,t,o,r,n){let a=md();if(!a)return eb(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function ob(e,t,o,r,n){return Iu(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class wu{static create(e){return new this(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 o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return Hi(this,e,t,o,r)}}import*as dn from"react";class wr extends wu{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){dn.useDebugValue(e);let o=this;q(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;q(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);q(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){dn.useDebugValue(e);let o=this,r=t!==void 0;q(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return dn.useDebugValue(e),Hi(this,this.selectors[e],t,o,r)}useContextCallback(e,t){dn.useDebugValue(e);let o=se(t??Ye);this.context[e]=o}useStateSetter(e){let t=dn.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var rb={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class xu extends wr{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Pi(),nested:o,triggerElements:n},rb);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Sp(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Ui(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new xu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:We,inactiveTriggerProps:We,popupProps:We}}var za=(e)=>e.triggerIdProp??e.activeTriggerId,Vi=(e)=>e.openProp??e.open,dd=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function gd(e,t){return t!==void 0&&Vi(e)&&za(e)===t}function nb(e,t){if(gd(e,t))return!0;return t!==void 0&&Vi(e)&&za(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Un={open:Vi,mounted:(e)=>e.mounted,transitionStatus:(e)=>Vi(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:za,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:dd,isTriggerActive:(e,t)=>t!==void 0&&za(e)===t,isOpenedByTrigger:(e,t)=>gd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&za(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>nb(e,t)?dd(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var hd=zm(Ni(),1);import*as yu from"react";function Wi(e){let t=yu.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=yu.useCallback(()=>e===void 0?void 0:e.store,[e]);return hd.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as lr from"react";var Ru=dr.mac&&gr.webkit;function vu(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=lr.useRef(!1),i=lr.useRef(null),c=lr.useRef(!0),u=rt();lr.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let p=ze(m);function d(){let I=e.select("domReferenceElement");if(!e.select("open")&&Ge(I)&&I===nt(Re(I)))s.current=!0,i.current=I}function f(){c.current=!0}function h(){c.current=!1}return Zt(Te(p,"blur",d),Ru&&Te(p,"keydown",f,!0),Ru&&Te(p,"pointerdown",h,!0))},[e,o]),lr.useEffect(()=>{if(!o)return;function m(p){if(p.reason===oi||p.reason===Fl){let d=e.select("domReferenceElement");if(He(d))i.current=d,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=lr.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(p){let d=p.currentTarget;if(s.current){if(i.current===d)return;m()}let f=Ze(p.nativeEvent);if(He(f)){if(Ru&&!p.relatedTarget){if(!c.current&&!br(f))return}else if(!Hr(f))return}let h=Br(p.relatedTarget,e.context.triggerElements),{nativeEvent:I,currentTarget:g}=p;if(e.select("open")&&h||!r){e.setOpen(!0,Me(ha,I,g));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Me(ha,I,g))})},onBlur(p){m();let{relatedTarget:d,nativeEvent:f}=p,h=He(d)&&d.hasAttribute(cr("focus-guard"))&&d.getAttribute("data-type")==="outside";u.start(0,()=>{let I=e.select("domReferenceElement"),g=nt(Re(I));if(!d&&g===I)return;if(pe(a.current.floatingContext?.refs.floating.current,g)||pe(I,g)||h)return;if(Br(d??g,e.context.triggerElements))return;e.setOpen(!1,Me(ha,f))})}}},[a,r,e,u]);return lr.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as Pu from"react";class Tu{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new to;restTimeout=new to;handleCloseOptions=void 0;static create(){return new Tu}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var _i=new WeakMap;function Wn(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&_i.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),_i.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Gi(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=_i.get(o);if(a&&a!==e)Wn(a);Wn(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,_i.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function zi(e){let t=e.context.dataRef.current,o=qe(()=>t.hoverInteractionState??Tu.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return Or(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ab(e,t){if(t!=null&&!Cr(t))return 0;if(typeof e==="function")return e();return e}function Za(e,t,o){let r=ab(e,o);if(typeof r==="number")return r;return r?.[t]}function Eu(e){if(typeof e==="function")return e();return e}function Zi(e,t){return t||e==="click"||e==="mousedown"}function Id(e){return e?.includes("mouse")&&e!=="mousedown"}function Au(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=oo(),l=yo(),m=zi(e),p=rt(),d=se(()=>Zi(c.current.openEvent?.type,m.interactedInside)),f=se(()=>Id(c.current.openEvent?.type)),h=se(()=>{Wn(m)});q(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,h()},[a,m,h]),Pu.useEffect(()=>h,[h]),q(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&f()&&He(i)&&s){let I=i,g=s,C=Re(s),w=u?.nodesRef.current.find((y)=>y.id===l)?.context?.elements.floating;if(w)w.style.pointerEvents="";let b=m.pointerEventsScopeElement!==g?m.pointerEventsScopeElement:null,S=w!==g?w:null,x=m.handleCloseOptions?.getScope?.()??b??S??Ir(I,"[data-rootownerid]")??C.body;return Gi(m,{scopeElement:x,referenceElement:I,floatingElement:g}),()=>{h()}}return},[o,a,i,s,m,f,u,l,h]),Pu.useEffect(()=>{if(!o)return;function I(){return!!(u&&l&&Oo(u.nodesRef.current,l).length>0)}function g(y){let R=Za(r,"close",m.pointerType),v=()=>{e.setOpen(!1,Me(mo,y)),u?.events.emit("floating.closed",y)};if(R)m.openChangeTimeout.start(R,v);else m.openChangeTimeout.clear(),v()}function C(y){let R=Ze(y);if(!$l(R)){m.interactedInside=!1;return}m.interactedInside=Ir(R,"[aria-haspopup]")!=null}function w(){m.openChangeTimeout.clear(),p.clear(),u?.events.off("floating.closed",S),h()}function b(y){if(I()&&u){u.events.on("floating.closed",S);return}if(Br(y.relatedTarget,e.context.triggerElements))return;let R=c.current.floatingContext?.nodeId??n,v=y.relatedTarget;if(u&&R&&He(v)&&Oo(u.nodesRef.current,R,!1).some((W)=>pe(W.context?.elements.floating,v)))return;if(m.handler){m.handler(y);return}if(h(),f()&&!d())g(y)}function S(y){if(!u||!l||I())return;p.start(0,()=>{u.events.off("floating.closed",S),e.setOpen(!1,Me(mo,y)),u.events.emit("floating.closed",y)})}let x=s;return Zt(x&&Te(x,"mouseenter",w),x&&Te(x,"mouseleave",b),x&&Te(x,"pointerdown",C,!0),()=>{u?.events.off("floating.closed",S)})},[o,s,e,c,r,n,f,d,h,m,u,l,p])}import*as zr from"react";import*as bd from"react-dom";var sb={current:null};function Mu(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=sb,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:p,shouldOpen:d,guardStaleOpen:f=!1}=t,{dataRef:h,events:I}=e.context,g=oo(u),C=zi(e),w=zr.useRef(!1),b=lt(n),S=lt(r),x=lt(s),y=lt(o),R=lt(d),v=lt(p),L=se(()=>Zi(h.current.openEvent?.type,C.interactedInside)),W=se(()=>R.current?.()!==!1),M=se((E,N,K)=>{let A=e.context.triggerElements;if(A.hasElement(N))return!E||!pe(E,N);if(!He(K))return!1;let O=K;return A.hasMatchingElement((Y)=>pe(Y,O))&&(!E||!pe(E,O))}),B=se(()=>{if(!C.handler)return;Re(e.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),D=se(()=>{Wn(C)});if(l)C.handleCloseOptions=n?.__options;return zr.useEffect(()=>B,[B]),zr.useEffect(()=>{if(!o)return;function E(N){if(!N.open)w.current=N.reason===mo,B(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1;else w.current=!1}return I.on("openchange",E),()=>{I.off("openchange",E)}},[o,I,C,B]),zr.useEffect(()=>{if(!o)return;function E(G,k=!0){let re=Za(S.current,"close",C.pointerType);if(re)C.openChangeTimeout.start(re,()=>{e.setOpen(!1,Me(mo,G)),g?.events.emit("floating.closed",G)});else if(k)C.openChangeTimeout.clear(),e.setOpen(!1,Me(mo,G)),g?.events.emit("floating.closed",G)}let N=c.current??(l?e.select("domReferenceElement"):null);if(!He(N))return;function K(G){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!Cr(C.pointerType))return;let k=Eu(x.current),re=Za(S.current,"open",C.pointerType),U=Ze(G),j=G.currentTarget??null,_=e.select("domReferenceElement"),ne=j;if(He(U)&&!e.context.triggerElements.hasElement(U)){for(let Se of e.context.triggerElements.elements())if(pe(Se,U)){ne=Se;break}}if(He(j)&&He(_)&&!e.context.triggerElements.hasElement(j)&&pe(j,_))ne=_;let be=ne==null?!1:M(_,ne,U),ee=e.select("open"),ce=v.current?.()??e.select("transitionStatus")==="ending",le=!ee&&ce&&w.current,Ce=!be&&He(ne)&&He(_)&&pe(_,ne)&&le,Ee=k>0&&!re,ie=be&&(ee||le)||Ce,xe=!ee||be;if(ie){if(W())e.setOpen(!0,Me(mo,G,ne));return}if(Ee)return;if(re)C.openChangeTimeout.start(re,()=>{if(xe&&W())e.setOpen(!0,Me(mo,G,ne))});else if(xe){if(W())e.setOpen(!0,Me(mo,G,ne))}}function A(G){if(L()){D();return}B();let k=e.select("domReferenceElement"),re=Re(k);C.restTimeout.clear(),C.restTimeoutPending=!1;let U=h.current.floatingContext??m?.();if(Br(G.relatedTarget,e.context.triggerElements))return;if(b.current&&U){if(!e.select("open"))C.openChangeTimeout.clear();let _=c.current;C.handler=b.current({...U,tree:g,x:G.clientX,y:G.clientY,onClose(){if(D(),B(),y.current&&!L()&&_===e.select("domReferenceElement"))E(G,!0)}}),re.addEventListener("mousemove",C.handler),C.handler(G);return}if(C.pointerType==="touch"?!pe(e.select("floatingElement"),G.relatedTarget):!0)E(G)}function O(G){if(pe(N,G.relatedTarget))return;C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1}let Y=f?Te(N,"mouseout",O):void 0;if(i)return Zt(Te(N,"mousemove",K,{once:!0}),Te(N,"mouseenter",K),Te(N,"mouseleave",A),Y);return Zt(Te(N,"mouseenter",K),Te(N,"mouseleave",A),Y)},[B,D,h,S,e,o,b,C,l,M,L,a,i,x,c,g,y,m,v,W,f]),zr.useMemo(()=>{if(!o)return;function E(N){C.pointerType=N.pointerType}return{onPointerDown:E,onPointerEnter:E,onMouseMove(N){let{nativeEvent:K}=N,A=N.currentTarget,O=e.select("domReferenceElement"),Y=e.select("open"),G=M(O,A,N.target);if(a&&!Cr(C.pointerType))return;if(Y&&G&&C.handleCloseOptions?.blockPointerEvents){let U=e.select("floatingElement");if(U){let j=C.handleCloseOptions?.getScope?.()??A.ownerDocument.body;Gi(C,{scopeElement:j,referenceElement:A,floatingElement:U})}}let k=Eu(x.current);if(Y&&!G||k===0)return;if(!G&&C.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;C.restTimeout.clear();function re(){if(C.restTimeoutPending=!1,L())return;let U=e.select("open");if(!C.blockMouseMove&&(!U||G)&&W())e.setOpen(!0,Me(mo,K,A))}if(C.pointerType==="touch")bd.flushSync(()=>{re()});else if(G&&Y)re();else C.restTimeoutPending=!0,C.restTimeout.start(k,re)}}},[o,C,L,M,a,e,x,W])}import*as Yt from"react";function Cd(e){return gr.webkit&&e.movementX===0&&e.movementY===0}function ji(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function qi(e,t){return ji(t,e===jl||e===di,e===xa||e===ya)}function ku(e,t,o){return ji(t,e===di,o?e===xa:e===ya)||e==="Enter"||e===" "||e===""}function ib(e,t,o){return ji(t,o?e===xa:e===ya,e===di)}function cb(e,t,o,r){let n=o?e===ya:e===xa,a=e===jl;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return ji(t,n,a)}function Lu(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:f=!0,disabledIndices:h=void 0,orientation:I="vertical",triggerOrientation:g=I,parentOrientation:C,id:w,resetOnPointerLeave:b=!0,externalTree:S,nestedReturnFocusRef:x,grid:y}=t,R=y!=null,v=e.useState("open"),L=e.useState("floatingElement"),W=e.useState("domReferenceElement"),M=e.context.dataRef,B=va(L),D=Ra(W),E=lt(B),N=yo(),K=oo(S),A=Yt.useRef(p),O=Yt.useRef(s??-1),Y=Yt.useRef(null),G=Yt.useRef(!0),k=se((P)=>{n(O.current===-1?null:O.current,P)}),re=Yt.useRef(!!L),U=Yt.useRef(v),j=Yt.useRef(!1),_=Yt.useRef(!1),ne=Yt.useRef(null),be=lt(h),ee=lt(v),ce=lt(s),le=lt(b),Ce=hr(),Ee=hr(),ie=se(()=>{Ce.cancel();function P(oe){if(!m)ne.current=Vn(oe,{sync:j.current,preventScroll:!0})}let H=o.current[O.current],me=_.current;if(H)P(H);(j.current?(oe)=>oe():(oe)=>Ce.request(oe))(()=>{let oe=o.current[O.current]||H;if(!oe)return;if(!H)P(oe);if(V&&(me||!G.current))oe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{M.current.orientation=I},[M,I]),q(()=>{if(!v)Y.current=null;if(!v||p!=="auto")A.current=p},[v,p]),q(()=>{if(!a)return;if(v&&L){if(O.current=s??-1,A.current&&s!=null)_.current=!0,k()}else if(re.current)O.current=-1,k()},[a,v,L,s,k]),q(()=>{if(!a)return;if(!v){j.current=!1;return}if(!L)return;if(r==null){if(j.current=!1,ce.current!=null)return;if(re.current)O.current=-1,ie();if((!U.current||!re.current)&&A.current&&(Y.current!=null||A.current===!0&&Y.current==null)){let P=0,H=()=>{if(o.current[0]==null){if(P<2)(P?(X)=>Ee.request(X):queueMicrotask)(H);P+=1}else O.current=Y.current==null||ku(Y.current,g,l)||u?wi(o):Yl(o),Y.current=null,k()};H()}}else if(!Si(o.current,r))O.current=r,ie(),_.current=!1},[a,v,L,r,ce,u,o,g,l,k,ie,Ee]),q(()=>{if(!a||L||!K||m||!re.current)return;let P=K.nodesRef.current,H=P.find((oe)=>oe.id===N)?.context?.elements.floating,me=nt(Re(W??H??null)),X=P.some((oe)=>oe.context&&pe(oe.context.elements.floating,me));if(H&&!X&&G.current)H.focus({preventScroll:!0})},[a,L,W,K,N,m]),q(()=>{U.current=v,re.current=!!L});let xe=r!=null,Se=se((P)=>{if(!ee.current)return;let H=o.current.indexOf(P.currentTarget);if(H!==-1&&(O.current!==H||r!==H))O.current=H,k(P)}),Le=se(()=>C??K?.nodesRef.current.find((P)=>P.id===N)?.context?.dataRef?.current.orientation),Ne=se(()=>wi(o,be.current)),ae=se((P)=>{if(G.current=!1,j.current=!0,P.which===229)return;if(!ee.current&&P.currentTarget===E.current)return;if(u&&cb(P.key,I,l,R)){if(!qi(P.key,Le()))wo(P);e.setOpen(!1,Me(ri,P.nativeEvent));let oe=x?.current??W;if(Ge(oe))oe.focus();return}if(r!=null&&r!==O.current&&!Si(o.current,r))O.current=r;let H=O.current,me=wi(o,h),X=Yl(o,h);if(!D){if(P.key==="Home")wo(P),O.current=me,k(P);if(P.key==="End")wo(P),O.current=X,k(P)}if(y!=null){let oe=y(P,O.current,o,I,c,l,h,me,X);if(oe!=null&&oe!==O.current)O.current=oe,k(P);if(I==="both")return}if(qi(P.key,I)){wo(P);let oe=nt(P.currentTarget.ownerDocument);if(v&&!m&&pe(P.currentTarget,oe)&&!o.current.some((he)=>he!=null&&pe(he,oe))){if(O.current=ku(P.key,I,l)?me:X,k(P),r===O.current)ie();return}let{index:de,wrapped:ge}=Tp(o.current,H,{decrement:!ku(P.key,I,l),loopFocus:c,allowEscape:i,disabledIndices:h,minIndex:me,maxIndex:X});if(ge)j.current=!1;O.current=de,k(P)}}),V=Yt.useMemo(()=>({onFocus(H){j.current=!0,Se(H)},onClick({currentTarget:H}){if(!m)H.focus({preventScroll:!0})},onMouseMove(H){if(Cd(H))return;if(j.current=!0,_.current=!1,d)Se(H)},onPointerLeave(H){if(!ee.current||!G.current||H.pointerType==="touch")return;j.current=!0;let me=H.relatedTarget;if(!d||o.current.includes(me))return;if(!le.current)return;if(ne.current?.(),ne.current=null,O.current=-1,k(H),!m){let X=E.current,oe=nt(Re(X));if(X&&pe(X,oe))X.focus({preventScroll:!0})}}}),[Se,ee,E,d,o,k,le,m]),T=Yt.useMemo(()=>m&&v&&xe&&{"aria-activedescendant":`${w}-${r}`},[m,v,xe,w,r]),J=Yt.useMemo(()=>({...!D?T:{},onKeyDown(P){if(P.key==="Tab"&&P.shiftKey&&v&&!m){let H=Ze(P.nativeEvent);if(H&&!pe(E.current,H))return;wo(P);let me=Me(On,P.nativeEvent);e.setOpen(!1,me);let X=x?.current??W;if(!me.isCanceled&&Ge(X))X.focus();return}ae(P)},onPointerMove(P){if(Cd(P))return;G.current=!0}}),[T,ae,E,D,e,v,m,W,x]),z=Yt.useMemo(()=>{function P(X){e.setOpen(!0,Me(ri,X.nativeEvent,X.currentTarget))}function H(X){if(p==="auto"&&Vr(X.nativeEvent))A.current=!m}function me(X){if(A.current=p,p==="auto"&&Hn(X.nativeEvent))A.current=!0}return{onKeyDown(X){let oe=e.select("open");G.current=!1;let de=X.key.startsWith("Arrow"),ge=ib(X.key,Le(),l),he=qi(X.key,oe?I:g),Ae=(u?ge:he)||X.key==="Enter"||X.key.trim()==="";if(m&&oe&&(!u||br(X.currentTarget)))return ae(X);if(!oe&&!f&&de)return;if(Ae){let Xe=qi(X.key,Le());Y.current=u&&Xe?null:X.key}if(u){if(ge)if(wo(X),oe){if(O.current=Ne(),k(X),m)E.current?.focus()}else P(X);return}if(he){if(ce.current!=null)O.current=ce.current;if(wo(X),!oe&&f)P(X);else ae(X);if(oe)k(X)}return},onFocus(X){if(X.target!==X.currentTarget)return;if(e.select("open")&&!m)O.current=-1,k(X)},onPointerDown:me,onPointerEnter:me,onMouseDown:H,onClick:H}},[ae,p,Ne,u,k,e,f,I,g,Le,l,ce,m,E]),ue=Yt.useMemo(()=>({...T,...z}),[T,z]);return Yt.useMemo(()=>a?{reference:ue,floating:J,item:V,trigger:z}:{},[a,ue,J,z,V])}import*as gn from"react";function Du(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=se(i),p=e.useState("open"),d=rt(),f=gn.useRef(""),h=gn.useRef(l??n??-1),I=gn.useRef(null),g=se((b)=>{function S(D){return r?.current[D]}function x(D){let E=S(D);if(E&&!fn(E)||E?.matches(":disabled"))return!1;return s==null||!Jl(pr,D,s)}function y(D,E,N=0){if(D.length===0)return-1;let K=(N%D.length+D.length)%D.length,A=E.toLowerCase();for(let O=0;O<D.length;O+=1){let Y=(K+O)%D.length;if(!D[Y]?.toLowerCase().startsWith(A)||!x(Y))continue;return Y}return-1}let R=o.current;if(f.current.length>0&&b.key===" ")wo(b),m?.(!0);if(f.current.length>0&&f.current[0]!==" "){if(y(R,f.current)===-1&&b.key!==" ")m?.(!1)}if(R==null||b.key.length!==1||b.ctrlKey||b.metaKey||b.altKey)return;if(p&&b.key!==" ")wo(b),m?.(!0);let v=f.current==="";if(v)h.current=l??n??-1;if(R.every((D,E)=>D&&x(E)?D[0]?.toLowerCase()!==D[1]?.toLowerCase():!0)&&f.current===b.key)f.current="",h.current=I.current;f.current+=b.key,d.start(u,()=>{f.current="",h.current=I.current,m?.(!1)});let M=((v?l??n??-1:h.current)??0)+1,B=y(R,f.current,M);if(B!==-1)a?.(B,b),I.current=B;else if(b.key!==" ")f.current="",m?.(!1)}),C=se((b)=>{let S=b.relatedTarget,x=e.select("domReferenceElement"),y=e.select("floatingElement");if(pe(x,S)||pe(y,S))return;d.clear(),f.current="",h.current=I.current,m?.(!1)});q(()=>{if(!p&&l!==null)return;if(d.clear(),I.current=null,f.current!=="")f.current="",m?.(!1)},[p,l,d,m]);let w=gn.useMemo(()=>({onKeyDown:g,onBlur:C}),[g,C]);return gn.useMemo(()=>c?{reference:w,floating:w}:{},[c,w])}var Sd=0.1,lb=Sd*Sd,Qe=0.5;function Xi(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function $i(e,t,o,r,n,a,s,i,c,u){let l=!1;if(Xi(e,t,o,r,n,a))l=!l;if(Xi(e,t,n,a,s,i))l=!l;if(Xi(e,t,s,i,c,u))l=!l;if(Xi(e,t,c,u,o,r))l=!l;return l}function ub(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Yi(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function Fu(e={}){let{blockPointerEvents:t=!1}=e,o=new to,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],p=!1,d=null,f=null,h=typeof performance<"u"?performance.now():0;function I(C,w){let b=performance.now(),S=b-h;if(d===null||f===null||S===0)return d=C,f=w,h=b,!1;let x=C-d,y=w-f,R=x*x+y*y,v=S*S*lb;return d=C,f=w,h=b,R<v}function g(){o.clear(),c()}return function(w){o.clear();let{domReference:b,floating:S}=i;if(!b||!S||m==null||n==null||a==null)return;let{clientX:x,clientY:y}=w,R=Ze(w),v=w.type==="mouseleave",L=pe(S,R),W=pe(b,R);if(L){if(p=!0,!v)return}if(W){if(p=!1,!v){p=!0;return}}if(v&&He(w.relatedTarget)&&pe(S,w.relatedTarget))return;function M(){return Boolean(l&&Oo(l.nodesRef.current,u).length>0)}function B(){if(!M())g()}if(M())return;let D=b.getBoundingClientRect(),E=S.getBoundingClientRect(),N=n>E.right-E.width/2,K=a>E.bottom-E.height/2,A=E.width>D.width,O=E.height>D.height,Y=(A?D:E).left,G=(A?D:E).right,k=(O?D:E).top,re=(O?D:E).bottom;if(m==="top"&&a>=D.bottom-1||m==="bottom"&&a<=D.top+1||m==="left"&&n>=D.right-1||m==="right"&&n<=D.left+1){B();return}let U=!1;switch(m){case"top":U=Yi(x,y,Y,D.top+1,G,E.bottom-1);break;case"bottom":U=Yi(x,y,Y,E.top+1,G,D.bottom-1);break;case"left":U=Yi(x,y,E.right-1,re,D.left+1,k);break;case"right":U=Yi(x,y,D.right-1,re,E.left+1,k);break;default:}if(U)return;if(p&&!ub(x,y,D)){B();return}if(!v&&I(x,y)){B();return}let j=!1;switch(m){case"top":{let _=A?Qe/2:Qe*4,ne=A?n+_:N?n+_:n-_,be=A?n-_:N?n+_:n-_,ee=a+Qe+1,ce=N?E.bottom-Qe:A?E.bottom-Qe:E.top,le=N?A?E.bottom-Qe:E.top:E.bottom-Qe;j=$i(x,y,ne,ee,be,ee,E.left,ce,E.right,le);break}case"bottom":{let _=A?Qe/2:Qe*4,ne=A?n+_:N?n+_:n-_,be=A?n-_:N?n+_:n-_,ee=a-Qe,ce=N?E.top+Qe:A?E.top+Qe:E.bottom,le=N?A?E.top+Qe:E.bottom:E.top+Qe;j=$i(x,y,ne,ee,be,ee,E.left,ce,E.right,le);break}case"left":{let _=O?Qe/2:Qe*4,ne=O?a+_:K?a+_:a-_,be=O?a-_:K?a+_:a-_,ee=n+Qe+1,ce=K?E.right-Qe:O?E.right-Qe:E.left,le=K?O?E.right-Qe:E.left:E.right-Qe;j=$i(x,y,ce,E.top,le,E.bottom,ee,ne,ee,be);break}case"right":{let _=O?Qe/2:Qe*4,ne=O?a+_:K?a+_:a-_,be=O?a-_:K?a+_:a-_,ee=n-Qe,ce=K?E.left+Qe:O?E.left+Qe:E.right,le=K?O?E.left+Qe:E.right:E.left+Qe;j=$i(x,y,ee,ne,ee,be,ce,E.top,le,E.bottom);break}default:}if(!j)B();else if(!p)o.start(40,B);return}};return r.__options={...e,blockPointerEvents:t},r}function wd(e,t,o){let{reference:r,floating:n}=e,a=Io(t),s=Ma(t),i=Aa(s),c=po(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,p=r[i]/2-n[i]/2,d;switch(c){case"top":d={x:l,y:r.y-n.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:m};break;case"left":d={x:r.x-n.width,y:m};break;default:d={x:r.x,y:r.y}}let f=xo(t);if(f)d[s]+=p*(f==="end"?1:-1)*(o&&u?-1:1);return d}async function xd(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:p=!1,padding:d=0}=ir(t,e),f=Ci(d),I=i[p?m==="floating"?"reference":"floating":m],g=mn(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(I)))!=null?o:!0)?I:I.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),C=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),b=await(a.isElement==null?void 0:a.isElement(w))&&await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1},S=mn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:w,strategy:c}):C);return{top:(g.top-S.top+f.top)/b.y,bottom:(S.bottom-g.bottom+f.bottom)/b.y,left:(g.left-S.left+f.left)/b.x,right:(S.right-g.right+f.right)/b.x}}var mb=50,yd=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:xd},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=wd(u,r,c),p=r,d=0,f={};for(let h=0;h<a.length;h++){let I=a[h];if(!I)continue;let{name:g,fn:C}=I,{x:w,y:b,data:S,reset:x}=await C({x:l,y:m,initialPlacement:r,placement:p,strategy:n,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=w!=null?w:l,m=b!=null?b:m,f[g]={...f[g],...S},x&&d<mb){if(d++,typeof x==="object"){if(x.placement)p=x.placement;if(x.rects)u=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):x.rects;({x:l,y:m}=wd(u,p,c))}h=-1}}return{x:l,y:m,placement:p,strategy:n,middlewareData:f}};var Rd=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...I}=ir(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let g=po(n),C=Io(i),w=po(i)===i,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=p||(w||!h?[Ta(i)]:Rp(i)),x=f!=="none";if(!p&&x)S.push(...vp(i,h,f,b));let y=[i,...S],R=await c.detectOverflow(t,I),v=[],L=((r=a.flip)==null?void 0:r.overflows)||[];if(l)v.push(R[g]);if(m){let D=yp(n,s,b);v.push(R[D[0]],R[D[1]])}if(L=[...L,{placement:n,overflows:v}],!v.every((D)=>D<=0)){var W,M;let D=(((W=a.flip)==null?void 0:W.index)||0)+1,E=y[D];if(E){if(!(m==="alignment"?C!==Io(E):!1)||L.every((A)=>Io(A.placement)===C?A.overflows[0]>0:!0))return{data:{index:D,overflows:L},reset:{placement:E}}}let N=(M=L.filter((K)=>K.overflows[0]<=0).sort((K,A)=>K.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!N)switch(d){case"bestFit":{var B;let K=(B=L.filter((A)=>{if(x){let O=Io(A.placement);return O===C||O==="y"}return!0}).map((A)=>[A.placement,A.overflows.filter((O)=>O>0).reduce((O,Y)=>O+Y,0)]).sort((A,O)=>A[1]-O[1])[0])==null?void 0:B[0];if(K)N=K;break}case"initialPlacement":N=i;break}if(n!==N)return{reset:{placement:N}}}return{}}}};var vd=new Set(["left","top"]);async function fb(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=po(o),i=xo(o),c=Io(o)==="y",u=vd.has(s)?-1:1,l=a&&c?-1:1,m=ir(t,e),{mainAxis:p,crossAxis:d,alignmentAxis:f}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof f==="number")d=i==="end"?f*-1:f;return c?{x:d*l,y:p*u}:{x:p*u,y:d*l}}var Td=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await fb(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},Ed=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(C)=>{let{x:w,y:b}=C;return{x:w,y:b}}},...u}=ir(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),p=Io(n),d=bi(p),f=l[d],h=l[p],I=(C,w)=>Ii(w+m[C==="y"?"top":"left"],w,w-m[C==="y"?"bottom":"right"]);if(s)f=I(d,f);if(i)h=I(p,h);let g=c.fn({...t,[d]:f,[p]:h});return{...g,data:{x:g.x-o,y:g.y-r,enabled:{[d]:s,[p]:i}}}}}},Pd=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=ir(e,t),p={x:n,y:a},d=Io(s),f=bi(d),h=p[f],I=p[d],g=ir(u,t),C=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(o=g.mainAxis)!=null?o:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(l){let S=f==="y"?"height":"width",x=i.reference[f]-i.floating[S]+C.mainAxis,y=i.reference[f]+i.reference[S]-C.mainAxis;if(h<x)h=x;else if(h>y)h=y}if(m){var w,b;let S=f==="y"?"width":"height",x=vd.has(po(s)),y=i.reference[d]-i.floating[S]+(x?((w=c.offset)==null?void 0:w[d])||0:0)+(x?0:C.crossAxis),R=i.reference[d]+i.reference[S]+(x?0:((b=c.offset)==null?void 0:b[d])||0)-(x?C.crossAxis:0);if(I<y)I=y;else if(I>R)I=R}return{[f]:h,[d]:I}}}},Ad=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=ir(e,t),c=await n.detectOverflow(t,i),u=po(o),l=xo(o),m=Io(o)==="y",{width:p,height:d}=r.floating,f,h;if(u==="top"||u==="bottom")f=u,h=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else h=u,f=l==="end"?"top":"bottom";let I=d-c.top-c.bottom,g=p-c.left-c.right,C=Ur(d-c[f],I),w=Ur(p-c[h],g),b=t.middlewareData.shift,S=!b,x=C,y=w;if(b!=null&&b.enabled.x)y=g;if(b!=null&&b.enabled.y)x=I;if(S&&!l)if(m)y=p-2*jo(c.left,c.right);else x=d-2*jo(c.top,c.bottom);await s({...t,availableWidth:y,availableHeight:x});let R=await n.getDimensions(a.floating);if(p!==R.width||d!==R.height)return{reset:{rects:!0}};return{}}}};function Ld(e){let t=Xt(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Ge(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=Ea(o)!==a||Ea(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Nu(e){return!He(e)?e.contextElement:e}function _n(e){let t=Nu(e);if(!Ge(t))return sr(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=Ld(t),s=(a?Ea(o.width):o.width)/r,i=(a?Ea(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var pb=sr(0);function Dd(e){let t=ze(e);if(!Zs()||!t.visualViewport)return pb;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function db(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===ze(e)}function hn(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Nu(e),s=sr(1);if(t)if(r){if(He(r))s=_n(r)}else s=_n(e);let i=db(a,o,r)?Dd(a):sr(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let p=ze(a),d=He(r)?ze(r):r,f=p,h=qs(f);while(h&&d!==f){let I=_n(h),g=h.getBoundingClientRect(),C=Xt(h),w=g.left+(h.clientLeft+parseFloat(C.paddingLeft))*I.x,b=g.top+(h.clientTop+parseFloat(C.paddingTop))*I.y;c*=I.x,u*=I.y,l*=I.x,m*=I.y,c+=w,u+=b,f=ze(h),h=qs(f)}}return mn({width:l,height:m,x:c,y:u})}function Ki(e,t){let o=sa(e).scrollLeft;if(!t)return hn(nr(e)).left+o;return t.left+o}function Fd(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Ki(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function gb(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=nr(r),i=t?aa(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=sr(1),l=sr(0),m=Ge(r);if(m||!a){if(Tt(r)!=="body"||an(s))c=sa(r);if(m){let d=hn(r);u=_n(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}}let p=s&&!m&&!a?Fd(s,c):sr(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:o.y*u.y-c.scrollTop*u.y+l.y+p.y}}function hb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ib(e){let t=sa(e),o=e.ownerDocument.body,r=jo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=jo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Ki(e),s=-t.scrollTop;if(Xt(o).direction==="rtl")a+=jo(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var bb=25;function Cb(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=ze(e),a=nr(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let p=!Zs()||t==="fixed";if(r){if(!p)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,p)u=s.offsetLeft,l=s.offsetTop}if(Ki(a)<=0){let p=a.ownerDocument,d=p.body,f=getComputedStyle(d),h=p.compatMode==="CSS1Compat"?parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0:0,I=Math.abs(a.clientWidth-d.clientWidth-h),g=getComputedStyle(a).scrollbarGutter==="stable both-edges"?I/2:I;if(g<=bb)i-=g}return{width:i,height:c,x:u,y:l}}function Sb(e,t){let o=hn(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=_n(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function Md(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=Cb(e,o,t);else if(t==="document")r=Ib(nr(e));else if(He(t))r=Sb(t,o);else{let n=Dd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return mn(r)}function wb(e,t){let o=t.get(e);if(o)return o;let r=Dr(e,[],!1).filter((i)=>He(i)&&Tt(i)!=="body"),n=null,a=Xt(e).position==="fixed",s=a?Lo(e):e;while(He(s)&&!Do(s)){let i=Xt(s),c=zs(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=Lo(s)}return t.set(e,r),r}function xb(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?aa(t)?[]:wb(t,this._c):[].concat(o),r],i=Md(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let p=1;p<s.length;p++){let d=Md(t,s[p],n);c=jo(d.top,c),u=Ur(d.right,u),l=Ur(d.bottom,l),m=jo(d.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function yb(e){let{width:t,height:o}=Ld(e);return{width:t,height:o}}function Rb(e,t,o){let r=Ge(t),n=nr(t),a=o==="fixed",s=hn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=sr(0);if(r||!a){if(Tt(t)!=="body"||an(n))i=sa(t);if(r){let p=hn(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}}if(!r&&n)c.x=Ki(n);let u=n&&!r&&!a?Fd(n,i):sr(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function Ou(e){return Xt(e).position==="static"}function kd(e,t){if(!Ge(e)||Xt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(nr(e)===o)o=o.ownerDocument.body;return o}function Od(e,t){let o=ze(e);if(aa(e))return o;if(!Ge(e)){let n=Lo(e);while(n&&!Do(n)){if(He(n)&&!Ou(n))return n;n=Lo(n)}return o}let r=kd(e,t);while(r&&Bf(r)&&Ou(r))r=kd(r,t);if(r&&Do(r)&&Ou(r)&&!zs(r))return o;return r||Hf(e)||o}var vb=async function(e){let t=this.getOffsetParent||Od,o=this.getDimensions,r=await o(e.floating);return{reference:Rb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tb(e){return Xt(e).direction==="rtl"}var Bu={convertOffsetParentRelativeRectToViewportRelativeRect:gb,getDocumentElement:nr,getClippingRect:xb,getOffsetParent:Od,getElementRects:vb,getClientRects:hb,getDimensions:yb,getScale:_n,isElement:He,isRTL:Tb};function Nd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eb(e,t,o){let r=null,n,a=nr(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let p=e.getBoundingClientRect(),{left:d,top:f,width:h,height:I}=p;if(!l)t();if(!h||!I)return;let g=Pa(f),C=Pa(a.clientWidth-(d+h)),w=Pa(a.clientHeight-(f+I)),b=Pa(d),x={rootMargin:-g+"px "+-C+"px "+-w+"px "+-b+"px",threshold:jo(0,Ur(1,m))||1},y=!0;function R(v){let L=v[0].intersectionRatio;if(!Nd(p,e.getBoundingClientRect()))return i();if(L!==m){if(!y)return i();if(!L)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,L)}y=!1}try{r=new IntersectionObserver(R,{...x,root:a.ownerDocument})}catch(v){r=new IntersectionObserver(R,x)}r.observe(e)}let c=ze(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function qa(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Nu(e),l=n||a?[...u?Dr(u):[],...t?Dr(t):[]]:[];l.forEach((g)=>{n&&g.addEventListener("scroll",o),a&&g.addEventListener("resize",o)});let m=u&&i?Eb(u,o,a):null,p=-1,d=null;if(s){if(d=new ResizeObserver((g)=>{let[C]=g;if(C&&C.target===u&&d&&t)d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)});o()}),u&&!c)d.observe(u);if(t)d.observe(t)}let f,h=c?hn(e):null;if(c)I();function I(){let g=hn(e);if(h&&!Nd(h,g))o();h=g,f=requestAnimationFrame(I)}return o(),()=>{var g;if(l.forEach((C)=>{n&&C.removeEventListener("scroll",o),a&&C.removeEventListener("resize",o)}),m==null||m(),(g=d)==null||g.disconnect(),d=null,c)cancelAnimationFrame(f)}}var Bd=Td;var Hd=Ed,Vd=Rd,Ud=Ad;var Wd=Pd,Ji=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...Bu,...n.platform,_c:r};return yd(e,t,{...n,platform:a})};import*as Ht from"react";import{useLayoutEffect as Ab}from"react";import*as Gd from"react-dom";var Mb=typeof document<"u",kb=function(){},Qi=Mb?Ab:kb;function ec(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 o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!ec(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!ec(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function zd(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){let o=zd(e);return Math.round(t*o)/o}function Hu(e){let t=Ht.useRef(e);return Qi(()=>{t.current=e}),t}function Zd(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=Ht.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=Ht.useState(r);if(!ec(p,r))d(r);let[f,h]=Ht.useState(null),[I,g]=Ht.useState(null),C=Ht.useCallback((A)=>{if(A!==x.current)x.current=A,h(A)},[]),w=Ht.useCallback((A)=>{if(A!==y.current)y.current=A,g(A)},[]),b=a||f,S=s||I,x=Ht.useRef(null),y=Ht.useRef(null),R=Ht.useRef(l),v=c!=null,L=Hu(c),W=Hu(n),M=Hu(u),B=Ht.useCallback(()=>{if(!x.current||!y.current)return;let A={placement:t,strategy:o,middleware:p};if(W.current)A.platform=W.current;Ji(x.current,y.current,A).then((O)=>{let Y={...O,isPositioned:M.current!==!1};if(D.current&&!ec(R.current,Y))R.current=Y,Gd.flushSync(()=>{m(Y)})})},[p,t,o,W,M]);Qi(()=>{if(u===!1&&R.current.isPositioned)R.current.isPositioned=!1,m((A)=>({...A,isPositioned:!1}))},[u]);let D=Ht.useRef(!1);Qi(()=>(D.current=!0,()=>{D.current=!1}),[]),Qi(()=>{if(b)x.current=b;if(S)y.current=S;if(b&&S){if(L.current)return L.current(b,S,B);B()}},[b,S,B,L,v]);let E=Ht.useMemo(()=>({reference:x,floating:y,setReference:C,setFloating:w}),[C,w]),N=Ht.useMemo(()=>({reference:b,floating:S}),[b,S]),K=Ht.useMemo(()=>{let A={position:o,left:0,top:0};if(!N.floating)return A;let O=_d(N.floating,l.x),Y=_d(N.floating,l.y);if(i)return{...A,transform:"translate("+O+"px, "+Y+"px)",...zd(N.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:O,top:Y}},[o,i,N.floating,l.x,l.y]);return Ht.useMemo(()=>({...l,update:B,refs:E,elements:N,floatingStyles:K}),[l,B,E,N,K])}var Vu=(e,t)=>{let o=Bd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Uu=(e,t)=>{let o=Hd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Wu=(e,t)=>({fn:Wd(e).fn,options:[e,t]}),_u=(e,t)=>{let o=Vd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Gu=(e,t)=>{let o=Ud(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as tc from"react";var Lb=tc.createContext(void 0);function qd(e){let t=tc.useContext(Lb);if(t===void 0&&!e)throw Error(Je(69));return t}var Db="ArrowUp",Fb="ArrowDown",Ob="ArrowLeft",Nb="ArrowRight",Bb="Home",Hb="End";var oc=new Set([Db,Fb,Ob,Nb,Bb,Hb]);function rc(e){return e==="starting"?_p:We}import*as nc from"react";var Vb=nc.createContext(void 0);function jd(){return nc.useContext(Vb)}import*as ac from"react";function Ub(e,t){let o=na(e.render);if(ac.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function Xd(e,t,o){let r=Ub(e,t),n=r===t?void 0:r,a=ac.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as $d from"react";function Yd(e,t,o){let r=na(e.render),n=$d.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as Kd}from"react/jsx-runtime";var Wb=In.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:p,virtualFocus:d,orientation:f}=ho(),h=jd(),{side:I,align:g}=Zf(),C=qd(!0)!=null,w=l.useState("open"),b=l.useState("transitionStatus"),S=l.useState("popupProps"),x=l.useState("mounted"),y=l.useState("instantType"),R=l.useState("activeTriggerElement"),v=l.useState("parent"),L=l.useState("lastOpenChangeReason"),W=l.useState("rootId"),M=l.useState("floatingRootContext"),B=l.useState("floatingTreeRoot"),D=l.useState("closeDelay"),E=l.useState("hoverEnabled"),N=l.useState("disabled"),K=l.useState("openMethod"),A=l.useState("activeTriggerId"),O=l.useState("listElement"),[Y,G]=Xd(t,m,p),k=Yd(t,R,A),re=v.type==="menu"?h:void 0,U=v.type==="context-menu",j=c??v.type!=="menu";if(c===void 0&&O&&v.type!=="menu")j=()=>{if(l.state.activeIndex!==null)return!1;return O};Nr({open:w,ref:l.context.popupRef,onComplete(){if(w)l.context.onOpenChangeComplete?.(!0)}}),In.useEffect(()=>{function ie(xe){l.setOpen(!1,Me(xe.reason,xe.domEvent))}return B.events.on("close",ie),()=>{B.events.off("close",ie)}},[B.events,l]),Au(M,{enabled:E&&!N&&!U&&v.type!=="menubar",closeDelay:D});let _=l.useStateSetter("popupElement"),ne=In.useContext(Ol)?.useParentHandoff??Gb,{parentVirtualFocusRef:be,handleFocus:ee}=ne(l,v,w,d),ce={transitionStatus:b,side:I,align:g,open:w,nested:v.type==="menu",instant:y},le=ke("div",t,{state:ce,ref:[o,l.context.popupRef,_,G],stateAttributesMapping:ei,props:[S,{id:Y,...O?{role:"presentation"}:{role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":k},onKeyDown(ie){if(re?.onPopupKeyDown?.(ie),C&&oc.has(ie.key))ie.stopPropagation()},onFocus:ee},rc(b),u,{"data-rootownerid":W}]}),Ce=v.type===void 0||U;if(R||v.type==="menubar"&&L!==Ll)Ce=!0;let Ee=re?.getReturnElement??be;return Kd(Ba,{context:M,openInteractionType:K,modal:U,disabled:!x,returnFocus:s??Ee??Ce,explicitReturnFocus:s===void 0&&Ee?!1:void 0,initialFocus:j,restoreFocus:!0,getInsideElements:v.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:v.type!=="menubar"?B:void 0,previousFocusableElement:R,nextFocusableElement:v.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:le})}),_b={parentVirtualFocusRef:void 0,handleFocus:void 0};function Gb(){return _b}var Jd=In.forwardRef(function(t,o){let r=Nl()?.Popup??Wb;return Kd(r,{...t,ref:o})});import*as t0 from"react";import*as sc from"react";var zu=sc.createContext(void 0);function Qd(){let e=sc.useContext(zu);if(e===void 0)throw Error(Je(32));return e}import{jsx as e0}from"react/jsx-runtime";var o0=t0.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=ho();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return e0(zu.Provider,{value:r,children:e0(Oa,{ref:o,...n,portalOwnerRole:u})})});import*as Zr from"react";function Gn(e){if(En(19))return e;return e?"true":void 0}import*as Ro from"react";import*as No from"react";function r0(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=No.useState(null),m=No.useRef(null),p=oo(o),d=No.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),f=Zd({...e,elements:{...d,...u&&{reference:u}}}),h=No.useCallback((w)=>{let b=He(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(b),f.refs.setReference(b)},[f.refs]),I=No.useMemo(()=>({...f.refs,setPositionReference:h,domReference:m}),[f.refs,h]),g=No.useMemo(()=>({...f.elements,domReference:s}),[f.elements,s]),C=No.useMemo(()=>({...f,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:I,elements:g,nodeId:t,rootStore:r}),[f,I,g,t,r,i,c]);return q(()=>{if(s)m.current=s},[s]),q(()=>{r.context.dataRef.current.floatingContext=C;let w=p?.nodesRef.current.find((b)=>b.id===t);if(w)w.context=C}),No.useMemo(()=>({...f,context:C,refs:I,elements:g,rootStore:r}),[f,I,g,C,r])}import*as ic from"react";var zb=ic.createContext(void 0);function cc(){return ic.useContext(zb)?.direction??"ltr"}var Zb=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=ir(e,t)||{};if(u==null)return{};let m=Ci(l),p={x:o,y:r},d=Ma(n),f=Aa(d),h=await s.getDimensions(u),I=d==="y",g=I?"top":"left",C=I?"bottom":"right",w=I?"clientHeight":"clientWidth",b=a.reference[f]+a.reference[d]-p[d]-a.floating[f],S=p[d]-a.reference[d],x=i.floating[w]||a.floating[f],y=b/2-S/2,R=x/2-h[f]/2-1,v=Math.min(m[g],R),L=Math.min(m[C],R),W=v,M=x-h[f]-L,B=x/2-h[f]/2+y,D=Ii(W,B,M),E=!c.arrow&&xo(n)!=null&&B!==D&&a.reference[f]/2-(B<W?v:L)-h[f]/2<0,N=E?B<W?B-W:B-M:0;return{[d]:p[d]+N,data:{[d]:D,centerOffset:B-D-N,...E&&{alignmentOffset:N}},reset:E}}}),n0=(e,t)=>{let{name:o,fn:r}=Zb(e);return{name:o,fn:r,options:[e,t]}};var a0={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var s0={sideX:"left",sideY:"top"};var i0="--available-width",c0="--available-height",l0="--anchor-width",u0="--anchor-height",m0="--transform-origin";var f0=i0,p0=c0;function h0(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function d0(e,t,o){let{rects:r,placement:n}=e;return{side:h0(t,po(n),o),align:xo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function I0(e){return jb(e,r0)}function jb(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:d,keepMounted:f=!1,floatingRootContext:h,mounted:I,collisionAvoidance:g,shift:C,nodeId:w,adaptiveOrigin:b,lazyFlip:S=!1,externalTree:x}=e,y=g.side||"flip",R=g.align||"flip",v=g.fallbackAxisSide||"end",L=C?.crossAxis??!1,W=C?.rootBoundary,M=typeof o==="function"?o:void 0,B=se(M),D=M?B:o,E=lt(o),N=lt(I),A=cc()==="rtl",[O,Y]=Ro.useState(null);if(!I&&O!==null)Y(null);let G=S==="placement",k=O?po(O):null,re=O&&G?xo(O)||"center":null,U=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":A?"left":"right","inline-start":A?"right":"left"}[n],j=re||s,_=j==="center"?U:`${U}-${j}`,ne=u;if(typeof ne==="number")ne={top:ne,right:ne,bottom:ne,left:ne};else if(ne)ne={top:ne.top||0,right:ne.right||0,bottom:ne.bottom||0,left:ne.left||0};let be=1,ee=n==="bottom"?be:0,ce=n==="top"?be:0,le=n==="right"?be:0,Ce=n==="left"?be:0,Ee={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:ne},ie=Ro.useRef(null),xe=lt(a),Se=lt(i),Le=typeof a!=="function"?a:0,Ne=typeof i!=="function"?i:0,ae=[];if(d)ae.push(d);ae.push(Vu((_e)=>{let Nt=d0(_e,n,A),we=typeof xe.current==="function"?xe.current(Nt):xe.current,ve=typeof Se.current==="function"?Se.current(Nt):Se.current;return{mainAxis:we,crossAxis:ve,alignmentAxis:ve}},[Le,Ne,A,n]));let V=R==="none"&&y!=="shift",T=!V&&(l||L||y==="shift"),J=y==="none"?null:_u({...Ee,padding:{top:ne.top+be+ee,right:ne.right+be+Ce,bottom:ne.bottom+be+ce,left:ne.left+be+le},mainAxis:!L&&y==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:v}),z=V?null:Uu({...Ee,rootBoundary:W,mainAxis:R!=="none",crossAxis:T,limiter:l||L?void 0:Wu((_e)=>{if(!ie.current)return{};let{width:Nt,height:we}=ie.current.getBoundingClientRect(),ve=Io(po(_e.placement)),Ve=ve==="y"?Nt:we,Bt=ve==="y"?ne.left+ne.right:ne.top+ne.bottom;return{offset:Ve/2+Bt/2}})},[Ee,l,L,W,ne,R]);if(y==="shift"||R==="shift"||j==="center")ae.push(z,J);else ae.push(J,z);ae.push(Gu({...Ee,apply({elements:{floating:_e},availableWidth:Nt,availableHeight:we,rects:ve}){if(!N.current)return;let Ve=_e.style;Ve.setProperty(f0,`${Nt}px`),Ve.setProperty(p0,`${we}px`);let Bt=ze(_e).devicePixelRatio||1,{x:Gt,y:lo,width:Vt,height:Co}=ve.reference,Vo=(Math.round((Gt+Vt)*Bt)-Math.round(Gt*Bt))/Bt,vo=(Math.round((lo+Co)*Bt)-Math.round(lo*Bt))/Bt;Ve.setProperty(l0,`${Vo}px`),Ve.setProperty(u0,`${vo}px`)}}),n0((_e)=>({element:ie.current||Re(_e.elements.floating).createElement("div"),padding:ie.current?m:0}),[m]),{name:"transformOrigin",fn(_e){let{elements:{floating:Nt},middlewareData:we,placement:ve,platform:Ve,rects:Bt,y:Gt}=_e,lo=po(ve),Vt=xo(ve),Co=Io(lo)==="y",Vo=ie.current,vo=typeof a==="function"?a(d0(_e,n,A)):a,wn;if(!Vo&&Vt&&Math.abs(Co?we.shift?.x||0:we.shift?.y||0)<=1)wn=Vt==="start"===(Co&&Ve.isRTL?.(Nt)===!0)?"100%":"0%";else{let Yr=Co?we.arrow?.x||0:we.arrow?.y||0,Kr=Co?Vo?.clientWidth||0:Vo?.clientHeight||0;wn=`${Yr+Kr/2}px`}let Qo=lo==="top"||lo==="left"?`calc(100% + ${vo}px)`:`${-vo}px`;if(T&&Co&&Math.abs(we.shift?.y||0)>vo)Qo=`${Bt.reference.y+Bt.reference.height/2-Gt}px`;return Nt.style.setProperty(m0,Co?`${wn} ${Qo}`:`${Qo} ${wn}`),{}}},a0,b),q(()=>{if(!I&&h)h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[I,h]);let ue=Ro.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:P,elements:H,x:me,y:X,middlewareData:oe,update:de,placement:ge,context:he,isPositioned:Ae,floatingStyles:Xe}=t({rootContext:h,open:f?I:void 0,placement:_,middleware:ae,strategy:r,whileElementsMounted:f?void 0:(..._e)=>qa(..._e,ue),nodeId:w,externalTree:x}),{sideX:ct,sideY:io}=oe.adaptiveOrigin||s0,co=Ae?r:"fixed",Ho=Ro.useMemo(()=>{let _e;if(!Ae)_e={position:co,top:0,left:0};else if(b)_e={position:co,[ct]:me,[io]:X};else _e={...Xe,position:co};if(_e[f0]="100vw",_e[p0]="100vh",!Ae)_e.opacity=0;return _e},[b,co,ct,me,io,X,Xe,Ae]),qt=Ro.useRef(null);q(()=>{if(!I)return;let _e=E.current,Nt=typeof _e==="function"?_e():_e,ve=(g0(Nt)?Nt.current:Nt)||null||null;if(ve!==qt.current)P.setPositionReference(ve),qt.current=ve},[I,P,D,E]),Ro.useEffect(()=>{if(!I)return;let _e=E.current;if(typeof _e==="function")return;if(g0(_e)&&_e.current!==qt.current)P.setPositionReference(_e.current),qt.current=_e.current},[I,P,D,E]),Ro.useEffect(()=>{if(f&&I&&H.reference&&H.floating)return qa(H.reference,H.floating,de,ue);return},[f,I,H,de,ue]);let _t=po(ge),go=h0(n,_t,A),bo=xo(ge)||"center",Qt=Boolean(oe.hide?.referenceHidden);q(()=>{if(S&&I&&Ae&&(_t!==U||G&&bo!==j))Y(ge)},[S,G,I,Ae,ge,_t,bo,U,j]);let Xr=Ro.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),$r=oe.arrow?.centerOffset!==0;return Ro.useMemo(()=>({positionerStyles:Ho,arrowStyles:Xr,arrowRef:ie,arrowUncentered:$r,side:go,align:bo,physicalSide:_t,anchorHidden:Qt,refs:P,context:he,isPositioned:Ae,update:de}),[Ho,Xr,ie,$r,go,bo,_t,Qt,P,he,Ae,de])}function g0(e){return e!=null&&"current"in e}import*as xr from"react";import{jsx as Xb}from"react/jsx-runtime";function b0(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=se(n),[,s]=xr.useState(0),i=qe(Yb).current,c=qe($b).current,u=xr.useRef(0),l=xr.useRef(!0),m=xr.useRef(null),p=xr.useRef(null),d=se(()=>{if(l.current)return;l.current=!0,s((S)=>S+1)}),f=se((S,x)=>{c.set(S,x),d()}),h=se((S)=>{c.delete(S),d()}),I=se((S)=>{let x=new Map;if(o.current.length=0,r)r.current.length=0;return S.forEach((y)=>{if(x.set(y.element,{...y.registration.metadata??{},index:y.index}),o.current[y.index]=y.element,r)r.current[y.index]=y.registration.label!==void 0?y.registration.label:y.registration.textRef?.current?.textContent??y.element.textContent}),u.current=o.current.length,x});function g(S){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=="function"||S.length<2)return;let x=new MutationObserver((R)=>{if(!Qb(R))return;let v=null;for(let L of S){if(!L.isConnected)continue;if(v&&C0(v,L)>0){x.disconnect(),d();return}v=L}});p.current=x;let y=new Set;for(let R=1;R<S.length;R+=1){let v=Jb(S[R-1],S[R]);if(v)y.add(v)}y.forEach((R)=>x.observe(R,{childList:!0}))}let C=se(()=>{let[S,x]=Kb(c),y=I(S),R=m.current,v=!R||R.length!==S.length||S.some((L,W)=>{let M=R[W];return L.index!==M.index||L.element!==M.element||L.registration.index!==M.registration.index||L.registration.metadata!==M.registration.metadata});if(g(x),m.current=S,l.current=!1,!v)return;i.forEach((L)=>L(y)),a(y)});q(()=>{if(!l.current&&m.current)I(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,I]),q(()=>{if(l.current)C()}),q(()=>()=>{p.current?.disconnect(),l.current=!0},[]);let w=se((S)=>(i.add(S),()=>{i.delete(S)})),b=xr.useMemo(()=>({register:f,unregister:h,subscribeMapChange:w,nextIndexRef:u}),[f,h,w,u]);return Xb(Wl.Provider,{value:b,children:t})}function $b(){return new Map}function Yb(){return new Set}function Kb(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>C0(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function Jb(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function Qb(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function C0(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as S0 from"react";import{jsx as eC}from"react/jsx-runtime";var lc=S0.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return eC("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as Zu from"react";function w0(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=Zu.useRef(null),s=Zu.useRef(null),i=Bn(r);q(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),q(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function x0(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return ke("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},rc(r),n],stateAttributesMapping:da})}import*as P0 from"react";var y0={},R0={},v0="";function uc(e,t){return an(e)?e:t}function T0(e,t,o){return/hidden|clip/.test(e.getComputedStyle(uc(t,o)).overflowY)}function tC(e){if(typeof document>"u")return!1;let t=Re(e);return ze(t).innerWidth-t.documentElement.clientWidth>0}function oC(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=Re(e),{documentElement:r,body:n}=o,a=uc(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function rC(e){let t=Re(e),{documentElement:o,body:r}=t,n=uc(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function nC(e){let t=Re(e),{documentElement:o,body:r}=t,n=ze(o),a=0,s=0,i=!1,c=Fo.create();if(gr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let d=n.getComputedStyle(o),f=n.getComputedStyle(r),g=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,y0={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},v0=o.style.scrollBehavior,R0={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 C=o.scrollHeight>o.clientHeight,w=o.scrollWidth>o.clientWidth,b=d.overflowY==="scroll"||f.overflowY==="scroll",S=d.overflowX==="scroll"||f.overflowX==="scroll",x=Math.max(0,n.innerWidth-r.clientWidth),y=Math.max(0,n.innerHeight-r.clientHeight),R=parseFloat(f.marginTop)+parseFloat(f.marginBottom),v=parseFloat(f.marginLeft)+parseFloat(f.marginRight),L=uc(o,r);if(i=oC(e),i){o.style.scrollbarGutter=g,L.style.overflowY="hidden",L.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:g,overflowY:"hidden",overflowX:"hidden"}),C||b)o.style.overflowY="scroll";if(w||S)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:R||y?`calc(100dvh - ${R+y}px)`:"100dvh",width:v||x?`calc(100vw - ${v+x}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,y0),Object.assign(r.style,R0),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=v0}function m(){l(),c.request(u)}u();let p=Te(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")p()}}class E0{lockCount=0;restore=null;timeoutLock=to.create();timeoutUnlock=to.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Re(e),{documentElement:o,body:r}=t,n=ze(o);if(T0(n,o,r)){let s=new n.MutationObserver(()=>{if(T0(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=dr.ios||!tC(e);this.restore=a?rC(e):nC(e)}}var aC=new E0;function mc(e=!0,t=null){q(()=>{if(!e)return;return aC.acquire(t)},[e,t])}var sC=20;function A0(e,t,o,r){let[n,a]=P0.useState(!1);q(()=>{if(!e||!t||o==null){a(!1);return}let s=Re(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-sC)},[e,t,o]),mc(e&&(!t||n),r)}import{jsx as qu,jsxs as iC}from"react/jsx-runtime";var M0=Zr.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:h=!1,collisionAvoidance:I=Zp,style:g,...C}=t,{store:w,virtualFocus:b,syncHighlightedItem:S}=ho(),x=Qd(),y=Fn(!0),R=w.useState("parent"),v=w.useState("floatingRootContext"),L=w.useState("floatingTreeRoot"),W=w.useState("mounted"),M=w.useState("open"),B=w.useState("modal"),D=w.useState("openMethod"),E=w.useState("activeTriggerElement"),N=w.useState("transitionStatus"),K=w.useState("positionerElement"),A=w.useState("instantType"),O=w.useState("adaptiveOrigin"),Y=w.useState("lastOpenChangeReason"),G=w.useState("floatingNodeId"),k=w.useState("floatingParentNodeId"),re=v.useState("domReferenceElement"),U=r,j=u,_=l,ne=c,be=I;if(R.type==="context-menu"){if(U=r??R.context?.anchor,ne=ne??"start",!i&&ne!=="center")_=t.alignOffset??2,j=t.sideOffset??-5}let ee=i,ce=ne;if(R.type==="menu")ee=ee??"inline-end",ce=ce??"start",be=t.collisionAvoidance??qp;else if(R.type==="menubar")ee=ee??(R.context.orientation==="vertical"?"inline-end":"bottom"),ce=ce??"start";let le=R.type==="context-menu",Ce=I0({anchor:U,floatingRootContext:v,positionMethod:y?"fixed":n,mounted:W,side:ee,sideOffset:j,align:ce,alignOffset:_,arrowPadding:le?0:d,collisionBoundary:m,collisionPadding:p,sticky:f,nodeId:G,keepMounted:x,disableAnchorTracking:h,collisionAvoidance:be,shift:le?{crossAxis:!(("side"in be)&&be.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:O,lazyFlip:b?"placement":!1});Zr.useEffect(()=>{function V(T){if(T.open){if(T.parentNodeId===G)w.set("hoverEnabled",!1);if(T.nodeId!==G&&T.parentNodeId===w.select("floatingParentNodeId"))w.setOpen(!1,Me(Ia))}}return L.events.on("menuopenchange",V),()=>{L.events.off("menuopenchange",V)}},[w,L.events,G]),Zr.useEffect(()=>{if(w.select("floatingParentNodeId")==null)return;function V(T){if(T.open||T.nodeId!==w.select("floatingParentNodeId"))return;let J=T.reason??Ia;w.setOpen(!1,Me(J))}return L.events.on("menuopenchange",V),()=>{L.events.off("menuopenchange",V)}},[L.events,w]);let Ee=rt();Zr.useEffect(()=>{if(!M)Ee.clear()},[M,Ee]),Zr.useEffect(()=>{function V(T){if(!M||T.nodeId!==w.select("floatingParentNodeId"))return;if(T.target&&E&&E!==T.target){let J=w.select("closeDelay");if(J>0){if(!Ee.isStarted())Ee.start(J,()=>{w.setOpen(!1,Me(Ia))})}else w.setOpen(!1,Me(Ia))}else Ee.clear()}return L.events.on("itemhover",V),()=>{L.events.off("itemhover",V)}},[L.events,M,E,w,Ee]),Zr.useEffect(()=>{let V={open:M,nodeId:G,parentNodeId:k,reason:w.select("lastOpenChangeReason")};L.events.emit("menuopenchange",V)},[L.events,M,w,G,k]),w0({store:w,domReference:re,positionerElement:K,open:M});let ie={open:M,side:Ce.side,align:Ce.align,anchorHidden:Ce.anchorHidden,nested:R.type==="menu",instant:A},xe=R.type==="menubar"&&R.context.modal,Se=B&&Y!==mo;A0(M&&(xe||Se),D==="touch",K,E);let Le=x0(t,ie,{styles:Ce.positionerStyles,transitionStatus:N,props:C,refs:[o,w.useStateSetter("positionerElement")],hidden:!W,inert:!M}),Ne=W&&R.type!=="menu"&&(R.type!=="menubar"&&B&&Y!==mo||R.type==="menubar"&&R.context.modal),ae=null;if(R.type==="menubar")ae=R.context.contentElement;else if(R.type===void 0)ae=E;return iC(Pl.Provider,{value:Ce,children:[Ne&&qu(lc,{ref:R.type==="context-menu"||R.type==="nested-context-menu"?R.context.internalBackdropRef:null,inert:Gn(!M),cutout:ae}),qu(mu,{id:G,children:qu(b0,{elementsRef:w.context.itemDomElements,labelsRef:w.context.itemLabels,onMapChange:S,children:Le})})]})});import*as st from"react";import*as fc from"react";var cC=fc.createContext(null);function pc(e){let t=fc.useContext(cC);if(t===null&&!e)throw Error(Je(5));return t}import*as Xa from"react";import*as ja from"react";function k0(e){let t=ja.useRef(""),o=ja.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:ja.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as L0 from"react";function dc(e,t){let o=L0.useRef(e),r=se(t);q(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function ju(e,t){let o=se((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(dr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=k0(o);return Xa.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function D0(e){let[t,o]=Xa.useState(null),r=ju(e,o);return dc(e,(n)=>{if(n&&!e)o(null)}),Xa.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function F0(e){if(e==null)return ga;if(e.type.startsWith("key"))return Kf;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return qI;return ga}import*as zn from"react";var lC={...Un,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=Un.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>gr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!Un.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class Xu extends wr{constructor(e,t,o=!1){let r=new _a,n=mC(r,t,o,e);super(n,uC(r),lC);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function uC(e){return{positionerRef:zn.createRef(),popupRef:zn.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:zn.createRef(),beforeTriggerFocusGuardRef:zn.createRef(),beforeContentFocusGuardRef:zn.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function mC(e,t,o=!1,r){return{...Ui(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:We,inputProps:We,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new pn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:We,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as O0 from"react";var $u=O0.createContext(null);function Yu(e,t){return(e===oi||e===Dl)&&t?.detail===0}function N0(e,t){return e===ri||Yu(e,t)}import{jsx as $a,jsxs as fC}from"react/jsx-runtime";var pC=Ga(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:d=!1,handle:f,triggerId:h,defaultTriggerId:I=null,highlightItemOnHover:g=!0,isSubmenu:C=!1,virtualFocus:w=!1,virtualFocusRef:b,allowEscape:S=!0,resetOnPointerLeave:x=!0}=t,y=Fn(!0),R=ho(!0),v=pc(!0),L=R?.store,W=R?.virtualFocus??!1,M=st.useMemo(()=>{if(C&&L)return{type:"menu",store:L};if(v)return{type:"menubar",context:v};if(y&&!L)return{type:"context-menu",context:y};return{type:void 0}},[y,L,v,C]),B=fo(),D=fo(),[E,N]=st.useState(void 0),K=(E??D)||void 0,A=yo(),O=M.type==="menu"?M.store:void 0,Y=(r??i)&&O?.state.transitionStatus==="starting",G=qe(()=>Y?O?.state.instantType:void 0).current,k=qe(()=>{let we=new Xu({open:i,openProp:r,activeTriggerId:I,triggerIdProp:h,parent:M,disabled:c,highlightItemOnHover:g,modal:M.type===void 0?u:void 0,rootId:B,instantType:G},K,A!=null);return we.context.virtualFocusRef=b,we}).current;k.useControlledProp("openProp",r),k.useControlledProp("triggerIdProp",h),k.useContextCallback("onOpenChangeComplete",a);let re=k.useState("floatingTreeRoot"),U=Na(re),j=k.useState("open"),_=k.useState("activeTriggerElement"),ne=k.useState("positionerElement"),be=k.useState("hoverEnabled"),ee=k.useState("disabled"),ce=k.useState("lastOpenChangeReason"),le=k.useState("parent"),Ce=k.useState("activeIndex"),Ee=k.useState("keyboardOpen"),ie=k.useState("payload"),xe=k.useState("floatingParentNodeId"),Se=st.useRef(null),Le=st.useRef(le.type!=="context-menu"),Ne=rt(),ae=st.useRef(!0),V=rt(),T=xe!=null,{openMethod:J,triggerProps:z}=D0(j);k.useSyncedValues({disabled:c,highlightItemOnHover:g,modal:le.type===void 0?u:void 0,openMethod:J,rootId:B}),Di(k);let{forceUnmount:ue,transitionStatus:P}=Fi(j,k,()=>{k.set("allowMouseEnter",!1)},Y),H=Bn(k.context.popupRef);st.useEffect(()=>{if(G===void 0)return;let we=()=>{if(k.state.instantType===G)k.set("instantType",void 0)};if(!j){we();return}if(P!==void 0)return;if(k.context.popupRef.current==null){we();return}let ve=new AbortController;return H(we,ve.signal),()=>{ve.abort()}},[G,j,P,H,k]),q(()=>{if(y&&!R)k.update({parent:{type:"context-menu",context:y},floatingNodeId:U,floatingParentNodeId:A});else if(R||!k.select("activeTriggerElement"))k.update({floatingNodeId:U,floatingParentNodeId:A})},[y,R,U,A,_,k]),st.useEffect(()=>{if(!j)Se.current=null;if(le.type!=="context-menu")return;if(!j){Ne.clear(),Le.current=!1;return}Ne.start(500,()=>{Le.current=!0})},[Ne,j,le.type]),q(()=>{if(!j&&!be)k.set("hoverEnabled",!0)},[j,be,k]);let me=se((we,ve)=>{let Ve=ve.reason;if(!we&&!k.select("open"))return;if(j===we&&ve.trigger===_&&ce===Ve)return;let Bt=cd(ve);if(!we&&ve.trigger==null)ve.trigger=_??void 0;if(n?.(we,ve),ve.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(we,ve);let Gt=ve.event;if(we===!1&&Ve!==Dl&&Gt?.type==="click"&&Gt.pointerType==="touch"&&!ae.current)return;if(we&&Ve===ha)ae.current=!1,V.start(300,()=>{ae.current=!0});else ae.current=!0,V.clear();let lo=!we&&(Ve===Fl||Ve==null);Se.current=ve.event;let Vt=ki(k.state,we,ve.trigger,Bt());if(Vt.openChangeReason=Ve,Vt.keyboardOpen=we&&N0(Ve,Gt),le.type==="menubar"&&(Ve===ha||Ve===On||Ve===mo||Ve===ri||Ve===Ia))Vt.instantType="group";else if(Yu(Ve,Gt))Vt.instantType="click";else if(lo)Vt.instantType="dismiss";else Vt.instantType=void 0;k.update(Vt)}),X=Wa({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:K,nested:A!=null,onOpenChange:me}),oe=X.context.events;q(()=>{let we=({open:ve,eventDetails:Ve})=>me(ve,Ve);return oe.on("setOpen",we),()=>{oe?.off("setOpen",we)}},[oe,me]),q(()=>k.subscribeToParentMenu(),[k]);let de=st.useCallback(()=>{k.setOpen(!1,Me(Jf))},[k]);st.useImperativeHandle(p,()=>({unmount:ue,close:de}),[ue,de]);let ge;if(le.type==="context-menu")ge=le.context;st.useImperativeHandle(ge?.positionerRef,()=>ne,[ne]),st.useImperativeHandle(ge?.actionsRef,()=>({setOpen:me}),[me]);let he=Ua(X,{enabled:!ee,bubbles:{escapeKey:d&&le.type==="menu"},outsidePress(){if(le.type!=="context-menu"||Se.current?.type==="contextmenu")return!0;return Le.current},externalTree:T?re:void 0}),Ae=cc(),Xe=Lu(X,{enabled:!ee,listRef:k.context.itemDomElements,activeIndex:Ce,virtual:w,nested:le.type==="menubar"||!w&&le.type!==void 0,parentOrientation:le.type==="menubar"?le.context.orientation:void 0,loopFocus:l,focusItemOnOpen:w?Ee:void 0,allowEscape:w&&l&&S,orientation:m,triggerOrientation:w?"vertical":m,rtl:Ae==="rtl",disabledIndices:pr,onNavigate(we,ve){k.setActiveIndex(we,F0(ve),ve?.nativeEvent)},openOnArrowKeyDown:le.type!=="context-menu"&&!(w&&C),externalTree:!w&&T?re:void 0,nestedReturnFocusRef:O?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),ct=st.useCallback((we)=>{k.context.typingRef.current=we},[k]),io=Du(X,{enabled:!ee&&!w,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:Ce,resetMs:Up,onMatch:(we,ve)=>{if(j&&we!==Ce)k.setActiveIndex(we,Kf,ve.nativeEvent)},onTyping:ct}),co=se(s),Ho=st.useRef(-1),qt=se(()=>{let we=k.state.activeIndex,ve=we===null?void 0:k.context.itemDomElements.current[we]??void 0;if(ve?.isConnected===!1)return;let Ve=ve===void 0?-1:we;if(Ho.current===Ve&&k.context.reportedItem===ve)return;if(Ho.current=Ve,k.context.reportedItem=ve,w)k.set("highlightedItem",ve);let{highlightReason:Bt,highlightEvent:Gt}=k.context;if(k.context.highlightReason=ga,k.context.highlightEvent=void 0,!s)return;co(ve,mp(Bt,Gt,{label:ve===void 0?void 0:k.context.itemLabels.current[Ve]??void 0}))});q(()=>{qt()},[Ce,qt]);let _t=st.useMemo(()=>{if(!w)return Xe.reference;if(!Xe.trigger)return We;let{onFocus:we,...ve}=Xe.trigger;return ve},[w,Xe.reference,Xe.trigger]);k.useSyncedValue("inputProps",w?Xe.reference??We:We);let go=st.useMemo(()=>{let we=Wt(io.reference,_t,he.reference,{onMouseMove(){k.set("allowMouseEnter",!0)}},z);return we["aria-haspopup"]="menu",we["aria-expanded"]=j,we},[k,io.reference,_t,he.reference,z,j]),bo=st.useMemo(()=>{let we=Wt(Xe.trigger,he.trigger,z);return we["aria-haspopup"]="menu",we["aria-expanded"]=!1,we},[Xe.trigger,he.trigger,z]);qe(()=>(k.update({inactiveTriggerProps:bo}),null));let Qt=st.useMemo(()=>Wt(Ai,{onMouseMove(){if(k.set("allowMouseEnter",!0),le.type==="menu")k.set("hoverEnabled",!1)},onClick(){if(k.select("hoverEnabled"))k.set("hoverEnabled",!1)},onKeyDown(we){let ve=k.select("keyboardEventRelay");if(ve&&!we.isPropagationStopped())ve(we)}},io.floating,Xe.floating,he.floating),[le.type,k,io.floating,Xe.floating,he.floating]),Xr=Xe.item??We;Oi(k,{floatingRootContext:X,activeTriggerProps:go,inactiveTriggerProps:bo,popupProps:Qt,itemProps:Xr});let $r=st.useMemo(()=>({store:k,parent:M,orientation:m,loopFocus:l,allowEscape:S,defaultFloatingId:D,setRenderedFloatingId:N,virtualFocus:w,parentVirtualFocus:W,syncHighlightedItem:qt}),[k,M,m,l,S,D,w,W,qt]),_e=typeof o==="function"?o({payload:ie}):o,Nt=fC(fa.Provider,{value:$r,children:[f&&$a(Mi,{handle:f,store:k}),_e]});if(le.type===void 0||le.type==="context-menu")Nt=$a(fu,{externalTree:re,children:Nt});return Nt});function B0(e){let t=st.useContext($u);if(t===null)return $a(pC,{...e});let o=t.Root;return $a($u.Provider,{value:null,children:$a(o,{...t.options,...e})})}import*as no from"react";var gc=5;function H0(e,t){let o=dC(t);return e.clientX>=o.left-gc&&e.clientX<=o.right+gc&&e.clientY>=o.top-gc&&e.clientY<=o.bottom+gc}function dC(e){let t=e.getBoundingClientRect(),o=ze(e);if(Ca.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),p=l-t.width,d=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-d/2,bottom:t.bottom+d/2}}import*as V0 from"react";function U0(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=An(),{ref:n,index:a}=ai(e),s=o===a,i=V0.useRef(null),c=ko(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function W0(e){let{render:t,className:o,style:r,state:n=We,props:a=pr,refs:s=pr,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:p}=U0({metadata:i});return ke(u,e,{state:n,ref:[p,...s],props:[m,...a,l],stateAttributesMapping:c})}function Ku(e){if(Ge(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(Do(e))return;return Ku(Lo(e))}import*as _0 from"react-dom";function G0(e,t){function o(a,s,i){let c=a.currentTarget;_0.flushSync(()=>{e.setOpen(!1,Me(On,a.nativeEvent,c))}),Dp(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Sr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as hc from"react";function z0(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=hc.useRef(!1);return hc.useMemo(()=>{if(!t)return We;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,Re(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Ya,jsxs as gC}from"react/jsx-runtime";var Z0=Bi(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:p,payload:d,...f}=t,h=ho(!0),g=Wi(p)??h?.store;if(!g)throw Error(Je(85));let C=fo(c),w=g.useState("isTriggerActive",C),b=g.useState("floatingRootContext"),S=g.useState("isOpenedByTrigger",C),x=g.useState("triggerControlsId",C),y=no.useRef(null),R=IC(),v=An(!0),L=oo(),W=no.useMemo(()=>L??new pn,[L]),M=Na(W),B=yo(),{registerTrigger:D,isMountedByThisTrigger:E}=Li(C,y,g,{payload:d,closeDelay:m,parent:R,floatingTreeRoot:W,floatingNodeId:M,floatingParentNodeId:B,keyboardEventRelay:v?.relayKeyboardEvent}),N=R.type==="menubar",K=g.useState("disabled"),A=s||K||N&&R.context.disabled,{getButtonProps:O,buttonRef:Y}=uo({disabled:A,native:i});no.useEffect(()=>{if(!S&&R.type===void 0)g.context.allowMouseUpTriggerRef.current=!1},[g,S,R.type]);let G=no.useRef(null),k=rt(),re=se((V)=>{if(!G.current)return;k.clear(),g.context.allowMouseUpTriggerRef.current=!1;let T=V.target;if(pe(G.current,T)||pe(g.select("positionerElement"),T)||T===G.current)return;if(T!=null&&Ku(T)===g.select("rootId"))return;if(H0(V,G.current))return;W.events.emit("close",{domEvent:V,reason:jI})});no.useEffect(()=>{let V=Re(G.current);if(S&&g.select("lastOpenChangeReason")===mo)return V.addEventListener("mouseup",re,{once:!0}),()=>{V.removeEventListener("mouseup",re)};return},[S,re,g]);let U=N&&R.context.hasSubmenuOpen,_=Mu(b,{enabled:(u??U)&&!A&&(!N||U&&!E),handleClose:Fu({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:R.type===void 0?l:void 0,delay:{close:m},triggerElementRef:y,externalTree:W,isActiveTrigger:w,isClosing:()=>g.select("transitionStatus")==="ending"}),ne=hC(S,g.select("lastOpenChangeReason")),be=Va(b,{enabled:!A,event:S&&N?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?ne:!1}),ee=vu(b,{enabled:!A&&U}),ce=z0({open:S,enabled:N,mouseDownAction:"open"}),le=no.useMemo(()=>Wt(ee.reference,be.reference),[ee.reference,be.reference]),Ce=g.useState("triggerProps",E),Ee=g.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ie,handleFocusTargetFocus:xe}=G0(g,y),Se={disabled:A,open:S},Le=[G,o,Y,D,y],Ne=[le,_??We,Ce,{"aria-haspopup":"menu","aria-controls":x,id:C,onMouseDown:(V)=>{if(g.select("open"))return;k.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Re(V.currentTarget).addEventListener("mouseup",re,{once:!0})}},Ee,N?{role:"menuitem"}:{},ce,f,O],ae=ke("button",t,{enabled:!N,stateAttributesMapping:kl,state:Se,ref:Le,props:Ne});if(N)return Ya(W0,{tag:"button",render:r,className:n,style:a,state:Se,refs:Le,props:Ne,stateAttributesMapping:kl});if(S)return gC(no.Fragment,{children:[Ya(qo,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:ie},`${C}-pre-focus-guard`),Ya(no.Fragment,{children:ae},C),Ya(qo,{ref:g.context.triggerFocusTargetRef,onFocus:xe},`${C}-post-focus-guard`)]});return Ya(no.Fragment,{children:ae},C)});function hC(e,t){let o=rt(),[r,n]=no.useState(!1);return q(()=>{if(e&&t===mo)n(!0),o.start(Wp,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function IC(){let e=pc(!0);return no.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as q0 from"react";var j0=q0.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return ke("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as bn,jsxs as Yje}from"react/jsx-runtime";function $0({...e}){return bn(B0,{"data-slot":"dropdown-menu",...e})}function Y0({...e}){return bn(Z0,{"data-slot":"dropdown-menu-trigger",...e})}function K0({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return bn(o0,{container:a,children:bn(M0,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:bn(Jd,{"data-slot":"dropdown-menu-content",className:fe("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Ka({className:e,inset:t,variant:o="default",...r}){return bn(hp,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:fe("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function J0({className:e,...t}){return bn(j0,{"data-slot":"dropdown-menu-separator",className:fe("-mx-1 my-1 h-px bg-border",e),...t})}import*as ug from"react";import*as Ic from"react";var Q0="data-valid",eg="data-invalid";var tg={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},CC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},og={disabled:!1,...CC},rg={valid(e){if(e===null)return null;if(e)return{[Q0]:""};return{[eg]:""}}};var SC={invalid:void 0,name:void 0,validityData:{state:tg,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:og,registerFieldControl:Ye,validation:{getValidationProps:(e,t=We)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},wC=Ic.createContext(SC);function Zn(e=!0){let t=Ic.useContext(wC);if(t.setValidityData===Ye&&!e)throw Error(Je(28));return t}import*as bc from"react";var xC=bc.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function ng(){return bc.useContext(xC)}import*as Cc from"react";var yC=Cc.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function Sc(){return Cc.useContext(yC)}import*as wc from"react";function ag(e,t,o){let{setFocused:r,focusOwnerRef:n}=Zn(),a=se((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return q(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function sg(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Zn(),i=qe(()=>Symbol());q(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),q(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as Ju from"react";function ig(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=Sc(),s=fo(),i=qe(()=>Symbol()),c=Ju.useRef(!1),u=Ju.useRef(!1),l=se(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return q(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),q(()=>l,[l]),(o?r:void 0)??t??s}var cg=wc.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:p,...d}=t,{state:f,name:h,disabled:I,setTouched:g,setDirty:C,validityData:w,setFilled:b,validationMode:S,validation:x}=Zn(),{clearErrors:y,elementRef:R,submitCountRef:v}=ng(),L=I||c,W=h??s,M={...f,disabled:L},{labelId:B}=Sc(),D=ig({id:a}),E=i!==void 0,N=i==null?void 0:String(i),K=se(()=>x.inputRef.current?.value);sg(x.inputRef,D,N,K,!L,s),q(()=>{let k=N??x.inputRef.current?.value;if(k!==void 0)b(k!=="")},[N,l,x.inputRef,b]),dc(N,()=>{if(N===void 0)return;y(W),C(N!==(w.initialValue??"")),x.change(N)});let A=wc.useRef(null),O=ag(L,A),Y=rt();return ke("input",t,{ref:[o,A],state:M,props:[{id:D,disabled:L,name:W,ref:x.inputRef,"aria-labelledby":B,autoFocus:m,...E?{value:i}:{defaultValue:l},onChange(k){let re=k.currentTarget.value,U=Me(ga,k.nativeEvent);if(u?.(re,U),E)return;if(C(re!==(w.initialValue??"")),b(re!==""),!k.nativeEvent.defaultPrevented&&!U.isCanceled)y(W),x.change(re)},onFocus(){O(!0)},onBlur(k){if(g(!0),O(!1),S==="onBlur"){let re=k.currentTarget.value;if(x.commit(re),E)queueMicrotask(()=>{let U=x.inputRef.current?.value;if(U!==void 0&&U!==re&&U!==(w.initialValue??""))x.commit(U)})}},onKeyDown(k){if(k.currentTarget.tagName==="INPUT"&&k.key==="Enter"){g(!0);let re=k.currentTarget.value,U=k.currentTarget.form;if(U&&U===R.current&&!k.defaultPrevented){let j=k.currentTarget,_=v.current;Y.start(0,()=>{if(v.current===_)x.commit(j.value)})}else x.commit(re)}}},d,(k)=>x.getValidationProps(L,k)],stateAttributesMapping:rg})});import{jsx as RC}from"react/jsx-runtime";var Qu=ug.forwardRef(function(t,o){return RC(cg,{ref:o,...t})});import{jsx as vC}from"react/jsx-runtime";function em({className:e,type:t,...o}){return vC(Qu,{type:t,"data-slot":"input",className:fe("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as TC}from"react/jsx-runtime";function mg({className:e,...t}){return TC("textarea",{"data-slot":"textarea",className:fe("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as xc}from"react/jsx-runtime";function fg({className:e,...t}){return xc("div",{"data-slot":"input-group",role:"group",className:fe("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var EC=jt("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function pg({className:e,align:t="inline-start",...o}){return xc("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:fe(EC({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var PC=jt("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function tm({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return xc(mt,{type:t,"data-size":r,variant:o,className:fe(PC({size:r}),e),...n})}function dg({className:e,...t}){return xc(mg,{"data-slot":"input-group-control",className:fe("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as et,jsxs as Kt}from"react/jsx-runtime";function gg({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n,body:a,onBodyChange:s,inputRef:i}){let[c,u]=Ja(!1),[l,m]=Ja(""),[p,d]=Ja([]),[f,h]=Ja(!1),I=MC(null),[g,C]=Ja(null);AC(()=>{C(I.current?.closest("[data-coristen-widget]")??null)},[]);async function w(S){let x=Array.from(S.target.files??[]).slice(0,Math.max(0,5-p.length));if(S.target.value="",!x.length)return;h(!0),m("");try{let y=[];for(let R of x)y.push(await t(R));d((R)=>[...R,...y].slice(0,5))}catch(y){m(y instanceof Error?y.message:"File upload failed. Try again.")}finally{h(!1)}}async function b(S){S.preventDefault();let x=a.trim();if(!x&&!p.length||c||f||o)return;u(!0),m("");try{await e(x,p),s(""),d([])}catch{m("Message could not be sent. Try again.")}finally{u(!1)}}return Kt("form",{onSubmit:(S)=>void b(S),className:"w-full",children:[et("input",{ref:I,type:"file",multiple:!0,className:"sr-only",onChange:(S)=>void w(S)}),(p.length>0||f)&&Kt($s,{className:"px-2 pb-2",children:[p.map((S)=>Kt(Ln,{size:"xs",children:[et(ca,{children:et(on,{})}),Kt(la,{className:"max-w-32",children:[et(ua,{title:S.name,children:S.name}),Kt(ma,{children:[(S.size/1024).toFixed(0)," KB"]})]}),et(Xs,{children:et(zf,{type:"button","aria-label":`Remove ${S.name}`,onClick:()=>d((x)=>x.filter((y)=>y.storageId!==S.storageId)),children:et(Ao,{})})})]},S.storageId)),f&&Kt(Ln,{size:"xs",state:"uploading",children:[et(ca,{children:et(on,{})}),Kt(la,{children:[et(ua,{children:"Uploading file"}),et(ma,{children:"Please wait"})]})]})]}),Kt(fg,{className:"has-disabled:opacity-100",children:[et(dg,{ref:i,"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(S)=>s(S.target.value),maxLength:2000,rows:2,onKeyDown:(S)=>{if(S.key==="Enter"&&!S.shiftKey)S.preventDefault(),S.currentTarget.form?.requestSubmit()}}),Kt(pg,{align:"block-end",className:"pt-1",children:[Kt($0,{children:[et(Y0,{render:et(tm,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:et(Tn,{className:"size-5"})}),Kt(K0,{portalContainer:g,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[Kt(Ka,{onClick:()=>I.current?.click(),children:[et(Os,{}),"Add Photos & Files"]}),et(J0,{}),Kt(Ka,{children:[et(Ds,{}),"Create Image"]}),Kt(Ka,{children:[et(xs,{}),"Deep Research"]}),Kt(Ka,{children:[et(ks,{}),"Web Search"]})]})]}),r&&et("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&et("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:Kt("span",{className:"inline-flex items-center gap-1",children:["Powered by",Kt("span",{className:"relative size-4 shrink-0",children:[et("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),et("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),et("span",{className:"font-medium",children:"Coristen"})]})})}),et(tm,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:c||f||o||!a.trim()&&!p.length,children:et(hs,{})})]})]}),l&&et("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as Cn}from"react/jsx-runtime";function om({className:e,size:t="default",...o}){return Cn("div",{"data-slot":"card","data-size":t,className:fe("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function rm({className:e,...t}){return Cn("div",{"data-slot":"card-header",className:fe("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function nm({className:e,...t}){return Cn("div",{"data-slot":"card-title",className:fe("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function am({className:e,...t}){return Cn("div",{"data-slot":"card-description",className:fe("text-sm text-muted-foreground",e),...t})}function hg({className:e,...t}){return Cn("div",{"data-slot":"card-action",className:fe("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function Ig({className:e,...t}){return Cn("div",{"data-slot":"card-content",className:fe("px-(--card-spacing)",e),...t})}function yc({className:e,...t}){return Cn("div",{"data-slot":"card-footer",className:fe("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as LC}from"react/jsx-runtime";var kC=jt("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function sm({variant:e="default",align:t="start",className:o,...r}){return LC("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:fe(kC({variant:e}),o),...r})}function im({className:e,render:t,...o}){return Pn({defaultTagName:"div",props:Wt({className:fe("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var P$e=jt("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as Rc}from"react/jsx-runtime";function bg({className:e,...t}){return Rc("div",{"data-slot":"empty",className:fe("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function Cg({className:e,...t}){return Rc("div",{"data-slot":"empty-header",className:fe("flex max-w-sm flex-col items-center gap-2",e),...t})}var D$e=jt("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function Sg({className:e,...t}){return Rc("div",{"data-slot":"empty-title",className:fe("font-heading text-sm font-medium tracking-tight",e),...t})}function wg({className:e,...t}){return Rc("div",{"data-slot":"empty-description",className:fe("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Qa}from"react/jsx-runtime";function xg({className:e,align:t="start",...o}){return Qa("div",{"data-slot":"message","data-align":t,className:fe("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function yg({className:e,...t}){return Qa("div",{"data-slot":"message-avatar",className:fe("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function Rg({className:e,...t}){return Qa("div",{"data-slot":"message-content",className:fe("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function vg({className:e,...t}){return Qa("div",{"data-slot":"message-header",className:fe("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function Tg({className:e,...t}){return Qa("div",{"data-slot":"message-footer",className:fe("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as vc from"react";import*as Pt from"react";var Eg=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var cm=vc.forwardRef((e,t)=>vc.createElement(Oe,{ref:t,...e,weights:Eg}));cm.displayName="ArrowCounterClockwiseIcon";import*as Tc from"react";import*as At from"react";var Pg=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var lm=Tc.forwardRef((e,t)=>Tc.createElement(Oe,{ref:t,...e,weights:Pg}));lm.displayName="DownloadSimpleIcon";import{useState as Bc}from"react";import*as Ag from"react";import*as Ec from"react";var um=Ec.createContext(void 0);function ao(e){let t=Ec.useContext(um);if(!e&&t===void 0)throw Error(Je(27));return t}var Mg=Ag.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=ao(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return ke("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,o],stateAttributesMapping:ei,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as kg from"react";var mm=kg.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=ao(),l=u.useState("open"),{getButtonProps:m,buttonRef:p}=uo({disabled:s,native:i}),d={disabled:s};function f(h){if(l)u.setOpen(!1,Me(ZI,h.nativeEvent))}return ke("button",t,{state:d,ref:[o,p],props:[{onClick:f},c,m]})});import*as Lg from"react";var Dg=Lg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ao(),u=fo(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ke("p",t,{ref:o,props:[{id:u},i]})});import*as Hg from"react";import*as Pc from"react";var fm=Pc.createContext(void 0);function Fg(){let e=Pc.useContext(fm);if(e===void 0)throw Error(Je(26));return e}var Og="--nested-dialogs";var fYe=Al,pYe=Ml,dYe=BI,gYe=HI;var Ng="data-nested-dialog-open";var Bg={...da,...Dn,nestedDialogOpen(e){return e?{[Ng]:""}:null}};import{jsx as OC}from"react/jsx-runtime";var Vg=Hg.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=ao(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),d=u.useState("popupProps"),f=u.useState("modal"),h=u.useState("mounted"),I=u.useState("nested"),g=u.useState("nestedOpenDialogCount"),C=u.useState("open"),w=u.useState("openMethod"),b=u.useState("titleElementId"),S=u.useState("transitionStatus"),x=u.useState("role"),y=p.useState("floatingId");Fg(),Nr({open:C,ref:u.context.popupRef,onComplete(){if(C)u.context.onOpenChangeComplete?.(!0)}});let R=i===void 0?sd(u.context.popupRef):i,v=g>0,L=u.useStateSetter("popupElement"),M=ke("div",t,{state:{open:C,nested:I,transitionStatus:S,nestedDialogOpen:v},props:[d,{id:y,"aria-labelledby":b,"aria-describedby":l,role:x,...Ai,hidden:!h,onKeyDown(B){if(oc.has(B.key))B.stopPropagation()},style:{[Og]:g}},c],ref:[o,u.context.popupRef,L],stateAttributesMapping:Bg});return OC(Ba,{context:p,openInteractionType:w,disabled:!h,closeOnFocusOut:!m,initialFocus:R,returnFocus:s,modal:f!==!1,restoreFocus:"popup",children:M})});import*as Wg from"react";import{jsx as Ug,jsxs as NC}from"react/jsx-runtime";var _g=Wg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=ao(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return Ug(fm.Provider,{value:r,children:NC(Oa,{ref:o,...n,children:[s&&i===!0&&Ug(lc,{ref:a.context.internalBackdropRef,inert:Gn(!c)}),t.children]})})});import*as Zg from"react";import*as pm from"react";function Gg({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=pm.useState(0),[m,p]=pm.useState(0),d=u===0,f=Ua(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(h){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in h&&h.button!==0)return!1;if("touches"in h){if(h.type==="touchend"){if(h.changedTouches.length!==1||h.touches.length!==0)return!1}else if(h.touches.length!==1)return!1}let I=Ze(h);if(d&&!a){if(s){let g=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return g||C?g===I||C===I||pe(I,i)&&!I?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:d});return mc(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(h,I)=>{if(!e.select("open")&&!e.select("mounted"))return;l(h),p(I)}),q(()=>{if(!r&&!n)l(0),p(0)},[r,n]),q(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),Oi(e,{activeTriggerProps:f.reference,inactiveTriggerProps:f.trigger,popupProps:f.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as Ac from"react";var BC={...Un,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class dm extends wr{constructor(e,t,o){let r=new _a,n=HC(e,r,t,o);super(n,VC(r),BC)}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;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(ki(this.state,e,t.trigger))}}function HC(e,t,o,r=!1){return{...Ui(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function VC(e){return{popupRef:Ac.createRef(),backdropRef:Ac.createRef(),internalBackdropRef:Ac.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as zg,jsxs as UC}from"react/jsx-runtime";function qg(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:p=null}=t,d=e==="drawer",f=e==="alert-dialog",h=f?!0:c,I=f||i,g=f?"alertdialog":"dialog",C=ao(!0),w=C!=null,b={modal:h,disablePointerDismissal:I,nested:w,role:g},S=id((W,M)=>new dm({open:n,openProp:r,activeTriggerId:p,triggerIdProp:m,...b},W,M),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",m),S.useSyncedValues(b),S.useContextCallback("onOpenChange",a),S.useContextCallback("onOpenChangeComplete",s);let x=S.useState("open"),y=S.useState("mounted"),R=S.useState("payload");ld(S,x),Di(S);let{forceUnmount:v}=Fi(x,S);Zg.useImperativeHandle(u,()=>({unmount:v,close:()=>S.setOpen(!1,Me(Jf))}),[v,S]);let L=x||y||l!=null;return UC(um.Provider,{value:S,children:[l&&zg(Mi,{handle:l,store:S}),L&&zg(Gg,{store:S,parentContext:C?.context,isDrawer:d}),typeof o==="function"?o({payload:R}):o]})}var jg=Ga(function(t){return qg("dialog",t)});import*as Xg from"react";var $g=Xg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ao(),u=fo(s);return c.useSyncedValueWithCleanup("titleElementId",u),ke("h2",t,{ref:o,props:[{id:u},i]})});import*as Yg from"react";var Kg=Bi(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,p=ao(!0),f=Wi(l)??p;if(!f)throw Error(Je(79));let h=fo(c),I=f.useState("floatingRootContext"),g=f.useState("isOpenedByTrigger",h),C=f.useState("triggerPopupId",h),w=Yg.useRef(null),{registerTrigger:b,isMountedByThisTrigger:S}=Li(h,w,f,{payload:u}),{getButtonProps:x,buttonRef:y}=uo({disabled:s,native:i}),R=Va(I),v=ju(()=>f.select("open"),(M)=>{f.set("openMethod",M)}),L={disabled:s,open:g},W=f.useState("triggerProps",S);return ke("button",t,{state:L,ref:[y,o,b,w],props:[R.reference,W,v,{[Ti]:"",id:h,"aria-haspopup":"dialog","aria-expanded":g,"aria-controls":C},m,x],stateAttributesMapping:Yf})});import{jsx as $o,jsxs as gm}from"react/jsx-runtime";function Qg({...e}){return $o(jg,{"data-slot":"dialog",...e})}function eh({...e}){return $o(Kg,{"data-slot":"dialog-trigger",...e})}function WC({...e}){return $o(_g,{"data-slot":"dialog-portal",...e})}function th({...e}){return $o(mm,{"data-slot":"dialog-close",...e})}function _C({className:e,...t}){return $o(Mg,{"data-slot":"dialog-overlay",className:fe("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function oh({className:e,children:t,showCloseButton:o=!0,...r}){return gm(WC,{children:[$o(_C,{}),gm(Vg,{"data-slot":"dialog-content",className:fe("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&gm(mm,{"data-slot":"dialog-close",render:$o(mt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[$o(Ao,{}),$o("span",{className:"sr-only",children:"Close"})]})]})]})}function rh({className:e,...t}){return $o($g,{"data-slot":"dialog-title",className:fe("font-heading text-base leading-none font-medium",e),...t})}function nh({className:e,...t}){return $o(Dg,{"data-slot":"dialog-description",className:fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function ah(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var GC=jt("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Mc({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"span",props:Wt({className:fe(GC({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as ZC}from"react/jsx-runtime";var zC=jt("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function sh({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"div",props:Wt({className:fe(zC({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function ih({className:e,...t}){return ZC("span",{"data-slot":"marker-content",className:fe("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function ch(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as qn from"react";function lh({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=kc(qC(r,n),t);if(!o)return qn.createElement(e,a);if(typeof o=="function")return o(a,r);if(!qn.isValidElement(o))return null;let s=o.props,i={...kc(a,s),ref:jn(a.ref,s.ref)};return qn.cloneElement(o,i)}function kc(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=jn(s,a):XC(n)&&typeof s=="function"&&typeof a=="function"?t[n]=jC(a,s):t[n]=a}}return t}function qC(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function jC(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function XC(e){return/^on[A-Z]/.test(e)}function jn(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as Q from"react";import{jsx as Xn,jsxs as fh}from"react/jsx-runtime";var $C=8,YC=64,KC=0,Fc=0.5,JC=180,QC=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),ph={start:!1,end:!1},eS=[],Oc={currentAnchorId:null,visibleMessageIds:eS};function tS({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return ph;let n=Im({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function oS({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Oc;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of es(e,r)){let p=m.dataset.messageId;if(!p)continue;let d=m.dataset.scrollAnchor==="true",f=d||c?m.getBoundingClientRect():null;(c&&f?f.bottom>i&&f.top<s.bottom:a.has(p))&&u.push(p),d&&f&&f.top<=i+Fc&&(l=p)}return u.length===0&&l===null?Oc:{currentAnchorId:l,visibleMessageIds:u}}function es(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function rS(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function nS(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function aS(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function sS(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function iS({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of es(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function cS({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=dh(t,n),s=t.getBoundingClientRect().height,i=mS(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function dh(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function Lc(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function lS({content:e,scrollTop:t,spacer:o,viewport:r}){let n=Im({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function Im({content:e,spacer:t,viewport:o}){let r=es(e,t),n=gh(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function uS(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function gh(e){let t=window.getComputedStyle(e);return{end:hm(t.paddingBlockEnd||t.paddingBottom),start:hm(t.paddingBlockStart||t.paddingTop)}}function mS(e){let t=e?.parentElement;return t?gh(t):{end:0,start:0}}function fS(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return hm(o)}function hm(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function hh(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function uh(e,t){return hh(e,t)}function pS(){return hh(Oc,gS)}function dS(e,t){return e.start===t.start&&e.end===t.end}function gS(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function hS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=Q.useRef(e),s=Q.useRef(!1),i=Q.useRef(null),c=Q.useRef(!1),u=Q.useRef(o),l=Q.useRef(0),m=Q.useRef(null),p=Q.useRef(0),d=Q.useRef(e?"following-bottom":"free-scrolling"),f=Q.useRef(new Map),h=Q.useRef(null),I=Q.useRef(null),g=Q.useRef(null),C=Q.useRef(n),w=Q.useRef(!0),b=Q.useRef(null),S=Q.useRef(r),x=Q.useRef(null),y=Q.useRef(0),R=Q.useRef(0),v=Q.useRef(null),L=Q.useRef(null),W=Q.useRef(null),M=Q.useRef(null),B=Q.useRef(null),D=Q.useRef(null),E=Q.useRef(null),N=Q.useRef(null),K=Q.useRef(null),A=Q.useRef(new Set),O=Q.useRef(new WeakSet);return W.current===null&&(W.current=uh(t==="end"||t==="last-anchor",(Y,G)=>Y===G)),M.current===null&&(M.current=uh(ph,dS)),K.current===null&&(K.current=pS()),a.current=e,u.current=o,S.current=r,C.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:B,streamingTurnRef:g,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:p,messageElementsRef:f,modeRef:d,pendingScrollFrameRef:x,pendingScrollToMessageRef:h,prependRestoreRef:I,preserveScrollOnPrependRef:w,pendingDefaultScrollStore:W.current,rootRef:b,scrollEdgeThresholdRef:u,scrollMarginRef:S,scrollPreviousItemPeekRef:C,spacerGapRef:y,spacerHeightRef:R,spacerRef:v,stateFrameRef:L,stateStore:M.current,viewportRef:D,visibilityFrameRef:E,visibilityObserverRef:N,visibilityStore:K.current,visibleMessageIdsRef:A,handledScrollAnchorsRef:O}}function Ih(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function Dc(e){e.defaultScrollPositionAppliedRef.current=!0,Ih(e)}function IS({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:p,prependRestoreRef:d,scrollMarginRef:f,scrollPreviousItemPeekRef:h,spacerGapRef:I,spacerHeightRef:g,spacerRef:C,viewportRef:w}=e,b=Q.useCallback((M)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==M&&(s.current=M,t()),M&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},JC))},[t]),S=Q.useCallback((M)=>{let B=C.current;if(!B)return;let D=Math.max(0,Math.ceil(M));g.current!==D&&(g.current=D,B.hidden=D===0,B.style.height=`${D}px`,B.style.marginTop=D>0?`${-I.current}px`:"")},[]),x=Q.useCallback((M,{behavior:B="auto",autoscrolling:D=!1}={})=>{let E=w.current;if(!E)return;let N=Math.max(0,M);if(Math.abs(E.scrollTop-N)<=Fc){E.scrollTop=N,t();return}D&&b(!0),E.scrollTo({top:N,behavior:B}),o()},[t,o,b]),y=Q.useCallback(({behavior:M="auto"}={})=>w.current?(S(0),n.current=null,m.current="free-scrolling",x(0,{behavior:M}),r(),!0):!1,[r,x,S]),R=Q.useCallback(({behavior:M="auto"}={})=>{let B=w.current;return B?(S(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",x(uS(B),{autoscrolling:!0,behavior:M}),r(),!0):!1},[r,x,S]),v=Q.useCallback((M,{align:B="start",behavior:D="auto",scrollMargin:E=f.current}={},{keepPreviousPeek:N=!1}={})=>{let K=c.current,A=w.current;if(!K||!A||!K.contains(M))return!1;let O=cS({align:B,element:M,scrollMargin:N?E+h.current:E,spacer:C.current,viewport:A}),Y=lS({content:K,scrollTop:O,spacer:C.current,viewport:A});return S(Y),d.current={element:M,viewportTop:Lc(M,A)},m.current=N?"anchored-to-message":"settling-jump",n.current=N?M:null,x(O,{behavior:D}),r(),!0},[r,x,S]),L=Q.useCallback(()=>{let M=n.current;return!M||!M.isConnected||m.current!=="anchored-to-message"?!1:v(M,{align:"start"},{keepPreviousPeek:!0})},[v]),W=Q.useCallback((M,B)=>{let D=l.current.get(M);return D?(Dc(e),v(D,B)?(p.current=null,!0):(p.current={messageId:M,options:B},!0)):u.current===0?(p.current={messageId:M,options:B},Dc(e),!0):!1},[v]);return{flushPendingScrollToMessage:Q.useCallback(()=>{let M=p.current;if(!M)return!1;let B=l.current.get(M.messageId);return!B||!v(B,M.options)?!1:(p.current=null,Dc(e),!0)},[v]),reanchorToAnchoredMessage:L,scrollToElement:v,scrollToEnd:R,scrollToMessage:W,scrollToStart:y}}function mh(e,t){return Q.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function bS({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=$C,scrollPreviousItemPeek:r=YC,scrollMargin:n=KC}){let a=hS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:p,itemCountRef:d,lastScrollTopRef:f,messageElementsRef:h,modeRef:I,pendingScrollFrameRef:g,pendingScrollToMessageRef:C,prependRestoreRef:w,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:S,rootRef:x,scrollEdgeThresholdRef:y,scrollMarginRef:R,scrollPreviousItemPeekRef:v,spacerGapRef:L,spacerHeightRef:W,spacerRef:M,stateFrameRef:B,stateStore:D,viewportRef:E,visibilityFrameRef:N,visibilityObserverRef:K,visibilityStore:A,visibleMessageIdsRef:O,handledScrollAnchorsRef:Y}=a,G=Q.useRef(t);G.current!==t&&(G.current=t,m.current=!1);let k=Q.useCallback((de)=>{let ge=x.current,he=E.current,Ae=[de.start&&"start",de.end&&"end"].filter(Boolean).join(" "),Xe=c.current;for(let ct of[ge,he])ct&&(Ae?ct.setAttribute("data-scrollable",Ae):ct.removeAttribute("data-scrollable"),ct.toggleAttribute("data-autoscrolling",Xe))},[]),re=Q.useCallback((de)=>{let ge=E.current?.scrollTop??0,he=ge<f.current-Fc;f.current=ge,i.current&&!de.end&&I.current!=="settling-jump"&&I.current!=="anchored-to-message"?I.current="following-bottom":I.current==="following-bottom"&&de.end&&he&&!c.current&&(I.current="free-scrolling")},[]),U=Q.useCallback(()=>{let de=tS({content:l.current,scrollEdgeThreshold:y.current,spacer:M.current,viewport:E.current});re(de);let ge=I.current==="following-bottom"?{...de,end:!1}:de;k(ge),D.setSnapshot(ge)},[re,D,k]),j=Q.useCallback(()=>{B.current===null&&(B.current=window.requestAnimationFrame(()=>{B.current=null,U()}))},[U]),_=Q.useCallback(()=>{A.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,A.hasListeners()&&A.setSnapshot(oS({content:l.current,scrollMargin:R.current,scrollPreviousItemPeek:v.current,spacer:M.current,viewport:E.current,visibleMessageIds:O.current}))}))},[A]),{flushPendingScrollToMessage:ne,reanchorToAnchoredMessage:be,scrollToElement:ee,scrollToEnd:ce,scrollToMessage:le,scrollToStart:Ce}=IS({refs:a,commitScrollState:U,scheduleStateCommit:j,scheduleVisibilitySync:_}),Ee=Q.useCallback(()=>{let de=w.current,ge=E.current;if(!de||!ge||!de.element.isConnected)return!1;let he=Lc(de.element,ge)-de.viewportTop;return Math.abs(he)<=Fc?!1:(ge.scrollTop+=he,de.viewportTop=Lc(de.element,ge),j(),_(),!0)},[j,_]),ie=Q.useCallback(()=>{let de=l.current,ge=E.current;if(!de||!ge){w.current=null;return}let he=iS({content:de,spacer:M.current,viewport:ge});w.current=he?{element:he,viewportTop:Lc(he,ge)}:null},[]),xe=Q.useCallback(()=>{g.current===null&&(g.current=window.requestAnimationFrame(()=>{g.current=null,ne()&&ie()}))},[ie,ne]),Se=Q.useCallback(()=>{if(!t||m.current||d.current===0)return!1;let de=!1;if(t==="last-anchor"){let ge=l.current,he=E.current,Ae=ge&&he?sS(es(ge,M.current)):null;if(!ge||!he||!Ae)de=ce({behavior:"auto"});else{let Xe=dh(Ae,he);de=Im({content:ge,spacer:M.current,viewport:he})-Xe<=he.clientHeight?ce({behavior:"auto"}):ee(Ae,{align:"start"},{keepPreviousPeek:!0})}}else de=t==="end"?ce({behavior:"auto"}):Ce({behavior:"auto"});return de?(Dc(a),!0):!1},[t,ee,ce,Ce]),Le=Q.useCallback(()=>{let de=l.current;if(!de)return;let ge=es(de,M.current),he=d.current,Ae=p.current;d.current=ge.length,p.current=ge[0]??null,(()=>{if(ne())return;if(he===0){if(Se()||ge.length>0&&i.current&&ce({behavior:"auto"}))return;U(),_();return}let Xe=Ae?ge.indexOf(Ae):-1;if(b.current&&Xe>0){Ee();return}if(ge.length>he){let ct=rS(ge,he);if(ct){if(i.current&&I.current==="following-bottom"&&aS(ge,he)){ce({behavior:"auto"});return}ee(ct,{align:"start"},{keepPreviousPeek:!0}),Y.current.add(ct);return}}if(ge.length===he){let ct=nS(ge,Y.current);if(ct){ee(ct,{align:"start"},{keepPreviousPeek:!0}),Y.current.add(ct);return}}I.current==="following-bottom"&&i.current?ce({behavior:"auto"}):(U(),_())})(),ie()},[Se,ie,U,ne,Ee,_,ee,ce]),Ne=Q.useCallback(()=>{if(I.current==="following-bottom"&&i.current){ce({behavior:"auto"});return}let de=W.current;if(be()){i.current&&de>0&&W.current===0&&ce({behavior:"auto"});return}j(),_()},[be,j,_,ce]),ae=Q.useCallback(()=>{let de=E.current;if(!(!de||!A.hasListeners())){if(typeof IntersectionObserver>"u"){_();return}K.current||(K.current=new IntersectionObserver((ge)=>{for(let he of ge){let Ae=he.target.dataset.messageId;Ae&&(he.isIntersecting?O.current.add(Ae):O.current.delete(Ae))}_()},{root:de,rootMargin:`${-(R.current+v.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),h.current.forEach((ge)=>{K.current?.observe(ge)}),_()}},[_,A]),V=Q.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),K.current?.disconnect(),K.current=null,O.current.clear(),A.setSnapshot(Oc)},[A]),T=Q.useCallback((de,ge,he)=>{if(ge){h.current.set(de,ge),K.current?.observe(ge),_(),C.current?.messageId===de&&xe();return}he&&h.current.get(de)===he&&(h.current.delete(de),O.current.delete(de),K.current?.unobserve(he),_())},[xe,_]),J=Q.useCallback(()=>{(I.current==="following-bottom"||I.current==="anchored-to-message"||I.current==="settling-jump")&&(s.current=null,I.current="free-scrolling")},[]),z=Q.useCallback(()=>k(D.getSnapshot()),[D,k]),ue=mh(x,z),P=mh(E,z),H=Q.useCallback((de)=>{l.current=de},[]),me=Q.useCallback((de)=>{M.current=de,L.current=fS(de?.parentElement??null)},[]),X=Q.useCallback(()=>{U(),_(),ie()},[ie,U,_]),oe=Q.useMemo(()=>({handleContentChange:Le,handleResize:Ne,observeVisibility:ae,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:b,scrollToEnd:ce,scrollToMessage:le,scrollToStart:Ce,setContentElement:H,setRootElement:ue,setSpacerElement:me,setViewportElement:P,stateStore:D,syncAfterScroll:X,unobserveVisibility:V,userScrollIntent:J,viewportRef:E,visibilityStore:A}),[Le,Ne,ae,S,ce,le,Ce,H,ue,me,P,D,X,V,J,A]);return Q.useLayoutEffect(()=>{Se()||d.current===0&&Ih(a)},[Se]),Q.useEffect(()=>()=>{B.current!==null&&(window.cancelAnimationFrame(B.current),B.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),g.current!==null&&(window.cancelAnimationFrame(g.current),g.current=null),K.current?.disconnect(),K.current=null},[]),Q.useLayoutEffect(()=>{if(e&&I.current==="following-bottom"&&d.current>0){ce({behavior:"auto"});return}U()},[e,U,ce]),{context:oe,registerMessage:T}}function CS(e){let t=Q.useRef(e);return t.current=e,t}var bh=Q.createContext(null),Ch=Q.createContext(null);function ts(){let e=Q.useContext(bh);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function SS(){let e=Q.useContext(Ch);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function wS({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=bS({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Xn(bh.Provider,{value:s,children:Xn(Ch.Provider,{value:i,children:t})})}function Sh(){let{pendingDefaultScrollStore:e}=ts();return Q.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function xS({children:e,...t}){let{setRootElement:o}=ts(),r=Sh();return Xn("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function yS({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:p,setViewportElement:d,syncAfterScroll:f,userScrollIntent:h,viewportRef:I}=ts(),g=Sh();p.current=s;let C=Q.useCallback((y)=>{d(y),jn(i)?.(y)},[i,d]);function w(y){f(),r?.(y)}function b(y){h(),a?.(y)}function S(y){h(),n?.(y)}function x(y){QC.has(y.key)&&h(),o?.(y)}return Q.useEffect(()=>{let y=I.current;if(!y||typeof ResizeObserver>"u")return;let R=0,v=new ResizeObserver(()=>{window.cancelAnimationFrame(R),R=window.requestAnimationFrame(m)});return v.observe(y),()=>{window.cancelAnimationFrame(R),v.disconnect()}},[m,I]),Xn("div",{ref:C,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:x,onScroll:w,onTouchMove:S,onWheel:b,...l,...g?{"data-pending-scroll":""}:null,children:t})}function RS({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=ts(),l=Q.useRef(null),m=Q.useCallback((p)=>{l.current=p,c(p),jn(o)?.(p)},[o,c]);return Q.useLayoutEffect(()=>{let p=l.current;if(!p||(s(),typeof MutationObserver>"u"))return;let d=new MutationObserver(()=>{s()});return d.observe(p,{childList:!0}),()=>d.disconnect()},[s]),Q.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let d=0,f=new ResizeObserver(()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(i)});return f.observe(p),()=>{window.cancelAnimationFrame(d),f.disconnect()}},[i]),fh("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Xn("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function vS({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=SS(),a=Q.useRef(null),s=Q.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),jn(t)?.(i)},[e,t,n]);return Xn("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function TS({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=ts(),m=CS(r),p=Q.useCallback((I)=>l.subscribe(I),[l]),d=Q.useCallback(()=>{let I=l.getSnapshot();return o==="start"?I.start:I.end},[o,l]),f=Q.useSyncExternalStore(p,d,d),h=Q.useCallback((I)=>{f&&(m.current?.(I),I.defaultPrevented||(I.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,f,m,c,u]);return lh({defaultTagName:"button",props:kc({type:s,inert:!f,tabIndex:f?a:-1,children:t??fh("span",{children:["Scroll to ",o]}),onClick:h},i),render:n,state:{active:f,direction:o},stateAttributesMapping:{active:(I)=>({"data-active":I?"true":"false"})}})}var Sn={Provider:wS,Root:xS,Viewport:yS,Content:RS,Item:vS,Button:TS};import*as Nc from"react";import*as Mt from"react";var wh=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Mt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var bm=Nc.forwardRef((e,t)=>Nc.createElement(Oe,{ref:t,...e,weights:wh}));bm.displayName="ArrowDownIcon";import{jsx as yr,jsxs as PS,Fragment as ES}from"react/jsx-runtime";function xh(e){return yr(Sn.Provider,{...e})}function yh({className:e,...t}){return yr(Sn.Root,{"data-slot":"message-scroller",className:fe("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function Rh({className:e,...t}){return yr(Sn.Viewport,{"data-slot":"message-scroller-viewport",className:fe("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function vh({className:e,...t}){return yr(Sn.Content,{"data-slot":"message-scroller-content",className:fe("flex h-max min-h-full flex-col gap-6",e),...t})}function Th({className:e,scrollAnchor:t=!1,...o}){return yr(Sn.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:fe("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function Eh({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return yr(Sn.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:fe("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??yr(mt,{variant:n,size:a}),...s,children:o??PS(ES,{children:[yr(bm,{}),yr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as Fe,jsxs as so}from"react/jsx-runtime";function AS(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Ph({attachment:e}){let[t,o]=Bc(!1),[r,n]=Bc(!1);return so("div",{className:"flex flex-col items-end gap-1",children:[Fe(mt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await ah(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:Fe(lm,{})}),r&&Fe("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function MS({attachments:e,allowDownloads:t=!1}){let[o,r]=Bc(null),[n,a]=Bc(!1);if(!e?.length)return null;return so(Qg,{onOpenChange:(s)=>{if(!s)r(null)},children:[Fe($s,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return Fe(Ln,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:Fe(eh,{render:Fe("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:Fe("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return so(Ln,{className:"min-w-52",children:[Fe(ca,{children:Fe(on,{})}),so(la,{className:"max-w-44",children:[Fe(ua,{title:s.name,children:s.name}),so(ma,{children:[s.type||"File"," ·"," ",AS(s.size)]})]}),t&&s.url&&Fe(Xs,{children:Fe(Ph,{attachment:s})})]},s.storageId)})}),so(oh,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[Fe(rh,{className:"sr-only",children:o?.name??"Image preview"}),Fe(nh,{className:"sr-only",children:"Expanded image preview"}),so("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&Fe(Ph,{attachment:o},o.storageId),Fe(th,{render:Fe(mt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:Fe(Ao,{})})]}),n?Fe("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&Fe("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function Cm({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return Fe(xh,{children:so(yh,{children:[Fe(Rh,{children:so(vh,{className:"p-4",children:[e?.length===0&&Fe(bg,{children:so(Cg,{children:[Fe(Sg,{children:"No messages yet"}),Fe(wg,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),p=e[u-1]?._creationTime,d=i&&m&&(p===void 0||m.toDateString()!==new Date(p).toDateString()),f=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return so(Th,{messageId:c._id,scrollAnchor:l,children:[d&&Fe(sh,{className:"mb-5 justify-center",children:Fe(ih,{children:ch(m.getTime())})}),so(xg,{align:l?"end":"start",children:[(l?n:a)&&Fe(yg,{className:"size-7 min-w-7",children:l?n:a}),so(Rg,{children:[i&&so(vg,{className:"gap-2",children:[c.sender==="customer"?"You":f?"Ten":"Support",f&&Fe(Mc,{variant:"secondary",children:"AI"})]}),Fe(MS,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&Fe(sm,{variant:"muted",children:Fe(im,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?Fe("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):Fe(sm,{variant:l?o:"secondary",children:Fe(im,{children:c.body})})),c.citations&&c.citations.length>0&&Fe("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((h)=>h.url?Fe("a",{href:h.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:h.title},h.sourceId):Fe("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:h.title},h.sourceId))}),c.generationStatus==="failed"&&so("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[Fe("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&so(mt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[Fe(cm,{}),"Retry"]})]}),i&&m&&Fe(Tg,{children:Fe("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),Fe(Eh,{})]})})}import{jsx as kS}from"react/jsx-runtime";function Ah({className:e,...t}){return kS("label",{"data-slot":"label",className:fe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as LS}from"react/jsx-runtime";function Yo({className:e,...t}){return LS("div",{"data-slot":"skeleton",className:fe("animate-pulse rounded-md bg-muted",e),...t})}import{jsx as Ie,jsxs as ut}from"react/jsx-runtime";function DS(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function kh({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,canExpand:a,onClose:s,onSettingsChange:i,theme:c,assetBaseUrl:u,defaultEmail:l,welcome:m}){let p=rs(Mo.workspace,{workspaceId:e}),d=p===void 0?t:p,f=Mh("");os(()=>{if(!p)return;let T=JSON.stringify(p);if(f.current===T)return;f.current=T,i(p)},[i,p]);let h=d?{...d,theme:c}:d,I=$n(Mo.openWebsite),g=$n(Mo.startCustomer),C=$n(Mo.sendCustomer),w=$n(Mo.retryAgentResponse),b=$n(Mo.generateAttachmentUploadUrl),S=$n(Mo.markCustomerRead),[x,y]=Rr(""),[R,v]=Rr(),[L,W]=Rr(l),[M,B]=Rr(""),D=Mh(null),[E,N]=Rr(!1),[K,A]=Rr(""),[O,Y]=Rr(),[G,k]=Rr("chat"),[re,U]=Rr(),j=!!o,_=rs(Mo.visitorProfile,x&&j?{workspaceId:e,visitorId:x,sessionToken:o}:"skip"),ne=rs(Mo.welcomeSuggestions,_&&m?.suggestions===void 0?{workspaceId:e,sessionToken:o}:"skip");os(()=>{let T=`coristen:${e}`,J=localStorage.getItem(T)??crypto.randomUUID();localStorage.setItem(T,J),y(J);let z=navigator.userAgent;U({currentPage:window.location.href,referrer:document.referrer,browser:DS(z),device:/Mobi|Android|iPhone|iPad/i.test(z)?"Mobile":navigator.platform||"Desktop"})},[e]);async function be(T){if(T.preventDefault(),!re||!o||E)return;N(!0),A("");try{let J=L.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",z=await I({workspaceId:e,visitorId:x,sessionToken:o,name:J,email:L,...re,newConversation:!0});v(z??void 0),k("chat")}catch{A("We couldn't save your email. Please try again.")}finally{N(!1)}}async function ee(){if(!_){k("chat");return}if(!re||E)return;N(!0),A("");try{let T=await I({workspaceId:e,visitorId:x,sessionToken:o,..._,...re,newConversation:!0});v(T??void 0),k("chat")}catch{A("We couldn't start a new conversation. Please try again.")}finally{N(!1)}}async function ce(T,J){if(!_)throw Error("Customer details are still loading");if(R)return await C({conversationId:R,visitorId:x,sessionToken:o,body:T,attachments:J});if(!re)throw Error("Chat is still loading");await I({workspaceId:e,visitorId:x,sessionToken:o,..._,...re,newConversation:!0});let z=await g({workspaceId:e,visitorId:x,sessionToken:o,body:T,attachments:J});return Y({body:T,attachments:J.map((ue)=>({...ue,url:null})),createdAt:Date.now()}),v(z),z}let le=rs(Mo.customerMessages,R&&x&&j?{conversationId:R,visitorId:x,sessionToken:o}:"skip"),Ce=rs(Mo.visitorConversations,x&&j?{workspaceId:e,visitorId:x,sessionToken:o}:"skip"),Ee=le?.at(-1);if(os(()=>{if(le!==void 0)Y(void 0)},[le]),os(()=>{if(G==="chat"&&j&&R&&x&&Ee?.sender==="merchant")S({conversationId:R,visitorId:x,sessionToken:o}).catch(()=>{})},[R,G,Ee?._id,Ee?.sender,S,o,j,x]),os(()=>{let T=(J)=>{if(J.key==="Escape"&&!J.defaultPrevented)s()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[s]),h===void 0||!o)return null;if(h===null||h.enabled===!1)return Ie(om,{className:"w-full max-w-md",children:ut(rm,{children:[Ie(nm,{children:"Chat unavailable"}),Ie(am,{children:h?"This chat is currently offline.":"This chat is no longer available."})]})});let xe=`${{none:0,sm:6,md:10,lg:16}[h?.radius??"lg"]}px`,Se=h?.accentEnabled?h.brandColor:"#171717",Le=h.theme==="dark"?`color-mix(in oklch, ${Se} 20%, white)`:Se,Ne=h.agentImageUrl?Ie("img",{src:h.agentImageUrl,alt:"",className:"size-7 rounded-full object-cover"}):Ie(vn,{seed:"Coristen agent",size:28,className:"size-7 contrast-200 grayscale"}),ae=ut("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto px-8 py-10 text-center",children:[Ie("div",{className:"flex size-12 items-center justify-center overflow-hidden rounded-full bg-muted",children:h.agentImageUrl?Ie("img",{src:h.agentImageUrl,alt:"",className:"size-12 object-cover"}):Ie(vn,{seed:"Coristen agent",size:48,className:"size-12 contrast-200 grayscale"})}),ut("div",{className:"flex flex-col gap-1.5",children:[Ie("p",{className:"text-base font-semibold",children:`Hi, I’m ${h.agentName}`}),Ie("p",{className:"max-w-72 text-sm text-muted-foreground",children:_?m?.message??h.welcomeMessage:"Enter your email below so we can keep your conversation and share replies with you."})]}),_&&Ie("div",{className:"flex w-full max-w-72 flex-col gap-1 pt-3",children:m?.suggestions===void 0&&ne===void 0?Ie("div",{className:"flex flex-col items-center gap-3","aria-label":"Loading suggestions","aria-busy":"true",children:["w-4/5","w-3/5","w-2/3"].map((T)=>Ie(Yo,{className:`h-10 rounded-lg ${T}`},T))}):(m?.suggestions??(ne?.length?ne:[{title:"Tell me what you can help with",message:"What can you help me with, and where should I start?"},{title:"Help me understand my options",message:"Can you explain the options available and help me decide what to do next?"},{title:"I need help with something",message:"I need help with something and would like guidance on the next step."}])).map((T,J)=>Ie(mt,{type:"button",variant:"ghost",className:"h-auto min-h-10 w-full justify-center px-2.5 py-2 text-center text-sm font-medium whitespace-normal",disabled:E,onClick:()=>{N(!0),A(""),ce(T.message.slice(0,2000),[]).catch(()=>A("Your message couldn't be sent. Please try again.")).finally(()=>N(!1))},children:Ie("span",{className:"min-w-0 break-words",children:T.title})},`${J}:${T.title}`))})]}),V=G==="history"?"history":R?`conversation:${R}`:_===null?"contact":"new";return Ie("div",{className:h.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ut(om,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) bg-background text-foreground shadow-none",style:{"--primary":h.accentSendIcon?h.theme==="dark"?Le:Se:void 0,"--primary-foreground":h.accentSendIcon&&h.theme==="dark"?"#171717":void 0,"--configured-radius":xe,backgroundColor:h?.tintedGrayscale?`color-mix(in oklch, ${Se} 4%, var(--background))`:void 0},children:[ut(rm,{className:"shrink-0 gap-1 pb-5 select-none",style:h?.accentEnabled&&h.accentHeader?{color:Le}:void 0,children:[ut(nm,{className:"flex min-w-0 items-center gap-2",children:[h.logoUrl?Ie("img",{src:h.logoUrl,alt:"",className:"size-6 shrink-0 object-contain"}):ut("span",{className:"relative size-6 shrink-0","aria-hidden":"true",children:[Ie("img",{src:`${u}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),Ie("img",{src:`${u}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),Ie("span",{className:"truncate",children:h.name})]}),G==="history"&&Ie(am,{className:"text-current opacity-85",children:"Continue a previous conversation"}),ut(hg,{className:"flex gap-1",children:[ut(mt,{variant:"ghost",size:"sm",onClick:()=>k(G==="chat"?"history":"chat"),children:[G==="chat"?Ie(Ps,{weight:"duotone","data-icon":"inline-start"}):Ie(Rs,{weight:"duotone","data-icon":"inline-start"}),G==="chat"?"Messages":"Chat"]}),a&&Ie(mt,{variant:"ghost",size:"icon-sm","aria-label":r?"Restore chat size":"Expand chat",title:r?"Restore chat size":"Expand chat","aria-pressed":r,onClick:()=>n(!r),children:r?Ie(bs,{weight:"duotone"}):Ie(Ss,{weight:"duotone"})}),Ie(mt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:s,children:Ie(Ao,{weight:"duotone"})})]})]}),K&&_!==null&&Ie("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:K}),Ie(Ig,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:G==="history"?Ie("div",{className:"flex min-h-0 w-full flex-col",children:ut("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[Ce===void 0&&Array.from({length:3}).map((T,J)=>ut("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[Ie(Yo,{className:"h-4 w-4/5"}),Ie(Yo,{className:"h-3 w-2/5"})]},J)),Ce?.map((T)=>ut("button",{type:"button",className:"group flex w-full items-center gap-3 rounded-lg border border-transparent p-3 text-left transition-colors hover:border-border hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{v(T._id),k("chat")},children:[Ie("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:h.agentImageUrl?Ie("img",{src:h.agentImageUrl,alt:"",className:"size-9 object-cover"}):Ie(vn,{seed:"Coristen agent",size:36,className:"size-9 contrast-200 grayscale"})}),ut("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ut("span",{className:"flex items-center justify-between gap-2",children:[Ie("span",{className:"text-sm font-medium",children:"Conversation"}),Ie("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(T.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(T.lastMessageAt)})]}),Ie("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:T.lastMessagePreview||"Attachment"}),!!T.customerUnreadCount&&ut(Mc,{variant:"secondary",children:[T.customerUnreadCount," unread"]})]}),Ie(Ts,{className:"size-4 shrink-0 text-muted-foreground"})]},T._id)),Ce?.length===0&&Ie("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):_===void 0&&!R?ut("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ut("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[Ie(Yo,{className:"size-12 rounded-full"}),Ie(Yo,{className:"h-5 w-28"}),ut("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[Ie(Yo,{className:"h-4 w-full"}),Ie(Yo,{className:"h-4 w-4/5"})]})]}),ut("div",{className:"flex flex-col gap-3",children:[ut("div",{className:"flex flex-col gap-2",children:[Ie(Yo,{className:"h-4 w-24"}),Ie(Yo,{className:"h-8 w-full rounded-lg"})]}),Ie(Yo,{className:"h-9 w-full rounded-lg"})]})]}):_===null&&!R?Ie("div",{className:"flex min-h-0 w-full flex-col",children:ae}):R&&le===void 0&&O?Ie(Cm,{messages:[{_id:"pending-first-message",_creationTime:O.createdAt,sender:"customer",body:O.body,attachments:O.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:Ie(vn,{seed:x,size:28,className:"size-7"}),otherAvatar:Ne}):!R||le===void 0||le.length===0?ae:Ie(Cm,{messages:le,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:Ie(vn,{seed:x,size:28,className:"size-7"}),otherAvatar:Ne,onRetry:(T)=>{A(""),w({conversationId:R,visitorId:x,customerMessageId:T,sessionToken:o}).catch(()=>A("The reply couldn't be retried. Please try again."))}},R)},V),G==="history"&&Ie(yc,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ut(mt,{variant:"secondary",size:"lg",className:"w-full",disabled:E||_===void 0,onClick:()=>void ee(),children:[Ie(Tn,{"data-icon":"inline-start"}),"Start a conversation"]})}),_===null&&!R&&G==="chat"&&Ie(yc,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ut("form",{className:"flex w-full flex-col gap-3",onSubmit:(T)=>void be(T),children:[ut("div",{className:"flex flex-col gap-2",children:[Ie(Ah,{htmlFor:"customer-email",children:"Email address"}),Ie(em,{id:"customer-email",type:"email",value:L,onChange:(T)=>W(T.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),K&&Ie("p",{role:"alert",className:"text-xs text-destructive",children:K}),Ie(mt,{type:"submit",size:"lg",className:"w-full",disabled:E||!re,children:E?"Continuing...":"Continue"})]})}),_&&G==="chat"&&j&&Ie(yc,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:Ie(gg,{body:M,onBodyChange:B,inputRef:D,sendDisabled:!re,showPoweredBy:h.showPoweredBy,assetBaseUrl:u,upload:async(T)=>{if(T.size>h.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${h.maxAttachmentSizeMb} MB or smaller`);if(!h.allowedAttachmentTypes.some((P)=>T.type===P||T.type.startsWith(P)))throw Error("This file type is not allowed");let J=await b({workspaceId:e,visitorId:x,sessionToken:o}),z=await fetch(J,{method:"POST",headers:{"Content-Type":T.type||"application/octet-stream"},body:T});if(!z.ok)throw Error("Upload failed");let{storageId:ue}=await z.json();return{storageId:ue,name:T.name,type:T.type||"application/octet-stream",size:T.size}},send:ce})})]})})}function Lh(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as Fh from"react";import*as Hc from"react";var Sm=Hc.createContext(void 0);function qr(){let e=Hc.useContext(Sm);if(!e)throw Error(Je(73));return e}var Dh=0;function Vc(e){return Dh+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Dh}`}function Uc(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function wm(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function xm(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var Ko={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class ym extends wr{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:wm(e.toasts)},{},Ko)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=xm(this.state.toasts,t);r.toasts=n,r.toastMetadata=wm(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=Ko.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||Vc("toast");if(e.id){let i=Ko.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(xm(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(Ko.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=Ko.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=Ko.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((h)=>h.id===e?i:h));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,p=this.timers.has(e),d=u!==c,f=s.type==="loading";if(!m&&p){this.clearTimer(e);return}if(m&&(!p||d||l||f||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),Ko.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=Ko.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=xm(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=Uc(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=Uc(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=Uc(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=to.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(pe(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!Ko.expandedOrOutOfFocus(this.state)?to.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:wm(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=nt(Re(this.state.viewport));if(!this.state.viewport||!pe(this.state.viewport,t)||!Hr(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=Ko.toasts(this.state),r=Ko.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as FS,jsxs as OS}from"react/jsx-runtime";var Oh=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=qe(()=>new ym({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Or(s.disposeEffect),Fh.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),OS(Sm.Provider,{value:s,children:[FS(NS,{store:s,timeout:r,limit:n}),o]})};function NS(e){let{store:t,timeout:o,limit:r}=e;return q(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as Bo from"react";var Nh="--toast-frontmost-height";import{jsx as Wc,jsxs as Rm}from"react/jsx-runtime";var Bh=Bo.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=qr(),u=rt(),l=Bo.useRef(!1),m=Bo.useRef(!1),p=Bo.useRef(!1),d=c.useState("isEmpty"),f=c.useState("toasts"),h=c.useState("focused"),I=c.useState("expanded"),g=c.useState("prevFocusElement"),C=f[0]?.height,w=f.some((A)=>A.transitionStatus==="ending"),b=f.filter((A)=>A.priority==="high");Bo.useEffect(()=>{let A=c.state.viewport;if(!A||d)return;let O=ze(A),Y=Re(A);function G(U){if(U.key==="F6"&&Ze(U)!==A)U.preventDefault(),c.set("prevFocusElement",nt(Y)),A?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function k(U){if(Ze(U)!==O)return;c.set("isWindowFocused",!1),c.pauseTimers()}function re(U){if(U.relatedTarget)return;let j=Ze(U),_=nt(Re(A));if(j===O||!pe(A,j)||!Hr(_))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return Zt(Te(O,"keydown",G),Te(O,"blur",k,!0),Te(O,"focus",re,!0),Te(Y,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,d]);function S(A){l.current=!0;let O=A.relatedTarget===c.state.viewport?f.find((Y)=>Y.transitionStatus!=="ending"&&!Y.limited):void 0;if(O)O.ref?.current?.focus();else c.restoreFocusToPrevElement()}function x(A){if(A.key==="Tab"&&A.shiftKey&&Ze(A.nativeEvent)===c.state.viewport)A.preventDefault(),c.restoreFocusToPrevElement()}function y(){if(c.state.toasts.some((O)=>O.transitionStatus==="ending")||p.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}Bo.useEffect(y,[w,c]);function R(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function v(){m.current=!0,y()}function L(A){if(A.pointerType==="touch")p.current=!0}function W(A){if(A.pointerType!=="touch")return;p.current=!1,y()}function M(){if(l.current){l.current=!1;return}if(h)return;if(Hr(nt(Re(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function B(A){if(!h||pe(c.state.viewport,A.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let D={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:R,onMouseMove:R,onMouseLeave:v,onFocus:M,onBlur:B,onKeyDown:x,onClick:M,onPointerDown:L,onPointerUp:W,onPointerCancel:W,style:{[Nh]:C?`${C}px`:void 0}},E={expanded:I},N=!d&&g&&Wc(qo,{onFocus:S}),K=ke("div",t,{ref:[o,c.setViewport],state:E,props:[D,i,{children:Rm(Bo.Fragment,{children:[N,s,N]})}]});return Rm(Bo.Fragment,{children:[N,K,!h&&b.length>0&&Wc("div",{style:fi,children:b.map((A)=>Rm("div",{role:"alert","aria-atomic":!0,children:[Wc("div",{children:A.title}),Wc("div",{children:A.description})]},A.id))})]})});import*as tt from"react";import*as jh from"react-dom";import*as _c from"react";var vm=_c.createContext(void 0);function jr(){let e=_c.useContext(vm);if(!e)throw Error(Je(66));return e}import*as Tm from"react";function Hh(e,t){let o=(t??ze(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function Gc(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var Vh="--toast-index",Uh="--toast-offset-y",Wh="--toast-height",_h="--toast-swipe-movement-x",Gh="--toast-swipe-movement-y";var zh="data-swipe-direction",WQe=sn,_Qe=pa;import{jsx as US}from"react/jsx-runtime";var WS={...Dn,swipeDirection(e){return e?{[zh]:e}:null}},Zh=40,_S=10,qh=0.5,GS=1,zS=`${Gp},${zp}`,Xh=tt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,p=qr(),[d,f]=tt.useState(void 0),[h,I]=tt.useState(!1),[g,C]=tt.useState(!1),[w,b]=tt.useState({x:0,y:0}),[S,x]=tt.useState({x:0,y:0,scale:1}),[y,R]=tt.useState(),[v,L]=tt.useState(),[W,M]=tt.useState(null),B=tt.useRef(null),D=tt.useRef(void 0),E=tt.useRef({x:0,y:0}),N=tt.useRef({x:0,y:0,scale:1}),K=tt.useRef(void 0),A=tt.useRef(0),O=tt.useRef(!1),Y=tt.useRef({x:0,y:0}),G=tt.useRef(!1),k=tt.useRef({x:0,y:0}),re=tt.useRef(null),U=tt.useRef(null),j=p.useState("toastIndex",r.id),_=p.useState("toastVisibleIndex",r.id),ne=p.useState("toastOffsetY",r.id),be=p.useState("focused"),ee=p.useState("expanded");Nr({open:r.transitionStatus!=="ending",ref:B,onComplete(){if(r.transitionStatus==="ending")p.removeToast(r.id)}});let ce=se((z=!1)=>{let ue=B.current;if(!ue)return;let P=ue.style.height;ue.style.height="auto";let H=ue.offsetHeight;ue.style.height=P;function me(){p.updateToastInternal(r.id,{ref:B,height:H,transitionStatus:void 0})}if(z)jh.flushSync(me);else me()});q(()=>{let z=D.current;if(r.transitionStatus!=="starting"&&z===r.id)return;if(z!==void 0)f(void 0),x({x:0,y:0,scale:1}),le({x:0,y:0});D.current=r.id,ce()},[ce,r.id,r.transitionStatus]);function le(z){k.current=z,b(z)}q(()=>()=>{U.current?.abort()},[]);function Ce(z,ue){let P=(X)=>X>0?X**qh:-(Math.abs(X)**qh),H=z>0&&!l.includes("right")||z<0&&!l.includes("left"),me=ue>0&&!l.includes("down")||ue<0&&!l.includes("up");return{x:H?P(z):z,y:me?P(ue):ue}}let Ee=se((z)=>{if(z.pointerId!==re.current)return;re.current=null,U.current?.abort(),U.current=null,I(!1),C(!1),M(null);let ue=N.current;if(z.type==="pointercancel"||O.current){le({x:ue.x,y:ue.y}),f(void 0);return}let P=k.current,H=P.x-ue.x,me=P.y-ue.y,X;for(let oe of l)if(Gc(oe,H,me)>Zh){X=oe;break}if(X)f(X),p.closeToast(r.id);else le({x:ue.x,y:ue.y}),f(void 0)});function ie(z){if(z.button!==0)return;if(z.pointerType==="touch")p.pauseTimers();let ue=Ze(z.nativeEvent);if(Ir(ue,`button,a,input,textarea,[role="button"],${zS}`))return;O.current=!1,K.current=void 0,A.current=0,re.current=z.pointerId,E.current={x:z.clientX,y:z.clientY},Y.current=E.current;let H=z.currentTarget,me=Hh(H);N.current=me,x(me),le({x:me.x,y:me.y}),p.set("hovering",!0),I(!0),C(!1),M(null),G.current=!0,U.current?.abort();let X=new AbortController;U.current=X;let oe=Re(H);oe.addEventListener("pointerup",Ee,{signal:X.signal}),oe.addEventListener("pointercancel",Ee,{signal:X.signal}),H.setPointerCapture?.(z.pointerId)}function xe(z){if(z.pointerId!==re.current)return;if(z.preventDefault(),G.current)E.current={x:z.clientX,y:z.clientY},G.current=!1;let{clientY:ue,clientX:P,movementX:H,movementY:me}=z;if(me<0&&ue>Y.current.y||me>0&&ue<Y.current.y)Y.current={x:Y.current.x,y:ue};if(H<0&&P>Y.current.x||H>0&&P<Y.current.x)Y.current={x:P,y:Y.current.y};let X=P-E.current.x,oe=ue-E.current.y,de=ue-Y.current.y,ge=P-Y.current.x,he=W;if(!g){if(Math.sqrt(X*X+oe*oe)>=GS){C(!0);let _t=l.includes("left")||l.includes("right"),go=l.includes("up")||l.includes("down");if(_t&&go){let bo=Math.abs(X),Qt=Math.abs(oe);he=bo>Qt?"horizontal":"vertical",M(he)}}}let Ae;if(!K.current){if(he==="vertical"){if(oe>0)Ae="down";else if(oe<0)Ae="up"}else if(he==="horizontal"){if(X>0)Ae="right";else if(X<0)Ae="left"}else if(Math.abs(X)>=Math.abs(oe))Ae=X>0?"right":"left";else Ae=oe>0?"down":"up";if(Ae&&l.includes(Ae))K.current=Ae,A.current=Gc(Ae,X,oe),f(Ae)}else{let qt=K.current,_t=Gc(qt,ge,de);if(_t>Zh)O.current=!1,f(qt);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&A.current-_t>=_S)O.current=!0}let Xe=Ce(X,oe),ct=N.current.x,io=N.current.y,co=l.includes("left")||l.includes("right"),Ho=l.includes("up")||l.includes("down");if(he!=="vertical"&&co)ct+=Xe.x;if(he!=="horizontal"&&Ho)io+=Xe.y;le({x:ct,y:io})}function Se(z){if(z.key==="Escape"){if(!B.current||!pe(B.current,nt(Re(B.current))))return;p.closeToast(r.id)}}tt.useEffect(()=>{let z=B.current;if(!m||!z)return;function ue(P){if(re.current===null||!pe(z,Ze(P)))return;P.preventDefault()}return Te(z,"touchmove",ue,{passive:!1})},[m]);function Le(){let z=w.x-S.x,ue=w.y-S.y;return{transition:h?"none":void 0,transform:h?`translateX(${w.x}px) translateY(${w.y}px) scale(${S.scale})`:void 0,[_h]:`${z}px`,[Gh]:`${ue}px`}}let Ne=r.priority==="high",ae={role:Ne?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":y,"aria-describedby":v,"aria-hidden":Ne&&!be?!0:void 0,onPointerDown:m?ie:void 0,onPointerMove:m?xe:void 0,onPointerUp:m?Ee:void 0,onPointerCancel:m?Ee:void 0,onKeyDown:Se,inert:Gn(r.limited),style:{...Le(),[Vh]:r.transitionStatus==="ending"?j:_,[Uh]:`${ne}px`,[Wh]:r.height?`${r.height}px`:void 0}},V=tt.useMemo(()=>({toast:r,setTitleId:R,setDescriptionId:L,recalculateHeight:ce,visibleIndex:_,expanded:ee}),[r,R,L,ce,_,ee]),T={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:h,swipeDirection:d},J=ke("div",t,{ref:[o,B],state:T,stateAttributesMapping:WS,props:[ae,c]});return US(vm.Provider,{value:V,children:J})});import*as zc from"react";var $h=zc.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=jr(),l=zc.useRef(null);q(()=>{u();let d=l.current;if(!d||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let f=new ResizeObserver(()=>u(!0)),h=new MutationObserver(()=>u(!0));return f.observe(d),h.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>{f.disconnect(),h.disconnect()}},[u]);let m=i>0;return ke("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as Jh from"react";import*as Yh from"react";function Kh(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(Kh);return!0}function Zc(e){return Yh.isValidElement(e)&&Kh(e.props.children)}function qc(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=jr(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:ar(e),children:i,type:r.type,setId:s}}function jc(e,t,o){let r=Zc(e);return q(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var Qh=Jh.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=qc(s,i,"description"),f=ke("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return jc(f,u,p)});import*as e1 from"react";var t1=e1.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=qc(s,i,"title"),f=ke("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return jc(f,u,p)});import*as Xc from"react";var o1=Xc.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=qr(),{toast:l,expanded:m}=jr(),[p,d]=Xc.useState(!1),{getButtonProps:f,buttonRef:h}=uo({disabled:s,native:i}),I={type:l.type};return ke("button",t,{ref:[o,h],state:I,props:[{"aria-hidden":!m&&!p,onClick(){u.closeToast(l.id)},onFocus(){d(!0)},onBlur(){d(!1)}},c,f]})});import*as r1 from"react";var n1=r1.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=jr(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:p}=uo({disabled:s,native:i}),d={type:u.type},f=ke("button",t,{ref:[o,p],state:d,props:[c,u.actionProps,m,{children:l}]});return Zc(f)?f:null});import*as i1 from"react";import*as $c from"react";import*as a1 from"react-dom";import{jsxs as ZS}from"react/jsx-runtime";var s1=$c.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=Ei({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return ZS($c.Fragment,{children:[l,u&&a1.createPortal(r,u)]})});import{jsx as qS}from"react/jsx-runtime";var c1=i1.forwardRef(function(t,o){return qS(s1,{ref:o,...t})});import*as l1 from"react";function Em(){let e=qr(),t=e.useState("toasts");return l1.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Pm(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||Vc("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as Yc from"react";import*as kt from"react";var m1=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Am=Yc.forwardRef((e,t)=>Yc.createElement(Oe,{ref:t,...e,weights:m1}));Am.displayName="CheckCircleIcon";import*as Kc from"react";import*as Lt from"react";var f1=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var Mm=Kc.forwardRef((e,t)=>Kc.createElement(Oe,{ref:t,...e,weights:f1}));Mm.displayName="CircleNotchIcon";import*as Jc from"react";import*as Dt from"react";var p1=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Dt.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var km=Jc.forwardRef((e,t)=>Jc.createElement(Oe,{ref:t,...e,weights:p1}));km.displayName="InfoIcon";import*as Qc from"react";import*as Ft from"react";var d1=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var Lm=Qc.forwardRef((e,t)=>Qc.createElement(Oe,{ref:t,...e,weights:d1}));Lm.displayName="WarningIcon";import*as el from"react";import*as Ot from"react";var g1=new Map([["bold",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Dm=el.forwardRef((e,t)=>el.createElement(Oe,{ref:t,...e,weights:g1}));Dm.displayName="XCircleIcon";import{jsx as at,jsxs as Fm}from"react/jsx-runtime";var jS=Pm();function XS({...e}){return at(Oh,{...e})}function $S({...e}){return at(c1,{"data-slot":"toast-portal",...e})}function YS({className:e,...t}){return at(Bh,{"data-slot":"toast-viewport",className:fe("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function KS({className:e,...t}){return at(Xh,{"data-slot":"toast",className:fe("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function JS({className:e,...t}){return at($h,{"data-slot":"toast-content",className:fe("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function QS({className:e,...t}){return at(t1,{"data-slot":"toast-title",className:fe("text-sm font-medium",e),...t})}function ew({className:e,...t}){return at(Qh,{"data-slot":"toast-description",className:fe("text-sm text-muted-foreground",e),...t})}function tw({className:e,render:t=at(mt,{variant:"outline",size:"sm"}),...o}){return at(n1,{"data-slot":"toast-action",render:t,className:fe("shrink-0",e),...o})}function ow({className:e,children:t,render:o=at(mt,{variant:"ghost",size:"icon-sm"}),...r}){return at(o1,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:fe("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??at(Ao,{"aria-hidden":"true"})})}function rw({type:e}){let t=null;if(e==="success")t=at(Am,{"aria-hidden":"true"});if(e==="info")t=at(km,{"aria-hidden":"true"});if(e==="warning")t=at(Lm,{"aria-hidden":"true"});if(e==="error")t=at(Dm,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=at(Mm,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return at("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function nw(){let{toasts:e}=Em();return e.map((t)=>at(KS,{toast:t,children:Fm(JS,{children:[at(rw,{type:t.type}),Fm("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[at(QS,{}),at(ew,{})]}),at(tw,{}),at(ow,{})]})},t.id))}function tl({children:e,toastManager:t=jS,container:o,...r}){return Fm(XS,{toastManager:t,...r,children:[e,at($S,{container:o,children:at(YS,{children:at(nw,{})})})]})}var h1=Pm,_tt=Em;import{jsx as Jt,jsxs as as}from"react/jsx-runtime";var uw="https://coristen-three.vercel.app",Yn=h1(),mw=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],fw={name:"Coristen",logoUrl:null,agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleColor:"#171717",showPoweredBy:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class I1 extends aw{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function Nm({identity:e,apiKey:t,apiUrl:o=uw,mode:r="floating",renderTrigger:n,open:a,onOpenChange:s,defaultOpen:i=!1,defaultEmail:c="",welcome:u,fontSize:l,appearance:m,onReady:p,onError:d}){let f=o.replace(/\/$/,""),[h,I]=Jo(),[g,C]=Jo(""),[w,b]=Jo(""),[S,x]=Jo(),[y,R]=Jo(i),v=a??y,L=Om((V)=>{if(a===void 0)R(V);s?.(V)},[a,s]),[W,M]=Jo(!1),[B,D]=Jo(0),[E,N]=Jo({}),[K,A]=Jo(!1),[O,Y]=Jo(),G=ns(null),k=ns(void 0),re=ns(!1),U=ns(p),j=ns(d);U.current=p,j.current=d,vr(()=>{let V=document.querySelector('meta[name="viewport"]'),T=!V;if(!V)V=document.createElement("meta"),V.name="viewport",document.head.append(V);let J=V.content;return V.content=(J?J.split(","):["width=device-width","initial-scale=1"]).map((z)=>z.trim()).filter((z)=>!/^maximum-scale\s*=/i.test(z)).concat("maximum-scale=1").filter(Boolean).join(", "),()=>{if(T)V.remove();else V.content=J}},[]);let _=Om(async(V)=>{let T=t,J;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let P=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!P.ok){let me=Error("Authentication required");throw me.status=P.status,me}let H=await P.json();if(T=H.publishableKey,J=H.identityToken,!J)throw Error("Invalid Coristen identity response")}if(!T?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let z=await fetch(`${f}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:T,identityToken:J,previousToken:V})});if(!z.ok){let P=Error(await z.text());throw P.status=z.status,P}let ue=await z.json();if(e&&!ue.identity)throw Error("Verified identity required");return ue},[t,f,e]);vr(()=>{let V=!0,T,J="",z=async()=>{try{let ue=await _(J||void 0);if(!V)return;J=ue.token,I(ue),C(""),U.current?.(),T=window.setTimeout(z,Math.max(5000,ue.expiresAt-Date.now()-30000))}catch(ue){if(!V)return;let P=ue instanceof Error?ue:Error("Widget failed to load");C(Lh(P)),I((me)=>me&&me.expiresAt>Date.now()?me:void 0),j.current?.(P),console.error("[Coristen widget] Failed to initialize",P);let H=P.status;if(!H||H===429||H>=500)T=window.setTimeout(z,5000)}};return z(),()=>{if(V=!1,T)window.clearTimeout(T);if(J)fetch(`${f}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:J}),keepalive:!0})}},[f,_,B]),vr(()=>{let V=g||w;if(!V)return;let T=Yn.add({title:"Support chat couldn't load",description:V,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Yn.close(T),C(""),b(""),D((J)=>J+1)}}});return()=>Yn.close(T)},[g,w]),vr(()=>{let V=()=>D((z)=>z+1),T=()=>{if(r==="floating"&&window.innerWidth<640)M(!0);L(!0)},J=()=>L(!1);return window.addEventListener("coristen:reset",V),window.addEventListener("coristen:open",T),window.addEventListener("coristen:close",J),()=>{window.removeEventListener("coristen:reset",V),window.removeEventListener("coristen:open",T),window.removeEventListener("coristen:close",J)}},[r,L]),vr(()=>{if(i&&r==="floating"&&window.innerWidth<640)M(!0)},[i,r]),vr(()=>{if(r!=="floating")M(!1)},[r]),vr(()=>{if(h)x(h.settings)},[h]),vr(()=>{if(!O)return;let V=()=>Y((T)=>{if(!T)return T;let J=window.innerWidth<640?12:20;return{left:Math.min(Math.max(T.left,J),window.innerWidth-56-J),top:Math.min(Math.max(T.top,J),window.innerHeight-56-J)}});return window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[O]),vr(()=>{let V=()=>{let z=getComputedStyle(document.documentElement),ue=G.current?.parentElement??document.body,P=getComputedStyle(ue);A(document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||z.colorScheme==="dark"),N({...Object.fromEntries(mw.flatMap((H)=>{let me=z.getPropertyValue(H).trim();return me?[[H,me]]:[]})),"--coristen-host-font-family":P.fontFamily,"--coristen-host-font-size":P.fontSize})};V();let T=new MutationObserver(V);T.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]});let J=G.current?.parentElement??document.body;if(J!==document.documentElement)T.observe(J,{attributes:!0,attributeFilter:["class","style"]});return()=>T.disconnect()},[]);let ne=iw(()=>h?new lw(h.convexUrl):void 0,[h?.convexUrl]),be={...S??h?.settings??fw,...m,theme:m?.theme??(K?"dark":"light")};if(be.enabled===!1)return null;let ee=be.position==="left"?"left":"right",ce=O&&typeof window<"u"?O.left+28<window.innerWidth/2?"left":"right":ee,le=O&&typeof window<"u"?O.top+28<window.innerHeight/2?"top":"bottom":"bottom",Ce={none:0,sm:6,md:10,lg:16}[be.radius],ie={...r!=="floating"?{}:O?{left:`${O.left}px`,top:`${O.top}px`,right:"auto",bottom:"auto"}:ee==="left"?{left:"20px"}:{right:"20px"},...E,"--coristen-radius":`${Ce}px`,"--coristen-bubble-color":be.bubbleColor,"--radius-small":`${Math.max(0,Ce-10)}px`,"--radius-medium":`${Math.max(0,Ce-8)}px`,"--radius-control":`${Math.max(0,Ce-8)}px`,"--radius-card":`${Math.max(0,Ce-4)}px`,"--radius-panel":`${Ce}px`,"--radius-dialog":`${Ce}px`,"--radius-display":`${Ce}px`,...l?{"--coristen-font-size":l}:{}},xe=r!=="floating"?void 0:W&&typeof window<"u"&&window.innerWidth<640?{position:"fixed",inset:0,width:"100vw",height:"100dvh"}:O&&typeof window<"u"?(()=>{let V=window.innerWidth<640?0:20,T=Math.min(W?580:420,window.innerWidth-V*2),J=Math.min(600,window.innerHeight-V*2);return{position:"fixed",right:"auto",bottom:"auto",left:Math.min(Math.max(ce==="left"?O.left:O.left+56-T,V),window.innerWidth-T-V),top:Math.min(Math.max(le==="top"?O.top:O.top+56-J,V),window.innerHeight-J-V)}})():void 0,Se=(V)=>{if(r!=="floating"||v||V.button!==0)return;let T=V.currentTarget.getBoundingClientRect();k.current={pointerId:V.pointerId,startX:V.clientX,startY:V.clientY,left:T.left,top:T.top,moved:!1},V.currentTarget.setPointerCapture(V.pointerId)},Le=(V)=>{let T=k.current;if(!T||T.pointerId!==V.pointerId)return;if(!T.moved&&Math.hypot(V.clientX-T.startX,V.clientY-T.startY)<=4)return;T.moved=!0;let J=window.innerWidth<640?12:20;Y({left:Math.min(Math.max(T.left+V.clientX-T.startX,J),window.innerWidth-56-J),top:Math.min(Math.max(T.top+V.clientY-T.startY,J),window.innerHeight-56-J)})},Ne=(V)=>{let T=k.current;if(!T||T.pointerId!==V.pointerId)return;if(T.moved){re.current=!0;let J=window.innerWidth<640?12:20;Y((z)=>z?{left:z.left+28<window.innerWidth/2?J:window.innerWidth-56-J,top:z.top}:z)}k.current=void 0},ae=()=>{if(!v&&r==="floating"&&window.innerWidth<640)M(!0);L(!v)};if(g&&(!h||!ne))return as("div",{ref:G,"data-coristen-widget":"","data-mode":r,className:be.theme==="dark"?"dark":void 0,style:ie,children:[Jt(tl,{toastManager:Yn,container:G}),n&&Jt("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:ae})})]});if(!h||!ne)return as("div",{ref:G,"data-coristen-widget":"","data-mode":r,className:be.theme==="dark"?"dark":void 0,style:ie,children:[Jt(tl,{toastManager:Yn,container:G}),n&&Jt("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:ae})})]});return as("div",{ref:G,"data-coristen-widget":"","data-open":v||void 0,"data-expanded":W||void 0,"data-mode":r,"data-position":ce,"data-vertical":le,className:be.theme==="dark"?"dark":void 0,style:ie,children:[Jt(tl,{toastManager:Yn,container:G}),r==="modal"&&v&&Jt("button",{type:"button",className:"coristen-backdrop","aria-label":"Close chat",onClick:()=>L(!1)}),h&&ne&&Jt("div",{className:"coristen-panel",role:"dialog","aria-modal":r==="modal"?!0:void 0,"aria-label":`${be.name} chat`,"aria-hidden":!v,inert:!v,style:xe,children:Jt(I1,{onError:(V)=>{b("Chat ran into a problem. Please try again."),j.current?.(V)},children:Jt(cw,{client:ne,children:Jt(kh,{workspaceId:h.workspaceId,initialSettings:be,sessionToken:h.token,expanded:W,onExpandedChange:M,canExpand:r==="floating",onClose:()=>L(!1),onSettingsChange:x,theme:be.theme,assetBaseUrl:f,defaultEmail:c,welcome:u})})},B)}),n?Jt("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:ae})}):r==="floating"?Jt("button",{type:"button",className:"coristen-launcher","aria-label":v?"Close chat":"Open chat","aria-expanded":v,"aria-busy":!h,onPointerDown:Se,onPointerMove:Le,onPointerUp:Ne,onPointerCancel:Ne,onClick:()=>{if(re.current){re.current=!1;return}ae()},children:Jt("img",{src:`${f}/widget-icons/${be.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})}):null]})}function b1(e,t,o){return sw(e,{"aria-expanded":t,onClick:(r)=>{if(e.props.onClick?.(r),!r.defaultPrevented)o()}})}function Ytt(e){return Jt(Nm,{...e,mode:"floating"})}function Ktt({trigger:e,...t}){return Jt(Nm,{...t,mode:"modal",renderTrigger:({open:o,toggle:r})=>b1(e,o,r)})}function Jtt({children:e,side:t="right",trigger:o,open:r,onOpenChange:n,defaultOpen:a=!1,appearance:s,...i}){let[c,u]=Jo(a),l=r??c,m=Om((p)=>{if(r===void 0)u(p);n?.(p)},[r,n]);return as("div",{className:"coristen-dock","data-side":t,"data-open":l||void 0,children:[as("div",{className:"coristen-dock-content",children:[e,!l&&Jt("div",{className:"coristen-dock-trigger",children:b1(o,l,()=>m(!0))})]}),Jt(Nm,{...i,mode:"embedded",open:l,onOpenChange:m,appearance:{...s,position:t}})]})}var Qtt={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{Jtt as CoristenDock,Ktt as CoristenModal,Ytt as CoristenWidget,Qtt as coristenWidget};
|
|
2
|
+
var CI=Object.create;var{getPrototypeOf:SI,defineProperty:Cu,getOwnPropertyNames:xI}=Object;var lp=Object.prototype.hasOwnProperty;function wI(e){return this[e]}var yI,vI,up=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?yI??=new WeakMap:vI??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?CI(SI(e)):{};let s=t||!e||!e.__esModule||!lp.call(e,"default")?Cu(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of xI(e))if(!lp.call(s,i))Cu(s,i,{get:wI.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var RI=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var PI=(e)=>e;function TI(e,t){this[e]=PI.bind(null,t)}var ti=(e,t)=>{for(var o in t)Cu(e,o,{get:t[o],enumerable:!0,configurable:!0,set:TI.bind(t,o)})};import*as nr from"react";var vc=RI(function(kC){function wC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yC=typeof Object.is==="function"?Object.is:wC,vC=nr.useState,RC=nr.useEffect,PC=nr.useLayoutEffect,TC=nr.useDebugValue;function AC(e,t){var o=t(),r=vC({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return PC(function(){n.value=o,n.getSnapshot=t,xm(n)&&a({inst:n})},[e,o,t]),RC(function(){return xm(n)&&a({inst:n}),e(function(){xm(n)&&a({inst:n})})},[e]),TC(o),o}function xm(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!yC(e,o)}catch(r){return!0}}function EC(e,t){return t()}var MC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?EC:AC;kC.useSyncExternalStore=nr.useSyncExternalStore!==void 0?nr.useSyncExternalStore:MC});var Er={};ti(Er,{android:()=>Cd,apple:()=>Uu,ios:()=>Vu,linux:()=>Wb,mac:()=>Sd,windows:()=>_b});var Mr={};ti(Mr,{blink:()=>Gb,gecko:()=>zb,webkit:()=>_u});var Wu={};ti(Wu,{voiceOver:()=>Zb});var ts={};ti(ts,{jsdom:()=>$b});import{Component as ky,cloneElement as Ly,useCallback as tp,useEffect as ln,useMemo as Dy,useRef as Zs,useState as vr}from"react";import{ConvexProvider as Fy,ConvexReactClient as Oy}from"convex/react";import{useEffect as zs,useRef as E2,useState as Br}from"react";import{useMutation as Fa,useQuery as Gs}from"convex/react";import*as oi from"react";import*as hn from"react";import{createContext as AI}from"react";var mp=AI({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Ne=hn.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:f="regular",mirrored:d=!1,...p}=hn.useContext(mp);return hn.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||d?"scale(-1, 1)":void 0,...p,...u},!!o&&hn.createElement("title",null,o),i,c.get(a!=null?a:f))});Ne.displayName="IconBase";import*as bt from"react";var fp=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),bt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var ri=oi.forwardRef((e,t)=>oi.createElement(Ne,{ref:t,...e,weights:fp}));ri.displayName="ArrowUpIcon";import*as ni from"react";import*as Ct from"react";var pp=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),Ct.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var ai=ni.forwardRef((e,t)=>ni.createElement(Ne,{ref:t,...e,weights:pp}));ai.displayName="BinocularsIcon";import*as si from"react";import*as St from"react";var dp=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),St.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var ii=si.forwardRef((e,t)=>si.createElement(Ne,{ref:t,...e,weights:dp}));ii.displayName="CaretLeftIcon";import*as ci from"react";import*as xt from"react";var gp=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),xt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var li=ci.forwardRef((e,t)=>ci.createElement(Ne,{ref:t,...e,weights:gp}));li.displayName="CaretRightIcon";import*as ui from"react";import*as wt from"react";var hp=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]);var mi=ui.forwardRef((e,t)=>ui.createElement(Ne,{ref:t,...e,weights:hp}));mi.displayName="CircleHalfIcon";import*as fi from"react";import*as yt from"react";var Ip=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),yt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var pi=fi.forwardRef((e,t)=>fi.createElement(Ne,{ref:t,...e,weights:Ip}));pi.displayName="ClockCounterClockwiseIcon";import*as di from"react";import*as vt from"react";var bp=new Map([["bold",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),vt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var In=di.forwardRef((e,t)=>di.createElement(Ne,{ref:t,...e,weights:bp}));In.displayName="FileTextIcon";import*as gi from"react";import*as Rt from"react";var Cp=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Rt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var hi=gi.forwardRef((e,t)=>gi.createElement(Ne,{ref:t,...e,weights:Cp}));hi.displayName="GlobeIcon";import*as Ii from"react";import*as Pt from"react";var Sp=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM212,173.44l-84,46-84-46V82.56l84-46,84,46Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,80.18v95.64a8,8,0,0,1-4.16,7l-88,48.18a8,8,0,0,1-7.68,0l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,4.16-7l88-48.18a8,8,0,0,1,7.68,0l88,48.18A8,8,0,0,1,224,80.18Z",opacity:"0.2"}),Pt.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M232,80.18v95.64a16,16,0,0,1-8.32,14l-88,48.17a15.88,15.88,0,0,1-15.36,0l-88-48.17a16,16,0,0,1-8.32-14V80.18a16,16,0,0,1,8.32-14l88-48.17a15.88,15.88,0,0,1,15.36,0l88,48.17A16,16,0,0,1,232,80.18Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM218,175.82a2,2,0,0,1-1,1.75l-88,48.18a2,2,0,0,1-1.92,0L39,177.57a2,2,0,0,1-1-1.75V80.18a2,2,0,0,1,1-1.75l88-48.18a2,2,0,0,1,1.92,0l88,48.18a2,2,0,0,1,1,1.75Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM220,175.82a4,4,0,0,1-2.08,3.5l-88,48.18a4,4,0,0,1-3.84,0l-88-48.18a4,4,0,0,1-2.08-3.5V80.18a4,4,0,0,1,2.08-3.5l88-48.18a3.94,3.94,0,0,1,3.84,0l88,48.18a4,4,0,0,1,2.08,3.5Z"}))]]);var bi=Ii.forwardRef((e,t)=>Ii.createElement(Ne,{ref:t,...e,weights:Sp}));bi.displayName="HexagonIcon";import*as Ci from"react";import*as Tt from"react";var xp=new Map([["bold",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),Tt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var Si=Ci.forwardRef((e,t)=>Ci.createElement(Ne,{ref:t,...e,weights:xp}));Si.displayName="ImageIcon";import*as xi from"react";import*as At from"react";var wp=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),At.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]);var wi=xi.forwardRef((e,t)=>xi.createElement(Ne,{ref:t,...e,weights:wp}));wi.displayName="PaletteIcon";import*as yi from"react";import*as Et from"react";var yp=new Map([["bold",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),Et.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var vi=yi.forwardRef((e,t)=>yi.createElement(Ne,{ref:t,...e,weights:yp}));vi.displayName="PaperclipIcon";import*as Ri from"react";import*as Mt from"react";var vp=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var jn=Ri.forwardRef((e,t)=>Ri.createElement(Ne,{ref:t,...e,weights:vp}));jn.displayName="PlusIcon";import*as Pi from"react";import*as kt from"react";var Rp=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M220,48V88a12,12,0,0,1-24,0V77L164.77,108.2a12,12,0,0,1-17-17L179,60H168a12,12,0,0,1,0-24h40A12,12,0,0,1,220,48ZM208,156a12,12,0,0,0-12,12v11L56.49,39.51a12,12,0,0,0-17,17L179,196H168a12,12,0,0,0,0,24h40a12,12,0,0,0,12-12V168A12,12,0,0,0,208,156ZM91.23,147.8,39.51,199.51a12,12,0,0,0,17,17l51.71-51.72a12,12,0,0,0-17-17Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M48,48l80,80L48,208Zm80,80,80,80V48Z",opacity:"0.2"}),kt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M216,48V88a8,8,0,0,1-13.66,5.66L188,79.31,156.28,111A8,8,0,0,1,145,99.72L176.69,68,162.34,53.66A8,8,0,0,1,168,40h40A8,8,0,0,1,216,48Zm-4.94,112.61a8,8,0,0,0-8.72,1.73L188,176.69,53.66,42.34A8,8,0,0,0,42.34,53.66L176.69,188l-14.35,14.34A8,8,0,0,0,168,216h40a8,8,0,0,0,8-8V168A8,8,0,0,0,211.06,160.61ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M214,48V88a6,6,0,0,1-12,0V62.48l-47.13,47.14a6,6,0,0,1-8.49-8.49L193.52,54H168a6,6,0,0,1,0-12h40A6,6,0,0,1,214,48Zm-6,114a6,6,0,0,0-6,6v25.52L52.24,43.76a6,6,0,0,0-8.48,8.48L193.52,202H168a6,6,0,0,0,0,12h40a6,6,0,0,0,6-6V168A6,6,0,0,0,208,162ZM101.13,146.38,43.76,203.76a6,6,0,1,0,8.48,8.48l57.38-57.37a6,6,0,0,0-8.49-8.49Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M212,48V88a4,4,0,0,1-8,0V57.66L153.46,108.2a4,4,0,1,1-5.66-5.66L198.34,52H168a4,4,0,0,1,0-8h40A4,4,0,0,1,212,48Zm-4,116a4,4,0,0,0-4,4v30.34L50.83,45.17a4,4,0,0,0-5.66,5.66L198.34,204H168a4,4,0,0,0,0,8h40a4,4,0,0,0,4-4V168A4,4,0,0,0,208,164ZM102.54,147.8,45.17,205.17a4,4,0,0,0,5.66,5.66l57.37-57.37a4,4,0,1,0-5.66-5.66Z"}))]]);var Ti=Pi.forwardRef((e,t)=>Pi.createElement(Ne,{ref:t,...e,weights:Rp}));Ti.displayName="ShuffleSimpleIcon";import*as Ai from"react";import*as Lt from"react";var Pp=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Lt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Ho=Ai.forwardRef((e,t)=>Ai.createElement(Ne,{ref:t,...e,weights:Pp}));Ho.displayName="XIcon";import{makeFunctionReference as Jo}from"convex/server";var Vo={welcomeSuggestions:Jo("conversations:welcomeSuggestions"),workspace:Jo("conversations:workspace"),visitorProfile:Jo("conversations:visitorProfile"),openWebsite:Jo("conversations:openWebsite"),visitorConversations:Jo("conversations:visitorConversations"),customerMessages:Jo("conversations:customerMessages"),startCustomer:Jo("conversations:startCustomer"),sendCustomer:Jo("conversations:sendCustomer"),retryAgentResponse:Jo("conversations:retryAgentResponse"),generateAttachmentUploadUrl:Jo("conversations:generateAttachmentUploadUrl"),markCustomerRead:Jo("conversations:markCustomerRead")};import{useEffect as bx,useRef as Cx,useState as Ns}from"react";function Ua(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var Tp={};function Dt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Ei(t);let a=Ei(e);if(t)a=_a(a,t);if(o)a=_a(a,o);if(r)a=_a(a,r);if(n)a=_a(a,n);return a}function Ap(e){if(e.length===0)return Tp;if(e.length===1)return Ei(e[0]);let t=Ei(e[0]);for(let o=1;o<e.length;o+=1)t=_a(t,e[o]);return t}function Ei(e){if(Mp(e))return{...e(Tp)};return EI(e)}function _a(e,t){if(Mp(t))return t(e);return MI(e,t)}function EI(e){let t={...e};for(let o in t){let r=t[o];if(Ep(o,r))t[o]=kp(r)}return t}function MI(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=Ua(e.style,r);break}case"className":{e[o]=Su(e.className,r);break}default:if(Ep(o,r))e[o]=kI(e[o],r);else e[o]=r}}return e}function Ep(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function Mp(e){return typeof e==="function"}function kI(e,t){if(!t)return e;if(!e)return kp(t);return(...o)=>{let r=o[0];if(Lp(r)){let a=r;Wa(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function kp(e){if(!e)return e;return(...t)=>{let o=t[0];if(Lp(o))Wa(o);return e(...t)}}function Wa(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Su(e,t){if(t){if(e)return t+" "+e;return t}return e}function Lp(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as zr from"react";import*as Fp from"react";var Dp={};function Xe(e,t){let o=Fp.useRef(Dp);if(o.current===Dp)o.current=e(t);return o}function Uo(e,t,o,r){let n=Xe(Np).current;if(LI(n,e,t,o,r))Bp(n,[e,t,o,r]);return n.callback}function Op(e){let t=Xe(Np).current;if(DI(t,e))Bp(t,e);return t.callback}function Np(){return{callback:null,cleanup:null,refs:[]}}function LI(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function DI(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function Bp(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as Vp from"react";import*as Hp from"react";var FI=parseInt(Hp.version,10);function Xn(e){return FI>=e}function xu(e){if(!Vp.isValidElement(e))return null;let t=e,o=t.props;return(Xn(19)?o?.ref:t.ref)??null}function Ye(){}var Ar=Object.freeze([]),Ue=Object.freeze({});function Up(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function _p(e,t){return typeof e==="function"?e(t):e}function Wp(e,t){return typeof e==="function"?e(t):e}import{createElement as zp}from"react";function ye(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=za(r);let n=OI(t,o,r);if(o.enabled===!1)return null;let a=o.state??Ue;return HI(e,r,n,a)}function OI(e,t,o){let{className:r,style:n}=e,{state:a=Ue,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?_p(r,a):void 0,m=u?Wp(n,a):void 0,f=u?Up(a,c):Ue,d=u&&i?NI(i):void 0,p=u?Ua(f,d)??{}:Ue;if(typeof document<"u")if(!u)Uo(null,null);else if(Array.isArray(s))p.ref=Op([p.ref,xu(o),...s]);else p.ref=Uo(p.ref,xu(o),s);if(!u)return Ue;if(l!==void 0)p.className=Su(p.className,l);if(m!==void 0)p.style=Ua(p.style,m);return p}function NI(e){if(Array.isArray(e))return Ap(e);return Dt(void 0,e)}var BI=Symbol.for("react.lazy");function za(e){if(e?.$$typeof!==BI)return e;let t=zr.Children.toArray(e)[0];return zr.isValidElement(t)?t:e}function HI(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Dt(o,t.props);return n.ref=o.ref,zr.cloneElement(t,n)}return VI(e,o)}function VI(e,t){if(e==="button")return zp("button",{type:"button",...t,key:t.key});if(e==="img")return zp("img",{alt:"",...t,key:t.key});return zr.createElement(e,t)}function Yn(e){return ye(e.defaultTagName??"div",e,e)}function Gp(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=Gp(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Zp(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=Gp(e))&&(r&&(r+=" "),r+=t);return r}var $p=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,qp=Zp,to=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return qp(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let f=$p(l)||$p(m);return n[u][f]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,f]=l;if(f===void 0)return u;return u[m]=f,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:f,...d}=l;return Object.entries(d).every((p)=>{let[S,g]=p;return Array.isArray(g)?g.includes({...a,...i}[S]):{...a,...i}[S]===g})?[...u,m,f]:u},[]);return qp(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var dr=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Mi=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},Gr=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var UI=[],bn=Mi(dr("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),_I=Mi(dr(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var WI=(()=>{let e=bn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=bn[n];i<bn[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(bn[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=bn[n];s<bn[n+1];s++)o[r++]=a,a+=t[a]}return o})(),zI=dr("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),GI=Mi(dr("123333359346463635126536711576")),ZI=dr("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),$I=dr("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),qI=Gr("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),jI=(()=>{let e=new Int32Array(319).fill(-1),t=Gr("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Gr("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),XI="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),jp=Gr("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),YI=Gr("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),KI=Gr("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),Xp=new Int32Array(995),Yp=new Int32Array(995),Kp=new Int32Array(995),wu="",yu=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<jp.length;r++)for(let n of XI[KI[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),yu[a*2]=wu.length,yu[a*2+1]=n.length,wu+=n;Xp[o]=jp[r],Yp[o]=YI[r],Kp[o]=a,o++}}var JI=Gr("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),QI=Mi(dr("1::24444432:442:44:44>222222:44:4421322511111311111114")),eb=Gr("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),tb=dr("ij"),ob=dr(""),rb=dr("1"),nb="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Jp={GROUP_COUNT:384,customValidatorNames:UI,edgeStart:bn,labelStart:_I,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:WI,nodeGroup:zI,nodeVlist:jI,vlistPat:GI,vlistOps:ZI,vlistRef:$I,vlistGroup:qI,litAnchor:Xp,litGroup:Yp,litPool:Kp,poolOffsets:yu,poolText:wu,adjGid:JI,adjStart:QI,adjTgt:eb,patGid:tb,patTgt:ob,postfixLookupGroups:rb,orderSensitiveModifiers:nb};var ab="line"in Error();var vu=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},ki=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},Qp=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:f,vlistGroup:d,litAnchor:p,litGroup:S,litPool:g,poolOffsets:h,poolText:b,adjGid:C,adjStart:I,adjTgt:x,patGid:y,patTgt:w,postfixLookupGroups:v,customValidatorNames:R,orderSensitiveModifiers:k}=e,H=new Int32Array(r).fill(-1);for(let O=0;O<C.length;O++)H[C[O]]=O;let E=0;for(let O=0;O+1<I.length;O++){let j=I[O+1]-I[O];if(j>E)E=j}let D=32;while(D<2*(1+E+y.length))D<<=1;let M=new Int32Array(f.length+1);for(let O=0;O<f.length;O++)M[O+1]=M[O]+l[f[O]+1]-l[f[O]];let P=new Uint8Array(r);for(let O=0;O<v.length;O++)P[v[O]]=1;let F=n.length-1,G=new Uint8Array(F),T=0,N=!0;for(let O=0;O<p.length;O++){G[p[O]]=1;let j=h[g[O]*2+1];if(j>T)T=j;let ne=b.charCodeAt(h[g[O]*2]);if(ne===91||ne===40)N=!1}let X=1;while(X<p.length*2)X<<=1;let Y=new Int32Array(X).fill(-1);for(let O=0;O<p.length;O++){let j=h[g[O]*2],ne=(vu(b,j,j+h[g[O]*2+1])^Math.imul(p[O],2654435761)|0)&X-1;while(Y[ne]!==-1)ne=ne+1&X-1;Y[ne]=O}let A=(O,j,ne,Te)=>{let _e=(vu(j,ne,Te)^Math.imul(O,2654435761)|0)&X-1,Be=Te-ne;for(;;){let Ke=Y[_e];if(Ke===-1)return-1;if(p[Ke]===O&&h[g[Ke]*2+1]===Be){let It=h[g[Ke]*2],tt=!0;for(let Fe=0;Fe<Be;Fe++)if(b.charCodeAt(It+Fe)!==j.charCodeAt(ne+Fe)){tt=!1;break}if(tt)return S[Ke]}_e=_e+1&X-1}},ue=o.cacheSize??8192,V=o.prefix??e.prefix??"",Z=V===""?"":V+":",q=Z.length,se=(R??[]).map((O)=>{let j=t&&t[O];if(!j)throw Error("cn: missing validator "+O);return j}),Pe=/\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$/,J=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,de=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fe=0,Se=-1,oe=-1,be=-1,W=-1,B=(O)=>O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95,ee=(O)=>/\s/.test(String.fromCharCode(O)),z=(O,j,ne)=>{if(fe=0,Se=-1,ne-j<3)return;let Te=O.charCodeAt(j),_e=O.charCodeAt(ne-1);if(Te===91&&_e===93)fe=1;else if(Te===40&&_e===41)fe=2;else return;be=j+1,W=ne-1;let Be=j+1;if(B(O.charCodeAt(Be))){Be++;while(Be<ne-1){let Ke=O.charCodeAt(Be);if(!B(Ke)&&Ke!==45)break;Be++}if(Be<ne-2&&O.charCodeAt(Be)===58)Se=j+1,oe=Be,be=Be+1}},ce=(O,j,ne,Te)=>{if(ne-j!==Te.length)return!1;for(let _e=0;_e<Te.length;_e++)if(O.charCodeAt(j+_e)!==Te.charCodeAt(_e))return!1;return!0},Q=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Le=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ie=(O)=>!!O&&!Number.isNaN(Number(O)),we=(O,j,ne)=>{if(ne-j<11||!ce(O,j,j+10,"@container"))return!1;if(O.charCodeAt(j+10)===47)return ne-j>=12;let Te=O.charCodeAt(j+11);return Te===115&&ne-j>=17&&ce(O,j+10,j+16,"-size/")||Te===110&&ne-j>=19&&ce(O,j+10,j+18,"-normal/")},L=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],U="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((O)=>O.split(" ")),Ce=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],K=(O,j,ne,Te)=>{if(O>=10){if(O>=25)return se[O-25](j.slice(ne,Te));let _e=O-10;if(fe!==L[_e])return!1;if(Se>=0){for(let Be of U[_e])if(ce(j,Se,oe,Be))return!0;return!1}switch(Ce[_e]){case 0:return!1;case 1:return!0;case 2:{let Be=j.slice(be,W);return Pe.test(Be)&&!J.test(Be)}case 3:return ie(j.slice(be,W));case 4:return de.test(j.slice(be,W));default:return pe.test(j.slice(be,W))}}switch(O){case 0:return!0;case 1:return fe===0;case 2:return fe===1;case 3:return fe===2;case 4:return Q.test(j.slice(ne,Te));case 5:return ie(j.slice(ne,Te));case 6:{let _e=j.slice(ne,Te);return!!_e&&Number.isInteger(Number(_e))}case 7:return Te>ne&&j.charCodeAt(Te-1)===37&&ie(j.slice(ne,Te-1));case 8:return Le.test(j.slice(ne,Te));default:return we(j,ne,Te)}},ae=new Set(typeof k==="string"?k.split(" "):k),ge=(O,j,ne,Te,_e,Be)=>{let Ke=vu(j,ne,Te)^(_e?2654435769:0)|0,It=O.get(Ke);if(It!==void 0)e:for(let ze=0;ze<It.length;ze++){let et=It[ze];if(et.imp!==_e||et.k.length!==Te-ne)continue;for(let qt=0;qt<et.k.length;qt++)if(et.k.charCodeAt(qt)!==j.charCodeAt(ne+qt))continue e;return et.id}else O.set(Ke,It=[]);let tt=j.slice(ne,Te),Fe=Be(tt);return It.push({k:tt,imp:_e,id:Fe}),Fe},he=new Map,Ie=new Map,Oe=2,Qe=4096,dt=(O,j)=>{let ne=[],Te=0,_e=0,Be=0;for(let Fe=0;Fe<O.length;Fe++){let ze=O.charCodeAt(Fe);if(Te===0&&_e===0&&ze===58)ne.push(O.slice(Be,Fe)),Be=Fe+1;else if(ze===91)Te++;else if(ze===93)Te--;else if(ze===40)_e++;else if(ze===41)_e--}ne.push(O.slice(Be));let Ke=ne[0];if(ne.length>1){let Fe=[],ze=[];for(let et of ne)if(et.charCodeAt(0)===91||ae.has(et)){if(ze.length)Fe.push(...ze.sort()),ze=[];Fe.push(et)}else ze.push(et);if(ze.length)Fe.push(...ze.sort());Ke=Fe.join(":")}let It=j?Ke+" !":Ke,tt=Ie.get(It);if(tt===void 0)Ie.set(It,tt=Oe++);return tt},ho=new Map,Io=r,jo=r+4096,eo=()=>Io++,Xt=2097152,xo=8192,Ro=new Int32Array(xo),co=Array(xo).fill(null),un=new Int32Array(xo),mn=new Int32Array(xo),$e=new Uint8Array(xo),zt=0,xe=(O,j,ne,Te,_e,Be,Ke,It)=>{let tt=O;if(co[O]!==null)if(co[O|1]===null)tt=O|1;else if((zt++&3)===0)tt=O|zt>>2&1;else return;co[tt]=j.slice(ne,Te),Ro[tt]=_e,un[tt]=Be,mn[tt]=Ke,$e[tt]=It},Me=()=>co.fill(null),We=256,Gt=[new Int32Array(We),new Int32Array(We),new Int32Array(We),new Int32Array(We)],[Yt,bo,$t,Po]=Gt,Xo=new Uint8Array(We),Fo=new Uint8Array(We),Gn=()=>{We*=2,Gt=Gt.map((j)=>{let ne=new Int32Array(We);return ne.set(j),ne}),[Yt,bo,$t,Po]=Gt;let O=new Uint8Array(We);O.set(Xo),Xo=O,Fo=new Uint8Array(We)},ur=64,fn=new Int32Array(ur),pn=new Int32Array(ur),nu=new Int32Array(r),Hr=2048,rp=21,au=new Float64Array(Hr),qs=new Int32Array(Hr),Vr=0,su=(O,j)=>{if(O===0&&j<r){if(nu[j]===Vr)return 1;return nu[j]=Vr,0}let ne=O*2097152+j+1,Te=Math.imul(ne,2654435761)>>>rp;for(;;){if(qs[Te]!==Vr)break;if(au[Te]===ne)return 1;Te=Te+1&Hr-1}return au[Te]=ne,qs[Te]=Vr,0},js=(O,j,ne,Te,_e)=>{if(ne-j>=2&&O.charCodeAt(j)===91&&O.charCodeAt(ne-1)===93){let Be=-1;for(let Ke=j+1;Ke<ne-1;Ke++)if(O.charCodeAt(Ke)===58){Be=Ke;break}if(Be===-1||Be===j+1)return-1;return ge(ho,O,j+1,Be,0,eo)}if(Te>=0&&c[Te]>=0)return c[Te];for(let Be=_e-1;Be>=0;Be--){let Ke=pn[Be];if(Ke>ne)continue;let It=fn[Be],tt=ne-Ke;if(G[It]===1&&tt>0&&tt<=T){let Kt=O.charCodeAt(Ke);if(N===!1||Kt!==91&&Kt!==40){let _r=A(It,O,Ke,ne);if(_r>=0)return _r}}let Fe=u[It];if(Fe<0)continue;let ze=f[Fe],et=l[ze],qt=l[ze+1];if(et===qt)continue;z(O,Ke,ne);let lo=M[Fe]-et;for(let Kt=et;Kt<qt;Kt++)if(K(m[Kt],O,Ke,ne))return d[lo+Kt]}return-1},Xs=(O)=>{let j=O.length,ne=0,Te=0,_e=!1;if(Oe>Qe||he.size>Qe)he=new Map,Ie=new Map,Oe=2,Me();if(Io>jo)ho=new Map,Io=r,Me();let Be=0;while(Be<j){let Fe=O.charCodeAt(Be);if(Fe===32||Fe>=9&&Fe<=13||Fe>=160&&ee(Fe)){if(Fe!==32)_e=!0;Be++;continue}let ze=Be,et=0;while(Be<j){if(Fe=O.charCodeAt(Be),Fe<=32){if(Fe===32)break;if(Fe>=9&&Fe<=13){_e=!0;break}}else if(Fe>=160&&ee(Fe)){_e=!0;break}et=Math.imul(et^Fe,16777619),Be++}let qt=Be,lo=qt-ze;if(ne===We)Gn();let Kt=ne++;Yt[Kt]=ze,bo[Kt]=qt,Te+=lo,et^=Math.imul(lo,2654435761);let _r=et^et>>>15|0,mr=_r&8190;{let at=-1;if(Ro[mr]===_r&&co[mr]!==null&&co[mr].length===lo)at=mr;else if(Ro[mr|1]===_r&&co[mr|1]!==null&&co[mr|1].length===lo)at=mr|1;if(at>=0){let Ko=co[at],Pr=!0;for(let Tr=0;Tr<lo;Tr++)if(Ko.charCodeAt(Tr)!==O.charCodeAt(ze+Tr)){Pr=!1;break}if(Pr){$t[Kt]=un[at],Po[Kt]=mn[at],Xo[Kt]=$e[at];continue}}}let $n=ze;if(q!==0){if(qt-ze<=q||!O.startsWith(Z,ze)){$t[Kt]=-1,xe(mr,O,ze,qt,_r,-1,0,0);continue}$n=ze+q}let cu=0,lu=0,Ha=-1,uu=-1;for(let at=$n;at<qt;at++){let Ko=O.charCodeAt(at);if(cu===0&&lu===0){if(Ko===58){Ha=at;continue}if(Ko===47){uu=at;continue}}if(Ko===91)cu++;else if(Ko===93)cu--;else if(Ko===40)lu++;else if(Ko===41)lu--}let sp=Ha>=$n?Ha+1:$n,Oo=sp,No=qt,Va=!1,ip=0;if(No>Oo&&O.charCodeAt(No-1)===33)Va=!0,No--;else if(No>Oo&&O.charCodeAt(Oo)===33)Va=!0,Oo++,ip=1;let dn=-1;if(uu>sp){if(dn=uu+ip,dn>=No)dn=-1}let mu=Oo;if(No-Oo>1&&O.charCodeAt(Oo)===45)mu=Oo+1;let fr=0,Wr=0,qn=0,cp=-1,pr=0;if(u[0]>=0||G[0]===1)fn[0]=0,pn[0]=mu,pr=1;let fu=-1,pu=0;for(let at=mu;at<No;at++){if(at===dn)fu=Wr<qn?-1:fr,pu=pr;if(fr!==-1){let Ko=O.charCodeAt(at),Pr=-1;if(Wr<qn)if(s.charCodeAt(Wr)===Ko){if(Wr++,Wr===qn)Pr=fr=cp}else fr=-1;else{let Tr=n[fr],ei=n[fr+1],Iu=-1;for(let gn=Tr;gn<ei;gn++){let bu=a[gn];if(s.charCodeAt(bu)===Ko){if(a[gn+1]-bu===1)Pr=Iu=i[gn];else Wr=bu+1,qn=a[gn+1],cp=i[gn],Iu=fr;break}}fr=Iu}if(Pr>=0&&(u[Pr]>=0||G[Pr]===1)&&at+1<No&&O.charCodeAt(at+1)===45){if(pr===ur){ur*=2;let Tr=new Int32Array(ur);Tr.set(fn),fn=Tr;let ei=new Int32Array(ur);ei.set(pn),pn=ei}fn[pr]=Pr,pn[pr]=at+2,pr++}}}if(dn===No)fu=Wr<qn?-1:fr,pu=pr;let du=Wr<qn?-1:fr,Bo,Qs=!1;if(dn>=0){if(Qs=!0,Bo=js(O,Oo,dn,fu,pu),Bo!==-1&&Bo<r&&P[Bo]){let at=js(O,Oo,No,du,pr);if(at!==-1&&at!==Bo)Bo=at,Qs=!1}else if(Bo===-1)Bo=js(O,Oo,No,du,pr),Qs=!1}else Bo=js(O,Oo,No,du,pr);let gu=0,hu=0;if(Bo===-1)$t[Kt]=-1;else hu=Qs?1:0,gu=$n>=Ha?Va?1:0:ge(he,O,$n,Ha,Va?1:0,(at)=>dt(at,Va)),$t[Kt]=Bo,Xo[Kt]=hu,Po[Kt]=gu;xe(mr,O,ze,qt,_r,Bo,gu,hu)}if(ne===0)return"";if(ne===1)return Yt[0]===0&&bo[0]===j?O:O.slice(Yt[0],bo[0]);if(ne*D>Hr){while(ne*D>Hr)Hr<<=1,rp--;au=new Float64Array(Hr),qs=new Int32Array(Hr)}if(Oe>=Xt||Io>=Xt)throw Error("cn: too many distinct classes in one merge");if(Vr=Vr+1|0,Vr===0)nu.fill(0),qs.fill(0),Vr=1;let Ke=!1;for(let Fe=ne-1;Fe>=0;Fe--){let ze=$t[Fe];if(ze===-1){Fo[Fe]=1;continue}let et=Po[Fe];if(su(et,ze)===1){Fo[Fe]=0,Ke=!0;continue}if(Fo[Fe]=1,ze<r){let qt=H[ze];if(qt>=0)for(let lo=I[qt];lo<I[qt+1];lo++)su(et,x[lo]);if(Xo[Fe]&1){for(let lo=0;lo<y.length;lo++)if(y[lo]===ze)su(et,w[lo])}}}if(!Ke&&!_e&&j===Te+ne-1)return O;let It="",tt=0;while(tt<ne){if(!Fo[tt]){tt++;continue}let Fe=Yt[tt],ze=bo[tt],et=tt+1;while(et<ne&&Fo[et]&&Yt[et]===ze+1&&O.charCodeAt(ze)===32)ze=bo[et],et++;if(It.length>0)It+=" ";It+=O.slice(Fe,ze),tt=et}return It},Ur=16384,Rr=new Int32Array(Ur*2),Ys=0,Yo=1,Na=Object.create(null),np=Object.create(null),Zn=new Map,ap=new Map,Ks=0,Js=0,Ba=()=>{Ys^=Ur,Yo=Yo+1|0,Js=0},hI=(O)=>{let j=Na[O];if(j!==void 0)return j;let ne=ki(O,0,O.length),Te=(ne&16383)+Ys,_e=Rr[Te]===(ne^Yo)||Rr[Te^Ur]===(ne^Yo-1);if(_e){if(j=np[O],j!==void 0)return Na[O]=j,j}if(j=Xs(O),_e){if(Na[O]=j,++Ks>ue)Ks=0,np=Na,Na=Object.create(null),Ba()}else if(Rr[Te]=ne^Yo,++Js>Ur)Ba();return j},II=(O)=>{let j=Zn.get(O);if(j!==void 0)return j;let ne=ki(O,0,O.length),Te=(ne&16383)+Ys,_e=Rr[Te]===(ne^Yo)||Rr[Te^Ur]===(ne^Yo-1);if(_e){if(j=ap.get(O),j!==void 0)return Zn.set(O,j),j}if(j=Xs(O),_e){if(Zn.set(O,j),++Ks>ue)Ks=0,ap=Zn,Zn=new Map,Ba()}else if(Rr[Te]=ne^Yo,++Js>Ur)Ba();return j},bI=(O)=>{let j=ki(O,0,O.length),ne=(j&16383)+Ys;if(Rr[ne]===(j^Yo)||Rr[ne^Ur]===(j^Yo-1))return!0;if(Rr[ne]=j^Yo,++Js>Ur)Ba();return!1},iu=ue===0?Xs:ab?(O)=>{let j=Zn.get(O);return j!==void 0?j:II(O)}:hI;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?iu(arguments[0]):iu(ed.apply(null,arguments))},mergeString:iu,seenBefore:ue===0?()=>!1:bI,mergeUncached:Xs}},Li=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Li(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},sb=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Li(n,t);if(a){if(o)o+=" ";o+=a}}return o},ed=function(){return sb(arguments,!1)};var td=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,f=(h,b,C)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let I=ki(h,0,h.length)&4094;if(c[I]===h&&u[I]===b)return l[I];if(c[I|1]===h&&u[I|1]===b)return l[I|1];let x=e(C?b+" "+h:h),y=c[I]===""?I:I|(c[I|1]===""?1:m++&1);return c[y]=h,u[y]=b,l[y]=x,x},d=(h,b,C,I)=>{let x=0;if(b){if(b!==h.a0)return!1;x=1}if(C){if(C!==(x===0?h.a0:h.a1))return!1;x++}if(I){if(I!==(x===0?h.a0:x===1?h.a1:h.a2))return!1;x++}return x===h.t},p=(h,b)=>{let C=h.a,I=0;for(let x=0;x<b.length;x++){let y=b[x];if(!y)continue;if(y!==C[I])return!1;I++}return I===h.t},S=(h,b)=>{let C=h.length,I=i===null?null:i.n;if(!b){if(I!==null&&p(I,h))return i=I,I.r;if(i!==null&&i!==I&&p(i,h))return i.r}let x="",y=-1,w=0,v=!1;for(let H=0;H<C;H++){let E=h[H];if(!E)continue;if(typeof E!=="string"){if(E=h[H]=Li(E,!0),!E)continue;v=!0}if(y<0)x=E,y=H;w++}if(w===0)return"";if(w===1)return e(x);if(v){if(I!==null&&p(I,h))return i=I,I.r;if(i!==null&&i!==I&&p(i,h))return i.r}let R=n.get(x);if(R===void 0){if(R=a.get(x),R!==void 0)n.set(x,R)}let k=null;if(R!==void 0){if(R.skip>0){R.skip--,i=null;let E=x;for(let D=y+1;D<C;D++){let M=h[D];if(M)E+=" "+M}return f(E,"",!1)}let H=R.e;e:for(let E=0;E<H.length;E++){let D=H[E];if(D.t!==w)continue;let M=D.a,P=1;for(let F=y+1;F<C;F++){let G=h[F];if(G&&G!==M[P++])continue e}k=D;break}if(k!==null)R.miss=0}if(k===null){let H=x,E=[x];for(let M=y+1;M<C;M++){let P=h[M];if(!P)continue;H+=" "+P,E.push(P)}if(!o(H))return r(H);if(k={r:e(H),t:E.length,a0:E[0],a1:E[1],a2:E[2]??"",a:E,n:null},R===void 0)n.set(x,R={e:[],miss:0,skip:0,at:0});else if(++R.miss>16)R.miss=16,R.skip=1024,R.e.length=0,R.at=0;let D=R.e;if(D.length<256)D.push(k);else D[R.at]=k,R.at=R.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==k)i.n=k;return i=k,k.r},g=(h)=>Array.isArray(h)?S(h.slice(),!1):e(Li(h,!0));return function(h,b,C){let I=arguments.length;if((I|1)===3){let w=i;if(w!==null){let v=w.n;if(v!==null&&d(v,h,b,C))return i=v,v.r;if(w!==v&&d(w,h,b,C))return w.r}if(I===2&&typeof b==="string"&&b!==""){let v=n.get(h);if(v!==void 0&&v.skip>0)return v.skip--,i=null,f(b,h,!0)}return S([h,b,C],!0)}if(I===1)return typeof h==="string"?e(h):g(h);let x=i;if(x!==null){let w=x.n;if(w!==null){let v=w.a,R=0,k=!0;for(let H=0;H<I;H++){let E=arguments[H];if(!E)continue;if(E!==v[R]){k=!1;break}R++}if(k&&R===w.t)return i=w,w.r}if(x!==w){let v=x.a,R=0,k=!0;for(let H=0;H<I;H++){let E=arguments[H];if(!E)continue;if(E!==v[R]){k=!1;break}R++}if(k&&R===x.t)return x.r}}let y=[];for(let w=0;w<I;w++)y.push(arguments[w]);return S(y,!0)}};var Ru=Qp(Jp),le=td(Ru.mergeString,Ru),_7e=Ru.merge;import*as cd from"react";import*as Qn from"react";function Di(){return typeof window<"u"}function Ft(e){if(Fi(e))return(e.nodeName||"").toLowerCase();return"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gr(e){var t;return(t=(Fi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fi(e){if(!Di())return!1;return e instanceof Node||e instanceof qe(e).Node}function Ve(e){if(!Di())return!1;return e instanceof Element||e instanceof qe(e).Element}function je(e){if(!Di())return!1;return e instanceof HTMLElement||e instanceof qe(e).HTMLElement}function Qo(e){if(!Di()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function Sn(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=oo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function od(e){return/^(table|td|th)$/.test(Ft(e))}function Ga(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var ib=/transform|translate|scale|rotate|perspective|filter/,cb=/paint|layout|strict|content/,Cn=(e)=>!!e&&e!=="none",Pu;function Oi(e){let t=Ve(e)?oo(e):e;return Cn(t.transform)||Cn(t.translate)||Cn(t.scale)||Cn(t.rotate)||Cn(t.perspective)||!Ni()&&(Cn(t.backdropFilter)||Cn(t.filter))||ib.test(t.willChange||"")||cb.test(t.contain||"")}function rd(e){let t=_o(e);while(je(t)&&!Wo(t)){if(Oi(t))return t;else if(Ga(t))return null;t=_o(t)}return null}function Ni(){if(Pu==null)Pu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Pu}function Wo(e){return/^(html|body|#document)$/.test(Ft(e))}function oo(e){return qe(e).getComputedStyle(e)}function Za(e){if(Ve(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _o(e){if(Ft(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Qo(e)&&e.host||gr(e);return Qo(t)?t.host:t}function nd(e){let t=_o(e);if(Wo(t))return(e.ownerDocument||e).body;if(je(t)&&Sn(t))return t;return nd(t)}function Zr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=nd(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=qe(n);if(a){let i=Bi(s);return t.concat(s,s.visualViewport||[],Sn(n)?n:[],i&&o?Zr(i):[])}else return t.concat(n,Zr(n,[],o))}function Bi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as lb from"react";var $a={...lb};var Tu=$a.useInsertionEffect,ub=Tu&&Tu!==$a.useLayoutEffect?Tu:(e)=>e();function re(e){let t=Xe(mb).current;return t.next=e,ub(t.effect),t.trampoline}function mb(){let e={next:void 0,callback:fb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function fb(){}import*as ad from"react";var pb=()=>{},_=typeof document<"u"?ad.useLayoutEffect:pb;function db(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var gb=db("https://base-ui.com/production-error","Base UI"),Ge=gb;import*as Hi from"react";var hb=Hi.createContext(void 0);function Kn(e=!1){let t=Hi.useContext(hb);if(t===void 0&&!e)throw Error(Ge(16));return t}import*as sd from"react";function id(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:sd.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function Ae(e){return e?.ownerDocument||document}function Jn(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(qe(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Co(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=Qn.useRef(null),i=Kn(!0),c=a??i!==void 0,{props:u}=id({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=Qn.useCallback(()=>{let d=s.current;if(!Au(d))return;if(c&&t&&u.disabled===void 0&&d.disabled)d.disabled=!1},[t,u.disabled,c]);_(l,[l]);let m=Qn.useCallback((d={})=>{let{onClick:p,onMouseDown:S,onKeyUp:g,onKeyDown:h,onPointerDown:b,...C}=d;return Dt({onClick(I){if(t){I.preventDefault();return}p?.(I)},onMouseDown(I){if(!t)S?.(I)},onKeyDown(I){if(t)return;if(Wa(I),h?.(I),I.baseUIHandlerPrevented)return;let x=I.target===I.currentTarget,y=I.currentTarget,w=Au(y),v=!n&&Ib(y),R=x&&(n?w:!v),k=I.key==="Enter",H=I.key===" ",E=y.getAttribute("role"),D=E?.startsWith("menuitem")||E==="option"||E==="gridcell";if(x&&c&&H){if(I.defaultPrevented&&D)return;if(I.preventDefault(),!n||w)I.preventBaseUIHandler(),Jn(y,I);return}if(!R||n||!H&&!k){if(x&&v&&H)I.preventDefault();return}if(I.defaultPrevented)return;if(I.preventDefault(),k)I.preventBaseUIHandler(),Jn(y,I)},onKeyUp(I){if(t)return;if(Wa(I),g?.(I),I.target===I.currentTarget&&n&&c&&Au(I.currentTarget)&&I.key===" "){I.preventDefault();return}if(I.baseUIHandlerPrevented)return;if(I.target===I.currentTarget&&!n&&!c&&!I.defaultPrevented&&I.key===" ")I.preventBaseUIHandler(),Jn(I.currentTarget,I)},onPointerDown(I){if(t){I.preventDefault();return}b?.(I)}},n?{type:"button"}:{role:"button"},u,C)},[t,u,c,n]),f=re((d)=>{s.current=d,l()});return{getButtonProps:m,buttonRef:f}}function Au(e){return je(e)&&e.tagName==="BUTTON"}function Ib(e){return je(e)&&e.tagName==="A"&&Boolean(e.href)}var Eu=cd.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=Co({disabled:a,focusableWhenDisabled:s,native:i});return ye("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as Cb}from"react/jsx-runtime";var bb=to("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function gt({className:e,variant:t="default",size:o="default",...r}){return Cb(Eu,{"data-slot":"button",className:le(bb({variant:t,size:o,className:e})),...r})}import{jsx as $r}from"react/jsx-runtime";var Sb=to("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function ea({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return $r("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:le(Sb({size:o,orientation:r}),e),...n})}var xb=to("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function qa({className:e,variant:t="icon",...o}){return $r("div",{"data-slot":"attachment-media","data-variant":t,className:le(xb({variant:t}),e),...o})}function ja({className:e,...t}){return $r("div",{"data-slot":"attachment-content",className:le("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function Xa({className:e,...t}){return $r("span",{"data-slot":"attachment-title",className:le("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function Ya({className:e,...t}){return $r("span",{"data-slot":"attachment-description",className:le("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function Vi({className:e,...t}){return $r("div",{"data-slot":"attachment-actions",className:le("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function ld({className:e,variant:t,size:o="icon-xs",...r}){return $r(gt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:le(e),...r})}function Ui({className:e,...t}){return $r("div",{"data-slot":"attachment-group",className:le("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as _i from"react";var Mu=_i.createContext(void 0);function ud(e){let t=_i.useContext(Mu);if(t===void 0&&!e)throw Error(Ge(33));return t}import*as Wi from"react";var Ka=Wi.createContext(void 0);function wo(e){let t=Wi.useContext(Ka);if(t===void 0&&!e)throw Error(Ge(36));return t}var xn="data-starting-style",Ja="data-ending-style";var wb={[xn]:""},yb={[Ja]:""},qr={transitionStatus(e){if(e==="starting")return wb;if(e==="ending")return yb;return null}};var ku="data-open",Lu="data-closed",vb=xn,Rb=Ja,md="data-anchor-hidden";var Gi="data-popup-open",pd="data-pressed";var Pb={[Gi]:""},Tb={[Gi]:"",[pd]:""},Ab={[ku]:""},Eb={[Lu]:""},Mb={[md]:""},Zi={open(e){if(e)return Pb;return null}},Du={open(e){if(e)return Tb;return null}},wn={open(e){if(e)return Ab;return Eb},anchorHidden(e){if(e)return Mb;return null}},ta={...wn,...qr};import*as $i from"react";var kb=$i.createContext(void 0);function oa(e=!0){let t=$i.useContext(kb);if(t===void 0&&!e)throw Error(Ge(25));return t}var yn="none",ra="trigger-press",jt="trigger-hover",na="trigger-focus",Fu="outside-press",Ou="item-press",Lb="close-press";var aa="focus-out",qi="escape-key";var ji="list-navigation",gd="keyboard",Db="pointer";var Fb="cancel-open",Qa="sibling-open",Ob="disabled";var Nu="imperative-action";import*as es from"react";var Bu=es.createContext(null);function Hu(e="root"){let t=es.useContext(Bu),o=es.useContext(Ka);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var Nb={visible:!0,ref:null};function Bb(){return Nb}function hd(e,t,o="root"){let r=Hu(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??Bb)({label:e.label,children:e.children,render:e.render}),s=Uo(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as sa from"react";import*as xd from"react";function Hb(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Vb,platform:Ub,maxTouchPoints:Id}=Hb(),vn=Vb.toLowerCase(),Rn=Ub.toLowerCase();var Vu=/^i(os$|p)/.test(Rn)||Rn==="macintel"&&Id>1,bd="android",Cd=Rn===bd||vn.includes(bd),Sd=!Vu&&Rn.startsWith("mac"),_b=Rn.startsWith("win"),Wb=!Cd&&/^(linux|chrome os)/.test(Rn),Uu=Sd||Vu;var _u=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),zb=!_u&&vn.includes("firefox"),Gb=!_u&&vn.includes("chrom");var Zb=Uu;var $b=/jsdom|happydom/.test(vn);function qb(e){e.preventDefault()}function wd(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=wo(),l=oa(!0),m=c.type==="submenu-trigger",f=m?u.parentVirtualFocus:u.virtualFocus,p=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:S}=a.useState("floatingTreeRoot"),g=a.useState("open"),h=l!==void 0,b=!f&&g&&o?0:-1;return xd.useMemo(()=>({id:r,role:"menuitem",tabIndex:b,"aria-selected":p,onMouseDown:f?qb:void 0,onKeyDown(C){if(C.key===" "&&s?.current)C.preventDefault()},onMouseMove(C){if(!n)return;S.emit("itemhover",{nodeId:n,target:C.currentTarget})},onClick(C){if(t)S.emit("close",{domEvent:C.nativeEvent,reason:Ou})},onMouseUp(C){if(l){let I=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,h&&I&&Math.abs(C.clientX-I.x)<=1&&Math.abs(C.clientY-I.y)<=1)return;if(h&&!Er.mac&&C.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!h||C.button===2)){if(c.type==="regular-item")Jn(i.current,C,{detail:1,pointerType:"mouse"})}}}),[t,b,r,S,n,a.context.allowMouseUpTriggerRef,s,i,l,h,c.type,p,f])}var yd={type:"regular-item"};function vd(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=sa.useRef(null),{getButtonProps:m,buttonRef:f}=Co({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),d=wd({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),p=sa.useCallback((g)=>Dt(d,{onMouseEnter(h){if(c.type!=="submenu-trigger")return;c.setActive(h.nativeEvent)}},g,m),[d,m,c]),S=Uo(l,f);return sa.useMemo(()=>({getItemProps:p,itemRef:S}),[p,S])}import*as Pn from"react";import*as Xi from"react";var zu=Xi.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Rd(){return Xi.useContext(zu)}function Yi(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=Rd(),l=Pn.useRef(-1),[m,f]=Pn.useState(a==null&&t?()=>{if(l.current===-1){let g=u.current;u.current+=1,l.current=g}return l.current}:-1),d=a??m,p=Pn.useRef(null),S=Pn.useCallback((g)=>{let h=p.current;if(h)i(h);if(p.current=g,g)s(g,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return _(()=>{if(a!=null)return;return c((g)=>{let h=p.current?g.get(p.current)?.index:null;if(h!=null)f(h)})},[a,c]),{ref:S,index:d}}import*as Qi from"react";import*as Ki from"react";function Ji(){let[,e]=Ki.useState({});return Ki.useCallback(()=>{e({})},[])}var Pd=0;function jb(e,t="mui"){let o=Qi.useRef(void 0),r=Ji(),n=e??o.current;return Qi.useEffect(()=>{if(o.current==null){if(Pd+=1,o.current=`${t}-${Pd}`,e==null)r()}},[e,t,r]),n}var Td=$a.useId;function hr(e,t){if(Td!==void 0){let o=Td();return e??(t?`${t}-${o}`:o)}return jb(e,t)}function ro(e){return hr(e,"base-ui")}function Re(e,t,o,r){let n=!1,a=!1,s=r??Ue;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function Ad(e,t,o){let r=o??Ue;return{reason:e,event:t??new Event("base-ui"),...r}}import*as Gu from"react";import*as Ed from"react";function jr(e){Ed.useEffect(e,Ar)}var ec=null,wUe=globalThis.requestAnimationFrame;class Md{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var tc=new Md;class zo{static create(){return new zo}static request(e){return tc.request(e)}static cancel(e){return tc.cancel(e)}currentId=ec;request(e){this.cancel(),this.currentId=tc.request(()=>{this.currentId=ec,e()})}cancel=()=>{if(this.currentId!==ec)tc.cancel(this.currentId),this.currentId=ec};disposeEffect=()=>this.cancel}function kr(){let e=Xe(zo.create).current;return jr(e.disposeEffect),e}function oc(e,t=!1,o=!1,r=!1){let[n,a]=Gu.useState(e&&t?"idle":void 0),[s,i]=Gu.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return _(()=>{if(!e&&s&&n!=="ending"&&o){let c=zo.request(()=>{a("ending")});return()=>{zo.cancel(c)}}return},[e,s,n,o]),_(()=>{if(!e||t||n===void 0)return;let c=zo.request(()=>{a(void 0)});return()=>{zo.cancel(c)}},[t,e,n]),_(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=zo.request(()=>{a("idle")});return()=>{zo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as kd from"react";import*as $u from"react-dom";function er(e){if(e==null)return e;return"current"in e?e.current:e}function Zu(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var rc=null;function Xb(e){if(!rc){let t=[];rc=t,queueMicrotask(()=>{rc=null,$u.flushSync(()=>{for(let o of t)o()})})}rc.push(e)}function ia(e,t=!1,o=!1){let r=kr();return re((n,a=null)=>{r.cancel();let s=er(e);if(s==null)return;let i=s,c=()=>{if(!o){$u.flushSync(n);return}Xb(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(Zu(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(Zu(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=xn;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function Go(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=re(a),i=ia(r,o,n);kd.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as qu from"react";import{jsx as Yb}from"react/jsx-runtime";var Kb=qu.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:f}=wo(),d=Yi({guess:!0,label:s}),p=ro(a),S=f.useState("disabled"),g=f.useState("isActive",d.index),h=f.useState("floatingNodeId"),b=f.useState("itemProps"),C=c||S,{getItemProps:I,itemRef:x}=vd({closeOnClick:u,disabled:C,highlighted:g,id:p,store:f,nativeButton:i,nodeId:h,itemMetadata:yd});return ye("div",t,{state:{disabled:C,highlighted:g},props:[b,m,I],ref:[x,o,d.ref]})}),Ld=qu.forwardRef(function(t,o){let r=hd(t,o);if(!r.visible)return null;return Yb(Kb,{...t,ref:r.ref})});import*as Nn from"react";import*as Ir from"react";var os=0;class Jt{static create(){return new Jt}currentId=os;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=os,t()},e)}isStarted(){return this.currentId!==os}clear=()=>{if(this.currentId!==os)clearTimeout(this.currentId),this.currentId=os};disposeEffect=()=>this.clear}function Je(){let e=Xe(Jt.create).current;return jr(e.disposeEffect),e}function Ao(e){e.preventDefault(),e.stopPropagation()}function Dd(e){return"nativeEvent"in e}function Xr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(Er.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function ca(e){if(ts.jsdom)return!1;return!Er.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(Er.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Eo(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Fd(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function st(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function me(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Qo(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function tr(e,t){let o=e;while(o){if(Ve(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(Qo(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var rs="data-base-ui-focusable";var ju="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ns="ArrowLeft",as="ArrowRight",Xu="ArrowUp",nc="ArrowDown";var t_e=Gi,ss="data-trigger-disabled";function Yr(e,t){if(!Ve(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(ss);for(let[,r]of t.entries())if(me(r,o))return!r.hasAttribute(ss);return!1}function ac(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function Nd(e){return e.matches("html,body")}function Lr(e){return je(e)&&e.matches(ju)}function Yu(e){return tr(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ju}`)!=null}function is(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&Lr(e)}function Kr(e){if(!e||ts.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function cs(e){if(!e)return null;return e.hasAttribute(rs)?e:e.querySelector(`[${rs}]`)||e}function Jb(e,t){if(t!=null&&!Eo(t))return 0;if(typeof e==="function")return e();return e}function Dr(e,t,o){let r=Jb(e,o);if(typeof r==="number")return r;return r?.[t]}function Ku(e){if(typeof e==="function")return e();return e}function sc(e,t){return t||e==="click"||e==="mousedown"}function Bd(e){return e?.includes("mouse")&&e!=="mousedown"}import{jsx as h_e}from"react/jsx-runtime";var Qb=Ir.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Jt,currentIdRef:{current:null},currentContextRef:{current:null}});function eC(e,t){e.current=t.current}function Ju(e,t={open:!1}){let{open:o}=t,r=e.useState("floatingId"),n=Ir.useContext(Qb),{currentIdRef:a,delayRef:s,timeoutMs:i,initialDelayRef:c,currentContextRef:u,hasProvider:l,timeout:m}=n,[f,d]=Ir.useState(!1),p=Ir.useRef(o);return _(()=>{p.current=o},[o]),_(()=>{function S(){u.current?.setIsInstantPhase(!1),a.current=null,u.current=null,s.current=c.current,m.clear()}if(!a.current)return;if(!o&&a.current===r){if(d(!1),i){let g=r;return m.start(i,()=>{if(e.select("open")||a.current&&a.current!==g)return;S()}),()=>{if(p.current||a.current!==g)m.clear()}}S()}return},[o,r,a,s,i,c,u,m,e]),_(()=>{if(!o)return;let S=u.current,g=a.current;if(m.clear(),u.current={onOpenChange:e.setOpen,setIsInstantPhase:d},a.current=r,s.current={open:0,close:Dr(c.current,"close")},g!==null&&g!==r)d(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,Re(yn));else d(!1),S?.setIsInstantPhase(!1)},[o,r,e,a,s,c,u,m]),_(()=>()=>{if(a.current===r){if(u.current=null,!p.current)return;a.current=null,eC(s,c),m.clear()}},[u,a,s,r,c,m]),Ir.useMemo(()=>({activeIdRef:a,hasProvider:l,delayRef:s,isInstantPhase:f}),[a,l,s,f])}import*as no from"react";function Ee(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Qt(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function ct(e){let t=Xe(tC,e).current;return t.next=e,_(t.effect),t}function tC(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}import*as cc from"react";var Hd={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ic={...Hd,position:"fixed",margin:0,top:0,left:0},y_e={...Hd,position:"absolute"};import{jsx as oC}from"react/jsx-runtime";var or=cc.forwardRef(function(t,o){let[r,n]=cc.useState();return _(()=>{if(Wu.voiceOver&&Mr.webkit)n("button")},[]),oC("span",{...t,ref:o,style:ic,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});var{min:Jr,max:rr,round:us,floor:ms}=Math,br=(e)=>({x:e,y:e}),rC={left:"right",right:"left",bottom:"top",top:"bottom"};function uc(e,t,o){return rr(e,Jr(t,o))}function Cr(e,t){return typeof e==="function"?e(t):e}function So(e){return e.split("-")[0]}function Mo(e){return e.split("-")[1]}function mc(e){return e==="x"?"y":"x"}function fs(e){return e==="y"?"height":"width"}function yo(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ps(e){return mc(yo(e))}function _d(e,t,o){if(o===void 0)o=!1;let r=Mo(e),n=ps(e),a=fs(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=ls(s);return[s,ls(s)]}function Wd(e){let t=ls(e);return[lc(e),t,lc(t)]}function lc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Vd=["left","right"],Ud=["right","left"],nC=["top","bottom"],aC=["bottom","top"];function sC(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Ud:Vd;return t?Vd:Ud;case"left":case"right":return t?nC:aC;default:return[]}}function zd(e,t,o,r){let n=Mo(e),a=sC(So(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(lc))}return a}function ls(e){let t=So(e);return rC[t]+e.slice(t.length)}function iC(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function fc(e){return typeof e!=="number"?iC(e):{top:e,right:e,bottom:e,left:e}}function Tn(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function pc(e,t){return t<0||t>=e.length}function dc(e,t){return em(e.current,{disabledIndices:t})}function Qu(e,t){return em(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Gd(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>em(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let f=r?-1:e.length;if(a&&t!==f)l=-1;else l=r?c:i,m=!0}else l=u();return{index:pc(e,l)?-1:l,wrapped:m}}function em(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&tm(e,a,r));return a}function tm(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!An(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function cC(e){return e.visibility==="hidden"||e.visibility==="collapse"}function An(e,t=e?oo(e):null){if(!e||!e.isConnected||!t||cC(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var lC='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function uC(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return Qo(o)?o.host:null}function rm(e){for(let t of Array.from(e.children))if(Ft(t)==="summary")return t;return null}function mC(e,t){let o=rm(t);return!!o&&(e===o||me(o,e))}function Zd(e){let t=e?Ft(e):"";return e!=null&&e.matches(lC)&&(t!=="summary"||e.parentElement!=null&&Ft(e.parentElement)==="details"&&rm(e.parentElement)===e)&&(t!=="details"||rm(e)==null)&&(t!=="input"||e.type!=="hidden")}function nm(e){if(!Zd(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=uC(t)){let o=t!==e,r=Ft(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Ft(t)==="details"&&!t.open&&!mC(e,t)||t.hasAttribute("hidden")||!r&&!fC(t,o))return!1}return!0}function fC(e,t){let o=oo(e);if(!t)return An(e,o);return o.display!=="none"}function $d(e){let t=e.tabIndex;if(t<0){let o=Ft(e);if(o==="details"||o==="audio"||o==="video"||je(e)&&e.isContentEditable)return 0}return t}function om(e){if(Ft(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function qd(e,t){let o=om(e);if(!o)return!0;let r=t.find((n)=>{let a=om(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=om(n);return a?.name===o.name&&a.form===o.form})===o}function jd(e){if(je(e)&&Ft(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(je(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function am(e,t){jd(e).forEach((o)=>{if(Zd(o))t.push(o);am(o,t)})}function Xd(e,t,o){jd(e).forEach((r)=>{if(je(r)&&r.matches(t))o.push(r);Xd(r,t,o)})}function ds(e){return nm(e)&&$d(e)>=0}function sm(e){let t=[];return am(e,t),t.filter(nm)}function gs(e){let t=sm(e);return t.filter((o)=>$d(o)>=0&&qd(o,t))}function Yd(e,t){let o=gs(e),r=o.length;if(r===0)return;let n=st(Ae(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function gc(e){return Yd(Ae(e).body,1)||e}function hc(e){return Yd(Ae(e).body,-1)||e}function Kd(e,t,o){if(!e)return null;let r=[];am(Ae(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(nm);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!me(o,i)&&ds(i)&&qd(i,a))return i}return r[n]}function Fr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!me(o,r)}function Jd(e){gs(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function im(e){let t=[];Xd(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function Zo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...Zo(e,n.id,o)])}function cm(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function Sr(e){return`data-base-ui-${e}`}var Ic=0;function la(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(Ic);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return Ic=s,()=>{if(Ic===s)cancelAnimationFrame(s),Ic=0}}var Qd="data-base-ui-inert",hs=new WeakMap,bc=new WeakSet,Is=new WeakMap,lm=0;function r0(e){if(!e)return null;return Qo(e)?e.host:r0(e.parentNode)}var e0=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=r0(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),t0=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},o0=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(Ft(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function pC(e,t,o,{mark:r=!0}){let n=e0(t,e),a=r?o0(t,t0(n),new Set(n)):[],s=[],i=[];if(o){let c=e0(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);o0(t,t0(u),new Set(u)).forEach((m)=>{let f=m.getAttribute("aria-hidden"),d=f!==null&&f!=="false",p=(hs.get(m)||0)+1;if(hs.set(m,p),s.push(m),p===1&&d)bc.add(m);if(!d)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Is.get(c)||0)+1;if(Is.set(c,u),i.push(c),u===1)c.setAttribute(Qd,"")});return lm+=1,()=>{if(s.forEach((c)=>{let u=(hs.get(c)||0)-1;if(hs.set(c,u),!u){if(!bc.has(c))c.removeAttribute("aria-hidden");bc.delete(c)}}),r)i.forEach((c)=>{let u=(Is.get(c)||0)-1;if(Is.set(c,u),!u)c.removeAttribute(Qd)});if(lm-=1,!lm)hs=new WeakMap,bc=new WeakSet,Is=new WeakMap}}function um(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=Ae(e[0]).body;return pC(e,n,o,{mark:r})}import*as ft from"react";import*as fm from"react-dom";var n0=500,a0=500,s0={style:{transition:"none"}},Cc="data-base-ui-click-trigger";var i0="[data-base-ui-swipe-ignore]",c0="[data-swipe-ignore]",l0={fallbackAxisSide:"none"},Sc={fallbackAxisSide:"end"},u0={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as mm,jsxs as m0}from"react/jsx-runtime";var f0=ft.createContext(null),pm=()=>ft.useContext(f0),dC=Sr("portal");function xc(e={}){let{ref:t,container:o,componentProps:r=Ue,elementProps:n}=e,a=hr(),i=pm()?.portalNode,[c,u]=ft.useState(null),[l,m]=ft.useState(null),f=re((g)=>{if(g!==null)m(g)}),d=ft.useRef(null);_(()=>{if(o===null){if(d.current)d.current=null,m(null),u(null);return}let g=(o&&(Fi(o)?o:o.current))??i??document.body;if(g==null){if(d.current)d.current=null,m(null),u(null);return}if(d.current!==g)d.current=g,m(null),u(g)},[o,i]);let p=ye("div",r,{ref:[t,f],props:[{id:a,[dC]:""},n]}),S=c&&p?fm.createPortal(p,c):null;return{node:l,nodeId:ft.isValidElement(p)?p.props.id:void 0,subtree:S}}var bs=ft.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:f}=xc({container:i,ref:o,componentProps:t,elementProps:u}),d=ft.useRef(null),p=ft.useRef(null),S=ft.useRef(null),g=ft.useRef(null),[h,b]=ft.useState(null),C=ft.useRef(!1),I=h?.modal,x=h?.open,y=!!h&&!h.modal&&h.open&&!!l;ft.useEffect(()=>{if(!l||I)return;function v(R){if(l&&R.relatedTarget&&Fr(R))if(R.type==="focusin"){if(C.current)im(l),C.current=!1}else Jd(l),C.current=!0}return Qt(Ee(l,"focusin",v,!0),Ee(l,"focusout",v,!0))},[l,I]),_(()=>{if(!l||x!==!0||!C.current)return;im(l),C.current=!1},[x,l]);let w=ft.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:S,afterInsideRef:g,portalNode:l,setFocusManagerState:b}),[l]);return m0(ft.Fragment,{children:[f,m0(f0.Provider,{value:w,children:[y&&l&&mm(or,{"data-type":"outside",ref:d,onFocus:(v)=>{if(Fr(v,l))S.current?.focus();else{let R=h?h.domReference:null;hc(R)?.focus()}}}),y&&l&&mm("span",{role:c,"aria-owns":m,style:u0}),l&&fm.createPortal(s,l),y&&l&&mm(or,{"data-type":"outside",ref:p,onFocus:(v)=>{if(Fr(v,l))g.current?.focus();else{let R=h?h.domReference:null;if(gc(R)?.focus(),h?.closeOnFocusOut)h?.onOpenChange(!1,Re(aa,v.nativeEvent))}}})]})]})});import*as Qr from"react";function wc(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class En{nodesRef={current:[]};events=wc();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as p0}from"react/jsx-runtime";var d0=Qr.createContext(null),g0=Qr.createContext(null),ko=()=>Qr.useContext(d0)?.id||null,uo=(e)=>{let t=Qr.useContext(g0);return e??t};function Cs(e){let t=hr(),o=uo(e),r=ko();return _(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function dm(e){let{children:t,id:o}=e,r=ko();return p0(d0.Provider,{value:Qr.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function gm(e){let{children:t,externalTree:o}=e,r=Xe(()=>o??new En).current;return p0(g0.Provider,{value:r,children:t})}import{jsx as h0,jsxs as gC}from"react/jsx-runtime";function hC(e,t){let o=qe(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Xr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var I0=20,en=[];function hm(){en=en.filter((e)=>e.deref()?.isConnected)}function b0(e){if(hm(),e&&Ft(e)!=="body"){if(en.push(new WeakRef(e)),en.length>I0)en=en.slice(-I0)}}function C0(){return hm(),en[en.length-1]?.deref()}function IC(e){if(!e)return null;if(ds(e))return e;return gs(e)[0]||e}function S0(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=sm(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return ds(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function Ss(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:f,beforeContentFocusGuardRef:d,externalTree:p,getInsideElements:S}=e,g=t.useState("open"),h=t.useState("domReferenceElement"),b=t.useState("floatingElement"),{events:C,dataRef:I}=t.context,x=re(()=>I.current.floatingContext?.nodeId),y=n===!1,w=is(h)&&y,v=ct(n),R=ct(a),k=ct(s),H=ct(l),E=ct(g),D=uo(p),M=pm(),P=no.useRef(!1),F=no.useRef(!1),G=no.useRef(!1),T=no.useRef(null),N=no.useRef(""),X=no.useRef(""),Y=no.useRef(null),A=no.useRef(null),ue=Uo(Y,d,M?.beforeInsideRef),V=Uo(A,M?.afterInsideRef),Z=Je(),q=Je(),se=kr(),Pe=M!=null,J=cs(b),pe=re((oe=J)=>oe?gs(oe):[]),de=re(()=>S?.().filter((oe)=>oe!=null)??[]);no.useEffect(()=>{if(r||!c)return;function oe(W){if(W.key==="Tab"){if(me(J,st(Ae(J)))&&pe().length===0&&!w)Ao(W)}}let be=Ae(J);return Ee(be,"keydown",oe)},[r,J,c,w,pe]),no.useEffect(()=>{if(r||!g)return;let oe=Ae(J);function be(){G.current=!1}function W(ee){let z=Ze(ee),ce=de(),Q=me(b,z)||me(h,z)||me(M?.portalNode,z)||ce.some((Le)=>Le===z||me(Le,z));if(G.current=!Q,X.current=ee.pointerType||"keyboard",tr(z,`[${Cc}]`))F.current=!0,q.start(0,()=>{F.current=!1})}function B(){X.current="keyboard"}return Qt(Ee(oe,"pointerdown",W,!0),Ee(oe,"pointerup",be,!0),Ee(oe,"pointercancel",be,!0),Ee(oe,"keydown",B,!0),be)},[r,b,h,J,g,M,q,de]),no.useEffect(()=>{if(r||!u)return;let oe=Ae(J);function be(){F.current=!0,q.start(0,()=>{F.current=!1})}function W(ce){let Q=Ze(ce);if(ds(Q))T.current=Q}function B(ce){let{relatedTarget:Q,currentTarget:Le}=ce,ie=Ze(ce);if(c&&Q==null&&ie!=null&&me(b,ie))b0(ie);queueMicrotask(()=>{let we=x(),L=t.context.triggerElements,U=de(),Ce=Q?.hasAttribute(Sr("focus-guard"))&&[Y.current,A.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,er(f),er(m)].includes(Q),K=!(me(h,Q)||me(b,Q)||me(Q,b)||me(M?.portalNode,Q)||U.some((ae)=>ae===Q||me(ae,Q))||L.hasMatchingElement((ae)=>me(ae,Q))||Ce||D&&(Zo(D.nodesRef.current,we).find((ae)=>me(ae.context?.elements.floating,Q)||me(ae.context?.elements.domReference,Q))||cm(D.nodesRef.current,we).find((ae)=>[ae.context?.elements.floating,cs(ae.context?.elements.floating)].includes(Q)||ae.context?.elements.domReference===Q)));if(Le===h&&J)S0(J);if(i&&Le!==h&&!An(ie)&&st(oe)===oe.body){if(je(J)){if(J.focus(),i==="popup"){se.request(()=>{J.focus()});return}}let ae=pe(),ge=T.current,he=(ge&&ae.includes(ge)?ge:null)||ae[ae.length-1]||J;if(je(he))he.focus()}if(I.current.insideReactTree){I.current.insideReactTree=!1;return}if((w?!0:!c)&&Q&&K&&!F.current&&(w||Q!==C0()))P.current=!0,t.setOpen(!1,Re(aa,ce))})}function ee(){if(G.current)return;I.current.insideReactTree=!0,Z.start(0,()=>{I.current.insideReactTree=!1})}let z=je(h)?h:null;if(!b&&!z)return;return Qt(z&&Ee(z,"focusout",B),z&&Ee(z,"pointerdown",be),b&&Ee(b,"focusin",W),b&&Ee(b,"focusout",B),b&&M&&Ee(b,"focusout",ee,!0))},[r,h,b,J,c,D,M,t,u,i,pe,w,x,I,Z,q,se,m,f,de]),no.useEffect(()=>{if(r||!b||!g)return;let oe=Array.from(M?.portalNode?.querySelectorAll(`[${Sr("portal")}]`)||[]),W=(D?cm(D.nodesRef.current,x()):[]).find((Le)=>is(Le.context?.elements.domReference||null))?.context?.elements.domReference,ee=[...[b,...oe,Y.current,A.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...de()],W,er(f),er(m),w?h:null].filter((Le)=>Le!=null),z=um(ee,{ariaHidden:c||w,mark:!1}),ce=[b,...oe].filter((Le)=>Le!=null),Q=um(ce);return()=>{Q(),z()}},[g,r,h,b,c,M,w,D,x,m,f,de]),_(()=>{if(!g||r||!je(J))return;N.current="",X.current="";let oe=Ae(J),be=st(oe);queueMicrotask(()=>{let W=v.current,B=typeof W==="function"?W(H.current||""):W;if(B===void 0||B===!1)return;if(me(J,be))return;let z=null,ce=()=>{if(z==null)z=pe(J);return z[0]||J},Q;if(B===!0||B===null)Q=ce();else Q=er(B);Q=Q||ce();let Le=me(J,st(oe)),ie=I.current.openEvent,we=ie?.type==="mousedown"&&Xr(ie);la(Q,{sync:we,preventScroll:Q===J,shouldFocus(){if(!E.current)return!1;if(Le)return!0;let L=st(oe);return!(L!==Q&&me(J,L))}})})},[r,g,J,pe,v,H,E,I]);let fe=no.useRef(null);_(()=>{if(r||!J){fe.current=null;return}if(fe.current)fe.current.cancelled=!0,fe.current=null;let oe=Ae(J),be=st(oe),W=H.current==null;b0(be);function B(z){if(!z.open)N.current=hC(z.nativeEvent,X.current);if(z.reason===aa&&z.triggerElement?.hasAttribute(Sr("focus-guard"))||z.reason===jt&&z.nativeEvent.type==="mouseleave")P.current=!0;if(z.reason!==Fu)return;if(z.nested)P.current=!1;else if(Xr(z.nativeEvent)||ca(z.nativeEvent))P.current=!1;else{let ce=!1;if(Ae(J).createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce)P.current=!1;else P.current=!0}}C.on("openchange",B);function ee(z){let ce=R.current,Q=typeof ce==="function"?ce(z):ce;if(Q===void 0||Q===!1)return null;if(Q===null)Q=!0;let Le=h?.isConnected?h:null,ie=be?.isConnected&&Ft(be)!=="body"?be:null,we=W?ie||Le:Le||ie;if(!we)we=C0()||null;if(typeof Q==="boolean")return we;return er(Q)||we||null}return()=>{C.off("openchange",B);let z=st(oe),ce=de(),Q=me(b,z)||ce.some((U)=>U===z||me(U,z))||D&&Zo(D.nodesRef.current,x(),!1).some((U)=>me(U.context?.elements.floating,z)),Le=R.current,ie=N.current,we=ee(ie),L={cancelled:!1};fe.current=L,queueMicrotask(()=>{if(fe.current===L)fe.current=null;let U=IC(we),Ce=k.current??typeof Le!=="boolean";if(!L.cancelled&&Le&&!P.current&&je(U)&&(!Ce&&U!==z&&z!==oe.body?Q:!0)){let K={preventScroll:!0};if(ie==="keyboard")K.focusVisible=!0;U.focus(K)}P.current=!1})}},[r,b,J,R,k,H,C,D,h,x,de]),_(()=>{if(!Mr.webkit||g||!b)return;let oe=st(Ae(b));if(!je(oe)||!Lr(oe))return;if(me(b,oe))oe.blur()},[g,b]),_(()=>{if(r||!M)return;return M.setFocusManagerState({modal:c,closeOnFocusOut:u,open:g,onOpenChange:t.setOpen,domReference:h}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,u,h]),_(()=>{if(r||!J)return;return S0(J),()=>{queueMicrotask(hm)}},[r,J]);let Se=!r&&(c?!w:!0)&&(Pe||c);return gC(no.Fragment,{children:[Se&&h0(or,{"data-type":"inside",ref:ue,onFocus:(oe)=>{if(c){let be=pe();la(be[be.length-1])}else if(M?.portalNode)if(P.current=!1,Fr(oe,M.portalNode))gc(h)?.focus();else er(f??M.beforeOutsideRef)?.focus()}}),o,Se&&h0(or,{"data-type":"inside",ref:V,onFocus:(oe)=>{if(c)la(pe()[0]);else if(M?.portalNode){if(u)P.current=!0;if(Fr(oe,M.portalNode))hc(h)?.focus();else er(m??M.afterOutsideRef)?.focus()}}})]})}import*as xs from"react";function ws(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=ra}=t,u=e.context.dataRef,l=xs.useRef(void 0),m=kr(),f=Je(),d=xs.useMemo(()=>{function p(g,h,b,C){let I=Re(c,h,b);if(g&&C==="touch"&&i>0)f.start(i,()=>{e.setOpen(!0,I)});else e.setOpen(g,I)}function S(g,h,b){let C=u.current.openEvent,I=e.select("domReferenceElement")!==h;if(g&&I)return!0;if(!g)return!0;if(!n)return!0;if(C&&(typeof s==="function"?s():s))return!b(C.type);return!1}return{onPointerDown(g){l.current=Eo(g.pointerType,!0)&&ca(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){let h=l.current,b=g.nativeEvent,C=e.select("open");if(g.button!==0||r==="click"||Eo(h,!0)&&a)return;let I=S(C,g.currentTarget,(v)=>v==="click"||v==="mousedown"),x=Ze(b),y=Lr(x);if(y||h==="virtual"){p(I,b,y?x:g.currentTarget,h);return}let w=g.currentTarget;m.request(()=>{p(I,b,w,h)})},onClick(g){if(r==="mousedown-only")return;let h=l.current;if(r==="mousedown"&&h){l.current=void 0;return}if(Eo(h,!0)&&a)return;let b=e.select("open"),C=S(b,g.currentTarget,(I)=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");p(C,g.nativeEvent,g.currentTarget,h)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,f,i]);return xs.useMemo(()=>o?{reference:d}:Ue,[o,d])}import*as vo from"react";function bC(e,t){let o=null,r=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},s=t.axis==="x"||t.axis==="both",i=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",u=t.axis==="y"?a.width:0,l=t.axis==="x"?a.height:0,{x:m,y:f}=a;if(o==null&&t.x&&s)o=a.x-t.x;if(r==null&&t.y&&i)r=a.y-t.y;if(m-=o||0,f-=r||0,!n||c)m=s&&t.x!=null?t.x:m,f=i&&t.y!=null?t.y:f;return n=!0,{width:u,height:l,x:m,y:f,top:f,right:m+u,bottom:f+l,left:m}}}}function x0(e){return e!=null&&e.clientX!=null}function Im(e,t={}){let{enabled:o=!0,axis:r="both"}=t,n=e.useState("open"),a=e.useState("floatingElement"),s=e.useState("domReferenceElement"),i=e.context.dataRef,c=vo.useRef(!1),u=vo.useRef(null),[l,m]=vo.useState(),[f,d]=vo.useState([]),p=re((C)=>{e.set("positionReference",C)}),S=re((C,I,x)=>{if(c.current)return;if(i.current.openEvent&&!x0(i.current.openEvent))return;e.set("positionReference",bC(x??s,{x:C,y:I,axis:r,dataRef:i,pointerType:l}))}),g=re((C)=>{if(!n)S(C.clientX,C.clientY,C.currentTarget);else if(!u.current)S(C.clientX,C.clientY,C.currentTarget),d([])}),h=Eo(l)?a:n;vo.useEffect(()=>{if(!o){p(s);return}if(!h)return;function C(){u.current?.(),u.current=null}let I=qe(a);function x(y){let w=Ze(y);if(!me(a,w))S(y.clientX,y.clientY);else C()}if(!i.current.openEvent||x0(i.current.openEvent))u.current=Ee(I,"mousemove",x);else p(s);return C},[h,o,a,i,s,e,S,p,f]),vo.useEffect(()=>()=>{e.set("positionReference",null)},[e]),vo.useEffect(()=>{if(o&&!a)c.current=!1},[o,a]),vo.useEffect(()=>{if(!o&&n)c.current=!0},[o,n]);let b=vo.useMemo(()=>{function C(I){m(I.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:g,onMouseEnter:g}},[g]);return vo.useMemo(()=>o?{reference:b,trigger:b}:{},[o,b])}import*as mo from"react";function CC(){return!1}function SC(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Mn(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=CC,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:f}=e.context,d=uo(c),p=re(typeof n==="function"?n:()=>!1),S=typeof n==="function"?p:n,g=S!==!1,h=re(()=>a),{escapeKey:b,outsidePress:C}=SC(i),I=mo.useRef(!1),x=mo.useRef(!1),y=mo.useRef(!1),w=mo.useRef(!1),v=mo.useRef(!1),R=mo.useRef(""),k=mo.useRef(null),H=Je(),E=Je(),D=Je(),M=re(()=>{E.clear(),m.current.insideReactTree=!1}),P=re((V)=>{let Z=m.current.floatingContext?.nodeId;return(d?Zo(d.nodesRef.current,Z):[]).some((se)=>se.context?.open&&!se.context.dataRef.current[V])}),F=re((V)=>ac(V,e.select("floatingElement"))||ac(V,e.select("domReferenceElement"))),G=re((V)=>{if(!s())return;e.setOpen(!1,Re(ra,V.nativeEvent))}),T=re((V)=>{if(!u||!o||!r||V.key!=="Escape")return;let Z=Dd(V)?V.nativeEvent:V;if(v.current||Z.isComposing)return;if(!b&&P("__escapeKeyBubbles"))return;let q=Re(qi,Z);if(e.setOpen(!1,q),!q.isCanceled)V.preventDefault();if(!b&&!q.isPropagationAllowed)V.stopPropagation()}),N=re(()=>{m.current.insideReactTree=!0,E.start(0,M)}),X=re((V)=>{if(!u||!o||V.button!==0)return;let Z=Ze(V.nativeEvent);if(!me(e.select("floatingElement"),Z))return;if(!I.current)I.current=!0,x.current=!1}),Y=re((V)=>{if(!u||!o)return;if(!(V.defaultPrevented||V.nativeEvent.defaultPrevented))return;if(I.current)x.current=!0});mo.useEffect(()=>{function V(Z){if(!Z.open)w.current=!1}return f.on("openchange",V),()=>{f.off("openchange",V)}},[f]),mo.useEffect(()=>M,[M]),mo.useEffect(()=>{if(!u||!o){if(!u)w.current=!1,v.current=!1,R.current="",k.current=null;return M}m.current.__escapeKeyBubbles=b,m.current.__outsidePressBubbles=C;let V=new Jt,Z=Ae(l);function q(){D.clear(),v.current=!0}function se(){v.current=!0,D.start(Mr.webkit?5:0,()=>{v.current=!1})}function Pe(){y.current=!0,V.start(0,()=>{y.current=!1})}function J(){I.current=!1,x.current=!1}function pe(){let L=R.current,U=L==="pen"||!L?"mouse":L,Ce=h(),K=typeof Ce==="function"?Ce():Ce;if(typeof K==="string")return K;return K[U]}function de(L){let U=pe();return U==="intentional"&&L.type!=="click"||U==="sloppy"&&L.type==="click"}function fe(L){let U=m.current.floatingContext?.nodeId,Ce=d&&Zo(d.nodesRef.current,U).some((K)=>ac(L,K.context?.elements.floating));return F(L)||Ce}function Se(L){if(de(L)){if(L.type!=="click"&&!F(L))V.clear(),y.current=!1;M();return}if(m.current.insideReactTree){M();return}let U=Ze(L),Ce=`[${Sr("inert")}]`,K=Ve(U)?U.getRootNode():null,ae=Array.from((Qo(K)?K:Ae(e.select("floatingElement"))).querySelectorAll(Ce)),ge=e.context.triggerElements;if(U&&(ge.hasElement(U)||ge.hasMatchingElement((Ie)=>me(Ie,U))))return;let he=Ve(U)?U:null;while(he&&!Wo(he)){let Ie=_o(he);if(Wo(Ie)||!Ve(Ie))break;he=Ie}if(ae.length&&Ve(U)&&!Nd(U)&&!me(U,e.select("floatingElement"))&&ae.every((Ie)=>!me(he,Ie)))return;if(je(U)&&!("touches"in L)){let Ie=Wo(U),Oe=oo(U),Qe=/auto|scroll/,dt=Ie||Qe.test(Oe.overflowX),ho=Ie||Qe.test(Oe.overflowY),Io=dt&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,jo=ho&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,eo=Oe.direction==="rtl",Xt=jo&&(eo?L.offsetX<=U.offsetWidth-U.clientWidth:L.offsetX>U.clientWidth),xo=Io&&L.offsetY>U.clientHeight;if(Xt||xo)return}if(fe(L))return;if(pe()==="intentional"){if(L.detail!==0&&!Xr(L)&&!w.current)return;if(y.current){V.clear(),y.current=!1;return}}if(typeof S==="function"&&!S(L))return;if(P("__outsidePressBubbles"))return;e.setOpen(!1,Re(Fu,L)),M()}function oe(L){if(pe()!=="sloppy"||L.pointerType==="touch"||!e.select("open")||!o||F(L))return;Se(L)}function be(L){if(pe()!=="sloppy"||!e.select("open")||!o||F(L))return;let U=L.touches[0];if(U)k.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1000,()=>{if(k.current)k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1})}function W(L,U){let Ce=Ze(L);if(!Ce)return;let K=Ee(Ce,L.type,()=>{U(L),K()})}function B(L){R.current="touch",W(L,be)}function ee(L){if(H.clear(),L.type==="pointerdown"){if(L.button===0)w.current=!0;R.current=L.pointerType}if(L.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)return;W(L,(U)=>{if(U.type==="pointerdown")oe(U);else Se(U)})}function z(L){if(L.type==="pointercancel")w.current=!1;if(!I.current)return;let U=x.current;if(J(),pe()!=="intentional")return;if(L.type==="pointercancel"){if(U)Pe();return}if(fe(L))return;if(U){Pe();return}if(typeof S==="function"&&!S(L))return;V.clear(),y.current=!0,M()}function ce(L){if(pe()!=="sloppy"||!k.current||F(L))return;let U=L.touches[0];if(!U)return;let Ce=Math.abs(U.clientX-k.current.startX),K=Math.abs(U.clientY-k.current.startY),ae=Math.sqrt(Ce*Ce+K*K);if(ae>5)k.current.dismissOnTouchEnd=!0;if(ae>10)Se(L),H.clear(),k.current=null}function Q(L){W(L,ce)}function Le(L){if(pe()!=="sloppy"||!k.current||F(L))return;if(k.current.dismissOnTouchEnd)Se(L);H.clear(),k.current=null}function ie(L){W(L,Le)}let we=Qt(r&&Qt(Ee(Z,"keydown",T),Ee(Z,"compositionstart",q),Ee(Z,"compositionend",se)),g&&Qt(Ee(Z,"click",ee,!0),Ee(Z,"pointerdown",ee,!0),Ee(Z,"pointerup",z,!0),Ee(Z,"pointercancel",z,!0),Ee(Z,"mousedown",ee,!0),Ee(Z,"mouseup",z,!0),Ee(Z,"touchstart",B,{capture:!0,passive:!0}),Ee(Z,"touchmove",Q,{capture:!0,passive:!0}),Ee(Z,"touchend",ie,{capture:!0,passive:!0})));return()=>{we(),V.clear(),J(),y.current=!1}},[m,l,r,g,S,u,o,b,C,T,M,h,P,F,d,e,H,D]);let A=mo.useMemo(()=>({onKeyDown:T,onPointerDown:G,onClick:G}),[T,G]),ue=mo.useMemo(()=>({onKeyDown:T,onPointerDown:Y,onMouseDown:Y,onClickCapture:N,onMouseDownCapture(V){N(),X(V)},onPointerDownCapture(V){N(),X(V)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[T,N,X,Y]);return mo.useMemo(()=>o?{reference:A,floating:ue,trigger:A}:{},[o,A,ue])}import*as Cm from"react";import*as v0 from"react-dom";function ys(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),_(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(Ve(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as bm from"react";function w0(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=re(n),{mounted:c,setMounted:u,transitionStatus:l}=oc(t,!1,!1,s),m=t?!1:r;_(()=>{if(t)i(!1)},[t,i]);let f=bm.useRef(c),d=bm.useRef(!1),p=Ji(),S=()=>{f.current=!1,u(!1),a()};_(()=>{if(f.current=c,d.current){if(d.current=!1,!t&&c)S()}});let g=re(()=>{if(!f.current)return;if(t){d.current=!0,p();return}S()});return Go({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)g()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:g}}var ua={tabIndex:-1,[rs]:""};function R0(e){return(t)=>t==="touch"?e.current:!0}function yc(e,t=!1){let o=hr(),r=ko()!=null,n=Xe(()=>e(o,r)).current;return ys({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function ma({handle:e,store:t}){return _(()=>e.attachStore(t),[e,t]),null}function y0(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function xC(e,t){let o=Cm.useRef(null);return re((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),y0(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),y0(t)})}function vs(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function Sm(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function P0(e,t,o,r={}){let n=o.reason,a=n===jt,s=t&&n===na,i=!t&&(n===ra||n===qi),c=Sm(o);if(e.context.onOpenChange?.(t,o),o.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,o);let u=()=>{let l=vs(e.state,t,o.trigger,c()),m={...r.extraState,...l};if(s)m.instantType="focus";else if(i)m.instantType="dismiss";else if(a)m.instantType=void 0;e.update(m)};if(a)v0.flushSync(u);else u()}function fa(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=xC(e,o),s=re((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=re((c)=>{if(a(c),c)s(c)});return _(()=>(i(t.current),()=>i(null)),[i,t,o,e]),_(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function pa(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=Cm.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");_(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let f=e.context.triggerElements.getById(l);if(!f){for(let[d,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){u.activeTriggerId=d,u.activeTriggerElement=p,r.current=d;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,f!==e.state.activeTriggerElement)u.activeTriggerElement=f}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let f=e.context.triggerElements.entries().next();if(!f.done){let[d,p]=f.value;u.activeTriggerId=d,u.activeTriggerElement=p,r.current=d}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let f=Re(yn);if(e.setOpen(!1,f),!f.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function da(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=w0({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return Xe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function ga(e,t){e.useSyncedValues(t),_(()=>()=>{e.update({activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue})},[e])}function T0(e,t){_(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),_(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class kn{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Rm=up(vc(),1);import*as k0 from"react";import*as tn from"react";var DC=vc();function FC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var OC=typeof Object.is==="function"?Object.is:FC,NC=DC.useSyncExternalStore,BC=tn.useRef,HC=tn.useEffect,VC=tn.useMemo,UC=tn.useDebugValue;var wm=function(e,t,o,r,n){var a=BC(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=VC(function(){function c(d){if(!u){if(u=!0,l=d,d=r(d),n!==void 0&&s.hasValue){var p=s.value;if(n(p,d))return m=p}return m=d}if(p=m,OC(l,d))return p;var S=r(d);if(n!==void 0&&n(p,S))return l=d,p;return l=d,m=S}var u=!1,l,m,f=o===void 0?null:o;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,o,r,n]);var i=NC(e,a[0],a[1]);return HC(function(){s.hasValue=!0,s.value=i},[i]),UC(i),i};import*as A0 from"react";var ym=[],vm=void 0;function E0(){return vm}function M0(e){ym.push(e)}function Ln(e){let t=(o,r)=>{let n=Xe(_C).current,a;try{vm=n;for(let s of ym)s.before(n);a=e(o,r);for(let s of ym)s.after(n);n.didInitialize=!0}finally{vm=void 0}return a};return t.displayName=e.displayName||e.name,t}function ha(e){return A0.forwardRef(Ln(e))}function _C(){return{didInitialize:!1}}var WC=Xn(19),zC=WC?ZC:$C;function Rc(e,t,o,r,n){return zC(e,t,o,r,n)}function GC(e,t,o,r,n){let a=k0.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return Rm.useSyncExternalStore(e.subscribe,a,a)}M0({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};Rm.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function ZC(e,t,o,r,n){let a=E0();if(!a)return GC(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function $C(e,t,o,r,n){return wm(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class Pm{static create(e){return new this(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 o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return Rc(this,e,t,o,r)}}import*as Dn from"react";class ar extends Pm{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){Dn.useDebugValue(e);let o=this;_(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;_(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);_(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){Dn.useDebugValue(e);let o=this,r=t!==void 0;_(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return Dn.useDebugValue(e),Rc(this,this.selectors[e],t,o,r)}useContextCallback(e,t){Dn.useDebugValue(e);let o=re(t??Ye);this.context[e]=o}useStateSetter(e){let t=Dn.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var qC={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class Tm extends ar{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:wc(),nested:o,triggerElements:n},qC);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Fd(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Ia(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Tm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue}}var Rs=(e)=>e.triggerIdProp??e.activeTriggerId,Pc=(e)=>e.openProp??e.open,L0=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function D0(e,t){return t!==void 0&&Pc(e)&&Rs(e)===t}function jC(e,t){if(D0(e,t))return!0;return t!==void 0&&Pc(e)&&Rs(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var on={open:Pc,mounted:(e)=>e.mounted,transitionStatus:(e)=>Pc(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:Rs,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:L0,isTriggerActive:(e,t)=>t!==void 0&&Rs(e)===t,isOpenedByTrigger:(e,t)=>D0(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Rs(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>jC(e,t)?L0(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var F0=up(vc(),1);import*as Am from"react";function ba(e){let t=Am.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=Am.useCallback(()=>e===void 0?void 0:e.store,[e]);return F0.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as xr from"react";var Em=Er.mac&&Mr.webkit;function Ps(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=xr.useRef(!1),i=xr.useRef(null),c=xr.useRef(!0),u=Je();xr.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let f=qe(m);function d(){let g=e.select("domReferenceElement");if(!e.select("open")&&je(g)&&g===st(Ae(g)))s.current=!0,i.current=g}function p(){c.current=!0}function S(){c.current=!1}return Qt(Ee(f,"blur",d),Em&&Ee(f,"keydown",p,!0),Em&&Ee(f,"pointerdown",S,!0))},[e,o]),xr.useEffect(()=>{if(!o)return;function m(f){if(f.reason===ra||f.reason===qi){let d=e.select("domReferenceElement");if(Ve(d))i.current=d,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=xr.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(f){let d=f.currentTarget;if(s.current){if(i.current===d)return;m()}let p=Ze(f.nativeEvent);if(Ve(p)){if(Em&&!f.relatedTarget){if(!c.current&&!Lr(p))return}else if(!Kr(p))return}let S=Yr(f.relatedTarget,e.context.triggerElements),{nativeEvent:g,currentTarget:h}=f;if(e.select("open")&&S||!r){e.setOpen(!0,Re(na,g,h));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Re(na,g,h))})},onBlur(f){m();let{relatedTarget:d,nativeEvent:p}=f,S=Ve(d)&&d.hasAttribute(Sr("focus-guard"))&&d.getAttribute("data-type")==="outside";u.start(0,()=>{let g=e.select("domReferenceElement"),h=st(Ae(g));if(!d&&h===g)return;if(me(a.current.floatingContext?.refs.floating.current,h)||me(g,h)||S)return;if(Yr(d??h,e.context.triggerElements))return;e.setOpen(!1,Re(na,p))})}}},[a,r,e,u]);return xr.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as km from"react";class Mm{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Jt;restTimeout=new Jt;handleCloseOptions=void 0;static create(){return new Mm}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var Tc=new WeakMap;function Ca(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Tc.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Tc.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ac(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=Tc.get(o);if(a&&a!==e)Ca(a);Ca(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Tc.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function Sa(e){let t=e.context.dataRef.current,o=Xe(()=>t.hoverInteractionState??Mm.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return jr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ts(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=uo(),l=ko(),m=Sa(e),f=Je(),d=re(()=>sc(c.current.openEvent?.type,m.interactedInside)),p=re(()=>Bd(c.current.openEvent?.type)),S=re(()=>{Ca(m)});_(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S()},[a,m,S]),km.useEffect(()=>S,[S]),_(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&p()&&Ve(i)&&s){let g=i,h=s,b=Ae(s),C=u?.nodesRef.current.find((w)=>w.id===l)?.context?.elements.floating;if(C)C.style.pointerEvents="";let I=m.pointerEventsScopeElement!==h?m.pointerEventsScopeElement:null,x=C!==h?C:null,y=m.handleCloseOptions?.getScope?.()??I??x??tr(g,"[data-rootownerid]")??b.body;return Ac(m,{scopeElement:y,referenceElement:g,floatingElement:h}),()=>{S()}}return},[o,a,i,s,m,p,u,l,S]),km.useEffect(()=>{if(!o)return;function g(){return!!(u&&l&&Zo(u.nodesRef.current,l).length>0)}function h(w){let v=Dr(r,"close",m.pointerType),R=()=>{e.setOpen(!1,Re(jt,w)),u?.events.emit("floating.closed",w)};if(v)m.openChangeTimeout.start(v,R);else m.openChangeTimeout.clear(),R()}function b(w){let v=Ze(w);if(!Yu(v)){m.interactedInside=!1;return}m.interactedInside=tr(v,"[aria-haspopup]")!=null}function C(){m.openChangeTimeout.clear(),f.clear(),u?.events.off("floating.closed",x),S()}function I(w){if(g()&&u){u.events.on("floating.closed",x);return}if(Yr(w.relatedTarget,e.context.triggerElements))return;let v=c.current.floatingContext?.nodeId??n,R=w.relatedTarget;if(u&&v&&Ve(R)&&Zo(u.nodesRef.current,v,!1).some((H)=>me(H.context?.elements.floating,R)))return;if(m.handler){m.handler(w);return}if(S(),p()&&!d())h(w)}function x(w){if(!u||!l||g())return;f.start(0,()=>{u.events.off("floating.closed",x),e.setOpen(!1,Re(jt,w)),u.events.emit("floating.closed",w)})}let y=s;return Qt(y&&Ee(y,"mouseenter",C),y&&Ee(y,"mouseleave",I),y&&Ee(y,"pointerdown",b,!0),()=>{u?.events.off("floating.closed",x)})},[o,s,e,c,r,n,p,d,S,m,u,l,f])}import*as rn from"react";import*as O0 from"react-dom";var XC={current:null};function As(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=XC,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:f,shouldOpen:d,guardStaleOpen:p=!1}=t,{dataRef:S,events:g}=e.context,h=uo(u),b=Sa(e),C=rn.useRef(!1),I=ct(n),x=ct(r),y=ct(s),w=ct(o),v=ct(d),R=ct(f),k=re(()=>sc(S.current.openEvent?.type,b.interactedInside)),H=re(()=>v.current?.()!==!1),E=re((P,F,G)=>{let T=e.context.triggerElements;if(T.hasElement(F))return!P||!me(P,F);if(!Ve(G))return!1;let N=G;return T.hasMatchingElement((X)=>me(X,N))&&(!P||!me(P,N))}),D=re(()=>{if(!b.handler)return;Ae(e.select("domReferenceElement")).removeEventListener("mousemove",b.handler),b.handler=void 0}),M=re(()=>{Ca(b)});if(l)b.handleCloseOptions=n?.__options;return rn.useEffect(()=>D,[D]),rn.useEffect(()=>{if(!o)return;function P(F){if(!F.open)C.current=F.reason===jt,D(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1;else C.current=!1}return g.on("openchange",P),()=>{g.off("openchange",P)}},[o,g,b,D]),rn.useEffect(()=>{if(!o)return;function P(Y,A=!0){let ue=Dr(x.current,"close",b.pointerType);if(ue)b.openChangeTimeout.start(ue,()=>{e.setOpen(!1,Re(jt,Y)),h?.events.emit("floating.closed",Y)});else if(A)b.openChangeTimeout.clear(),e.setOpen(!1,Re(jt,Y)),h?.events.emit("floating.closed",Y)}let F=c.current??(l?e.select("domReferenceElement"):null);if(!Ve(F))return;function G(Y){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!Eo(b.pointerType))return;let A=Ku(y.current),ue=Dr(x.current,"open",b.pointerType),V=Ze(Y),Z=Y.currentTarget??null,q=e.select("domReferenceElement"),se=Z;if(Ve(V)&&!e.context.triggerElements.hasElement(V)){for(let W of e.context.triggerElements.elements())if(me(W,V)){se=W;break}}if(Ve(Z)&&Ve(q)&&!e.context.triggerElements.hasElement(Z)&&me(Z,q))se=q;let Pe=se==null?!1:E(q,se,V),J=e.select("open"),pe=R.current?.()??e.select("transitionStatus")==="ending",de=!J&&pe&&C.current,fe=!Pe&&Ve(se)&&Ve(q)&&me(q,se)&&de,Se=A>0&&!ue,oe=Pe&&(J||de)||fe,be=!J||Pe;if(oe){if(H())e.setOpen(!0,Re(jt,Y,se));return}if(Se)return;if(ue)b.openChangeTimeout.start(ue,()=>{if(be&&H())e.setOpen(!0,Re(jt,Y,se))});else if(be){if(H())e.setOpen(!0,Re(jt,Y,se))}}function T(Y){if(k()){M();return}D();let A=e.select("domReferenceElement"),ue=Ae(A);b.restTimeout.clear(),b.restTimeoutPending=!1;let V=S.current.floatingContext??m?.();if(Yr(Y.relatedTarget,e.context.triggerElements))return;if(I.current&&V){if(!e.select("open"))b.openChangeTimeout.clear();let q=c.current;b.handler=I.current({...V,tree:h,x:Y.clientX,y:Y.clientY,onClose(){if(M(),D(),w.current&&!k()&&q===e.select("domReferenceElement"))P(Y,!0)}}),ue.addEventListener("mousemove",b.handler),b.handler(Y);return}if(b.pointerType==="touch"?!me(e.select("floatingElement"),Y.relatedTarget):!0)P(Y)}function N(Y){if(me(F,Y.relatedTarget))return;b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1}let X=p?Ee(F,"mouseout",N):void 0;if(i)return Qt(Ee(F,"mousemove",G,{once:!0}),Ee(F,"mouseenter",G),Ee(F,"mouseleave",T),X);return Qt(Ee(F,"mouseenter",G),Ee(F,"mouseleave",T),X)},[D,M,S,x,e,o,I,b,l,E,k,a,i,y,c,h,w,m,R,H,p]),rn.useMemo(()=>{if(!o)return;function P(F){b.pointerType=F.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(F){let{nativeEvent:G}=F,T=F.currentTarget,N=e.select("domReferenceElement"),X=e.select("open"),Y=E(N,T,F.target);if(a&&!Eo(b.pointerType))return;if(X&&Y&&b.handleCloseOptions?.blockPointerEvents){let V=e.select("floatingElement");if(V){let Z=b.handleCloseOptions?.getScope?.()??T.ownerDocument.body;Ac(b,{scopeElement:Z,referenceElement:T,floatingElement:V})}}let A=Ku(y.current);if(X&&!Y||A===0)return;if(!Y&&b.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;b.restTimeout.clear();function ue(){if(b.restTimeoutPending=!1,k())return;let V=e.select("open");if(!b.blockMouseMove&&(!V||Y)&&H())e.setOpen(!0,Re(jt,G,T))}if(b.pointerType==="touch")O0.flushSync(()=>{ue()});else if(Y&&X)ue();else b.restTimeoutPending=!0,b.restTimeout.start(A,ue)}}},[o,b,k,E,a,e,y,H])}import*as ao from"react";function N0(e){return Mr.webkit&&e.movementX===0&&e.movementY===0}function Mc(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Ec(e,t){return Mc(t,e===Xu||e===nc,e===ns||e===as)}function Lm(e,t,o){return Mc(t,e===nc,o?e===ns:e===as)||e==="Enter"||e===" "||e===""}function YC(e,t,o){return Mc(t,o?e===ns:e===as,e===nc)}function KC(e,t,o,r){let n=o?e===as:e===ns,a=e===Xu;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return Mc(t,n,a)}function Dm(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:f="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:p=!0,disabledIndices:S=void 0,orientation:g="vertical",triggerOrientation:h=g,parentOrientation:b,id:C,resetOnPointerLeave:I=!0,externalTree:x,nestedReturnFocusRef:y,grid:w}=t,v=w!=null,R=e.useState("open"),k=e.useState("floatingElement"),H=e.useState("domReferenceElement"),E=e.context.dataRef,D=cs(k),M=is(H),P=ct(D),F=ko(),G=uo(x),T=ao.useRef(f),N=ao.useRef(s??-1),X=ao.useRef(null),Y=ao.useRef(!0),A=re((L)=>{n(N.current===-1?null:N.current,L)}),ue=ao.useRef(!!k),V=ao.useRef(R),Z=ao.useRef(!1),q=ao.useRef(!1),se=ao.useRef(null),Pe=ct(S),J=ct(R),pe=ct(s),de=ct(I),fe=kr(),Se=kr(),oe=re(()=>{fe.cancel();function L(ae){if(!m)se.current=la(ae,{sync:Z.current,preventScroll:!0})}let U=o.current[N.current],Ce=q.current;if(U)L(U);(Z.current?(ae)=>ae():(ae)=>fe.request(ae))(()=>{let ae=o.current[N.current]||U;if(!ae)return;if(!U)L(ae);if(ce&&(Ce||!Y.current))ae.scrollIntoView?.({block:"nearest",inline:"nearest"})})});_(()=>{E.current.orientation=g},[E,g]),_(()=>{if(!R)X.current=null;if(!R||f!=="auto")T.current=f},[R,f]),_(()=>{if(!a)return;if(R&&k){if(N.current=s??-1,T.current&&s!=null)q.current=!0,A()}else if(ue.current)N.current=-1,A()},[a,R,k,s,A]),_(()=>{if(!a)return;if(!R){Z.current=!1;return}if(!k)return;if(r==null){if(Z.current=!1,pe.current!=null)return;if(ue.current)N.current=-1,oe();if((!V.current||!ue.current)&&T.current&&(X.current!=null||T.current===!0&&X.current==null)){let L=0,U=()=>{if(o.current[0]==null){if(L<2)(L?(K)=>Se.request(K):queueMicrotask)(U);L+=1}else N.current=X.current==null||Lm(X.current,h,l)||u?dc(o):Qu(o),X.current=null,A()};U()}}else if(!pc(o.current,r))N.current=r,oe(),q.current=!1},[a,R,k,r,pe,u,o,h,l,A,oe,Se]),_(()=>{if(!a||k||!G||m||!ue.current)return;let L=G.nodesRef.current,U=L.find((ae)=>ae.id===F)?.context?.elements.floating,Ce=st(Ae(H??U??null)),K=L.some((ae)=>ae.context&&me(ae.context.elements.floating,Ce));if(U&&!K&&Y.current)U.focus({preventScroll:!0})},[a,k,H,G,F,m]),_(()=>{V.current=R,ue.current=!!k});let be=r!=null,W=re((L)=>{if(!J.current)return;let U=o.current.indexOf(L.currentTarget);if(U!==-1&&(N.current!==U||r!==U))N.current=U,A(L)}),B=re(()=>b??G?.nodesRef.current.find((L)=>L.id===F)?.context?.dataRef?.current.orientation),ee=re(()=>dc(o,Pe.current)),z=re((L)=>{if(Y.current=!1,Z.current=!0,L.which===229)return;if(!J.current&&L.currentTarget===P.current)return;if(u&&KC(L.key,g,l,v)){if(!Ec(L.key,B()))Ao(L);e.setOpen(!1,Re(ji,L.nativeEvent));let ae=y?.current??H;if(je(ae))ae.focus();return}if(r!=null&&r!==N.current&&!pc(o.current,r))N.current=r;let U=N.current,Ce=dc(o,S),K=Qu(o,S);if(!M){if(L.key==="Home")Ao(L),N.current=Ce,A(L);if(L.key==="End")Ao(L),N.current=K,A(L)}if(w!=null){let ae=w(L,N.current,o,g,c,l,S,Ce,K);if(ae!=null&&ae!==N.current)N.current=ae,A(L);if(g==="both")return}if(Ec(L.key,g)){Ao(L);let ae=st(L.currentTarget.ownerDocument);if(R&&!m&&me(L.currentTarget,ae)&&!o.current.some((Ie)=>Ie!=null&&me(Ie,ae))){if(N.current=Lm(L.key,g,l)?Ce:K,A(L),r===N.current)oe();return}let{index:ge,wrapped:he}=Gd(o.current,U,{decrement:!Lm(L.key,g,l),loopFocus:c,allowEscape:i,disabledIndices:S,minIndex:Ce,maxIndex:K});if(he)Z.current=!1;N.current=ge,A(L)}}),ce=ao.useMemo(()=>({onFocus(U){Z.current=!0,W(U)},onClick({currentTarget:U}){if(!m)U.focus({preventScroll:!0})},onMouseMove(U){if(N0(U))return;if(Z.current=!0,q.current=!1,d)W(U)},onPointerLeave(U){if(!J.current||!Y.current||U.pointerType==="touch")return;Z.current=!0;let Ce=U.relatedTarget;if(!d||o.current.includes(Ce))return;if(!de.current)return;if(se.current?.(),se.current=null,N.current=-1,A(U),!m){let K=P.current,ae=st(Ae(K));if(K&&me(K,ae))K.focus({preventScroll:!0})}}}),[W,J,P,d,o,A,de,m]),Q=ao.useMemo(()=>m&&R&&be&&{"aria-activedescendant":`${C}-${r}`},[m,R,be,C,r]),Le=ao.useMemo(()=>({...!M?Q:{},onKeyDown(L){if(L.key==="Tab"&&L.shiftKey&&R&&!m){let U=Ze(L.nativeEvent);if(U&&!me(P.current,U))return;Ao(L);let Ce=Re(aa,L.nativeEvent);e.setOpen(!1,Ce);let K=y?.current??H;if(!Ce.isCanceled&&je(K))K.focus();return}z(L)},onPointerMove(L){if(N0(L))return;Y.current=!0}}),[Q,z,P,M,e,R,m,H,y]),ie=ao.useMemo(()=>{function L(K){e.setOpen(!0,Re(ji,K.nativeEvent,K.currentTarget))}function U(K){if(f==="auto"&&Xr(K.nativeEvent))T.current=!m}function Ce(K){if(T.current=f,f==="auto"&&ca(K.nativeEvent))T.current=!0}return{onKeyDown(K){let ae=e.select("open");Y.current=!1;let ge=K.key.startsWith("Arrow"),he=YC(K.key,B(),l),Ie=Ec(K.key,ae?g:h),Oe=(u?he:Ie)||K.key==="Enter"||K.key.trim()==="";if(m&&ae&&(!u||Lr(K.currentTarget)))return z(K);if(!ae&&!p&&ge)return;if(Oe){let Qe=Ec(K.key,B());X.current=u&&Qe?null:K.key}if(u){if(he)if(Ao(K),ae){if(N.current=ee(),A(K),m)P.current?.focus()}else L(K);return}if(Ie){if(pe.current!=null)N.current=pe.current;if(Ao(K),!ae&&p)L(K);else z(K);if(ae)A(K)}return},onFocus(K){if(K.target!==K.currentTarget)return;if(e.select("open")&&!m)N.current=-1,A(K)},onPointerDown:Ce,onPointerEnter:Ce,onMouseDown:U,onClick:U}},[z,f,ee,u,A,e,p,g,h,B,l,pe,m,P]),we=ao.useMemo(()=>({...Q,...ie}),[Q,ie]);return ao.useMemo(()=>a?{reference:we,floating:Le,item:ce,trigger:ie}:{},[a,we,Le,ie,ce])}import*as Fn from"react";function Fm(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=re(i),f=e.useState("open"),d=Je(),p=Fn.useRef(""),S=Fn.useRef(l??n??-1),g=Fn.useRef(null),h=re((I)=>{function x(M){return r?.current[M]}function y(M){let P=x(M);if(P&&!An(P)||P?.matches(":disabled"))return!1;return s==null||!tm(Ar,M,s)}function w(M,P,F=0){if(M.length===0)return-1;let G=(F%M.length+M.length)%M.length,T=P.toLowerCase();for(let N=0;N<M.length;N+=1){let X=(G+N)%M.length;if(!M[X]?.toLowerCase().startsWith(T)||!y(X))continue;return X}return-1}let v=o.current;if(p.current.length>0&&I.key===" ")Ao(I),m?.(!0);if(p.current.length>0&&p.current[0]!==" "){if(w(v,p.current)===-1&&I.key!==" ")m?.(!1)}if(v==null||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;if(f&&I.key!==" ")Ao(I),m?.(!0);let R=p.current==="";if(R)S.current=l??n??-1;if(v.every((M,P)=>M&&y(P)?M[0]?.toLowerCase()!==M[1]?.toLowerCase():!0)&&p.current===I.key)p.current="",S.current=g.current;p.current+=I.key,d.start(u,()=>{p.current="",S.current=g.current,m?.(!1)});let E=((R?l??n??-1:S.current)??0)+1,D=w(v,p.current,E);if(D!==-1)a?.(D,I),g.current=D;else if(I.key!==" ")p.current="",m?.(!1)}),b=re((I)=>{let x=I.relatedTarget,y=e.select("domReferenceElement"),w=e.select("floatingElement");if(me(y,x)||me(w,x))return;d.clear(),p.current="",S.current=g.current,m?.(!1)});_(()=>{if(!f&&l!==null)return;if(d.clear(),g.current=null,p.current!=="")p.current="",m?.(!1)},[f,l,d,m]);let C=Fn.useMemo(()=>({onKeyDown:h,onBlur:b}),[h,b]);return Fn.useMemo(()=>c?{reference:C,floating:C}:{},[c,C])}var B0=0.1,JC=B0*B0,ot=0.5;function kc(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function Lc(e,t,o,r,n,a,s,i,c,u){let l=!1;if(kc(e,t,o,r,n,a))l=!l;if(kc(e,t,n,a,s,i))l=!l;if(kc(e,t,s,i,c,u))l=!l;if(kc(e,t,c,u,o,r))l=!l;return l}function QC(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Dc(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function Es(e={}){let{blockPointerEvents:t=!1}=e,o=new Jt,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],f=!1,d=null,p=null,S=typeof performance<"u"?performance.now():0;function g(b,C){let I=performance.now(),x=I-S;if(d===null||p===null||x===0)return d=b,p=C,S=I,!1;let y=b-d,w=C-p,v=y*y+w*w,R=x*x*JC;return d=b,p=C,S=I,v<R}function h(){o.clear(),c()}return function(C){o.clear();let{domReference:I,floating:x}=i;if(!I||!x||m==null||n==null||a==null)return;let{clientX:y,clientY:w}=C,v=Ze(C),R=C.type==="mouseleave",k=me(x,v),H=me(I,v);if(k){if(f=!0,!R)return}if(H){if(f=!1,!R){f=!0;return}}if(R&&Ve(C.relatedTarget)&&me(x,C.relatedTarget))return;function E(){return Boolean(l&&Zo(l.nodesRef.current,u).length>0)}function D(){if(!E())h()}if(E())return;let M=I.getBoundingClientRect(),P=x.getBoundingClientRect(),F=n>P.right-P.width/2,G=a>P.bottom-P.height/2,T=P.width>M.width,N=P.height>M.height,X=(T?M:P).left,Y=(T?M:P).right,A=(N?M:P).top,ue=(N?M:P).bottom;if(m==="top"&&a>=M.bottom-1||m==="bottom"&&a<=M.top+1||m==="left"&&n>=M.right-1||m==="right"&&n<=M.left+1){D();return}let V=!1;switch(m){case"top":V=Dc(y,w,X,M.top+1,Y,P.bottom-1);break;case"bottom":V=Dc(y,w,X,P.top+1,Y,M.bottom-1);break;case"left":V=Dc(y,w,P.right-1,ue,M.left+1,A);break;case"right":V=Dc(y,w,M.right-1,ue,P.left+1,A);break;default:}if(V)return;if(f&&!QC(y,w,M)){D();return}if(!R&&g(y,w)){D();return}let Z=!1;switch(m){case"top":{let q=T?ot/2:ot*4,se=T?n+q:F?n+q:n-q,Pe=T?n-q:F?n+q:n-q,J=a+ot+1,pe=F?P.bottom-ot:T?P.bottom-ot:P.top,de=F?T?P.bottom-ot:P.top:P.bottom-ot;Z=Lc(y,w,se,J,Pe,J,P.left,pe,P.right,de);break}case"bottom":{let q=T?ot/2:ot*4,se=T?n+q:F?n+q:n-q,Pe=T?n-q:F?n+q:n-q,J=a-ot,pe=F?P.top+ot:T?P.top+ot:P.bottom,de=F?T?P.top+ot:P.bottom:P.top+ot;Z=Lc(y,w,se,J,Pe,J,P.left,pe,P.right,de);break}case"left":{let q=N?ot/2:ot*4,se=N?a+q:G?a+q:a-q,Pe=N?a-q:G?a+q:a-q,J=n+ot+1,pe=G?P.right-ot:N?P.right-ot:P.left,de=G?N?P.right-ot:P.left:P.right-ot;Z=Lc(y,w,pe,P.top,de,P.bottom,J,se,J,Pe);break}case"right":{let q=N?ot/2:ot*4,se=N?a+q:G?a+q:a-q,Pe=N?a-q:G?a+q:a-q,J=n-ot,pe=G?P.left+ot:N?P.left+ot:P.right,de=G?N?P.left+ot:P.right:P.left+ot;Z=Lc(y,w,J,se,J,Pe,pe,P.top,de,P.bottom);break}default:}if(!Z)D();else if(!f)o.start(40,D);return}};return r.__options={...e,blockPointerEvents:t},r}function H0(e,t,o){let{reference:r,floating:n}=e,a=yo(t),s=ps(t),i=fs(s),c=So(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,f=r[i]/2-n[i]/2,d;switch(c){case"top":d={x:l,y:r.y-n.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:m};break;case"left":d={x:r.x-n.width,y:m};break;default:d={x:r.x,y:r.y}}let p=Mo(t);if(p)d[s]+=f*(p==="end"?1:-1)*(o&&u?-1:1);return d}async function V0(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:f=!1,padding:d=0}=Cr(t,e),p=fc(d),g=i[f?m==="floating"?"reference":"floating":m],h=Tn(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(g)))!=null?o:!0)?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),b=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),I=await(a.isElement==null?void 0:a.isElement(C))&&await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1},x=Tn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:C,strategy:c}):b);return{top:(h.top-x.top+p.top)/I.y,bottom:(x.bottom-h.bottom+p.bottom)/I.y,left:(h.left-x.left+p.left)/I.x,right:(x.right-h.right+p.right)/I.x}}var eS=50,U0=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:V0},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=H0(u,r,c),f=r,d=0,p={};for(let S=0;S<a.length;S++){let g=a[S];if(!g)continue;let{name:h,fn:b}=g,{x:C,y:I,data:x,reset:y}=await b({x:l,y:m,initialPlacement:r,placement:f,strategy:n,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=C!=null?C:l,m=I!=null?I:m,p[h]={...p[h],...x},y&&d<eS){if(d++,typeof y==="object"){if(y.placement)f=y.placement;if(y.rects)u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:l,y:m}=H0(u,f,c))}S=-1}}return{x:l,y:m,placement:f,strategy:n,middlewareData:p}};var _0=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:S=!0,...g}=Cr(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let h=So(n),b=yo(i),C=So(i)===i,I=await(c.isRTL==null?void 0:c.isRTL(u.floating)),x=f||(C||!S?[ls(i)]:Wd(i)),y=p!=="none";if(!f&&y)x.push(...zd(i,S,p,I));let w=[i,...x],v=await c.detectOverflow(t,g),R=[],k=((r=a.flip)==null?void 0:r.overflows)||[];if(l)R.push(v[h]);if(m){let M=_d(n,s,I);R.push(v[M[0]],v[M[1]])}if(k=[...k,{placement:n,overflows:R}],!R.every((M)=>M<=0)){var H,E;let M=(((H=a.flip)==null?void 0:H.index)||0)+1,P=w[M];if(P){if(!(m==="alignment"?b!==yo(P):!1)||k.every((T)=>yo(T.placement)===b?T.overflows[0]>0:!0))return{data:{index:M,overflows:k},reset:{placement:P}}}let F=(E=k.filter((G)=>G.overflows[0]<=0).sort((G,T)=>G.overflows[1]-T.overflows[1])[0])==null?void 0:E.placement;if(!F)switch(d){case"bestFit":{var D;let G=(D=k.filter((T)=>{if(y){let N=yo(T.placement);return N===b||N==="y"}return!0}).map((T)=>[T.placement,T.overflows.filter((N)=>N>0).reduce((N,X)=>N+X,0)]).sort((T,N)=>T[1]-N[1])[0])==null?void 0:D[0];if(G)F=G;break}case"initialPlacement":F=i;break}if(n!==F)return{reset:{placement:F}}}return{}}}};var W0=new Set(["left","top"]);async function tS(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=So(o),i=Mo(o),c=yo(o)==="y",u=W0.has(s)?-1:1,l=a&&c?-1:1,m=Cr(t,e),{mainAxis:f,crossAxis:d,alignmentAxis:p}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof p==="number")d=i==="end"?p*-1:p;return c?{x:d*l,y:f*u}:{x:f*u,y:d*l}}var z0=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await tS(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},G0=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(b)=>{let{x:C,y:I}=b;return{x:C,y:I}}},...u}=Cr(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),f=yo(n),d=mc(f),p=l[d],S=l[f],g=(b,C)=>uc(C+m[b==="y"?"top":"left"],C,C-m[b==="y"?"bottom":"right"]);if(s)p=g(d,p);if(i)S=g(f,S);let h=c.fn({...t,[d]:p,[f]:S});return{...h,data:{x:h.x-o,y:h.y-r,enabled:{[d]:s,[f]:i}}}}}},Z0=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=Cr(e,t),f={x:n,y:a},d=yo(s),p=mc(d),S=f[p],g=f[d],h=Cr(u,t),b=typeof h==="number"?{mainAxis:h,crossAxis:0}:{mainAxis:(o=h.mainAxis)!=null?o:0,crossAxis:(r=h.crossAxis)!=null?r:0};if(l){let x=p==="y"?"height":"width",y=i.reference[p]-i.floating[x]+b.mainAxis,w=i.reference[p]+i.reference[x]-b.mainAxis;if(S<y)S=y;else if(S>w)S=w}if(m){var C,I;let x=p==="y"?"width":"height",y=W0.has(So(s)),w=i.reference[d]-i.floating[x]+(y?((C=c.offset)==null?void 0:C[d])||0:0)+(y?0:b.crossAxis),v=i.reference[d]+i.reference[x]+(y?0:((I=c.offset)==null?void 0:I[d])||0)-(y?b.crossAxis:0);if(g<w)g=w;else if(g>v)g=v}return{[p]:S,[d]:g}}}},$0=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=Cr(e,t),c=await n.detectOverflow(t,i),u=So(o),l=Mo(o),m=yo(o)==="y",{width:f,height:d}=r.floating,p,S;if(u==="top"||u==="bottom")p=u,S=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else S=u,p=l==="end"?"top":"bottom";let g=d-c.top-c.bottom,h=f-c.left-c.right,b=Jr(d-c[p],g),C=Jr(f-c[S],h),I=t.middlewareData.shift,x=!I,y=b,w=C;if(I!=null&&I.enabled.x)w=h;if(I!=null&&I.enabled.y)y=g;if(x&&!l)if(m)w=f-2*rr(c.left,c.right);else y=d-2*rr(c.top,c.bottom);await s({...t,availableWidth:w,availableHeight:y});let v=await n.getDimensions(a.floating);if(f!==v.width||d!==v.height)return{reset:{rects:!0}};return{}}}};function X0(e){let t=oo(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=je(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=us(o)!==a||us(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Nm(e){return!Ve(e)?e.contextElement:e}function xa(e){let t=Nm(e);if(!je(t))return br(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=X0(t),s=(a?us(o.width):o.width)/r,i=(a?us(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var oS=br(0);function Y0(e){let t=qe(e);if(!Ni()||!t.visualViewport)return oS;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rS(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===qe(e)}function On(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Nm(e),s=br(1);if(t)if(r){if(Ve(r))s=xa(r)}else s=xa(e);let i=rS(a,o,r)?Y0(a):br(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let f=qe(a),d=Ve(r)?qe(r):r,p=f,S=Bi(p);while(S&&d!==p){let g=xa(S),h=S.getBoundingClientRect(),b=oo(S),C=h.left+(S.clientLeft+parseFloat(b.paddingLeft))*g.x,I=h.top+(S.clientTop+parseFloat(b.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,m*=g.y,c+=C,u+=I,p=qe(S),S=Bi(p)}}return Tn({width:l,height:m,x:c,y:u})}function Fc(e,t){let o=Za(e).scrollLeft;if(!t)return On(gr(e)).left+o;return t.left+o}function K0(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Fc(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function nS(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=gr(r),i=t?Ga(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=br(1),l=br(0),m=je(r);if(m||!a){if(Ft(r)!=="body"||Sn(s))c=Za(r);if(m){let d=On(r);u=xa(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}}let f=s&&!m&&!a?K0(s,c):br(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+f.x,y:o.y*u.y-c.scrollTop*u.y+l.y+f.y}}function aS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sS(e){let t=Za(e),o=e.ownerDocument.body,r=rr(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=rr(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Fc(e),s=-t.scrollTop;if(oo(o).direction==="rtl")a+=rr(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var iS=25;function cS(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=qe(e),a=gr(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let f=!Ni()||t==="fixed";if(r){if(!f)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,f)u=s.offsetLeft,l=s.offsetTop}if(Fc(a)<=0){let f=a.ownerDocument,d=f.body,p=getComputedStyle(d),S=f.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,g=Math.abs(a.clientWidth-d.clientWidth-S),h=getComputedStyle(a).scrollbarGutter==="stable both-edges"?g/2:g;if(h<=iS)i-=h}return{width:i,height:c,x:u,y:l}}function lS(e,t){let o=On(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=xa(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function q0(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=cS(e,o,t);else if(t==="document")r=sS(gr(e));else if(Ve(t))r=lS(t,o);else{let n=Y0(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tn(r)}function uS(e,t){let o=t.get(e);if(o)return o;let r=Zr(e,[],!1).filter((i)=>Ve(i)&&Ft(i)!=="body"),n=null,a=oo(e).position==="fixed",s=a?_o(e):e;while(Ve(s)&&!Wo(s)){let i=oo(s),c=Oi(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=_o(s)}return t.set(e,r),r}function mS(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?Ga(t)?[]:uS(t,this._c):[].concat(o),r],i=q0(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let f=1;f<s.length;f++){let d=q0(t,s[f],n);c=rr(d.top,c),u=Jr(d.right,u),l=Jr(d.bottom,l),m=rr(d.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function fS(e){let{width:t,height:o}=X0(e);return{width:t,height:o}}function pS(e,t,o){let r=je(t),n=gr(t),a=o==="fixed",s=On(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=br(0);if(r||!a){if(Ft(t)!=="body"||Sn(n))i=Za(t);if(r){let f=On(t,!0,a,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}}if(!r&&n)c.x=Fc(n);let u=n&&!r&&!a?K0(n,i):br(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function Om(e){return oo(e).position==="static"}function j0(e,t){if(!je(e)||oo(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(gr(e)===o)o=o.ownerDocument.body;return o}function J0(e,t){let o=qe(e);if(Ga(e))return o;if(!je(e)){let n=_o(e);while(n&&!Wo(n)){if(Ve(n)&&!Om(n))return n;n=_o(n)}return o}let r=j0(e,t);while(r&&od(r)&&Om(r))r=j0(r,t);if(r&&Wo(r)&&Om(r)&&!Oi(r))return o;return r||rd(e)||o}var dS=async function(e){let t=this.getOffsetParent||J0,o=this.getDimensions,r=await o(e.floating);return{reference:pS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gS(e){return oo(e).direction==="rtl"}var Bm={convertOffsetParentRelativeRectToViewportRelativeRect:nS,getDocumentElement:gr,getClippingRect:mS,getOffsetParent:J0,getElementRects:dS,getClientRects:aS,getDimensions:fS,getScale:xa,isElement:Ve,isRTL:gS};function Q0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hS(e,t,o){let r=null,n,a=gr(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let f=e.getBoundingClientRect(),{left:d,top:p,width:S,height:g}=f;if(!l)t();if(!S||!g)return;let h=ms(p),b=ms(a.clientWidth-(d+S)),C=ms(a.clientHeight-(p+g)),I=ms(d),y={rootMargin:-h+"px "+-b+"px "+-C+"px "+-I+"px",threshold:rr(0,Jr(1,m))||1},w=!0;function v(R){let k=R[0].intersectionRatio;if(!Q0(f,e.getBoundingClientRect()))return i();if(k!==m){if(!w)return i();if(!k)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,k)}w=!1}try{r=new IntersectionObserver(v,{...y,root:a.ownerDocument})}catch(R){r=new IntersectionObserver(v,y)}r.observe(e)}let c=qe(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function Ms(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Nm(e),l=n||a?[...u?Zr(u):[],...t?Zr(t):[]]:[];l.forEach((h)=>{n&&h.addEventListener("scroll",o),a&&h.addEventListener("resize",o)});let m=u&&i?hS(u,o,a):null,f=-1,d=null;if(s){if(d=new ResizeObserver((h)=>{let[b]=h;if(b&&b.target===u&&d&&t)d.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)});o()}),u&&!c)d.observe(u);if(t)d.observe(t)}let p,S=c?On(e):null;if(c)g();function g(){let h=On(e);if(S&&!Q0(S,h))o();S=h,p=requestAnimationFrame(g)}return o(),()=>{var h;if(l.forEach((b)=>{n&&b.removeEventListener("scroll",o),a&&b.removeEventListener("resize",o)}),m==null||m(),(h=d)==null||h.disconnect(),d=null,c)cancelAnimationFrame(p)}}var eg=z0;var tg=G0,og=_0,rg=$0;var ng=Z0,Oc=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...Bm,...n.platform,_c:r};return U0(e,t,{...n,platform:a})};import*as Zt from"react";import{useLayoutEffect as bS}from"react";import*as sg from"react-dom";var CS=typeof document<"u",SS=function(){},Nc=CS?bS:SS;function Bc(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 o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!Bc(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!Bc(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ig(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ag(e,t){let o=ig(e);return Math.round(t*o)/o}function Hm(e){let t=Zt.useRef(e);return Nc(()=>{t.current=e}),t}function cg(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=Zt.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[f,d]=Zt.useState(r);if(!Bc(f,r))d(r);let[p,S]=Zt.useState(null),[g,h]=Zt.useState(null),b=Zt.useCallback((T)=>{if(T!==y.current)y.current=T,S(T)},[]),C=Zt.useCallback((T)=>{if(T!==w.current)w.current=T,h(T)},[]),I=a||p,x=s||g,y=Zt.useRef(null),w=Zt.useRef(null),v=Zt.useRef(l),R=c!=null,k=Hm(c),H=Hm(n),E=Hm(u),D=Zt.useCallback(()=>{if(!y.current||!w.current)return;let T={placement:t,strategy:o,middleware:f};if(H.current)T.platform=H.current;Oc(y.current,w.current,T).then((N)=>{let X={...N,isPositioned:E.current!==!1};if(M.current&&!Bc(v.current,X))v.current=X,sg.flushSync(()=>{m(X)})})},[f,t,o,H,E]);Nc(()=>{if(u===!1&&v.current.isPositioned)v.current.isPositioned=!1,m((T)=>({...T,isPositioned:!1}))},[u]);let M=Zt.useRef(!1);Nc(()=>(M.current=!0,()=>{M.current=!1}),[]),Nc(()=>{if(I)y.current=I;if(x)w.current=x;if(I&&x){if(k.current)return k.current(I,x,D);D()}},[I,x,D,k,R]);let P=Zt.useMemo(()=>({reference:y,floating:w,setReference:b,setFloating:C}),[b,C]),F=Zt.useMemo(()=>({reference:I,floating:x}),[I,x]),G=Zt.useMemo(()=>{let T={position:o,left:0,top:0};if(!F.floating)return T;let N=ag(F.floating,l.x),X=ag(F.floating,l.y);if(i)return{...T,transform:"translate("+N+"px, "+X+"px)",...ig(F.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:N,top:X}},[o,i,F.floating,l.x,l.y]);return Zt.useMemo(()=>({...l,update:D,refs:P,elements:F,floatingStyles:G}),[l,D,P,F,G])}var Vm=(e,t)=>{let o=eg(e);return{name:o.name,fn:o.fn,options:[e,t]}},Um=(e,t)=>{let o=tg(e);return{name:o.name,fn:o.fn,options:[e,t]}},_m=(e,t)=>({fn:ng(e).fn,options:[e,t]}),Wm=(e,t)=>{let o=og(e);return{name:o.name,fn:o.fn,options:[e,t]}},zm=(e,t)=>{let o=rg(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as Hc from"react";var xS=Hc.createContext(void 0);function lg(e){let t=Hc.useContext(xS);if(t===void 0&&!e)throw Error(Ge(69));return t}var wS="ArrowUp",yS="ArrowDown",vS="ArrowLeft",RS="ArrowRight",PS="Home",TS="End";var Vc=new Set([wS,yS,vS,RS,PS,TS]);function wa(e){return e==="starting"?s0:Ue}import*as Uc from"react";var AS=Uc.createContext(void 0);function ug(){return Uc.useContext(AS)}import*as _c from"react";function ES(e,t){let o=za(e.render);if(_c.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function mg(e,t,o){let r=ES(e,t),n=r===t?void 0:r,a=_c.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as fg from"react";function pg(e,t,o){let r=za(e.render),n=fg.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as dg}from"react/jsx-runtime";var MS=Nn.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:f,virtualFocus:d,orientation:p}=wo(),S=ug(),{side:g,align:h}=ud(),b=lg(!0)!=null,C=l.useState("open"),I=l.useState("transitionStatus"),x=l.useState("popupProps"),y=l.useState("mounted"),w=l.useState("instantType"),v=l.useState("activeTriggerElement"),R=l.useState("parent"),k=l.useState("lastOpenChangeReason"),H=l.useState("rootId"),E=l.useState("floatingRootContext"),D=l.useState("floatingTreeRoot"),M=l.useState("closeDelay"),P=l.useState("hoverEnabled"),F=l.useState("disabled"),G=l.useState("openMethod"),T=l.useState("activeTriggerId"),N=l.useState("listElement"),[X,Y]=mg(t,m,f),A=pg(t,v,T),ue=R.type==="menu"?S:void 0,V=R.type==="context-menu",Z=c??R.type!=="menu";if(c===void 0&&N&&R.type!=="menu")Z=()=>{if(l.state.activeIndex!==null)return!1;return N};Go({open:C,ref:l.context.popupRef,onComplete(){if(C)l.context.onOpenChangeComplete?.(!0)}}),Nn.useEffect(()=>{function oe(be){l.setOpen(!1,Re(be.reason,be.domEvent))}return D.events.on("close",oe),()=>{D.events.off("close",oe)}},[D.events,l]),Ts(E,{enabled:P&&!F&&!V&&R.type!=="menubar",closeDelay:M});let q=l.useStateSetter("popupElement"),se=Nn.useContext(Bu)?.useParentHandoff??LS,{parentVirtualFocusRef:Pe,handleFocus:J}=se(l,R,C,d),pe={transitionStatus:I,side:g,align:h,open:C,nested:R.type==="menu",instant:w},de=ye("div",t,{state:pe,ref:[o,l.context.popupRef,q,Y],stateAttributesMapping:ta,props:[x,{id:X,...N?{role:"presentation"}:{role:"menu","aria-orientation":p==="horizontal"?"horizontal":void 0,"aria-labelledby":A},onKeyDown(oe){if(ue?.onPopupKeyDown?.(oe),b&&Vc.has(oe.key))oe.stopPropagation()},onFocus:J},wa(I),u,{"data-rootownerid":H}]}),fe=R.type===void 0||V;if(v||R.type==="menubar"&&k!==Fu)fe=!0;let Se=ue?.getReturnElement??Pe;return dg(Ss,{context:E,openInteractionType:G,modal:V,disabled:!y,returnFocus:s??Se??fe,explicitReturnFocus:s===void 0&&Se?!1:void 0,initialFocus:Z,restoreFocus:!0,getInsideElements:R.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:R.type!=="menubar"?D:void 0,previousFocusableElement:v,nextFocusableElement:R.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:de})}),kS={parentVirtualFocusRef:void 0,handleFocus:void 0};function LS(){return kS}var gg=Nn.forwardRef(function(t,o){let r=Hu()?.Popup??MS;return dg(r,{...t,ref:o})});import*as bg from"react";import*as Wc from"react";var Gm=Wc.createContext(void 0);function hg(){let e=Wc.useContext(Gm);if(e===void 0)throw Error(Ge(32));return e}import{jsx as Ig}from"react/jsx-runtime";var Cg=bg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=wo();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return Ig(Gm.Provider,{value:r,children:Ig(bs,{ref:o,...n,portalOwnerRole:u})})});import*as nn from"react";function ya(e){if(Xn(19))return e;return e?"true":void 0}import*as Lo from"react";import*as $o from"react";function Sg(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=$o.useState(null),m=$o.useRef(null),f=uo(o),d=$o.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),p=cg({...e,elements:{...d,...u&&{reference:u}}}),S=$o.useCallback((C)=>{let I=Ve(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;l(I),p.refs.setReference(I)},[p.refs]),g=$o.useMemo(()=>({...p.refs,setPositionReference:S,domReference:m}),[p.refs,S]),h=$o.useMemo(()=>({...p.elements,domReference:s}),[p.elements,s]),b=$o.useMemo(()=>({...p,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:h,nodeId:t,rootStore:r}),[p,g,h,t,r,i,c]);return _(()=>{if(s)m.current=s},[s]),_(()=>{r.context.dataRef.current.floatingContext=b;let C=f?.nodesRef.current.find((I)=>I.id===t);if(C)C.context=b}),$o.useMemo(()=>({...p,context:b,refs:g,elements:h,rootStore:r}),[p,g,h,b,r])}import*as zc from"react";var DS=zc.createContext(void 0);function Gc(){return zc.useContext(DS)?.direction??"ltr"}var FS=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=Cr(e,t)||{};if(u==null)return{};let m=fc(l),f={x:o,y:r},d=ps(n),p=fs(d),S=await s.getDimensions(u),g=d==="y",h=g?"top":"left",b=g?"bottom":"right",C=g?"clientHeight":"clientWidth",I=a.reference[p]+a.reference[d]-f[d]-a.floating[p],x=f[d]-a.reference[d],y=i.floating[C]||a.floating[p],w=I/2-x/2,v=y/2-S[p]/2-1,R=Math.min(m[h],v),k=Math.min(m[b],v),H=R,E=y-S[p]-k,D=y/2-S[p]/2+w,M=uc(H,D,E),P=!c.arrow&&Mo(n)!=null&&D!==M&&a.reference[p]/2-(D<H?R:k)-S[p]/2<0,F=P?D<H?D-H:D-E:0;return{[d]:f[d]+F,data:{[d]:M,centerOffset:D-M-F,...P&&{alignmentOffset:F}},reset:P}}}),xg=(e,t)=>{let{name:o,fn:r}=FS(e);return{name:o,fn:r,options:[e,t]}};var wg={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var yg={sideX:"left",sideY:"top"};var vg="--available-width",Rg="--available-height",Pg="--anchor-width",Tg="--anchor-height",Ag="--transform-origin";var Eg=vg,Mg=Rg;function Dg(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function kg(e,t,o){let{rects:r,placement:n}=e;return{side:Dg(t,So(n),o),align:Mo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Zc(e){return NS(e,Sg)}function NS(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:f=!1,inline:d,keepMounted:p=!1,floatingRootContext:S,mounted:g,collisionAvoidance:h,shift:b,nodeId:C,adaptiveOrigin:I,lazyFlip:x=!1,externalTree:y}=e,w=h.side||"flip",v=h.align||"flip",R=h.fallbackAxisSide||"end",k=b?.crossAxis??!1,H=b?.rootBoundary,E=typeof o==="function"?o:void 0,D=re(E),M=E?D:o,P=ct(o),F=ct(g),T=Gc()==="rtl",[N,X]=Lo.useState(null);if(!g&&N!==null)X(null);let Y=x==="placement",A=N?So(N):null,ue=N&&Y?Mo(N)||"center":null,V=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[n],Z=ue||s,q=Z==="center"?V:`${V}-${Z}`,se=u;if(typeof se==="number")se={top:se,right:se,bottom:se,left:se};else if(se)se={top:se.top||0,right:se.right||0,bottom:se.bottom||0,left:se.left||0};let Pe=1,J=n==="bottom"?Pe:0,pe=n==="top"?Pe:0,de=n==="right"?Pe:0,fe=n==="left"?Pe:0,Se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:se},oe=Lo.useRef(null),be=ct(a),W=ct(i),B=typeof a!=="function"?a:0,ee=typeof i!=="function"?i:0,z=[];if(d)z.push(d);z.push(Vm(($e)=>{let zt=kg($e,n,T),xe=typeof be.current==="function"?be.current(zt):be.current,Me=typeof W.current==="function"?W.current(zt):W.current;return{mainAxis:xe,crossAxis:Me,alignmentAxis:Me}},[B,ee,T,n]));let ce=v==="none"&&w!=="shift",Q=!ce&&(l||k||w==="shift"),Le=w==="none"?null:Wm({...Se,padding:{top:se.top+Pe+J,right:se.right+Pe+fe,bottom:se.bottom+Pe+pe,left:se.left+Pe+de},mainAxis:!k&&w==="flip",crossAxis:v==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),ie=ce?null:Um({...Se,rootBoundary:H,mainAxis:v!=="none",crossAxis:Q,limiter:l||k?void 0:_m(($e)=>{if(!oe.current)return{};let{width:zt,height:xe}=oe.current.getBoundingClientRect(),Me=yo(So($e.placement)),We=Me==="y"?zt:xe,Gt=Me==="y"?se.left+se.right:se.top+se.bottom;return{offset:We/2+Gt/2}})},[Se,l,k,H,se,v]);if(w==="shift"||v==="shift"||Z==="center")z.push(ie,Le);else z.push(Le,ie);z.push(zm({...Se,apply({elements:{floating:$e},availableWidth:zt,availableHeight:xe,rects:Me}){if(!F.current)return;let We=$e.style;We.setProperty(Eg,`${zt}px`),We.setProperty(Mg,`${xe}px`);let Gt=qe($e).devicePixelRatio||1,{x:Yt,y:bo,width:$t,height:Po}=Me.reference,Xo=(Math.round((Yt+$t)*Gt)-Math.round(Yt*Gt))/Gt,Fo=(Math.round((bo+Po)*Gt)-Math.round(bo*Gt))/Gt;We.setProperty(Pg,`${Xo}px`),We.setProperty(Tg,`${Fo}px`)}}),xg(($e)=>({element:oe.current||Ae($e.elements.floating).createElement("div"),padding:oe.current?m:0}),[m]),{name:"transformOrigin",fn($e){let{elements:{floating:zt},middlewareData:xe,placement:Me,platform:We,rects:Gt,y:Yt}=$e,bo=So(Me),$t=Mo(Me),Po=yo(bo)==="y",Xo=oe.current,Fo=typeof a==="function"?a(kg($e,n,T)):a,Gn;if(!Xo&&$t&&Math.abs(Po?xe.shift?.x||0:xe.shift?.y||0)<=1)Gn=$t==="start"===(Po&&We.isRTL?.(zt)===!0)?"100%":"0%";else{let fn=Po?xe.arrow?.x||0:xe.arrow?.y||0,pn=Po?Xo?.clientWidth||0:Xo?.clientHeight||0;Gn=`${fn+pn/2}px`}let ur=bo==="top"||bo==="left"?`calc(100% + ${Fo}px)`:`${-Fo}px`;if(Q&&Po&&Math.abs(xe.shift?.y||0)>Fo)ur=`${Gt.reference.y+Gt.reference.height/2-Yt}px`;return zt.style.setProperty(Ag,Po?`${Gn} ${ur}`:`${ur} ${Gn}`),{}}},wg,I),_(()=>{if(!g&&S)S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,S]);let we=Lo.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:L,elements:U,x:Ce,y:K,middlewareData:ae,update:ge,placement:he,context:Ie,isPositioned:Oe,floatingStyles:Qe}=t({rootContext:S,open:p?g:void 0,placement:q,middleware:z,strategy:r,whileElementsMounted:p?void 0:(...$e)=>Ms(...$e,we),nodeId:C,externalTree:y}),{sideX:dt,sideY:ho}=ae.adaptiveOrigin||yg,Io=Oe?r:"fixed",jo=Lo.useMemo(()=>{let $e;if(!Oe)$e={position:Io,top:0,left:0};else if(I)$e={position:Io,[dt]:Ce,[ho]:K};else $e={...Qe,position:Io};if($e[Eg]="100vw",$e[Mg]="100vh",!Oe)$e.opacity=0;return $e},[I,Io,dt,Ce,ho,K,Qe,Oe]),eo=Lo.useRef(null);_(()=>{if(!g)return;let $e=P.current,zt=typeof $e==="function"?$e():$e,Me=(Lg(zt)?zt.current:zt)||null||null;if(Me!==eo.current)L.setPositionReference(Me),eo.current=Me},[g,L,M,P]),Lo.useEffect(()=>{if(!g)return;let $e=P.current;if(typeof $e==="function")return;if(Lg($e)&&$e.current!==eo.current)L.setPositionReference($e.current),eo.current=$e.current},[g,L,M,P]),Lo.useEffect(()=>{if(p&&g&&U.reference&&U.floating)return Ms(U.reference,U.floating,ge,we);return},[p,g,U,ge,we]);let Xt=So(he),xo=Dg(n,Xt,T),Ro=Mo(he)||"center",co=Boolean(ae.hide?.referenceHidden);_(()=>{if(x&&g&&Oe&&(Xt!==V||Y&&Ro!==Z))X(he)},[x,Y,g,Oe,he,Xt,Ro,V,Z]);let un=Lo.useMemo(()=>({position:"absolute",top:ae.arrow?.y,left:ae.arrow?.x}),[ae.arrow]),mn=ae.arrow?.centerOffset!==0;return Lo.useMemo(()=>({positionerStyles:jo,arrowStyles:un,arrowRef:oe,arrowUncentered:mn,side:xo,align:Ro,physicalSide:Xt,anchorHidden:co,refs:L,context:Ie,isPositioned:Oe,update:ge}),[jo,un,oe,mn,xo,Ro,Xt,co,L,Ie,Oe,ge])}function Lg(e){return e!=null&&"current"in e}import*as Or from"react";import{jsx as BS}from"react/jsx-runtime";function Fg(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=re(n),[,s]=Or.useState(0),i=Xe(VS).current,c=Xe(HS).current,u=Or.useRef(0),l=Or.useRef(!0),m=Or.useRef(null),f=Or.useRef(null),d=re(()=>{if(l.current)return;l.current=!0,s((x)=>x+1)}),p=re((x,y)=>{c.set(x,y),d()}),S=re((x)=>{c.delete(x),d()}),g=re((x)=>{let y=new Map;if(o.current.length=0,r)r.current.length=0;return x.forEach((w)=>{if(y.set(w.element,{...w.registration.metadata??{},index:w.index}),o.current[w.index]=w.element,r)r.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),u.current=o.current.length,y});function h(x){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=="function"||x.length<2)return;let y=new MutationObserver((v)=>{if(!WS(v))return;let R=null;for(let k of x){if(!k.isConnected)continue;if(R&&Og(R,k)>0){y.disconnect(),d();return}R=k}});f.current=y;let w=new Set;for(let v=1;v<x.length;v+=1){let R=_S(x[v-1],x[v]);if(R)w.add(R)}w.forEach((v)=>y.observe(v,{childList:!0}))}let b=re(()=>{let[x,y]=US(c),w=g(x),v=m.current,R=!v||v.length!==x.length||x.some((k,H)=>{let E=v[H];return k.index!==E.index||k.element!==E.element||k.registration.index!==E.registration.index||k.registration.metadata!==E.registration.metadata});if(h(y),m.current=x,l.current=!1,!R)return;i.forEach((k)=>k(w)),a(w)});_(()=>{if(!l.current&&m.current)g(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,g]),_(()=>{if(l.current)b()}),_(()=>()=>{f.current?.disconnect(),l.current=!0},[]);let C=re((x)=>(i.add(x),()=>{i.delete(x)})),I=Or.useMemo(()=>({register:p,unregister:S,subscribeMapChange:C,nextIndexRef:u}),[p,S,C,u]);return BS(zu.Provider,{value:I,children:t})}function HS(){return new Map}function VS(){return new Set}function US(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>Og(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function _S(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function WS(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function Og(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as Ng from"react";import{jsx as zS}from"react/jsx-runtime";var $c=Ng.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return zS("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as Zm from"react";function Bg(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=Zm.useRef(null),s=Zm.useRef(null),i=ia(r);_(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),_(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function qc(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return ye("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},wa(r),n],stateAttributesMapping:wn})}import*as zg from"react";var Hg={},Vg={},Ug="";function jc(e,t){return Sn(e)?e:t}function _g(e,t,o){return/hidden|clip/.test(e.getComputedStyle(jc(t,o)).overflowY)}function GS(e){if(typeof document>"u")return!1;let t=Ae(e);return qe(t).innerWidth-t.documentElement.clientWidth>0}function ZS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=Ae(e),{documentElement:r,body:n}=o,a=jc(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function $S(e){let t=Ae(e),{documentElement:o,body:r}=t,n=jc(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function qS(e){let t=Ae(e),{documentElement:o,body:r}=t,n=qe(o),a=0,s=0,i=!1,c=zo.create();if(Mr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let d=n.getComputedStyle(o),p=n.getComputedStyle(r),h=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,Hg={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},Ug=o.style.scrollBehavior,Vg={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 b=o.scrollHeight>o.clientHeight,C=o.scrollWidth>o.clientWidth,I=d.overflowY==="scroll"||p.overflowY==="scroll",x=d.overflowX==="scroll"||p.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),w=Math.max(0,n.innerHeight-r.clientHeight),v=parseFloat(p.marginTop)+parseFloat(p.marginBottom),R=parseFloat(p.marginLeft)+parseFloat(p.marginRight),k=jc(o,r);if(i=ZS(e),i){o.style.scrollbarGutter=h,k.style.overflowY="hidden",k.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),b||I)o.style.overflowY="scroll";if(C||x)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:v||w?`calc(100dvh - ${v+w}px)`:"100dvh",width:R||y?`calc(100vw - ${R+y}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,Hg),Object.assign(r.style,Vg),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=Ug}function m(){l(),c.request(u)}u();let f=Ee(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")f()}}class Wg{lockCount=0;restore=null;timeoutLock=Jt.create();timeoutUnlock=Jt.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ae(e),{documentElement:o,body:r}=t,n=qe(o);if(_g(n,o,r)){let s=new n.MutationObserver(()=>{if(_g(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=Er.ios||!GS(e);this.restore=a?$S(e):qS(e)}}var jS=new Wg;function Xc(e=!0,t=null){_(()=>{if(!e)return;return jS.acquire(t)},[e,t])}var XS=20;function Gg(e,t,o,r){let[n,a]=zg.useState(!1);_(()=>{if(!e||!t||o==null){a(!1);return}let s=Ae(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-XS)},[e,t,o]),Xc(e&&(!t||n),r)}import{jsx as $m,jsxs as YS}from"react/jsx-runtime";var Zg=nn.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:f=5,arrowPadding:d=5,sticky:p=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=l0,style:h,...b}=t,{store:C,virtualFocus:I,syncHighlightedItem:x}=wo(),y=hg(),w=oa(!0),v=C.useState("parent"),R=C.useState("floatingRootContext"),k=C.useState("floatingTreeRoot"),H=C.useState("mounted"),E=C.useState("open"),D=C.useState("modal"),M=C.useState("openMethod"),P=C.useState("activeTriggerElement"),F=C.useState("transitionStatus"),G=C.useState("positionerElement"),T=C.useState("instantType"),N=C.useState("adaptiveOrigin"),X=C.useState("lastOpenChangeReason"),Y=C.useState("floatingNodeId"),A=C.useState("floatingParentNodeId"),ue=R.useState("domReferenceElement"),V=r,Z=u,q=l,se=c,Pe=g;if(v.type==="context-menu"){if(V=r??v.context?.anchor,se=se??"start",!i&&se!=="center")q=t.alignOffset??2,Z=t.sideOffset??-5}let J=i,pe=se;if(v.type==="menu")J=J??"inline-end",pe=pe??"start",Pe=t.collisionAvoidance??Sc;else if(v.type==="menubar")J=J??(v.context.orientation==="vertical"?"inline-end":"bottom"),pe=pe??"start";let de=v.type==="context-menu",fe=Zc({anchor:V,floatingRootContext:R,positionMethod:w?"fixed":n,mounted:H,side:J,sideOffset:Z,align:pe,alignOffset:q,arrowPadding:de?0:d,collisionBoundary:m,collisionPadding:f,sticky:p,nodeId:Y,keepMounted:y,disableAnchorTracking:S,collisionAvoidance:Pe,shift:de?{crossAxis:!(("side"in Pe)&&Pe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:k,adaptiveOrigin:N,lazyFlip:I?"placement":!1});nn.useEffect(()=>{function ce(Q){if(Q.open){if(Q.parentNodeId===Y)C.set("hoverEnabled",!1);if(Q.nodeId!==Y&&Q.parentNodeId===C.select("floatingParentNodeId"))C.setOpen(!1,Re(Qa))}}return k.events.on("menuopenchange",ce),()=>{k.events.off("menuopenchange",ce)}},[C,k.events,Y]),nn.useEffect(()=>{if(C.select("floatingParentNodeId")==null)return;function ce(Q){if(Q.open||Q.nodeId!==C.select("floatingParentNodeId"))return;let Le=Q.reason??Qa;C.setOpen(!1,Re(Le))}return k.events.on("menuopenchange",ce),()=>{k.events.off("menuopenchange",ce)}},[k.events,C]);let Se=Je();nn.useEffect(()=>{if(!E)Se.clear()},[E,Se]),nn.useEffect(()=>{function ce(Q){if(!E||Q.nodeId!==C.select("floatingParentNodeId"))return;if(Q.target&&P&&P!==Q.target){let Le=C.select("closeDelay");if(Le>0){if(!Se.isStarted())Se.start(Le,()=>{C.setOpen(!1,Re(Qa))})}else C.setOpen(!1,Re(Qa))}else Se.clear()}return k.events.on("itemhover",ce),()=>{k.events.off("itemhover",ce)}},[k.events,E,P,C,Se]),nn.useEffect(()=>{let ce={open:E,nodeId:Y,parentNodeId:A,reason:C.select("lastOpenChangeReason")};k.events.emit("menuopenchange",ce)},[k.events,E,C,Y,A]),Bg({store:C,domReference:ue,positionerElement:G,open:E});let oe={open:E,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:v.type==="menu",instant:T},be=v.type==="menubar"&&v.context.modal,W=D&&X!==jt;Gg(E&&(be||W),M==="touch",G,P);let B=qc(t,oe,{styles:fe.positionerStyles,transitionStatus:F,props:b,refs:[o,C.useStateSetter("positionerElement")],hidden:!H,inert:!E}),ee=H&&v.type!=="menu"&&(v.type!=="menubar"&&D&&X!==jt||v.type==="menubar"&&v.context.modal),z=null;if(v.type==="menubar")z=v.context.contentElement;else if(v.type===void 0)z=P;return YS(Mu.Provider,{value:fe,children:[ee&&$m($c,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:ya(!E),cutout:z}),$m(dm,{id:Y,children:$m(Fg,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,onMapChange:x,children:B})})]})});import*as lt from"react";import*as Yc from"react";var KS=Yc.createContext(null);function Kc(e){let t=Yc.useContext(KS);if(t===null&&!e)throw Error(Ge(5));return t}import*as Ls from"react";import*as ks from"react";function $g(e){let t=ks.useRef(""),o=ks.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:ks.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as qg from"react";function Jc(e,t){let o=qg.useRef(e),r=re(t);_(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function qm(e,t){let o=re((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(Er.ios?"touch":""))}),{onClick:r,onPointerDown:n}=$g(o);return Ls.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function jg(e){let[t,o]=Ls.useState(null),r=qm(e,o);return Jc(e,(n)=>{if(n&&!e)o(null)}),Ls.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Xg(e){if(e==null)return yn;if(e.type.startsWith("key"))return gd;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return Db;return yn}import*as va from"react";var JS={...on,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=on.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>Mr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!on.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class jm extends ar{constructor(e,t,o=!1){let r=new kn,n=ex(r,t,o,e);super(n,QS(r),JS);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function QS(e){return{positionerRef:va.createRef(),popupRef:va.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:va.createRef(),beforeTriggerFocusGuardRef:va.createRef(),beforeContentFocusGuardRef:va.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function ex(e,t,o=!1,r){return{...Ia(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ue,inputProps:Ue,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new En,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ue,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as Yg from"react";var Xm=Yg.createContext(null);function Ym(e,t){return(e===ra||e===Ou)&&t?.detail===0}function Kg(e,t){return e===ji||Ym(e,t)}import{jsx as Ds,jsxs as tx}from"react/jsx-runtime";var ox=Ln(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:f,closeParentOnEsc:d=!1,handle:p,triggerId:S,defaultTriggerId:g=null,highlightItemOnHover:h=!0,isSubmenu:b=!1,virtualFocus:C=!1,virtualFocusRef:I,allowEscape:x=!0,resetOnPointerLeave:y=!0}=t,w=oa(!0),v=wo(!0),R=Kc(!0),k=v?.store,H=v?.virtualFocus??!1,E=lt.useMemo(()=>{if(b&&k)return{type:"menu",store:k};if(R)return{type:"menubar",context:R};if(w&&!k)return{type:"context-menu",context:w};return{type:void 0}},[w,k,R,b]),D=ro(),M=ro(),[P,F]=lt.useState(void 0),G=(P??M)||void 0,T=ko(),N=E.type==="menu"?E.store:void 0,X=(r??i)&&N?.state.transitionStatus==="starting",Y=Xe(()=>X?N?.state.instantType:void 0).current,A=Xe(()=>{let xe=new jm({open:i,openProp:r,activeTriggerId:g,triggerIdProp:S,parent:E,disabled:c,highlightItemOnHover:h,modal:E.type===void 0?u:void 0,rootId:D,instantType:Y},G,T!=null);return xe.context.virtualFocusRef=I,xe}).current;A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",S),A.useContextCallback("onOpenChangeComplete",a);let ue=A.useState("floatingTreeRoot"),V=Cs(ue),Z=A.useState("open"),q=A.useState("activeTriggerElement"),se=A.useState("positionerElement"),Pe=A.useState("hoverEnabled"),J=A.useState("disabled"),pe=A.useState("lastOpenChangeReason"),de=A.useState("parent"),fe=A.useState("activeIndex"),Se=A.useState("keyboardOpen"),oe=A.useState("payload"),be=A.useState("floatingParentNodeId"),W=lt.useRef(null),B=lt.useRef(de.type!=="context-menu"),ee=Je(),z=lt.useRef(!0),ce=Je(),Q=be!=null,{openMethod:Le,triggerProps:ie}=jg(Z);A.useSyncedValues({disabled:c,highlightItemOnHover:h,modal:de.type===void 0?u:void 0,openMethod:Le,rootId:D}),pa(A);let{forceUnmount:we,transitionStatus:L}=da(Z,A,()=>{A.set("allowMouseEnter",!1)},X),U=ia(A.context.popupRef);lt.useEffect(()=>{if(Y===void 0)return;let xe=()=>{if(A.state.instantType===Y)A.set("instantType",void 0)};if(!Z){xe();return}if(L!==void 0)return;if(A.context.popupRef.current==null){xe();return}let Me=new AbortController;return U(xe,Me.signal),()=>{Me.abort()}},[Y,Z,L,U,A]),_(()=>{if(w&&!v)A.update({parent:{type:"context-menu",context:w},floatingNodeId:V,floatingParentNodeId:T});else if(v||!A.select("activeTriggerElement"))A.update({floatingNodeId:V,floatingParentNodeId:T})},[w,v,V,T,q,A]),lt.useEffect(()=>{if(!Z)W.current=null;if(de.type!=="context-menu")return;if(!Z){ee.clear(),B.current=!1;return}ee.start(500,()=>{B.current=!0})},[ee,Z,de.type]),_(()=>{if(!Z&&!Pe)A.set("hoverEnabled",!0)},[Z,Pe,A]);let Ce=re((xe,Me)=>{let We=Me.reason;if(!xe&&!A.select("open"))return;if(Z===xe&&Me.trigger===q&&pe===We)return;let Gt=Sm(Me);if(!xe&&Me.trigger==null)Me.trigger=q??void 0;if(n?.(xe,Me),Me.isCanceled)return;A.state.floatingRootContext.dispatchOpenChange(xe,Me);let Yt=Me.event;if(xe===!1&&We!==Ou&&Yt?.type==="click"&&Yt.pointerType==="touch"&&!z.current)return;if(xe&&We===na)z.current=!1,ce.start(300,()=>{z.current=!0});else z.current=!0,ce.clear();let bo=!xe&&(We===qi||We==null);W.current=Me.event;let $t=vs(A.state,xe,Me.trigger,Gt());if($t.openChangeReason=We,$t.keyboardOpen=xe&&Kg(We,Yt),de.type==="menubar"&&(We===na||We===aa||We===jt||We===ji||We===Qa))$t.instantType="group";else if(Ym(We,Yt))$t.instantType="click";else if(bo)$t.instantType="dismiss";else $t.instantType=void 0;A.update($t)}),K=ys({popupStore:A,floatingRootContext:A.state.floatingRootContext,floatingId:G,nested:T!=null,onOpenChange:Ce}),ae=K.context.events;_(()=>{let xe=({open:Me,eventDetails:We})=>Ce(Me,We);return ae.on("setOpen",xe),()=>{ae?.off("setOpen",xe)}},[ae,Ce]),_(()=>A.subscribeToParentMenu(),[A]);let ge=lt.useCallback(()=>{A.setOpen(!1,Re(Nu))},[A]);lt.useImperativeHandle(f,()=>({unmount:we,close:ge}),[we,ge]);let he;if(de.type==="context-menu")he=de.context;lt.useImperativeHandle(he?.positionerRef,()=>se,[se]),lt.useImperativeHandle(he?.actionsRef,()=>({setOpen:Ce}),[Ce]);let Ie=Mn(K,{enabled:!J,bubbles:{escapeKey:d&&de.type==="menu"},outsidePress(){if(de.type!=="context-menu"||W.current?.type==="contextmenu")return!0;return B.current},externalTree:Q?ue:void 0}),Oe=Gc(),Qe=Dm(K,{enabled:!J,listRef:A.context.itemDomElements,activeIndex:fe,virtual:C,nested:de.type==="menubar"||!C&&de.type!==void 0,parentOrientation:de.type==="menubar"?de.context.orientation:void 0,loopFocus:l,focusItemOnOpen:C?Se:void 0,allowEscape:C&&l&&x,orientation:m,triggerOrientation:C?"vertical":m,rtl:Oe==="rtl",disabledIndices:Ar,onNavigate(xe,Me){A.setActiveIndex(xe,Xg(Me),Me?.nativeEvent)},openOnArrowKeyDown:de.type!=="context-menu"&&!(C&&b),externalTree:!C&&Q?ue:void 0,nestedReturnFocusRef:N?.context.virtualFocusRef,focusItemOnHover:h,resetOnPointerLeave:y}),dt=lt.useCallback((xe)=>{A.context.typingRef.current=xe},[A]),ho=Fm(K,{enabled:!J&&!C,listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:fe,resetMs:n0,onMatch:(xe,Me)=>{if(Z&&xe!==fe)A.setActiveIndex(xe,gd,Me.nativeEvent)},onTyping:dt}),Io=re(s),jo=lt.useRef(-1),eo=re(()=>{let xe=A.state.activeIndex,Me=xe===null?void 0:A.context.itemDomElements.current[xe]??void 0;if(Me?.isConnected===!1)return;let We=Me===void 0?-1:xe;if(jo.current===We&&A.context.reportedItem===Me)return;if(jo.current=We,A.context.reportedItem=Me,C)A.set("highlightedItem",Me);let{highlightReason:Gt,highlightEvent:Yt}=A.context;if(A.context.highlightReason=yn,A.context.highlightEvent=void 0,!s)return;Io(Me,Ad(Gt,Yt,{label:Me===void 0?void 0:A.context.itemLabels.current[We]??void 0}))});_(()=>{eo()},[fe,eo]);let Xt=lt.useMemo(()=>{if(!C)return Qe.reference;if(!Qe.trigger)return Ue;let{onFocus:xe,...Me}=Qe.trigger;return Me},[C,Qe.reference,Qe.trigger]);A.useSyncedValue("inputProps",C?Qe.reference??Ue:Ue);let xo=lt.useMemo(()=>{let xe=Dt(ho.reference,Xt,Ie.reference,{onMouseMove(){A.set("allowMouseEnter",!0)}},ie);return xe["aria-haspopup"]="menu",xe["aria-expanded"]=Z,xe},[A,ho.reference,Xt,Ie.reference,ie,Z]),Ro=lt.useMemo(()=>{let xe=Dt(Qe.trigger,Ie.trigger,ie);return xe["aria-haspopup"]="menu",xe["aria-expanded"]=!1,xe},[Qe.trigger,Ie.trigger,ie]);Xe(()=>(A.update({inactiveTriggerProps:Ro}),null));let co=lt.useMemo(()=>Dt(ua,{onMouseMove(){if(A.set("allowMouseEnter",!0),de.type==="menu")A.set("hoverEnabled",!1)},onClick(){if(A.select("hoverEnabled"))A.set("hoverEnabled",!1)},onKeyDown(xe){let Me=A.select("keyboardEventRelay");if(Me&&!xe.isPropagationStopped())Me(xe)}},ho.floating,Qe.floating,Ie.floating),[de.type,A,ho.floating,Qe.floating,Ie.floating]),un=Qe.item??Ue;ga(A,{floatingRootContext:K,activeTriggerProps:xo,inactiveTriggerProps:Ro,popupProps:co,itemProps:un});let mn=lt.useMemo(()=>({store:A,parent:E,orientation:m,loopFocus:l,allowEscape:x,defaultFloatingId:M,setRenderedFloatingId:F,virtualFocus:C,parentVirtualFocus:H,syncHighlightedItem:eo}),[A,E,m,l,x,M,C,H,eo]),$e=typeof o==="function"?o({payload:oe}):o,zt=tx(Ka.Provider,{value:mn,children:[p&&Ds(ma,{handle:p,store:A}),$e]});if(de.type===void 0||de.type==="context-menu")zt=Ds(gm,{externalTree:ue,children:zt});return zt});function Jg(e){let t=lt.useContext(Xm);if(t===null)return Ds(ox,{...e});let o=t.Root;return Ds(Xm.Provider,{value:null,children:Ds(o,{...t.options,...e})})}import*as fo from"react";var Qc=5;function Qg(e,t){let o=rx(t);return e.clientX>=o.left-Qc&&e.clientX<=o.right+Qc&&e.clientY>=o.top-Qc&&e.clientY<=o.bottom+Qc}function rx(e){let t=e.getBoundingClientRect(),o=qe(e);if(ts.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),f=l-t.width,d=m-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-d/2,bottom:t.bottom+d/2}}import*as e1 from"react";function t1(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=Kn(),{ref:n,index:a}=Yi(e),s=o===a,i=e1.useRef(null),c=Uo(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function o1(e){let{render:t,className:o,style:r,state:n=Ue,props:a=Ar,refs:s=Ar,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:f}=t1({metadata:i});return ye(u,e,{state:n,ref:[f,...s],props:[m,...a,l],stateAttributesMapping:c})}function Km(e){if(je(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(Wo(e))return;return Km(_o(e))}import*as r1 from"react-dom";function n1(e,t){function o(a,s,i){let c=a.currentTarget;r1.flushSync(()=>{e.setOpen(!1,Re(aa,a.nativeEvent,c))}),Kd(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Fr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as el from"react";function a1(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=el.useRef(!1);return el.useMemo(()=>{if(!t)return Ue;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,Ae(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Fs,jsxs as nx}from"react/jsx-runtime";var s1=ha(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:f,payload:d,...p}=t,S=wo(!0),h=ba(f)??S?.store;if(!h)throw Error(Ge(85));let b=ro(c),C=h.useState("isTriggerActive",b),I=h.useState("floatingRootContext"),x=h.useState("isOpenedByTrigger",b),y=h.useState("triggerControlsId",b),w=fo.useRef(null),v=sx(),R=Kn(!0),k=uo(),H=fo.useMemo(()=>k??new En,[k]),E=Cs(H),D=ko(),{registerTrigger:M,isMountedByThisTrigger:P}=fa(b,w,h,{payload:d,closeDelay:m,parent:v,floatingTreeRoot:H,floatingNodeId:E,floatingParentNodeId:D,keyboardEventRelay:R?.relayKeyboardEvent}),F=v.type==="menubar",G=h.useState("disabled"),T=s||G||F&&v.context.disabled,{getButtonProps:N,buttonRef:X}=Co({disabled:T,native:i});fo.useEffect(()=>{if(!x&&v.type===void 0)h.context.allowMouseUpTriggerRef.current=!1},[h,x,v.type]);let Y=fo.useRef(null),A=Je(),ue=re((ce)=>{if(!Y.current)return;A.clear(),h.context.allowMouseUpTriggerRef.current=!1;let Q=ce.target;if(me(Y.current,Q)||me(h.select("positionerElement"),Q)||Q===Y.current)return;if(Q!=null&&Km(Q)===h.select("rootId"))return;if(Qg(ce,Y.current))return;H.events.emit("close",{domEvent:ce,reason:Fb})});fo.useEffect(()=>{let ce=Ae(Y.current);if(x&&h.select("lastOpenChangeReason")===jt)return ce.addEventListener("mouseup",ue,{once:!0}),()=>{ce.removeEventListener("mouseup",ue)};return},[x,ue,h]);let V=F&&v.context.hasSubmenuOpen,q=As(I,{enabled:(u??V)&&!T&&(!F||V&&!P),handleClose:Es({blockPointerEvents:!F}),mouseOnly:!0,move:!1,restMs:v.type===void 0?l:void 0,delay:{close:m},triggerElementRef:w,externalTree:H,isActiveTrigger:C,isClosing:()=>h.select("transitionStatus")==="ending"}),se=ax(x,h.select("lastOpenChangeReason")),Pe=ws(I,{enabled:!T,event:x&&F?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?se:!1}),J=Ps(I,{enabled:!T&&V}),pe=a1({open:x,enabled:F,mouseDownAction:"open"}),de=fo.useMemo(()=>Dt(J.reference,Pe.reference),[J.reference,Pe.reference]),fe=h.useState("triggerProps",P),Se=h.useState("filterTriggerProps"),{handlePreFocusGuardFocus:oe,handleFocusTargetFocus:be}=n1(h,w),W={disabled:T,open:x},B=[Y,o,X,M,w],ee=[de,q??Ue,fe,{"aria-haspopup":"menu","aria-controls":y,id:b,onMouseDown:(ce)=>{if(h.select("open"))return;A.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ae(ce.currentTarget).addEventListener("mouseup",ue,{once:!0})}},Se,F?{role:"menuitem"}:{},pe,p,N],z=ye("button",t,{enabled:!F,stateAttributesMapping:Du,state:W,ref:B,props:ee});if(F)return Fs(o1,{tag:"button",render:r,className:n,style:a,state:W,refs:B,props:ee,stateAttributesMapping:Du});if(x)return nx(fo.Fragment,{children:[Fs(or,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:oe},`${b}-pre-focus-guard`),Fs(fo.Fragment,{children:z},b),Fs(or,{ref:h.context.triggerFocusTargetRef,onFocus:be},`${b}-post-focus-guard`)]});return Fs(fo.Fragment,{children:z},b)});function ax(e,t){let o=Je(),[r,n]=fo.useState(!1);return _(()=>{if(e&&t===jt)n(!0),o.start(a0,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function sx(){let e=Kc(!0);return fo.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as i1 from"react";var c1=i1.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return ye("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as Bn,jsxs as HYe}from"react/jsx-runtime";function u1({...e}){return Bn(Jg,{"data-slot":"dropdown-menu",...e})}function m1({...e}){return Bn(s1,{"data-slot":"dropdown-menu-trigger",...e})}function f1({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return Bn(Cg,{container:a,children:Bn(Zg,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:Bn(gg,{"data-slot":"dropdown-menu-content",className:le("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Os({className:e,inset:t,variant:o="default",...r}){return Bn(Ld,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:le("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function p1({className:e,...t}){return Bn(c1,{"data-slot":"dropdown-menu-separator",className:le("-mx-1 my-1 h-px bg-border",e),...t})}import*as R1 from"react";import*as tl from"react";var d1="data-valid",g1="data-invalid";var h1={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},cx={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},I1={disabled:!1,...cx},b1={valid(e){if(e===null)return null;if(e)return{[d1]:""};return{[g1]:""}}};var lx={invalid:void 0,name:void 0,validityData:{state:h1,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:I1,registerFieldControl:Ye,validation:{getValidationProps:(e,t=Ue)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},ux=tl.createContext(lx);function Ra(e=!0){let t=tl.useContext(ux);if(t.setValidityData===Ye&&!e)throw Error(Ge(28));return t}import*as ol from"react";var mx=ol.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function C1(){return ol.useContext(mx)}import*as rl from"react";var fx=rl.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function nl(){return rl.useContext(fx)}import*as al from"react";function S1(e,t,o){let{setFocused:r,focusOwnerRef:n}=Ra(),a=re((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return _(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function x1(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Ra(),i=Xe(()=>Symbol());_(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),_(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as Jm from"react";function w1(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=nl(),s=ro(),i=Xe(()=>Symbol()),c=Jm.useRef(!1),u=Jm.useRef(!1),l=re(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return _(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),_(()=>l,[l]),(o?r:void 0)??t??s}var y1=al.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:f,...d}=t,{state:p,name:S,disabled:g,setTouched:h,setDirty:b,validityData:C,setFilled:I,validationMode:x,validation:y}=Ra(),{clearErrors:w,elementRef:v,submitCountRef:R}=C1(),k=g||c,H=S??s,E={...p,disabled:k},{labelId:D}=nl(),M=w1({id:a}),P=i!==void 0,F=i==null?void 0:String(i),G=re(()=>y.inputRef.current?.value);x1(y.inputRef,M,F,G,!k,s),_(()=>{let A=F??y.inputRef.current?.value;if(A!==void 0)I(A!=="")},[F,l,y.inputRef,I]),Jc(F,()=>{if(F===void 0)return;w(H),b(F!==(C.initialValue??"")),y.change(F)});let T=al.useRef(null),N=S1(k,T),X=Je();return ye("input",t,{ref:[o,T],state:E,props:[{id:M,disabled:k,name:H,ref:y.inputRef,"aria-labelledby":D,autoFocus:m,...P?{value:i}:{defaultValue:l},onChange(A){let ue=A.currentTarget.value,V=Re(yn,A.nativeEvent);if(u?.(ue,V),P)return;if(b(ue!==(C.initialValue??"")),I(ue!==""),!A.nativeEvent.defaultPrevented&&!V.isCanceled)w(H),y.change(ue)},onFocus(){N(!0)},onBlur(A){if(h(!0),N(!1),x==="onBlur"){let ue=A.currentTarget.value;if(y.commit(ue),P)queueMicrotask(()=>{let V=y.inputRef.current?.value;if(V!==void 0&&V!==ue&&V!==(C.initialValue??""))y.commit(V)})}},onKeyDown(A){if(A.currentTarget.tagName==="INPUT"&&A.key==="Enter"){h(!0);let ue=A.currentTarget.value,V=A.currentTarget.form;if(V&&V===v.current&&!A.defaultPrevented){let Z=A.currentTarget,q=R.current;X.start(0,()=>{if(R.current===q)y.commit(Z.value)})}else y.commit(ue)}}},d,(A)=>y.getValidationProps(k,A)],stateAttributesMapping:b1})});import{jsx as px}from"react/jsx-runtime";var Qm=R1.forwardRef(function(t,o){return px(y1,{ref:o,...t})});import{jsx as dx}from"react/jsx-runtime";function ef({className:e,type:t,...o}){return dx(Qm,{type:t,"data-slot":"input",className:le("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as gx}from"react/jsx-runtime";function P1({className:e,...t}){return gx("textarea",{"data-slot":"textarea",className:le("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as sl}from"react/jsx-runtime";function T1({className:e,...t}){return sl("div",{"data-slot":"input-group",role:"group",className:le("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var hx=to("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function A1({className:e,align:t="inline-start",...o}){return sl("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:le(hx({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var Ix=to("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function tf({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return sl(gt,{type:t,"data-size":r,variant:o,className:le(Ix({size:r}),e),...n})}function E1({className:e,...t}){return sl(P1,{"data-slot":"input-group-control",className:le("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as rt,jsxs as so}from"react/jsx-runtime";function M1({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n,body:a,onBodyChange:s,inputRef:i}){let[c,u]=Ns(!1),[l,m]=Ns(""),[f,d]=Ns([]),[p,S]=Ns(!1),g=Cx(null),[h,b]=Ns(null);bx(()=>{b(g.current?.closest("[data-coristen-widget]")??null)},[]);async function C(x){let y=Array.from(x.target.files??[]).slice(0,Math.max(0,5-f.length));if(x.target.value="",!y.length)return;S(!0),m("");try{let w=[];for(let v of y)w.push(await t(v));d((v)=>[...v,...w].slice(0,5))}catch(w){m(w instanceof Error?w.message:"File upload failed. Try again.")}finally{S(!1)}}async function I(x){x.preventDefault();let y=a.trim();if(!y&&!f.length||c||p||o)return;u(!0),m("");try{await e(y,f),s(""),d([])}catch{m("Message could not be sent. Try again.")}finally{u(!1)}}return so("form",{onSubmit:(x)=>void I(x),className:"w-full",children:[rt("input",{ref:g,type:"file",multiple:!0,className:"sr-only",onChange:(x)=>void C(x)}),(f.length>0||p)&&so(Ui,{className:"px-2 pb-2",children:[f.map((x)=>so(ea,{size:"xs",children:[rt(qa,{children:rt(In,{})}),so(ja,{className:"max-w-32",children:[rt(Xa,{title:x.name,children:x.name}),so(Ya,{children:[(x.size/1024).toFixed(0)," KB"]})]}),rt(Vi,{children:rt(ld,{type:"button","aria-label":`Remove ${x.name}`,onClick:()=>d((y)=>y.filter((w)=>w.storageId!==x.storageId)),children:rt(Ho,{})})})]},x.storageId)),p&&so(ea,{size:"xs",state:"uploading",children:[rt(qa,{children:rt(In,{})}),so(ja,{children:[rt(Xa,{children:"Uploading file"}),rt(Ya,{children:"Please wait"})]})]})]}),so(T1,{className:"has-disabled:opacity-100",children:[rt(E1,{ref:i,"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(x)=>s(x.target.value),maxLength:2000,rows:2,onKeyDown:(x)=>{if(x.key==="Enter"&&!x.shiftKey)x.preventDefault(),x.currentTarget.form?.requestSubmit()}}),so(A1,{align:"block-end",className:"pt-1",children:[so(u1,{children:[rt(m1,{render:rt(tf,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:rt(jn,{className:"size-5"})}),so(f1,{portalContainer:h,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[so(Os,{onClick:()=>g.current?.click(),children:[rt(vi,{}),"Add Photos & Files"]}),rt(p1,{}),so(Os,{children:[rt(Si,{}),"Create Image"]}),so(Os,{children:[rt(ai,{}),"Deep Research"]}),so(Os,{children:[rt(hi,{}),"Web Search"]})]})]}),r&&rt("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&rt("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:so("span",{className:"inline-flex items-center gap-1",children:["Powered by",so("span",{className:"relative size-4 shrink-0",children:[rt("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),rt("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),rt("span",{className:"font-medium",children:"Coristen"})]})})}),rt(tf,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:c||p||o||!a.trim()&&!f.length,children:rt(ri,{})})]})]}),l&&rt("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as Hn}from"react/jsx-runtime";function of({className:e,size:t="default",...o}){return Hn("div",{"data-slot":"card","data-size":t,className:le("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function rf({className:e,...t}){return Hn("div",{"data-slot":"card-header",className:le("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function nf({className:e,...t}){return Hn("div",{"data-slot":"card-title",className:le("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function af({className:e,...t}){return Hn("div",{"data-slot":"card-description",className:le("text-sm text-muted-foreground",e),...t})}function k1({className:e,...t}){return Hn("div",{"data-slot":"card-action",className:le("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function L1({className:e,...t}){return Hn("div",{"data-slot":"card-content",className:le("px-(--card-spacing)",e),...t})}function il({className:e,...t}){return Hn("div",{"data-slot":"card-footer",className:le("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as xx}from"react/jsx-runtime";var Sx=to("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function sf({variant:e="default",align:t="start",className:o,...r}){return xx("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:le(Sx({variant:e}),o),...r})}function cf({className:e,render:t,...o}){return Yn({defaultTagName:"div",props:Dt({className:le("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var hJe=to("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as cl}from"react/jsx-runtime";function D1({className:e,...t}){return cl("div",{"data-slot":"empty",className:le("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function F1({className:e,...t}){return cl("div",{"data-slot":"empty-header",className:le("flex max-w-sm flex-col items-center gap-2",e),...t})}var xJe=to("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function O1({className:e,...t}){return cl("div",{"data-slot":"empty-title",className:le("font-heading text-sm font-medium tracking-tight",e),...t})}function N1({className:e,...t}){return cl("div",{"data-slot":"empty-description",className:le("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Bs}from"react/jsx-runtime";function B1({className:e,align:t="start",...o}){return Bs("div",{"data-slot":"message","data-align":t,className:le("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function H1({className:e,...t}){return Bs("div",{"data-slot":"message-avatar",className:le("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function V1({className:e,...t}){return Bs("div",{"data-slot":"message-content",className:le("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function U1({className:e,...t}){return Bs("div",{"data-slot":"message-header",className:le("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function _1({className:e,...t}){return Bs("div",{"data-slot":"message-footer",className:le("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as ll from"react";import*as Ot from"react";var W1=new Map([["bold",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Ot.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var lf=ll.forwardRef((e,t)=>ll.createElement(Ne,{ref:t,...e,weights:W1}));lf.displayName="ArrowCounterClockwiseIcon";import*as ul from"react";import*as Nt from"react";var z1=new Map([["bold",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),Nt.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var uf=ul.forwardRef((e,t)=>ul.createElement(Ne,{ref:t,...e,weights:z1}));uf.displayName="DownloadSimpleIcon";import{useState as xl}from"react";import*as G1 from"react";import*as ml from"react";var mf=ml.createContext(void 0);function po(e){let t=ml.useContext(mf);if(!e&&t===void 0)throw Error(Ge(27));return t}var Z1=G1.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=po(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),f=c.useState("transitionStatus");return ye("div",t,{state:{open:u,transitionStatus:f},ref:[c.context.backdropRef,o],stateAttributesMapping:ta,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as $1 from"react";var ff=$1.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=po(),l=u.useState("open"),{getButtonProps:m,buttonRef:f}=Co({disabled:s,native:i}),d={disabled:s};function p(S){if(l)u.setOpen(!1,Re(Lb,S.nativeEvent))}return ye("button",t,{state:d,ref:[o,f],props:[{onClick:p},c,m]})});import*as q1 from"react";var j1=q1.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=po(),u=ro(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ye("p",t,{ref:o,props:[{id:u},i]})});import*as Q1 from"react";import*as fl from"react";var pf=fl.createContext(void 0);function X1(){let e=fl.useContext(pf);if(e===void 0)throw Error(Ge(26));return e}var Y1="--nested-dialogs";var eQe=ku,tQe=Lu,oQe=vb,rQe=Rb;var K1="data-nested-dialog-open";var J1={...wn,...qr,nestedDialogOpen(e){return e?{[K1]:""}:null}};import{jsx as vx}from"react/jsx-runtime";var eh=Q1.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=po(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),d=u.useState("popupProps"),p=u.useState("modal"),S=u.useState("mounted"),g=u.useState("nested"),h=u.useState("nestedOpenDialogCount"),b=u.useState("open"),C=u.useState("openMethod"),I=u.useState("titleElementId"),x=u.useState("transitionStatus"),y=u.useState("role"),w=f.useState("floatingId");X1(),Go({open:b,ref:u.context.popupRef,onComplete(){if(b)u.context.onOpenChangeComplete?.(!0)}});let v=i===void 0?R0(u.context.popupRef):i,R=h>0,k=u.useStateSetter("popupElement"),E=ye("div",t,{state:{open:b,nested:g,transitionStatus:x,nestedDialogOpen:R},props:[d,{id:w,"aria-labelledby":I,"aria-describedby":l,role:y,...ua,hidden:!S,onKeyDown(D){if(Vc.has(D.key))D.stopPropagation()},style:{[Y1]:h}},c],ref:[o,u.context.popupRef,k],stateAttributesMapping:J1});return vx(Ss,{context:f,openInteractionType:C,disabled:!S,closeOnFocusOut:!m,initialFocus:v,returnFocus:s,modal:p!==!1,restoreFocus:"popup",children:E})});import*as oh from"react";import{jsx as th,jsxs as Rx}from"react/jsx-runtime";var rh=oh.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=po(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return th(pf.Provider,{value:r,children:Rx(bs,{ref:o,...n,children:[s&&i===!0&&th($c,{ref:a.context.internalBackdropRef,inert:ya(!c)}),t.children]})})});import*as sh from"react";import*as df from"react";function nh({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=df.useState(0),[m,f]=df.useState(0),d=u===0,p=Mn(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in S&&S.button!==0)return!1;if("touches"in S){if(S.type==="touchend"){if(S.changedTouches.length!==1||S.touches.length!==0)return!1}else if(S.touches.length!==1)return!1}let g=Ze(S);if(d&&!a){if(s){let h=e.context.internalBackdropRef.current,b=e.context.backdropRef.current;return h||b?h===g||b===g||me(g,i)&&!g?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:d});return Xc(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(S,g)=>{if(!e.select("open")&&!e.select("mounted"))return;l(S),f(g)}),_(()=>{if(!r&&!n)l(0),f(0)},[r,n]),_(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),ga(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as pl from"react";var Px={...on,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class gf extends ar{constructor(e,t,o){let r=new kn,n=Tx(e,r,t,o);super(n,Ax(r),Px)}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;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(vs(this.state,e,t.trigger))}}function Tx(e,t,o,r=!1){return{...Ia(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Ax(e){return{popupRef:pl.createRef(),backdropRef:pl.createRef(),internalBackdropRef:pl.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as ah,jsxs as Ex}from"react/jsx-runtime";function ih(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:f=null}=t,d=e==="drawer",p=e==="alert-dialog",S=p?!0:c,g=p||i,h=p?"alertdialog":"dialog",b=po(!0),C=b!=null,I={modal:S,disablePointerDismissal:g,nested:C,role:h},x=yc((H,E)=>new gf({open:n,openProp:r,activeTriggerId:f,triggerIdProp:m,...I},H,E),!0);x.useControlledProp("openProp",r),x.useControlledProp("triggerIdProp",m),x.useSyncedValues(I),x.useContextCallback("onOpenChange",a),x.useContextCallback("onOpenChangeComplete",s);let y=x.useState("open"),w=x.useState("mounted"),v=x.useState("payload");T0(x,y),pa(x);let{forceUnmount:R}=da(y,x);sh.useImperativeHandle(u,()=>({unmount:R,close:()=>x.setOpen(!1,Re(Nu))}),[R,x]);let k=y||w||l!=null;return Ex(mf.Provider,{value:x,children:[l&&ah(ma,{handle:l,store:x}),k&&ah(nh,{store:x,parentContext:b?.context,isDrawer:d}),typeof o==="function"?o({payload:v}):o]})}var ch=Ln(function(t){return ih("dialog",t)});import*as lh from"react";var uh=lh.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=po(),u=ro(s);return c.useSyncedValueWithCleanup("titleElementId",u),ye("h2",t,{ref:o,props:[{id:u},i]})});import*as mh from"react";var fh=ha(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,f=po(!0),p=ba(l)??f;if(!p)throw Error(Ge(79));let S=ro(c),g=p.useState("floatingRootContext"),h=p.useState("isOpenedByTrigger",S),b=p.useState("triggerPopupId",S),C=mh.useRef(null),{registerTrigger:I,isMountedByThisTrigger:x}=fa(S,C,p,{payload:u}),{getButtonProps:y,buttonRef:w}=Co({disabled:s,native:i}),v=ws(g),R=qm(()=>p.select("open"),(E)=>{p.set("openMethod",E)}),k={disabled:s,open:h},H=p.useState("triggerProps",x);return ye("button",t,{state:k,ref:[w,o,I,C],props:[v.reference,H,R,{[Cc]:"",id:S,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":b},m,y],stateAttributesMapping:Zi})});import{jsx as sr,jsxs as hf}from"react/jsx-runtime";function dh({...e}){return sr(ch,{"data-slot":"dialog",...e})}function gh({...e}){return sr(fh,{"data-slot":"dialog-trigger",...e})}function Mx({...e}){return sr(rh,{"data-slot":"dialog-portal",...e})}function hh({...e}){return sr(ff,{"data-slot":"dialog-close",...e})}function kx({className:e,...t}){return sr(Z1,{"data-slot":"dialog-overlay",className:le("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function Ih({className:e,children:t,showCloseButton:o=!0,...r}){return hf(Mx,{children:[sr(kx,{}),hf(eh,{"data-slot":"dialog-content",className:le("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&hf(ff,{"data-slot":"dialog-close",render:sr(gt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[sr(Ho,{}),sr("span",{className:"sr-only",children:"Close"})]})]})]})}function If({className:e,...t}){return sr(uh,{"data-slot":"dialog-title",className:le("font-heading text-base leading-none font-medium",e),...t})}function bf({className:e,...t}){return sr(j1,{"data-slot":"dialog-description",className:le("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function bh(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var Lx=to("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function dl({className:e,variant:t="default",render:o,...r}){return Yn({defaultTagName:"span",props:Dt({className:le(Lx({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as Fx}from"react/jsx-runtime";var Dx=to("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function Ch({className:e,variant:t="default",render:o,...r}){return Yn({defaultTagName:"div",props:Dt({className:le(Dx({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function Sh({className:e,...t}){return Fx("span",{"data-slot":"marker-content",className:le("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function xh(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as Pa from"react";function wh({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=gl(Ox(r,n),t);if(!o)return Pa.createElement(e,a);if(typeof o=="function")return o(a,r);if(!Pa.isValidElement(o))return null;let s=o.props,i={...gl(a,s),ref:Ta(a.ref,s.ref)};return Pa.cloneElement(o,i)}function gl(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=Ta(s,a):Bx(n)&&typeof s=="function"&&typeof a=="function"?t[n]=Nx(a,s):t[n]=a}}return t}function Ox(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function Nx(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function Bx(e){return/^on[A-Z]/.test(e)}function Ta(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as te from"react";import{jsx as Aa,jsxs as Rh}from"react/jsx-runtime";var Hx=8,Vx=64,Ux=0,bl=0.5,_x=180,Wx=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),Ph={start:!1,end:!1},zx=[],Cl={currentAnchorId:null,visibleMessageIds:zx};function Gx({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return Ph;let n=Sf({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function Zx({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Cl;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of Hs(e,r)){let f=m.dataset.messageId;if(!f)continue;let d=m.dataset.scrollAnchor==="true",p=d||c?m.getBoundingClientRect():null;(c&&p?p.bottom>i&&p.top<s.bottom:a.has(f))&&u.push(f),d&&p&&p.top<=i+bl&&(l=f)}return u.length===0&&l===null?Cl:{currentAnchorId:l,visibleMessageIds:u}}function Hs(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function $x(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function qx(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function jx(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function Xx(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function Yx({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of Hs(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function Kx({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=Th(t,n),s=t.getBoundingClientRect().height,i=ew(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function Th(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function hl(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Jx({content:e,scrollTop:t,spacer:o,viewport:r}){let n=Sf({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function Sf({content:e,spacer:t,viewport:o}){let r=Hs(e,t),n=Ah(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function Qx(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Ah(e){let t=window.getComputedStyle(e);return{end:Cf(t.paddingBlockEnd||t.paddingBottom),start:Cf(t.paddingBlockStart||t.paddingTop)}}function ew(e){let t=e?.parentElement;return t?Ah(t):{end:0,start:0}}function tw(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return Cf(o)}function Cf(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Eh(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function yh(e,t){return Eh(e,t)}function ow(){return Eh(Cl,nw)}function rw(e,t){return e.start===t.start&&e.end===t.end}function nw(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function aw({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=te.useRef(e),s=te.useRef(!1),i=te.useRef(null),c=te.useRef(!1),u=te.useRef(o),l=te.useRef(0),m=te.useRef(null),f=te.useRef(0),d=te.useRef(e?"following-bottom":"free-scrolling"),p=te.useRef(new Map),S=te.useRef(null),g=te.useRef(null),h=te.useRef(null),b=te.useRef(n),C=te.useRef(!0),I=te.useRef(null),x=te.useRef(r),y=te.useRef(null),w=te.useRef(0),v=te.useRef(0),R=te.useRef(null),k=te.useRef(null),H=te.useRef(null),E=te.useRef(null),D=te.useRef(null),M=te.useRef(null),P=te.useRef(null),F=te.useRef(null),G=te.useRef(null),T=te.useRef(new Set),N=te.useRef(new WeakSet);return H.current===null&&(H.current=yh(t==="end"||t==="last-anchor",(X,Y)=>X===Y)),E.current===null&&(E.current=yh(Ph,rw)),G.current===null&&(G.current=ow()),a.current=e,u.current=o,x.current=r,b.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:D,streamingTurnRef:h,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:f,messageElementsRef:p,modeRef:d,pendingScrollFrameRef:y,pendingScrollToMessageRef:S,prependRestoreRef:g,preserveScrollOnPrependRef:C,pendingDefaultScrollStore:H.current,rootRef:I,scrollEdgeThresholdRef:u,scrollMarginRef:x,scrollPreviousItemPeekRef:b,spacerGapRef:w,spacerHeightRef:v,spacerRef:R,stateFrameRef:k,stateStore:E.current,viewportRef:M,visibilityFrameRef:P,visibilityObserverRef:F,visibilityStore:G.current,visibleMessageIdsRef:T,handledScrollAnchorsRef:N}}function Mh(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function Il(e){e.defaultScrollPositionAppliedRef.current=!0,Mh(e)}function sw({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:f,prependRestoreRef:d,scrollMarginRef:p,scrollPreviousItemPeekRef:S,spacerGapRef:g,spacerHeightRef:h,spacerRef:b,viewportRef:C}=e,I=te.useCallback((E)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==E&&(s.current=E,t()),E&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},_x))},[t]),x=te.useCallback((E)=>{let D=b.current;if(!D)return;let M=Math.max(0,Math.ceil(E));h.current!==M&&(h.current=M,D.hidden=M===0,D.style.height=`${M}px`,D.style.marginTop=M>0?`${-g.current}px`:"")},[]),y=te.useCallback((E,{behavior:D="auto",autoscrolling:M=!1}={})=>{let P=C.current;if(!P)return;let F=Math.max(0,E);if(Math.abs(P.scrollTop-F)<=bl){P.scrollTop=F,t();return}M&&I(!0),P.scrollTo({top:F,behavior:D}),o()},[t,o,I]),w=te.useCallback(({behavior:E="auto"}={})=>C.current?(x(0),n.current=null,m.current="free-scrolling",y(0,{behavior:E}),r(),!0):!1,[r,y,x]),v=te.useCallback(({behavior:E="auto"}={})=>{let D=C.current;return D?(x(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(Qx(D),{autoscrolling:!0,behavior:E}),r(),!0):!1},[r,y,x]),R=te.useCallback((E,{align:D="start",behavior:M="auto",scrollMargin:P=p.current}={},{keepPreviousPeek:F=!1}={})=>{let G=c.current,T=C.current;if(!G||!T||!G.contains(E))return!1;let N=Kx({align:D,element:E,scrollMargin:F?P+S.current:P,spacer:b.current,viewport:T}),X=Jx({content:G,scrollTop:N,spacer:b.current,viewport:T});return x(X),d.current={element:E,viewportTop:hl(E,T)},m.current=F?"anchored-to-message":"settling-jump",n.current=F?E:null,y(N,{behavior:M}),r(),!0},[r,y,x]),k=te.useCallback(()=>{let E=n.current;return!E||!E.isConnected||m.current!=="anchored-to-message"?!1:R(E,{align:"start"},{keepPreviousPeek:!0})},[R]),H=te.useCallback((E,D)=>{let M=l.current.get(E);return M?(Il(e),R(M,D)?(f.current=null,!0):(f.current={messageId:E,options:D},!0)):u.current===0?(f.current={messageId:E,options:D},Il(e),!0):!1},[R]);return{flushPendingScrollToMessage:te.useCallback(()=>{let E=f.current;if(!E)return!1;let D=l.current.get(E.messageId);return!D||!R(D,E.options)?!1:(f.current=null,Il(e),!0)},[R]),reanchorToAnchoredMessage:k,scrollToElement:R,scrollToEnd:v,scrollToMessage:H,scrollToStart:w}}function vh(e,t){return te.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function iw({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=Hx,scrollPreviousItemPeek:r=Vx,scrollMargin:n=Ux}){let a=aw({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:f,itemCountRef:d,lastScrollTopRef:p,messageElementsRef:S,modeRef:g,pendingScrollFrameRef:h,pendingScrollToMessageRef:b,prependRestoreRef:C,preserveScrollOnPrependRef:I,pendingDefaultScrollStore:x,rootRef:y,scrollEdgeThresholdRef:w,scrollMarginRef:v,scrollPreviousItemPeekRef:R,spacerGapRef:k,spacerHeightRef:H,spacerRef:E,stateFrameRef:D,stateStore:M,viewportRef:P,visibilityFrameRef:F,visibilityObserverRef:G,visibilityStore:T,visibleMessageIdsRef:N,handledScrollAnchorsRef:X}=a,Y=te.useRef(t);Y.current!==t&&(Y.current=t,m.current=!1);let A=te.useCallback((ge)=>{let he=y.current,Ie=P.current,Oe=[ge.start&&"start",ge.end&&"end"].filter(Boolean).join(" "),Qe=c.current;for(let dt of[he,Ie])dt&&(Oe?dt.setAttribute("data-scrollable",Oe):dt.removeAttribute("data-scrollable"),dt.toggleAttribute("data-autoscrolling",Qe))},[]),ue=te.useCallback((ge)=>{let he=P.current?.scrollTop??0,Ie=he<p.current-bl;p.current=he,i.current&&!ge.end&&g.current!=="settling-jump"&&g.current!=="anchored-to-message"?g.current="following-bottom":g.current==="following-bottom"&&ge.end&&Ie&&!c.current&&(g.current="free-scrolling")},[]),V=te.useCallback(()=>{let ge=Gx({content:l.current,scrollEdgeThreshold:w.current,spacer:E.current,viewport:P.current});ue(ge);let he=g.current==="following-bottom"?{...ge,end:!1}:ge;A(he),M.setSnapshot(he)},[ue,M,A]),Z=te.useCallback(()=>{D.current===null&&(D.current=window.requestAnimationFrame(()=>{D.current=null,V()}))},[V]),q=te.useCallback(()=>{T.hasListeners()&&F.current===null&&(F.current=window.requestAnimationFrame(()=>{F.current=null,T.hasListeners()&&T.setSnapshot(Zx({content:l.current,scrollMargin:v.current,scrollPreviousItemPeek:R.current,spacer:E.current,viewport:P.current,visibleMessageIds:N.current}))}))},[T]),{flushPendingScrollToMessage:se,reanchorToAnchoredMessage:Pe,scrollToElement:J,scrollToEnd:pe,scrollToMessage:de,scrollToStart:fe}=sw({refs:a,commitScrollState:V,scheduleStateCommit:Z,scheduleVisibilitySync:q}),Se=te.useCallback(()=>{let ge=C.current,he=P.current;if(!ge||!he||!ge.element.isConnected)return!1;let Ie=hl(ge.element,he)-ge.viewportTop;return Math.abs(Ie)<=bl?!1:(he.scrollTop+=Ie,ge.viewportTop=hl(ge.element,he),Z(),q(),!0)},[Z,q]),oe=te.useCallback(()=>{let ge=l.current,he=P.current;if(!ge||!he){C.current=null;return}let Ie=Yx({content:ge,spacer:E.current,viewport:he});C.current=Ie?{element:Ie,viewportTop:hl(Ie,he)}:null},[]),be=te.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null,se()&&oe()}))},[oe,se]),W=te.useCallback(()=>{if(!t||m.current||d.current===0)return!1;let ge=!1;if(t==="last-anchor"){let he=l.current,Ie=P.current,Oe=he&&Ie?Xx(Hs(he,E.current)):null;if(!he||!Ie||!Oe)ge=pe({behavior:"auto"});else{let Qe=Th(Oe,Ie);ge=Sf({content:he,spacer:E.current,viewport:Ie})-Qe<=Ie.clientHeight?pe({behavior:"auto"}):J(Oe,{align:"start"},{keepPreviousPeek:!0})}}else ge=t==="end"?pe({behavior:"auto"}):fe({behavior:"auto"});return ge?(Il(a),!0):!1},[t,J,pe,fe]),B=te.useCallback(()=>{let ge=l.current;if(!ge)return;let he=Hs(ge,E.current),Ie=d.current,Oe=f.current;d.current=he.length,f.current=he[0]??null,(()=>{if(se())return;if(Ie===0){if(W()||he.length>0&&i.current&&pe({behavior:"auto"}))return;V(),q();return}let Qe=Oe?he.indexOf(Oe):-1;if(I.current&&Qe>0){Se();return}if(he.length>Ie){let dt=$x(he,Ie);if(dt){if(i.current&&g.current==="following-bottom"&&jx(he,Ie)){pe({behavior:"auto"});return}J(dt,{align:"start"},{keepPreviousPeek:!0}),X.current.add(dt);return}}if(he.length===Ie){let dt=qx(he,X.current);if(dt){J(dt,{align:"start"},{keepPreviousPeek:!0}),X.current.add(dt);return}}g.current==="following-bottom"&&i.current?pe({behavior:"auto"}):(V(),q())})(),oe()},[W,oe,V,se,Se,q,J,pe]),ee=te.useCallback(()=>{if(g.current==="following-bottom"&&i.current){pe({behavior:"auto"});return}let ge=H.current;if(Pe()){i.current&&ge>0&&H.current===0&&pe({behavior:"auto"});return}Z(),q()},[Pe,Z,q,pe]),z=te.useCallback(()=>{let ge=P.current;if(!(!ge||!T.hasListeners())){if(typeof IntersectionObserver>"u"){q();return}G.current||(G.current=new IntersectionObserver((he)=>{for(let Ie of he){let Oe=Ie.target.dataset.messageId;Oe&&(Ie.isIntersecting?N.current.add(Oe):N.current.delete(Oe))}q()},{root:ge,rootMargin:`${-(v.current+R.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),S.current.forEach((he)=>{G.current?.observe(he)}),q()}},[q,T]),ce=te.useCallback(()=>{F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null),G.current?.disconnect(),G.current=null,N.current.clear(),T.setSnapshot(Cl)},[T]),Q=te.useCallback((ge,he,Ie)=>{if(he){S.current.set(ge,he),G.current?.observe(he),q(),b.current?.messageId===ge&&be();return}Ie&&S.current.get(ge)===Ie&&(S.current.delete(ge),N.current.delete(ge),G.current?.unobserve(Ie),q())},[be,q]),Le=te.useCallback(()=>{(g.current==="following-bottom"||g.current==="anchored-to-message"||g.current==="settling-jump")&&(s.current=null,g.current="free-scrolling")},[]),ie=te.useCallback(()=>A(M.getSnapshot()),[M,A]),we=vh(y,ie),L=vh(P,ie),U=te.useCallback((ge)=>{l.current=ge},[]),Ce=te.useCallback((ge)=>{E.current=ge,k.current=tw(ge?.parentElement??null)},[]),K=te.useCallback(()=>{V(),q(),oe()},[oe,V,q]),ae=te.useMemo(()=>({handleContentChange:B,handleResize:ee,observeVisibility:z,pendingDefaultScrollStore:x,preserveScrollOnPrependRef:I,scrollToEnd:pe,scrollToMessage:de,scrollToStart:fe,setContentElement:U,setRootElement:we,setSpacerElement:Ce,setViewportElement:L,stateStore:M,syncAfterScroll:K,unobserveVisibility:ce,userScrollIntent:Le,viewportRef:P,visibilityStore:T}),[B,ee,z,x,pe,de,fe,U,we,Ce,L,M,K,ce,Le,T]);return te.useLayoutEffect(()=>{W()||d.current===0&&Mh(a)},[W]),te.useEffect(()=>()=>{D.current!==null&&(window.cancelAnimationFrame(D.current),D.current=null),F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),G.current?.disconnect(),G.current=null},[]),te.useLayoutEffect(()=>{if(e&&g.current==="following-bottom"&&d.current>0){pe({behavior:"auto"});return}V()},[e,V,pe]),{context:ae,registerMessage:Q}}function cw(e){let t=te.useRef(e);return t.current=e,t}var kh=te.createContext(null),Lh=te.createContext(null);function Vs(){let e=te.useContext(kh);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function lw(){let e=te.useContext(Lh);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function uw({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=iw({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Aa(kh.Provider,{value:s,children:Aa(Lh.Provider,{value:i,children:t})})}function Dh(){let{pendingDefaultScrollStore:e}=Vs();return te.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function mw({children:e,...t}){let{setRootElement:o}=Vs(),r=Dh();return Aa("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function fw({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:f,setViewportElement:d,syncAfterScroll:p,userScrollIntent:S,viewportRef:g}=Vs(),h=Dh();f.current=s;let b=te.useCallback((w)=>{d(w),Ta(i)?.(w)},[i,d]);function C(w){p(),r?.(w)}function I(w){S(),a?.(w)}function x(w){S(),n?.(w)}function y(w){Wx.has(w.key)&&S(),o?.(w)}return te.useEffect(()=>{let w=g.current;if(!w||typeof ResizeObserver>"u")return;let v=0,R=new ResizeObserver(()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(m)});return R.observe(w),()=>{window.cancelAnimationFrame(v),R.disconnect()}},[m,g]),Aa("div",{ref:b,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:y,onScroll:C,onTouchMove:x,onWheel:I,...l,...h?{"data-pending-scroll":""}:null,children:t})}function pw({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=Vs(),l=te.useRef(null),m=te.useCallback((f)=>{l.current=f,c(f),Ta(o)?.(f)},[o,c]);return te.useLayoutEffect(()=>{let f=l.current;if(!f||(s(),typeof MutationObserver>"u"))return;let d=new MutationObserver(()=>{s()});return d.observe(f,{childList:!0}),()=>d.disconnect()},[s]),te.useEffect(()=>{let f=l.current;if(!f||typeof ResizeObserver>"u")return;let d=0,p=new ResizeObserver(()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(i)});return p.observe(f),()=>{window.cancelAnimationFrame(d),p.disconnect()}},[i]),Rh("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Aa("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function dw({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=lw(),a=te.useRef(null),s=te.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),Ta(t)?.(i)},[e,t,n]);return Aa("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function gw({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=Vs(),m=cw(r),f=te.useCallback((g)=>l.subscribe(g),[l]),d=te.useCallback(()=>{let g=l.getSnapshot();return o==="start"?g.start:g.end},[o,l]),p=te.useSyncExternalStore(f,d,d),S=te.useCallback((g)=>{p&&(m.current?.(g),g.defaultPrevented||(g.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,p,m,c,u]);return wh({defaultTagName:"button",props:gl({type:s,inert:!p,tabIndex:p?a:-1,children:t??Rh("span",{children:["Scroll to ",o]}),onClick:S},i),render:n,state:{active:p,direction:o},stateAttributesMapping:{active:(g)=>({"data-active":g?"true":"false"})}})}var Vn={Provider:uw,Root:mw,Viewport:fw,Content:pw,Item:dw,Button:gw};import*as Sl from"react";import*as Bt from"react";var Fh=new Map([["bold",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Bt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var xf=Sl.forwardRef((e,t)=>Sl.createElement(Ne,{ref:t,...e,weights:Fh}));xf.displayName="ArrowDownIcon";import{jsx as Nr,jsxs as Iw,Fragment as hw}from"react/jsx-runtime";function Oh(e){return Nr(Vn.Provider,{...e})}function Nh({className:e,...t}){return Nr(Vn.Root,{"data-slot":"message-scroller",className:le("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function Bh({className:e,...t}){return Nr(Vn.Viewport,{"data-slot":"message-scroller-viewport",className:le("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function Hh({className:e,...t}){return Nr(Vn.Content,{"data-slot":"message-scroller-content",className:le("flex h-max min-h-full flex-col gap-6",e),...t})}function Vh({className:e,scrollAnchor:t=!1,...o}){return Nr(Vn.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:le("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function Uh({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return Nr(Vn.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:le("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??Nr(gt,{variant:n,size:a}),...s,children:o??Iw(hw,{children:[Nr(xf,{}),Nr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as He,jsxs as go}from"react/jsx-runtime";function bw(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function _h({attachment:e}){let[t,o]=xl(!1),[r,n]=xl(!1);return go("div",{className:"flex flex-col items-end gap-1",children:[He(gt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await bh(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:He(uf,{})}),r&&He("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function Cw({attachments:e,allowDownloads:t=!1}){let[o,r]=xl(null),[n,a]=xl(!1);if(!e?.length)return null;return go(dh,{onOpenChange:(s)=>{if(!s)r(null)},children:[He(Ui,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return He(ea,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:He(gh,{render:He("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:He("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return go(ea,{className:"min-w-52",children:[He(qa,{children:He(In,{})}),go(ja,{className:"max-w-44",children:[He(Xa,{title:s.name,children:s.name}),go(Ya,{children:[s.type||"File"," ·"," ",bw(s.size)]})]}),t&&s.url&&He(Vi,{children:He(_h,{attachment:s})})]},s.storageId)})}),go(Ih,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[He(If,{className:"sr-only",children:o?.name??"Image preview"}),He(bf,{className:"sr-only",children:"Expanded image preview"}),go("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&He(_h,{attachment:o},o.storageId),He(hh,{render:He(gt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:He(Ho,{})})]}),n?He("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&He("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function wf({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return He(Oh,{children:go(Nh,{children:[He(Bh,{children:go(Hh,{className:"p-4",children:[e?.length===0&&He(D1,{children:go(F1,{children:[He(O1,{children:"No messages yet"}),He(N1,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),f=e[u-1]?._creationTime,d=i&&m&&(f===void 0||m.toDateString()!==new Date(f).toDateString()),p=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return go(Vh,{messageId:c._id,scrollAnchor:l,children:[d&&He(Ch,{className:"mb-5 justify-center",children:He(Sh,{children:xh(m.getTime())})}),go(B1,{align:l?"end":"start",children:[(l?n:a)&&He(H1,{className:"size-7 min-w-7",children:l?n:a}),go(V1,{children:[i&&go(U1,{className:"gap-2",children:[c.sender==="customer"?"You":p?"Ten":"Support",p&&He(dl,{variant:"secondary",children:"AI"})]}),He(Cw,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&He(sf,{variant:"muted",children:He(cf,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?He("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):He(sf,{variant:l?o:"secondary",children:He(cf,{children:c.body})})),c.citations&&c.citations.length>0&&He("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((S)=>S.url?He("a",{href:S.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:S.title},S.sourceId):He("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:S.title},S.sourceId))}),c.generationStatus==="failed"&&go("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[He("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&go(gt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[He(lf,{}),"Retry"]})]}),i&&m&&He(_1,{children:He("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),He(Uh,{})]})})}import{jsx as Sw}from"react/jsx-runtime";function Wh({className:e,...t}){return Sw("label",{"data-slot":"label",className:le("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as xw}from"react/jsx-runtime";function ir({className:e,...t}){return xw("div",{"data-slot":"skeleton",className:le("animate-pulse rounded-md bg-muted",e),...t})}import*as Ma from"react";import*as wl from"react";var yf=wl.createContext(void 0);function yl(){let e=wl.useContext(yf);if(e===void 0)throw Error(Ge(13));return e}var Ea={imageLoadingStatus:()=>null};import{jsx as ww}from"react/jsx-runtime";var zh=Ma.forwardRef(function(t,o){let{className:r,render:n,style:a,...s}=t,[i,c]=Ma.useState("idle"),u={imageLoadingStatus:i},l=Ma.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:c}),[i,c]),m=ye("span",t,{state:u,ref:o,props:s,stateAttributesMapping:Ea});return ww(yf.Provider,{value:l,children:m})});import*as Us from"react";import*as Gh from"react";function Zh(e,{referrerPolicy:t,crossOrigin:o,sizes:r,srcSet:n},a){let s=Gh.useState("idle"),i=s[1];return _(()=>{if(!a)return Ye;if(!e&&!n)return i("error"),Ye;let c=!0,u=new window.Image,l=(m)=>()=>{if(!c)return;i(m)};if(i("loading"),u.onload=l("loaded"),u.onerror=l("error"),t)u.referrerPolicy=t;if(u.crossOrigin=o??null,r)u.sizes=r;if(n)u.srcset=n;if(e)u.src=e;if(u.complete)i(u.naturalWidth>0?"loaded":"error");return()=>{c=!1}},[a,e,n,r,o,t,i]),s}var yw={...Ea,...qr},$h=Us.forwardRef(function(t,o){let{className:r,render:n,onLoadingStatusChange:a,keepMounted:s=!1,style:i,sizes:c,srcSet:u,src:l,...m}=t,{setImageLoadingStatus:f}=yl(),[d,p]=Zh(l,t,!s),S=d==="loaded",{mounted:g,transitionStatus:h,setMounted:b}=oc(S),C=Us.useRef(null),I=Us.useRef(!0);_(()=>{if(!s)return;let H=I.current;I.current=!1;let E=C.current;if(!E)return;if(!E.complete){p("loading");return}let D=E.naturalWidth>0?"loaded":"error";if(p(D),D==="loaded"&&H)b(!0)},[s,l,u,c,m.crossOrigin,m.referrerPolicy,n,p,b]);let x=s?{"data-loading":d==="loading"?"":void 0,"data-error":d==="error"?"":void 0,"aria-hidden":d!=="loaded"||void 0,onLoad(){p("loaded")},onError(){p("error")}}:void 0,y=re((H)=>{a?.(H),f(H)});_(()=>{if(d!=="idle")y(d)},[d,y]),_(()=>()=>f("idle"),[f]),Go({enabled:!S,open:S,ref:C,onComplete(){if(!S)b(!1)}});let w={imageLoadingStatus:d,transitionStatus:s&&h==="ending"?void 0:h},v=s||g,R={};if(c!==void 0)R.sizes=c;if(u!==void 0)R.srcSet=u;if(l!==void 0)R.src=l;let k=ye("img",t,{state:w,ref:[o,C],props:[x,m,R],stateAttributesMapping:yw,enabled:v});if(!v)return null;return k});import*as ka from"react";var qh=ka.forwardRef(function(t,o){let{className:r,render:n,delay:a=0,style:s,...i}=t,{imageLoadingStatus:c}=yl(),[u,l]=ka.useState(a===0),m=Je();return ka.useEffect(()=>{if(a>0)m.start(a,()=>l(!0));else l(!0);return m.clear},[m,a]),ye("span",t,{state:{imageLoadingStatus:c},ref:o,props:i,stateAttributesMapping:Ea,enabled:c!=="loaded"&&(a===0||u)})});import{jsx as Tf}from"react/jsx-runtime";function vf({className:e,size:t="default",...o}){return Tf(zh,{"data-slot":"avatar","data-size":t,className:(r)=>le("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full bg-muted select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",r.imageLoadingStatus==="loading"&&"animate-pulse",typeof e==="function"?e(r):e),...o})}function Rf({className:e,...t}){return Tf($h,{"data-slot":"avatar-image",className:le("aspect-square size-full rounded-full object-cover",e),...t})}function Pf({className:e,...t}){return Tf(qh,{"data-slot":"avatar-fallback",className:(o)=>le("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",o.imageLoadingStatus==="loading"&&"opacity-0",typeof e==="function"?e(o):e),...t})}var La=Math.PI*2,De=(e)=>Math.round(e*100)/100,ke=(e,t)=>t[Math.floor(e()*t.length)];function Af(e){let t=2166136261;for(let o=0;o<e.length;o++)t^=e.charCodeAt(o),t=Math.imul(t,16777619);return t>>>0}function Ef(e){let t=e;return()=>{t=t+1831565813|0;let o=Math.imul(t^t>>>15,1|t);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}var Rl=[{name:"rose",bg:"#E8608A",fg:"#FFE3C2"},{name:"marigold",bg:"#F6CD5E",fg:"#D9416F"},{name:"mint",bg:"#8EDBC4",fg:"#1D6448"},{name:"cobalt",bg:"#3D7FE6",fg:"#C7E3FF"},{name:"lilac",bg:"#C9B6F4",fg:"#E0477E"},{name:"meadow",bg:"#2E9D52",fg:"#F9E07A"},{name:"sky",bg:"#9CC9F5",fg:"#24418F"},{name:"butter",bg:"#FBE38E",fg:"#3A62D6"},{name:"forest",bg:"#1F6B4A",fg:"#9BE3C9"},{name:"plum",bg:"#6E3A8E",fg:"#F0D9FF"},{name:"peach",bg:"#FFC4A3",fg:"#C23B5B"},{name:"tangerine",bg:"#F28A4B",fg:"#FFF0D6"},{name:"teal",bg:"#2BA3A0",fg:"#FFF3C4"},{name:"slate",bg:"#56637F",fg:"#FFD3B0"}],Xh=36,vw=["bright","soft","deep"],Rw=["tonal","complement","triad"],Pw={tonal:0,complement:180,triad:120},Tw={bright:0.7,soft:0.87,deep:0.48},Aw={bright:0.16,soft:0.085,deep:0.12};function vl(e,t,o){let r=(s)=>{let i=s*Math.cos(o*Math.PI/180),c=s*Math.sin(o*Math.PI/180),u=(e+0.3963377774*i+0.2158037573*c)**3,l=(e-0.1055613458*i-0.0638541728*c)**3,m=(e-0.0894841775*i-1.291485548*c)**3;return[4.0767416621*u-3.3077115913*l+0.2309699292*m,-1.2684380046*u+2.6097574011*l-0.3413193965*m,-0.0041960863*u-0.7034186147*l+1.707614701*m]},n=t,a=r(n);while(n>0&&a.some((s)=>s<-0.0001||s>1.0001))n-=0.004,a=r(Math.max(n,0));return`#${a.map((s)=>{let i=Math.min(1,Math.max(0,s)),c=i<=0.0031308?12.92*i:1.055*i**0.4166666666666667-0.055;return Math.round(c*255).toString(16).padStart(2,"0")}).join("")}`}function Ew(e,t,o){let r=(e.match(/\w\w/g)??[]).map((a)=>parseInt(a,16)),n=(t.match(/\w\w/g)??[]).map((a)=>parseInt(a,16));return`#${r.map((a,s)=>Math.round(a+(n[s]-a)*o).toString(16).padStart(2,"0")).join("")}`}function Mw(e){let t=Math.floor(e()*Xh)*(360/Xh),o=t>=50&&t<=130,r=ke(e,vw),n=o&&r==="deep"?"bright":r,a=ke(e,Rw),s=(t+Pw[a])%360,i=n==="bright"&&o?0.86:Tw[n],c=Aw[n],u=i<0.8,l=u?vl(0.96,0.05,s):vl(0.4,0.15,s),m=vl(i,c,t),f=vl(i+(u?-0.06:0.045),c,t);return{name:`${Math.round(t)}° ${n} ${a}`,bg:m,fg:l,bg2:f}}function Mf(e,t,o){let r=Mw(o),n=ke(o,Rl),a=t==="curated"?n:r;if(typeof e==="number"){let s=Rl.length;a=Rl[(e%s+s)%s]}if(e&&typeof e==="object"&&e.bg&&e.fg)a=e;return{...a,bg2:a.bg2??Ew(a.bg,a.fg,0.14)}}var Yh=Math.PI*2,Un=0.000000001,Do=50,Tl=(e,t,o)=>({x:e.x+t*Math.cos(o),y:e.y+t*Math.sin(o)}),kf=(e)=>e.kind==="line"?e.from:Tl(e.c,e.r,e.from),Lf=(e)=>e.kind==="line"?e.to:Tl(e.c,e.r,e.to),Kh=(e,t)=>Math.abs(e.x-t.x)<0.000001&&Math.abs(e.y-t.y)<0.000001;function kw(e){if(!e.square)return[{kind:"arc",c:{x:Do,y:Do},r:Do,from:-Math.PI,to:Math.PI}];let t=Math.min(Math.max(e.radius,0),Do),o=100-t;return[{kind:"line",from:{x:t,y:0},to:{x:o,y:0}},{kind:"arc",c:{x:o,y:t},r:t,from:-Math.PI/2,to:0},{kind:"line",from:{x:100,y:t},to:{x:100,y:o}},{kind:"arc",c:{x:o,y:o},r:t,from:0,to:Math.PI/2},{kind:"line",from:{x:o,y:100},to:{x:t,y:100}},{kind:"arc",c:{x:t,y:o},r:t,from:Math.PI/2,to:Math.PI},{kind:"line",from:{x:0,y:o},to:{x:0,y:t}},{kind:"arc",c:{x:t,y:t},r:t,from:Math.PI,to:3*Math.PI/2}].filter((n)=>n.kind==="arc"?n.r>Un:!Kh(n.from,n.to))}function Lw(e,t){let o=(m)=>t.nx*m.x+t.ny*m.y-t.d;if(e.kind==="line"){let m=o(e.from),f=o(e.to);if(m<=Un&&f<=Un)return[e];if(m>-Un&&f>-Un)return[];let d=m/(m-f),p={x:e.from.x+d*(e.to.x-e.from.x),y:e.from.y+d*(e.to.y-e.from.y)};return[m<0?{kind:"line",from:e.from,to:p}:{kind:"line",from:p,to:e.to}]}let{c:r,r:n,from:a,to:s}=e,i=(t.d-t.nx*r.x-t.ny*r.y)/n,c=[];if(Math.abs(i)<1){let m=Math.atan2(t.ny,t.nx),f=Math.acos(i);for(let d of[m-f,m+f]){let p=d;while(p<a)p+=Yh;while(p>s)p-=Yh;if(p>a+Un&&p<s-Un)c.push(p)}}let u=[a,...c.sort((m,f)=>m-f),s],l=[];for(let m=0;m<u.length-1;m++){let f=u[m],d=u[m+1];if(o(Tl(r,n,(f+d)/2))<=0)l.push({kind:"arc",c:r,r:n,from:f,to:d})}return l}function Dw(e,t){let o=e.flatMap((n)=>Lw(n,t));if(o.length===0)return[];let r=[];for(let n=0;n<o.length;n++){let a=o[n];r.push(a);let s=o[(n+1)%o.length];if(!Kh(Lf(a),kf(s)))r.push({kind:"line",from:Lf(a),to:kf(s)})}return r}var Pl=(e)=>`${De(e.x)} ${De(e.y)}`;function Fw(e){if(e.length===0)return"";let t=`M${Pl(kf(e[0]))}`;for(let o of e){if(o.kind==="line"){t+=`L${Pl(o.to)}`;continue}let r=o.to-o.from;if(r>Math.PI*1.999){let n=(o.from+o.to)/2;t+=`A${De(o.r)} ${De(o.r)} 0 0 1 ${Pl(Tl(o.c,o.r,n))}`}t+=`A${De(o.r)} ${De(o.r)} 0 ${r>Math.PI&&r<=Math.PI*1.999?1:0} 1 ${Pl(Lf(o))}`}return`${t}Z`}function _n(e,t,o,r){let n=r*Math.PI/180,a=e*Math.cos(n)-t*Math.sin(n),s=e*Math.sin(n)+t*Math.cos(n);return{nx:a,ny:s,d:o+a*Do+s*Do}}function _s(e,t){let o=kw(e);for(let r of t)o=Dw(o,r);return Fw(o)}function Jh(e,t,o,r){if(!e.square)return Math.hypot(t-Do,o-Do)+r<=Do;let n=Do-r,a=Math.max(Math.min(Math.max(e.radius,0),Do)-r,0),s=Math.max(Math.abs(t-Do)-(n-a),0),i=Math.max(Math.abs(o-Do)-(n-a),0);return Math.hypot(s,i)<=a}var Wn=["solid","split","quarter","ring","halo","stripes","horizon","polka"],Ow=(e,t,o,r)=>`<circle cx="${De(e)}" cy="${De(t)}" r="${De(o)}" fill="${r}"/>`,Al=(e,t)=>e?`<path d="${e}" fill="${t}"/>`:"";function Qh(e,t,o,r,n){let{bg:a,bg2:s}=o,i=Math.floor(e()*8)*45,c=Math.floor(e()*4)*90,u=r(a);if(t==="split")return u+Al(_s(n,[_n(-1,0,0,i)]),s);if(t==="quarter")return u+Al(_s(n,[_n(-1,0,0,c),_n(0,-1,0,c)]),s);if(t==="ring")return r(s)+`<g transform="translate(50 50) scale(0.84) translate(-50 -50)">${u}</g>`;if(t==="halo")return u+`<circle cx="50" cy="50" r="34" fill="${s}"/>`;if(t==="stripes"){let l=i%180===0?45:135,m=[];for(let f=-4;f<=4;f++){let d=f*16;m.push(_s(n,[_n(-1,0,-(d-4),l),_n(1,0,d+4,l)]))}return u+Al(m.join(""),s)}if(t==="horizon")return u+Al(_s(n,[_n(0,-1,-16,c)]),s);if(t==="polka"){let l="";for(let m=0;m<6;m++)for(let f=0;f<6;f++){let d=8+f*17+m%2*8.5,p=8+m*17;if(Jh(n,d,p,2.6))l+=Ow(d,p,2.6,s)}return u+l}return u}var zn=(e,t)=>e[t],pt=(e,t,o,r)=>`<circle cx="${De(e)}" cy="${De(t)}" r="${De(o)}" fill="${r}"/>`,cr=(e,t)=>`<polygon points="${e.map((o)=>o.map(De).join(",")).join(" ")}" fill="${t}"/>`,ut=(e,t)=>{if(!e)return t;return`<g transform="rotate(${e} 50 50)">${t}</g>`},El={dots(e,{fg:t}){let o=ke(e,[2,3,3,4,4]),r=zn({2:20,3:28,4:30},o),n=zn({2:7.5,3:5,4:3.6},o),a=zn({2:["full","diag"],3:["full","plus","x","ring","linked"],4:["full","ring","x","diag","center"]},o),s=ke(e,a),i=e()<0.3?45:0,c=r/(o-1),u=50-r/2,l="";if(s==="linked"){let f="";for(let d=0;d<o;d++){let p=u+d*c;f+=`M${u} ${p}H${u+r}M${p} ${u}V${u+r}`}l+=`<path d="${f}" stroke="${t}" stroke-width="1.6" fill="none"/>`}let m=(f,d)=>{let p=f===0||d===0||f===o-1||d===o-1,S=(f===0||f===o-1)&&(d===0||d===o-1);if(s==="plus")return f!==1&&d!==1;if(s==="x")return(f+d)%2===1;if(s==="ring")return o===3?f===1&&d===1:!p;if(s==="diag")return o===2?f!==d:f!==d&&f+d!==o-1;if(s==="center")return p&&!S;return!1};for(let f=0;f<o;f++)for(let d=0;d<o;d++){if(m(f,d))continue;l+=pt(u+f*c,u+d*c,s==="linked"?3.6:n,t)}return ut(i,l)},flower(e,{fg:t,bg:o}){let r=ke(e,[4,4,5,6,8]),[n,a]=zn({4:[11,12],5:[12,10],6:[13,9],8:[15,7]},r),s=e()<0.5?0:Math.PI/r,i=ke(e,["fill","hole","none"]),c="";for(let u=0;u<r;u++){let l=u/r*La+s-Math.PI/2;c+=pt(50+Math.cos(l)*n,50+Math.sin(l)*n,a,t)}if(i==="fill")c+=pt(50,50,n,t);if(i==="hole")c+=pt(50,50,a*0.5,o);return c},burst(e,{fg:t}){let o=ke(e,[5,6,8,10,12]),r=e()<0.6,n=ke(e,["dot","ring","none"]),a=r?17:22,s="",i="";for(let c=0;c<o;c++){let u=c/o*La-Math.PI/2,l=Math.cos(u),m=Math.sin(u);if(s+=`M${De(50+l*8)} ${De(50+m*8)}L${De(50+l*a)} ${De(50+m*a)}`,r)i+=pt(50+l*22,50+m*22,3.4,t)}if(n==="dot")i+=pt(50,50,4.5,t);if(n==="ring")i+=`<circle cx="50" cy="50" r="4.5" fill="none" stroke="${t}" stroke-width="2.5"/>`;return`<path d="${s}" stroke="${t}" stroke-width="3" stroke-linecap="round"/>${i}`},stairs(e,{fg:t}){let o=ke(e,[2,3,4]),r=Math.floor(e()*4)*90,[n,a,s,i]=[29,29,71,71],c=(s-n)/o,u=(i-a)/o,l=[[n,i],[s,i],[s,a]];for(let f=1;f<o;f++)l.push([s-f*c,a+(f-1)*u],[s-f*c,a+f*u]);l.push([n,a+(o-1)*u]);let m=e()<0.5?`<rect x="29" y="29" width="42" height="42" fill="${t}" opacity="0.35"/>`:"";return ut(r,m+cr(l,t))},hourglass(e,{fg:t}){let o=ke(e,[3,6]),n=e()<0.6?[[30,28],[70,28],[70,34],[50+o,50],[70,66],[70,72],[30,72],[30,66],[50-o,50],[30,34]]:[[30,28],[70,28],[50+o,50],[70,72],[30,72],[50-o,50]];return ut(ke(e,[0,45,90,135]),cr(n,t))},plus(e,{fg:t,bg:o}){let r=ke(e,[14,18,22]),n=ke(e,[0,3]),a=50-r/2,s=`<rect x="${a}" y="28" width="${r}" height="44" rx="${n}" fill="${t}"/><rect x="28" y="${a}" width="44" height="${r}" rx="${n}" fill="${t}"/>`,i=e()<0.25?45:0;if(r===22&&e()<0.6)for(let c of[-5.5,5.5])for(let u of[-5.5,5.5])s+=pt(50+c,50+u,2.2,o);return ut(i,s)},leaves(e,{fg:t,bg:o}){let r=ke(e,[2,3,4,4,6]),n=`<path d="M50 50C40 42 40 28 50 22C60 28 60 42 50 50Z" fill="${t}"/>`,a=e()<0.5?0:180/r,s="";for(let i=0;i<r;i++)s+=ut(360/r*i+a,n);if(e()<0.4)s+=pt(50,50,3.5,o);return s},rings(e,{fg:t}){let o=ke(e,[2,3,4]),r=o===4?5.5:7,n=o===4?2.8:3.5,a=e()<0.35,s="";for(let i=0;i<o;i++){let c=22-i*r,u=a?50+(22-c):50;s+=`<circle cx="50" cy="${u}" r="${c}" fill="none" stroke="${t}" stroke-width="${n}"/>`}if(e()<0.5){let i=22-o*r;s+=pt(50,a?50+(22-i):50,Math.max(2.5,Math.min(6,i-2)),t)}return s},checker(e,{fg:t}){let o=ke(e,[2,3,4,5]),r=e()<0.5?0:1,n=40/o,a="";for(let s=0;s<o;s++)for(let i=0;i<o;i++){if((s+i)%2!==r)continue;a+=`<rect x="${De(30+s*n)}" y="${De(30+i*n)}" width="${De(n)}" height="${De(n)}" fill="${t}"/>`}return ut(e()<0.4?45:0,a)},sparkle(e,{fg:t}){let o=(s,i,c)=>{let u=c*0.14,l=(m,f)=>`${De(m)} ${De(f)}`;return`<path d="M${l(s,i-c)}Q${l(s+u,i-u)} ${l(s+c,i)}Q${l(s+u,i+u)} ${l(s,i+c)}Q${l(s-u,i+u)} ${l(s-c,i)}Q${l(s-u,i-u)} ${l(s,i-c)}Z" fill="${t}"/>`},r=e()<0.4,a=ke(e,[[[50,50,24]],[[46,54,18],[65,34,8]],[[44,56,15],[64,42,9],[42,31,6]]]).map(([s,i,c],u)=>{if(r&&u===0)return`<g transform="rotate(45 ${s} ${i})">${o(s,i,c*0.55)}</g>${o(s,i,c)}`;return o(s,i,c)}).join("");return ut(ke(e,[0,90]),a)},arch(e,{fg:t,bg:o}){let r=ke(e,[[26,13],[26,18,10]]),n="";return r.forEach((a,s)=>{n+=`<path d="M${50-a} 63A${a} ${a} 0 0 1 ${50+a} 63Z" fill="${s%2?o:t}"/>`}),ut(Math.floor(e()*4)*90,n)},pinwheel(e,{fg:t}){let o=ke(e,[[[28,28],[50,28],[50,50]],[[28,28],[50,28],[28,50]],[[50,50],[50,26],[33.7,33.7]]]),r="";for(let n=0;n<4;n++)r+=ut(n*90,cr(o,t));if(e()<0.4)r+=pt(50,50,4,t);return ut(e()<0.5?0:45,r)},waves(e,{fg:t}){let o=ke(e,[[43,57],[38,50,62],[33.5,44.5,55.5,66.5]]),r=o.length===4?3.5:4,n=e()<0.5,a=7.333333333333333,s="";for(let i of o){if(n){s+=`M28 ${i}Q${De(31.666666666666668)} ${i-r*1.6} ${De(35.333333333333336)} ${i}`;for(let c=2;c<=6;c++)s+=`T${De(28+c*7.333333333333333)} ${i}`;continue}s+=`M28 ${i+r}`;for(let c=1;c<=6;c++)s+=`L${De(28+c*7.333333333333333)} ${i+(c%2?-r:r)}`}return ut(ke(e,[0,45,90,135]),`<path d="${s}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},halves(e,{fg:t}){let o=ke(e,[3,5]),r=`<path d="M${50-o} 28A22 22 0 0 0 ${50-o} 72Z" fill="${t}"/><path d="M${50+o} 28A22 22 0 0 1 ${50+o} 72Z" fill="${t}"/>`;return ut(ke(e,[0,45,90,135]),r)},diamond(e,{fg:t,bg:o}){let r=ke(e,[2,8]),n=`<rect x="34" y="34" width="32" height="32" rx="${r}" fill="${t}"/>`,a=ke(e,["none","hole","dot","nest"]);if(a==="hole")n+=`<rect x="43" y="43" width="14" height="14" rx="${r/2}" fill="${o}"/>`;if(a==="dot")n+=pt(50,50,5,o);if(a==="nest")n+=`<rect x="40" y="40" width="20" height="20" rx="${r/2}" fill="${o}"/><rect x="45" y="45" width="10" height="10" rx="${r/4}" fill="${t}"/>`;return ut(e()<0.7?45:0,n)},moon(e,{fg:t}){let o=Math.floor(e()*8)*45-22,r=ke(e,[10,14]),n=21,a=18,s=(117+r*r)/(2*r),i=Math.sqrt(441-s*s),c=`${De(50+s)} ${De(50-i)}`,u=`${De(50+s)} ${De(50+i)}`,l=`<path d="M${c}A21 21 0 1 0 ${u}A18 18 0 ${s-r>0?1:0} 1 ${c}Z" fill="${t}"/>`;if(e()<0.4)l+=pt(50+r+3,43,3,t);return ut(o,l)},eye(e,{fg:t,bg:o}){let r=ke(e,[10,14]),n=`<path d="M26 50Q50 ${50-r*2} 74 50Q50 ${50+r*2} 26 50Z" fill="${t}"/>`;if(n+=pt(50,50,r*0.75,o),e()<0.5)n+=pt(50,50,r*0.35,t);return ut(e()<0.5?0:90,n)},triangle(e,{fg:t,bg:o}){let r=ke(e,["solid","hole","split"]),n=(s,i,c,u=1)=>{let l=c*0.866;return[[s,i-u*2*l/3],[s+c/2,i+u*l/3],[s-c/2,i+u*l/3]]},a=cr(n(50,53,46),t);if(r==="hole")a+=cr(n(50,53,18),o);if(r==="split")a+=cr(n(50,53,23,-1),o);return ut(Math.floor(e()*4)*90,a)},bars(e,{fg:t}){let o=ke(e,[3,4,5]),r=zn({3:9,4:7,5:5.6},o),n=(44-o*r)/(o-1),a=ke(e,["center","bottom"]),s="";for(let i=0;i<o;i++){let c=ke(e,[14,20,26,32,38,44]),u=a==="center"?50-c/2:72-c;s+=`<rect x="${De(28+i*(r+n))}" y="${u}" width="${r}" height="${c}" rx="${r/2}" fill="${t}"/>`}return ut(e()<0.5?0:90,s)},pixels(e,{fg:t}){let o=ke(e,[3,4,5]),r=e()<0.35,n=44/o,a=Math.ceil(o/2),s=[];for(let i=0;i<o;i++)for(let c=0;c<a;c++)if(e()<0.6)s.push([c,i],[o-1-c,i]);if(s.length<o*o*0.45){let i=Math.floor(o/2);for(let c=0;c<o;c++)s.push([i,c],[c,i])}return s.map(([i,c])=>{if(r)return pt(28+i*n+n/2,28+c*n+n/2,n*0.4,t);return`<rect x="${De(28+i*n)}" y="${De(28+c*n)}" width="${De(n+0.4)}" height="${De(n+0.4)}" fill="${t}"/>`}).join("")},chain(e,{fg:t}){let o=ke(e,[2,3,4]),r=ke(e,[0,45,90,135]),n=zn({2:7,3:7.5,4:9},o),a=zn({2:13,3:12,4:11},o),s="";for(let i=0;i<o;i++){let c=i/o*La;s+=`<circle cx="${De(50+Math.cos(c)*n)}" cy="${De(50+Math.sin(c)*n)}" r="${a}" fill="none" stroke="${t}" stroke-width="${o===4?3.5:4}"/>`}return ut(r,s)},gear(e,{fg:t,bg:o}){let r=ke(e,[6,8,10,12]),n=pt(50,50,16,t);for(let s=0;s<r;s++)n+=`<rect x="46.5" y="27" width="7" height="10" rx="1.5" fill="${t}" transform="rotate(${De(360/r*s)} 50 50)"/>`;let a=ke(e,[0,5,8]);if(a)n+=pt(50,50,a,o);return n},orbit(e,{fg:t}){let o=Math.floor(e()*8)*45,r=ke(e,[7,9]),n=e()<0.4,a=`<circle cx="50" cy="50" r="19" fill="none" stroke="${t}" stroke-width="3"/>`+pt(50,50,r,t),s=(i)=>{let c=i*Math.PI/180;return pt(50+Math.cos(c)*19,50+Math.sin(c)*19,4.5,t)};if(a+=s(o),n)a+=s(o+180);return a},truchet(e,{fg:t}){let r="";for(let n=0;n<2;n++)for(let a=0;a<2;a++){let s=e()<0.5?0:1,i=e()<0.5?0:1,c=28+a*22+s*22,u=28+n*22+i*22,l=s?-1:1,m=i?-1:1;r+=`<path d="M${c} ${u}L${c+l*22} ${u}A22 22 0 0 ${l*m>0?1:0} ${c} ${u+m*22}Z" fill="${t}"/>`}return r},chevrons(e,{fg:t}){let r=ke(e,[[43,57],[38,50,62]]).map((n)=>`M30 ${n+6}L50 ${n-6}L70 ${n+6}`).join("");return ut(Math.floor(e()*4)*90,`<path d="${r}" fill="none" stroke="${t}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>`)},drop(e,{fg:t,bg:o}){let r=`<path d="M50 24C56 32 69 43 69 54A19 19 0 0 1 31 54C31 43 44 32 50 24Z" fill="${t}"/>`,n=ke(e,["none","dot","ring"]);if(n==="dot")r+=pt(50,55,6,o);if(n==="ring")r+=pt(50,55,9,o)+pt(50,55,4,t);return ut(Math.floor(e()*8)*45,r)},spiral(e,{fg:t}){let o=ke(e,[2,2.75]),r=e()<0.5?1:-1,n=o*La,a="";for(let s=0;s<=n;s+=0.2){let i=1+21*s/n;a+=`${a?"L":"M"}${De(50+Math.cos(s*r)*i)} ${De(50+Math.sin(s*r)*i)}`}return ut(Math.floor(e()*4)*90,`<path d="${a}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},stripes(e,{fg:t}){let o=ke(e,[3,4,5]),r=23,n=46/(o+1),a="";for(let s=0;s<o;s++){let i=-23+n*(s+1),c=Math.sqrt(529-i*i);a+=`M${De(50-c)} ${De(50+i)}H${De(50+c)}`}return ut(ke(e,[0,45,90,135]),`<path d="${a}" stroke="${t}" stroke-width="4.5" stroke-linecap="round"/>`)},cube(e,{fg:t}){let o=[50,28],r=[69.05,39],n=[69.05,61],a=[50,72],s=[30.95,61],i=[30.95,39],c=[50,50],u=e()<0.2,l=ke(e,[[1,0.5,0.75],[1,0.75,0.5],[0.5,1,0.75],[0.75,0.5,1],[1,0.45,0],[1,0,0.45],[0,1,0.5]]),m="";if(u){let f=(d)=>d.map(De).join(" ");m=`<path d="M${f(o)}L${f(r)}L${f(n)}L${f(a)}L${f(s)}L${f(i)}ZM${f(i)}L${f(c)}L${f(r)}M${f(c)}L${f(a)}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`}if(!u)[[o,r,c,i],[c,r,n,a],[i,c,a,s]].forEach((f,d)=>{if(!l[d])return;m+=cr(f,t).replace("/>",l[d]<1?` opacity="${l[d]}"/>`:"/>")});return ut(e()<0.5?0:180,m)},peaks(e,{fg:t}){let o=e()<0.6,r=e()<0.5,n=o?cr([[50,66],[61,46],[72,66]],t).replace("/>",' opacity="0.6"/>')+cr([[28,66],[46,34],[64,66]],t):cr([[28,66],[50,32],[72,66]],t);if(r)n+=pt(o?64:66,34,5,t);if(e()<0.5)return`<g transform="matrix(-1 0 0 1 100 0)">${n}</g>`;return n},hex(e,{fg:t,bg:o}){let r=e()<0.5?0:30,n=(c)=>Array.from({length:6},(u,l)=>{let m=l/6*La-Math.PI/2;return[50+Math.cos(m)*c,50+Math.sin(m)*c]}),a=(c,u)=>cr(n(c),u),s=ke(e,["none","hole","dot","nested","outline"]);if(s==="outline")return ut(r,`<polygon points="${n(21).map((c)=>c.map(De).join(",")).join(" ")}" fill="none" stroke="${t}" stroke-width="4" stroke-linejoin="round"/>${a(8,t)}`);let i=a(23,t);if(s==="hole")i+=a(11,o);if(s==="dot")i+=pt(50,50,7,o);if(s==="nested")i+=a(15,o)+a(8,t);return ut(r,i)},bubbles(e,{fg:t}){let o=ke(e,[[[44,46,15],[63,60,8],[61,37,5]],[[50,42,13],[37,63,7],[63,63,7]],[[40,58,12],[60,44,9],[52,30,4]]]);return ut(Math.floor(e()*4)*90,o.map(([r,n,a])=>pt(r,n,a,t)).join(""))}},Df=Object.keys(El);var t2=1,e2=`v${t2}:`;function Ml(e){if(!e.startsWith(e2))return null;let[t,o,r,n]=e.slice(e2.length).split(":");if(!t)return null;let a={seed:decodeURIComponent(t)};if(o)a.colorSeed=decodeURIComponent(o);if(r&&Wn.includes(r))a.background=r;if(n==="c")a.colors="curated";return a}var Nw=(e)=>e.replace(/[&<>"]/g,(t)=>({"&":"&","<":"<",">":">",'"':"""})[t]),o2=(e)=>Wn.includes(e),r2=(e)=>typeof e==="string"&&(e in El);function n2(e,t,o){let r=e?.filter(t)??[];return r.length>0?r:o}function Bw(e,t){let o=Ef(Af(e)),r=Mf(t.palette,t.colors,o);if(t.colorSeed&&t.palette===void 0)r=Mf(void 0,t.colors,Ef(Af(t.colorSeed)));let n=ke(o,n2(t.backgrounds,o2,Wn)),a=o2(t.background)?t.background:n,s=r2(t.glyph)?t.glyph:ke(o,n2(t.glyphs,r2,Df)),i=El[s](o,r),c=t.size??64,u=t.shape==="square",l=t.radius??24,f=Qh(o,a,r,(S)=>u?`<rect width="100" height="100" rx="${l}" fill="${S}"/>`:`<circle cx="50" cy="50" r="50" fill="${S}"/>`,{square:u,radius:l}),d=t.title?` role="img"><title>${Nw(t.title)}</title>`:' aria-hidden="true">';return{svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="${c}" height="${c}" style="display:block;width:100%;height:100%"${d}${f}${i}</svg>`,glyph:s,palette:r,background:a}}function Ff(e,t={}){let o=typeof e==="string"?Ml(e):null,r=o??(typeof e==="string"?{seed:e}:e),n={...t};if(o)n.colors="generated";if(r.colorSeed!==void 0)n.colorSeed=r.colorSeed;if(r.background!==void 0)n.background=r.background;if(r.colors!==void 0)n.colors=r.colors;return Bw(r.seed,n)}function Of(e,t){return Ff(e,t).svg}import{jsx as Uw}from"react/jsx-runtime";function wr(e){let{value:t,size:o=40,alt:r,glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:f,className:d,style:p,...S}=e,g=Of(t,{glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:f,size:o,title:r});return Uw("span",{...S,className:["overflow-hidden [&>svg]:block [&>svg]:size-full",d].filter(Boolean).join(" "),style:{display:"inline-block",width:o,height:o,minWidth:o,lineHeight:0,flexShrink:0,...p},dangerouslySetInnerHTML:{__html:g}})}import{createContext as Yw,useCallback as Dnt,useContext as Kw,useEffect as Fnt,useRef as Ont,useState as Nnt}from"react";import*as Da from"react";import*as kl from"react";var Nf=kl.createContext(void 0);function yr(e){let t=kl.useContext(Nf);if(t===void 0&&!e)throw Error(Ge(72));return t}import*as a2 from"react";var _w={...on,disabled:(e)=>e.disabled,instantType:(e)=>e.instantType,isInstantPhase:(e)=>e.isInstantPhase,trackCursorAxis:(e)=>e.trackCursorAxis,disableHoverablePopup:(e)=>e.disableHoverablePopup,lastOpenChangeReason:(e)=>e.openChangeReason,closeOnClick:(e)=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin};class Bf extends ar{constructor(e,t,o){let r=new kn;super(Ww(e,r,t,o),zw(r),_w)}setOpen=(e,t)=>{P0(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Re(ra,e))}}function Ww(e,t,o,r=!1){return{...Ia(t,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function zw(e){return{popupRef:a2.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}import{jsx as s2,jsxs as Gw}from"react/jsx-runtime";var i2=Ln(function(t){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:a=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:u,handle:l,triggerId:m,defaultTriggerId:f=null,children:d}=t,p=yc((H,E)=>new Bf({open:r,openProp:n,activeTriggerId:f,triggerIdProp:m},H,E));p.useControlledProp("openProp",n),p.useControlledProp("triggerIdProp",m),p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",u);let S=p.useState("open"),g=!o&&S,h=p.useState("activeTriggerId"),b=p.useState("mounted"),C=p.useState("payload");p.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:a,disabled:o}),pa(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:I,transitionStatus:x}=da(g,p),y=p.useState("isInstantPhase"),w=p.useState("instantType"),v=p.useState("lastOpenChangeReason"),R=Da.useRef(null);_(()=>{if(S&&o)p.setOpen(!1,Re(Ob))},[S,o,p]),_(()=>{if(x==="ending"&&v===yn||x!=="ending"&&y){if(w!=="delay")R.current=w;p.set("instantType","delay")}else if(R.current!==null)p.set("instantType",R.current),R.current=null},[x,y,v,w,p]),_(()=>{if(g){if(h==null)p.set("payload",void 0)}},[p,h,g]),Da.useImperativeHandle(i,()=>({unmount:I,close:()=>p.setOpen(!1,Re(Nu))}),[I,p]);let k=g||b||!o&&s!=="none";return Gw(Nf.Provider,{value:p,children:[l&&s2(ma,{handle:l,store:p}),k&&s2(Zw,{store:p,disabled:o,trackCursorAxis:s}),typeof d==="function"?d({payload:C}):d]})});function Zw({store:e,disabled:t,trackCursorAxis:o}){let r=e.useState("floatingRootContext"),n=Mn(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=Im(r,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),s=Da.useMemo(()=>Dt(a.reference,n.reference),[a.reference,n.reference]);return ga(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:n.floating??Ue}),null}import*as Dl from"react";import*as Ll from"react";var $w=Ll.createContext(void 0);function c2(){return Ll.useContext($w)}var l2=600;var u2="data-base-ui-tooltip-trigger";function m2(e){let t=Ze(e);return Ve(t)?t:null}var f2=ha(function(t,o){let{render:r,className:n,style:a,handle:s,payload:i,disabled:c,delay:u,closeOnClick:l=!0,closeDelay:m,id:f,...d}=t,p=yr(!0),g=ba(s)??p;if(!g)throw Error(Ge(82));let h=ro(f),b=g.useState("isTriggerActive",h),C=g.useState("isOpenedByTrigger",h),I=g.useState("floatingRootContext"),x=Dl.useRef(null),y=m??0,{registerTrigger:w,isMountedByThisTrigger:v}=fa(h,x,g,{payload:i,closeOnClick:l,closeDelay:y}),R=c2(),{activeIdRef:k,delayRef:H,isInstantPhase:E,hasProvider:D}=Ju(I,{open:C}),M=Sa(I);g.useSyncedValue("isInstantPhase",E);let P=g.useState("disabled"),F=c??P,G=ct(F),T=g.useState("trackCursorAxis"),N=g.useState("disableHoverablePopup"),X=Dl.useRef(!1),Y=Je(),A=Dl.useRef(void 0);function ue(){if(D&&k.current!=null)return 0;return u??R??l2}function V(fe){let Se=x.current;if(!Se||!fe)return!1;let oe=tr(fe,`[${u2}]`);return oe!==null&&oe!==Se&&me(Se,oe)}function Z(fe){let Se=V(fe);if(X.current=Se,Se)M.openChangeTimeout.clear(),M.restTimeout.clear(),M.restTimeoutPending=!1,Y.clear();return Se}let q=As(I,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!N&&T!=="both"?Es():null,restMs:ue,delay(){if(m==null&&D)return{close:Dr(H.current,"close")};return{close:y}},triggerElementRef:x,isActiveTrigger:b,isClosing:()=>g.select("transitionStatus")==="ending",shouldOpen(){return!X.current}}),se=Ps(I,{enabled:!F}).reference,Pe=(fe)=>{let Se=X.current,oe=m2(fe),be=Z(oe),W=x.current,B=W&&oe&&me(W,oe);if(be&&g.select("open")&&g.select("lastOpenChangeReason")===jt){g.setOpen(!1,Re(jt,fe));return}if(Se&&!be&&B&&!G.current&&!g.select("open")&&W&&Eo(A.current)){let ee=()=>{if(!X.current&&!G.current&&!g.select("open"))g.setOpen(!0,Re(jt,fe,W))},z=ue();if(z===0)Y.clear(),ee();else Y.start(z,ee)}},J=g.useState("appliedTriggerProps",v||T!=="none");return ye("button",t,{state:{open:C},ref:[o,w,x],props:[q,se,J,{onMouseOver(fe){Pe(fe.nativeEvent)},onFocus(fe){if(V(m2(fe.nativeEvent)))fe.preventBaseUIHandler()},onMouseLeave(){X.current=!1,Y.clear(),A.current=void 0},onPointerEnter(fe){A.current=fe.pointerType},onPointerDown(fe){if(A.current=fe.pointerType,g.set("closeOnClick",l),l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},onClick(fe){if(l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},id:h,[ss]:F?"":void 0,[u2]:F?void 0:""},d],stateAttributesMapping:Zi})});import*as h2 from"react";import*as Fl from"react";var Hf=Fl.createContext(void 0);function p2(){let e=Fl.useContext(Hf);if(e===void 0)throw Error(Ge(70));return e}import*as Ol from"react";import*as d2 from"react-dom";import{jsxs as qw}from"react/jsx-runtime";var Nl=Ol.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=xc({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return qw(Ol.Fragment,{children:[l,u&&d2.createPortal(r,u)]})});import{jsx as g2}from"react/jsx-runtime";var I2=h2.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t;if(!(yr().useState("mounted")||r))return null;return g2(Hf.Provider,{value:r,children:g2(Nl,{ref:o,...n})})});import*as Vl from"react";import*as Bl from"react";var Vf=Bl.createContext(void 0);function Hl(){let e=Bl.useContext(Vf);if(e===void 0)throw Error(Ge(71));return e}import{jsx as jw}from"react/jsx-runtime";var b2=Vl.forwardRef(function(t,o){let{render:r,className:n,anchor:a,positionMethod:s="absolute",side:i="top",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:f=5,arrowPadding:d=5,sticky:p=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=Sc,style:h,...b}=t,C=yr(),I=p2(),x=C.useState("open"),y=C.useState("mounted"),w=C.useState("trackCursorAxis"),v=C.useState("disableHoverablePopup"),R=C.useState("floatingRootContext"),k=C.useState("instantType"),H=C.useState("transitionStatus"),E=C.useState("adaptiveOrigin"),D=Zc({anchor:a,positionMethod:s,floatingRootContext:R,mounted:y,side:i,sideOffset:u,align:c,alignOffset:l,collisionBoundary:m,collisionPadding:f,sticky:p,arrowPadding:d,disableAnchorTracking:S,keepMounted:I,collisionAvoidance:g,adaptiveOrigin:E}),M=Vl.useMemo(()=>({open:x,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:w!=="none"?"tracking-cursor":k}),[x,D.side,D.align,D.anchorHidden,w,k]),P=qc(t,M,{styles:D.positionerStyles,transitionStatus:H,props:b,refs:[o,C.useStateSetter("positionerElement")],hidden:!y,inert:!x||w==="both"||v});return jw(Vf.Provider,{value:D,children:P})});import*as C2 from"react";var S2=C2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=yr(),{side:c,align:u}=Hl(),l=i.useState("open"),m=i.useState("instantType"),f=i.useState("transitionStatus"),d=i.useState("popupProps"),p=i.useState("floatingRootContext"),S=i.useState("disabled"),g=i.useState("closeDelay");Go({open:l,ref:i.context.popupRef,onComplete(){if(l)i.context.onOpenChangeComplete?.(!0)}}),Ts(p,{enabled:!S,closeDelay:g});let h=i.useStateSetter("popupElement");return ye("div",t,{state:{open:l,side:c,align:u,instant:m,transitionStatus:f},ref:[o,i.context.popupRef,h],props:[ua,d,wa(f),s],stateAttributesMapping:ta})});import*as x2 from"react";var w2=x2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=yr(),{arrowRef:c,side:u,align:l,arrowUncentered:m,arrowStyles:f}=Hl(),d=i.useState("open"),p=i.useState("instantType");return ye("div",t,{state:{open:d,side:u,align:l,uncentered:m,instant:p},ref:[o,c],props:[{style:f,"aria-hidden":!0},s],stateAttributesMapping:wn})});import{jsx as Ws,jsxs as Xw}from"react/jsx-runtime";function v2({...e}){return Ws(i2,{"data-slot":"tooltip",...e})}function R2({...e}){return Ws(f2,{"data-slot":"tooltip-trigger",...e})}function P2({className:e,side:t="top",sideOffset:o=4,align:r="center",alignOffset:n=0,children:a,...s}){return Ws(I2,{children:Ws(b2,{align:r,alignOffset:n,side:t,sideOffset:o,className:"isolate z-50",children:Xw(S2,{"data-slot":"tooltip-content",className:le("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[a,Ws(w2,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}import{useInsertionEffect as Rnt}from"react";import{jsx as an,jsxs as A2,Fragment as ny}from"react/jsx-runtime";var Jw=Yw(null);function Qw(){let e=Kw(Jw);if(!e)throw Error("useAvatarPicker and the AvatarPicker parts must be used inside <AvatarPickerRoot>.");return e}function T2(){return Qw()}function Ul(e,t,o,r,n,a=!1){function s(i){let{className:c,children:u,onClick:l,...m}=i,f=T2(),d=n(f),p=(h)=>{if(l?.(h),h.defaultPrevented)return;d()},S=a?"ga-ghost":"ga-icon",g=an(gt,{type:"button",variant:"ghost",size:a?"default":"icon","aria-label":u?void 0:o,...m,className:c?`${S} ${c}`:S,"data-part":t,onClick:p,children:u??r});if(a)return g;return A2(v2,{children:[an(R2,{render:g}),an(P2,{children:o})]})}return s.displayName=e,s}var ey=Ul("AvatarPickerShuffle","shuffle","Shuffle",A2(ny,{children:[an(Ti,{}),an("span",{className:"ga-label",children:"Shuffle"})]}),(e)=>e.shuffle,!0),ty=Ul("AvatarPickerNewShape","new-shape","New shape",an(bi,{}),(e)=>e.newShape),oy=Ul("AvatarPickerNewColors","new-colors","New colors",an(wi,{}),(e)=>e.newColors),ry=Ul("AvatarPickerNewBackground","new-background","New background",an(mi,{}),(e)=>e.newBackground);import{jsx as ve,jsxs as ht}from"react/jsx-runtime";function sy(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function M2({workspaceId:e,initialSettings:t,sessionToken:o,onClose:r,onSettingsChange:n,theme:a,assetBaseUrl:s,welcome:i}){let c=Gs(Vo.workspace,{workspaceId:e}),u=c===void 0?t:c,l=E2("");zs(()=>{if(!c)return;let B=JSON.stringify(c);if(l.current===B)return;l.current=B,n(c)},[n,c]);let m=u?{...u,theme:a}:u,f=Fa(Vo.openWebsite),d=Fa(Vo.startCustomer),p=Fa(Vo.sendCustomer),S=Fa(Vo.retryAgentResponse),g=Fa(Vo.generateAttachmentUploadUrl),h=Fa(Vo.markCustomerRead),[b,C]=Br(""),[I,x]=Br(),[y,w]=Br(""),[v,R]=Br(""),k=E2(null),[H,E]=Br(!1),[D,M]=Br(""),[P,F]=Br(),[G,T]=Br("chat"),[N,X]=Br(),Y=!!o,A=Gs(Vo.visitorProfile,b&&Y?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),ue=Gs(Vo.welcomeSuggestions,A&&i?.suggestions===void 0?{workspaceId:e,sessionToken:o}:"skip");zs(()=>{let B=`coristen:${e}`,ee=localStorage.getItem(B)??crypto.randomUUID();localStorage.setItem(B,ee),C(ee);let z=navigator.userAgent;X({currentPage:window.location.href,referrer:document.referrer,browser:sy(z),device:/Mobi|Android|iPhone|iPad/i.test(z)?"Mobile":navigator.platform||"Desktop"})},[e]);async function V(B){if(B.preventDefault(),!N||!o||H)return;E(!0),M("");try{let ee=y.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",z=await f({workspaceId:e,visitorId:b,sessionToken:o,name:ee,email:y,...N,newConversation:!0});x(z??void 0),T("chat")}catch{M("We couldn't save your email. Please try again.")}finally{E(!1)}}async function Z(){if(!A){T("chat");return}if(!N||H)return;E(!0),M("");try{let B=await f({workspaceId:e,visitorId:b,sessionToken:o,...A,...N,newConversation:!0});x(B??void 0),T("chat")}catch{M("We couldn't start a new conversation. Please try again.")}finally{E(!1)}}async function q(B,ee){if(!A)throw Error("Customer details are still loading");if(I)return await p({conversationId:I,visitorId:b,sessionToken:o,body:B,attachments:ee});if(!N)throw Error("Chat is still loading");await f({workspaceId:e,visitorId:b,sessionToken:o,...A,...N,newConversation:!0});let z=await d({workspaceId:e,visitorId:b,sessionToken:o,body:B,attachments:ee});return F({body:B,attachments:ee.map((ce)=>({...ce,url:null})),createdAt:Date.now()}),x(z),z}let se=Gs(Vo.customerMessages,I&&b&&Y?{conversationId:I,visitorId:b,sessionToken:o}:"skip"),Pe=Gs(Vo.visitorConversations,b&&Y?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),J=se?.at(-1);if(zs(()=>{if(se!==void 0)F(void 0)},[se]),zs(()=>{if(G==="chat"&&Y&&I&&b&&J?.sender==="merchant")h({conversationId:I,visitorId:b,sessionToken:o}).catch(()=>{})},[I,G,J?._id,J?.sender,h,o,Y,b]),zs(()=>{let B=(ee)=>{if(ee.key==="Escape"&&!ee.defaultPrevented)r()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[r]),m===void 0||!o)return null;if(m===null||m.enabled===!1)return ve(of,{className:"w-full max-w-md",children:ht(rf,{children:[ve(nf,{children:"Chat unavailable"}),ve(af,{children:m?"This chat is currently offline.":"This chat is no longer available."})]})});let de=`${{none:0,sm:6,md:10,lg:16}[m?.radius??"lg"]}px`,fe=m?.accentEnabled?m.brandColor:"var(--foreground)",Se=m.theme==="dark"?`color-mix(in oklch, ${fe} 20%, white)`:fe,oe=ht(vf,{children:[ve(Rf,{src:m.agentImageUrl||void 0,alt:m.agentName}),ve(Pf,{children:ve(wr,{value:m.agentName,size:32,className:"size-8"})})]}),be=ht("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto px-8 py-10 text-center",children:[ht(vf,{className:"size-12",children:[ve(Rf,{src:m.agentImageUrl||void 0,alt:m.agentName}),ve(Pf,{children:ve(wr,{value:m.agentName,size:48,className:"size-12"})})]}),ht("div",{className:"flex flex-col gap-1.5",children:[ve("p",{className:"text-base font-semibold",children:`Hi, I’m ${m.agentName}`}),ve("p",{className:"max-w-72 text-sm text-muted-foreground",children:A?i?.message??m.welcomeMessage:"Enter your email below so we can keep your conversation and share replies with you."})]}),A&&ve("div",{className:"flex w-full max-w-72 flex-col gap-1 pt-3",children:i?.suggestions===void 0&&ue===void 0?ve("div",{className:"flex flex-col items-center gap-3","aria-label":"Loading suggestions","aria-busy":"true",children:["w-4/5","w-3/5","w-2/3"].map((B)=>ve(ir,{className:`h-10 rounded-lg ${B}`},B))}):(i?.suggestions??(ue?.length?ue:[{title:"Tell me what you can help with",message:"What can you help me with, and where should I start?"},{title:"Help me understand my options",message:"Can you explain the options available and help me decide what to do next?"},{title:"I need help with something",message:"I need help with something and would like guidance on the next step."}])).map((B,ee)=>ve(gt,{type:"button",variant:"ghost",className:"h-auto min-h-10 w-full justify-center px-2.5 py-2 text-center text-sm font-medium whitespace-normal",disabled:H,onClick:()=>{E(!0),M(""),q(B.message.slice(0,2000),[]).catch(()=>M("Your message couldn't be sent. Please try again.")).finally(()=>E(!1))},children:ve("span",{className:"min-w-0 break-words",children:B.title})},`${ee}:${B.title}`))})]}),W=G==="history"?"history":I?`conversation:${I}`:A===null?"contact":"new";return ve("div",{className:m.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ht(of,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) bg-background text-foreground shadow-none",style:{"--primary":m.accentSendIcon?m.theme==="dark"?Se:fe:void 0,"--primary-foreground":m.accentSendIcon&&m.theme==="dark"?"var(--background)":void 0,"--configured-radius":de,backgroundColor:m?.tintedGrayscale?`color-mix(in oklch, ${fe} 4%, var(--background))`:void 0},children:[ht(rf,{className:"shrink-0 gap-1 pb-5 select-none",style:m?.accentEnabled&&m.accentHeader?{color:Se}:void 0,children:[ht(nf,{className:"flex min-w-0 items-center gap-2",children:[m.logoUrl?ve("img",{src:m.logoUrl,alt:"",className:"size-6 shrink-0 object-contain"}):ve(wr,{value:m.name,size:24,className:"size-6"}),ve("span",{className:"truncate",children:m.name})]}),G==="history"&&ve(af,{className:"text-current opacity-85",children:"Continue a previous conversation"}),ht(k1,{className:"flex gap-1",children:[ht(gt,{variant:"ghost",size:"sm",onClick:()=>T(G==="chat"?"history":"chat"),children:[G==="chat"?ve(pi,{weight:"duotone","data-icon":"inline-start"}):ve(ii,{weight:"duotone","data-icon":"inline-start"}),G==="chat"?"Messages":"Chat"]}),ve(gt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:r,children:ve(Ho,{weight:"duotone"})})]})]}),D&&A!==null&&ve("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:D}),ve(L1,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:G==="history"?ve("div",{className:"flex min-h-0 w-full flex-col",children:ht("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[Pe===void 0&&Array.from({length:3}).map((B,ee)=>ht("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[ve(ir,{className:"h-4 w-4/5"}),ve(ir,{className:"h-3 w-2/5"})]},ee)),Pe?.map((B)=>ht(gt,{type:"button",variant:"ghost",className:"h-auto w-full justify-start gap-3 border border-transparent p-3 text-left whitespace-normal hover:border-border",onClick:()=>{x(B._id),T("chat")},children:[m.agentImageUrl?ve("img",{src:m.agentImageUrl,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):ve(wr,{value:m.agentName,size:32,className:"size-8"}),ht("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ht("span",{className:"flex items-center justify-between gap-2",children:[ve("span",{className:"text-sm font-medium",children:"Conversation"}),ve("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(B.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(B.lastMessageAt)})]}),ve("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:B.lastMessagePreview||"Attachment"}),!!B.customerUnreadCount&&ht(dl,{variant:"secondary",children:[B.customerUnreadCount," unread"]})]}),ve(li,{className:"size-4 shrink-0 text-muted-foreground"})]},B._id)),Pe?.length===0&&ve("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):A===void 0&&!I?ht("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ht("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[ve(ir,{className:"size-12 rounded-full"}),ve(ir,{className:"h-5 w-28"}),ht("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[ve(ir,{className:"h-4 w-full"}),ve(ir,{className:"h-4 w-4/5"})]})]}),ht("div",{className:"flex flex-col gap-3",children:[ht("div",{className:"flex flex-col gap-2",children:[ve(ir,{className:"h-4 w-24"}),ve(ir,{className:"h-8 w-full rounded-lg"})]}),ve(ir,{className:"h-9 w-full rounded-lg"})]})]}):A===null&&!I?ve("div",{className:"flex min-h-0 w-full flex-col",children:be}):I&&se===void 0&&P?ve(wf,{messages:[{_id:"pending-first-message",_creationTime:P.createdAt,sender:"customer",body:P.body,attachments:P.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:ve(wr,{value:b,size:32,className:"size-8"}),otherAvatar:oe}):!I||se===void 0||se.length===0?be:ve(wf,{messages:se,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:ve(wr,{value:b,size:32,className:"size-8"}),otherAvatar:oe,onRetry:(B)=>{M(""),S({conversationId:I,visitorId:b,customerMessageId:B,sessionToken:o}).catch(()=>M("The reply couldn't be retried. Please try again."))}},I)},W),G==="history"&&ve(il,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ht(gt,{variant:"secondary",size:"lg",className:"w-full",disabled:H||A===void 0,onClick:()=>void Z(),children:[ve(jn,{"data-icon":"inline-start"}),"Start a conversation"]})}),A===null&&!I&&G==="chat"&&ve(il,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ht("form",{className:"flex w-full flex-col gap-3",onSubmit:(B)=>void V(B),children:[ht("div",{className:"flex flex-col gap-2",children:[ve(Wh,{htmlFor:"customer-email",children:"Email address"}),ve(ef,{id:"customer-email",type:"email",value:y,onChange:(B)=>w(B.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),D&&ve("p",{role:"alert",className:"text-xs text-destructive",children:D}),ve(gt,{type:"submit",size:"lg",className:"w-full",disabled:H||!N,children:H?"Continuing...":"Continue"})]})}),A&&G==="chat"&&Y&&ve(il,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:ve(M1,{body:v,onBodyChange:R,inputRef:k,sendDisabled:!N,showPoweredBy:m.showPoweredBy,assetBaseUrl:s,upload:async(B)=>{if(B.size>m.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${m.maxAttachmentSizeMb} MB or smaller`);if(!m.allowedAttachmentTypes.some((Q)=>B.type===Q||B.type.startsWith(Q)))throw Error("This file type is not allowed");let ee=await g({workspaceId:e,visitorId:b,sessionToken:o}),z=await fetch(ee,{method:"POST",headers:{"Content-Type":B.type||"application/octet-stream"},body:B});if(!z.ok)throw Error("Upload failed");let{storageId:ce}=await z.json();return{storageId:ce,name:B.name,type:B.type||"application/octet-stream",size:B.size}},send:q})})]})})}function k2(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as D2 from"react";import*as _l from"react";var Uf=_l.createContext(void 0);function sn(){let e=_l.useContext(Uf);if(!e)throw Error(Ge(73));return e}var L2=0;function Wl(e){return L2+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${L2}`}function zl(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function _f(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function Wf(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var lr={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class zf extends ar{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:_f(e.toasts)},{},lr)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=Wf(this.state.toasts,t);r.toasts=n,r.toastMetadata=_f(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=lr.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||Wl("toast");if(e.id){let i=lr.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(Wf(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(lr.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=lr.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=lr.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((S)=>S.id===e?i:S));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,f=this.timers.has(e),d=u!==c,p=s.type==="loading";if(!m&&f){this.clearTimer(e);return}if(m&&(!f||d||l||p||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),lr.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=lr.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=Wf(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=zl(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=zl(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=zl(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Jt.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(me(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!lr.expandedOrOutOfFocus(this.state)?Jt.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:_f(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=st(Ae(this.state.viewport));if(!this.state.viewport||!me(this.state.viewport,t)||!Kr(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=lr.toasts(this.state),r=lr.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as iy,jsxs as cy}from"react/jsx-runtime";var F2=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=Xe(()=>new zf({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return jr(s.disposeEffect),D2.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),cy(Uf.Provider,{value:s,children:[iy(ly,{store:s,timeout:r,limit:n}),o]})};function ly(e){let{store:t,timeout:o,limit:r}=e;return _(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as qo from"react";var O2="--toast-frontmost-height";import{jsx as Gl,jsxs as Gf}from"react/jsx-runtime";var N2=qo.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=sn(),u=Je(),l=qo.useRef(!1),m=qo.useRef(!1),f=qo.useRef(!1),d=c.useState("isEmpty"),p=c.useState("toasts"),S=c.useState("focused"),g=c.useState("expanded"),h=c.useState("prevFocusElement"),b=p[0]?.height,C=p.some((T)=>T.transitionStatus==="ending"),I=p.filter((T)=>T.priority==="high");qo.useEffect(()=>{let T=c.state.viewport;if(!T||d)return;let N=qe(T),X=Ae(T);function Y(V){if(V.key==="F6"&&Ze(V)!==T)V.preventDefault(),c.set("prevFocusElement",st(X)),T?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function A(V){if(Ze(V)!==N)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ue(V){if(V.relatedTarget)return;let Z=Ze(V),q=st(Ae(T));if(Z===N||!me(T,Z)||!Kr(q))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return Qt(Ee(N,"keydown",Y),Ee(N,"blur",A,!0),Ee(N,"focus",ue,!0),Ee(X,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,d]);function x(T){l.current=!0;let N=T.relatedTarget===c.state.viewport?p.find((X)=>X.transitionStatus!=="ending"&&!X.limited):void 0;if(N)N.ref?.current?.focus();else c.restoreFocusToPrevElement()}function y(T){if(T.key==="Tab"&&T.shiftKey&&Ze(T.nativeEvent)===c.state.viewport)T.preventDefault(),c.restoreFocusToPrevElement()}function w(){if(c.state.toasts.some((N)=>N.transitionStatus==="ending")||f.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}qo.useEffect(w,[C,c]);function v(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function R(){m.current=!0,w()}function k(T){if(T.pointerType==="touch")f.current=!0}function H(T){if(T.pointerType!=="touch")return;f.current=!1,w()}function E(){if(l.current){l.current=!1;return}if(S)return;if(Kr(st(Ae(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function D(T){if(!S||me(c.state.viewport,T.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let M={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:v,onMouseMove:v,onMouseLeave:R,onFocus:E,onBlur:D,onKeyDown:y,onClick:E,onPointerDown:k,onPointerUp:H,onPointerCancel:H,style:{[O2]:b?`${b}px`:void 0}},P={expanded:g},F=!d&&h&&Gl(or,{onFocus:x}),G=ye("div",t,{ref:[o,c.setViewport],state:P,props:[M,i,{children:Gf(qo.Fragment,{children:[F,s,F]})}]});return Gf(qo.Fragment,{children:[F,G,!S&&I.length>0&&Gl("div",{style:ic,children:I.map((T)=>Gf("div",{role:"alert","aria-atomic":!0,children:[Gl("div",{children:T.title}),Gl("div",{children:T.description})]},T.id))})]})});import*as nt from"react";import*as $2 from"react-dom";import*as Zl from"react";var Zf=Zl.createContext(void 0);function cn(){let e=Zl.useContext(Zf);if(!e)throw Error(Ge(66));return e}import*as $f from"react";function B2(e,t){let o=(t??qe(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function $l(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var H2="--toast-index",V2="--toast-offset-y",U2="--toast-height",_2="--toast-swipe-movement-x",W2="--toast-swipe-movement-y";var z2="data-swipe-direction",ast=xn,sst=Ja;import{jsx as py}from"react/jsx-runtime";var dy={...qr,swipeDirection(e){return e?{[z2]:e}:null}},G2=40,gy=10,Z2=0.5,hy=1,Iy=`${i0},${c0}`,q2=nt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,f=sn(),[d,p]=nt.useState(void 0),[S,g]=nt.useState(!1),[h,b]=nt.useState(!1),[C,I]=nt.useState({x:0,y:0}),[x,y]=nt.useState({x:0,y:0,scale:1}),[w,v]=nt.useState(),[R,k]=nt.useState(),[H,E]=nt.useState(null),D=nt.useRef(null),M=nt.useRef(void 0),P=nt.useRef({x:0,y:0}),F=nt.useRef({x:0,y:0,scale:1}),G=nt.useRef(void 0),T=nt.useRef(0),N=nt.useRef(!1),X=nt.useRef({x:0,y:0}),Y=nt.useRef(!1),A=nt.useRef({x:0,y:0}),ue=nt.useRef(null),V=nt.useRef(null),Z=f.useState("toastIndex",r.id),q=f.useState("toastVisibleIndex",r.id),se=f.useState("toastOffsetY",r.id),Pe=f.useState("focused"),J=f.useState("expanded");Go({open:r.transitionStatus!=="ending",ref:D,onComplete(){if(r.transitionStatus==="ending")f.removeToast(r.id)}});let pe=re((ie=!1)=>{let we=D.current;if(!we)return;let L=we.style.height;we.style.height="auto";let U=we.offsetHeight;we.style.height=L;function Ce(){f.updateToastInternal(r.id,{ref:D,height:U,transitionStatus:void 0})}if(ie)$2.flushSync(Ce);else Ce()});_(()=>{let ie=M.current;if(r.transitionStatus!=="starting"&&ie===r.id)return;if(ie!==void 0)p(void 0),y({x:0,y:0,scale:1}),de({x:0,y:0});M.current=r.id,pe()},[pe,r.id,r.transitionStatus]);function de(ie){A.current=ie,I(ie)}_(()=>()=>{V.current?.abort()},[]);function fe(ie,we){let L=(K)=>K>0?K**Z2:-(Math.abs(K)**Z2),U=ie>0&&!l.includes("right")||ie<0&&!l.includes("left"),Ce=we>0&&!l.includes("down")||we<0&&!l.includes("up");return{x:U?L(ie):ie,y:Ce?L(we):we}}let Se=re((ie)=>{if(ie.pointerId!==ue.current)return;ue.current=null,V.current?.abort(),V.current=null,g(!1),b(!1),E(null);let we=F.current;if(ie.type==="pointercancel"||N.current){de({x:we.x,y:we.y}),p(void 0);return}let L=A.current,U=L.x-we.x,Ce=L.y-we.y,K;for(let ae of l)if($l(ae,U,Ce)>G2){K=ae;break}if(K)p(K),f.closeToast(r.id);else de({x:we.x,y:we.y}),p(void 0)});function oe(ie){if(ie.button!==0)return;if(ie.pointerType==="touch")f.pauseTimers();let we=Ze(ie.nativeEvent);if(tr(we,`button,a,input,textarea,[role="button"],${Iy}`))return;N.current=!1,G.current=void 0,T.current=0,ue.current=ie.pointerId,P.current={x:ie.clientX,y:ie.clientY},X.current=P.current;let U=ie.currentTarget,Ce=B2(U);F.current=Ce,y(Ce),de({x:Ce.x,y:Ce.y}),f.set("hovering",!0),g(!0),b(!1),E(null),Y.current=!0,V.current?.abort();let K=new AbortController;V.current=K;let ae=Ae(U);ae.addEventListener("pointerup",Se,{signal:K.signal}),ae.addEventListener("pointercancel",Se,{signal:K.signal}),U.setPointerCapture?.(ie.pointerId)}function be(ie){if(ie.pointerId!==ue.current)return;if(ie.preventDefault(),Y.current)P.current={x:ie.clientX,y:ie.clientY},Y.current=!1;let{clientY:we,clientX:L,movementX:U,movementY:Ce}=ie;if(Ce<0&&we>X.current.y||Ce>0&&we<X.current.y)X.current={x:X.current.x,y:we};if(U<0&&L>X.current.x||U>0&&L<X.current.x)X.current={x:L,y:X.current.y};let K=L-P.current.x,ae=we-P.current.y,ge=we-X.current.y,he=L-X.current.x,Ie=H;if(!h){if(Math.sqrt(K*K+ae*ae)>=hy){b(!0);let Xt=l.includes("left")||l.includes("right"),xo=l.includes("up")||l.includes("down");if(Xt&&xo){let Ro=Math.abs(K),co=Math.abs(ae);Ie=Ro>co?"horizontal":"vertical",E(Ie)}}}let Oe;if(!G.current){if(Ie==="vertical"){if(ae>0)Oe="down";else if(ae<0)Oe="up"}else if(Ie==="horizontal"){if(K>0)Oe="right";else if(K<0)Oe="left"}else if(Math.abs(K)>=Math.abs(ae))Oe=K>0?"right":"left";else Oe=ae>0?"down":"up";if(Oe&&l.includes(Oe))G.current=Oe,T.current=$l(Oe,K,ae),p(Oe)}else{let eo=G.current,Xt=$l(eo,he,ge);if(Xt>G2)N.current=!1,p(eo);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&T.current-Xt>=gy)N.current=!0}let Qe=fe(K,ae),dt=F.current.x,ho=F.current.y,Io=l.includes("left")||l.includes("right"),jo=l.includes("up")||l.includes("down");if(Ie!=="vertical"&&Io)dt+=Qe.x;if(Ie!=="horizontal"&&jo)ho+=Qe.y;de({x:dt,y:ho})}function W(ie){if(ie.key==="Escape"){if(!D.current||!me(D.current,st(Ae(D.current))))return;f.closeToast(r.id)}}nt.useEffect(()=>{let ie=D.current;if(!m||!ie)return;function we(L){if(ue.current===null||!me(ie,Ze(L)))return;L.preventDefault()}return Ee(ie,"touchmove",we,{passive:!1})},[m]);function B(){let ie=C.x-x.x,we=C.y-x.y;return{transition:S?"none":void 0,transform:S?`translateX(${C.x}px) translateY(${C.y}px) scale(${x.scale})`:void 0,[_2]:`${ie}px`,[W2]:`${we}px`}}let ee=r.priority==="high",z={role:ee?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":R,"aria-hidden":ee&&!Pe?!0:void 0,onPointerDown:m?oe:void 0,onPointerMove:m?be:void 0,onPointerUp:m?Se:void 0,onPointerCancel:m?Se:void 0,onKeyDown:W,inert:ya(r.limited),style:{...B(),[H2]:r.transitionStatus==="ending"?Z:q,[V2]:`${se}px`,[U2]:r.height?`${r.height}px`:void 0}},ce=nt.useMemo(()=>({toast:r,setTitleId:v,setDescriptionId:k,recalculateHeight:pe,visibleIndex:q,expanded:J}),[r,v,k,pe,q,J]),Q={transitionStatus:r.transitionStatus,expanded:J,limited:r.limited||!1,type:r.type,swiping:S,swipeDirection:d},Le=ye("div",t,{ref:[o,D],state:Q,stateAttributesMapping:dy,props:[z,c]});return py(Zf.Provider,{value:ce,children:Le})});import*as ql from"react";var j2=ql.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=cn(),l=ql.useRef(null);_(()=>{u();let d=l.current;if(!d||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let p=new ResizeObserver(()=>u(!0)),S=new MutationObserver(()=>u(!0));return p.observe(d),S.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>{p.disconnect(),S.disconnect()}},[u]);let m=i>0;return ye("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as K2 from"react";import*as X2 from"react";function Y2(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(Y2);return!0}function jl(e){return X2.isValidElement(e)&&Y2(e.props.children)}function Xl(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=cn(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:hr(e),children:i,type:r.type,setId:s}}function Yl(e,t,o){let r=jl(e);return _(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var J2=K2.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:f}=Xl(s,i,"description"),p=ye("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return Yl(p,u,f)});import*as Q2 from"react";var eI=Q2.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:f}=Xl(s,i,"title"),p=ye("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return Yl(p,u,f)});import*as Kl from"react";var tI=Kl.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=sn(),{toast:l,expanded:m}=cn(),[f,d]=Kl.useState(!1),{getButtonProps:p,buttonRef:S}=Co({disabled:s,native:i}),g={type:l.type};return ye("button",t,{ref:[o,S],state:g,props:[{"aria-hidden":!m&&!f,onClick(){u.closeToast(l.id)},onFocus(){d(!0)},onBlur(){d(!1)}},c,p]})});import*as oI from"react";var rI=oI.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=cn(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:f}=Co({disabled:s,native:i}),d={type:u.type},p=ye("button",t,{ref:[o,f],state:d,props:[c,u.actionProps,m,{children:l}]});return jl(p)?p:null});import*as nI from"react";import{jsx as by}from"react/jsx-runtime";var aI=nI.forwardRef(function(t,o){return by(Nl,{ref:o,...t})});import*as sI from"react";function qf(){let e=sn(),t=e.useState("toasts");return sI.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function jf(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||Wl("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as Jl from"react";import*as Ht from"react";var cI=new Map([["bold",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ht.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Xf=Jl.forwardRef((e,t)=>Jl.createElement(Ne,{ref:t,...e,weights:cI}));Xf.displayName="CheckCircleIcon";import*as Ql from"react";import*as Vt from"react";var lI=new Map([["bold",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Vt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var Yf=Ql.forwardRef((e,t)=>Ql.createElement(Ne,{ref:t,...e,weights:lI}));Yf.displayName="CircleNotchIcon";import*as eu from"react";import*as Ut from"react";var uI=new Map([["bold",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ut.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Kf=eu.forwardRef((e,t)=>eu.createElement(Ne,{ref:t,...e,weights:uI}));Kf.displayName="InfoIcon";import*as tu from"react";import*as _t from"react";var mI=new Map([["bold",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),_t.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var Jf=tu.forwardRef((e,t)=>tu.createElement(Ne,{ref:t,...e,weights:mI}));Jf.displayName="WarningIcon";import*as ou from"react";import*as Wt from"react";var fI=new Map([["bold",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Wt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Qf=ou.forwardRef((e,t)=>ou.createElement(Ne,{ref:t,...e,weights:fI}));Qf.displayName="XCircleIcon";import{jsx as it,jsxs as ep}from"react/jsx-runtime";var Cy=jf();function Sy({...e}){return it(F2,{...e})}function xy({...e}){return it(aI,{"data-slot":"toast-portal",...e})}function wy({className:e,...t}){return it(N2,{"data-slot":"toast-viewport",className:le("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function yy({className:e,...t}){return it(q2,{"data-slot":"toast",className:le("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function vy({className:e,...t}){return it(j2,{"data-slot":"toast-content",className:le("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function Ry({className:e,...t}){return it(eI,{"data-slot":"toast-title",className:le("text-sm font-medium",e),...t})}function Py({className:e,...t}){return it(J2,{"data-slot":"toast-description",className:le("text-sm text-muted-foreground",e),...t})}function Ty({className:e,render:t=it(gt,{variant:"outline",size:"sm"}),...o}){return it(rI,{"data-slot":"toast-action",render:t,className:le("shrink-0",e),...o})}function Ay({className:e,children:t,render:o=it(gt,{variant:"ghost",size:"icon-sm"}),...r}){return it(tI,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:le("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??it(Ho,{"aria-hidden":"true"})})}function Ey({type:e}){let t=null;if(e==="success")t=it(Xf,{"aria-hidden":"true"});if(e==="info")t=it(Kf,{"aria-hidden":"true"});if(e==="warning")t=it(Jf,{"aria-hidden":"true"});if(e==="error")t=it(Qf,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=it(Yf,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return it("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function My(){let{toasts:e}=qf();return e.map((t)=>it(yy,{toast:t,children:ep(vy,{children:[it(Ey,{type:t.type}),ep("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[it(Ry,{}),it(Py,{})]}),it(Ty,{}),it(Ay,{})]})},t.id))}function ru({children:e,toastManager:t=Cy,container:o,...r}){return ep(Sy,{toastManager:t,...r,children:[e,it(xy,{container:o,children:it(wy,{children:it(My,{})})})]})}var pI=jf,tct=qf;import{jsx as io,jsxs as $s}from"react/jsx-runtime";var Ny="https://coristen-three.vercel.app",Oa=pI(),By=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],Hy={name:"Coristen",logoUrl:null,agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleColor:"#171717",showPoweredBy:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class dI extends ky{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function op({identity:e,apiKey:t,apiUrl:o=Ny,mode:r="floating",renderTrigger:n,open:a,onOpenChange:s,defaultOpen:i=!1,welcome:c,fontSize:u,appearance:l,onReady:m,onError:f}){let d=o.replace(/\/$/,""),[p,S]=vr(),[g,h]=vr(""),[b,C]=vr(""),[I,x]=vr(),[y,w]=vr(i),v=a??y,R=tp((W)=>{if(a===void 0)w(W);s?.(W)},[a,s]),[k,H]=vr(0),[E,D]=vr({}),[M,P]=vr(!1),[F,G]=vr(),T=Zs(null),N=Zs(void 0),X=Zs(!1),Y=Zs(m),A=Zs(f);Y.current=m,A.current=f,ln(()=>{let W=document.querySelector('meta[name="viewport"]'),B=!W;if(!W)W=document.createElement("meta"),W.name="viewport",document.head.append(W);let ee=W.content;return W.content=(ee?ee.split(","):["width=device-width","initial-scale=1"]).map((z)=>z.trim()).filter((z)=>!/^maximum-scale\s*=/i.test(z)).concat("maximum-scale=1").filter(Boolean).join(", "),()=>{if(B)W.remove();else W.content=ee}},[]),ln(()=>{let W=window.visualViewport,B=()=>{T.current?.style.setProperty("--coristen-viewport-height",`${W?.height??window.innerHeight}px`),T.current?.style.setProperty("--coristen-viewport-top",`${W?.offsetTop??0}px`)};return B(),W?.addEventListener("resize",B),W?.addEventListener("scroll",B),window.addEventListener("resize",B),()=>{W?.removeEventListener("resize",B),W?.removeEventListener("scroll",B),window.removeEventListener("resize",B)}},[]);let ue=tp(async(W)=>{let B=t,ee;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let Q=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!Q.ok){let ie=Error("Authentication required");throw ie.status=Q.status,ie}let Le=await Q.json();if(B=Le.publishableKey,ee=Le.identityToken,!ee)throw Error("Invalid Coristen identity response")}if(!B?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let z=await fetch(`${d}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:B,identityToken:ee,previousToken:W})});if(!z.ok){let Q=Error(await z.text());throw Q.status=z.status,Q}let ce=await z.json();if(e&&!ce.identity)throw Error("Verified identity required");return ce},[t,d,e]);ln(()=>{let W=!0,B,ee="",z=async()=>{try{let ce=await ue(ee||void 0);if(!W)return;ee=ce.token,S(ce),h(""),Y.current?.(),B=window.setTimeout(z,Math.max(5000,ce.expiresAt-Date.now()-30000))}catch(ce){if(!W)return;let Q=ce instanceof Error?ce:Error("Widget failed to load");h(k2(Q)),S((ie)=>ie&&ie.expiresAt>Date.now()?ie:void 0),A.current?.(Q),console.error("[Coristen widget] Failed to initialize",Q);let Le=Q.status;if(!Le||Le===429||Le>=500)B=window.setTimeout(z,5000)}};return z(),()=>{if(W=!1,B)window.clearTimeout(B);if(ee)fetch(`${d}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:ee}),keepalive:!0})}},[d,ue,k]),ln(()=>{let W=g||b;if(!W)return;let B=Oa.add({title:"Support chat couldn't load",description:W,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Oa.close(B),h(""),C(""),H((ee)=>ee+1)}}});return()=>Oa.close(B)},[g,b]),ln(()=>{let W=()=>H((z)=>z+1),B=()=>R(!0),ee=()=>R(!1);return window.addEventListener("coristen:reset",W),window.addEventListener("coristen:open",B),window.addEventListener("coristen:close",ee),()=>{window.removeEventListener("coristen:reset",W),window.removeEventListener("coristen:open",B),window.removeEventListener("coristen:close",ee)}},[r,R]),ln(()=>{if(p)x(p.settings)},[p]),ln(()=>{if(!F)return;let W=()=>G((B)=>{if(!B)return B;let ee=window.innerWidth<640?12:20;return{left:Math.min(Math.max(B.left,ee),window.innerWidth-56-ee),top:Math.min(Math.max(B.top,ee),window.innerHeight-56-ee)}});return window.addEventListener("resize",W),()=>window.removeEventListener("resize",W)},[F]),ln(()=>{let W=()=>{let z=getComputedStyle(document.documentElement),ce=T.current?.parentElement??document.body,Q=getComputedStyle(ce);P(document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||z.colorScheme==="dark"),D({...Object.fromEntries(By.flatMap((Le)=>{let ie=z.getPropertyValue(Le).trim();return ie?[[Le,ie]]:[]})),"--coristen-host-font-family":Q.fontFamily,"--coristen-host-font-size":Q.fontSize})};W();let B=new MutationObserver(W);B.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]});let ee=T.current?.parentElement??document.body;if(ee!==document.documentElement)B.observe(ee,{attributes:!0,attributeFilter:["class","style"]});return()=>B.disconnect()},[]);let V=Dy(()=>p?new Oy(p.convexUrl):void 0,[p?.convexUrl]),Z={...I??p?.settings??Hy,...l,theme:l?.theme??(M?"dark":"light")};if(Z.enabled===!1)return null;let q=Z.position==="left"?"left":"right",se=F&&typeof window<"u"?F.left+28<window.innerWidth/2?"left":"right":q,Pe=F&&typeof window<"u"?F.top+28<window.innerHeight/2?"top":"bottom":"bottom",J={none:0,sm:6,md:10,lg:16}[Z.radius],de={...r!=="floating"?{}:F?{left:`${F.left}px`,top:`${F.top}px`,right:"auto",bottom:"auto"}:q==="left"?{left:"20px"}:{right:"20px"},...E,"--coristen-radius":`${J}px`,"--coristen-bubble-color":Z.bubbleColor,"--radius-small":`${Math.max(0,J-10)}px`,"--radius-medium":`${Math.max(0,J-8)}px`,"--radius-control":`${Math.max(0,J-8)}px`,"--radius-card":`${Math.max(0,J-4)}px`,"--radius-panel":`${J}px`,"--radius-dialog":`${J}px`,"--radius-display":`${J}px`,...u?{"--coristen-font-size":u}:{}},fe=(W)=>{if(r!=="floating"||v||W.button!==0)return;let B=W.currentTarget.getBoundingClientRect();N.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,left:B.left,top:B.top,moved:!1},W.currentTarget.setPointerCapture(W.pointerId)},Se=(W)=>{let B=N.current;if(!B||B.pointerId!==W.pointerId)return;if(!B.moved&&Math.hypot(W.clientX-B.startX,W.clientY-B.startY)<=4)return;B.moved=!0;let ee=window.innerWidth<640?12:20;G({left:Math.min(Math.max(B.left+W.clientX-B.startX,ee),window.innerWidth-56-ee),top:Math.min(Math.max(B.top+W.clientY-B.startY,ee),window.innerHeight-56-ee)})},oe=(W)=>{let B=N.current;if(!B||B.pointerId!==W.pointerId)return;if(B.moved){X.current=!0;let ee=window.innerWidth<640?12:20;G((z)=>z?{left:z.left+28<window.innerWidth/2?ee:window.innerWidth-56-ee,top:z.top}:z)}N.current=void 0},be=()=>{R(!v)};if(g&&(!p||!V))return $s("div",{ref:T,"data-coristen-widget":"","data-mode":r,className:Z.theme==="dark"?"dark":void 0,style:de,children:[io(ru,{toastManager:Oa,container:T}),n&&io("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:be})})]});if(!p||!V)return $s("div",{ref:T,"data-coristen-widget":"","data-mode":r,className:Z.theme==="dark"?"dark":void 0,style:de,children:[io(ru,{toastManager:Oa,container:T}),n&&io("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:be})})]});return $s("div",{ref:T,"data-coristen-widget":"","data-open":v||void 0,"data-mode":r,"data-position":se,"data-vertical":Pe,className:Z.theme==="dark"?"dark":void 0,style:de,children:[io(ru,{toastManager:Oa,container:T}),r==="modal"&&v&&io("button",{type:"button",className:"coristen-backdrop","aria-label":"Close chat",onClick:()=>R(!1)}),p&&V&&io("div",{className:"coristen-panel",role:"dialog","aria-modal":r==="modal"?!0:void 0,"aria-label":`${Z.name} chat`,"aria-hidden":!v,inert:!v,children:io(dI,{onError:(W)=>{C("Chat ran into a problem. Please try again."),A.current?.(W)},children:io(Fy,{client:V,children:io(M2,{workspaceId:p.workspaceId,initialSettings:Z,sessionToken:p.token,onClose:()=>R(!1),onSettingsChange:x,theme:Z.theme,assetBaseUrl:d,welcome:c})})},k)}),n?io("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:be})}):r==="floating"?io("button",{type:"button",className:"coristen-launcher","aria-label":v?"Close chat":"Open chat","aria-expanded":v,"aria-busy":!p,onPointerDown:fe,onPointerMove:Se,onPointerUp:oe,onPointerCancel:oe,onClick:()=>{if(X.current){X.current=!1;return}be()},children:io("img",{src:`${d}/widget-icons/${Z.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})}):null]})}function gI(e,t,o){return Ly(e,{"aria-expanded":t,onClick:(r)=>{if(e.props.onClick?.(r),!r.defaultPrevented)o()}})}function lct(e){return io(op,{...e,mode:"floating"})}function uct({trigger:e,...t}){return io(op,{...t,mode:"modal",renderTrigger:({open:o,toggle:r})=>gI(e,o,r)})}function mct({children:e,side:t="right",trigger:o,open:r,onOpenChange:n,defaultOpen:a=!1,appearance:s,...i}){let[c,u]=vr(a),l=r??c,m=tp((f)=>{if(r===void 0)u(f);n?.(f)},[r,n]);return $s("div",{className:"coristen-dock","data-side":t,"data-open":l||void 0,children:[$s("div",{className:"coristen-dock-content",children:[e,!l&&io("div",{className:"coristen-dock-trigger",children:gI(o,l,()=>m(!0))})]}),io(op,{...i,mode:"embedded",open:l,onOpenChange:m,appearance:{...s,position:t}})]})}var fct={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{mct as CoristenDock,uct as CoristenModal,lct as CoristenWidget,fct as coristenWidget};
|