@voxket-ai/voxket-live 1.0.65 → 1.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +47 -117
  2. package/dist/index.js +5965 -6779
  3. package/package.json +7 -1
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ip=Object.defineProperty;var ap=(e,t,n)=>t in e?ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>ap(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("react"),d=require("react/jsx-runtime"),te=require("livekit-client"),Me=require("@livekit/components-react"),Fi=require("react-dom"),Ms=require("class-variance-authority"),Bi=require("clsx");function Fd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=Fd(A),Rs=Fd(Fi),Hi=A.createContext({});function zi(e){const t=A.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ui=typeof window<"u",Bd=Ui?A.useLayoutEffect:A.useEffect,Ns=A.createContext(null);function Wi(e,t){e.indexOf(t)===-1&&e.push(t)}function Zi(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Mt=(e,t,n)=>n>t?t:n<e?e:n;function Yo(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let zn=()=>{},Rt=()=>{};process.env.NODE_ENV!=="production"&&(zn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Yo(t,n))},Rt=(e,t,n)=>{if(!e)throw new Error(Yo(t,n))});const Nt={},Hd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function zd(e){return typeof e=="object"&&e!==null}const Ud=e=>/^0[^.\s]+$/u.test(e);function Ki(e){let t;return()=>(t===void 0&&(t=e()),t)}const nt=e=>e,cp=(e,t)=>n=>t(e(n)),Tr=(...e)=>e.reduce(cp),hr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Yi{constructor(){this.subscriptions=[]}add(t){return Wi(this.subscriptions,t),()=>Zi(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const at=e=>e*1e3,vt=e=>e/1e3;function Wd(e,t){return t?e*(1e3/t):0}const tc=new Set;function Gi(e,t,n){e||tc.has(t)||(console.warn(Yo(t,n)),tc.add(t))}const Zd=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lp=1e-7,dp=12;function up(e,t,n,r,s){let o,i,a=0;do i=t+(n-t)/2,o=Zd(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>lp&&++a<dp);return i}function Ar(e,t,n,r){if(e===t&&n===r)return nt;const s=o=>up(o,0,1,e,n);return o=>o===0||o===1?o:Zd(s(o),t,r)}const Kd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yd=e=>t=>1-e(1-t),Gd=Ar(.33,1.53,.69,.99),qi=Yd(Gd),qd=Kd(qi),Xd=e=>(e*=2)<1?.5*qi(e):.5*(2-Math.pow(2,-10*(e-1))),Xi=e=>1-Math.sin(Math.acos(e)),Jd=Yd(Xi),Qd=Kd(Xi),fp=Ar(.42,0,1,1),hp=Ar(0,0,.58,1),eu=Ar(.42,0,.58,1),mp=e=>Array.isArray(e)&&typeof e[0]!="number",tu=e=>Array.isArray(e)&&typeof e[0]=="number",nc={linear:nt,easeIn:fp,easeInOut:eu,easeOut:hp,circIn:Xi,circInOut:Qd,circOut:Jd,backIn:qi,backInOut:qd,backOut:Gd,anticipate:Xd},pp=e=>typeof e=="string",rc=e=>{if(tu(e)){Rt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return Ar(t,n,r,s)}else if(pp(e))return Rt(nc[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),nc[e];return e},$r=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function gp(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,h=!1,p=!1)=>{const y=p&&s?n:r;return h&&i.add(u),y.has(u)||y.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,l.process(u))}};return l}const yp=40;function nu(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=$r.reduce((S,C)=>(S[C]=gp(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:p,render:g,postRender:y}=i,f=()=>{const S=Nt.useManualTiming?s.timestamp:performance.now();n=!1,Nt.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,yp),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),c.process(s),l.process(s),u.process(s),h.process(s),p.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(f))},v=()=>{n=!0,r=!0,s.isProcessing||e(f)};return{schedule:$r.reduce((S,C)=>{const E=i[C];return S[C]=(T,k=!1,P=!1)=>(n||v(),E.schedule(T,k,P)),S},{}),cancel:S=>{for(let C=0;C<$r.length;C++)i[$r[C]].cancel(S)},state:s,steps:i}}const{schedule:be,cancel:_t,state:Oe,steps:ao}=nu(typeof requestAnimationFrame<"u"?requestAnimationFrame:nt,!0);let ns;function vp(){ns=void 0}const Ue={now:()=>(ns===void 0&&Ue.set(Oe.isProcessing||Nt.useManualTiming?Oe.timestamp:performance.now()),ns),set:e=>{ns=e,queueMicrotask(vp)}},ru=e=>t=>typeof t=="string"&&t.startsWith(e),Ji=ru("--"),xp=ru("var(--"),Qi=e=>xp(e)?bp.test(e.split("/*")[0].trim()):!1,bp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Un={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},mr={...Un,transform:e=>Mt(0,1,e)},Lr={...Un,default:1},cr=e=>Math.round(e*1e5)/1e5,ea=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wp(e){return e==null}const Sp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ta=(e,t)=>n=>!!(typeof n=="string"&&Sp.test(n)&&n.startsWith(e)||t&&!wp(n)&&Object.prototype.hasOwnProperty.call(n,t)),su=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,a]=r.match(ea);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Cp=e=>Mt(0,255,e),co={...Un,transform:e=>Math.round(Cp(e))},en={test:ta("rgb","red"),parse:su("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+co.transform(e)+", "+co.transform(t)+", "+co.transform(n)+", "+cr(mr.transform(r))+")"};function Ep(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Go={test:ta("#"),parse:Ep,transform:en.transform},Pr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$t=Pr("deg"),xt=Pr("%"),re=Pr("px"),kp=Pr("vh"),Tp=Pr("vw"),sc={...xt,parse:e=>xt.parse(e)/100,transform:e=>xt.transform(e*100)},kn={test:ta("hsl","hue"),parse:su("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+xt.transform(cr(t))+", "+xt.transform(cr(n))+", "+cr(mr.transform(r))+")"},je={test:e=>en.test(e)||Go.test(e)||kn.test(e),parse:e=>en.test(e)?en.parse(e):kn.test(e)?kn.parse(e):Go.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?en.transform(e):kn.transform(e),getAnimatableNone:e=>{const t=je.parse(e);return t.alpha=0,je.transform(t)}},Ap=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pp(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ea))==null?void 0:t.length)||0)+(((n=e.match(Ap))==null?void 0:n.length)||0)>0}const ou="number",iu="color",Mp="var",Rp="var(",oc="${}",Np=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const a=t.replace(Np,c=>(je.test(c)?(r.color.push(o),s.push(iu),n.push(je.parse(c))):c.startsWith(Rp)?(r.var.push(o),s.push(Mp),n.push(c)):(r.number.push(o),s.push(ou),n.push(parseFloat(c))),++o,oc)).split(oc);return{values:n,split:a,indexes:r,types:s}}function au(e){return pr(e).values}function cu(e){const{split:t,types:n}=pr(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const a=n[i];a===ou?o+=cr(s[i]):a===iu?o+=je.transform(s[i]):o+=s[i]}return o}}const jp=e=>typeof e=="number"?0:je.test(e)?je.getAnimatableNone(e):e;function Vp(e){const t=au(e);return cu(e)(t.map(jp))}const Ft={test:Pp,parse:au,createTransformer:cu,getAnimatableNone:Vp};function lo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ip({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=lo(c,a,e+1/3),o=lo(c,a,e),i=lo(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function ps(e,t){return n=>n>0?t:e}const Se=(e,t,n)=>e+(t-e)*n,uo=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Dp=[Go,en,kn],Op=e=>Dp.find(t=>t.test(e));function ic(e){const t=Op(e);if(zn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===kn&&(n=Ip(n)),n}const ac=(e,t)=>{const n=ic(e),r=ic(t);if(!n||!r)return ps(e,t);const s={...n};return o=>(s.red=uo(n.red,r.red,o),s.green=uo(n.green,r.green,o),s.blue=uo(n.blue,r.blue,o),s.alpha=Se(n.alpha,r.alpha,o),en.transform(s))},qo=new Set(["none","hidden"]);function $p(e,t){return qo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lp(e,t){return n=>Se(e,t,n)}function na(e){return typeof e=="number"?Lp:typeof e=="string"?Qi(e)?ps:je.test(e)?ac:Bp:Array.isArray(e)?lu:typeof e=="object"?je.test(e)?ac:_p:ps}function lu(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>na(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function _p(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=na(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Fp(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],a=e.values[i]??0;n[s]=a,r[o]++}return n}const Bp=(e,t)=>{const n=Ft.createTransformer(t),r=pr(e),s=pr(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?qo.has(e)&&!s.values.length||qo.has(t)&&!r.values.length?$p(e,t):Tr(lu(Fp(r,s),s.values),n):(zn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ps(e,t))};function du(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Se(e,t,n):na(e)(e,t)}const Hp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>be.update(t,n),stop:()=>_t(t),now:()=>Oe.isProcessing?Oe.timestamp:Ue.now()}},uu=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},gs=2e4;function ra(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<gs;)t+=n,r=e.next(t);return t>=gs?1/0:t}function zp(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(ra(r),gs);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:vt(s)}}const Up=5;function fu(e,t,n){const r=Math.max(t-Up,0);return Wd(n-e(r),t-r)}const we={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},fo=.001;function Wp({duration:e=we.duration,bounce:t=we.bounce,velocity:n=we.velocity,mass:r=we.mass}){let s,o;zn(e<=at(we.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Mt(we.minDamping,we.maxDamping,i),e=Mt(we.minDuration,we.maxDuration,vt(e)),i<1?(s=l=>{const u=l*i,h=u*e,p=u-n,g=Xo(l,i),y=Math.exp(-h);return fo-p/g*y},o=l=>{const h=l*i*e,p=h*n+n,g=Math.pow(i,2)*Math.pow(l,2)*e,y=Math.exp(-h),f=Xo(Math.pow(l,2),i);return(-s(l)+fo>0?-1:1)*((p-g)*y)/f}):(s=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-fo+u*h},o=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=Kp(s,o,a);if(e=at(e),isNaN(c))return{stiffness:we.stiffness,damping:we.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const Zp=12;function Kp(e,t,n){let r=n;for(let s=1;s<Zp;s++)r=r-e(r)/t(r);return r}function Xo(e,t){return e*Math.sqrt(1-t*t)}const Yp=["duration","bounce"],Gp=["stiffness","damping","mass"];function cc(e,t){return t.some(n=>e[n]!==void 0)}function qp(e){let t={velocity:we.velocity,stiffness:we.stiffness,damping:we.damping,mass:we.mass,isResolvedFromDuration:!1,...e};if(!cc(e,Gp)&&cc(e,Yp))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Mt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:we.mass,stiffness:s,damping:o}}else{const n=Wp(e);t={...t,...n,mass:we.mass},t.isResolvedFromDuration=!0}return t}function ys(e=we.visualDuration,t=we.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:h,velocity:p,isResolvedFromDuration:g}=qp({...n,velocity:-vt(n.velocity||0)}),y=p||0,f=l/(2*Math.sqrt(c*u)),v=i-o,w=vt(Math.sqrt(c/u)),b=Math.abs(v)<5;r||(r=b?we.restSpeed.granular:we.restSpeed.default),s||(s=b?we.restDelta.granular:we.restDelta.default);let S;if(f<1){const E=Xo(w,f);S=T=>{const k=Math.exp(-f*w*T);return i-k*((y+f*w*v)/E*Math.sin(E*T)+v*Math.cos(E*T))}}else if(f===1)S=E=>i-Math.exp(-w*E)*(v+(y+w*v)*E);else{const E=w*Math.sqrt(f*f-1);S=T=>{const k=Math.exp(-f*w*T),P=Math.min(E*T,300);return i-k*((y+f*w*v)*Math.sinh(P)+E*v*Math.cosh(P))/E}}const C={calculatedDuration:g&&h||null,next:E=>{const T=S(E);if(g)a.done=E>=h;else{let k=E===0?y:0;f<1&&(k=E===0?at(y):fu(S,E,T));const P=Math.abs(k)<=r,$=Math.abs(i-T)<=s;a.done=P&&$}return a.value=a.done?i:T,a},toString:()=>{const E=Math.min(ra(C),gs),T=uu(k=>C.next(E*k).value,E,30);return E+"ms "+T},toTransition:()=>{}};return C}ys.applyToOptions=e=>{const t=zp(e,100,ys);return e.ease=t.ease,e.duration=at(t.duration),e.type="keyframes",e};function Jo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=e[0],p={done:!1,value:h},g=P=>a!==void 0&&P<a||c!==void 0&&P>c,y=P=>a===void 0?c:c===void 0||Math.abs(a-P)<Math.abs(c-P)?a:c;let f=n*t;const v=h+f,w=i===void 0?v:i(v);w!==v&&(f=w-h);const b=P=>-f*Math.exp(-P/r),S=P=>w+b(P),C=P=>{const $=b(P),x=S(P);p.done=Math.abs($)<=l,p.value=p.done?w:x};let E,T;const k=P=>{g(p.value)&&(E=P,T=ys({keyframes:[p.value,y(p.value)],velocity:fu(S,P,p.value),damping:s,stiffness:o,restDelta:l,restSpeed:u}))};return k(0),{calculatedDuration:null,next:P=>{let $=!1;return!T&&E===void 0&&($=!0,C(P),k(P)),E!==void 0&&P>=E?T.next(P-E):(!$&&C(P),p)}}}function Xp(e,t,n){const r=[],s=n||Nt.mix||du,o=e.length-1;for(let i=0;i<o;i++){let a=s(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||nt:t;a=Tr(c,a)}r.push(a)}return r}function Jp(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(Rt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Xp(t,r,s),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const p=hr(e[h],e[h+1],u);return a[h](p)};return n?u=>l(Mt(e[0],e[o-1],u)):l}function Qp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hr(0,t,r);e.push(Se(n,1,s))}}function e0(e){const t=[0];return Qp(t,e.length-1),t}function t0(e,t){return e.map(n=>n*t)}function n0(e,t){return e.map(()=>t||eu).splice(0,e.length-1)}function Tn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=mp(r)?r.map(rc):rc(r),o={done:!1,value:t[0]},i=t0(n&&n.length===t.length?n:e0(t),e),a=Jp(i,t,{ease:Array.isArray(s)?s:n0(t,s)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const r0=e=>e!==null;function sa(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(r0),a=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const s0={decay:Jo,inertia:Jo,tween:Tn,keyframes:Tn,spring:ys};function hu(e){typeof e.type=="string"&&(e.type=s0[e.type])}class oa{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const o0=e=>e/100;class ia extends oa{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Ue.now()&&this.tick(Ue.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;hu(t);const{type:n=Tn,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Tn;process.env.NODE_ENV!=="production"&&c!==Tn&&Rt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Tn&&typeof a[0]!="number"&&(this.mixKeyframes=Tr(o0,du(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=ra(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:p,repeatDelay:g,type:y,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-l*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?w<0:w>s;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,C=r;if(h){const P=Math.min(this.currentTime,s)/a;let $=Math.floor(P),x=P%1;!x&&P>=1&&(x=1),x===1&&$--,$=Math.min($,h+1),!!($%2)&&(p==="reverse"?(x=1-x,g&&(x-=g/a)):p==="mirror"&&(C=i)),S=Mt(0,1,x)*a}const E=b?{done:!1,value:u[0]}:C.next(S);o&&(E.value=o(E.value));let{done:T}=E;!b&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return k&&y!==Jo&&(E.value=sa(u,this.options,v,this.speed)),f&&f(E.value),k&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return vt(this.calculatedDuration)}get time(){return vt(this.currentTime)}set time(t){var n;t=at(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ue.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=vt(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Hp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ue.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function i0(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tn=e=>e*180/Math.PI,Qo=e=>{const t=tn(Math.atan2(e[1],e[0]));return ei(t)},a0={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Qo,rotateZ:Qo,skewX:e=>tn(Math.atan(e[1])),skewY:e=>tn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ei=e=>(e=e%360,e<0&&(e+=360),e),lc=Qo,dc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),uc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),c0={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dc,scaleY:uc,scale:e=>(dc(e)+uc(e))/2,rotateX:e=>ei(tn(Math.atan2(e[6],e[5]))),rotateY:e=>ei(tn(Math.atan2(-e[2],e[0]))),rotateZ:lc,rotate:lc,skewX:e=>tn(Math.atan(e[4])),skewY:e=>tn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ti(e){return e.includes("scale")?1:0}function ni(e,t){if(!e||e==="none")return ti(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=c0,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=a0,s=a}if(!s)return ti(t);const o=r[t],i=s[1].split(",").map(d0);return typeof o=="function"?o(i):i[o]}const l0=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ni(n,t)};function d0(e){return parseFloat(e.trim())}const Wn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zn=new Set(Wn),fc=e=>e===Un||e===re,u0=new Set(["x","y","z"]),f0=Wn.filter(e=>!u0.has(e));function h0(e){const t=[];return f0.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const rn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ni(t,"x"),y:(e,{transform:t})=>ni(t,"y")};rn.translateX=rn.x;rn.translateY=rn.y;const sn=new Set;let ri=!1,si=!1,oi=!1;function mu(){if(si){const e=Array.from(sn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=h0(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var a;(a=r.getValue(o))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}si=!1,ri=!1,sn.forEach(e=>e.complete(oi)),sn.clear()}function pu(){sn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(si=!0)})}function m0(){oi=!0,pu(),mu(),oi=!1}class aa{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(sn.add(this),ri||(ri=!0,be.read(pu),be.resolveKeyframes(mu))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}i0(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),sn.delete(this)}cancel(){this.state==="scheduled"&&(sn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const p0=e=>e.startsWith("--");function g0(e,t,n){p0(t)?e.style.setProperty(t,n):e.style[t]=n}const y0=Ki(()=>window.ScrollTimeline!==void 0),v0={};function x0(e,t){const n=Ki(e);return()=>v0[t]??n()}const gu=x0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sr([0,.65,.55,1]),circOut:sr([.55,0,1,.45]),backIn:sr([.31,.01,.66,-.59]),backOut:sr([.33,1.53,.69,.99])};function yu(e,t){if(e)return typeof e=="function"?gu()?uu(e,t):"ease-out":tu(e)?sr(e):Array.isArray(e)?e.map(n=>yu(n,t)||hc.easeOut):hc[e]}function b0(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const h=yu(a,s);Array.isArray(h)&&(u.easing=h);const p={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return l&&(p.pseudoElement=l),e.animate(u,p)}function vu(e){return typeof e=="function"&&"applyToOptions"in e}function w0({type:e,...t}){return vu(e)&&gu()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class S0 extends oa{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,Rt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=w0(t);this.animation=b0(n,r,s,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=sa(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):g0(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return vt(Number(t))}get time(){return vt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=at(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&y0()?(this.animation.timeline=t,nt):n(this)}}const xu={anticipate:Xd,backInOut:qd,circInOut:Qd};function C0(e){return e in xu}function E0(e){typeof e.ease=="string"&&C0(e.ease)&&(e.ease=xu[e.ease])}const mc=10;class k0 extends S0{constructor(t){E0(t),hu(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new ia({...i,autoplay:!1}),c=at(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-mc).value,a.sample(c).value,mc),a.stop()}}const pc=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ft.test(e)||e==="0")&&!e.startsWith("url("));function T0(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function A0(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=pc(s,t),a=pc(o,t);return zn(i===a,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:T0(e)||(n==="spring"||vu(n))&&r}function ii(e){e.duration=0,e.type}const P0=new Set(["opacity","clipPath","filter","transform"]),M0=Ki(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function R0(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return M0()&&n&&P0.has(n)&&(n!=="transform"||!l)&&!c&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const N0=40;class j0 extends oa{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){var y;super(),this.stop=()=>{var f,v;this._animation&&(this._animation.stop(),(f=this.stopTimeline)==null||f.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Ue.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:c,motionValue:l,element:u,...h},g=(u==null?void 0:u.KeyframeResolver)||aa;this.keyframeResolver=new g(a,(f,v,w)=>this.onKeyframesResolved(f,v,p,!w),c,l,u),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=Ue.now(),A0(t,o,i,a)||((Nt.instantAnimations||!c)&&(u==null||u(sa(t,r,n))),t[0]=t[t.length-1],ii(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>N0?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!l&&R0(p)?new k0({...p,element:p.motionValue.owner.current}):new ia(p);g.finished.then(()=>this.notifyFinished()).catch(nt),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),m0()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const V0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function I0(e){const t=V0.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const D0=4;function bu(e,t,n=1){Rt(n<=D0,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=I0(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return Hd(i)?parseFloat(i):i}return Qi(s)?bu(s,t,n+1):s}function ca(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const wu=new Set(["width","height","top","left","right","bottom",...Wn]),O0={test:e=>e==="auto",parse:e=>e},Su=e=>t=>t.test(e),Cu=[Un,re,xt,$t,Tp,kp,O0],gc=e=>Cu.find(Su(e));function $0(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ud(e):!0}const L0=new Set(["brightness","contrast","saturate","opacity"]);function _0(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ea)||[];if(!r)return e;const s=n.replace(r,"");let o=L0.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const F0=/\b([a-z-]*)\(.*?\)/gu,ai={...Ft,getAnimatableNone:e=>{const t=e.match(F0);return t?t.map(_0).join(" "):e}},yc={...Un,transform:Math.round},B0={rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Lr,scaleX:Lr,scaleY:Lr,scaleZ:Lr,skew:$t,skewX:$t,skewY:$t,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:mr,originX:sc,originY:sc,originZ:re},la={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...B0,zIndex:yc,fillOpacity:mr,strokeOpacity:mr,numOctaves:yc},H0={...la,color:je,backgroundColor:je,outlineColor:je,fill:je,stroke:je,borderColor:je,borderTopColor:je,borderRightColor:je,borderBottomColor:je,borderLeftColor:je,filter:ai,WebkitFilter:ai},Eu=e=>H0[e];function ku(e,t){let n=Eu(e);return n!==ai&&(n=Ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const z0=new Set(["auto","none","0"]);function U0(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!z0.has(o)&&pr(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=ku(n,s)}class W0 extends aa{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Qi(l))){const u=bu(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!wu.has(r)||t.length!==2)return;const[s,o]=t,i=gc(s),a=gc(o);if(i!==a)if(fc(i)&&fc(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else rn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||$0(t[s]))&&r.push(s);r.length&&U0(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=rn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=rn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Z0(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Tu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Au(e){return zd(e)&&"offsetHeight"in e}const vc=30,K0=e=>!isNaN(parseFloat(e));class Y0{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=Ue.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ue.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=K0(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Gi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Yi);const r=this.events[t].add(n);return t==="change"?()=>{r(),be.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ue.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vc)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vc);return Wd(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function $n(e,t){return new Y0(e,t)}const{schedule:da}=nu(queueMicrotask,!1),ot={x:!1,y:!1};function Pu(){return ot.x||ot.y}function G0(e){return e==="x"||e==="y"?ot[e]?null:(ot[e]=!0,()=>{ot[e]=!1}):ot.x||ot.y?null:(ot.x=ot.y=!0,()=>{ot.x=ot.y=!1})}function Mu(e,t){const n=Z0(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function xc(e){return!(e.pointerType==="touch"||Pu())}function q0(e,t,n={}){const[r,s,o]=Mu(e,n),i=a=>{if(!xc(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=h=>{xc(h)&&(l(h),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",i,s)}),o}const Ru=(e,t)=>t?e===t?!0:Ru(e,t.parentElement):!1,ua=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,X0=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J0(e){return X0.has(e.tagName)||e.tabIndex!==-1}const rs=new WeakSet;function bc(e){return t=>{t.key==="Enter"&&e(t)}}function ho(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Q0=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=bc(()=>{if(rs.has(n))return;ho(n,"down");const s=bc(()=>{ho(n,"up")}),o=()=>ho(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function wc(e){return ua(e)&&!Pu()}function eg(e,t,n={}){const[r,s,o]=Mu(e,n),i=a=>{const c=a.currentTarget;if(!wc(a))return;rs.add(c);const l=t(c,a),u=(g,y)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),rs.has(c)&&rs.delete(c),wc(g)&&typeof l=="function"&&l(g,{success:y})},h=g=>{u(g,c===window||c===document||n.useGlobalTarget||Ru(c,g.target))},p=g=>{u(g,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",p,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,s),Au(a)&&(a.addEventListener("focus",l=>Q0(l,s)),!J0(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Nu(e){return zd(e)&&"ownerSVGElement"in e}function tg(e){return Nu(e)&&e.tagName==="svg"}const He=e=>!!(e&&e.getVelocity),ng=[...Cu,je,Ft],rg=e=>ng.find(Su(e)),fa=A.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class sg extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Au(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function og({children:e,isPresent:t,anchorX:n,root:r}){const s=A.useId(),o=A.useRef(null),i=A.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=A.useContext(fa);return A.useInsertionEffect(()=>{const{width:c,height:l,top:u,left:h,right:p}=i.current;if(t||!o.current||!c||!l)return;const g=n==="left"?`left: ${h}`:`right: ${p}`;o.current.dataset.motionPopId=s;const y=document.createElement("style");a&&(y.nonce=a);const f=r??document.head;return f.appendChild(y),y.sheet&&y.sheet.insertRule(`
1
+ "use strict";var bm=Object.defineProperty;var vm=(e,t,n)=>t in e?bm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Te=(e,t,n)=>vm(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("react"),d=require("react/jsx-runtime"),te=require("livekit-client"),Ee=require("@livekit/components-react"),ad=require("react-dom"),ps=require("class-variance-authority"),vi=require("clsx"),wm=require("react-remove-scroll"),Pn=require("react-is");function cd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=cd(A),It=cd(ad),wi=A.createContext({});function Si(e){const t=A.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ci=typeof window<"u",ld=Ci?A.useLayoutEffect:A.useEffect,gs=A.createContext(null);function ki(e,t){e.indexOf(t)===-1&&e.push(t)}function Ei(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const kt=(e,t,n)=>n>t?t:n<e?e:n;function Po(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let On=()=>{},Et=()=>{};process.env.NODE_ENV!=="production"&&(On=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Po(t,n))},Et=(e,t,n)=>{if(!e)throw new Error(Po(t,n))});const At={},dd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ud(e){return typeof e=="object"&&e!==null}const fd=e=>/^0[^.\s]+$/u.test(e);function Ai(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=e=>e,Sm=(e,t)=>n=>t(e(n)),br=(...e)=>e.reduce(Sm),ir=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ti{constructor(){this.subscriptions=[]}add(t){return ki(this.subscriptions,t),()=>Ei(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rt=e=>e*1e3,ht=e=>e/1e3;function hd(e,t){return t?e*(1e3/t):0}const Ia=new Set;function ji(e,t,n){e||Ia.has(t)||(console.warn(Po(t,n)),Ia.add(t))}const md=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cm=1e-7,km=12;function Em(e,t,n,r,s){let o,i,a=0;do i=t+(n-t)/2,o=md(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Cm&&++a<km);return i}function vr(e,t,n,r){if(e===t&&n===r)return Je;const s=o=>Em(o,0,1,e,n);return o=>o===0||o===1?o:md(s(o),t,r)}const pd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gd=e=>t=>1-e(1-t),yd=vr(.33,1.53,.69,.99),Pi=gd(yd),xd=pd(Pi),bd=e=>(e*=2)<1?.5*Pi(e):.5*(2-Math.pow(2,-10*(e-1))),Mi=e=>1-Math.sin(Math.acos(e)),vd=gd(Mi),wd=pd(Mi),Am=vr(.42,0,1,1),Tm=vr(0,0,.58,1),Sd=vr(.42,0,.58,1),jm=e=>Array.isArray(e)&&typeof e[0]!="number",Cd=e=>Array.isArray(e)&&typeof e[0]=="number",Da={linear:Je,easeIn:Am,easeInOut:Sd,easeOut:Tm,circIn:Mi,circInOut:wd,circOut:vd,backIn:Pi,backInOut:xd,backOut:yd,anticipate:bd},Pm=e=>typeof e=="string",Oa=e=>{if(Cd(e)){Et(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return vr(t,n,r,s)}else if(Pm(e))return Et(Da[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Da[e];return e},Mr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Mm(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,f=!1,h=!1)=>{const y=h&&s?n:r;return f&&i.add(u),y.has(u)||y.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,l.process(u))}};return l}const Nm=40;function kd(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Mr.reduce((S,C)=>(S[C]=Mm(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:f,preRender:h,render:g,postRender:y}=i,p=()=>{const S=At.useManualTiming?s.timestamp:performance.now();n=!1,At.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,Nm),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),c.process(s),l.process(s),u.process(s),f.process(s),h.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},x=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:Mr.reduce((S,C)=>{const E=i[C];return S[C]=(T,k=!1,j=!1)=>(n||x(),E.schedule(T,k,j)),S},{}),cancel:S=>{for(let C=0;C<Mr.length;C++)i[Mr[C]].cancel(S)},state:s,steps:i}}const{schedule:ge,cancel:Dt,state:Ne,steps:Ws}=kd(typeof requestAnimationFrame<"u"?requestAnimationFrame:Je,!0);let Wr;function Rm(){Wr=void 0}const _e={now:()=>(Wr===void 0&&_e.set(Ne.isProcessing||At.useManualTiming?Ne.timestamp:performance.now()),Wr),set:e=>{Wr=e,queueMicrotask(Rm)}},Ed=e=>t=>typeof t=="string"&&t.startsWith(e),Ni=Ed("--"),Vm=Ed("var(--"),Ri=e=>Vm(e)?Im.test(e.split("/*")[0].trim()):!1,Im=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ln={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ar={...Ln,transform:e=>kt(0,1,e)},Nr={...Ln,default:1},tr=e=>Math.round(e*1e5)/1e5,Vi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dm(e){return e==null}const Om=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ii=(e,t)=>n=>!!(typeof n=="string"&&Om.test(n)&&n.startsWith(e)||t&&!Dm(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ad=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,a]=r.match(Vi);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Lm=e=>kt(0,255,e),Zs={...Ln,transform:e=>Math.round(Lm(e))},qt={test:Ii("rgb","red"),parse:Ad("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zs.transform(e)+", "+Zs.transform(t)+", "+Zs.transform(n)+", "+tr(ar.transform(r))+")"};function $m(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Mo={test:Ii("#"),parse:$m,transform:qt.transform},wr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rt=wr("deg"),mt=wr("%"),re=wr("px"),Fm=wr("vh"),_m=wr("vw"),La={...mt,parse:e=>mt.parse(e)/100,transform:e=>mt.transform(e*100)},xn={test:Ii("hsl","hue"),parse:Ad("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+mt.transform(tr(t))+", "+mt.transform(tr(n))+", "+tr(ar.transform(r))+")"},je={test:e=>qt.test(e)||Mo.test(e)||xn.test(e),parse:e=>qt.test(e)?qt.parse(e):xn.test(e)?xn.parse(e):Mo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qt.transform(e):xn.transform(e),getAnimatableNone:e=>{const t=je.parse(e);return t.alpha=0,je.transform(t)}},Bm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hm(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vi))==null?void 0:t.length)||0)+(((n=e.match(Bm))==null?void 0:n.length)||0)>0}const Td="number",jd="color",zm="var",Um="var(",$a="${}",Wm=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const a=t.replace(Wm,c=>(je.test(c)?(r.color.push(o),s.push(jd),n.push(je.parse(c))):c.startsWith(Um)?(r.var.push(o),s.push(zm),n.push(c)):(r.number.push(o),s.push(Td),n.push(parseFloat(c))),++o,$a)).split($a);return{values:n,split:a,indexes:r,types:s}}function Pd(e){return cr(e).values}function Md(e){const{split:t,types:n}=cr(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const a=n[i];a===Td?o+=tr(s[i]):a===jd?o+=je.transform(s[i]):o+=s[i]}return o}}const Zm=e=>typeof e=="number"?0:je.test(e)?je.getAnimatableNone(e):e;function Km(e){const t=Pd(e);return Md(e)(t.map(Zm))}const Ot={test:Hm,parse:Pd,createTransformer:Md,getAnimatableNone:Km};function Ks(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Gm({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=Ks(c,a,e+1/3),o=Ks(c,a,e),i=Ks(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function ns(e,t){return n=>n>0?t:e}const xe=(e,t,n)=>e+(t-e)*n,Gs=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Ym=[Mo,qt,xn],qm=e=>Ym.find(t=>t.test(e));function Fa(e){const t=qm(e);if(On(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===xn&&(n=Gm(n)),n}const _a=(e,t)=>{const n=Fa(e),r=Fa(t);if(!n||!r)return ns(e,t);const s={...n};return o=>(s.red=Gs(n.red,r.red,o),s.green=Gs(n.green,r.green,o),s.blue=Gs(n.blue,r.blue,o),s.alpha=xe(n.alpha,r.alpha,o),qt.transform(s))},No=new Set(["none","hidden"]);function Xm(e,t){return No.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Jm(e,t){return n=>xe(e,t,n)}function Di(e){return typeof e=="number"?Jm:typeof e=="string"?Ri(e)?ns:je.test(e)?_a:tp:Array.isArray(e)?Nd:typeof e=="object"?je.test(e)?_a:Qm:ns}function Nd(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Di(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Qm(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Di(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function ep(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],a=e.values[i]??0;n[s]=a,r[o]++}return n}const tp=(e,t)=>{const n=Ot.createTransformer(t),r=cr(e),s=cr(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?No.has(e)&&!s.values.length||No.has(t)&&!r.values.length?Xm(e,t):br(Nd(ep(r,s),s.values),n):(On(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ns(e,t))};function Rd(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?xe(e,t,n):Di(e)(e,t)}const np=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>Dt(t),now:()=>Ne.isProcessing?Ne.timestamp:_e.now()}},Vd=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},rs=2e4;function Oi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<rs;)t+=n,r=e.next(t);return t>=rs?1/0:t}function rp(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Oi(r),rs);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:ht(s)}}const sp=5;function Id(e,t,n){const r=Math.max(t-sp,0);return hd(n-e(r),t-r)}const ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ys=.001;function op({duration:e=ye.duration,bounce:t=ye.bounce,velocity:n=ye.velocity,mass:r=ye.mass}){let s,o;On(e<=rt(ye.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=kt(ye.minDamping,ye.maxDamping,i),e=kt(ye.minDuration,ye.maxDuration,ht(e)),i<1?(s=l=>{const u=l*i,f=u*e,h=u-n,g=Ro(l,i),y=Math.exp(-f);return Ys-h/g*y},o=l=>{const f=l*i*e,h=f*n+n,g=Math.pow(i,2)*Math.pow(l,2)*e,y=Math.exp(-f),p=Ro(Math.pow(l,2),i);return(-s(l)+Ys>0?-1:1)*((h-g)*y)/p}):(s=l=>{const u=Math.exp(-l*e),f=(l-n)*e+1;return-Ys+u*f},o=l=>{const u=Math.exp(-l*e),f=(n-l)*(e*e);return u*f});const a=5/e,c=ap(s,o,a);if(e=rt(e),isNaN(c))return{stiffness:ye.stiffness,damping:ye.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const ip=12;function ap(e,t,n){let r=n;for(let s=1;s<ip;s++)r=r-e(r)/t(r);return r}function Ro(e,t){return e*Math.sqrt(1-t*t)}const cp=["duration","bounce"],lp=["stiffness","damping","mass"];function Ba(e,t){return t.some(n=>e[n]!==void 0)}function dp(e){let t={velocity:ye.velocity,stiffness:ye.stiffness,damping:ye.damping,mass:ye.mass,isResolvedFromDuration:!1,...e};if(!Ba(e,lp)&&Ba(e,cp))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*kt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ye.mass,stiffness:s,damping:o}}else{const n=op(e);t={...t,...n,mass:ye.mass},t.isResolvedFromDuration=!0}return t}function ss(e=ye.visualDuration,t=ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:f,velocity:h,isResolvedFromDuration:g}=dp({...n,velocity:-ht(n.velocity||0)}),y=h||0,p=l/(2*Math.sqrt(c*u)),x=i-o,w=ht(Math.sqrt(c/u)),v=Math.abs(x)<5;r||(r=v?ye.restSpeed.granular:ye.restSpeed.default),s||(s=v?ye.restDelta.granular:ye.restDelta.default);let S;if(p<1){const E=Ro(w,p);S=T=>{const k=Math.exp(-p*w*T);return i-k*((y+p*w*x)/E*Math.sin(E*T)+x*Math.cos(E*T))}}else if(p===1)S=E=>i-Math.exp(-w*E)*(x+(y+w*x)*E);else{const E=w*Math.sqrt(p*p-1);S=T=>{const k=Math.exp(-p*w*T),j=Math.min(E*T,300);return i-k*((y+p*w*x)*Math.sinh(j)+E*x*Math.cosh(j))/E}}const C={calculatedDuration:g&&f||null,next:E=>{const T=S(E);if(g)a.done=E>=f;else{let k=E===0?y:0;p<1&&(k=E===0?rt(y):Id(S,E,T));const j=Math.abs(k)<=r,$=Math.abs(i-T)<=s;a.done=j&&$}return a.value=a.done?i:T,a},toString:()=>{const E=Math.min(Oi(C),rs),T=Vd(k=>C.next(E*k).value,E,30);return E+"ms "+T},toTransition:()=>{}};return C}ss.applyToOptions=e=>{const t=rp(e,100,ss);return e.ease=t.ease,e.duration=rt(t.duration),e.type="keyframes",e};function Vo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},g=j=>a!==void 0&&j<a||c!==void 0&&j>c,y=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let p=n*t;const x=f+p,w=i===void 0?x:i(x);w!==x&&(p=w-f);const v=j=>-p*Math.exp(-j/r),S=j=>w+v(j),C=j=>{const $=v(j),b=S(j);h.done=Math.abs($)<=l,h.value=h.done?w:b};let E,T;const k=j=>{g(h.value)&&(E=j,T=ss({keyframes:[h.value,y(h.value)],velocity:Id(S,j,h.value),damping:s,stiffness:o,restDelta:l,restSpeed:u}))};return k(0),{calculatedDuration:null,next:j=>{let $=!1;return!T&&E===void 0&&($=!0,C(j),k(j)),E!==void 0&&j>=E?T.next(j-E):(!$&&C(j),h)}}}function up(e,t,n){const r=[],s=n||At.mix||Rd,o=e.length-1;for(let i=0;i<o;i++){let a=s(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Je:t;a=br(c,a)}r.push(a)}return r}function fp(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(Et(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=up(t,r,s),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=ir(e[f],e[f+1],u);return a[f](h)};return n?u=>l(kt(e[0],e[o-1],u)):l}function hp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ir(0,t,r);e.push(xe(n,1,s))}}function mp(e){const t=[0];return hp(t,e.length-1),t}function pp(e,t){return e.map(n=>n*t)}function gp(e,t){return e.map(()=>t||Sd).splice(0,e.length-1)}function bn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=jm(r)?r.map(Oa):Oa(r),o={done:!1,value:t[0]},i=pp(n&&n.length===t.length?n:mp(t),e),a=fp(i,t,{ease:Array.isArray(s)?s:gp(t,s)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const yp=e=>e!==null;function Li(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(yp),a=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const xp={decay:Vo,inertia:Vo,tween:bn,keyframes:bn,spring:ss};function Dd(e){typeof e.type=="string"&&(e.type=xp[e.type])}class $i{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const bp=e=>e/100;class Fi extends $i{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==_e.now()&&this.tick(_e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Dd(t);const{type:n=bn,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||bn;process.env.NODE_ENV!=="production"&&c!==bn&&Et(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==bn&&typeof a[0]!="number"&&(this.mixKeyframes=br(bp,Rd(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=Oi(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:g,type:y,onUpdate:p,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?w<0:w>s;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,C=r;if(f){const j=Math.min(this.currentTime,s)/a;let $=Math.floor(j),b=j%1;!b&&j>=1&&(b=1),b===1&&$--,$=Math.min($,f+1),!!($%2)&&(h==="reverse"?(b=1-b,g&&(b-=g/a)):h==="mirror"&&(C=i)),S=kt(0,1,b)*a}const E=v?{done:!1,value:u[0]}:C.next(S);o&&(E.value=o(E.value));let{done:T}=E;!v&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return k&&y!==Vo&&(E.value=Li(u,this.options,x,this.speed)),p&&p(E.value),k&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return ht(this.calculatedDuration)}get time(){return ht(this.currentTime)}set time(t){var n;t=rt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(_e.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ht(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=np,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function vp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Xt=e=>e*180/Math.PI,Io=e=>{const t=Xt(Math.atan2(e[1],e[0]));return Do(t)},wp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Io,rotateZ:Io,skewX:e=>Xt(Math.atan(e[1])),skewY:e=>Xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Do=e=>(e=e%360,e<0&&(e+=360),e),Ha=Io,za=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ua=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Sp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:za,scaleY:Ua,scale:e=>(za(e)+Ua(e))/2,rotateX:e=>Do(Xt(Math.atan2(e[6],e[5]))),rotateY:e=>Do(Xt(Math.atan2(-e[2],e[0]))),rotateZ:Ha,rotate:Ha,skewX:e=>Xt(Math.atan(e[4])),skewY:e=>Xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Oo(e){return e.includes("scale")?1:0}function Lo(e,t){if(!e||e==="none")return Oo(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Sp,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=wp,s=a}if(!s)return Oo(t);const o=r[t],i=s[1].split(",").map(kp);return typeof o=="function"?o(i):i[o]}const Cp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Lo(n,t)};function kp(e){return parseFloat(e.trim())}const $n=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fn=new Set($n),Wa=e=>e===Ln||e===re,Ep=new Set(["x","y","z"]),Ap=$n.filter(e=>!Ep.has(e));function Tp(e){const t=[];return Ap.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Qt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Lo(t,"x"),y:(e,{transform:t})=>Lo(t,"y")};Qt.translateX=Qt.x;Qt.translateY=Qt.y;const en=new Set;let $o=!1,Fo=!1,_o=!1;function Od(){if(Fo){const e=Array.from(en).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Tp(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var a;(a=r.getValue(o))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Fo=!1,$o=!1,en.forEach(e=>e.complete(_o)),en.clear()}function Ld(){en.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Fo=!0)})}function jp(){_o=!0,Ld(),Od(),_o=!1}class _i{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(en.add(this),$o||($o=!0,ge.read(Ld),ge.resolveKeyframes(Od))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}vp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),en.delete(this)}cancel(){this.state==="scheduled"&&(en.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Pp=e=>e.startsWith("--");function Mp(e,t,n){Pp(t)?e.style.setProperty(t,n):e.style[t]=n}const Np=Ai(()=>window.ScrollTimeline!==void 0),Rp={};function Vp(e,t){const n=Ai(e);return()=>Rp[t]??n()}const $d=Vp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Za={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xn([0,.65,.55,1]),circOut:Xn([.55,0,1,.45]),backIn:Xn([.31,.01,.66,-.59]),backOut:Xn([.33,1.53,.69,.99])};function Fd(e,t){if(e)return typeof e=="function"?$d()?Vd(e,t):"ease-out":Cd(e)?Xn(e):Array.isArray(e)?e.map(n=>Fd(n,t)||Za.easeOut):Za[e]}function Ip(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const f=Fd(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return l&&(h.pseudoElement=l),e.animate(u,h)}function _d(e){return typeof e=="function"&&"applyToOptions"in e}function Dp({type:e,...t}){return _d(e)&&$d()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Op extends $i{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,Et(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=Dp(t);this.animation=Ip(n,r,s,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=Li(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Mp(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ht(Number(t))}get time(){return ht(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=rt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Np()?(this.animation.timeline=t,Je):n(this)}}const Bd={anticipate:bd,backInOut:xd,circInOut:wd};function Lp(e){return e in Bd}function $p(e){typeof e.ease=="string"&&Lp(e.ease)&&(e.ease=Bd[e.ease])}const Ka=10;class Fp extends Op{constructor(t){$p(t),Dd(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Fi({...i,autoplay:!1}),c=rt(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Ka).value,a.sample(c).value,Ka),a.stop()}}const Ga=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ot.test(e)||e==="0")&&!e.startsWith("url("));function _p(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Bp(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Ga(s,t),a=Ga(o,t);return On(i===a,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:_p(e)||(n==="spring"||_d(n))&&r}function Bo(e){e.duration=0,e.type}const Hp=new Set(["opacity","clipPath","filter","transform"]),zp=Ai(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Up(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return zp()&&n&&Hp.has(n)&&(n!=="transform"||!l)&&!c&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const Wp=40;class Zp extends $i{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...f}){var y;super(),this.stop=()=>{var p,x;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=_e.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:c,motionValue:l,element:u,...f},g=(u==null?void 0:u.KeyframeResolver)||_i;this.keyframeResolver=new g(a,(p,x,w)=>this.onKeyframesResolved(p,x,h,!w),c,l,u),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=_e.now(),Bp(t,o,i,a)||((At.instantAnimations||!c)&&(u==null||u(Li(t,r,n))),t[0]=t[t.length-1],Bo(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Wp?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!l&&Up(h)?new Fp({...h,element:h.motionValue.owner.current}):new Fi(h);g.finished.then(()=>this.notifyFinished()).catch(Je),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),jp()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Kp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gp(e){const t=Kp.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Yp=4;function Hd(e,t,n=1){Et(n<=Yp,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=Gp(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return dd(i)?parseFloat(i):i}return Ri(s)?Hd(s,t,n+1):s}function Bi(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zd=new Set(["width","height","top","left","right","bottom",...$n]),qp={test:e=>e==="auto",parse:e=>e},Ud=e=>t=>t.test(e),Wd=[Ln,re,mt,Rt,_m,Fm,qp],Ya=e=>Wd.find(Ud(e));function Xp(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fd(e):!0}const Jp=new Set(["brightness","contrast","saturate","opacity"]);function Qp(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Vi)||[];if(!r)return e;const s=n.replace(r,"");let o=Jp.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const e0=/\b([a-z-]*)\(.*?\)/gu,Ho={...Ot,getAnimatableNone:e=>{const t=e.match(e0);return t?t.map(Qp).join(" "):e}},qa={...Ln,transform:Math.round},t0={rotate:Rt,rotateX:Rt,rotateY:Rt,rotateZ:Rt,scale:Nr,scaleX:Nr,scaleY:Nr,scaleZ:Nr,skew:Rt,skewX:Rt,skewY:Rt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:ar,originX:La,originY:La,originZ:re},Hi={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...t0,zIndex:qa,fillOpacity:ar,strokeOpacity:ar,numOctaves:qa},n0={...Hi,color:je,backgroundColor:je,outlineColor:je,fill:je,stroke:je,borderColor:je,borderTopColor:je,borderRightColor:je,borderBottomColor:je,borderLeftColor:je,filter:Ho,WebkitFilter:Ho},Zd=e=>n0[e];function Kd(e,t){let n=Zd(e);return n!==Ho&&(n=Ot),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const r0=new Set(["auto","none","0"]);function s0(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!r0.has(o)&&cr(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=Kd(n,s)}class o0 extends _i{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Ri(l))){const u=Hd(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!zd.has(r)||t.length!==2)return;const[s,o]=t,i=Ya(s),a=Ya(o);if(i!==a)if(Wa(i)&&Wa(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else Qt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Xp(t[s]))&&r.push(s);r.length&&s0(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=Qt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function i0(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Gd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Yd(e){return ud(e)&&"offsetHeight"in e}const Xa=30,a0=e=>!isNaN(parseFloat(e));class c0{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=_e.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=_e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=a0(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ji(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ti);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=_e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xa)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xa);return hd(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mn(e,t){return new c0(e,t)}const{schedule:zi}=kd(queueMicrotask,!1),tt={x:!1,y:!1};function qd(){return tt.x||tt.y}function l0(e){return e==="x"||e==="y"?tt[e]?null:(tt[e]=!0,()=>{tt[e]=!1}):tt.x||tt.y?null:(tt.x=tt.y=!0,()=>{tt.x=tt.y=!1})}function Xd(e,t){const n=i0(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ja(e){return!(e.pointerType==="touch"||qd())}function d0(e,t,n={}){const[r,s,o]=Xd(e,n),i=a=>{if(!Ja(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=f=>{Ja(f)&&(l(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",i,s)}),o}const Jd=(e,t)=>t?e===t?!0:Jd(e,t.parentElement):!1,Ui=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,u0=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function f0(e){return u0.has(e.tagName)||e.tabIndex!==-1}const Zr=new WeakSet;function Qa(e){return t=>{t.key==="Enter"&&e(t)}}function qs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const h0=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Qa(()=>{if(Zr.has(n))return;qs(n,"down");const s=Qa(()=>{qs(n,"up")}),o=()=>qs(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ec(e){return Ui(e)&&!qd()}function m0(e,t,n={}){const[r,s,o]=Xd(e,n),i=a=>{const c=a.currentTarget;if(!ec(a))return;Zr.add(c);const l=t(c,a),u=(g,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Zr.has(c)&&Zr.delete(c),ec(g)&&typeof l=="function"&&l(g,{success:y})},f=g=>{u(g,c===window||c===document||n.useGlobalTarget||Jd(c,g.target))},h=g=>{u(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,s),Yd(a)&&(a.addEventListener("focus",l=>h0(l,s)),!f0(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Qd(e){return ud(e)&&"ownerSVGElement"in e}function p0(e){return Qd(e)&&e.tagName==="svg"}const Le=e=>!!(e&&e.getVelocity),g0=[...Wd,je,Ot],y0=e=>g0.find(Ud(e)),Wi=A.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class x0 extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Yd(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function b0({children:e,isPresent:t,anchorX:n,root:r}){const s=A.useId(),o=A.useRef(null),i=A.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=A.useContext(Wi);return A.useInsertionEffect(()=>{const{width:c,height:l,top:u,left:f,right:h}=i.current;if(t||!o.current||!c||!l)return;const g=n==="left"?`left: ${f}`:`right: ${h}`;o.current.dataset.motionPopId=s;const y=document.createElement("style");a&&(y.nonce=a);const p=r??document.head;return p.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
2
  [data-motion-pop-id="${s}"] {
3
3
  position: absolute !important;
4
4
  width: ${c}px !important;
@@ -6,203 +6,133 @@
6
6
  ${g}px !important;
7
7
  top: ${u}px !important;
8
8
  }
9
- `),()=>{f.contains(y)&&f.removeChild(y)}},[t]),d.jsx(sg,{isPresent:t,childRef:o,sizeRef:i,children:m.cloneElement(e,{ref:o})})}const ig=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a,root:c})=>{const l=zi(ag),u=A.useId();let h=!0,p=A.useMemo(()=>(h=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:g=>{l.set(g,!0);for(const y of l.values())if(!y)return;r&&r()},register:g=>(l.set(g,!1),()=>l.delete(g))}),[n,l,r]);return o&&h&&(p={...p}),A.useMemo(()=>{l.forEach((g,y)=>l.set(y,!1))},[n]),m.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(e=d.jsx(og,{isPresent:n,anchorX:a,root:c,children:e})),d.jsx(Ns.Provider,{value:p,children:e})};function ag(){return new Map}function ju(e=!0){const t=A.useContext(Ns);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=A.useId();A.useEffect(()=>{if(e)return s(o)},[e]);const i=A.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const _r=e=>e.key||"";function Sc(e){const t=[];return A.Children.forEach(e,n=>{A.isValidElement(n)&&t.push(n)}),t}const Nn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[l,u]=ju(i),h=A.useMemo(()=>Sc(e),[e]),p=i&&!l?[]:h.map(_r),g=A.useRef(!0),y=A.useRef(h),f=zi(()=>new Map),[v,w]=A.useState(h),[b,S]=A.useState(h);Bd(()=>{g.current=!1,y.current=h;for(let T=0;T<b.length;T++){const k=_r(b[T]);p.includes(k)?f.delete(k):f.get(k)!==!0&&f.set(k,!1)}},[b,p.length,p.join("-")]);const C=[];if(h!==v){let T=[...h];for(let k=0;k<b.length;k++){const P=b[k],$=_r(P);p.includes($)||(T.splice(k,0,P),C.push(P))}return o==="wait"&&C.length&&(T=C),S(Sc(T)),w(h),null}process.env.NODE_ENV!=="production"&&o==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:E}=A.useContext(Hi);return d.jsx(d.Fragment,{children:b.map(T=>{const k=_r(T),P=i&&!l?!1:h===b||p.includes(k),$=()=>{if(f.has(k))f.set(k,!0);else return;let x=!0;f.forEach(I=>{I||(x=!1)}),x&&(E==null||E(),S(y.current),i&&(u==null||u()),r&&r())};return d.jsx(ig,{isPresent:P,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:P?void 0:$,anchorX:a,children:T},k)})})},Vu=A.createContext({strict:!1}),Cc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ln={};for(const e in Cc)Ln[e]={isEnabled:t=>Cc[e].some(n=>!!t[n])};function cg(e){for(const t in e)Ln[t]={...Ln[t],...e[t]}}const lg=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function vs(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lg.has(e)}let Iu=e=>!vs(e);function dg(e){typeof e=="function"&&(Iu=t=>t.startsWith("on")?!vs(t):e(t))}try{dg(require("@emotion/is-prop-valid").default)}catch{}function ug(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Iu(s)||n===!0&&vs(s)||!t&&!vs(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const js=A.createContext({});function Vs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function gr(e){return typeof e=="string"||Array.isArray(e)}const ha=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ma=["initial",...ha];function Is(e){return Vs(e.animate)||ma.some(t=>gr(e[t]))}function Du(e){return!!(Is(e)||e.variants)}function fg(e,t){if(Is(e)){const{initial:n,animate:r}=e;return{initial:n===!1||gr(n)?n:void 0,animate:gr(r)?r:void 0}}return e.inherit!==!1?t:{}}function hg(e){const{initial:t,animate:n}=fg(e,A.useContext(js));return A.useMemo(()=>({initial:t,animate:n}),[Ec(t),Ec(n)])}function Ec(e){return Array.isArray(e)?e.join(" "):e}const yr={};function mg(e){for(const t in e)yr[t]=e[t],Ji(t)&&(yr[t].isCSSVariable=!0)}function Ou(e,{layout:t,layoutId:n}){return Zn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!yr[e]||e==="opacity")}const pg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gg=Wn.length;function yg(e,t,n){let r="",s=!0;for(let o=0;o<gg;o++){const i=Wn[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Tu(a,la[i]);if(!c){s=!1;const u=pg[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function pa(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Zn.has(c)){i=!0;continue}else if(Ji(c)){s[c]=l;continue}else{const u=Tu(l,la[c]);c.startsWith("origin")?(a=!0,o[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=yg(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${l} ${u}`}}const ga=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $u(e,t,n){for(const r in t)!He(t[r])&&!Ou(r,n)&&(e[r]=t[r])}function vg({transformTemplate:e},t){return A.useMemo(()=>{const n=ga();return pa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function xg(e,t){const n=e.style||{},r={};return $u(r,n,e),Object.assign(r,vg(e,t)),r}function bg(e,t){const n={},r=xg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const wg={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sg={offset:"strokeDashoffset",array:"strokeDasharray"};function Cg(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?wg:Sg;e[o.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[o.array]=`${i} ${a}`}function Lu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...a},c,l,u){if(pa(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p}=e;h.transform&&(p.transform=h.transform,delete h.transform),(p.transform||h.transformOrigin)&&(p.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&Cg(h,s,o,i,!1)}const _u=()=>({...ga(),attrs:{}}),Fu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Eg(e,t,n,r){const s=A.useMemo(()=>{const o=_u();return Lu(o,t,Fu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};$u(o,e.style,e),s.style={...o,...s.style}}return s}const kg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ya(e){return typeof e!="string"||e.includes("-")?!1:!!(kg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Tg(e,t,n,{latestValues:r},s,o=!1){const a=(ya(e)?Eg:bg)(t,r,s,e),c=ug(t,typeof e=="string",o),l=e!==A.Fragment?{...c,...a,ref:n}:{},{children:u}=t,h=A.useMemo(()=>He(u)?u.get():u,[u]);return A.createElement(e,{...l,children:h})}function kc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function va(e,t,n,r){if(typeof t=="function"){const[s,o]=kc(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=kc(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function ss(e){return He(e)?e.get():e}function Ag({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Pg(n,r,s,e),renderState:t()}}function Pg(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=ss(o[p]);let{initial:i,animate:a}=e;const c=Is(e),l=Du(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const h=u?a:i;if(h&&typeof h!="boolean"&&!Vs(h)){const p=Array.isArray(h)?h:[h];for(let g=0;g<p.length;g++){const y=va(e,p[g]);if(y){const{transitionEnd:f,transition:v,...w}=y;for(const b in w){let S=w[b];if(Array.isArray(S)){const C=u?S.length-1:0;S=S[C]}S!==null&&(s[b]=S)}for(const b in f)s[b]=f[b]}}}return s}const Bu=e=>(t,n)=>{const r=A.useContext(js),s=A.useContext(Ns),o=()=>Ag(e,t,r,s);return n?o():zi(o)};function xa(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(He(r[i])||t.style&&He(t.style[i])||Ou(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const Mg=Bu({scrapeMotionValuesFromProps:xa,createRenderState:ga});function Hu(e,t,n){const r=xa(e,t,n);for(const s in e)if(He(e[s])||He(t[s])){const o=Wn.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const Rg=Bu({scrapeMotionValuesFromProps:Hu,createRenderState:_u}),Ng=Symbol.for("motionComponentSymbol");function An(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function jg(e,t,n){return A.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):An(n)&&(n.current=r))},[t])}const ba=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Vg="framerAppearId",zu="data-"+ba(Vg),Uu=A.createContext({});function Ig(e,t,n,r,s){var f,v;const{visualElement:o}=A.useContext(js),i=A.useContext(Vu),a=A.useContext(Ns),c=A.useContext(fa).reducedMotion,l=A.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,h=A.useContext(Uu);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&Dg(l.current,n,s,h);const p=A.useRef(!1);A.useInsertionEffect(()=>{u&&p.current&&u.update(n,a)});const g=n[zu],y=A.useRef(!!g&&!((f=window.MotionHandoffIsComplete)!=null&&f.call(window,g))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,g)));return Bd(()=>{u&&(p.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),y.current&&u.animationState&&u.animationState.animateChanges())}),A.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,g)}),y.current=!1),u.enteringChildren=void 0)}),u}function Dg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Wu(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&An(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Wu(e){if(e)return e.options.allowProjection!==!1?e.projection:Wu(e.parent)}function mo(e,{forwardMotionProps:t=!1}={},n,r){n&&cg(n);const s=ya(e)?Rg:Mg;function o(a,c){let l;const u={...A.useContext(fa),...a,layoutId:Og(a)},{isStatic:h}=u,p=hg(a),g=s(a,h);if(!h&&Ui){$g(u,n);const y=Lg(u);l=y.MeasureLayout,p.visualElement=Ig(e,g,u,r,y.ProjectionNode)}return d.jsxs(js.Provider,{value:p,children:[l&&p.visualElement?d.jsx(l,{visualElement:p.visualElement,...u}):null,Tg(e,a,jg(g,p.visualElement,c),g,h,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=A.forwardRef(o);return i[Ng]=e,i}function Og({layoutId:e}){const t=A.useContext(Hi).id;return t&&e!==void 0?t+"-"+e:e}function $g(e,t){const n=A.useContext(Vu).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?zn(!1,r,"lazy-strict-mode"):Rt(!1,r,"lazy-strict-mode")}}function Lg(e){const{drag:t,layout:n}=Ln;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function _g(e,t){if(typeof Proxy>"u")return mo;const n=new Map,r=(o,i)=>mo(o,i,e,t),s=(o,i)=>(process.env.NODE_ENV!=="production"&&Gi(!1,"motion() is deprecated. Use motion.create() instead."),r(o,i));return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,mo(i,void 0,e,t)),n.get(i))})}function Zu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Fg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function po(e){return e===void 0||e===1}function ci({scale:e,scaleX:t,scaleY:n}){return!po(e)||!po(t)||!po(n)}function Qt(e){return ci(e)||Ku(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ku(e){return Tc(e.x)||Tc(e.y)}function Tc(e){return e&&e!=="0%"}function xs(e,t,n){const r=e-n,s=t*r;return n+s}function Ac(e,t,n,r,s){return s!==void 0&&(e=xs(e,s,r)),xs(e,n,r)+t}function li(e,t=0,n=1,r,s){e.min=Ac(e.min,t,n,r,s),e.max=Ac(e.max,t,n,r,s)}function Yu(e,{x:t,y:n}){li(e.x,t.translate,t.scale,t.originPoint),li(e.y,n.translate,n.scale,n.originPoint)}const Pc=.999999999999,Mc=1.0000000000001;function Hg(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Mn(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Yu(e,i)),r&&Qt(o.latestValues)&&Mn(e,o.latestValues))}t.x<Mc&&t.x>Pc&&(t.x=1),t.y<Mc&&t.y>Pc&&(t.y=1)}function Pn(e,t){e.min=e.min+t,e.max=e.max+t}function Rc(e,t,n,r,s=.5){const o=Se(e.min,e.max,s);li(e,t,n,o,r)}function Mn(e,t){Rc(e.x,t.x,t.scaleX,t.scale,t.originX),Rc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Gu(e,t){return Zu(Bg(e.getBoundingClientRect(),t))}function zg(e,t,n){const r=Gu(e,n),{scroll:s}=t;return s&&(Pn(r.x,s.offset.x),Pn(r.y,s.offset.y)),r}const Nc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rn=()=>({x:Nc(),y:Nc()}),jc=()=>({min:0,max:0}),Ae=()=>({x:jc(),y:jc()}),di={current:null},qu={current:!1};function Ug(){if(qu.current=!0,!!Ui)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>di.current=e.matches;e.addEventListener("change",t),t()}else di.current=!1}const Wg=new WeakMap;function Zg(e,t,n){for(const r in t){const s=t[r],o=n[r];if(He(s))e.addValue(r,s);else if(He(o))e.addValue(r,$n(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,$n(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Kg{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=aa,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ue.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,be.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Is(n),this.isVariantNode=Du(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];c[p]!==void 0&&He(g)&&g.set(c[p])}}mount(t){var n;this.current=t,Wg.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),qu.current||Ug(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:di.current,process.env.NODE_ENV!=="production"&&Gi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),_t(this.notifyUpdate),_t(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Zn.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&be.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ln){const n=Ln[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ae()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vc.length;r++){const s=Vc[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=Zg(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=$n(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Hd(r)||Ud(r))?r=parseFloat(r):!rg(r)&&Ft.test(n)&&(r=ku(t,n)),this.setBaseTarget(t,He(r)?r.get():r)),He(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=va(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!He(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Yi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){da.render(this.render)}}class Xu extends Kg{constructor(){super(...arguments),this.KeyframeResolver=W0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;He(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ju(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Yg(e){return window.getComputedStyle(e)}class Gg extends Xu{constructor(){super(...arguments),this.type="html",this.renderInstance=Ju}readValueFromInstance(t,n){var r;if(Zn.has(n))return(r=this.projection)!=null&&r.isProjecting?ti(n):l0(t,n);{const s=Yg(t),o=(Ji(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Gu(t,n)}build(t,n,r){pa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xa(t,n,r)}}const Qu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function qg(e,t,n,r){Ju(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Qu.has(s)?s:ba(s),t.attrs[s])}class Xg extends Xu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Zn.has(n)){const r=Eu(n);return r&&r.default||0}return n=Qu.has(n)?n:ba(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Hu(t,n,r)}build(t,n,r){Lu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){qg(t,n,r,s)}mount(t){this.isSVGTag=Fu(t.tagName),super.mount(t)}}const Jg=(e,t)=>ya(e)?new Xg(t):new Gg(t,{allowProjection:e!==A.Fragment});function jn(e,t,n){const r=e.getProps();return va(r,t,n!==void 0?n:r.custom,e)}const ui=e=>Array.isArray(e);function Qg(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$n(n))}function ey(e){return ui(e)?e[e.length-1]||0:e}function ty(e,t){const n=jn(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const a=ey(o[i]);Qg(e,i,a)}}function ny(e){return!!(He(e)&&e.add)}function fi(e,t){const n=e.getValue("willChange");if(ny(n))return n.add(t);if(!n&&Nt.WillChange){const r=new Nt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ef(e){return e.props[zu]}const ry=e=>e!==null;function sy(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(ry),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const oy={type:"spring",stiffness:500,damping:25,restSpeed:10},iy=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ay={type:"keyframes",duration:.8},cy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ly=(e,{keyframes:t})=>t.length>2?ay:Zn.has(e)?e.startsWith("scale")?iy(t[1]):oy:cy;function dy({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const wa=(e,t,n,r={},s,o)=>i=>{const a=ca(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-at(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};dy(a)||Object.assign(u,ly(e,u)),u.duration&&(u.duration=at(u.duration)),u.repeatDelay&&(u.repeatDelay=at(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ii(u),u.delay===0&&(h=!0)),(Nt.instantAnimations||Nt.skipAnimations)&&(h=!0,ii(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const p=sy(u.keyframes,a);if(p!==void 0){be.update(()=>{u.onUpdate(p),u.onComplete()});return}}return a.isSync?new ia(u):new j0(u)};function uy({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function tf(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(o=r);const c=[],l=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const h=e.getValue(u,e.latestValues[u]??null),p=a[u];if(p===void 0||l&&uy(l,u))continue;const g={delay:n,...ca(o||{},u)},y=h.get();if(y!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===y&&!g.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){const w=ef(e);if(w){const b=window.MotionHandoffAnimation(w,u,be);b!==null&&(g.startTime=b,f=!0)}}fi(e,u),h.start(wa(u,h,p,e.shouldReduceMotion&&wu.has(u)?{type:!1}:g,e,f));const v=h.animation;v&&c.push(v)}return i&&Promise.all(c).then(()=>{be.update(()=>{i&&ty(e,i)})}),c}function nf(e,t,n,r=0,s=1){const o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:a-o*r}function hi(e,t,n={}){var c;const r=jn(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(tf(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:p}=s;return fy(e,t,l,u,h,p,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,u]=a==="beforeChildren"?[o,i]:[i,o];return l().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function fy(e,t,n=0,r=0,s=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(hi(c,t,{...i,delay:n+(typeof r=="function"?0:r)+nf(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function hy(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>hi(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=hi(e,t,n);else{const s=typeof t=="function"?jn(e,t,n.custom):t;r=Promise.all(tf(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function rf(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const my=ma.length;function sf(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?sf(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<my;n++){const r=ma[n],s=e.props[r];(gr(s)||s===!1)&&(t[r]=s)}return t}const py=[...ha].reverse(),gy=ha.length;function yy(e){return t=>Promise.all(t.map(({animation:n,options:r})=>hy(e,n,r)))}function vy(e){let t=yy(e),n=Ic(),r=!0;const s=c=>(l,u)=>{var p;const h=jn(e,u,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:g,transitionEnd:y,...f}=h;l={...l,...f,...y}}return l};function o(c){t=c(e)}function i(c){const{props:l}=e,u=sf(e.parent)||{},h=[],p=new Set;let g={},y=1/0;for(let v=0;v<gy;v++){const w=py[v],b=n[w],S=l[w]!==void 0?l[w]:u[w],C=gr(S),E=w===c?b.isActive:null;E===!1&&(y=v);let T=S===u[w]&&S!==l[w]&&C;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),b.protectedKeys={...g},!b.isActive&&E===null||!S&&!b.prevProp||Vs(S)||typeof S=="boolean")continue;const k=xy(b.prevProp,S);let P=k||w===c&&b.isActive&&!T&&C||v>y&&C,$=!1;const x=Array.isArray(S)?S:[S];let I=x.reduce(s(w),{});E===!1&&(I={});const{prevResolvedValues:_={}}=b,K={..._,...I},Y=U=>{P=!0,p.has(U)&&($=!0,p.delete(U)),b.needsAnimating[U]=!0;const M=e.getValue(U);M&&(M.liveStyle=!1)};for(const U in K){const M=I[U],q=_[U];if(g.hasOwnProperty(U))continue;let N=!1;ui(M)&&ui(q)?N=!rf(M,q):N=M!==q,N?M!=null?Y(U):p.add(U):M!==void 0&&p.has(U)?Y(U):b.protectedKeys[U]=!0}b.prevProp=S,b.prevResolvedValues=I,b.isActive&&(g={...g,...I}),r&&e.blockInitialAnimation&&(P=!1);const X=T&&k;P&&(!X||$)&&h.push(...x.map(U=>{const M={type:w};if(typeof U=="string"&&r&&!X&&e.manuallyAnimateOnMount&&e.parent){const{parent:q}=e,N=jn(q,U);if(q.enteringChildren&&N){const{delayChildren:V}=N.transition||{};M.delay=nf(q.enteringChildren,e,V)}}return{animation:U,options:M}}))}if(p.size){const v={};if(typeof l.initial!="boolean"){const w=jn(e,Array.isArray(l.initial)?l.initial[0]:l.initial);w&&w.transition&&(v.transition=w.transition)}p.forEach(w=>{const b=e.getBaseTarget(w),S=e.getValue(w);S&&(S.liveStyle=!0),v[w]=b??null}),h.push({animation:v})}let f=!!h.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(h):Promise.resolve()}function a(c,l){var h;if(n[c].isActive===l)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var g;return(g=p.animationState)==null?void 0:g.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ic(),r=!0}}}function xy(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rf(t,e):!1}function Xt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ic(){return{animate:Xt(!0),whileInView:Xt(),whileHover:Xt(),whileTap:Xt(),whileDrag:Xt(),whileFocus:Xt(),exit:Xt()}}class Wt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class by extends Wt{constructor(t){super(t),t.animationState||(t.animationState=vy(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let wy=0;class Sy extends Wt{constructor(){super(...arguments),this.id=wy++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Cy={animation:{Feature:by},exit:{Feature:Sy}};function vr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mr(e){return{point:{x:e.pageX,y:e.pageY}}}const Ey=e=>t=>ua(t)&&e(t,Mr(t));function lr(e,t,n,r){return vr(e,t,Ey(n),r)}const of=1e-4,ky=1-of,Ty=1+of,af=.01,Ay=0-af,Py=0+af;function ze(e){return e.max-e.min}function My(e,t,n){return Math.abs(e-t)<=n}function Dc(e,t,n,r=.5){e.origin=r,e.originPoint=Se(t.min,t.max,e.origin),e.scale=ze(n)/ze(t),e.translate=Se(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ky&&e.scale<=Ty||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ay&&e.translate<=Py||isNaN(e.translate))&&(e.translate=0)}function dr(e,t,n,r){Dc(e.x,t.x,n.x,r?r.originX:void 0),Dc(e.y,t.y,n.y,r?r.originY:void 0)}function Oc(e,t,n){e.min=n.min+t.min,e.max=e.min+ze(t)}function Ry(e,t,n){Oc(e.x,t.x,n.x),Oc(e.y,t.y,n.y)}function $c(e,t,n){e.min=t.min-n.min,e.max=e.min+ze(t)}function ur(e,t,n){$c(e.x,t.x,n.x),$c(e.y,t.y,n.y)}function Qe(e){return[e("x"),e("y")]}const cf=({current:e})=>e?e.ownerDocument.defaultView:null,Lc=(e,t)=>Math.abs(e-t);function Ny(e,t){const n=Lc(e.x,t.x),r=Lc(e.y,t.y);return Math.sqrt(n**2+r**2)}class lf{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=yo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=Ny(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:f}=p,{timestamp:v}=Oe;this.history.push({...f,timestamp:v});const{onStart:w,onMove:b}=this.handlers;g||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=go(g,this.transformPagePoint),be.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:y,onSessionEnd:f,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=yo(p.type==="pointercancel"?this.lastMoveEventInfo:go(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,w),f&&f(p,w)},!ua(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const a=Mr(t),c=go(a,this.transformPagePoint),{point:l}=c,{timestamp:u}=Oe;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=n;h&&h(t,yo(c,this.history)),this.removeListeners=Tr(lr(this.contextWindow,"pointermove",this.handlePointerMove),lr(this.contextWindow,"pointerup",this.handlePointerUp),lr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_t(this.updatePoint)}}function go(e,t){return t?{point:t(e.point)}:e}function _c(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yo({point:e},t){return{point:e,delta:_c(e,df(t)),offset:_c(e,jy(t)),velocity:Vy(t,.1)}}function jy(e){return e[0]}function df(e){return e[e.length-1]}function Vy(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=df(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>at(t)));)n--;if(!r)return{x:0,y:0};const o=vt(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Iy(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Se(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Se(n,e,r.max):Math.min(e,n)),e}function Fc(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Dy(e,{top:t,left:n,bottom:r,right:s}){return{x:Fc(e.x,n,s),y:Fc(e.y,t,r)}}function Bc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Oy(e,t){return{x:Bc(e.x,t.x),y:Bc(e.y,t.y)}}function $y(e,t){let n=.5;const r=ze(e),s=ze(t);return s>r?n=hr(t.min,t.max-r,e.min):r>s&&(n=hr(e.min,e.max-s,t.min)),Mt(0,1,n)}function Ly(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const mi=.35;function _y(e=mi){return e===!1?e=0:e===!0&&(e=mi),{x:Hc(e,"left","right"),y:Hc(e,"top","bottom")}}function Hc(e,t,n){return{min:zc(e,t),max:zc(e,n)}}function zc(e,t){return typeof e=="number"?e:e[t]||0}const Fy=new WeakMap;class By{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ae(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=h=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mr(h).point)},i=(h,p)=>{const{drag:g,dragPropagation:y,onDragStart:f}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=G0(g),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qe(w=>{let b=this.getAxisMotionValue(w).get()||0;if(xt.test(b)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[w];C&&(b=ze(C)*(parseFloat(b)/100))}}this.originPoint[w]=b}),f&&be.postRender(()=>f(h,p)),fi(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:f,onDrag:v}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=p;if(y&&this.currentDirection===null){this.currentDirection=Hy(w),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",p.point,w),this.updateAxis("y",p.point,w),this.visualElement.render(),v&&v(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>Qe(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new lf(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:cf(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&be.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Fr(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=Iy(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&An(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Dy(r.layoutBox,t):this.constraints=!1,this.elastic=_y(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Qe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Ly(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!An(t))return!1;const r=t.current;Rt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=zg(r,s.root,this.visualElement.getTransformPagePoint());let i=Oy(s.layout.layoutBox,o);if(n){const a=n(Fg(i));this.hasMutatedConstraints=!!a,a&&(i=Zu(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Qe(u=>{if(!Fr(u,n,this.currentDirection))return;let h=c&&c[u]||{};i&&(h={min:0,max:0});const p=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,y)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return fi(this.visualElement,t),r.start(wa(t,r,0,n,this.visualElement,!1))}stopAnimation(){Qe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Qe(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Qe(n=>{const{drag:r}=this.getProps();if(!Fr(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n];o.set(t[n]-Se(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!An(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Qe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();s[i]=$y({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Qe(i=>{if(!Fr(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(Se(c,l,s[i]))})}addListeners(){if(!this.visualElement.current)return;Fy.set(this.visualElement,this);const t=this.visualElement.current,n=lr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();An(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),be.read(r);const i=vr(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Qe(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=c[u].translate,h.set(h.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=mi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function Fr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Hy(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class zy extends Wt{constructor(t){super(t),this.removeGroupControls=nt,this.removeListeners=nt,this.controls=new By(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Uc=e=>(t,n)=>{e&&be.postRender(()=>e(t,n))};class Uy extends Wt{constructor(){super(...arguments),this.removePointerDownListener=nt}onPointerDown(t){this.session=new lf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Uc(t),onStart:Uc(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&be.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=lr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const os={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Wc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const er={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=Wc(e,t.target.x),r=Wc(e,t.target.y);return`${n}% ${r}%`}},Wy={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ft.parse(e);if(s.length>5)return r;const o=Ft.createTransformer(e),i=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+i]/=a,s[1+i]/=c;const l=Se(a,c,.5);return typeof s[2+i]=="number"&&(s[2+i]/=l),typeof s[3+i]=="number"&&(s[3+i]/=l),o(s)}};let vo=!1;class Zy extends A.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;mg(Ky),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),vo&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),os.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,vo=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||be.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),da.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;vo=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uf(e){const[t,n]=ju(),r=A.useContext(Hi);return d.jsx(Zy,{...e,layoutGroup:r,switchLayoutGroup:A.useContext(Uu),isPresent:t,safeToRemove:n})}const Ky={borderRadius:{...er,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:er,borderTopRightRadius:er,borderBottomLeftRadius:er,borderBottomRightRadius:er,boxShadow:Wy};function Yy(e,t,n){const r=He(e)?e:$n(e);return r.start(wa("",r,t,n)),r.animation}const Gy=(e,t)=>e.depth-t.depth;class qy{constructor(){this.children=[],this.isDirty=!1}add(t){Wi(this.children,t),this.isDirty=!0}remove(t){Zi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gy),this.isDirty=!1,this.children.forEach(t)}}function Xy(e,t){const n=Ue.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(_t(r),e(o-t))};return be.setup(r,!0),()=>_t(r)}const ff=["TopLeft","TopRight","BottomLeft","BottomRight"],Jy=ff.length,Zc=e=>typeof e=="string"?parseFloat(e):e,Kc=e=>typeof e=="number"||re.test(e);function Qy(e,t,n,r,s,o){s?(e.opacity=Se(0,n.opacity??1,e1(r)),e.opacityExit=Se(t.opacity??1,0,t1(r))):o&&(e.opacity=Se(t.opacity??1,n.opacity??1,r));for(let i=0;i<Jy;i++){const a=`border${ff[i]}Radius`;let c=Yc(t,a),l=Yc(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Kc(c)===Kc(l)?(e[a]=Math.max(Se(Zc(c),Zc(l),r),0),(xt.test(l)||xt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=Se(t.rotate||0,n.rotate||0,r))}function Yc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const e1=hf(0,.5,Jd),t1=hf(.5,.95,nt);function hf(e,t,n){return r=>r<e?0:r>t?1:n(hr(e,t,r))}function Gc(e,t){e.min=t.min,e.max=t.max}function Je(e,t){Gc(e.x,t.x),Gc(e.y,t.y)}function qc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Xc(e,t,n,r,s){return e-=t,e=xs(e,1/n,r),s!==void 0&&(e=xs(e,1/s,r)),e}function n1(e,t=0,n=1,r=.5,s,o=e,i=e){if(xt.test(t)&&(t=parseFloat(t),t=Se(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Se(o.min,o.max,r);e===o&&(a-=t),e.min=Xc(e.min,t,n,a,s),e.max=Xc(e.max,t,n,a,s)}function Jc(e,t,[n,r,s],o,i){n1(e,t[n],t[r],t[s],t.scale,o,i)}const r1=["x","scaleX","originX"],s1=["y","scaleY","originY"];function Qc(e,t,n,r){Jc(e.x,t,r1,n?n.x:void 0,r?r.x:void 0),Jc(e.y,t,s1,n?n.y:void 0,r?r.y:void 0)}function el(e){return e.translate===0&&e.scale===1}function mf(e){return el(e.x)&&el(e.y)}function tl(e,t){return e.min===t.min&&e.max===t.max}function o1(e,t){return tl(e.x,t.x)&&tl(e.y,t.y)}function nl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pf(e,t){return nl(e.x,t.x)&&nl(e.y,t.y)}function rl(e){return ze(e.x)/ze(e.y)}function sl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class i1{constructor(){this.members=[]}add(t){Wi(this.members,t),t.scheduleRender()}remove(t){if(Zi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function a1(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:h,rotateY:p,skewX:g,skewY:y}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),g&&(r+=`skewX(${g}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const xo=["","X","Y","Z"],c1=1e3;let l1=0;function bo(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function gf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ef(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",be,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&gf(r)}function yf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},a=t==null?void 0:t()){this.id=l1++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f1),this.nodes.forEach(g1),this.nodes.forEach(y1),this.nodes.forEach(h1)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new qy)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Yi),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Nu(i)&&!tg(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,h=0;const p=()=>this.root.updateBlockedByResize=!1;be.read(()=>{h=window.innerWidth}),e(i,()=>{const g=window.innerWidth;g!==h&&(h=g,this.root.updateBlockedByResize=!0,u&&u(),u=Xy(p,250),os.hasAnimatedSinceResize&&(os.hasAnimatedSinceResize=!1,this.nodes.forEach(al)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||l.getDefaultTransition()||S1,{onLayoutAnimationStart:f,onLayoutAnimationComplete:v}=l.getProps(),w=!this.targetLayout||!pf(this.targetLayout,g),b=!h&&p;if(this.options.layoutRoot||this.resumeFrom||b||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...ca(y,"layout"),onPlay:f,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,b)}else h||al(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_t(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(v1),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&gf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ol);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(il);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p1),this.nodes.forEach(d1),this.nodes.forEach(u1)):this.nodes.forEach(il),this.clearAllSnapshots();const a=Ue.now();Oe.delta=Mt(0,1e3/60,a-Oe.timestamp),Oe.timestamp=a,Oe.isProcessing=!0,ao.update.process(Oe),ao.preRender.process(Oe),ao.render.process(Oe),Oe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,da.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(m1),this.sharedNodes.forEach(x1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,be.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ae(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!mf(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Qt(this.latestValues)||u)&&(s(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),C1(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return Ae();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(E1))){const{scroll:u}=this.root;u&&(Pn(a.x,u.offset.x),Pn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Ae();if(Je(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:h,options:p}=u;u!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&Je(a,i),Pn(a.x,h.offset.x),Pn(a.y,h.offset.y))}return a}applyTransform(i,a=!1){const c=Ae();Je(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Mn(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Qt(u.latestValues)&&Mn(c,u.latestValues)}return Qt(this.latestValues)&&Mn(c,this.latestValues),c}removeTransform(i){const a=Ae();Je(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Qt(l.latestValues))continue;ci(l.latestValues)&&l.updateSnapshot();const u=Ae(),h=l.measurePageBox();Je(u,h),Qc(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Qt(this.latestValues)&&Qc(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Oe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!(!this.layout||!(u||h))){if(this.resolvedRelativeTargetAt=Oe.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),ur(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Je(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ae(),this.targetWithTransforms=Ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ry(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Je(this.target,this.layout.layoutBox),Yu(this.target,this.targetDelta)):Je(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),ur(this.relativeTargetOrigin,this.target,g.target),Je(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ci(this.parent.latestValues)||Ku(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Oe.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Je(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;Hg(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ae());const{target:g}=i;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qc(this.prevProjectionDelta.x,this.projectionDelta.x),qc(this.prevProjectionDelta.y,this.projectionDelta.y)),dr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!sl(this.projectionDelta.x,this.prevProjectionDelta.x)||!sl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rn(),this.projectionDelta=Rn(),this.projectionDeltaWithTransform=Rn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=Rn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Ae(),g=c?c.source:void 0,y=this.layout?this.layout.source:void 0,f=g!==y,v=this.getStack(),w=!v||v.members.length<=1,b=!!(f&&!w&&this.options.crossfade===!0&&!this.path.some(w1));this.animationProgress=0;let S;this.mixTargetDelta=C=>{const E=C/1e3;cl(h.x,i.x,E),cl(h.y,i.y,E),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ur(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b1(this.relativeTarget,this.relativeTargetOrigin,p,E),S&&o1(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Ae()),Je(S,this.relativeTarget)),f&&(this.animationValues=u,Qy(u,l,this.latestValues,E,b,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(),this.pendingAnimation&&(_t(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=be.update(()=>{os.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=$n(0)),this.currentAnimation=Yy(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(c1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&vf(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ae();const h=ze(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+h;const p=ze(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+p}Je(a,c),Mn(a,u),dr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new i1),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&bo("z",i,l,this.animationValues);for(let u=0;u<xo.length;u++)bo(`rotate${xo[u]}`,i,l,this.animationValues),bo(`skew${xo[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=ss(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=ss(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=a1(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),i.transform=h;const{x:p,y:g}=this.projectionDelta;i.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in yr){if(u[y]===void 0)continue;const{correct:f,applyTo:v,isCSSVariable:w}=yr[y],b=h==="none"?u[y]:f(u[y],l);if(v){const S=v.length;for(let C=0;C<S;C++)i[v[C]]=b}else w?this.options.visualElement.renderState.vars[y]=b:i[y]=b}this.options.layoutId&&(i.pointerEvents=l===this?ss(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(ol),this.root.sharedNodes.clear()}}}function d1(e){e.updateLayout()}function u1(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?Qe(h=>{const p=i?t.measuredBox[h]:t.layoutBox[h],g=ze(p);p.min=r[h].min,p.max=p.min+g}):vf(o,t.layoutBox,r)&&Qe(h=>{const p=i?t.measuredBox[h]:t.layoutBox[h],g=ze(r[h]);p.max=p.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+g)});const a=Rn();dr(a,r,t.layoutBox);const c=Rn();i?dr(c,e.applyTransform(s,!0),t.measuredBox):dr(c,r,t.layoutBox);const l=!mf(a);let u=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:g}=h;if(p&&g){const y=Ae();ur(y,t.layoutBox,p.layoutBox);const f=Ae();ur(f,r,g.layoutBox),pf(y,f)||(u=!0),h.options.layoutRoot&&(e.relativeTarget=f,e.relativeTargetOrigin=y,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function f1(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h1(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function m1(e){e.clearSnapshot()}function ol(e){e.clearMeasurements()}function il(e){e.isLayoutDirty=!1}function p1(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function al(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function g1(e){e.resolveTargetDelta()}function y1(e){e.calcProjection()}function v1(e){e.resetSkewAndRotation()}function x1(e){e.removeLeadSnapshot()}function cl(e,t,n){e.translate=Se(t.translate,0,n),e.scale=Se(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ll(e,t,n,r){e.min=Se(t.min,n.min,r),e.max=Se(t.max,n.max,r)}function b1(e,t,n,r){ll(e.x,t.x,n.x,r),ll(e.y,t.y,n.y,r)}function w1(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const S1={duration:.45,ease:[.4,0,.1,1]},dl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ul=dl("applewebkit/")&&!dl("chrome/")?Math.round:nt;function fl(e){e.min=ul(e.min),e.max=ul(e.max)}function C1(e){fl(e.x),fl(e.y)}function vf(e,t,n){return e==="position"||e==="preserve-aspect"&&!My(rl(t),rl(n),.2)}function E1(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const k1=yf({attachResizeListener:(e,t)=>vr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wo={current:void 0},xf=yf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wo.current){const e=new k1({});e.mount(window),e.setOptions({layoutScroll:!0}),wo.current=e}return wo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),T1={pan:{Feature:Uy},drag:{Feature:zy,ProjectionNode:xf,MeasureLayout:uf}};function hl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&be.postRender(()=>o(t,Mr(t)))}class A1 extends Wt{mount(){const{current:t}=this.node;t&&(this.unmount=q0(t,(n,r)=>(hl(this.node,r,"Start"),s=>hl(this.node,s,"End"))))}unmount(){}}class P1 extends Wt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tr(vr(this.node.current,"focus",()=>this.onFocus()),vr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ml(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&be.postRender(()=>o(t,Mr(t)))}class M1 extends Wt{mount(){const{current:t}=this.node;t&&(this.unmount=eg(t,(n,r)=>(ml(this.node,r,"Start"),(s,{success:o})=>ml(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pi=new WeakMap,So=new WeakMap,R1=e=>{const t=pi.get(e.target);t&&t(e)},N1=e=>{e.forEach(R1)};function j1({root:e,...t}){const n=e||document;So.has(n)||So.set(n,{});const r=So.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(N1,{root:e,...t})),r[s]}function V1(e,t,n){const r=j1(t);return pi.set(e,n),r.observe(e),()=>{pi.delete(e),r.unobserve(e)}}const I1={some:0,all:1};class D1 extends Wt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:I1[s]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),p=l?u:h;p&&p(c)};return V1(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(O1(t,n))&&this.startObserver()}unmount(){}}function O1({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const $1={inView:{Feature:D1},tap:{Feature:M1},focus:{Feature:P1},hover:{Feature:A1}},L1={layout:{ProjectionNode:xf,MeasureLayout:uf}},_1={...Cy,...$1,...T1,...L1},ae=_g(_1,Jg);function F1(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let gi=1;class B1{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gi++,i=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],A.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(z1(l)&&!l.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,y=typeof h=="object"&&!A.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}else if(l instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(l):n.error,p=typeof n.description=="function"?await n.description(l):n.description,y=typeof h=="object"&&!A.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(l):n.success,p=typeof n.description=="function"?await n.description(l):n.description,y=typeof h=="object"&&!A.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:p,...y})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const u=typeof n.error=="function"?await n.error(l):n.error,h=typeof n.description=="function"?await n.description(l):n.description,g=typeof u=="object"&&!A.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gi++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const et=new B1,H1=(e,t)=>{const n=(t==null?void 0:t.id)||gi++;return et.addToast({title:e,...t,id:n}),n},z1=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",U1=H1,W1=()=>et.toasts,Z1=()=>et.getActiveToasts(),bf=Object.assign(U1,{success:et.success,info:et.info,warning:et.warning,error:et.error,custom:et.custom,message:et.message,promise:et.promise,dismiss:et.dismiss,loading:et.loading},{getHistory:W1,getToasts:Z1});F1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const dt=m.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:s="1em",weight:o="regular",mirrored:i=!1,children:a,weights:c,...l}=e;return m.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...l},!!n&&m.createElement("title",null,n),a,c.get(o))});dt.displayName="SSRBase";const K1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Sa=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:K1}));Sa.displayName="CaretDownIcon";const Y1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),m.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),wf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:Y1}));wf.displayName="CaretUpIcon";const G1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),Sf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:G1}));Sf.displayName="ChatTextIcon";const q1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",m.createElement(m.Fragment,null,m.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,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Cf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:q1}));Cf.displayName="CheckIcon";const X1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),m.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]),Ef=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:X1}));Ef.displayName="MicrophoneIcon";const J1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M56.88,39.93A12,12,0,1,0,39.12,56.07L76,96.64V128a52,52,0,0,0,72.11,48l11.26,12.39A67.34,67.34,0,0,1,128,196a68.07,68.07,0,0,1-68-68,12,12,0,0,0-24,0,92.14,92.14,0,0,0,80,91.22V240a12,12,0,0,0,24,0V219.23a90.39,90.39,0,0,0,35.92-12.68l23.2,25.52a12,12,0,0,0,17.76-16.14ZM128,156a28,28,0,0,1-28-28v-5l29.9,32.89C129.27,156,128.64,156,128,156Zm63-2.42A67.63,67.63,0,0,0,196,128a12,12,0,0,1,24,0,91.48,91.48,0,0,1-6.74,34.61,12,12,0,0,1-22.23-9ZM85.7,33.75A52,52,0,0,1,180,64v56.54a12,12,0,0,1-24,0V64a28,28,0,0,0-50.79-16.28,12,12,0,0,1-19.51-14Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),m.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.38,229.92a8,8,0,0,1-11.3-.54l-30.92-34A78.83,78.83,0,0,1,136,207.59V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64.07,64.07,0,0,0,64,64,63.41,63.41,0,0,0,32.21-8.68l-11.1-12.2A48,48,0,0,1,80,128V95.09L42.08,53.38A8,8,0,0,1,53.92,42.62l160,176A8,8,0,0,1,213.38,229.92Zm-24.19-63.13a7.88,7.88,0,0,0,3.51.82,8,8,0,0,0,7.19-4.49A79.16,79.16,0,0,0,208,128a8,8,0,0,0-16,0,63.32,63.32,0,0,1-6.48,28.09A8,8,0,0,0,189.19,166.79Zm-27.33-29.22A8,8,0,0,0,175.74,133a49.49,49.49,0,0,0,.26-5V64A48,48,0,0,0,84,44.87a8,8,0,0,0,1.41,8.57Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.44,220,52.44,44A6,6,0,0,0,43.56,52L82,94.32V128a46,46,0,0,0,67.56,40.64l13.75,15.12A65.26,65.26,0,0,1,128,194a66.08,66.08,0,0,1-66-66,6,6,0,0,0-12,0,78.09,78.09,0,0,0,72,77.75V240a6,6,0,0,0,12,0V205.77a76.93,76.93,0,0,0,37.48-13L203.56,228a6,6,0,0,0,8.88-8.08ZM128,162a34,34,0,0,1-34-34V107.52l47.12,51.84A33.82,33.82,0,0,1,128,162Zm59.32-5A65.38,65.38,0,0,0,194,128a6,6,0,0,1,12,0,77.33,77.33,0,0,1-7.9,34.25A6,6,0,1,1,187.32,157ZM85.8,45.67A46,46,0,0,1,174,64v64a45.17,45.17,0,0,1-.25,4.81,6,6,0,0,1-6,5.38q-.31,0-.63,0a6,6,0,0,1-5.34-6.59A35.41,35.41,0,0,0,162,128V64A34,34,0,0,0,96.8,50.45a6,6,0,0,1-11-4.78Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211,221.31,51,45.31A4,4,0,0,0,45,50.69L84,93.55V128a44,44,0,0,0,66,38.12l16.38,18A67.21,67.21,0,0,1,128,196a68.07,68.07,0,0,1-68-68,4,4,0,0,0-8,0,76.09,76.09,0,0,0,72,75.89V240a4,4,0,0,0,8,0V203.89a75.1,75.1,0,0,0,39.79-13.77L205,226.69a4,4,0,1,0,5.92-5.38ZM128,164a36,36,0,0,1-36-36V102.35L144.43,160A35.83,35.83,0,0,1,128,164Zm61.12-6.15A67.44,67.44,0,0,0,196,128a4,4,0,0,1,8,0,75.28,75.28,0,0,1-7.7,33.37,4,4,0,0,1-7.18-3.52ZM87.63,46.46A44,44,0,0,1,172,64v64a44.2,44.2,0,0,1-.24,4.61,4,4,0,0,1-4,3.58l-.42,0a4,4,0,0,1-3.57-4.39A36.67,36.67,0,0,0,164,128V64A36,36,0,0,0,95,49.66a4,4,0,0,1-7.34-3.2Z"}))]]),kf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:J1}));kf.displayName="MicrophoneSlashIcon";const Q1=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228ZM160.49,103.51a12,12,0,0,1-17,17L140,117v35a12,12,0,0,1-24,0V117l-3.51,3.52a12,12,0,0,1-17-17l24-24a12,12,0,0,1,17,0Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z",opacity:"0.2"}),m.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,224a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64Zm-74.34,42.34-24-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,11.32,11.32L120,107.31V152a8,8,0,0,0,16,0V107.31l10.34,10.35a8,8,0,0,0,11.32-11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Zm-9.76-116.24a6,6,0,1,1-8.48,8.48L134,102.49V152a6,6,0,0,1-12,0V102.49l-13.76,13.75a6,6,0,0,1-8.48-8.48l24-24a6,6,0,0,1,8.48,0Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Zm-9.17-114.83a4,4,0,0,1-5.66,5.66L132,97.66V152a4,4,0,0,1-8,0V97.66l-17.17,17.17a4,4,0,0,1-5.66-5.66l24-24a4,4,0,0,1,5.66,0Z"}))]]),Tf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:Q1}));Tf.displayName="MonitorArrowUpIcon";const ev=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),Ca=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:ev}));Ca.displayName="SpinnerIcon";const tv=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V167.57l24.94,18.14A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM188,180H36V76H188Zm44-27.57-20-14.54V118.11l20-14.54Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,72V184a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V72A16,16,0,0,1,32,56H176A16,16,0,0,1,192,72Zm58,.25a8.23,8.23,0,0,0-6.63,1.22L209.78,95.86A4,4,0,0,0,208,99.19v57.62a4,4,0,0,0,1.78,3.33l33.78,22.52a8,8,0,0,0,8.58.19,8.33,8.33,0,0,0,3.86-7.17V80A8,8,0,0,0,250,72.25Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V155.21L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM194,184a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H192a2,2,0,0,1,2,2Zm48-19.21-36-24V115.21l36-24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V151.47l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM196,184a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H192a4,4,0,0,1,4,4Zm48-15.47-40-26.67V114.14l40-26.67Z"}))]]),Af=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:tv}));Af.displayName="VideoCameraIcon";const nv=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H123.88a12,12,0,0,0,0,24H188v68a12,12,0,0,0,4.46,9.33c.15.13.31.25.48.38l44,32A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM232,152.43l-20-14.54V118.11l20-14.54ZM56.88,31.93A12,12,0,1,0,39.12,48.07L42.69,52H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H180.87l18.25,20.07a12,12,0,0,0,17.76-16.14ZM36,180V76H64.51l94.55,104Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M256,80.23v95.45a8.33,8.33,0,0,1-3.86,7.17,8,8,0,0,1-8.58-.19l-33.78-22.52a4,4,0,0,1-1.78-3.33V99.19a4,4,0,0,1,1.78-3.32l33.78-22.53a8,8,0,0,1,9.73.66A8.23,8.23,0,0,1,256,80.23ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM185,155.07a4,4,0,0,0,7-2.7V72a16,16,0,0,0-16-16H104a4,4,0,0,0-3,6.69Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H113.06a6,6,0,0,0,0,12H192a2,2,0,0,1,2,2v87.63a6,6,0,0,0,12,0v-4.42L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM242,164.79l-36-24V115.21l36-24ZM52.44,36A6,6,0,0,0,43.56,44L56.25,58H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H183.53l20,22a6,6,0,0,0,8.88-8.08ZM32,186a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H67.16L172.62,186Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H113.06a4,4,0,0,0,0,8H192a4,4,0,0,1,4,4v87.63a4,4,0,0,0,8,0v-8.16l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM244,168.53l-40-26.67V114.14l40-26.67ZM51,37.31A4,4,0,0,0,45,42.69L60.78,60H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H184.41L205,218.69a4,4,0,1,0,5.92-5.38ZM32,188a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H68.05L177.14,188Z"}))]]),Pf=m.forwardRef((e,t)=>m.createElement(dt,{ref:t,...e,weights:nv}));Pf.displayName="VideoCameraSlashIcon";const rv=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),sv=A.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Mf=m.forwardRef((e,t)=>{const{alt:n,color:r,size:s,weight:o,mirrored:i,children:a,weights:c,...l}=e,{color:u="currentColor",size:h,weight:p="regular",mirrored:g=!1,...y}=m.useContext(sv);return m.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??u,viewBox:"0 0 256 256",transform:i||g?"scale(-1, 1)":void 0,...y,...l},!!n&&m.createElement("title",null,n),a,c.get(o??p))});Mf.displayName="IconBase";const Rf=m.forwardRef((e,t)=>m.createElement(Mf,{ref:t,...e,weights:rv}));Rf.displayName="WarningIcon";const Ea="-",ov=e=>{const t=av(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Ea);return a[0]===""&&a.length!==1&&a.shift(),Nf(a,t)||iv(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Nf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Nf(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Ea);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},pl=/^\[(.+)\]$/,iv=e=>{if(pl.test(e)){const t=pl.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},av=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)yi(n[s],r,s,t);return r},yi=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:gl(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(cv(s)){yi(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{yi(i,gl(t,o),n,r)})})},gl=(e,t)=>{let n=e;return t.split(Ea).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cv=e=>e.isThemeGetter,lv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},vi="!",xi=":",dv=xi.length,uv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,l;for(let y=0;y<s.length;y++){let f=s[y];if(i===0&&a===0){if(f===xi){o.push(s.slice(c,y)),c=y+dv;continue}if(f==="/"){l=y;continue}}f==="["?i++:f==="]"?i--:f==="("?a++:f===")"&&a--}const u=o.length===0?s:s.substring(c),h=fv(u),p=h!==u,g=l&&l>c?l-c:void 0;return{modifiers:o,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}};if(t){const s=t+xi,o=r;r=i=>i.startsWith(s)?o(i.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},fv=e=>e.endsWith(vi)?e.substring(0,e.length-1):e.startsWith(vi)?e.substring(1):e,hv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(i=>{i[0]==="["||t[i]?(s.push(...o.sort(),i),o=[]):o.push(i)}),s.push(...o.sort()),s}},mv=e=>({cache:lv(e.cacheSize),parseClassName:uv(e),sortModifiers:hv(e),...ov(e)}),pv=/\s+/,gv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(pv);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:h,modifiers:p,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:f}=n(u);if(h){c=u+(c.length>0?" "+c:c);continue}let v=!!f,w=r(v?y.substring(0,f):y);if(!w){if(!v){c=u+(c.length>0?" "+c:c);continue}if(w=r(y),!w){c=u+(c.length>0?" "+c:c);continue}v=!1}const b=o(p).join(":"),S=g?b+vi:b,C=S+w;if(i.includes(C))continue;i.push(C);const E=s(w,v);for(let T=0;T<E.length;++T){const k=E[T];i.push(S+k)}c=u+(c.length>0?" "+c:c)}return c};function yv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=jf(t))&&(r&&(r+=" "),r+=n);return r}const jf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=jf(e[r]))&&(n&&(n+=" "),n+=t);return n};function vv(e,...t){let n,r,s,o=i;function i(c){const l=t.reduce((u,h)=>h(u),e());return n=mv(l),r=n.cache.get,s=n.cache.set,o=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=gv(c,n);return s(c,u),u}return function(){return o(yv.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Vf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,If=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xv=/^\d+\/\d+$/,bv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wv=/\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$/,Sv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ev=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mn=e=>xv.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),Ot=e=>!!e&&Number.isInteger(Number(e)),Co=e=>e.endsWith("%")&&oe(e.slice(0,-1)),kt=e=>bv.test(e),kv=()=>!0,Tv=e=>wv.test(e)&&!Sv.test(e),Df=()=>!1,Av=e=>Cv.test(e),Pv=e=>Ev.test(e),Mv=e=>!Q(e)&&!ee(e),Rv=e=>Kn(e,Lf,Df),Q=e=>Vf.test(e),Jt=e=>Kn(e,_f,Tv),Eo=e=>Kn(e,Dv,oe),yl=e=>Kn(e,Of,Df),Nv=e=>Kn(e,$f,Pv),Br=e=>Kn(e,Ff,Av),ee=e=>If.test(e),tr=e=>Yn(e,_f),jv=e=>Yn(e,Ov),vl=e=>Yn(e,Of),Vv=e=>Yn(e,Lf),Iv=e=>Yn(e,$f),Hr=e=>Yn(e,Ff,!0),Kn=(e,t,n)=>{const r=Vf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yn=(e,t,n=!1)=>{const r=If.exec(e);return r?r[1]?t(r[1]):n:!1},Of=e=>e==="position"||e==="percentage",$f=e=>e==="image"||e==="url",Lf=e=>e==="length"||e==="size"||e==="bg-size",_f=e=>e==="length",Dv=e=>e==="number",Ov=e=>e==="family-name",Ff=e=>e==="shadow",$v=()=>{const e=Ie("color"),t=Ie("font"),n=Ie("text"),r=Ie("font-weight"),s=Ie("tracking"),o=Ie("leading"),i=Ie("breakpoint"),a=Ie("container"),c=Ie("spacing"),l=Ie("radius"),u=Ie("shadow"),h=Ie("inset-shadow"),p=Ie("text-shadow"),g=Ie("drop-shadow"),y=Ie("blur"),f=Ie("perspective"),v=Ie("aspect"),w=Ie("ease"),b=Ie("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),ee,Q],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],P=()=>[ee,Q,c],$=()=>[mn,"full","auto",...P()],x=()=>[Ot,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",Ot,ee,Q]},Ot,ee,Q],_=()=>[Ot,"auto",ee,Q],K=()=>["auto","min","max","fr",ee,Q],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...P()],U=()=>[mn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],M=()=>[e,ee,Q],q=()=>[...C(),vl,yl,{position:[ee,Q]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Vv,Rv,{size:[ee,Q]}],Z=()=>[Co,tr,Jt],R=()=>["","none","full",l,ee,Q],B=()=>["",oe,tr,Jt],z=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>[oe,Co,vl,yl],F=()=>["","none",y,ee,Q],W=()=>["none",oe,ee,Q],L=()=>["none",oe,ee,Q],J=()=>[oe,ee,Q],O=()=>[mn,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[kt],breakpoint:[kt],color:[kv],container:[kt],"drop-shadow":[kt],ease:["in","out","in-out"],font:[Mv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[kt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[kt],shadow:[kt],spacing:["px",oe],text:[kt],"text-shadow":[kt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mn,Q,ee,v]}],container:["container"],columns:[{columns:[oe,Q,ee,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Ot,"auto",ee,Q]}],basis:[{basis:[mn,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,mn,"auto","initial","none",Q]}],grow:[{grow:["",oe,ee,Q]}],shrink:[{shrink:["",oe,ee,Q]}],order:[{order:[Ot,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,tr,Jt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,Eo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Co,Q]}],"font-family":[{font:[jv,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ee,Q]}],"line-clamp":[{"line-clamp":[oe,"none",ee,Eo]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",ee,Jt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[oe,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ot,ee,Q],radial:["",ee,Q],conic:[Ot,ee,Q]},Iv,Nv]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...z(),"hidden","none"]}],"divide-style":[{divide:[...z(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,ee,Q]}],"outline-w":[{outline:["",oe,tr,Jt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,Hr,Br]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",h,Hr,Br]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[oe,Jt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",p,Hr,Br]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[oe,ee,Q]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:F()}],brightness:[{brightness:[oe,ee,Q]}],contrast:[{contrast:[oe,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",g,Hr,Br]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",oe,ee,Q]}],"hue-rotate":[{"hue-rotate":[oe,ee,Q]}],invert:[{invert:["",oe,ee,Q]}],saturate:[{saturate:[oe,ee,Q]}],sepia:[{sepia:["",oe,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[oe,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[oe,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",oe,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[oe,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[oe,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",ee,Q]}],ease:[{ease:["linear","initial",w,ee,Q]}],delay:[{delay:[oe,ee,Q]}],animate:[{animate:["none",b,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,ee,Q]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[oe,tr,Jt,Eo]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lv=vv($v);function ne(...e){return Lv(Bi.clsx(e))}function _v(e,t){return{id:e.streamInfo.id,timestamp:e.streamInfo.timestamp,message:e.text,from:e.participantInfo.identity===t.localParticipant.identity?t.localParticipant:Array.from(t.remoteParticipants.values()).find(n=>n.identity===e.participantInfo.identity)}}const Fv=Ms.cva(["relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-[0_1fr] gap-y-0.5 items-start","has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current"],{variants:{variant:{default:"bg-card text-card-foreground",destructive:["text-destructive-foreground bg-destructive border-destructive-border","[&>svg]:text-current *:data-[slot=alert-description]:text-destructive-foreground/90"]}},defaultVariants:{variant:"default"}});function Bv({className:e,variant:t,...n}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:ne(Fv({variant:t}),e),...n})}function Hv({className:e,...t}){return d.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function zv({className:e,...t}){return d.jsx("div",{"data-slot":"alert-description",className:ne("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function zr(e){return bf.custom(t=>d.jsx(Uv,{id:t,title:e.title,description:e.description}),{duration:1e4})}function Uv(e){const{title:t,id:n,description:r}=e;return d.jsxs(Bv,{onClick:()=>bf.dismiss(n),className:"bg-gradient-to-br from-[#181825] to-[#232336] border border-[#232336] shadow-lg shadow-black/40 rounded-xl px-4 py-3 flex items-start gap-3 hover:shadow-xl transition-all duration-200",style:{color:"#F3F4F6"},children:[d.jsx(Rf,{weight:"bold",className:"text-yellow-400 mt-1 flex-shrink-0",size:24}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx(Hv,{className:"text-base font-semibold text-white mb-1",children:t}),d.jsx(zv,{className:"text-sm text-gray-300 leading-snug",children:r})]})]})}function xl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bf(...e){return t=>{let n=!1;const r=e.map(s=>{const o=xl(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():xl(e[s],null)}}}}function Le(...e){return m.useCallback(Bf(...e),e)}function xr(e){const t=Zv(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,a=m.Children.toArray(o),c=a.find(Yv);if(c){const l=c.props.children,u=a.map(h=>h===c?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:h);return d.jsx(t,{...i,ref:s,children:m.isValidElement(l)?m.cloneElement(l,void 0,u):null})}return d.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var Wv=xr("Slot");function Zv(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=qv(s),a=Gv(o,s.props);return s.type!==m.Fragment&&(a.ref=r?Bf(r,i):i),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kv=Symbol("radix.slottable");function Yv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kv}function Gv(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function qv(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Xv=Ms.cva(["text-xs font-bold tracking-wider uppercase whitespace-nowrap","inline-flex items-center justify-center gap-2 shrink-0 rounded-full cursor-pointer outline-none transition-colors duration-300","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:pointer-events-none disabled:opacity-50","aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40 ","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button text-button-foreground hover:bg-muted focus:bg-muted",destructive:["bg-destructive text-destructive-foreground","hover:bg-destructive-hover focus:bg-destructive-hover focus-visible:ring-destructive-foreground/20","dark:focus-visible:ring-destructive-foreground/40"],outline:["border bg-background","hover:bg-accent hover:text-accent-foreground","dark:bg-input/30 dark:border-input dark:hover:bg-input/50"],primary:"",secondary:"bg-secondary text-secondary-foregroun hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Jv({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?Wv:"button";return d.jsx(o,{"data-slot":"button",className:ne(Xv({variant:t,size:n,className:e})),...s})}function Qv({onSend:e,className:t,disabled:n,...r}){const s=A.useRef(null),[o,i]=A.useState(""),a=l=>{var u,h;l.preventDefault(),(u=r.onSubmit)==null||u.call(r,l),e==null||e(o),i(""),(h=s.current)==null||h.focus({preventScroll:!0})},c=n||o.trim().length===0;return d.jsxs("form",{...r,onSubmit:a,className:ne("flex items-center rounded-md pl-1 text-sm",t),children:[d.jsx("input",{ref:s,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:o,onChange:l=>i(l.target.value),disabled:n}),d.jsx(Jv,{size:"sm",type:"submit",variant:c?"secondary":"primary",disabled:c,className:"font-mono",children:"SEND"})]})}function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var We=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},ex=m[" useInsertionEffect ".trim().toString()]||We;function bi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=tx({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const h=u.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=m.useCallback(u=>{var h;if(a){const p=nx(u)?u(e):u;p!==e&&((h=i.current)==null||h.call(i,p))}else o(u)},[a,e,o,i]);return[c,l]}function tx({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return ex(()=>{o.current=t},[t]),m.useEffect(()=>{var i;s.current!==n&&((i=o.current)==null||i.call(o,n),s.current=n)},[n,s]),[n,r,o]}function nx(e){return typeof e=="function"}var rx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=rx.reduce((e,t)=>{const n=xr(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sx(e,t){e&&Rs.flushSync(()=>e.dispatchEvent(t))}var Hf="Toggle",zf=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...o}=e,[i,a]=bi({prop:n,onChange:s,defaultProp:r??!1,caller:Hf});return d.jsx(Te.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Pe(e.onClick,()=>{e.disabled||a(!i)})})});zf.displayName=Hf;var ox=zf;const ix=Ms.cva(["inline-flex items-center justify-center gap-2 rounded-full","text-sm font-medium whitespace-nowrap","cursor-pointer outline-none transition-[color,border,background-color]","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0 aria-invalid:border-0","disabled:pointer-events-none disabled:opacity-50 disabled:not-allowed","data-[state=on]:bg-button-selected data-[state=on]:border-button-border-selected","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button hover:bg-muted focus:bg-muted hover:text-muted-foreground focus:text-muted-foreground",primary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=off]:bg-button-primary hover:data-[state=off]:bg-button-hover data-[state=off]:text-button-primary-foreground",secondary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=on]:bg-button-secondary hover:data-[state=on]:bg-button-secondary data-[state=on]:text-button-secondary-foreground",outline:["border border-button-border bg-button text-button-foreground","hover:bg-background focus:bg-background"]},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Uf({className:e,variant:t,size:n,...r}){return d.jsx(ox,{"data-slot":"toggle",className:ne(ix({variant:t,size:n,className:e})),...r})}function ax(e){const[t,n]=A.useState(()=>e.getPublishPermissions());return A.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},s=()=>{r()};return e.on("connection.connected",s),e.on("connection.disconnected",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s)}},[e]),t}function cx(e){const[t,n]=A.useState(()=>e.getLocalParticipant()),[r,s]=A.useState(()=>e.getMicrophoneTrack());return A.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),c=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!c,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),s(c)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},c=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",c),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),i.off("localTrackPublished",a),i.off("localTrackUnpublished",c)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function ko(e,t,n){const[r,s]=A.useState(!1),[o,i]=A.useState(!1);return A.useEffect(()=>{const c=()=>{let l=!1;switch(t){case"microphone":l=e.isMicrophoneEnabled;break;case"camera":l=e.isCameraEnabled;break;case"screenShare":l=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,l),s(l)};return c(),e.on("track.muted",c),e.on("track.unmuted",c),e.on("connection.connected",c),()=>{e.off("track.muted",c),e.off("track.unmuted",c),e.off("connection.connected",c)}},[e,t]),{enabled:r,pending:o,toggle:async c=>{var l;try{i(!0);const u=c!==void 0?c:!r;switch(t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?await e.startScreenShare():await e.stopScreenShare();break}}catch(u){(l=n==null?void 0:n.onDeviceError)==null||l.call(n,u)}finally{i(!1)}}}}function lx(e){const[t,n]=A.useState(()=>e.getRoom()),[r,s]=A.useState(()=>e.getConnectionState());return A.useEffect(()=>{const o=()=>{n(e.getRoom()),s(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function dx(e,t){const[n,r]=A.useState([]),[s,o]=A.useState("");return A.useEffect(()=>{var l;const a=async()=>{try{const u=t==="audioinput"?await e.getAudioInputDevices():await e.getVideoInputDevices();r(u)}catch(u){console.error("Failed to load devices:",u)}};a();const c=()=>{a()};return(l=navigator.mediaDevices)==null||l.addEventListener("devicechange",c),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",c)}},[e,t]),{devices:n,activeDeviceId:s,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),o(a)}catch(c){console.error("Failed to set device:",c)}}}}function ux(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:i=>{t||localStorage.setItem("voxket-audio-input-enabled",i.toString())},saveAudioInputDeviceId:i=>{t||localStorage.setItem("voxket-audio-input-device-id",i)},saveVideoInputEnabled:i=>{t||localStorage.setItem("voxket-video-input-enabled",i.toString())},saveVideoInputDeviceId:i=>{t||localStorage.setItem("voxket-video-input-device-id",i)}}}function bl(e,[t,n]){return Math.min(n,Math.max(t,e))}function ka(e,t=[]){let n=[];function r(o,i){const a=m.createContext(i),c=n.length;n=[...n,i];const l=h=>{var w;const{scope:p,children:g,...y}=h,f=((w=p==null?void 0:p[e])==null?void 0:w[c])||a,v=m.useMemo(()=>y,Object.values(y));return d.jsx(f.Provider,{value:v,children:g})};l.displayName=o+"Provider";function u(h,p){var f;const g=((f=p==null?void 0:p[e])==null?void 0:f[c])||a,y=m.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[l,u]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(a){const c=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,fx(s,...t)]}function fx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const h=c(o)[`__scope${l}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function hx(e){const t=e+"CollectionProvider",[n,r]=ka(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:v,children:w}=f,b=A.useRef(null),S=A.useRef(new Map).current;return d.jsx(s,{scope:v,itemMap:S,collectionRef:b,children:w})};i.displayName=t;const a=e+"CollectionSlot",c=xr(a),l=A.forwardRef((f,v)=>{const{scope:w,children:b}=f,S=o(a,w),C=Le(v,S.collectionRef);return d.jsx(c,{ref:C,children:b})});l.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=xr(u),g=A.forwardRef((f,v)=>{const{scope:w,children:b,...S}=f,C=A.useRef(null),E=Le(v,C),T=o(u,w);return A.useEffect(()=>(T.itemMap.set(C,{ref:C,...S}),()=>void T.itemMap.delete(C))),d.jsx(p,{[h]:"",ref:E,children:b})});g.displayName=u;function y(f){const v=o(e+"CollectionConsumer",f);return A.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((T,k)=>S.indexOf(T.ref.current)-S.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:l,ItemSlot:g},y,r]}var mx=m.createContext(void 0);function px(e){const t=m.useContext(mx);return e||t||"ltr"}function cn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function gx(e,t=globalThis==null?void 0:globalThis.document){const n=cn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yx="DismissableLayer",wi="dismissableLayer.update",vx="dismissableLayer.pointerDownOutside",xx="dismissableLayer.focusOutside",wl,Wf=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zf=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,l=m.useContext(Wf),[u,h]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),y=Le(t,k=>h(k)),f=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=f.indexOf(v),b=u?f.indexOf(u):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=b>=w,E=Sx(k=>{const P=k.target,$=[...l.branches].some(x=>x.contains(P));!C||$||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},p),T=Cx(k=>{const P=k.target;[...l.branches].some(x=>x.contains(P))||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},p);return gx(k=>{b===l.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},p),m.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(wl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Sl(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wl)}},[u,p,n,l]),m.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Sl())},[u,l]),m.useEffect(()=>{const k=()=>g({});return document.addEventListener(wi,k),()=>document.removeEventListener(wi,k)},[]),d.jsx(Te.div,{...c,ref:y,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,E.onPointerDownCapture)})});Zf.displayName=yx;var bx="DismissableLayerBranch",wx=m.forwardRef((e,t)=>{const n=m.useContext(Wf),r=m.useRef(null),s=Le(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Te.div,{...e,ref:s})});wx.displayName=bx;function Sx(e,t=globalThis==null?void 0:globalThis.document){const n=cn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){Kf(vx,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Cx(e,t=globalThis==null?void 0:globalThis.document){const n=cn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&Kf(xx,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sl(){const e=new CustomEvent(wi);document.dispatchEvent(e)}function Kf(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?sx(s,o):s.dispatchEvent(o)}var To=0;function Ex(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cl()),document.body.insertAdjacentElement("beforeend",e[1]??Cl()),To++,()=>{To===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),To--}},[])}function Cl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ao="focusScope.autoFocusOnMount",Po="focusScope.autoFocusOnUnmount",El={bubbles:!1,cancelable:!0},kx="FocusScope",Yf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=m.useState(null),l=cn(s),u=cn(o),h=m.useRef(null),p=Le(t,f=>c(f)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let f=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?h.current=C:Lt(h.current,{select:!0})},v=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||Lt(h.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Lt(a)};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){Tl.add(g);const f=document.activeElement;if(!a.contains(f)){const w=new CustomEvent(Ao,El);a.addEventListener(Ao,l),a.dispatchEvent(w),w.defaultPrevented||(Tx(Nx(Gf(a)),{select:!0}),document.activeElement===f&&Lt(a))}return()=>{a.removeEventListener(Ao,l),setTimeout(()=>{const w=new CustomEvent(Po,El);a.addEventListener(Po,u),a.dispatchEvent(w),w.defaultPrevented||Lt(f??document.body,{select:!0}),a.removeEventListener(Po,u),Tl.remove(g)},0)}}},[a,l,u,g]);const y=m.useCallback(f=>{if(!n&&!r||g.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,w=document.activeElement;if(v&&w){const b=f.currentTarget,[S,C]=Ax(b);S&&C?!f.shiftKey&&w===C?(f.preventDefault(),n&&Lt(S,{select:!0})):f.shiftKey&&w===S&&(f.preventDefault(),n&&Lt(C,{select:!0})):w===b&&f.preventDefault()}},[n,r,g.paused]);return d.jsx(Te.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});Yf.displayName=kx;function Tx(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Lt(r,{select:t}),document.activeElement!==n)return}function Ax(e){const t=Gf(e),n=kl(t,e),r=kl(t.reverse(),e);return[n,r]}function Gf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kl(e,t){for(const n of e)if(!Px(n,{upTo:t}))return n}function Px(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Mx(e){return e instanceof HTMLInputElement&&"select"in e}function Lt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mx(e)&&t&&e.select()}}var Tl=Rx();function Rx(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Al(e,t),e.unshift(t)},remove(t){var n;e=Al(e,t),(n=e[0])==null||n.resume()}}}function Al(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Nx(e){return e.filter(t=>t.tagName!=="A")}var jx=m[" useId ".trim().toString()]||(()=>{}),Vx=0;function Ta(e){const[t,n]=m.useState(jx());return We(()=>{n(r=>r??String(Vx++))},[e]),e||(t?`radix-${t}`:"")}const Ix=["top","right","bottom","left"],Bt=Math.min,Ke=Math.max,bs=Math.round,Ur=Math.floor,bt=e=>({x:e,y:e}),Dx={left:"right",right:"left",bottom:"top",top:"bottom"},Ox={start:"end",end:"start"};function Si(e,t,n){return Ke(e,Bt(t,n))}function jt(e,t){return typeof e=="function"?e(t):e}function Vt(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function Aa(e){return e==="x"?"y":"x"}function Pa(e){return e==="y"?"height":"width"}const $x=new Set(["top","bottom"]);function yt(e){return $x.has(Vt(e))?"y":"x"}function Ma(e){return Aa(yt(e))}function Lx(e,t,n){n===void 0&&(n=!1);const r=Gn(e),s=Ma(e),o=Pa(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ws(i)),[i,ws(i)]}function _x(e){const t=ws(e);return[Ci(e),t,Ci(t)]}function Ci(e){return e.replace(/start|end/g,t=>Ox[t])}const Pl=["left","right"],Ml=["right","left"],Fx=["top","bottom"],Bx=["bottom","top"];function Hx(e,t,n){switch(e){case"top":case"bottom":return n?t?Ml:Pl:t?Pl:Ml;case"left":case"right":return t?Fx:Bx;default:return[]}}function zx(e,t,n,r){const s=Gn(e);let o=Hx(Vt(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Ci)))),o}function ws(e){return e.replace(/left|right|bottom|top/g,t=>Dx[t])}function Ux(e){return{top:0,right:0,bottom:0,left:0,...e}}function qf(e){return typeof e!="number"?Ux(e):{top:e,right:e,bottom:e,left:e}}function Ss(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Rl(e,t,n){let{reference:r,floating:s}=e;const o=yt(t),i=Ma(t),a=Pa(i),c=Vt(t),l=o==="y",u=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,p=r[a]/2-s[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-s.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Gn(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}const Wx=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=Rl(l,r,c),p=r,g={},y=0;for(let f=0;f<a.length;f++){const{name:v,fn:w}=a[f],{x:b,y:S,data:C,reset:E}=await w({x:u,y:h,initialPlacement:r,placement:p,strategy:s,middlewareData:g,rects:l,platform:i,elements:{reference:e,floating:t}});u=b??u,h=S??h,g={...g,[v]:{...g[v],...C}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(l=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:h}=Rl(l,p,c)),f=-1)}return{x:u,y:h,placement:p,strategy:s,middlewareData:g}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=jt(t,e),y=qf(g),v=a[p?h==="floating"?"reference":"floating":h],w=Ss(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=h==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),C=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Ss(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:c}):b);return{top:(w.top-E.top+y.top)/C.y,bottom:(E.bottom-w.bottom+y.bottom)/C.y,left:(w.left-E.left+y.left)/C.x,right:(E.right-w.right+y.right)/C.x}}const Zx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=jt(e,t)||{};if(l==null)return{};const h=qf(u),p={x:n,y:r},g=Ma(s),y=Pa(g),f=await i.getDimensions(l),v=g==="y",w=v?"top":"left",b=v?"bottom":"right",S=v?"clientHeight":"clientWidth",C=o.reference[y]+o.reference[g]-p[g]-o.floating[y],E=p[g]-o.reference[g],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=T?T[S]:0;(!k||!await(i.isElement==null?void 0:i.isElement(T)))&&(k=a.floating[S]||o.floating[y]);const P=C/2-E/2,$=k/2-f[y]/2-1,x=Bt(h[w],$),I=Bt(h[b],$),_=x,K=k-f[y]-I,Y=k/2-f[y]/2+P,X=Si(_,Y,K),G=!c.arrow&&Gn(s)!=null&&Y!==X&&o.reference[y]/2-(Y<_?x:I)-f[y]/2<0,U=G?Y<_?Y-_:Y-K:0;return{[g]:p[g]+U,data:{[g]:X,centerOffset:Y-X-U,...G&&{alignmentOffset:U}},reset:G}}}),Kx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:f=!0,...v}=jt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=Vt(s),b=yt(a),S=Vt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),E=p||(S||!f?[ws(a)]:_x(a)),T=y!=="none";!p&&T&&E.push(...zx(a,f,y,C));const k=[a,...E],P=await br(t,v),$=[];let x=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&$.push(P[w]),h){const Y=Lx(s,i,C);$.push(P[Y[0]],P[Y[1]])}if(x=[...x,{placement:s,overflows:$}],!$.every(Y=>Y<=0)){var I,_;const Y=(((I=o.flip)==null?void 0:I.index)||0)+1,X=k[Y];if(X&&(!(h==="alignment"?b!==yt(X):!1)||x.every(M=>M.overflows[0]>0&&yt(M.placement)===b)))return{data:{index:Y,overflows:x},reset:{placement:X}};let G=(_=x.filter(U=>U.overflows[0]<=0).sort((U,M)=>U.overflows[1]-M.overflows[1])[0])==null?void 0:_.placement;if(!G)switch(g){case"bestFit":{var K;const U=(K=x.filter(M=>{if(T){const q=yt(M.placement);return q===b||q==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(q=>q>0).reduce((q,N)=>q+N,0)]).sort((M,q)=>M[1]-q[1])[0])==null?void 0:K[0];U&&(G=U);break}case"initialPlacement":G=a;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function Nl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jl(e){return Ix.some(t=>e[t]>=0)}const Yx=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=jt(e,t);switch(r){case"referenceHidden":{const o=await br(t,{...s,elementContext:"reference"}),i=Nl(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:jl(i)}}}case"escaped":{const o=await br(t,{...s,altBoundary:!0}),i=Nl(o,n.floating);return{data:{escapedOffsets:i,escaped:jl(i)}}}default:return{}}}}},Xf=new Set(["left","top"]);async function Gx(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Vt(n),a=Gn(n),c=yt(n)==="y",l=Xf.has(i)?-1:1,u=o&&c?-1:1,h=jt(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const qx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await Gx(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},Xx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:w,y:b}=v;return{x:w,y:b}}},...c}=jt(e,t),l={x:n,y:r},u=await br(t,c),h=yt(Vt(s)),p=Aa(h);let g=l[p],y=l[h];if(o){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",b=g+u[v],S=g-u[w];g=Si(b,g,S)}if(i){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+u[v],S=y-u[w];y=Si(b,y,S)}const f=a.fn({...t,[p]:g,[h]:y});return{...f,data:{x:f.x-n,y:f.y-r,enabled:{[p]:o,[h]:i}}}}}},Jx=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=jt(e,t),u={x:n,y:r},h=yt(s),p=Aa(h);let g=u[p],y=u[h];const f=jt(a,t),v=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const S=p==="y"?"height":"width",C=o.reference[p]-o.floating[S]+v.mainAxis,E=o.reference[p]+o.reference[S]-v.mainAxis;g<C?g=C:g>E&&(g=E)}if(l){var w,b;const S=p==="y"?"width":"height",C=Xf.has(Vt(s)),E=o.reference[h]-o.floating[S]+(C&&((w=i.offset)==null?void 0:w[h])||0)+(C?0:v.crossAxis),T=o.reference[h]+o.reference[S]+(C?0:((b=i.offset)==null?void 0:b[h])||0)-(C?v.crossAxis:0);y<E?y=E:y>T&&(y=T)}return{[p]:g,[h]:y}}}},Qx=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=jt(e,t),u=await br(t,l),h=Vt(s),p=Gn(s),g=yt(s)==="y",{width:y,height:f}=o.floating;let v,w;h==="top"||h==="bottom"?(v=h,w=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=h,v=p==="end"?"top":"bottom");const b=f-u.top-u.bottom,S=y-u.left-u.right,C=Bt(f-u[v],b),E=Bt(y-u[w],S),T=!t.middlewareData.shift;let k=C,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),T&&!p){const x=Ke(u.left,0),I=Ke(u.right,0),_=Ke(u.top,0),K=Ke(u.bottom,0);g?P=y-2*(x!==0||I!==0?x+I:Ke(u.left,u.right)):k=f-2*(_!==0||K!==0?_+K:Ke(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:k});const $=await i.getDimensions(a.floating);return y!==$.width||f!==$.height?{reset:{rects:!0}}:{}}}};function Ds(){return typeof window<"u"}function qn(e){return Jf(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ct(e){var t;return(t=(Jf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jf(e){return Ds()?e instanceof Node||e instanceof Ge(e).Node:!1}function ct(e){return Ds()?e instanceof Element||e instanceof Ge(e).Element:!1}function St(e){return Ds()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function Vl(e){return!Ds()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}const eb=new Set(["inline","contents"]);function Rr(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=lt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!eb.has(s)}const tb=new Set(["table","td","th"]);function nb(e){return tb.has(qn(e))}const rb=[":popover-open",":modal"];function Os(e){return rb.some(t=>{try{return e.matches(t)}catch{return!1}})}const sb=["transform","translate","scale","rotate","perspective"],ob=["transform","translate","scale","rotate","perspective","filter"],ib=["paint","layout","strict","content"];function Ra(e){const t=Na(),n=ct(e)?lt(e):e;return sb.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ob.some(r=>(n.willChange||"").includes(r))||ib.some(r=>(n.contain||"").includes(r))}function ab(e){let t=Ht(e);for(;St(t)&&!_n(t);){if(Ra(t))return t;if(Os(t))return null;t=Ht(t)}return null}function Na(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cb=new Set(["html","body","#document"]);function _n(e){return cb.has(qn(e))}function lt(e){return Ge(e).getComputedStyle(e)}function $s(e){return ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ht(e){if(qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vl(e)&&e.host||Ct(e);return Vl(t)?t.host:t}function Qf(e){const t=Ht(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&Rr(t)?t:Qf(t)}function wr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Qf(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Ge(s);if(o){const a=Ei(i);return t.concat(i,i.visualViewport||[],Rr(s)?s:[],a&&n?wr(a):[])}return t.concat(s,wr(s,[],n))}function Ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eh(e){const t=lt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=St(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=bs(n)!==o||bs(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function ja(e){return ct(e)?e:e.contextElement}function Vn(e){const t=ja(e);if(!St(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=eh(t);let i=(o?bs(n.width):n.width)/r,a=(o?bs(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const lb=bt(0);function th(e){const t=Ge(e);return!Na()||!t.visualViewport?lb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function db(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function ln(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=ja(e);let i=bt(1);t&&(r?ct(r)&&(i=Vn(r)):i=Vn(e));const a=db(o,n,r)?th(o):bt(0);let c=(s.left+a.x)/i.x,l=(s.top+a.y)/i.y,u=s.width/i.x,h=s.height/i.y;if(o){const p=Ge(o),g=r&&ct(r)?Ge(r):r;let y=p,f=Ei(y);for(;f&&r&&g!==y;){const v=Vn(f),w=f.getBoundingClientRect(),b=lt(f),S=w.left+(f.clientLeft+parseFloat(b.paddingLeft))*v.x,C=w.top+(f.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,h*=v.y,c+=S,l+=C,y=Ge(f),f=Ei(y)}}return Ss({width:u,height:h,x:c,y:l})}function Va(e,t){const n=$s(e).scrollLeft;return t?t.left+n:ln(Ct(e)).left+n}function nh(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:Va(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function ub(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Ct(r),a=t?Os(t.floating):!1;if(r===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=bt(1);const u=bt(0),h=St(r);if((h||!h&&!o)&&((qn(r)!=="body"||Rr(i))&&(c=$s(r)),St(r))){const g=ln(r);l=Vn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const p=i&&!h&&!o?nh(i,c,!0):bt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function fb(e){return Array.from(e.getClientRects())}function hb(e){const t=Ct(e),n=$s(e),r=e.ownerDocument.body,s=Ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Va(e);const a=-n.scrollTop;return lt(r).direction==="rtl"&&(i+=Ke(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}function mb(e,t){const n=Ge(e),r=Ct(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const l=Na();(!l||l&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:o,height:i,x:a,y:c}}const pb=new Set(["absolute","fixed"]);function gb(e,t){const n=ln(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=St(e)?Vn(e):bt(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,l=r*o.y;return{width:i,height:a,x:c,y:l}}function Il(e,t,n){let r;if(t==="viewport")r=mb(e,n);else if(t==="document")r=hb(Ct(e));else if(ct(t))r=gb(t,n);else{const s=th(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ss(r)}function rh(e,t){const n=Ht(e);return n===t||!ct(n)||_n(n)?!1:lt(n).position==="fixed"||rh(n,t)}function yb(e,t){const n=t.get(e);if(n)return n;let r=wr(e,[],!1).filter(a=>ct(a)&&qn(a)!=="body"),s=null;const o=lt(e).position==="fixed";let i=o?Ht(e):e;for(;ct(i)&&!_n(i);){const a=lt(i),c=Ra(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&pb.has(s.position)||Rr(i)&&!c&&rh(e,i))?r=r.filter(u=>u!==i):s=a,i=Ht(i)}return t.set(e,r),r}function vb(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?Os(t)?[]:yb(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const h=Il(t,u,s);return l.top=Ke(h.top,l.top),l.right=Bt(h.right,l.right),l.bottom=Bt(h.bottom,l.bottom),l.left=Ke(h.left,l.left),l},Il(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function xb(e){const{width:t,height:n}=eh(e);return{width:t,height:n}}function bb(e,t,n){const r=St(t),s=Ct(t),o=n==="fixed",i=ln(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=bt(0);function l(){c.x=Va(s)}if(r||!r&&!o)if((qn(t)!=="body"||Rr(s))&&(a=$s(t)),r){const g=ln(t,!0,o,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&l();o&&!r&&s&&l();const u=s&&!r&&!o?nh(s,a):bt(0),h=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:h,y:p,width:i.width,height:i.height}}function Mo(e){return lt(e).position==="static"}function Dl(e,t){if(!St(e)||lt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ct(e)===n&&(n=n.ownerDocument.body),n}function sh(e,t){const n=Ge(e);if(Os(e))return n;if(!St(e)){let s=Ht(e);for(;s&&!_n(s);){if(ct(s)&&!Mo(s))return s;s=Ht(s)}return n}let r=Dl(e,t);for(;r&&nb(r)&&Mo(r);)r=Dl(r,t);return r&&_n(r)&&Mo(r)&&!Ra(r)?n:r||ab(e)||n}const wb=async function(e){const t=this.getOffsetParent||sh,n=this.getDimensions,r=await n(e.floating);return{reference:bb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sb(e){return lt(e).direction==="rtl"}const Cb={convertOffsetParentRelativeRectToViewportRelativeRect:ub,getDocumentElement:Ct,getClippingRect:vb,getOffsetParent:sh,getElementRects:wb,getClientRects:fb,getDimensions:xb,getScale:Vn,isElement:ct,isRTL:Sb};function oh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eb(e,t){let n=null,r;const s=Ct(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:h,width:p,height:g}=l;if(a||t(),!p||!g)return;const y=Ur(h),f=Ur(s.clientWidth-(u+p)),v=Ur(s.clientHeight-(h+g)),w=Ur(u),S={rootMargin:-y+"px "+-f+"px "+-v+"px "+-w+"px",threshold:Ke(0,Bt(1,c))||1};let C=!0;function E(T){const k=T[0].intersectionRatio;if(k!==c){if(!C)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!oh(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return i(!0),o}function kb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ja(e),u=s||o?[...l?wr(l):[],...wr(t)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const h=l&&a?Eb(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(w=>{let[b]=w;b&&b.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let y,f=c?ln(e):null;c&&v();function v(){const w=ln(e);f&&!oh(f,w)&&n(),f=w,y=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(b=>{s&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),h==null||h(),(w=g)==null||w.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const Tb=qx,Ab=Xx,Pb=Kx,Mb=Qx,Rb=Yx,Ol=Zx,Nb=Jx,jb=(e,t,n)=>{const r=new Map,s={platform:Cb,...n},o={...s.platform,_c:r};return Wx(e,t,{...s,platform:o})};var Vb=typeof document<"u",Ib=function(){},is=Vb?A.useLayoutEffect:Ib;function Cs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Cs(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Cs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ih(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $l(e,t){const n=ih(e);return Math.round(t*n)/n}function Ro(e){const t=m.useRef(e);return is(()=>{t.current=e}),t}function Db(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,h]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=m.useState(r);Cs(p,r)||g(r);const[y,f]=m.useState(null),[v,w]=m.useState(null),b=m.useCallback(M=>{M!==T.current&&(T.current=M,f(M))},[]),S=m.useCallback(M=>{M!==k.current&&(k.current=M,w(M))},[]),C=o||y,E=i||v,T=m.useRef(null),k=m.useRef(null),P=m.useRef(u),$=c!=null,x=Ro(c),I=Ro(s),_=Ro(l),K=m.useCallback(()=>{if(!T.current||!k.current)return;const M={placement:t,strategy:n,middleware:p};I.current&&(M.platform=I.current),jb(T.current,k.current,M).then(q=>{const N={...q,isPositioned:_.current!==!1};Y.current&&!Cs(P.current,N)&&(P.current=N,Rs.flushSync(()=>{h(N)}))})},[p,t,n,I,_]);is(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(M=>({...M,isPositioned:!1})))},[l]);const Y=m.useRef(!1);is(()=>(Y.current=!0,()=>{Y.current=!1}),[]),is(()=>{if(C&&(T.current=C),E&&(k.current=E),C&&E){if(x.current)return x.current(C,E,K);K()}},[C,E,K,x,$]);const X=m.useMemo(()=>({reference:T,floating:k,setReference:b,setFloating:S}),[b,S]),G=m.useMemo(()=>({reference:C,floating:E}),[C,E]),U=m.useMemo(()=>{const M={position:n,left:0,top:0};if(!G.floating)return M;const q=$l(G.floating,u.x),N=$l(G.floating,u.y);return a?{...M,transform:"translate("+q+"px, "+N+"px)",...ih(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:N}},[n,a,G.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:K,refs:X,elements:G,floatingStyles:U}),[u,K,X,G,U])}const Ob=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ol({element:r.current,padding:s}).fn(n):{}:r?Ol({element:r,padding:s}).fn(n):{}}}},$b=(e,t)=>({...Tb(e),options:[e,t]}),Lb=(e,t)=>({...Ab(e),options:[e,t]}),_b=(e,t)=>({...Nb(e),options:[e,t]}),Fb=(e,t)=>({...Pb(e),options:[e,t]}),Bb=(e,t)=>({...Mb(e),options:[e,t]}),Hb=(e,t)=>({...Rb(e),options:[e,t]}),zb=(e,t)=>({...Ob(e),options:[e,t]});var Ub="Arrow",ah=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return d.jsx(Te.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});ah.displayName=Ub;var Wb=ah;function Zb(e){const[t,n]=m.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ia="Popper",[ch,lh]=ka(Ia),[Kb,dh]=ch(Ia),uh=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return d.jsx(Kb,{scope:t,anchor:r,onAnchorChange:s,children:n})};uh.displayName=Ia;var fh="PopperAnchor",hh=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=dh(fh,n),i=m.useRef(null),a=Le(t,i);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:d.jsx(Te.div,{...s,ref:a})});hh.displayName=fh;var Da="PopperContent",[Yb,Gb]=ch(Da),mh=m.forwardRef((e,t)=>{var j,F,W,L,J,O;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:y,...f}=e,v=dh(Da,n),[w,b]=m.useState(null),S=Le(t,se=>b(se)),[C,E]=m.useState(null),T=Zb(C),k=(T==null?void 0:T.width)??0,P=(T==null?void 0:T.height)??0,$=r+(o!=="center"?"-"+o:""),x=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(l)?l:[l],_=I.length>0,K={padding:x,boundary:I.filter(Xb),altBoundary:_},{refs:Y,floatingStyles:X,placement:G,isPositioned:U,middlewareData:M}=Db({strategy:"fixed",placement:$,whileElementsMounted:(...se)=>kb(...se,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[$b({mainAxis:s+P,alignmentAxis:i}),c&&Lb({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?_b():void 0,...K}),c&&Fb({...K}),Bb({...K,apply:({elements:se,rects:le,availableWidth:De,availableHeight:ut})=>{const{width:Gt,height:qt}=le.reference,ft=se.floating.style;ft.setProperty("--radix-popper-available-width",`${De}px`),ft.setProperty("--radix-popper-available-height",`${ut}px`),ft.setProperty("--radix-popper-anchor-width",`${Gt}px`),ft.setProperty("--radix-popper-anchor-height",`${qt}px`)}}),C&&zb({element:C,padding:a}),Jb({arrowWidth:k,arrowHeight:P}),p&&Hb({strategy:"referenceHidden",...K})]}),[q,N]=yh(G),V=cn(y);We(()=>{U&&(V==null||V())},[U,V]);const Z=(j=M.arrow)==null?void 0:j.x,R=(F=M.arrow)==null?void 0:F.y,B=((W=M.arrow)==null?void 0:W.centerOffset)!==0,[z,H]=m.useState();return We(()=>{w&&H(window.getComputedStyle(w).zIndex)},[w]),d.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:U?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[(L=M.transformOrigin)==null?void 0:L.x,(J=M.transformOrigin)==null?void 0:J.y].join(" "),...((O=M.hide)==null?void 0:O.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(Yb,{scope:n,placedSide:q,onArrowChange:E,arrowX:Z,arrowY:R,shouldHideArrow:B,children:d.jsx(Te.div,{"data-side":q,"data-align":N,...f,ref:S,style:{...f.style,animation:U?void 0:"none"}})})})});mh.displayName=Da;var ph="PopperArrow",qb={top:"bottom",right:"left",bottom:"top",left:"right"},gh=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=Gb(ph,r),i=qb[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(Wb,{...s,ref:n,style:{...s.style,display:"block"}})})});gh.displayName=ph;function Xb(e){return e!==null}var Jb=e=>({name:"transformOrigin",options:e,fn(t){var v,w,b;const{placement:n,rects:r,middlewareData:s}=t,i=((v=s.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=yh(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(((w=s.arrow)==null?void 0:w.x)??0)+a/2,g=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let y="",f="";return l==="bottom"?(y=i?h:`${p}px`,f=`${-c}px`):l==="top"?(y=i?h:`${p}px`,f=`${r.floating.height+c}px`):l==="right"?(y=`${-c}px`,f=i?h:`${g}px`):l==="left"&&(y=`${r.floating.width+c}px`,f=i?h:`${g}px`),{data:{x:y,y:f}}}});function yh(e){const[t,n="center"]=e.split("-");return[t,n]}var Qb=uh,e2=hh,t2=mh,n2=gh,r2="Portal",vh=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=m.useState(!1);We(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Fi.createPortal(d.jsx(Te.div,{...r,ref:t}),i):null});vh.displayName=r2;function s2(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o2="VisuallyHidden",i2=m.forwardRef((e,t)=>d.jsx(Te.span,{...e,ref:t,style:{...xh,...e.style}}));i2.displayName=o2;var a2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pn=new WeakMap,Wr=new WeakMap,Zr={},No=0,bh=function(e){return e&&(e.host||bh(e.parentNode))},c2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},l2=function(e,t,n,r){var s=c2(t,Array.isArray(e)?e:[e]);Zr[n]||(Zr[n]=new WeakMap);var o=Zr[n],i=[],a=new Set,c=new Set(s),l=function(h){!h||a.has(h)||(a.add(h),l(h.parentNode))};s.forEach(l);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))u(p);else try{var g=p.getAttribute(r),y=g!==null&&g!=="false",f=(pn.get(p)||0)+1,v=(o.get(p)||0)+1;pn.set(p,f),o.set(p,v),i.push(p),f===1&&y&&Wr.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return u(t),a.clear(),No++,function(){i.forEach(function(h){var p=pn.get(h)-1,g=o.get(h)-1;pn.set(h,p),o.set(h,g),p||(Wr.has(h)||h.removeAttribute(r),Wr.delete(h)),g||h.removeAttribute(n)}),No--,No||(pn=new WeakMap,pn=new WeakMap,Wr=new WeakMap,Zr={})}},d2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=a2(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),l2(r,s,n,"aria-hidden")):function(){return null}},gt=function(){return gt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},gt.apply(this,arguments)};function wh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function u2(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var as="right-scroll-bar-position",cs="width-before-scroll-bar",f2="with-scroll-bars-hidden",h2="--removed-body-scroll-bar-size";function jo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function m2(e,t){var n=A.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var p2=typeof window<"u"?m.useLayoutEffect:m.useEffect,Ll=new WeakMap;function g2(e,t){var n=m2(null,function(r){return e.forEach(function(s){return jo(s,r)})});return p2(function(){var r=Ll.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||jo(a,null)}),o.forEach(function(a){s.has(a)||jo(a,i)})}Ll.set(n,e)},[e]),n}function y2(e){return e}function v2(e,t){t===void 0&&(t=y2);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var c=function(){var u=i;i=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return s}function x2(e){e===void 0&&(e={});var t=v2(null);return t.options=gt({async:!0,ssr:!1},e),t}var Sh=function(e){var t=e.sideCar,n=wh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,gt({},n))};Sh.isSideCarExport=!0;function b2(e,t){return e.useMedium(t),Sh}var Ch=x2(),Vo=function(){},Ls=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Vo,onWheelCapture:Vo,onTouchMoveCapture:Vo}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,g=e.noRelative,y=e.noIsolation,f=e.inert,v=e.allowPinchZoom,w=e.as,b=w===void 0?"div":w,S=e.gapMode,C=wh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,T=g2([n,t]),k=gt(gt({},C),s);return m.createElement(m.Fragment,null,u&&m.createElement(E,{sideCar:Ch,removeScrollBar:l,shards:h,noRelative:g,noIsolation:y,inert:f,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:S}),i?m.cloneElement(m.Children.only(a),gt(gt({},k),{ref:T})):m.createElement(b,gt({},k,{className:c,ref:T}),a))});Ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ls.classNames={fullWidth:cs,zeroRight:as};var w2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function S2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=w2();return t&&e.setAttribute("nonce",t),e}function C2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function E2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var k2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=S2())&&(C2(t,n),E2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},T2=function(){var e=k2();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Eh=function(){var e=T2(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},A2={left:0,top:0,right:0,gap:0},Io=function(e){return parseInt(e||"",10)||0},P2=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Io(n),Io(r),Io(s)]},M2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return A2;var t=P2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},R2=Eh(),In="data-scroll-locked",N2=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
10
- .`.concat(f2,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(a,"px ").concat(r,`;
13
- }
14
- body[`).concat(In,`] {
15
- overflow: hidden `).concat(r,`;
16
- overscroll-behavior: contain;
17
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
18
- padding-left: `.concat(s,`px;
19
- padding-top: `).concat(o,`px;
20
- padding-right: `).concat(i,`px;
21
- margin-left:0;
22
- margin-top:0;
23
- margin-right: `).concat(a,"px ").concat(r,`;
24
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
25
- }
26
-
27
- .`).concat(as,` {
28
- right: `).concat(a,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(cs,` {
32
- margin-right: `).concat(a,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(as," .").concat(as,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(cs," .").concat(cs,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(In,`] {
44
- `).concat(h2,": ").concat(a,`px;
45
- }
46
- `)},_l=function(){var e=parseInt(document.body.getAttribute(In)||"0",10);return isFinite(e)?e:0},j2=function(){m.useEffect(function(){return document.body.setAttribute(In,(_l()+1).toString()),function(){var e=_l()-1;e<=0?document.body.removeAttribute(In):document.body.setAttribute(In,e.toString())}},[])},V2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;j2();var o=m.useMemo(function(){return M2(s)},[s]);return m.createElement(R2,{styles:N2(o,!t,s,n?"":"!important")})},ki=!1;if(typeof window<"u")try{var Kr=Object.defineProperty({},"passive",{get:function(){return ki=!0,!0}});window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{ki=!1}var gn=ki?{passive:!1}:!1,I2=function(e){return e.tagName==="TEXTAREA"},kh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!I2(e)&&n[t]==="visible")},D2=function(e){return kh(e,"overflowY")},O2=function(e){return kh(e,"overflowX")},Fl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Th(e,r);if(s){var o=Ah(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},L2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Th=function(e,t){return e==="v"?D2(t):O2(t)},Ah=function(e,t){return e==="v"?$2(t):L2(t)},_2=function(e,t){return e==="h"&&t==="rtl"?-1:1},F2=function(e,t,n,r,s){var o=_2(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,c=t.contains(a),l=!1,u=i>0,h=0,p=0;do{if(!a)break;var g=Ah(e,a),y=g[0],f=g[1],v=g[2],w=f-v-o*y;(y||w)&&Th(e,a)&&(h+=w,p+=y);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(h)<1||!u&&Math.abs(p)<1)&&(l=!0),l},Yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bl=function(e){return[e.deltaX,e.deltaY]},Hl=function(e){return e&&"current"in e?e.current:e},B2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},H2=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},z2=0,yn=[];function U2(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(z2++)[0],o=m.useState(Eh)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var f=u2([e.lockRef.current],(e.shards||[]).map(Hl),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(f,v){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var w=Yr(f),b=n.current,S="deltaX"in f?f.deltaX:b[0]-w[0],C="deltaY"in f?f.deltaY:b[1]-w[1],E,T=f.target,k=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in f&&k==="h"&&T.type==="range")return!1;var P=Fl(k,T);if(!P)return!0;if(P?E=k:(E=k==="v"?"h":"v",P=Fl(k,T)),!P)return!1;if(!r.current&&"changedTouches"in f&&(S||C)&&(r.current=E),!E)return!0;var $=r.current||E;return F2($,v,f,$==="h"?S:C)},[]),c=m.useCallback(function(f){var v=f;if(!(!yn.length||yn[yn.length-1]!==o)){var w="deltaY"in v?Bl(v):Yr(v),b=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&B2(E.delta,w)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Hl).filter(Boolean).filter(function(E){return E.contains(v.target)}),C=S.length>0?a(v,S[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),l=m.useCallback(function(f,v,w,b){var S={name:f,delta:v,target:w,should:b,shadowParent:W2(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=m.useCallback(function(f){n.current=Yr(f),r.current=void 0},[]),h=m.useCallback(function(f){l(f.type,Bl(f),f.target,a(f,e.lockRef.current))},[]),p=m.useCallback(function(f){l(f.type,Yr(f),f.target,a(f,e.lockRef.current))},[]);m.useEffect(function(){return yn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,gn),document.addEventListener("touchmove",c,gn),document.addEventListener("touchstart",u,gn),function(){yn=yn.filter(function(f){return f!==o}),document.removeEventListener("wheel",c,gn),document.removeEventListener("touchmove",c,gn),document.removeEventListener("touchstart",u,gn)}},[]);var g=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(o,{styles:H2(s)}):null,g?m.createElement(V2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function W2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Z2=b2(Ch,U2);var Ph=m.forwardRef(function(e,t){return m.createElement(Ls,gt({},e,{ref:t,sideCar:Z2}))});Ph.classNames=Ls.classNames;var K2=[" ","Enter","ArrowUp","ArrowDown"],Y2=[" ","Enter"],dn="Select",[_s,Fs,G2]=hx(dn),[Xn,fE]=ka(dn,[G2,lh]),Bs=lh(),[q2,Zt]=Xn(dn),[X2,J2]=Xn(dn),Mh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:h,disabled:p,required:g,form:y}=e,f=Bs(t),[v,w]=m.useState(null),[b,S]=m.useState(null),[C,E]=m.useState(!1),T=px(l),[k,P]=bi({prop:r,defaultProp:s??!1,onChange:o,caller:dn}),[$,x]=bi({prop:i,defaultProp:a,onChange:c,caller:dn}),I=m.useRef(null),_=v?y||!!v.closest("form"):!0,[K,Y]=m.useState(new Set),X=Array.from(K).map(G=>G.props.value).join(";");return d.jsx(Qb,{...f,children:d.jsxs(q2,{required:g,scope:t,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Ta(),value:$,onValueChange:x,open:k,onOpenChange:P,dir:T,triggerPointerDownPosRef:I,disabled:p,children:[d.jsx(_s.Provider,{scope:t,children:d.jsx(X2,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(G=>{Y(U=>new Set(U).add(G))},[]),onNativeOptionRemove:m.useCallback(G=>{Y(U=>{const M=new Set(U);return M.delete(G),M})},[]),children:n})}),_?d.jsxs(Xh,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:h,value:$,onChange:G=>x(G.target.value),disabled:p,form:y,children:[$===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},X):null]})})};Mh.displayName=dn;var Rh="SelectTrigger",Nh=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Bs(n),i=Zt(Rh,n),a=i.disabled||r,c=Le(t,i.onTriggerChange),l=Fs(n),u=m.useRef("touch"),[h,p,g]=Qh(f=>{const v=l().filter(S=>!S.disabled),w=v.find(S=>S.value===i.value),b=em(v,f,w);b!==void 0&&i.onValueChange(b.value)}),y=f=>{a||(i.onOpenChange(!0),g()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return d.jsx(e2,{asChild:!0,...o,children:d.jsx(Te.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Jh(i.value)?"":void 0,...s,ref:c,onClick:Pe(s.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&y(f)}),onPointerDown:Pe(s.onPointerDown,f=>{u.current=f.pointerType;const v=f.target;v.hasPointerCapture(f.pointerId)&&v.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(y(f),f.preventDefault())}),onKeyDown:Pe(s.onKeyDown,f=>{const v=h.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&p(f.key),!(v&&f.key===" ")&&K2.includes(f.key)&&(y(),f.preventDefault())})})})});Nh.displayName=Rh;var jh="SelectValue",Vh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=Zt(jh,n),{onValueNodeHasChildrenChange:l}=c,u=o!==void 0,h=Le(t,c.onValueNodeChange);return We(()=>{l(u)},[l,u]),d.jsx(Te.span,{...a,ref:h,style:{pointerEvents:"none"},children:Jh(c.value)?d.jsx(d.Fragment,{children:i}):o})});Vh.displayName=jh;var Q2="SelectIcon",Ih=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return d.jsx(Te.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Ih.displayName=Q2;var ew="SelectPortal",Dh=e=>d.jsx(vh,{asChild:!0,...e});Dh.displayName=ew;var un="SelectContent",Oh=m.forwardRef((e,t)=>{const n=Zt(un,e.__scopeSelect),[r,s]=m.useState();if(We(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Rs.createPortal(d.jsx($h,{scope:e.__scopeSelect,children:d.jsx(_s.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),o):null}return d.jsx(Lh,{...e,ref:t})});Oh.displayName=un;var it=10,[$h,Kt]=Xn(un),tw="SelectContentImpl",nw=xr("SelectContent.RemoveScroll"),Lh=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:f,avoidCollisions:v,...w}=e,b=Zt(un,n),[S,C]=m.useState(null),[E,T]=m.useState(null),k=Le(t,j=>C(j)),[P,$]=m.useState(null),[x,I]=m.useState(null),_=Fs(n),[K,Y]=m.useState(!1),X=m.useRef(!1);m.useEffect(()=>{if(S)return d2(S)},[S]),Ex();const G=m.useCallback(j=>{const[F,...W]=_().map(O=>O.ref.current),[L]=W.slice(-1),J=document.activeElement;for(const O of j)if(O===J||(O==null||O.scrollIntoView({block:"nearest"}),O===F&&E&&(E.scrollTop=0),O===L&&E&&(E.scrollTop=E.scrollHeight),O==null||O.focus(),document.activeElement!==J))return},[_,E]),U=m.useCallback(()=>G([P,S]),[G,P,S]);m.useEffect(()=>{K&&U()},[K,U]);const{onOpenChange:M,triggerPointerDownPosRef:q}=b;m.useEffect(()=>{if(S){let j={x:0,y:0};const F=L=>{var J,O;j={x:Math.abs(Math.round(L.pageX)-(((J=q.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(L.pageY)-(((O=q.current)==null?void 0:O.y)??0))}},W=L=>{j.x<=10&&j.y<=10?L.preventDefault():S.contains(L.target)||M(!1),document.removeEventListener("pointermove",F),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",W,{capture:!0})}}},[S,M,q]),m.useEffect(()=>{const j=()=>M(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[M]);const[N,V]=Qh(j=>{const F=_().filter(J=>!J.disabled),W=F.find(J=>J.ref.current===document.activeElement),L=em(F,j,W);L&&setTimeout(()=>L.ref.current.focus())}),Z=m.useCallback((j,F,W)=>{const L=!X.current&&!W;(b.value!==void 0&&b.value===F||L)&&($(j),L&&(X.current=!0))},[b.value]),R=m.useCallback(()=>S==null?void 0:S.focus(),[S]),B=m.useCallback((j,F,W)=>{const L=!X.current&&!W;(b.value!==void 0&&b.value===F||L)&&I(j)},[b.value]),z=r==="popper"?Ti:_h,H=z===Ti?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:f,avoidCollisions:v}:{};return d.jsx($h,{scope:n,content:S,viewport:E,onViewportChange:T,itemRefCallback:Z,selectedItem:P,onItemLeave:R,itemTextRefCallback:B,focusSelectedItem:U,selectedItemText:x,position:r,isPositioned:K,searchRef:N,children:d.jsx(Ph,{as:nw,allowPinchZoom:!0,children:d.jsx(Yf,{asChild:!0,trapped:b.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:Pe(s,j=>{var F;(F=b.trigger)==null||F.focus({preventScroll:!0}),j.preventDefault()}),children:d.jsx(Zf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:d.jsx(z,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:j=>j.preventDefault(),...w,...H,onPlaced:()=>Y(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Pe(w.onKeyDown,j=>{const F=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!F&&j.key.length===1&&V(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let L=_().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(j.key)&&(L=L.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const J=j.target,O=L.indexOf(J);L=L.slice(O+1)}setTimeout(()=>G(L)),j.preventDefault()}})})})})})})});Lh.displayName=tw;var rw="SelectItemAlignedPosition",_h=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Zt(un,n),i=Kt(un,n),[a,c]=m.useState(null),[l,u]=m.useState(null),h=Le(t,k=>u(k)),p=Fs(n),g=m.useRef(!1),y=m.useRef(!0),{viewport:f,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=i,S=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&l&&f&&v&&w){const k=o.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),x=w.getBoundingClientRect();if(o.dir!=="rtl"){const J=x.left-P.left,O=$.left-J,se=k.left-O,le=k.width+se,De=Math.max(le,P.width),ut=window.innerWidth-it,Gt=bl(O,[it,Math.max(it,ut-De)]);a.style.minWidth=le+"px",a.style.left=Gt+"px"}else{const J=P.right-x.right,O=window.innerWidth-$.right-J,se=window.innerWidth-k.right-O,le=k.width+se,De=Math.max(le,P.width),ut=window.innerWidth-it,Gt=bl(O,[it,Math.max(it,ut-De)]);a.style.minWidth=le+"px",a.style.right=Gt+"px"}const I=p(),_=window.innerHeight-it*2,K=f.scrollHeight,Y=window.getComputedStyle(l),X=parseInt(Y.borderTopWidth,10),G=parseInt(Y.paddingTop,10),U=parseInt(Y.borderBottomWidth,10),M=parseInt(Y.paddingBottom,10),q=X+G+K+M+U,N=Math.min(v.offsetHeight*5,q),V=window.getComputedStyle(f),Z=parseInt(V.paddingTop,10),R=parseInt(V.paddingBottom,10),B=k.top+k.height/2-it,z=_-B,H=v.offsetHeight/2,j=v.offsetTop+H,F=X+G+j,W=q-F;if(F<=B){const J=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const O=l.clientHeight-f.offsetTop-f.offsetHeight,se=Math.max(z,H+(J?R:0)+O+U),le=F+se;a.style.height=le+"px"}else{const J=I.length>0&&v===I[0].ref.current;a.style.top="0px";const se=Math.max(B,X+f.offsetTop+(J?Z:0)+H)+W;a.style.height=se+"px",f.scrollTop=F-B+f.offsetTop}a.style.margin=`${it}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,o.trigger,o.valueNode,a,l,f,v,w,o.dir,r]);We(()=>S(),[S]);const[C,E]=m.useState();We(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const T=m.useCallback(k=>{k&&y.current===!0&&(S(),b==null||b(),y.current=!1)},[S,b]);return d.jsx(ow,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:d.jsx(Te.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});_h.displayName=rw;var sw="SelectPopperPosition",Ti=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=it,...o}=e,i=Bs(n);return d.jsx(t2,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ti.displayName=sw;var[ow,Oa]=Xn(un,{}),Ai="SelectViewport",Fh=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Kt(Ai,n),i=Oa(Ai,n),a=Le(t,o.onViewportChange),c=m.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(_s.Slot,{scope:n,children:d.jsx(Te.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Pe(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&h){const g=Math.abs(c.current-u.scrollTop);if(g>0){const y=window.innerHeight-it*2,f=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),w=Math.max(f,v);if(w<y){const b=w+g,S=Math.min(y,b),C=b-S;h.style.height=S+"px",h.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Fh.displayName=Ai;var Bh="SelectGroup",[iw,aw]=Xn(Bh),cw=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ta();return d.jsx(iw,{scope:n,id:s,children:d.jsx(Te.div,{role:"group","aria-labelledby":s,...r,ref:t})})});cw.displayName=Bh;var Hh="SelectLabel",lw=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=aw(Hh,n);return d.jsx(Te.div,{id:s.id,...r,ref:t})});lw.displayName=Hh;var Es="SelectItem",[dw,zh]=Xn(Es),Uh=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=Zt(Es,n),c=Kt(Es,n),l=a.value===r,[u,h]=m.useState(o??""),[p,g]=m.useState(!1),y=Le(t,b=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,b,r,s)}),f=Ta(),v=m.useRef("touch"),w=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(dw,{scope:n,value:r,disabled:s,textId:f,isSelected:l,onItemTextChange:m.useCallback(b=>{h(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:d.jsx(_s.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:d.jsx(Te.div,{role:"option","aria-labelledby":f,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:Pe(i.onFocus,()=>g(!0)),onBlur:Pe(i.onBlur,()=>g(!1)),onClick:Pe(i.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:Pe(i.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:Pe(i.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:Pe(i.onPointerMove,b=>{var S;v.current=b.pointerType,s?(S=c.onItemLeave)==null||S.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(i.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:Pe(i.onKeyDown,b=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&b.key===" "||(Y2.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});Uh.displayName=Es;var or="SelectItemText",Wh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=Zt(or,n),a=Kt(or,n),c=zh(or,n),l=J2(or,n),[u,h]=m.useState(null),p=Le(t,w=>h(w),c.onItemTextChange,w=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,w,c.value,c.disabled)}),g=u==null?void 0:u.textContent,y=m.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:v}=l;return We(()=>(f(y),()=>v(y)),[f,v,y]),d.jsxs(d.Fragment,{children:[d.jsx(Te.span,{id:c.textId,...o,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Rs.createPortal(o.children,i.valueNode):null]})});Wh.displayName=or;var Zh="SelectItemIndicator",Kh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zh(Zh,n).isSelected?d.jsx(Te.span,{"aria-hidden":!0,...r,ref:t}):null});Kh.displayName=Zh;var Pi="SelectScrollUpButton",Yh=m.forwardRef((e,t)=>{const n=Kt(Pi,e.__scopeSelect),r=Oa(Pi,e.__scopeSelect),[s,o]=m.useState(!1),i=Le(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;o(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Yh.displayName=Pi;var Mi="SelectScrollDownButton",Gh=m.forwardRef((e,t)=>{const n=Kt(Mi,e.__scopeSelect),r=Oa(Mi,e.__scopeSelect),[s,o]=m.useState(!1),i=Le(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Gh.displayName=Mi;var qh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Kt("SelectScrollButton",n),i=m.useRef(null),a=Fs(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),We(()=>{var u;const l=a().find(h=>h.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),d.jsx(Te.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Pe(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Pe(s.onPointerMove,()=>{var l;(l=o.onItemLeave)==null||l.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Pe(s.onPointerLeave,()=>{c()})})}),uw="SelectSeparator",fw=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Te.div,{"aria-hidden":!0,...r,ref:t})});fw.displayName=uw;var Ri="SelectArrow",hw=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Bs(n),o=Zt(Ri,n),i=Kt(Ri,n);return o.open&&i.position==="popper"?d.jsx(n2,{...s,...r,ref:t}):null});hw.displayName=Ri;var mw="SelectBubbleInput",Xh=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),o=Le(r,s),i=s2(t);return m.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const h=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(h)}},[i,t]),d.jsx(Te.select,{...n,style:{...xh,...n.style},ref:o,defaultValue:t})});Xh.displayName=mw;function Jh(e){return e===""||e===void 0}function Qh(e){const t=cn(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function em(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=pw(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function pw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gw=Mh,yw=Nh,vw=Vh,xw=Ih,bw=Dh,ww=Oh,Sw=Fh,Cw=Uh,Ew=Wh,kw=Kh,Tw=Yh,Aw=Gh;function zl({...e}){return d.jsx(gw,{"data-slot":"select",...e})}function Ul({...e}){return d.jsx(vw,{"data-slot":"select-value",...e})}function Wl({className:e,size:t="default",children:n,...r}){return d.jsxs(yw,{"data-slot":"select-trigger","data-size":t,className:ne(["flex w-fit cursor-pointer items-center justify-between gap-2","rounded-full px-3 py-2 text-sm whitespace-nowrap","bg-button transition-[color,border,background-color]","disabled:cursor-not-allowed disabled:opacity-50","hover:bg-muted hover:text-muted-foreground","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0","data-[placeholder]:text-muted-foreground","data-[size=default]:h-9 data-[size=sm]:h-8","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&:not([class*='text-'])_svg:not([class*='text-'])]:text-muted-foreground","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...r,children:[n,d.jsx(xw,{asChild:!0,children:d.jsx(Sa,{weight:"bold",className:"size-4 transition-colors"})})]})}function Zl({className:e,children:t,position:n="popper",...r}){return d.jsx(bw,{children:d.jsxs(ww,{"data-slot":"select-content",className:ne(["bg-[#18182a]/90 backdrop-blur-md text-white border border-[#23233a] shadow-2xl","relative z-50 overflow-x-hidden overflow-y-auto rounded-xl","max-h-(--radix-select-content-available-height) min-w-[8rem]","origin-(--radix-select-content-transform-origin)","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2","data-[side=right]:slide-in-from-left-2","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2"],n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[d.jsx(Pw,{}),d.jsx(Sw,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(Mw,{})]})})}function Kl({className:e,children:t,...n}){return d.jsxs(Cw,{"data-slot":"select-item",className:ne(["relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none","cursor-pointer disabled:cursor-not-allowed","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...n,children:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(kw,{children:d.jsx(Cf,{className:"size-4",weight:"bold"})})}),d.jsx(Ew,{children:t})]})}function Pw({className:e,...t}){return d.jsx(Tw,{"data-slot":"select-scroll-up-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(wf,{className:"size-4",weight:"bold"})})}function Mw({className:e,...t}){return d.jsx(Aw,{"data-slot":"select-scroll-down-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Sa,{className:"size-4",weight:"bold"})})}const Yl=Ms.cva(["w-full rounded-full px-3 py-2 text-sm cursor-pointer","disabled:not-allowed hover:bg-button-hover focus:bg-button-hover"],{variants:{size:{default:"w-[180px]",sm:"w-auto"}},defaultVariants:{size:"default"}});function Gl({kind:e,track:t,requestPermissions:n,onError:r,client:s,...o}){const i=o.size||"default";if(!s)return d.jsxs(zl,{disabled:!0,children:[d.jsx(Wl,{className:ne(Yl({size:i}),o.className),children:d.jsx(Ul,{placeholder:`Select a ${e}`})}),d.jsx(Zl,{children:d.jsx(Kl,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:c,setActiveMediaDevice:l}=dx(s,e==="audioinput"?"audioinput":"videoinput");return d.jsxs(zl,{value:c,onValueChange:l,children:[d.jsx(Wl,{className:ne(Yl({size:i}),o.className,"hover:bg"),children:i!=="sm"&&d.jsx(Ul,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),d.jsx(Zl,{children:a.map(u=>d.jsx(Kl,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function Rw(e,t,n=!1){if(n)return Ca;switch(e){case te.Track.Source.Microphone:return t?Ef:kf;case te.Track.Source.Camera:return t?Af:Pf;case te.Track.Source.ScreenShare:return Tf;default:return m.Fragment}}function Do({source:e,pressed:t,pending:n,className:r,...s}){const o=Rw(e,t??!1,n),i=e===te.Track.Source.Microphone&&!(t??!1)&&!n,a=e===te.Track.Source.Camera&&!(t??!1)&&!n;return m.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),d.jsxs(Uf,{pressed:t,"aria-label":`Toggle ${e}`,className:ne(r),...s,children:[d.jsx(o,{weight:"bold",className:ne(n&&"animate-spin",i||a?"text-red-500":void 0)}),s.children]})}function Nw(e){return e?ax(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function jw(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,s={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:te.Track.Source.Microphone,publication:void 0},visibleControls:s,microphoneToggle:{enabled:!1,pending:!1,toggle:async()=>{}},cameraToggle:{enabled:!1,pending:!1,toggle:async()=>{}},screenShareToggle:{enabled:!1,pending:!1,toggle:async()=>{}},handleDisconnect:()=>{},handleAudioDeviceChange:()=>{},handleVideoDeviceChange:()=>{}};const{microphoneTrack:o,localParticipant:i}=cx(r),a=Nw(r);lx(r);const c=ko(r,"microphone",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.Microphone,error:T})}}),l=ko(r,"camera",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.Camera,error:T})}}),u=ko(r,"screenShare",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.ScreenShare,error:T})}}),h=m.useMemo(()=>{let T;if(i){for(const[,k]of i.trackPublications)if(k.source===te.Track.Source.Microphone){T=k;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!T,isTrackSubscribed:T==null?void 0:T.isSubscribed,isMuted:T==null?void 0:T.isMuted,trackSid:T==null?void 0:T.trackSid}),{participant:i??void 0,source:te.Track.Source.Microphone,publication:T}},[i,o]);s.microphone??(s.microphone=a.microphone),s.screenShare??(s.screenShare=a.screenShare),s.camera??(s.camera=a.camera),s.chat??(s.chat=a.data);const{saveAudioInputEnabled:p,saveAudioInputDeviceId:g,saveVideoInputEnabled:y,saveVideoInputDeviceId:f}=ux({preventSave:!n}),v=m.useCallback(()=>{r&&r.disconnect()},[r]),w=m.useCallback(T=>{g(T??"default"),r&&r.setAudioInputDevice(T)},[g,r]),b=m.useCallback(T=>{f(T??"default"),r&&r.setVideoInputDevice(T)},[f,r]),S=m.useCallback(async T=>{u.enabled&&await u.toggle(!1),await l.toggle(T),y(!l.enabled)},[l,y,u]),C=m.useCallback(async T=>{await c.toggle(T),p(!c.enabled)},[c,p]),E=m.useCallback(async T=>{l.enabled&&await l.toggle(!1),await u.toggle(T)},[l,u]);return{micTrackRef:h,visibleControls:s,cameraToggle:{...l,toggle:S},microphoneToggle:{...c,toggle:C},screenShareToggle:{...u,toggle:E},handleDisconnect:v,handleAudioDeviceChange:w,handleVideoDeviceChange:b}}const Vw={card:" bg-gradient-to-br from-black to-gray-900 border border-gray-900 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-black/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-gray-800/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-gray-600/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-gray-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-gray-400 to-gray-500 rounded-full blur-sm opacity-20 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-gray-500 to-gray-600 rounded-full blur-sm opacity-15 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-black to-gray-900 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-white via-gray-200 to-gray-300"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900",promptSlider:"absolute w-full py-3 px-2 bg-gray-900 rounded-xl text-center text-white text-sm transition-opacity duration-700 ease-in-out border border-gray-600",statusIndicator:"w-2 h-2 bg-gray-400 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-gray-400/15 pulse-ring"},controlBar:"border border-gray-600 rounded-3xl py-4 flex flex-col justify-end h-full bg-gray-900/50 backdrop-blur-sm",chatInput:{container:"bg-gray-900 w-full border-gray-600",textarea:"bg-gray-800 border-none text-white placeholder-gray-400",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-gray-600 text-white",other:"bg-gray-700 text-white"},chatHeader:{container:"bg-gray-900 border-gray-600",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white"},video:{container:"bg-gradient-to-br from-black to-gray-900 text-white",header:"border-gray-700 bg-gray-900/50",headerButton:"bg-gray-800 hover:bg-gray-700 text-gray-300",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-gray-900/80 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-gray-800 border border-gray-700 shadow-lg",placeholder:"bg-gray-800 text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Iw={card:" bg-gradient-to-br from-white to-gray-50 border border-gray-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-white/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-500/5 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-500/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-pink-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-500 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-pink-500 to-purple-500 rounded-full blur-sm opacity-20 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-white to-gray-50 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-gray-900",secondary:"text-gray-700",muted:"text-gray-500",accent:"bg-clip-text text-transparent bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-white",promptSlider:"absolute w-full py-3 px-2 bg-gray-100 rounded-xl text-center text-gray-700 text-sm transition-opacity duration-700 ease-in-out border border-gray-200",statusIndicator:"w-2 h-2 bg-green-500 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-pink-500/10 pulse-ring"},controlBar:"border border-gray-200 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-sm",chatInput:{container:"bg-white/90 border-gray-200 shadow-sm",textarea:"bg-white border-none text-gray-900 placeholder-gray-500 ",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 disabled:opacity-50 text-white",attachButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100 bg-blue-50",endButton:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200"},chatMessage:{own:"bg-blue-50 text-gray-900 border border-blue-100",other:"bg-gray-50 text-gray-900 border border-gray-200"},chatHeader:{container:"bg-white border-gray-200",backButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900"},video:{container:"bg-gradient-to-br from-white to-gray-50 text-gray-900",header:"border-gray-200 bg-white/80",headerButton:"bg-gray-100 hover:bg-gray-200 text-gray-600",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-white/90 backdrop-blur-sm border-t border-gray-200",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-200 hover:bg-gray-300 text-gray-600",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-white border border-gray-200 shadow-sm",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-gray-200 text-gray-600",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Dw={card:" text-white bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-[#3B82F6] via-[#8B5CF6] to-[#EC4899]"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},ql={dark:Vw,light:Iw,vox:Dw};function _e(e){return ql[e]||ql.vox}function Ow({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:s,onChatOpenChange:o,onDisconnect:i,onDeviceError:a,theme:c="vox",client:l,...u}){const[h,p]=m.useState(!1),[g,y]=m.useState(!1),f=_e(c),{micTrackRef:v,visibleControls:w,cameraToggle:b,microphoneToggle:S,screenShareToggle:C,handleAudioDeviceChange:E,handleVideoDeviceChange:T,handleDisconnect:k}=jw({controls:e,saveUserChoices:t,client:l}),P=async $=>{y(!0);try{await(s==null?void 0:s($))}finally{y(!1)}};return m.useEffect(()=>{o==null||o(h)},[h,o]),m.useEffect(()=>{var $,x,I,_;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!v.participant,hasPublication:!!v.publication,source:v.source,isSubscribed:($=v.publication)==null?void 0:$.isSubscribed,isMuted:(x=v.publication)==null?void 0:x.isMuted,trackSid:(I=v.publication)==null?void 0:I.trackSid,hasTrack:!!((_=v.publication)!=null&&_.track)})},[v]),d.jsxs("div",{"aria-label":"Voice assistant controls",className:ne(f.controlBar,r),...u,children:[n.suportsChatInput&&d.jsxs("div",{inert:!h,className:ne("overflow-hidden transition-[height] relative duration-300 ease-in-out",h?"h-[64px] mb-3":"h-0"),children:[d.jsx("div",{className:"flex h-9 px-4 w-full",children:d.jsx(Qv,{onSend:P,disabled:g,className:ne("w-full",f.chatInput)})}),d.jsx("hr",{className:"border-border my-2 mx-5"})]}),d.jsxs("div",{className:ne("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-2",c==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[d.jsxs("div",{className:"flex gap-y-2 justify-start",children:[w.microphone&&d.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[d.jsx(Do,{variant:"primary",source:te.Track.Source.Microphone,pressed:S.enabled,disabled:S.pending,onPressedChange:S.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),d.jsx(Me.BarVisualizer,{barCount:3,trackRef:v,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:d.jsx("span",{className:ne(["h-full w-0.5 origin-center rounded-2xl","bg-white","group-data-[state=on]/track:bg-white group-data-[state=off]/track:bg-white","data-lk-muted:bg-muted"])})}),d.jsx(Gl,{size:"sm",kind:"audioinput",client:l,onError:a?$=>$ instanceof Error?a({source:te.Track.Source.Microphone,error:$}):void 0:void 0,onActiveDeviceChange:E,className:ne(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&w.camera&&d.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[d.jsx(Do,{variant:"primary",source:te.Track.Source.Camera,pressed:b.enabled,pending:b.pending,disabled:b.pending,onPressedChange:b.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),d.jsx(Gl,{size:"sm",kind:"videoinput",client:l,onError:a?$=>$ instanceof Error?a({source:te.Track.Source.Camera,error:$}):void 0:void 0,onActiveDeviceChange:T,className:ne(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&w.screenShare&&d.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:d.jsx(Do,{variant:"secondary",source:te.Track.Source.ScreenShare,pressed:C.enabled,disabled:C.pending,onPressedChange:C.toggle,className:"w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),w.chat&&d.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:d.jsx(Uf,{variant:"secondary","aria-label":"Toggle chat",pressed:h,onPressedChange:$=>{p($)},className:"aspect-square h-full py-3 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:d.jsx(Sf,{weight:"bold",className:"h-5 w-5"})})})]})]})}const $w=(e,t)=>{var a,c;const n=m.useMemo(()=>t?t(e.message):e.message,[e.message,t]),r=!!e.editTimestamp,s=new Date(e.timestamp),o=typeof navigator<"u"?navigator.language:"en-US",i=(a=e.from)!=null&&a.name&&e.from.name!==""?e.from.name:(c=e.from)==null?void 0:c.identity;return{message:n,hasBeenEdited:r,time:s,locale:o,name:i}},Lw=({entry:e,messageFormatter:t,className:n,participantName:r,...s})=>{var u,h;const{message:o,time:i,locale:a}=$w(e,t),c=((u=e.from)==null?void 0:u.isLocal)??!1;ne("w-full px-3 py-2 rounded-2xl text-xs break-words whitespace-pre-line",c?" text-end border border-[#5078F2]/30":"bg-muted text-foreground border border-[#813aa7]/30","text-left");const l=ne("inline-flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold flex-shrink-0",c?"bg-[#5078F2] text-white":"bg-[#813aa7] ml-1 text-white");return d.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:ne("group flex mb-2",c?"justify-end":"justify-start",n),...s,children:d.jsxs("div",{className:ne("flex w-fit max-w-full rounded-2xl border",c?"flex-row-reverse items-center border-[#5078F2]/30":"flex-row items-center border-[#813aa7]/30 bg-muted text-foreground"),children:[d.jsx("span",{className:l,children:c?((h=r==null?void 0:r[0])==null?void 0:h.toUpperCase())||"U":"A"}),d.jsx("span",{className:ne("flex items-center text-xs break-words whitespace-pre-line",c?"ml-auto justify-end text-right":"justify-start text-left","px-3 py-2"),children:o})]})})};function _w(e){A.useEffect(()=>{function t(){const n=e.current;n&&(n.scrollTop=n.scrollHeight)}if(e.current){const n=new ResizeObserver(t);return n.observe(e.current),t(),()=>n.disconnect()}},[e])}const Fw=({className:e,children:t,...n})=>{const r=A.useRef(null);return _w(r),d.jsx("div",{ref:r,className:ne("flex flex-col justify-end",e),...n,children:t})},Bw=({state:e,audioTrack:t,className:n,ref:r})=>d.jsx("div",{ref:r,className:ne("",n),children:d.jsx(Me.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:ne("flex aspect-video w-40 items-center justify-center gap-1"),children:d.jsx("span",{className:ne(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-[#5c64f6]","data-[lk-muted=true]:bg-[#222222]"])})})}),Hw=({videoTrack:e,className:t,ref:n})=>{var r,s;return d.jsx("div",{ref:n,className:ne(t),children:d.jsx(Me.VideoTrack,{trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.height)??0,className:"rounded-md"})})},zw=ae.create(Me.VideoTrack),Uw=({trackRef:e,className:t,ref:n})=>{var r,s;return d.jsx("div",{className:ne("bg-muted overflow-hidden rounded-md",t),children:d.jsx(zw,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.height)??0,className:ne("h-full w-auto")})})},Xl=ae.create(Uw),Ww=ae.create(Bw),Zw=ae.create(Hw),Tt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},vn={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2 row-span-3","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function Kw(e){const{localParticipant:t}=Me.useLocalParticipant(),n=t.getTrackPublication(e);return A.useMemo(()=>n?{source:e,participant:t,publication:n}:void 0,[e,n,t])}function Yw({chatOpen:e}){const{state:t,audioTrack:n,videoTrack:r,agent:{isActive:s=!1}={}}=Me.useVoiceAssistant(),[o]=Me.useTracks([te.Track.Source.ScreenShare]),i=Kw(te.Track.Source.Camera),a=i&&!i.publication.isMuted,c=o&&!o.publication.isMuted,l=a||c,u={...Tt.transition,delay:e?0:.15},h={...Tt.animate,scale:e?1:3,transition:u},p={...Tt.animate,transition:u},g=u,y=u,f=r!==void 0;return d.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:d.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:d.jsxs("div",{className:ne(vn.grid),children:[s&&d.jsx("div",{className:ne(["grid",!e&&vn.agentChatClosed,e&&l&&vn.agentChatOpenWithSecondTile,e&&!l&&vn.agentChatOpenWithoutSecondTile]),children:d.jsxs("div",{className:"h-full flex items-center justify-center",children:[!f&&d.jsx(Ww,{layoutId:"agent",...Tt,animate:h,transition:g,state:t,audioTrack:n,className:ne(e?"h-[90px]":"h-auto w-full")},"agent"),f&&d.jsx(Zw,{layoutId:"avatar",...Tt,animate:p,transition:y,videoTrack:r,className:ne(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),d.jsx("div",{className:ne(["grid",e&&vn.secondTileChatOpen,!e&&vn.secondTileChatClosed]),children:d.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[i&&a&&d.jsx(Xl,{layout:"position",layoutId:"camera",...Tt,trackRef:i,transition:{...Tt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),c&&d.jsx(Xl,{layout:"position",layoutId:"screen",...Tt,trackRef:o,transition:{...Tt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}/**
9
+ `),()=>{p.contains(y)&&p.removeChild(y)}},[t]),d.jsx(x0,{isPresent:t,childRef:o,sizeRef:i,children:m.cloneElement(e,{ref:o})})}const v0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a,root:c})=>{const l=Si(w0),u=A.useId();let f=!0,h=A.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:g=>{l.set(g,!0);for(const y of l.values())if(!y)return;r&&r()},register:g=>(l.set(g,!1),()=>l.delete(g))}),[n,l,r]);return o&&f&&(h={...h}),A.useMemo(()=>{l.forEach((g,y)=>l.set(y,!1))},[n]),m.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(e=d.jsx(b0,{isPresent:n,anchorX:a,root:c,children:e})),d.jsx(gs.Provider,{value:h,children:e})};function w0(){return new Map}function eu(e=!0){const t=A.useContext(gs);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=A.useId();A.useEffect(()=>{if(e)return s(o)},[e]);const i=A.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const Rr=e=>e.key||"";function tc(e){const t=[];return A.Children.forEach(e,n=>{A.isValidElement(n)&&t.push(n)}),t}const kn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[l,u]=eu(i),f=A.useMemo(()=>tc(e),[e]),h=i&&!l?[]:f.map(Rr),g=A.useRef(!0),y=A.useRef(f),p=Si(()=>new Map),[x,w]=A.useState(f),[v,S]=A.useState(f);ld(()=>{g.current=!1,y.current=f;for(let T=0;T<v.length;T++){const k=Rr(v[T]);h.includes(k)?p.delete(k):p.get(k)!==!0&&p.set(k,!1)}},[v,h.length,h.join("-")]);const C=[];if(f!==x){let T=[...f];for(let k=0;k<v.length;k++){const j=v[k],$=Rr(j);h.includes($)||(T.splice(k,0,j),C.push(j))}return o==="wait"&&C.length&&(T=C),S(tc(T)),w(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:E}=A.useContext(wi);return d.jsx(d.Fragment,{children:v.map(T=>{const k=Rr(T),j=i&&!l?!1:f===v||h.includes(k),$=()=>{if(p.has(k))p.set(k,!0);else return;let b=!0;p.forEach(I=>{I||(b=!1)}),b&&(E==null||E(),S(y.current),i&&(u==null||u()),r&&r())};return d.jsx(v0,{isPresent:j,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:j?void 0:$,anchorX:a,children:T},k)})})},tu=A.createContext({strict:!1}),nc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Nn={};for(const e in nc)Nn[e]={isEnabled:t=>nc[e].some(n=>!!t[n])};function S0(e){for(const t in e)Nn[t]={...Nn[t],...e[t]}}const C0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function os(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||C0.has(e)}let nu=e=>!os(e);function k0(e){typeof e=="function"&&(nu=t=>t.startsWith("on")?!os(t):e(t))}try{k0(require("@emotion/is-prop-valid").default)}catch{}function E0(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(nu(s)||n===!0&&os(s)||!t&&!os(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const ys=A.createContext({});function xs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function lr(e){return typeof e=="string"||Array.isArray(e)}const Zi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ki=["initial",...Zi];function bs(e){return xs(e.animate)||Ki.some(t=>lr(e[t]))}function ru(e){return!!(bs(e)||e.variants)}function A0(e,t){if(bs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||lr(n)?n:void 0,animate:lr(r)?r:void 0}}return e.inherit!==!1?t:{}}function T0(e){const{initial:t,animate:n}=A0(e,A.useContext(ys));return A.useMemo(()=>({initial:t,animate:n}),[rc(t),rc(n)])}function rc(e){return Array.isArray(e)?e.join(" "):e}const dr={};function j0(e){for(const t in e)dr[t]=e[t],Ni(t)&&(dr[t].isCSSVariable=!0)}function su(e,{layout:t,layoutId:n}){return Fn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!dr[e]||e==="opacity")}const P0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},M0=$n.length;function N0(e,t,n){let r="",s=!0;for(let o=0;o<M0;o++){const i=$n[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Gd(a,Hi[i]);if(!c){s=!1;const u=P0[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Gi(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Fn.has(c)){i=!0;continue}else if(Ni(c)){s[c]=l;continue}else{const u=Gd(l,Hi[c]);c.startsWith("origin")?(a=!0,o[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=N0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${l} ${u}`}}const Yi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ou(e,t,n){for(const r in t)!Le(t[r])&&!su(r,n)&&(e[r]=t[r])}function R0({transformTemplate:e},t){return A.useMemo(()=>{const n=Yi();return Gi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function V0(e,t){const n=e.style||{},r={};return ou(r,n,e),Object.assign(r,R0(e,t)),r}function I0(e,t){const n={},r=V0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const D0={offset:"stroke-dashoffset",array:"stroke-dasharray"},O0={offset:"strokeDashoffset",array:"strokeDasharray"};function L0(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?D0:O0;e[o.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[o.array]=`${i} ${a}`}function iu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...a},c,l,u){if(Gi(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&L0(f,s,o,i,!1)}const au=()=>({...Yi(),attrs:{}}),cu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function $0(e,t,n,r){const s=A.useMemo(()=>{const o=au();return iu(o,t,cu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};ou(o,e.style,e),s.style={...o,...s.style}}return s}const F0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qi(e){return typeof e!="string"||e.includes("-")?!1:!!(F0.indexOf(e)>-1||/[A-Z]/u.test(e))}function _0(e,t,n,{latestValues:r},s,o=!1){const a=(qi(e)?$0:I0)(t,r,s,e),c=E0(t,typeof e=="string",o),l=e!==A.Fragment?{...c,...a,ref:n}:{},{children:u}=t,f=A.useMemo(()=>Le(u)?u.get():u,[u]);return A.createElement(e,{...l,children:f})}function sc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xi(e,t,n,r){if(typeof t=="function"){const[s,o]=sc(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=sc(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function Kr(e){return Le(e)?e.get():e}function B0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:H0(n,r,s,e),renderState:t()}}function H0(e,t,n,r){const s={},o=r(e,{});for(const h in o)s[h]=Kr(o[h]);let{initial:i,animate:a}=e;const c=bs(e),l=ru(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!xs(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g<h.length;g++){const y=Xi(e,h[g]);if(y){const{transitionEnd:p,transition:x,...w}=y;for(const v in w){let S=w[v];if(Array.isArray(S)){const C=u?S.length-1:0;S=S[C]}S!==null&&(s[v]=S)}for(const v in p)s[v]=p[v]}}}return s}const lu=e=>(t,n)=>{const r=A.useContext(ys),s=A.useContext(gs),o=()=>B0(e,t,r,s);return n?o():Si(o)};function Ji(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(Le(r[i])||t.style&&Le(t.style[i])||su(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const z0=lu({scrapeMotionValuesFromProps:Ji,createRenderState:Yi});function du(e,t,n){const r=Ji(e,t,n);for(const s in e)if(Le(e[s])||Le(t[s])){const o=$n.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const U0=lu({scrapeMotionValuesFromProps:du,createRenderState:au}),W0=Symbol.for("motionComponentSymbol");function vn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Z0(e,t,n){return A.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):vn(n)&&(n.current=r))},[t])}const Qi=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),K0="framerAppearId",uu="data-"+Qi(K0),fu=A.createContext({});function G0(e,t,n,r,s){var p,x;const{visualElement:o}=A.useContext(ys),i=A.useContext(tu),a=A.useContext(gs),c=A.useContext(Wi).reducedMotion,l=A.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,f=A.useContext(fu);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&Y0(l.current,n,s,f);const h=A.useRef(!1);A.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const g=n[uu],y=A.useRef(!!g&&!((p=window.MotionHandoffIsComplete)!=null&&p.call(window,g))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,g)));return ld(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),y.current&&u.animationState&&u.animationState.animateChanges())}),A.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,g)}),y.current=!1),u.enteringChildren=void 0)}),u}function Y0(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:hu(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&vn(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function hu(e){if(e)return e.options.allowProjection!==!1?e.projection:hu(e.parent)}function Xs(e,{forwardMotionProps:t=!1}={},n,r){n&&S0(n);const s=qi(e)?U0:z0;function o(a,c){let l;const u={...A.useContext(Wi),...a,layoutId:q0(a)},{isStatic:f}=u,h=T0(a),g=s(a,f);if(!f&&Ci){X0(u,n);const y=J0(u);l=y.MeasureLayout,h.visualElement=G0(e,g,u,r,y.ProjectionNode)}return d.jsxs(ys.Provider,{value:h,children:[l&&h.visualElement?d.jsx(l,{visualElement:h.visualElement,...u}):null,_0(e,a,Z0(g,h.visualElement,c),g,f,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=A.forwardRef(o);return i[W0]=e,i}function q0({layoutId:e}){const t=A.useContext(wi).id;return t&&e!==void 0?t+"-"+e:e}function X0(e,t){const n=A.useContext(tu).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?On(!1,r,"lazy-strict-mode"):Et(!1,r,"lazy-strict-mode")}}function J0(e){const{drag:t,layout:n}=Nn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Q0(e,t){if(typeof Proxy>"u")return Xs;const n=new Map,r=(o,i)=>Xs(o,i,e,t),s=(o,i)=>(process.env.NODE_ENV!=="production"&&ji(!1,"motion() is deprecated. Use motion.create() instead."),r(o,i));return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,Xs(i,void 0,e,t)),n.get(i))})}function mu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(e){return e===void 0||e===1}function zo({scale:e,scaleX:t,scaleY:n}){return!Js(e)||!Js(t)||!Js(n)}function Yt(e){return zo(e)||pu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function pu(e){return oc(e.x)||oc(e.y)}function oc(e){return e&&e!=="0%"}function is(e,t,n){const r=e-n,s=t*r;return n+s}function ic(e,t,n,r,s){return s!==void 0&&(e=is(e,s,r)),is(e,n,r)+t}function Uo(e,t=0,n=1,r,s){e.min=ic(e.min,t,n,r,s),e.max=ic(e.max,t,n,r,s)}function gu(e,{x:t,y:n}){Uo(e.x,t.translate,t.scale,t.originPoint),Uo(e.y,n.translate,n.scale,n.originPoint)}const ac=.999999999999,cc=1.0000000000001;function ng(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Sn(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,gu(e,i)),r&&Yt(o.latestValues)&&Sn(e,o.latestValues))}t.x<cc&&t.x>ac&&(t.x=1),t.y<cc&&t.y>ac&&(t.y=1)}function wn(e,t){e.min=e.min+t,e.max=e.max+t}function lc(e,t,n,r,s=.5){const o=xe(e.min,e.max,s);Uo(e,t,n,o,r)}function Sn(e,t){lc(e.x,t.x,t.scaleX,t.scale,t.originX),lc(e.y,t.y,t.scaleY,t.scale,t.originY)}function yu(e,t){return mu(tg(e.getBoundingClientRect(),t))}function rg(e,t,n){const r=yu(e,n),{scroll:s}=t;return s&&(wn(r.x,s.offset.x),wn(r.y,s.offset.y)),r}const dc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:dc(),y:dc()}),uc=()=>({min:0,max:0}),Ce=()=>({x:uc(),y:uc()}),Wo={current:null},xu={current:!1};function sg(){if(xu.current=!0,!!Ci)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Wo.current=e.matches;e.addEventListener("change",t),t()}else Wo.current=!1}const og=new WeakMap;function ig(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Le(s))e.addValue(r,s);else if(Le(o))e.addValue(r,Mn(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,Mn(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ag{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_i,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=_e.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ge.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=bs(n),this.isVariantNode=ru(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const g=f[h];c[h]!==void 0&&Le(g)&&g.set(c[h])}}mount(t){var n;this.current=t,og.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),xu.current||sg(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Wo.current,process.env.NODE_ENV!=="production"&&ji(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Dt(this.notifyUpdate),Dt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Fn.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nn){const n=Nn[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ce()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<fc.length;r++){const s=fc[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=ig(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Mn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(dd(r)||fd(r))?r=parseFloat(r):!y0(r)&&Ot.test(n)&&(r=Kd(t,n)),this.setBaseTarget(t,Le(r)?r.get():r)),Le(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xi(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Le(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ti),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zi.render(this.render)}}class bu extends ag{constructor(){super(...arguments),this.KeyframeResolver=o0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Le(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function vu(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function cg(e){return window.getComputedStyle(e)}class lg extends bu{constructor(){super(...arguments),this.type="html",this.renderInstance=vu}readValueFromInstance(t,n){var r;if(Fn.has(n))return(r=this.projection)!=null&&r.isProjecting?Oo(n):Cp(t,n);{const s=cg(t),o=(Ni(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return yu(t,n)}build(t,n,r){Gi(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ji(t,n,r)}}const wu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function dg(e,t,n,r){vu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(wu.has(s)?s:Qi(s),t.attrs[s])}class ug extends bu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ce}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fn.has(n)){const r=Zd(n);return r&&r.default||0}return n=wu.has(n)?n:Qi(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return du(t,n,r)}build(t,n,r){iu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){dg(t,n,r,s)}mount(t){this.isSVGTag=cu(t.tagName),super.mount(t)}}const fg=(e,t)=>qi(e)?new ug(t):new lg(t,{allowProjection:e!==A.Fragment});function En(e,t,n){const r=e.getProps();return Xi(r,t,n!==void 0?n:r.custom,e)}const Zo=e=>Array.isArray(e);function hg(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mn(n))}function mg(e){return Zo(e)?e[e.length-1]||0:e}function pg(e,t){const n=En(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const a=mg(o[i]);hg(e,i,a)}}function gg(e){return!!(Le(e)&&e.add)}function Ko(e,t){const n=e.getValue("willChange");if(gg(n))return n.add(t);if(!n&&At.WillChange){const r=new At.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Su(e){return e.props[uu]}const yg=e=>e!==null;function xg(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(yg),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const bg={type:"spring",stiffness:500,damping:25,restSpeed:10},vg=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wg={type:"keyframes",duration:.8},Sg={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cg=(e,{keyframes:t})=>t.length>2?wg:Fn.has(e)?e.startsWith("scale")?vg(t[1]):bg:Sg;function kg({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const ea=(e,t,n,r={},s,o)=>i=>{const a=Bi(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-rt(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};kg(a)||Object.assign(u,Cg(e,u)),u.duration&&(u.duration=rt(u.duration)),u.repeatDelay&&(u.repeatDelay=rt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Bo(u),u.delay===0&&(f=!0)),(At.instantAnimations||At.skipAnimations)&&(f=!0,Bo(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const h=xg(u.keyframes,a);if(h!==void 0){ge.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Fi(u):new Zp(u)};function Eg({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Cu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(o=r);const c=[],l=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||l&&Eg(l,u))continue;const g={delay:n,...Bi(o||{},u)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===y&&!g.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const w=Su(e);if(w){const v=window.MotionHandoffAnimation(w,u,ge);v!==null&&(g.startTime=v,p=!0)}}Ko(e,u),f.start(ea(u,f,h,e.shouldReduceMotion&&zd.has(u)?{type:!1}:g,e,p));const x=f.animation;x&&c.push(x)}return i&&Promise.all(c).then(()=>{ge.update(()=>{i&&pg(e,i)})}),c}function ku(e,t,n,r=0,s=1){const o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:a-o*r}function Go(e,t,n={}){var c;const r=En(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(Cu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return Ag(e,t,l,u,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,u]=a==="beforeChildren"?[o,i]:[i,o];return l().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function Ag(e,t,n=0,r=0,s=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(Go(c,t,{...i,delay:n+(typeof r=="function"?0:r)+ku(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Tg(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Go(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Go(e,t,n);else{const s=typeof t=="function"?En(e,t,n.custom):t;r=Promise.all(Cu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Eu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const jg=Ki.length;function Au(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Au(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<jg;n++){const r=Ki[n],s=e.props[r];(lr(s)||s===!1)&&(t[r]=s)}return t}const Pg=[...Zi].reverse(),Mg=Zi.length;function Ng(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Tg(e,n,r)))}function Rg(e){let t=Ng(e),n=hc(),r=!0;const s=c=>(l,u)=>{var h;const f=En(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:g,transitionEnd:y,...p}=f;l={...l,...p,...y}}return l};function o(c){t=c(e)}function i(c){const{props:l}=e,u=Au(e.parent)||{},f=[],h=new Set;let g={},y=1/0;for(let x=0;x<Mg;x++){const w=Pg[x],v=n[w],S=l[w]!==void 0?l[w]:u[w],C=lr(S),E=w===c?v.isActive:null;E===!1&&(y=x);let T=S===u[w]&&S!==l[w]&&C;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),v.protectedKeys={...g},!v.isActive&&E===null||!S&&!v.prevProp||xs(S)||typeof S=="boolean")continue;const k=Vg(v.prevProp,S);let j=k||w===c&&v.isActive&&!T&&C||x>y&&C,$=!1;const b=Array.isArray(S)?S:[S];let I=b.reduce(s(w),{});E===!1&&(I={});const{prevResolvedValues:L={}}=v,Z={...L,...I},K=z=>{j=!0,h.has(z)&&($=!0,h.delete(z)),v.needsAnimating[z]=!0;const P=e.getValue(z);P&&(P.liveStyle=!1)};for(const z in Z){const P=I[z],Y=L[z];if(g.hasOwnProperty(z))continue;let R=!1;Zo(P)&&Zo(Y)?R=!Eu(P,Y):R=P!==Y,R?P!=null?K(z):h.add(z):P!==void 0&&h.has(z)?K(z):v.protectedKeys[z]=!0}v.prevProp=S,v.prevResolvedValues=I,v.isActive&&(g={...g,...I}),r&&e.blockInitialAnimation&&(j=!1);const q=T&&k;j&&(!q||$)&&f.push(...b.map(z=>{const P={type:w};if(typeof z=="string"&&r&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:Y}=e,R=En(Y,z);if(Y.enteringChildren&&R){const{delayChildren:V}=R.transition||{};P.delay=ku(Y.enteringChildren,e,V)}}return{animation:z,options:P}}))}if(h.size){const x={};if(typeof l.initial!="boolean"){const w=En(e,Array.isArray(l.initial)?l.initial[0]:l.initial);w&&w.transition&&(x.transition=w.transition)}h.forEach(w=>{const v=e.getBaseTarget(w),S=e.getValue(w);S&&(S.liveStyle=!0),x[w]=v??null}),f.push({animation:x})}let p=!!f.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(c,l){var f;if(n[c].isActive===l)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var g;return(g=h.animationState)==null?void 0:g.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=hc(),r=!0}}}function Vg(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Eu(t,e):!1}function Kt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hc(){return{animate:Kt(!0),whileInView:Kt(),whileHover:Kt(),whileTap:Kt(),whileDrag:Kt(),whileFocus:Kt(),exit:Kt()}}class Bt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Ig extends Bt{constructor(t){super(t),t.animationState||(t.animationState=Rg(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Dg=0;class Og extends Bt{constructor(){super(...arguments),this.id=Dg++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Lg={animation:{Feature:Ig},exit:{Feature:Og}};function ur(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sr(e){return{point:{x:e.pageX,y:e.pageY}}}const $g=e=>t=>Ui(t)&&e(t,Sr(t));function nr(e,t,n,r){return ur(e,t,$g(n),r)}const Tu=1e-4,Fg=1-Tu,_g=1+Tu,ju=.01,Bg=0-ju,Hg=0+ju;function Fe(e){return e.max-e.min}function zg(e,t,n){return Math.abs(e-t)<=n}function mc(e,t,n,r=.5){e.origin=r,e.originPoint=xe(t.min,t.max,e.origin),e.scale=Fe(n)/Fe(t),e.translate=xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fg&&e.scale<=_g||isNaN(e.scale))&&(e.scale=1),(e.translate>=Bg&&e.translate<=Hg||isNaN(e.translate))&&(e.translate=0)}function rr(e,t,n,r){mc(e.x,t.x,n.x,r?r.originX:void 0),mc(e.y,t.y,n.y,r?r.originY:void 0)}function pc(e,t,n){e.min=n.min+t.min,e.max=e.min+Fe(t)}function Ug(e,t,n){pc(e.x,t.x,n.x),pc(e.y,t.y,n.y)}function gc(e,t,n){e.min=t.min-n.min,e.max=e.min+Fe(t)}function sr(e,t,n){gc(e.x,t.x,n.x),gc(e.y,t.y,n.y)}function Ye(e){return[e("x"),e("y")]}const Pu=({current:e})=>e?e.ownerDocument.defaultView:null,yc=(e,t)=>Math.abs(e-t);function Wg(e,t){const n=yc(e.x,t.x),r=yc(e.y,t.y);return Math.sqrt(n**2+r**2)}class Mu{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=eo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=Wg(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:p}=h,{timestamp:x}=Ne;this.history.push({...p,timestamp:x});const{onStart:w,onMove:v}=this.handlers;g||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Qs(g,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();const{onEnd:y,onSessionEnd:p,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=eo(h.type==="pointercancel"?this.lastMoveEventInfo:Qs(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,w),p&&p(h,w)},!Ui(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const a=Sr(t),c=Qs(a,this.transformPagePoint),{point:l}=c,{timestamp:u}=Ne;this.history=[{...l,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,eo(c,this.history)),this.removeListeners=br(nr(this.contextWindow,"pointermove",this.handlePointerMove),nr(this.contextWindow,"pointerup",this.handlePointerUp),nr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Dt(this.updatePoint)}}function Qs(e,t){return t?{point:t(e.point)}:e}function xc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function eo({point:e},t){return{point:e,delta:xc(e,Nu(t)),offset:xc(e,Zg(t)),velocity:Kg(t,.1)}}function Zg(e){return e[0]}function Nu(e){return e[e.length-1]}function Kg(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Nu(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>rt(t)));)n--;if(!r)return{x:0,y:0};const o=ht(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Gg(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?xe(n,e,r.max):Math.min(e,n)),e}function bc(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Yg(e,{top:t,left:n,bottom:r,right:s}){return{x:bc(e.x,n,s),y:bc(e.y,t,r)}}function vc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function qg(e,t){return{x:vc(e.x,t.x),y:vc(e.y,t.y)}}function Xg(e,t){let n=.5;const r=Fe(e),s=Fe(t);return s>r?n=ir(t.min,t.max-r,e.min):r>s&&(n=ir(e.min,e.max-s,t.min)),kt(0,1,n)}function Jg(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yo=.35;function Qg(e=Yo){return e===!1?e=0:e===!0&&(e=Yo),{x:wc(e,"left","right"),y:wc(e,"top","bottom")}}function wc(e,t,n){return{min:Sc(e,t),max:Sc(e,n)}}function Sc(e,t){return typeof e=="number"?e:e[t]||0}const e1=new WeakMap;class t1{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ce(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Sr(f).point)},i=(f,h)=>{const{drag:g,dragPropagation:y,onDragStart:p}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=l0(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ye(w=>{let v=this.getAxisMotionValue(w).get()||0;if(mt.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[w];C&&(v=Fe(C)*(parseFloat(v)/100))}}this.originPoint[w]=v}),p&&ge.postRender(()=>p(f,h)),Ko(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:p,onDrag:x}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=h;if(y&&this.currentDirection===null){this.currentDirection=n1(w),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,w),this.updateAxis("y",h.point,w),this.visualElement.render(),x&&x(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>Ye(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Mu(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Pu(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ge.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Vr(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=Gg(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&vn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Yg(r.layoutBox,t):this.constraints=!1,this.elastic=Qg(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ye(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Jg(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!vn(t))return!1;const r=t.current;Et(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=rg(r,s.root,this.visualElement.getTransformPagePoint());let i=qg(s.layout.layoutBox,o);if(n){const a=n(eg(i));this.hasMutatedConstraints=!!a,a&&(i=mu(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ye(u=>{if(!Vr(u,n,this.currentDirection))return;let f=c&&c[u]||{};i&&(f={min:0,max:0});const h=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ko(this.visualElement,t),r.start(ea(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ye(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ye(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ye(n=>{const{drag:r}=this.getProps();if(!Vr(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n];o.set(t[n]-xe(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!vn(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ye(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();s[i]=Xg({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ye(i=>{if(!Vr(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(xe(c,l,s[i]))})}addListeners(){if(!this.visualElement.current)return;e1.set(this.visualElement,this);const t=this.visualElement.current,n=nr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();vn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ge.read(r);const i=ur(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ye(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=Yo,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function Vr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function n1(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class r1 extends Bt{constructor(t){super(t),this.removeGroupControls=Je,this.removeListeners=Je,this.controls=new t1(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Je}unmount(){this.removeGroupControls(),this.removeListeners()}}const Cc=e=>(t,n)=>{e&&ge.postRender(()=>e(t,n))};class s1 extends Bt{constructor(){super(...arguments),this.removePointerDownListener=Je}onPointerDown(t){this.session=new Mu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pu(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Cc(t),onStart:Cc(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&ge.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=nr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Gr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function kc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Kn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=kc(e,t.target.x),r=kc(e,t.target.y);return`${n}% ${r}%`}},o1={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ot.parse(e);if(s.length>5)return r;const o=Ot.createTransformer(e),i=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+i]/=a,s[1+i]/=c;const l=xe(a,c,.5);return typeof s[2+i]=="number"&&(s[2+i]/=l),typeof s[3+i]=="number"&&(s[3+i]/=l),o(s)}};let to=!1;class i1 extends A.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;j0(a1),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),to&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Gr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,to=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||ge.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zi.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;to=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ru(e){const[t,n]=eu(),r=A.useContext(wi);return d.jsx(i1,{...e,layoutGroup:r,switchLayoutGroup:A.useContext(fu),isPresent:t,safeToRemove:n})}const a1={borderRadius:{...Kn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kn,borderTopRightRadius:Kn,borderBottomLeftRadius:Kn,borderBottomRightRadius:Kn,boxShadow:o1};function c1(e,t,n){const r=Le(e)?e:Mn(e);return r.start(ea("",r,t,n)),r.animation}const l1=(e,t)=>e.depth-t.depth;class d1{constructor(){this.children=[],this.isDirty=!1}add(t){ki(this.children,t),this.isDirty=!0}remove(t){Ei(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(l1),this.isDirty=!1,this.children.forEach(t)}}function u1(e,t){const n=_e.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(Dt(r),e(o-t))};return ge.setup(r,!0),()=>Dt(r)}const Vu=["TopLeft","TopRight","BottomLeft","BottomRight"],f1=Vu.length,Ec=e=>typeof e=="string"?parseFloat(e):e,Ac=e=>typeof e=="number"||re.test(e);function h1(e,t,n,r,s,o){s?(e.opacity=xe(0,n.opacity??1,m1(r)),e.opacityExit=xe(t.opacity??1,0,p1(r))):o&&(e.opacity=xe(t.opacity??1,n.opacity??1,r));for(let i=0;i<f1;i++){const a=`border${Vu[i]}Radius`;let c=Tc(t,a),l=Tc(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Ac(c)===Ac(l)?(e[a]=Math.max(xe(Ec(c),Ec(l),r),0),(mt.test(l)||mt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=xe(t.rotate||0,n.rotate||0,r))}function Tc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const m1=Iu(0,.5,vd),p1=Iu(.5,.95,Je);function Iu(e,t,n){return r=>r<e?0:r>t?1:n(ir(e,t,r))}function jc(e,t){e.min=t.min,e.max=t.max}function Ge(e,t){jc(e.x,t.x),jc(e.y,t.y)}function Pc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Mc(e,t,n,r,s){return e-=t,e=is(e,1/n,r),s!==void 0&&(e=is(e,1/s,r)),e}function g1(e,t=0,n=1,r=.5,s,o=e,i=e){if(mt.test(t)&&(t=parseFloat(t),t=xe(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=xe(o.min,o.max,r);e===o&&(a-=t),e.min=Mc(e.min,t,n,a,s),e.max=Mc(e.max,t,n,a,s)}function Nc(e,t,[n,r,s],o,i){g1(e,t[n],t[r],t[s],t.scale,o,i)}const y1=["x","scaleX","originX"],x1=["y","scaleY","originY"];function Rc(e,t,n,r){Nc(e.x,t,y1,n?n.x:void 0,r?r.x:void 0),Nc(e.y,t,x1,n?n.y:void 0,r?r.y:void 0)}function Vc(e){return e.translate===0&&e.scale===1}function Du(e){return Vc(e.x)&&Vc(e.y)}function Ic(e,t){return e.min===t.min&&e.max===t.max}function b1(e,t){return Ic(e.x,t.x)&&Ic(e.y,t.y)}function Dc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ou(e,t){return Dc(e.x,t.x)&&Dc(e.y,t.y)}function Oc(e){return Fe(e.x)/Fe(e.y)}function Lc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class v1{constructor(){this.members=[]}add(t){ki(this.members,t),t.scheduleRender()}remove(t){if(Ei(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function w1(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:f,rotateY:h,skewX:g,skewY:y}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),g&&(r+=`skewX(${g}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const no=["","X","Y","Z"],S1=1e3;let C1=0;function ro(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Lu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Su(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Lu(r)}function $u({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},a=t==null?void 0:t()){this.id=C1++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(A1),this.nodes.forEach(M1),this.nodes.forEach(N1),this.nodes.forEach(T1)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new d1)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ti),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Qd(i)&&!p0(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;ge.read(()=>{f=window.innerWidth}),e(i,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,u&&u(),u=u1(h,250),Gr.hasAnimatedSinceResize&&(Gr.hasAnimatedSinceResize=!1,this.nodes.forEach(_c)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||l.getDefaultTransition()||O1,{onLayoutAnimationStart:p,onLayoutAnimationComplete:x}=l.getProps(),w=!this.targetLayout||!Ou(this.targetLayout,g),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...Bi(y,"layout"),onPlay:p,onComplete:x};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,v)}else f||_c(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Dt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(R1),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Lu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach($c);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Fc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(P1),this.nodes.forEach(k1),this.nodes.forEach(E1)):this.nodes.forEach(Fc),this.clearAllSnapshots();const a=_e.now();Ne.delta=kt(0,1e3/60,a-Ne.timestamp),Ne.timestamp=a,Ne.isProcessing=!0,Ws.update.process(Ne),Ws.preRender.process(Ne),Ws.render.process(Ne),Ne.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(j1),this.sharedNodes.forEach(V1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Fe(this.snapshot.measuredBox.x)&&!Fe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ce(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Du(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Yt(this.latestValues)||u)&&(s(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),L1(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return Ce();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some($1))){const{scroll:u}=this.root;u&&(wn(a.x,u.offset.x),wn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Ce();if(Ge(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Ge(a,i),wn(a.x,f.offset.x),wn(a.y,f.offset.y))}return a}applyTransform(i,a=!1){const c=Ce();Ge(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Sn(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Yt(u.latestValues)&&Sn(c,u.latestValues)}return Yt(this.latestValues)&&Sn(c,this.latestValues),c}removeTransform(i){const a=Ce();Ge(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Yt(l.latestValues))continue;zo(l.latestValues)&&l.updateSnapshot();const u=Ce(),f=l.measurePageBox();Ge(u,f),Rc(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Yt(this.latestValues)&&Rc(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ne.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!(!this.layout||!(u||f))){if(this.resolvedRelativeTargetAt=Ne.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ce(),this.relativeTargetOrigin=Ce(),sr(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ce(),this.targetWithTransforms=Ce()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ug(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ge(this.target,this.layout.layoutBox),gu(this.target,this.targetDelta)):Ge(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ce(),this.relativeTargetOrigin=Ce(),sr(this.relativeTargetOrigin,this.target,g.target),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||zo(this.parent.latestValues)||pu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Ne.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ge(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;ng(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ce());const{target:g}=i;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Pc(this.prevProjectionDelta.x,this.projectionDelta.x),Pc(this.prevProjectionDelta.y,this.projectionDelta.y)),rr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Lc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Lc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},f=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ce(),g=c?c.source:void 0,y=this.layout?this.layout.source:void 0,p=g!==y,x=this.getStack(),w=!x||x.members.length<=1,v=!!(p&&!w&&this.options.crossfade===!0&&!this.path.some(D1));this.animationProgress=0;let S;this.mixTargetDelta=C=>{const E=C/1e3;Bc(f.x,i.x,E),Bc(f.y,i.y,E),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),I1(this.relativeTarget,this.relativeTargetOrigin,h,E),S&&b1(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Ce()),Ge(S,this.relativeTarget)),p&&(this.animationValues=u,h1(u,l,this.latestValues,E,v,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(),this.pendingAnimation&&(Dt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Gr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mn(0)),this.currentAnimation=c1(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(S1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Fu(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ce();const f=Fe(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=Fe(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ge(a,c),Sn(a,u),rr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new v1),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&ro("z",i,l,this.animationValues);for(let u=0;u<no.length;u++)ro(`rotate${no[u]}`,i,l,this.animationValues),ro(`skew${no[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Kr(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Kr(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Yt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=w1(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),i.transform=f;const{x:h,y:g}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${g.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in dr){if(u[y]===void 0)continue;const{correct:p,applyTo:x,isCSSVariable:w}=dr[y],v=f==="none"?u[y]:p(u[y],l);if(x){const S=x.length;for(let C=0;C<S;C++)i[x[C]]=v}else w?this.options.visualElement.renderState.vars[y]=v:i[y]=v}this.options.layoutId&&(i.pointerEvents=l===this?Kr(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach($c),this.root.sharedNodes.clear()}}}function k1(e){e.updateLayout()}function E1(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?Ye(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],g=Fe(h);h.min=r[f].min,h.max=h.min+g}):Fu(o,t.layoutBox,r)&&Ye(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],g=Fe(r[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const a=Cn();rr(a,r,t.layoutBox);const c=Cn();i?rr(c,e.applyTransform(s,!0),t.measuredBox):rr(c,r,t.layoutBox);const l=!Du(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const y=Ce();sr(y,t.layoutBox,h.layoutBox);const p=Ce();sr(p,r,g.layoutBox),Ou(y,p)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function A1(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function T1(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function j1(e){e.clearSnapshot()}function $c(e){e.clearMeasurements()}function Fc(e){e.isLayoutDirty=!1}function P1(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _c(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function M1(e){e.resolveTargetDelta()}function N1(e){e.calcProjection()}function R1(e){e.resetSkewAndRotation()}function V1(e){e.removeLeadSnapshot()}function Bc(e,t,n){e.translate=xe(t.translate,0,n),e.scale=xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hc(e,t,n,r){e.min=xe(t.min,n.min,r),e.max=xe(t.max,n.max,r)}function I1(e,t,n,r){Hc(e.x,t.x,n.x,r),Hc(e.y,t.y,n.y,r)}function D1(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const O1={duration:.45,ease:[.4,0,.1,1]},zc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Uc=zc("applewebkit/")&&!zc("chrome/")?Math.round:Je;function Wc(e){e.min=Uc(e.min),e.max=Uc(e.max)}function L1(e){Wc(e.x),Wc(e.y)}function Fu(e,t,n){return e==="position"||e==="preserve-aspect"&&!zg(Oc(t),Oc(n),.2)}function $1(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const F1=$u({attachResizeListener:(e,t)=>ur(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),so={current:void 0},_u=$u({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!so.current){const e=new F1({});e.mount(window),e.setOptions({layoutScroll:!0}),so.current=e}return so.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_1={pan:{Feature:s1},drag:{Feature:r1,ProjectionNode:_u,MeasureLayout:Ru}};function Zc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&ge.postRender(()=>o(t,Sr(t)))}class B1 extends Bt{mount(){const{current:t}=this.node;t&&(this.unmount=d0(t,(n,r)=>(Zc(this.node,r,"Start"),s=>Zc(this.node,s,"End"))))}unmount(){}}class H1 extends Bt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=br(ur(this.node.current,"focus",()=>this.onFocus()),ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Kc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&ge.postRender(()=>o(t,Sr(t)))}class z1 extends Bt{mount(){const{current:t}=this.node;t&&(this.unmount=m0(t,(n,r)=>(Kc(this.node,r,"Start"),(s,{success:o})=>Kc(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const qo=new WeakMap,oo=new WeakMap,U1=e=>{const t=qo.get(e.target);t&&t(e)},W1=e=>{e.forEach(U1)};function Z1({root:e,...t}){const n=e||document;oo.has(n)||oo.set(n,{});const r=oo.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(W1,{root:e,...t})),r[s]}function K1(e,t,n){const r=Z1(t);return qo.set(e,n),r.observe(e),()=>{qo.delete(e),r.unobserve(e)}}const G1={some:0,all:1};class Y1 extends Bt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:G1[s]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=l?u:f;h&&h(c)};return K1(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(q1(t,n))&&this.startObserver()}unmount(){}}function q1({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const X1={inView:{Feature:Y1},tap:{Feature:z1},focus:{Feature:H1},hover:{Feature:B1}},J1={layout:{ProjectionNode:_u,MeasureLayout:Ru}},Q1={...Lg,...X1,..._1,...J1},ae=Q0(Q1,fg);function ey(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let Xo=1;class ty{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Xo++,i=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],A.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(ry(l)&&!l.ok){o=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,y=typeof f=="object"&&!A.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...y})}else if(l instanceof Error){o=!1;const f=typeof n.error=="function"?await n.error(l):n.error,h=typeof n.description=="function"?await n.description(l):n.description,y=typeof f=="object"&&!A.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...y})}else if(n.success!==void 0){o=!1;const f=typeof n.success=="function"?await n.success(l):n.success,h=typeof n.description=="function"?await n.description(l):n.description,y=typeof f=="object"&&!A.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:h,...y})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const u=typeof n.error=="function"?await n.error(l):n.error,f=typeof n.description=="function"?await n.description(l):n.description,g=typeof u=="object"&&!A.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...g})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Xo++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qe=new ty,ny=(e,t)=>{const n=(t==null?void 0:t.id)||Xo++;return qe.addToast({title:e,...t,id:n}),n},ry=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",sy=ny,oy=()=>qe.toasts,iy=()=>qe.getActiveToasts(),Bu=Object.assign(sy,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:oy,getToasts:iy});ey("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const it=m.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:s="1em",weight:o="regular",mirrored:i=!1,children:a,weights:c,...l}=e;return m.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...l},!!n&&m.createElement("title",null,n),a,c.get(o))});it.displayName="SSRBase";const ay=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),ta=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:ay}));ta.displayName="CaretDownIcon";const cy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),m.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),Hu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:cy}));Hu.displayName="CaretUpIcon";const ly=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),zu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:ly}));zu.displayName="ChatTextIcon";const dy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",m.createElement(m.Fragment,null,m.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,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Uu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:dy}));Uu.displayName="CheckIcon";const uy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),m.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]),Wu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:uy}));Wu.displayName="MicrophoneIcon";const fy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M56.88,39.93A12,12,0,1,0,39.12,56.07L76,96.64V128a52,52,0,0,0,72.11,48l11.26,12.39A67.34,67.34,0,0,1,128,196a68.07,68.07,0,0,1-68-68,12,12,0,0,0-24,0,92.14,92.14,0,0,0,80,91.22V240a12,12,0,0,0,24,0V219.23a90.39,90.39,0,0,0,35.92-12.68l23.2,25.52a12,12,0,0,0,17.76-16.14ZM128,156a28,28,0,0,1-28-28v-5l29.9,32.89C129.27,156,128.64,156,128,156Zm63-2.42A67.63,67.63,0,0,0,196,128a12,12,0,0,1,24,0,91.48,91.48,0,0,1-6.74,34.61,12,12,0,0,1-22.23-9ZM85.7,33.75A52,52,0,0,1,180,64v56.54a12,12,0,0,1-24,0V64a28,28,0,0,0-50.79-16.28,12,12,0,0,1-19.51-14Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),m.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.38,229.92a8,8,0,0,1-11.3-.54l-30.92-34A78.83,78.83,0,0,1,136,207.59V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64.07,64.07,0,0,0,64,64,63.41,63.41,0,0,0,32.21-8.68l-11.1-12.2A48,48,0,0,1,80,128V95.09L42.08,53.38A8,8,0,0,1,53.92,42.62l160,176A8,8,0,0,1,213.38,229.92Zm-24.19-63.13a7.88,7.88,0,0,0,3.51.82,8,8,0,0,0,7.19-4.49A79.16,79.16,0,0,0,208,128a8,8,0,0,0-16,0,63.32,63.32,0,0,1-6.48,28.09A8,8,0,0,0,189.19,166.79Zm-27.33-29.22A8,8,0,0,0,175.74,133a49.49,49.49,0,0,0,.26-5V64A48,48,0,0,0,84,44.87a8,8,0,0,0,1.41,8.57Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.44,220,52.44,44A6,6,0,0,0,43.56,52L82,94.32V128a46,46,0,0,0,67.56,40.64l13.75,15.12A65.26,65.26,0,0,1,128,194a66.08,66.08,0,0,1-66-66,6,6,0,0,0-12,0,78.09,78.09,0,0,0,72,77.75V240a6,6,0,0,0,12,0V205.77a76.93,76.93,0,0,0,37.48-13L203.56,228a6,6,0,0,0,8.88-8.08ZM128,162a34,34,0,0,1-34-34V107.52l47.12,51.84A33.82,33.82,0,0,1,128,162Zm59.32-5A65.38,65.38,0,0,0,194,128a6,6,0,0,1,12,0,77.33,77.33,0,0,1-7.9,34.25A6,6,0,1,1,187.32,157ZM85.8,45.67A46,46,0,0,1,174,64v64a45.17,45.17,0,0,1-.25,4.81,6,6,0,0,1-6,5.38q-.31,0-.63,0a6,6,0,0,1-5.34-6.59A35.41,35.41,0,0,0,162,128V64A34,34,0,0,0,96.8,50.45a6,6,0,0,1-11-4.78Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211,221.31,51,45.31A4,4,0,0,0,45,50.69L84,93.55V128a44,44,0,0,0,66,38.12l16.38,18A67.21,67.21,0,0,1,128,196a68.07,68.07,0,0,1-68-68,4,4,0,0,0-8,0,76.09,76.09,0,0,0,72,75.89V240a4,4,0,0,0,8,0V203.89a75.1,75.1,0,0,0,39.79-13.77L205,226.69a4,4,0,1,0,5.92-5.38ZM128,164a36,36,0,0,1-36-36V102.35L144.43,160A35.83,35.83,0,0,1,128,164Zm61.12-6.15A67.44,67.44,0,0,0,196,128a4,4,0,0,1,8,0,75.28,75.28,0,0,1-7.7,33.37,4,4,0,0,1-7.18-3.52ZM87.63,46.46A44,44,0,0,1,172,64v64a44.2,44.2,0,0,1-.24,4.61,4,4,0,0,1-4,3.58l-.42,0a4,4,0,0,1-3.57-4.39A36.67,36.67,0,0,0,164,128V64A36,36,0,0,0,95,49.66a4,4,0,0,1-7.34-3.2Z"}))]]),Zu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:fy}));Zu.displayName="MicrophoneSlashIcon";const hy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228ZM160.49,103.51a12,12,0,0,1-17,17L140,117v35a12,12,0,0,1-24,0V117l-3.51,3.52a12,12,0,0,1-17-17l24-24a12,12,0,0,1,17,0Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z",opacity:"0.2"}),m.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,224a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64Zm-74.34,42.34-24-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,11.32,11.32L120,107.31V152a8,8,0,0,0,16,0V107.31l10.34,10.35a8,8,0,0,0,11.32-11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Zm-9.76-116.24a6,6,0,1,1-8.48,8.48L134,102.49V152a6,6,0,0,1-12,0V102.49l-13.76,13.75a6,6,0,0,1-8.48-8.48l24-24a6,6,0,0,1,8.48,0Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Zm-9.17-114.83a4,4,0,0,1-5.66,5.66L132,97.66V152a4,4,0,0,1-8,0V97.66l-17.17,17.17a4,4,0,0,1-5.66-5.66l24-24a4,4,0,0,1,5.66,0Z"}))]]),Ku=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:hy}));Ku.displayName="MonitorArrowUpIcon";const my=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),na=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:my}));na.displayName="SpinnerIcon";const py=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V167.57l24.94,18.14A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM188,180H36V76H188Zm44-27.57-20-14.54V118.11l20-14.54Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,72V184a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V72A16,16,0,0,1,32,56H176A16,16,0,0,1,192,72Zm58,.25a8.23,8.23,0,0,0-6.63,1.22L209.78,95.86A4,4,0,0,0,208,99.19v57.62a4,4,0,0,0,1.78,3.33l33.78,22.52a8,8,0,0,0,8.58.19,8.33,8.33,0,0,0,3.86-7.17V80A8,8,0,0,0,250,72.25Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V155.21L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM194,184a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H192a2,2,0,0,1,2,2Zm48-19.21-36-24V115.21l36-24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V151.47l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM196,184a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H192a4,4,0,0,1,4,4Zm48-15.47-40-26.67V114.14l40-26.67Z"}))]]),Gu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:py}));Gu.displayName="VideoCameraIcon";const gy=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H123.88a12,12,0,0,0,0,24H188v68a12,12,0,0,0,4.46,9.33c.15.13.31.25.48.38l44,32A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM232,152.43l-20-14.54V118.11l20-14.54ZM56.88,31.93A12,12,0,1,0,39.12,48.07L42.69,52H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H180.87l18.25,20.07a12,12,0,0,0,17.76-16.14ZM36,180V76H64.51l94.55,104Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M256,80.23v95.45a8.33,8.33,0,0,1-3.86,7.17,8,8,0,0,1-8.58-.19l-33.78-22.52a4,4,0,0,1-1.78-3.33V99.19a4,4,0,0,1,1.78-3.32l33.78-22.53a8,8,0,0,1,9.73.66A8.23,8.23,0,0,1,256,80.23ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM185,155.07a4,4,0,0,0,7-2.7V72a16,16,0,0,0-16-16H104a4,4,0,0,0-3,6.69Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H113.06a6,6,0,0,0,0,12H192a2,2,0,0,1,2,2v87.63a6,6,0,0,0,12,0v-4.42L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM242,164.79l-36-24V115.21l36-24ZM52.44,36A6,6,0,0,0,43.56,44L56.25,58H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H183.53l20,22a6,6,0,0,0,8.88-8.08ZM32,186a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H67.16L172.62,186Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H113.06a4,4,0,0,0,0,8H192a4,4,0,0,1,4,4v87.63a4,4,0,0,0,8,0v-8.16l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM244,168.53l-40-26.67V114.14l40-26.67ZM51,37.31A4,4,0,0,0,45,42.69L60.78,60H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H184.41L205,218.69a4,4,0,1,0,5.92-5.38ZM32,188a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H68.05L177.14,188Z"}))]]),Yu=m.forwardRef((e,t)=>m.createElement(it,{ref:t,...e,weights:gy}));Yu.displayName="VideoCameraSlashIcon";const yy=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),xy=A.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),qu=m.forwardRef((e,t)=>{const{alt:n,color:r,size:s,weight:o,mirrored:i,children:a,weights:c,...l}=e,{color:u="currentColor",size:f,weight:h="regular",mirrored:g=!1,...y}=m.useContext(xy);return m.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s??f,height:s??f,fill:r??u,viewBox:"0 0 256 256",transform:i||g?"scale(-1, 1)":void 0,...y,...l},!!n&&m.createElement("title",null,n),a,c.get(o??h))});qu.displayName="IconBase";const Xu=m.forwardRef((e,t)=>m.createElement(qu,{ref:t,...e,weights:yy}));Xu.displayName="WarningIcon";const ra="-",by=e=>{const t=wy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ra);return a[0]===""&&a.length!==1&&a.shift(),Ju(a,t)||vy(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Ju=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Ju(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(ra);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},Gc=/^\[(.+)\]$/,vy=e=>{if(Gc.test(e)){const t=Gc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wy=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)Jo(n[s],r,s,t);return r},Jo=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Yc(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(Sy(s)){Jo(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{Jo(i,Yc(t,o),n,r)})})},Yc=(e,t)=>{let n=e;return t.split(ra).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sy=e=>e.isThemeGetter,Cy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},Qo="!",ei=":",ky=ei.length,Ey=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,l;for(let y=0;y<s.length;y++){let p=s[y];if(i===0&&a===0){if(p===ei){o.push(s.slice(c,y)),c=y+ky;continue}if(p==="/"){l=y;continue}}p==="["?i++:p==="]"?i--:p==="("?a++:p===")"&&a--}const u=o.length===0?s:s.substring(c),f=Ay(u),h=f!==u,g=l&&l>c?l-c:void 0;return{modifiers:o,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:g}};if(t){const s=t+ei,o=r;r=i=>i.startsWith(s)?o(i.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Ay=e=>e.endsWith(Qo)?e.substring(0,e.length-1):e.startsWith(Qo)?e.substring(1):e,Ty=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(i=>{i[0]==="["||t[i]?(s.push(...o.sort(),i),o=[]):o.push(i)}),s.push(...o.sort()),s}},jy=e=>({cache:Cy(e.cacheSize),parseClassName:Ey(e),sortModifiers:Ty(e),...by(e)}),Py=/\s+/,My=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(Py);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:f,modifiers:h,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:p}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let x=!!p,w=r(x?y.substring(0,p):y);if(!w){if(!x){c=u+(c.length>0?" "+c:c);continue}if(w=r(y),!w){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=o(h).join(":"),S=g?v+Qo:v,C=S+w;if(i.includes(C))continue;i.push(C);const E=s(w,x);for(let T=0;T<E.length;++T){const k=E[T];i.push(S+k)}c=u+(c.length>0?" "+c:c)}return c};function Ny(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Qu(t))&&(r&&(r+=" "),r+=n);return r}const Qu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Qu(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ry(e,...t){let n,r,s,o=i;function i(c){const l=t.reduce((u,f)=>f(u),e());return n=jy(l),r=n.cache.get,s=n.cache.set,o=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=My(c,n);return s(c,u),u}return function(){return o(Ny.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ef=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vy=/^\d+\/\d+$/,Iy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dy=/\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$/,Oy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ly=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$y=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dn=e=>Vy.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),Nt=e=>!!e&&Number.isInteger(Number(e)),io=e=>e.endsWith("%")&&oe(e.slice(0,-1)),vt=e=>Iy.test(e),Fy=()=>!0,_y=e=>Dy.test(e)&&!Oy.test(e),nf=()=>!1,By=e=>Ly.test(e),Hy=e=>$y.test(e),zy=e=>!Q(e)&&!ee(e),Uy=e=>_n(e,of,nf),Q=e=>ef.test(e),Gt=e=>_n(e,af,_y),ao=e=>_n(e,Yy,oe),qc=e=>_n(e,rf,nf),Wy=e=>_n(e,sf,Hy),Ir=e=>_n(e,cf,By),ee=e=>tf.test(e),Gn=e=>Bn(e,af),Zy=e=>Bn(e,qy),Xc=e=>Bn(e,rf),Ky=e=>Bn(e,of),Gy=e=>Bn(e,sf),Dr=e=>Bn(e,cf,!0),_n=(e,t,n)=>{const r=ef.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Bn=(e,t,n=!1)=>{const r=tf.exec(e);return r?r[1]?t(r[1]):n:!1},rf=e=>e==="position"||e==="percentage",sf=e=>e==="image"||e==="url",of=e=>e==="length"||e==="size"||e==="bg-size",af=e=>e==="length",Yy=e=>e==="number",qy=e=>e==="family-name",cf=e=>e==="shadow",Xy=()=>{const e=Me("color"),t=Me("font"),n=Me("text"),r=Me("font-weight"),s=Me("tracking"),o=Me("leading"),i=Me("breakpoint"),a=Me("container"),c=Me("spacing"),l=Me("radius"),u=Me("shadow"),f=Me("inset-shadow"),h=Me("text-shadow"),g=Me("drop-shadow"),y=Me("blur"),p=Me("perspective"),x=Me("aspect"),w=Me("ease"),v=Me("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),ee,Q],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],j=()=>[ee,Q,c],$=()=>[dn,"full","auto",...j()],b=()=>[Nt,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",Nt,ee,Q]},Nt,ee,Q],L=()=>[Nt,"auto",ee,Q],Z=()=>["auto","min","max","fr",ee,Q],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],z=()=>[dn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],P=()=>[e,ee,Q],Y=()=>[...C(),Xc,qc,{position:[ee,Q]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Ky,Uy,{size:[ee,Q]}],W=()=>[io,Gn,Gt],M=()=>["","none","full",l,ee,Q],_=()=>["",oe,Gn,Gt],H=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>[oe,io,Xc,qc],F=()=>["","none",y,ee,Q],U=()=>["none",oe,ee,Q],O=()=>["none",oe,ee,Q],J=()=>[oe,ee,Q],X=()=>[dn,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vt],breakpoint:[vt],color:[Fy],container:[vt],"drop-shadow":[vt],ease:["in","out","in-out"],font:[zy],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vt],shadow:[vt],spacing:["px",oe],text:[vt],"text-shadow":[vt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dn,Q,ee,x]}],container:["container"],columns:[{columns:[oe,Q,ee,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Nt,"auto",ee,Q]}],basis:[{basis:[dn,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,dn,"auto","initial","none",Q]}],grow:[{grow:["",oe,ee,Q]}],shrink:[{shrink:["",oe,ee,Q]}],order:[{order:[Nt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[a,"screen",...z()]}],"min-w":[{"min-w":[a,"screen","none",...z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,Gn,Gt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,ao]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",io,Q]}],"font-family":[{font:[Zy,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ee,Q]}],"line-clamp":[{"line-clamp":[oe,"none",ee,ao]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",ee,Gt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[oe,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nt,ee,Q],radial:["",ee,Q],conic:[Nt,ee,Q]},Gy,Wy]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,ee,Q]}],"outline-w":[{outline:["",oe,Gn,Gt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Dr,Ir]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",f,Dr,Ir]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[oe,Gt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",h,Dr,Ir]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[oe,ee,Q]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":N()}],"mask-image-linear-to-pos":[{"mask-linear-to":N()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":N()}],"mask-image-t-to-pos":[{"mask-t-to":N()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":N()}],"mask-image-r-to-pos":[{"mask-r-to":N()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":N()}],"mask-image-b-to-pos":[{"mask-b-to":N()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":N()}],"mask-image-l-to-pos":[{"mask-l-to":N()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":N()}],"mask-image-x-to-pos":[{"mask-x-to":N()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":N()}],"mask-image-y-to-pos":[{"mask-y-to":N()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":N()}],"mask-image-radial-to-pos":[{"mask-radial-to":N()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":N()}],"mask-image-conic-to-pos":[{"mask-conic-to":N()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:F()}],brightness:[{brightness:[oe,ee,Q]}],contrast:[{contrast:[oe,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",g,Dr,Ir]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",oe,ee,Q]}],"hue-rotate":[{"hue-rotate":[oe,ee,Q]}],invert:[{invert:["",oe,ee,Q]}],saturate:[{saturate:[oe,ee,Q]}],sepia:[{sepia:["",oe,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[oe,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[oe,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",oe,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[oe,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[oe,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",ee,Q]}],ease:[{ease:["linear","initial",w,ee,Q]}],delay:[{delay:[oe,ee,Q]}],animate:[{animate:["none",v,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ee,Q]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[oe,Gn,Gt,ao]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Jy=Ry(Xy);function ne(...e){return Jy(vi.clsx(e))}function Qy(e,t){return{id:e.streamInfo.id,timestamp:e.streamInfo.timestamp,message:e.text,from:e.participantInfo.identity===t.localParticipant.identity?t.localParticipant:Array.from(t.remoteParticipants.values()).find(n=>n.identity===e.participantInfo.identity)}}const ex=ps.cva(["relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-[0_1fr] gap-y-0.5 items-start","has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current"],{variants:{variant:{default:"bg-card text-card-foreground",destructive:["text-destructive-foreground bg-destructive border-destructive-border","[&>svg]:text-current *:data-[slot=alert-description]:text-destructive-foreground/90"]}},defaultVariants:{variant:"default"}});function tx({className:e,variant:t,...n}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:ne(ex({variant:t}),e),...n})}function nx({className:e,...t}){return d.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function rx({className:e,...t}){return d.jsx("div",{"data-slot":"alert-description",className:ne("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Or(e){return Bu.custom(t=>d.jsx(sx,{id:t,title:e.title,description:e.description}),{duration:1e4})}function sx(e){const{title:t,id:n,description:r}=e;return d.jsxs(tx,{onClick:()=>Bu.dismiss(n),className:"bg-gradient-to-br from-[#181825] to-[#232336] border border-[#232336] shadow-lg shadow-black/40 rounded-xl px-4 py-3 flex items-start gap-3 hover:shadow-xl transition-all duration-200",style:{color:"#F3F4F6"},children:[d.jsx(Xu,{weight:"bold",className:"text-yellow-400 mt-1 flex-shrink-0",size:24}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx(nx,{className:"text-base font-semibold text-white mb-1",children:t}),d.jsx(rx,{className:"text-sm text-gray-300 leading-snug",children:r})]})]})}function Jc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lf(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Jc(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Jc(e[s],null)}}}}function Ve(...e){return m.useCallback(lf(...e),e)}function fr(e){const t=ix(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,a=m.Children.toArray(o),c=a.find(cx);if(c){const l=c.props.children,u=a.map(f=>f===c?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:f);return d.jsx(t,{...i,ref:s,children:m.isValidElement(l)?m.cloneElement(l,void 0,u):null})}return d.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var ox=fr("Slot");function ix(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=dx(s),a=lx(o,s.props);return s.type!==m.Fragment&&(a.ref=r?lf(r,i):i),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ax=Symbol("radix.slottable");function cx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ax}function lx(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function dx(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const ux=ps.cva(["text-xs font-bold tracking-wider uppercase whitespace-nowrap","inline-flex items-center justify-center gap-2 shrink-0 rounded-full cursor-pointer outline-none transition-colors duration-300","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:pointer-events-none disabled:opacity-50","aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40 ","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button text-button-foreground hover:bg-muted focus:bg-muted",destructive:["bg-destructive text-destructive-foreground","hover:bg-destructive-hover focus:bg-destructive-hover focus-visible:ring-destructive-foreground/20","dark:focus-visible:ring-destructive-foreground/40"],outline:["border bg-background","hover:bg-accent hover:text-accent-foreground","dark:bg-input/30 dark:border-input dark:hover:bg-input/50"],primary:"",secondary:"bg-secondary text-secondary-foregroun hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function fx({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?ox:"button";return d.jsx(o,{"data-slot":"button",className:ne(ux({variant:t,size:n,className:e})),...s})}function hx({onSend:e,className:t,disabled:n,...r}){const s=A.useRef(null),[o,i]=A.useState(""),a=l=>{var u,f;l.preventDefault(),(u=r.onSubmit)==null||u.call(r,l),e==null||e(o),i(""),(f=s.current)==null||f.focus({preventScroll:!0})},c=n||o.trim().length===0;return d.jsxs("form",{...r,onSubmit:a,className:ne("flex items-center rounded-md pl-1 text-sm",t),children:[d.jsx("input",{ref:s,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:o,onChange:l=>i(l.target.value),disabled:n}),d.jsx(fx,{size:"sm",type:"submit",variant:c?"secondary":"primary",disabled:c,className:"font-mono",children:"SEND"})]})}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var Be=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},mx=m[" useInsertionEffect ".trim().toString()]||Be;function ti({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=px({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=m.useCallback(u=>{var f;if(a){const h=gx(u)?u(e):u;h!==e&&((f=i.current)==null||f.call(i,h))}else o(u)},[a,e,o,i]);return[c,l]}function px({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return mx(()=>{o.current=t},[t]),m.useEffect(()=>{var i;s.current!==n&&((i=o.current)==null||i.call(o,n),s.current=n)},[n,s]),[n,r,o]}function gx(e){return typeof e=="function"}var yx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Se=yx.reduce((e,t)=>{const n=fr(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xx(e,t){e&&It.flushSync(()=>e.dispatchEvent(t))}var df="Toggle",uf=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...o}=e,[i,a]=ti({prop:n,onChange:s,defaultProp:r??!1,caller:df});return d.jsx(Se.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:ke(e.onClick,()=>{e.disabled||a(!i)})})});uf.displayName=df;var bx=uf;const vx=ps.cva(["inline-flex items-center justify-center gap-2 rounded-full","text-sm font-medium whitespace-nowrap","cursor-pointer outline-none transition-[color,border,background-color]","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0 aria-invalid:border-0","disabled:pointer-events-none disabled:opacity-50 disabled:not-allowed","data-[state=on]:bg-button-selected data-[state=on]:border-button-border-selected","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button hover:bg-muted focus:bg-muted hover:text-muted-foreground focus:text-muted-foreground",primary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=off]:bg-button-primary hover:data-[state=off]:bg-button-hover data-[state=off]:text-button-primary-foreground",secondary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=on]:bg-button-secondary hover:data-[state=on]:bg-button-secondary data-[state=on]:text-button-secondary-foreground",outline:["border border-button-border bg-button text-button-foreground","hover:bg-background focus:bg-background"]},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function ff({className:e,variant:t,size:n,...r}){return d.jsx(bx,{"data-slot":"toggle",className:ne(vx({variant:t,size:n,className:e})),...r})}function wx(e){const[t,n]=A.useState(()=>e.getPublishPermissions());return A.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},s=()=>{r()};return e.on("connection.connected",s),e.on("connection.disconnected",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s)}},[e]),t}function Sx(e){const[t,n]=A.useState(()=>e.getLocalParticipant()),[r,s]=A.useState(()=>e.getMicrophoneTrack());return A.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),c=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!c,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),s(c)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},c=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",c),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),i.off("localTrackPublished",a),i.off("localTrackUnpublished",c)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function co(e,t,n){const[r,s]=A.useState(!1),[o,i]=A.useState(!1);return A.useEffect(()=>{const c=()=>{let l=!1;switch(t){case"microphone":l=e.isMicrophoneEnabled;break;case"camera":l=e.isCameraEnabled;break;case"screenShare":l=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,l),s(l)};return c(),e.on("track.muted",c),e.on("track.unmuted",c),e.on("connection.connected",c),()=>{e.off("track.muted",c),e.off("track.unmuted",c),e.off("connection.connected",c)}},[e,t]),{enabled:r,pending:o,toggle:async c=>{var l;try{i(!0);const u=c!==void 0?c:!r;switch(t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?await e.startScreenShare():await e.stopScreenShare();break}}catch(u){(l=n==null?void 0:n.onDeviceError)==null||l.call(n,u)}finally{i(!1)}}}}function Cx(e){const[t,n]=A.useState(()=>e.getRoom()),[r,s]=A.useState(()=>e.getConnectionState());return A.useEffect(()=>{const o=()=>{n(e.getRoom()),s(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function kx(e,t){const[n,r]=A.useState([]),[s,o]=A.useState("");return A.useEffect(()=>{var l;const a=async()=>{try{const u=t==="audioinput"?await e.getAudioInputDevices():await e.getVideoInputDevices();r(u)}catch(u){console.error("Failed to load devices:",u)}};a();const c=()=>{a()};return(l=navigator.mediaDevices)==null||l.addEventListener("devicechange",c),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",c)}},[e,t]),{devices:n,activeDeviceId:s,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),o(a)}catch(c){console.error("Failed to set device:",c)}}}}function Ex(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:i=>{t||localStorage.setItem("voxket-audio-input-enabled",i.toString())},saveAudioInputDeviceId:i=>{t||localStorage.setItem("voxket-audio-input-device-id",i)},saveVideoInputEnabled:i=>{t||localStorage.setItem("voxket-video-input-enabled",i.toString())},saveVideoInputDeviceId:i=>{t||localStorage.setItem("voxket-video-input-device-id",i)}}}function Qc(e,[t,n]){return Math.min(n,Math.max(t,e))}function sa(e,t=[]){let n=[];function r(o,i){const a=m.createContext(i),c=n.length;n=[...n,i];const l=f=>{var w;const{scope:h,children:g,...y}=f,p=((w=h==null?void 0:h[e])==null?void 0:w[c])||a,x=m.useMemo(()=>y,Object.values(y));return d.jsx(p.Provider,{value:x,children:g})};l.displayName=o+"Provider";function u(f,h){var p;const g=((p=h==null?void 0:h[e])==null?void 0:p[c])||a,y=m.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,u]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(a){const c=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,Ax(s,...t)]}function Ax(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const f=c(o)[`__scope${l}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Tx(e){const t=e+"CollectionProvider",[n,r]=sa(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:x,children:w}=p,v=A.useRef(null),S=A.useRef(new Map).current;return d.jsx(s,{scope:x,itemMap:S,collectionRef:v,children:w})};i.displayName=t;const a=e+"CollectionSlot",c=fr(a),l=A.forwardRef((p,x)=>{const{scope:w,children:v}=p,S=o(a,w),C=Ve(x,S.collectionRef);return d.jsx(c,{ref:C,children:v})});l.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=fr(u),g=A.forwardRef((p,x)=>{const{scope:w,children:v,...S}=p,C=A.useRef(null),E=Ve(x,C),T=o(u,w);return A.useEffect(()=>(T.itemMap.set(C,{ref:C,...S}),()=>void T.itemMap.delete(C))),d.jsx(h,{[f]:"",ref:E,children:v})});g.displayName=u;function y(p){const x=o(e+"CollectionConsumer",p);return A.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((T,k)=>S.indexOf(T.ref.current)-S.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:l,ItemSlot:g},y,r]}var jx=m.createContext(void 0);function Px(e){const t=m.useContext(jx);return e||t||"ltr"}function rn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Mx(e,t=globalThis==null?void 0:globalThis.document){const n=rn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Nx="DismissableLayer",ni="dismissableLayer.update",Rx="dismissableLayer.pointerDownOutside",Vx="dismissableLayer.focusOutside",el,hf=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mf=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,l=m.useContext(hf),[u,f]=m.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),y=Ve(t,k=>f(k)),p=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=p.indexOf(x),v=u?p.indexOf(u):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=v>=w,E=Ox(k=>{const j=k.target,$=[...l.branches].some(b=>b.contains(j));!C||$||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},h),T=Lx(k=>{const j=k.target;[...l.branches].some(b=>b.contains(j))||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},h);return Mx(k=>{v===l.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},h),m.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(el=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tl(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=el)}},[u,h,n,l]),m.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tl())},[u,l]),m.useEffect(()=>{const k=()=>g({});return document.addEventListener(ni,k),()=>document.removeEventListener(ni,k)},[]),d.jsx(Se.div,{...c,ref:y,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,E.onPointerDownCapture)})});mf.displayName=Nx;var Ix="DismissableLayerBranch",Dx=m.forwardRef((e,t)=>{const n=m.useContext(hf),r=m.useRef(null),s=Ve(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Se.div,{...e,ref:s})});Dx.displayName=Ix;function Ox(e,t=globalThis==null?void 0:globalThis.document){const n=rn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){pf(Rx,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Lx(e,t=globalThis==null?void 0:globalThis.document){const n=rn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&pf(Vx,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tl(){const e=new CustomEvent(ni);document.dispatchEvent(e)}function pf(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xx(s,o):s.dispatchEvent(o)}var lo=0;function $x(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nl()),document.body.insertAdjacentElement("beforeend",e[1]??nl()),lo++,()=>{lo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lo--}},[])}function nl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var uo="focusScope.autoFocusOnMount",fo="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},Fx="FocusScope",gf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=m.useState(null),l=rn(s),u=rn(o),f=m.useRef(null),h=Ve(t,p=>c(p)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let p=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:Vt(f.current,{select:!0})},x=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||Vt(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Vt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",x);const v=new MutationObserver(w);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",x),v.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){ol.add(g);const p=document.activeElement;if(!a.contains(p)){const w=new CustomEvent(uo,rl);a.addEventListener(uo,l),a.dispatchEvent(w),w.defaultPrevented||(_x(Wx(yf(a)),{select:!0}),document.activeElement===p&&Vt(a))}return()=>{a.removeEventListener(uo,l),setTimeout(()=>{const w=new CustomEvent(fo,rl);a.addEventListener(fo,u),a.dispatchEvent(w),w.defaultPrevented||Vt(p??document.body,{select:!0}),a.removeEventListener(fo,u),ol.remove(g)},0)}}},[a,l,u,g]);const y=m.useCallback(p=>{if(!n&&!r||g.paused)return;const x=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,w=document.activeElement;if(x&&w){const v=p.currentTarget,[S,C]=Bx(v);S&&C?!p.shiftKey&&w===C?(p.preventDefault(),n&&Vt(S,{select:!0})):p.shiftKey&&w===S&&(p.preventDefault(),n&&Vt(C,{select:!0})):w===v&&p.preventDefault()}},[n,r,g.paused]);return d.jsx(Se.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});gf.displayName=Fx;function _x(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vt(r,{select:t}),document.activeElement!==n)return}function Bx(e){const t=yf(e),n=sl(t,e),r=sl(t.reverse(),e);return[n,r]}function yf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function sl(e,t){for(const n of e)if(!Hx(n,{upTo:t}))return n}function Hx(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function zx(e){return e instanceof HTMLInputElement&&"select"in e}function Vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zx(e)&&t&&e.select()}}var ol=Ux();function Ux(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=il(e,t),e.unshift(t)},remove(t){var n;e=il(e,t),(n=e[0])==null||n.resume()}}}function il(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wx(e){return e.filter(t=>t.tagName!=="A")}var Zx=m[" useId ".trim().toString()]||(()=>{}),Kx=0;function oa(e){const[t,n]=m.useState(Zx());return Be(()=>{n(r=>r??String(Kx++))},[e]),e||(t?`radix-${t}`:"")}const Gx=["top","right","bottom","left"],Lt=Math.min,ze=Math.max,as=Math.round,Lr=Math.floor,pt=e=>({x:e,y:e}),Yx={left:"right",right:"left",bottom:"top",top:"bottom"},qx={start:"end",end:"start"};function ri(e,t,n){return ze(e,Lt(t,n))}function Tt(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Hn(e){return e.split("-")[1]}function ia(e){return e==="x"?"y":"x"}function aa(e){return e==="y"?"height":"width"}const Xx=new Set(["top","bottom"]);function ft(e){return Xx.has(jt(e))?"y":"x"}function ca(e){return ia(ft(e))}function Jx(e,t,n){n===void 0&&(n=!1);const r=Hn(e),s=ca(e),o=aa(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=cs(i)),[i,cs(i)]}function Qx(e){const t=cs(e);return[si(e),t,si(t)]}function si(e){return e.replace(/start|end/g,t=>qx[t])}const al=["left","right"],cl=["right","left"],eb=["top","bottom"],tb=["bottom","top"];function nb(e,t,n){switch(e){case"top":case"bottom":return n?t?cl:al:t?al:cl;case"left":case"right":return t?eb:tb;default:return[]}}function rb(e,t,n,r){const s=Hn(e);let o=nb(jt(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(si)))),o}function cs(e){return e.replace(/left|right|bottom|top/g,t=>Yx[t])}function sb(e){return{top:0,right:0,bottom:0,left:0,...e}}function xf(e){return typeof e!="number"?sb(e):{top:e,right:e,bottom:e,left:e}}function ls(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ll(e,t,n){let{reference:r,floating:s}=e;const o=ft(t),i=ca(t),a=aa(i),c=jt(t),l=o==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[a]/2-s[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Hn(t)){case"start":g[i]-=h*(n&&l?-1:1);break;case"end":g[i]+=h*(n&&l?-1:1);break}return g}const ob=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=ll(l,r,c),h=r,g={},y=0;for(let p=0;p<a.length;p++){const{name:x,fn:w}=a[p],{x:v,y:S,data:C,reset:E}=await w({x:u,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:g,rects:l,platform:i,elements:{reference:e,floating:t}});u=v??u,f=S??f,g={...g,[x]:{...g[x],...C}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(l=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:f}=ll(l,h,c)),p=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:g}};async function hr(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Tt(t,e),y=xf(g),x=a[h?f==="floating"?"reference":"floating":f],w=ls(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),C=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},E=ls(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:S,strategy:c}):v);return{top:(w.top-E.top+y.top)/C.y,bottom:(E.bottom-w.bottom+y.bottom)/C.y,left:(w.left-E.left+y.left)/C.x,right:(E.right-w.right+y.right)/C.x}}const ib=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Tt(e,t)||{};if(l==null)return{};const f=xf(u),h={x:n,y:r},g=ca(s),y=aa(g),p=await i.getDimensions(l),x=g==="y",w=x?"top":"left",v=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=o.reference[y]+o.reference[g]-h[g]-o.floating[y],E=h[g]-o.reference[g],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=T?T[S]:0;(!k||!await(i.isElement==null?void 0:i.isElement(T)))&&(k=a.floating[S]||o.floating[y]);const j=C/2-E/2,$=k/2-p[y]/2-1,b=Lt(f[w],$),I=Lt(f[v],$),L=b,Z=k-p[y]-I,K=k/2-p[y]/2+j,q=ri(L,K,Z),G=!c.arrow&&Hn(s)!=null&&K!==q&&o.reference[y]/2-(K<L?b:I)-p[y]/2<0,z=G?K<L?K-L:K-Z:0;return{[g]:h[g]+z,data:{[g]:q,centerOffset:K-q-z,...G&&{alignmentOffset:z}},reset:G}}}),ab=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...x}=Tt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=jt(s),v=ft(a),S=jt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),E=h||(S||!p?[cs(a)]:Qx(a)),T=y!=="none";!h&&T&&E.push(...rb(a,p,y,C));const k=[a,...E],j=await hr(t,x),$=[];let b=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&$.push(j[w]),f){const K=Jx(s,i,C);$.push(j[K[0]],j[K[1]])}if(b=[...b,{placement:s,overflows:$}],!$.every(K=>K<=0)){var I,L;const K=(((I=o.flip)==null?void 0:I.index)||0)+1,q=k[K];if(q&&(!(f==="alignment"?v!==ft(q):!1)||b.every(P=>P.overflows[0]>0&&ft(P.placement)===v)))return{data:{index:K,overflows:b},reset:{placement:q}};let G=(L=b.filter(z=>z.overflows[0]<=0).sort((z,P)=>z.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(g){case"bestFit":{var Z;const z=(Z=b.filter(P=>{if(T){const Y=ft(P.placement);return Y===v||Y==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(Y=>Y>0).reduce((Y,R)=>Y+R,0)]).sort((P,Y)=>P[1]-Y[1])[0])==null?void 0:Z[0];z&&(G=z);break}case"initialPlacement":G=a;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function dl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ul(e){return Gx.some(t=>e[t]>=0)}const cb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Tt(e,t);switch(r){case"referenceHidden":{const o=await hr(t,{...s,elementContext:"reference"}),i=dl(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ul(i)}}}case"escaped":{const o=await hr(t,{...s,altBoundary:!0}),i=dl(o,n.floating);return{data:{escapedOffsets:i,escaped:ul(i)}}}default:return{}}}}},bf=new Set(["left","top"]);async function lb(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=jt(n),a=Hn(n),c=ft(n)==="y",l=bf.has(i)?-1:1,u=o&&c?-1:1,f=Tt(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const db=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await lb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},ub=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:w,y:v}=x;return{x:w,y:v}}},...c}=Tt(e,t),l={x:n,y:r},u=await hr(t,c),f=ft(jt(s)),h=ia(f);let g=l[h],y=l[f];if(o){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",v=g+u[x],S=g-u[w];g=ri(v,g,S)}if(i){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=y+u[x],S=y-u[w];y=ri(v,y,S)}const p=a.fn({...t,[h]:g,[f]:y});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[f]:i}}}}}},fb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Tt(e,t),u={x:n,y:r},f=ft(s),h=ia(f);let g=u[h],y=u[f];const p=Tt(a,t),x=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const S=h==="y"?"height":"width",C=o.reference[h]-o.floating[S]+x.mainAxis,E=o.reference[h]+o.reference[S]-x.mainAxis;g<C?g=C:g>E&&(g=E)}if(l){var w,v;const S=h==="y"?"width":"height",C=bf.has(jt(s)),E=o.reference[f]-o.floating[S]+(C&&((w=i.offset)==null?void 0:w[f])||0)+(C?0:x.crossAxis),T=o.reference[f]+o.reference[S]+(C?0:((v=i.offset)==null?void 0:v[f])||0)-(C?x.crossAxis:0);y<E?y=E:y>T&&(y=T)}return{[h]:g,[f]:y}}}},hb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Tt(e,t),u=await hr(t,l),f=jt(s),h=Hn(s),g=ft(s)==="y",{width:y,height:p}=o.floating;let x,w;f==="top"||f==="bottom"?(x=f,w=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,x=h==="end"?"top":"bottom");const v=p-u.top-u.bottom,S=y-u.left-u.right,C=Lt(p-u[x],v),E=Lt(y-u[w],S),T=!t.middlewareData.shift;let k=C,j=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=v),T&&!h){const b=ze(u.left,0),I=ze(u.right,0),L=ze(u.top,0),Z=ze(u.bottom,0);g?j=y-2*(b!==0||I!==0?b+I:ze(u.left,u.right)):k=p-2*(L!==0||Z!==0?L+Z:ze(u.top,u.bottom))}await c({...t,availableWidth:j,availableHeight:k});const $=await i.getDimensions(a.floating);return y!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}};function vs(){return typeof window<"u"}function zn(e){return vf(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xt(e){var t;return(t=(vf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vf(e){return vs()?e instanceof Node||e instanceof We(e).Node:!1}function st(e){return vs()?e instanceof Element||e instanceof We(e).Element:!1}function yt(e){return vs()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function fl(e){return!vs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}const mb=new Set(["inline","contents"]);function Cr(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!mb.has(s)}const pb=new Set(["table","td","th"]);function gb(e){return pb.has(zn(e))}const yb=[":popover-open",":modal"];function ws(e){return yb.some(t=>{try{return e.matches(t)}catch{return!1}})}const xb=["transform","translate","scale","rotate","perspective"],bb=["transform","translate","scale","rotate","perspective","filter"],vb=["paint","layout","strict","content"];function la(e){const t=da(),n=st(e)?ot(e):e;return xb.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bb.some(r=>(n.willChange||"").includes(r))||vb.some(r=>(n.contain||"").includes(r))}function wb(e){let t=$t(e);for(;yt(t)&&!Rn(t);){if(la(t))return t;if(ws(t))return null;t=$t(t)}return null}function da(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Sb=new Set(["html","body","#document"]);function Rn(e){return Sb.has(zn(e))}function ot(e){return We(e).getComputedStyle(e)}function Ss(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $t(e){if(zn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fl(e)&&e.host||xt(e);return fl(t)?t.host:t}function wf(e){const t=$t(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:yt(t)&&Cr(t)?t:wf(t)}function mr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=wf(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=We(s);if(o){const a=oi(i);return t.concat(i,i.visualViewport||[],Cr(s)?s:[],a&&n?mr(a):[])}return t.concat(s,mr(s,[],n))}function oi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sf(e){const t=ot(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=yt(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=as(n)!==o||as(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function ua(e){return st(e)?e:e.contextElement}function An(e){const t=ua(e);if(!yt(t))return pt(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Sf(t);let i=(o?as(n.width):n.width)/r,a=(o?as(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Cb=pt(0);function Cf(e){const t=We(e);return!da()||!t.visualViewport?Cb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function sn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=ua(e);let i=pt(1);t&&(r?st(r)&&(i=An(r)):i=An(e));const a=kb(o,n,r)?Cf(o):pt(0);let c=(s.left+a.x)/i.x,l=(s.top+a.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o){const h=We(o),g=r&&st(r)?We(r):r;let y=h,p=oi(y);for(;p&&r&&g!==y;){const x=An(p),w=p.getBoundingClientRect(),v=ot(p),S=w.left+(p.clientLeft+parseFloat(v.paddingLeft))*x.x,C=w.top+(p.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,l*=x.y,u*=x.x,f*=x.y,c+=S,l+=C,y=We(p),p=oi(y)}}return ls({width:u,height:f,x:c,y:l})}function fa(e,t){const n=Ss(e).scrollLeft;return t?t.left+n:sn(xt(e)).left+n}function kf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:fa(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function Eb(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=xt(r),a=t?ws(t.floating):!1;if(r===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=pt(1);const u=pt(0),f=yt(r);if((f||!f&&!o)&&((zn(r)!=="body"||Cr(i))&&(c=Ss(r)),yt(r))){const g=sn(r);l=An(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=i&&!f&&!o?kf(i,c,!0):pt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function Ab(e){return Array.from(e.getClientRects())}function Tb(e){const t=xt(e),n=Ss(e),r=e.ownerDocument.body,s=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+fa(e);const a=-n.scrollTop;return ot(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}function jb(e,t){const n=We(e),r=xt(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const l=da();(!l||l&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:o,height:i,x:a,y:c}}const Pb=new Set(["absolute","fixed"]);function Mb(e,t){const n=sn(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=yt(e)?An(e):pt(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,l=r*o.y;return{width:i,height:a,x:c,y:l}}function hl(e,t,n){let r;if(t==="viewport")r=jb(e,n);else if(t==="document")r=Tb(xt(e));else if(st(t))r=Mb(t,n);else{const s=Cf(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ls(r)}function Ef(e,t){const n=$t(e);return n===t||!st(n)||Rn(n)?!1:ot(n).position==="fixed"||Ef(n,t)}function Nb(e,t){const n=t.get(e);if(n)return n;let r=mr(e,[],!1).filter(a=>st(a)&&zn(a)!=="body"),s=null;const o=ot(e).position==="fixed";let i=o?$t(e):e;for(;st(i)&&!Rn(i);){const a=ot(i),c=la(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&Pb.has(s.position)||Cr(i)&&!c&&Ef(e,i))?r=r.filter(u=>u!==i):s=a,i=$t(i)}return t.set(e,r),r}function Rb(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?ws(t)?[]:Nb(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const f=hl(t,u,s);return l.top=ze(f.top,l.top),l.right=Lt(f.right,l.right),l.bottom=Lt(f.bottom,l.bottom),l.left=ze(f.left,l.left),l},hl(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Vb(e){const{width:t,height:n}=Sf(e);return{width:t,height:n}}function Ib(e,t,n){const r=yt(t),s=xt(t),o=n==="fixed",i=sn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=pt(0);function l(){c.x=fa(s)}if(r||!r&&!o)if((zn(t)!=="body"||Cr(s))&&(a=Ss(t)),r){const g=sn(t,!0,o,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&l();o&&!r&&s&&l();const u=s&&!r&&!o?kf(s,a):pt(0),f=i.left+a.scrollLeft-c.x-u.x,h=i.top+a.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function ho(e){return ot(e).position==="static"}function ml(e,t){if(!yt(e)||ot(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xt(e)===n&&(n=n.ownerDocument.body),n}function Af(e,t){const n=We(e);if(ws(e))return n;if(!yt(e)){let s=$t(e);for(;s&&!Rn(s);){if(st(s)&&!ho(s))return s;s=$t(s)}return n}let r=ml(e,t);for(;r&&gb(r)&&ho(r);)r=ml(r,t);return r&&Rn(r)&&ho(r)&&!la(r)?n:r||wb(e)||n}const Db=async function(e){const t=this.getOffsetParent||Af,n=this.getDimensions,r=await n(e.floating);return{reference:Ib(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ob(e){return ot(e).direction==="rtl"}const Lb={convertOffsetParentRelativeRectToViewportRelativeRect:Eb,getDocumentElement:xt,getClippingRect:Rb,getOffsetParent:Af,getElementRects:Db,getClientRects:Ab,getDimensions:Vb,getScale:An,isElement:st,isRTL:Ob};function Tf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $b(e,t){let n=null,r;const s=xt(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=l;if(a||t(),!h||!g)return;const y=Lr(f),p=Lr(s.clientWidth-(u+h)),x=Lr(s.clientHeight-(f+g)),w=Lr(u),S={rootMargin:-y+"px "+-p+"px "+-x+"px "+-w+"px",threshold:ze(0,Lt(1,c))||1};let C=!0;function E(T){const k=T[0].intersectionRatio;if(k!==c){if(!C)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Tf(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return i(!0),o}function Fb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ua(e),u=s||o?[...l?mr(l):[],...mr(t)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=l&&a?$b(l,n):null;let h=-1,g=null;i&&(g=new ResizeObserver(w=>{let[v]=w;v&&v.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let y,p=c?sn(e):null;c&&x();function x(){const w=sn(e);p&&!Tf(p,w)&&n(),p=w,y=requestAnimationFrame(x)}return n(),()=>{var w;u.forEach(v=>{s&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),f==null||f(),(w=g)==null||w.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const _b=db,Bb=ub,Hb=ab,zb=hb,Ub=cb,pl=ib,Wb=fb,Zb=(e,t,n)=>{const r=new Map,s={platform:Lb,...n},o={...s.platform,_c:r};return ob(e,t,{...s,platform:o})};var Kb=typeof document<"u",Gb=function(){},Yr=Kb?A.useLayoutEffect:Gb;function ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ds(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!ds(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gl(e,t){const n=jf(e);return Math.round(t*n)/n}function mo(e){const t=m.useRef(e);return Yr(()=>{t.current=e}),t}function Yb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=m.useState(r);ds(h,r)||g(r);const[y,p]=m.useState(null),[x,w]=m.useState(null),v=m.useCallback(P=>{P!==T.current&&(T.current=P,p(P))},[]),S=m.useCallback(P=>{P!==k.current&&(k.current=P,w(P))},[]),C=o||y,E=i||x,T=m.useRef(null),k=m.useRef(null),j=m.useRef(u),$=c!=null,b=mo(c),I=mo(s),L=mo(l),Z=m.useCallback(()=>{if(!T.current||!k.current)return;const P={placement:t,strategy:n,middleware:h};I.current&&(P.platform=I.current),Zb(T.current,k.current,P).then(Y=>{const R={...Y,isPositioned:L.current!==!1};K.current&&!ds(j.current,R)&&(j.current=R,It.flushSync(()=>{f(R)}))})},[h,t,n,I,L]);Yr(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const K=m.useRef(!1);Yr(()=>(K.current=!0,()=>{K.current=!1}),[]),Yr(()=>{if(C&&(T.current=C),E&&(k.current=E),C&&E){if(b.current)return b.current(C,E,Z);Z()}},[C,E,Z,b,$]);const q=m.useMemo(()=>({reference:T,floating:k,setReference:v,setFloating:S}),[v,S]),G=m.useMemo(()=>({reference:C,floating:E}),[C,E]),z=m.useMemo(()=>{const P={position:n,left:0,top:0};if(!G.floating)return P;const Y=gl(G.floating,u.x),R=gl(G.floating,u.y);return a?{...P,transform:"translate("+Y+"px, "+R+"px)",...jf(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:R}},[n,a,G.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:Z,refs:q,elements:G,floatingStyles:z}),[u,Z,q,G,z])}const qb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?pl({element:r.current,padding:s}).fn(n):{}:r?pl({element:r,padding:s}).fn(n):{}}}},Xb=(e,t)=>({..._b(e),options:[e,t]}),Jb=(e,t)=>({...Bb(e),options:[e,t]}),Qb=(e,t)=>({...Wb(e),options:[e,t]}),ev=(e,t)=>({...Hb(e),options:[e,t]}),tv=(e,t)=>({...zb(e),options:[e,t]}),nv=(e,t)=>({...Ub(e),options:[e,t]}),rv=(e,t)=>({...qb(e),options:[e,t]});var sv="Arrow",Pf=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return d.jsx(Se.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pf.displayName=sv;var ov=Pf;function iv(e){const[t,n]=m.useState(void 0);return Be(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ha="Popper",[Mf,Nf]=sa(ha),[av,Rf]=Mf(ha),Vf=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return d.jsx(av,{scope:t,anchor:r,onAnchorChange:s,children:n})};Vf.displayName=ha;var If="PopperAnchor",Df=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=Rf(If,n),i=m.useRef(null),a=Ve(t,i);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:d.jsx(Se.div,{...s,ref:a})});Df.displayName=If;var ma="PopperContent",[cv,lv]=Mf(ma),Of=m.forwardRef((e,t)=>{var N,F,U,O,J,X;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...p}=e,x=Rf(ma,n),[w,v]=m.useState(null),S=Ve(t,se=>v(se)),[C,E]=m.useState(null),T=iv(C),k=(T==null?void 0:T.width)??0,j=(T==null?void 0:T.height)??0,$=r+(o!=="center"?"-"+o:""),b=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(l)?l:[l],L=I.length>0,Z={padding:b,boundary:I.filter(uv),altBoundary:L},{refs:K,floatingStyles:q,placement:G,isPositioned:z,middlewareData:P}=Yb({strategy:"fixed",placement:$,whileElementsMounted:(...se)=>Fb(...se,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Xb({mainAxis:s+j,alignmentAxis:i}),c&&Jb({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Qb():void 0,...Z}),c&&ev({...Z}),tv({...Z,apply:({elements:se,rects:me,availableWidth:$e,availableHeight:at})=>{const{width:Wt,height:Zt}=me.reference,ct=se.floating.style;ct.setProperty("--radix-popper-available-width",`${$e}px`),ct.setProperty("--radix-popper-available-height",`${at}px`),ct.setProperty("--radix-popper-anchor-width",`${Wt}px`),ct.setProperty("--radix-popper-anchor-height",`${Zt}px`)}}),C&&rv({element:C,padding:a}),fv({arrowWidth:k,arrowHeight:j}),h&&nv({strategy:"referenceHidden",...Z})]}),[Y,R]=Ff(G),V=rn(y);Be(()=>{z&&(V==null||V())},[z,V]);const W=(N=P.arrow)==null?void 0:N.x,M=(F=P.arrow)==null?void 0:F.y,_=((U=P.arrow)==null?void 0:U.centerOffset)!==0,[H,B]=m.useState();return Be(()=>{w&&B(window.getComputedStyle(w).zIndex)},[w]),d.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:z?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(O=P.transformOrigin)==null?void 0:O.x,(J=P.transformOrigin)==null?void 0:J.y].join(" "),...((X=P.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(cv,{scope:n,placedSide:Y,onArrowChange:E,arrowX:W,arrowY:M,shouldHideArrow:_,children:d.jsx(Se.div,{"data-side":Y,"data-align":R,...p,ref:S,style:{...p.style,animation:z?void 0:"none"}})})})});Of.displayName=ma;var Lf="PopperArrow",dv={top:"bottom",right:"left",bottom:"top",left:"right"},$f=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=lv(Lf,r),i=dv[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(ov,{...s,ref:n,style:{...s.style,display:"block"}})})});$f.displayName=Lf;function uv(e){return e!==null}var fv=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:r,middlewareData:s}=t,i=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Ff(n),f={start:"0%",center:"50%",end:"100%"}[u],h=(((w=s.arrow)==null?void 0:w.x)??0)+a/2,g=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let y="",p="";return l==="bottom"?(y=i?f:`${h}px`,p=`${-c}px`):l==="top"?(y=i?f:`${h}px`,p=`${r.floating.height+c}px`):l==="right"?(y=`${-c}px`,p=i?f:`${g}px`):l==="left"&&(y=`${r.floating.width+c}px`,p=i?f:`${g}px`),{data:{x:y,y:p}}}});function Ff(e){const[t,n="center"]=e.split("-");return[t,n]}var hv=Vf,mv=Df,pv=Of,gv=$f,yv="Portal",_f=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=m.useState(!1);Be(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ad.createPortal(d.jsx(Se.div,{...r,ref:t}),i):null});_f.displayName=yv;function xv(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Bf=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bv="VisuallyHidden",vv=m.forwardRef((e,t)=>d.jsx(Se.span,{...e,ref:t,style:{...Bf,...e.style}}));vv.displayName=bv;var wv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},un=new WeakMap,$r=new WeakMap,Fr={},po=0,Hf=function(e){return e&&(e.host||Hf(e.parentNode))},Sv=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hf(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Cv=function(e,t,n,r){var s=Sv(t,Array.isArray(e)?e:[e]);Fr[n]||(Fr[n]=new WeakMap);var o=Fr[n],i=[],a=new Set,c=new Set(s),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};s.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var g=h.getAttribute(r),y=g!==null&&g!=="false",p=(un.get(h)||0)+1,x=(o.get(h)||0)+1;un.set(h,p),o.set(h,x),i.push(h),p===1&&y&&$r.set(h,!0),x===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return u(t),a.clear(),po++,function(){i.forEach(function(f){var h=un.get(f)-1,g=o.get(f)-1;un.set(f,h),o.set(f,g),h||($r.has(f)||f.removeAttribute(r),$r.delete(f)),g||f.removeAttribute(n)}),po--,po||(un=new WeakMap,un=new WeakMap,$r=new WeakMap,Fr={})}},kv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=wv(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Cv(r,s,n,"aria-hidden")):function(){return null}},Ev=[" ","Enter","ArrowUp","ArrowDown"],Av=[" ","Enter"],on="Select",[Cs,ks,Tv]=Tx(on),[Un,L6]=sa(on,[Tv,Nf]),Es=Nf(),[jv,Ht]=Un(on),[Pv,Mv]=Un(on),zf=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:h,required:g,form:y}=e,p=Es(t),[x,w]=m.useState(null),[v,S]=m.useState(null),[C,E]=m.useState(!1),T=Px(l),[k,j]=ti({prop:r,defaultProp:s??!1,onChange:o,caller:on}),[$,b]=ti({prop:i,defaultProp:a,onChange:c,caller:on}),I=m.useRef(null),L=x?y||!!x.closest("form"):!0,[Z,K]=m.useState(new Set),q=Array.from(Z).map(G=>G.props.value).join(";");return d.jsx(hv,{...p,children:d.jsxs(jv,{required:g,scope:t,trigger:x,onTriggerChange:w,valueNode:v,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:oa(),value:$,onValueChange:b,open:k,onOpenChange:j,dir:T,triggerPointerDownPosRef:I,disabled:h,children:[d.jsx(Cs.Provider,{scope:t,children:d.jsx(Pv,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(G=>{K(z=>new Set(z).add(G))},[]),onNativeOptionRemove:m.useCallback(G=>{K(z=>{const P=new Set(z);return P.delete(G),P})},[]),children:n})}),L?d.jsxs(uh,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:$,onChange:G=>b(G.target.value),disabled:h,form:y,children:[$===void 0?d.jsx("option",{value:""}):null,Array.from(Z)]},q):null]})})};zf.displayName=on;var Uf="SelectTrigger",Wf=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Es(n),i=Ht(Uf,n),a=i.disabled||r,c=Ve(t,i.onTriggerChange),l=ks(n),u=m.useRef("touch"),[f,h,g]=hh(p=>{const x=l().filter(S=>!S.disabled),w=x.find(S=>S.value===i.value),v=mh(x,p,w);v!==void 0&&i.onValueChange(v.value)}),y=p=>{a||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(mv,{asChild:!0,...o,children:d.jsx(Se.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":fh(i.value)?"":void 0,...s,ref:c,onClick:ke(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&y(p)}),onPointerDown:ke(s.onPointerDown,p=>{u.current=p.pointerType;const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:ke(s.onKeyDown,p=>{const x=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(x&&p.key===" ")&&Ev.includes(p.key)&&(y(),p.preventDefault())})})})});Wf.displayName=Uf;var Zf="SelectValue",Kf=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=Ht(Zf,n),{onValueNodeHasChildrenChange:l}=c,u=o!==void 0,f=Ve(t,c.onValueNodeChange);return Be(()=>{l(u)},[l,u]),d.jsx(Se.span,{...a,ref:f,style:{pointerEvents:"none"},children:fh(c.value)?d.jsx(d.Fragment,{children:i}):o})});Kf.displayName=Zf;var Nv="SelectIcon",Gf=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return d.jsx(Se.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Gf.displayName=Nv;var Rv="SelectPortal",Yf=e=>d.jsx(_f,{asChild:!0,...e});Yf.displayName=Rv;var an="SelectContent",qf=m.forwardRef((e,t)=>{const n=Ht(an,e.__scopeSelect),[r,s]=m.useState();if(Be(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?It.createPortal(d.jsx(Xf,{scope:e.__scopeSelect,children:d.jsx(Cs.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),o):null}return d.jsx(Jf,{...e,ref:t})});qf.displayName=an;var nt=10,[Xf,zt]=Un(an),Vv="SelectContentImpl",Iv=fr("SelectContent.RemoveScroll"),Jf=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:x,...w}=e,v=Ht(an,n),[S,C]=m.useState(null),[E,T]=m.useState(null),k=Ve(t,N=>C(N)),[j,$]=m.useState(null),[b,I]=m.useState(null),L=ks(n),[Z,K]=m.useState(!1),q=m.useRef(!1);m.useEffect(()=>{if(S)return kv(S)},[S]),$x();const G=m.useCallback(N=>{const[F,...U]=L().map(X=>X.ref.current),[O]=U.slice(-1),J=document.activeElement;for(const X of N)if(X===J||(X==null||X.scrollIntoView({block:"nearest"}),X===F&&E&&(E.scrollTop=0),X===O&&E&&(E.scrollTop=E.scrollHeight),X==null||X.focus(),document.activeElement!==J))return},[L,E]),z=m.useCallback(()=>G([j,S]),[G,j,S]);m.useEffect(()=>{Z&&z()},[Z,z]);const{onOpenChange:P,triggerPointerDownPosRef:Y}=v;m.useEffect(()=>{if(S){let N={x:0,y:0};const F=O=>{var J,X;N={x:Math.abs(Math.round(O.pageX)-(((J=Y.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(O.pageY)-(((X=Y.current)==null?void 0:X.y)??0))}},U=O=>{N.x<=10&&N.y<=10?O.preventDefault():S.contains(O.target)||P(!1),document.removeEventListener("pointermove",F),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",U,{capture:!0})}}},[S,P,Y]),m.useEffect(()=>{const N=()=>P(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[P]);const[R,V]=hh(N=>{const F=L().filter(J=>!J.disabled),U=F.find(J=>J.ref.current===document.activeElement),O=mh(F,N,U);O&&setTimeout(()=>O.ref.current.focus())}),W=m.useCallback((N,F,U)=>{const O=!q.current&&!U;(v.value!==void 0&&v.value===F||O)&&($(N),O&&(q.current=!0))},[v.value]),M=m.useCallback(()=>S==null?void 0:S.focus(),[S]),_=m.useCallback((N,F,U)=>{const O=!q.current&&!U;(v.value!==void 0&&v.value===F||O)&&I(N)},[v.value]),H=r==="popper"?ii:Qf,B=H===ii?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:x}:{};return d.jsx(Xf,{scope:n,content:S,viewport:E,onViewportChange:T,itemRefCallback:W,selectedItem:j,onItemLeave:M,itemTextRefCallback:_,focusSelectedItem:z,selectedItemText:b,position:r,isPositioned:Z,searchRef:R,children:d.jsx(wm.RemoveScroll,{as:Iv,allowPinchZoom:!0,children:d.jsx(gf,{asChild:!0,trapped:v.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:ke(s,N=>{var F;(F=v.trigger)==null||F.focus({preventScroll:!0}),N.preventDefault()}),children:d.jsx(mf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:d.jsx(H,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:N=>N.preventDefault(),...w,...B,onPlaced:()=>K(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ke(w.onKeyDown,N=>{const F=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!F&&N.key.length===1&&V(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let O=L().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(N.key)&&(O=O.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const J=N.target,X=O.indexOf(J);O=O.slice(X+1)}setTimeout(()=>G(O)),N.preventDefault()}})})})})})})});Jf.displayName=Vv;var Dv="SelectItemAlignedPosition",Qf=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Ht(an,n),i=zt(an,n),[a,c]=m.useState(null),[l,u]=m.useState(null),f=Ve(t,k=>u(k)),h=ks(n),g=m.useRef(!1),y=m.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:w,focusSelectedItem:v}=i,S=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&l&&p&&x&&w){const k=o.trigger.getBoundingClientRect(),j=l.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),b=w.getBoundingClientRect();if(o.dir!=="rtl"){const J=b.left-j.left,X=$.left-J,se=k.left-X,me=k.width+se,$e=Math.max(me,j.width),at=window.innerWidth-nt,Wt=Qc(X,[nt,Math.max(nt,at-$e)]);a.style.minWidth=me+"px",a.style.left=Wt+"px"}else{const J=j.right-b.right,X=window.innerWidth-$.right-J,se=window.innerWidth-k.right-X,me=k.width+se,$e=Math.max(me,j.width),at=window.innerWidth-nt,Wt=Qc(X,[nt,Math.max(nt,at-$e)]);a.style.minWidth=me+"px",a.style.right=Wt+"px"}const I=h(),L=window.innerHeight-nt*2,Z=p.scrollHeight,K=window.getComputedStyle(l),q=parseInt(K.borderTopWidth,10),G=parseInt(K.paddingTop,10),z=parseInt(K.borderBottomWidth,10),P=parseInt(K.paddingBottom,10),Y=q+G+Z+P+z,R=Math.min(x.offsetHeight*5,Y),V=window.getComputedStyle(p),W=parseInt(V.paddingTop,10),M=parseInt(V.paddingBottom,10),_=k.top+k.height/2-nt,H=L-_,B=x.offsetHeight/2,N=x.offsetTop+B,F=q+G+N,U=Y-F;if(F<=_){const J=I.length>0&&x===I[I.length-1].ref.current;a.style.bottom="0px";const X=l.clientHeight-p.offsetTop-p.offsetHeight,se=Math.max(H,B+(J?M:0)+X+z),me=F+se;a.style.height=me+"px"}else{const J=I.length>0&&x===I[0].ref.current;a.style.top="0px";const se=Math.max(_,q+p.offsetTop+(J?W:0)+B)+U;a.style.height=se+"px",p.scrollTop=F-_+p.offsetTop}a.style.margin=`${nt}px 0`,a.style.minHeight=R+"px",a.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,o.trigger,o.valueNode,a,l,p,x,w,o.dir,r]);Be(()=>S(),[S]);const[C,E]=m.useState();Be(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const T=m.useCallback(k=>{k&&y.current===!0&&(S(),v==null||v(),y.current=!1)},[S,v]);return d.jsx(Lv,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:d.jsx(Se.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Qf.displayName=Dv;var Ov="SelectPopperPosition",ii=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=nt,...o}=e,i=Es(n);return d.jsx(pv,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ii.displayName=Ov;var[Lv,pa]=Un(an,{}),ai="SelectViewport",eh=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=zt(ai,n),i=pa(ai,n),a=Ve(t,o.onViewportChange),c=m.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(Cs.Slot,{scope:n,children:d.jsx(Se.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ke(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const g=Math.abs(c.current-u.scrollTop);if(g>0){const y=window.innerHeight-nt*2,p=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),w=Math.max(p,x);if(w<y){const v=w+g,S=Math.min(y,v),C=v-S;f.style.height=S+"px",f.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});eh.displayName=ai;var th="SelectGroup",[$v,Fv]=Un(th),_v=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=oa();return d.jsx($v,{scope:n,id:s,children:d.jsx(Se.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_v.displayName=th;var nh="SelectLabel",Bv=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Fv(nh,n);return d.jsx(Se.div,{id:s.id,...r,ref:t})});Bv.displayName=nh;var us="SelectItem",[Hv,rh]=Un(us),sh=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=Ht(us,n),c=zt(us,n),l=a.value===r,[u,f]=m.useState(o??""),[h,g]=m.useState(!1),y=Ve(t,v=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,v,r,s)}),p=oa(),x=m.useRef("touch"),w=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Hv,{scope:n,value:r,disabled:s,textId:p,isSelected:l,onItemTextChange:m.useCallback(v=>{f(S=>S||((v==null?void 0:v.textContent)??"").trim())},[]),children:d.jsx(Cs.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:d.jsx(Se.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:ke(i.onFocus,()=>g(!0)),onBlur:ke(i.onBlur,()=>g(!1)),onClick:ke(i.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:ke(i.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:ke(i.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:ke(i.onPointerMove,v=>{var S;x.current=v.pointerType,s?(S=c.onItemLeave)==null||S.call(c):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(i.onPointerLeave,v=>{var S;v.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:ke(i.onKeyDown,v=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(Av.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});sh.displayName=us;var Jn="SelectItemText",oh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=Ht(Jn,n),a=zt(Jn,n),c=rh(Jn,n),l=Mv(Jn,n),[u,f]=m.useState(null),h=Ve(t,w=>f(w),c.onItemTextChange,w=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,w,c.value,c.disabled)}),g=u==null?void 0:u.textContent,y=m.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=l;return Be(()=>(p(y),()=>x(y)),[p,x,y]),d.jsxs(d.Fragment,{children:[d.jsx(Se.span,{id:c.textId,...o,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?It.createPortal(o.children,i.valueNode):null]})});oh.displayName=Jn;var ih="SelectItemIndicator",ah=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return rh(ih,n).isSelected?d.jsx(Se.span,{"aria-hidden":!0,...r,ref:t}):null});ah.displayName=ih;var ci="SelectScrollUpButton",ch=m.forwardRef((e,t)=>{const n=zt(ci,e.__scopeSelect),r=pa(ci,e.__scopeSelect),[s,o]=m.useState(!1),i=Ve(t,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;o(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(dh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});ch.displayName=ci;var li="SelectScrollDownButton",lh=m.forwardRef((e,t)=>{const n=zt(li,e.__scopeSelect),r=pa(li,e.__scopeSelect),[s,o]=m.useState(!1),i=Ve(t,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(dh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});lh.displayName=li;var dh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=zt("SelectScrollButton",n),i=m.useRef(null),a=ks(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Be(()=>{var u;const l=a().find(f=>f.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),d.jsx(Se.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ke(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ke(s.onPointerMove,()=>{var l;(l=o.onItemLeave)==null||l.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ke(s.onPointerLeave,()=>{c()})})}),zv="SelectSeparator",Uv=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Se.div,{"aria-hidden":!0,...r,ref:t})});Uv.displayName=zv;var di="SelectArrow",Wv=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Es(n),o=Ht(di,n),i=zt(di,n);return o.open&&i.position==="popper"?d.jsx(gv,{...s,...r,ref:t}):null});Wv.displayName=di;var Zv="SelectBubbleInput",uh=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),o=Ve(r,s),i=xv(t);return m.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[i,t]),d.jsx(Se.select,{...n,style:{...Bf,...n.style},ref:o,defaultValue:t})});uh.displayName=Zv;function fh(e){return e===""||e===void 0}function hh(e){const t=rn(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function mh(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=Kv(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Kv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gv=zf,Yv=Wf,qv=Kf,Xv=Gf,Jv=Yf,Qv=qf,e2=eh,t2=sh,n2=oh,r2=ah,s2=ch,o2=lh;function yl({...e}){return d.jsx(Gv,{"data-slot":"select",...e})}function xl({...e}){return d.jsx(qv,{"data-slot":"select-value",...e})}function bl({className:e,size:t="default",children:n,...r}){return d.jsxs(Yv,{"data-slot":"select-trigger","data-size":t,className:ne(["flex w-fit cursor-pointer items-center justify-between gap-2","rounded-full px-3 py-2 text-sm whitespace-nowrap","bg-button transition-[color,border,background-color]","disabled:cursor-not-allowed disabled:opacity-50","hover:bg-muted hover:text-muted-foreground","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0","data-[placeholder]:text-muted-foreground","data-[size=default]:h-9 data-[size=sm]:h-8","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&:not([class*='text-'])_svg:not([class*='text-'])]:text-muted-foreground","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...r,children:[n,d.jsx(Xv,{asChild:!0,children:d.jsx(ta,{weight:"bold",className:"size-4 transition-colors"})})]})}function vl({className:e,children:t,position:n="popper",...r}){return d.jsx(Jv,{children:d.jsxs(Qv,{"data-slot":"select-content",className:ne(["bg-[#18182a]/90 backdrop-blur-md text-white border border-[#23233a] shadow-2xl","relative z-50 overflow-x-hidden overflow-y-auto rounded-xl","max-h-(--radix-select-content-available-height) min-w-[8rem]","origin-(--radix-select-content-transform-origin)","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2","data-[side=right]:slide-in-from-left-2","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2"],n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[d.jsx(i2,{}),d.jsx(e2,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(a2,{})]})})}function wl({className:e,children:t,...n}){return d.jsxs(t2,{"data-slot":"select-item",className:ne(["relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none","cursor-pointer disabled:cursor-not-allowed","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...n,children:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(r2,{children:d.jsx(Uu,{className:"size-4",weight:"bold"})})}),d.jsx(n2,{children:t})]})}function i2({className:e,...t}){return d.jsx(s2,{"data-slot":"select-scroll-up-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Hu,{className:"size-4",weight:"bold"})})}function a2({className:e,...t}){return d.jsx(o2,{"data-slot":"select-scroll-down-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(ta,{className:"size-4",weight:"bold"})})}const Sl=ps.cva(["w-full rounded-full px-3 py-2 text-sm cursor-pointer","disabled:not-allowed hover:bg-button-hover focus:bg-button-hover"],{variants:{size:{default:"w-[180px]",sm:"w-auto"}},defaultVariants:{size:"default"}});function Cl({kind:e,track:t,requestPermissions:n,onError:r,client:s,...o}){const i=o.size||"default";if(!s)return d.jsxs(yl,{disabled:!0,children:[d.jsx(bl,{className:ne(Sl({size:i}),o.className),children:d.jsx(xl,{placeholder:`Select a ${e}`})}),d.jsx(vl,{children:d.jsx(wl,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:c,setActiveMediaDevice:l}=kx(s,e==="audioinput"?"audioinput":"videoinput");return d.jsxs(yl,{value:c,onValueChange:l,children:[d.jsx(bl,{className:ne(Sl({size:i}),o.className,"hover:bg"),children:i!=="sm"&&d.jsx(xl,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),d.jsx(vl,{children:a.map(u=>d.jsx(wl,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function c2(e,t,n=!1){if(n)return na;switch(e){case te.Track.Source.Microphone:return t?Wu:Zu;case te.Track.Source.Camera:return t?Gu:Yu;case te.Track.Source.ScreenShare:return Ku;default:return m.Fragment}}function go({source:e,pressed:t,pending:n,className:r,...s}){const o=c2(e,t??!1,n),i=e===te.Track.Source.Microphone&&!(t??!1)&&!n,a=e===te.Track.Source.Camera&&!(t??!1)&&!n;return m.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),d.jsxs(ff,{pressed:t,"aria-label":`Toggle ${e}`,className:ne(r),...s,children:[d.jsx(o,{weight:"bold",className:ne(n&&"animate-spin",i||a?"text-red-500":void 0)}),s.children]})}function l2(e){return e?wx(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function d2(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,s={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:te.Track.Source.Microphone,publication:void 0},visibleControls:s,microphoneToggle:{enabled:!1,pending:!1,toggle:async()=>{}},cameraToggle:{enabled:!1,pending:!1,toggle:async()=>{}},screenShareToggle:{enabled:!1,pending:!1,toggle:async()=>{}},handleDisconnect:()=>{},handleAudioDeviceChange:()=>{},handleVideoDeviceChange:()=>{}};const{microphoneTrack:o,localParticipant:i}=Sx(r),a=l2(r);Cx(r);const c=co(r,"microphone",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.Microphone,error:T})}}),l=co(r,"camera",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.Camera,error:T})}}),u=co(r,"screenShare",{onDeviceError:T=>{var k;return(k=e.onDeviceError)==null?void 0:k.call(e,{source:te.Track.Source.ScreenShare,error:T})}}),f=m.useMemo(()=>{let T;if(i){for(const[,k]of i.trackPublications)if(k.source===te.Track.Source.Microphone){T=k;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!T,isTrackSubscribed:T==null?void 0:T.isSubscribed,isMuted:T==null?void 0:T.isMuted,trackSid:T==null?void 0:T.trackSid}),{participant:i??void 0,source:te.Track.Source.Microphone,publication:T}},[i,o]);s.microphone??(s.microphone=a.microphone),s.screenShare??(s.screenShare=a.screenShare),s.camera??(s.camera=a.camera),s.chat??(s.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:g,saveVideoInputEnabled:y,saveVideoInputDeviceId:p}=Ex({preventSave:!n}),x=m.useCallback(()=>{r&&r.disconnect()},[r]),w=m.useCallback(T=>{g(T??"default"),r&&r.setAudioInputDevice(T)},[g,r]),v=m.useCallback(T=>{p(T??"default"),r&&r.setVideoInputDevice(T)},[p,r]),S=m.useCallback(async T=>{u.enabled&&await u.toggle(!1),await l.toggle(T),y(!l.enabled)},[l,y,u]),C=m.useCallback(async T=>{await c.toggle(T),h(!c.enabled)},[c,h]),E=m.useCallback(async T=>{l.enabled&&await l.toggle(!1),await u.toggle(T)},[l,u]);return{micTrackRef:f,visibleControls:s,cameraToggle:{...l,toggle:S},microphoneToggle:{...c,toggle:C},screenShareToggle:{...u,toggle:E},handleDisconnect:x,handleAudioDeviceChange:w,handleVideoDeviceChange:v}}const u2={card:" bg-gradient-to-br from-black to-gray-900 border border-gray-900 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-black/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-gray-800/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-gray-600/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-gray-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-gray-400 to-gray-500 rounded-full blur-sm opacity-20 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-gray-500 to-gray-600 rounded-full blur-sm opacity-15 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-black to-gray-900 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-white via-gray-200 to-gray-300"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900",promptSlider:"absolute w-full py-3 px-2 bg-gray-900 rounded-xl text-center text-white text-sm transition-opacity duration-700 ease-in-out border border-gray-600",statusIndicator:"w-2 h-2 bg-gray-400 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-gray-400/15 pulse-ring"},controlBar:"border border-gray-600 rounded-3xl py-4 flex flex-col justify-end h-full bg-gray-900/50 backdrop-blur-sm",chatInput:{container:"bg-gray-900 w-full border-gray-600",textarea:"bg-gray-800 border-none text-white placeholder-gray-400",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-gray-600 text-white",other:"bg-gray-700 text-white"},chatHeader:{container:"bg-gray-900 border-gray-600",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white"},video:{container:"bg-gradient-to-br from-black to-gray-900 text-white",header:"border-gray-700 bg-gray-900/50",headerButton:"bg-gray-800 hover:bg-gray-700 text-gray-300",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-gray-900/80 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-gray-800 border border-gray-700 shadow-lg",placeholder:"bg-gray-800 text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},f2={card:" bg-gradient-to-br from-white to-gray-50 border border-gray-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-white/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-500/5 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-500/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-pink-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-500 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-pink-500 to-purple-500 rounded-full blur-sm opacity-20 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-white to-gray-50 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-gray-900",secondary:"text-gray-700",muted:"text-gray-500",accent:"bg-clip-text text-transparent bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-white",promptSlider:"absolute w-full py-3 px-2 bg-gray-100 rounded-xl text-center text-gray-700 text-sm transition-opacity duration-700 ease-in-out border border-gray-200",statusIndicator:"w-2 h-2 bg-green-500 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-pink-500/10 pulse-ring"},controlBar:"border border-gray-200 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-sm",chatInput:{container:"bg-white/90 border-gray-200 shadow-sm",textarea:"bg-white border-none text-gray-900 placeholder-gray-500 ",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 disabled:opacity-50 text-white",attachButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100 bg-blue-50",endButton:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200"},chatMessage:{own:"bg-blue-50 text-gray-900 border border-blue-100",other:"bg-gray-50 text-gray-900 border border-gray-200"},chatHeader:{container:"bg-white border-gray-200",backButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900"},video:{container:"bg-gradient-to-br from-white to-gray-50 text-gray-900",header:"border-gray-200 bg-white/80",headerButton:"bg-gray-100 hover:bg-gray-200 text-gray-600",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-white/90 backdrop-blur-sm border-t border-gray-200",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-200 hover:bg-gray-300 text-gray-600",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-white border border-gray-200 shadow-sm",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-gray-200 text-gray-600",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},h2={card:" text-white bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-[#3B82F6] via-[#8B5CF6] to-[#EC4899]"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},kl={dark:u2,light:f2,vox:h2};function Ie(e){return kl[e]||kl.vox}function m2({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:s,onChatOpenChange:o,onDisconnect:i,onDeviceError:a,theme:c="vox",client:l,...u}){const[f,h]=m.useState(!1),[g,y]=m.useState(!1),p=Ie(c),{micTrackRef:x,visibleControls:w,cameraToggle:v,microphoneToggle:S,screenShareToggle:C,handleAudioDeviceChange:E,handleVideoDeviceChange:T,handleDisconnect:k}=d2({controls:e,saveUserChoices:t,client:l}),j=async $=>{y(!0);try{await(s==null?void 0:s($))}finally{y(!1)}};return m.useEffect(()=>{o==null||o(f)},[f,o]),m.useEffect(()=>{var $,b,I,L;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!x.participant,hasPublication:!!x.publication,source:x.source,isSubscribed:($=x.publication)==null?void 0:$.isSubscribed,isMuted:(b=x.publication)==null?void 0:b.isMuted,trackSid:(I=x.publication)==null?void 0:I.trackSid,hasTrack:!!((L=x.publication)!=null&&L.track)})},[x]),d.jsxs("div",{"aria-label":"Voice assistant controls",className:ne(p.controlBar,r),...u,children:[n.suportsChatInput&&d.jsxs("div",{inert:!f,className:ne("overflow-hidden transition-[height] relative duration-300 ease-in-out",f?"h-[64px] mb-3":"h-0"),children:[d.jsx("div",{className:"flex h-9 px-4 w-full",children:d.jsx(hx,{onSend:j,disabled:g,className:ne("w-full",p.chatInput)})}),d.jsx("hr",{className:"border-border my-2 mx-5"})]}),d.jsxs("div",{className:ne("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-2",c==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[d.jsxs("div",{className:"flex gap-y-2 justify-start",children:[w.microphone&&d.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[d.jsx(go,{variant:"primary",source:te.Track.Source.Microphone,pressed:S.enabled,disabled:S.pending,onPressedChange:S.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),d.jsx(Ee.BarVisualizer,{barCount:3,trackRef:x,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:d.jsx("span",{className:ne(["h-full w-0.5 origin-center rounded-2xl","bg-white","group-data-[state=on]/track:bg-white group-data-[state=off]/track:bg-white","data-lk-muted:bg-muted"])})}),d.jsx(Cl,{size:"sm",kind:"audioinput",client:l,onError:a?$=>$ instanceof Error?a({source:te.Track.Source.Microphone,error:$}):void 0:void 0,onActiveDeviceChange:E,className:ne(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&w.camera&&d.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[d.jsx(go,{variant:"primary",source:te.Track.Source.Camera,pressed:v.enabled,pending:v.pending,disabled:v.pending,onPressedChange:v.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),d.jsx(Cl,{size:"sm",kind:"videoinput",client:l,onError:a?$=>$ instanceof Error?a({source:te.Track.Source.Camera,error:$}):void 0:void 0,onActiveDeviceChange:T,className:ne(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&w.screenShare&&d.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:d.jsx(go,{variant:"secondary",source:te.Track.Source.ScreenShare,pressed:C.enabled,disabled:C.pending,onPressedChange:C.toggle,className:"w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),w.chat&&d.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:d.jsx(ff,{variant:"secondary","aria-label":"Toggle chat",pressed:f,onPressedChange:$=>{h($)},className:"aspect-square h-full py-3 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:d.jsx(zu,{weight:"bold",className:"h-5 w-5"})})})]})]})}const p2=(e,t)=>{var a,c;const n=m.useMemo(()=>t?t(e.message):e.message,[e.message,t]),r=!!e.editTimestamp,s=new Date(e.timestamp),o=typeof navigator<"u"?navigator.language:"en-US",i=(a=e.from)!=null&&a.name&&e.from.name!==""?e.from.name:(c=e.from)==null?void 0:c.identity;return{message:n,hasBeenEdited:r,time:s,locale:o,name:i}},g2=({entry:e,messageFormatter:t,className:n,participantName:r,...s})=>{var u,f;const{message:o,time:i,locale:a}=p2(e,t),c=((u=e.from)==null?void 0:u.isLocal)??!1;ne("w-full px-3 py-2 rounded-2xl text-xs break-words whitespace-pre-line",c?" text-end border border-[#5078F2]/30":"bg-muted text-foreground border border-[#813aa7]/30","text-left");const l=ne("inline-flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold flex-shrink-0",c?"bg-[#5078F2] text-white":"bg-[#813aa7] ml-1 text-white");return d.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:ne("group flex mb-2",c?"justify-end":"justify-start",n),...s,children:d.jsxs("div",{className:ne("flex w-fit max-w-full rounded-2xl border",c?"flex-row-reverse items-center border-[#5078F2]/30":"flex-row items-center border-[#813aa7]/30 bg-muted text-foreground"),children:[d.jsx("span",{className:l,children:c?((f=r==null?void 0:r[0])==null?void 0:f.toUpperCase())||"U":"A"}),d.jsx("span",{className:ne("flex items-center text-xs break-words whitespace-pre-line",c?"ml-auto justify-end text-right":"justify-start text-left","px-3 py-2"),children:o})]})})};function y2(e){A.useEffect(()=>{function t(){const n=e.current;n&&(n.scrollTop=n.scrollHeight)}if(e.current){const n=new ResizeObserver(t);return n.observe(e.current),t(),()=>n.disconnect()}},[e])}const x2=({className:e,children:t,...n})=>{const r=A.useRef(null);return y2(r),d.jsx("div",{ref:r,className:ne("flex flex-col justify-end",e),...n,children:t})},b2=({state:e,audioTrack:t,className:n,ref:r})=>d.jsx("div",{ref:r,className:ne("",n),children:d.jsx(Ee.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:ne("flex aspect-video w-40 items-center justify-center gap-1"),children:d.jsx("span",{className:ne(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-[#5c64f6]","data-[lk-muted=true]:bg-[#222222]"])})})}),v2=({videoTrack:e,className:t,ref:n})=>{var r,s;return d.jsx("div",{ref:n,className:ne(t),children:d.jsx(Ee.VideoTrack,{trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.height)??0,className:"rounded-md"})})},w2=ae.create(Ee.VideoTrack),S2=({trackRef:e,className:t,ref:n})=>{var r,s;return d.jsx("div",{className:ne("bg-muted overflow-hidden rounded-md",t),children:d.jsx(w2,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.height)??0,className:ne("h-full w-auto")})})},El=ae.create(S2),C2=ae.create(b2),k2=ae.create(v2),wt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},fn={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2 row-span-3","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function E2(e){const{localParticipant:t}=Ee.useLocalParticipant(),n=t.getTrackPublication(e);return A.useMemo(()=>n?{source:e,participant:t,publication:n}:void 0,[e,n,t])}function A2({chatOpen:e}){const{state:t,audioTrack:n,videoTrack:r,agent:{isActive:s=!1}={}}=Ee.useVoiceAssistant(),[o]=Ee.useTracks([te.Track.Source.ScreenShare]),i=E2(te.Track.Source.Camera),a=i&&!i.publication.isMuted,c=o&&!o.publication.isMuted,l=a||c,u={...wt.transition,delay:e?0:.15},f={...wt.animate,scale:e?1:3,transition:u},h={...wt.animate,transition:u},g=u,y=u,p=r!==void 0;return d.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:d.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:d.jsxs("div",{className:ne(fn.grid),children:[s&&d.jsx("div",{className:ne(["grid",!e&&fn.agentChatClosed,e&&l&&fn.agentChatOpenWithSecondTile,e&&!l&&fn.agentChatOpenWithoutSecondTile]),children:d.jsxs("div",{className:"h-full flex items-center justify-center",children:[!p&&d.jsx(C2,{layoutId:"agent",...wt,animate:f,transition:g,state:t,audioTrack:n,className:ne(e?"h-[90px]":"h-auto w-full")},"agent"),p&&d.jsx(k2,{layoutId:"avatar",...wt,animate:h,transition:y,videoTrack:r,className:ne(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),d.jsx("div",{className:ne(["grid",e&&fn.secondTileChatOpen,!e&&fn.secondTileChatClosed]),children:d.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[i&&a&&d.jsx(El,{layout:"position",layoutId:"camera",...wt,trackRef:i,transition:{...wt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),c&&d.jsx(El,{layout:"position",layoutId:"screen",...wt,trackRef:o,transition:{...wt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}/**
50
10
  * @license lucide-react v0.522.0 - ISC
51
11
  *
52
12
  * This source code is licensed under the ISC license.
53
13
  * See the LICENSE file in the root directory of this source tree.
54
- */const Gw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qw=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Jl=e=>{const t=qw(e);return t.charAt(0).toUpperCase()+t.slice(1)},tm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Xw=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
14
+ */const T2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Al=e=>{const t=j2(e);return t.charAt(0).toUpperCase()+t.slice(1)},ph=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),P2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
55
15
  * @license lucide-react v0.522.0 - ISC
56
16
  *
57
17
  * This source code is licensed under the ISC license.
58
18
  * See the LICENSE file in the root directory of this source tree.
59
- */var Jw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
19
+ */var M2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
60
20
  * @license lucide-react v0.522.0 - ISC
61
21
  *
62
22
  * This source code is licensed under the ISC license.
63
23
  * See the LICENSE file in the root directory of this source tree.
64
- */const Qw=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>A.createElement("svg",{ref:c,...Jw,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tm("lucide",s),...!o&&!Xw(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>A.createElement(l,u)),...Array.isArray(o)?o:[o]]));/**
24
+ */const N2=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>A.createElement("svg",{ref:c,...M2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ph("lucide",s),...!o&&!P2(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>A.createElement(l,u)),...Array.isArray(o)?o:[o]]));/**
65
25
  * @license lucide-react v0.522.0 - ISC
66
26
  *
67
27
  * This source code is licensed under the ISC license.
68
28
  * See the LICENSE file in the root directory of this source tree.
69
- */const Fe=(e,t)=>{const n=A.forwardRef(({className:r,...s},o)=>A.createElement(Qw,{ref:o,iconNode:t,className:tm(`lucide-${Gw(Jl(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Jl(e),n};/**
29
+ */const De=(e,t)=>{const n=A.forwardRef(({className:r,...s},o)=>A.createElement(N2,{ref:o,iconNode:t,className:ph(`lucide-${T2(Al(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Al(e),n};/**
70
30
  * @license lucide-react v0.522.0 - ISC
71
31
  *
72
32
  * This source code is licensed under the ISC license.
73
33
  * See the LICENSE file in the root directory of this source tree.
74
- */const eS=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],tS=Fe("archive",eS);/**
34
+ */const R2=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],V2=De("archive",R2);/**
75
35
  * @license lucide-react v0.522.0 - ISC
76
36
  *
77
37
  * This source code is licensed under the ISC license.
78
38
  * See the LICENSE file in the root directory of this source tree.
79
- */const nS=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16",key:"qmtpty"}],["path",{d:"M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5",key:"1ufyfc"}],["path",{d:"M14.121 15.121A3 3 0 1 1 9.88 10.88",key:"11zox6"}]],nm=Fe("camera-off",nS);/**
39
+ */const I2=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16",key:"qmtpty"}],["path",{d:"M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5",key:"1ufyfc"}],["path",{d:"M14.121 15.121A3 3 0 1 1 9.88 10.88",key:"11zox6"}]],gh=De("camera-off",I2);/**
80
40
  * @license lucide-react v0.522.0 - ISC
81
41
  *
82
42
  * This source code is licensed under the ISC license.
83
43
  * See the LICENSE file in the root directory of this source tree.
84
- */const rS=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],rm=Fe("camera",rS);/**
44
+ */const D2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],yh=De("camera",D2);/**
85
45
  * @license lucide-react v0.522.0 - ISC
86
46
  *
87
47
  * This source code is licensed under the ISC license.
88
48
  * See the LICENSE file in the root directory of this source tree.
89
- */const sS=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],oS=Fe("download",sS);/**
49
+ */const O2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],L2=De("download",O2);/**
90
50
  * @license lucide-react v0.522.0 - ISC
91
51
  *
92
52
  * This source code is licensed under the ISC license.
93
53
  * See the LICENSE file in the root directory of this source tree.
94
- */const iS=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],aS=Fe("file-text",iS);/**
54
+ */const $2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],F2=De("file-text",$2);/**
95
55
  * @license lucide-react v0.522.0 - ISC
96
56
  *
97
57
  * This source code is licensed under the ISC license.
98
58
  * See the LICENSE file in the root directory of this source tree.
99
- */const cS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],lS=Fe("image",cS);/**
59
+ */const _2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],B2=De("image",_2);/**
100
60
  * @license lucide-react v0.522.0 - ISC
101
61
  *
102
62
  * This source code is licensed under the ISC license.
103
63
  * See the LICENSE file in the root directory of this source tree.
104
- */const dS=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],uS=Fe("layout-grid",dS);/**
64
+ */const H2=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],z2=De("layout-grid",H2);/**
105
65
  * @license lucide-react v0.522.0 - ISC
106
66
  *
107
67
  * This source code is licensed under the ISC license.
108
68
  * See the LICENSE file in the root directory of this source tree.
109
- */const fS=[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hS=Fe("monitor-off",fS);/**
69
+ */const U2=[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],W2=De("monitor-off",U2);/**
110
70
  * @license lucide-react v0.522.0 - ISC
111
71
  *
112
72
  * This source code is licensed under the ISC license.
113
73
  * See the LICENSE file in the root directory of this source tree.
114
- */const mS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],pS=Fe("monitor",mS);/**
74
+ */const Z2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],K2=De("monitor",Z2);/**
115
75
  * @license lucide-react v0.522.0 - ISC
116
76
  *
117
77
  * This source code is licensed under the ISC license.
118
78
  * See the LICENSE file in the root directory of this source tree.
119
- */const gS=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],yS=Fe("music",gS);/**
79
+ */const G2=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Y2=De("music",G2);/**
120
80
  * @license lucide-react v0.522.0 - ISC
121
81
  *
122
82
  * This source code is licensed under the ISC license.
123
83
  * See the LICENSE file in the root directory of this source tree.
124
- */const vS=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],xS=Fe("paperclip",vS);/**
84
+ */const q2=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],X2=De("paperclip",q2);/**
125
85
  * @license lucide-react v0.522.0 - ISC
126
86
  *
127
87
  * This source code is licensed under the ISC license.
128
88
  * See the LICENSE file in the root directory of this source tree.
129
- */const bS=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],sm=Fe("phone-off",bS);/**
89
+ */const J2=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],xh=De("phone-off",J2);/**
130
90
  * @license lucide-react v0.522.0 - ISC
131
91
  *
132
92
  * This source code is licensed under the ISC license.
133
93
  * See the LICENSE file in the root directory of this source tree.
134
- */const wS=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],SS=Fe("send-horizontal",wS);/**
94
+ */const Q2=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],ew=De("send-horizontal",Q2);/**
135
95
  * @license lucide-react v0.522.0 - ISC
136
96
  *
137
97
  * This source code is licensed under the ISC license.
138
98
  * See the LICENSE file in the root directory of this source tree.
139
- */const CS=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ES=Fe("user",CS);/**
99
+ */const tw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],nw=De("user",tw);/**
140
100
  * @license lucide-react v0.522.0 - ISC
141
101
  *
142
102
  * This source code is licensed under the ISC license.
143
103
  * See the LICENSE file in the root directory of this source tree.
144
- */const kS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],TS=Fe("users",kS);/**
104
+ */const rw=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sw=De("users",rw);/**
145
105
  * @license lucide-react v0.522.0 - ISC
146
106
  *
147
107
  * This source code is licensed under the ISC license.
148
108
  * See the LICENSE file in the root directory of this source tree.
149
- */const AS=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],PS=Fe("video",AS);/**
109
+ */const ow=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],iw=De("video",ow);/**
150
110
  * @license lucide-react v0.522.0 - ISC
151
111
  *
152
112
  * This source code is licensed under the ISC license.
153
113
  * See the LICENSE file in the root directory of this source tree.
154
- */const MS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RS=Fe("x",MS);function Ql({timeout:e}){const[t,n]=A.useState(100),r=A.useRef(null),s=A.useRef(null);return A.useEffect(()=>{if(!e||e<=0)return;n(100),s.current=Date.now();const o=()=>{if(!e||s.current===null)return;const i=Date.now()-s.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:d.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:d.jsx(ae.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function Fn({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:s}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=m.useState(()=>Date.now()),i=()=>e.component?m.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async l=>{console.log("InteractiveComponent: Loading data:",l)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:s}):d.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return d.jsx(Nn,{children:d.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx(Ql,{timeout:e.timeout}),d.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[d.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())}),d.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:d.jsx(RS,{className:"w-5 h-5"})})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return d.jsx(Nn,{children:d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:d.jsxs("div",{children:[d.jsx(Ql,{timeout:e.timeout}),i()]})})})}}function NS(){const e=Me.useTranscriptions(),t=Me.useChat(),n=Me.useRoomContext();return{messages:A.useMemo(()=>[...e.map(o=>_v(o,n)),...t.chatMessages].sort((o,i)=>o.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const jS=({logLevel:e}={})=>{const t=Me.useRoomContext();m.useEffect(()=>(te.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},ed=e=>e,VS=()=>{let e=ed;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ed}}},IS=VS();function zt(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function fn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":zt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function DS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gr={exports:{}},qr={exports:{}},fe={};/** @license React v16.13.1
155
- * react-is.production.min.js
156
- *
157
- * Copyright (c) Facebook, Inc. and its affiliates.
158
- *
159
- * This source code is licensed under the MIT license found in the
160
- * LICENSE file in the root directory of this source tree.
161
- */var td;function OS(){if(td)return fe;td=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var T=E.$$typeof;switch(T){case t:switch(E=E.type,E){case c:case l:case r:case o:case s:case h:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case y:case g:case i:return E;default:return T}}case n:return T}}}function C(E){return S(E)===l}return fe.AsyncMode=c,fe.ConcurrentMode=l,fe.ContextConsumer=a,fe.ContextProvider=i,fe.Element=t,fe.ForwardRef=u,fe.Fragment=r,fe.Lazy=y,fe.Memo=g,fe.Portal=n,fe.Profiler=o,fe.StrictMode=s,fe.Suspense=h,fe.isAsyncMode=function(E){return C(E)||S(E)===c},fe.isConcurrentMode=C,fe.isContextConsumer=function(E){return S(E)===a},fe.isContextProvider=function(E){return S(E)===i},fe.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},fe.isForwardRef=function(E){return S(E)===u},fe.isFragment=function(E){return S(E)===r},fe.isLazy=function(E){return S(E)===y},fe.isMemo=function(E){return S(E)===g},fe.isPortal=function(E){return S(E)===n},fe.isProfiler=function(E){return S(E)===o},fe.isStrictMode=function(E){return S(E)===s},fe.isSuspense=function(E){return S(E)===h},fe.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===l||E===o||E===s||E===h||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===g||E.$$typeof===i||E.$$typeof===a||E.$$typeof===u||E.$$typeof===v||E.$$typeof===w||E.$$typeof===b||E.$$typeof===f)},fe.typeOf=S,fe}var he={};/** @license React v16.13.1
162
- * react-is.development.js
163
- *
164
- * Copyright (c) Facebook, Inc. and its affiliates.
165
- *
166
- * This source code is licensed under the MIT license found in the
167
- * LICENSE file in the root directory of this source tree.
168
- */var nd;function $S(){return nd||(nd=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(O){return typeof O=="string"||typeof O=="function"||O===r||O===l||O===o||O===s||O===h||O===p||typeof O=="object"&&O!==null&&(O.$$typeof===y||O.$$typeof===g||O.$$typeof===i||O.$$typeof===a||O.$$typeof===u||O.$$typeof===v||O.$$typeof===w||O.$$typeof===b||O.$$typeof===f)}function C(O){if(typeof O=="object"&&O!==null){var se=O.$$typeof;switch(se){case t:var le=O.type;switch(le){case c:case l:case r:case o:case s:case h:return le;default:var De=le&&le.$$typeof;switch(De){case a:case u:case y:case g:case i:return De;default:return se}}case n:return se}}}var E=c,T=l,k=a,P=i,$=t,x=u,I=r,_=y,K=g,Y=n,X=o,G=s,U=h,M=!1;function q(O){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),N(O)||C(O)===c}function N(O){return C(O)===l}function V(O){return C(O)===a}function Z(O){return C(O)===i}function R(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function B(O){return C(O)===u}function z(O){return C(O)===r}function H(O){return C(O)===y}function j(O){return C(O)===g}function F(O){return C(O)===n}function W(O){return C(O)===o}function L(O){return C(O)===s}function J(O){return C(O)===h}he.AsyncMode=E,he.ConcurrentMode=T,he.ContextConsumer=k,he.ContextProvider=P,he.Element=$,he.ForwardRef=x,he.Fragment=I,he.Lazy=_,he.Memo=K,he.Portal=Y,he.Profiler=X,he.StrictMode=G,he.Suspense=U,he.isAsyncMode=q,he.isConcurrentMode=N,he.isContextConsumer=V,he.isContextProvider=Z,he.isElement=R,he.isForwardRef=B,he.isFragment=z,he.isLazy=H,he.isMemo=j,he.isPortal=F,he.isProfiler=W,he.isStrictMode=L,he.isSuspense=J,he.isValidElementType=S,he.typeOf=C}()),he}var rd;function om(){return rd||(rd=1,process.env.NODE_ENV==="production"?qr.exports=OS():qr.exports=$S()),qr.exports}/*
114
+ */const aw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cw=De("x",aw);function Tl({timeout:e}){const[t,n]=A.useState(100),r=A.useRef(null),s=A.useRef(null);return A.useEffect(()=>{if(!e||e<=0)return;n(100),s.current=Date.now();const o=()=>{if(!e||s.current===null)return;const i=Date.now()-s.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:d.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:d.jsx(ae.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function Vn({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:s}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=m.useState(()=>Date.now()),i=()=>e.component?m.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async l=>{console.log("InteractiveComponent: Loading data:",l)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:s}):d.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return d.jsx(kn,{children:d.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx(Tl,{timeout:e.timeout}),d.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[d.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())}),d.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:d.jsx(cw,{className:"w-5 h-5"})})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return d.jsx(kn,{children:d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:d.jsxs("div",{children:[d.jsx(Tl,{timeout:e.timeout}),i()]})})})}}function lw(){const e=Ee.useTranscriptions(),t=Ee.useChat(),n=Ee.useRoomContext();return{messages:A.useMemo(()=>[...e.map(o=>Qy(o,n)),...t.chatMessages].sort((o,i)=>o.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const dw=({logLevel:e}={})=>{const t=Ee.useRoomContext();m.useEffect(()=>(te.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},jl=e=>e,uw=()=>{let e=jl;return{configure(t){e=t},generate(t){return e(t)},reset(){e=jl}}},fw=uw();function Ft(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function cn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Ft(7));return e.charAt(0).toUpperCase()+e.slice(1)}function hw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _r={exports:{}};/*
169
115
  object-assign
170
116
  (c) Sindre Sorhus
171
117
  @license MIT
172
- */var Oo,sd;function LS(){if(sd)return Oo;sd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Oo=s()?Object.assign:function(o,i){for(var a,c=r(o),l,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var h in a)t.call(a,h)&&(c[h]=a[h]);if(e){l=e(a);for(var p=0;p<l.length;p++)n.call(a,l[p])&&(c[l[p]]=a[l[p]])}}return c},Oo}var $o,od;function $a(){if(od)return $o;od=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $o=e,$o}var Lo,id;function im(){return id||(id=1,Lo=Function.call.bind(Object.prototype.hasOwnProperty)),Lo}var _o,ad;function _S(){if(ad)return _o;ad=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=$a(),n={},r=im();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var h;try{if(typeof o[u]!="function"){var p=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=o[u](i,u,c,a,null,t)}catch(y){h=y}if(h&&!(h instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var g=l?l():"";e("Failed "+a+" type: "+h.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},_o=s,_o}var Fo,cd;function FS(){if(cd)return Fo;cd=1;var e=om(),t=LS(),n=$a(),r=im(),s=_S(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return Fo=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function h(N){var V=N&&(l&&N[l]||N[u]);if(typeof V=="function")return V}var p="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:b(),arrayOf:S,element:C(),elementType:E(),instanceOf:T,node:x(),objectOf:P,oneOf:k,oneOfType:$,shape:_,exact:K};function y(N,V){return N===V?N!==0||1/N===1/V:N!==N&&V!==V}function f(N,V){this.message=N,this.data=V&&typeof V=="object"?V:{},this.stack=""}f.prototype=Error.prototype;function v(N){if(process.env.NODE_ENV!=="production")var V={},Z=0;function R(z,H,j,F,W,L,J){if(F=F||p,L=L||j,J!==n){if(c){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var se=F+":"+j;!V[se]&&Z<3&&(o("You are manually calling a React.PropTypes validation function for the `"+L+"` prop on `"+F+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[se]=!0,Z++)}}return H[j]==null?z?H[j]===null?new f("The "+W+" `"+L+"` is marked as required "+("in `"+F+"`, but its value is `null`.")):new f("The "+W+" `"+L+"` is marked as required in "+("`"+F+"`, but its value is `undefined`.")):null:N(H,j,F,W,L)}var B=R.bind(null,!1);return B.isRequired=R.bind(null,!0),B}function w(N){function V(Z,R,B,z,H,j){var F=Z[R],W=G(F);if(W!==N){var L=U(F);return new f("Invalid "+z+" `"+H+"` of type "+("`"+L+"` supplied to `"+B+"`, expected ")+("`"+N+"`."),{expectedType:N})}return null}return v(V)}function b(){return v(i)}function S(N){function V(Z,R,B,z,H){if(typeof N!="function")return new f("Property `"+H+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var j=Z[R];if(!Array.isArray(j)){var F=G(j);return new f("Invalid "+z+" `"+H+"` of type "+("`"+F+"` supplied to `"+B+"`, expected an array."))}for(var W=0;W<j.length;W++){var L=N(j,W,B,z,H+"["+W+"]",n);if(L instanceof Error)return L}return null}return v(V)}function C(){function N(V,Z,R,B,z){var H=V[Z];if(!a(H)){var j=G(H);return new f("Invalid "+B+" `"+z+"` of type "+("`"+j+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return v(N)}function E(){function N(V,Z,R,B,z){var H=V[Z];if(!e.isValidElementType(H)){var j=G(H);return new f("Invalid "+B+" `"+z+"` of type "+("`"+j+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return v(N)}function T(N){function V(Z,R,B,z,H){if(!(Z[R]instanceof N)){var j=N.name||p,F=q(Z[R]);return new f("Invalid "+z+" `"+H+"` of type "+("`"+F+"` supplied to `"+B+"`, expected ")+("instance of `"+j+"`."))}return null}return v(V)}function k(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function V(Z,R,B,z,H){for(var j=Z[R],F=0;F<N.length;F++)if(y(j,N[F]))return null;var W=JSON.stringify(N,function(J,O){var se=U(O);return se==="symbol"?String(O):O});return new f("Invalid "+z+" `"+H+"` of value `"+String(j)+"` "+("supplied to `"+B+"`, expected one of "+W+"."))}return v(V)}function P(N){function V(Z,R,B,z,H){if(typeof N!="function")return new f("Property `"+H+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var j=Z[R],F=G(j);if(F!=="object")return new f("Invalid "+z+" `"+H+"` of type "+("`"+F+"` supplied to `"+B+"`, expected an object."));for(var W in j)if(r(j,W)){var L=N(j,W,B,z,H+"."+W,n);if(L instanceof Error)return L}return null}return v(V)}function $(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var V=0;V<N.length;V++){var Z=N[V];if(typeof Z!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+M(Z)+" at index "+V+"."),i}function R(B,z,H,j,F){for(var W=[],L=0;L<N.length;L++){var J=N[L],O=J(B,z,H,j,F,n);if(O==null)return null;O.data&&r(O.data,"expectedType")&&W.push(O.data.expectedType)}var se=W.length>0?", expected one of type ["+W.join(", ")+"]":"";return new f("Invalid "+j+" `"+F+"` supplied to "+("`"+H+"`"+se+"."))}return v(R)}function x(){function N(V,Z,R,B,z){return Y(V[Z])?null:new f("Invalid "+B+" `"+z+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return v(N)}function I(N,V,Z,R,B){return new f((N||"React class")+": "+V+" type `"+Z+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function _(N){function V(Z,R,B,z,H){var j=Z[R],F=G(j);if(F!=="object")return new f("Invalid "+z+" `"+H+"` of type `"+F+"` "+("supplied to `"+B+"`, expected `object`."));for(var W in N){var L=N[W];if(typeof L!="function")return I(B,z,H,W,U(L));var J=L(j,W,B,z,H+"."+W,n);if(J)return J}return null}return v(V)}function K(N){function V(Z,R,B,z,H){var j=Z[R],F=G(j);if(F!=="object")return new f("Invalid "+z+" `"+H+"` of type `"+F+"` "+("supplied to `"+B+"`, expected `object`."));var W=t({},Z[R],N);for(var L in W){var J=N[L];if(r(N,L)&&typeof J!="function")return I(B,z,H,L,U(J));if(!J)return new f("Invalid "+z+" `"+H+"` key `"+L+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(Z[R],null," ")+`
173
- Valid keys: `+JSON.stringify(Object.keys(N),null," "));var O=J(j,L,B,z,H+"."+L,n);if(O)return O}return null}return v(V)}function Y(N){switch(typeof N){case"number":case"string":case"undefined":return!0;case"boolean":return!N;case"object":if(Array.isArray(N))return N.every(Y);if(N===null||a(N))return!0;var V=h(N);if(V){var Z=V.call(N),R;if(V!==N.entries){for(;!(R=Z.next()).done;)if(!Y(R.value))return!1}else for(;!(R=Z.next()).done;){var B=R.value;if(B&&!Y(B[1]))return!1}}else return!1;return!0;default:return!1}}function X(N,V){return N==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function G(N){var V=typeof N;return Array.isArray(N)?"array":N instanceof RegExp?"object":X(V,N)?"symbol":V}function U(N){if(typeof N>"u"||N===null)return""+N;var V=G(N);if(V==="object"){if(N instanceof Date)return"date";if(N instanceof RegExp)return"regexp"}return V}function M(N){var V=U(N);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function q(N){return!N.constructor||!N.constructor.name?p:N.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},Fo}var Bo,ld;function BS(){if(ld)return Bo;ld=1;var e=$a();function t(){}function n(){}return n.resetWarningCache=t,Bo=function(){function r(i,a,c,l,u,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Bo}var dd;function HS(){if(dd)return Gr.exports;if(dd=1,process.env.NODE_ENV!=="production"){var e=om(),t=!0;Gr.exports=FS()(e.isElement,t)}else Gr.exports=BS()();return Gr.exports}var zS=HS();const ce=DS(zS);function US(e,t,n=void 0){const r={};for(const s in e){const o=e[s];let i="",a=!0;for(let c=0;c<o.length;c+=1){const l=o[c];l&&(i+=(a===!0?"":" ")+t(l),a=!1,n&&n[l]&&(i+=" "+n[l]))}r[s]=i}return r}var Xr={exports:{}},me={};/**
174
- * @license React
175
- * react-is.production.js
176
- *
177
- * Copyright (c) Meta Platforms, Inc. and affiliates.
178
- *
179
- * This source code is licensed under the MIT license found in the
180
- * LICENSE file in the root directory of this source tree.
181
- */var ud;function WS(){if(ud)return me;ud=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function y(f){if(typeof f=="object"&&f!==null){var v=f.$$typeof;switch(v){case e:switch(f=f.type,f){case n:case s:case r:case c:case l:case p:return f;default:switch(f=f&&f.$$typeof,f){case i:case a:case h:case u:return f;case o:return f;default:return v}}case t:return v}}}return me.ContextConsumer=o,me.ContextProvider=i,me.Element=e,me.ForwardRef=a,me.Fragment=n,me.Lazy=h,me.Memo=u,me.Portal=t,me.Profiler=s,me.StrictMode=r,me.Suspense=c,me.SuspenseList=l,me.isContextConsumer=function(f){return y(f)===o},me.isContextProvider=function(f){return y(f)===i},me.isElement=function(f){return typeof f=="object"&&f!==null&&f.$$typeof===e},me.isForwardRef=function(f){return y(f)===a},me.isFragment=function(f){return y(f)===n},me.isLazy=function(f){return y(f)===h},me.isMemo=function(f){return y(f)===u},me.isPortal=function(f){return y(f)===t},me.isProfiler=function(f){return y(f)===s},me.isStrictMode=function(f){return y(f)===r},me.isSuspense=function(f){return y(f)===c},me.isSuspenseList=function(f){return y(f)===l},me.isValidElementType=function(f){return typeof f=="string"||typeof f=="function"||f===n||f===s||f===r||f===c||f===l||typeof f=="object"&&f!==null&&(f.$$typeof===h||f.$$typeof===u||f.$$typeof===i||f.$$typeof===o||f.$$typeof===a||f.$$typeof===g||f.getModuleId!==void 0)},me.typeOf=y,me}var pe={};/**
182
- * @license React
183
- * react-is.development.js
184
- *
185
- * Copyright (c) Meta Platforms, Inc. and affiliates.
186
- *
187
- * This source code is licensed under the MIT license found in the
188
- * LICENSE file in the root directory of this source tree.
189
- */var fd;function ZS(){return fd||(fd=1,process.env.NODE_ENV!=="production"&&function(){function e(f){if(typeof f=="object"&&f!==null){var v=f.$$typeof;switch(v){case t:switch(f=f.type,f){case r:case o:case s:case l:case u:case g:return f;default:switch(f=f&&f.$$typeof,f){case a:case c:case p:case h:return f;case i:return f;default:return v}}case n:return v}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),y=Symbol.for("react.client.reference");pe.ContextConsumer=i,pe.ContextProvider=a,pe.Element=t,pe.ForwardRef=c,pe.Fragment=r,pe.Lazy=p,pe.Memo=h,pe.Portal=n,pe.Profiler=o,pe.StrictMode=s,pe.Suspense=l,pe.SuspenseList=u,pe.isContextConsumer=function(f){return e(f)===i},pe.isContextProvider=function(f){return e(f)===a},pe.isElement=function(f){return typeof f=="object"&&f!==null&&f.$$typeof===t},pe.isForwardRef=function(f){return e(f)===c},pe.isFragment=function(f){return e(f)===r},pe.isLazy=function(f){return e(f)===p},pe.isMemo=function(f){return e(f)===h},pe.isPortal=function(f){return e(f)===n},pe.isProfiler=function(f){return e(f)===o},pe.isStrictMode=function(f){return e(f)===s},pe.isSuspense=function(f){return e(f)===l},pe.isSuspenseList=function(f){return e(f)===u},pe.isValidElementType=function(f){return typeof f=="string"||typeof f=="function"||f===r||f===o||f===s||f===l||f===u||typeof f=="object"&&f!==null&&(f.$$typeof===p||f.$$typeof===h||f.$$typeof===a||f.$$typeof===i||f.$$typeof===c||f.$$typeof===y||f.getModuleId!==void 0)},pe.typeOf=e}()),pe}var hd;function KS(){return hd||(hd=1,process.env.NODE_ENV==="production"?Xr.exports=WS():Xr.exports=ZS()),Xr.exports}var ks=KS();function Pt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function am(e){if(m.isValidElement(e)||ks.isValidElementType(e)||!Pt(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=am(e[n])}),t}function qe(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Pt(e)&&Pt(t)&&Object.keys(t).forEach(s=>{m.isValidElement(t[s])||ks.isValidElementType(t[s])?r[s]=t[s]:Pt(t[s])&&Object.prototype.hasOwnProperty.call(e,s)&&Pt(e[s])?r[s]=qe(e[s],t[s],n):n.clone?r[s]=Pt(t[s])?am(t[s]):t[s]:r[s]=t[s]}),r}function fr(e,t){return t?qe(e,t,{clone:!1}):e}const Yt=process.env.NODE_ENV!=="production"?ce.oneOfType([ce.number,ce.string,ce.object,ce.array]):{};function md(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,s)=>{var i,a;const o=/min-width:\s*([0-9.]+)/;return+(((i=r.match(o))==null?void 0:i[1])||0)-+(((a=s.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,s)=>{const o=t[s];return delete r[s],r[s]=o,r},{...t}):t}function YS(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function GS(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
190
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:zt(18,`(${t})`));return null}const[,r,s]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(s).up(o)}function qS(e){const t=(o,i)=>o.replace("@media",i?`@container ${i}`:"@container");function n(o,i){o.up=(...a)=>t(e.breakpoints.up(...a),i),o.down=(...a)=>t(e.breakpoints.down(...a),i),o.between=(...a)=>t(e.breakpoints.between(...a),i),o.only=(...a)=>t(e.breakpoints.only(...a),i),o.not=(...a)=>{const c=t(e.breakpoints.not(...a),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},s=o=>(n(r,o),r);return n(s),{...e,containerQueries:s}}const Hs={xs:0,sm:600,md:900,lg:1200,xl:1536},pd={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Hs[e]}px)`},XS={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Hs[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function It(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||pd;return t.reduce((i,a,c)=>(i[o.up(o.keys[c])]=n(t[c]),i),{})}if(typeof t=="object"){const o=r.breakpoints||pd;return Object.keys(t).reduce((i,a)=>{if(YS(o.keys,a)){const c=GS(r.containerQueries?r:XS,a);c&&(i[c]=n(t[a],a))}else if(Object.keys(o.values||Hs).includes(a)){const c=o.up(a);i[c]=n(t[a],a)}else{const c=a;i[c]=t[c]}return i},{})}return n(t)}function JS(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,s)=>{const o=e.up(s);return r[o]={},r},{}))||{}}function gd(e,t){return e.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},t)}function zs(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,e)}function Ts(e,t,n,r=n){let s;return typeof e=="function"?s=e(n):Array.isArray(e)?s=e[n]||r:s=zs(e,n)||r,t&&(s=t(s,r,e)),s}function Re(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:s}=e,o=i=>{if(i[t]==null)return null;const a=i[t],c=i.theme,l=zs(c,r)||{};return It(i,a,h=>{let p=Ts(l,s,h);return h===p&&typeof h=="string"&&(p=Ts(l,s,`${t}${h==="default"?"":fn(h)}`,h)),n===!1?p:{[n]:p}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Yt}:{},o.filterProps=[t],o}function QS(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const e4={m:"margin",p:"padding"},t4={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},yd={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},n4=QS(e=>{if(e.length>2)if(yd[e])e=yd[e];else return[e];const[t,n]=e.split(""),r=e4[t],s=t4[n]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),Us=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ws=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],r4=[...Us,...Ws];function Nr(e,t,n,r){const s=zs(e,t,!0)??n;return typeof s=="number"||typeof s=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof s=="string"?s.startsWith("var(")&&o===0?0:s.startsWith("var(")&&o===1?s:`calc(${o} * ${s})`:s*o):Array.isArray(s)?o=>{if(typeof o=="string")return o;const i=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>s.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(s)}.`,`${i} > ${s.length-1}, you need to add the missing values.`].join(`
118
+ */var yo,Pl;function mw(){if(Pl)return yo;Pl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return yo=s()?Object.assign:function(o,i){for(var a,c=r(o),l,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(c[f]=a[f]);if(e){l=e(a);for(var h=0;h<l.length;h++)n.call(a,l[h])&&(c[l[h]]=a[l[h]])}}return c},yo}var xo,Ml;function ga(){if(Ml)return xo;Ml=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xo=e,xo}var bo,Nl;function bh(){return Nl||(Nl=1,bo=Function.call.bind(Object.prototype.hasOwnProperty)),bo}var vo,Rl;function pw(){if(Rl)return vo;Rl=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ga(),n={},r=bh();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var h=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=o[u](i,u,c,a,null,t)}catch(y){f=y}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=l?l():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},vo=s,vo}var wo,Vl;function gw(){if(Vl)return wo;Vl=1;var e=Pn,t=mw(),n=ga(),r=bh(),s=pw(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return wo=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(R){var V=R&&(l&&R[l]||R[u]);if(typeof V=="function")return V}var h="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:v(),arrayOf:S,element:C(),elementType:E(),instanceOf:T,node:b(),objectOf:j,oneOf:k,oneOfType:$,shape:L,exact:Z};function y(R,V){return R===V?R!==0||1/R===1/V:R!==R&&V!==V}function p(R,V){this.message=R,this.data=V&&typeof V=="object"?V:{},this.stack=""}p.prototype=Error.prototype;function x(R){if(process.env.NODE_ENV!=="production")var V={},W=0;function M(H,B,N,F,U,O,J){if(F=F||h,O=O||N,J!==n){if(c){var X=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw X.name="Invariant Violation",X}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var se=F+":"+N;!V[se]&&W<3&&(o("You are manually calling a React.PropTypes validation function for the `"+O+"` prop on `"+F+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[se]=!0,W++)}}return B[N]==null?H?B[N]===null?new p("The "+U+" `"+O+"` is marked as required "+("in `"+F+"`, but its value is `null`.")):new p("The "+U+" `"+O+"` is marked as required in "+("`"+F+"`, but its value is `undefined`.")):null:R(B,N,F,U,O)}var _=M.bind(null,!1);return _.isRequired=M.bind(null,!0),_}function w(R){function V(W,M,_,H,B,N){var F=W[M],U=G(F);if(U!==R){var O=z(F);return new p("Invalid "+H+" `"+B+"` of type "+("`"+O+"` supplied to `"+_+"`, expected ")+("`"+R+"`."),{expectedType:R})}return null}return x(V)}function v(){return x(i)}function S(R){function V(W,M,_,H,B){if(typeof R!="function")return new p("Property `"+B+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var N=W[M];if(!Array.isArray(N)){var F=G(N);return new p("Invalid "+H+" `"+B+"` of type "+("`"+F+"` supplied to `"+_+"`, expected an array."))}for(var U=0;U<N.length;U++){var O=R(N,U,_,H,B+"["+U+"]",n);if(O instanceof Error)return O}return null}return x(V)}function C(){function R(V,W,M,_,H){var B=V[W];if(!a(B)){var N=G(B);return new p("Invalid "+_+" `"+H+"` of type "+("`"+N+"` supplied to `"+M+"`, expected a single ReactElement."))}return null}return x(R)}function E(){function R(V,W,M,_,H){var B=V[W];if(!e.isValidElementType(B)){var N=G(B);return new p("Invalid "+_+" `"+H+"` of type "+("`"+N+"` supplied to `"+M+"`, expected a single ReactElement type."))}return null}return x(R)}function T(R){function V(W,M,_,H,B){if(!(W[M]instanceof R)){var N=R.name||h,F=Y(W[M]);return new p("Invalid "+H+" `"+B+"` of type "+("`"+F+"` supplied to `"+_+"`, expected ")+("instance of `"+N+"`."))}return null}return x(V)}function k(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function V(W,M,_,H,B){for(var N=W[M],F=0;F<R.length;F++)if(y(N,R[F]))return null;var U=JSON.stringify(R,function(J,X){var se=z(X);return se==="symbol"?String(X):X});return new p("Invalid "+H+" `"+B+"` of value `"+String(N)+"` "+("supplied to `"+_+"`, expected one of "+U+"."))}return x(V)}function j(R){function V(W,M,_,H,B){if(typeof R!="function")return new p("Property `"+B+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var N=W[M],F=G(N);if(F!=="object")return new p("Invalid "+H+" `"+B+"` of type "+("`"+F+"` supplied to `"+_+"`, expected an object."));for(var U in N)if(r(N,U)){var O=R(N,U,_,H,B+"."+U,n);if(O instanceof Error)return O}return null}return x(V)}function $(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var V=0;V<R.length;V++){var W=R[V];if(typeof W!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(W)+" at index "+V+"."),i}function M(_,H,B,N,F){for(var U=[],O=0;O<R.length;O++){var J=R[O],X=J(_,H,B,N,F,n);if(X==null)return null;X.data&&r(X.data,"expectedType")&&U.push(X.data.expectedType)}var se=U.length>0?", expected one of type ["+U.join(", ")+"]":"";return new p("Invalid "+N+" `"+F+"` supplied to "+("`"+B+"`"+se+"."))}return x(M)}function b(){function R(V,W,M,_,H){return K(V[W])?null:new p("Invalid "+_+" `"+H+"` supplied to "+("`"+M+"`, expected a ReactNode."))}return x(R)}function I(R,V,W,M,_){return new p((R||"React class")+": "+V+" type `"+W+"."+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function L(R){function V(W,M,_,H,B){var N=W[M],F=G(N);if(F!=="object")return new p("Invalid "+H+" `"+B+"` of type `"+F+"` "+("supplied to `"+_+"`, expected `object`."));for(var U in R){var O=R[U];if(typeof O!="function")return I(_,H,B,U,z(O));var J=O(N,U,_,H,B+"."+U,n);if(J)return J}return null}return x(V)}function Z(R){function V(W,M,_,H,B){var N=W[M],F=G(N);if(F!=="object")return new p("Invalid "+H+" `"+B+"` of type `"+F+"` "+("supplied to `"+_+"`, expected `object`."));var U=t({},W[M],R);for(var O in U){var J=R[O];if(r(R,O)&&typeof J!="function")return I(_,H,B,O,z(J));if(!J)return new p("Invalid "+H+" `"+B+"` key `"+O+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(W[M],null," ")+`
119
+ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var X=J(N,O,_,H,B+"."+O,n);if(X)return X}return null}return x(V)}function K(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(K);if(R===null||a(R))return!0;var V=f(R);if(V){var W=V.call(R),M;if(V!==R.entries){for(;!(M=W.next()).done;)if(!K(M.value))return!1}else for(;!(M=W.next()).done;){var _=M.value;if(_&&!K(_[1]))return!1}}else return!1;return!0;default:return!1}}function q(R,V){return R==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function G(R){var V=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":q(V,R)?"symbol":V}function z(R){if(typeof R>"u"||R===null)return""+R;var V=G(R);if(V==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return V}function P(R){var V=z(R);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function Y(R){return!R.constructor||!R.constructor.name?h:R.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},wo}var So,Il;function yw(){if(Il)return So;Il=1;var e=ga();function t(){}function n(){}return n.resetWarningCache=t,So=function(){function r(i,a,c,l,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},So}var Dl;function xw(){if(Dl)return _r.exports;if(Dl=1,process.env.NODE_ENV!=="production"){var e=Pn,t=!0;_r.exports=gw()(e.isElement,t)}else _r.exports=yw()();return _r.exports}var bw=xw();const ce=hw(bw);function vw(e,t,n=void 0){const r={};for(const s in e){const o=e[s];let i="",a=!0;for(let c=0;c<o.length;c+=1){const l=o[c];l&&(i+=(a===!0?"":" ")+t(l),a=!1,n&&n[l]&&(i+=" "+n[l]))}r[s]=i}return r}function Ct(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vh(e){if(m.isValidElement(e)||Pn.isValidElementType(e)||!Ct(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=vh(e[n])}),t}function Ze(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Ct(e)&&Ct(t)&&Object.keys(t).forEach(s=>{m.isValidElement(t[s])||Pn.isValidElementType(t[s])?r[s]=t[s]:Ct(t[s])&&Object.prototype.hasOwnProperty.call(e,s)&&Ct(e[s])?r[s]=Ze(e[s],t[s],n):n.clone?r[s]=Ct(t[s])?vh(t[s]):t[s]:r[s]=t[s]}),r}function or(e,t){return t?Ze(e,t,{clone:!1}):e}const Ut=process.env.NODE_ENV!=="production"?ce.oneOfType([ce.number,ce.string,ce.object,ce.array]):{};function Ol(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,s)=>{var i,a;const o=/min-width:\s*([0-9.]+)/;return+(((i=r.match(o))==null?void 0:i[1])||0)-+(((a=s.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,s)=>{const o=t[s];return delete r[s],r[s]=o,r},{...t}):t}function ww(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Sw(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
120
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Ft(18,`(${t})`));return null}const[,r,s]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(s).up(o)}function Cw(e){const t=(o,i)=>o.replace("@media",i?`@container ${i}`:"@container");function n(o,i){o.up=(...a)=>t(e.breakpoints.up(...a),i),o.down=(...a)=>t(e.breakpoints.down(...a),i),o.between=(...a)=>t(e.breakpoints.between(...a),i),o.only=(...a)=>t(e.breakpoints.only(...a),i),o.not=(...a)=>{const c=t(e.breakpoints.not(...a),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},s=o=>(n(r,o),r);return n(s),{...e,containerQueries:s}}const As={xs:0,sm:600,md:900,lg:1200,xl:1536},Ll={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${As[e]}px)`},kw={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:As[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Pt(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Ll;return t.reduce((i,a,c)=>(i[o.up(o.keys[c])]=n(t[c]),i),{})}if(typeof t=="object"){const o=r.breakpoints||Ll;return Object.keys(t).reduce((i,a)=>{if(ww(o.keys,a)){const c=Sw(r.containerQueries?r:kw,a);c&&(i[c]=n(t[a],a))}else if(Object.keys(o.values||As).includes(a)){const c=o.up(a);i[c]=n(t[a],a)}else{const c=a;i[c]=t[c]}return i},{})}return n(t)}function Ew(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,s)=>{const o=e.up(s);return r[o]={},r},{}))||{}}function $l(e,t){return e.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},t)}function Ts(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,e)}function fs(e,t,n,r=n){let s;return typeof e=="function"?s=e(n):Array.isArray(e)?s=e[n]||r:s=Ts(e,n)||r,t&&(s=t(s,r,e)),s}function Ae(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:s}=e,o=i=>{if(i[t]==null)return null;const a=i[t],c=i.theme,l=Ts(c,r)||{};return Pt(i,a,f=>{let h=fs(l,s,f);return f===h&&typeof f=="string"&&(h=fs(l,s,`${t}${f==="default"?"":cn(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Ut}:{},o.filterProps=[t],o}function Aw(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Tw={m:"margin",p:"padding"},jw={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Fl={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Pw=Aw(e=>{if(e.length>2)if(Fl[e])e=Fl[e];else return[e];const[t,n]=e.split(""),r=Tw[t],s=jw[n]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),js=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ps=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Mw=[...js,...Ps];function kr(e,t,n,r){const s=Ts(e,t,!0)??n;return typeof s=="number"||typeof s=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof s=="string"?s.startsWith("var(")&&o===0?0:s.startsWith("var(")&&o===1?s:`calc(${o} * ${s})`:s*o):Array.isArray(s)?o=>{if(typeof o=="string")return o;const i=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>s.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(s)}.`,`${i} > ${s.length-1}, you need to add the missing values.`].join(`
191
121
  `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
192
122
  `)));const a=s[i];return o>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof s=="function"?s:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${s}) is invalid.`,"It should be a number, an array or a function."].join(`
193
- `)),()=>{})}function La(e){return Nr(e,"spacing",8,"spacing")}function jr(e,t){return typeof t=="string"||t==null?t:e(t)}function s4(e,t){return n=>e.reduce((r,s)=>(r[s]=jr(t,n),r),{})}function o4(e,t,n,r){if(!t.includes(n))return null;const s=n4(n),o=s4(s,r),i=e[n];return It(e,i,o)}function cm(e,t){const n=La(e.theme);return Object.keys(e).map(r=>o4(e,t,r,n)).reduce(fr,{})}function Ee(e){return cm(e,Us)}Ee.propTypes=process.env.NODE_ENV!=="production"?Us.reduce((e,t)=>(e[t]=Yt,e),{}):{};Ee.filterProps=Us;function ke(e){return cm(e,Ws)}ke.propTypes=process.env.NODE_ENV!=="production"?Ws.reduce((e,t)=>(e[t]=Yt,e),{}):{};ke.filterProps=Ws;process.env.NODE_ENV!=="production"&&r4.reduce((e,t)=>(e[t]=Yt,e),{});function Zs(...e){const t=e.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),n=r=>Object.keys(r).reduce((s,o)=>t[o]?fr(s,t[o](r)):s,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,s)=>Object.assign(r,s.propTypes),{}):{},n.filterProps=e.reduce((r,s)=>r.concat(s.filterProps),[]),n}function tt(e){return typeof e!="number"?e:`${e}px solid`}function rt(e,t){return Re({prop:e,themeKey:"borders",transform:t})}const i4=rt("border",tt),a4=rt("borderTop",tt),c4=rt("borderRight",tt),l4=rt("borderBottom",tt),d4=rt("borderLeft",tt),u4=rt("borderColor"),f4=rt("borderTopColor"),h4=rt("borderRightColor"),m4=rt("borderBottomColor"),p4=rt("borderLeftColor"),g4=rt("outline",tt),y4=rt("outlineColor"),Ks=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Nr(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:jr(t,r)});return It(e,e.borderRadius,n)}return null};Ks.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Yt}:{};Ks.filterProps=["borderRadius"];Zs(i4,a4,c4,l4,d4,u4,f4,h4,m4,p4,Ks,g4,y4);const Ys=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Nr(e.theme,"spacing",8,"gap"),n=r=>({gap:jr(t,r)});return It(e,e.gap,n)}return null};Ys.propTypes=process.env.NODE_ENV!=="production"?{gap:Yt}:{};Ys.filterProps=["gap"];const Gs=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Nr(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:jr(t,r)});return It(e,e.columnGap,n)}return null};Gs.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Yt}:{};Gs.filterProps=["columnGap"];const qs=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Nr(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:jr(t,r)});return It(e,e.rowGap,n)}return null};qs.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Yt}:{};qs.filterProps=["rowGap"];const v4=Re({prop:"gridColumn"}),x4=Re({prop:"gridRow"}),b4=Re({prop:"gridAutoFlow"}),w4=Re({prop:"gridAutoColumns"}),S4=Re({prop:"gridAutoRows"}),C4=Re({prop:"gridTemplateColumns"}),E4=Re({prop:"gridTemplateRows"}),k4=Re({prop:"gridTemplateAreas"}),T4=Re({prop:"gridArea"});Zs(Ys,Gs,qs,v4,x4,b4,w4,S4,C4,E4,k4,T4);function Dn(e,t){return t==="grey"?t:e}const A4=Re({prop:"color",themeKey:"palette",transform:Dn}),P4=Re({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Dn}),M4=Re({prop:"backgroundColor",themeKey:"palette",transform:Dn});Zs(A4,P4,M4);function Ye(e){return e<=1&&e!==0?`${e*100}%`:e}const R4=Re({prop:"width",transform:Ye}),_a=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var s,o,i,a,c;const r=((i=(o=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:o.values)==null?void 0:i[n])||Hs[n];return r?((c=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ye(n)}};return It(e,e.maxWidth,t)}return null};_a.filterProps=["maxWidth"];const N4=Re({prop:"minWidth",transform:Ye}),j4=Re({prop:"height",transform:Ye}),V4=Re({prop:"maxHeight",transform:Ye}),I4=Re({prop:"minHeight",transform:Ye});Re({prop:"size",cssProperty:"width",transform:Ye});Re({prop:"size",cssProperty:"height",transform:Ye});const D4=Re({prop:"boxSizing"});Zs(R4,_a,N4,j4,V4,I4,D4);const Xs={border:{themeKey:"borders",transform:tt},borderTop:{themeKey:"borders",transform:tt},borderRight:{themeKey:"borders",transform:tt},borderBottom:{themeKey:"borders",transform:tt},borderLeft:{themeKey:"borders",transform:tt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:tt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ks},color:{themeKey:"palette",transform:Dn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Dn},backgroundColor:{themeKey:"palette",transform:Dn},p:{style:ke},pt:{style:ke},pr:{style:ke},pb:{style:ke},pl:{style:ke},px:{style:ke},py:{style:ke},padding:{style:ke},paddingTop:{style:ke},paddingRight:{style:ke},paddingBottom:{style:ke},paddingLeft:{style:ke},paddingX:{style:ke},paddingY:{style:ke},paddingInline:{style:ke},paddingInlineStart:{style:ke},paddingInlineEnd:{style:ke},paddingBlock:{style:ke},paddingBlockStart:{style:ke},paddingBlockEnd:{style:ke},m:{style:Ee},mt:{style:Ee},mr:{style:Ee},mb:{style:Ee},ml:{style:Ee},mx:{style:Ee},my:{style:Ee},margin:{style:Ee},marginTop:{style:Ee},marginRight:{style:Ee},marginBottom:{style:Ee},marginLeft:{style:Ee},marginX:{style:Ee},marginY:{style:Ee},marginInline:{style:Ee},marginInlineStart:{style:Ee},marginInlineEnd:{style:Ee},marginBlock:{style:Ee},marginBlockStart:{style:Ee},marginBlockEnd:{style:Ee},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ys},rowGap:{style:qs},columnGap:{style:Gs},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ye},maxWidth:{style:_a},minWidth:{transform:Ye},height:{transform:Ye},maxHeight:{transform:Ye},minHeight:{transform:Ye},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function O4(...e){const t=e.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function $4(e,t){return typeof e=="function"?e(t):e}function L4(){function e(n,r,s,o){const i={[n]:r,theme:s},a=o[n];if(!a)return{[n]:r};const{cssProperty:c=n,themeKey:l,transform:u,style:h}=a;if(r==null)return null;if(l==="typography"&&r==="inherit")return{[n]:r};const p=zs(s,l)||{};return h?h(i):It(i,r,y=>{let f=Ts(p,u,y);return y===f&&typeof y=="string"&&(f=Ts(p,u,`${n}${y==="default"?"":fn(y)}`,y)),c===!1?f:{[c]:f}})}function t(n){const{sx:r,theme:s={},nested:o}=n||{};if(!r)return null;const i=s.unstable_sxConfig??Xs;function a(c){let l=c;if(typeof c=="function")l=c(s);else if(typeof c!="object")return c;if(!l)return null;const u=JS(s.breakpoints),h=Object.keys(u);let p=u;return Object.keys(l).forEach(g=>{const y=$4(l[g],s);if(y!=null)if(typeof y=="object")if(i[g])p=fr(p,e(g,y,s,i));else{const f=It({theme:s},y,v=>({[g]:v}));O4(f,y)?p[g]=t({sx:y,theme:s,nested:!0}):p=fr(p,f)}else p=fr(p,e(g,y,s,i))}),!o&&s.modularCssLayers?{"@layer sx":md(s,gd(h,p))}:md(s,gd(h,p))}return Array.isArray(r)?r.map(a):a(r)}return t}const Bn=L4();Bn.filterProps=["sx"];function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ni.apply(null,arguments)}function _4(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function F4(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var B4=function(){function e(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(F4(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=_4(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Be="-ms-",As="-moz-",de="-webkit-",lm="comm",Fa="rule",Ba="decl",H4="@import",dm="@keyframes",z4="@layer",U4=Math.abs,Js=String.fromCharCode,W4=Object.assign;function Z4(e,t){return $e(e,0)^45?(((t<<2^$e(e,0))<<2^$e(e,1))<<2^$e(e,2))<<2^$e(e,3):0}function um(e){return e.trim()}function K4(e,t){return(e=t.exec(e))?e[0]:e}function ue(e,t,n){return e.replace(t,n)}function ji(e,t){return e.indexOf(t)}function $e(e,t){return e.charCodeAt(t)|0}function Sr(e,t,n){return e.slice(t,n)}function mt(e){return e.length}function Ha(e){return e.length}function Jr(e,t){return t.push(e),e}function Y4(e,t){return e.map(t).join("")}var Qs=1,Hn=1,fm=0,Ze=0,Ve=0,Jn="";function eo(e,t,n,r,s,o,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:Qs,column:Hn,length:i,return:""}}function nr(e,t){return W4(eo("",null,null,"",null,null,0),e,{length:-e.length},t)}function G4(){return Ve}function q4(){return Ve=Ze>0?$e(Jn,--Ze):0,Hn--,Ve===10&&(Hn=1,Qs--),Ve}function Xe(){return Ve=Ze<fm?$e(Jn,Ze++):0,Hn++,Ve===10&&(Hn=1,Qs++),Ve}function wt(){return $e(Jn,Ze)}function ls(){return Ze}function Vr(e,t){return Sr(Jn,e,t)}function Cr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function hm(e){return Qs=Hn=1,fm=mt(Jn=e),Ze=0,[]}function mm(e){return Jn="",e}function ds(e){return um(Vr(Ze-1,Vi(e===91?e+2:e===40?e+1:e)))}function X4(e){for(;(Ve=wt())&&Ve<33;)Xe();return Cr(e)>2||Cr(Ve)>3?"":" "}function J4(e,t){for(;--t&&Xe()&&!(Ve<48||Ve>102||Ve>57&&Ve<65||Ve>70&&Ve<97););return Vr(e,ls()+(t<6&&wt()==32&&Xe()==32))}function Vi(e){for(;Xe();)switch(Ve){case e:return Ze;case 34:case 39:e!==34&&e!==39&&Vi(Ve);break;case 40:e===41&&Vi(e);break;case 92:Xe();break}return Ze}function Q4(e,t){for(;Xe()&&e+Ve!==57;)if(e+Ve===84&&wt()===47)break;return"/*"+Vr(t,Ze-1)+"*"+Js(e===47?e:Xe())}function eC(e){for(;!Cr(wt());)Xe();return Vr(e,Ze)}function tC(e){return mm(us("",null,null,null,[""],e=hm(e),0,[0],e))}function us(e,t,n,r,s,o,i,a,c){for(var l=0,u=0,h=i,p=0,g=0,y=0,f=1,v=1,w=1,b=0,S="",C=s,E=o,T=r,k=S;v;)switch(y=b,b=Xe()){case 40:if(y!=108&&$e(k,h-1)==58){ji(k+=ue(ds(b),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:k+=ds(b);break;case 9:case 10:case 13:case 32:k+=X4(y);break;case 92:k+=J4(ls()-1,7);continue;case 47:switch(wt()){case 42:case 47:Jr(nC(Q4(Xe(),ls()),t,n),c);break;default:k+="/"}break;case 123*f:a[l++]=mt(k)*w;case 125*f:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:w==-1&&(k=ue(k,/\f/g,"")),g>0&&mt(k)-h&&Jr(g>32?xd(k+";",r,n,h-1):xd(ue(k," ","")+";",r,n,h-2),c);break;case 59:k+=";";default:if(Jr(T=vd(k,t,n,l,u,s,a,S,C=[],E=[],h),o),b===123)if(u===0)us(k,t,T,T,C,o,h,a,E);else switch(p===99&&$e(k,3)===110?100:p){case 100:case 108:case 109:case 115:us(e,T,T,r&&Jr(vd(e,T,T,0,0,s,a,S,s,C=[],h),E),s,E,h,a,r?C:E);break;default:us(k,T,T,T,[""],E,0,a,E)}}l=u=g=0,f=w=1,S=k="",h=i;break;case 58:h=1+mt(k),g=y;default:if(f<1){if(b==123)--f;else if(b==125&&f++==0&&q4()==125)continue}switch(k+=Js(b),b*f){case 38:w=u>0?1:(k+="\f",-1);break;case 44:a[l++]=(mt(k)-1)*w,w=1;break;case 64:wt()===45&&(k+=ds(Xe())),p=wt(),u=h=mt(S=k+=eC(ls())),b++;break;case 45:y===45&&mt(k)==2&&(f=0)}}return o}function vd(e,t,n,r,s,o,i,a,c,l,u){for(var h=s-1,p=s===0?o:[""],g=Ha(p),y=0,f=0,v=0;y<r;++y)for(var w=0,b=Sr(e,h+1,h=U4(f=i[y])),S=e;w<g;++w)(S=um(f>0?p[w]+" "+b:ue(b,/&\f/g,p[w])))&&(c[v++]=S);return eo(e,t,n,s===0?Fa:a,c,l,u)}function nC(e,t,n){return eo(e,t,n,lm,Js(G4()),Sr(e,2,-2),0)}function xd(e,t,n,r){return eo(e,t,n,Ba,Sr(e,0,r),Sr(e,r+1,-1),r)}function On(e,t){for(var n="",r=Ha(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function rC(e,t,n,r){switch(e.type){case z4:if(e.children.length)break;case H4:case Ba:return e.return=e.return||e.value;case lm:return"";case dm:return e.return=e.value+"{"+On(e.children,r)+"}";case Fa:e.value=e.props.join(",")}return mt(n=On(e.children,r))?e.return=e.value+"{"+n+"}":""}function sC(e){var t=Ha(e);return function(n,r,s,o){for(var i="",a=0;a<t;a++)i+=e[a](n,r,s,o)||"";return i}}function oC(e){return function(t){t.root||(t=t.return)&&e(t)}}function pm(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var iC=function(t,n,r){for(var s=0,o=0;s=o,o=wt(),s===38&&o===12&&(n[r]=1),!Cr(o);)Xe();return Vr(t,Ze)},aC=function(t,n){var r=-1,s=44;do switch(Cr(s)){case 0:s===38&&wt()===12&&(n[r]=1),t[r]+=iC(Ze-1,n,r);break;case 2:t[r]+=ds(s);break;case 4:if(s===44){t[++r]=wt()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Js(s)}while(s=Xe());return t},cC=function(t,n){return mm(aC(hm(t),n))},bd=new WeakMap,lC=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!bd.get(r))&&!s){bd.set(t,!0);for(var o=[],i=cC(n,o),a=r.props,c=0,l=0;c<i.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=o[c]?i[c].replace(/&\f/g,a[u]):a[u]+" "+i[c]}}},dC=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function gm(e,t){switch(Z4(e,t)){case 5103:return de+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return de+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return de+e+As+e+Be+e+e;case 6828:case 4268:return de+e+Be+e+e;case 6165:return de+e+Be+"flex-"+e+e;case 5187:return de+e+ue(e,/(\w+).+(:[^]+)/,de+"box-$1$2"+Be+"flex-$1$2")+e;case 5443:return de+e+Be+"flex-item-"+ue(e,/flex-|-self/,"")+e;case 4675:return de+e+Be+"flex-line-pack"+ue(e,/align-content|flex-|-self/,"")+e;case 5548:return de+e+Be+ue(e,"shrink","negative")+e;case 5292:return de+e+Be+ue(e,"basis","preferred-size")+e;case 6060:return de+"box-"+ue(e,"-grow","")+de+e+Be+ue(e,"grow","positive")+e;case 4554:return de+ue(e,/([^-])(transform)/g,"$1"+de+"$2")+e;case 6187:return ue(ue(ue(e,/(zoom-|grab)/,de+"$1"),/(image-set)/,de+"$1"),e,"")+e;case 5495:case 3959:return ue(e,/(image-set\([^]*)/,de+"$1$`$1");case 4968:return ue(ue(e,/(.+:)(flex-)?(.*)/,de+"box-pack:$3"+Be+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+de+e+e;case 4095:case 3583:case 4068:case 2532:return ue(e,/(.+)-inline(.+)/,de+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(mt(e)-1-t>6)switch($e(e,t+1)){case 109:if($e(e,t+4)!==45)break;case 102:return ue(e,/(.+:)(.+)-([^]+)/,"$1"+de+"$2-$3$1"+As+($e(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ji(e,"stretch")?gm(ue(e,"stretch","fill-available"),t)+e:e}break;case 4949:if($e(e,t+1)!==115)break;case 6444:switch($e(e,mt(e)-3-(~ji(e,"!important")&&10))){case 107:return ue(e,":",":"+de)+e;case 101:return ue(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+de+($e(e,14)===45?"inline-":"")+"box$3$1"+de+"$2$3$1"+Be+"$2box$3")+e}break;case 5936:switch($e(e,t+11)){case 114:return de+e+Be+ue(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return de+e+Be+ue(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return de+e+Be+ue(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return de+e+Be+e+e}return e}var uC=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Ba:t.return=gm(t.value,t.length);break;case dm:return On([nr(t,{value:ue(t.value,"@","@"+de)})],s);case Fa:if(t.length)return Y4(t.props,function(o){switch(K4(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return On([nr(t,{props:[ue(o,/:(read-\w+)/,":"+As+"$1")]})],s);case"::placeholder":return On([nr(t,{props:[ue(o,/:(plac\w+)/,":"+de+"input-$1")]}),nr(t,{props:[ue(o,/:(plac\w+)/,":"+As+"$1")]}),nr(t,{props:[ue(o,/:(plac\w+)/,Be+"input-$1")]})],s)}return""})}},fC=[uC],hC=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(f){var v=f.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(f),f.setAttribute("data-s",""))})}var s=t.stylisPlugins||fC,o={},i,a=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(f){for(var v=f.getAttribute("data-emotion").split(" "),w=1;w<v.length;w++)o[v[w]]=!0;a.push(f)});var c,l=[lC,dC];{var u,h=[rC,oC(function(f){u.insert(f)})],p=sC(l.concat(s,h)),g=function(v){return On(tC(v),p)};c=function(v,w,b,S){u=b,g(v?v+"{"+w.styles+"}":w.styles),S&&(y.inserted[w.name]=!0)}}var y={key:n,sheet:new B4({key:n,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:c};return y.sheet.hydrate(a),y},mC=!0;function pC(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var ym=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||mC===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},gC=function(t,n,r){ym(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+s:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function yC(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var vC={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},xC=/[A-Z]|^ms/g,bC=/_EMO_([^_]+?)_([^]*?)_EMO_/g,vm=function(t){return t.charCodeAt(1)===45},wd=function(t){return t!=null&&typeof t!="boolean"},Ho=pm(function(e){return vm(e)?e:e.replace(xC,"-$&").toLowerCase()}),Sd=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(bC,function(r,s,o){return pt={name:s,styles:o,next:pt},s})}return vC[t]!==1&&!vm(t)&&typeof n=="number"&&n!==0?n+"px":n};function Er(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return pt={name:s.name,styles:s.styles,next:pt},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)pt={name:i.name,styles:i.styles,next:pt},i=i.next;var a=o.styles+";";return a}return wC(e,t,n)}case"function":{if(e!==void 0){var c=pt,l=n(e);return pt=c,Er(e,t,l)}break}}var u=n;if(t==null)return u;var h=t[u];return h!==void 0?h:u}function wC(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Er(e,t,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":wd(a)&&(r+=Ho(o)+":"+Sd(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&(t==null||t[i[0]]===void 0))for(var c=0;c<i.length;c++)wd(i[c])&&(r+=Ho(o)+":"+Sd(o,i[c])+";");else{var l=Er(e,t,i);switch(o){case"animation":case"animationName":{r+=Ho(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var Cd=/label:\s*([^\s;{]+)\s*(;|$)/g,pt;function xm(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";pt=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,s+=Er(n,t,o);else{var i=o;s+=i[0]}for(var a=1;a<e.length;a++)if(s+=Er(n,t,e[a]),r){var c=o;s+=c[a]}Cd.lastIndex=0;for(var l="",u;(u=Cd.exec(s))!==null;)l+="-"+u[1];var h=yC(s)+l;return{name:h,styles:s,next:pt}}var SC=function(t){return t()},CC=m.useInsertionEffect?m.useInsertionEffect:!1,EC=CC||SC,bm=m.createContext(typeof HTMLElement<"u"?hC({key:"css"}):null);bm.Provider;var kC=function(t){return A.forwardRef(function(n,r){var s=A.useContext(bm);return t(n,s,r)})},TC=m.createContext({}),AC=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,PC=pm(function(e){return AC.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),MC=PC,RC=function(t){return t!=="theme"},Ed=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?MC:RC},kd=function(t,n,r){var s;if(n){var o=n.shouldForwardProp;s=t.__emotion_forwardProp&&o?function(i){return t.__emotion_forwardProp(i)&&o(i)}:o}return typeof s!="function"&&r&&(s=t.__emotion_forwardProp),s},NC=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return ym(n,r,s),EC(function(){return gC(n,r,s)}),null},jC=function e(t,n){var r=t.__emotion_real===t,s=r&&t.__emotion_base||t,o,i;n!==void 0&&(o=n.label,i=n.target);var a=kd(t,n,r),c=a||Ed(s),l=!c("as");return function(){var u=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)h.push.apply(h,u);else{var p=u[0];h.push(p[0]);for(var g=u.length,y=1;y<g;y++)h.push(u[y],p[y])}var f=kC(function(v,w,b){var S=l&&v.as||s,C="",E=[],T=v;if(v.theme==null){T={};for(var k in v)T[k]=v[k];T.theme=m.useContext(TC)}typeof v.className=="string"?C=pC(w.registered,E,v.className):v.className!=null&&(C=v.className+" ");var P=xm(h.concat(E),w.registered,T);C+=w.key+"-"+P.name,i!==void 0&&(C+=" "+i);var $=l&&a===void 0?Ed(S):c,x={};for(var I in v)l&&I==="as"||$(I)&&(x[I]=v[I]);return x.className=C,b&&(x.ref=b),m.createElement(m.Fragment,null,m.createElement(NC,{cache:w,serialized:P,isStringTag:typeof S=="string"}),m.createElement(S,x))});return f.displayName=o!==void 0?o:"Styled("+(typeof s=="string"?s:s.displayName||s.name||"Component")+")",f.defaultProps=t.defaultProps,f.__emotion_real=f,f.__emotion_base=s,f.__emotion_styles=h,f.__emotion_forwardProp=a,Object.defineProperty(f,"toString",{value:function(){return"."+i}}),f.withComponent=function(v,w){var b=e(v,Ni({},n,w,{shouldForwardProp:kd(f,w,!0)}));return b.apply(void 0,h)},f}},VC=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ii=jC.bind(null);VC.forEach(function(e){Ii[e]=Ii(e)});/**
123
+ `)),()=>{})}function ya(e){return kr(e,"spacing",8,"spacing")}function Er(e,t){return typeof t=="string"||t==null?t:e(t)}function Nw(e,t){return n=>e.reduce((r,s)=>(r[s]=Er(t,n),r),{})}function Rw(e,t,n,r){if(!t.includes(n))return null;const s=Pw(n),o=Nw(s,r),i=e[n];return Pt(e,i,o)}function wh(e,t){const n=ya(e.theme);return Object.keys(e).map(r=>Rw(e,t,r,n)).reduce(or,{})}function ve(e){return wh(e,js)}ve.propTypes=process.env.NODE_ENV!=="production"?js.reduce((e,t)=>(e[t]=Ut,e),{}):{};ve.filterProps=js;function we(e){return wh(e,Ps)}we.propTypes=process.env.NODE_ENV!=="production"?Ps.reduce((e,t)=>(e[t]=Ut,e),{}):{};we.filterProps=Ps;process.env.NODE_ENV!=="production"&&Mw.reduce((e,t)=>(e[t]=Ut,e),{});function Ms(...e){const t=e.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),n=r=>Object.keys(r).reduce((s,o)=>t[o]?or(s,t[o](r)):s,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,s)=>Object.assign(r,s.propTypes),{}):{},n.filterProps=e.reduce((r,s)=>r.concat(s.filterProps),[]),n}function Xe(e){return typeof e!="number"?e:`${e}px solid`}function Qe(e,t){return Ae({prop:e,themeKey:"borders",transform:t})}const Vw=Qe("border",Xe),Iw=Qe("borderTop",Xe),Dw=Qe("borderRight",Xe),Ow=Qe("borderBottom",Xe),Lw=Qe("borderLeft",Xe),$w=Qe("borderColor"),Fw=Qe("borderTopColor"),_w=Qe("borderRightColor"),Bw=Qe("borderBottomColor"),Hw=Qe("borderLeftColor"),zw=Qe("outline",Xe),Uw=Qe("outlineColor"),Ns=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=kr(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Er(t,r)});return Pt(e,e.borderRadius,n)}return null};Ns.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Ut}:{};Ns.filterProps=["borderRadius"];Ms(Vw,Iw,Dw,Ow,Lw,$w,Fw,_w,Bw,Hw,Ns,zw,Uw);const Rs=e=>{if(e.gap!==void 0&&e.gap!==null){const t=kr(e.theme,"spacing",8,"gap"),n=r=>({gap:Er(t,r)});return Pt(e,e.gap,n)}return null};Rs.propTypes=process.env.NODE_ENV!=="production"?{gap:Ut}:{};Rs.filterProps=["gap"];const Vs=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=kr(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Er(t,r)});return Pt(e,e.columnGap,n)}return null};Vs.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Ut}:{};Vs.filterProps=["columnGap"];const Is=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=kr(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Er(t,r)});return Pt(e,e.rowGap,n)}return null};Is.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Ut}:{};Is.filterProps=["rowGap"];const Ww=Ae({prop:"gridColumn"}),Zw=Ae({prop:"gridRow"}),Kw=Ae({prop:"gridAutoFlow"}),Gw=Ae({prop:"gridAutoColumns"}),Yw=Ae({prop:"gridAutoRows"}),qw=Ae({prop:"gridTemplateColumns"}),Xw=Ae({prop:"gridTemplateRows"}),Jw=Ae({prop:"gridTemplateAreas"}),Qw=Ae({prop:"gridArea"});Ms(Rs,Vs,Is,Ww,Zw,Kw,Gw,Yw,qw,Xw,Jw,Qw);function Tn(e,t){return t==="grey"?t:e}const eS=Ae({prop:"color",themeKey:"palette",transform:Tn}),tS=Ae({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Tn}),nS=Ae({prop:"backgroundColor",themeKey:"palette",transform:Tn});Ms(eS,tS,nS);function Ue(e){return e<=1&&e!==0?`${e*100}%`:e}const rS=Ae({prop:"width",transform:Ue}),xa=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var s,o,i,a,c;const r=((i=(o=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:o.values)==null?void 0:i[n])||As[n];return r?((c=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ue(n)}};return Pt(e,e.maxWidth,t)}return null};xa.filterProps=["maxWidth"];const sS=Ae({prop:"minWidth",transform:Ue}),oS=Ae({prop:"height",transform:Ue}),iS=Ae({prop:"maxHeight",transform:Ue}),aS=Ae({prop:"minHeight",transform:Ue});Ae({prop:"size",cssProperty:"width",transform:Ue});Ae({prop:"size",cssProperty:"height",transform:Ue});const cS=Ae({prop:"boxSizing"});Ms(rS,xa,sS,oS,iS,aS,cS);const Ds={border:{themeKey:"borders",transform:Xe},borderTop:{themeKey:"borders",transform:Xe},borderRight:{themeKey:"borders",transform:Xe},borderBottom:{themeKey:"borders",transform:Xe},borderLeft:{themeKey:"borders",transform:Xe},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Xe},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ns},color:{themeKey:"palette",transform:Tn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Tn},backgroundColor:{themeKey:"palette",transform:Tn},p:{style:we},pt:{style:we},pr:{style:we},pb:{style:we},pl:{style:we},px:{style:we},py:{style:we},padding:{style:we},paddingTop:{style:we},paddingRight:{style:we},paddingBottom:{style:we},paddingLeft:{style:we},paddingX:{style:we},paddingY:{style:we},paddingInline:{style:we},paddingInlineStart:{style:we},paddingInlineEnd:{style:we},paddingBlock:{style:we},paddingBlockStart:{style:we},paddingBlockEnd:{style:we},m:{style:ve},mt:{style:ve},mr:{style:ve},mb:{style:ve},ml:{style:ve},mx:{style:ve},my:{style:ve},margin:{style:ve},marginTop:{style:ve},marginRight:{style:ve},marginBottom:{style:ve},marginLeft:{style:ve},marginX:{style:ve},marginY:{style:ve},marginInline:{style:ve},marginInlineStart:{style:ve},marginInlineEnd:{style:ve},marginBlock:{style:ve},marginBlockStart:{style:ve},marginBlockEnd:{style:ve},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Rs},rowGap:{style:Is},columnGap:{style:Vs},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ue},maxWidth:{style:xa},minWidth:{transform:Ue},height:{transform:Ue},maxHeight:{transform:Ue},minHeight:{transform:Ue},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function lS(...e){const t=e.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function dS(e,t){return typeof e=="function"?e(t):e}function uS(){function e(n,r,s,o){const i={[n]:r,theme:s},a=o[n];if(!a)return{[n]:r};const{cssProperty:c=n,themeKey:l,transform:u,style:f}=a;if(r==null)return null;if(l==="typography"&&r==="inherit")return{[n]:r};const h=Ts(s,l)||{};return f?f(i):Pt(i,r,y=>{let p=fs(h,u,y);return y===p&&typeof y=="string"&&(p=fs(h,u,`${n}${y==="default"?"":cn(y)}`,y)),c===!1?p:{[c]:p}})}function t(n){const{sx:r,theme:s={},nested:o}=n||{};if(!r)return null;const i=s.unstable_sxConfig??Ds;function a(c){let l=c;if(typeof c=="function")l=c(s);else if(typeof c!="object")return c;if(!l)return null;const u=Ew(s.breakpoints),f=Object.keys(u);let h=u;return Object.keys(l).forEach(g=>{const y=dS(l[g],s);if(y!=null)if(typeof y=="object")if(i[g])h=or(h,e(g,y,s,i));else{const p=Pt({theme:s},y,x=>({[g]:x}));lS(p,y)?h[g]=t({sx:y,theme:s,nested:!0}):h=or(h,p)}else h=or(h,e(g,y,s,i))}),!o&&s.modularCssLayers?{"@layer sx":Ol(s,$l(f,h))}:Ol(s,$l(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const In=uS();In.filterProps=["sx"];function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(null,arguments)}function fS(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function hS(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var mS=function(){function e(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(hS(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=fS(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Oe="-ms-",hs="-moz-",le="-webkit-",Sh="comm",ba="rule",va="decl",pS="@import",Ch="@keyframes",gS="@layer",yS=Math.abs,Os=String.fromCharCode,xS=Object.assign;function bS(e,t){return Re(e,0)^45?(((t<<2^Re(e,0))<<2^Re(e,1))<<2^Re(e,2))<<2^Re(e,3):0}function kh(e){return e.trim()}function vS(e,t){return(e=t.exec(e))?e[0]:e}function de(e,t,n){return e.replace(t,n)}function fi(e,t){return e.indexOf(t)}function Re(e,t){return e.charCodeAt(t)|0}function pr(e,t,n){return e.slice(t,n)}function dt(e){return e.length}function wa(e){return e.length}function Br(e,t){return t.push(e),e}function wS(e,t){return e.map(t).join("")}var Ls=1,Dn=1,Eh=0,He=0,Pe=0,Wn="";function $s(e,t,n,r,s,o,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:Ls,column:Dn,length:i,return:""}}function Yn(e,t){return xS($s("",null,null,"",null,null,0),e,{length:-e.length},t)}function SS(){return Pe}function CS(){return Pe=He>0?Re(Wn,--He):0,Dn--,Pe===10&&(Dn=1,Ls--),Pe}function Ke(){return Pe=He<Eh?Re(Wn,He++):0,Dn++,Pe===10&&(Dn=1,Ls++),Pe}function gt(){return Re(Wn,He)}function qr(){return He}function Ar(e,t){return pr(Wn,e,t)}function gr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ah(e){return Ls=Dn=1,Eh=dt(Wn=e),He=0,[]}function Th(e){return Wn="",e}function Xr(e){return kh(Ar(He-1,hi(e===91?e+2:e===40?e+1:e)))}function kS(e){for(;(Pe=gt())&&Pe<33;)Ke();return gr(e)>2||gr(Pe)>3?"":" "}function ES(e,t){for(;--t&&Ke()&&!(Pe<48||Pe>102||Pe>57&&Pe<65||Pe>70&&Pe<97););return Ar(e,qr()+(t<6&&gt()==32&&Ke()==32))}function hi(e){for(;Ke();)switch(Pe){case e:return He;case 34:case 39:e!==34&&e!==39&&hi(Pe);break;case 40:e===41&&hi(e);break;case 92:Ke();break}return He}function AS(e,t){for(;Ke()&&e+Pe!==57;)if(e+Pe===84&&gt()===47)break;return"/*"+Ar(t,He-1)+"*"+Os(e===47?e:Ke())}function TS(e){for(;!gr(gt());)Ke();return Ar(e,He)}function jS(e){return Th(Jr("",null,null,null,[""],e=Ah(e),0,[0],e))}function Jr(e,t,n,r,s,o,i,a,c){for(var l=0,u=0,f=i,h=0,g=0,y=0,p=1,x=1,w=1,v=0,S="",C=s,E=o,T=r,k=S;x;)switch(y=v,v=Ke()){case 40:if(y!=108&&Re(k,f-1)==58){fi(k+=de(Xr(v),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:k+=Xr(v);break;case 9:case 10:case 13:case 32:k+=kS(y);break;case 92:k+=ES(qr()-1,7);continue;case 47:switch(gt()){case 42:case 47:Br(PS(AS(Ke(),qr()),t,n),c);break;default:k+="/"}break;case 123*p:a[l++]=dt(k)*w;case 125*p:case 59:case 0:switch(v){case 0:case 125:x=0;case 59+u:w==-1&&(k=de(k,/\f/g,"")),g>0&&dt(k)-f&&Br(g>32?Bl(k+";",r,n,f-1):Bl(de(k," ","")+";",r,n,f-2),c);break;case 59:k+=";";default:if(Br(T=_l(k,t,n,l,u,s,a,S,C=[],E=[],f),o),v===123)if(u===0)Jr(k,t,T,T,C,o,f,a,E);else switch(h===99&&Re(k,3)===110?100:h){case 100:case 108:case 109:case 115:Jr(e,T,T,r&&Br(_l(e,T,T,0,0,s,a,S,s,C=[],f),E),s,E,f,a,r?C:E);break;default:Jr(k,T,T,T,[""],E,0,a,E)}}l=u=g=0,p=w=1,S=k="",f=i;break;case 58:f=1+dt(k),g=y;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&CS()==125)continue}switch(k+=Os(v),v*p){case 38:w=u>0?1:(k+="\f",-1);break;case 44:a[l++]=(dt(k)-1)*w,w=1;break;case 64:gt()===45&&(k+=Xr(Ke())),h=gt(),u=f=dt(S=k+=TS(qr())),v++;break;case 45:y===45&&dt(k)==2&&(p=0)}}return o}function _l(e,t,n,r,s,o,i,a,c,l,u){for(var f=s-1,h=s===0?o:[""],g=wa(h),y=0,p=0,x=0;y<r;++y)for(var w=0,v=pr(e,f+1,f=yS(p=i[y])),S=e;w<g;++w)(S=kh(p>0?h[w]+" "+v:de(v,/&\f/g,h[w])))&&(c[x++]=S);return $s(e,t,n,s===0?ba:a,c,l,u)}function PS(e,t,n){return $s(e,t,n,Sh,Os(SS()),pr(e,2,-2),0)}function Bl(e,t,n,r){return $s(e,t,n,va,pr(e,0,r),pr(e,r+1,-1),r)}function jn(e,t){for(var n="",r=wa(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function MS(e,t,n,r){switch(e.type){case gS:if(e.children.length)break;case pS:case va:return e.return=e.return||e.value;case Sh:return"";case Ch:return e.return=e.value+"{"+jn(e.children,r)+"}";case ba:e.value=e.props.join(",")}return dt(n=jn(e.children,r))?e.return=e.value+"{"+n+"}":""}function NS(e){var t=wa(e);return function(n,r,s,o){for(var i="",a=0;a<t;a++)i+=e[a](n,r,s,o)||"";return i}}function RS(e){return function(t){t.root||(t=t.return)&&e(t)}}function jh(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var VS=function(t,n,r){for(var s=0,o=0;s=o,o=gt(),s===38&&o===12&&(n[r]=1),!gr(o);)Ke();return Ar(t,He)},IS=function(t,n){var r=-1,s=44;do switch(gr(s)){case 0:s===38&&gt()===12&&(n[r]=1),t[r]+=VS(He-1,n,r);break;case 2:t[r]+=Xr(s);break;case 4:if(s===44){t[++r]=gt()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Os(s)}while(s=Ke());return t},DS=function(t,n){return Th(IS(Ah(t),n))},Hl=new WeakMap,OS=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Hl.get(r))&&!s){Hl.set(t,!0);for(var o=[],i=DS(n,o),a=r.props,c=0,l=0;c<i.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=o[c]?i[c].replace(/&\f/g,a[u]):a[u]+" "+i[c]}}},LS=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Ph(e,t){switch(bS(e,t)){case 5103:return le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return le+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return le+e+hs+e+Oe+e+e;case 6828:case 4268:return le+e+Oe+e+e;case 6165:return le+e+Oe+"flex-"+e+e;case 5187:return le+e+de(e,/(\w+).+(:[^]+)/,le+"box-$1$2"+Oe+"flex-$1$2")+e;case 5443:return le+e+Oe+"flex-item-"+de(e,/flex-|-self/,"")+e;case 4675:return le+e+Oe+"flex-line-pack"+de(e,/align-content|flex-|-self/,"")+e;case 5548:return le+e+Oe+de(e,"shrink","negative")+e;case 5292:return le+e+Oe+de(e,"basis","preferred-size")+e;case 6060:return le+"box-"+de(e,"-grow","")+le+e+Oe+de(e,"grow","positive")+e;case 4554:return le+de(e,/([^-])(transform)/g,"$1"+le+"$2")+e;case 6187:return de(de(de(e,/(zoom-|grab)/,le+"$1"),/(image-set)/,le+"$1"),e,"")+e;case 5495:case 3959:return de(e,/(image-set\([^]*)/,le+"$1$`$1");case 4968:return de(de(e,/(.+:)(flex-)?(.*)/,le+"box-pack:$3"+Oe+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+le+e+e;case 4095:case 3583:case 4068:case 2532:return de(e,/(.+)-inline(.+)/,le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(dt(e)-1-t>6)switch(Re(e,t+1)){case 109:if(Re(e,t+4)!==45)break;case 102:return de(e,/(.+:)(.+)-([^]+)/,"$1"+le+"$2-$3$1"+hs+(Re(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fi(e,"stretch")?Ph(de(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Re(e,t+1)!==115)break;case 6444:switch(Re(e,dt(e)-3-(~fi(e,"!important")&&10))){case 107:return de(e,":",":"+le)+e;case 101:return de(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+le+(Re(e,14)===45?"inline-":"")+"box$3$1"+le+"$2$3$1"+Oe+"$2box$3")+e}break;case 5936:switch(Re(e,t+11)){case 114:return le+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return le+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return le+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return le+e+Oe+e+e}return e}var $S=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case va:t.return=Ph(t.value,t.length);break;case Ch:return jn([Yn(t,{value:de(t.value,"@","@"+le)})],s);case ba:if(t.length)return wS(t.props,function(o){switch(vS(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return jn([Yn(t,{props:[de(o,/:(read-\w+)/,":"+hs+"$1")]})],s);case"::placeholder":return jn([Yn(t,{props:[de(o,/:(plac\w+)/,":"+le+"input-$1")]}),Yn(t,{props:[de(o,/:(plac\w+)/,":"+hs+"$1")]}),Yn(t,{props:[de(o,/:(plac\w+)/,Oe+"input-$1")]})],s)}return""})}},FS=[$S],_S=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var x=p.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var s=t.stylisPlugins||FS,o={},i,a=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var x=p.getAttribute("data-emotion").split(" "),w=1;w<x.length;w++)o[x[w]]=!0;a.push(p)});var c,l=[OS,LS];{var u,f=[MS,RS(function(p){u.insert(p)})],h=NS(l.concat(s,f)),g=function(x){return jn(jS(x),h)};c=function(x,w,v,S){u=v,g(x?x+"{"+w.styles+"}":w.styles),S&&(y.inserted[w.name]=!0)}}var y={key:n,sheet:new mS({key:n,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:c};return y.sheet.hydrate(a),y},BS=!0;function HS(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Mh=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||BS===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},zS=function(t,n,r){Mh(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+s:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function US(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var WS={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ZS=/[A-Z]|^ms/g,KS=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Nh=function(t){return t.charCodeAt(1)===45},zl=function(t){return t!=null&&typeof t!="boolean"},Co=jh(function(e){return Nh(e)?e:e.replace(ZS,"-$&").toLowerCase()}),Ul=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(KS,function(r,s,o){return ut={name:s,styles:o,next:ut},s})}return WS[t]!==1&&!Nh(t)&&typeof n=="number"&&n!==0?n+"px":n};function yr(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return ut={name:s.name,styles:s.styles,next:ut},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)ut={name:i.name,styles:i.styles,next:ut},i=i.next;var a=o.styles+";";return a}return GS(e,t,n)}case"function":{if(e!==void 0){var c=ut,l=n(e);return ut=c,yr(e,t,l)}break}}var u=n;if(t==null)return u;var f=t[u];return f!==void 0?f:u}function GS(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=yr(e,t,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":zl(a)&&(r+=Co(o)+":"+Ul(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&(t==null||t[i[0]]===void 0))for(var c=0;c<i.length;c++)zl(i[c])&&(r+=Co(o)+":"+Ul(o,i[c])+";");else{var l=yr(e,t,i);switch(o){case"animation":case"animationName":{r+=Co(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var Wl=/label:\s*([^\s;{]+)\s*(;|$)/g,ut;function Rh(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";ut=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,s+=yr(n,t,o);else{var i=o;s+=i[0]}for(var a=1;a<e.length;a++)if(s+=yr(n,t,e[a]),r){var c=o;s+=c[a]}Wl.lastIndex=0;for(var l="",u;(u=Wl.exec(s))!==null;)l+="-"+u[1];var f=US(s)+l;return{name:f,styles:s,next:ut}}var YS=function(t){return t()},qS=m.useInsertionEffect?m.useInsertionEffect:!1,XS=qS||YS,Vh=m.createContext(typeof HTMLElement<"u"?_S({key:"css"}):null);Vh.Provider;var JS=function(t){return A.forwardRef(function(n,r){var s=A.useContext(Vh);return t(n,s,r)})},QS=m.createContext({}),e4=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,t4=jh(function(e){return e4.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),n4=t4,r4=function(t){return t!=="theme"},Zl=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?n4:r4},Kl=function(t,n,r){var s;if(n){var o=n.shouldForwardProp;s=t.__emotion_forwardProp&&o?function(i){return t.__emotion_forwardProp(i)&&o(i)}:o}return typeof s!="function"&&r&&(s=t.__emotion_forwardProp),s},s4=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return Mh(n,r,s),XS(function(){return zS(n,r,s)}),null},o4=function e(t,n){var r=t.__emotion_real===t,s=r&&t.__emotion_base||t,o,i;n!==void 0&&(o=n.label,i=n.target);var a=Kl(t,n,r),c=a||Zl(s),l=!c("as");return function(){var u=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var h=u[0];f.push(h[0]);for(var g=u.length,y=1;y<g;y++)f.push(u[y],h[y])}var p=JS(function(x,w,v){var S=l&&x.as||s,C="",E=[],T=x;if(x.theme==null){T={};for(var k in x)T[k]=x[k];T.theme=m.useContext(QS)}typeof x.className=="string"?C=HS(w.registered,E,x.className):x.className!=null&&(C=x.className+" ");var j=Rh(f.concat(E),w.registered,T);C+=w.key+"-"+j.name,i!==void 0&&(C+=" "+i);var $=l&&a===void 0?Zl(S):c,b={};for(var I in x)l&&I==="as"||$(I)&&(b[I]=x[I]);return b.className=C,v&&(b.ref=v),m.createElement(m.Fragment,null,m.createElement(s4,{cache:w,serialized:j,isStringTag:typeof S=="string"}),m.createElement(S,b))});return p.displayName=o!==void 0?o:"Styled("+(typeof s=="string"?s:s.displayName||s.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=s,p.__emotion_styles=f,p.__emotion_forwardProp=a,Object.defineProperty(p,"toString",{value:function(){return"."+i}}),p.withComponent=function(x,w){var v=e(x,ui({},n,w,{shouldForwardProp:Kl(p,w,!0)}));return v.apply(void 0,f)},p}},i4=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],mi=o4.bind(null);i4.forEach(function(e){mi[e]=mi(e)});/**
194
124
  * @mui/styled-engine v7.2.0
195
125
  *
196
126
  * @license MIT
197
127
  * This source code is licensed under the MIT license found in the
198
128
  * LICENSE file in the root directory of this source tree.
199
- */function IC(e,t){const n=Ii(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const s=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${s})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
200
- `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${s})(...args) API requires all its args to be defined.`),n(...r)}:n}function DC(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Td=[];function on(e){return Td[0]=e,xm(Td)}const OC=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function $C(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...s}=e,o=OC(t),i=Object.keys(o);function a(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function l(p,g){const y=i.indexOf(g);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(y!==-1&&typeof t[i[y]]=="number"?t[i[y]]:g)-r/100}${n})`}function u(p){return i.indexOf(p)+1<i.length?l(p,i[i.indexOf(p)+1]):a(p)}function h(p){const g=i.indexOf(p);return g===0?a(i[1]):g===i.length-1?c(i[g]):l(p,i[i.indexOf(p)+1]).replace("@media","@media not all and")}return{keys:i,values:o,up:a,down:c,between:l,only:u,not:h,unit:n,...s}}const LC={borderRadius:4};function wm(e=8,t=La({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const i=t(o);return typeof i=="number"?`${i}px`:i}).join(" "));return n.mui=!0,n}function _C(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(e);return s==="&"?t:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:t})}return n.palette.mode===e?t:{}}function Sm(e={},...t){const{breakpoints:n={},palette:r={},spacing:s,shape:o={},...i}=e,a=$C(n),c=wm(s);let l=qe({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...LC,...o}},i);return l=qS(l),l.applyStyles=_C,l=t.reduce((u,h)=>qe(u,h),l),l.unstable_sxConfig={...Xs,...i==null?void 0:i.unstable_sxConfig},l.unstable_sx=function(h){return Bn({sx:h,theme:this})},l}const FC={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function za(e,t,n="Mui"){const r=FC[t];return r?`${n}-${r}`:`${IS.generate(e)}-${t}`}function BC(e,t,n="Mui"){const r={};return t.forEach(s=>{r[s]=za(e,s,n)}),r}function Cm(e,t=""){return e.displayName||e.name||t}function Ad(e,t,n){const r=Cm(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function HC(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Cm(e,"Component");if(typeof e=="object")switch(e.$$typeof){case ks.ForwardRef:return Ad(e,e.render,"ForwardRef");case ks.Memo:return Ad(e,e.type,"memo");default:return}}}function Em(e){const{variants:t,...n}=e,r={variants:t,style:on(n),isProcessed:!0};return r.style===n||t&&t.forEach(s=>{typeof s.style!="function"&&(s.style=on(s.style))}),r}const zC=Sm();function zo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function nn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function UC(e){return e?(t,n)=>n[e]:null}function WC(e,t,n){e.theme=GC(e.theme)?n:e.theme[t]||e.theme}function fs(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(s=>fs(e,s,n));if(Array.isArray(r==null?void 0:r.variants)){let s;if(r.isProcessed)s=n?nn(r.style,n):r.style;else{const{variants:o,...i}=r;s=n?nn(on(i),n):i}return km(e,r.variants,[s],n)}return r!=null&&r.isProcessed?n?nn(on(r.style),n):r.style:n?nn(on(r),n):r}function km(e,t,n=[],r=void 0){var o;let s;e:for(let i=0;i<t.length;i+=1){const a=t[i];if(typeof a.props=="function"){if(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(s))continue}else for(const c in a.props)if(e[c]!==a.props[c]&&((o=e.ownerState)==null?void 0:o[c])!==a.props[c])continue e;typeof a.style=="function"?(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?nn(on(a.style(s)),r):a.style(s))):n.push(r?nn(on(a.style),r):a.style)}return n}function ZC(e={}){const{themeId:t,defaultTheme:n=zC,rootShouldForwardProp:r=zo,slotShouldForwardProp:s=zo}=e;function o(a){WC(a,t,n)}return(a,c={})=>{DC(a,T=>T.filter(k=>k!==Bn));const{name:l,slot:u,skipVariantsResolver:h,skipSx:p,overridesResolver:g=UC(Tm(u)),...y}=c,f=l&&l.startsWith("Mui")||u?"components":"custom",v=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,w=p||!1;let b=zo;u==="Root"||u==="root"?b=r:u?b=s:qC(a)&&(b=void 0);const S=IC(a,{shouldForwardProp:b,label:YC(l,u),...y}),C=T=>{if(T.__emotion_real===T)return T;if(typeof T=="function")return function(P){return fs(P,T,P.theme.modularCssLayers?f:void 0)};if(Pt(T)){const k=Em(T);return function($){return k.variants?fs($,k,$.theme.modularCssLayers?f:void 0):$.theme.modularCssLayers?nn(k.style,f):k.style}}return T},E=(...T)=>{const k=[],P=T.map(C),$=[];if(k.push(o),l&&g&&$.push(function(K){var U,M;const X=(M=(U=K.theme.components)==null?void 0:U[l])==null?void 0:M.styleOverrides;if(!X)return null;const G={};for(const q in X)G[q]=fs(K,X[q],K.theme.modularCssLayers?"theme":void 0);return g(K,G)}),l&&!v&&$.push(function(K){var G,U;const Y=K.theme,X=(U=(G=Y==null?void 0:Y.components)==null?void 0:G[l])==null?void 0:U.variants;return X?km(K,X,[],K.theme.modularCssLayers?"theme":void 0):null}),w||$.push(Bn),Array.isArray(P[0])){const _=P.shift(),K=new Array(k.length).fill(""),Y=new Array($.length).fill("");let X;X=[...K,..._,...Y],X.raw=[...K,..._.raw,...Y],k.unshift(X)}const x=[...k,...P,...$],I=S(...x);return a.muiName&&(I.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(I.displayName=KC(l,u,a)),I};return S.withConfig&&(E.withConfig=S.withConfig),E}}function KC(e,t,n){return e?`${e}${fn(t||"")}`:`Styled(${HC(n)})`}function YC(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Tm(t||"Root")}`),n}function GC(e){for(const t in e)return!1;return!0}function qC(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Tm(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Di(e,t,n=!1){const r={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const o=s;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],a=t[o];if(!a)r[o]=i||{};else if(!i)r[o]=a;else{r[o]={...a};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const l=c;r[o][l]=Di(i[l],a[l],n)}}}else o==="className"&&n&&t.className?r.className=Bi(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function XC(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Ua(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),XC(e,t,n)}function JC(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Ut(e){if(e.type)return e;if(e.charAt(0)==="#")return Ut(JC(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
201
- The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:zt(9,e));let r=e.substring(t+1,e.length-1),s;if(n==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(s))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${s}\` color space.
202
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:zt(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:s}}const QC=e=>{const t=Ut(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ir=(e,t)=>{try{return QC(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function to(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((s,o)=>o<3?parseInt(s,10):s):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Am(e){e=Ut(e);const{values:t}=e,n=t[0],r=t[1]/100,s=t[2]/100,o=r*Math.min(s,1-s),i=(l,u=(l+n/30)%12)=>s-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const c=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(a+="a",c.push(t[3])),to({type:a,values:c})}function Oi(e){e=Ut(e);let t=e.type==="hsl"||e.type==="hsla"?Ut(Am(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Pd(e,t){const n=Oi(e),r=Oi(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function e8(e,t){return e=Ut(e),t=Ua(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,to(e)}function Qr(e,t,n){try{return e8(e,t)}catch{return e}}function Wa(e,t){if(e=Ut(e),t=Ua(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return to(e)}function ye(e,t,n){try{return Wa(e,t)}catch{return e}}function Za(e,t){if(e=Ut(e),t=Ua(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return to(e)}function ve(e,t,n){try{return Za(e,t)}catch{return e}}function t8(e,t=.15){return Oi(e)>.5?Wa(e,t):Za(e,t)}function es(e,t,n){try{return t8(e,t)}catch{return e}}const n8=m.createContext(void 0);process.env.NODE_ENV!=="production"&&(ce.node,ce.object);function r8(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const s=t.components[n];return s.defaultProps?Di(s.defaultProps,r,t.components.mergeClassNameAndStyle):!s.styleOverrides&&!s.variants?Di(s,r,t.components.mergeClassNameAndStyle):r}function s8({props:e,name:t}){const n=m.useContext(n8);return r8({props:e,name:t,theme:{components:n}})}const Md={theme:void 0};function o8(e){let t,n;return function(s){let o=t;return(o===void 0||s.theme!==n)&&(Md.theme=s.theme,o=Em(e(Md)),t=o,n=s.theme),o}}function i8(e=""){function t(...r){if(!r.length)return"";const s=r[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${s}${t(...r.slice(1))})`:`, ${s}`}return(r,...s)=>`var(--${e?`${e}-`:""}${r}${t(...s)})`}const Rd=(e,t,n,r=[])=>{let s=e;t.forEach((o,i)=>{i===t.length-1?Array.isArray(s)?s[Number(o)]=n:s&&typeof s=="object"&&(s[o]=n):s&&typeof s=="object"&&(s[o]||(s[o]=r.includes(o)?[]:{}),s=s[o])})},a8=(e,t,n)=>{function r(s,o=[],i=[]){Object.entries(s).forEach(([a,c])=>{(!n||n&&!n([...o,a]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,a],Array.isArray(c)?[...i,a]:i):t([...o,a],c,i))})}r(e)},c8=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Uo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},s={},o={},i={};return a8(e,(a,c,l)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(a,c))){const u=`--${n?`${n}-`:""}${a.join("-")}`,h=c8(a,c);Object.assign(s,{[u]:h}),Rd(o,a,`var(${u})`,l),Rd(i,a,`var(${u}, ${h})`,l)}},a=>a[0]==="vars"),{css:s,vars:o,varsWithDefaults:i}}function l8(e,t={}){const{getSelector:n=v,disableCssColorScheme:r,colorSchemeSelector:s}=t,{colorSchemes:o={},components:i,defaultColorScheme:a="light",...c}=e,{vars:l,css:u,varsWithDefaults:h}=Uo(c,t);let p=h;const g={},{[a]:y,...f}=o;if(Object.entries(f||{}).forEach(([S,C])=>{const{vars:E,css:T,varsWithDefaults:k}=Uo(C,t);p=qe(p,k),g[S]={css:T,vars:E}}),y){const{css:S,vars:C,varsWithDefaults:E}=Uo(y,t);p=qe(p,E),g[a]={css:S,vars:C}}function v(S,C){var T,k;let E=s;if(s==="class"&&(E=".%s"),s==="data"&&(E="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(E=`[${s}="%s"]`),S){if(E==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${((k=(T=o[S])==null?void 0:T.palette)==null?void 0:k.mode)||S})`]:{":root":C}};if(E)return e.defaultColorScheme===S?`:root, ${E.replace("%s",String(S))}`:E.replace("%s",String(S))}return":root"}return{vars:p,generateThemeVars:()=>{let S={...l};return Object.entries(g).forEach(([,{vars:C}])=>{S=qe(S,C)}),S},generateStyleSheets:()=>{var P,$;const S=[],C=e.defaultColorScheme||"light";function E(x,I){Object.keys(I).length&&S.push(typeof x=="string"?{[x]:{...I}}:x)}E(n(void 0,{...u}),u);const{[C]:T,...k}=g;if(T){const{css:x}=T,I=($=(P=o[C])==null?void 0:P.palette)==null?void 0:$.mode,_=!r&&I?{colorScheme:I,...x}:{...x};E(n(C,{..._}),_)}return Object.entries(k).forEach(([x,{css:I}])=>{var Y,X;const _=(X=(Y=o[x])==null?void 0:Y.palette)==null?void 0:X.mode,K=!r&&_?{colorScheme:_,...I}:{...I};E(n(x,{...K}),K)}),S}}}function d8(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const kr={black:"#000",white:"#fff"},u8={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},xn={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},bn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},rr={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},wn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Sn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Cn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Pm(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:kr.white,default:kr.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const f8=Pm();function Mm(){return{text:{primary:kr.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:kr.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Nd=Mm();function jd(e,t,n,r){const s=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Za(e.main,s):t==="dark"&&(e.dark=Wa(e.main,o)))}function h8(e="light"){return e==="dark"?{main:wn[200],light:wn[50],dark:wn[400]}:{main:wn[700],light:wn[400],dark:wn[800]}}function m8(e="light"){return e==="dark"?{main:xn[200],light:xn[50],dark:xn[400]}:{main:xn[500],light:xn[300],dark:xn[700]}}function p8(e="light"){return e==="dark"?{main:bn[500],light:bn[300],dark:bn[700]}:{main:bn[700],light:bn[400],dark:bn[800]}}function g8(e="light"){return e==="dark"?{main:Sn[400],light:Sn[300],dark:Sn[700]}:{main:Sn[700],light:Sn[500],dark:Sn[900]}}function y8(e="light"){return e==="dark"?{main:Cn[400],light:Cn[300],dark:Cn[700]}:{main:Cn[800],light:Cn[500],dark:Cn[900]}}function v8(e="light"){return e==="dark"?{main:rr[400],light:rr[300],dark:rr[700]}:{main:"#ed6c02",light:rr[500],dark:rr[900]}}function Ka(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...s}=e,o=e.primary||h8(t),i=e.secondary||m8(t),a=e.error||p8(t),c=e.info||g8(t),l=e.success||y8(t),u=e.warning||v8(t);function h(f){const v=Pd(f,Nd.text.primary)>=n?Nd.text.primary:f8.text.primary;if(process.env.NODE_ENV!=="production"){const w=Pd(f,v);w<3&&console.error([`MUI: The contrast ratio of ${w}:1 for ${v} on ${f}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
203
- `))}return v}const p=({color:f,name:v,mainShade:w=500,lightShade:b=300,darkShade:S=700})=>{if(f={...f},!f.main&&f[w]&&(f.main=f[w]),!f.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${v?` (${v})`:""} provided to augmentColor(color) is invalid.
204
- The color object needs to have a \`main\` property or a \`${w}\` property.`:zt(11,v?` (${v})`:"",w));if(typeof f.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${v?` (${v})`:""} provided to augmentColor(color) is invalid.
205
- \`color.main\` should be a string, but \`${JSON.stringify(f.main)}\` was provided instead.
129
+ */function a4(e,t){const n=mi(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const s=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${s})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
130
+ `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${s})(...args) API requires all its args to be defined.`),n(...r)}:n}function c4(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Gl=[];function tn(e){return Gl[0]=e,Rh(Gl)}const l4=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function d4(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...s}=e,o=l4(t),i=Object.keys(o);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function c(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function l(h,g){const y=i.indexOf(g);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(y!==-1&&typeof t[i[y]]=="number"?t[i[y]]:g)-r/100}${n})`}function u(h){return i.indexOf(h)+1<i.length?l(h,i[i.indexOf(h)+1]):a(h)}function f(h){const g=i.indexOf(h);return g===0?a(i[1]):g===i.length-1?c(i[g]):l(h,i[i.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:i,values:o,up:a,down:c,between:l,only:u,not:f,unit:n,...s}}const u4={borderRadius:4};function Ih(e=8,t=ya({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const i=t(o);return typeof i=="number"?`${i}px`:i}).join(" "));return n.mui=!0,n}function f4(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(e);return s==="&"?t:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:t})}return n.palette.mode===e?t:{}}function Dh(e={},...t){const{breakpoints:n={},palette:r={},spacing:s,shape:o={},...i}=e,a=d4(n),c=Ih(s);let l=Ze({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...u4,...o}},i);return l=Cw(l),l.applyStyles=f4,l=t.reduce((u,f)=>Ze(u,f),l),l.unstable_sxConfig={...Ds,...i==null?void 0:i.unstable_sxConfig},l.unstable_sx=function(f){return In({sx:f,theme:this})},l}const h4={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Sa(e,t,n="Mui"){const r=h4[t];return r?`${n}-${r}`:`${fw.generate(e)}-${t}`}function m4(e,t,n="Mui"){const r={};return t.forEach(s=>{r[s]=Sa(e,s,n)}),r}function Oh(e,t=""){return e.displayName||e.name||t}function Yl(e,t,n){const r=Oh(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function p4(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Oh(e,"Component");if(typeof e=="object")switch(e.$$typeof){case Pn.ForwardRef:return Yl(e,e.render,"ForwardRef");case Pn.Memo:return Yl(e,e.type,"memo");default:return}}}function Lh(e){const{variants:t,...n}=e,r={variants:t,style:tn(n),isProcessed:!0};return r.style===n||t&&t.forEach(s=>{typeof s.style!="function"&&(s.style=tn(s.style))}),r}const g4=Dh();function ko(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Jt(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function y4(e){return e?(t,n)=>n[e]:null}function x4(e,t,n){e.theme=S4(e.theme)?n:e.theme[t]||e.theme}function Qr(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(s=>Qr(e,s,n));if(Array.isArray(r==null?void 0:r.variants)){let s;if(r.isProcessed)s=n?Jt(r.style,n):r.style;else{const{variants:o,...i}=r;s=n?Jt(tn(i),n):i}return $h(e,r.variants,[s],n)}return r!=null&&r.isProcessed?n?Jt(tn(r.style),n):r.style:n?Jt(tn(r),n):r}function $h(e,t,n=[],r=void 0){var o;let s;e:for(let i=0;i<t.length;i+=1){const a=t[i];if(typeof a.props=="function"){if(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(s))continue}else for(const c in a.props)if(e[c]!==a.props[c]&&((o=e.ownerState)==null?void 0:o[c])!==a.props[c])continue e;typeof a.style=="function"?(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Jt(tn(a.style(s)),r):a.style(s))):n.push(r?Jt(tn(a.style),r):a.style)}return n}function b4(e={}){const{themeId:t,defaultTheme:n=g4,rootShouldForwardProp:r=ko,slotShouldForwardProp:s=ko}=e;function o(a){x4(a,t,n)}return(a,c={})=>{c4(a,T=>T.filter(k=>k!==In));const{name:l,slot:u,skipVariantsResolver:f,skipSx:h,overridesResolver:g=y4(Fh(u)),...y}=c,p=l&&l.startsWith("Mui")||u?"components":"custom",x=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,w=h||!1;let v=ko;u==="Root"||u==="root"?v=r:u?v=s:C4(a)&&(v=void 0);const S=a4(a,{shouldForwardProp:v,label:w4(l,u),...y}),C=T=>{if(T.__emotion_real===T)return T;if(typeof T=="function")return function(j){return Qr(j,T,j.theme.modularCssLayers?p:void 0)};if(Ct(T)){const k=Lh(T);return function($){return k.variants?Qr($,k,$.theme.modularCssLayers?p:void 0):$.theme.modularCssLayers?Jt(k.style,p):k.style}}return T},E=(...T)=>{const k=[],j=T.map(C),$=[];if(k.push(o),l&&g&&$.push(function(Z){var z,P;const q=(P=(z=Z.theme.components)==null?void 0:z[l])==null?void 0:P.styleOverrides;if(!q)return null;const G={};for(const Y in q)G[Y]=Qr(Z,q[Y],Z.theme.modularCssLayers?"theme":void 0);return g(Z,G)}),l&&!x&&$.push(function(Z){var G,z;const K=Z.theme,q=(z=(G=K==null?void 0:K.components)==null?void 0:G[l])==null?void 0:z.variants;return q?$h(Z,q,[],Z.theme.modularCssLayers?"theme":void 0):null}),w||$.push(In),Array.isArray(j[0])){const L=j.shift(),Z=new Array(k.length).fill(""),K=new Array($.length).fill("");let q;q=[...Z,...L,...K],q.raw=[...Z,...L.raw,...K],k.unshift(q)}const b=[...k,...j,...$],I=S(...b);return a.muiName&&(I.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(I.displayName=v4(l,u,a)),I};return S.withConfig&&(E.withConfig=S.withConfig),E}}function v4(e,t,n){return e?`${e}${cn(t||"")}`:`Styled(${p4(n)})`}function w4(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Fh(t||"Root")}`),n}function S4(e){for(const t in e)return!1;return!0}function C4(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Fh(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function pi(e,t,n=!1){const r={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const o=s;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],a=t[o];if(!a)r[o]=i||{};else if(!i)r[o]=a;else{r[o]={...a};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const l=c;r[o][l]=pi(i[l],a[l],n)}}}else o==="className"&&n&&t.className?r.className=vi(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function k4(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Ca(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),k4(e,t,n)}function E4(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function _t(e){if(e.type)return e;if(e.charAt(0)==="#")return _t(E4(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
131
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Ft(9,e));let r=e.substring(t+1,e.length-1),s;if(n==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(s))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${s}\` color space.
132
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Ft(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:s}}const A4=e=>{const t=_t(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Qn=(e,t)=>{try{return A4(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Fs(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((s,o)=>o<3?parseInt(s,10):s):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function _h(e){e=_t(e);const{values:t}=e,n=t[0],r=t[1]/100,s=t[2]/100,o=r*Math.min(s,1-s),i=(l,u=(l+n/30)%12)=>s-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const c=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(a+="a",c.push(t[3])),Fs({type:a,values:c})}function gi(e){e=_t(e);let t=e.type==="hsl"||e.type==="hsla"?_t(_h(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ql(e,t){const n=gi(e),r=gi(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function T4(e,t){return e=_t(e),t=Ca(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Fs(e)}function Hr(e,t,n){try{return T4(e,t)}catch{return e}}function ka(e,t){if(e=_t(e),t=Ca(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Fs(e)}function fe(e,t,n){try{return ka(e,t)}catch{return e}}function Ea(e,t){if(e=_t(e),t=Ca(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Fs(e)}function he(e,t,n){try{return Ea(e,t)}catch{return e}}function j4(e,t=.15){return gi(e)>.5?ka(e,t):Ea(e,t)}function zr(e,t,n){try{return j4(e,t)}catch{return e}}const P4=m.createContext(void 0);process.env.NODE_ENV!=="production"&&(ce.node,ce.object);function M4(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const s=t.components[n];return s.defaultProps?pi(s.defaultProps,r,t.components.mergeClassNameAndStyle):!s.styleOverrides&&!s.variants?pi(s,r,t.components.mergeClassNameAndStyle):r}function N4({props:e,name:t}){const n=m.useContext(P4);return M4({props:e,name:t,theme:{components:n}})}const Xl={theme:void 0};function R4(e){let t,n;return function(s){let o=t;return(o===void 0||s.theme!==n)&&(Xl.theme=s.theme,o=Lh(e(Xl)),t=o,n=s.theme),o}}function V4(e=""){function t(...r){if(!r.length)return"";const s=r[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${s}${t(...r.slice(1))})`:`, ${s}`}return(r,...s)=>`var(--${e?`${e}-`:""}${r}${t(...s)})`}const Jl=(e,t,n,r=[])=>{let s=e;t.forEach((o,i)=>{i===t.length-1?Array.isArray(s)?s[Number(o)]=n:s&&typeof s=="object"&&(s[o]=n):s&&typeof s=="object"&&(s[o]||(s[o]=r.includes(o)?[]:{}),s=s[o])})},I4=(e,t,n)=>{function r(s,o=[],i=[]){Object.entries(s).forEach(([a,c])=>{(!n||n&&!n([...o,a]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,a],Array.isArray(c)?[...i,a]:i):t([...o,a],c,i))})}r(e)},D4=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Eo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},s={},o={},i={};return I4(e,(a,c,l)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(a,c))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=D4(a,c);Object.assign(s,{[u]:f}),Jl(o,a,`var(${u})`,l),Jl(i,a,`var(${u}, ${f})`,l)}},a=>a[0]==="vars"),{css:s,vars:o,varsWithDefaults:i}}function O4(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:s}=t,{colorSchemes:o={},components:i,defaultColorScheme:a="light",...c}=e,{vars:l,css:u,varsWithDefaults:f}=Eo(c,t);let h=f;const g={},{[a]:y,...p}=o;if(Object.entries(p||{}).forEach(([S,C])=>{const{vars:E,css:T,varsWithDefaults:k}=Eo(C,t);h=Ze(h,k),g[S]={css:T,vars:E}}),y){const{css:S,vars:C,varsWithDefaults:E}=Eo(y,t);h=Ze(h,E),g[a]={css:S,vars:C}}function x(S,C){var T,k;let E=s;if(s==="class"&&(E=".%s"),s==="data"&&(E="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(E=`[${s}="%s"]`),S){if(E==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${((k=(T=o[S])==null?void 0:T.palette)==null?void 0:k.mode)||S})`]:{":root":C}};if(E)return e.defaultColorScheme===S?`:root, ${E.replace("%s",String(S))}`:E.replace("%s",String(S))}return":root"}return{vars:h,generateThemeVars:()=>{let S={...l};return Object.entries(g).forEach(([,{vars:C}])=>{S=Ze(S,C)}),S},generateStyleSheets:()=>{var j,$;const S=[],C=e.defaultColorScheme||"light";function E(b,I){Object.keys(I).length&&S.push(typeof b=="string"?{[b]:{...I}}:b)}E(n(void 0,{...u}),u);const{[C]:T,...k}=g;if(T){const{css:b}=T,I=($=(j=o[C])==null?void 0:j.palette)==null?void 0:$.mode,L=!r&&I?{colorScheme:I,...b}:{...b};E(n(C,{...L}),L)}return Object.entries(k).forEach(([b,{css:I}])=>{var K,q;const L=(q=(K=o[b])==null?void 0:K.palette)==null?void 0:q.mode,Z=!r&&L?{colorScheme:L,...I}:{...I};E(n(b,{...Z}),Z)}),S}}}function L4(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const xr={black:"#000",white:"#fff"},$4={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},hn={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},mn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},qn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},pn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},gn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},yn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Bh(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:xr.white,default:xr.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const F4=Bh();function Hh(){return{text:{primary:xr.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:xr.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Ql=Hh();function ed(e,t,n,r){const s=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Ea(e.main,s):t==="dark"&&(e.dark=ka(e.main,o)))}function _4(e="light"){return e==="dark"?{main:pn[200],light:pn[50],dark:pn[400]}:{main:pn[700],light:pn[400],dark:pn[800]}}function B4(e="light"){return e==="dark"?{main:hn[200],light:hn[50],dark:hn[400]}:{main:hn[500],light:hn[300],dark:hn[700]}}function H4(e="light"){return e==="dark"?{main:mn[500],light:mn[300],dark:mn[700]}:{main:mn[700],light:mn[400],dark:mn[800]}}function z4(e="light"){return e==="dark"?{main:gn[400],light:gn[300],dark:gn[700]}:{main:gn[700],light:gn[500],dark:gn[900]}}function U4(e="light"){return e==="dark"?{main:yn[400],light:yn[300],dark:yn[700]}:{main:yn[800],light:yn[500],dark:yn[900]}}function W4(e="light"){return e==="dark"?{main:qn[400],light:qn[300],dark:qn[700]}:{main:"#ed6c02",light:qn[500],dark:qn[900]}}function Aa(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...s}=e,o=e.primary||_4(t),i=e.secondary||B4(t),a=e.error||H4(t),c=e.info||z4(t),l=e.success||U4(t),u=e.warning||W4(t);function f(p){const x=ql(p,Ql.text.primary)>=n?Ql.text.primary:F4.text.primary;if(process.env.NODE_ENV!=="production"){const w=ql(p,x);w<3&&console.error([`MUI: The contrast ratio of ${w}:1 for ${x} on ${p}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
133
+ `))}return x}const h=({color:p,name:x,mainShade:w=500,lightShade:v=300,darkShade:S=700})=>{if(p={...p},!p.main&&p[w]&&(p.main=p[w]),!p.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${x?` (${x})`:""} provided to augmentColor(color) is invalid.
134
+ The color object needs to have a \`main\` property or a \`${w}\` property.`:Ft(11,x?` (${x})`:"",w));if(typeof p.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${x?` (${x})`:""} provided to augmentColor(color) is invalid.
135
+ \`color.main\` should be a string, but \`${JSON.stringify(p.main)}\` was provided instead.
206
136
 
207
137
  Did you intend to use one of the following approaches?
208
138
 
@@ -214,40 +144,40 @@ const theme1 = createTheme({ palette: {
214
144
 
215
145
  const theme2 = createTheme({ palette: {
216
146
  primary: { main: green[500] },
217
- } });`:zt(12,v?` (${v})`:"",JSON.stringify(f.main)));return jd(f,"light",b,r),jd(f,"dark",S,r),f.contrastText||(f.contrastText=h(f.main)),f};let g;return t==="light"?g=Pm():t==="dark"&&(g=Mm()),process.env.NODE_ENV!=="production"&&(g||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),qe({common:{...kr},mode:t,primary:p({color:o,name:"primary"}),secondary:p({color:i,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:a,name:"error"}),warning:p({color:u,name:"warning"}),info:p({color:c,name:"info"}),success:p({color:l,name:"success"}),grey:u8,contrastThreshold:n,getContrastText:h,augmentColor:p,tonalOffset:r,...g},s)}function x8(e){const t={};return Object.entries(e).forEach(r=>{const[s,o]=r;typeof o=="object"&&(t[s]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function b8(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function w8(e){return Math.round(e*1e5)/1e5}const Vd={textTransform:"uppercase"},Id='"Roboto", "Helvetica", "Arial", sans-serif';function S8(e,t){const{fontFamily:n=Id,fontSize:r=14,fontWeightLight:s=300,fontWeightRegular:o=400,fontWeightMedium:i=500,fontWeightBold:a=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...h}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof r!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof c!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const p=r/14,g=u||(v=>`${v/c*p}rem`),y=(v,w,b,S,C)=>({fontFamily:n,fontWeight:v,fontSize:g(w),lineHeight:b,...n===Id?{letterSpacing:`${w8(S/w)}em`}:{},...C,...l}),f={h1:y(s,96,1.167,-1.5),h2:y(s,60,1.2,-.5),h3:y(o,48,1.167,0),h4:y(o,34,1.235,.25),h5:y(o,24,1.334,0),h6:y(i,20,1.6,.15),subtitle1:y(o,16,1.75,.15),subtitle2:y(i,14,1.57,.1),body1:y(o,16,1.5,.15),body2:y(o,14,1.43,.15),button:y(i,14,1.75,.4,Vd),caption:y(o,12,1.66,.4),overline:y(o,12,2.66,1,Vd),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return qe({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:r,fontWeightLight:s,fontWeightRegular:o,fontWeightMedium:i,fontWeightBold:a,...f},h,{clone:!1})}const C8=.2,E8=.14,k8=.12;function xe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${C8})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${E8})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${k8})`].join(",")}const T8=["none",xe(0,2,1,-1,0,1,1,0,0,1,3,0),xe(0,3,1,-2,0,2,2,0,0,1,5,0),xe(0,3,3,-2,0,3,4,0,0,1,8,0),xe(0,2,4,-1,0,4,5,0,0,1,10,0),xe(0,3,5,-1,0,5,8,0,0,1,14,0),xe(0,3,5,-1,0,6,10,0,0,1,18,0),xe(0,4,5,-2,0,7,10,1,0,2,16,1),xe(0,5,5,-3,0,8,10,1,0,3,14,2),xe(0,5,6,-3,0,9,12,1,0,3,16,2),xe(0,6,6,-3,0,10,14,1,0,4,18,3),xe(0,6,7,-4,0,11,15,1,0,4,20,3),xe(0,7,8,-4,0,12,17,2,0,5,22,4),xe(0,7,8,-4,0,13,19,2,0,5,24,4),xe(0,7,9,-4,0,14,21,2,0,5,26,4),xe(0,8,9,-5,0,15,22,2,0,6,28,5),xe(0,8,10,-5,0,16,24,2,0,6,30,5),xe(0,8,11,-5,0,17,26,2,0,6,32,5),xe(0,9,11,-5,0,18,28,2,0,7,34,6),xe(0,9,12,-6,0,19,29,2,0,7,36,6),xe(0,10,13,-6,0,20,31,3,0,8,38,7),xe(0,10,13,-6,0,21,33,3,0,8,40,7),xe(0,10,14,-6,0,22,35,3,0,8,42,7),xe(0,11,14,-7,0,23,36,3,0,9,44,8),xe(0,11,15,-7,0,24,38,3,0,9,46,8)],A8={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},P8={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Dd(e){return`${Math.round(e)}ms`}function M8(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function R8(e){const t={...A8,...e.easing},n={...P8,...e.duration};return{getAutoHeightDuration:M8,create:(s=["all"],o={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...l}=o;if(process.env.NODE_ENV!=="production"){const u=p=>typeof p=="string",h=p=>!Number.isNaN(parseFloat(p));!u(s)&&!Array.isArray(s)&&console.error('MUI: Argument "props" must be a string or Array.'),!h(i)&&!u(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!h(c)&&!u(c)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
218
- `)),Object.keys(l).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(l).join(",")}].`)}return(Array.isArray(s)?s:[s]).map(u=>`${u} ${typeof i=="string"?i:Dd(i)} ${a} ${typeof c=="string"?c:Dd(c)}`).join(",")},...e,easing:t,duration:n}}const N8={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function j8(e){return Pt(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Rm(e={}){const t={...e};function n(r){const s=Object.entries(r);for(let o=0;o<s.length;o++){const[i,a]=s[o];!j8(a)||i.startsWith("unstable_")?delete r[i]:Pt(a)&&(r[i]={...a},n(r[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
147
+ } });`:Ft(12,x?` (${x})`:"",JSON.stringify(p.main)));return ed(p,"light",v,r),ed(p,"dark",S,r),p.contrastText||(p.contrastText=f(p.main)),p};let g;return t==="light"?g=Bh():t==="dark"&&(g=Hh()),process.env.NODE_ENV!=="production"&&(g||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Ze({common:{...xr},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:i,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:l,name:"success"}),grey:$4,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r,...g},s)}function Z4(e){const t={};return Object.entries(e).forEach(r=>{const[s,o]=r;typeof o=="object"&&(t[s]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function K4(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function G4(e){return Math.round(e*1e5)/1e5}const td={textTransform:"uppercase"},nd='"Roboto", "Helvetica", "Arial", sans-serif';function Y4(e,t){const{fontFamily:n=nd,fontSize:r=14,fontWeightLight:s=300,fontWeightRegular:o=400,fontWeightMedium:i=500,fontWeightBold:a=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...f}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof r!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof c!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,g=u||(x=>`${x/c*h}rem`),y=(x,w,v,S,C)=>({fontFamily:n,fontWeight:x,fontSize:g(w),lineHeight:v,...n===nd?{letterSpacing:`${G4(S/w)}em`}:{},...C,...l}),p={h1:y(s,96,1.167,-1.5),h2:y(s,60,1.2,-.5),h3:y(o,48,1.167,0),h4:y(o,34,1.235,.25),h5:y(o,24,1.334,0),h6:y(i,20,1.6,.15),subtitle1:y(o,16,1.75,.15),subtitle2:y(i,14,1.57,.1),body1:y(o,16,1.5,.15),body2:y(o,14,1.43,.15),button:y(i,14,1.75,.4,td),caption:y(o,12,1.66,.4),overline:y(o,12,2.66,1,td),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ze({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:r,fontWeightLight:s,fontWeightRegular:o,fontWeightMedium:i,fontWeightBold:a,...p},f,{clone:!1})}const q4=.2,X4=.14,J4=.12;function pe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${q4})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${X4})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${J4})`].join(",")}const Q4=["none",pe(0,2,1,-1,0,1,1,0,0,1,3,0),pe(0,3,1,-2,0,2,2,0,0,1,5,0),pe(0,3,3,-2,0,3,4,0,0,1,8,0),pe(0,2,4,-1,0,4,5,0,0,1,10,0),pe(0,3,5,-1,0,5,8,0,0,1,14,0),pe(0,3,5,-1,0,6,10,0,0,1,18,0),pe(0,4,5,-2,0,7,10,1,0,2,16,1),pe(0,5,5,-3,0,8,10,1,0,3,14,2),pe(0,5,6,-3,0,9,12,1,0,3,16,2),pe(0,6,6,-3,0,10,14,1,0,4,18,3),pe(0,6,7,-4,0,11,15,1,0,4,20,3),pe(0,7,8,-4,0,12,17,2,0,5,22,4),pe(0,7,8,-4,0,13,19,2,0,5,24,4),pe(0,7,9,-4,0,14,21,2,0,5,26,4),pe(0,8,9,-5,0,15,22,2,0,6,28,5),pe(0,8,10,-5,0,16,24,2,0,6,30,5),pe(0,8,11,-5,0,17,26,2,0,6,32,5),pe(0,9,11,-5,0,18,28,2,0,7,34,6),pe(0,9,12,-6,0,19,29,2,0,7,36,6),pe(0,10,13,-6,0,20,31,3,0,8,38,7),pe(0,10,13,-6,0,21,33,3,0,8,40,7),pe(0,10,14,-6,0,22,35,3,0,8,42,7),pe(0,11,14,-7,0,23,36,3,0,9,44,8),pe(0,11,15,-7,0,24,38,3,0,9,46,8)],e8={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},t8={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function rd(e){return`${Math.round(e)}ms`}function n8(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function r8(e){const t={...e8,...e.easing},n={...t8,...e.duration};return{getAutoHeightDuration:n8,create:(s=["all"],o={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...l}=o;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",f=h=>!Number.isNaN(parseFloat(h));!u(s)&&!Array.isArray(s)&&console.error('MUI: Argument "props" must be a string or Array.'),!f(i)&&!u(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!f(c)&&!u(c)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
148
+ `)),Object.keys(l).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(l).join(",")}].`)}return(Array.isArray(s)?s:[s]).map(u=>`${u} ${typeof i=="string"?i:rd(i)} ${a} ${typeof c=="string"?c:rd(c)}`).join(",")},...e,easing:t,duration:n}}const s8={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function o8(e){return Ct(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function zh(e={}){const t={...e};function n(r){const s=Object.entries(r);for(let o=0;o<s.length;o++){const[i,a]=s[o];!o8(a)||i.startsWith("unstable_")?delete r[i]:Ct(a)&&(r[i]={...a},n(r[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
219
149
 
220
150
  const theme = ${JSON.stringify(t,null,2)};
221
151
 
222
152
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
223
153
  theme.transitions = createTransitions(theme.transitions || {});
224
154
 
225
- export default theme;`}function $i(e={},...t){const{breakpoints:n,mixins:r={},spacing:s,palette:o={},transitions:i={},typography:a={},shape:c,...l}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":zt(20));const u=Ka(o),h=Sm(e);let p=qe(h,{mixins:b8(h.breakpoints,r),palette:u,shadows:T8.slice(),typography:S8(u,a),transitions:R8(i),zIndex:{...N8}});if(p=qe(p,l),p=t.reduce((g,y)=>qe(g,y),p),process.env.NODE_ENV!=="production"){const g=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],y=(f,v)=>{let w;for(w in f){const b=f[w];if(g.includes(w)&&Object.keys(b).length>0){if(process.env.NODE_ENV!=="production"){const S=za("",w);console.error([`MUI: The \`${v}\` component increases the CSS specificity of the \`${w}\` internal state.`,"You can not override it like this: ",JSON.stringify(f,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:b}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
226
- `))}f[w]={}}}};Object.keys(p.components).forEach(f=>{const v=p.components[f].styleOverrides;v&&f.startsWith("Mui")&&y(v,f)})}return p.unstable_sxConfig={...Xs,...l==null?void 0:l.unstable_sxConfig},p.unstable_sx=function(y){return Bn({sx:y,theme:this})},p.toRuntimeSource=Rm,p}function V8(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const I8=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=V8(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Nm(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function jm(e){return e==="dark"?I8:[]}function D8(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...s}=e,o=Ka(t);return{palette:o,opacity:{...Nm(o.mode),...n},overlays:r||jm(o.mode),...s}}function O8(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const $8=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],L8=e=>(t,n)=>{const r=e.rootSelector||":root",s=e.colorSchemeSelector;let o=s;if(s==="class"&&(o=".%s"),s==="data"&&(o="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(o=`[${s}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return $8(e.cssVarPrefix).forEach(a=>{i[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:o?{[o.replace("%s",t)]:i,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function _8(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function D(e,t,n){!e[t]&&n&&(e[t]=n)}function ar(e){return typeof e!="string"||!e.startsWith("hsl")?e:Am(e)}function At(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ir(ar(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
227
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function F8(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const ht=e=>{try{return e()}catch{}},B8=(e="mui")=>i8(e);function Wo(e,t,n,r){if(!t)return;t=t===!0?{}:t;const s=r==="dark"?"dark":"light";if(!n){e[r]=D8({...t,palette:{mode:s,...t==null?void 0:t.palette}});return}const{palette:o,...i}=$i({...n,palette:{mode:s,...t==null?void 0:t.palette}});return e[r]={...t,palette:o,opacity:{...Nm(s),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||jm(s)},i}function H8(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:s=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:i=O8,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...l}=e,u=Object.keys(n)[0],h=r||(n.light&&u!=="light"?"light":u),p=B8(o),{[h]:g,light:y,dark:f,...v}=n,w={...v};let b=g;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(b=!0),!b)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${h}\` option is either missing or invalid.`:zt(21,h));const S=Wo(w,b,l,h);y&&!w.light&&Wo(w,y,void 0,"light"),f&&!w.dark&&Wo(w,f,void 0,"dark");let C={defaultColorScheme:h,...S,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:c,getCssVar:p,colorSchemes:w,font:{...x8(S.typography),...S.font},spacing:F8(l.spacing)};Object.keys(C.colorSchemes).forEach($=>{const x=C.colorSchemes[$].palette,I=_=>{const K=_.split("-"),Y=K[1],X=K[2];return p(_,x[Y][X])};if(x.mode==="light"&&(D(x.common,"background","#fff"),D(x.common,"onBackground","#000")),x.mode==="dark"&&(D(x.common,"background","#000"),D(x.common,"onBackground","#fff")),_8(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){D(x.Alert,"errorColor",ye(x.error.light,.6)),D(x.Alert,"infoColor",ye(x.info.light,.6)),D(x.Alert,"successColor",ye(x.success.light,.6)),D(x.Alert,"warningColor",ye(x.warning.light,.6)),D(x.Alert,"errorFilledBg",I("palette-error-main")),D(x.Alert,"infoFilledBg",I("palette-info-main")),D(x.Alert,"successFilledBg",I("palette-success-main")),D(x.Alert,"warningFilledBg",I("palette-warning-main")),D(x.Alert,"errorFilledColor",ht(()=>x.getContrastText(x.error.main))),D(x.Alert,"infoFilledColor",ht(()=>x.getContrastText(x.info.main))),D(x.Alert,"successFilledColor",ht(()=>x.getContrastText(x.success.main))),D(x.Alert,"warningFilledColor",ht(()=>x.getContrastText(x.warning.main))),D(x.Alert,"errorStandardBg",ve(x.error.light,.9)),D(x.Alert,"infoStandardBg",ve(x.info.light,.9)),D(x.Alert,"successStandardBg",ve(x.success.light,.9)),D(x.Alert,"warningStandardBg",ve(x.warning.light,.9)),D(x.Alert,"errorIconColor",I("palette-error-main")),D(x.Alert,"infoIconColor",I("palette-info-main")),D(x.Alert,"successIconColor",I("palette-success-main")),D(x.Alert,"warningIconColor",I("palette-warning-main")),D(x.AppBar,"defaultBg",I("palette-grey-100")),D(x.Avatar,"defaultBg",I("palette-grey-400")),D(x.Button,"inheritContainedBg",I("palette-grey-300")),D(x.Button,"inheritContainedHoverBg",I("palette-grey-A100")),D(x.Chip,"defaultBorder",I("palette-grey-400")),D(x.Chip,"defaultAvatarColor",I("palette-grey-700")),D(x.Chip,"defaultIconColor",I("palette-grey-700")),D(x.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),D(x.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),D(x.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),D(x.LinearProgress,"primaryBg",ve(x.primary.main,.62)),D(x.LinearProgress,"secondaryBg",ve(x.secondary.main,.62)),D(x.LinearProgress,"errorBg",ve(x.error.main,.62)),D(x.LinearProgress,"infoBg",ve(x.info.main,.62)),D(x.LinearProgress,"successBg",ve(x.success.main,.62)),D(x.LinearProgress,"warningBg",ve(x.warning.main,.62)),D(x.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.11)`),D(x.Slider,"primaryTrack",ve(x.primary.main,.62)),D(x.Slider,"secondaryTrack",ve(x.secondary.main,.62)),D(x.Slider,"errorTrack",ve(x.error.main,.62)),D(x.Slider,"infoTrack",ve(x.info.main,.62)),D(x.Slider,"successTrack",ve(x.success.main,.62)),D(x.Slider,"warningTrack",ve(x.warning.main,.62));const _=es(x.background.default,.8);D(x.SnackbarContent,"bg",_),D(x.SnackbarContent,"color",ht(()=>x.getContrastText(_))),D(x.SpeedDialAction,"fabHoverBg",es(x.background.paper,.15)),D(x.StepConnector,"border",I("palette-grey-400")),D(x.StepContent,"border",I("palette-grey-400")),D(x.Switch,"defaultColor",I("palette-common-white")),D(x.Switch,"defaultDisabledColor",I("palette-grey-100")),D(x.Switch,"primaryDisabledColor",ve(x.primary.main,.62)),D(x.Switch,"secondaryDisabledColor",ve(x.secondary.main,.62)),D(x.Switch,"errorDisabledColor",ve(x.error.main,.62)),D(x.Switch,"infoDisabledColor",ve(x.info.main,.62)),D(x.Switch,"successDisabledColor",ve(x.success.main,.62)),D(x.Switch,"warningDisabledColor",ve(x.warning.main,.62)),D(x.TableCell,"border",ve(Qr(x.divider,1),.88)),D(x.Tooltip,"bg",Qr(x.grey[700],.92))}if(x.mode==="dark"){D(x.Alert,"errorColor",ve(x.error.light,.6)),D(x.Alert,"infoColor",ve(x.info.light,.6)),D(x.Alert,"successColor",ve(x.success.light,.6)),D(x.Alert,"warningColor",ve(x.warning.light,.6)),D(x.Alert,"errorFilledBg",I("palette-error-dark")),D(x.Alert,"infoFilledBg",I("palette-info-dark")),D(x.Alert,"successFilledBg",I("palette-success-dark")),D(x.Alert,"warningFilledBg",I("palette-warning-dark")),D(x.Alert,"errorFilledColor",ht(()=>x.getContrastText(x.error.dark))),D(x.Alert,"infoFilledColor",ht(()=>x.getContrastText(x.info.dark))),D(x.Alert,"successFilledColor",ht(()=>x.getContrastText(x.success.dark))),D(x.Alert,"warningFilledColor",ht(()=>x.getContrastText(x.warning.dark))),D(x.Alert,"errorStandardBg",ye(x.error.light,.9)),D(x.Alert,"infoStandardBg",ye(x.info.light,.9)),D(x.Alert,"successStandardBg",ye(x.success.light,.9)),D(x.Alert,"warningStandardBg",ye(x.warning.light,.9)),D(x.Alert,"errorIconColor",I("palette-error-main")),D(x.Alert,"infoIconColor",I("palette-info-main")),D(x.Alert,"successIconColor",I("palette-success-main")),D(x.Alert,"warningIconColor",I("palette-warning-main")),D(x.AppBar,"defaultBg",I("palette-grey-900")),D(x.AppBar,"darkBg",I("palette-background-paper")),D(x.AppBar,"darkColor",I("palette-text-primary")),D(x.Avatar,"defaultBg",I("palette-grey-600")),D(x.Button,"inheritContainedBg",I("palette-grey-800")),D(x.Button,"inheritContainedHoverBg",I("palette-grey-700")),D(x.Chip,"defaultBorder",I("palette-grey-700")),D(x.Chip,"defaultAvatarColor",I("palette-grey-300")),D(x.Chip,"defaultIconColor",I("palette-grey-300")),D(x.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),D(x.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),D(x.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),D(x.LinearProgress,"primaryBg",ye(x.primary.main,.5)),D(x.LinearProgress,"secondaryBg",ye(x.secondary.main,.5)),D(x.LinearProgress,"errorBg",ye(x.error.main,.5)),D(x.LinearProgress,"infoBg",ye(x.info.main,.5)),D(x.LinearProgress,"successBg",ye(x.success.main,.5)),D(x.LinearProgress,"warningBg",ye(x.warning.main,.5)),D(x.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.13)`),D(x.Slider,"primaryTrack",ye(x.primary.main,.5)),D(x.Slider,"secondaryTrack",ye(x.secondary.main,.5)),D(x.Slider,"errorTrack",ye(x.error.main,.5)),D(x.Slider,"infoTrack",ye(x.info.main,.5)),D(x.Slider,"successTrack",ye(x.success.main,.5)),D(x.Slider,"warningTrack",ye(x.warning.main,.5));const _=es(x.background.default,.98);D(x.SnackbarContent,"bg",_),D(x.SnackbarContent,"color",ht(()=>x.getContrastText(_))),D(x.SpeedDialAction,"fabHoverBg",es(x.background.paper,.15)),D(x.StepConnector,"border",I("palette-grey-600")),D(x.StepContent,"border",I("palette-grey-600")),D(x.Switch,"defaultColor",I("palette-grey-300")),D(x.Switch,"defaultDisabledColor",I("palette-grey-600")),D(x.Switch,"primaryDisabledColor",ye(x.primary.main,.55)),D(x.Switch,"secondaryDisabledColor",ye(x.secondary.main,.55)),D(x.Switch,"errorDisabledColor",ye(x.error.main,.55)),D(x.Switch,"infoDisabledColor",ye(x.info.main,.55)),D(x.Switch,"successDisabledColor",ye(x.success.main,.55)),D(x.Switch,"warningDisabledColor",ye(x.warning.main,.55)),D(x.TableCell,"border",ye(Qr(x.divider,1),.68)),D(x.Tooltip,"bg",Qr(x.grey[700],.92))}At(x.background,"default"),At(x.background,"paper"),At(x.common,"background"),At(x.common,"onBackground"),At(x,"divider"),Object.keys(x).forEach(_=>{const K=x[_];_!=="tonalOffset"&&K&&typeof K=="object"&&(K.main&&D(x[_],"mainChannel",ir(ar(K.main))),K.light&&D(x[_],"lightChannel",ir(ar(K.light))),K.dark&&D(x[_],"darkChannel",ir(ar(K.dark))),K.contrastText&&D(x[_],"contrastTextChannel",ir(ar(K.contrastText))),_==="text"&&(At(x[_],"primary"),At(x[_],"secondary")),_==="action"&&(K.active&&At(x[_],"active"),K.selected&&At(x[_],"selected")))})}),C=t.reduce(($,x)=>qe($,x),C);const E={prefix:o,disableCssColorScheme:s,shouldSkipGeneratingVar:i,getSelector:L8(C)},{vars:T,generateThemeVars:k,generateStyleSheets:P}=l8(C,E);return C.vars=T,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([$,x])=>{C[$]=x}),C.generateThemeVars=k,C.generateStyleSheets=P,C.generateSpacing=function(){return wm(l.spacing,La(this))},C.getColorSchemeSelector=d8(a),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=i,C.unstable_sxConfig={...Xs,...l==null?void 0:l.unstable_sxConfig},C.unstable_sx=function(x){return Bn({sx:x,theme:this})},C.toRuntimeSource=Rm,C}function Od(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ka({...n===!0?{}:n.palette,mode:t})})}function z8(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...i}=e,a=o||"light",c=s==null?void 0:s[a],l={...s,...n?{[a]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return $i(e,...t);let u=n;"palette"in e||l[a]&&(l[a]!==!0?u=l[a].palette:a==="dark"&&(u={mode:"dark"}));const h=$i({...e,palette:u},...t);return h.defaultColorScheme=a,h.colorSchemes=l,h.palette.mode==="light"&&(h.colorSchemes.light={...l.light!==!0&&l.light,palette:h.palette},Od(h,"dark",l.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:h.palette},Od(h,"light",l.light)),h}return!n&&!("light"in l)&&a==="light"&&(l.light=!0),H8({...i,colorSchemes:l,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const U8=z8(),W8="$$material";function Z8(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const K8=e=>Z8(e)&&e!=="classes",Y8=ZC({themeId:W8,defaultTheme:U8,rootShouldForwardProp:K8}),G8=o8;process.env.NODE_ENV!=="production"&&(ce.node,ce.object.isRequired);function q8(e){return s8(e)}function X8(e){return za("MuiSvgIcon",e)}BC("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const J8=e=>{const{color:t,fontSize:n,classes:r}=e,s={root:["root",t!=="inherit"&&`color${fn(t)}`,`fontSize${fn(n)}`]};return US(s,X8,r)},Q8=Y8("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${fn(n.color)}`],t[`fontSize${fn(n.fontSize)}`]]}})(G8(({theme:e})=>{var t,n,r,s,o,i,a,c,l,u,h,p,g,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(t=e.transitions)==null?void 0:t.create)==null?void 0:s.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:f=>!f.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:i.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:c.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:u.call(l,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,f])=>f&&f.main).map(([f])=>{var v,w;return{props:{color:f},style:{color:(w=(v=(e.vars??e).palette)==null?void 0:v[f])==null?void 0:w.main}}}),{props:{color:"action"},style:{color:(p=(h=(e.vars??e).palette)==null?void 0:h.action)==null?void 0:p.active}},{props:{color:"disabled"},style:{color:(y=(g=(e.vars??e).palette)==null?void 0:g.action)==null?void 0:y.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Ps=m.forwardRef(function(t,n){const r=q8({props:t,name:"MuiSvgIcon"}),{children:s,className:o,color:i="inherit",component:a="svg",fontSize:c="medium",htmlColor:l,inheritViewBox:u=!1,titleAccess:h,viewBox:p="0 0 24 24",...g}=r,y=m.isValidElement(s)&&s.type==="svg",f={...r,color:i,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:p,hasSvgAsChild:y},v={};u||(v.viewBox=p);const w=J8(f);return d.jsxs(Q8,{as:a,className:Bi(w.root,o),focusable:"false",color:l,"aria-hidden":h?void 0:!0,role:h?"img":void 0,ref:n,...v,...g,...y&&s.props,ownerState:f,children:[y?s.props.children:s,h?d.jsx("title",{children:h}):null]})});process.env.NODE_ENV!=="production"&&(Ps.propTypes={children:ce.node,classes:ce.object,className:ce.string,color:ce.oneOfType([ce.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ce.string]),component:ce.elementType,fontSize:ce.oneOfType([ce.oneOf(["inherit","large","medium","small"]),ce.string]),htmlColor:ce.string,inheritViewBox:ce.bool,shapeRendering:ce.string,sx:ce.oneOfType([ce.arrayOf(ce.oneOfType([ce.func,ce.object,ce.bool])),ce.func,ce.object]),titleAccess:ce.string,viewBox:ce.string});Ps.muiName="SvgIcon";function Qn(e,t){function n(r,s){return d.jsx(Ps,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:s,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Ps.muiName,m.memo(m.forwardRef(n))}const e6=Qn(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),t6=Qn(d.jsx("path",{d:"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7s.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71s-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9"}),"CallEnd"),n6=Qn([d.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),d.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt"),Vm=Qn(d.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),Im=Qn(d.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),Dm=Qn(d.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),r6=({disabled:e,capabilities:t,sessionStarted:n,ref:r,participantName:s="User",loadingText:o="Waiting for agent to connect...",theme:i="vox",client:a,displayType:c="widget",onBack:l})=>{var Y,X,G,U,M,q,N;const[u,h]=A.useState(!1),[p,g]=A.useState(!1),[y,f]=A.useState(()=>{var Z;const V=(Z=a==null?void 0:a.getCurrentInteraction)==null?void 0:Z.call(a);return console.log("SessionView: Initializing with existing interaction:",(V==null?void 0:V.methodName)||"none"),V||null}),{messages:v,send:w}=NS(),b=A.useRef(null),S=A.useRef(null),{agent:{isActive:C=!1}={}}=Me.useVoiceAssistant(),E=_e(i),T=A.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),k=C||T;A.useEffect(()=>{var V,Z;console.log("🤖 SessionView agent state:",{isAgentActive:C,hasActiveSession:T,effectiveAgentActive:k,sessionStarted:n,clientSession:(Z=(V=a==null?void 0:a.getCurrentSession)==null?void 0:V.call(a))==null?void 0:Z.id})},[C,T,k,n,a]),A.useEffect(()=>{console.log("🤖 Agent active state changed:",C)},[C]),A.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:s,effectiveAgentActive:k,chatOpen:u,currentInteraction:(y==null?void 0:y.methodName)||"none"})},[n,e,s,k,u,y]),A.useEffect(()=>{if(n&&!C){console.log("⏰ Starting agent timeout detection...");const V=setTimeout(()=>{console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),g(!0)},3e4);return()=>{clearTimeout(V)}}else C&&(console.log("✅ Agent is active, clearing timeout"),g(!1))},[n,C]),A.useEffect(()=>{if(!a)return;const V=()=>{console.log("🔄 Client connection state changed:",a.connected)},Z=R=>{console.log("🔴 Client disconnected:",R),f(null),h(!1),g(!1)};return a.on("connection.connected",V),a.on("connection.disconnected",Z),()=>{a.off("connection.connected",V),a.off("connection.disconnected",Z)}},[a]),A.useEffect(()=>{if(!a)return;const V=z=>{console.log("🎯 SessionView: RPC Interaction started:",z);const H=a.getCurrentInteraction();H&&(console.log("📱 SessionView: Setting current interaction:",H.methodName,"mode:",H.presentationMode),f(H))},Z=z=>{console.log("✅ SessionView: RPC Interaction completed:",z),f(null)},R=async z=>{console.log("⏰ SessionView: RPC Interaction timeout:",z),f(null)},B=async z=>{console.log("❌ SessionView: RPC Interaction dismissed:",z),f(null)};return a.on("rpc.interaction.started",V),a.on("rpc.interaction.completed",Z),a.on("rpc.interaction.timeout",R),a.on("rpc.interaction.dismissed",B),()=>{a.off("rpc.interaction.started",V),a.off("rpc.interaction.completed",Z),a.off("rpc.interaction.timeout",R),a.off("rpc.interaction.dismissed",B)}},[a]),A.useEffect(()=>{if(!a)return;const V=a.getCurrentInteraction();V?(console.log("🔄 SessionView: Syncing with existing interaction:",V.methodName),f(V)):f(null)},[a]),A.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(y==null?void 0:y.methodName)||"none","mode:",(y==null?void 0:y.presentationMode)||"none")},[y]),A.useEffect(()=>{var V,Z,R;console.log("📱 SessionView: Display type changed to:",c),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:k,hasSession:!!((V=a==null?void 0:a.getCurrentSession)!=null&&V.call(a)),sessionId:(R=(Z=a==null?void 0:a.getCurrentSession)==null?void 0:Z.call(a))==null?void 0:R.id})},[c,n,k,a]),A.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),A.useEffect(()=>{y&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),h(!1))},[y,u]),jS(),A.useEffect(()=>{b.current&&u&&v.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",v.length),setTimeout(()=>{if(b.current){let V=b.current.parentElement;for(;V&&V.scrollHeight<=V.clientHeight;)V=V.parentElement;V?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),V.scrollTo({top:V.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),b.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[v.length,u]),A.useEffect(()=>{var R,B;console.log("📝 SessionView: Messages updated, count:",v.length),v.length>0&&console.log("📝 SessionView: Latest messages:",v.slice(-3).map(z=>{var H,j,F,W,L,J,O;return{id:z.id,message:z.message,timestamp:z.timestamp,from:((H=z.from)==null?void 0:H.name)||((j=z.from)==null?void 0:j.identity),fromType:z.from===void 0?"unknown":"participant",isLocal:((F=z.from)==null?void 0:F.identity)===((J=(L=(W=a==null?void 0:a.getCurrentSession)==null?void 0:W.call(a))==null?void 0:L.localParticipant)==null?void 0:J.identity),messageLength:((O=z.message)==null?void 0:O.length)||0}}));const V=((R=a==null?void 0:a.getTranscriptions)==null?void 0:R.call(a))||[],Z=((B=a==null?void 0:a.getChatMessages)==null?void 0:B.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",V.length),console.log("📝 SessionView: Raw chat messages count:",Z.length)},[v.length,v,a]),A.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:v.length,displayType:c,hasMessages:v.length>0})},[u,v.length,c]);async function P(V){await w(V)}const $=A.useCallback(V=>{console.log("📝 SessionView: Adding local message for voice session context:",V)},[]),x=A.useCallback(async V=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(V),console.log("📎 SessionView: Attachments sent successfully:",V.map(Z=>Z.name)))}catch(Z){console.error("❌ SessionView: Failed to send attachments:",Z)}},[a]),I=A.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:k,chatOpen:u,currentInteraction:y==null?void 0:y.methodName,hasOnBack:!!l}),y&&(console.log("🎭 SessionView: Dismissing current interaction:",y.methodName),f(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),h(!1),g(!1),console.log("✅ SessionView: Local state reset"),a&&typeof a.endSession=="function"&&(a.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),a&&typeof a.disconnect=="function"&&(a.disconnect(),console.log("✅ SessionView: Client disconnected")),l?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),setTimeout(()=>{l(),console.log("✅ SessionView: onBack called")},150)):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(V){console.error("❌ SessionView: Failed to end call:",V),f(null),h(!1),g(!1),l&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),l())}},[a,l,y,n,k,u]);A.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:s,displayType:c,hasOnBack:!!l,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,s,c,l,a]),A.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!l,onBackType:typeof l})},[l]),A.useEffect(()=>{var Z,R;const V=((R=(Z=a==null?void 0:a.getCurrentSession)==null?void 0:Z.call(a))==null?void 0:R.id)||null;S.current&&!V&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:V,displayType:c,sessionStarted:n,effectiveAgentActive:k}),S.current=V},[a,c,n,k]);const _=ne("w-full flex flex-col items-center justify-center",c==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",E.main,c==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),K=l&&(c==="popup"||c==="fullscreen");return d.jsxs("main",{ref:r,inert:e,className:ne(_,"relative"),style:{minHeight:0},children:[K&&d.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((Y=E.chatHeader)==null?void 0:Y.container)||"border-gray-200"}`,children:d.jsx("div",{className:"flex items-center",children:d.jsxs("div",{children:[d.jsx("h3",{className:`font-semibold ${E.text.primary}`,children:"Voice Session"}),d.jsx("p",{className:`text-sm ${E.text.muted}`,children:s})]})})}),d.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!k&&d.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[d.jsx(ae.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:d.jsx(Ca,{className:E.spinner,weight:"bold"})}),d.jsx(ae.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${E.text.muted} text-center max-w-xs`,children:p?"Agent is taking longer than expected...":o}),d.jsx(ae.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${E.text.muted} mt-2 text-center opacity-60`,children:p?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),p&&l&&d.jsx(ae.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:l,className:`mt-4 px-4 py-2 rounded-lg ${((X=E.chatHeader)==null?void 0:X.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),k&&d.jsxs(d.Fragment,{children:[u&&d.jsxs("div",{className:ne("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[d.jsxs("div",{className:ne("flex-shrink-0 px-4 py-3 border-b",c==="fullscreen"?"px-8":"px-5",((G=E.chatHeader)==null?void 0:G.container)||"border-gray-200 dark:border-gray-700"),children:[d.jsx("h3",{className:ne("font-semibold text-lg",((U=E.text)==null?void 0:U.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),d.jsxs("p",{className:ne("text-sm",((M=E.text)==null?void 0:M.muted)||"text-gray-600 dark:text-gray-400"),children:[v.length," messages"]})]}),d.jsx("div",{className:ne("flex-1 flex flex-col min-h-0",c==="fullscreen"?"px-8":"px-5"),children:d.jsx(Fw,{className:"flex-1 flex flex-col min-h-0 h-full",children:d.jsxs("div",{className:`flex-1 flex flex-col h-full ${ne("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[v.length===0&&d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:ne("text-lg font-medium mb-2",((q=E.text)==null?void 0:q.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),d.jsx("p",{className:ne("text-sm",((N=E.text)==null?void 0:N.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),v.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-h-4"}),d.jsx("div",{ref:b,className:"space-y-4 relative whitespace-pre-wrap z-0",children:d.jsx(Nn,{mode:"popLayout",children:v.map((V,Z)=>d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:Z*.02},layout:!0,children:d.jsx(Lw,{participantName:s,entry:V})},V.id||`message-${Z}`))})})]})]})})})]}),!u&&d.jsxs("div",{className:ne("flex-1 flex flex-col items-center w-full h-full min-h-0",(y==null?void 0:y.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[d.jsx(ae.div,{className:"w-full flex justify-center",animate:{y:(y==null?void 0:y.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:d.jsx(Yw,{chatOpen:u})}),d.jsx(Nn,{mode:"wait",children:y&&y.presentationMode==="embedded"&&d.jsx(ae.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:ne("w-full relative mt-4 flex justify-center",c==="fullscreen"?"max-w-4xl":"max-w-md"),children:d.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:d.jsx(Fn,{interaction:y,theme:i,onDismiss:()=>{var V;return(V=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:V.call(a)},client:a,addLocalMessage:$})})},`embedded-${y.methodName}`)})]})]})]}),d.jsx(Nn,{mode:"wait",children:y&&y.presentationMode!=="embedded"&&!u&&d.jsx("div",{className:ne("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",c==="fullscreen"?"bg-black/70":"bg-black/50"),children:d.jsx(ae.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:ne("relative w-full overflow-hidden",c==="fullscreen"?"max-w-2xl mx-8 max-h-[85vh]":"max-w-lg mx-4 max-h-[80vh]","bg-white dark:bg-gray-900 rounded-2xl shadow-2xl","border border-gray-200 dark:border-gray-700"),children:d.jsx(Fn,{interaction:y,theme:i,onDismiss:()=>{var V;return(V=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:V.call(a)},client:a,addLocalMessage:$})},`modal-${y.methodName}`)})}),d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"absolute bottom-0 left-0 right-0 flex-shrink-0 w-full z-20",children:d.jsx(s6,{capabilities:t,onSendMessage:P,onSendAttachments:x,onEndCall:I,onChatOpenChange:h,disabled:e,theme:i,client:a,sessionStarted:n})})]})};function s6({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:s,disabled:o=!1,theme:i,client:a,sessionStarted:c=!1}){const[l,u]=A.useState(!1),h=A.useRef(null),p=A.useRef(null);A.useEffect(()=>{const b=()=>{const S=navigator.userAgent.toLowerCase(),E=["android","iphone","ipad","mobile","tablet"].some(P=>S.includes(P)),T="ontouchstart"in window||navigator.maxTouchPoints>0,k=window.innerWidth<=768;u(E||T&&k)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const g=b=>{const S=b.target.files;if(S&&S.length>0){const E=Array.from(S).filter(T=>T.type.startsWith("image/"));if(E.length===0){console.warn("No valid image files selected");return}n&&n(E),h.current&&(h.current.value="")}},y=b=>{const S=b.target.files;if(S&&S.length>0){const C=S[0];C.type.startsWith("image/")&&n&&n([C]),p.current&&(p.current.value="")}},f=()=>{!o&&h.current&&h.current.click()},v=()=>{!o&&l&&p.current&&p.current.click()},w=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:o,sessionStarted:c,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return d.jsx("div",{className:ne("px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:d.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[d.jsx("input",{ref:h,type:"file",multiple:!0,onChange:g,className:"hidden",accept:"image/*"}),d.jsx("input",{ref:p,type:"file",onChange:y,className:"hidden",accept:"image/*",capture:"environment"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:f,disabled:o,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Attach files",children:d.jsx(e6,{className:"w-5 h-5"})}),l&&d.jsx("button",{onClick:v,disabled:o,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Take photo",children:d.jsx(n6,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"flex-1 flex justify-center px-4",children:d.jsx(Ow,{capabilities:e,onChatOpenChange:s,onSendMessage:t,theme:i,client:a,className:"border-none py-1 rounded-xl max-w-md w-full"})}),d.jsx("div",{className:"flex items-center",children:d.jsx("button",{onClick:w,disabled:o||!c,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o||!c?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:d.jsx(t6,{className:"w-5 h-5"})})})]})})}function o6({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:s}){const[o,i]=m.useState(""),[a,c]=m.useState(!1),l=m.useRef(null),u=m.useRef(null),[h,p]=m.useState(!1),g=_e(r);m.useEffect(()=>{const C=()=>{const E=navigator.userAgent.toLowerCase(),k=["android","iphone","ipad","mobile","tablet"].some(x=>E.includes(x)),P="ontouchstart"in window||navigator.maxTouchPoints>0,$=window.innerWidth<=768;p(k||P&&$)};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const y=C=>{C.preventDefault(),o.trim()&&!n&&(e(o.trim()),i(""))},f=C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),y(C))},v=C=>{const E=C.target.files;if(E&&E.length>0){const T=Array.from(E),k=T.filter(P=>P.type.startsWith("image/"));if(k.length===0){console.warn("No valid image files selected");return}k.length!==T.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",k),t(k),l.current&&(l.current.value="")}},w=()=>{!n&&l.current&&l.current.click()},b=()=>{!n&&h&&u.current&&u.current.click()},S=C=>{const E=C.target.files;if(E&&E.length>0){const T=E[0];T.type.startsWith("image/")?t([T]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return d.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:d.jsx("form",{onSubmit:y,className:"flex items-center !w-full mx-auto max-w-4xl",children:d.jsxs("div",{className:`flex items-center gap-2 !w-full backdrop-blur-md rounded-full px-3 py-2 shadow-sm hover:shadow-md focus-within:shadow-lg focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-500/50 transition-all duration-200 border ${r==="light"?"bg-white/90 border-gray-200":g.chatInput.container}`,children:[d.jsx(ae.button,{type:"button",onClick:w,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:d.jsx(xS,{className:"w-4 h-4"})}),h&&d.jsx(ae.button,{type:"button",onClick:b,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:d.jsx(rm,{className:"w-4 h-4"})}),d.jsx("input",{ref:l,type:"file",multiple:!0,onChange:v,className:"hidden",accept:"image/*"}),d.jsx("input",{ref:u,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),d.jsx("textarea",{value:o,onChange:C=>i(C.target.value),onKeyDown:f,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${g.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:C=>{const E=C.target;E.style.height="auto",E.style.height=`${Math.min(E.scrollHeight,80)}px`}}),d.jsx(ae.button,{type:"submit",disabled:n||!o.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${o.trim()&&!n?g.chatInput.sendButton:r==="light"?"bg-gray-200 text-gray-400 cursor-not-allowed opacity-70":"bg-gray-600/50 text-gray-500 cursor-not-allowed opacity-50"}`,"aria-label":"Send message",children:d.jsx(SS,{className:"w-4 h-4"})}),s&&d.jsx(ae.button,{type:"button",onClick:s,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${g.chatInput.endButton}`,"aria-label":"End chat",children:d.jsx(sm,{className:"w-4 h-4"})})]})})})}function i6({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[s,o]=m.useState(""),[i,a]=m.useState(0);return m.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(i<e.length){const c=setTimeout(()=>{o(e.slice(0,i+1)),a(i+1)},r);return()=>clearTimeout(c)}},[e,i,t,r,n]),m.useEffect(()=>{n||(a(0),o(""))},[e,n]),d.jsxs("span",{className:"relative",children:[d.jsx("span",{className:"inline-block",children:s}),!t&&d.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(c=>d.jsx(ae.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:c*.2,ease:"easeInOut"}},c))})]})}function a6({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var i,a;const s=_e(t),o=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return d.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:d.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),d.jsxs("div",{className:`
155
+ export default theme;`}function yi(e={},...t){const{breakpoints:n,mixins:r={},spacing:s,palette:o={},transitions:i={},typography:a={},shape:c,...l}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Ft(20));const u=Aa(o),f=Dh(e);let h=Ze(f,{mixins:K4(f.breakpoints,r),palette:u,shadows:Q4.slice(),typography:Y4(u,a),transitions:r8(i),zIndex:{...s8}});if(h=Ze(h,l),h=t.reduce((g,y)=>Ze(g,y),h),process.env.NODE_ENV!=="production"){const g=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],y=(p,x)=>{let w;for(w in p){const v=p[w];if(g.includes(w)&&Object.keys(v).length>0){if(process.env.NODE_ENV!=="production"){const S=Sa("",w);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${w}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:v}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
156
+ `))}p[w]={}}}};Object.keys(h.components).forEach(p=>{const x=h.components[p].styleOverrides;x&&p.startsWith("Mui")&&y(x,p)})}return h.unstable_sxConfig={...Ds,...l==null?void 0:l.unstable_sxConfig},h.unstable_sx=function(y){return In({sx:y,theme:this})},h.toRuntimeSource=zh,h}function i8(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const a8=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=i8(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Uh(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Wh(e){return e==="dark"?a8:[]}function c8(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...s}=e,o=Aa(t);return{palette:o,opacity:{...Uh(o.mode),...n},overlays:r||Wh(o.mode),...s}}function l8(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const d8=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],u8=e=>(t,n)=>{const r=e.rootSelector||":root",s=e.colorSchemeSelector;let o=s;if(s==="class"&&(o=".%s"),s==="data"&&(o="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(o=`[${s}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return d8(e.cssVarPrefix).forEach(a=>{i[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:o?{[o.replace("%s",t)]:i,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function f8(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function D(e,t,n){!e[t]&&n&&(e[t]=n)}function er(e){return typeof e!="string"||!e.startsWith("hsl")?e:_h(e)}function St(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Qn(er(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
157
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function h8(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const lt=e=>{try{return e()}catch{}},m8=(e="mui")=>V4(e);function Ao(e,t,n,r){if(!t)return;t=t===!0?{}:t;const s=r==="dark"?"dark":"light";if(!n){e[r]=c8({...t,palette:{mode:s,...t==null?void 0:t.palette}});return}const{palette:o,...i}=yi({...n,palette:{mode:s,...t==null?void 0:t.palette}});return e[r]={...t,palette:o,opacity:{...Uh(s),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||Wh(s)},i}function p8(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:s=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:i=l8,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...l}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),h=m8(o),{[f]:g,light:y,dark:p,...x}=n,w={...x};let v=g;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(v=!0),!v)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`:Ft(21,f));const S=Ao(w,v,l,f);y&&!w.light&&Ao(w,y,void 0,"light"),p&&!w.dark&&Ao(w,p,void 0,"dark");let C={defaultColorScheme:f,...S,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:c,getCssVar:h,colorSchemes:w,font:{...Z4(S.typography),...S.font},spacing:h8(l.spacing)};Object.keys(C.colorSchemes).forEach($=>{const b=C.colorSchemes[$].palette,I=L=>{const Z=L.split("-"),K=Z[1],q=Z[2];return h(L,b[K][q])};if(b.mode==="light"&&(D(b.common,"background","#fff"),D(b.common,"onBackground","#000")),b.mode==="dark"&&(D(b.common,"background","#000"),D(b.common,"onBackground","#fff")),f8(b,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),b.mode==="light"){D(b.Alert,"errorColor",fe(b.error.light,.6)),D(b.Alert,"infoColor",fe(b.info.light,.6)),D(b.Alert,"successColor",fe(b.success.light,.6)),D(b.Alert,"warningColor",fe(b.warning.light,.6)),D(b.Alert,"errorFilledBg",I("palette-error-main")),D(b.Alert,"infoFilledBg",I("palette-info-main")),D(b.Alert,"successFilledBg",I("palette-success-main")),D(b.Alert,"warningFilledBg",I("palette-warning-main")),D(b.Alert,"errorFilledColor",lt(()=>b.getContrastText(b.error.main))),D(b.Alert,"infoFilledColor",lt(()=>b.getContrastText(b.info.main))),D(b.Alert,"successFilledColor",lt(()=>b.getContrastText(b.success.main))),D(b.Alert,"warningFilledColor",lt(()=>b.getContrastText(b.warning.main))),D(b.Alert,"errorStandardBg",he(b.error.light,.9)),D(b.Alert,"infoStandardBg",he(b.info.light,.9)),D(b.Alert,"successStandardBg",he(b.success.light,.9)),D(b.Alert,"warningStandardBg",he(b.warning.light,.9)),D(b.Alert,"errorIconColor",I("palette-error-main")),D(b.Alert,"infoIconColor",I("palette-info-main")),D(b.Alert,"successIconColor",I("palette-success-main")),D(b.Alert,"warningIconColor",I("palette-warning-main")),D(b.AppBar,"defaultBg",I("palette-grey-100")),D(b.Avatar,"defaultBg",I("palette-grey-400")),D(b.Button,"inheritContainedBg",I("palette-grey-300")),D(b.Button,"inheritContainedHoverBg",I("palette-grey-A100")),D(b.Chip,"defaultBorder",I("palette-grey-400")),D(b.Chip,"defaultAvatarColor",I("palette-grey-700")),D(b.Chip,"defaultIconColor",I("palette-grey-700")),D(b.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),D(b.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),D(b.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),D(b.LinearProgress,"primaryBg",he(b.primary.main,.62)),D(b.LinearProgress,"secondaryBg",he(b.secondary.main,.62)),D(b.LinearProgress,"errorBg",he(b.error.main,.62)),D(b.LinearProgress,"infoBg",he(b.info.main,.62)),D(b.LinearProgress,"successBg",he(b.success.main,.62)),D(b.LinearProgress,"warningBg",he(b.warning.main,.62)),D(b.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.11)`),D(b.Slider,"primaryTrack",he(b.primary.main,.62)),D(b.Slider,"secondaryTrack",he(b.secondary.main,.62)),D(b.Slider,"errorTrack",he(b.error.main,.62)),D(b.Slider,"infoTrack",he(b.info.main,.62)),D(b.Slider,"successTrack",he(b.success.main,.62)),D(b.Slider,"warningTrack",he(b.warning.main,.62));const L=zr(b.background.default,.8);D(b.SnackbarContent,"bg",L),D(b.SnackbarContent,"color",lt(()=>b.getContrastText(L))),D(b.SpeedDialAction,"fabHoverBg",zr(b.background.paper,.15)),D(b.StepConnector,"border",I("palette-grey-400")),D(b.StepContent,"border",I("palette-grey-400")),D(b.Switch,"defaultColor",I("palette-common-white")),D(b.Switch,"defaultDisabledColor",I("palette-grey-100")),D(b.Switch,"primaryDisabledColor",he(b.primary.main,.62)),D(b.Switch,"secondaryDisabledColor",he(b.secondary.main,.62)),D(b.Switch,"errorDisabledColor",he(b.error.main,.62)),D(b.Switch,"infoDisabledColor",he(b.info.main,.62)),D(b.Switch,"successDisabledColor",he(b.success.main,.62)),D(b.Switch,"warningDisabledColor",he(b.warning.main,.62)),D(b.TableCell,"border",he(Hr(b.divider,1),.88)),D(b.Tooltip,"bg",Hr(b.grey[700],.92))}if(b.mode==="dark"){D(b.Alert,"errorColor",he(b.error.light,.6)),D(b.Alert,"infoColor",he(b.info.light,.6)),D(b.Alert,"successColor",he(b.success.light,.6)),D(b.Alert,"warningColor",he(b.warning.light,.6)),D(b.Alert,"errorFilledBg",I("palette-error-dark")),D(b.Alert,"infoFilledBg",I("palette-info-dark")),D(b.Alert,"successFilledBg",I("palette-success-dark")),D(b.Alert,"warningFilledBg",I("palette-warning-dark")),D(b.Alert,"errorFilledColor",lt(()=>b.getContrastText(b.error.dark))),D(b.Alert,"infoFilledColor",lt(()=>b.getContrastText(b.info.dark))),D(b.Alert,"successFilledColor",lt(()=>b.getContrastText(b.success.dark))),D(b.Alert,"warningFilledColor",lt(()=>b.getContrastText(b.warning.dark))),D(b.Alert,"errorStandardBg",fe(b.error.light,.9)),D(b.Alert,"infoStandardBg",fe(b.info.light,.9)),D(b.Alert,"successStandardBg",fe(b.success.light,.9)),D(b.Alert,"warningStandardBg",fe(b.warning.light,.9)),D(b.Alert,"errorIconColor",I("palette-error-main")),D(b.Alert,"infoIconColor",I("palette-info-main")),D(b.Alert,"successIconColor",I("palette-success-main")),D(b.Alert,"warningIconColor",I("palette-warning-main")),D(b.AppBar,"defaultBg",I("palette-grey-900")),D(b.AppBar,"darkBg",I("palette-background-paper")),D(b.AppBar,"darkColor",I("palette-text-primary")),D(b.Avatar,"defaultBg",I("palette-grey-600")),D(b.Button,"inheritContainedBg",I("palette-grey-800")),D(b.Button,"inheritContainedHoverBg",I("palette-grey-700")),D(b.Chip,"defaultBorder",I("palette-grey-700")),D(b.Chip,"defaultAvatarColor",I("palette-grey-300")),D(b.Chip,"defaultIconColor",I("palette-grey-300")),D(b.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),D(b.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),D(b.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),D(b.LinearProgress,"primaryBg",fe(b.primary.main,.5)),D(b.LinearProgress,"secondaryBg",fe(b.secondary.main,.5)),D(b.LinearProgress,"errorBg",fe(b.error.main,.5)),D(b.LinearProgress,"infoBg",fe(b.info.main,.5)),D(b.LinearProgress,"successBg",fe(b.success.main,.5)),D(b.LinearProgress,"warningBg",fe(b.warning.main,.5)),D(b.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.13)`),D(b.Slider,"primaryTrack",fe(b.primary.main,.5)),D(b.Slider,"secondaryTrack",fe(b.secondary.main,.5)),D(b.Slider,"errorTrack",fe(b.error.main,.5)),D(b.Slider,"infoTrack",fe(b.info.main,.5)),D(b.Slider,"successTrack",fe(b.success.main,.5)),D(b.Slider,"warningTrack",fe(b.warning.main,.5));const L=zr(b.background.default,.98);D(b.SnackbarContent,"bg",L),D(b.SnackbarContent,"color",lt(()=>b.getContrastText(L))),D(b.SpeedDialAction,"fabHoverBg",zr(b.background.paper,.15)),D(b.StepConnector,"border",I("palette-grey-600")),D(b.StepContent,"border",I("palette-grey-600")),D(b.Switch,"defaultColor",I("palette-grey-300")),D(b.Switch,"defaultDisabledColor",I("palette-grey-600")),D(b.Switch,"primaryDisabledColor",fe(b.primary.main,.55)),D(b.Switch,"secondaryDisabledColor",fe(b.secondary.main,.55)),D(b.Switch,"errorDisabledColor",fe(b.error.main,.55)),D(b.Switch,"infoDisabledColor",fe(b.info.main,.55)),D(b.Switch,"successDisabledColor",fe(b.success.main,.55)),D(b.Switch,"warningDisabledColor",fe(b.warning.main,.55)),D(b.TableCell,"border",fe(Hr(b.divider,1),.68)),D(b.Tooltip,"bg",Hr(b.grey[700],.92))}St(b.background,"default"),St(b.background,"paper"),St(b.common,"background"),St(b.common,"onBackground"),St(b,"divider"),Object.keys(b).forEach(L=>{const Z=b[L];L!=="tonalOffset"&&Z&&typeof Z=="object"&&(Z.main&&D(b[L],"mainChannel",Qn(er(Z.main))),Z.light&&D(b[L],"lightChannel",Qn(er(Z.light))),Z.dark&&D(b[L],"darkChannel",Qn(er(Z.dark))),Z.contrastText&&D(b[L],"contrastTextChannel",Qn(er(Z.contrastText))),L==="text"&&(St(b[L],"primary"),St(b[L],"secondary")),L==="action"&&(Z.active&&St(b[L],"active"),Z.selected&&St(b[L],"selected")))})}),C=t.reduce(($,b)=>Ze($,b),C);const E={prefix:o,disableCssColorScheme:s,shouldSkipGeneratingVar:i,getSelector:u8(C)},{vars:T,generateThemeVars:k,generateStyleSheets:j}=O4(C,E);return C.vars=T,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([$,b])=>{C[$]=b}),C.generateThemeVars=k,C.generateStyleSheets=j,C.generateSpacing=function(){return Ih(l.spacing,ya(this))},C.getColorSchemeSelector=L4(a),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=i,C.unstable_sxConfig={...Ds,...l==null?void 0:l.unstable_sxConfig},C.unstable_sx=function(b){return In({sx:b,theme:this})},C.toRuntimeSource=zh,C}function sd(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Aa({...n===!0?{}:n.palette,mode:t})})}function g8(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...i}=e,a=o||"light",c=s==null?void 0:s[a],l={...s,...n?{[a]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return yi(e,...t);let u=n;"palette"in e||l[a]&&(l[a]!==!0?u=l[a].palette:a==="dark"&&(u={mode:"dark"}));const f=yi({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=l,f.palette.mode==="light"&&(f.colorSchemes.light={...l.light!==!0&&l.light,palette:f.palette},sd(f,"dark",l.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:f.palette},sd(f,"light",l.light)),f}return!n&&!("light"in l)&&a==="light"&&(l.light=!0),p8({...i,colorSchemes:l,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const y8=g8(),x8="$$material";function b8(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const v8=e=>b8(e)&&e!=="classes",w8=b4({themeId:x8,defaultTheme:y8,rootShouldForwardProp:v8}),S8=R4;process.env.NODE_ENV!=="production"&&(ce.node,ce.object.isRequired);function C8(e){return N4(e)}function k8(e){return Sa("MuiSvgIcon",e)}m4("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const E8=e=>{const{color:t,fontSize:n,classes:r}=e,s={root:["root",t!=="inherit"&&`color${cn(t)}`,`fontSize${cn(n)}`]};return vw(s,k8,r)},A8=w8("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${cn(n.color)}`],t[`fontSize${cn(n.fontSize)}`]]}})(S8(({theme:e})=>{var t,n,r,s,o,i,a,c,l,u,f,h,g,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(t=e.transitions)==null?void 0:t.create)==null?void 0:s.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:i.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:c.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:u.call(l,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var x,w;return{props:{color:p},style:{color:(w=(x=(e.vars??e).palette)==null?void 0:x[p])==null?void 0:w.main}}}),{props:{color:"action"},style:{color:(h=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(y=(g=(e.vars??e).palette)==null?void 0:g.action)==null?void 0:y.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),ms=m.forwardRef(function(t,n){const r=C8({props:t,name:"MuiSvgIcon"}),{children:s,className:o,color:i="inherit",component:a="svg",fontSize:c="medium",htmlColor:l,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24",...g}=r,y=m.isValidElement(s)&&s.type==="svg",p={...r,color:i,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:y},x={};u||(x.viewBox=h);const w=E8(p);return d.jsxs(A8,{as:a,className:vi(w.root,o),focusable:"false",color:l,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...x,...g,...y&&s.props,ownerState:p,children:[y?s.props.children:s,f?d.jsx("title",{children:f}):null]})});process.env.NODE_ENV!=="production"&&(ms.propTypes={children:ce.node,classes:ce.object,className:ce.string,color:ce.oneOfType([ce.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ce.string]),component:ce.elementType,fontSize:ce.oneOfType([ce.oneOf(["inherit","large","medium","small"]),ce.string]),htmlColor:ce.string,inheritViewBox:ce.bool,shapeRendering:ce.string,sx:ce.oneOfType([ce.arrayOf(ce.oneOfType([ce.func,ce.object,ce.bool])),ce.func,ce.object]),titleAccess:ce.string,viewBox:ce.string});ms.muiName="SvgIcon";function Zn(e,t){function n(r,s){return d.jsx(ms,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:s,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=ms.muiName,m.memo(m.forwardRef(n))}const T8=Zn(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),j8=Zn(d.jsx("path",{d:"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7s.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71s-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9"}),"CallEnd"),P8=Zn([d.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),d.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt"),Zh=Zn(d.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),Kh=Zn(d.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),Gh=Zn(d.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),M8=({disabled:e,capabilities:t,sessionStarted:n,ref:r,participantName:s="User",loadingText:o="Waiting for agent to connect...",theme:i="vox",client:a,displayType:c="widget",onBack:l})=>{var K,q,G,z,P,Y,R;const[u,f]=A.useState(!1),[h,g]=A.useState(!1),[y,p]=A.useState(()=>{var W;const V=(W=a==null?void 0:a.getCurrentInteraction)==null?void 0:W.call(a);return console.log("SessionView: Initializing with existing interaction:",(V==null?void 0:V.methodName)||"none"),V||null}),{messages:x,send:w}=lw(),v=A.useRef(null),S=A.useRef(null),{agent:{isActive:C=!1}={}}=Ee.useVoiceAssistant(),E=Ie(i),T=A.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),k=C||T;A.useEffect(()=>{var V,W;console.log("🤖 SessionView agent state:",{isAgentActive:C,hasActiveSession:T,effectiveAgentActive:k,sessionStarted:n,clientSession:(W=(V=a==null?void 0:a.getCurrentSession)==null?void 0:V.call(a))==null?void 0:W.id})},[C,T,k,n,a]),A.useEffect(()=>{console.log("🤖 Agent active state changed:",C)},[C]),A.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:s,effectiveAgentActive:k,chatOpen:u,currentInteraction:(y==null?void 0:y.methodName)||"none"})},[n,e,s,k,u,y]),A.useEffect(()=>{if(n&&!C){console.log("⏰ Starting agent timeout detection...");const V=setTimeout(()=>{console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),g(!0)},3e4);return()=>{clearTimeout(V)}}else C&&(console.log("✅ Agent is active, clearing timeout"),g(!1))},[n,C]),A.useEffect(()=>{if(!a)return;const V=()=>{console.log("🔄 Client connection state changed:",a.connected)},W=M=>{console.log("🔴 Client disconnected:",M),p(null),f(!1),g(!1)};return a.on("connection.connected",V),a.on("connection.disconnected",W),()=>{a.off("connection.connected",V),a.off("connection.disconnected",W)}},[a]),A.useEffect(()=>{if(!a)return;const V=H=>{console.log("🎯 SessionView: RPC Interaction started:",H);const B=a.getCurrentInteraction();B&&(console.log("📱 SessionView: Setting current interaction:",B.methodName,"mode:",B.presentationMode),p(B))},W=H=>{console.log("✅ SessionView: RPC Interaction completed:",H),p(null)},M=async H=>{console.log("⏰ SessionView: RPC Interaction timeout:",H),p(null)},_=async H=>{console.log("❌ SessionView: RPC Interaction dismissed:",H),p(null)};return a.on("rpc.interaction.started",V),a.on("rpc.interaction.completed",W),a.on("rpc.interaction.timeout",M),a.on("rpc.interaction.dismissed",_),()=>{a.off("rpc.interaction.started",V),a.off("rpc.interaction.completed",W),a.off("rpc.interaction.timeout",M),a.off("rpc.interaction.dismissed",_)}},[a]),A.useEffect(()=>{if(!a)return;const V=a.getCurrentInteraction();V?(console.log("🔄 SessionView: Syncing with existing interaction:",V.methodName),p(V)):p(null)},[a]),A.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(y==null?void 0:y.methodName)||"none","mode:",(y==null?void 0:y.presentationMode)||"none")},[y]),A.useEffect(()=>{var V,W,M;console.log("📱 SessionView: Display type changed to:",c),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:k,hasSession:!!((V=a==null?void 0:a.getCurrentSession)!=null&&V.call(a)),sessionId:(M=(W=a==null?void 0:a.getCurrentSession)==null?void 0:W.call(a))==null?void 0:M.id})},[c,n,k,a]),A.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),A.useEffect(()=>{y&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),f(!1))},[y,u]),dw(),A.useEffect(()=>{v.current&&u&&x.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",x.length),setTimeout(()=>{if(v.current){let V=v.current.parentElement;for(;V&&V.scrollHeight<=V.clientHeight;)V=V.parentElement;V?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),V.scrollTo({top:V.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),v.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[x.length,u]),A.useEffect(()=>{var M,_;console.log("📝 SessionView: Messages updated, count:",x.length),x.length>0&&console.log("📝 SessionView: Latest messages:",x.slice(-3).map(H=>{var B,N,F,U,O,J,X;return{id:H.id,message:H.message,timestamp:H.timestamp,from:((B=H.from)==null?void 0:B.name)||((N=H.from)==null?void 0:N.identity),fromType:H.from===void 0?"unknown":"participant",isLocal:((F=H.from)==null?void 0:F.identity)===((J=(O=(U=a==null?void 0:a.getCurrentSession)==null?void 0:U.call(a))==null?void 0:O.localParticipant)==null?void 0:J.identity),messageLength:((X=H.message)==null?void 0:X.length)||0}}));const V=((M=a==null?void 0:a.getTranscriptions)==null?void 0:M.call(a))||[],W=((_=a==null?void 0:a.getChatMessages)==null?void 0:_.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",V.length),console.log("📝 SessionView: Raw chat messages count:",W.length)},[x.length,x,a]),A.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:x.length,displayType:c,hasMessages:x.length>0})},[u,x.length,c]);async function j(V){await w(V)}const $=A.useCallback(V=>{console.log("📝 SessionView: Adding local message for voice session context:",V)},[]),b=A.useCallback(async V=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(V),console.log("📎 SessionView: Attachments sent successfully:",V.map(W=>W.name)))}catch(W){console.error("❌ SessionView: Failed to send attachments:",W)}},[a]),I=A.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:k,chatOpen:u,currentInteraction:y==null?void 0:y.methodName,hasOnBack:!!l}),y&&(console.log("🎭 SessionView: Dismissing current interaction:",y.methodName),p(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),f(!1),g(!1),console.log("✅ SessionView: Local state reset"),a&&typeof a.endSession=="function"&&(a.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),a&&typeof a.disconnect=="function"&&(a.disconnect(),console.log("✅ SessionView: Client disconnected")),l?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),setTimeout(()=>{l(),console.log("✅ SessionView: onBack called")},150)):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(V){console.error("❌ SessionView: Failed to end call:",V),p(null),f(!1),g(!1),l&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),l())}},[a,l,y,n,k,u]);A.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:s,displayType:c,hasOnBack:!!l,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,s,c,l,a]),A.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!l,onBackType:typeof l})},[l]),A.useEffect(()=>{var W,M;const V=((M=(W=a==null?void 0:a.getCurrentSession)==null?void 0:W.call(a))==null?void 0:M.id)||null;S.current&&!V&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:V,displayType:c,sessionStarted:n,effectiveAgentActive:k}),S.current=V},[a,c,n,k]);const L=ne("w-full flex flex-col items-center justify-center",c==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",E.main,c==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),Z=l&&(c==="popup"||c==="fullscreen");return d.jsxs("main",{ref:r,inert:e,className:ne(L,"relative"),style:{minHeight:0},children:[Z&&d.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=E.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:d.jsx("div",{className:"flex items-center",children:d.jsxs("div",{children:[d.jsx("h3",{className:`font-semibold ${E.text.primary}`,children:"Voice Session"}),d.jsx("p",{className:`text-sm ${E.text.muted}`,children:s})]})})}),d.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!k&&d.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[d.jsx(ae.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:d.jsx(na,{className:E.spinner,weight:"bold"})}),d.jsx(ae.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${E.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":o}),d.jsx(ae.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${E.text.muted} mt-2 text-center opacity-60`,children:h?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),h&&l&&d.jsx(ae.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:l,className:`mt-4 px-4 py-2 rounded-lg ${((q=E.chatHeader)==null?void 0:q.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),k&&d.jsxs(d.Fragment,{children:[u&&d.jsxs("div",{className:ne("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[d.jsxs("div",{className:ne("flex-shrink-0 px-4 py-3 border-b",c==="fullscreen"?"px-8":"px-5",((G=E.chatHeader)==null?void 0:G.container)||"border-gray-200 dark:border-gray-700"),children:[d.jsx("h3",{className:ne("font-semibold text-lg",((z=E.text)==null?void 0:z.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),d.jsxs("p",{className:ne("text-sm",((P=E.text)==null?void 0:P.muted)||"text-gray-600 dark:text-gray-400"),children:[x.length," messages"]})]}),d.jsx("div",{className:ne("flex-1 flex flex-col min-h-0",c==="fullscreen"?"px-8":"px-5"),children:d.jsx(x2,{className:"flex-1 flex flex-col min-h-0 h-full",children:d.jsxs("div",{className:`flex-1 flex flex-col h-full ${ne("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[x.length===0&&d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:ne("text-lg font-medium mb-2",((Y=E.text)==null?void 0:Y.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),d.jsx("p",{className:ne("text-sm",((R=E.text)==null?void 0:R.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),x.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-h-4"}),d.jsx("div",{ref:v,className:"space-y-4 relative whitespace-pre-wrap z-0",children:d.jsx(kn,{mode:"popLayout",children:x.map((V,W)=>d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:W*.02},layout:!0,children:d.jsx(g2,{participantName:s,entry:V})},V.id||`message-${W}`))})})]})]})})})]}),!u&&d.jsxs("div",{className:ne("flex-1 flex flex-col items-center w-full h-full min-h-0",(y==null?void 0:y.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[d.jsx(ae.div,{className:"w-full flex justify-center",animate:{y:(y==null?void 0:y.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:d.jsx(A2,{chatOpen:u})}),d.jsx(kn,{mode:"wait",children:y&&y.presentationMode==="embedded"&&d.jsx(ae.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:ne("w-full relative mt-4 flex justify-center",c==="fullscreen"?"max-w-4xl":"max-w-md"),children:d.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:d.jsx(Vn,{interaction:y,theme:i,onDismiss:()=>{var V;return(V=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:V.call(a)},client:a,addLocalMessage:$})})},`embedded-${y.methodName}`)})]})]})]}),d.jsx(kn,{mode:"wait",children:y&&y.presentationMode!=="embedded"&&!u&&d.jsx("div",{className:ne("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",c==="fullscreen"?"bg-black/70":"bg-black/50"),children:d.jsx(ae.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:ne("relative w-full overflow-hidden",c==="fullscreen"?"max-w-2xl mx-8 max-h-[85vh]":"max-w-lg mx-4 max-h-[80vh]","bg-white dark:bg-gray-900 rounded-2xl shadow-2xl","border border-gray-200 dark:border-gray-700"),children:d.jsx(Vn,{interaction:y,theme:i,onDismiss:()=>{var V;return(V=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:V.call(a)},client:a,addLocalMessage:$})},`modal-${y.methodName}`)})}),d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"absolute bottom-0 left-0 right-0 flex-shrink-0 w-full z-20",children:d.jsx(N8,{capabilities:t,onSendMessage:j,onSendAttachments:b,onEndCall:I,onChatOpenChange:f,disabled:e,theme:i,client:a,sessionStarted:n})})]})};function N8({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:s,disabled:o=!1,theme:i,client:a,sessionStarted:c=!1}){const[l,u]=A.useState(!1),f=A.useRef(null),h=A.useRef(null);A.useEffect(()=>{const v=()=>{const S=navigator.userAgent.toLowerCase(),E=["android","iphone","ipad","mobile","tablet"].some(j=>S.includes(j)),T="ontouchstart"in window||navigator.maxTouchPoints>0,k=window.innerWidth<=768;u(E||T&&k)};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const g=v=>{const S=v.target.files;if(S&&S.length>0){const E=Array.from(S).filter(T=>T.type.startsWith("image/"));if(E.length===0){console.warn("No valid image files selected");return}n&&n(E),f.current&&(f.current.value="")}},y=v=>{const S=v.target.files;if(S&&S.length>0){const C=S[0];C.type.startsWith("image/")&&n&&n([C]),h.current&&(h.current.value="")}},p=()=>{!o&&f.current&&f.current.click()},x=()=>{!o&&l&&h.current&&h.current.click()},w=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:o,sessionStarted:c,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return d.jsx("div",{className:ne("px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:d.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[d.jsx("input",{ref:f,type:"file",multiple:!0,onChange:g,className:"hidden",accept:"image/*"}),d.jsx("input",{ref:h,type:"file",onChange:y,className:"hidden",accept:"image/*",capture:"environment"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:o,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Attach files",children:d.jsx(T8,{className:"w-5 h-5"})}),l&&d.jsx("button",{onClick:x,disabled:o,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Take photo",children:d.jsx(P8,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"flex-1 flex justify-center px-4",children:d.jsx(m2,{capabilities:e,onChatOpenChange:s,onSendMessage:t,theme:i,client:a,className:"border-none py-1 rounded-xl max-w-md w-full"})}),d.jsx("div",{className:"flex items-center",children:d.jsx("button",{onClick:w,disabled:o||!c,className:ne("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o||!c?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:d.jsx(j8,{className:"w-5 h-5"})})})]})})}function R8({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:s}){const[o,i]=m.useState(""),[a,c]=m.useState(!1),l=m.useRef(null),u=m.useRef(null),[f,h]=m.useState(!1),g=Ie(r);m.useEffect(()=>{const C=()=>{const E=navigator.userAgent.toLowerCase(),k=["android","iphone","ipad","mobile","tablet"].some(b=>E.includes(b)),j="ontouchstart"in window||navigator.maxTouchPoints>0,$=window.innerWidth<=768;h(k||j&&$)};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const y=C=>{C.preventDefault(),o.trim()&&!n&&(e(o.trim()),i(""))},p=C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),y(C))},x=C=>{const E=C.target.files;if(E&&E.length>0){const T=Array.from(E),k=T.filter(j=>j.type.startsWith("image/"));if(k.length===0){console.warn("No valid image files selected");return}k.length!==T.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",k),t(k),l.current&&(l.current.value="")}},w=()=>{!n&&l.current&&l.current.click()},v=()=>{!n&&f&&u.current&&u.current.click()},S=C=>{const E=C.target.files;if(E&&E.length>0){const T=E[0];T.type.startsWith("image/")?t([T]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return d.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:d.jsx("form",{onSubmit:y,className:"flex items-center !w-full mx-auto max-w-4xl",children:d.jsxs("div",{className:`flex items-center gap-2 !w-full backdrop-blur-md rounded-full px-3 py-2 shadow-sm hover:shadow-md focus-within:shadow-lg focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-500/50 transition-all duration-200 border ${r==="light"?"bg-white/90 border-gray-200":g.chatInput.container}`,children:[d.jsx(ae.button,{type:"button",onClick:w,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:d.jsx(X2,{className:"w-4 h-4"})}),f&&d.jsx(ae.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:d.jsx(yh,{className:"w-4 h-4"})}),d.jsx("input",{ref:l,type:"file",multiple:!0,onChange:x,className:"hidden",accept:"image/*"}),d.jsx("input",{ref:u,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),d.jsx("textarea",{value:o,onChange:C=>i(C.target.value),onKeyDown:p,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${g.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:C=>{const E=C.target;E.style.height="auto",E.style.height=`${Math.min(E.scrollHeight,80)}px`}}),d.jsx(ae.button,{type:"submit",disabled:n||!o.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${o.trim()&&!n?g.chatInput.sendButton:r==="light"?"bg-gray-200 text-gray-400 cursor-not-allowed opacity-70":"bg-gray-600/50 text-gray-500 cursor-not-allowed opacity-50"}`,"aria-label":"Send message",children:d.jsx(ew,{className:"w-4 h-4"})}),s&&d.jsx(ae.button,{type:"button",onClick:s,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${g.chatInput.endButton}`,"aria-label":"End chat",children:d.jsx(xh,{className:"w-4 h-4"})})]})})})}function V8({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[s,o]=m.useState(""),[i,a]=m.useState(0);return m.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(i<e.length){const c=setTimeout(()=>{o(e.slice(0,i+1)),a(i+1)},r);return()=>clearTimeout(c)}},[e,i,t,r,n]),m.useEffect(()=>{n||(a(0),o(""))},[e,n]),d.jsxs("span",{className:"relative",children:[d.jsx("span",{className:"inline-block",children:s}),!t&&d.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(c=>d.jsx(ae.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:c*.2,ease:"easeInOut"}},c))})]})}function I8({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var i,a;const s=Ie(t),o=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return d.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:d.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),d.jsxs("div",{className:`
228
158
  relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover
229
159
  ${n?`${s.chatMessage.own} rounded-br-md`:`${s.chatMessage.other} rounded-bl-md`}
230
160
  ${r?"shimmer":""}
231
161
  transition-all duration-200 group-hover:scale-[1.02]
232
- `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[d.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:((i=e.metadata)==null?void 0:i.type)==="attachment"?d.jsx(d6,{message:e,theme:t,isOwn:n}):r&&!n?d.jsx(i6,{text:e.content,isComplete:!r,isRealTimeStream:((a=e.metadata)==null?void 0:a.streaming)===!0,speed:35}):e.content}),d.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function c6(e,t){return e.startsWith("image/")?lS:e.startsWith("video/")?PS:e.startsWith("audio/")?yS:e.includes("zip")||e.includes("rar")||e.includes("archive")?tS:aS}function l6(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function d6({message:e,theme:t,isOwn:n}){const r=_e(t),s=e.metadata,o=(s==null?void 0:s.fileName)||"Unknown file",i=(s==null?void 0:s.fileSize)||0,a=(s==null?void 0:s.mimeType)||"application/octet-stream",c=s==null?void 0:s.downloading,l=s==null?void 0:s.uploading,u=(s==null?void 0:s.downloadProgress)||0,h=(s==null?void 0:s.uploadProgress)||0,p=s==null?void 0:s.downloadUrl,g=s==null?void 0:s.file,y=c6(a),f=c||l,v=c?u:h,w=c?"Downloading...":l?"Uploading...":"Complete",[b,S]=m.useState(null);m.useEffect(()=>{if(p)S(p);else if(g&&a.startsWith("image/")){const k=URL.createObjectURL(g);return S(k),()=>URL.revokeObjectURL(k)}else S(null)},[p,g,a]);const C=()=>{if(p){const k=document.createElement("a");k.href=p,k.download=o,k.click()}},T=a.startsWith("image/")&&b;return d.jsxs("div",{className:"flex flex-col gap-2 max-w-sm",children:[T&&d.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[d.jsx("img",{src:b,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:C}),d.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),d.jsxs("div",{className:`
162
+ `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[d.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:((i=e.metadata)==null?void 0:i.type)==="attachment"?d.jsx(L8,{message:e,theme:t,isOwn:n}):r&&!n?d.jsx(V8,{text:e.content,isComplete:!r,isRealTimeStream:((a=e.metadata)==null?void 0:a.streaming)===!0,speed:35}):e.content}),d.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function D8(e,t){return e.startsWith("image/")?B2:e.startsWith("video/")?iw:e.startsWith("audio/")?Y2:e.includes("zip")||e.includes("rar")||e.includes("archive")?V2:F2}function O8(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function L8({message:e,theme:t,isOwn:n}){const r=Ie(t),s=e.metadata,o=(s==null?void 0:s.fileName)||"Unknown file",i=(s==null?void 0:s.fileSize)||0,a=(s==null?void 0:s.mimeType)||"application/octet-stream",c=s==null?void 0:s.downloading,l=s==null?void 0:s.uploading,u=(s==null?void 0:s.downloadProgress)||0,f=(s==null?void 0:s.uploadProgress)||0,h=s==null?void 0:s.downloadUrl,g=s==null?void 0:s.file,y=D8(a),p=c||l,x=c?u:f,w=c?"Downloading...":l?"Uploading...":"Complete",[v,S]=m.useState(null);m.useEffect(()=>{if(h)S(h);else if(g&&a.startsWith("image/")){const k=URL.createObjectURL(g);return S(k),()=>URL.revokeObjectURL(k)}else S(null)},[h,g,a]);const C=()=>{if(h){const k=document.createElement("a");k.href=h,k.download=o,k.click()}},T=a.startsWith("image/")&&v;return d.jsxs("div",{className:"flex flex-col gap-2 max-w-sm",children:[T&&d.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[d.jsx("img",{src:v,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:C}),d.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),d.jsxs("div",{className:`
233
163
  flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
234
164
  ${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
235
165
  `,children:[d.jsx("div",{className:`
236
166
  p-2 rounded-lg flex-shrink-0
237
167
  ${t==="light"?"bg-blue-100 text-blue-600":"bg-blue-900/50 text-blue-400"}
238
- `,children:d.jsx(y,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:o}),d.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[i>0&&l6(i),f&&d.jsxs(d.Fragment,{children:[i>0&&" • ",w," ",Math.round(v*100),"%"]})]}),f&&d.jsx("div",{className:`
168
+ `,children:d.jsx(y,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:o}),d.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[i>0&&O8(i),p&&d.jsxs(d.Fragment,{children:[i>0&&" • ",w," ",Math.round(x*100),"%"]})]}),p&&d.jsx("div",{className:`
239
169
  w-full h-1 rounded-full mt-1 overflow-hidden
240
170
  ${t==="light"?"bg-gray-200":"bg-gray-700"}
241
- `,children:d.jsx(ae.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${v*100}%`},transition:{duration:.3}})})]}),p&&!f&&d.jsx(ae.button,{onClick:C,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
171
+ `,children:d.jsx(ae.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${x*100}%`},transition:{duration:.3}})})]}),h&&!p&&d.jsx(ae.button,{onClick:C,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
242
172
  p-2 rounded-lg transition-colors duration-200
243
173
  ${t==="light"?"hover:bg-gray-200 text-gray-600 hover:text-gray-800":"hover:bg-gray-600 text-gray-400 hover:text-gray-200"}
244
- `,"aria-label":"Download file",children:d.jsx(oS,{className:"w-4 h-4"})})]})]})}function u6(){return d.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[d.jsx("div",{className:"text-2xl mb-2",children:"✅"}),d.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function f6(){return d.jsxs("div",{className:"max-w-xs mx-auto bg-yellow-50 border border-yellow-200 rounded-lg shadow p-3 flex flex-col items-center",children:[d.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),d.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function h6({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s="widget",onEndChat:o}){const[i,a]=m.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const R=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",R.length),R}return[]}),[c,l]=m.useState(!0),[u,h]=m.useState(()=>{const R=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),B=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!R&&!B}),[p,g]=m.useState(new Set),[y,f]=m.useState([]),[v,w]=m.useState(!1),[b,S]=m.useState(!1),[C,E]=m.useState(()=>{const R=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(R==null?void 0:R.methodName)||"none"),R}),T=m.useRef(null),k=_e(t);m.useEffect(()=>{const R=()=>{const B=navigator.userAgent.toLowerCase(),H=["android","iphone","ipad","mobile","tablet"].some(L=>B.includes(L)),j="ontouchstart"in window||navigator.maxTouchPoints>0,F=window.innerWidth<=768,W=H||j&&F;w(W),W&&s==="widget"&&S(!0)};return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[s]),m.useEffect(()=>(b&&v&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{b&&v&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[b,v]);const P=e.getCurrentAgentInfo(),$=(P==null?void 0:P.name)||"AI Assistant",x=$.split(" ").map(R=>R[0]).join("").toUpperCase().slice(0,2),I=m.useCallback(R=>{const B={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:R,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(z=>(console.log("ChatView: Adding local message:",B.id),[...z,B]))},[]);m.useEffect(()=>{var R,B,z,H,j;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((R=e==null?void 0:e.getCurrentSession)!=null&&R.call(e)),messagesCount:i.length,sessionId:(z=(B=e==null?void 0:e.getCurrentSession)==null?void 0:B.call(e))==null?void 0:z.id,hasStoredMessages:!!((j=(H=e==null?void 0:e.getChatMessages)==null?void 0:H.call(e))!=null&&j.length),isMobile:v,isFullscreen:b})},[u,i.length,e,v,b]);const _=m.useCallback((R=!1)=>{T.current&&(R?T.current.scrollIntoView({behavior:"auto"}):T.current.scrollIntoView({behavior:"smooth"}))},[]);m.useEffect(()=>{_(!0);const R=setTimeout(()=>{_(!1)},10);return()=>clearTimeout(R)},[i.length,_]),m.useEffect(()=>{if(C){_(!0);const R=setTimeout(()=>{_(!1)},50);return()=>clearTimeout(R)}},[C,_]),m.useEffect(()=>{const R=H=>{if(console.log("ChatView: Received message:",H),h(!1),C&&H.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",C.methodName),f(j=>[...j,H]);return}H.sender.type==="agent"&&l(!1),a(j=>{var W;if(j.some(L=>L.id===H.id))return console.log("ChatView: Message already exists, skipping:",H.id),j;if(console.log("ChatView: Adding new message:",H.id),H.sender.type==="agent"&&(g(L=>new Set(L).add(H.id)),!((W=H.metadata)!=null&&W.streaming))){const L=H.content.length*35+1e3;setTimeout(()=>{g(J=>{const O=new Set(J);return O.delete(H.id),O})},L)}return[...j,H]}),setTimeout(()=>_(!0),0)},B=H=>{var j;if(console.log("ChatView: Updated message:",H),C&&H.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",C.methodName),f(F=>{const W=F.findIndex(L=>L.id===H.id);if(W>=0){const L=[...F];return L[W]=H,L}else return[...F,H]});return}a(F=>F.map(W=>W.id===H.id?{...H}:W)),setTimeout(()=>_(!0),0),(j=H.metadata)!=null&&j.streaming||g(F=>{const W=new Set(F);return W.delete(H.id),W})},z=H=>{console.log("ChatView: Sent message:",H),h(!1),a(j=>j.some(W=>W.id===H.id)?(console.log("ChatView: Sent message already exists, skipping:",H.id),j):(console.log("ChatView: Adding sent message:",H.id),[...j,H])),setTimeout(()=>_(!0),0)};return e.on("chat.message.received",R),e.on("chat.message.updated",B),e.on("chat.message.sent",z),()=>{e.off("chat.message.received",R),e.off("chat.message.updated",B),e.off("chat.message.sent",z)}},[e,C]),m.useEffect(()=>{const R=j=>{console.log("ChatView: RPC interaction started:",j);const F=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",F==null?void 0:F.methodName),E(F),l(!1),_(!0),setTimeout(()=>{_(!1)},100)},B=j=>{if(console.log("ChatView: RPC interaction completed:",j),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages"),a(F=>{const W=[...F];return y.forEach(L=>{var O;if(!W.some(se=>se.id===L.id)&&(console.log("ChatView: Adding queued message:",L.id),W.push(L),L.sender.type==="agent"&&(g(se=>new Set(se).add(L.id)),!((O=L.metadata)!=null&&O.streaming)))){const se=L.content.length*35+1e3;setTimeout(()=>{g(le=>{const De=new Set(le);return De.delete(L.id),De})},se)}}),W}),f([]),setTimeout(()=>_(!0),0)),j&&j.response&&j.response.success){let F=null;j.response.successView?F=j.response.successView:j.successView&&(F=j.successView),a(W=>{const L=[...W].reverse().findIndex(le=>le.sender.type==="participant");let J=W.length;L!==-1&&(J=W.length-L);const O={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:F||d.jsx(u6,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(O);const se=[...W];return se.splice(J,0,O),se})}},z=async j=>{C&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after timeout"),a(W=>{const L=[...W];return y.forEach(J=>{var se;if(!L.some(le=>le.id===J.id)&&(L.push(J),J.sender.type==="agent"&&(g(le=>new Set(le).add(J.id)),!((se=J.metadata)!=null&&se.streaming)))){const le=J.content.length*35+1e3;setTimeout(()=>{g(De=>{const ut=new Set(De);return ut.delete(J.id),ut})},le)}}),L}),f([]),setTimeout(()=>_(!0),0));let F=null;j&&j.response&&j.response.timeoutView?F=j.response.timeoutView:j&&j.timeoutView&&(F=j.timeoutView),a(W=>{const L={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:$,type:"agent"},metadata:{type:"timeoutView",view:F||d.jsx(f6,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(L),[...W,L]}),setTimeout(()=>{e.getCurrentInteraction()||E(null)},100)},H=async j=>{console.log("ChatView: RPC interaction dismissed:",j),console.log("ChatView: Current interaction before dismiss:",C==null?void 0:C.methodName),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after dismissal"),a(F=>{const W=[...F];return y.forEach(L=>{var O;if(!W.some(se=>se.id===L.id)&&(W.push(L),L.sender.type==="agent"&&(g(se=>new Set(se).add(L.id)),!((O=L.metadata)!=null&&O.streaming)))){const se=L.content.length*35+1e3;setTimeout(()=>{g(le=>{const De=new Set(le);return De.delete(L.id),De})},se)}}),W}),f([]),setTimeout(()=>_(!0),0)),setTimeout(()=>{const F=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(F==null?void 0:F.methodName)||"null"),F===null&&E(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",R),e.on("rpc.interaction.completed",B),e.on("rpc.interaction.timeout",z),e.on("rpc.interaction.dismissed",H),()=>{e.off("rpc.interaction.started",R),e.off("rpc.interaction.completed",B),e.off("rpc.interaction.timeout",z),e.off("rpc.interaction.dismissed",H)}},[e]),m.useEffect(()=>{const R=()=>{if(console.log("ChatView: Agent is thinking"),C){console.log("ChatView: Suppressing thinking indicator due to active interaction:",C.methodName);return}l(!0)},B=()=>{console.log("ChatView: Agent is speaking"),l(!1)};return e.on("agent.thinking",R),e.on("agent.speaking",B),()=>{e.off("agent.thinking",R),e.off("agent.speaking",B)}},[e,C]),m.useEffect(()=>{const R=e.getCurrentInteraction();R?(console.log("ChatView: Restoring interaction state on mount/client change:",R.methodName),E(R)):E(null)},[e]),m.useEffect(()=>{console.log("ChatView: Display type changed to:",s,"Current interaction:",(C==null?void 0:C.methodName)||"none")},[s,C]);const K=async R=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),E(null)),await e.sendChatMessage(R)}catch(B){console.error("Failed to send message:",B)}},Y=async R=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),E(null)),await e.sendAttachments(R),console.log("Attachments sent successfully:",R.map(B=>B.name))}catch(B){console.error("Failed to send attachments:",B)}},[X,G]=m.useState([]);if(m.useEffect(()=>{const R=B=>{G(Array.isArray(B)?B:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",R),()=>{e.off("suggested.response",R)}},[e]),u){const R=b&&v?"fixed inset-0 z-[9999] flex flex-col items-center justify-center h-screen w-screen bg-black":"flex w-full flex-col items-center justify-center h-full p-8";return d.jsxs("div",{className:R,children:[d.jsx("div",{className:`${k.spinner} w-12 h-12 mb-6`}),d.jsxs("p",{className:`text-sm text-center ${b&&v?"text-white":""}`,children:["Connecting to ",$,"..."]})]})}const U=b&&v?"fullscreen":s,M=U==="fullscreen"?b&&v?"fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black":"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm",q=U==="fullscreen"?b&&v?"flex items-center w-full justify-between px-4 pt-3 pb-3 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-6 pt-5 pb-4 border-b ${k.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${k.chatHeader.container}`,N=U==="fullscreen"?b&&v?"flex-1 overflow-y-auto scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide w-full p-4 chat-scrollable min-h-0",V="flex-shrink-0 !w-full",Z=()=>{S(!1),n&&n()};return d.jsxs("div",{className:M,children:[d.jsx("div",{className:q,children:d.jsxs("div",{className:"flex items-center gap-2",children:[b&&v&&d.jsx(ae.button,{onClick:Z,whileHover:{scale:1.05},whileTap:{scale:.95},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2","aria-label":"Exit fullscreen",children:"✕"}),d.jsxs("div",{children:[d.jsx("h3",{className:`font-semibold text-base leading-tight ${b&&v?"text-white":k.text.primary}`,children:$}),d.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${b&&v?"text-gray-300":k.text.muted}`,children:[d.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),d.jsxs("div",{className:`${N} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[d.jsx(ae.div,{transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:x}),d.jsxs("p",{className:`text-base mb-2 ${b&&v?"text-white":k.text.secondary}`,children:[$," is joining..."]}),d.jsx("p",{className:`text-xs ${b&&v?"text-gray-300":k.text.muted}`,children:"Your conversation will begin shortly"})]}):d.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:d.jsxs("div",{className:"space-y-3",children:[i.map((R,B)=>{var z,H;return d.jsx("div",{children:((z=R.metadata)==null?void 0:z.type)==="successView"?d.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[d.jsx(ae.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"Y"}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.own}`,children:[R.metadata.view,d.jsx("div",{className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:R.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((H=R.metadata)==null?void 0:H.type)==="timeoutView"?d.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:x}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.other}`,children:[R.metadata.view,d.jsx("div",{className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:R.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):d.jsx(a6,{message:R,theme:t,isOwn:R.sender.type==="participant",isStreaming:p.has(R.id)})},R.id)}),c&&!C&&d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:i.length*.1},className:"flex w-full justify-start mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:x}),d.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${k.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:d.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(R=>d.jsx(ae.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:R*.2,ease:"easeInOut"}},R))})})]})}),C&&C.presentationMode==="embedded"&&d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx(ae.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:x}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.other}`,children:[d.jsx(Fn,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:I},C.methodName),d.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),d.jsx("div",{ref:T})]})})]}),X.length>0&&d.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:X.map((R,B)=>{var z;return d.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
245
- ${t==="light"?"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900":t==="dark"?"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white":((z=k.suggestedResponse)==null?void 0:z.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
246
- `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{K(R),G([])},children:R},R+B)})}),C&&C.presentationMode!=="embedded"&&d.jsx(Fn,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:I},C.methodName),d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:V,children:d.jsx(o6,{onSendMessage:K,onSendAttachments:Y,disabled:r,theme:t,onEndChat:o})})]})}function m6({onToggleCamera:e,onToggleScreenShare:t,onEndCall:n,onBack:r,theme:s,cameraEnabled:o,screenShareEnabled:i,isCameraLoading:a,isScreenShareLoading:c,disabled:l}){const u=_e(s);return d.jsxs("div",{className:`flex items-center justify-center gap-3 p-4 ${u.video.controlsBackground}`,children:[d.jsx("button",{onClick:e,disabled:l||a,className:`p-3 rounded-full transition-all duration-200 ${o?u.video.controlEnabled:u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Turn off camera":"Turn on camera",children:a?d.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?d.jsx(rm,{className:"w-5 h-5"}):d.jsx(nm,{className:"w-5 h-5"})}),d.jsx("button",{onClick:t,disabled:l||c,className:`p-3 rounded-full transition-all duration-200 ${i?u.video.controlEnabled:u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Stop screen share":"Share screen",children:c?d.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?d.jsx(hS,{className:"w-5 h-5"}):d.jsx(pS,{className:"w-5 h-5"})}),n&&d.jsx("button",{onClick:n,disabled:l,className:`p-3 rounded-full transition-all duration-200 ${u.video.endCall} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:d.jsx(sm,{className:"w-5 h-5"})}),r&&d.jsx("button",{onClick:r,disabled:l,className:`p-3 rounded-full transition-all duration-200 ${u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"Back",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})})]})}function $d({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:s}){var c;const o=_e(s),i=(t==null?void 0:t.name)||(t==null?void 0:t.identity)||(n?"You":"Participant"),a=(e==null?void 0:e.publication)&&!e.publication.isMuted;return d.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?d.jsx(Me.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):d.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:d.jsx(ES,{className:"w-8 h-8"})}),d.jsx("p",{className:"text-sm opacity-80",children:i}),d.jsx("p",{className:"text-xs opacity-60",children:"Camera off"})]})}),d.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:i}),((c=e==null?void 0:e.publication)==null?void 0:c.isMuted)&&d.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:d.jsx(nm,{className:"w-4 h-4"})})]})}function p6({trackRefs:e,participants:t,theme:n,localParticipant:r}){const s=e.find(u=>u.source===te.Track.Source.Camera&&u.participant===r),o=e.filter(u=>u.participant!==r),i=e.length,a=i<=1?1:i<=4?2:3,c="grid gap-2 h-full",l={gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoRows:"minmax(0, 1fr)"};return d.jsxs("div",{className:c,style:l,children:[s&&r&&d.jsx($d,{trackRef:s,participant:r,isLocal:!0,theme:n,className:"min-h-0"}),o.map((u,h)=>{var p;return d.jsx($d,{trackRef:u,participant:u.participant,isLocal:!1,theme:n,className:"min-h-0"},((p=u.publication)==null?void 0:p.trackSid)||h)}),i===0&&d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsxs("div",{className:"text-center",children:[d.jsx(TS,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),d.jsx("p",{className:"text-lg opacity-70",children:"Waiting for participants..."}),d.jsx("p",{className:"text-sm opacity-50",children:"Turn on your camera to start the video call"})]})})]})}function g6({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s,onEndCall:o}){const i=_e(t),a=Me.useMaybeRoomContext(),[c,l]=m.useState(!1),[u,h]=m.useState(!1),[p,g]=m.useState(!1),[y,f]=m.useState(!1),[v,w]=m.useState(null),b=Me.useTracks([te.Track.Source.Camera,te.Track.Source.ScreenShare],{onlySubscribed:!1});b.filter(k=>k.source===te.Track.Source.Camera),b.filter(k=>k.source===te.Track.Source.ScreenShare);const S=m.useMemo(()=>a?Array.from(a.remoteParticipants.values()):[],[a]),C=m.useCallback(async()=>{if(!(!a||p)){g(!0);try{const k=a.localParticipant;c?(await k.setCameraEnabled(!1),l(!1)):(await k.setCameraEnabled(!0),l(!0))}catch(k){console.error("Failed to toggle camera:",k)}finally{g(!1)}}},[a,c,p]),E=m.useCallback(async()=>{if(!(!a||y)){f(!0);try{const k=a.localParticipant;u?(await k.setScreenShareEnabled(!1),h(!1)):(await k.setScreenShareEnabled(!0),h(!0))}catch(k){console.error("Failed to toggle screen share:",k)}finally{f(!1)}}},[a,u,y]),T=m.useCallback(()=>{o?o():n&&n()},[o,n]);return m.useEffect(()=>{if(!e)return;const k=P=>{console.log("📺 Video: Interactive UI state updated:",P),w(P)};return e.on("interactive.ui.update",k),e.on("interactive.ui.show",k),()=>{e.off("interactive.ui.update",k),e.off("interactive.ui.show",k)}},[e]),d.jsxs("div",{className:`flex flex-col h-full ${i.video.container}`,children:[d.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${i.video.header}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`w-3 h-3 rounded-full ${i.video.statusDot}`}),d.jsx("span",{className:"font-medium",children:"Video Call"}),d.jsxs("span",{className:"text-sm opacity-70",children:[S.length+1," participant",S.length!==0?"s":""]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("button",{className:`p-2 rounded-lg transition-colors ${i.video.headerButton}`,title:"Layout options",children:d.jsx(uS,{className:"w-4 h-4"})})})]}),d.jsx("div",{className:"flex-1 p-4 min-h-0",children:d.jsx(p6,{trackRefs:b,participants:S,localParticipant:a==null?void 0:a.localParticipant,theme:t})}),v&&d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute inset-4 z-10",children:d.jsx(Fn,{interaction:v,onDismiss:()=>w(null),theme:t})}),d.jsx(m6,{onToggleCamera:C,onToggleScreenShare:E,onEndCall:T,onBack:n,theme:t,cameraEnabled:c,screenShareEnabled:u,isCameraLoading:p,isScreenShareLoading:y,disabled:r})]})}function ts({onClick:e,disabled:t,theme:n}){const r=_e(n);return d.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:d.jsx(Im,{})})}function Zo({onClick:e,disabled:t,theme:n}){const r=_e(n);return d.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:d.jsx(Vm,{})})}function Ko({onClick:e,disabled:t,theme:n}){const r=_e(n);return d.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:d.jsx(Dm,{})})}function y6({prompts:e,theme:t}){const n=_e(t),[r,s]=A.useState(0);return A.useEffect(()=>{const o=setInterval(()=>{s(i=>(i+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),d.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,i)=>d.jsx("div",{className:`
174
+ `,"aria-label":"Download file",children:d.jsx(L2,{className:"w-4 h-4"})})]})]})}function $8(){return d.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[d.jsx("div",{className:"text-2xl mb-2",children:"✅"}),d.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function F8(){return d.jsxs("div",{className:"max-w-xs mx-auto bg-yellow-50 border border-yellow-200 rounded-lg shadow p-3 flex flex-col items-center",children:[d.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),d.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function _8({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s="widget",onEndChat:o}){const[i,a]=m.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const M=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",M.length),M}return[]}),[c,l]=m.useState(!0),[u,f]=m.useState(()=>{const M=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),_=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!M&&!_}),[h,g]=m.useState(new Set),[y,p]=m.useState([]),[x,w]=m.useState(!1),[v,S]=m.useState(!1),[C,E]=m.useState(()=>{const M=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(M==null?void 0:M.methodName)||"none"),M}),T=m.useRef(null),k=Ie(t);m.useEffect(()=>{const M=()=>{const _=navigator.userAgent.toLowerCase(),B=["android","iphone","ipad","mobile","tablet"].some(O=>_.includes(O)),N="ontouchstart"in window||navigator.maxTouchPoints>0,F=window.innerWidth<=768,U=B||N&&F;w(U),U&&s==="widget"&&S(!0)};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[s]),m.useEffect(()=>(v&&x&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{v&&x&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[v,x]);const j=e.getCurrentAgentInfo(),$=(j==null?void 0:j.name)||"AI Assistant",b=$.split(" ").map(M=>M[0]).join("").toUpperCase().slice(0,2),I=m.useCallback(M=>{const _={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:M,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(H=>(console.log("ChatView: Adding local message:",_.id),[...H,_]))},[]);m.useEffect(()=>{var M,_,H,B,N;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((M=e==null?void 0:e.getCurrentSession)!=null&&M.call(e)),messagesCount:i.length,sessionId:(H=(_=e==null?void 0:e.getCurrentSession)==null?void 0:_.call(e))==null?void 0:H.id,hasStoredMessages:!!((N=(B=e==null?void 0:e.getChatMessages)==null?void 0:B.call(e))!=null&&N.length),isMobile:x,isFullscreen:v})},[u,i.length,e,x,v]);const L=m.useCallback((M=!1)=>{T.current&&(M?T.current.scrollIntoView({behavior:"auto"}):T.current.scrollIntoView({behavior:"smooth"}))},[]);m.useEffect(()=>{L(!0);const M=setTimeout(()=>{L(!1)},10);return()=>clearTimeout(M)},[i.length,L]),m.useEffect(()=>{if(C){L(!0);const M=setTimeout(()=>{L(!1)},50);return()=>clearTimeout(M)}},[C,L]),m.useEffect(()=>{const M=B=>{if(console.log("ChatView: Received message:",B),f(!1),C&&B.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",C.methodName),p(N=>[...N,B]);return}B.sender.type==="agent"&&l(!1),a(N=>{var U;if(N.some(O=>O.id===B.id))return console.log("ChatView: Message already exists, skipping:",B.id),N;if(console.log("ChatView: Adding new message:",B.id),B.sender.type==="agent"&&(g(O=>new Set(O).add(B.id)),!((U=B.metadata)!=null&&U.streaming))){const O=B.content.length*35+1e3;setTimeout(()=>{g(J=>{const X=new Set(J);return X.delete(B.id),X})},O)}return[...N,B]}),setTimeout(()=>L(!0),0)},_=B=>{var N;if(console.log("ChatView: Updated message:",B),C&&B.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",C.methodName),p(F=>{const U=F.findIndex(O=>O.id===B.id);if(U>=0){const O=[...F];return O[U]=B,O}else return[...F,B]});return}a(F=>F.map(U=>U.id===B.id?{...B}:U)),setTimeout(()=>L(!0),0),(N=B.metadata)!=null&&N.streaming||g(F=>{const U=new Set(F);return U.delete(B.id),U})},H=B=>{console.log("ChatView: Sent message:",B),f(!1),a(N=>N.some(U=>U.id===B.id)?(console.log("ChatView: Sent message already exists, skipping:",B.id),N):(console.log("ChatView: Adding sent message:",B.id),[...N,B])),setTimeout(()=>L(!0),0)};return e.on("chat.message.received",M),e.on("chat.message.updated",_),e.on("chat.message.sent",H),()=>{e.off("chat.message.received",M),e.off("chat.message.updated",_),e.off("chat.message.sent",H)}},[e,C]),m.useEffect(()=>{const M=N=>{console.log("ChatView: RPC interaction started:",N);const F=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",F==null?void 0:F.methodName),E(F),l(!1),L(!0),setTimeout(()=>{L(!1)},100)},_=N=>{if(console.log("ChatView: RPC interaction completed:",N),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages"),a(F=>{const U=[...F];return y.forEach(O=>{var X;if(!U.some(se=>se.id===O.id)&&(console.log("ChatView: Adding queued message:",O.id),U.push(O),O.sender.type==="agent"&&(g(se=>new Set(se).add(O.id)),!((X=O.metadata)!=null&&X.streaming)))){const se=O.content.length*35+1e3;setTimeout(()=>{g(me=>{const $e=new Set(me);return $e.delete(O.id),$e})},se)}}),U}),p([]),setTimeout(()=>L(!0),0)),N&&N.response&&N.response.success){let F=null;N.response.successView?F=N.response.successView:N.successView&&(F=N.successView),a(U=>{const O=[...U].reverse().findIndex(me=>me.sender.type==="participant");let J=U.length;O!==-1&&(J=U.length-O);const X={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:F||d.jsx($8,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(X);const se=[...U];return se.splice(J,0,X),se})}},H=async N=>{C&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after timeout"),a(U=>{const O=[...U];return y.forEach(J=>{var se;if(!O.some(me=>me.id===J.id)&&(O.push(J),J.sender.type==="agent"&&(g(me=>new Set(me).add(J.id)),!((se=J.metadata)!=null&&se.streaming)))){const me=J.content.length*35+1e3;setTimeout(()=>{g($e=>{const at=new Set($e);return at.delete(J.id),at})},me)}}),O}),p([]),setTimeout(()=>L(!0),0));let F=null;N&&N.response&&N.response.timeoutView?F=N.response.timeoutView:N&&N.timeoutView&&(F=N.timeoutView),a(U=>{const O={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:$,type:"agent"},metadata:{type:"timeoutView",view:F||d.jsx(F8,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(O),[...U,O]}),setTimeout(()=>{e.getCurrentInteraction()||E(null)},100)},B=async N=>{console.log("ChatView: RPC interaction dismissed:",N),console.log("ChatView: Current interaction before dismiss:",C==null?void 0:C.methodName),E(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after dismissal"),a(F=>{const U=[...F];return y.forEach(O=>{var X;if(!U.some(se=>se.id===O.id)&&(U.push(O),O.sender.type==="agent"&&(g(se=>new Set(se).add(O.id)),!((X=O.metadata)!=null&&X.streaming)))){const se=O.content.length*35+1e3;setTimeout(()=>{g(me=>{const $e=new Set(me);return $e.delete(O.id),$e})},se)}}),U}),p([]),setTimeout(()=>L(!0),0)),setTimeout(()=>{const F=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(F==null?void 0:F.methodName)||"null"),F===null&&E(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",M),e.on("rpc.interaction.completed",_),e.on("rpc.interaction.timeout",H),e.on("rpc.interaction.dismissed",B),()=>{e.off("rpc.interaction.started",M),e.off("rpc.interaction.completed",_),e.off("rpc.interaction.timeout",H),e.off("rpc.interaction.dismissed",B)}},[e]),m.useEffect(()=>{const M=()=>{if(console.log("ChatView: Agent is thinking"),C){console.log("ChatView: Suppressing thinking indicator due to active interaction:",C.methodName);return}l(!0)},_=()=>{console.log("ChatView: Agent is speaking"),l(!1)};return e.on("agent.thinking",M),e.on("agent.speaking",_),()=>{e.off("agent.thinking",M),e.off("agent.speaking",_)}},[e,C]),m.useEffect(()=>{const M=e.getCurrentInteraction();M?(console.log("ChatView: Restoring interaction state on mount/client change:",M.methodName),E(M)):E(null)},[e]),m.useEffect(()=>{console.log("ChatView: Display type changed to:",s,"Current interaction:",(C==null?void 0:C.methodName)||"none")},[s,C]);const Z=async M=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),E(null)),await e.sendChatMessage(M)}catch(_){console.error("Failed to send message:",_)}},K=async M=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),E(null)),await e.sendAttachments(M),console.log("Attachments sent successfully:",M.map(_=>_.name))}catch(_){console.error("Failed to send attachments:",_)}},[q,G]=m.useState([]);if(m.useEffect(()=>{const M=_=>{G(Array.isArray(_)?_:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",M),()=>{e.off("suggested.response",M)}},[e]),u){const M=v&&x?"fixed inset-0 z-[9999] flex flex-col items-center justify-center h-screen w-screen bg-black":"flex w-full flex-col items-center justify-center h-full p-8";return d.jsxs("div",{className:M,children:[d.jsx("div",{className:`${k.spinner} w-12 h-12 mb-6`}),d.jsxs("p",{className:`text-sm text-center ${v&&x?"text-white":""}`,children:["Connecting to ",$,"..."]})]})}const z=v&&x?"fullscreen":s,P=z==="fullscreen"?v&&x?"fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black":"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm",Y=z==="fullscreen"?v&&x?"flex items-center w-full justify-between px-4 pt-3 pb-3 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-6 pt-5 pb-4 border-b ${k.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${k.chatHeader.container}`,R=z==="fullscreen"?v&&x?"flex-1 overflow-y-auto scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide w-full p-4 chat-scrollable min-h-0",V="flex-shrink-0 !w-full",W=()=>{S(!1),n&&n()};return d.jsxs("div",{className:P,children:[d.jsx("div",{className:Y,children:d.jsxs("div",{className:"flex items-center gap-2",children:[v&&x&&d.jsx(ae.button,{onClick:W,whileHover:{scale:1.05},whileTap:{scale:.95},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2","aria-label":"Exit fullscreen",children:"✕"}),d.jsxs("div",{children:[d.jsx("h3",{className:`font-semibold text-base leading-tight ${v&&x?"text-white":k.text.primary}`,children:$}),d.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${v&&x?"text-gray-300":k.text.muted}`,children:[d.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),d.jsxs("div",{className:`${R} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[d.jsx(ae.div,{transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:b}),d.jsxs("p",{className:`text-base mb-2 ${v&&x?"text-white":k.text.secondary}`,children:[$," is joining..."]}),d.jsx("p",{className:`text-xs ${v&&x?"text-gray-300":k.text.muted}`,children:"Your conversation will begin shortly"})]}):d.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:d.jsxs("div",{className:"space-y-3",children:[i.map((M,_)=>{var H,B;return d.jsx("div",{children:((H=M.metadata)==null?void 0:H.type)==="successView"?d.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[d.jsx(ae.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"Y"}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.own}`,children:[M.metadata.view,d.jsx("div",{className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:M.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((B=M.metadata)==null?void 0:B.type)==="timeoutView"?d.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:b}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.other}`,children:[M.metadata.view,d.jsx("div",{className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:M.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):d.jsx(I8,{message:M,theme:t,isOwn:M.sender.type==="participant",isStreaming:h.has(M.id)})},M.id)}),c&&!C&&d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:i.length*.1},className:"flex w-full justify-start mb-4 px-1",children:d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:b}),d.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${k.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:d.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(M=>d.jsx(ae.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:M*.2,ease:"easeInOut"}},M))})})]})}),C&&C.presentationMode==="embedded"&&d.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[d.jsx(ae.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:b}),d.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${k.chatMessage.other}`,children:[d.jsx(Vn,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:I},C.methodName),d.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${k.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),d.jsx("div",{ref:T})]})})]}),q.length>0&&d.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:q.map((M,_)=>{var H;return d.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
175
+ ${t==="light"?"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900":t==="dark"?"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white":((H=k.suggestedResponse)==null?void 0:H.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
176
+ `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{Z(M),G([])},children:M},M+_)})}),C&&C.presentationMode!=="embedded"&&d.jsx(Vn,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:I},C.methodName),d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:V,children:d.jsx(R8,{onSendMessage:Z,onSendAttachments:K,disabled:r,theme:t,onEndChat:o})})]})}function B8({onToggleCamera:e,onToggleScreenShare:t,onEndCall:n,onBack:r,theme:s,cameraEnabled:o,screenShareEnabled:i,isCameraLoading:a,isScreenShareLoading:c,disabled:l}){const u=Ie(s);return d.jsxs("div",{className:`flex items-center justify-center gap-3 p-4 ${u.video.controlsBackground}`,children:[d.jsx("button",{onClick:e,disabled:l||a,className:`p-3 rounded-full transition-all duration-200 ${o?u.video.controlEnabled:u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Turn off camera":"Turn on camera",children:a?d.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?d.jsx(yh,{className:"w-5 h-5"}):d.jsx(gh,{className:"w-5 h-5"})}),d.jsx("button",{onClick:t,disabled:l||c,className:`p-3 rounded-full transition-all duration-200 ${i?u.video.controlEnabled:u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Stop screen share":"Share screen",children:c?d.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?d.jsx(W2,{className:"w-5 h-5"}):d.jsx(K2,{className:"w-5 h-5"})}),n&&d.jsx("button",{onClick:n,disabled:l,className:`p-3 rounded-full transition-all duration-200 ${u.video.endCall} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:d.jsx(xh,{className:"w-5 h-5"})}),r&&d.jsx("button",{onClick:r,disabled:l,className:`p-3 rounded-full transition-all duration-200 ${u.video.controlDisabled} ${l?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"Back",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})})]})}function od({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:s}){var c;const o=Ie(s),i=(t==null?void 0:t.name)||(t==null?void 0:t.identity)||(n?"You":"Participant"),a=(e==null?void 0:e.publication)&&!e.publication.isMuted;return d.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?d.jsx(Ee.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):d.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:d.jsx(nw,{className:"w-8 h-8"})}),d.jsx("p",{className:"text-sm opacity-80",children:i}),d.jsx("p",{className:"text-xs opacity-60",children:"Camera off"})]})}),d.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:i}),((c=e==null?void 0:e.publication)==null?void 0:c.isMuted)&&d.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:d.jsx(gh,{className:"w-4 h-4"})})]})}function H8({trackRefs:e,participants:t,theme:n,localParticipant:r}){const s=e.find(u=>u.source===te.Track.Source.Camera&&u.participant===r),o=e.filter(u=>u.participant!==r),i=e.length,a=i<=1?1:i<=4?2:3,c="grid gap-2 h-full",l={gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoRows:"minmax(0, 1fr)"};return d.jsxs("div",{className:c,style:l,children:[s&&r&&d.jsx(od,{trackRef:s,participant:r,isLocal:!0,theme:n,className:"min-h-0"}),o.map((u,f)=>{var h;return d.jsx(od,{trackRef:u,participant:u.participant,isLocal:!1,theme:n,className:"min-h-0"},((h=u.publication)==null?void 0:h.trackSid)||f)}),i===0&&d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsxs("div",{className:"text-center",children:[d.jsx(sw,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),d.jsx("p",{className:"text-lg opacity-70",children:"Waiting for participants..."}),d.jsx("p",{className:"text-sm opacity-50",children:"Turn on your camera to start the video call"})]})})]})}function z8({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s,onEndCall:o}){const i=Ie(t),a=Ee.useMaybeRoomContext(),[c,l]=m.useState(!1),[u,f]=m.useState(!1),[h,g]=m.useState(!1),[y,p]=m.useState(!1),[x,w]=m.useState(null),v=Ee.useTracks([te.Track.Source.Camera,te.Track.Source.ScreenShare],{onlySubscribed:!1});v.filter(k=>k.source===te.Track.Source.Camera),v.filter(k=>k.source===te.Track.Source.ScreenShare);const S=m.useMemo(()=>a?Array.from(a.remoteParticipants.values()):[],[a]),C=m.useCallback(async()=>{if(!(!a||h)){g(!0);try{const k=a.localParticipant;c?(await k.setCameraEnabled(!1),l(!1)):(await k.setCameraEnabled(!0),l(!0))}catch(k){console.error("Failed to toggle camera:",k)}finally{g(!1)}}},[a,c,h]),E=m.useCallback(async()=>{if(!(!a||y)){p(!0);try{const k=a.localParticipant;u?(await k.setScreenShareEnabled(!1),f(!1)):(await k.setScreenShareEnabled(!0),f(!0))}catch(k){console.error("Failed to toggle screen share:",k)}finally{p(!1)}}},[a,u,y]),T=m.useCallback(()=>{o?o():n&&n()},[o,n]);return m.useEffect(()=>{if(!e)return;const k=j=>{console.log("📺 Video: Interactive UI state updated:",j),w(j)};return e.on("interactive.ui.update",k),e.on("interactive.ui.show",k),()=>{e.off("interactive.ui.update",k),e.off("interactive.ui.show",k)}},[e]),d.jsxs("div",{className:`flex flex-col h-full ${i.video.container}`,children:[d.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${i.video.header}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`w-3 h-3 rounded-full ${i.video.statusDot}`}),d.jsx("span",{className:"font-medium",children:"Video Call"}),d.jsxs("span",{className:"text-sm opacity-70",children:[S.length+1," participant",S.length!==0?"s":""]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("button",{className:`p-2 rounded-lg transition-colors ${i.video.headerButton}`,title:"Layout options",children:d.jsx(z2,{className:"w-4 h-4"})})})]}),d.jsx("div",{className:"flex-1 p-4 min-h-0",children:d.jsx(H8,{trackRefs:v,participants:S,localParticipant:a==null?void 0:a.localParticipant,theme:t})}),x&&d.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute inset-4 z-10",children:d.jsx(Vn,{interaction:x,onDismiss:()=>w(null),theme:t})}),d.jsx(B8,{onToggleCamera:C,onToggleScreenShare:E,onEndCall:T,onBack:n,theme:t,cameraEnabled:c,screenShareEnabled:u,isCameraLoading:h,isScreenShareLoading:y,disabled:r})]})}function Ur({onClick:e,disabled:t,theme:n}){const r=Ie(n);return d.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:d.jsx(Kh,{})})}function To({onClick:e,disabled:t,theme:n}){const r=Ie(n);return d.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:d.jsx(Zh,{})})}function jo({onClick:e,disabled:t,theme:n}){const r=Ie(n);return d.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:d.jsx(Gh,{})})}function U8({prompts:e,theme:t}){const n=Ie(t),[r,s]=A.useState(0);return A.useEffect(()=>{const o=setInterval(()=>{s(i=>(i+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),d.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,i)=>d.jsx("div",{className:`
247
177
  ${n.promptSlider}
248
178
  ${i===r?"opacity-100":"opacity-0"}
249
179
  whitespace-pre-line break-words
250
- `,style:{minHeight:"2.5rem",display:i===r?"block":"none"},children:o},i))})}function v6({statusMessage:e,theme:t}){const n=_e(t);return d.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[d.jsx("div",{className:n.statusIndicator}),d.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const x6=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:s=['"Book a meeting with the marketing team"',`"What's the status of project Alpha?"`,`"Summarize yesterday's sales report"`,'"Find a good Italian restaurant nearby"','"Remind me to call John tomorrow at 10 AM"'],statusMessage:o="Agent is ready",title:i="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:c="vox",modalities:l=["voice","chat","video"]})=>{const u=_e(c),h=l.includes("voice"),p=l.includes("chat"),g=l.includes("video"),y=[h,p,g].filter(Boolean).length;return console.log("🎯 Welcome component debug:",{modalities:l,hasVoice:h,hasChat:p,hasVideo:g,totalButtons:y,onStartVideo:!!r}),d.jsxs("div",{inert:e,className:"flex p-8 flex-col items-center h-full justify-center w-full",children:[d.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[d.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[d.jsx("div",{className:u.pulseRings.ring1}),d.jsx("div",{className:u.pulseRings.ring2,style:{animationDelay:"0.5s"}}),d.jsx("div",{className:u.pulseRings.ring3,style:{animationDelay:"1s"}})]}),d.jsx("div",{className:"relative z-10 flex items-center justify-center",children:h&&p&&g?d.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[d.jsx(ts,{onClick:t,disabled:e,theme:c}),d.jsx(Zo,{onClick:n,disabled:e,theme:c}),d.jsx(Ko,{onClick:r||t,disabled:e,theme:c})]}):y>1?d.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[h&&d.jsx(ts,{onClick:t,disabled:e,theme:c}),p&&d.jsx(Zo,{onClick:n,disabled:e,theme:c}),g&&r&&d.jsx(Ko,{onClick:r,disabled:e,theme:c})]}):d.jsx("div",{className:"flex items-center justify-center",children:h?d.jsx(ts,{onClick:t,disabled:e,theme:c}):p?d.jsx(Zo,{onClick:n,disabled:e,theme:c}):g&&r?d.jsx(Ko,{onClick:r,disabled:e,theme:c}):d.jsx(ts,{onClick:t,disabled:e,theme:c})})})]}),d.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[d.jsx("h3",{className:`text-xl font-semibold mb-2 ${u.text.accent}`,children:i}),d.jsx("p",{className:`text-sm leading-relaxed px-4 ${u.text.secondary}`,children:a}),y>1&&d.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[h&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Im,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Voice"})]}),p&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Vm,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Chat"})]}),g&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Dm,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Video"})]})]})]}),d.jsx(y6,{prompts:s,theme:c}),d.jsx(v6,{statusMessage:o,theme:c})]})};function Om({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:s=!0,voxketSessionId:o}={}){const[i,a]=m.useState(null),[c,l]=m.useState([]),[u,h]=m.useState(null),[p,g]=m.useState([]),y=m.useCallback((b,S)=>{const C={timestamp:new Date,event:b,data:S,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(l(E=>[...E,C]),s){const E=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");E.push(C),localStorage.setItem("voxket-session-logs",JSON.stringify(E))}return C},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,r,s]);m.useEffect(()=>{if(!e)return;const b=()=>{const x=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,I=new Date,_={sessionId:x,startTime:I,totalMessages:0,connectionIssues:0,participantCount:p.length,events:[]};a(_),y("SESSION_STARTED",{sessionId:x,startTime:I}),n==null||n(x)},S=()=>{if(i){const x=new Date,I=x.getTime()-i.startTime.getTime(),_={...i,endTime:x,duration:I,events:c};y("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(I/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(_),a(null),l([])}},C=x=>{y("CONNECTION_STATE_CHANGED",{state:x}),x===te.ConnectionState.Reconnecting&&i&&(a(I=>I?{...I,connectionIssues:I.connectionIssues+1}:null),y("CONNECTION_ISSUE",{type:"reconnecting"}))},E=x=>{y("TRACK_PUBLISHED",{trackKind:x.kind,trackSource:x.source})},T=x=>{y("TRACK_UNPUBLISHED",{trackKind:x.kind,trackSource:x.source})},k=(x,I)=>{i&&a(_=>_?{..._,totalMessages:_.totalMessages+1}:null),y("DATA_RECEIVED",{participantId:I==null?void 0:I.identity,dataSize:x.length})},P=x=>{y("PARTICIPANT_CONNECTED",{participantId:x.identity,participantName:x.name}),g(I=>[...I,x]),i&&a(I=>I?{...I,participantCount:I.participantCount+1}:null)},$=x=>{y("PARTICIPANT_DISCONNECTED",{participantId:x.identity,participantName:x.name}),g(I=>I.filter(_=>_.identity!==x.identity))};return e.localParticipant&&h(e.localParticipant),e.on(te.RoomEvent.Connected,b),e.on(te.RoomEvent.Disconnected,S),e.on(te.RoomEvent.ConnectionStateChanged,C),e.on(te.RoomEvent.TrackPublished,E),e.on(te.RoomEvent.TrackUnpublished,T),e.on(te.RoomEvent.DataReceived,k),e.on(te.RoomEvent.ParticipantConnected,P),e.on(te.RoomEvent.ParticipantDisconnected,$),()=>{e.off(te.RoomEvent.Connected,b),e.off(te.RoomEvent.Disconnected,S),e.off(te.RoomEvent.ConnectionStateChanged,C),e.off(te.RoomEvent.TrackPublished,E),e.off(te.RoomEvent.TrackUnpublished,T),e.off(te.RoomEvent.DataReceived,k),e.off(te.RoomEvent.ParticipantConnected,P),e.off(te.RoomEvent.ParticipantDisconnected,$)}},[e,i,c,p.length,y,t,n]);const f=m.useCallback(()=>s?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):c,[c,s]),v=m.useCallback(()=>{s&&localStorage.removeItem("voxket-session-logs"),l([])},[s]),w=m.useCallback(()=>{const b=f(),S=JSON.stringify(b,null,2),C="data:application/json;charset=utf-8,"+encodeURIComponent(S),E=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,T=document.createElement("a");T.setAttribute("href",C),T.setAttribute("download",E),T.click()},[f]);return{sessionMetrics:i,sessionLogs:c,logEvent:y,getSessionLogs:f,clearSessionLogs:v,exportSessionLogs:w}}var En={},Ld;function b6(){if(Ld)return En;Ld=1;var e=Fi;if(process.env.NODE_ENV==="production")En.createRoot=e.createRoot,En.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;En.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},En.hydrateRoot=function(n,r,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,s)}finally{t.usingClientEntryPoint=!1}}}return En}var w6=b6();class Ya{constructor(){Ne(this,"listeners",{})}on(t,n){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n),()=>this.off(t,n)}once(t,n){const r=(...s)=>{this.off(t,r),n(...s)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);s>-1&&r.splice(s,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const s=[...r];for(const o of s)try{o(...n)}catch(i){console.error(`Error in event listener for ${String(t)}:`,i)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class $m{constructor(t){Ne(this,"plugins",new Map);Ne(this,"installedPlugins",new Set);Ne(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const r=this.plugins.get(t);if(!r)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(r.dependencies)for(const o of r.dependencies)this.installedPlugins.has(o)||await this.install(o);const s={...this.context,config:{...r.config,...n}};r.install&&await r.install(s),this.installedPlugins.add(t),this.setupPluginEvents(r,s)}async uninstall(t){var r;const n=this.plugins.get(t);if(!n)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t)){for(const[s,o]of this.plugins)if(this.installedPlugins.has(s)&&((r=o.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${s}' depends on it`);n.uninstall&&await n.uninstall(this.context),this.installedPlugins.delete(t)}}isInstalled(t){return this.installedPlugins.has(t)}getInstalledPlugins(){return Array.from(this.installedPlugins)}getAvailablePlugins(){return Array.from(this.plugins.keys())}getPluginInfo(t){return this.plugins.get(t)}setupPluginEvents(t,n){t.onSessionStart&&n.on("session.started",r=>{t.onSessionStart(n,r.id)}),t.onSessionEnd&&n.on("session.ended",r=>{t.onSessionEnd(n,r.id)}),t.onAgentResponse&&n.on("agent.response",r=>{t.onAgentResponse(n,r)})}}function S6(e){return e}function Ga(e,t,n){return{name:e,version:"1.0.0",description:`${t} modality plugin`,install:async r=>{n.onActivate&&await n.onActivate(r)},uninstall:async r=>{n.onDeactivate&&await n.onDeactivate(r)},onAgentResponse:n.onMessage}}const C6={name:"analytics",version:"1.0.0",description:"Built-in analytics tracking",install:async e=>{console.log("Analytics plugin installed"),e.on("session.started",t=>{console.log("Analytics: Session started",t.id)}),e.on("session.ended",(t,n)=>{console.log("Analytics: Session ended",t.id,n)}),e.on("chat.message.sent",t=>{console.log("Analytics: User message sent",t.content.length)})}},E6={name:"debug",version:"1.0.0",description:"Debug logging and development tools",install:async e=>{console.log("Debug plugin installed");const t=e.emit;e.emit=(n,...r)=>(console.log(`[Debug] Event: ${String(n)}`,r),t(n,...r))}},k6={name:"metrics",version:"1.0.0",description:"Advanced metrics collection",install:async e=>{console.log("Metrics plugin installed");const t=new Map;e.on("session.started",n=>{t.set(n.id,{startTime:Date.now(),events:[]})}),e.on("agent.response",n=>{console.log("Metrics: Agent response analyzed",{type:n.type,length:n.content.length,timestamp:n.timestamp})})}},Lm=A.createContext(null);function _m({config:e,children:t,autoConnect:n=!1}){const[r,s]=A.useState(null),[o,i]=A.useState(!1),[a,c]=A.useState(!1),[l,u]=A.useState(null),[h,p]=A.useState(null),[g,y]=A.useState("idle"),[f,v]=A.useState(null),[w,b]=A.useState([]),[S,C]=A.useState([]),[E,T]=A.useState([]);A.useEffect(()=>{const M=new Ir(e);return s(M),k(M),n&&P(M),()=>{M.disconnect().catch(console.error)}},[e,n]);const k=M=>{M.on("connection.connecting",()=>{c(!0),u(null)}),M.on("connection.connected",()=>{i(!0),c(!1),u(null)}),M.on("connection.disconnected",()=>{i(!1),c(!1),p(null),y("idle"),b([]),C([]),T([])}),M.on("connection.error",q=>{u(q),c(!1)}),M.on("session.created",q=>{p(q),y(q.state)}),M.on("session.state.changed",q=>{y(q),h&&p({...h,state:q})}),M.on("session.ended",(q,N)=>{p(null),y("idle"),v(N),b([]),C([]),T([])}),M.on("participant.joined",q=>{b(N=>[...N,q])}),M.on("participant.left",q=>{b(N=>N.filter(V=>V.id!==q.id))}),M.on("chat.message.received",q=>{C(N=>[...N,q])}),M.on("chat.message.sent",q=>{C(N=>[...N,q])}),M.on("transcription.received",q=>{T(N=>[...N,q])})},P=async M=>{const q=M||r;if(q)try{await q.connect()}catch(N){console.error("Failed to connect:",N)}},U={client:r,isConnected:o,isConnecting:a,connectionError:l,currentSession:h,sessionState:g,sessionMetrics:f,participants:w,chatMessages:S,transcriptions:E,connect:()=>P(),disconnect:async()=>{if(r)try{await r.disconnect()}catch(M){console.error("Failed to disconnect:",M)}},createSession:async(M,q={})=>{if(!r)throw new Error("Client not initialized");const N={agentId:M,participantName:q.participantName||"User",metadata:q.metadata,modalities:q.modalities||["voice"]};return await r.createSession(N)},endSession:async()=>r?await r.endSession():null,sendChatMessage:async M=>{if(!r)throw new Error("Client not initialized");await r.sendChatMessage(M)},setMicrophoneEnabled:async M=>{if(!r)throw new Error("Client not initialized");await r.setMicrophoneEnabled(M)},setCameraEnabled:async M=>{if(!r)throw new Error("Client not initialized");await r.setCameraEnabled(M)},startScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.startScreenShare()},stopScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.stopScreenShare()}};return d.jsx(Lm.Provider,{value:U,children:t})}function Et(){const e=A.useContext(Lm);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class T6 extends Ya{constructor(n){super();Ne(this,"room",null);Ne(this,"registeredMethods",new Map);Ne(this,"activeInteractions",new Map);Ne(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,s="embedded"){if(console.log(`RpcManager: Starting registration for method '${n}'`),!this.room)throw console.error(`RpcManager: Cannot register '${n}' - no room instance`),new Error("Room not initialized. Cannot register RPC method.");if(!this.room.localParticipant)throw console.error(`RpcManager: Cannot register '${n}' - no local participant`),new Error("Local participant not available for RPC registration");console.log(`RpcManager: Room state: ${this.room.state}`),console.log(`RpcManager: Local participant: ${this.room.localParticipant.identity}`),console.log(`RpcManager: Registering frontend RPC method: ${n}`);const o={methodName:n,component:r,presentationMode:s};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async i=>{console.log(`RpcManager: RPC method '${n}' called by ${i.callerIdentity}`),console.log("RpcManager: Payload:",i.payload),this.emit("rpc.method.called",{methodName:n,data:i});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let c=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const l=await this.awaitUserInteraction(n,r,s,a,c);return JSON.stringify(l)}catch(l){throw console.error(`RpcManager: Error in RPC method '${n}':`,l),l}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(i){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,i),i}}async awaitUserInteraction(n,r,s,o,i){return new Promise((a,c)=>{const l=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(p,g)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,p),this.clearInteraction(l),this.currentInteraction=null;const y={success:!0,message:"User interaction completed successfully",data:p,timestamp:new Date,...g?{successView:g}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:y}),a(y)},didFail:p=>{console.log(`RpcManager: User interaction failed for method: ${n}`,p),this.clearInteraction(l);const g={success:!1,message:"User interaction failed",error:p,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},dismissView:()=>{var g;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(g=this.currentInteraction)==null?void 0:g.methodName),this.clearInteraction(l),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const p={success:!0,data:{dismissed:!0,reason:"User dismissed the interaction"},message:"User interaction dismissed",timestamp:new Date};this.emit("rpc.interaction.dismissed",{methodName:n,response:p}),this.emit("rpc.interaction.completed",{methodName:n,response:p}),setTimeout(()=>{var y;((y=this.currentInteraction)==null?void 0:y.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(p)},didTimeout:p=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(l),this.currentInteraction=null;const g={success:!0,message:`User interaction timed out after ${i} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...p?{timeoutView:p}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:g}),setTimeout(()=>{var y;((y=this.currentInteraction)==null?void 0:y.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(g)}},h=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(l,{resolve:p=>a(JSON.parse(p)),reject:c,timeoutId:h}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:s,timeout:i,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:s}),setTimeout(async()=>{var p;if((p=this.currentInteraction)!=null&&p.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(g){console.error("RpcManager: Error loading data into component:",g),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const r=this.activeInteractions.get(n);r&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(r.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,r]of this.activeInteractions)clearTimeout(r.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}class ge extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}class Ir extends Ya{constructor(n){super();Ne(this,"config");Ne(this,"room",null);Ne(this,"pluginManager");Ne(this,"rpcManager");Ne(this,"isConnected",!1);Ne(this,"currentSession",null);Ne(this,"connectionState",te.ConnectionState.Disconnected);Ne(this,"renderedComponents",new Map);Ne(this,"textStreamHandlersRegistered",!1);Ne(this,"currentAgentInfo",null);Ne(this,"chatMessages",[]);this.config=n,this.pluginManager=new $m(this),this.rpcManager=new T6,this.setupEventListeners(),this.initializeClient()}setupEventListeners(){this.on("connection.connected",()=>{var n,r;this.isConnected=!0,(r=(n=this.config).onConnected)==null||r.call(n)}),this.on("connection.disconnected",n=>{var r,s;this.isConnected=!1,(s=(r=this.config).onDisconnected)==null||s.call(r,n)}),this.on("connection.error",n=>{var r,s;(s=(r=this.config).onError)==null||s.call(r,n)}),this.on("chat.message.received",n=>{var r,s;this.addChatMessage(n),(s=(r=this.config).onMessageReceived)==null||s.call(r,n)}),this.on("chat.message.updated",n=>{this.updateChatMessage(n)}),this.on("chat.message.sent",n=>{this.addChatMessage(n)}),this.on("transcription.received",n=>{var r,s;(s=(r=this.config).onTranscriptionReceived)==null||s.call(r,n)}),this.on("session.state.changed",n=>{var r,s;(s=(r=this.config).onSessionStateChanged)==null||s.call(r,n)}),this.on("session.created",n=>{var r,s;(s=(r=this.config).onSessionStart)==null||s.call(r,n.id)}),this.on("session.ended",(n,r)=>{var s,o;(o=(s=this.config).onSessionEnd)==null||o.call(s,r)}),this.on("participant.joined",n=>{var r,s;(s=(r=this.config).onUserJoined)==null||s.call(r,n.id)}),this.on("participant.left",n=>{var r,s;(s=(r=this.config).onUserLeft)==null||s.call(r,n.id)}),this.setupRpcEventForwarding()}setupRpcEventForwarding(){if(!this.rpcManager){console.warn("RpcManager not initialized, skipping event forwarding setup");return}this.rpcManager.on("rpc.method.registered",n=>this.emit("rpc.method.registered",n)),this.rpcManager.on("rpc.method.called",n=>this.emit("rpc.method.called",n)),this.rpcManager.on("rpc.interaction.started",n=>this.emit("rpc.interaction.started",n)),this.rpcManager.on("rpc.interaction.completed",n=>this.emit("rpc.interaction.completed",n)),this.rpcManager.on("rpc.interaction.timeout",n=>this.emit("rpc.interaction.timeout",n)),this.rpcManager.on("rpc.interaction.dismissed",n=>this.emit("rpc.interaction.dismissed",n))}initializeClient(){this.room=new te.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(te.RoomEvent.Connected,()=>{var n,r;this.connectionState=te.ConnectionState.Connected,this.emit("connection.connected"),this.rpcManager.setRoom(this.room),(r=(n=this.currentSession)==null?void 0:n.activeModalities)!=null&&r.includes("voice")&&setTimeout(async()=>{var s;try{(s=this.room)!=null&&s.localParticipant&&(this.room.localParticipant.isMicrophoneEnabled?this.emit("track.unmuted",{source:"microphone",enabled:!0}):(await this.room.localParticipant.setMicrophoneEnabled(!0),this.emit("track.unmuted",{source:"microphone",enabled:!0})))}catch(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(te.RoomEvent.Disconnected,n=>{this.connectionState=te.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(te.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===te.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(te.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(te.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}))}setupTextStreamHandlers(){if(this.room){try{this.room.registerTextStreamHandler("lk.chat",async(n,r)=>{try{const s=await n.readAll(),o={id:`msg_${Date.now()}_${r.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:r.identity||"user",name:r.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",o)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(n){console.warn("VoxketClient: lk.chat handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("lk.transcription",async(n,r)=>{var s,o;try{const i=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let a="";const c=((s=this.currentAgentInfo)==null?void 0:s.name)||r.identity||"AI Assistant",l={id:i,content:"",timestamp:new Date,sender:{id:r.identity||"agent",name:c,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",l);for await(const p of n){a+=p;const g=this.convertMarkdownToText(a),y={...l,content:g,metadata:{...l.metadata,streaming:!0}};this.emit("chat.message.updated",y)}const u=this.convertMarkdownToText(a),h={...l,content:u,metadata:{...l.metadata,streaming:!1}};this.emit("chat.message.updated",h)}catch(i){console.error("VoxketClient: Failed to process lk.transcription message:",i);try{const a=await n.readAll(),c=((o=this.currentAgentInfo)==null?void 0:o.name)||r.identity||"AI Assistant",l={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:a,timestamp:new Date,sender:{id:r.identity||"agent",name:c,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",l)}catch(a){console.error("VoxketClient: Fallback failed for lk.transcription:",a)}}})}catch(n){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("suggested_response",async n=>{const r=await n.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(o){console.warn("VoxketClient: Failed to parse suggested_response:",o,r)}this.emit("suggested.response",s)})}catch(n){console.warn("VoxketClient: suggested_response handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("agent_state_changed",async(n,r)=>{const s=await n.readAll();let o={};try{o=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(i){console.warn("VoxketClient: Failed to parse agent_state_changed:",i,s)}o.new_state==="speaking"?this.emit("agent.speaking",o):o.new_state==="thinking"&&this.emit("agent.thinking",o)})}catch(n){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("images",async(n,r)=>{try{const s=await n.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(n){console.warn("VoxketClient: images handler already registered, skipping:",n)}try{this.room.registerByteStreamHandler("images",async(n,r)=>{var s,o;try{const i=n.info,a={id:`img_${Date.now()}_${r.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${i.name||"Image"}`,sender:{id:r.identity||"agent",name:r.identity||"Agent",type:r.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.mimeType,streamId:i.id,downloading:!0}};this.emit("chat.message.received",a),n.onProgress&&(n.onProgress=p=>{const g={...a,metadata:{...a.metadata,downloadProgress:p||0}};this.emit("chat.message.updated",g)});const c=[];for await(const p of n)c.push(p);const l=new Blob(c,{type:i.mimeType||"application/octet-stream"}),u=URL.createObjectURL(l),h={...a,metadata:{...a.metadata,downloading:!1,downloadProgress:1,downloadUrl:u,blob:l}};this.emit("chat.message.updated",h)}catch(i){console.error("VoxketClient: Error processing image attachment:",i)}})}catch(n){console.warn("VoxketClient: image handler already registered, skipping:",n)}this.textStreamHandlersRegistered=!0}}async fetchConnectionDetails(n,r,s){const o=n||this.config.agentId||"default-agent",i=r||this.config.participantName||"User",a=s||this.config.modalities||["voice"];try{const c={agent_id:o,participant_name:i,participant_metadata:{user_id:""},modality:a[0]},l=await fetch(`${this.config.baseUrl}/api/live/agent/session`,{method:"POST",headers:{accept:"application/json","X-APP-ID":this.config.appId,"X-APP-SECRET":this.config.appSecret,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!l.ok){let p=`HTTP ${l.status}: Failed to fetch connection details`;try{const g=await l.json();g&&(g.error?p=`API Error: ${g.error}`:g.detail?p=`API Error: ${g.detail}`:g.message&&(p=`API Error: ${g.message}`))}catch{try{const y=await l.text();y&&(p=`API Error: ${y}`)}catch{}}throw new Error(p)}const u=await l.json();let h;return u.agent_info&&(h={id:u.agent_info.id||o,name:u.agent_info.name||"AI Assistant",avatar:u.agent_info.avatar,capabilities:u.agent_info.capabilities||["voice_interaction","text_chat"],metadata:u.agent_info.metadata||{}},this.currentAgentInfo=h),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:h}}catch(c){console.error("VoxketClient: fetchConnectionDetails failed:",c);const l=new ge(`Failed to fetch connection details: ${c instanceof Error?c.message:"Unknown error"}`,"CONNECTION_FAILED",c);throw this.emit("connection.error",l),l}}async connect(n,r,s){var o;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,r,s);return await((o=this.room)==null?void 0:o.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new ge(`Failed to connect to Voxket services: ${i instanceof Error?i.message:"Unknown error"}`,"CONNECTION_FAILED",i);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{await((n=this.room)==null?void 0:n.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),this.room=new te.Room,this.setupRoomEventListeners()}catch(r){const s=new ge("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",s),s}}async createSession(n){var r,s;try{const o=await this.connect(n.agentId,n.participantName,n.modalities),i={id:o.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:o.agentInfo||this.currentAgentInfo};if(this.currentSession=i,this.emit("session.created",i),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(a=>setTimeout(a,500)),(s=this.room)!=null&&s.localParticipant?(await this.room.localParticipant.setMicrophoneEnabled(!0,void 0,{preConnectBuffer:!0}),this.emit("track.unmuted",{source:"microphone",enabled:!0})):console.warn("VoxketClient: No local participant found, microphone not enabled")}catch(a){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",a)}return setTimeout(()=>{this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state))},1e3),i}catch(o){throw console.error("VoxketClient: Failed to create session:",o),o instanceof ge?o:o instanceof TypeError&&o.message.includes("fetch")?new ge("Network connection failed","CONNECTION_FAILED",o):o instanceof Error&&o.message.includes("Failed to fetch connection details")?new ge(`API connection failed: ${o.message}`,"CONNECTION_FAILED",o):new ge(`Failed to create session: ${o instanceof Error?o.message:"Unknown error"}`,"SESSION_NOT_FOUND",o)}}async startSession(n,r){const s={agentId:n||this.config.agentId||"default-agent",participantName:(r==null?void 0:r.participantName)||this.config.participantName||"User",modalities:(r==null?void 0:r.modalities)||this.config.modalities||["voice","chat"],metadata:r==null?void 0:r.metadata};return this.createSession(s)}async endSession(){var n,r;if(!this.currentSession)return null;try{const s={sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]};return this.currentSession.endedAt=new Date,this.currentSession.state="disconnected",this.emit("session.ended",this.currentSession,s),await this.disconnect(),s}catch(s){throw new ge("Failed to end session","SESSION_NOT_FOUND",s)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(s=>s.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(s=>s.id===n.id);r!==-1&&(this.chatMessages[r]=n)}clearChatMessages(){this.chatMessages=[],this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),this.emit("chat.history.cleared")}renderUI(n={}){var c,l,u;const r=this.resolveTarget(n.target||"body"),s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&o.target===r||this.removeUI(r);const i=(o==null?void 0:o.root)||w6.createRoot(r),a={agentId:n.agentId||this.config.agentId||"default-agent",participantName:n.participantName||this.config.participantName||"User",baseUrl:this.config.baseUrl,appSecret:this.config.appSecret,appId:this.config.appId,className:n.className,theme:typeof n.theme=="string"?n.theme:void 0,modalities:n.modality||this.config.modalities||["voice"],suportsChatInput:((c=n.modality)==null?void 0:c.includes("chat"))!==!1,suportsVideoInput:((l=n.modality)==null?void 0:l.includes("video"))===!0,suportsScreenShare:((u=n.modality)==null?void 0:u.includes("screen_share"))===!0,autoStart:n.autoStart,displayType:n.displayType||"widget",popupPosition:n.popupPosition||"bottom-right",popupTriggerText:n.popupTriggerText||"Open Chat",width:n.width,height:n.height,onDisplayTypeChange:n.onDisplayTypeChange,prompts:n.prompts,statusMessage:n.statusMessage,welcomeTitle:n.welcomeTitle,welcomeSubTitle:n.welcomeSubTitle,loadingText:n.loadingText,voxketClient:this};i.render(m.createElement(_m,{config:this.config,autoConnect:n.autoStart||!1,children:m.createElement(Fm,a)})),this.renderedComponents.set(s,{root:i,target:r})}removeUI(n){const r=n?this.resolveTarget(n):null;if(r){const s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&(o.root.unmount(),this.renderedComponents.delete(s),r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(a=>{try{a.remove()}catch(c){console.warn("Failed to remove element:",c)}}),r===document.body&&r.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(c=>{if(c.classList.contains("bg-black")&&c.classList.contains("backdrop-blur-sm"))try{c.remove()}catch(l){console.warn("Failed to remove fixed element:",l)}}))}}removeAllUI(){for(const[n,r]of this.renderedComponents)r.root.unmount();this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays()}forceCleanupFullscreenOverlays(){document.body.querySelectorAll(".fixed.inset-0.z-50").forEach(r=>{if(r.classList.contains("bg-black")&&(r.classList.contains("backdrop-blur-sm")||r.classList.contains("bg-opacity-30")))try{r.remove()}catch(s){console.warn("Failed to remove overlay:",s)}})}resolveTarget(n){if(typeof n=="string"){const r=document.querySelector(n);if(!r)throw new Error(`Target element not found: ${n}`);return r}return n}getTargetKey(n){return n.id?n.id:n.className?n.tagName+"_"+n.className.replace(/\s+/g,"_"):n.tagName+"_"+n.outerHTML.length%1e3}async sendMessage(n,r){var s;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new ge("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new ge("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new ge("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},i=await((s=this.room)==null?void 0:s.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new ge("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,r){return this.sendMessage(n,r)}async sendAttachments(n,r){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new ge("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new ge("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new ge("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new ge("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const s=n.filter(o=>o.type.startsWith("image/"));if(s.length===0)throw new ge("Only image files are allowed","INVALID_PARAMETER");s.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=s.map(async(i,a)=>{const l={id:`att_${Date.now()}_${a}`,content:`📎 ${i.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.type,uploading:!0}};this.emit("chat.message.sent",l);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:p=>{const g={...l,metadata:{...l.metadata,uploadProgress:p}};this.emit("chat.message.updated",g)}});try{const p=new FileReader,g=new Promise((v,w)=>{p.onload=()=>{typeof p.result=="string"?v(p.result):w(new Error("Failed to convert to base64"))},p.onerror=w});p.readAsDataURL(i);const f={type:"image",data:await g,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(f),{topic:"images",destinationIdentities:[]})}catch(p){console.warn("VoxketClient: Failed to send image data to agent:",p);try{const g=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(g,{topic:"lk.chat",destinationIdentities:[]})}catch(g){console.warn("VoxketClient: Failed to send image notification to agent:",g)}}const h={...l,metadata:{...l.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",h),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new ge("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new ge("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new ge("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0))}catch(r){throw new ge("Failed to start screen share","PERMISSION_DENIED",r)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1))}catch(r){throw new ge("Failed to stop screen share","PERMISSION_DENIED",r)}}async getAudioInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput")}catch(n){throw new ge("Failed to get audio input devices","DEVICE_ERROR",n)}}async getVideoInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="videoinput")}catch(n){throw new ge("Failed to get video input devices","DEVICE_ERROR",n)}}async setAudioInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new ge("Failed to set audio input device","DEVICE_ERROR",s)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new ge("Failed to set video input device","DEVICE_ERROR",s)}}getLocalParticipant(){var n;return((n=this.room)==null?void 0:n.localParticipant)??null}getRemoteParticipants(){var n;return Array.from(((n=this.room)==null?void 0:n.remoteParticipants.values())??[])}getPublishPermissions(){const n=this.getLocalParticipant();if(!n)return{camera:!1,microphone:!1,screenShare:!1,data:!1};const r=n.permissions;if(!r)return{camera:!0,microphone:!0,screenShare:!0,data:!0};const s=o=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(o));return{camera:s(1),microphone:s(2),screenShare:s(3),data:r.canPublishData??!1}}canPublishSource(n){return this.getPublishPermissions()[n]}getRoom(){return this.room}getConnectionState(){return this.connectionState}get connected(){return this.isConnected&&this.connectionState===te.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.Microphone)return r.track;return null}getCameraTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.Camera)return r.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.ScreenShare)return r.track;return null}get isMicrophoneEnabled(){const n=this.getMicrophoneTrack();return n?!n.isMuted:!1}get isCameraEnabled(){const n=this.getCameraTrack();return n?!n.isMuted:!1}get isScreenShareEnabled(){const n=this.getScreenShareTrack();return n?!n.isMuted:!1}registerPlugin(n){this.pluginManager.register(n)}getPluginManager(){return this.pluginManager}getParticipants(){if(!this.room)return[];const n=[];return this.room.localParticipant&&n.push({id:this.room.localParticipant.identity,name:this.room.localParticipant.name||this.room.localParticipant.identity,isLocal:!0}),this.room.remoteParticipants.forEach(r=>{n.push({id:r.identity,name:r.name||r.identity,isLocal:!1})}),n}getSessionMetrics(){var n,r;return this.currentSession?{sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]}:null}updateConfig(n){this.config={...this.config,...n}}async startRecording(){var n;try{this.emit("recording.started",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new ge("Failed to start recording","RECORDING_ERROR",r)}}async stopRecording(){var n;try{this.emit("recording.stopped",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new ge("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,s="embedded"){return this.rpcManager.registerFrontendRPC(n,r,s)}getCurrentInteraction(){return this.rpcManager.getCurrentInteraction()}dismissCurrentInteraction(){this.rpcManager.dismissCurrentInteraction()}getRegisteredRpcMethods(){return this.rpcManager.getRegisteredMethods()}unregisterRpcMethod(n){this.rpcManager.unregisterMethod(n)}registerEventListener(n,r){return this.on(n,r)}registerEventEmitter(n,r){if(!this.room)throw new Error("Room not available");try{this.room.registerTextStreamHandler(n,async s=>{try{const o=await s.readAll();r(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}catch(s){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,s)}}convertMarkdownToText(n){if(!n)return"";let r=n;return r=r.replace(/\*\*(.*?)\*\*/g,"$1"),r=r.replace(/__(.*?)__/g,"$1"),r=r.replace(/\*(.*?)\*/g,"$1"),r=r.replace(/_(.*?)_/g,"$1"),r=r.replace(/~~(.*?)~~/g,"$1"),r=r.replace(/`([^`]+)`/g,"$1"),r=r.replace(/```[\s\S]*?```/g,""),r=r.replace(/^#{1,6}\s+/gm,""),r=r.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),r.trim()}}const A6=ae.create(r6),P6=ae.create(h6),M6=ae.create(g6),R6=ae.create(x6);function N6({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const s={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},o=_e(r);return d.jsx(ae.button,{onClick:e,className:`fixed ${s[n]} z-50 px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.05},whileTap:{scale:.95},children:t})}function _d({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:s="bottom-right",onExpand:o}){const i=_e(t);if(n==="fullscreen")return d.jsx("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",children:d.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",children:[r&&d.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),r()},className:"absolute top-4 cursor-pointer right-4 z-[100] w-12 h-12 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Exit Fullscreen",type:"button",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),d.jsxs("div",{id:"voice-card",className:`${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[d.jsx("div",{className:i.cardTopGradient}),d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),d.jsx("div",{className:" flex flex-col h-full",children:e}),d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})});if(n==="popup"){const a={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"};return d.jsx("div",{className:"fixed rounded-2xl inset-0 z-50 pointer-events-none",children:d.jsxs("div",{className:`fixed rounded-2xl ${a[s]} pointer-events-auto`,children:[r&&d.jsx("button",{onClick:r,className:"absolute -top-2 -right-2 z-10 w-8 h-8 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 text-sm shadow-lg border border-gray-700",children:"×"}),d.jsxs("div",{id:"voice-card",className:`${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),d.jsx("div",{className:" flex flex-col h-full",children:e}),d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return d.jsxs("div",{id:"voice-card",className:`${i.card}`,children:[o&&d.jsx("button",{onClick:o,className:"absolute top-4 right-4 z-20 w-10 h-10 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Enter Fullscreen",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})}),d.jsx("div",{className:i.cardTopGradient}),d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),e,d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function Fm(e){if(typeof window>"u")return null;console.log("🎯 Widget component rendering with props:",{displayType:e.displayType,popupPosition:e.popupPosition,theme:e.theme});const{agentId:t,participantName:n,baseUrl:r,appSecret:s,appId:o,prompts:i,statusMessage:a,welcomeTitle:c,welcomeSubTitle:l,className:u,width:h,height:p,loadingText:g,suportsChatInput:y=!0,suportsVideoInput:f=!0,suportsScreenShare:v=!0,theme:w="vox",onSessionStart:b,onSessionEnd:S,enableSessionLogging:C=!0,onSessionLogsUpdate:E,onSessionMetricsUpdate:T,modalities:k=["voice"],displayType:P="widget",popupPosition:$="bottom-right",popupTriggerText:x="Open Chat",onPopupToggle:I,voxketClient:_,onDisplayTypeChange:K}=e,[Y,X]=m.useState(()=>_?!!_.getCurrentSession():!1),[G,U]=m.useState(!1),[M,q]=m.useState(t||""),[N,V]=m.useState(n||"User"),[Z,R]=m.useState(()=>_?_.getCurrentSession():null),[B,z]=m.useState(()=>{var ie,Dt,st;if(_){const Ce=_.getCurrentSession();if((ie=Ce==null?void 0:Ce.activeModalities)!=null&&ie.includes("chat"))return"chat";if((Dt=Ce==null?void 0:Ce.activeModalities)!=null&&Dt.includes("voice"))return"voice";if((st=Ce==null?void 0:Ce.activeModalities)!=null&&st.includes("video"))return"video"}return"welcome"}),[H,j]=m.useState(!1);m.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",P)},[P]),m.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:B,sessionStarted:Y,loading:G,currentSession:Z==null?void 0:Z.id,isPopupOpen:H})},[B,Y,G,Z,H]);const F=m.useMemo(()=>{if(_)return console.log("🔄 Using passed VoxketClient to preserve session state"),_;console.log("🆕 Creating new VoxketClient instance");const ie={appId:o,appSecret:s,baseUrl:r,agentId:M,participantName:N||"User",modalities:k};return new Ir(ie)},[_,o,s,r,M,N,k]),W=k,L=m.useMemo(()=>F.getRoom()||new te.Room,[F]),J={suportsChatInput:y,suportsVideoInput:f,suportsScreenShare:v},{sessionMetrics:O,sessionLogs:se,logEvent:le}=Om({room:L,onSessionStart:b,onSessionEnd:S,enableConsoleLogging:C,enableLocalStorage:C,voxketSessionId:Z==null?void 0:Z.id});m.useEffect(()=>{E&&E(se)},[se,E]),m.useEffect(()=>{T&&O&&T(O)},[O,T]),m.useEffect(()=>{const ie=st=>{console.log("🔴 Room disconnected:",st),U(!1),X(!1),R(null),z("welcome")},Dt=st=>{console.log("📹 Media devices error:",st),zr({title:"Allow access to your microphone/camera",description:`${st.name}: ${st.message}`})};return L.on(te.RoomEvent.MediaDevicesError,Dt),L.on(te.RoomEvent.Disconnected,ie),()=>{L.off(te.RoomEvent.Disconnected,ie),L.off(te.RoomEvent.MediaDevicesError,Dt)}},[L]);const De=async()=>{try{console.log("🎤 Starting voice session...",{agentId:M,participantName:N}),console.log("🎤 Pre-start state:",{currentMode:B,sessionStarted:Y,loading:G}),U(!0),X(!0),z("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),le("USER_STARTED_VOICE_SESSION",{agentId:M,participantName:N});const ie=await F.startSession(M,{participantName:N||"User",modalities:["voice",...f?["video"]:[]]});console.log("✅ Voice session started successfully:",ie.id),R(ie),U(!1),b&&b(ie.id)}catch(ie){console.error("❌ Failed to start voice session:",ie),zr({title:"Failed to start voice session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),U(!1),X(!1),z("welcome")}},ut=async()=>{try{U(!0),X(!0),z("chat"),le("USER_STARTED_CHAT_SESSION",{agentId:M,participantName:N});const ie=await F.startSession(M,{participantName:N||"User",modalities:["chat"]});R(ie),U(!1),b&&b(ie.id)}catch(ie){console.error("Failed to start chat session:",ie),zr({title:"Failed to start chat session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),U(!1),X(!1),z("welcome")}},Gt=async()=>{try{console.log("📺 Starting video session...",{agentId:M,participantName:N}),console.log("📺 Pre-start state:",{currentMode:B,sessionStarted:Y,loading:G}),U(!0),X(!0),z("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),le("USER_STARTED_VIDEO_SESSION",{agentId:M,participantName:N});const ie=await F.startSession(M,{participantName:N||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",ie.id),R(ie),U(!1),b&&b(ie.id)}catch(ie){console.error("❌ Failed to start video session:",ie),zr({title:"Failed to start video session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),U(!1),X(!1),z("welcome")}},qt=()=>{z("welcome"),K&&K(e.displayType||"widget"),Z&&Y&&(X(!1),R(null),F.disconnect()),P==="popup"&&!H&&j(!0)},ft=()=>{const ie=!H;j(ie),I&&I(ie),!ie&&!(Z&&Y)&&(z("welcome"),X(!1),R(null))},rp=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},sp=()=>{e.onDisplayTypeChange&&e.onDisplayTypeChange("fullscreen")};m.useEffect(()=>{var ie,Dt,st;if(_&&F){console.log("🔄 Syncing widget state with existing client session state");const Ce=F.getCurrentSession(),op=F.connected;console.log("🔍 Existing session state:",{hasSession:!!Ce,sessionId:Ce==null?void 0:Ce.id,isConnected:op,activeModalities:Ce==null?void 0:Ce.activeModalities}),Ce&&(console.log("✅ Restoring session state from existing client"),R(Ce),X(!0),U(!1),(ie=Ce.activeModalities)!=null&&ie.includes("chat")?z("chat"):(Dt=Ce.activeModalities)!=null&&Dt.includes("voice")?z("voice"):(st=Ce.activeModalities)!=null&&st.includes("video")&&z("video"))}},[_,F]),m.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),_?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),F.disconnect())},[F,_]);let ro="w-96",so="h-[25rem]",oo={};if(h&&(h.startsWith("w-")?ro=h:(oo.width=h,ro="")),p&&(p.startsWith("h-")?so=p:(oo.height=p,so="")),P==="popup"&&!H)return console.log("🟡 Showing popup trigger button"),d.jsx(N6,{onClick:ft,text:x,position:$,theme:w});console.log("🟢 Rendering widget content, displayType:",P,"isPopupOpen:",H,"currentMode:",B,"sessionStarted:",Y,"loading:",G);let io=`voxket-widget-root theme-${w}`,Or={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};P==="widget"?(io+=` flex items-center justify-center min-h-fit ${ro} ${so} ${u}`,Or={...Or,...oo}):(io=`${u||""}`,Or={});const ec=d.jsx(d.Fragment,{children:d.jsxs(Nn,{mode:"wait",children:[B==="welcome"&&!G&&d.jsx(R6,{agentId:M,participantName:N||"",onAgentIdChange:q,onParticipantNameChange:V,onStartCall:De,onStartChat:ut,onStartVideo:Gt,disabled:Y||G,prompts:i,statusMessage:a,title:c,subTitle:l,theme:w,modalities:W,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),B==="voice"&&d.jsxs(Me.RoomContext.Provider,{value:L,children:[d.jsx(Me.RoomAudioRenderer,{}),d.jsx(Me.StartAudio,{label:"Start Audio"}),d.jsx(A6,{loadingText:g,participantName:N||"User",capabilities:J,sessionStarted:Y,disabled:!Y,theme:w,client:F,displayType:P,onBack:P==="popup"?ft:qt,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),B==="chat"&&d.jsx(P6,{client:F,theme:w,displayType:P,onBack:P==="popup"?ft:qt,onEndChat:qt,disabled:!Y,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),B==="video"&&d.jsxs(Me.RoomContext.Provider,{value:L,children:[d.jsx(Me.RoomAudioRenderer,{}),d.jsx(Me.StartAudio,{label:"Start Audio"}),d.jsx(M6,{client:F,theme:w,displayType:P,onBack:P==="popup"?ft:qt,onEndCall:qt,disabled:!Y,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return P==="fullscreen"||P==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",P),d.jsx(_d,{theme:w,displayType:P,popupPosition:$,onClose:P==="fullscreen"?rp:ft,children:ec})):(console.log("📦 Rendering widget mode"),d.jsx("div",{className:io,style:Or,children:d.jsx(_d,{theme:w,displayType:P,popupPosition:$,onExpand:sp,children:ec})}))}class Bm extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("VoxketWidget Error:",t,n)}render(){if(this.state.hasError){if(this.props.fallback){const t=this.props.fallback;return m.createElement(t,{error:this.state.error})}return m.createElement("div",{style:{padding:"20px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"}},"VoxketWidget encountered an error. Please check the console for details.")}return this.props.children}}function j6({logs:e,onClear:t,onExport:n}){const[r,s]=A.useState(!1),[o,i]=A.useState(""),a=e.filter(c=>!o||c.event.toLowerCase().includes(o.toLowerCase()));return r?d.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:d.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:c=>i(c.target.value),className:"px-3 py-1 border rounded text-sm"}),d.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),d.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),d.jsx("button",{onClick:()=>s(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),d.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?d.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):d.jsx("div",{className:"space-y-2",children:a.map((c,l)=>d.jsxs("div",{className:"border rounded p-3 text-sm",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"font-semibold text-blue-600",children:c.event}),d.jsx("span",{className:"text-gray-500 text-xs",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.sessionId&&d.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",c.sessionId]}),c.data&&d.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:d.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(c.data,null,2)})})]},l))})})]})}):d.jsxs("button",{onClick:()=>s(!0),className:"fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-blue-700 transition-colors text-sm z-50",children:["Session Logs (",e.length,")"]})}function V6({metrics:e}){return e?d.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[d.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Session ID:"}),d.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Start Time:"}),d.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Messages:"}),d.jsx("div",{children:e.totalMessages})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Participants:"}),d.jsx("div",{children:e.participantCount})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),d.jsx("div",{children:e.connectionIssues})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Duration:"}),d.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function hn(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:s}=Et(),o=A.useCallback(async(a,c)=>await r(a,c),[r]),i=A.useCallback(async()=>await s(),[s]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:o,stop:i}}function Hm(){const{sessionMetrics:e,currentSession:t}=Et();return{metrics:e,sessionId:t==null?void 0:t.id,duration:e==null?void 0:e.duration,participantCount:e==null?void 0:e.participantCount,messageCount:e==null?void 0:e.messageCount,audioQuality:e==null?void 0:e.audioQuality,networkStats:e==null?void 0:e.networkStats}}function zm(){const{setMicrophoneEnabled:e,client:t}=Et(),[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useCallback(async()=>{if(!s){o(!0);try{const l=!n;await e(l),r(l)}catch(l){console.error("Failed to toggle microphone:",l)}finally{o(!1)}}},[n,s,e]),a=A.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(!0),r(!0)}catch(l){console.error("Failed to enable microphone:",l)}finally{o(!1)}}},[n,s,e]),c=A.useCallback(async()=>{if(!(!n||s)){o(!0);try{await e(!1),r(!1)}catch(l){console.error("Failed to disable microphone:",l)}finally{o(!1)}}},[n,s,e]);return{isEnabled:n,isLoading:s,toggle:i,enable:a,disable:c}}function Um(){const{setCameraEnabled:e}=Et(),[t,n]=A.useState(!1),[r,s]=A.useState(!1),o=A.useCallback(async()=>{if(!r){s(!0);try{const c=!t;await e(c),n(c)}catch(c){console.error("Failed to toggle camera:",c)}finally{s(!1)}}},[t,r,e]),i=A.useCallback(async()=>{if(!(t||r)){s(!0);try{await e(!0),n(!0)}catch(c){console.error("Failed to enable camera:",c)}finally{s(!1)}}},[t,r,e]),a=A.useCallback(async()=>{if(!(!t||r)){s(!0);try{await e(!1),n(!1)}catch(c){console.error("Failed to disable camera:",c)}finally{s(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:o,enable:i,disable:a}}function Wm(){const{startScreenShare:e,stopScreenShare:t}=Et(),[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(),r(!0)}catch(l){console.error("Failed to start screen share:",l)}finally{o(!1)}}},[n,s,e]),a=A.useCallback(async()=>{if(!(!n||s)){o(!0);try{await t(),r(!1)}catch(l){console.error("Failed to stop screen share:",l)}finally{o(!1)}}},[n,s,t]),c=A.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:s,start:i,stop:a,toggle:c}}function I6(){const{client:e}=Et(),[t,n]=A.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=A.useMemo(()=>t.tracks.find(f=>f.isLocal),[t.tracks]),s=A.useMemo(()=>t.tracks.filter(f=>!f.isLocal),[t.tracks]),o=A.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(f){throw console.error("Failed to toggle camera:",f),f}},[e,r]),i=A.useCallback(async()=>{try{t.tracks.find(v=>v.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(f){throw console.error("Failed to toggle screen share:",f),f}},[e,t.tracks]),a=A.useCallback(f=>{n(v=>({...v,layout:f}))},[]),c=A.useCallback(f=>{n(v=>({...v,pinnedTrack:f}))},[]),l=A.useCallback(()=>{n(f=>({...f,pinnedTrack:void 0}))},[]),u=A.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(f=>({...f,isRecording:!0}))}catch(f){throw console.error("Failed to start recording:",f),f}},[e]),h=A.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(f=>({...f,isRecording:!1}))}catch(f){throw console.error("Failed to stop recording:",f),f}},[e]),p=A.useCallback(f=>t.tracks.find(v=>v.id===f),[t.tracks]),g=A.useCallback(f=>t.tracks.filter(v=>v.participantId===f),[t.tracks]),y=A.useCallback(f=>f.isEnabled&&t.tracks.includes(f),[t.tracks]);return A.useEffect(()=>{if(!e)return;const f=b=>{n(S=>({...S,tracks:[...S.tracks.filter(C=>C.id!==b.id),b]}))},v=b=>{n(S=>{var C;return{...S,tracks:S.tracks.filter(E=>E.id!==b),pinnedTrack:((C=S.pinnedTrack)==null?void 0:C.id)===b?void 0:S.pinnedTrack}})},w=b=>{n(S=>({...S,tracks:S.tracks.map(C=>C.id===b.id?b:C)}))};return e.on("videoTrackAdded",f),e.on("videoTrackRemoved",v),e.on("videoTrackUpdated",w),()=>{e.off("videoTrackAdded",f),e.off("videoTrackRemoved",v),e.off("videoTrackUpdated",w)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:s,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:i,setLayout:a,pinTrack:c,unpinTrack:l,startRecording:u,stopRecording:h,getTrackById:p,getTracksByParticipant:g,isTrackActive:y}}function no(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=Et(),[r,s]=A.useState(!1),o=A.useCallback(async l=>{if(!(!l.trim()||r||!n)){s(!0);try{await t(l.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{s(!1)}}},[t,r,n]),{userMessages:i,agentMessages:a,allMessages:c}=A.useMemo(()=>{const l=e.filter(h=>h.sender.type==="participant"),u=e.filter(h=>h.sender.type==="agent");return{userMessages:l,agentMessages:u,allMessages:e}},[e]);return{messages:c,userMessages:i,agentMessages:a,messageCount:c.length,isSending:r,canSend:!!n&&!r,send:o}}function D6(){const{send:e,isSending:t,canSend:n}=no(),[r,s]=A.useState(""),o=A.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),s("")}catch(a){throw a}},[r,e,n]),i=A.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:r,setValue:s,send:o,handleKeyPress:i,isSending:t,canSend:n&&r.trim().length>0}}function qa(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:s}=Et(),o=A.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),i=A.useCallback(async()=>{if(e)try{await s()}catch(a){throw console.error("Failed to disconnect:",a),a}},[s,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:o,disconnect:i}}function Zm(){const{participants:e}=Et();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Km=A.createContext({}),Dr=()=>A.useContext(Km);function Ym({children:e,...t}){return d.jsx(Km.Provider,{value:t,children:e})}function hs({name:e,children:t,fallback:n,className:r}){return d.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function Gm(e,t={}){return Object.assign(e,t)}function qm({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:s,className:o=""}){const i=hn(),a=zm(),c=Um(),l=Wm(),u=Dr(),h=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,i.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!i.isActive&&!r?d.jsx("div",{className:h,children:d.jsx("div",{className:"voxket-controls-inactive",children:d.jsx("p",{children:"Controls available during active session"})})}):d.jsxs("div",{className:h,children:[r&&d.jsx("div",{className:"voxket-session-actions",children:i.isActive?d.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):d.jsx(O6,{})}),i.isActive&&d.jsxs("div",{className:"voxket-media-controls",children:[e&&d.jsxs("button",{onClick:a.toggle,disabled:a.isLoading,className:`voxket-button voxket-button--media ${a.isEnabled?"voxket-button--active":""}`,title:a.isEnabled?"Mute microphone":"Unmute microphone",children:[d.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&d.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isEnabled?"voxket-button--active":""}`,title:c.isEnabled?"Stop camera":"Start camera",children:[d.jsx("span",{className:"voxket-icon",children:"📹"}),c.isLoading?"Loading...":c.isEnabled?"Stop Video":"Start Video"]}),n&&d.jsxs("button",{onClick:l.toggle,disabled:l.isLoading,className:`voxket-button voxket-button--media ${l.isSharing?"voxket-button--active":""}`,title:l.isSharing?"Stop screen share":"Start screen share",children:[d.jsx("span",{className:"voxket-icon",children:"🖥️"}),l.isLoading?"Loading...":l.isSharing?"Stop Share":"Share Screen"]})]}),s&&d.jsx("div",{className:"voxket-custom-controls",children:s})]})}function O6(){hn();const[e,t]=A.useState(!1),n=async()=>{t(!0);try{console.log("Start session - agentId needed")}catch(r){console.error("Failed to start session:",r)}finally{t(!1)}};return d.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Xa({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const s=hn(),o=qa(),i=Dr(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,r].filter(Boolean).join(" ");return d.jsxs("div",{className:a,children:[e&&d.jsxs("div",{className:"voxket-connection-status",children:[d.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),d.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&s.session&&d.jsxs("div",{className:"voxket-session-info",children:[d.jsxs("div",{className:"voxket-session-id",children:["Session: ",s.session.id.slice(-8)]}),d.jsxs("div",{className:"voxket-session-state",children:["State: ",s.state]})]}),n&&s.session&&d.jsxs("div",{className:"voxket-agent-info",children:[d.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",s.session.agentId]}),d.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",s.session.activeModalities.join(", ")]})]}),o.error&&d.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function Ja({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const s=hn(),o=no(),i=Dr(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,r].filter(Boolean).join(" ");return s.isActive?d.jsx("div",{className:a,children:n||d.jsxs(d.Fragment,{children:[e&&d.jsxs("div",{className:"voxket-chat-container",children:[d.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(c=>d.jsxs("div",{className:`voxket-message voxket-message--${c.sender.type}`,children:[d.jsxs("div",{className:"voxket-message-header",children:[d.jsx("span",{className:"voxket-message-sender",children:c.sender.name}),d.jsx("span",{className:"voxket-message-time",children:c.timestamp.toLocaleTimeString()})]}),d.jsx("div",{className:"voxket-message-content",children:c.content})]},c.id)),o.messages.length===0&&d.jsx("div",{className:"voxket-empty-messages",children:d.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),d.jsx($6,{})]}),t&&d.jsx("div",{className:"voxket-transcriptions",children:d.jsx("div",{className:"voxket-transcription-placeholder",children:d.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):d.jsx("div",{className:a,children:d.jsx("div",{className:"voxket-inactive-state",children:d.jsxs("div",{className:"voxket-inactive-message",children:[d.jsx("h3",{children:"Start a conversation"}),d.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function $6(){const e=no(),[t,n]=A.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},s=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())};return d.jsxs("div",{className:"voxket-chat-input",children:[d.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:s,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),d.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function Qa({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:s=""}){const o=hn(),i=Hm(),a=Zm(),c=Dr(),l=["voxket-session-footer",`voxket-session-footer--${c.variant||"default"}`,`voxket-session-footer--${c.size||"md"}`,s].filter(Boolean).join(" ");return o.isActive?d.jsx("div",{className:l,children:r||d.jsxs(d.Fragment,{children:[n&&d.jsxs("div",{className:"voxket-session-status",children:[d.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),d.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&d.jsxs("div",{className:"voxket-session-metrics",children:[d.jsxs("div",{className:"voxket-metric",children:[d.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),d.jsx("span",{className:"voxket-metric-value",children:L6(i.duration||0)})]}),d.jsxs("div",{className:"voxket-metric",children:[d.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),d.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&d.jsxs("div",{className:"voxket-participants-info",children:[d.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&d.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>d.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):d.jsx("div",{className:l,children:d.jsx("div",{className:"voxket-footer-inactive",children:d.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function L6(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60);return r>0?`${r}:${(n%60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`:`${n}:${(t%60).toString().padStart(2,"0")}`}function _6({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:s,variant:o="default",size:i="md",theme:a,className:c="",children:l}){var g;const u=hn(),h=qa();A.useEffect(()=>{n&&e&&h.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,h.isConnected,u.isActive]),A.useEffect(()=>{var y;(y=u.session)!=null&&y.id&&r&&r(u.session.id)},[(g=u.session)==null?void 0:g.id,r]),A.useEffect(()=>()=>{u.isActive&&s&&u.stop().then(s).catch(console.error)},[]);const p=["voxket-session",`voxket-session--${o}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",c].filter(Boolean).join(" ");return d.jsx(Ym,{variant:o,size:i,theme:a,className:c,children:d.jsx("div",{className:p,children:l||d.jsxs(d.Fragment,{children:[d.jsx(hs,{name:"header",fallback:d.jsx(Xa,{})}),d.jsx(hs,{name:"content",fallback:d.jsx(Ja,{})}),d.jsx(hs,{name:"footer",fallback:d.jsx(Qa,{})})]})})})}const Xm=Gm(_6,{Header:Xa,Content:Ja,Footer:Qa,Controls:qm}),an={name:"default",colors:{primary:"#3B82F6",secondary:"#6B7280",accent:"#8B5CF6",background:"#FFFFFF",surface:"#F9FAFB",text:{primary:"#111827",secondary:"#6B7280",muted:"#9CA3AF",inverse:"#FFFFFF"},status:{success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6"},border:"#E5E7EB",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},typography:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},borderRadius:{none:"0",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"}},Li={...an,name:"dark",colors:{primary:"#60A5FA",secondary:"#9CA3AF",accent:"#A78BFA",background:"#111827",surface:"#1F2937",text:{primary:"#F9FAFB",secondary:"#D1D5DB",muted:"#9CA3AF",inverse:"#111827"},status:{success:"#34D399",warning:"#FBBF24",error:"#F87171",info:"#60A5FA"},border:"#374151",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.3)"}},_i={...an,name:"enterprise",colors:{primary:"#1E40AF",secondary:"#64748B",accent:"#7C3AED",background:"#FFFFFF",surface:"#F8FAFC",text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8",inverse:"#FFFFFF"},status:{success:"#059669",warning:"#D97706",error:"#DC2626",info:"#1E40AF"},border:"#CBD5E1",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.375rem",full:"9999px"}},Jm=A.createContext(null),Qm=()=>{const e=A.useContext(Jm);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function F6({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:s=""}){const[o,i]=A.useState(()=>{const p={default:an,dark:Li,enterprise:_i,...t};return typeof e=="string"?p[e]||an:e}),[a,c]=A.useState(()=>({default:an,dark:Li,enterprise:_i,...t})),l=p=>{if(typeof p=="string"){const g=a[p];g&&i(g)}else i(p)},u=p=>{c(g=>({...g,[p.name]:p}))};A.useEffect(()=>{if(r&&typeof document<"u"){const p=document.documentElement;Object.entries(ep(o)).forEach(([g,y])=>{p.style.setProperty(`--voxket-${g}`,y)})}},[o,r]);const h={theme:o,setTheme:l,themes:a,registerTheme:u};return d.jsx(Jm.Provider,{value:h,children:d.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${s}`,children:n})})}function ep(e){const t={},n=(r,s="")=>{for(const[o,i]of Object.entries(r)){const a=s?`${s}-${o}`:o;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function B6(e=an,t){return{...e,...t,colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography},spacing:{...e.spacing,...t.spacing},borderRadius:{...e.borderRadius,...t.borderRadius},shadows:{...e.shadows,...t.shadows}}}function H6(e){var n;const{theme:t}=Qm();return((n=t.components)==null?void 0:n[e])||{}}const z6=Ga("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&U6(e),t.enableVoiceActivation&&W6(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&Z6(e,t)}});function U6(e,t){e.on("participant.speaking.started",n=>{console.log("Transcription: Started for",n.name)}),e.on("participant.speaking.stopped",n=>{console.log("Transcription: Stopped for",n.name)})}function W6(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function Z6(e,t){console.log("Playing audio response:",t.content)}const K6=Ga("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&Y6(),t.enableFileUpload&&G6(e),t.enableCustomComponents&&q6(),console.log("Chat modality activated",t)},onDeactivate:async e=>{console.log("Chat modality deactivated")},onMessage:async(e,t)=>{const n=e.config;t.type==="ui_component"?X6(e,t):t.type==="text"&&n.enableRichText&&J6(e,t)}});function Y6(e){console.log("Rich text support enabled")}function G6(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function q6(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",Q6),t.set("form",eE),t.set("card",tE),t.set("chart",nE)}function X6(e,t){const{componentType:n,props:r}=t.metadata;console.log("Rendering custom component:",n,r),e.emit("chat.component.render",{type:n,props:r,timestamp:new Date})}function J6(e,t){console.log("Processing rich text message:",t.content)}function Q6(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function eE(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function tE(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function nE(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function ms({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:s=!0,isPinned:o=!1,className:i="",onClick:a,onPin:c,onUnpin:l}){const u=A.useRef(null),[h,p]=A.useState(!1);A.useEffect(()=>{if(!u.current||!e.isEnabled)return;const v=u.current;return v.srcObject=null,()=>{v.srcObject&&(v.srcObject=null)}},[e]);const g=()=>{a==null||a(e)},y=v=>{v.stopPropagation(),o?l==null||l(e):c==null||c(e)},f=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",h?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return d.jsxs("div",{className:f,onClick:g,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[d.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&d.jsxs("div",{className:"voxket-video-placeholder",children:[d.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),d.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),d.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&d.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),s&&!e.isEnabled&&d.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(h||o)&&d.jsxs("div",{className:"voxket-video-controls",children:[d.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:y,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&d.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&d.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&d.jsx("div",{className:"voxket-video-loading",children:d.jsx("div",{className:"voxket-spinner"})})]})}function rE({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:s,maxVisibleTracks:o=9,showPagination:i=!0}){const[a,c]=A.useState(0),[l,u]=A.useState(null),h=A.useMemo(()=>{let b=[...e];t.type==="speaker"&&l&&(b=[l,...e.filter(E=>E.id!==l.id)]);const S=a*o,C=S+o;return b.slice(S,C)},[e,t,l,a,o]),p=Math.ceil(e.length/o),g=A.useMemo(()=>{const b=h.length;switch(t.type){case"grid":const S=Math.ceil(Math.sqrt(b)),C=Math.ceil(b/S);return{display:"grid",gridTemplateColumns:`repeat(${S}, 1fr)`,gridTemplateRows:`repeat(${C}, 1fr)`,gap:"8px"};case"speaker":return{display:"flex",flexDirection:"column",gap:"8px"};case"sidebar":return{display:"flex",gap:"8px"};case"gallery":return{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center"};default:return{}}},[t.type,h.length]),y=b=>{u(b)},f=()=>{u(null)},v=b=>{r==null||r({...t,type:b})},w=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${h.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?d.jsx("div",{className:"voxket-video-grid-empty",children:d.jsxs("div",{className:"voxket-video-grid-empty-content",children:[d.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),d.jsx("p",{children:"No video tracks available"})]})}):d.jsxs("div",{className:w,children:[d.jsxs("div",{className:"voxket-video-grid-controls",children:[d.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(b=>d.jsx("button",{className:`voxket-layout-btn ${t.type===b?"voxket-layout-btn--active":""}`,onClick:()=>v(b),title:`Switch to ${b} layout`,children:sE(b)},b))}),d.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),d.jsx("div",{className:"voxket-video-grid-content",style:g,children:t.type==="speaker"&&l?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"voxket-video-speaker-main",children:d.jsx(ms,{track:l,participantName:`Participant ${l.participantId}`,isPinned:!0,onClick:s,onUnpin:f})}),d.jsx("div",{className:"voxket-video-speaker-sidebar",children:h.filter(b=>b.id!==l.id).map(b=>d.jsx(ms,{track:b,participantName:`Participant ${b.participantId}`,showControls:!1,onClick:s,onPin:y},b.id))})]}):h.map(b=>d.jsx(ms,{track:b,participantName:`Participant ${b.participantId}`,isPinned:(l==null?void 0:l.id)===b.id,onClick:s,onPin:y,onUnpin:f},b.id))}),i&&p>1&&d.jsxs("div",{className:"voxket-video-pagination",children:[d.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.max(0,a-1)),disabled:a===0,children:"←"}),d.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",p]}),d.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.min(p-1,a+1)),disabled:a===p-1,children:"→"})]})]})}function sE(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function oE({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:s=!0,showCameraControls:o=!0,showScreenShareControls:i=!0,className:a=""}){const c=["voxket-video-controls",a].filter(Boolean).join(" "),l=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return d.jsxs("div",{className:c,children:[o&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),d.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isEnabled?"voxket-control-btn--active":""}`,onClick:t,title:e!=null&&e.isEnabled?"Turn off camera":"Turn on camera",children:[d.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),d.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&d.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),d.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isScreenShare?"voxket-control-btn--active":""}`,onClick:n,title:e!=null&&e.isScreenShare?"Stop screen sharing":"Start screen sharing",children:[d.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),d.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),s&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),d.jsx("div",{className:"voxket-layout-buttons",children:[{type:"grid",icon:"⊞",label:"Grid"},{type:"speaker",icon:"🎤",label:"Speaker"},{type:"sidebar",icon:"⫸",label:"Sidebar"},{type:"gallery",icon:"⊡",label:"Gallery"}].map(({type:u,icon:h,label:p})=>d.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>l(u),title:`Switch to ${p} layout`,children:[d.jsx("span",{className:"voxket-control-icon",children:h}),d.jsx("span",{className:"voxket-control-label",children:p})]},u))})]}),d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),d.jsxs("div",{className:"voxket-video-settings",children:[d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Quality"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"high",children:"High (720p)"}),d.jsx("option",{value:"medium",children:"Medium (480p)"}),d.jsx("option",{value:"low",children:"Low (240p)"})]})]}),d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"30",children:"30 fps"}),d.jsx("option",{value:"15",children:"15 fps"}),d.jsx("option",{value:"10",children:"10 fps"})]})]}),d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"unlimited",children:"Unlimited"}),d.jsx("option",{value:"1000",children:"1 Mbps"}),d.jsx("option",{value:"500",children:"500 Kbps"}),d.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),d.jsxs("div",{className:"voxket-video-stats",children:[d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),d.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Source:"}),d.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Status:"}),d.jsx("span",{className:`voxket-stat-value ${e!=null&&e.isEnabled?"voxket-stat-value--active":"voxket-stat-value--inactive"}`,children:e!=null&&e.isEnabled?"Active":"Inactive"})]})]})]})]})}const tp=({handler:e,loadData:t,data:n,client:r,addLocalMessage:s})=>{const[o,i]=m.useState(null),[a,c]=m.useState(!0),[l,u]=m.useState(!1),[h]=m.useState(Date.now());m.useEffect(()=>{(async()=>{try{if(c(!0),console.log("📋 AssignmentView: Loading assignment data..."),console.log("📋 AssignmentView: Received data from RPC:",n),n&&typeof n=="object"){const v={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(v),console.log("📋 AssignmentView: Assignment loaded from RPC data:",v)}}catch(v){console.error("📋 AssignmentView: Error loading assignment:",v),i({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{c(!1)}})()},[n,t]);const p=({message:f,assignment:v})=>{const w=f.toLowerCase().includes("declined"),b=w?"bg-red-50 border-red-200":"bg-green-50 border-green-200",S=w?"text-red-700":"text-green-700",C=w?"❌":"🎉";return d.jsxs("div",{className:`max-w-sm mx-auto ${b} border rounded-lg shadow p-3 flex flex-col items-center`,children:[d.jsx("div",{className:"text-2xl mb-2",children:C}),d.jsx("div",{className:`${S} font-semibold text-sm mb-1`,children:f}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:v.title}),d.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},g=async()=>{if(!(!o||!e)){u(!0);try{const f={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",f),e.didSuccess(f,d.jsx(p,{message:"Assignment accepted!",assignment:o}))}catch(f){console.error("📋 AssignmentView: Error accepting assignment:",f),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},y=async()=>{if(!(!o||!e)){u(!0);try{const f={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",f),e.didSuccess(f,d.jsx(p,{message:"Assignment declined",assignment:o}))}catch(f){console.error("📋 AssignmentView: Error declining assignment:",f),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?d.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),d.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?d.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[d.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),d.jsxs("div",{className:"p-3",children:[d.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:d.jsx("p",{className:"text-xs text-gray-700 leading-snug",children:o.description})}),d.jsx("div",{className:"mb-3",children:d.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[d.jsx("span",{className:"text-xs mr-1",children:"📅"}),d.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:g,disabled:l,className:"flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:l?d.jsxs("span",{className:"flex items-center justify-center",children:[d.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),d.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),d.jsx("button",{onClick:y,disabled:l,className:"flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Decline"})]})]})]}):d.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:d.jsxs("div",{className:"text-center py-4",children:[d.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),d.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function iE(){const[e,t]=m.useState(null),[n,r]=m.useState([]);m.useEffect(()=>{const a=new Ir({appId:"your-app-id",appSecret:"your-app-secret",baseUrl:"https://your-voxket-api.com",agentId:"your-agent-id",participantName:"User",modalities:["chat"]});return t(a),a.on("rpc.method.called",c=>{console.log("RPC Method Called:",c)}),a.on("rpc.interaction.completed",c=>{console.log("RPC Interaction Completed:",c)}),()=>{a.disconnect()}},[]);const s=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",tp,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:c,timeout:l})=>{const[u,h]=m.useState(""),p=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],g=f=>{h(f)},y=()=>{const f=p.find(v=>v.id===u);c==null||c.didSuccess({selectedProduct:u,productName:f==null?void 0:f.name,price:f==null?void 0:f.price,timestamp:new Date().toISOString()})};return d.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[d.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),d.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),d.jsx("div",{className:"space-y-3 mb-6",children:p.map(f=>d.jsx("div",{onClick:()=>g(f.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===f.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"font-medium",children:f.name}),d.jsx("p",{className:"text-gray-600 text-sm",children:f.price})]}),d.jsx("div",{className:`w-4 h-4 rounded-full ${u===f.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},f.id))}),d.jsxs("div",{className:"flex justify-end space-x-3",children:[d.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),d.jsx("button",{onClick:y,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),l&&d.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",l," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Product Recommendation RPC registered successfully")}catch(c){console.error("❌ Failed to register product recommendation RPC:",c)}},i=async()=>{if(!e)return;const a=({handler:c})=>{const[l,u]=m.useState(0),[h,p]=m.useState(""),g=()=>{c==null||c.didSuccess({rating:l,comment:h,timestamp:new Date().toISOString()})};return d.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),d.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(y=>d.jsx("button",{onClick:()=>u(y),className:`text-2xl ${y<=l?"text-yellow-400":"text-gray-300"}`,children:"⭐"},y))})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),d.jsx("textarea",{value:h,onChange:y=>p(y.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),d.jsxs("div",{className:"flex justify-end space-x-2",children:[d.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),d.jsx("button",{onClick:g,disabled:l===0,className:"px-3 py-1 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Submit"})]})]})};try{await e.registerFrontendRPC("collect_feedback",a,"embedded");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Feedback RPC registered successfully")}catch(c){console.error("❌ Failed to register feedback RPC:",c)}};return d.jsxs("div",{className:"p-6",children:[d.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),d.jsxs("div",{className:"space-y-4 mb-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),d.jsxs("div",{className:"space-x-2",children:[d.jsx("button",{onClick:s,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),d.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),d.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?d.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>d.jsx("li",{className:"text-gray-700",children:d.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):d.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),d.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),d.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[d.jsxs("li",{children:["Register RPC methods with React components using ",d.jsx("code",{children:"client.registerFrontendRPC()"})]}),d.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),d.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),d.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),d.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),d.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),d.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),d.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
180
+ `,style:{minHeight:"2.5rem",display:i===r?"block":"none"},children:o},i))})}function W8({statusMessage:e,theme:t}){const n=Ie(t);return d.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[d.jsx("div",{className:n.statusIndicator}),d.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const Z8=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:s=['"Book a meeting with the marketing team"',`"What's the status of project Alpha?"`,`"Summarize yesterday's sales report"`,'"Find a good Italian restaurant nearby"','"Remind me to call John tomorrow at 10 AM"'],statusMessage:o="Agent is ready",title:i="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:c="vox",modalities:l=["voice","chat","video"]})=>{const u=Ie(c),f=l.includes("voice"),h=l.includes("chat"),g=l.includes("video"),y=[f,h,g].filter(Boolean).length;return console.log("🎯 Welcome component debug:",{modalities:l,hasVoice:f,hasChat:h,hasVideo:g,totalButtons:y,onStartVideo:!!r}),d.jsxs("div",{inert:e,className:"flex p-8 flex-col items-center h-full justify-center w-full",children:[d.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[d.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[d.jsx("div",{className:u.pulseRings.ring1}),d.jsx("div",{className:u.pulseRings.ring2,style:{animationDelay:"0.5s"}}),d.jsx("div",{className:u.pulseRings.ring3,style:{animationDelay:"1s"}})]}),d.jsx("div",{className:"relative z-10 flex items-center justify-center",children:f&&h&&g?d.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[d.jsx(Ur,{onClick:t,disabled:e,theme:c}),d.jsx(To,{onClick:n,disabled:e,theme:c}),d.jsx(jo,{onClick:r||t,disabled:e,theme:c})]}):y>1?d.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[f&&d.jsx(Ur,{onClick:t,disabled:e,theme:c}),h&&d.jsx(To,{onClick:n,disabled:e,theme:c}),g&&r&&d.jsx(jo,{onClick:r,disabled:e,theme:c})]}):d.jsx("div",{className:"flex items-center justify-center",children:f?d.jsx(Ur,{onClick:t,disabled:e,theme:c}):h?d.jsx(To,{onClick:n,disabled:e,theme:c}):g&&r?d.jsx(jo,{onClick:r,disabled:e,theme:c}):d.jsx(Ur,{onClick:t,disabled:e,theme:c})})})]}),d.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[d.jsx("h3",{className:`text-xl font-semibold mb-2 ${u.text.accent}`,children:i}),d.jsx("p",{className:`text-sm leading-relaxed px-4 ${u.text.secondary}`,children:a}),y>1&&d.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[f&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Kh,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Voice"})]}),h&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Zh,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Chat"})]}),g&&d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Gh,{className:"w-4 h-4"}),d.jsx("span",{className:u.text.muted,children:"Video"})]})]})]}),d.jsx(U8,{prompts:s,theme:c}),d.jsx(W8,{statusMessage:o,theme:c})]})};function Yh({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:s=!0,voxketSessionId:o}={}){const[i,a]=m.useState(null),[c,l]=m.useState([]),[u,f]=m.useState(null),[h,g]=m.useState([]),y=m.useCallback((v,S)=>{const C={timestamp:new Date,event:v,data:S,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(l(E=>[...E,C]),s){const E=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");E.push(C),localStorage.setItem("voxket-session-logs",JSON.stringify(E))}return C},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,r,s]);m.useEffect(()=>{if(!e)return;const v=()=>{const b=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,I=new Date,L={sessionId:b,startTime:I,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(L),y("SESSION_STARTED",{sessionId:b,startTime:I}),n==null||n(b)},S=()=>{if(i){const b=new Date,I=b.getTime()-i.startTime.getTime(),L={...i,endTime:b,duration:I,events:c};y("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(I/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(L),a(null),l([])}},C=b=>{y("CONNECTION_STATE_CHANGED",{state:b}),b===te.ConnectionState.Reconnecting&&i&&(a(I=>I?{...I,connectionIssues:I.connectionIssues+1}:null),y("CONNECTION_ISSUE",{type:"reconnecting"}))},E=b=>{y("TRACK_PUBLISHED",{trackKind:b.kind,trackSource:b.source})},T=b=>{y("TRACK_UNPUBLISHED",{trackKind:b.kind,trackSource:b.source})},k=(b,I)=>{i&&a(L=>L?{...L,totalMessages:L.totalMessages+1}:null),y("DATA_RECEIVED",{participantId:I==null?void 0:I.identity,dataSize:b.length})},j=b=>{y("PARTICIPANT_CONNECTED",{participantId:b.identity,participantName:b.name}),g(I=>[...I,b]),i&&a(I=>I?{...I,participantCount:I.participantCount+1}:null)},$=b=>{y("PARTICIPANT_DISCONNECTED",{participantId:b.identity,participantName:b.name}),g(I=>I.filter(L=>L.identity!==b.identity))};return e.localParticipant&&f(e.localParticipant),e.on(te.RoomEvent.Connected,v),e.on(te.RoomEvent.Disconnected,S),e.on(te.RoomEvent.ConnectionStateChanged,C),e.on(te.RoomEvent.TrackPublished,E),e.on(te.RoomEvent.TrackUnpublished,T),e.on(te.RoomEvent.DataReceived,k),e.on(te.RoomEvent.ParticipantConnected,j),e.on(te.RoomEvent.ParticipantDisconnected,$),()=>{e.off(te.RoomEvent.Connected,v),e.off(te.RoomEvent.Disconnected,S),e.off(te.RoomEvent.ConnectionStateChanged,C),e.off(te.RoomEvent.TrackPublished,E),e.off(te.RoomEvent.TrackUnpublished,T),e.off(te.RoomEvent.DataReceived,k),e.off(te.RoomEvent.ParticipantConnected,j),e.off(te.RoomEvent.ParticipantDisconnected,$)}},[e,i,c,h.length,y,t,n]);const p=m.useCallback(()=>s?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):c,[c,s]),x=m.useCallback(()=>{s&&localStorage.removeItem("voxket-session-logs"),l([])},[s]),w=m.useCallback(()=>{const v=p(),S=JSON.stringify(v,null,2),C="data:application/json;charset=utf-8,"+encodeURIComponent(S),E=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,T=document.createElement("a");T.setAttribute("href",C),T.setAttribute("download",E),T.click()},[p]);return{sessionMetrics:i,sessionLogs:c,logEvent:y,getSessionLogs:p,clearSessionLogs:x,exportSessionLogs:w}}class Ta{constructor(){Te(this,"listeners",{})}on(t,n){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n),()=>this.off(t,n)}once(t,n){const r=(...s)=>{this.off(t,r),n(...s)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);s>-1&&r.splice(s,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const s=[...r];for(const o of s)try{o(...n)}catch(i){console.error(`Error in event listener for ${String(t)}:`,i)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class qh{constructor(t){Te(this,"plugins",new Map);Te(this,"installedPlugins",new Set);Te(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const r=this.plugins.get(t);if(!r)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(r.dependencies)for(const o of r.dependencies)this.installedPlugins.has(o)||await this.install(o);const s={...this.context,config:{...r.config,...n}};r.install&&await r.install(s),this.installedPlugins.add(t),this.setupPluginEvents(r,s)}async uninstall(t){var r;const n=this.plugins.get(t);if(!n)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t)){for(const[s,o]of this.plugins)if(this.installedPlugins.has(s)&&((r=o.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${s}' depends on it`);n.uninstall&&await n.uninstall(this.context),this.installedPlugins.delete(t)}}isInstalled(t){return this.installedPlugins.has(t)}getInstalledPlugins(){return Array.from(this.installedPlugins)}getAvailablePlugins(){return Array.from(this.plugins.keys())}getPluginInfo(t){return this.plugins.get(t)}setupPluginEvents(t,n){t.onSessionStart&&n.on("session.started",r=>{t.onSessionStart(n,r.id)}),t.onSessionEnd&&n.on("session.ended",r=>{t.onSessionEnd(n,r.id)}),t.onAgentResponse&&n.on("agent.response",r=>{t.onAgentResponse(n,r)})}}function K8(e){return e}function ja(e,t,n){return{name:e,version:"1.0.0",description:`${t} modality plugin`,install:async r=>{n.onActivate&&await n.onActivate(r)},uninstall:async r=>{n.onDeactivate&&await n.onDeactivate(r)},onAgentResponse:n.onMessage}}const G8={name:"analytics",version:"1.0.0",description:"Built-in analytics tracking",install:async e=>{console.log("Analytics plugin installed"),e.on("session.started",t=>{console.log("Analytics: Session started",t.id)}),e.on("session.ended",(t,n)=>{console.log("Analytics: Session ended",t.id,n)}),e.on("chat.message.sent",t=>{console.log("Analytics: User message sent",t.content.length)})}},Y8={name:"debug",version:"1.0.0",description:"Debug logging and development tools",install:async e=>{console.log("Debug plugin installed");const t=e.emit;e.emit=(n,...r)=>(console.log(`[Debug] Event: ${String(n)}`,r),t(n,...r))}},q8={name:"metrics",version:"1.0.0",description:"Advanced metrics collection",install:async e=>{console.log("Metrics plugin installed");const t=new Map;e.on("session.started",n=>{t.set(n.id,{startTime:Date.now(),events:[]})}),e.on("agent.response",n=>{console.log("Metrics: Agent response analyzed",{type:n.type,length:n.content.length,timestamp:n.timestamp})})}},Xh=A.createContext(null);function Jh({config:e,children:t,autoConnect:n=!1}){const[r,s]=A.useState(null),[o,i]=A.useState(!1),[a,c]=A.useState(!1),[l,u]=A.useState(null),[f,h]=A.useState(null),[g,y]=A.useState("idle"),[p,x]=A.useState(null),[w,v]=A.useState([]),[S,C]=A.useState([]),[E,T]=A.useState([]);A.useEffect(()=>{const P=new Tr(e);return s(P),k(P),n&&j(P),()=>{P.disconnect().catch(console.error)}},[e,n]);const k=P=>{P.on("connection.connecting",()=>{c(!0),u(null)}),P.on("connection.connected",()=>{i(!0),c(!1),u(null)}),P.on("connection.disconnected",()=>{i(!1),c(!1),h(null),y("idle"),v([]),C([]),T([])}),P.on("connection.error",Y=>{u(Y),c(!1)}),P.on("session.created",Y=>{h(Y),y(Y.state)}),P.on("session.state.changed",Y=>{y(Y),f&&h({...f,state:Y})}),P.on("session.ended",(Y,R)=>{h(null),y("idle"),x(R),v([]),C([]),T([])}),P.on("participant.joined",Y=>{v(R=>[...R,Y])}),P.on("participant.left",Y=>{v(R=>R.filter(V=>V.id!==Y.id))}),P.on("chat.message.received",Y=>{C(R=>[...R,Y])}),P.on("chat.message.sent",Y=>{C(R=>[...R,Y])}),P.on("transcription.received",Y=>{T(R=>[...R,Y])})},j=async P=>{const Y=P||r;if(Y)try{await Y.connect()}catch(R){console.error("Failed to connect:",R)}},z={client:r,isConnected:o,isConnecting:a,connectionError:l,currentSession:f,sessionState:g,sessionMetrics:p,participants:w,chatMessages:S,transcriptions:E,connect:()=>j(),disconnect:async()=>{if(r)try{await r.disconnect()}catch(P){console.error("Failed to disconnect:",P)}},createSession:async(P,Y={})=>{if(!r)throw new Error("Client not initialized");const R={agentId:P,participantName:Y.participantName||"User",metadata:Y.metadata,modalities:Y.modalities||["voice"]};return await r.createSession(R)},endSession:async()=>r?await r.endSession():null,sendChatMessage:async P=>{if(!r)throw new Error("Client not initialized");await r.sendChatMessage(P)},setMicrophoneEnabled:async P=>{if(!r)throw new Error("Client not initialized");await r.setMicrophoneEnabled(P)},setCameraEnabled:async P=>{if(!r)throw new Error("Client not initialized");await r.setCameraEnabled(P)},startScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.startScreenShare()},stopScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.stopScreenShare()}};return d.jsx(Xh.Provider,{value:z,children:t})}function bt(){const e=A.useContext(Xh);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class X8 extends Ta{constructor(n){super();Te(this,"room",null);Te(this,"registeredMethods",new Map);Te(this,"activeInteractions",new Map);Te(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,s="embedded"){if(console.log(`RpcManager: Starting registration for method '${n}'`),!this.room)throw console.error(`RpcManager: Cannot register '${n}' - no room instance`),new Error("Room not initialized. Cannot register RPC method.");if(!this.room.localParticipant)throw console.error(`RpcManager: Cannot register '${n}' - no local participant`),new Error("Local participant not available for RPC registration");console.log(`RpcManager: Room state: ${this.room.state}`),console.log(`RpcManager: Local participant: ${this.room.localParticipant.identity}`),console.log(`RpcManager: Registering frontend RPC method: ${n}`);const o={methodName:n,component:r,presentationMode:s};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async i=>{console.log(`RpcManager: RPC method '${n}' called by ${i.callerIdentity}`),console.log("RpcManager: Payload:",i.payload),this.emit("rpc.method.called",{methodName:n,data:i});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let c=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const l=await this.awaitUserInteraction(n,r,s,a,c);return JSON.stringify(l)}catch(l){throw console.error(`RpcManager: Error in RPC method '${n}':`,l),l}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(i){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,i),i}}async awaitUserInteraction(n,r,s,o,i){return new Promise((a,c)=>{const l=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(h,g)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(l),this.currentInteraction=null;const y={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...g?{successView:g}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:y}),a(y)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(l);const g={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},dismissView:()=>{var g;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(g=this.currentInteraction)==null?void 0:g.methodName),this.clearInteraction(l),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const h={success:!0,data:{dismissed:!0,reason:"User dismissed the interaction"},message:"User interaction dismissed",timestamp:new Date};this.emit("rpc.interaction.dismissed",{methodName:n,response:h}),this.emit("rpc.interaction.completed",{methodName:n,response:h}),setTimeout(()=>{var y;((y=this.currentInteraction)==null?void 0:y.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(h)},didTimeout:h=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(l),this.currentInteraction=null;const g={success:!0,message:`User interaction timed out after ${i} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...h?{timeoutView:h}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:g}),setTimeout(()=>{var y;((y=this.currentInteraction)==null?void 0:y.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(g)}},f=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(l,{resolve:h=>a(JSON.parse(h)),reject:c,timeoutId:f}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:s,timeout:i,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:s}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(g){console.error("RpcManager: Error loading data into component:",g),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const r=this.activeInteractions.get(n);r&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(r.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,r]of this.activeInteractions)clearTimeout(r.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}class ue extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}class Tr extends Ta{constructor(n){super();Te(this,"config");Te(this,"room",null);Te(this,"pluginManager");Te(this,"rpcManager");Te(this,"isConnected",!1);Te(this,"currentSession",null);Te(this,"connectionState",te.ConnectionState.Disconnected);Te(this,"renderedComponents",new Map);Te(this,"textStreamHandlersRegistered",!1);Te(this,"currentAgentInfo",null);Te(this,"chatMessages",[]);this.config=n,this.pluginManager=new qh(this),this.rpcManager=new X8,this.setupEventListeners(),this.initializeClient()}setupEventListeners(){this.on("connection.connected",()=>{var n,r;this.isConnected=!0,(r=(n=this.config).onConnected)==null||r.call(n)}),this.on("connection.disconnected",n=>{var r,s;this.isConnected=!1,(s=(r=this.config).onDisconnected)==null||s.call(r,n)}),this.on("connection.error",n=>{var r,s;(s=(r=this.config).onError)==null||s.call(r,n)}),this.on("chat.message.received",n=>{var r,s;this.addChatMessage(n),(s=(r=this.config).onMessageReceived)==null||s.call(r,n)}),this.on("chat.message.updated",n=>{this.updateChatMessage(n)}),this.on("chat.message.sent",n=>{this.addChatMessage(n)}),this.on("transcription.received",n=>{var r,s;(s=(r=this.config).onTranscriptionReceived)==null||s.call(r,n)}),this.on("session.state.changed",n=>{var r,s;(s=(r=this.config).onSessionStateChanged)==null||s.call(r,n)}),this.on("session.created",n=>{var r,s;(s=(r=this.config).onSessionStart)==null||s.call(r,n.id)}),this.on("session.ended",(n,r)=>{var s,o;(o=(s=this.config).onSessionEnd)==null||o.call(s,r)}),this.on("participant.joined",n=>{var r,s;(s=(r=this.config).onUserJoined)==null||s.call(r,n.id)}),this.on("participant.left",n=>{var r,s;(s=(r=this.config).onUserLeft)==null||s.call(r,n.id)}),this.setupRpcEventForwarding()}setupRpcEventForwarding(){if(!this.rpcManager){console.warn("RpcManager not initialized, skipping event forwarding setup");return}this.rpcManager.on("rpc.method.registered",n=>this.emit("rpc.method.registered",n)),this.rpcManager.on("rpc.method.called",n=>this.emit("rpc.method.called",n)),this.rpcManager.on("rpc.interaction.started",n=>this.emit("rpc.interaction.started",n)),this.rpcManager.on("rpc.interaction.completed",n=>this.emit("rpc.interaction.completed",n)),this.rpcManager.on("rpc.interaction.timeout",n=>this.emit("rpc.interaction.timeout",n)),this.rpcManager.on("rpc.interaction.dismissed",n=>this.emit("rpc.interaction.dismissed",n))}initializeClient(){this.room=new te.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(te.RoomEvent.Connected,()=>{var n,r;this.connectionState=te.ConnectionState.Connected,this.emit("connection.connected"),this.rpcManager.setRoom(this.room),(r=(n=this.currentSession)==null?void 0:n.activeModalities)!=null&&r.includes("voice")&&setTimeout(async()=>{var s;try{(s=this.room)!=null&&s.localParticipant&&(this.room.localParticipant.isMicrophoneEnabled?this.emit("track.unmuted",{source:"microphone",enabled:!0}):(await this.room.localParticipant.setMicrophoneEnabled(!0),this.emit("track.unmuted",{source:"microphone",enabled:!0})))}catch(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(te.RoomEvent.Disconnected,n=>{this.connectionState=te.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(te.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===te.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(te.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(te.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}))}setupTextStreamHandlers(){if(this.room){try{this.room.registerTextStreamHandler("lk.chat",async(n,r)=>{try{const s=await n.readAll(),o={id:`msg_${Date.now()}_${r.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:r.identity||"user",name:r.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",o)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(n){console.warn("VoxketClient: lk.chat handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("lk.transcription",async(n,r)=>{var s,o;try{const i=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let a="";const c=((s=this.currentAgentInfo)==null?void 0:s.name)||r.identity||"AI Assistant",l={id:i,content:"",timestamp:new Date,sender:{id:r.identity||"agent",name:c,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",l);for await(const h of n){a+=h;const g=this.convertMarkdownToText(a),y={...l,content:g,metadata:{...l.metadata,streaming:!0}};this.emit("chat.message.updated",y)}const u=this.convertMarkdownToText(a),f={...l,content:u,metadata:{...l.metadata,streaming:!1}};this.emit("chat.message.updated",f)}catch(i){console.error("VoxketClient: Failed to process lk.transcription message:",i);try{const a=await n.readAll(),c=((o=this.currentAgentInfo)==null?void 0:o.name)||r.identity||"AI Assistant",l={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:a,timestamp:new Date,sender:{id:r.identity||"agent",name:c,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",l)}catch(a){console.error("VoxketClient: Fallback failed for lk.transcription:",a)}}})}catch(n){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("suggested_response",async n=>{const r=await n.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(o){console.warn("VoxketClient: Failed to parse suggested_response:",o,r)}this.emit("suggested.response",s)})}catch(n){console.warn("VoxketClient: suggested_response handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("agent_state_changed",async(n,r)=>{const s=await n.readAll();let o={};try{o=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(i){console.warn("VoxketClient: Failed to parse agent_state_changed:",i,s)}o.new_state==="speaking"?this.emit("agent.speaking",o):o.new_state==="thinking"&&this.emit("agent.thinking",o)})}catch(n){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",n)}try{this.room.registerTextStreamHandler("images",async(n,r)=>{try{const s=await n.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(n){console.warn("VoxketClient: images handler already registered, skipping:",n)}try{this.room.registerByteStreamHandler("images",async(n,r)=>{var s,o;try{const i=n.info,a={id:`img_${Date.now()}_${r.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${i.name||"Image"}`,sender:{id:r.identity||"agent",name:r.identity||"Agent",type:r.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.mimeType,streamId:i.id,downloading:!0}};this.emit("chat.message.received",a),n.onProgress&&(n.onProgress=h=>{const g={...a,metadata:{...a.metadata,downloadProgress:h||0}};this.emit("chat.message.updated",g)});const c=[];for await(const h of n)c.push(h);const l=new Blob(c,{type:i.mimeType||"application/octet-stream"}),u=URL.createObjectURL(l),f={...a,metadata:{...a.metadata,downloading:!1,downloadProgress:1,downloadUrl:u,blob:l}};this.emit("chat.message.updated",f)}catch(i){console.error("VoxketClient: Error processing image attachment:",i)}})}catch(n){console.warn("VoxketClient: image handler already registered, skipping:",n)}this.textStreamHandlersRegistered=!0}}async fetchConnectionDetails(n,r,s){const o=n||this.config.agentId||"default-agent",i=r||this.config.participantName||"User",a=s||this.config.modalities||["voice"];try{const c={agent_id:o,participant_name:i,participant_metadata:{user_id:""},modality:a[0]},l=await fetch(`${this.config.baseUrl}/api/live/agent/session`,{method:"POST",headers:{accept:"application/json","X-APP-ID":this.config.appId,"X-APP-SECRET":this.config.appSecret,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!l.ok){let h=`HTTP ${l.status}: Failed to fetch connection details`;try{const g=await l.json();g&&(g.error?h=`API Error: ${g.error}`:g.detail?h=`API Error: ${g.detail}`:g.message&&(h=`API Error: ${g.message}`))}catch{try{const y=await l.text();y&&(h=`API Error: ${y}`)}catch{}}throw new Error(h)}const u=await l.json();let f;return u.agent_info&&(f={id:u.agent_info.id||o,name:u.agent_info.name||"AI Assistant",avatar:u.agent_info.avatar,capabilities:u.agent_info.capabilities||["voice_interaction","text_chat"],metadata:u.agent_info.metadata||{}},this.currentAgentInfo=f),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:f}}catch(c){console.error("VoxketClient: fetchConnectionDetails failed:",c);const l=new ue(`Failed to fetch connection details: ${c instanceof Error?c.message:"Unknown error"}`,"CONNECTION_FAILED",c);throw this.emit("connection.error",l),l}}async connect(n,r,s){var o;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,r,s);return await((o=this.room)==null?void 0:o.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new ue(`Failed to connect to Voxket services: ${i instanceof Error?i.message:"Unknown error"}`,"CONNECTION_FAILED",i);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{await((n=this.room)==null?void 0:n.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),this.room=new te.Room,this.setupRoomEventListeners()}catch(r){const s=new ue("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",s),s}}async createSession(n){var r,s;try{const o=await this.connect(n.agentId,n.participantName,n.modalities),i={id:o.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:o.agentInfo||this.currentAgentInfo};if(this.currentSession=i,this.emit("session.created",i),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(a=>setTimeout(a,500)),(s=this.room)!=null&&s.localParticipant?(await this.room.localParticipant.setMicrophoneEnabled(!0,void 0,{preConnectBuffer:!0}),this.emit("track.unmuted",{source:"microphone",enabled:!0})):console.warn("VoxketClient: No local participant found, microphone not enabled")}catch(a){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",a)}return setTimeout(()=>{this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state))},1e3),i}catch(o){throw console.error("VoxketClient: Failed to create session:",o),o instanceof ue?o:o instanceof TypeError&&o.message.includes("fetch")?new ue("Network connection failed","CONNECTION_FAILED",o):o instanceof Error&&o.message.includes("Failed to fetch connection details")?new ue(`API connection failed: ${o.message}`,"CONNECTION_FAILED",o):new ue(`Failed to create session: ${o instanceof Error?o.message:"Unknown error"}`,"SESSION_NOT_FOUND",o)}}async startSession(n,r){const s={agentId:n||this.config.agentId||"default-agent",participantName:(r==null?void 0:r.participantName)||this.config.participantName||"User",modalities:(r==null?void 0:r.modalities)||this.config.modalities||["voice","chat"],metadata:r==null?void 0:r.metadata};return this.createSession(s)}async endSession(){var n,r;if(!this.currentSession)return null;try{const s={sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]};return this.currentSession.endedAt=new Date,this.currentSession.state="disconnected",this.emit("session.ended",this.currentSession,s),await this.disconnect(),s}catch(s){throw new ue("Failed to end session","SESSION_NOT_FOUND",s)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(s=>s.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(s=>s.id===n.id);r!==-1&&(this.chatMessages[r]=n)}clearChatMessages(){this.chatMessages=[],this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),this.emit("chat.history.cleared")}renderUI(n={}){var l,u,f;const r=this.resolveTarget(n.target||"body"),s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&o.target===r||this.removeUI(r);const i=h=>It.createRoot?It.createRoot(h):{render:g=>{It.render(g,h)},unmount:()=>{It.unmountComponentAtNode(h)}},a=(o==null?void 0:o.root)||i(r),c={agentId:n.agentId||this.config.agentId||"default-agent",participantName:n.participantName||this.config.participantName||"User",baseUrl:this.config.baseUrl,appSecret:this.config.appSecret,appId:this.config.appId,className:n.className,theme:typeof n.theme=="string"?n.theme:void 0,modalities:n.modality||this.config.modalities||["voice"],suportsChatInput:((l=n.modality)==null?void 0:l.includes("chat"))!==!1,suportsVideoInput:((u=n.modality)==null?void 0:u.includes("video"))===!0,suportsScreenShare:((f=n.modality)==null?void 0:f.includes("screen_share"))===!0,autoStart:n.autoStart,displayType:n.displayType||"widget",popupPosition:n.popupPosition||"bottom-right",popupTriggerText:n.popupTriggerText||"Open Chat",width:n.width,height:n.height,onDisplayTypeChange:n.onDisplayTypeChange,prompts:n.prompts,statusMessage:n.statusMessage,welcomeTitle:n.welcomeTitle,welcomeSubTitle:n.welcomeSubTitle,loadingText:n.loadingText,voxketClient:this};a.render(m.createElement(Jh,{config:this.config,autoConnect:n.autoStart||!1,children:m.createElement(Qh,c)})),this.renderedComponents.set(s,{root:a,target:r})}removeUI(n){const r=n?this.resolveTarget(n):null;if(r){const s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&(o.root.unmount(),this.renderedComponents.delete(s),r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(a=>{try{a.remove()}catch(c){console.warn("Failed to remove element:",c)}}),r===document.body&&r.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(c=>{if(c.classList.contains("bg-black")&&c.classList.contains("backdrop-blur-sm"))try{c.remove()}catch(l){console.warn("Failed to remove fixed element:",l)}}))}}removeAllUI(){for(const[n,r]of this.renderedComponents)r.root.unmount();this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays()}forceCleanupFullscreenOverlays(){document.body.querySelectorAll(".fixed.inset-0.z-50").forEach(r=>{if(r.classList.contains("bg-black")&&(r.classList.contains("backdrop-blur-sm")||r.classList.contains("bg-opacity-30")))try{r.remove()}catch(s){console.warn("Failed to remove overlay:",s)}})}resolveTarget(n){if(typeof n=="string"){const r=document.querySelector(n);if(!r)throw new Error(`Target element not found: ${n}`);return r}return n}getTargetKey(n){return n.id?n.id:n.className?n.tagName+"_"+n.className.replace(/\s+/g,"_"):n.tagName+"_"+n.outerHTML.length%1e3}async sendMessage(n,r){var s;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new ue("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new ue("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new ue("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},i=await((s=this.room)==null?void 0:s.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new ue("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,r){return this.sendMessage(n,r)}async sendAttachments(n,r){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new ue("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new ue("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new ue("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new ue("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const s=n.filter(o=>o.type.startsWith("image/"));if(s.length===0)throw new ue("Only image files are allowed","INVALID_PARAMETER");s.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=s.map(async(i,a)=>{const l={id:`att_${Date.now()}_${a}`,content:`📎 ${i.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.type,uploading:!0}};this.emit("chat.message.sent",l);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:h=>{const g={...l,metadata:{...l.metadata,uploadProgress:h}};this.emit("chat.message.updated",g)}});try{const h=new FileReader,g=new Promise((x,w)=>{h.onload=()=>{typeof h.result=="string"?x(h.result):w(new Error("Failed to convert to base64"))},h.onerror=w});h.readAsDataURL(i);const p={type:"image",data:await g,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(p),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const g=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(g,{topic:"lk.chat",destinationIdentities:[]})}catch(g){console.warn("VoxketClient: Failed to send image notification to agent:",g)}}const f={...l,metadata:{...l.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",f),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new ue("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new ue("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new ue("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0))}catch(r){throw new ue("Failed to start screen share","PERMISSION_DENIED",r)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1))}catch(r){throw new ue("Failed to stop screen share","PERMISSION_DENIED",r)}}async getAudioInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput")}catch(n){throw new ue("Failed to get audio input devices","DEVICE_ERROR",n)}}async getVideoInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="videoinput")}catch(n){throw new ue("Failed to get video input devices","DEVICE_ERROR",n)}}async setAudioInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new ue("Failed to set audio input device","DEVICE_ERROR",s)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new ue("Failed to set video input device","DEVICE_ERROR",s)}}getLocalParticipant(){var n;return((n=this.room)==null?void 0:n.localParticipant)??null}getRemoteParticipants(){var n;return Array.from(((n=this.room)==null?void 0:n.remoteParticipants.values())??[])}getPublishPermissions(){const n=this.getLocalParticipant();if(!n)return{camera:!1,microphone:!1,screenShare:!1,data:!1};const r=n.permissions;if(!r)return{camera:!0,microphone:!0,screenShare:!0,data:!0};const s=o=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(o));return{camera:s(1),microphone:s(2),screenShare:s(3),data:r.canPublishData??!1}}canPublishSource(n){return this.getPublishPermissions()[n]}getRoom(){return this.room}getConnectionState(){return this.connectionState}get connected(){return this.isConnected&&this.connectionState===te.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.Microphone)return r.track;return null}getCameraTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.Camera)return r.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.ScreenShare)return r.track;return null}get isMicrophoneEnabled(){const n=this.getMicrophoneTrack();return n?!n.isMuted:!1}get isCameraEnabled(){const n=this.getCameraTrack();return n?!n.isMuted:!1}get isScreenShareEnabled(){const n=this.getScreenShareTrack();return n?!n.isMuted:!1}registerPlugin(n){this.pluginManager.register(n)}getPluginManager(){return this.pluginManager}getParticipants(){if(!this.room)return[];const n=[];return this.room.localParticipant&&n.push({id:this.room.localParticipant.identity,name:this.room.localParticipant.name||this.room.localParticipant.identity,isLocal:!0}),this.room.remoteParticipants.forEach(r=>{n.push({id:r.identity,name:r.name||r.identity,isLocal:!1})}),n}getSessionMetrics(){var n,r;return this.currentSession?{sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]}:null}updateConfig(n){this.config={...this.config,...n}}async startRecording(){var n;try{this.emit("recording.started",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new ue("Failed to start recording","RECORDING_ERROR",r)}}async stopRecording(){var n;try{this.emit("recording.stopped",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new ue("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,s="embedded"){return this.rpcManager.registerFrontendRPC(n,r,s)}getCurrentInteraction(){return this.rpcManager.getCurrentInteraction()}dismissCurrentInteraction(){this.rpcManager.dismissCurrentInteraction()}getRegisteredRpcMethods(){return this.rpcManager.getRegisteredMethods()}unregisterRpcMethod(n){this.rpcManager.unregisterMethod(n)}registerEventListener(n,r){return this.on(n,r)}registerEventEmitter(n,r){if(!this.room)throw new Error("Room not available");try{this.room.registerTextStreamHandler(n,async s=>{try{const o=await s.readAll();r(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}catch(s){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,s)}}convertMarkdownToText(n){if(!n)return"";let r=n;return r=r.replace(/\*\*(.*?)\*\*/g,"$1"),r=r.replace(/__(.*?)__/g,"$1"),r=r.replace(/\*(.*?)\*/g,"$1"),r=r.replace(/_(.*?)_/g,"$1"),r=r.replace(/~~(.*?)~~/g,"$1"),r=r.replace(/`([^`]+)`/g,"$1"),r=r.replace(/```[\s\S]*?```/g,""),r=r.replace(/^#{1,6}\s+/gm,""),r=r.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),r.trim()}}const J8=ae.create(M8),Q8=ae.create(_8),e6=ae.create(z8),t6=ae.create(Z8);function n6({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const s={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},o=Ie(r);return d.jsx(ae.button,{onClick:e,className:`fixed ${s[n]} z-50 px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.05},whileTap:{scale:.95},children:t})}function id({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:s="bottom-right",onExpand:o}){const i=Ie(t);if(n==="fullscreen")return d.jsx("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",children:d.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",children:[r&&d.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),r()},className:"absolute top-4 cursor-pointer right-4 z-[100] w-12 h-12 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Exit Fullscreen",type:"button",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),d.jsxs("div",{id:"voice-card",className:`${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[d.jsx("div",{className:i.cardTopGradient}),d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),d.jsx("div",{className:" flex flex-col h-full",children:e}),d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})});if(n==="popup"){const a={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"};return d.jsx("div",{className:"fixed rounded-2xl inset-0 z-50 pointer-events-none",children:d.jsxs("div",{className:`fixed rounded-2xl ${a[s]} pointer-events-auto`,children:[r&&d.jsx("button",{onClick:r,className:"absolute -top-2 -right-2 z-10 w-8 h-8 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 text-sm shadow-lg border border-gray-700",children:"×"}),d.jsxs("div",{id:"voice-card",className:`${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),d.jsx("div",{className:" flex flex-col h-full",children:e}),d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return d.jsxs("div",{id:"voice-card",className:`${i.card}`,children:[o&&d.jsx("button",{onClick:o,className:"absolute top-4 right-4 z-20 w-10 h-10 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Enter Fullscreen",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})}),d.jsx("div",{className:i.cardTopGradient}),d.jsx("div",{className:i.cardPurpleBlur}),d.jsx("div",{className:i.cardPinkBlur}),e,d.jsx("div",{className:i.cardPulse1}),d.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function Qh(e){if(typeof window>"u")return null;console.log("🎯 Widget component rendering with props:",{displayType:e.displayType,popupPosition:e.popupPosition,theme:e.theme});const{agentId:t,participantName:n,baseUrl:r,appSecret:s,appId:o,prompts:i,statusMessage:a,welcomeTitle:c,welcomeSubTitle:l,className:u,width:f,height:h,loadingText:g,suportsChatInput:y=!0,suportsVideoInput:p=!0,suportsScreenShare:x=!0,theme:w="vox",onSessionStart:v,onSessionEnd:S,enableSessionLogging:C=!0,onSessionLogsUpdate:E,onSessionMetricsUpdate:T,modalities:k=["voice"],displayType:j="widget",popupPosition:$="bottom-right",popupTriggerText:b="Open Chat",onPopupToggle:I,voxketClient:L,onDisplayTypeChange:Z}=e,[K,q]=m.useState(()=>L?!!L.getCurrentSession():!1),[G,z]=m.useState(!1),[P,Y]=m.useState(t||""),[R,V]=m.useState(n||"User"),[W,M]=m.useState(()=>L?L.getCurrentSession():null),[_,H]=m.useState(()=>{var ie,Mt,et;if(L){const be=L.getCurrentSession();if((ie=be==null?void 0:be.activeModalities)!=null&&ie.includes("chat"))return"chat";if((Mt=be==null?void 0:be.activeModalities)!=null&&Mt.includes("voice"))return"voice";if((et=be==null?void 0:be.activeModalities)!=null&&et.includes("video"))return"video"}return"welcome"}),[B,N]=m.useState(!1);m.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",j)},[j]),m.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:_,sessionStarted:K,loading:G,currentSession:W==null?void 0:W.id,isPopupOpen:B})},[_,K,G,W,B]);const F=m.useMemo(()=>{if(L)return console.log("🔄 Using passed VoxketClient to preserve session state"),L;console.log("🆕 Creating new VoxketClient instance");const ie={appId:o,appSecret:s,baseUrl:r,agentId:P,participantName:R||"User",modalities:k};return new Tr(ie)},[L,o,s,r,P,R,k]),U=k,O=m.useMemo(()=>F.getRoom()||new te.Room,[F]),J={suportsChatInput:y,suportsVideoInput:p,suportsScreenShare:x},{sessionMetrics:X,sessionLogs:se,logEvent:me}=Yh({room:O,onSessionStart:v,onSessionEnd:S,enableConsoleLogging:C,enableLocalStorage:C,voxketSessionId:W==null?void 0:W.id});m.useEffect(()=>{E&&E(se)},[se,E]),m.useEffect(()=>{T&&X&&T(X)},[X,T]),m.useEffect(()=>{const ie=et=>{console.log("🔴 Room disconnected:",et),z(!1),q(!1),M(null),H("welcome")},Mt=et=>{console.log("📹 Media devices error:",et),Or({title:"Allow access to your microphone/camera",description:`${et.name}: ${et.message}`})};return O.on(te.RoomEvent.MediaDevicesError,Mt),O.on(te.RoomEvent.Disconnected,ie),()=>{O.off(te.RoomEvent.Disconnected,ie),O.off(te.RoomEvent.MediaDevicesError,Mt)}},[O]);const $e=async()=>{try{console.log("🎤 Starting voice session...",{agentId:P,participantName:R}),console.log("🎤 Pre-start state:",{currentMode:_,sessionStarted:K,loading:G}),z(!0),q(!0),H("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),me("USER_STARTED_VOICE_SESSION",{agentId:P,participantName:R});const ie=await F.startSession(P,{participantName:R||"User",modalities:["voice",...p?["video"]:[]]});console.log("✅ Voice session started successfully:",ie.id),M(ie),z(!1),v&&v(ie.id)}catch(ie){console.error("❌ Failed to start voice session:",ie),Or({title:"Failed to start voice session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),z(!1),q(!1),H("welcome")}},at=async()=>{try{z(!0),q(!0),H("chat"),me("USER_STARTED_CHAT_SESSION",{agentId:P,participantName:R});const ie=await F.startSession(P,{participantName:R||"User",modalities:["chat"]});M(ie),z(!1),v&&v(ie.id)}catch(ie){console.error("Failed to start chat session:",ie),Or({title:"Failed to start chat session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),z(!1),q(!1),H("welcome")}},Wt=async()=>{try{console.log("📺 Starting video session...",{agentId:P,participantName:R}),console.log("📺 Pre-start state:",{currentMode:_,sessionStarted:K,loading:G}),z(!0),q(!0),H("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),me("USER_STARTED_VIDEO_SESSION",{agentId:P,participantName:R});const ie=await F.startSession(P,{participantName:R||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",ie.id),M(ie),z(!1),v&&v(ie.id)}catch(ie){console.error("❌ Failed to start video session:",ie),Or({title:"Failed to start video session",description:ie instanceof Error?ie.message:"Unknown error occurred"}),z(!1),q(!1),H("welcome")}},Zt=()=>{H("welcome"),Z&&Z(e.displayType||"widget"),W&&K&&(q(!1),M(null),F.disconnect()),j==="popup"&&!B&&N(!0)},ct=()=>{const ie=!B;N(ie),I&&I(ie),!ie&&!(W&&K)&&(H("welcome"),q(!1),M(null))},gm=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},ym=()=>{e.onDisplayTypeChange&&e.onDisplayTypeChange("fullscreen")};m.useEffect(()=>{var ie,Mt,et;if(L&&F){console.log("🔄 Syncing widget state with existing client session state");const be=F.getCurrentSession(),xm=F.connected;console.log("🔍 Existing session state:",{hasSession:!!be,sessionId:be==null?void 0:be.id,isConnected:xm,activeModalities:be==null?void 0:be.activeModalities}),be&&(console.log("✅ Restoring session state from existing client"),M(be),q(!0),z(!1),(ie=be.activeModalities)!=null&&ie.includes("chat")?H("chat"):(Mt=be.activeModalities)!=null&&Mt.includes("voice")?H("voice"):(et=be.activeModalities)!=null&&et.includes("video")&&H("video"))}},[L,F]),m.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),L?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),F.disconnect())},[F,L]);let Bs="w-96",Hs="h-[25rem]",zs={};if(f&&(f.startsWith("w-")?Bs=f:(zs.width=f,Bs="")),h&&(h.startsWith("h-")?Hs=h:(zs.height=h,Hs="")),j==="popup"&&!B)return console.log("🟡 Showing popup trigger button"),d.jsx(n6,{onClick:ct,text:b,position:$,theme:w});console.log("🟢 Rendering widget content, displayType:",j,"isPopupOpen:",B,"currentMode:",_,"sessionStarted:",K,"loading:",G);let Us=`voxket-widget-root theme-${w}`,Pr={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};j==="widget"?(Us+=` flex items-center justify-center min-h-fit ${Bs} ${Hs} ${u}`,Pr={...Pr,...zs}):(Us=`${u||""}`,Pr={});const Va=d.jsx(d.Fragment,{children:d.jsxs(kn,{mode:"wait",children:[_==="welcome"&&!G&&d.jsx(t6,{agentId:P,participantName:R||"",onAgentIdChange:Y,onParticipantNameChange:V,onStartCall:$e,onStartChat:at,onStartVideo:Wt,disabled:K||G,prompts:i,statusMessage:a,title:c,subTitle:l,theme:w,modalities:U,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),_==="voice"&&d.jsxs(Ee.RoomContext.Provider,{value:O,children:[d.jsx(Ee.RoomAudioRenderer,{}),d.jsx(Ee.StartAudio,{label:"Start Audio"}),d.jsx(J8,{loadingText:g,participantName:R||"User",capabilities:J,sessionStarted:K,disabled:!K,theme:w,client:F,displayType:j,onBack:j==="popup"?ct:Zt,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),_==="chat"&&d.jsx(Q8,{client:F,theme:w,displayType:j,onBack:j==="popup"?ct:Zt,onEndChat:Zt,disabled:!K,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),_==="video"&&d.jsxs(Ee.RoomContext.Provider,{value:O,children:[d.jsx(Ee.RoomAudioRenderer,{}),d.jsx(Ee.StartAudio,{label:"Start Audio"}),d.jsx(e6,{client:F,theme:w,displayType:j,onBack:j==="popup"?ct:Zt,onEndCall:Zt,disabled:!K,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return j==="fullscreen"||j==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",j),d.jsx(id,{theme:w,displayType:j,popupPosition:$,onClose:j==="fullscreen"?gm:ct,children:Va})):(console.log("📦 Rendering widget mode"),d.jsx("div",{className:Us,style:Pr,children:d.jsx(id,{theme:w,displayType:j,popupPosition:$,onExpand:ym,children:Va})}))}class em extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("VoxketWidget Error:",t,n)}render(){if(this.state.hasError){if(this.props.fallback){const t=this.props.fallback;return m.createElement(t,{error:this.state.error})}return m.createElement("div",{style:{padding:"20px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"}},"VoxketWidget encountered an error. Please check the console for details.")}return this.props.children}}function r6({logs:e,onClear:t,onExport:n}){const[r,s]=A.useState(!1),[o,i]=A.useState(""),a=e.filter(c=>!o||c.event.toLowerCase().includes(o.toLowerCase()));return r?d.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:d.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:c=>i(c.target.value),className:"px-3 py-1 border rounded text-sm"}),d.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),d.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),d.jsx("button",{onClick:()=>s(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),d.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?d.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):d.jsx("div",{className:"space-y-2",children:a.map((c,l)=>d.jsxs("div",{className:"border rounded p-3 text-sm",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"font-semibold text-blue-600",children:c.event}),d.jsx("span",{className:"text-gray-500 text-xs",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.sessionId&&d.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",c.sessionId]}),c.data&&d.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:d.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(c.data,null,2)})})]},l))})})]})}):d.jsxs("button",{onClick:()=>s(!0),className:"fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-blue-700 transition-colors text-sm z-50",children:["Session Logs (",e.length,")"]})}function s6({metrics:e}){return e?d.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[d.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Session ID:"}),d.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Start Time:"}),d.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Messages:"}),d.jsx("div",{children:e.totalMessages})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Participants:"}),d.jsx("div",{children:e.participantCount})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),d.jsx("div",{children:e.connectionIssues})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-gray-600",children:"Duration:"}),d.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function ln(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:s}=bt(),o=A.useCallback(async(a,c)=>await r(a,c),[r]),i=A.useCallback(async()=>await s(),[s]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:o,stop:i}}function tm(){const{sessionMetrics:e,currentSession:t}=bt();return{metrics:e,sessionId:t==null?void 0:t.id,duration:e==null?void 0:e.duration,participantCount:e==null?void 0:e.participantCount,messageCount:e==null?void 0:e.messageCount,audioQuality:e==null?void 0:e.audioQuality,networkStats:e==null?void 0:e.networkStats}}function nm(){const{setMicrophoneEnabled:e,client:t}=bt(),[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useCallback(async()=>{if(!s){o(!0);try{const l=!n;await e(l),r(l)}catch(l){console.error("Failed to toggle microphone:",l)}finally{o(!1)}}},[n,s,e]),a=A.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(!0),r(!0)}catch(l){console.error("Failed to enable microphone:",l)}finally{o(!1)}}},[n,s,e]),c=A.useCallback(async()=>{if(!(!n||s)){o(!0);try{await e(!1),r(!1)}catch(l){console.error("Failed to disable microphone:",l)}finally{o(!1)}}},[n,s,e]);return{isEnabled:n,isLoading:s,toggle:i,enable:a,disable:c}}function rm(){const{setCameraEnabled:e}=bt(),[t,n]=A.useState(!1),[r,s]=A.useState(!1),o=A.useCallback(async()=>{if(!r){s(!0);try{const c=!t;await e(c),n(c)}catch(c){console.error("Failed to toggle camera:",c)}finally{s(!1)}}},[t,r,e]),i=A.useCallback(async()=>{if(!(t||r)){s(!0);try{await e(!0),n(!0)}catch(c){console.error("Failed to enable camera:",c)}finally{s(!1)}}},[t,r,e]),a=A.useCallback(async()=>{if(!(!t||r)){s(!0);try{await e(!1),n(!1)}catch(c){console.error("Failed to disable camera:",c)}finally{s(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:o,enable:i,disable:a}}function sm(){const{startScreenShare:e,stopScreenShare:t}=bt(),[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(),r(!0)}catch(l){console.error("Failed to start screen share:",l)}finally{o(!1)}}},[n,s,e]),a=A.useCallback(async()=>{if(!(!n||s)){o(!0);try{await t(),r(!1)}catch(l){console.error("Failed to stop screen share:",l)}finally{o(!1)}}},[n,s,t]),c=A.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:s,start:i,stop:a,toggle:c}}function o6(){const{client:e}=bt(),[t,n]=A.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=A.useMemo(()=>t.tracks.find(p=>p.isLocal),[t.tracks]),s=A.useMemo(()=>t.tracks.filter(p=>!p.isLocal),[t.tracks]),o=A.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(p){throw console.error("Failed to toggle camera:",p),p}},[e,r]),i=A.useCallback(async()=>{try{t.tracks.find(x=>x.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(p){throw console.error("Failed to toggle screen share:",p),p}},[e,t.tracks]),a=A.useCallback(p=>{n(x=>({...x,layout:p}))},[]),c=A.useCallback(p=>{n(x=>({...x,pinnedTrack:p}))},[]),l=A.useCallback(()=>{n(p=>({...p,pinnedTrack:void 0}))},[]),u=A.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(p=>({...p,isRecording:!0}))}catch(p){throw console.error("Failed to start recording:",p),p}},[e]),f=A.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(p=>({...p,isRecording:!1}))}catch(p){throw console.error("Failed to stop recording:",p),p}},[e]),h=A.useCallback(p=>t.tracks.find(x=>x.id===p),[t.tracks]),g=A.useCallback(p=>t.tracks.filter(x=>x.participantId===p),[t.tracks]),y=A.useCallback(p=>p.isEnabled&&t.tracks.includes(p),[t.tracks]);return A.useEffect(()=>{if(!e)return;const p=v=>{n(S=>({...S,tracks:[...S.tracks.filter(C=>C.id!==v.id),v]}))},x=v=>{n(S=>{var C;return{...S,tracks:S.tracks.filter(E=>E.id!==v),pinnedTrack:((C=S.pinnedTrack)==null?void 0:C.id)===v?void 0:S.pinnedTrack}})},w=v=>{n(S=>({...S,tracks:S.tracks.map(C=>C.id===v.id?v:C)}))};return e.on("videoTrackAdded",p),e.on("videoTrackRemoved",x),e.on("videoTrackUpdated",w),()=>{e.off("videoTrackAdded",p),e.off("videoTrackRemoved",x),e.off("videoTrackUpdated",w)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:s,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:i,setLayout:a,pinTrack:c,unpinTrack:l,startRecording:u,stopRecording:f,getTrackById:h,getTracksByParticipant:g,isTrackActive:y}}function _s(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=bt(),[r,s]=A.useState(!1),o=A.useCallback(async l=>{if(!(!l.trim()||r||!n)){s(!0);try{await t(l.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{s(!1)}}},[t,r,n]),{userMessages:i,agentMessages:a,allMessages:c}=A.useMemo(()=>{const l=e.filter(f=>f.sender.type==="participant"),u=e.filter(f=>f.sender.type==="agent");return{userMessages:l,agentMessages:u,allMessages:e}},[e]);return{messages:c,userMessages:i,agentMessages:a,messageCount:c.length,isSending:r,canSend:!!n&&!r,send:o}}function i6(){const{send:e,isSending:t,canSend:n}=_s(),[r,s]=A.useState(""),o=A.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),s("")}catch(a){throw a}},[r,e,n]),i=A.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:r,setValue:s,send:o,handleKeyPress:i,isSending:t,canSend:n&&r.trim().length>0}}function Pa(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:s}=bt(),o=A.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),i=A.useCallback(async()=>{if(e)try{await s()}catch(a){throw console.error("Failed to disconnect:",a),a}},[s,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:o,disconnect:i}}function om(){const{participants:e}=bt();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const im=A.createContext({}),jr=()=>A.useContext(im);function am({children:e,...t}){return d.jsx(im.Provider,{value:t,children:e})}function es({name:e,children:t,fallback:n,className:r}){return d.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function cm(e,t={}){return Object.assign(e,t)}function lm({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:s,className:o=""}){const i=ln(),a=nm(),c=rm(),l=sm(),u=jr(),f=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,i.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!i.isActive&&!r?d.jsx("div",{className:f,children:d.jsx("div",{className:"voxket-controls-inactive",children:d.jsx("p",{children:"Controls available during active session"})})}):d.jsxs("div",{className:f,children:[r&&d.jsx("div",{className:"voxket-session-actions",children:i.isActive?d.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):d.jsx(a6,{})}),i.isActive&&d.jsxs("div",{className:"voxket-media-controls",children:[e&&d.jsxs("button",{onClick:a.toggle,disabled:a.isLoading,className:`voxket-button voxket-button--media ${a.isEnabled?"voxket-button--active":""}`,title:a.isEnabled?"Mute microphone":"Unmute microphone",children:[d.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&d.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isEnabled?"voxket-button--active":""}`,title:c.isEnabled?"Stop camera":"Start camera",children:[d.jsx("span",{className:"voxket-icon",children:"📹"}),c.isLoading?"Loading...":c.isEnabled?"Stop Video":"Start Video"]}),n&&d.jsxs("button",{onClick:l.toggle,disabled:l.isLoading,className:`voxket-button voxket-button--media ${l.isSharing?"voxket-button--active":""}`,title:l.isSharing?"Stop screen share":"Start screen share",children:[d.jsx("span",{className:"voxket-icon",children:"🖥️"}),l.isLoading?"Loading...":l.isSharing?"Stop Share":"Share Screen"]})]}),s&&d.jsx("div",{className:"voxket-custom-controls",children:s})]})}function a6(){ln();const[e,t]=A.useState(!1),n=async()=>{t(!0);try{console.log("Start session - agentId needed")}catch(r){console.error("Failed to start session:",r)}finally{t(!1)}};return d.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Ma({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const s=ln(),o=Pa(),i=jr(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,r].filter(Boolean).join(" ");return d.jsxs("div",{className:a,children:[e&&d.jsxs("div",{className:"voxket-connection-status",children:[d.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),d.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&s.session&&d.jsxs("div",{className:"voxket-session-info",children:[d.jsxs("div",{className:"voxket-session-id",children:["Session: ",s.session.id.slice(-8)]}),d.jsxs("div",{className:"voxket-session-state",children:["State: ",s.state]})]}),n&&s.session&&d.jsxs("div",{className:"voxket-agent-info",children:[d.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",s.session.agentId]}),d.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",s.session.activeModalities.join(", ")]})]}),o.error&&d.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function Na({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const s=ln(),o=_s(),i=jr(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,r].filter(Boolean).join(" ");return s.isActive?d.jsx("div",{className:a,children:n||d.jsxs(d.Fragment,{children:[e&&d.jsxs("div",{className:"voxket-chat-container",children:[d.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(c=>d.jsxs("div",{className:`voxket-message voxket-message--${c.sender.type}`,children:[d.jsxs("div",{className:"voxket-message-header",children:[d.jsx("span",{className:"voxket-message-sender",children:c.sender.name}),d.jsx("span",{className:"voxket-message-time",children:c.timestamp.toLocaleTimeString()})]}),d.jsx("div",{className:"voxket-message-content",children:c.content})]},c.id)),o.messages.length===0&&d.jsx("div",{className:"voxket-empty-messages",children:d.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),d.jsx(c6,{})]}),t&&d.jsx("div",{className:"voxket-transcriptions",children:d.jsx("div",{className:"voxket-transcription-placeholder",children:d.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):d.jsx("div",{className:a,children:d.jsx("div",{className:"voxket-inactive-state",children:d.jsxs("div",{className:"voxket-inactive-message",children:[d.jsx("h3",{children:"Start a conversation"}),d.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function c6(){const e=_s(),[t,n]=A.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},s=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())};return d.jsxs("div",{className:"voxket-chat-input",children:[d.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:s,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),d.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function Ra({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:s=""}){const o=ln(),i=tm(),a=om(),c=jr(),l=["voxket-session-footer",`voxket-session-footer--${c.variant||"default"}`,`voxket-session-footer--${c.size||"md"}`,s].filter(Boolean).join(" ");return o.isActive?d.jsx("div",{className:l,children:r||d.jsxs(d.Fragment,{children:[n&&d.jsxs("div",{className:"voxket-session-status",children:[d.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),d.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&d.jsxs("div",{className:"voxket-session-metrics",children:[d.jsxs("div",{className:"voxket-metric",children:[d.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),d.jsx("span",{className:"voxket-metric-value",children:l6(i.duration||0)})]}),d.jsxs("div",{className:"voxket-metric",children:[d.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),d.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&d.jsxs("div",{className:"voxket-participants-info",children:[d.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&d.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>d.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):d.jsx("div",{className:l,children:d.jsx("div",{className:"voxket-footer-inactive",children:d.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function l6(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60);return r>0?`${r}:${(n%60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`:`${n}:${(t%60).toString().padStart(2,"0")}`}function d6({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:s,variant:o="default",size:i="md",theme:a,className:c="",children:l}){var g;const u=ln(),f=Pa();A.useEffect(()=>{n&&e&&f.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,f.isConnected,u.isActive]),A.useEffect(()=>{var y;(y=u.session)!=null&&y.id&&r&&r(u.session.id)},[(g=u.session)==null?void 0:g.id,r]),A.useEffect(()=>()=>{u.isActive&&s&&u.stop().then(s).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${o}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",c].filter(Boolean).join(" ");return d.jsx(am,{variant:o,size:i,theme:a,className:c,children:d.jsx("div",{className:h,children:l||d.jsxs(d.Fragment,{children:[d.jsx(es,{name:"header",fallback:d.jsx(Ma,{})}),d.jsx(es,{name:"content",fallback:d.jsx(Na,{})}),d.jsx(es,{name:"footer",fallback:d.jsx(Ra,{})})]})})})}const dm=cm(d6,{Header:Ma,Content:Na,Footer:Ra,Controls:lm}),nn={name:"default",colors:{primary:"#3B82F6",secondary:"#6B7280",accent:"#8B5CF6",background:"#FFFFFF",surface:"#F9FAFB",text:{primary:"#111827",secondary:"#6B7280",muted:"#9CA3AF",inverse:"#FFFFFF"},status:{success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6"},border:"#E5E7EB",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},typography:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},borderRadius:{none:"0",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"}},xi={...nn,name:"dark",colors:{primary:"#60A5FA",secondary:"#9CA3AF",accent:"#A78BFA",background:"#111827",surface:"#1F2937",text:{primary:"#F9FAFB",secondary:"#D1D5DB",muted:"#9CA3AF",inverse:"#111827"},status:{success:"#34D399",warning:"#FBBF24",error:"#F87171",info:"#60A5FA"},border:"#374151",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.3)"}},bi={...nn,name:"enterprise",colors:{primary:"#1E40AF",secondary:"#64748B",accent:"#7C3AED",background:"#FFFFFF",surface:"#F8FAFC",text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8",inverse:"#FFFFFF"},status:{success:"#059669",warning:"#D97706",error:"#DC2626",info:"#1E40AF"},border:"#CBD5E1",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.375rem",full:"9999px"}},um=A.createContext(null),fm=()=>{const e=A.useContext(um);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function u6({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:s=""}){const[o,i]=A.useState(()=>{const h={default:nn,dark:xi,enterprise:bi,...t};return typeof e=="string"?h[e]||nn:e}),[a,c]=A.useState(()=>({default:nn,dark:xi,enterprise:bi,...t})),l=h=>{if(typeof h=="string"){const g=a[h];g&&i(g)}else i(h)},u=h=>{c(g=>({...g,[h.name]:h}))};A.useEffect(()=>{if(r&&typeof document<"u"){const h=document.documentElement;Object.entries(hm(o)).forEach(([g,y])=>{h.style.setProperty(`--voxket-${g}`,y)})}},[o,r]);const f={theme:o,setTheme:l,themes:a,registerTheme:u};return d.jsx(um.Provider,{value:f,children:d.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${s}`,children:n})})}function hm(e){const t={},n=(r,s="")=>{for(const[o,i]of Object.entries(r)){const a=s?`${s}-${o}`:o;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function f6(e=nn,t){return{...e,...t,colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography},spacing:{...e.spacing,...t.spacing},borderRadius:{...e.borderRadius,...t.borderRadius},shadows:{...e.shadows,...t.shadows}}}function h6(e){var n;const{theme:t}=fm();return((n=t.components)==null?void 0:n[e])||{}}const m6=ja("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&p6(e),t.enableVoiceActivation&&g6(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&y6(e,t)}});function p6(e,t){e.on("participant.speaking.started",n=>{console.log("Transcription: Started for",n.name)}),e.on("participant.speaking.stopped",n=>{console.log("Transcription: Stopped for",n.name)})}function g6(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function y6(e,t){console.log("Playing audio response:",t.content)}const x6=ja("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&b6(),t.enableFileUpload&&v6(e),t.enableCustomComponents&&w6(),console.log("Chat modality activated",t)},onDeactivate:async e=>{console.log("Chat modality deactivated")},onMessage:async(e,t)=>{const n=e.config;t.type==="ui_component"?S6(e,t):t.type==="text"&&n.enableRichText&&C6(e,t)}});function b6(e){console.log("Rich text support enabled")}function v6(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function w6(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",k6),t.set("form",E6),t.set("card",A6),t.set("chart",T6)}function S6(e,t){const{componentType:n,props:r}=t.metadata;console.log("Rendering custom component:",n,r),e.emit("chat.component.render",{type:n,props:r,timestamp:new Date})}function C6(e,t){console.log("Processing rich text message:",t.content)}function k6(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function E6(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function A6(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function T6(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function ts({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:s=!0,isPinned:o=!1,className:i="",onClick:a,onPin:c,onUnpin:l}){const u=A.useRef(null),[f,h]=A.useState(!1);A.useEffect(()=>{if(!u.current||!e.isEnabled)return;const x=u.current;return x.srcObject=null,()=>{x.srcObject&&(x.srcObject=null)}},[e]);const g=()=>{a==null||a(e)},y=x=>{x.stopPropagation(),o?l==null||l(e):c==null||c(e)},p=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",f?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return d.jsxs("div",{className:p,onClick:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[d.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&d.jsxs("div",{className:"voxket-video-placeholder",children:[d.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),d.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),d.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&d.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),s&&!e.isEnabled&&d.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(f||o)&&d.jsxs("div",{className:"voxket-video-controls",children:[d.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:y,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&d.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&d.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&d.jsx("div",{className:"voxket-video-loading",children:d.jsx("div",{className:"voxket-spinner"})})]})}function j6({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:s,maxVisibleTracks:o=9,showPagination:i=!0}){const[a,c]=A.useState(0),[l,u]=A.useState(null),f=A.useMemo(()=>{let v=[...e];t.type==="speaker"&&l&&(v=[l,...e.filter(E=>E.id!==l.id)]);const S=a*o,C=S+o;return v.slice(S,C)},[e,t,l,a,o]),h=Math.ceil(e.length/o),g=A.useMemo(()=>{const v=f.length;switch(t.type){case"grid":const S=Math.ceil(Math.sqrt(v)),C=Math.ceil(v/S);return{display:"grid",gridTemplateColumns:`repeat(${S}, 1fr)`,gridTemplateRows:`repeat(${C}, 1fr)`,gap:"8px"};case"speaker":return{display:"flex",flexDirection:"column",gap:"8px"};case"sidebar":return{display:"flex",gap:"8px"};case"gallery":return{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center"};default:return{}}},[t.type,f.length]),y=v=>{u(v)},p=()=>{u(null)},x=v=>{r==null||r({...t,type:v})},w=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${f.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?d.jsx("div",{className:"voxket-video-grid-empty",children:d.jsxs("div",{className:"voxket-video-grid-empty-content",children:[d.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),d.jsx("p",{children:"No video tracks available"})]})}):d.jsxs("div",{className:w,children:[d.jsxs("div",{className:"voxket-video-grid-controls",children:[d.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(v=>d.jsx("button",{className:`voxket-layout-btn ${t.type===v?"voxket-layout-btn--active":""}`,onClick:()=>x(v),title:`Switch to ${v} layout`,children:P6(v)},v))}),d.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),d.jsx("div",{className:"voxket-video-grid-content",style:g,children:t.type==="speaker"&&l?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"voxket-video-speaker-main",children:d.jsx(ts,{track:l,participantName:`Participant ${l.participantId}`,isPinned:!0,onClick:s,onUnpin:p})}),d.jsx("div",{className:"voxket-video-speaker-sidebar",children:f.filter(v=>v.id!==l.id).map(v=>d.jsx(ts,{track:v,participantName:`Participant ${v.participantId}`,showControls:!1,onClick:s,onPin:y},v.id))})]}):f.map(v=>d.jsx(ts,{track:v,participantName:`Participant ${v.participantId}`,isPinned:(l==null?void 0:l.id)===v.id,onClick:s,onPin:y,onUnpin:p},v.id))}),i&&h>1&&d.jsxs("div",{className:"voxket-video-pagination",children:[d.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.max(0,a-1)),disabled:a===0,children:"←"}),d.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),d.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function P6(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function M6({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:s=!0,showCameraControls:o=!0,showScreenShareControls:i=!0,className:a=""}){const c=["voxket-video-controls",a].filter(Boolean).join(" "),l=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return d.jsxs("div",{className:c,children:[o&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),d.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isEnabled?"voxket-control-btn--active":""}`,onClick:t,title:e!=null&&e.isEnabled?"Turn off camera":"Turn on camera",children:[d.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),d.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&d.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),d.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isScreenShare?"voxket-control-btn--active":""}`,onClick:n,title:e!=null&&e.isScreenShare?"Stop screen sharing":"Start screen sharing",children:[d.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),d.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),s&&d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),d.jsx("div",{className:"voxket-layout-buttons",children:[{type:"grid",icon:"⊞",label:"Grid"},{type:"speaker",icon:"🎤",label:"Speaker"},{type:"sidebar",icon:"⫸",label:"Sidebar"},{type:"gallery",icon:"⊡",label:"Gallery"}].map(({type:u,icon:f,label:h})=>d.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>l(u),title:`Switch to ${h} layout`,children:[d.jsx("span",{className:"voxket-control-icon",children:f}),d.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),d.jsxs("div",{className:"voxket-video-settings",children:[d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Quality"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"high",children:"High (720p)"}),d.jsx("option",{value:"medium",children:"Medium (480p)"}),d.jsx("option",{value:"low",children:"Low (240p)"})]})]}),d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"30",children:"30 fps"}),d.jsx("option",{value:"15",children:"15 fps"}),d.jsx("option",{value:"10",children:"10 fps"})]})]}),d.jsxs("div",{className:"voxket-setting-group",children:[d.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),d.jsxs("select",{className:"voxket-setting-select",children:[d.jsx("option",{value:"unlimited",children:"Unlimited"}),d.jsx("option",{value:"1000",children:"1 Mbps"}),d.jsx("option",{value:"500",children:"500 Kbps"}),d.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),d.jsxs("div",{className:"voxket-video-controls-section",children:[d.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),d.jsxs("div",{className:"voxket-video-stats",children:[d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),d.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Source:"}),d.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),d.jsxs("div",{className:"voxket-stat-item",children:[d.jsx("span",{className:"voxket-stat-label",children:"Status:"}),d.jsx("span",{className:`voxket-stat-value ${e!=null&&e.isEnabled?"voxket-stat-value--active":"voxket-stat-value--inactive"}`,children:e!=null&&e.isEnabled?"Active":"Inactive"})]})]})]})]})}const mm=({handler:e,loadData:t,data:n,client:r,addLocalMessage:s})=>{const[o,i]=m.useState(null),[a,c]=m.useState(!0),[l,u]=m.useState(!1),[f]=m.useState(Date.now());m.useEffect(()=>{(async()=>{try{if(c(!0),console.log("📋 AssignmentView: Loading assignment data..."),console.log("📋 AssignmentView: Received data from RPC:",n),n&&typeof n=="object"){const x={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(x),console.log("📋 AssignmentView: Assignment loaded from RPC data:",x)}}catch(x){console.error("📋 AssignmentView: Error loading assignment:",x),i({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{c(!1)}})()},[n,t]);const h=({message:p,assignment:x})=>{const w=p.toLowerCase().includes("declined"),v=w?"bg-red-50 border-red-200":"bg-green-50 border-green-200",S=w?"text-red-700":"text-green-700",C=w?"❌":"🎉";return d.jsxs("div",{className:`max-w-sm mx-auto ${v} border rounded-lg shadow p-3 flex flex-col items-center`,children:[d.jsx("div",{className:"text-2xl mb-2",children:C}),d.jsx("div",{className:`${S} font-semibold text-sm mb-1`,children:p}),d.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:x.title}),d.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},g=async()=>{if(!(!o||!e)){u(!0);try{const p={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",p),e.didSuccess(p,d.jsx(h,{message:"Assignment accepted!",assignment:o}))}catch(p){console.error("📋 AssignmentView: Error accepting assignment:",p),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},y=async()=>{if(!(!o||!e)){u(!0);try{const p={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",p),e.didSuccess(p,d.jsx(h,{message:"Assignment declined",assignment:o}))}catch(p){console.error("📋 AssignmentView: Error declining assignment:",p),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?d.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),d.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?d.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[d.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),d.jsxs("div",{className:"p-3",children:[d.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:d.jsx("p",{className:"text-xs text-gray-700 leading-snug",children:o.description})}),d.jsx("div",{className:"mb-3",children:d.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[d.jsx("span",{className:"text-xs mr-1",children:"📅"}),d.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:g,disabled:l,className:"flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:l?d.jsxs("span",{className:"flex items-center justify-center",children:[d.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),d.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),d.jsx("button",{onClick:y,disabled:l,className:"flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Decline"})]})]})]}):d.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:d.jsxs("div",{className:"text-center py-4",children:[d.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),d.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function N6(){const[e,t]=m.useState(null),[n,r]=m.useState([]);m.useEffect(()=>{const a=new Tr({appId:"your-app-id",appSecret:"your-app-secret",baseUrl:"https://your-voxket-api.com",agentId:"your-agent-id",participantName:"User",modalities:["chat"]});return t(a),a.on("rpc.method.called",c=>{console.log("RPC Method Called:",c)}),a.on("rpc.interaction.completed",c=>{console.log("RPC Interaction Completed:",c)}),()=>{a.disconnect()}},[]);const s=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",mm,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:c,timeout:l})=>{const[u,f]=m.useState(""),h=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],g=p=>{f(p)},y=()=>{const p=h.find(x=>x.id===u);c==null||c.didSuccess({selectedProduct:u,productName:p==null?void 0:p.name,price:p==null?void 0:p.price,timestamp:new Date().toISOString()})};return d.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[d.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),d.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),d.jsx("div",{className:"space-y-3 mb-6",children:h.map(p=>d.jsx("div",{onClick:()=>g(p.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===p.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"font-medium",children:p.name}),d.jsx("p",{className:"text-gray-600 text-sm",children:p.price})]}),d.jsx("div",{className:`w-4 h-4 rounded-full ${u===p.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},p.id))}),d.jsxs("div",{className:"flex justify-end space-x-3",children:[d.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),d.jsx("button",{onClick:y,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),l&&d.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",l," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Product Recommendation RPC registered successfully")}catch(c){console.error("❌ Failed to register product recommendation RPC:",c)}},i=async()=>{if(!e)return;const a=({handler:c})=>{const[l,u]=m.useState(0),[f,h]=m.useState(""),g=()=>{c==null||c.didSuccess({rating:l,comment:f,timestamp:new Date().toISOString()})};return d.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),d.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(y=>d.jsx("button",{onClick:()=>u(y),className:`text-2xl ${y<=l?"text-yellow-400":"text-gray-300"}`,children:"⭐"},y))})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),d.jsx("textarea",{value:f,onChange:y=>h(y.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),d.jsxs("div",{className:"flex justify-end space-x-2",children:[d.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),d.jsx("button",{onClick:g,disabled:l===0,className:"px-3 py-1 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Submit"})]})]})};try{await e.registerFrontendRPC("collect_feedback",a,"embedded");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Feedback RPC registered successfully")}catch(c){console.error("❌ Failed to register feedback RPC:",c)}};return d.jsxs("div",{className:"p-6",children:[d.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),d.jsxs("div",{className:"space-y-4 mb-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),d.jsxs("div",{className:"space-x-2",children:[d.jsx("button",{onClick:s,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),d.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),d.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?d.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>d.jsx("li",{className:"text-gray-700",children:d.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):d.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),d.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),d.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[d.jsxs("li",{children:["Register RPC methods with React components using ",d.jsx("code",{children:"client.registerFrontendRPC()"})]}),d.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),d.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),d.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),d.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),d.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[d.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),d.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),d.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
251
181
  const response = await participant.performRpc({
252
182
  method: 'give_assignment',
253
183
  data: JSON.stringify({
@@ -258,4 +188,4 @@ const response = await participant.performRpc({
258
188
  })
259
189
  });
260
190
 
261
- console.log('User response:', response);`})]})]})}const aE={async checkAvailableRpcs(e){const t=e.getRegisteredRpcMethods();return console.log("🔍 Agent: Available RPC methods:",t),t},async triggerAssignment(e,t){const n={title:"Complete Q4 Sales Analysis Report",description:"Please analyze the Q4 sales data and create a comprehensive report with insights, trends, and recommendations for the upcoming quarter. Include visualizations and executive summary.",estimated_time_of_completion:"2-3 hours"};try{console.log("🤖 Agent: Triggering give_assignment RPC with data:",n);const r=await e.localParticipant.performRpc(t,"give_assignment",JSON.stringify(n),{responseTimeout:12e4}),s=JSON.parse(r);return console.log("✅ Agent: Received user response:",s),await this.processAssignmentResponse(s),s}catch(r){throw console.error("❌ Agent: RPC failed:",r),r}},async processAssignmentResponse(e){console.log("🧠 Agent: Processing assignment response...");const t=e.status,n=e.assignmentId,r=e.timeSpent;return t==="accepted"?(console.log("🎉 Agent: User accepted the assignment!"),console.log(`� Assignment ID: ${n}`),console.log(`⏱️ Time to respond: ${r}ms`),console.log("💬 Agent: Sending follow-up:","Great! I've recorded that you've accepted the assignment. You'll receive the detailed requirements and access to the data shortly. Let me know if you need any clarification!")):t==="declined"?(console.log("❌ Agent: User declined the assignment"),console.log("💬 Agent: Sending follow-up:","No problem! Is there anything specific about this assignment that doesn't work for you? I can suggest alternatives or modify the requirements.")):t==="completed"&&(console.log("✅ Agent: User completed the assignment"),console.log("💬 Agent: Sending follow-up:","Excellent work! Could you please share the completed report? I'm excited to review your analysis and insights.")),{status:t,assignmentId:n,timeSpent:r,processed:!0,followupAction:t==="accepted"?"send_requirements":t==="declined"?"offer_alternatives":"request_deliverables"}},getAssignmentExamples(){return{marketing:{title:"Create Social Media Campaign",description:"Design and plan a social media campaign for our new product launch. Include content calendar, post designs, and engagement strategy.",estimated_time_of_completion:"4-5 hours"},technical:{title:"API Integration Documentation",description:"Create comprehensive documentation for our new API endpoints, including examples, error codes, and best practices for developers.",estimated_time_of_completion:"6-8 hours"},research:{title:"Market Research Analysis",description:"Research and analyze competitor pricing strategies in our target market. Provide recommendations for our pricing model.",estimated_time_of_completion:"3-4 hours"},quick:{title:"Customer Feedback Summary",description:"Review this week's customer feedback and create a summary of key themes and actionable insights.",estimated_time_of_completion:"30-45 minutes"}}}};function np(){var t,n;const e=[];try{const r=(window==null?void 0:window.React)||(global==null?void 0:global.React);if(!r)return e.push("React not found in global scope"),{isCompatible:!1,warnings:e};const s=r.version;return parseInt((s==null?void 0:s.split(".")[0])||"0")<18?(e.push(`React version ${s} is not supported. Please use React 18 or higher.`),{isCompatible:!1,version:s,warnings:e}):(((n=(t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__)==null?void 0:t.renderers)==null?void 0:n.size)>1&&e.push("Multiple React instances detected. This may cause issues."),{isCompatible:!0,version:s,warnings:e})}catch(r){return e.push(`Error checking React: ${r}`),{isCompatible:!1,warnings:e}}}function cE(e,t){return function(r){const s=require("react");return s.useEffect(()=>{const o=np();!o.isCompatible&&t?t(new Error("React compatibility check failed"),o.warnings):o.warnings.length>0&&console.warn("VoxketWidget warnings:",o.warnings)},[]),s.createElement(e,r)}}const lE=e=>typeof window>"u"?null:m.createElement(Bm,{children:m.createElement(Fm,e)});exports.AssignmentView=tp;exports.CompoundProvider=Ym;exports.InteractiveComponent=Fn;exports.PluginManager=$m;exports.RpcExamples=iE;exports.SessionContainer=Xm;exports.SessionContent=Ja;exports.SessionControls=qm;exports.SessionFooter=Qa;exports.SessionHeader=Xa;exports.SessionLogViewer=j6;exports.SessionMetricsComponent=V6;exports.Slot=hs;exports.ThemeProvider=F6;exports.VideoControls=oE;exports.VideoGrid=rE;exports.VideoTile=ms;exports.VoxketClient=Ir;exports.VoxketErrorBoundary=Bm;exports.VoxketEventEmitter=Ya;exports.VoxketProvider=_m;exports.VoxketSDK=Ir;exports.VoxketSessionComponent=Xm;exports.agentRpcExample=aE;exports.analyticsPlugin=C6;exports.chatModalityPlugin=K6;exports.checkReactVersion=np;exports.createCustomTheme=B6;exports.createModalityPlugin=Ga;exports.createPlugin=S6;exports.createVoxketWithCheck=cE;exports.darkTheme=Li;exports.debugPlugin=E6;exports.default=lE;exports.defaultTheme=an;exports.enterpriseTheme=_i;exports.flattenTheme=ep;exports.metricsPlugin=k6;exports.useComponentTheme=H6;exports.useCompoundContext=Dr;exports.useSessionLogging=Om;exports.useTheme=Qm;exports.useVoxket=Et;exports.useVoxketCamera=Um;exports.useVoxketChat=no;exports.useVoxketChatInput=D6;exports.useVoxketConnection=qa;exports.useVoxketMetrics=Hm;exports.useVoxketMicrophone=zm;exports.useVoxketParticipants=Zm;exports.useVoxketScreenShare=Wm;exports.useVoxketSession=hn;exports.useVoxketVideo=I6;exports.voiceModalityPlugin=z6;exports.withCompoundComponent=Gm;
191
+ console.log('User response:', response);`})]})]})}const R6={async checkAvailableRpcs(e){const t=e.getRegisteredRpcMethods();return console.log("🔍 Agent: Available RPC methods:",t),t},async triggerAssignment(e,t){const n={title:"Complete Q4 Sales Analysis Report",description:"Please analyze the Q4 sales data and create a comprehensive report with insights, trends, and recommendations for the upcoming quarter. Include visualizations and executive summary.",estimated_time_of_completion:"2-3 hours"};try{console.log("🤖 Agent: Triggering give_assignment RPC with data:",n);const r=await e.localParticipant.performRpc(t,"give_assignment",JSON.stringify(n),{responseTimeout:12e4}),s=JSON.parse(r);return console.log("✅ Agent: Received user response:",s),await this.processAssignmentResponse(s),s}catch(r){throw console.error("❌ Agent: RPC failed:",r),r}},async processAssignmentResponse(e){console.log("🧠 Agent: Processing assignment response...");const t=e.status,n=e.assignmentId,r=e.timeSpent;return t==="accepted"?(console.log("🎉 Agent: User accepted the assignment!"),console.log(`� Assignment ID: ${n}`),console.log(`⏱️ Time to respond: ${r}ms`),console.log("💬 Agent: Sending follow-up:","Great! I've recorded that you've accepted the assignment. You'll receive the detailed requirements and access to the data shortly. Let me know if you need any clarification!")):t==="declined"?(console.log("❌ Agent: User declined the assignment"),console.log("💬 Agent: Sending follow-up:","No problem! Is there anything specific about this assignment that doesn't work for you? I can suggest alternatives or modify the requirements.")):t==="completed"&&(console.log("✅ Agent: User completed the assignment"),console.log("💬 Agent: Sending follow-up:","Excellent work! Could you please share the completed report? I'm excited to review your analysis and insights.")),{status:t,assignmentId:n,timeSpent:r,processed:!0,followupAction:t==="accepted"?"send_requirements":t==="declined"?"offer_alternatives":"request_deliverables"}},getAssignmentExamples(){return{marketing:{title:"Create Social Media Campaign",description:"Design and plan a social media campaign for our new product launch. Include content calendar, post designs, and engagement strategy.",estimated_time_of_completion:"4-5 hours"},technical:{title:"API Integration Documentation",description:"Create comprehensive documentation for our new API endpoints, including examples, error codes, and best practices for developers.",estimated_time_of_completion:"6-8 hours"},research:{title:"Market Research Analysis",description:"Research and analyze competitor pricing strategies in our target market. Provide recommendations for our pricing model.",estimated_time_of_completion:"3-4 hours"},quick:{title:"Customer Feedback Summary",description:"Review this week's customer feedback and create a summary of key themes and actionable insights.",estimated_time_of_completion:"30-45 minutes"}}}};function pm(){var t,n;const e=[];try{const r=(window==null?void 0:window.React)||(global==null?void 0:global.React);if(!r)return e.push("React not found in global scope"),{isCompatible:!1,warnings:e};const s=r.version;return parseInt((s==null?void 0:s.split(".")[0])||"0")<18?(e.push(`React version ${s} is not supported. Please use React 18 or higher.`),{isCompatible:!1,version:s,warnings:e}):(((n=(t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__)==null?void 0:t.renderers)==null?void 0:n.size)>1&&e.push("Multiple React instances detected. This may cause issues."),{isCompatible:!0,version:s,warnings:e})}catch(r){return e.push(`Error checking React: ${r}`),{isCompatible:!1,warnings:e}}}function V6(e,t){return function(r){const s=require("react");return s.useEffect(()=>{const o=pm();!o.isCompatible&&t?t(new Error("React compatibility check failed"),o.warnings):o.warnings.length>0&&console.warn("VoxketWidget warnings:",o.warnings)},[]),s.createElement(e,r)}}const I6=e=>typeof window>"u"?null:m.createElement(em,{children:m.createElement(Qh,e)});exports.AssignmentView=mm;exports.CompoundProvider=am;exports.InteractiveComponent=Vn;exports.PluginManager=qh;exports.RpcExamples=N6;exports.SessionContainer=dm;exports.SessionContent=Na;exports.SessionControls=lm;exports.SessionFooter=Ra;exports.SessionHeader=Ma;exports.SessionLogViewer=r6;exports.SessionMetricsComponent=s6;exports.Slot=es;exports.ThemeProvider=u6;exports.VideoControls=M6;exports.VideoGrid=j6;exports.VideoTile=ts;exports.VoxketClient=Tr;exports.VoxketErrorBoundary=em;exports.VoxketEventEmitter=Ta;exports.VoxketProvider=Jh;exports.VoxketSDK=Tr;exports.VoxketSessionComponent=dm;exports.agentRpcExample=R6;exports.analyticsPlugin=G8;exports.chatModalityPlugin=x6;exports.checkReactVersion=pm;exports.createCustomTheme=f6;exports.createModalityPlugin=ja;exports.createPlugin=K8;exports.createVoxketWithCheck=V6;exports.darkTheme=xi;exports.debugPlugin=Y8;exports.default=I6;exports.defaultTheme=nn;exports.enterpriseTheme=bi;exports.flattenTheme=hm;exports.metricsPlugin=q8;exports.useComponentTheme=h6;exports.useCompoundContext=jr;exports.useSessionLogging=Yh;exports.useTheme=fm;exports.useVoxket=bt;exports.useVoxketCamera=rm;exports.useVoxketChat=_s;exports.useVoxketChatInput=i6;exports.useVoxketConnection=Pa;exports.useVoxketMetrics=tm;exports.useVoxketMicrophone=nm;exports.useVoxketParticipants=om;exports.useVoxketScreenShare=sm;exports.useVoxketSession=ln;exports.useVoxketVideo=o6;exports.voiceModalityPlugin=m6;exports.withCompoundComponent=cm;