@voxket-ai/voxket-live 1.0.102 → 1.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +341 -30
- package/dist/index.js +341 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";var Od=Object.defineProperty;var Ld=(e,t,n)=>t in e?Od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>Ld(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("react"),l=require("react/jsx-runtime"),H=require("livekit-client"),Ie=require("@livekit/components-react"),Fo=require("class-variance-authority"),Oo=require("clsx"),_d=require("@radix-ui/react-toggle"),Bd=require("@radix-ui/react-select"),Pe=require("lucide-react"),zd=require("@emotion/styled");require("@emotion/react");const Hd=require("react-dom/client");function Lo(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 g=Lo(w),Ud=Lo(_d),He=Lo(Bd),_o=w.createContext({});function Bo(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const zo=typeof window<"u",Ka=zo?w.useLayoutEffect:w.useEffect,dr=w.createContext(null);function Ho(e,t){e.indexOf(t)===-1&&e.push(t)}function Uo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const it=(e,t,n)=>n>t?t:n<e?e:n;function io(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Qt=()=>{},at=()=>{};process.env.NODE_ENV!=="production"&&(Qt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(io(t,n))},at=(e,t,n)=>{if(!e)throw new Error(io(t,n))});const ct={},Ya=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qa(e){return typeof e=="object"&&e!==null}const Xa=e=>/^0[^.\s]+$/u.test(e);function Zo(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ue=e=>e,Zd=(e,t)=>n=>t(e(n)),An=(...e)=>e.reduce(Zd),vn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wo{constructor(){this.subscriptions=[]}add(t){return Ho(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ke=e=>e*1e3,Je=e=>e/1e3;function Ja(e,t){return t?e*(1e3/t):0}const Os=new Set;function Go(e,t,n){e||Os.has(t)||(console.warn(io(t,n)),Os.add(t))}const Qa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wd=1e-7,Gd=12;function Kd(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Qa(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>Wd&&++a<Gd);return i}function jn(e,t,n,r){if(e===t&&n===r)return Ue;const o=s=>Kd(s,0,1,e,n);return s=>s===0||s===1?s:Qa(o(s),t,r)}const ec=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tc=e=>t=>1-e(1-t),nc=jn(.33,1.53,.69,.99),Ko=tc(nc),rc=ec(Ko),oc=e=>(e*=2)<1?.5*Ko(e):.5*(2-Math.pow(2,-10*(e-1))),Yo=e=>1-Math.sin(Math.acos(e)),sc=tc(Yo),ic=ec(Yo),Yd=jn(.42,0,1,1),qd=jn(0,0,.58,1),ac=jn(.42,0,.58,1),Xd=e=>Array.isArray(e)&&typeof e[0]!="number",cc=e=>Array.isArray(e)&&typeof e[0]=="number",Ls={linear:Ue,easeIn:Yd,easeInOut:ac,easeOut:qd,circIn:Yo,circInOut:ic,circOut:sc,backIn:Ko,backInOut:rc,backOut:nc,anticipate:oc},Jd=e=>typeof e=="string",_s=e=>{if(cc(e)){at(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return jn(t,n,r,o)}else if(Jd(e))return at(Ls[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ls[e];return e},$n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qd(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(d.schedule(u),e()),u(a)}const d={schedule:(u,f=!1,h=!1)=>{const y=h&&o?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,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),n.clear(),o=!1,s&&(s=!1,d.process(u))}};return d}const eu=40;function lc(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=$n.reduce((T,k)=>(T[k]=Qd(s),T),{}),{setup:a,read:c,resolveKeyframes:d,preUpdate:u,update:f,preRender:h,render:x,postRender:y}=i,m=()=>{const T=ct.useManualTiming?o.timestamp:performance.now();n=!1,ct.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(T-o.timestamp,eu),1)),o.timestamp=T,o.isProcessing=!0,a.process(o),c.process(o),d.process(o),u.process(o),f.process(o),h.process(o),x.process(o),y.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},b=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:$n.reduce((T,k)=>{const S=i[k];return T[k]=(j,P=!1,A=!1)=>(n||b(),S.schedule(j,P,A)),T},{}),cancel:T=>{for(let k=0;k<$n.length;k++)i[$n[k]].cancel(T)},state:o,steps:i}}const{schedule:be,cancel:mt,state:Ve,steps:Mr}=lc(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ue,!0);let Kn;function tu(){Kn=void 0}const Fe={now:()=>(Kn===void 0&&Fe.set(Ve.isProcessing||ct.useManualTiming?Ve.timestamp:performance.now()),Kn),set:e=>{Kn=e,queueMicrotask(tu)}},dc=e=>t=>typeof t=="string"&&t.startsWith(e),qo=dc("--"),nu=dc("var(--"),Xo=e=>nu(e)?ru.test(e.split("/*")[0].trim()):!1,ru=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,en={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wn={...en,transform:e=>it(0,1,e)},Fn={...en,default:1},mn=e=>Math.round(e*1e5)/1e5,Jo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ou(e){return e==null}const su=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qo=(e,t)=>n=>!!(typeof n=="string"&&su.test(n)&&n.startsWith(e)||t&&!ou(n)&&Object.prototype.hasOwnProperty.call(n,t)),uc=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Jo);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},iu=e=>it(0,255,e),Vr={...en,transform:e=>Math.round(iu(e))},kt={test:Qo("rgb","red"),parse:uc("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vr.transform(e)+", "+Vr.transform(t)+", "+Vr.transform(n)+", "+mn(wn.transform(r))+")"};function au(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ao={test:Qo("#"),parse:au,transform:kt.transform},Pn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ft=Pn("deg"),Qe=Pn("%"),ee=Pn("px"),cu=Pn("vh"),lu=Pn("vw"),Bs={...Qe,parse:e=>Qe.parse(e)/100,transform:e=>Qe.transform(e*100)},_t={test:Qo("hsl","hue"),parse:uc("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qe.transform(mn(t))+", "+Qe.transform(mn(n))+", "+mn(wn.transform(r))+")"},je={test:e=>kt.test(e)||ao.test(e)||_t.test(e),parse:e=>kt.test(e)?kt.parse(e):_t.test(e)?_t.parse(e):ao.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kt.transform(e):_t.transform(e),getAnimatableNone:e=>{const t=je.parse(e);return t.alpha=0,je.transform(t)}},du=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uu(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Jo))==null?void 0:t.length)||0)+(((n=e.match(du))==null?void 0:n.length)||0)>0}const fc="number",hc="color",fu="var",hu="var(",zs="${}",mu=/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 Sn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(mu,c=>(je.test(c)?(r.color.push(s),o.push(hc),n.push(je.parse(c))):c.startsWith(hu)?(r.var.push(s),o.push(fu),n.push(c)):(r.number.push(s),o.push(fc),n.push(parseFloat(c))),++s,zs)).split(zs);return{values:n,split:a,indexes:r,types:o}}function mc(e){return Sn(e).values}function gc(e){const{split:t,types:n}=Sn(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===fc?s+=mn(o[i]):a===hc?s+=je.transform(o[i]):s+=o[i]}return s}}const gu=e=>typeof e=="number"?0:je.test(e)?je.getAnimatableNone(e):e;function pu(e){const t=mc(e);return gc(e)(t.map(gu))}const gt={test:uu,parse:mc,createTransformer:gc,getAnimatableNone:pu};function Nr(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 xu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=Nr(c,a,e+1/3),s=Nr(c,a,e),i=Nr(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function tr(e,t){return n=>n>0?t:e}const we=(e,t,n)=>e+(t-e)*n,Rr=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yu=[ao,kt,_t],bu=e=>yu.find(t=>t.test(e));function Hs(e){const t=bu(e);if(Qt(!!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===_t&&(n=xu(n)),n}const Us=(e,t)=>{const n=Hs(e),r=Hs(t);if(!n||!r)return tr(e,t);const o={...n};return s=>(o.red=Rr(n.red,r.red,s),o.green=Rr(n.green,r.green,s),o.blue=Rr(n.blue,r.blue,s),o.alpha=we(n.alpha,r.alpha,s),kt.transform(o))},co=new Set(["none","hidden"]);function vu(e,t){return co.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wu(e,t){return n=>we(e,t,n)}function es(e){return typeof e=="number"?wu:typeof e=="string"?Xo(e)?tr:je.test(e)?Us:Cu:Array.isArray(e)?pc:typeof e=="object"?je.test(e)?Us:Su:tr}function pc(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>es(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Su(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=es(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function ku(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const Cu=(e,t)=>{const n=gt.createTransformer(t),r=Sn(e),o=Sn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?co.has(e)&&!o.values.length||co.has(t)&&!r.values.length?vu(e,t):An(pc(ku(r,o),o.values),n):(Qt(!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"),tr(e,t))};function xc(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?we(e,t,n):es(e)(e,t)}const Eu=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>be.update(t,n),stop:()=>mt(t),now:()=>Ve.isProcessing?Ve.timestamp:Fe.now()}},yc=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},nr=2e4;function ts(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<nr;)t+=n,r=e.next(t);return t>=nr?1/0:t}function Tu(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ts(r),nr);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:Je(o)}}const Au=5;function bc(e,t,n){const r=Math.max(t-Au,0);return Ja(n-e(r),t-r)}const ve={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},Ir=.001;function ju({duration:e=ve.duration,bounce:t=ve.bounce,velocity:n=ve.velocity,mass:r=ve.mass}){let o,s;Qt(e<=Ke(ve.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=it(ve.minDamping,ve.maxDamping,i),e=it(ve.minDuration,ve.maxDuration,Je(e)),i<1?(o=d=>{const u=d*i,f=u*e,h=u-n,x=lo(d,i),y=Math.exp(-f);return Ir-h/x*y},s=d=>{const f=d*i*e,h=f*n+n,x=Math.pow(i,2)*Math.pow(d,2)*e,y=Math.exp(-f),m=lo(Math.pow(d,2),i);return(-o(d)+Ir>0?-1:1)*((h-x)*y)/m}):(o=d=>{const u=Math.exp(-d*e),f=(d-n)*e+1;return-Ir+u*f},s=d=>{const u=Math.exp(-d*e),f=(n-d)*(e*e);return u*f});const a=5/e,c=Mu(o,s,a);if(e=Ke(e),isNaN(c))return{stiffness:ve.stiffness,damping:ve.damping,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const Pu=12;function Mu(e,t,n){let r=n;for(let o=1;o<Pu;o++)r=r-e(r)/t(r);return r}function lo(e,t){return e*Math.sqrt(1-t*t)}const Vu=["duration","bounce"],Nu=["stiffness","damping","mass"];function Zs(e,t){return t.some(n=>e[n]!==void 0)}function Ru(e){let t={velocity:ve.velocity,stiffness:ve.stiffness,damping:ve.damping,mass:ve.mass,isResolvedFromDuration:!1,...e};if(!Zs(e,Nu)&&Zs(e,Vu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*it(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ve.mass,stiffness:o,damping:s}}else{const n=ju(e);t={...t,...n,mass:ve.mass},t.isResolvedFromDuration=!0}return t}function rr(e=ve.visualDuration,t=ve.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:d,mass:u,duration:f,velocity:h,isResolvedFromDuration:x}=Ru({...n,velocity:-Je(n.velocity||0)}),y=h||0,m=d/(2*Math.sqrt(c*u)),b=i-s,C=Je(Math.sqrt(c/u)),v=Math.abs(b)<5;r||(r=v?ve.restSpeed.granular:ve.restSpeed.default),o||(o=v?ve.restDelta.granular:ve.restDelta.default);let T;if(m<1){const S=lo(C,m);T=j=>{const P=Math.exp(-m*C*j);return i-P*((y+m*C*b)/S*Math.sin(S*j)+b*Math.cos(S*j))}}else if(m===1)T=S=>i-Math.exp(-C*S)*(b+(y+C*b)*S);else{const S=C*Math.sqrt(m*m-1);T=j=>{const P=Math.exp(-m*C*j),A=Math.min(S*j,300);return i-P*((y+m*C*b)*Math.sinh(A)+S*b*Math.cosh(A))/S}}const k={calculatedDuration:x&&f||null,next:S=>{const j=T(S);if(x)a.done=S>=f;else{let P=S===0?y:0;m<1&&(P=S===0?Ke(y):bc(T,S,j));const A=Math.abs(P)<=r,_=Math.abs(i-j)<=o;a.done=A&&_}return a.value=a.done?i:j,a},toString:()=>{const S=Math.min(ts(k),nr),j=yc(P=>k.next(S*P).value,S,30);return S+"ms "+j},toTransition:()=>{}};return k}rr.applyToOptions=e=>{const t=Tu(e,100,rr);return e.ease=t.ease,e.duration=Ke(t.duration),e.type="keyframes",e};function uo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:d=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},x=A=>a!==void 0&&A<a||c!==void 0&&A>c,y=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let m=n*t;const b=f+m,C=i===void 0?b:i(b);C!==b&&(m=C-f);const v=A=>-m*Math.exp(-A/r),T=A=>C+v(A),k=A=>{const _=v(A),p=T(A);h.done=Math.abs(_)<=d,h.value=h.done?C:p};let S,j;const P=A=>{x(h.value)&&(S=A,j=rr({keyframes:[h.value,y(h.value)],velocity:bc(T,A,h.value),damping:o,stiffness:s,restDelta:d,restSpeed:u}))};return P(0),{calculatedDuration:null,next:A=>{let _=!1;return!j&&S===void 0&&(_=!0,k(A),P(A)),S!==void 0&&A>=S?j.next(A-S):(!_&&k(A),h)}}}function Iu(e,t,n){const r=[],o=n||ct.mix||xc,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Ue:t;a=An(c,a)}r.push(a)}return r}function Du(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(at(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Iu(t,r,o),c=a.length,d=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=vn(e[f],e[f+1],u);return a[f](h)};return n?u=>d(it(e[0],e[s-1],u)):d}function $u(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=vn(0,t,r);e.push(we(n,1,o))}}function Fu(e){const t=[0];return $u(t,e.length-1),t}function Ou(e,t){return e.map(n=>n*t)}function Lu(e,t){return e.map(()=>t||ac).splice(0,e.length-1)}function Bt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Xd(r)?r.map(_s):_s(r),s={done:!1,value:t[0]},i=Ou(n&&n.length===t.length?n:Fu(t),e),a=Du(i,t,{ease:Array.isArray(o)?o:Lu(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const _u=e=>e!==null;function ns(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(_u),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Bu={decay:uo,inertia:uo,tween:Bt,keyframes:Bt,spring:rr};function vc(e){typeof e.type=="string"&&(e.type=Bu[e.type])}class rs{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 zu=e=>e/100;class os extends rs{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,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Fe.now()&&this.tick(Fe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vc(t);const{type:n=Bt,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Bt;process.env.NODE_ENV!=="production"&&c!==Bt&&at(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Bt&&typeof a[0]!="number"&&(this.mixKeyframes=An(zu,xc(a[0],a[1])),a=[0,100]);const d=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=ts(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=d}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:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:x,type:y,onUpdate:m,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const C=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?C<0:C>o;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let T=this.currentTime,k=r;if(f){const A=Math.min(this.currentTime,o)/a;let _=Math.floor(A),p=A%1;!p&&A>=1&&(p=1),p===1&&_--,_=Math.min(_,f+1),!!(_%2)&&(h==="reverse"?(p=1-p,x&&(p-=x/a)):h==="mirror"&&(k=i)),T=it(0,1,p)*a}const S=v?{done:!1,value:u[0]}:k.next(T);s&&(S.value=s(S.value));let{done:j}=S;!v&&c!==null&&(j=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return P&&y!==uo&&(S.value=ns(u,this.options,b,this.speed)),m&&m(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Je(this.calculatedDuration)}get time(){return Je(this.currentTime)}set time(t){var n;t=Ke(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(Fe.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Je(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Eu,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);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(Fe.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 Hu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ct=e=>e*180/Math.PI,fo=e=>{const t=Ct(Math.atan2(e[1],e[0]));return ho(t)},Uu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fo,rotateZ:fo,skewX:e=>Ct(Math.atan(e[1])),skewY:e=>Ct(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ho=e=>(e=e%360,e<0&&(e+=360),e),Ws=fo,Gs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ks=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Zu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gs,scaleY:Ks,scale:e=>(Gs(e)+Ks(e))/2,rotateX:e=>ho(Ct(Math.atan2(e[6],e[5]))),rotateY:e=>ho(Ct(Math.atan2(-e[2],e[0]))),rotateZ:Ws,rotate:Ws,skewX:e=>Ct(Math.atan(e[4])),skewY:e=>Ct(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mo(e){return e.includes("scale")?1:0}function go(e,t){if(!e||e==="none")return mo(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Zu,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Uu,o=a}if(!o)return mo(t);const s=r[t],i=o[1].split(",").map(Gu);return typeof s=="function"?s(i):i[s]}const Wu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return go(n,t)};function Gu(e){return parseFloat(e.trim())}const tn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nn=new Set(tn),Ys=e=>e===en||e===ee,Ku=new Set(["x","y","z"]),Yu=tn.filter(e=>!Ku.has(e));function qu(e){const t=[];return Yu.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tt={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})=>go(t,"x"),y:(e,{transform:t})=>go(t,"y")};Tt.translateX=Tt.x;Tt.translateY=Tt.y;const At=new Set;let po=!1,xo=!1,yo=!1;function wc(){if(xo){const e=Array.from(At).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=qu(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xo=!1,po=!1,At.forEach(e=>e.complete(yo)),At.clear()}function Sc(){At.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xo=!0)})}function Xu(){yo=!0,Sc(),wc(),yo=!1}class ss{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(At.add(this),po||(po=!0,be.read(Sc),be.resolveKeyframes(wc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}Hu(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),At.delete(this)}cancel(){this.state==="scheduled"&&(At.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ju=e=>e.startsWith("--");function Qu(e,t,n){Ju(t)?e.style.setProperty(t,n):e.style[t]=n}const ef=Zo(()=>window.ScrollTimeline!==void 0),tf={};function nf(e,t){const n=Zo(e);return()=>tf[t]??n()}const kc=nf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),un=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function Cc(e,t){if(e)return typeof e=="function"?kc()?yc(e,t):"ease-out":cc(e)?un(e):Array.isArray(e)?e.map(n=>Cc(n,t)||qs.easeOut):qs[e]}function rf(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},d=void 0){const u={[t]:n};c&&(u.offset=c);const f=Cc(a,o);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return d&&(h.pseudoElement=d),e.animate(u,h)}function Ec(e){return typeof e=="function"&&"applyToOptions"in e}function of({type:e,...t}){return Ec(e)&&kc()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sf extends rs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,at(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=of(t);this.animation=rf(n,r,o,d,s),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=ns(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Qu(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 Je(Number(t))}get time(){return Je(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ke(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&&ef()?(this.animation.timeline=t,Ue):n(this)}}const Tc={anticipate:oc,backInOut:rc,circInOut:ic};function af(e){return e in Tc}function cf(e){typeof e.ease=="string"&&af(e.ease)&&(e.ease=Tc[e.ease])}const Xs=10;class lf extends sf{constructor(t){cf(t),vc(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new os({...i,autoplay:!1}),c=Ke(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Xs).value,a.sample(c).value,Xs),a.stop()}}const Js=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(gt.test(e)||e==="0")&&!e.startsWith("url("));function df(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 uf(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Js(o,t),a=Js(s,t);return Qt(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:df(e)||(n==="spring"||Ec(n))&&r}function bo(e){e.duration=0,e.type}const ff=new Set(["opacity","clipPath","filter","transform"]),hf=Zo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mf(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return hf()&&n&&ff.has(n)&&(n!=="transform"||!d)&&!c&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const gf=40;class pf extends rs{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:d,element:u,...f}){var y;super(),this.stop=()=>{var m,b;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Fe.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:d,element:u,...f},x=(u==null?void 0:u.KeyframeResolver)||ss;this.keyframeResolver=new x(a,(m,b,C)=>this.onKeyframesResolved(m,b,h,!C),c,d,u),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:d,onUpdate:u}=r;this.resolvedAt=Fe.now(),uf(t,s,i,a)||((ct.instantAnimations||!c)&&(u==null||u(ns(t,r,n))),t[0]=t[t.length-1],bo(r),r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>gf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=!d&&mf(h)?new lf({...h,element:h.motionValue.owner.current}):new os(h);x.finished.then(()=>this.notifyFinished()).catch(Ue),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),Xu()),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 xf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yf(e){const t=xf.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const bf=4;function Ac(e,t,n=1){at(n<=bf,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=yf(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Ya(i)?parseFloat(i):i}return Xo(o)?Ac(o,t,n+1):o}function is(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const jc=new Set(["width","height","top","left","right","bottom",...tn]),vf={test:e=>e==="auto",parse:e=>e},Pc=e=>t=>t.test(e),Mc=[en,ee,Qe,ft,lu,cu,vf],Qs=e=>Mc.find(Pc(e));function wf(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xa(e):!0}const Sf=new Set(["brightness","contrast","saturate","opacity"]);function kf(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Jo)||[];if(!r)return e;const o=n.replace(r,"");let s=Sf.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const Cf=/\b([a-z-]*)\(.*?\)/gu,vo={...gt,getAnimatableNone:e=>{const t=e.match(Cf);return t?t.map(kf).join(" "):e}},ei={...en,transform:Math.round},Ef={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:Fn,scaleX:Fn,scaleY:Fn,scaleZ:Fn,skew:ft,skewX:ft,skewY:ft,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:wn,originX:Bs,originY:Bs,originZ:ee},as={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee,...Ef,zIndex:ei,fillOpacity:wn,strokeOpacity:wn,numOctaves:ei},Tf={...as,color:je,backgroundColor:je,outlineColor:je,fill:je,stroke:je,borderColor:je,borderTopColor:je,borderRightColor:je,borderBottomColor:je,borderLeftColor:je,filter:vo,WebkitFilter:vo},Vc=e=>Tf[e];function Nc(e,t){let n=Vc(e);return n!==vo&&(n=gt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Af=new Set(["auto","none","0"]);function jf(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!Af.has(s)&&Sn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Nc(n,o)}class Pf extends ss{constructor(t,n,r,o,s){super(t,n,r,o,s,!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 d=t[c];if(typeof d=="string"&&(d=d.trim(),Xo(d))){const u=Ac(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!jc.has(r)||t.length!==2)return;const[o,s]=t,i=Qs(o),a=Qs(s);if(i!==a)if(Ys(i)&&Ys(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else Tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||wf(t[o]))&&r.push(o);r.length&&jf(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=Tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Tt[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,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function Mf(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Rc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Ic(e){return qa(e)&&"offsetHeight"in e}const ti=30,Vf=e=>!isNaN(parseFloat(e));class Nf{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Fe.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.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=Fe.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vf(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Go(!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 Wo);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=Fe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ti)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ti);return Ja(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 Yt(e,t){return new Nf(e,t)}const{schedule:cs}=lc(queueMicrotask,!1),Ge={x:!1,y:!1};function Dc(){return Ge.x||Ge.y}function Rf(e){return e==="x"||e==="y"?Ge[e]?null:(Ge[e]=!0,()=>{Ge[e]=!1}):Ge.x||Ge.y?null:(Ge.x=Ge.y=!0,()=>{Ge.x=Ge.y=!1})}function $c(e,t){const n=Mf(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ni(e){return!(e.pointerType==="touch"||Dc())}function If(e,t,n={}){const[r,o,s]=$c(e,n),i=a=>{if(!ni(a))return;const{target:c}=a,d=t(c,a);if(typeof d!="function"||!c)return;const u=f=>{ni(f)&&(d(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const Fc=(e,t)=>t?e===t?!0:Fc(e,t.parentElement):!1,ls=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Df=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $f(e){return Df.has(e.tagName)||e.tabIndex!==-1}const Yn=new WeakSet;function ri(e){return t=>{t.key==="Enter"&&e(t)}}function Dr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ff=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ri(()=>{if(Yn.has(n))return;Dr(n,"down");const o=ri(()=>{Dr(n,"up")}),s=()=>Dr(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function oi(e){return ls(e)&&!Dc()}function Of(e,t,n={}){const[r,o,s]=$c(e,n),i=a=>{const c=a.currentTarget;if(!oi(a))return;Yn.add(c);const d=t(c,a),u=(x,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Yn.has(c)&&Yn.delete(c),oi(x)&&typeof d=="function"&&d(x,{success:y})},f=x=>{u(x,c===window||c===document||n.useGlobalTarget||Fc(c,x.target))},h=x=>{u(x,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Ic(a)&&(a.addEventListener("focus",d=>Ff(d,o)),!$f(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Oc(e){return qa(e)&&"ownerSVGElement"in e}function Lf(e){return Oc(e)&&e.tagName==="svg"}const De=e=>!!(e&&e.getVelocity),_f=[...Mc,je,gt],Bf=e=>_f.find(Pc(e)),ds=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zf extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Ic(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Hf({children:e,isPresent:t,anchorX:n,root:r}){const o=w.useId(),s=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=w.useContext(ds);return w.useInsertionEffect(()=>{const{width:c,height:d,top:u,left:f,right:h}=i.current;if(t||!s.current||!c||!d)return;const x=n==="left"?`left: ${f}`:`right: ${h}`;s.current.dataset.motionPopId=o;const y=document.createElement("style");a&&(y.nonce=a);const m=r??document.head;return m.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
1
|
+
"use strict";var Od=Object.defineProperty;var Ld=(e,t,n)=>t in e?Od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>Ld(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("react"),c=require("react/jsx-runtime"),H=require("livekit-client"),Ie=require("@livekit/components-react"),Fo=require("class-variance-authority"),Oo=require("clsx"),_d=require("@radix-ui/react-toggle"),Bd=require("@radix-ui/react-select"),Pe=require("lucide-react"),zd=require("@emotion/styled");require("@emotion/react");const Hd=require("react-dom/client");function Lo(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 g=Lo(w),Ud=Lo(_d),He=Lo(Bd),_o=w.createContext({});function Bo(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const zo=typeof window<"u",Ka=zo?w.useLayoutEffect:w.useEffect,dr=w.createContext(null);function Ho(e,t){e.indexOf(t)===-1&&e.push(t)}function Uo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const it=(e,t,n)=>n>t?t:n<e?e:n;function io(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Qt=()=>{},at=()=>{};process.env.NODE_ENV!=="production"&&(Qt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(io(t,n))},at=(e,t,n)=>{if(!e)throw new Error(io(t,n))});const lt={},Ya=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qa(e){return typeof e=="object"&&e!==null}const Xa=e=>/^0[^.\s]+$/u.test(e);function Zo(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ue=e=>e,Zd=(e,t)=>n=>t(e(n)),An=(...e)=>e.reduce(Zd),vn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wo{constructor(){this.subscriptions=[]}add(t){return Ho(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ke=e=>e*1e3,Je=e=>e/1e3;function Ja(e,t){return t?e*(1e3/t):0}const Os=new Set;function Go(e,t,n){e||Os.has(t)||(console.warn(io(t,n)),Os.add(t))}const Qa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wd=1e-7,Gd=12;function Kd(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Qa(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>Wd&&++a<Gd);return i}function jn(e,t,n,r){if(e===t&&n===r)return Ue;const o=s=>Kd(s,0,1,e,n);return s=>s===0||s===1?s:Qa(o(s),t,r)}const el=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tl=e=>t=>1-e(1-t),nl=jn(.33,1.53,.69,.99),Ko=tl(nl),rl=el(Ko),ol=e=>(e*=2)<1?.5*Ko(e):.5*(2-Math.pow(2,-10*(e-1))),Yo=e=>1-Math.sin(Math.acos(e)),sl=tl(Yo),il=el(Yo),Yd=jn(.42,0,1,1),qd=jn(0,0,.58,1),al=jn(.42,0,.58,1),Xd=e=>Array.isArray(e)&&typeof e[0]!="number",ll=e=>Array.isArray(e)&&typeof e[0]=="number",Ls={linear:Ue,easeIn:Yd,easeInOut:al,easeOut:qd,circIn:Yo,circInOut:il,circOut:sl,backIn:Ko,backInOut:rl,backOut:nl,anticipate:ol},Jd=e=>typeof e=="string",_s=e=>{if(ll(e)){at(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return jn(t,n,r,o)}else if(Jd(e))return at(Ls[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ls[e];return e},$n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qd(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){i.has(u)&&(d.schedule(u),e()),u(a)}const d={schedule:(u,f=!1,h=!1)=>{const b=h&&o?n:r;return f&&i.add(u),b.has(u)||b.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,s&&(s=!1,d.process(u))}};return d}const eu=40;function cl(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=$n.reduce((T,k)=>(T[k]=Qd(s),T),{}),{setup:a,read:l,resolveKeyframes:d,preUpdate:u,update:f,preRender:h,render:x,postRender:b}=i,m=()=>{const T=lt.useManualTiming?o.timestamp:performance.now();n=!1,lt.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(T-o.timestamp,eu),1)),o.timestamp=T,o.isProcessing=!0,a.process(o),l.process(o),d.process(o),u.process(o),f.process(o),h.process(o),x.process(o),b.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:$n.reduce((T,k)=>{const S=i[k];return T[k]=(j,P=!1,A=!1)=>(n||y(),S.schedule(j,P,A)),T},{}),cancel:T=>{for(let k=0;k<$n.length;k++)i[$n[k]].cancel(T)},state:o,steps:i}}const{schedule:ye,cancel:mt,state:Ve,steps:Mr}=cl(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ue,!0);let Kn;function tu(){Kn=void 0}const Fe={now:()=>(Kn===void 0&&Fe.set(Ve.isProcessing||lt.useManualTiming?Ve.timestamp:performance.now()),Kn),set:e=>{Kn=e,queueMicrotask(tu)}},dl=e=>t=>typeof t=="string"&&t.startsWith(e),qo=dl("--"),nu=dl("var(--"),Xo=e=>nu(e)?ru.test(e.split("/*")[0].trim()):!1,ru=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,en={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wn={...en,transform:e=>it(0,1,e)},Fn={...en,default:1},mn=e=>Math.round(e*1e5)/1e5,Jo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ou(e){return e==null}const su=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qo=(e,t)=>n=>!!(typeof n=="string"&&su.test(n)&&n.startsWith(e)||t&&!ou(n)&&Object.prototype.hasOwnProperty.call(n,t)),ul=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Jo);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},iu=e=>it(0,255,e),Vr={...en,transform:e=>Math.round(iu(e))},kt={test:Qo("rgb","red"),parse:ul("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vr.transform(e)+", "+Vr.transform(t)+", "+Vr.transform(n)+", "+mn(wn.transform(r))+")"};function au(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ao={test:Qo("#"),parse:au,transform:kt.transform},Pn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ft=Pn("deg"),Qe=Pn("%"),ee=Pn("px"),lu=Pn("vh"),cu=Pn("vw"),Bs={...Qe,parse:e=>Qe.parse(e)/100,transform:e=>Qe.transform(e*100)},_t={test:Qo("hsl","hue"),parse:ul("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qe.transform(mn(t))+", "+Qe.transform(mn(n))+", "+mn(wn.transform(r))+")"},je={test:e=>kt.test(e)||ao.test(e)||_t.test(e),parse:e=>kt.test(e)?kt.parse(e):_t.test(e)?_t.parse(e):ao.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kt.transform(e):_t.transform(e),getAnimatableNone:e=>{const t=je.parse(e);return t.alpha=0,je.transform(t)}},du=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uu(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Jo))==null?void 0:t.length)||0)+(((n=e.match(du))==null?void 0:n.length)||0)>0}const fl="number",hl="color",fu="var",hu="var(",zs="${}",mu=/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 Sn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(mu,l=>(je.test(l)?(r.color.push(s),o.push(hl),n.push(je.parse(l))):l.startsWith(hu)?(r.var.push(s),o.push(fu),n.push(l)):(r.number.push(s),o.push(fl),n.push(parseFloat(l))),++s,zs)).split(zs);return{values:n,split:a,indexes:r,types:o}}function ml(e){return Sn(e).values}function gl(e){const{split:t,types:n}=Sn(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===fl?s+=mn(o[i]):a===hl?s+=je.transform(o[i]):s+=o[i]}return s}}const gu=e=>typeof e=="number"?0:je.test(e)?je.getAnimatableNone(e):e;function pu(e){const t=ml(e);return gl(e)(t.map(gu))}const gt={test:uu,parse:ml,createTransformer:gl,getAnimatableNone:pu};function Nr(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 xu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Nr(l,a,e+1/3),s=Nr(l,a,e),i=Nr(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function tr(e,t){return n=>n>0?t:e}const we=(e,t,n)=>e+(t-e)*n,Rr=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},bu=[ao,kt,_t],yu=e=>bu.find(t=>t.test(e));function Hs(e){const t=yu(e);if(Qt(!!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===_t&&(n=xu(n)),n}const Us=(e,t)=>{const n=Hs(e),r=Hs(t);if(!n||!r)return tr(e,t);const o={...n};return s=>(o.red=Rr(n.red,r.red,s),o.green=Rr(n.green,r.green,s),o.blue=Rr(n.blue,r.blue,s),o.alpha=we(n.alpha,r.alpha,s),kt.transform(o))},lo=new Set(["none","hidden"]);function vu(e,t){return lo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wu(e,t){return n=>we(e,t,n)}function es(e){return typeof e=="number"?wu:typeof e=="string"?Xo(e)?tr:je.test(e)?Us:Cu:Array.isArray(e)?pl:typeof e=="object"?je.test(e)?Us:Su:tr}function pl(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>es(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Su(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=es(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function ku(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const Cu=(e,t)=>{const n=gt.createTransformer(t),r=Sn(e),o=Sn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?lo.has(e)&&!o.values.length||lo.has(t)&&!r.values.length?vu(e,t):An(pl(ku(r,o),o.values),n):(Qt(!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"),tr(e,t))};function xl(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?we(e,t,n):es(e)(e,t)}const Eu=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>mt(t),now:()=>Ve.isProcessing?Ve.timestamp:Fe.now()}},bl=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},nr=2e4;function ts(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<nr;)t+=n,r=e.next(t);return t>=nr?1/0:t}function Tu(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ts(r),nr);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:Je(o)}}const Au=5;function yl(e,t,n){const r=Math.max(t-Au,0);return Ja(n-e(r),t-r)}const ve={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},Ir=.001;function ju({duration:e=ve.duration,bounce:t=ve.bounce,velocity:n=ve.velocity,mass:r=ve.mass}){let o,s;Qt(e<=Ke(ve.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=it(ve.minDamping,ve.maxDamping,i),e=it(ve.minDuration,ve.maxDuration,Je(e)),i<1?(o=d=>{const u=d*i,f=u*e,h=u-n,x=co(d,i),b=Math.exp(-f);return Ir-h/x*b},s=d=>{const f=d*i*e,h=f*n+n,x=Math.pow(i,2)*Math.pow(d,2)*e,b=Math.exp(-f),m=co(Math.pow(d,2),i);return(-o(d)+Ir>0?-1:1)*((h-x)*b)/m}):(o=d=>{const u=Math.exp(-d*e),f=(d-n)*e+1;return-Ir+u*f},s=d=>{const u=Math.exp(-d*e),f=(n-d)*(e*e);return u*f});const a=5/e,l=Mu(o,s,a);if(e=Ke(e),isNaN(l))return{stiffness:ve.stiffness,damping:ve.damping,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const Pu=12;function Mu(e,t,n){let r=n;for(let o=1;o<Pu;o++)r=r-e(r)/t(r);return r}function co(e,t){return e*Math.sqrt(1-t*t)}const Vu=["duration","bounce"],Nu=["stiffness","damping","mass"];function Zs(e,t){return t.some(n=>e[n]!==void 0)}function Ru(e){let t={velocity:ve.velocity,stiffness:ve.stiffness,damping:ve.damping,mass:ve.mass,isResolvedFromDuration:!1,...e};if(!Zs(e,Nu)&&Zs(e,Vu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*it(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ve.mass,stiffness:o,damping:s}}else{const n=ju(e);t={...t,...n,mass:ve.mass},t.isResolvedFromDuration=!0}return t}function rr(e=ve.visualDuration,t=ve.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:d,mass:u,duration:f,velocity:h,isResolvedFromDuration:x}=Ru({...n,velocity:-Je(n.velocity||0)}),b=h||0,m=d/(2*Math.sqrt(l*u)),y=i-s,C=Je(Math.sqrt(l/u)),v=Math.abs(y)<5;r||(r=v?ve.restSpeed.granular:ve.restSpeed.default),o||(o=v?ve.restDelta.granular:ve.restDelta.default);let T;if(m<1){const S=co(C,m);T=j=>{const P=Math.exp(-m*C*j);return i-P*((b+m*C*y)/S*Math.sin(S*j)+y*Math.cos(S*j))}}else if(m===1)T=S=>i-Math.exp(-C*S)*(y+(b+C*y)*S);else{const S=C*Math.sqrt(m*m-1);T=j=>{const P=Math.exp(-m*C*j),A=Math.min(S*j,300);return i-P*((b+m*C*y)*Math.sinh(A)+S*y*Math.cosh(A))/S}}const k={calculatedDuration:x&&f||null,next:S=>{const j=T(S);if(x)a.done=S>=f;else{let P=S===0?b:0;m<1&&(P=S===0?Ke(b):yl(T,S,j));const A=Math.abs(P)<=r,_=Math.abs(i-j)<=o;a.done=A&&_}return a.value=a.done?i:j,a},toString:()=>{const S=Math.min(ts(k),nr),j=bl(P=>k.next(S*P).value,S,30);return S+"ms "+j},toTransition:()=>{}};return k}rr.applyToOptions=e=>{const t=Tu(e,100,rr);return e.ease=t.ease,e.duration=Ke(t.duration),e.type="keyframes",e};function uo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:d=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},x=A=>a!==void 0&&A<a||l!==void 0&&A>l,b=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let m=n*t;const y=f+m,C=i===void 0?y:i(y);C!==y&&(m=C-f);const v=A=>-m*Math.exp(-A/r),T=A=>C+v(A),k=A=>{const _=v(A),p=T(A);h.done=Math.abs(_)<=d,h.value=h.done?C:p};let S,j;const P=A=>{x(h.value)&&(S=A,j=rr({keyframes:[h.value,b(h.value)],velocity:yl(T,A,h.value),damping:o,stiffness:s,restDelta:d,restSpeed:u}))};return P(0),{calculatedDuration:null,next:A=>{let _=!1;return!j&&S===void 0&&(_=!0,k(A),P(A)),S!==void 0&&A>=S?j.next(A-S):(!_&&k(A),h)}}}function Iu(e,t,n){const r=[],o=n||lt.mix||xl,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Ue:t;a=An(l,a)}r.push(a)}return r}function Du(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(at(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Iu(t,r,o),l=a.length,d=u=>{if(i&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=vn(e[f],e[f+1],u);return a[f](h)};return n?u=>d(it(e[0],e[s-1],u)):d}function $u(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=vn(0,t,r);e.push(we(n,1,o))}}function Fu(e){const t=[0];return $u(t,e.length-1),t}function Ou(e,t){return e.map(n=>n*t)}function Lu(e,t){return e.map(()=>t||al).splice(0,e.length-1)}function Bt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Xd(r)?r.map(_s):_s(r),s={done:!1,value:t[0]},i=Ou(n&&n.length===t.length?n:Fu(t),e),a=Du(i,t,{ease:Array.isArray(o)?o:Lu(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const _u=e=>e!==null;function ns(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(_u),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Bu={decay:uo,inertia:uo,tween:Bt,keyframes:Bt,spring:rr};function vl(e){typeof e.type=="string"&&(e.type=Bu[e.type])}class rs{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 zu=e=>e/100;class os extends rs{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,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Fe.now()&&this.tick(Fe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vl(t);const{type:n=Bt,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const l=n||Bt;process.env.NODE_ENV!=="production"&&l!==Bt&&at(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==Bt&&typeof a[0]!="number"&&(this.mixKeyframes=An(zu,xl(a[0],a[1])),a=[0,100]);const d=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=ts(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=d}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:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:x,type:b,onUpdate:m,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const C=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?C<0:C>o;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let T=this.currentTime,k=r;if(f){const A=Math.min(this.currentTime,o)/a;let _=Math.floor(A),p=A%1;!p&&A>=1&&(p=1),p===1&&_--,_=Math.min(_,f+1),!!(_%2)&&(h==="reverse"?(p=1-p,x&&(p-=x/a)):h==="mirror"&&(k=i)),T=it(0,1,p)*a}const S=v?{done:!1,value:u[0]}:k.next(T);s&&(S.value=s(S.value));let{done:j}=S;!v&&l!==null&&(j=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return P&&b!==uo&&(S.value=ns(u,this.options,y,this.speed)),m&&m(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Je(this.calculatedDuration)}get time(){return Je(this.currentTime)}set time(t){var n;t=Ke(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(Fe.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Je(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Eu,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);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(Fe.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 Hu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ct=e=>e*180/Math.PI,fo=e=>{const t=Ct(Math.atan2(e[1],e[0]));return ho(t)},Uu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fo,rotateZ:fo,skewX:e=>Ct(Math.atan(e[1])),skewY:e=>Ct(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ho=e=>(e=e%360,e<0&&(e+=360),e),Ws=fo,Gs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ks=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Zu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gs,scaleY:Ks,scale:e=>(Gs(e)+Ks(e))/2,rotateX:e=>ho(Ct(Math.atan2(e[6],e[5]))),rotateY:e=>ho(Ct(Math.atan2(-e[2],e[0]))),rotateZ:Ws,rotate:Ws,skewX:e=>Ct(Math.atan(e[4])),skewY:e=>Ct(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mo(e){return e.includes("scale")?1:0}function go(e,t){if(!e||e==="none")return mo(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Zu,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Uu,o=a}if(!o)return mo(t);const s=r[t],i=o[1].split(",").map(Gu);return typeof s=="function"?s(i):i[s]}const Wu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return go(n,t)};function Gu(e){return parseFloat(e.trim())}const tn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nn=new Set(tn),Ys=e=>e===en||e===ee,Ku=new Set(["x","y","z"]),Yu=tn.filter(e=>!Ku.has(e));function qu(e){const t=[];return Yu.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tt={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})=>go(t,"x"),y:(e,{transform:t})=>go(t,"y")};Tt.translateX=Tt.x;Tt.translateY=Tt.y;const At=new Set;let po=!1,xo=!1,bo=!1;function wl(){if(xo){const e=Array.from(At).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=qu(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xo=!1,po=!1,At.forEach(e=>e.complete(bo)),At.clear()}function Sl(){At.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xo=!0)})}function Xu(){bo=!0,Sl(),wl(),bo=!1}class ss{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(At.add(this),po||(po=!0,ye.read(Sl),ye.resolveKeyframes(wl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}Hu(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),At.delete(this)}cancel(){this.state==="scheduled"&&(At.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ju=e=>e.startsWith("--");function Qu(e,t,n){Ju(t)?e.style.setProperty(t,n):e.style[t]=n}const ef=Zo(()=>window.ScrollTimeline!==void 0),tf={};function nf(e,t){const n=Zo(e);return()=>tf[t]??n()}const kl=nf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),un=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function Cl(e,t){if(e)return typeof e=="function"?kl()?bl(e,t):"ease-out":ll(e)?un(e):Array.isArray(e)?e.map(n=>Cl(n,t)||qs.easeOut):qs[e]}function rf(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:l}={},d=void 0){const u={[t]:n};l&&(u.offset=l);const f=Cl(a,o);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return d&&(h.pseudoElement=d),e.animate(u,h)}function El(e){return typeof e=="function"&&"applyToOptions"in e}function of({type:e,...t}){return El(e)&&kl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sf extends rs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,at(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=of(t);this.animation=rf(n,r,o,d,s),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=ns(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Qu(n,r,u),this.animation.cancel()}l==null||l(),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 Je(Number(t))}get time(){return Je(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ke(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&&ef()?(this.animation.timeline=t,Ue):n(this)}}const Tl={anticipate:ol,backInOut:rl,circInOut:il};function af(e){return e in Tl}function lf(e){typeof e.ease=="string"&&af(e.ease)&&(e.ease=Tl[e.ease])}const Xs=10;class cf extends sf{constructor(t){lf(t),vl(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new os({...i,autoplay:!1}),l=Ke(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Xs).value,a.sample(l).value,Xs),a.stop()}}const Js=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(gt.test(e)||e==="0")&&!e.startsWith("url("));function df(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 uf(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Js(o,t),a=Js(s,t);return Qt(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:df(e)||(n==="spring"||El(n))&&r}function yo(e){e.duration=0,e.type}const ff=new Set(["opacity","clipPath","filter","transform"]),hf=Zo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mf(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:d}=t.owner.getProps();return hf()&&n&&ff.has(n)&&(n!=="transform"||!d)&&!l&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const gf=40;class pf extends rs{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:l,motionValue:d,element:u,...f}){var b;super(),this.stop=()=>{var m,y;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Fe.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:l,motionValue:d,element:u,...f},x=(u==null?void 0:u.KeyframeResolver)||ss;this.keyframeResolver=new x(a,(m,y,C)=>this.onKeyframesResolved(m,y,h,!C),l,d,u),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:l,isHandoff:d,onUpdate:u}=r;this.resolvedAt=Fe.now(),uf(t,s,i,a)||((lt.instantAnimations||!l)&&(u==null||u(ns(t,r,n))),t[0]=t[t.length-1],yo(r),r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>gf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=!d&&mf(h)?new cf({...h,element:h.motionValue.owner.current}):new os(h);x.finished.then(()=>this.notifyFinished()).catch(Ue),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),Xu()),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 xf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bf(e){const t=xf.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const yf=4;function Al(e,t,n=1){at(n<=yf,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=bf(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Ya(i)?parseFloat(i):i}return Xo(o)?Al(o,t,n+1):o}function is(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const jl=new Set(["width","height","top","left","right","bottom",...tn]),vf={test:e=>e==="auto",parse:e=>e},Pl=e=>t=>t.test(e),Ml=[en,ee,Qe,ft,cu,lu,vf],Qs=e=>Ml.find(Pl(e));function wf(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xa(e):!0}const Sf=new Set(["brightness","contrast","saturate","opacity"]);function kf(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Jo)||[];if(!r)return e;const o=n.replace(r,"");let s=Sf.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const Cf=/\b([a-z-]*)\(.*?\)/gu,vo={...gt,getAnimatableNone:e=>{const t=e.match(Cf);return t?t.map(kf).join(" "):e}},ei={...en,transform:Math.round},Ef={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:Fn,scaleX:Fn,scaleY:Fn,scaleZ:Fn,skew:ft,skewX:ft,skewY:ft,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:wn,originX:Bs,originY:Bs,originZ:ee},as={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee,...Ef,zIndex:ei,fillOpacity:wn,strokeOpacity:wn,numOctaves:ei},Tf={...as,color:je,backgroundColor:je,outlineColor:je,fill:je,stroke:je,borderColor:je,borderTopColor:je,borderRightColor:je,borderBottomColor:je,borderLeftColor:je,filter:vo,WebkitFilter:vo},Vl=e=>Tf[e];function Nl(e,t){let n=Vl(e);return n!==vo&&(n=gt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Af=new Set(["auto","none","0"]);function jf(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!Af.has(s)&&Sn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Nl(n,o)}class Pf extends ss{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let d=t[l];if(typeof d=="string"&&(d=d.trim(),Xo(d))){const u=Al(d,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!jl.has(r)||t.length!==2)return;const[o,s]=t,i=Qs(o),a=Qs(s);if(i!==a)if(Ys(i)&&Ys(a))for(let l=0;l<t.length;l++){const d=t[l];typeof d=="string"&&(t[l]=parseFloat(d))}else Tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||wf(t[o]))&&r.push(o);r.length&&jf(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=Tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Tt[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(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Mf(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Rl=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Il(e){return qa(e)&&"offsetHeight"in e}const ti=30,Vf=e=>!isNaN(parseFloat(e));class Nf{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Fe.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.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=Fe.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vf(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Go(!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 Wo);const r=this.events[t].add(n);return t==="change"?()=>{r(),ye.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=Fe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ti)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ti);return Ja(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 Yt(e,t){return new Nf(e,t)}const{schedule:ls}=cl(queueMicrotask,!1),Ge={x:!1,y:!1};function Dl(){return Ge.x||Ge.y}function Rf(e){return e==="x"||e==="y"?Ge[e]?null:(Ge[e]=!0,()=>{Ge[e]=!1}):Ge.x||Ge.y?null:(Ge.x=Ge.y=!0,()=>{Ge.x=Ge.y=!1})}function $l(e,t){const n=Mf(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ni(e){return!(e.pointerType==="touch"||Dl())}function If(e,t,n={}){const[r,o,s]=$l(e,n),i=a=>{if(!ni(a))return;const{target:l}=a,d=t(l,a);if(typeof d!="function"||!l)return;const u=f=>{ni(f)&&(d(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const Fl=(e,t)=>t?e===t?!0:Fl(e,t.parentElement):!1,cs=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Df=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $f(e){return Df.has(e.tagName)||e.tabIndex!==-1}const Yn=new WeakSet;function ri(e){return t=>{t.key==="Enter"&&e(t)}}function Dr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ff=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ri(()=>{if(Yn.has(n))return;Dr(n,"down");const o=ri(()=>{Dr(n,"up")}),s=()=>Dr(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function oi(e){return cs(e)&&!Dl()}function Of(e,t,n={}){const[r,o,s]=$l(e,n),i=a=>{const l=a.currentTarget;if(!oi(a))return;Yn.add(l);const d=t(l,a),u=(x,b)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Yn.has(l)&&Yn.delete(l),oi(x)&&typeof d=="function"&&d(x,{success:b})},f=x=>{u(x,l===window||l===document||n.useGlobalTarget||Fl(l,x.target))},h=x=>{u(x,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Il(a)&&(a.addEventListener("focus",d=>Ff(d,o)),!$f(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Ol(e){return qa(e)&&"ownerSVGElement"in e}function Lf(e){return Ol(e)&&e.tagName==="svg"}const De=e=>!!(e&&e.getVelocity),_f=[...Ml,je,gt],Bf=e=>_f.find(Pl(e)),ds=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zf extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Il(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Hf({children:e,isPresent:t,anchorX:n,root:r}){const o=w.useId(),s=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=w.useContext(ds);return w.useInsertionEffect(()=>{const{width:l,height:d,top:u,left:f,right:h}=i.current;if(t||!s.current||!l||!d)return;const x=n==="left"?`left: ${f}`:`right: ${h}`;s.current.dataset.motionPopId=o;const b=document.createElement("style");a&&(b.nonce=a);const m=r??document.head;return m.appendChild(b),b.sheet&&b.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${o}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
|
-
width: ${
|
|
4
|
+
width: ${l}px !important;
|
|
5
5
|
height: ${d}px !important;
|
|
6
6
|
${x}px !important;
|
|
7
7
|
top: ${u}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{m.contains(y)&&m.removeChild(y)}},[t]),l.jsx(zf,{isPresent:t,childRef:s,sizeRef:i,children:g.cloneElement(e,{ref:s})})}const Uf=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,root:c})=>{const d=Bo(Zf),u=w.useId();let f=!0,h=w.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:x=>{d.set(x,!0);for(const y of d.values())if(!y)return;r&&r()},register:x=>(d.set(x,!1),()=>d.delete(x))}),[n,d,r]);return s&&f&&(h={...h}),w.useMemo(()=>{d.forEach((x,y)=>d.set(y,!1))},[n]),g.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),i==="popLayout"&&(e=l.jsx(Hf,{isPresent:n,anchorX:a,root:c,children:e})),l.jsx(dr.Provider,{value:h,children:e})};function Zf(){return new Map}function Lc(e=!0){const t=w.useContext(dr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const On=e=>e.key||"";function si(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const Wt=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[d,u]=Lc(i),f=w.useMemo(()=>si(e),[e]),h=i&&!d?[]:f.map(On),x=w.useRef(!0),y=w.useRef(f),m=Bo(()=>new Map),[b,C]=w.useState(f),[v,T]=w.useState(f);Ka(()=>{x.current=!1,y.current=f;for(let j=0;j<v.length;j++){const P=On(v[j]);h.includes(P)?m.delete(P):m.get(P)!==!0&&m.set(P,!1)}},[v,h.length,h.join("-")]);const k=[];if(f!==b){let j=[...f];for(let P=0;P<v.length;P++){const A=v[P],_=On(A);h.includes(_)||(j.splice(P,0,A),k.push(A))}return s==="wait"&&k.length&&(j=k),T(si(j)),C(f),null}process.env.NODE_ENV!=="production"&&s==="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:S}=w.useContext(_o);return l.jsx(l.Fragment,{children:v.map(j=>{const P=On(j),A=i&&!d?!1:f===v||h.includes(P),_=()=>{if(m.has(P))m.set(P,!0);else return;let p=!0;m.forEach(V=>{V||(p=!1)}),p&&(S==null||S(),T(y.current),i&&(u==null||u()),r&&r())};return l.jsx(Uf,{isPresent:A,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:c,onExitComplete:A?void 0:_,anchorX:a,children:j},P)})})},_c=w.createContext({strict:!1}),ii={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"]},qt={};for(const e in ii)qt[e]={isEnabled:t=>ii[e].some(n=>!!t[n])};function Wf(e){for(const t in e)qt[t]={...qt[t],...e[t]}}const Gf=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 or(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gf.has(e)}let Bc=e=>!or(e);function Kf(e){typeof e=="function"&&(Bc=t=>t.startsWith("on")?!or(t):e(t))}try{Kf(require("@emotion/is-prop-valid").default)}catch{}function Yf(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Bc(o)||n===!0&&or(o)||!t&&!or(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const ur=w.createContext({});function fr(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function kn(e){return typeof e=="string"||Array.isArray(e)}const us=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fs=["initial",...us];function hr(e){return fr(e.animate)||fs.some(t=>kn(e[t]))}function zc(e){return!!(hr(e)||e.variants)}function qf(e,t){if(hr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kn(n)?n:void 0,animate:kn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=qf(e,w.useContext(ur));return w.useMemo(()=>({initial:t,animate:n}),[ai(t),ai(n)])}function ai(e){return Array.isArray(e)?e.join(" "):e}const Cn={};function Jf(e){for(const t in e)Cn[t]=e[t],qo(t)&&(Cn[t].isCSSVariable=!0)}function Hc(e,{layout:t,layoutId:n}){return nn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cn[e]||e==="opacity")}const Qf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eh=tn.length;function th(e,t,n){let r="",o=!0;for(let s=0;s<eh;s++){const i=tn[s],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 d=Rc(a,as[i]);if(!c){o=!1;const u=Qf[i]||i;r+=`${u}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function hs(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const d=t[c];if(nn.has(c)){i=!0;continue}else if(qo(c)){o[c]=d;continue}else{const u=Rc(d,as[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=th(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:d="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${d} ${u}`}}const ms=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uc(e,t,n){for(const r in t)!De(t[r])&&!Hc(r,n)&&(e[r]=t[r])}function nh({transformTemplate:e},t){return w.useMemo(()=>{const n=ms();return hs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rh(e,t){const n=e.style||{},r={};return Uc(r,n,e),Object.assign(r,nh(e,t)),r}function oh(e,t){const n={},r=rh(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 sh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ih={offset:"strokeDashoffset",array:"strokeDasharray"};function ah(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?sh:ih;e[s.offset]=ee.transform(-r);const i=ee.transform(t),a=ee.transform(n);e[s.array]=`${i} ${a}`}function Zc(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,d,u){if(hs(e,a,d),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),o!==void 0&&ah(f,o,s,i,!1)}const Wc=()=>({...ms(),attrs:{}}),Gc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ch(e,t,n,r){const o=w.useMemo(()=>{const s=Wc();return Zc(s,t,Gc(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Uc(s,e.style,e),o.style={...s,...o.style}}return o}const lh=["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 gs(e){return typeof e!="string"||e.includes("-")?!1:!!(lh.indexOf(e)>-1||/[A-Z]/u.test(e))}function dh(e,t,n,{latestValues:r},o,s=!1){const a=(gs(e)?ch:oh)(t,r,o,e),c=Yf(t,typeof e=="string",s),d=e!==w.Fragment?{...c,...a,ref:n}:{},{children:u}=t,f=w.useMemo(()=>De(u)?u.get():u,[u]);return w.createElement(e,{...d,children:f})}function ci(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ps(e,t,n,r){if(typeof t=="function"){const[o,s]=ci(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=ci(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function qn(e){return De(e)?e.get():e}function uh({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:fh(n,r,o,e),renderState:t()}}function fh(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=qn(s[h]);let{initial:i,animate:a}=e;const c=hr(e),d=zc(e);t&&d&&!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"&&!fr(f)){const h=Array.isArray(f)?f:[f];for(let x=0;x<h.length;x++){const y=ps(e,h[x]);if(y){const{transitionEnd:m,transition:b,...C}=y;for(const v in C){let T=C[v];if(Array.isArray(T)){const k=u?T.length-1:0;T=T[k]}T!==null&&(o[v]=T)}for(const v in m)o[v]=m[v]}}}return o}const Kc=e=>(t,n)=>{const r=w.useContext(ur),o=w.useContext(dr),s=()=>uh(e,t,r,o);return n?s():Bo(s)};function xs(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(De(r[i])||t.style&&De(t.style[i])||Hc(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const hh=Kc({scrapeMotionValuesFromProps:xs,createRenderState:ms});function Yc(e,t,n){const r=xs(e,t,n);for(const o in e)if(De(e[o])||De(t[o])){const s=tn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const mh=Kc({scrapeMotionValuesFromProps:Yc,createRenderState:Wc}),gh=Symbol.for("motionComponentSymbol");function zt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ph(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):zt(n)&&(n.current=r))},[t])}const ys=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xh="framerAppearId",qc="data-"+ys(xh),Xc=w.createContext({});function yh(e,t,n,r,o){var m,b;const{visualElement:s}=w.useContext(ur),i=w.useContext(_c),a=w.useContext(dr),c=w.useContext(ds).reducedMotion,d=w.useRef(null);r=r||i.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=d.current,f=w.useContext(Xc);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&bh(d.current,n,o,f);const h=w.useRef(!1);w.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const x=n[qc],y=w.useRef(!!x&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,x))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,x)));return Ka(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),y.current&&u.animationState&&u.animationState.animateChanges())}),w.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,x)}),y.current=!1),u.enteringChildren=void 0)}),u}function bh(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jc(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&zt(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:d})}function Jc(e){if(e)return e.options.allowProjection!==!1?e.projection:Jc(e.parent)}function $r(e,{forwardMotionProps:t=!1}={},n,r){n&&Wf(n);const o=gs(e)?mh:hh;function s(a,c){let d;const u={...w.useContext(ds),...a,layoutId:vh(a)},{isStatic:f}=u,h=Xf(a),x=o(a,f);if(!f&&zo){wh(u,n);const y=Sh(u);d=y.MeasureLayout,h.visualElement=yh(e,x,u,r,y.ProjectionNode)}return l.jsxs(ur.Provider,{value:h,children:[d&&h.visualElement?l.jsx(d,{visualElement:h.visualElement,...u}):null,dh(e,a,ph(x,h.visualElement,c),x,f,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=w.forwardRef(s);return i[gh]=e,i}function vh({layoutId:e}){const t=w.useContext(_o).id;return t&&e!==void 0?t+"-"+e:e}function wh(e,t){const n=w.useContext(_c).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?Qt(!1,r,"lazy-strict-mode"):at(!1,r,"lazy-strict-mode")}}function Sh(e){const{drag:t,layout:n}=qt;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 kh(e,t){if(typeof Proxy>"u")return $r;const n=new Map,r=(s,i)=>$r(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Go(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,$r(i,void 0,e,t)),n.get(i))})}function Qc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ch({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Eh(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 Fr(e){return e===void 0||e===1}function wo({scale:e,scaleX:t,scaleY:n}){return!Fr(e)||!Fr(t)||!Fr(n)}function St(e){return wo(e)||el(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function el(e){return li(e.x)||li(e.y)}function li(e){return e&&e!=="0%"}function sr(e,t,n){const r=e-n,o=t*r;return n+o}function di(e,t,n,r,o){return o!==void 0&&(e=sr(e,o,r)),sr(e,n,r)+t}function So(e,t=0,n=1,r,o){e.min=di(e.min,t,n,r,o),e.max=di(e.max,t,n,r,o)}function tl(e,{x:t,y:n}){So(e.x,t.translate,t.scale,t.originPoint),So(e.y,n.translate,n.scale,n.originPoint)}const ui=.999999999999,fi=1.0000000000001;function Th(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ut(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,tl(e,i)),r&&St(s.latestValues)&&Ut(e,s.latestValues))}t.x<fi&&t.x>ui&&(t.x=1),t.y<fi&&t.y>ui&&(t.y=1)}function Ht(e,t){e.min=e.min+t,e.max=e.max+t}function hi(e,t,n,r,o=.5){const s=we(e.min,e.max,o);So(e,t,n,s,r)}function Ut(e,t){hi(e.x,t.x,t.scaleX,t.scale,t.originX),hi(e.y,t.y,t.scaleY,t.scale,t.originY)}function nl(e,t){return Qc(Eh(e.getBoundingClientRect(),t))}function Ah(e,t,n){const r=nl(e,n),{scroll:o}=t;return o&&(Ht(r.x,o.offset.x),Ht(r.y,o.offset.y)),r}const mi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zt=()=>({x:mi(),y:mi()}),gi=()=>({min:0,max:0}),Te=()=>({x:gi(),y:gi()}),ko={current:null},rl={current:!1};function jh(){if(rl.current=!0,!!zo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ko.current=e.matches;e.addEventListener("change",t),t()}else ko.current=!1}const Ph=new WeakMap;function Mh(e,t,n){for(const r in t){const o=t[r],s=n[r];if(De(o))e.addValue(r,o);else if(De(s))e.addValue(r,Yt(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Yt(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,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=ss,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=Fe.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,be.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=hr(n),this.isVariantNode=zc(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 x=f[h];c[h]!==void 0&&De(x)&&x.set(c[h])}}mount(t){var n;this.current=t,Ph.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,o)=>this.bindToMotionValue(o,r)),rl.current||jh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ko.current,process.env.NODE_ENV!=="production"&&Go(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(),mt(this.notifyUpdate),mt(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=nn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=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 s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 qt){const n=qt[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}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<pi.length;r++){const o=pi[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Mh(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=Yt(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"&&(Ya(r)||Xa(r))?r=parseFloat(r):!Bf(r)&>.test(n)&&(r=Nc(t,n)),this.setBaseTarget(t,De(r)?r.get():r)),De(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ps(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!De(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Wo),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){cs.render(this.render)}}class ol extends Vh{constructor(){super(...arguments),this.KeyframeResolver=Pf}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;De(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sl(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function Nh(e){return window.getComputedStyle(e)}class Rh extends ol{constructor(){super(...arguments),this.type="html",this.renderInstance=sl}readValueFromInstance(t,n){var r;if(nn.has(n))return(r=this.projection)!=null&&r.isProjecting?mo(n):Wu(t,n);{const o=Nh(t),s=(qo(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return nl(t,n)}build(t,n,r){hs(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}}const il=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 Ih(e,t,n,r){sl(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(il.has(o)?o:ys(o),t.attrs[o])}class Dh extends ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(nn.has(n)){const r=Vc(n);return r&&r.default||0}return n=il.has(n)?n:ys(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Yc(t,n,r)}build(t,n,r){Zc(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Ih(t,n,r,o)}mount(t){this.isSVGTag=Gc(t.tagName),super.mount(t)}}const $h=(e,t)=>gs(e)?new Dh(t):new Rh(t,{allowProjection:e!==w.Fragment});function Gt(e,t,n){const r=e.getProps();return ps(r,t,n!==void 0?n:r.custom,e)}const Co=e=>Array.isArray(e);function Fh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yt(n))}function Oh(e){return Co(e)?e[e.length-1]||0:e}function Lh(e,t){const n=Gt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Oh(s[i]);Fh(e,i,a)}}function _h(e){return!!(De(e)&&e.add)}function Eo(e,t){const n=e.getValue("willChange");if(_h(n))return n.add(t);if(!n&&ct.WillChange){const r=new ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function al(e){return e.props[qc]}const Bh=e=>e!==null;function zh(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Bh),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const Hh={type:"spring",stiffness:500,damping:25,restSpeed:10},Uh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Zh={type:"keyframes",duration:.8},Wh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gh=(e,{keyframes:t})=>t.length>2?Zh:nn.has(e)?e.startsWith("scale")?Uh(t[1]):Hh:Wh;function Kh({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const bs=(e,t,n,r={},o,s)=>i=>{const a=is(r,e)||{},c=a.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ke(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Kh(a)||Object.assign(u,Gh(e,u)),u.duration&&(u.duration=Ke(u.duration)),u.repeatDelay&&(u.repeatDelay=Ke(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)),(ct.instantAnimations||ct.skipAnimations)&&(f=!0,bo(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=zh(u.keyframes,a);if(h!==void 0){be.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new os(u):new pf(u)};function Yh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cl(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||d&&Yh(d,u))continue;const x={delay:n,...is(s||{},u)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===y&&!x.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const C=al(e);if(C){const v=window.MotionHandoffAnimation(C,u,be);v!==null&&(x.startTime=v,m=!0)}}Eo(e,u),f.start(bs(u,f,h,e.shouldReduceMotion&&jc.has(u)?{type:!1}:x,e,m));const b=f.animation;b&&c.push(b)}return i&&Promise.all(c).then(()=>{be.update(()=>{i&&Lh(e,i)})}),c}function ll(e,t,n,r=0,o=1){const s=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}function To(e,t,n={}){var c;const r=Gt(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(cl(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=o;return qh(e,t,d,u,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[d,u]=a==="beforeChildren"?[s,i]:[i,s];return d().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function qh(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(To(c,t,{...i,delay:n+(typeof r=="function"?0:r)+ll(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Xh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>To(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=To(e,t,n);else{const o=typeof t=="function"?Gt(e,t,n.custom):t;r=Promise.all(cl(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function dl(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 Jh=fs.length;function ul(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ul(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jh;n++){const r=fs[n],o=e.props[r];(kn(o)||o===!1)&&(t[r]=o)}return t}const Qh=[...us].reverse(),em=us.length;function tm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Xh(e,n,r)))}function nm(e){let t=tm(e),n=xi(),r=!0;const o=c=>(d,u)=>{var h;const f=Gt(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:x,transitionEnd:y,...m}=f;d={...d,...m,...y}}return d};function s(c){t=c(e)}function i(c){const{props:d}=e,u=ul(e.parent)||{},f=[],h=new Set;let x={},y=1/0;for(let b=0;b<em;b++){const C=Qh[b],v=n[C],T=d[C]!==void 0?d[C]:u[C],k=kn(T),S=C===c?v.isActive:null;S===!1&&(y=b);let j=T===u[C]&&T!==d[C]&&k;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...x},!v.isActive&&S===null||!T&&!v.prevProp||fr(T)||typeof T=="boolean")continue;const P=rm(v.prevProp,T);let A=P||C===c&&v.isActive&&!j&&k||b>y&&k,_=!1;const p=Array.isArray(T)?T:[T];let V=p.reduce(o(C),{});S===!1&&(V={});const{prevResolvedValues:B={}}=v,G={...B,...V},te=X=>{A=!0,h.has(X)&&(_=!0,h.delete(X)),v.needsAnimating[X]=!0;const I=e.getValue(X);I&&(I.liveStyle=!1)};for(const X in G){const I=V[X],q=B[X];if(x.hasOwnProperty(X))continue;let M=!1;Co(I)&&Co(q)?M=!dl(I,q):M=I!==q,M?I!=null?te(X):h.add(X):I!==void 0&&h.has(X)?te(X):v.protectedKeys[X]=!0}v.prevProp=T,v.prevResolvedValues=V,v.isActive&&(x={...x,...V}),r&&e.blockInitialAnimation&&(A=!1);const ne=j&&P;A&&(!ne||_)&&f.push(...p.map(X=>{const I={type:C};if(typeof X=="string"&&r&&!ne&&e.manuallyAnimateOnMount&&e.parent){const{parent:q}=e,M=Gt(q,X);if(q.enteringChildren&&M){const{delayChildren:z}=M.transition||{};I.delay=ll(q.enteringChildren,e,z)}}return{animation:X,options:I}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const C=Gt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);C&&C.transition&&(b.transition=C.transition)}h.forEach(C=>{const v=e.getBaseTarget(C),T=e.getValue(C);T&&(T.liveStyle=!0),b[C]=v??null}),f.push({animation:b})}let m=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function a(c,d){var f;if(n[c].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var x;return(x=h.animationState)==null?void 0:x.setActive(c,d)}),n[c].isActive=d;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=xi(),r=!0}}}function rm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dl(t,e):!1}function vt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xi(){return{animate:vt(!0),whileInView:vt(),whileHover:vt(),whileTap:vt(),whileDrag:vt(),whileFocus:vt(),exit:vt()}}class yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class om extends yt{constructor(t){super(t),t.animationState||(t.animationState=nm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fr(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 sm=0;class im extends yt{constructor(){super(...arguments),this.id=sm++}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 o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 am={animation:{Feature:om},exit:{Feature:im}};function En(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mn(e){return{point:{x:e.pageX,y:e.pageY}}}const cm=e=>t=>ls(t)&&e(t,Mn(t));function gn(e,t,n,r){return En(e,t,cm(n),r)}const fl=1e-4,lm=1-fl,dm=1+fl,hl=.01,um=0-hl,fm=0+hl;function $e(e){return e.max-e.min}function hm(e,t,n){return Math.abs(e-t)<=n}function yi(e,t,n,r=.5){e.origin=r,e.originPoint=we(t.min,t.max,e.origin),e.scale=$e(n)/$e(t),e.translate=we(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lm&&e.scale<=dm||isNaN(e.scale))&&(e.scale=1),(e.translate>=um&&e.translate<=fm||isNaN(e.translate))&&(e.translate=0)}function pn(e,t,n,r){yi(e.x,t.x,n.x,r?r.originX:void 0),yi(e.y,t.y,n.y,r?r.originY:void 0)}function bi(e,t,n){e.min=n.min+t.min,e.max=e.min+$e(t)}function mm(e,t,n){bi(e.x,t.x,n.x),bi(e.y,t.y,n.y)}function vi(e,t,n){e.min=t.min-n.min,e.max=e.min+$e(t)}function xn(e,t,n){vi(e.x,t.x,n.x),vi(e.y,t.y,n.y)}function Be(e){return[e("x"),e("y")]}const ml=({current:e})=>e?e.ownerDocument.defaultView:null,wi=(e,t)=>Math.abs(e-t);function gm(e,t){const n=wi(e.x,t.x),r=wi(e.y,t.y);return Math.sqrt(n**2+r**2)}class gl{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!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=Lr(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,y=gm(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!y)return;const{point:m}=h,{timestamp:b}=Ve;this.history.push({...m,timestamp:b});const{onStart:C,onMove:v}=this.handlers;x||(C&&C(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,x)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Or(x,this.transformPagePoint),be.update(this.updatePoint,!0)},this.handlePointerUp=(h,x)=>{this.end();const{onEnd:y,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Lr(h.type==="pointercancel"?this.lastMoveEventInfo:Or(x,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,C),m&&m(h,C)},!ls(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const a=Mn(t),c=Or(a,this.transformPagePoint),{point:d}=c,{timestamp:u}=Ve;this.history=[{...d,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Lr(c,this.history)),this.removeListeners=An(gn(this.contextWindow,"pointermove",this.handlePointerMove),gn(this.contextWindow,"pointerup",this.handlePointerUp),gn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),mt(this.updatePoint)}}function Or(e,t){return t?{point:t(e.point)}:e}function Si(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lr({point:e},t){return{point:e,delta:Si(e,pl(t)),offset:Si(e,pm(t)),velocity:xm(t,.1)}}function pm(e){return e[0]}function pl(e){return e[e.length-1]}function xm(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pl(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ke(t)));)n--;if(!r)return{x:0,y:0};const s=Je(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function ym(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function ki(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 bm(e,{top:t,left:n,bottom:r,right:o}){return{x:ki(e.x,n,o),y:ki(e.y,t,r)}}function Ci(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 vm(e,t){return{x:Ci(e.x,t.x),y:Ci(e.y,t.y)}}function wm(e,t){let n=.5;const r=$e(e),o=$e(t);return o>r?n=vn(t.min,t.max-r,e.min):r>o&&(n=vn(e.min,e.max-o,t.min)),it(0,1,n)}function Sm(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 Ao=.35;function km(e=Ao){return e===!1?e=0:e===!0&&(e=Ao),{x:Ei(e,"left","right"),y:Ei(e,"top","bottom")}}function Ei(e,t,n){return{min:Ti(e,t),max:Ti(e,n)}}function Ti(e,t){return typeof e=="number"?e:e[t]||0}const Cm=new WeakMap;class Em{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=Te(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mn(f).point)},i=(f,h)=>{const{drag:x,dragPropagation:y,onDragStart:m}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(x),!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),Be(C=>{let v=this.getAxisMotionValue(C).get()||0;if(Qe.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[C];k&&(v=$e(k)*(parseFloat(v)/100))}}this.originPoint[C]=v}),m&&be.postRender(()=>m(f,h)),Eo(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:m,onDrag:b}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=h;if(y&&this.currentDirection===null){this.currentDirection=Tm(C),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,C),this.updateAxis("y",h.point,C),this.visualElement.render(),b&&b(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>Be(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 gl(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:ml(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&be.postRender(()=>a(r,o))}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:o}=this.getProps();if(!r||!Ln(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=ym(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&zt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bm(r.layoutBox,t):this.constraints=!1,this.elastic=km(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Be(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sm(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zt(t))return!1;const r=t.current;at(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:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Ah(r,o.root,this.visualElement.getTransformPagePoint());let i=vm(o.layout.layoutBox,s);if(n){const a=n(Ch(i));this.hasMutatedConstraints=!!a,a&&(i=Qc(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=Be(u=>{if(!Ln(u,n,this.currentDirection))return;let f=c&&c[u]||{};i&&(f={min:0,max:0});const h=o?200:1e6,x=o?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(d).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Eo(this.visualElement,t),r.start(bs(t,r,0,n,this.visualElement,!1))}stopAnimation(){Be(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Be(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(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Be(n=>{const{drag:r}=this.getProps();if(!Ln(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-we(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Be(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=wm({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Be(i=>{if(!Ln(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:d}=this.constraints[i];a.set(we(c,d,o[i]))})}addListeners(){if(!this.visualElement.current)return;Cm.set(this.visualElement,this);const t=this.visualElement.current,n=gn(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();zt(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),be.read(r);const i=En(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Be(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(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Ao,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Ln(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tm(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Am extends yt{constructor(t){super(t),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new Em(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ai=e=>(t,n)=>{e&&be.postRender(()=>e(t,n))};class jm extends yt{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(t){this.session=new gl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ml(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ai(t),onStart:Ai(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&be.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=gn(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 Xn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ee.test(e))e=parseFloat(e);else return e;const n=ji(e,t.target.x),r=ji(e,t.target.y);return`${n}% ${r}%`}},Pm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=gt.parse(e);if(o.length>5)return r;const s=gt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const d=we(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=d),typeof o[3+i]=="number"&&(o[3+i]/=d),s(o)}};let _r=!1;class Mm extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;Jf(Vm),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),_r&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Xn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,_r=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?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(),cs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;_r=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xl(e){const[t,n]=Lc(),r=w.useContext(_o);return l.jsx(Mm,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Xc),isPresent:t,safeToRemove:n})}const Vm={borderRadius:{...cn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cn,borderTopRightRadius:cn,borderBottomLeftRadius:cn,borderBottomRightRadius:cn,boxShadow:Pm};function Nm(e,t,n){const r=De(e)?e:Yt(e);return r.start(bs("",r,t,n)),r.animation}const Rm=(e,t)=>e.depth-t.depth;class Im{constructor(){this.children=[],this.isDirty=!1}add(t){Ho(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rm),this.isDirty=!1,this.children.forEach(t)}}function Dm(e,t){const n=Fe.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(mt(r),e(s-t))};return be.setup(r,!0),()=>mt(r)}const yl=["TopLeft","TopRight","BottomLeft","BottomRight"],$m=yl.length,Pi=e=>typeof e=="string"?parseFloat(e):e,Mi=e=>typeof e=="number"||ee.test(e);function Fm(e,t,n,r,o,s){o?(e.opacity=we(0,n.opacity??1,Om(r)),e.opacityExit=we(t.opacity??1,0,Lm(r))):s&&(e.opacity=we(t.opacity??1,n.opacity??1,r));for(let i=0;i<$m;i++){const a=`border${yl[i]}Radius`;let c=Vi(t,a),d=Vi(n,a);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Mi(c)===Mi(d)?(e[a]=Math.max(we(Pi(c),Pi(d),r),0),(Qe.test(d)||Qe.test(c))&&(e[a]+="%")):e[a]=d}(t.rotate||n.rotate)&&(e.rotate=we(t.rotate||0,n.rotate||0,r))}function Vi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Om=bl(0,.5,sc),Lm=bl(.5,.95,Ue);function bl(e,t,n){return r=>r<e?0:r>t?1:n(vn(e,t,r))}function Ni(e,t){e.min=t.min,e.max=t.max}function _e(e,t){Ni(e.x,t.x),Ni(e.y,t.y)}function Ri(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ii(e,t,n,r,o){return e-=t,e=sr(e,1/n,r),o!==void 0&&(e=sr(e,1/o,r)),e}function _m(e,t=0,n=1,r=.5,o,s=e,i=e){if(Qe.test(t)&&(t=parseFloat(t),t=we(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=we(s.min,s.max,r);e===s&&(a-=t),e.min=Ii(e.min,t,n,a,o),e.max=Ii(e.max,t,n,a,o)}function Di(e,t,[n,r,o],s,i){_m(e,t[n],t[r],t[o],t.scale,s,i)}const Bm=["x","scaleX","originX"],zm=["y","scaleY","originY"];function $i(e,t,n,r){Di(e.x,t,Bm,n?n.x:void 0,r?r.x:void 0),Di(e.y,t,zm,n?n.y:void 0,r?r.y:void 0)}function Fi(e){return e.translate===0&&e.scale===1}function vl(e){return Fi(e.x)&&Fi(e.y)}function Oi(e,t){return e.min===t.min&&e.max===t.max}function Hm(e,t){return Oi(e.x,t.x)&&Oi(e.y,t.y)}function Li(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wl(e,t){return Li(e.x,t.x)&&Li(e.y,t.y)}function _i(e){return $e(e.x)/$e(e.y)}function Bi(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Um{constructor(){this.members=[]}add(t){Ho(this.members,t),t.scheduleRender()}remove(t){if(Uo(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(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;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:o}=t.options;o===!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 Zm(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:f,rotateY:h,skewX:x,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),x&&(r+=`skewX(${x}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 Br=["","X","Y","Z"],Wm=1e3;let Gm=0;function zr(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=al(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",be,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sl(r)}function kl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Gm++,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(qm),this.nodes.forEach(eg),this.nodes.forEach(tg),this.nodes.forEach(Xm)},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 Im)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Wo),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=Oc(i)&&!Lf(i),this.instance=i;const{layoutId:a,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.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;be.read(()=>{f=window.innerWidth}),e(i,()=>{const x=window.innerWidth;x!==f&&(f=x,this.root.updateBlockedByResize=!0,u&&u(),u=Dm(h,250),Xn.hasAnimatedSinceResize&&(Xn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ui)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||ig,{onLayoutAnimationStart:m,onLayoutAnimationComplete:b}=d.getProps(),C=!this.targetLayout||!wl(this.targetLayout,x),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...is(y,"layout"),onPlay:m,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(u,v)}else f||Ui(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(),mt(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(ng),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&&Sl(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 d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qm),this.nodes.forEach(Km),this.nodes.forEach(Ym)):this.nodes.forEach(Hi),this.clearAllSnapshots();const a=Fe.now();Ve.delta=it(0,1e3/60,a-Ve.timestamp),Ve.timestamp=a,Ve.isProcessing=!0,Mr.update.process(Ve),Mr.preRender.process(Ve),Mr.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jm),this.sharedNodes.forEach(rg)}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&&!$e(this.snapshot.measuredBox.x)&&!$e(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=Te(),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(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!vl(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;i&&this.instance&&(a||St(this.latestValues)||u)&&(o(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),ag(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:i}=this.options;if(!i)return Te();const a=i.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(cg))){const{scroll:u}=this.root;u&&(Ht(a.x,u.offset.x),Ht(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Te();if(_e(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&_e(a,i),Ht(a.x,f.offset.x),Ht(a.y,f.offset.y))}return a}applyTransform(i,a=!1){const c=Te();_e(c,i);for(let d=0;d<this.path.length;d++){const u=this.path[d];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ut(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),St(u.latestValues)&&Ut(c,u.latestValues)}return St(this.latestValues)&&Ut(c,this.latestValues),c}removeTransform(i){const a=Te();_e(a,i);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!St(d.latestValues))continue;wo(d.latestValues)&&d.updateSnapshot();const u=Te(),f=d.measurePageBox();_e(u,f),$i(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return St(this.latestValues)&&$i(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!==Ve.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=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),xn(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),_e(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_e(this.target,this.layout.layoutBox),tl(this.target,this.targetDelta)):_e(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),xn(this.relativeTargetOrigin,this.target,x.target),_e(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||wo(this.parent.latestValues)||el(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===Ve.timestamp&&(c=!1),c)return;const{layout:d,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||!(d||u))return;_e(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Th(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=Te());const{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ri(this.prevProjectionDelta.x,this.projectionDelta.x),Ri(this.prevProjectionDelta.y,this.projectionDelta.y)),pn(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Bi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}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=Zt(),this.projectionDelta=Zt(),this.projectionDeltaWithTransform=Zt()}setAnimationOrigin(i,a=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},f=Zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Te(),x=c?c.source:void 0,y=this.layout?this.layout.source:void 0,m=x!==y,b=this.getStack(),C=!b||b.members.length<=1,v=!!(m&&!C&&this.options.crossfade===!0&&!this.path.some(sg));this.animationProgress=0;let T;this.mixTargetDelta=k=>{const S=k/1e3;Zi(f.x,i.x,S),Zi(f.y,i.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xn(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),og(this.relativeTarget,this.relativeTargetOrigin,h,S),T&&Hm(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Te()),_e(T,this.relativeTarget)),m&&(this.animationValues=u,Fm(u,d,this.latestValues,S,v,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(mt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=be.update(()=>{Xn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yt(0)),this.currentAnimation=Nm(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(Wm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:d,latestValues:u}=i;if(!(!a||!c||!d)){if(this!==i&&this.layout&&d&&Cl(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Te();const f=$e(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=$e(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}_e(a,c),Ut(a,u),pn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Um),this.sharedNodes.get(i).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&zr("z",i,d,this.animationValues);for(let u=0;u<Br.length;u++)zr(`rotate${Br[u]}`,i,d,this.animationValues),zr(`skew${Br[u]}`,i,d,this.animationValues);i.render();for(const u in d)i.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[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=qn(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=qn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!St(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=Zm(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),i.transform=f;const{x:h,y:x}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${x.origin*100}% 0`,d.animationValues?i.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in Cn){if(u[y]===void 0)continue;const{correct:m,applyTo:b,isCSSVariable:C}=Cn[y],v=f==="none"?u[y]:m(u[y],d);if(b){const T=b.length;for(let k=0;k<T;k++)i[b[k]]=v}else C?this.options.visualElement.renderState.vars[y]=v:i[y]=v}this.options.layoutId&&(i.pointerEvents=d===this?qn(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(zi),this.root.sharedNodes.clear()}}}function Km(e){e.updateLayout()}function Ym(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:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Be(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],x=$e(h);h.min=r[f].min,h.max=h.min+x}):Cl(s,t.layoutBox,r)&&Be(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],x=$e(r[f]);h.max=h.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+x)});const a=Zt();pn(a,r,t.layoutBox);const c=Zt();i?pn(c,e.applyTransform(o,!0),t.measuredBox):pn(c,r,t.layoutBox);const d=!vl(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:x}=f;if(h&&x){const y=Te();xn(y,t.layoutBox,h.layoutBox);const m=Te();xn(m,r,x.layoutBox),wl(y,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qm(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 Xm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jm(e){e.clearSnapshot()}function zi(e){e.clearMeasurements()}function Hi(e){e.isLayoutDirty=!1}function Qm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ui(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function eg(e){e.resolveTargetDelta()}function tg(e){e.calcProjection()}function ng(e){e.resetSkewAndRotation()}function rg(e){e.removeLeadSnapshot()}function Zi(e,t,n){e.translate=we(t.translate,0,n),e.scale=we(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Wi(e,t,n,r){e.min=we(t.min,n.min,r),e.max=we(t.max,n.max,r)}function og(e,t,n,r){Wi(e.x,t.x,n.x,r),Wi(e.y,t.y,n.y,r)}function sg(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ig={duration:.45,ease:[.4,0,.1,1]},Gi=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ki=Gi("applewebkit/")&&!Gi("chrome/")?Math.round:Ue;function Yi(e){e.min=Ki(e.min),e.max=Ki(e.max)}function ag(e){Yi(e.x),Yi(e.y)}function Cl(e,t,n){return e==="position"||e==="preserve-aspect"&&!hm(_i(t),_i(n),.2)}function cg(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lg=kl({attachResizeListener:(e,t)=>En(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hr={current:void 0},El=kl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hr.current){const e=new lg({});e.mount(window),e.setOptions({layoutScroll:!0}),Hr.current=e}return Hr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dg={pan:{Feature:jm},drag:{Feature:Am,ProjectionNode:El,MeasureLayout:xl}};function qi(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&be.postRender(()=>s(t,Mn(t)))}class ug extends yt{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,r)=>(qi(this.node,r,"Start"),o=>qi(this.node,o,"End"))))}unmount(){}}class fg extends yt{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=An(En(this.node.current,"focus",()=>this.onFocus()),En(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xi(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 o="onTap"+(n==="End"?"":n),s=r[o];s&&be.postRender(()=>s(t,Mn(t)))}class hg extends yt{mount(){const{current:t}=this.node;t&&(this.unmount=Of(t,(n,r)=>(Xi(this.node,r,"Start"),(o,{success:s})=>Xi(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const jo=new WeakMap,Ur=new WeakMap,mg=e=>{const t=jo.get(e.target);t&&t(e)},gg=e=>{e.forEach(mg)};function pg({root:e,...t}){const n=e||document;Ur.has(n)||Ur.set(n,{});const r=Ur.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(gg,{root:e,...t})),r[o]}function xg(e,t,n){const r=pg(t);return jo.set(e,n),r.observe(e),()=>{jo.delete(e),r.unobserve(e)}}const yg={some:0,all:1};class bg extends yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:yg[o]},a=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=d?u:f;h&&h(c)};return xg(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(vg(t,n))&&this.startObserver()}unmount(){}}function vg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wg={inView:{Feature:bg},tap:{Feature:hg},focus:{Feature:fg},hover:{Feature:ug}},Sg={layout:{ProjectionNode:El,MeasureLayout:xl}},kg={...am,...wg,...dg,...Sg},ie=kh(kg,$h),Ye=g.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:o="1em",weight:s="regular",mirrored:i=!1,children:a,weights:c,...d}=e;return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!n&&g.createElement("title",null,n),a,c.get(s))});Ye.displayName="SSRBase";const Cg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),vs=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Cg}));vs.displayName="CaretDownIcon";const Eg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Tl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Eg}));Tl.displayName="CaretUpIcon";const Tg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Al=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Tg}));Al.displayName="ChatTextIcon";const Ag=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),jl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Ag}));jl.displayName="CheckIcon";const jg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Pl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:jg}));Pl.displayName="MicrophoneIcon";const Pg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Ml=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Pg}));Ml.displayName="MicrophoneSlashIcon";const Mg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Vl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Mg}));Vl.displayName="MonitorArrowUpIcon";const Vg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),ws=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Vg}));ws.displayName="SpinnerIcon";const Ng=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Nl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Ng}));Nl.displayName="VideoCameraIcon";const Rg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Rl=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Rg}));Rl.displayName="VideoCameraSlashIcon";function Ji(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ig(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ji(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ji(e[o],null)}}}}function Dg(e){const t=Fg(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,a=g.Children.toArray(s),c=a.find(Lg);if(c){const d=c.props.children,u=a.map(f=>f===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return l.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var $g=Dg("Slot");function Fg(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=Bg(o),a=_g(s,o.props);return o.type!==g.Fragment&&(a.ref=r?Ig(r,i):i),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Og=Symbol("radix.slottable");function Lg(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Og}function _g(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Bg(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Ss="-",zg=e=>{const t=Ug(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Ss);return a[0]===""&&a.length!==1&&a.shift(),Il(a,t)||Hg(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Il=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Il(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ss);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Qi=/^\[(.+)\]$/,Hg=e=>{if(Qi.test(e)){const t=Qi.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ug=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Po(n[o],r,o,t);return r},Po=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ea(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Zg(o)){Po(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Po(i,ea(t,s),n,r)})})},ea=(e,t)=>{let n=e;return t.split(Ss).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Zg=e=>e.isThemeGetter,Wg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Mo="!",Vo=":",Gg=Vo.length,Kg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,d;for(let y=0;y<o.length;y++){let m=o[y];if(i===0&&a===0){if(m===Vo){s.push(o.slice(c,y)),c=y+Gg;continue}if(m==="/"){d=y;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=s.length===0?o:o.substring(c),f=Yg(u),h=f!==u,x=d&&d>c?d-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:x}};if(t){const o=t+Vo,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Yg=e=>e.endsWith(Mo)?e.substring(0,e.length-1):e.startsWith(Mo)?e.substring(1):e,qg=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Xg=e=>({cache:Wg(e.cacheSize),parseClassName:Kg(e),sortModifiers:qg(e),...zg(e)}),Jg=/\s+/,Qg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Jg);let c="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:m}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let b=!!m,C=r(b?y.substring(0,m):y);if(!C){if(!b){c=u+(c.length>0?" "+c:c);continue}if(C=r(y),!C){c=u+(c.length>0?" "+c:c);continue}b=!1}const v=s(h).join(":"),T=x?v+Mo:v,k=T+C;if(i.includes(k))continue;i.push(k);const S=o(C,b);for(let j=0;j<S.length;++j){const P=S[j];i.push(T+P)}c=u+(c.length>0?" "+c:c)}return c};function e0(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dl(t))&&(r&&(r+=" "),r+=n);return r}const Dl=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dl(e[r]))&&(n&&(n+=" "),n+=t);return n};function t0(e,...t){let n,r,o,s=i;function i(c){const d=t.reduce((u,f)=>f(u),e());return n=Xg(d),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const d=r(c);if(d)return d;const u=Qg(c,n);return o(c,u),u}return function(){return s(e0.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$l=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n0=/^\d+\/\d+$/,r0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o0=/\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$/,s0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nt=e=>n0.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),ut=e=>!!e&&Number.isInteger(Number(e)),Zr=e=>e.endsWith("%")&&se(e.slice(0,-1)),nt=e=>r0.test(e),c0=()=>!0,l0=e=>o0.test(e)&&!s0.test(e),Ol=()=>!1,d0=e=>i0.test(e),u0=e=>a0.test(e),f0=e=>!K(e)&&!Y(e),h0=e=>rn(e,Bl,Ol),K=e=>$l.test(e),wt=e=>rn(e,zl,l0),Wr=e=>rn(e,y0,se),ta=e=>rn(e,Ll,Ol),m0=e=>rn(e,_l,u0),_n=e=>rn(e,Hl,d0),Y=e=>Fl.test(e),ln=e=>on(e,zl),g0=e=>on(e,b0),na=e=>on(e,Ll),p0=e=>on(e,Bl),x0=e=>on(e,_l),Bn=e=>on(e,Hl,!0),rn=(e,t,n)=>{const r=$l.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},on=(e,t,n=!1)=>{const r=Fl.exec(e);return r?r[1]?t(r[1]):n:!1},Ll=e=>e==="position"||e==="percentage",_l=e=>e==="image"||e==="url",Bl=e=>e==="length"||e==="size"||e==="bg-size",zl=e=>e==="length",y0=e=>e==="number",b0=e=>e==="family-name",Hl=e=>e==="shadow",v0=()=>{const e=Me("color"),t=Me("font"),n=Me("text"),r=Me("font-weight"),o=Me("tracking"),s=Me("leading"),i=Me("breakpoint"),a=Me("container"),c=Me("spacing"),d=Me("radius"),u=Me("shadow"),f=Me("inset-shadow"),h=Me("text-shadow"),x=Me("drop-shadow"),y=Me("blur"),m=Me("perspective"),b=Me("aspect"),C=Me("ease"),v=Me("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...k(),Y,K],j=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],A=()=>[Y,K,c],_=()=>[Nt,"full","auto",...A()],p=()=>[ut,"none","subgrid",Y,K],V=()=>["auto",{span:["full",ut,Y,K]},ut,Y,K],B=()=>[ut,"auto",Y,K],G=()=>["auto","min","max","fr",Y,K],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...A()],X=()=>[Nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],I=()=>[e,Y,K],q=()=>[...k(),na,ta,{position:[Y,K]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",p0,h0,{size:[Y,K]}],Q=()=>[Zr,ln,wt],W=()=>["","none","full",d,Y,K],U=()=>["",se,ln,wt],E=()=>["solid","dashed","dotted","double"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[se,Zr,na,ta],$=()=>["","none",y,Y,K],F=()=>["none",se,Y,K],L=()=>["none",se,Y,K],J=()=>[se,Y,K],R=()=>[Nt,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nt],breakpoint:[nt],color:[c0],container:[nt],"drop-shadow":[nt],ease:["in","out","in-out"],font:[f0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nt],shadow:[nt],spacing:["px",se],text:[nt],"text-shadow":[nt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nt,K,Y,b]}],container:["container"],columns:[{columns:[se,K,Y,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:S()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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:[ut,"auto",Y,K]}],basis:[{basis:[Nt,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,Nt,"auto","initial","none",K]}],grow:[{grow:["",se,Y,K]}],shrink:[{shrink:["",se,Y,K]}],order:[{order:[ut,"first","last","none",Y,K]}],"grid-cols":[{"grid-cols":p()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":p()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,ln,wt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y,Wr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zr,K]}],"font-family":[{font:[g0,K,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:[o,Y,K]}],"line-clamp":[{"line-clamp":[se,"none",Y,Wr]}],leading:[{leading:[s,...A()]}],"list-image":[{"list-image":["none",Y,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",Y,wt]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[se,"auto",Y,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,K]}],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",Y,K]}],"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:M()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ut,Y,K],radial:["",Y,K],conic:[ut,Y,K]},x0,m0]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...E(),"hidden","none"]}],"divide-style":[{divide:[...E(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...E(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,Y,K]}],"outline-w":[{outline:["",se,ln,wt]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",u,Bn,_n]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",f,Bn,_n]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[se,wt]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",h,Bn,_n]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[se,Y,K]}],"mix-blend":[{"mix-blend":[...D(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":D()}],"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":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Y,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,K]}],filter:[{filter:["","none",Y,K]}],blur:[{blur:$()}],brightness:[{brightness:[se,Y,K]}],contrast:[{contrast:[se,Y,K]}],"drop-shadow":[{"drop-shadow":["","none",x,Bn,_n]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",se,Y,K]}],"hue-rotate":[{"hue-rotate":[se,Y,K]}],invert:[{invert:["",se,Y,K]}],saturate:[{saturate:[se,Y,K]}],sepia:[{sepia:["",se,Y,K]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,K]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[se,Y,K]}],"backdrop-contrast":[{"backdrop-contrast":[se,Y,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,Y,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,Y,K]}],"backdrop-invert":[{"backdrop-invert":["",se,Y,K]}],"backdrop-opacity":[{"backdrop-opacity":[se,Y,K]}],"backdrop-saturate":[{"backdrop-saturate":[se,Y,K]}],"backdrop-sepia":[{"backdrop-sepia":["",se,Y,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",Y,K]}],ease:[{ease:["linear","initial",C,Y,K]}],delay:[{delay:[se,Y,K]}],animate:[{animate:["none",v,Y,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Y,K]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],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:[Y,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",Y,K]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Y,K]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[se,ln,wt,Wr]}],stroke:[{stroke:["none",...I()]}],"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"]}},w0=t0(v0);function Z(...e){return w0(Oo.clsx(e))}function S0(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 k0=Fo.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 C0({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?$g:"button";return l.jsx(s,{"data-slot":"button",className:Z(k0({variant:t,size:n,className:e})),...o})}function E0({onSend:e,className:t,disabled:n,...r}){const o=w.useRef(null),[s,i]=w.useState(""),a=d=>{var u,f;d.preventDefault(),(u=r.onSubmit)==null||u.call(r,d),e==null||e(s),i(""),(f=o.current)==null||f.focus({preventScroll:!0})},c=n||s.trim().length===0;return l.jsxs("form",{...r,onSubmit:a,className:Z("flex items-center rounded-md pl-1 text-sm",t),children:[l.jsx("input",{ref:o,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:s,onChange:d=>i(d.target.value),disabled:n}),l.jsx(C0,{size:"sm",type:"submit",variant:c?"secondary":"primary",disabled:c,className:"font-mono",children:"SEND"})]})}const T0=Fo.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 Ul({className:e,variant:t,size:n,...r}){return l.jsx(Ud.Root,{"data-slot":"toggle",className:Z(T0({variant:t,size:n,className:e})),...r})}function A0(e){const[t,n]=w.useState(()=>e.getPublishPermissions());return w.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},o=()=>{r()};return e.on("connection.connected",o),e.on("connection.disconnected",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o)}},[e]),t}function Zl(e){const[t,n]=w.useState(()=>e.getLocalParticipant()),[r,o]=w.useState(()=>e.getMicrophoneTrack());return w.useEffect(()=>{const s=()=>{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),o(c)};s(),e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("track.muted",s),e.on("track.unmuted",s);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),s()},c=()=>{console.log("🎤 Track unpublished, updating participant state"),s()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",c),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s),i.off("localTrackPublished",a),i.off("localTrackUnpublished",c)}}else return()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s)}},[e]),{localParticipant:t,microphoneTrack:r}}function yn(e,t,n){const[r,o]=w.useState(!1),[s,i]=w.useState(!1);return w.useEffect(()=>{const c=()=>{let d=!1;switch(t){case"microphone":d=e.isMicrophoneEnabled;break;case"camera":d=e.isCameraEnabled;break;case"screenShare":d=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,d),o(d)};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:s,toggle:async c=>{var d;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){(d=n==null?void 0:n.onDeviceError)==null||d.call(n,u)}finally{i(!1)}}}}function Wl(e){const[t,n]=w.useState(()=>e.getRoom()),[r,o]=w.useState(()=>e.getConnectionState());return w.useEffect(()=>{const s=()=>{n(e.getRoom()),o(e.getConnectionState())};return e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("connection.connecting",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("connection.connecting",s)}},[e]),t}function j0(e,t){const[n,r]=w.useState([]),[o,s]=w.useState("");return w.useEffect(()=>{var d;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(d=navigator.mediaDevices)==null||d.addEventListener("devicechange",c),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",c)}},[e,t]),{devices:n,activeDeviceId:o,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),s(a)}catch(c){console.error("Failed to set device:",c)}}}}function P0(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 Gl(e){const[t,n]=w.useState(()=>e.getIsAgentConnected()),[r,o]=w.useState(()=>e.getCurrentSession()),[s,i]=w.useState(()=>e.getCurrentAgentInfo()),[a,c]=w.useState(()=>e.getAgentState()),[d,u]=w.useState(()=>e.getAgentAudioTrack()),[f,h]=w.useState(()=>e.getAgentVideoTrack());return w.useEffect(()=>{const x=()=>{const T=e.getIsAgentConnected(),k=e.getCurrentSession(),S=e.getCurrentAgentInfo(),j=e.getAgentState(),P=e.getAgentAudioTrack(),A=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:T,hasSession:!!k,sessionId:k==null?void 0:k.id,hasAgentInfo:!!S,agentState:j,hasAudioTrack:!!P,hasVideoTrack:!!A}),n(T),o(k),i(S),c(j),u(P),h(A)};x();const y=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),x()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),x()},b=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),x()},C=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),x()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),x()};return e.on("agent.connected",y),e.on("agent.speaking",y),e.on("agent.thinking",y),e.on("agent.state.changed",v),e.on("connection.disconnected",m),e.on("session.created",b),e.on("session.ended",b),e.on("session.state.changed",b),e.on("connection.connected",C),()=>{e.off("agent.connected",y),e.off("agent.speaking",y),e.off("agent.thinking",y),e.off("agent.state.changed",v),e.off("connection.disconnected",m),e.off("session.created",b),e.off("session.ended",b),e.off("session.state.changed",b),e.off("connection.connected",C)}},[e]),{agent:{isActive:t,info:s},session:r,state:a,audioTrack:d,videoTrack:f}}function M0(e){const[t,n]=w.useState(()=>e.getVideoTrackRefs()),[r,o]=w.useState(()=>e.getCameraTrackRefs()),[s,i]=w.useState(()=>e.getScreenShareTrackRefs());return w.useEffect(()=>{const a=()=>{const d=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),f=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:d.length,cameraCount:u.length,screenShareCount:f.length}),n(d),o(u),i(f)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const c=e.getRoom();if(c){const d=()=>{console.log("📹 Track event, updating video tracks"),a()};return c.on("localTrackPublished",d),c.on("localTrackUnpublished",d),c.on("trackPublished",d),c.on("trackUnpublished",d),c.on("trackSubscribed",d),c.on("trackUnsubscribed",d),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),c.off("localTrackPublished",d),c.off("localTrackUnpublished",d),c.off("trackPublished",d),c.off("trackUnpublished",d),c.off("trackSubscribed",d),c.off("trackUnsubscribed",d)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:r,screenShareTrackRefs:s}}function ra({...e}){return l.jsx(He.Root,{"data-slot":"select",...e})}function oa({...e}){return l.jsx(He.Value,{"data-slot":"select-value",...e})}function sa({className:e,size:t="default",children:n,...r}){return l.jsxs(He.Trigger,{"data-slot":"select-trigger","data-size":t,className:Z(["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,l.jsx(He.Icon,{asChild:!0,children:l.jsx(vs,{weight:"bold",className:"size-4 transition-colors"})})]})}function ia({className:e,children:t,position:n="popper",...r}){return l.jsx(He.Portal,{children:l.jsxs(He.Content,{"data-slot":"select-content",className:Z(["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:[l.jsx(V0,{}),l.jsx(He.Viewport,{className:Z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx(N0,{})]})})}function aa({className:e,children:t,...n}){return l.jsxs(He.Item,{"data-slot":"select-item",className:Z(["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:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(He.ItemIndicator,{children:l.jsx(jl,{className:"size-4",weight:"bold"})})}),l.jsx(He.ItemText,{children:t})]})}function V0({className:e,...t}){return l.jsx(He.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Tl,{className:"size-4",weight:"bold"})})}function N0({className:e,...t}){return l.jsx(He.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(vs,{className:"size-4",weight:"bold"})})}const ca=Fo.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 la({kind:e,track:t,requestPermissions:n,onError:r,client:o,...s}){const i=s.size||"default";if(!o)return l.jsxs(ra,{disabled:!0,children:[l.jsx(sa,{className:Z(ca({size:i}),s.className),children:l.jsx(oa,{placeholder:`Select a ${e}`})}),l.jsx(ia,{children:l.jsx(aa,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:c,setActiveMediaDevice:d}=j0(o,e==="audioinput"?"audioinput":"videoinput");return l.jsxs(ra,{value:c,onValueChange:d,children:[l.jsx(sa,{className:Z(ca({size:i}),s.className,"hover:bg"),children:i!=="sm"&&l.jsx(oa,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),l.jsx(ia,{children:a.map(u=>l.jsx(aa,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function R0(e,t,n=!1){if(n)return ws;switch(e){case H.Track.Source.Microphone:return t?Pl:Ml;case H.Track.Source.Camera:return t?Nl:Rl;case H.Track.Source.ScreenShare:return Vl;default:return g.Fragment}}function Gr({source:e,pressed:t,pending:n,className:r,...o}){const s=R0(e,t??!1,n),i=e===H.Track.Source.Microphone&&!(t??!1)&&!n,a=e===H.Track.Source.Camera&&!(t??!1)&&!n;return g.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),l.jsxs(Ul,{pressed:t,"aria-label":`Toggle ${e}`,className:Z(r),...o,children:[l.jsx(s,{weight:"bold",className:Z(n&&"animate-spin",i||a?"text-red-500":void 0)}),o.children]})}function I0(e){return e?A0(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function D0(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,o={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:H.Track.Source.Microphone,publication:void 0},visibleControls:o,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:s,localParticipant:i}=Zl(r),a=I0(r);Wl(r);const c=yn(r,"microphone",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.Microphone,error:j})}}),d=yn(r,"camera",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.Camera,error:j})}}),u=yn(r,"screenShare",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.ScreenShare,error:j})}}),f=g.useMemo(()=>{let j;if(i){for(const[,P]of i.trackPublications)if(P.source===H.Track.Source.Microphone){j=P;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!j,isTrackSubscribed:j==null?void 0:j.isSubscribed,isMuted:j==null?void 0:j.isMuted,trackSid:j==null?void 0:j.trackSid}),{participant:i??void 0,source:H.Track.Source.Microphone,publication:j}},[i,s]);o.microphone??(o.microphone=a.microphone),o.screenShare??(o.screenShare=a.screenShare),o.camera??(o.camera=a.camera),o.chat??(o.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:x,saveVideoInputEnabled:y,saveVideoInputDeviceId:m}=P0({preventSave:!n}),b=g.useCallback(()=>{r&&(typeof r.endSession=="function"?(r.endSession(),console.log("✅ AgentControlBar: Session ended via client.endSession()")):(r.disconnect(),console.log("⚠️ AgentControlBar: Using fallback client.disconnect()")))},[r]),C=g.useCallback(j=>{x(j??"default"),r&&r.setAudioInputDevice(j)},[x,r]),v=g.useCallback(j=>{m(j??"default"),r&&r.setVideoInputDevice(j)},[m,r]),T=g.useCallback(async j=>{u.enabled&&await u.toggle(!1),await d.toggle(j),y(!d.enabled)},[d,y,u]),k=g.useCallback(async j=>{await c.toggle(j),h(!c.enabled)},[c,h]),S=g.useCallback(async j=>{d.enabled&&await d.toggle(!1),await u.toggle(j)},[d,u]);return{micTrackRef:f,visibleControls:o,cameraToggle:{...d,toggle:T},microphoneToggle:{...c,toggle:k},screenShareToggle:{...u,toggle:S},handleDisconnect:b,handleAudioDeviceChange:C,handleVideoDeviceChange:v}}const $0={card:"relative bg-gradient-to-br from-slate-950 via-slate-900 to-gray-950 border border-slate-800 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-slate-950/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-indigo-900/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-600/20 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-blue-600/15 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-purple-600 to-blue-600 rounded-full blur-sm opacity-25 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-slate-950 via-slate-900 to-gray-950 rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-slate-300",muted:"text-slate-400",accent:"text-white font-semibold"},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-24 h-24 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-16 h-16 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:" 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},F0={card:"relative bg-gradient-to-br from-sky-50 via-white to-indigo-50 border border-sky-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-sky-50/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-400/8 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-violet-400/15 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-rose-400/12 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-violet-500 rounded-full blur-sm opacity-35 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-rose-500 to-violet-500 rounded-full blur-sm opacity-25 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-sky-50 via-white to-indigo-50 rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-slate-900",secondary:"text-slate-700",muted:"text-slate-500",accent:"text-slate-900 font-semibold"},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-24 h-24 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-16 h-16 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},O0={card:"relative bg-gradient-to-br from-[#0a0a1a] via-[#171727] to-[#0f0f23] border border-[#2a2a4a] w-full h-full flex flex-col items-center justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#0a0a1a]/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/30 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/25 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-60 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-50 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#0a0a1a] via-[#171727] to-[#0f0f23] rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"text-white font-semibold"},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-24 h-24 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-16 h-16 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},da={dark:$0,light:F0,vox:O0};function Ne(e){return da[e]||da.vox}function L0({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:o,onChatOpenChange:s,onDisconnect:i,onDeviceError:a,theme:c="vox",client:d,...u}){var _;const[f,h]=g.useState(!1),[x,y]=g.useState(!1),m=Ne(c),{micTrackRef:b,visibleControls:C,cameraToggle:v,microphoneToggle:T,screenShareToggle:k,handleAudioDeviceChange:S,handleVideoDeviceChange:j,handleDisconnect:P}=D0({controls:e,saveUserChoices:t,client:d}),A=async p=>{y(!0);try{await(o==null?void 0:o(p))}finally{y(!1)}};return g.useEffect(()=>{s==null||s(f)},[f,s]),g.useEffect(()=>{var p,V,B,G;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!b.participant,hasPublication:!!b.publication,source:b.source,isSubscribed:(p=b.publication)==null?void 0:p.isSubscribed,isMuted:(V=b.publication)==null?void 0:V.isMuted,trackSid:(B=b.publication)==null?void 0:B.trackSid,hasTrack:!!((G=b.publication)!=null&&G.track)})},[b]),l.jsxs("div",{"aria-label":"Voice assistant controls",className:Z(m.controlBar,r),...u,children:[n.suportsChatInput&&l.jsxs("div",{inert:!f,className:Z("overflow-hidden transition-[height] relative duration-300 ease-in-out",f?"h-[64px] mb-3":"h-0"),children:[l.jsx("div",{className:"flex h-9 px-4 w-full",children:l.jsx(E0,{onSend:A,disabled:x,className:Z("w-full",m.chatInput)})}),l.jsx("hr",{className:"border-border my-2 mx-5"})]}),l.jsxs("div",{className:Z("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 text-gray-900":"bg-[#18182a]/80 text-white",(_=m.text)==null?void 0:_.primary),children:[l.jsxs("div",{className:"flex gap-y-2 justify-start",children:[C.microphone&&l.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Gr,{variant:"primary",source:H.Track.Source.Microphone,pressed:T.enabled,disabled:T.pending,onPressedChange:T.toggle,className:Z("w-auto py-2 rounded-none border-none bg-transparent transition-colors",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")}),l.jsx(Ie.BarVisualizer,{barCount:3,trackRef:b,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:l.jsx("span",{className:Z(["h-full w-0.5 origin-center rounded-2xl",c==="vox"||c==="dark"?"bg-white":"bg-gray-900","data-lk-muted:bg-muted"])})}),l.jsx(la,{size:"sm",kind:"audioinput",client:d,onError:a?p=>p instanceof Error?a({source:H.Track.Source.Microphone,error:p}):void 0:void 0,onActiveDeviceChange:S,className:Z(["h-full py-2 rounded-none border-none bg-transparent transition-colors","min-w-[2.5rem]",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"])})]}),n.suportsVideoInput&&C.camera&&l.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Gr,{variant:"primary",source:H.Track.Source.Camera,pressed:v.enabled,pending:v.pending,disabled:v.pending,onPressedChange:v.toggle,className:Z("w-auto py-2 rounded-none border-none bg-transparent transition-colors",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")}),l.jsx(la,{size:"sm",kind:"videoinput",client:d,onError:a?p=>p instanceof Error?a({source:H.Track.Source.Camera,error:p}):void 0:void 0,onActiveDeviceChange:j,className:Z(["h-full py-2 rounded-none border-none bg-transparent transition-colors","min-w-[2.5rem]",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"])})]}),n.suportsScreenShare&&C.screenShare&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:l.jsx(Gr,{variant:"secondary",source:H.Track.Source.ScreenShare,pressed:k.enabled,disabled:k.pending,onPressedChange:k.toggle,className:Z("w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent transition-colors",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")})})]}),C.chat&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:l.jsx(Ul,{variant:"secondary","aria-label":"Toggle chat",pressed:f,onPressedChange:p=>{h(p)},className:Z("aspect-square h-full py-3 rounded-none border-none bg-transparent transition-colors flex items-center",c==="vox"||c==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"),children:l.jsx(Al,{weight:"bold",className:"h-5 w-5"})})})]})]})}const _0=(e,t)=>{var a,c;const n=g.useMemo(()=>t?t(e.message):e.message,[e.message,t]),r=!!e.editTimestamp,o=new Date(e.timestamp),s=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:o,locale:s,name:i}},B0=({entry:e,messageFormatter:t,className:n,participantName:r,...o})=>{var u,f;const{message:s,time:i,locale:a}=_0(e,t),c=((u=e.from)==null?void 0:u.isLocal)??!1;Z("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 d=Z("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 l.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:Z("group flex mb-2",c?"justify-end":"justify-start",n),...o,children:l.jsxs("div",{className:Z("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:[l.jsx("span",{className:d,children:c?((f=r==null?void 0:r[0])==null?void 0:f.toUpperCase())||"U":"A"}),l.jsx("span",{className:Z("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:s})]})})};function z0(e){w.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 H0=({className:e,children:t,...n})=>{const r=w.useRef(null);return z0(r),l.jsx("div",{ref:r,className:Z("flex flex-col justify-end",e),...n,children:t})},U0=({state:e,audioTrack:t,className:n,ref:r})=>l.jsx("div",{ref:r,className:Z("",n),children:t?l.jsx(Ie.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Z("flex aspect-video w-40 items-center justify-center gap-1"),children:l.jsx("span",{className:Z(["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]"])})}):l.jsx("div",{className:Z("flex aspect-video w-40 items-center justify-center"),children:l.jsx("div",{className:"flex flex-col items-center justify-center",children:l.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((o,s)=>l.jsx("span",{className:Z(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},s))})})})}),Z0=({videoTrack:e,className:t,ref:n})=>{var r,o;return!e||!e.publication||!e.participant?l.jsx("div",{ref:n,className:Z(t),children:l.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:l.jsx("span",{className:"text-gray-500",children:"No video available"})})}):l.jsx("div",{ref:n,className:Z(t),children:l.jsx(Ie.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((o=e.publication.dimensions)==null?void 0:o.height)??0,className:"rounded-md"})})},W0=ie.create(Ie.VideoTrack),G0=({trackRef:e,className:t,ref:n})=>{var r,o;return l.jsx("div",{className:Z("bg-muted overflow-hidden rounded-md",t),children:l.jsx(W0,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((o=e==null?void 0:e.publication.dimensions)==null?void 0:o.height)??0,className:Z("h-full w-auto")})})},ua=ie.create(G0),K0=ie.create(U0),Y0=ie.create(Z0),rt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Rt={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 q0(e,t){const{localParticipant:n}=Zl(t),r=n==null?void 0:n.getTrackPublication(e);return w.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function X0({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:o="idle",audioTrack:s,videoTrack:i}=t?Gl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=Ie.useTracks([H.Track.Source.ScreenShare]),c=q0(H.Track.Source.Camera,t),d=c&&!c.publication.isMuted,u=a&&!a.publication.isMuted,f=d||u,h=n||r&&r.state==="active",x={...rt.transition,delay:e?0:.15},y={...rt.animate,scale:e?1:3,transition:x},m={...rt.animate,transition:x},b=x,C=x,v=i&&i.publication&&i.participant;return l.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:l.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:l.jsxs("div",{className:Z(Rt.grid),children:[h&&l.jsx("div",{className:Z(["grid",!e&&Rt.agentChatClosed,e&&f&&Rt.agentChatOpenWithSecondTile,e&&!f&&Rt.agentChatOpenWithoutSecondTile]),children:l.jsxs("div",{className:"h-full flex items-center justify-center",children:[!v&&l.jsx(K0,{layoutId:"agent",...rt,animate:y,transition:b,state:o,audioTrack:s||void 0,className:Z(e?"h-[90px]":"h-auto w-full")},"agent"),v&&i&&l.jsx(Y0,{layoutId:"avatar",...rt,animate:m,transition:C,videoTrack:i,className:Z(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),l.jsx("div",{className:Z(["grid",e&&Rt.secondTileChatOpen,!e&&Rt.secondTileChatClosed]),children:l.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&d&&l.jsx(ua,{layout:"position",layoutId:"camera",...rt,trackRef:c,transition:{...rt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&l.jsx(ua,{layout:"position",layoutId:"screen",...rt,trackRef:a,transition:{...rt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function fa({timeout:e}){const[t,n]=w.useState(100),r=w.useRef(null),o=w.useRef(null);return w.useEffect(()=>{if(!e||e<=0)return;n(100),o.current=Date.now();const s=()=>{if(!e||o.current===null)return;const i=Date.now()-o.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(r.current=requestAnimationFrame(s))};return r.current=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:l.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:l.jsx(ie.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 Xt({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:o}){var a;if(!e||!e.isVisible||!e.component)return null;const[s]=g.useState(()=>Date.now()),i=()=>e.component?g.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async d=>{console.log("InteractiveComponent: Loading data:",d)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:o}):l.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return l.jsx(Wt,{children:l.jsxs(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx(fa,{timeout:e.timeout}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[l.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())}),l.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:l.jsx(Pe.X,{className:"w-5 h-5"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return l.jsx(Wt,{children:l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg z-50 relative",style:{zIndex:50},children:l.jsxs("div",{children:[l.jsx(fa,{timeout:e.timeout}),i()]})})})}}function J0(){const e=Ie.useTranscriptions(),t=Ie.useChat(),n=Ie.useRoomContext();return{messages:w.useMemo(()=>[...e.map(s=>S0(s,n)),...t.chatMessages].sort((s,i)=>s.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const Q0=({logLevel:e}={})=>{const t=Ie.useRoomContext();g.useEffect(()=>(H.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},ha=e=>e,ep=()=>{let e=ha;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ha}}},tp=ep();function pt(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 Mt(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":pt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Hn={exports:{}},le={};/** @license React v16.13.1
|
|
9
|
+
`),()=>{m.contains(b)&&m.removeChild(b)}},[t]),c.jsx(zf,{isPresent:t,childRef:s,sizeRef:i,children:g.cloneElement(e,{ref:s})})}const Uf=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,root:l})=>{const d=Bo(Zf),u=w.useId();let f=!0,h=w.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:x=>{d.set(x,!0);for(const b of d.values())if(!b)return;r&&r()},register:x=>(d.set(x,!1),()=>d.delete(x))}),[n,d,r]);return s&&f&&(h={...h}),w.useMemo(()=>{d.forEach((x,b)=>d.set(b,!1))},[n]),g.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),i==="popLayout"&&(e=c.jsx(Hf,{isPresent:n,anchorX:a,root:l,children:e})),c.jsx(dr.Provider,{value:h,children:e})};function Zf(){return new Map}function Ll(e=!0){const t=w.useContext(dr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const On=e=>e.key||"";function si(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const Wt=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",root:l})=>{const[d,u]=Ll(i),f=w.useMemo(()=>si(e),[e]),h=i&&!d?[]:f.map(On),x=w.useRef(!0),b=w.useRef(f),m=Bo(()=>new Map),[y,C]=w.useState(f),[v,T]=w.useState(f);Ka(()=>{x.current=!1,b.current=f;for(let j=0;j<v.length;j++){const P=On(v[j]);h.includes(P)?m.delete(P):m.get(P)!==!0&&m.set(P,!1)}},[v,h.length,h.join("-")]);const k=[];if(f!==y){let j=[...f];for(let P=0;P<v.length;P++){const A=v[P],_=On(A);h.includes(_)||(j.splice(P,0,A),k.push(A))}return s==="wait"&&k.length&&(j=k),T(si(j)),C(f),null}process.env.NODE_ENV!=="production"&&s==="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:S}=w.useContext(_o);return c.jsx(c.Fragment,{children:v.map(j=>{const P=On(j),A=i&&!d?!1:f===v||h.includes(P),_=()=>{if(m.has(P))m.set(P,!0);else return;let p=!0;m.forEach(V=>{V||(p=!1)}),p&&(S==null||S(),T(b.current),i&&(u==null||u()),r&&r())};return c.jsx(Uf,{isPresent:A,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:l,onExitComplete:A?void 0:_,anchorX:a,children:j},P)})})},_l=w.createContext({strict:!1}),ii={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"]},qt={};for(const e in ii)qt[e]={isEnabled:t=>ii[e].some(n=>!!t[n])};function Wf(e){for(const t in e)qt[t]={...qt[t],...e[t]}}const Gf=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 or(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gf.has(e)}let Bl=e=>!or(e);function Kf(e){typeof e=="function"&&(Bl=t=>t.startsWith("on")?!or(t):e(t))}try{Kf(require("@emotion/is-prop-valid").default)}catch{}function Yf(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Bl(o)||n===!0&&or(o)||!t&&!or(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const ur=w.createContext({});function fr(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function kn(e){return typeof e=="string"||Array.isArray(e)}const us=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fs=["initial",...us];function hr(e){return fr(e.animate)||fs.some(t=>kn(e[t]))}function zl(e){return!!(hr(e)||e.variants)}function qf(e,t){if(hr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kn(n)?n:void 0,animate:kn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=qf(e,w.useContext(ur));return w.useMemo(()=>({initial:t,animate:n}),[ai(t),ai(n)])}function ai(e){return Array.isArray(e)?e.join(" "):e}const Cn={};function Jf(e){for(const t in e)Cn[t]=e[t],qo(t)&&(Cn[t].isCSSVariable=!0)}function Hl(e,{layout:t,layoutId:n}){return nn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cn[e]||e==="opacity")}const Qf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eh=tn.length;function th(e,t,n){let r="",o=!0;for(let s=0;s<eh;s++){const i=tn[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const d=Rl(a,as[i]);if(!l){o=!1;const u=Qf[i]||i;r+=`${u}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function hs(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const d=t[l];if(nn.has(l)){i=!0;continue}else if(qo(l)){o[l]=d;continue}else{const u=Rl(d,as[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=th(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:d="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${d} ${u}`}}const ms=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ul(e,t,n){for(const r in t)!De(t[r])&&!Hl(r,n)&&(e[r]=t[r])}function nh({transformTemplate:e},t){return w.useMemo(()=>{const n=ms();return hs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rh(e,t){const n=e.style||{},r={};return Ul(r,n,e),Object.assign(r,nh(e,t)),r}function oh(e,t){const n={},r=rh(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 sh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ih={offset:"strokeDashoffset",array:"strokeDasharray"};function ah(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?sh:ih;e[s.offset]=ee.transform(-r);const i=ee.transform(t),a=ee.transform(n);e[s.array]=`${i} ${a}`}function Zl(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},l,d,u){if(hs(e,a,d),l){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),o!==void 0&&ah(f,o,s,i,!1)}const Wl=()=>({...ms(),attrs:{}}),Gl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lh(e,t,n,r){const o=w.useMemo(()=>{const s=Wl();return Zl(s,t,Gl(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Ul(s,e.style,e),o.style={...s,...o.style}}return o}const ch=["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 gs(e){return typeof e!="string"||e.includes("-")?!1:!!(ch.indexOf(e)>-1||/[A-Z]/u.test(e))}function dh(e,t,n,{latestValues:r},o,s=!1){const a=(gs(e)?lh:oh)(t,r,o,e),l=Yf(t,typeof e=="string",s),d=e!==w.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=w.useMemo(()=>De(u)?u.get():u,[u]);return w.createElement(e,{...d,children:f})}function li(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ps(e,t,n,r){if(typeof t=="function"){const[o,s]=li(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=li(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function qn(e){return De(e)?e.get():e}function uh({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:fh(n,r,o,e),renderState:t()}}function fh(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=qn(s[h]);let{initial:i,animate:a}=e;const l=hr(e),d=zl(e);t&&d&&!l&&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"&&!fr(f)){const h=Array.isArray(f)?f:[f];for(let x=0;x<h.length;x++){const b=ps(e,h[x]);if(b){const{transitionEnd:m,transition:y,...C}=b;for(const v in C){let T=C[v];if(Array.isArray(T)){const k=u?T.length-1:0;T=T[k]}T!==null&&(o[v]=T)}for(const v in m)o[v]=m[v]}}}return o}const Kl=e=>(t,n)=>{const r=w.useContext(ur),o=w.useContext(dr),s=()=>uh(e,t,r,o);return n?s():Bo(s)};function xs(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(De(r[i])||t.style&&De(t.style[i])||Hl(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const hh=Kl({scrapeMotionValuesFromProps:xs,createRenderState:ms});function Yl(e,t,n){const r=xs(e,t,n);for(const o in e)if(De(e[o])||De(t[o])){const s=tn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const mh=Kl({scrapeMotionValuesFromProps:Yl,createRenderState:Wl}),gh=Symbol.for("motionComponentSymbol");function zt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ph(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):zt(n)&&(n.current=r))},[t])}const bs=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xh="framerAppearId",ql="data-"+bs(xh),Xl=w.createContext({});function bh(e,t,n,r,o){var m,y;const{visualElement:s}=w.useContext(ur),i=w.useContext(_l),a=w.useContext(dr),l=w.useContext(ds).reducedMotion,d=w.useRef(null);r=r||i.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=d.current,f=w.useContext(Xl);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&yh(d.current,n,o,f);const h=w.useRef(!1);w.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const x=n[ql],b=w.useRef(!!x&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,x))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,x)));return Ka(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),b.current&&u.animationState&&u.animationState.animateChanges())}),w.useEffect(()=>{u&&(!b.current&&u.animationState&&u.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,x)}),b.current=!1),u.enteringChildren=void 0)}),u}function yh(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jl(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&zt(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:d})}function Jl(e){if(e)return e.options.allowProjection!==!1?e.projection:Jl(e.parent)}function $r(e,{forwardMotionProps:t=!1}={},n,r){n&&Wf(n);const o=gs(e)?mh:hh;function s(a,l){let d;const u={...w.useContext(ds),...a,layoutId:vh(a)},{isStatic:f}=u,h=Xf(a),x=o(a,f);if(!f&&zo){wh(u,n);const b=Sh(u);d=b.MeasureLayout,h.visualElement=bh(e,x,u,r,b.ProjectionNode)}return c.jsxs(ur.Provider,{value:h,children:[d&&h.visualElement?c.jsx(d,{visualElement:h.visualElement,...u}):null,dh(e,a,ph(x,h.visualElement,l),x,f,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=w.forwardRef(s);return i[gh]=e,i}function vh({layoutId:e}){const t=w.useContext(_o).id;return t&&e!==void 0?t+"-"+e:e}function wh(e,t){const n=w.useContext(_l).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?Qt(!1,r,"lazy-strict-mode"):at(!1,r,"lazy-strict-mode")}}function Sh(e){const{drag:t,layout:n}=qt;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 kh(e,t){if(typeof Proxy>"u")return $r;const n=new Map,r=(s,i)=>$r(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Go(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,$r(i,void 0,e,t)),n.get(i))})}function Ql({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ch({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Eh(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 Fr(e){return e===void 0||e===1}function wo({scale:e,scaleX:t,scaleY:n}){return!Fr(e)||!Fr(t)||!Fr(n)}function St(e){return wo(e)||ec(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ec(e){return ci(e.x)||ci(e.y)}function ci(e){return e&&e!=="0%"}function sr(e,t,n){const r=e-n,o=t*r;return n+o}function di(e,t,n,r,o){return o!==void 0&&(e=sr(e,o,r)),sr(e,n,r)+t}function So(e,t=0,n=1,r,o){e.min=di(e.min,t,n,r,o),e.max=di(e.max,t,n,r,o)}function tc(e,{x:t,y:n}){So(e.x,t.translate,t.scale,t.originPoint),So(e.y,n.translate,n.scale,n.originPoint)}const ui=.999999999999,fi=1.0000000000001;function Th(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ut(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,tc(e,i)),r&&St(s.latestValues)&&Ut(e,s.latestValues))}t.x<fi&&t.x>ui&&(t.x=1),t.y<fi&&t.y>ui&&(t.y=1)}function Ht(e,t){e.min=e.min+t,e.max=e.max+t}function hi(e,t,n,r,o=.5){const s=we(e.min,e.max,o);So(e,t,n,s,r)}function Ut(e,t){hi(e.x,t.x,t.scaleX,t.scale,t.originX),hi(e.y,t.y,t.scaleY,t.scale,t.originY)}function nc(e,t){return Ql(Eh(e.getBoundingClientRect(),t))}function Ah(e,t,n){const r=nc(e,n),{scroll:o}=t;return o&&(Ht(r.x,o.offset.x),Ht(r.y,o.offset.y)),r}const mi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zt=()=>({x:mi(),y:mi()}),gi=()=>({min:0,max:0}),Te=()=>({x:gi(),y:gi()}),ko={current:null},rc={current:!1};function jh(){if(rc.current=!0,!!zo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ko.current=e.matches;e.addEventListener("change",t),t()}else ko.current=!1}const Ph=new WeakMap;function Mh(e,t,n){for(const r in t){const o=t[r],s=n[r];if(De(o))e.addValue(r,o);else if(De(s))e.addValue(r,Yt(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Yt(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,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=ss,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=Fe.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ye.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=hr(n),this.isVariantNode=zl(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 x=f[h];l[h]!==void 0&&De(x)&&x.set(l[h])}}mount(t){var n;this.current=t,Ph.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,o)=>this.bindToMotionValue(o,r)),rc.current||jh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ko.current,process.env.NODE_ENV!=="production"&&Go(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(),mt(this.notifyUpdate),mt(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=nn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 qt){const n=qt[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}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<pi.length;r++){const o=pi[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Mh(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=Yt(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"&&(Ya(r)||Xa(r))?r=parseFloat(r):!Bf(r)&>.test(n)&&(r=Nl(t,n)),this.setBaseTarget(t,De(r)?r.get():r)),De(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ps(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!De(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Wo),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ls.render(this.render)}}class oc extends Vh{constructor(){super(...arguments),this.KeyframeResolver=Pf}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;De(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sc(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function Nh(e){return window.getComputedStyle(e)}class Rh extends oc{constructor(){super(...arguments),this.type="html",this.renderInstance=sc}readValueFromInstance(t,n){var r;if(nn.has(n))return(r=this.projection)!=null&&r.isProjecting?mo(n):Wu(t,n);{const o=Nh(t),s=(qo(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return nc(t,n)}build(t,n,r){hs(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}}const ic=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 Ih(e,t,n,r){sc(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(ic.has(o)?o:bs(o),t.attrs[o])}class Dh extends oc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(nn.has(n)){const r=Vl(n);return r&&r.default||0}return n=ic.has(n)?n:bs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Yl(t,n,r)}build(t,n,r){Zl(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Ih(t,n,r,o)}mount(t){this.isSVGTag=Gl(t.tagName),super.mount(t)}}const $h=(e,t)=>gs(e)?new Dh(t):new Rh(t,{allowProjection:e!==w.Fragment});function Gt(e,t,n){const r=e.getProps();return ps(r,t,n!==void 0?n:r.custom,e)}const Co=e=>Array.isArray(e);function Fh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yt(n))}function Oh(e){return Co(e)?e[e.length-1]||0:e}function Lh(e,t){const n=Gt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Oh(s[i]);Fh(e,i,a)}}function _h(e){return!!(De(e)&&e.add)}function Eo(e,t){const n=e.getValue("willChange");if(_h(n))return n.add(t);if(!n&<.WillChange){const r=new lt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ac(e){return e.props[ql]}const Bh=e=>e!==null;function zh(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Bh),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const Hh={type:"spring",stiffness:500,damping:25,restSpeed:10},Uh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Zh={type:"keyframes",duration:.8},Wh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gh=(e,{keyframes:t})=>t.length>2?Zh:nn.has(e)?e.startsWith("scale")?Uh(t[1]):Hh:Wh;function Kh({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:d,...u}){return!!Object.keys(u).length}const ys=(e,t,n,r={},o,s)=>i=>{const a=is(r,e)||{},l=a.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ke(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Kh(a)||Object.assign(u,Gh(e,u)),u.duration&&(u.duration=Ke(u.duration)),u.repeatDelay&&(u.repeatDelay=Ke(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(yo(u),u.delay===0&&(f=!0)),(lt.instantAnimations||lt.skipAnimations)&&(f=!0,yo(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=zh(u.keyframes,a);if(h!==void 0){ye.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new os(u):new pf(u)};function Yh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function lc(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const l=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||d&&Yh(d,u))continue;const x={delay:n,...is(s||{},u)},b=f.get();if(b!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===b&&!x.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const C=ac(e);if(C){const v=window.MotionHandoffAnimation(C,u,ye);v!==null&&(x.startTime=v,m=!0)}}Eo(e,u),f.start(ys(u,f,h,e.shouldReduceMotion&&jl.has(u)?{type:!1}:x,e,m));const y=f.animation;y&&l.push(y)}return i&&Promise.all(l).then(()=>{ye.update(()=>{i&&Lh(e,i)})}),l}function cc(e,t,n,r=0,o=1){const s=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}function To(e,t,n={}){var l;const r=Gt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(lc(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=o;return qh(e,t,d,u,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[d,u]=a==="beforeChildren"?[s,i]:[i,s];return d().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function qh(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(To(l,t,{...i,delay:n+(typeof r=="function"?0:r)+cc(e.variantChildren,l,r,o,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Xh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>To(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=To(e,t,n);else{const o=typeof t=="function"?Gt(e,t,n.custom):t;r=Promise.all(lc(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function dc(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 Jh=fs.length;function uc(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uc(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jh;n++){const r=fs[n],o=e.props[r];(kn(o)||o===!1)&&(t[r]=o)}return t}const Qh=[...us].reverse(),em=us.length;function tm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Xh(e,n,r)))}function nm(e){let t=tm(e),n=xi(),r=!0;const o=l=>(d,u)=>{var h;const f=Gt(e,u,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:x,transitionEnd:b,...m}=f;d={...d,...m,...b}}return d};function s(l){t=l(e)}function i(l){const{props:d}=e,u=uc(e.parent)||{},f=[],h=new Set;let x={},b=1/0;for(let y=0;y<em;y++){const C=Qh[y],v=n[C],T=d[C]!==void 0?d[C]:u[C],k=kn(T),S=C===l?v.isActive:null;S===!1&&(b=y);let j=T===u[C]&&T!==d[C]&&k;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...x},!v.isActive&&S===null||!T&&!v.prevProp||fr(T)||typeof T=="boolean")continue;const P=rm(v.prevProp,T);let A=P||C===l&&v.isActive&&!j&&k||y>b&&k,_=!1;const p=Array.isArray(T)?T:[T];let V=p.reduce(o(C),{});S===!1&&(V={});const{prevResolvedValues:B={}}=v,G={...B,...V},te=X=>{A=!0,h.has(X)&&(_=!0,h.delete(X)),v.needsAnimating[X]=!0;const I=e.getValue(X);I&&(I.liveStyle=!1)};for(const X in G){const I=V[X],q=B[X];if(x.hasOwnProperty(X))continue;let M=!1;Co(I)&&Co(q)?M=!dc(I,q):M=I!==q,M?I!=null?te(X):h.add(X):I!==void 0&&h.has(X)?te(X):v.protectedKeys[X]=!0}v.prevProp=T,v.prevResolvedValues=V,v.isActive&&(x={...x,...V}),r&&e.blockInitialAnimation&&(A=!1);const ne=j&&P;A&&(!ne||_)&&f.push(...p.map(X=>{const I={type:C};if(typeof X=="string"&&r&&!ne&&e.manuallyAnimateOnMount&&e.parent){const{parent:q}=e,M=Gt(q,X);if(q.enteringChildren&&M){const{delayChildren:z}=M.transition||{};I.delay=cc(q.enteringChildren,e,z)}}return{animation:X,options:I}}))}if(h.size){const y={};if(typeof d.initial!="boolean"){const C=Gt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);C&&C.transition&&(y.transition=C.transition)}h.forEach(C=>{const v=e.getBaseTarget(C),T=e.getValue(C);T&&(T.liveStyle=!0),y[C]=v??null}),f.push({animation:y})}let m=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function a(l,d){var f;if(n[l].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var x;return(x=h.animationState)==null?void 0:x.setActive(l,d)}),n[l].isActive=d;const u=i(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=xi(),r=!0}}}function rm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dc(t,e):!1}function vt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xi(){return{animate:vt(!0),whileInView:vt(),whileHover:vt(),whileTap:vt(),whileDrag:vt(),whileFocus:vt(),exit:vt()}}class bt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class om extends bt{constructor(t){super(t),t.animationState||(t.animationState=nm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fr(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 sm=0;class im extends bt{constructor(){super(...arguments),this.id=sm++}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 o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 am={animation:{Feature:om},exit:{Feature:im}};function En(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mn(e){return{point:{x:e.pageX,y:e.pageY}}}const lm=e=>t=>cs(t)&&e(t,Mn(t));function gn(e,t,n,r){return En(e,t,lm(n),r)}const fc=1e-4,cm=1-fc,dm=1+fc,hc=.01,um=0-hc,fm=0+hc;function $e(e){return e.max-e.min}function hm(e,t,n){return Math.abs(e-t)<=n}function bi(e,t,n,r=.5){e.origin=r,e.originPoint=we(t.min,t.max,e.origin),e.scale=$e(n)/$e(t),e.translate=we(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cm&&e.scale<=dm||isNaN(e.scale))&&(e.scale=1),(e.translate>=um&&e.translate<=fm||isNaN(e.translate))&&(e.translate=0)}function pn(e,t,n,r){bi(e.x,t.x,n.x,r?r.originX:void 0),bi(e.y,t.y,n.y,r?r.originY:void 0)}function yi(e,t,n){e.min=n.min+t.min,e.max=e.min+$e(t)}function mm(e,t,n){yi(e.x,t.x,n.x),yi(e.y,t.y,n.y)}function vi(e,t,n){e.min=t.min-n.min,e.max=e.min+$e(t)}function xn(e,t,n){vi(e.x,t.x,n.x),vi(e.y,t.y,n.y)}function Be(e){return[e("x"),e("y")]}const mc=({current:e})=>e?e.ownerDocument.defaultView:null,wi=(e,t)=>Math.abs(e-t);function gm(e,t){const n=wi(e.x,t.x),r=wi(e.y,t.y);return Math.sqrt(n**2+r**2)}class gc{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!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=Lr(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,b=gm(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!b)return;const{point:m}=h,{timestamp:y}=Ve;this.history.push({...m,timestamp:y});const{onStart:C,onMove:v}=this.handlers;x||(C&&C(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,x)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Or(x,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(h,x)=>{this.end();const{onEnd:b,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Lr(h.type==="pointercancel"?this.lastMoveEventInfo:Or(x,this.transformPagePoint),this.history);this.startEvent&&b&&b(h,C),m&&m(h,C)},!cs(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const a=Mn(t),l=Or(a,this.transformPagePoint),{point:d}=l,{timestamp:u}=Ve;this.history=[{...d,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Lr(l,this.history)),this.removeListeners=An(gn(this.contextWindow,"pointermove",this.handlePointerMove),gn(this.contextWindow,"pointerup",this.handlePointerUp),gn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),mt(this.updatePoint)}}function Or(e,t){return t?{point:t(e.point)}:e}function Si(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lr({point:e},t){return{point:e,delta:Si(e,pc(t)),offset:Si(e,pm(t)),velocity:xm(t,.1)}}function pm(e){return e[0]}function pc(e){return e[e.length-1]}function xm(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ke(t)));)n--;if(!r)return{x:0,y:0};const s=Je(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function bm(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function ki(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 ym(e,{top:t,left:n,bottom:r,right:o}){return{x:ki(e.x,n,o),y:ki(e.y,t,r)}}function Ci(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 vm(e,t){return{x:Ci(e.x,t.x),y:Ci(e.y,t.y)}}function wm(e,t){let n=.5;const r=$e(e),o=$e(t);return o>r?n=vn(t.min,t.max-r,e.min):r>o&&(n=vn(e.min,e.max-o,t.min)),it(0,1,n)}function Sm(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 Ao=.35;function km(e=Ao){return e===!1?e=0:e===!0&&(e=Ao),{x:Ei(e,"left","right"),y:Ei(e,"top","bottom")}}function Ei(e,t,n){return{min:Ti(e,t),max:Ti(e,n)}}function Ti(e,t){return typeof e=="number"?e:e[t]||0}const Cm=new WeakMap;class Em{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=Te(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mn(f).point)},i=(f,h)=>{const{drag:x,dragPropagation:b,onDragStart:m}=this.getProps();if(x&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(x),!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),Be(C=>{let v=this.getAxisMotionValue(C).get()||0;if(Qe.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[C];k&&(v=$e(k)*(parseFloat(v)/100))}}this.originPoint[C]=v}),m&&ye.postRender(()=>m(f,h)),Eo(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:x,dragDirectionLock:b,onDirectionLock:m,onDrag:y}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=h;if(b&&this.currentDirection===null){this.currentDirection=Tm(C),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,C),this.updateAxis("y",h.point,C),this.visualElement.render(),y&&y(f,h)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>Be(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 gc(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:mc(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(r,o))}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:o}=this.getProps();if(!r||!Ln(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=bm(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&zt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ym(r.layoutBox,t):this.constraints=!1,this.elastic=km(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Be(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sm(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zt(t))return!1;const r=t.current;at(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:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Ah(r,o.root,this.visualElement.getTransformPagePoint());let i=vm(o.layout.layoutBox,s);if(n){const a=n(Ch(i));this.hasMutatedConstraints=!!a,a&&(i=Ql(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},d=Be(u=>{if(!Ln(u,n,this.currentDirection))return;let f=l&&l[u]||{};i&&(f={min:0,max:0});const h=o?200:1e6,x=o?40:1e7,b={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,b)});return Promise.all(d).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Eo(this.visualElement,t),r.start(ys(t,r,0,n,this.visualElement,!1))}stopAnimation(){Be(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Be(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(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Be(n=>{const{drag:r}=this.getProps();if(!Ln(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-we(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Be(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=wm({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Be(i=>{if(!Ln(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:d}=this.constraints[i];a.set(we(l,d,o[i]))})}addListeners(){if(!this.visualElement.current)return;Cm.set(this.visualElement,this);const t=this.visualElement.current,n=gn(t,"pointerdown",l=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();zt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ye.read(r);const i=En(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Be(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Ao,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Ln(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tm(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Am extends bt{constructor(t){super(t),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new Em(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ai=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class jm extends bt{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(t){this.session=new gc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:mc(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ai(t),onStart:Ai(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ye.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=gn(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 Xn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ln={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ee.test(e))e=parseFloat(e);else return e;const n=ji(e,t.target.x),r=ji(e,t.target.y);return`${n}% ${r}%`}},Pm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=gt.parse(e);if(o.length>5)return r;const s=gt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const d=we(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=d),typeof o[3+i]=="number"&&(o[3+i]/=d),s(o)}};let _r=!1;class Mm extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;Jf(Vm),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),_r&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Xn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,_r=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ye.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ls.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;_r=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xc(e){const[t,n]=Ll(),r=w.useContext(_o);return c.jsx(Mm,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Xl),isPresent:t,safeToRemove:n})}const Vm={borderRadius:{...ln,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ln,borderTopRightRadius:ln,borderBottomLeftRadius:ln,borderBottomRightRadius:ln,boxShadow:Pm};function Nm(e,t,n){const r=De(e)?e:Yt(e);return r.start(ys("",r,t,n)),r.animation}const Rm=(e,t)=>e.depth-t.depth;class Im{constructor(){this.children=[],this.isDirty=!1}add(t){Ho(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rm),this.isDirty=!1,this.children.forEach(t)}}function Dm(e,t){const n=Fe.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(mt(r),e(s-t))};return ye.setup(r,!0),()=>mt(r)}const bc=["TopLeft","TopRight","BottomLeft","BottomRight"],$m=bc.length,Pi=e=>typeof e=="string"?parseFloat(e):e,Mi=e=>typeof e=="number"||ee.test(e);function Fm(e,t,n,r,o,s){o?(e.opacity=we(0,n.opacity??1,Om(r)),e.opacityExit=we(t.opacity??1,0,Lm(r))):s&&(e.opacity=we(t.opacity??1,n.opacity??1,r));for(let i=0;i<$m;i++){const a=`border${bc[i]}Radius`;let l=Vi(t,a),d=Vi(n,a);if(l===void 0&&d===void 0)continue;l||(l=0),d||(d=0),l===0||d===0||Mi(l)===Mi(d)?(e[a]=Math.max(we(Pi(l),Pi(d),r),0),(Qe.test(d)||Qe.test(l))&&(e[a]+="%")):e[a]=d}(t.rotate||n.rotate)&&(e.rotate=we(t.rotate||0,n.rotate||0,r))}function Vi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Om=yc(0,.5,sl),Lm=yc(.5,.95,Ue);function yc(e,t,n){return r=>r<e?0:r>t?1:n(vn(e,t,r))}function Ni(e,t){e.min=t.min,e.max=t.max}function _e(e,t){Ni(e.x,t.x),Ni(e.y,t.y)}function Ri(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ii(e,t,n,r,o){return e-=t,e=sr(e,1/n,r),o!==void 0&&(e=sr(e,1/o,r)),e}function _m(e,t=0,n=1,r=.5,o,s=e,i=e){if(Qe.test(t)&&(t=parseFloat(t),t=we(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=we(s.min,s.max,r);e===s&&(a-=t),e.min=Ii(e.min,t,n,a,o),e.max=Ii(e.max,t,n,a,o)}function Di(e,t,[n,r,o],s,i){_m(e,t[n],t[r],t[o],t.scale,s,i)}const Bm=["x","scaleX","originX"],zm=["y","scaleY","originY"];function $i(e,t,n,r){Di(e.x,t,Bm,n?n.x:void 0,r?r.x:void 0),Di(e.y,t,zm,n?n.y:void 0,r?r.y:void 0)}function Fi(e){return e.translate===0&&e.scale===1}function vc(e){return Fi(e.x)&&Fi(e.y)}function Oi(e,t){return e.min===t.min&&e.max===t.max}function Hm(e,t){return Oi(e.x,t.x)&&Oi(e.y,t.y)}function Li(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wc(e,t){return Li(e.x,t.x)&&Li(e.y,t.y)}function _i(e){return $e(e.x)/$e(e.y)}function Bi(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Um{constructor(){this.members=[]}add(t){Ho(this.members,t),t.scheduleRender()}remove(t){if(Uo(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(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;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:o}=t.options;o===!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 Zm(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:f,rotateY:h,skewX:x,skewY:b}=n;d&&(r=`perspective(${d}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),x&&(r+=`skewX(${x}deg) `),b&&(r+=`skewY(${b}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Br=["","X","Y","Z"],Wm=1e3;let Gm=0;function zr(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ac(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sc(r)}function kc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Gm++,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(qm),this.nodes.forEach(eg),this.nodes.forEach(tg),this.nodes.forEach(Xm)},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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Im)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Wo),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Ol(i)&&!Lf(i),this.instance=i;const{layoutId:a,layout:l,visualElement:d}=this.options;if(d&&!d.current&&d.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{f=window.innerWidth}),e(i,()=>{const x=window.innerWidth;x!==f&&(f=x,this.root.updateBlockedByResize=!0,u&&u(),u=Dm(h,250),Xn.hasAnimatedSinceResize&&(Xn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ui)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||ig,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=d.getProps(),C=!this.targetLayout||!wc(this.targetLayout,x),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...is(b,"layout"),onPlay:m,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(u,v)}else f||Ui(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(),mt(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(ng),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&&Sc(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:l}=this.options;if(a===void 0&&!l)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qm),this.nodes.forEach(Km),this.nodes.forEach(Ym)):this.nodes.forEach(Hi),this.clearAllSnapshots();const a=Fe.now();Ve.delta=it(0,1e3/60,a-Ve.timestamp),Ve.timestamp=a,Ve.isProcessing=!0,Mr.update.process(Ve),Mr.preRender.process(Ve),Mr.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ls.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jm),this.sharedNodes.forEach(rg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$e(this.snapshot.measuredBox.x)&&!$e(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),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 l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!vc(this.projectionDelta),l=this.getTransformTemplate(),d=l?l(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;i&&this.instance&&(a||St(this.latestValues)||u)&&(o(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),ag(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:i}=this.options;if(!i)return Te();const a=i.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(lg))){const{scroll:u}=this.root;u&&(Ht(a.x,u.offset.x),Ht(a.y,u.offset.y))}return a}removeElementScroll(i){var l;const a=Te();if(_e(a,i),(l=this.scroll)!=null&&l.wasRoot)return a;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&_e(a,i),Ht(a.x,f.offset.x),Ht(a.y,f.offset.y))}return a}applyTransform(i,a=!1){const l=Te();_e(l,i);for(let d=0;d<this.path.length;d++){const u=this.path[d];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ut(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),St(u.latestValues)&&Ut(l,u.latestValues)}return St(this.latestValues)&&Ut(l,this.latestValues),l}removeTransform(i){const a=Te();_e(a,i);for(let l=0;l<this.path.length;l++){const d=this.path[l];if(!d.instance||!St(d.latestValues))continue;wo(d.latestValues)&&d.updateSnapshot();const u=Te(),f=d.measurePageBox();_e(u,f),$i(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return St(this.latestValues)&&$i(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!==Ve.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 l=!!this.resumingFrom||this!==a;if(!(i||l&&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=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),xn(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),_e(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_e(this.target,this.layout.layoutBox),tc(this.target,this.targetDelta)):_e(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),xn(this.relativeTargetOrigin,this.target,x.target),_e(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||wo(this.parent.latestValues)||ec(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 b;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let l=!0;if((this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(l=!1),l)return;const{layout:d,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||!(d||u))return;_e(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Th(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=Te());const{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ri(this.prevProjectionDelta.x,this.projectionDelta.x),Ri(this.prevProjectionDelta.y,this.projectionDelta.y)),pn(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Bi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Zt(),this.projectionDelta=Zt(),this.projectionDeltaWithTransform=Zt()}setAnimationOrigin(i,a=!1){const l=this.snapshot,d=l?l.latestValues:{},u={...this.latestValues},f=Zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Te(),x=l?l.source:void 0,b=this.layout?this.layout.source:void 0,m=x!==b,y=this.getStack(),C=!y||y.members.length<=1,v=!!(m&&!C&&this.options.crossfade===!0&&!this.path.some(sg));this.animationProgress=0;let T;this.mixTargetDelta=k=>{const S=k/1e3;Zi(f.x,i.x,S),Zi(f.y,i.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xn(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),og(this.relativeTarget,this.relativeTargetOrigin,h,S),T&&Hm(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Te()),_e(T,this.relativeTarget)),m&&(this.animationValues=u,Fm(u,d,this.latestValues,S,v,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,l,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||d.stop(),this.pendingAnimation&&(mt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Xn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yt(0)),this.currentAnimation=Nm(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(Wm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:d,latestValues:u}=i;if(!(!a||!l||!d)){if(this!==i&&this.layout&&d&&Cc(this.options.animationType,this.layout.layoutBox,d.layoutBox)){l=this.target||Te();const f=$e(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+f;const h=$e(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+h}_e(a,l),Ut(a,u),pn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Um),this.sharedNodes.get(i).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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:l}={}){const d=this.getStack();d&&d.promote(this,l),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:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const d={};l.z&&zr("z",i,d,this.animationValues);for(let u=0;u<Br.length;u++)zr(`rotate${Br[u]}`,i,d,this.animationValues),zr(`skew${Br[u]}`,i,d,this.animationValues);i.render();for(const u in d)i.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=qn(a==null?void 0:a.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=qn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!St(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=Zm(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),i.transform=f;const{x:h,y:x}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${x.origin*100}% 0`,d.animationValues?i.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const b in Cn){if(u[b]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:C}=Cn[b],v=f==="none"?u[b]:m(u[b],d);if(y){const T=y.length;for(let k=0;k<T;k++)i[y[k]]=v}else C?this.options.visualElement.renderState.vars[b]=v:i[b]=v}this.options.layoutId&&(i.pointerEvents=d===this?qn(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(zi),this.root.sharedNodes.clear()}}}function Km(e){e.updateLayout()}function Ym(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:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Be(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],x=$e(h);h.min=r[f].min,h.max=h.min+x}):Cc(s,t.layoutBox,r)&&Be(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],x=$e(r[f]);h.max=h.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+x)});const a=Zt();pn(a,r,t.layoutBox);const l=Zt();i?pn(l,e.applyTransform(o,!0),t.measuredBox):pn(l,r,t.layoutBox);const d=!vc(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:x}=f;if(h&&x){const b=Te();xn(b,t.layoutBox,h.layoutBox);const m=Te();xn(m,r,x.layoutBox),wc(b,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=b,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qm(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 Xm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jm(e){e.clearSnapshot()}function zi(e){e.clearMeasurements()}function Hi(e){e.isLayoutDirty=!1}function Qm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ui(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function eg(e){e.resolveTargetDelta()}function tg(e){e.calcProjection()}function ng(e){e.resetSkewAndRotation()}function rg(e){e.removeLeadSnapshot()}function Zi(e,t,n){e.translate=we(t.translate,0,n),e.scale=we(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Wi(e,t,n,r){e.min=we(t.min,n.min,r),e.max=we(t.max,n.max,r)}function og(e,t,n,r){Wi(e.x,t.x,n.x,r),Wi(e.y,t.y,n.y,r)}function sg(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ig={duration:.45,ease:[.4,0,.1,1]},Gi=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ki=Gi("applewebkit/")&&!Gi("chrome/")?Math.round:Ue;function Yi(e){e.min=Ki(e.min),e.max=Ki(e.max)}function ag(e){Yi(e.x),Yi(e.y)}function Cc(e,t,n){return e==="position"||e==="preserve-aspect"&&!hm(_i(t),_i(n),.2)}function lg(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const cg=kc({attachResizeListener:(e,t)=>En(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hr={current:void 0},Ec=kc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hr.current){const e=new cg({});e.mount(window),e.setOptions({layoutScroll:!0}),Hr.current=e}return Hr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dg={pan:{Feature:jm},drag:{Feature:Am,ProjectionNode:Ec,MeasureLayout:xc}};function qi(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ye.postRender(()=>s(t,Mn(t)))}class ug extends bt{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,r)=>(qi(this.node,r,"Start"),o=>qi(this.node,o,"End"))))}unmount(){}}class fg 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=An(En(this.node.current,"focus",()=>this.onFocus()),En(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xi(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 o="onTap"+(n==="End"?"":n),s=r[o];s&&ye.postRender(()=>s(t,Mn(t)))}class hg extends bt{mount(){const{current:t}=this.node;t&&(this.unmount=Of(t,(n,r)=>(Xi(this.node,r,"Start"),(o,{success:s})=>Xi(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const jo=new WeakMap,Ur=new WeakMap,mg=e=>{const t=jo.get(e.target);t&&t(e)},gg=e=>{e.forEach(mg)};function pg({root:e,...t}){const n=e||document;Ur.has(n)||Ur.set(n,{});const r=Ur.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(gg,{root:e,...t})),r[o]}function xg(e,t,n){const r=pg(t);return jo.set(e,n),r.observe(e),()=>{jo.delete(e),r.unobserve(e)}}const bg={some:0,all:1};class yg 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:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:bg[o]},a=l=>{const{isIntersecting:d}=l;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=d?u:f;h&&h(l)};return xg(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(vg(t,n))&&this.startObserver()}unmount(){}}function vg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wg={inView:{Feature:yg},tap:{Feature:hg},focus:{Feature:fg},hover:{Feature:ug}},Sg={layout:{ProjectionNode:Ec,MeasureLayout:xc}},kg={...am,...wg,...dg,...Sg},ie=kh(kg,$h),Ye=g.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:o="1em",weight:s="regular",mirrored:i=!1,children:a,weights:l,...d}=e;return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!n&&g.createElement("title",null,n),a,l.get(s))});Ye.displayName="SSRBase";const Cg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),vs=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Cg}));vs.displayName="CaretDownIcon";const Eg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Tc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Eg}));Tc.displayName="CaretUpIcon";const Tg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Ac=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Tg}));Ac.displayName="ChatTextIcon";const Ag=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),jc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Ag}));jc.displayName="CheckIcon";const jg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Pc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:jg}));Pc.displayName="MicrophoneIcon";const Pg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Mc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Pg}));Mc.displayName="MicrophoneSlashIcon";const Mg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Vc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Mg}));Vc.displayName="MonitorArrowUpIcon";const Vg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),ws=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Vg}));ws.displayName="SpinnerIcon";const Ng=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Nc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Ng}));Nc.displayName="VideoCameraIcon";const Rg=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),Rc=g.forwardRef((e,t)=>g.createElement(Ye,{ref:t,...e,weights:Rg}));Rc.displayName="VideoCameraSlashIcon";function Ji(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ig(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ji(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ji(e[o],null)}}}}function Dg(e){const t=Fg(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,a=g.Children.toArray(s),l=a.find(Lg);if(l){const d=l.props.children,u=a.map(f=>f===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var $g=Dg("Slot");function Fg(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=Bg(o),a=_g(s,o.props);return o.type!==g.Fragment&&(a.ref=r?Ig(r,i):i),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Og=Symbol("radix.slottable");function Lg(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Og}function _g(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Bg(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Ss="-",zg=e=>{const t=Ug(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Ss);return a[0]===""&&a.length!==1&&a.shift(),Ic(a,t)||Hg(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Ic=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ic(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ss);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Qi=/^\[(.+)\]$/,Hg=e=>{if(Qi.test(e)){const t=Qi.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ug=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Po(n[o],r,o,t);return r},Po=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ea(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Zg(o)){Po(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Po(i,ea(t,s),n,r)})})},ea=(e,t)=>{let n=e;return t.split(Ss).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Zg=e=>e.isThemeGetter,Wg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Mo="!",Vo=":",Gg=Vo.length,Kg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,d;for(let b=0;b<o.length;b++){let m=o[b];if(i===0&&a===0){if(m===Vo){s.push(o.slice(l,b)),l=b+Gg;continue}if(m==="/"){d=b;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=s.length===0?o:o.substring(l),f=Yg(u),h=f!==u,x=d&&d>l?d-l:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:x}};if(t){const o=t+Vo,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Yg=e=>e.endsWith(Mo)?e.substring(0,e.length-1):e.startsWith(Mo)?e.substring(1):e,qg=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Xg=e=>({cache:Wg(e.cacheSize),parseClassName:Kg(e),sortModifiers:qg(e),...zg(e)}),Jg=/\s+/,Qg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Jg);let l="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:m}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let y=!!m,C=r(y?b.substring(0,m):b);if(!C){if(!y){l=u+(l.length>0?" "+l:l);continue}if(C=r(b),!C){l=u+(l.length>0?" "+l:l);continue}y=!1}const v=s(h).join(":"),T=x?v+Mo:v,k=T+C;if(i.includes(k))continue;i.push(k);const S=o(C,y);for(let j=0;j<S.length;++j){const P=S[j];i.push(T+P)}l=u+(l.length>0?" "+l:l)}return l};function e0(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dc(t))&&(r&&(r+=" "),r+=n);return r}const Dc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dc(e[r]))&&(n&&(n+=" "),n+=t);return n};function t0(e,...t){let n,r,o,s=i;function i(l){const d=t.reduce((u,f)=>f(u),e());return n=Xg(d),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const d=r(l);if(d)return d;const u=Qg(l,n);return o(l,u),u}return function(){return s(e0.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$c=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n0=/^\d+\/\d+$/,r0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o0=/\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$/,s0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nt=e=>n0.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),ut=e=>!!e&&Number.isInteger(Number(e)),Zr=e=>e.endsWith("%")&&se(e.slice(0,-1)),nt=e=>r0.test(e),l0=()=>!0,c0=e=>o0.test(e)&&!s0.test(e),Oc=()=>!1,d0=e=>i0.test(e),u0=e=>a0.test(e),f0=e=>!K(e)&&!Y(e),h0=e=>rn(e,Bc,Oc),K=e=>$c.test(e),wt=e=>rn(e,zc,c0),Wr=e=>rn(e,b0,se),ta=e=>rn(e,Lc,Oc),m0=e=>rn(e,_c,u0),_n=e=>rn(e,Hc,d0),Y=e=>Fc.test(e),cn=e=>on(e,zc),g0=e=>on(e,y0),na=e=>on(e,Lc),p0=e=>on(e,Bc),x0=e=>on(e,_c),Bn=e=>on(e,Hc,!0),rn=(e,t,n)=>{const r=$c.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},on=(e,t,n=!1)=>{const r=Fc.exec(e);return r?r[1]?t(r[1]):n:!1},Lc=e=>e==="position"||e==="percentage",_c=e=>e==="image"||e==="url",Bc=e=>e==="length"||e==="size"||e==="bg-size",zc=e=>e==="length",b0=e=>e==="number",y0=e=>e==="family-name",Hc=e=>e==="shadow",v0=()=>{const e=Me("color"),t=Me("font"),n=Me("text"),r=Me("font-weight"),o=Me("tracking"),s=Me("leading"),i=Me("breakpoint"),a=Me("container"),l=Me("spacing"),d=Me("radius"),u=Me("shadow"),f=Me("inset-shadow"),h=Me("text-shadow"),x=Me("drop-shadow"),b=Me("blur"),m=Me("perspective"),y=Me("aspect"),C=Me("ease"),v=Me("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...k(),Y,K],j=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],A=()=>[Y,K,l],_=()=>[Nt,"full","auto",...A()],p=()=>[ut,"none","subgrid",Y,K],V=()=>["auto",{span:["full",ut,Y,K]},ut,Y,K],B=()=>[ut,"auto",Y,K],G=()=>["auto","min","max","fr",Y,K],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...A()],X=()=>[Nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],I=()=>[e,Y,K],q=()=>[...k(),na,ta,{position:[Y,K]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",p0,h0,{size:[Y,K]}],Q=()=>[Zr,cn,wt],W=()=>["","none","full",d,Y,K],U=()=>["",se,cn,wt],E=()=>["solid","dashed","dotted","double"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[se,Zr,na,ta],$=()=>["","none",b,Y,K],F=()=>["none",se,Y,K],L=()=>["none",se,Y,K],J=()=>[se,Y,K],R=()=>[Nt,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nt],breakpoint:[nt],color:[l0],container:[nt],"drop-shadow":[nt],ease:["in","out","in-out"],font:[f0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nt],shadow:[nt],spacing:["px",se],text:[nt],"text-shadow":[nt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nt,K,Y,y]}],container:["container"],columns:[{columns:[se,K,Y,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:S()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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:[ut,"auto",Y,K]}],basis:[{basis:[Nt,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,Nt,"auto","initial","none",K]}],grow:[{grow:["",se,Y,K]}],shrink:[{shrink:["",se,Y,K]}],order:[{order:[ut,"first","last","none",Y,K]}],"grid-cols":[{"grid-cols":p()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":p()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,cn,wt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y,Wr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zr,K]}],"font-family":[{font:[g0,K,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:[o,Y,K]}],"line-clamp":[{"line-clamp":[se,"none",Y,Wr]}],leading:[{leading:[s,...A()]}],"list-image":[{"list-image":["none",Y,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",Y,wt]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[se,"auto",Y,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,K]}],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",Y,K]}],"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:M()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ut,Y,K],radial:["",Y,K],conic:[ut,Y,K]},x0,m0]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...E(),"hidden","none"]}],"divide-style":[{divide:[...E(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...E(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,Y,K]}],"outline-w":[{outline:["",se,cn,wt]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",u,Bn,_n]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",f,Bn,_n]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[se,wt]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",h,Bn,_n]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[se,Y,K]}],"mix-blend":[{"mix-blend":[...D(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":D()}],"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":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Y,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,K]}],filter:[{filter:["","none",Y,K]}],blur:[{blur:$()}],brightness:[{brightness:[se,Y,K]}],contrast:[{contrast:[se,Y,K]}],"drop-shadow":[{"drop-shadow":["","none",x,Bn,_n]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",se,Y,K]}],"hue-rotate":[{"hue-rotate":[se,Y,K]}],invert:[{invert:["",se,Y,K]}],saturate:[{saturate:[se,Y,K]}],sepia:[{sepia:["",se,Y,K]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,K]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[se,Y,K]}],"backdrop-contrast":[{"backdrop-contrast":[se,Y,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,Y,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,Y,K]}],"backdrop-invert":[{"backdrop-invert":["",se,Y,K]}],"backdrop-opacity":[{"backdrop-opacity":[se,Y,K]}],"backdrop-saturate":[{"backdrop-saturate":[se,Y,K]}],"backdrop-sepia":[{"backdrop-sepia":["",se,Y,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",Y,K]}],ease:[{ease:["linear","initial",C,Y,K]}],delay:[{delay:[se,Y,K]}],animate:[{animate:["none",v,Y,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Y,K]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],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:[Y,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",Y,K]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Y,K]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[se,cn,wt,Wr]}],stroke:[{stroke:["none",...I()]}],"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"]}},w0=t0(v0);function Z(...e){return w0(Oo.clsx(e))}function S0(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 k0=Fo.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 C0({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?$g:"button";return c.jsx(s,{"data-slot":"button",className:Z(k0({variant:t,size:n,className:e})),...o})}function E0({onSend:e,className:t,disabled:n,...r}){const o=w.useRef(null),[s,i]=w.useState(""),a=d=>{var u,f;d.preventDefault(),(u=r.onSubmit)==null||u.call(r,d),e==null||e(s),i(""),(f=o.current)==null||f.focus({preventScroll:!0})},l=n||s.trim().length===0;return c.jsxs("form",{...r,onSubmit:a,className:Z("flex items-center rounded-md pl-1 text-sm",t),children:[c.jsx("input",{ref:o,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:s,onChange:d=>i(d.target.value),disabled:n}),c.jsx(C0,{size:"sm",type:"submit",variant:l?"secondary":"primary",disabled:l,className:"font-mono",children:"SEND"})]})}const T0=Fo.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 Uc({className:e,variant:t,size:n,...r}){return c.jsx(Ud.Root,{"data-slot":"toggle",className:Z(T0({variant:t,size:n,className:e})),...r})}function A0(e){const[t,n]=w.useState(()=>e.getPublishPermissions());return w.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},o=()=>{r()};return e.on("connection.connected",o),e.on("connection.disconnected",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o)}},[e]),t}function Zc(e){const[t,n]=w.useState(()=>e.getLocalParticipant()),[r,o]=w.useState(()=>e.getMicrophoneTrack());return w.useEffect(()=>{const s=()=>{const a=e.getLocalParticipant(),l=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!l,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),o(l)};s(),e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("track.muted",s),e.on("track.unmuted",s);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),s()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),s()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",l),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s),i.off("localTrackPublished",a),i.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s)}},[e]),{localParticipant:t,microphoneTrack:r}}function bn(e,t,n){const[r,o]=w.useState(!1),[s,i]=w.useState(!1);return w.useEffect(()=>{const l=()=>{let d=!1;switch(t){case"microphone":d=e.isMicrophoneEnabled;break;case"camera":d=e.isCameraEnabled;break;case"screenShare":d=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,d),o(d)};return l(),e.on("track.muted",l),e.on("track.unmuted",l),e.on("connection.connected",l),()=>{e.off("track.muted",l),e.off("track.unmuted",l),e.off("connection.connected",l)}},[e,t]),{enabled:r,pending:s,toggle:async l=>{var d;try{i(!0);const u=l!==void 0?l:!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){(d=n==null?void 0:n.onDeviceError)==null||d.call(n,u)}finally{i(!1)}}}}function Wc(e){const[t,n]=w.useState(()=>e.getRoom()),[r,o]=w.useState(()=>e.getConnectionState());return w.useEffect(()=>{const s=()=>{n(e.getRoom()),o(e.getConnectionState())};return e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("connection.connecting",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("connection.connecting",s)}},[e]),t}function j0(e,t){const[n,r]=w.useState([]),[o,s]=w.useState("");return w.useEffect(()=>{var d;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 l=()=>{a()};return(d=navigator.mediaDevices)==null||d.addEventListener("devicechange",l),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",l)}},[e,t]),{devices:n,activeDeviceId:o,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),s(a)}catch(l){console.error("Failed to set device:",l)}}}}function P0(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 Gc(e){const[t,n]=w.useState(()=>e.getIsAgentConnected()),[r,o]=w.useState(()=>e.getCurrentSession()),[s,i]=w.useState(()=>e.getCurrentAgentInfo()),[a,l]=w.useState(()=>e.getAgentState()),[d,u]=w.useState(()=>e.getAgentAudioTrack()),[f,h]=w.useState(()=>e.getAgentVideoTrack());return w.useEffect(()=>{const x=()=>{const T=e.getIsAgentConnected(),k=e.getCurrentSession(),S=e.getCurrentAgentInfo(),j=e.getAgentState(),P=e.getAgentAudioTrack(),A=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:T,hasSession:!!k,sessionId:k==null?void 0:k.id,hasAgentInfo:!!S,agentState:j,hasAudioTrack:!!P,hasVideoTrack:!!A}),n(T),o(k),i(S),l(j),u(P),h(A)};x();const b=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),x()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),x()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),x()},C=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),x()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),x()};return e.on("agent.connected",b),e.on("agent.speaking",b),e.on("agent.thinking",b),e.on("agent.state.changed",v),e.on("connection.disconnected",m),e.on("session.created",y),e.on("session.ended",y),e.on("session.state.changed",y),e.on("connection.connected",C),()=>{e.off("agent.connected",b),e.off("agent.speaking",b),e.off("agent.thinking",b),e.off("agent.state.changed",v),e.off("connection.disconnected",m),e.off("session.created",y),e.off("session.ended",y),e.off("session.state.changed",y),e.off("connection.connected",C)}},[e]),{agent:{isActive:t,info:s},session:r,state:a,audioTrack:d,videoTrack:f}}function M0(e){const[t,n]=w.useState(()=>e.getVideoTrackRefs()),[r,o]=w.useState(()=>e.getCameraTrackRefs()),[s,i]=w.useState(()=>e.getScreenShareTrackRefs());return w.useEffect(()=>{const a=()=>{const d=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),f=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:d.length,cameraCount:u.length,screenShareCount:f.length}),n(d),o(u),i(f)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const l=e.getRoom();if(l){const d=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",d),l.on("localTrackUnpublished",d),l.on("trackPublished",d),l.on("trackUnpublished",d),l.on("trackSubscribed",d),l.on("trackUnsubscribed",d),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),l.off("localTrackPublished",d),l.off("localTrackUnpublished",d),l.off("trackPublished",d),l.off("trackUnpublished",d),l.off("trackSubscribed",d),l.off("trackUnsubscribed",d)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:r,screenShareTrackRefs:s}}function ra({...e}){return c.jsx(He.Root,{"data-slot":"select",...e})}function oa({...e}){return c.jsx(He.Value,{"data-slot":"select-value",...e})}function sa({className:e,size:t="default",children:n,...r}){return c.jsxs(He.Trigger,{"data-slot":"select-trigger","data-size":t,className:Z(["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,c.jsx(He.Icon,{asChild:!0,children:c.jsx(vs,{weight:"bold",className:"size-4 transition-colors"})})]})}function ia({className:e,children:t,position:n="popper",...r}){return c.jsx(He.Portal,{children:c.jsxs(He.Content,{"data-slot":"select-content",className:Z(["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:[c.jsx(V0,{}),c.jsx(He.Viewport,{className:Z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(N0,{})]})})}function aa({className:e,children:t,...n}){return c.jsxs(He.Item,{"data-slot":"select-item",className:Z(["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:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(He.ItemIndicator,{children:c.jsx(jc,{className:"size-4",weight:"bold"})})}),c.jsx(He.ItemText,{children:t})]})}function V0({className:e,...t}){return c.jsx(He.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Tc,{className:"size-4",weight:"bold"})})}function N0({className:e,...t}){return c.jsx(He.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(vs,{className:"size-4",weight:"bold"})})}const la=Fo.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 ca({kind:e,track:t,requestPermissions:n,onError:r,client:o,...s}){const i=s.size||"default";if(!o)return c.jsxs(ra,{disabled:!0,children:[c.jsx(sa,{className:Z(la({size:i}),s.className),children:c.jsx(oa,{placeholder:`Select a ${e}`})}),c.jsx(ia,{children:c.jsx(aa,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:l,setActiveMediaDevice:d}=j0(o,e==="audioinput"?"audioinput":"videoinput");return c.jsxs(ra,{value:l,onValueChange:d,children:[c.jsx(sa,{className:Z(la({size:i}),s.className,"hover:bg"),children:i!=="sm"&&c.jsx(oa,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),c.jsx(ia,{children:a.map(u=>c.jsx(aa,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function R0(e,t,n=!1){if(n)return ws;switch(e){case H.Track.Source.Microphone:return t?Pc:Mc;case H.Track.Source.Camera:return t?Nc:Rc;case H.Track.Source.ScreenShare:return Vc;default:return g.Fragment}}function Gr({source:e,pressed:t,pending:n,className:r,...o}){const s=R0(e,t??!1,n),i=e===H.Track.Source.Microphone&&!(t??!1)&&!n,a=e===H.Track.Source.Camera&&!(t??!1)&&!n;return g.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),c.jsxs(Uc,{pressed:t,"aria-label":`Toggle ${e}`,className:Z(r),...o,children:[c.jsx(s,{weight:"bold",className:Z(n&&"animate-spin",i||a?"text-red-500":void 0)}),o.children]})}function I0(e){return e?A0(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function D0(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,o={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:H.Track.Source.Microphone,publication:void 0},visibleControls:o,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:s,localParticipant:i}=Zc(r),a=I0(r);Wc(r);const l=bn(r,"microphone",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.Microphone,error:j})}}),d=bn(r,"camera",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.Camera,error:j})}}),u=bn(r,"screenShare",{onDeviceError:j=>{var P;return(P=e.onDeviceError)==null?void 0:P.call(e,{source:H.Track.Source.ScreenShare,error:j})}}),f=g.useMemo(()=>{let j;if(i){for(const[,P]of i.trackPublications)if(P.source===H.Track.Source.Microphone){j=P;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!j,isTrackSubscribed:j==null?void 0:j.isSubscribed,isMuted:j==null?void 0:j.isMuted,trackSid:j==null?void 0:j.trackSid}),{participant:i??void 0,source:H.Track.Source.Microphone,publication:j}},[i,s]);o.microphone??(o.microphone=a.microphone),o.screenShare??(o.screenShare=a.screenShare),o.camera??(o.camera=a.camera),o.chat??(o.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:x,saveVideoInputEnabled:b,saveVideoInputDeviceId:m}=P0({preventSave:!n}),y=g.useCallback(()=>{r&&(typeof r.endSession=="function"?(r.endSession(),console.log("✅ AgentControlBar: Session ended via client.endSession()")):(r.disconnect(),console.log("⚠️ AgentControlBar: Using fallback client.disconnect()")))},[r]),C=g.useCallback(j=>{x(j??"default"),r&&r.setAudioInputDevice(j)},[x,r]),v=g.useCallback(j=>{m(j??"default"),r&&r.setVideoInputDevice(j)},[m,r]),T=g.useCallback(async j=>{u.enabled&&await u.toggle(!1),await d.toggle(j),b(!d.enabled)},[d,b,u]),k=g.useCallback(async j=>{await l.toggle(j),h(!l.enabled)},[l,h]),S=g.useCallback(async j=>{d.enabled&&await d.toggle(!1),await u.toggle(j)},[d,u]);return{micTrackRef:f,visibleControls:o,cameraToggle:{...d,toggle:T},microphoneToggle:{...l,toggle:k},screenShareToggle:{...u,toggle:S},handleDisconnect:y,handleAudioDeviceChange:C,handleVideoDeviceChange:v}}const $0={card:"relative bg-gradient-to-br from-slate-950 via-slate-900 to-gray-950 border border-slate-800 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-slate-950/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-indigo-900/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-600/20 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-blue-600/15 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-purple-600 to-blue-600 rounded-full blur-sm opacity-25 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-slate-950 via-slate-900 to-gray-950 rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-slate-300",muted:"text-slate-400",accent:"text-white font-semibold"},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-24 h-24 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-16 h-16 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:" 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},F0={card:"relative bg-gradient-to-br from-sky-50 via-white to-indigo-50 border border-sky-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-sky-50/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-400/8 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-violet-400/15 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-rose-400/12 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-violet-500 rounded-full blur-sm opacity-35 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-rose-500 to-violet-500 rounded-full blur-sm opacity-25 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-sky-50 via-white to-indigo-50 rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-slate-900",secondary:"text-slate-700",muted:"text-slate-500",accent:"text-slate-900 font-semibold"},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-24 h-24 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-16 h-16 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},O0={card:"relative bg-gradient-to-br from-[#0a0a1a] via-[#171727] to-[#0f0f23] border border-[#2a2a4a] w-full h-full flex flex-col items-center justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#0a0a1a]/95 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/30 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/25 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-60 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-50 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#0a0a1a] via-[#171727] to-[#0f0f23] rounded-2xl shadow-2xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"text-white font-semibold"},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-24 h-24 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-20 h-20 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-16 h-16 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"},popup:{textSizes:{title:"text-xs font-medium",subtitle:"text-xs",body:"text-xs",small:"text-xs"},buttonSizes:{large:"w-12 h-12",medium:"w-6 h-6 p-1",small:"w-4 h-4 p-0.5"},spacing:{padding:"p-2",margin:"m-1",gap:"gap-1"}},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"}},da={dark:$0,light:F0,vox:O0};function Ne(e){return da[e]||da.vox}function L0({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:o,onChatOpenChange:s,onDisconnect:i,onDeviceError:a,theme:l="vox",client:d,...u}){var _;const[f,h]=g.useState(!1),[x,b]=g.useState(!1),m=Ne(l),{micTrackRef:y,visibleControls:C,cameraToggle:v,microphoneToggle:T,screenShareToggle:k,handleAudioDeviceChange:S,handleVideoDeviceChange:j,handleDisconnect:P}=D0({controls:e,saveUserChoices:t,client:d}),A=async p=>{b(!0);try{await(o==null?void 0:o(p))}finally{b(!1)}};return g.useEffect(()=>{s==null||s(f)},[f,s]),g.useEffect(()=>{var p,V,B,G;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!y.participant,hasPublication:!!y.publication,source:y.source,isSubscribed:(p=y.publication)==null?void 0:p.isSubscribed,isMuted:(V=y.publication)==null?void 0:V.isMuted,trackSid:(B=y.publication)==null?void 0:B.trackSid,hasTrack:!!((G=y.publication)!=null&&G.track)})},[y]),c.jsxs("div",{"aria-label":"Voice assistant controls",className:Z(m.controlBar,r),...u,children:[n.suportsChatInput&&c.jsxs("div",{inert:!f,className:Z("overflow-hidden transition-[height] relative duration-300 ease-in-out",f?"h-[64px] mb-3":"h-0"),children:[c.jsx("div",{className:"flex h-9 px-4 w-full",children:c.jsx(E0,{onSend:A,disabled:x,className:Z("w-full",m.chatInput)})}),c.jsx("hr",{className:"border-border my-2 mx-5"})]}),c.jsxs("div",{className:Z("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-2",l==="light"?"bg-white/80 text-gray-900":"bg-[#18182a]/80 text-white",(_=m.text)==null?void 0:_.primary),children:[c.jsxs("div",{className:"flex gap-y-2 justify-start",children:[C.microphone&&c.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[c.jsx(Gr,{variant:"primary",source:H.Track.Source.Microphone,pressed:T.enabled,disabled:T.pending,onPressedChange:T.toggle,className:Z("w-auto py-2 rounded-none border-none bg-transparent transition-colors",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")}),c.jsx(Ie.BarVisualizer,{barCount:3,trackRef:y,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:c.jsx("span",{className:Z(["h-full w-0.5 origin-center rounded-2xl",l==="vox"||l==="dark"?"bg-white":"bg-gray-900","data-lk-muted:bg-muted"])})}),c.jsx(ca,{size:"sm",kind:"audioinput",client:d,onError:a?p=>p instanceof Error?a({source:H.Track.Source.Microphone,error:p}):void 0:void 0,onActiveDeviceChange:S,className:Z(["h-full py-2 rounded-none border-none bg-transparent transition-colors","min-w-[2.5rem]",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"])})]}),n.suportsVideoInput&&C.camera&&c.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[c.jsx(Gr,{variant:"primary",source:H.Track.Source.Camera,pressed:v.enabled,pending:v.pending,disabled:v.pending,onPressedChange:v.toggle,className:Z("w-auto py-2 rounded-none border-none bg-transparent transition-colors",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")}),c.jsx(ca,{size:"sm",kind:"videoinput",client:d,onError:a?p=>p instanceof Error?a({source:H.Track.Source.Camera,error:p}):void 0:void 0,onActiveDeviceChange:j,className:Z(["h-full py-2 rounded-none border-none bg-transparent transition-colors","min-w-[2.5rem]",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"])})]}),n.suportsScreenShare&&C.screenShare&&c.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:c.jsx(Gr,{variant:"secondary",source:H.Track.Source.ScreenShare,pressed:k.enabled,disabled:k.pending,onPressedChange:k.toggle,className:Z("w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent transition-colors",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20")})})]}),C.chat&&c.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:c.jsx(Uc,{variant:"secondary","aria-label":"Toggle chat",pressed:f,onPressedChange:p=>{h(p)},className:Z("aspect-square h-full py-3 rounded-none border-none bg-transparent transition-colors flex items-center",l==="vox"||l==="dark"?"text-white hover:bg-white/20 focus:bg-white/20":"text-gray-900 hover:bg-gray-900/20 focus:bg-gray-900/20"),children:c.jsx(Ac,{weight:"bold",className:"h-5 w-5"})})})]})]})}const _0=(e,t)=>{var a,l;const n=g.useMemo(()=>t?t(e.message):e.message,[e.message,t]),r=!!e.editTimestamp,o=new Date(e.timestamp),s=typeof navigator<"u"?navigator.language:"en-US",i=(a=e.from)!=null&&a.name&&e.from.name!==""?e.from.name:(l=e.from)==null?void 0:l.identity;return{message:n,hasBeenEdited:r,time:o,locale:s,name:i}},B0=({entry:e,messageFormatter:t,className:n,participantName:r,...o})=>{var u,f;const{message:s,time:i,locale:a}=_0(e,t),l=((u=e.from)==null?void 0:u.isLocal)??!1;Z("w-full px-3 py-2 rounded-2xl text-xs break-words whitespace-pre-line",l?" text-end border border-[#5078F2]/30":"bg-muted text-foreground border border-[#813aa7]/30","text-left");const d=Z("inline-flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold flex-shrink-0",l?"bg-[#5078F2] text-white":"bg-[#813aa7] ml-1 text-white");return c.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:Z("group flex mb-2",l?"justify-end":"justify-start",n),...o,children:c.jsxs("div",{className:Z("flex w-fit max-w-full rounded-2xl border",l?"flex-row-reverse items-center border-[#5078F2]/30":"flex-row items-center border-[#813aa7]/30 bg-muted text-foreground"),children:[c.jsx("span",{className:d,children:l?((f=r==null?void 0:r[0])==null?void 0:f.toUpperCase())||"U":"A"}),c.jsx("span",{className:Z("flex items-center text-xs break-words whitespace-pre-line",l?"ml-auto justify-end text-right":"justify-start text-left","px-3 py-2"),children:s})]})})};function z0(e){w.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 H0=({className:e,children:t,...n})=>{const r=w.useRef(null);return z0(r),c.jsx("div",{ref:r,className:Z("flex flex-col justify-end",e),...n,children:t})},U0=({state:e,audioTrack:t,className:n,ref:r})=>c.jsx("div",{ref:r,className:Z("",n),children:t?c.jsx(Ie.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Z("flex aspect-video w-40 items-center justify-center gap-1"),children:c.jsx("span",{className:Z(["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]"])})}):c.jsx("div",{className:Z("flex aspect-video w-40 items-center justify-center"),children:c.jsx("div",{className:"flex flex-col items-center justify-center",children:c.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((o,s)=>c.jsx("span",{className:Z(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},s))})})})}),Z0=({videoTrack:e,className:t,ref:n})=>{var r,o;return!e||!e.publication||!e.participant?c.jsx("div",{ref:n,className:Z(t),children:c.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:c.jsx("span",{className:"text-gray-500",children:"No video available"})})}):c.jsx("div",{ref:n,className:Z(t),children:c.jsx(Ie.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((o=e.publication.dimensions)==null?void 0:o.height)??0,className:"rounded-md"})})},W0=ie.create(Ie.VideoTrack),G0=({trackRef:e,className:t,ref:n})=>{var r,o;return c.jsx("div",{className:Z("bg-muted overflow-hidden rounded-md",t),children:c.jsx(W0,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((o=e==null?void 0:e.publication.dimensions)==null?void 0:o.height)??0,className:Z("h-full w-auto")})})},ua=ie.create(G0),K0=ie.create(U0),Y0=ie.create(Z0),rt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Rt={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 q0(e,t){const{localParticipant:n}=Zc(t),r=n==null?void 0:n.getTrackPublication(e);return w.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function X0({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:o="idle",audioTrack:s,videoTrack:i}=t?Gc(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=Ie.useTracks([H.Track.Source.ScreenShare]),l=q0(H.Track.Source.Camera,t),d=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,f=d||u,h=n||r&&r.state==="active",x={...rt.transition,delay:e?0:.15},b={...rt.animate,scale:e?1:3,transition:x},m={...rt.animate,transition:x},y=x,C=x,v=i&&i.publication&&i.participant;return c.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:c.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:c.jsxs("div",{className:Z(Rt.grid),children:[h&&c.jsx("div",{className:Z(["grid",!e&&Rt.agentChatClosed,e&&f&&Rt.agentChatOpenWithSecondTile,e&&!f&&Rt.agentChatOpenWithoutSecondTile]),children:c.jsxs("div",{className:"h-full flex items-center justify-center",children:[!v&&c.jsx(K0,{layoutId:"agent",...rt,animate:b,transition:y,state:o,audioTrack:s||void 0,className:Z(e?"h-[90px]":"h-auto w-full")},"agent"),v&&i&&c.jsx(Y0,{layoutId:"avatar",...rt,animate:m,transition:C,videoTrack:i,className:Z(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),c.jsx("div",{className:Z(["grid",e&&Rt.secondTileChatOpen,!e&&Rt.secondTileChatClosed]),children:c.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&d&&c.jsx(ua,{layout:"position",layoutId:"camera",...rt,trackRef:l,transition:{...rt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&c.jsx(ua,{layout:"position",layoutId:"screen",...rt,trackRef:a,transition:{...rt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function fa({timeout:e}){const[t,n]=w.useState(100),r=w.useRef(null),o=w.useRef(null);return w.useEffect(()=>{if(!e||e<=0)return;n(100),o.current=Date.now();const s=()=>{if(!e||o.current===null)return;const i=Date.now()-o.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(r.current=requestAnimationFrame(s))};return r.current=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:c.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:c.jsx(ie.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 Xt({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:o}){var a;if(!e||!e.isVisible||!e.component)return null;const[s]=g.useState(()=>Date.now()),i=()=>e.component?g.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async d=>{console.log("InteractiveComponent: Loading data:",d)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:o}):c.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return c.jsx(Wt,{children:c.jsxs(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx(fa,{timeout:e.timeout}),c.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[c.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),c.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:c.jsx(Pe.X,{className:"w-5 h-5"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return c.jsx(Wt,{children:c.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg z-50 relative",style:{zIndex:50},children:c.jsxs("div",{children:[c.jsx(fa,{timeout:e.timeout}),i()]})})})}}function J0(){const e=Ie.useTranscriptions(),t=Ie.useChat(),n=Ie.useRoomContext();return{messages:w.useMemo(()=>[...e.map(s=>S0(s,n)),...t.chatMessages].sort((s,i)=>s.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const Q0=({logLevel:e}={})=>{const t=Ie.useRoomContext();g.useEffect(()=>(H.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},ha=e=>e,ep=()=>{let e=ha;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ha}}},tp=ep();function pt(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 Mt(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":pt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Hn={exports:{}},ce={};/** @license React v16.13.1
|
|
10
10
|
* react-is.production.min.js
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/var ma;function rp(){if(ma)return
|
|
16
|
+
*/var ma;function rp(){if(ma)return ce;ma=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,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function T(S){if(typeof S=="object"&&S!==null){var j=S.$$typeof;switch(j){case t:switch(S=S.type,S){case l:case d:case r:case s:case o:case f:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case b:case x:case i:return S;default:return j}}case n:return j}}}function k(S){return T(S)===d}return ce.AsyncMode=l,ce.ConcurrentMode=d,ce.ContextConsumer=a,ce.ContextProvider=i,ce.Element=t,ce.ForwardRef=u,ce.Fragment=r,ce.Lazy=b,ce.Memo=x,ce.Portal=n,ce.Profiler=s,ce.StrictMode=o,ce.Suspense=f,ce.isAsyncMode=function(S){return k(S)||T(S)===l},ce.isConcurrentMode=k,ce.isContextConsumer=function(S){return T(S)===a},ce.isContextProvider=function(S){return T(S)===i},ce.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},ce.isForwardRef=function(S){return T(S)===u},ce.isFragment=function(S){return T(S)===r},ce.isLazy=function(S){return T(S)===b},ce.isMemo=function(S){return T(S)===x},ce.isPortal=function(S){return T(S)===n},ce.isProfiler=function(S){return T(S)===s},ce.isStrictMode=function(S){return T(S)===o},ce.isSuspense=function(S){return T(S)===f},ce.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===d||S===s||S===o||S===f||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===b||S.$$typeof===x||S.$$typeof===i||S.$$typeof===a||S.$$typeof===u||S.$$typeof===y||S.$$typeof===C||S.$$typeof===v||S.$$typeof===m)},ce.typeOf=T,ce}var de={};/** @license React v16.13.1
|
|
17
17
|
* react-is.development.js
|
|
18
18
|
*
|
|
19
19
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/var ga;function op(){return ga||(ga=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,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,
|
|
23
|
+
*/var ga;function op(){return ga||(ga=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,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function T(R){return typeof R=="string"||typeof R=="function"||R===r||R===d||R===s||R===o||R===f||R===h||typeof R=="object"&&R!==null&&(R.$$typeof===b||R.$$typeof===x||R.$$typeof===i||R.$$typeof===a||R.$$typeof===u||R.$$typeof===y||R.$$typeof===C||R.$$typeof===v||R.$$typeof===m)}function k(R){if(typeof R=="object"&&R!==null){var le=R.$$typeof;switch(le){case t:var xe=R.type;switch(xe){case l:case d:case r:case s:case o:case f:return xe;default:var pe=xe&&xe.$$typeof;switch(pe){case a:case u:case b:case x:case i:return pe;default:return le}}case n:return le}}}var S=l,j=d,P=a,A=i,_=t,p=u,V=r,B=b,G=x,te=n,ne=s,oe=o,X=f,I=!1;function q(R){return I||(I=!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.")),M(R)||k(R)===l}function M(R){return k(R)===d}function z(R){return k(R)===a}function Q(R){return k(R)===i}function W(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function U(R){return k(R)===u}function E(R){return k(R)===r}function D(R){return k(R)===b}function O(R){return k(R)===x}function $(R){return k(R)===n}function F(R){return k(R)===s}function L(R){return k(R)===o}function J(R){return k(R)===f}de.AsyncMode=S,de.ConcurrentMode=j,de.ContextConsumer=P,de.ContextProvider=A,de.Element=_,de.ForwardRef=p,de.Fragment=V,de.Lazy=B,de.Memo=G,de.Portal=te,de.Profiler=ne,de.StrictMode=oe,de.Suspense=X,de.isAsyncMode=q,de.isConcurrentMode=M,de.isContextConsumer=z,de.isContextProvider=Q,de.isElement=W,de.isForwardRef=U,de.isFragment=E,de.isLazy=D,de.isMemo=O,de.isPortal=$,de.isProfiler=F,de.isStrictMode=L,de.isSuspense=J,de.isValidElementType=T,de.typeOf=k}()),de}var pa;function Kc(){return pa||(pa=1,process.env.NODE_ENV==="production"?Hn.exports=rp():Hn.exports=op()),Hn.exports}/*
|
|
24
24
|
object-assign
|
|
25
25
|
(c) Sindre Sorhus
|
|
26
26
|
@license MIT
|
|
27
|
-
*/var Kr,xa;function sp(){if(xa)return Kr;xa=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var
|
|
28
|
-
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var R=J(O,L,U,E,D+"."+L,n);if(R)return R}return null}return
|
|
27
|
+
*/var Kr,xa;function sp(){if(xa)return Kr;xa=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(l.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(u){d[u]=u}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Kr=o()?Object.assign:function(s,i){for(var a,l=r(s),d,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){d=e(a);for(var h=0;h<d.length;h++)n.call(a,d[h])&&(l[d[h]]=a[d[h]])}}return l},Kr}var Yr,ba;function ks(){if(ba)return Yr;ba=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Yr=e,Yr}var qr,ya;function Yc(){return ya||(ya=1,qr=Function.call.bind(Object.prototype.hasOwnProperty)),qr}var Xr,va;function ip(){if(va)return Xr;va=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ks(),n={},r=Yc();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,l,d){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var f;try{if(typeof s[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=s[u](i,u,l,a,null,t)}catch(b){f=b}if(f&&!(f instanceof Error)&&e((l||"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 x=d?d():"";e("Failed "+a+" type: "+f.message+(x??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Xr=o,Xr}var Jr,wa;function ap(){if(wa)return Jr;wa=1;var e=Kc(),t=sp(),n=ks(),r=Yc(),o=ip(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return Jr=function(a,l){var d=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(M){var z=M&&(d&&M[d]||M[u]);if(typeof z=="function")return z}var h="<<anonymous>>",x={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:v(),arrayOf:T,element:k(),elementType:S(),instanceOf:j,node:p(),objectOf:A,oneOf:P,oneOfType:_,shape:B,exact:G};function b(M,z){return M===z?M!==0||1/M===1/z:M!==M&&z!==z}function m(M,z){this.message=M,this.data=z&&typeof z=="object"?z:{},this.stack=""}m.prototype=Error.prototype;function y(M){if(process.env.NODE_ENV!=="production")var z={},Q=0;function W(E,D,O,$,F,L,J){if($=$||h,L=L||O,J!==n){if(l){var R=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 R.name="Invariant Violation",R}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=$+":"+O;!z[le]&&Q<3&&(s("You are manually calling a React.PropTypes validation function for the `"+L+"` prop on `"+$+"`. 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."),z[le]=!0,Q++)}}return D[O]==null?E?D[O]===null?new m("The "+F+" `"+L+"` is marked as required "+("in `"+$+"`, but its value is `null`.")):new m("The "+F+" `"+L+"` is marked as required in "+("`"+$+"`, but its value is `undefined`.")):null:M(D,O,$,F,L)}var U=W.bind(null,!1);return U.isRequired=W.bind(null,!0),U}function C(M){function z(Q,W,U,E,D,O){var $=Q[W],F=oe($);if(F!==M){var L=X($);return new m("Invalid "+E+" `"+D+"` of type "+("`"+L+"` supplied to `"+U+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return y(z)}function v(){return y(i)}function T(M){function z(Q,W,U,E,D){if(typeof M!="function")return new m("Property `"+D+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var O=Q[W];if(!Array.isArray(O)){var $=oe(O);return new m("Invalid "+E+" `"+D+"` of type "+("`"+$+"` supplied to `"+U+"`, expected an array."))}for(var F=0;F<O.length;F++){var L=M(O,F,U,E,D+"["+F+"]",n);if(L instanceof Error)return L}return null}return y(z)}function k(){function M(z,Q,W,U,E){var D=z[Q];if(!a(D)){var O=oe(D);return new m("Invalid "+U+" `"+E+"` of type "+("`"+O+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return y(M)}function S(){function M(z,Q,W,U,E){var D=z[Q];if(!e.isValidElementType(D)){var O=oe(D);return new m("Invalid "+U+" `"+E+"` of type "+("`"+O+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return y(M)}function j(M){function z(Q,W,U,E,D){if(!(Q[W]instanceof M)){var O=M.name||h,$=q(Q[W]);return new m("Invalid "+E+" `"+D+"` of type "+("`"+$+"` supplied to `"+U+"`, expected ")+("instance of `"+O+"`."))}return null}return y(z)}function P(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function z(Q,W,U,E,D){for(var O=Q[W],$=0;$<M.length;$++)if(b(O,M[$]))return null;var F=JSON.stringify(M,function(J,R){var le=X(R);return le==="symbol"?String(R):R});return new m("Invalid "+E+" `"+D+"` of value `"+String(O)+"` "+("supplied to `"+U+"`, expected one of "+F+"."))}return y(z)}function A(M){function z(Q,W,U,E,D){if(typeof M!="function")return new m("Property `"+D+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var O=Q[W],$=oe(O);if($!=="object")return new m("Invalid "+E+" `"+D+"` of type "+("`"+$+"` supplied to `"+U+"`, expected an object."));for(var F in O)if(r(O,F)){var L=M(O,F,U,E,D+"."+F,n);if(L instanceof Error)return L}return null}return y(z)}function _(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var z=0;z<M.length;z++){var Q=M[z];if(typeof Q!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+I(Q)+" at index "+z+"."),i}function W(U,E,D,O,$){for(var F=[],L=0;L<M.length;L++){var J=M[L],R=J(U,E,D,O,$,n);if(R==null)return null;R.data&&r(R.data,"expectedType")&&F.push(R.data.expectedType)}var le=F.length>0?", expected one of type ["+F.join(", ")+"]":"";return new m("Invalid "+O+" `"+$+"` supplied to "+("`"+D+"`"+le+"."))}return y(W)}function p(){function M(z,Q,W,U,E){return te(z[Q])?null:new m("Invalid "+U+" `"+E+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return y(M)}function V(M,z,Q,W,U){return new m((M||"React class")+": "+z+" type `"+Q+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function B(M){function z(Q,W,U,E,D){var O=Q[W],$=oe(O);if($!=="object")return new m("Invalid "+E+" `"+D+"` of type `"+$+"` "+("supplied to `"+U+"`, expected `object`."));for(var F in M){var L=M[F];if(typeof L!="function")return V(U,E,D,F,X(L));var J=L(O,F,U,E,D+"."+F,n);if(J)return J}return null}return y(z)}function G(M){function z(Q,W,U,E,D){var O=Q[W],$=oe(O);if($!=="object")return new m("Invalid "+E+" `"+D+"` of type `"+$+"` "+("supplied to `"+U+"`, expected `object`."));var F=t({},Q[W],M);for(var L in F){var J=M[L];if(r(M,L)&&typeof J!="function")return V(U,E,D,L,X(J));if(!J)return new m("Invalid "+E+" `"+D+"` key `"+L+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(Q[W],null," ")+`
|
|
28
|
+
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var R=J(O,L,U,E,D+"."+L,n);if(R)return R}return null}return y(z)}function te(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(te);if(M===null||a(M))return!0;var z=f(M);if(z){var Q=z.call(M),W;if(z!==M.entries){for(;!(W=Q.next()).done;)if(!te(W.value))return!1}else for(;!(W=Q.next()).done;){var U=W.value;if(U&&!te(U[1]))return!1}}else return!1;return!0;default:return!1}}function ne(M,z){return M==="symbol"?!0:z?z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&z instanceof Symbol:!1}function oe(M){var z=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":ne(z,M)?"symbol":z}function X(M){if(typeof M>"u"||M===null)return""+M;var z=oe(M);if(z==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return z}function I(M){var z=X(M);switch(z){case"array":case"object":return"an "+z;case"boolean":case"date":case"regexp":return"a "+z;default:return z}}function q(M){return!M.constructor||!M.constructor.name?h:M.constructor.name}return x.checkPropTypes=o,x.resetWarningCache=o.resetWarningCache,x.PropTypes=x,x},Jr}var Qr,Sa;function lp(){if(Sa)return Qr;Sa=1;var e=ks();function t(){}function n(){}return n.resetWarningCache=t,Qr=function(){function r(i,a,l,d,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 o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Qr}var ka;function cp(){if(ka)return zn.exports;if(ka=1,process.env.NODE_ENV!=="production"){var e=Kc(),t=!0;zn.exports=ap()(e.isElement,t)}else zn.exports=lp()();return zn.exports}var dp=cp();const ae=np(dp);function up(e,t,n=void 0){const r={};for(const o in e){const s=e[o];let i="",a=!0;for(let l=0;l<s.length;l+=1){const d=s[l];d&&(i+=(a===!0?"":" ")+t(d),a=!1,n&&n[d]&&(i+=" "+n[d]))}r[o]=i}return r}var Un={exports:{}},ue={};/**
|
|
29
29
|
* @license React
|
|
30
30
|
* react-is.production.js
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var R=J(O,L,U,E,D+"."+L,
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var Ca;function fp(){if(Ca)return ue;Ca=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),
|
|
36
|
+
*/var Ca;function fp(){if(Ca)return ue;Ca=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function b(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case e:switch(m=m.type,m){case n:case o:case r:case l:case d:case h:return m;default:switch(m=m&&m.$$typeof,m){case i:case a:case f:case u:return m;case s:return m;default:return y}}case t:return y}}}return ue.ContextConsumer=s,ue.ContextProvider=i,ue.Element=e,ue.ForwardRef=a,ue.Fragment=n,ue.Lazy=f,ue.Memo=u,ue.Portal=t,ue.Profiler=o,ue.StrictMode=r,ue.Suspense=l,ue.SuspenseList=d,ue.isContextConsumer=function(m){return b(m)===s},ue.isContextProvider=function(m){return b(m)===i},ue.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},ue.isForwardRef=function(m){return b(m)===a},ue.isFragment=function(m){return b(m)===n},ue.isLazy=function(m){return b(m)===f},ue.isMemo=function(m){return b(m)===u},ue.isPortal=function(m){return b(m)===t},ue.isProfiler=function(m){return b(m)===o},ue.isStrictMode=function(m){return b(m)===r},ue.isSuspense=function(m){return b(m)===l},ue.isSuspenseList=function(m){return b(m)===d},ue.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===o||m===r||m===l||m===d||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===u||m.$$typeof===i||m.$$typeof===s||m.$$typeof===a||m.$$typeof===x||m.getModuleId!==void 0)},ue.typeOf=b,ue}var fe={};/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-is.development.js
|
|
39
39
|
*
|
|
@@ -41,22 +41,22 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var R=J(O,L,U,E,D+"."+L,
|
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var Ea;function hp(){return Ea||(Ea=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var
|
|
45
|
-
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:pt(18,`(${t})`));return null}const[,r,o]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(s)}function xp(e){const t=(s,i)=>s.replace("@media",i?`@container ${i}`:"@container");function n(s,i){s.up=(...a)=>t(e.breakpoints.up(...a),i),s.down=(...a)=>t(e.breakpoints.down(...a),i),s.between=(...a)=>t(e.breakpoints.between(...a),i),s.only=(...a)=>t(e.breakpoints.only(...a),i),s.not=(...a)=>{const
|
|
44
|
+
*/var Ea;function hp(){return Ea||(Ea=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case t:switch(m=m.type,m){case r:case s:case o:case d:case u:case x:return m;default:switch(m=m&&m.$$typeof,m){case a:case l:case h:case f:return m;case i:return m;default:return y}}case n:return y}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),x=Symbol.for("react.view_transition"),b=Symbol.for("react.client.reference");fe.ContextConsumer=i,fe.ContextProvider=a,fe.Element=t,fe.ForwardRef=l,fe.Fragment=r,fe.Lazy=h,fe.Memo=f,fe.Portal=n,fe.Profiler=s,fe.StrictMode=o,fe.Suspense=d,fe.SuspenseList=u,fe.isContextConsumer=function(m){return e(m)===i},fe.isContextProvider=function(m){return e(m)===a},fe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},fe.isForwardRef=function(m){return e(m)===l},fe.isFragment=function(m){return e(m)===r},fe.isLazy=function(m){return e(m)===h},fe.isMemo=function(m){return e(m)===f},fe.isPortal=function(m){return e(m)===n},fe.isProfiler=function(m){return e(m)===s},fe.isStrictMode=function(m){return e(m)===o},fe.isSuspense=function(m){return e(m)===d},fe.isSuspenseList=function(m){return e(m)===u},fe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===s||m===o||m===d||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===f||m.$$typeof===a||m.$$typeof===i||m.$$typeof===l||m.$$typeof===b||m.getModuleId!==void 0)},fe.typeOf=e}()),fe}var Ta;function mp(){return Ta||(Ta=1,process.env.NODE_ENV==="production"?Un.exports=fp():Un.exports=hp()),Un.exports}var ir=mp();function st(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 qc(e){if(g.isValidElement(e)||ir.isValidElementType(e)||!st(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=qc(e[n])}),t}function Le(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return st(e)&&st(t)&&Object.keys(t).forEach(o=>{g.isValidElement(t[o])||ir.isValidElementType(t[o])?r[o]=t[o]:st(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&st(e[o])?r[o]=Le(e[o],t[o],n):n.clone?r[o]=st(t[o])?qc(t[o]):t[o]:r[o]=t[o]}),r}function yn(e,t){return t?Le(e,t,{clone:!1}):e}const yt=process.env.NODE_ENV!=="production"?ae.oneOfType([ae.number,ae.string,ae.object,ae.array]):{};function Aa(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{var i,a;const s=/min-width:\s*([0-9.]+)/;return+(((i=r.match(s))==null?void 0:i[1])||0)-+(((a=o.match(s))==null?void 0:a[1])||0)});return n.length?n.reduce((r,o)=>{const s=t[o];return delete r[o],r[o]=s,r},{...t}):t}function gp(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function pp(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>\`.
|
|
45
|
+
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:pt(18,`(${t})`));return null}const[,r,o]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(s)}function xp(e){const t=(s,i)=>s.replace("@media",i?`@container ${i}`:"@container");function n(s,i){s.up=(...a)=>t(e.breakpoints.up(...a),i),s.down=(...a)=>t(e.breakpoints.down(...a),i),s.between=(...a)=>t(e.breakpoints.between(...a),i),s.only=(...a)=>t(e.breakpoints.only(...a),i),s.not=(...a)=>{const l=t(e.breakpoints.not(...a),i);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},o=s=>(n(r,s),r);return n(o),{...e,containerQueries:o}}const mr={xs:0,sm:600,md:900,lg:1200,xl:1536},ja={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${mr[e]}px)`},bp={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:mr[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ct(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints||ja;return t.reduce((i,a,l)=>(i[s.up(s.keys[l])]=n(t[l]),i),{})}if(typeof t=="object"){const s=r.breakpoints||ja;return Object.keys(t).reduce((i,a)=>{if(gp(s.keys,a)){const l=pp(r.containerQueries?r:bp,a);l&&(i[l]=n(t[a],a))}else if(Object.keys(s.values||mr).includes(a)){const l=s.up(a);i[l]=n(t[a],a)}else{const l=a;i[l]=t[l]}return i},{})}return n(t)}function yp(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,o)=>{const s=e.up(o);return r[s]={},r},{}))||{}}function Pa(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function gr(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,s)=>o&&o[s]?o[s]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function ar(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=gr(e,n)||r,t&&(o=t(o,r,e)),o}function Ae(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,s=i=>{if(i[t]==null)return null;const a=i[t],l=i.theme,d=gr(l,r)||{};return ct(i,a,f=>{let h=ar(d,o,f);return f===h&&typeof f=="string"&&(h=ar(d,o,`${t}${f==="default"?"":Mt(f)}`,f)),n===!1?h:{[n]:h}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:yt}:{},s.filterProps=[t],s}function vp(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const wp={m:"margin",p:"padding"},Sp={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ma={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},kp=vp(e=>{if(e.length>2)if(Ma[e])e=Ma[e];else return[e];const[t,n]=e.split(""),r=wp[t],o=Sp[n]||"";return Array.isArray(o)?o.map(s=>r+s):[r+o]}),pr=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],xr=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Cp=[...pr,...xr];function Vn(e,t,n,r){const o=gr(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${s}.`),typeof o=="string"?o.startsWith("var(")&&s===0?0:o.startsWith("var(")&&s===1?o:`calc(${s} * ${o})`:o*s):Array.isArray(o)?s=>{if(typeof s=="string")return s;const i=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>o.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(o)}.`,`${i} > ${o.length-1}, you need to add the missing values.`].join(`
|
|
46
46
|
`)):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(`
|
|
47
47
|
`)));const a=o[i];return s>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof o=="function"?o:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${o}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
48
|
-
`)),()=>{})}function Cs(e){return Vn(e,"spacing",8,"spacing")}function Nn(e,t){return typeof t=="string"||t==null?t:e(t)}function Ep(e,t){return n=>e.reduce((r,o)=>(r[o]=Nn(t,n),r),{})}function Tp(e,t,n,r){if(!t.includes(n))return null;const o=kp(n),s=Ep(o,r),i=e[n];return lt(e,i,s)}function Xl(e,t){const n=Cs(e.theme);return Object.keys(e).map(r=>Tp(e,t,r,n)).reduce(bn,{})}function Ce(e){return Xl(e,pr)}Ce.propTypes=process.env.NODE_ENV!=="production"?pr.reduce((e,t)=>(e[t]=bt,e),{}):{};Ce.filterProps=pr;function Ee(e){return Xl(e,xr)}Ee.propTypes=process.env.NODE_ENV!=="production"?xr.reduce((e,t)=>(e[t]=bt,e),{}):{};Ee.filterProps=xr;process.env.NODE_ENV!=="production"&&Cp.reduce((e,t)=>(e[t]=bt,e),{});function yr(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(s=>{r[s]=o}),r),{}),n=r=>Object.keys(r).reduce((o,s)=>t[s]?bn(o,t[s](r)):o,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,o)=>Object.assign(r,o.propTypes),{}):{},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function ze(e){return typeof e!="number"?e:`${e}px solid`}function Ze(e,t){return Ae({prop:e,themeKey:"borders",transform:t})}const Ap=Ze("border",ze),jp=Ze("borderTop",ze),Pp=Ze("borderRight",ze),Mp=Ze("borderBottom",ze),Vp=Ze("borderLeft",ze),Np=Ze("borderColor"),Rp=Ze("borderTopColor"),Ip=Ze("borderRightColor"),Dp=Ze("borderBottomColor"),$p=Ze("borderLeftColor"),Fp=Ze("outline",ze),Op=Ze("outlineColor"),br=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Vn(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Nn(t,r)});return lt(e,e.borderRadius,n)}return null};br.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:bt}:{};br.filterProps=["borderRadius"];yr(Ap,jp,Pp,Mp,Vp,Np,Rp,Ip,Dp,$p,br,Fp,Op);const vr=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Vn(e.theme,"spacing",8,"gap"),n=r=>({gap:Nn(t,r)});return lt(e,e.gap,n)}return null};vr.propTypes=process.env.NODE_ENV!=="production"?{gap:bt}:{};vr.filterProps=["gap"];const wr=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Vn(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Nn(t,r)});return lt(e,e.columnGap,n)}return null};wr.propTypes=process.env.NODE_ENV!=="production"?{columnGap:bt}:{};wr.filterProps=["columnGap"];const Sr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Vn(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Nn(t,r)});return lt(e,e.rowGap,n)}return null};Sr.propTypes=process.env.NODE_ENV!=="production"?{rowGap:bt}:{};Sr.filterProps=["rowGap"];const Lp=Ae({prop:"gridColumn"}),_p=Ae({prop:"gridRow"}),Bp=Ae({prop:"gridAutoFlow"}),zp=Ae({prop:"gridAutoColumns"}),Hp=Ae({prop:"gridAutoRows"}),Up=Ae({prop:"gridTemplateColumns"}),Zp=Ae({prop:"gridTemplateRows"}),Wp=Ae({prop:"gridTemplateAreas"}),Gp=Ae({prop:"gridArea"});yr(vr,wr,Sr,Lp,_p,Bp,zp,Hp,Up,Zp,Wp,Gp);function Kt(e,t){return t==="grey"?t:e}const Kp=Ae({prop:"color",themeKey:"palette",transform:Kt}),Yp=Ae({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Kt}),qp=Ae({prop:"backgroundColor",themeKey:"palette",transform:Kt});yr(Kp,Yp,qp);function Oe(e){return e<=1&&e!==0?`${e*100}%`:e}const Xp=Ae({prop:"width",transform:Oe}),Es=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var o,s,i,a,c;const r=((i=(s=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:s.values)==null?void 0:i[n])||mr[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:Oe(n)}};return lt(e,e.maxWidth,t)}return null};Es.filterProps=["maxWidth"];const Jp=Ae({prop:"minWidth",transform:Oe}),Qp=Ae({prop:"height",transform:Oe}),ex=Ae({prop:"maxHeight",transform:Oe}),tx=Ae({prop:"minHeight",transform:Oe});Ae({prop:"size",cssProperty:"width",transform:Oe});Ae({prop:"size",cssProperty:"height",transform:Oe});const nx=Ae({prop:"boxSizing"});yr(Xp,Es,Jp,Qp,ex,tx,nx);const kr={border:{themeKey:"borders",transform:ze},borderTop:{themeKey:"borders",transform:ze},borderRight:{themeKey:"borders",transform:ze},borderBottom:{themeKey:"borders",transform:ze},borderLeft:{themeKey:"borders",transform:ze},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ze},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:br},color:{themeKey:"palette",transform:Kt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Kt},backgroundColor:{themeKey:"palette",transform:Kt},p:{style:Ee},pt:{style:Ee},pr:{style:Ee},pb:{style:Ee},pl:{style:Ee},px:{style:Ee},py:{style:Ee},padding:{style:Ee},paddingTop:{style:Ee},paddingRight:{style:Ee},paddingBottom:{style:Ee},paddingLeft:{style:Ee},paddingX:{style:Ee},paddingY:{style:Ee},paddingInline:{style:Ee},paddingInlineStart:{style:Ee},paddingInlineEnd:{style:Ee},paddingBlock:{style:Ee},paddingBlockStart:{style:Ee},paddingBlockEnd:{style:Ee},m:{style:Ce},mt:{style:Ce},mr:{style:Ce},mb:{style:Ce},ml:{style:Ce},mx:{style:Ce},my:{style:Ce},margin:{style:Ce},marginTop:{style:Ce},marginRight:{style:Ce},marginBottom:{style:Ce},marginLeft:{style:Ce},marginX:{style:Ce},marginY:{style:Ce},marginInline:{style:Ce},marginInlineStart:{style:Ce},marginInlineEnd:{style:Ce},marginBlock:{style:Ce},marginBlockStart:{style:Ce},marginBlockEnd:{style:Ce},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:vr},rowGap:{style:Sr},columnGap:{style:wr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Oe},maxWidth:{style:Es},minWidth:{transform:Oe},height:{transform:Oe},maxHeight:{transform:Oe},minHeight:{transform:Oe},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 rx(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function ox(e,t){return typeof e=="function"?e(t):e}function sx(){function e(n,r,o,s){const i={[n]:r,theme:o},a=s[n];if(!a)return{[n]:r};const{cssProperty:c=n,themeKey:d,transform:u,style:f}=a;if(r==null)return null;if(d==="typography"&&r==="inherit")return{[n]:r};const h=gr(o,d)||{};return f?f(i):lt(i,r,y=>{let m=ar(h,u,y);return y===m&&typeof y=="string"&&(m=ar(h,u,`${n}${y==="default"?"":Mt(y)}`,y)),c===!1?m:{[c]:m}})}function t(n){const{sx:r,theme:o={},nested:s}=n||{};if(!r)return null;const i=o.unstable_sxConfig??kr;function a(c){let d=c;if(typeof c=="function")d=c(o);else if(typeof c!="object")return c;if(!d)return null;const u=bp(o.breakpoints),f=Object.keys(u);let h=u;return Object.keys(d).forEach(x=>{const y=ox(d[x],o);if(y!=null)if(typeof y=="object")if(i[x])h=bn(h,e(x,y,o,i));else{const m=lt({theme:o},y,b=>({[x]:b}));rx(m,y)?h[x]=t({sx:y,theme:o,nested:!0}):h=bn(h,m)}else h=bn(h,e(x,y,o,i))}),!s&&o.modularCssLayers?{"@layer sx":Aa(o,Pa(f,h))}:Aa(o,Pa(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Jt=sx();Jt.filterProps=["sx"];function ix(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=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(o){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 ax={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};function cx(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var lx=/[A-Z]|^ms/g,dx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Jl=function(t){return t.charCodeAt(1)===45},Va=function(t){return t!=null&&typeof t!="boolean"},eo=cx(function(e){return Jl(e)?e:e.replace(lx,"-$&").toLowerCase()}),Na=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(dx,function(r,o,s){return ht={name:o,styles:s,next:ht},o})}return ax[t]!==1&&!Jl(t)&&typeof n=="number"&&n!==0?n+"px":n};function cr(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 o=n;if(o.anim===1)return ht={name:o.name,styles:o.styles,next:ht},o.name;var s=n;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)ht={name:i.name,styles:i.styles,next:ht},i=i.next;var a=s.styles+";";return a}return ux(e,t,n)}}var c=n;return c}function ux(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=cr(e,t,n[o])+";";else for(var s in n){var i=n[s];if(typeof i!="object"){var a=i;Va(a)&&(r+=eo(s)+":"+Na(s,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var c=0;c<i.length;c++)Va(i[c])&&(r+=eo(s)+":"+Na(s,i[c])+";");else{var d=cr(e,t,i);switch(s){case"animation":case"animationName":{r+=eo(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var Ra=/label:\s*([^\s;{]+)\s*(;|$)/g,ht;function fx(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,o="";ht=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=cr(n,t,s);else{var i=s;o+=i[0]}for(var a=1;a<e.length;a++)if(o+=cr(n,t,e[a]),r){var c=s;o+=c[a]}Ra.lastIndex=0;for(var d="",u;(u=Ra.exec(o))!==null;)d+="-"+u[1];var f=ix(o)+d;return{name:f,styles:o,next:ht}}/**
|
|
48
|
+
`)),()=>{})}function Cs(e){return Vn(e,"spacing",8,"spacing")}function Nn(e,t){return typeof t=="string"||t==null?t:e(t)}function Ep(e,t){return n=>e.reduce((r,o)=>(r[o]=Nn(t,n),r),{})}function Tp(e,t,n,r){if(!t.includes(n))return null;const o=kp(n),s=Ep(o,r),i=e[n];return ct(e,i,s)}function Xc(e,t){const n=Cs(e.theme);return Object.keys(e).map(r=>Tp(e,t,r,n)).reduce(yn,{})}function Ce(e){return Xc(e,pr)}Ce.propTypes=process.env.NODE_ENV!=="production"?pr.reduce((e,t)=>(e[t]=yt,e),{}):{};Ce.filterProps=pr;function Ee(e){return Xc(e,xr)}Ee.propTypes=process.env.NODE_ENV!=="production"?xr.reduce((e,t)=>(e[t]=yt,e),{}):{};Ee.filterProps=xr;process.env.NODE_ENV!=="production"&&Cp.reduce((e,t)=>(e[t]=yt,e),{});function br(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(s=>{r[s]=o}),r),{}),n=r=>Object.keys(r).reduce((o,s)=>t[s]?yn(o,t[s](r)):o,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,o)=>Object.assign(r,o.propTypes),{}):{},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function ze(e){return typeof e!="number"?e:`${e}px solid`}function Ze(e,t){return Ae({prop:e,themeKey:"borders",transform:t})}const Ap=Ze("border",ze),jp=Ze("borderTop",ze),Pp=Ze("borderRight",ze),Mp=Ze("borderBottom",ze),Vp=Ze("borderLeft",ze),Np=Ze("borderColor"),Rp=Ze("borderTopColor"),Ip=Ze("borderRightColor"),Dp=Ze("borderBottomColor"),$p=Ze("borderLeftColor"),Fp=Ze("outline",ze),Op=Ze("outlineColor"),yr=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Vn(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Nn(t,r)});return ct(e,e.borderRadius,n)}return null};yr.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:yt}:{};yr.filterProps=["borderRadius"];br(Ap,jp,Pp,Mp,Vp,Np,Rp,Ip,Dp,$p,yr,Fp,Op);const vr=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Vn(e.theme,"spacing",8,"gap"),n=r=>({gap:Nn(t,r)});return ct(e,e.gap,n)}return null};vr.propTypes=process.env.NODE_ENV!=="production"?{gap:yt}:{};vr.filterProps=["gap"];const wr=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Vn(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Nn(t,r)});return ct(e,e.columnGap,n)}return null};wr.propTypes=process.env.NODE_ENV!=="production"?{columnGap:yt}:{};wr.filterProps=["columnGap"];const Sr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Vn(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Nn(t,r)});return ct(e,e.rowGap,n)}return null};Sr.propTypes=process.env.NODE_ENV!=="production"?{rowGap:yt}:{};Sr.filterProps=["rowGap"];const Lp=Ae({prop:"gridColumn"}),_p=Ae({prop:"gridRow"}),Bp=Ae({prop:"gridAutoFlow"}),zp=Ae({prop:"gridAutoColumns"}),Hp=Ae({prop:"gridAutoRows"}),Up=Ae({prop:"gridTemplateColumns"}),Zp=Ae({prop:"gridTemplateRows"}),Wp=Ae({prop:"gridTemplateAreas"}),Gp=Ae({prop:"gridArea"});br(vr,wr,Sr,Lp,_p,Bp,zp,Hp,Up,Zp,Wp,Gp);function Kt(e,t){return t==="grey"?t:e}const Kp=Ae({prop:"color",themeKey:"palette",transform:Kt}),Yp=Ae({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Kt}),qp=Ae({prop:"backgroundColor",themeKey:"palette",transform:Kt});br(Kp,Yp,qp);function Oe(e){return e<=1&&e!==0?`${e*100}%`:e}const Xp=Ae({prop:"width",transform:Oe}),Es=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var o,s,i,a,l;const r=((i=(s=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:s.values)==null?void 0:i[n])||mr[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Oe(n)}};return ct(e,e.maxWidth,t)}return null};Es.filterProps=["maxWidth"];const Jp=Ae({prop:"minWidth",transform:Oe}),Qp=Ae({prop:"height",transform:Oe}),ex=Ae({prop:"maxHeight",transform:Oe}),tx=Ae({prop:"minHeight",transform:Oe});Ae({prop:"size",cssProperty:"width",transform:Oe});Ae({prop:"size",cssProperty:"height",transform:Oe});const nx=Ae({prop:"boxSizing"});br(Xp,Es,Jp,Qp,ex,tx,nx);const kr={border:{themeKey:"borders",transform:ze},borderTop:{themeKey:"borders",transform:ze},borderRight:{themeKey:"borders",transform:ze},borderBottom:{themeKey:"borders",transform:ze},borderLeft:{themeKey:"borders",transform:ze},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ze},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:yr},color:{themeKey:"palette",transform:Kt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Kt},backgroundColor:{themeKey:"palette",transform:Kt},p:{style:Ee},pt:{style:Ee},pr:{style:Ee},pb:{style:Ee},pl:{style:Ee},px:{style:Ee},py:{style:Ee},padding:{style:Ee},paddingTop:{style:Ee},paddingRight:{style:Ee},paddingBottom:{style:Ee},paddingLeft:{style:Ee},paddingX:{style:Ee},paddingY:{style:Ee},paddingInline:{style:Ee},paddingInlineStart:{style:Ee},paddingInlineEnd:{style:Ee},paddingBlock:{style:Ee},paddingBlockStart:{style:Ee},paddingBlockEnd:{style:Ee},m:{style:Ce},mt:{style:Ce},mr:{style:Ce},mb:{style:Ce},ml:{style:Ce},mx:{style:Ce},my:{style:Ce},margin:{style:Ce},marginTop:{style:Ce},marginRight:{style:Ce},marginBottom:{style:Ce},marginLeft:{style:Ce},marginX:{style:Ce},marginY:{style:Ce},marginInline:{style:Ce},marginInlineStart:{style:Ce},marginInlineEnd:{style:Ce},marginBlock:{style:Ce},marginBlockStart:{style:Ce},marginBlockEnd:{style:Ce},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:vr},rowGap:{style:Sr},columnGap:{style:wr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Oe},maxWidth:{style:Es},minWidth:{transform:Oe},height:{transform:Oe},maxHeight:{transform:Oe},minHeight:{transform:Oe},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 rx(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function ox(e,t){return typeof e=="function"?e(t):e}function sx(){function e(n,r,o,s){const i={[n]:r,theme:o},a=s[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:d,transform:u,style:f}=a;if(r==null)return null;if(d==="typography"&&r==="inherit")return{[n]:r};const h=gr(o,d)||{};return f?f(i):ct(i,r,b=>{let m=ar(h,u,b);return b===m&&typeof b=="string"&&(m=ar(h,u,`${n}${b==="default"?"":Mt(b)}`,b)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:o={},nested:s}=n||{};if(!r)return null;const i=o.unstable_sxConfig??kr;function a(l){let d=l;if(typeof l=="function")d=l(o);else if(typeof l!="object")return l;if(!d)return null;const u=yp(o.breakpoints),f=Object.keys(u);let h=u;return Object.keys(d).forEach(x=>{const b=ox(d[x],o);if(b!=null)if(typeof b=="object")if(i[x])h=yn(h,e(x,b,o,i));else{const m=ct({theme:o},b,y=>({[x]:y}));rx(m,b)?h[x]=t({sx:b,theme:o,nested:!0}):h=yn(h,m)}else h=yn(h,e(x,b,o,i))}),!s&&o.modularCssLayers?{"@layer sx":Aa(o,Pa(f,h))}:Aa(o,Pa(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Jt=sx();Jt.filterProps=["sx"];function ix(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=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(o){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 ax={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};function lx(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var cx=/[A-Z]|^ms/g,dx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Jc=function(t){return t.charCodeAt(1)===45},Va=function(t){return t!=null&&typeof t!="boolean"},eo=lx(function(e){return Jc(e)?e:e.replace(cx,"-$&").toLowerCase()}),Na=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(dx,function(r,o,s){return ht={name:o,styles:s,next:ht},o})}return ax[t]!==1&&!Jc(t)&&typeof n=="number"&&n!==0?n+"px":n};function lr(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 o=n;if(o.anim===1)return ht={name:o.name,styles:o.styles,next:ht},o.name;var s=n;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)ht={name:i.name,styles:i.styles,next:ht},i=i.next;var a=s.styles+";";return a}return ux(e,t,n)}}var l=n;return l}function ux(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=lr(e,t,n[o])+";";else for(var s in n){var i=n[s];if(typeof i!="object"){var a=i;Va(a)&&(r+=eo(s)+":"+Na(s,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var l=0;l<i.length;l++)Va(i[l])&&(r+=eo(s)+":"+Na(s,i[l])+";");else{var d=lr(e,t,i);switch(s){case"animation":case"animationName":{r+=eo(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var Ra=/label:\s*([^\s;{]+)\s*(;|$)/g,ht;function fx(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,o="";ht=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=lr(n,t,s);else{var i=s;o+=i[0]}for(var a=1;a<e.length;a++)if(o+=lr(n,t,e[a]),r){var l=s;o+=l[a]}Ra.lastIndex=0;for(var d="",u;(u=Ra.exec(o))!==null;)d+="-"+u[1];var f=ix(o)+d;return{name:f,styles:o,next:ht}}/**
|
|
49
49
|
* @mui/styled-engine v7.2.0
|
|
50
50
|
*
|
|
51
51
|
* @license MIT
|
|
52
52
|
* This source code is licensed under the MIT license found in the
|
|
53
53
|
* LICENSE file in the root directory of this source tree.
|
|
54
54
|
*/function hx(e,t){const n=zd(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const o=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${o})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
|
|
55
|
-
`)):r.some(s=>s===void 0)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),n(...r)}:n}function mx(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ia=[];function jt(e){return Ia[0]=e,fx(Ia)}const gx=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 px(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,s=gx(t),i=Object.keys(s);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function
|
|
55
|
+
`)):r.some(s=>s===void 0)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),n(...r)}:n}function mx(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ia=[];function jt(e){return Ia[0]=e,fx(Ia)}const gx=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 px(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,s=gx(t),i=Object.keys(s);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function d(h,x){const b=i.indexOf(x);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(b!==-1&&typeof t[i[b]]=="number"?t[i[b]]:x)-r/100}${n})`}function u(h){return i.indexOf(h)+1<i.length?d(h,i[i.indexOf(h)+1]):a(h)}function f(h){const x=i.indexOf(h);return x===0?a(i[1]):x===i.length-1?l(i[x]):d(h,i[i.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:i,values:s,up:a,down:l,between:d,only:u,not:f,unit:n,...o}}const xx={borderRadius:4};function Qc(e=8,t=Cs({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(s=>{const i=t(s);return typeof i=="number"?`${i}px`:i}).join(" "));return n.mui=!0,n}function bx(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function ed(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:s={},...i}=e,a=px(n),l=Qc(o);let d=Le({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...xx,...s}},i);return d=xp(d),d.applyStyles=bx,d=t.reduce((u,f)=>Le(u,f),d),d.unstable_sxConfig={...kr,...i==null?void 0:i.unstable_sxConfig},d.unstable_sx=function(f){return Jt({sx:f,theme:this})},d}const yx={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 Ts(e,t,n="Mui"){const r=yx[t];return r?`${n}-${r}`:`${tp.generate(e)}-${t}`}function vx(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Ts(e,o,n)}),r}function td(e,t=""){return e.displayName||e.name||t}function Da(e,t,n){const r=td(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function wx(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return td(e,"Component");if(typeof e=="object")switch(e.$$typeof){case ir.ForwardRef:return Da(e,e.render,"ForwardRef");case ir.Memo:return Da(e,e.type,"memo");default:return}}}function nd(e){const{variants:t,...n}=e,r={variants:t,style:jt(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=jt(o.style))}),r}const Sx=ed();function to(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Et(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function kx(e){return e?(t,n)=>n[e]:null}function Cx(e,t,n){e.theme=jx(e.theme)?n:e.theme[t]||e.theme}function Jn(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>Jn(e,o,n));if(Array.isArray(r==null?void 0:r.variants)){let o;if(r.isProcessed)o=n?Et(r.style,n):r.style;else{const{variants:s,...i}=r;o=n?Et(jt(i),n):i}return rd(e,r.variants,[o],n)}return r!=null&&r.isProcessed?n?Et(jt(r.style),n):r.style:n?Et(jt(r),n):r}function rd(e,t,n=[],r=void 0){var s;let o;e:for(let i=0;i<t.length;i+=1){const a=t[i];if(typeof a.props=="function"){if(o??(o={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(o))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((s=e.ownerState)==null?void 0:s[l])!==a.props[l])continue e;typeof a.style=="function"?(o??(o={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Et(jt(a.style(o)),r):a.style(o))):n.push(r?Et(jt(a.style),r):a.style)}return n}function Ex(e={}){const{themeId:t,defaultTheme:n=Sx,rootShouldForwardProp:r=to,slotShouldForwardProp:o=to}=e;function s(a){Cx(a,t,n)}return(a,l={})=>{mx(a,j=>j.filter(P=>P!==Jt));const{name:d,slot:u,skipVariantsResolver:f,skipSx:h,overridesResolver:x=kx(od(u)),...b}=l,m=d&&d.startsWith("Mui")||u?"components":"custom",y=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,C=h||!1;let v=to;u==="Root"||u==="root"?v=r:u?v=o:Px(a)&&(v=void 0);const T=hx(a,{shouldForwardProp:v,label:Ax(d,u),...b}),k=j=>{if(j.__emotion_real===j)return j;if(typeof j=="function")return function(A){return Jn(A,j,A.theme.modularCssLayers?m:void 0)};if(st(j)){const P=nd(j);return function(_){return P.variants?Jn(_,P,_.theme.modularCssLayers?m:void 0):_.theme.modularCssLayers?Et(P.style,m):P.style}}return j},S=(...j)=>{const P=[],A=j.map(k),_=[];if(P.push(s),d&&x&&_.push(function(G){var X,I;const ne=(I=(X=G.theme.components)==null?void 0:X[d])==null?void 0:I.styleOverrides;if(!ne)return null;const oe={};for(const q in ne)oe[q]=Jn(G,ne[q],G.theme.modularCssLayers?"theme":void 0);return x(G,oe)}),d&&!y&&_.push(function(G){var oe,X;const te=G.theme,ne=(X=(oe=te==null?void 0:te.components)==null?void 0:oe[d])==null?void 0:X.variants;return ne?rd(G,ne,[],G.theme.modularCssLayers?"theme":void 0):null}),C||_.push(Jt),Array.isArray(A[0])){const B=A.shift(),G=new Array(P.length).fill(""),te=new Array(_.length).fill("");let ne;ne=[...G,...B,...te],ne.raw=[...G,...B.raw,...te],P.unshift(ne)}const p=[...P,...A,..._],V=T(...p);return a.muiName&&(V.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(V.displayName=Tx(d,u,a)),V};return T.withConfig&&(S.withConfig=T.withConfig),S}}function Tx(e,t,n){return e?`${e}${Mt(t||"")}`:`Styled(${wx(n)})`}function Ax(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${od(t||"Root")}`),n}function jx(e){for(const t in e)return!1;return!0}function Px(e){return typeof e=="string"&&e.charCodeAt(0)>96}function od(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function No(e,t,n=!1){const r={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const s=o;if(s==="components"||s==="slots")r[s]={...e[s],...r[s]};else if(s==="componentsProps"||s==="slotProps"){const i=e[s],a=t[s];if(!a)r[s]=i||{};else if(!i)r[s]=a;else{r[s]={...a};for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l)){const d=l;r[s][d]=No(i[d],a[d],n)}}}else s==="className"&&n&&t.className?r.className=Oo(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[s]===void 0&&(r[s]=e[s])}return r}function Mx(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function As(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}].`),Mx(e,t,n)}function Vx(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,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function xt(e){if(e.type)return e;if(e.charAt(0)==="#")return xt(Vx(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.
|
|
56
56
|
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:pt(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=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(o))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${o}\` color space.
|
|
57
|
-
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:pt(10,o))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:o}}const Nx=e=>{const t=xt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},fn=(e,t)=>{try{return Nx(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Cr(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,s)=>s<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function sd(e){e=xt(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,s=r*Math.min(o,1-o),i=(d,u=(d+n/30)%12)=>o-s*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const
|
|
58
|
-
`))}return
|
|
59
|
-
The color object needs to have a \`main\` property or a \`${C}\` property.`:pt(11,
|
|
57
|
+
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:pt(10,o))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:o}}const Nx=e=>{const t=xt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},fn=(e,t)=>{try{return Nx(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Cr(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,s)=>s<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function sd(e){e=xt(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,s=r*Math.min(o,1-o),i=(d,u=(d+n/30)%12)=>o-s*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Cr({type:a,values:l})}function Ro(e){e=xt(e);let t=e.type==="hsl"||e.type==="hsla"?xt(sd(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 $a(e,t){const n=Ro(e),r=Ro(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Rx(e,t){return e=xt(e),t=As(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Cr(e)}function Zn(e,t,n){try{return Rx(e,t)}catch{return e}}function js(e,t){if(e=xt(e),t=As(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 Cr(e)}function me(e,t,n){try{return js(e,t)}catch{return e}}function Ps(e,t){if(e=xt(e),t=As(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 Cr(e)}function ge(e,t,n){try{return Ps(e,t)}catch{return e}}function Ix(e,t=.15){return Ro(e)>.5?js(e,t):Ps(e,t)}function Wn(e,t,n){try{return Ix(e,t)}catch{return e}}const Dx=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(ae.node,ae.object);function $x(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?No(o.defaultProps,r,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?No(o,r,t.components.mergeClassNameAndStyle):r}function Fx({props:e,name:t}){const n=g.useContext(Dx);return $x({props:e,name:t,theme:{components:n}})}const Fa={theme:void 0};function Ox(e){let t,n;return function(o){let s=t;return(s===void 0||o.theme!==n)&&(Fa.theme=o.theme,s=nd(e(Fa)),t=s,n=o.theme),s}}function Lx(e=""){function t(...r){if(!r.length)return"";const o=r[0];return typeof o=="string"&&!o.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}-`:""}${o}${t(...r.slice(1))})`:`, ${o}`}return(r,...o)=>`var(--${e?`${e}-`:""}${r}${t(...o)})`}const Oa=(e,t,n,r=[])=>{let o=e;t.forEach((s,i)=>{i===t.length-1?Array.isArray(o)?o[Number(s)]=n:o&&typeof o=="object"&&(o[s]=n):o&&typeof o=="object"&&(o[s]||(o[s]=r.includes(s)?[]:{}),o=o[s])})},_x=(e,t,n)=>{function r(o,s=[],i=[]){Object.entries(o).forEach(([a,l])=>{(!n||n&&!n([...s,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...s,a],Array.isArray(l)?[...i,a]:i):t([...s,a],l,i))})}r(e)},Bx=(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 no(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},s={},i={};return _x(e,(a,l,d)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=Bx(a,l);Object.assign(o,{[u]:f}),Oa(s,a,`var(${u})`,d),Oa(i,a,`var(${u}, ${f})`,d)}},a=>a[0]==="vars"),{css:o,vars:s,varsWithDefaults:i}}function zx(e,t={}){const{getSelector:n=y,disableCssColorScheme:r,colorSchemeSelector:o}=t,{colorSchemes:s={},components:i,defaultColorScheme:a="light",...l}=e,{vars:d,css:u,varsWithDefaults:f}=no(l,t);let h=f;const x={},{[a]:b,...m}=s;if(Object.entries(m||{}).forEach(([T,k])=>{const{vars:S,css:j,varsWithDefaults:P}=no(k,t);h=Le(h,P),x[T]={css:j,vars:S}}),b){const{css:T,vars:k,varsWithDefaults:S}=no(b,t);h=Le(h,S),x[a]={css:T,vars:k}}function y(T,k){var j,P;let S=o;if(o==="class"&&(S=".%s"),o==="data"&&(S="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(S=`[${o}="%s"]`),T){if(S==="media")return e.defaultColorScheme===T?":root":{[`@media (prefers-color-scheme: ${((P=(j=s[T])==null?void 0:j.palette)==null?void 0:P.mode)||T})`]:{":root":k}};if(S)return e.defaultColorScheme===T?`:root, ${S.replace("%s",String(T))}`:S.replace("%s",String(T))}return":root"}return{vars:h,generateThemeVars:()=>{let T={...d};return Object.entries(x).forEach(([,{vars:k}])=>{T=Le(T,k)}),T},generateStyleSheets:()=>{var A,_;const T=[],k=e.defaultColorScheme||"light";function S(p,V){Object.keys(V).length&&T.push(typeof p=="string"?{[p]:{...V}}:p)}S(n(void 0,{...u}),u);const{[k]:j,...P}=x;if(j){const{css:p}=j,V=(_=(A=s[k])==null?void 0:A.palette)==null?void 0:_.mode,B=!r&&V?{colorScheme:V,...p}:{...p};S(n(k,{...B}),B)}return Object.entries(P).forEach(([p,{css:V}])=>{var te,ne;const B=(ne=(te=s[p])==null?void 0:te.palette)==null?void 0:ne.mode,G=!r&&B?{colorScheme:B,...V}:{...V};S(n(p,{...G}),G)}),T}}}function Hx(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 Tn={black:"#000",white:"#fff"},Ux={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"},It={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Dt={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},dn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},$t={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Ft={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Ot={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function id(){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:Tn.white,default:Tn.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 Zx=id();function ad(){return{text:{primary:Tn.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:Tn.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 La=ad();function _a(e,t,n,r){const o=r.light||r,s=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Ps(e.main,o):t==="dark"&&(e.dark=js(e.main,s)))}function Wx(e="light"){return e==="dark"?{main:$t[200],light:$t[50],dark:$t[400]}:{main:$t[700],light:$t[400],dark:$t[800]}}function Gx(e="light"){return e==="dark"?{main:It[200],light:It[50],dark:It[400]}:{main:It[500],light:It[300],dark:It[700]}}function Kx(e="light"){return e==="dark"?{main:Dt[500],light:Dt[300],dark:Dt[700]}:{main:Dt[700],light:Dt[400],dark:Dt[800]}}function Yx(e="light"){return e==="dark"?{main:Ft[400],light:Ft[300],dark:Ft[700]}:{main:Ft[700],light:Ft[500],dark:Ft[900]}}function qx(e="light"){return e==="dark"?{main:Ot[400],light:Ot[300],dark:Ot[700]}:{main:Ot[800],light:Ot[500],dark:Ot[900]}}function Xx(e="light"){return e==="dark"?{main:dn[400],light:dn[300],dark:dn[700]}:{main:"#ed6c02",light:dn[500],dark:dn[900]}}function Ms(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...o}=e,s=e.primary||Wx(t),i=e.secondary||Gx(t),a=e.error||Kx(t),l=e.info||Yx(t),d=e.success||qx(t),u=e.warning||Xx(t);function f(m){const y=$a(m,La.text.primary)>=n?La.text.primary:Zx.text.primary;if(process.env.NODE_ENV!=="production"){const C=$a(m,y);C<3&&console.error([`MUI: The contrast ratio of ${C}:1 for ${y} on ${m}`,"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(`
|
|
58
|
+
`))}return y}const h=({color:m,name:y,mainShade:C=500,lightShade:v=300,darkShade:T=700})=>{if(m={...m},!m.main&&m[C]&&(m.main=m[C]),!m.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${y?` (${y})`:""} provided to augmentColor(color) is invalid.
|
|
59
|
+
The color object needs to have a \`main\` property or a \`${C}\` property.`:pt(11,y?` (${y})`:"",C));if(typeof m.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${y?` (${y})`:""} provided to augmentColor(color) is invalid.
|
|
60
60
|
\`color.main\` should be a string, but \`${JSON.stringify(m.main)}\` was provided instead.
|
|
61
61
|
|
|
62
62
|
Did you intend to use one of the following approaches?
|
|
@@ -69,40 +69,40 @@ const theme1 = createTheme({ palette: {
|
|
|
69
69
|
|
|
70
70
|
const theme2 = createTheme({ palette: {
|
|
71
71
|
primary: { main: green[500] },
|
|
72
|
-
} });`:pt(12,
|
|
73
|
-
`)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:Ha(i)} ${a} ${typeof
|
|
72
|
+
} });`:pt(12,y?` (${y})`:"",JSON.stringify(m.main)));return _a(m,"light",v,r),_a(m,"dark",T,r),m.contrastText||(m.contrastText=f(m.main)),m};let x;return t==="light"?x=id():t==="dark"&&(x=ad()),process.env.NODE_ENV!=="production"&&(x||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Le({common:{...Tn},mode:t,primary:h({color:s,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:l,name:"info"}),success:h({color:d,name:"success"}),grey:Ux,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r,...x},o)}function Jx(e){const t={};return Object.entries(e).forEach(r=>{const[o,s]=r;typeof s=="object"&&(t[o]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function Qx(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function e1(e){return Math.round(e*1e5)/1e5}const Ba={textTransform:"uppercase"},za='"Roboto", "Helvetica", "Arial", sans-serif';function t1(e,t){const{fontFamily:n=za,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:i=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:d,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 l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,x=u||(y=>`${y/l*h}rem`),b=(y,C,v,T,k)=>({fontFamily:n,fontWeight:y,fontSize:x(C),lineHeight:v,...n===za?{letterSpacing:`${e1(T/C)}em`}:{},...k,...d}),m={h1:b(o,96,1.167,-1.5),h2:b(o,60,1.2,-.5),h3:b(s,48,1.167,0),h4:b(s,34,1.235,.25),h5:b(s,24,1.334,0),h6:b(i,20,1.6,.15),subtitle1:b(s,16,1.75,.15),subtitle2:b(i,14,1.57,.1),body1:b(s,16,1.5,.15),body2:b(s,14,1.43,.15),button:b(i,14,1.75,.4,Ba),caption:b(s,12,1.66,.4),overline:b(s,12,2.66,1,Ba),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Le({htmlFontSize:l,pxToRem:x,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:i,fontWeightBold:a,...m},f,{clone:!1})}const n1=.2,r1=.14,o1=.12;function be(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${n1})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${r1})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${o1})`].join(",")}const s1=["none",be(0,2,1,-1,0,1,1,0,0,1,3,0),be(0,3,1,-2,0,2,2,0,0,1,5,0),be(0,3,3,-2,0,3,4,0,0,1,8,0),be(0,2,4,-1,0,4,5,0,0,1,10,0),be(0,3,5,-1,0,5,8,0,0,1,14,0),be(0,3,5,-1,0,6,10,0,0,1,18,0),be(0,4,5,-2,0,7,10,1,0,2,16,1),be(0,5,5,-3,0,8,10,1,0,3,14,2),be(0,5,6,-3,0,9,12,1,0,3,16,2),be(0,6,6,-3,0,10,14,1,0,4,18,3),be(0,6,7,-4,0,11,15,1,0,4,20,3),be(0,7,8,-4,0,12,17,2,0,5,22,4),be(0,7,8,-4,0,13,19,2,0,5,24,4),be(0,7,9,-4,0,14,21,2,0,5,26,4),be(0,8,9,-5,0,15,22,2,0,6,28,5),be(0,8,10,-5,0,16,24,2,0,6,30,5),be(0,8,11,-5,0,17,26,2,0,6,32,5),be(0,9,11,-5,0,18,28,2,0,7,34,6),be(0,9,12,-6,0,19,29,2,0,7,36,6),be(0,10,13,-6,0,20,31,3,0,8,38,7),be(0,10,13,-6,0,21,33,3,0,8,40,7),be(0,10,14,-6,0,22,35,3,0,8,42,7),be(0,11,14,-7,0,23,36,3,0,9,44,8),be(0,11,15,-7,0,24,38,3,0,9,46,8)],i1={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)"},a1={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Ha(e){return`${Math.round(e)}ms`}function l1(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function c1(e){const t={...i1,...e.easing},n={...a1,...e.duration};return{getAutoHeightDuration:l1,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:l=0,...d}=s;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",f=h=>!Number.isNaN(parseFloat(h));!u(o)&&!Array.isArray(o)&&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(l)&&!u(l)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="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(`
|
|
73
|
+
`)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:Ha(i)} ${a} ${typeof l=="string"?l:Ha(l)}`).join(",")},...e,easing:t,duration:n}}const d1={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function u1(e){return st(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function ld(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let s=0;s<o.length;s++){const[i,a]=o[s];!u1(a)||i.startsWith("unstable_")?delete r[i]:st(a)&&(r[i]={...a},n(r[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
74
74
|
|
|
75
75
|
const theme = ${JSON.stringify(t,null,2)};
|
|
76
76
|
|
|
77
77
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
78
78
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
79
79
|
|
|
80
|
-
export default theme;`}function Io(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:s={},transitions:i={},typography:a={},shape:
|
|
81
|
-
`))}m[C]={}}}};Object.keys(h.components).forEach(m=>{const
|
|
82
|
-
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 b1(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Xe=e=>{try{return e()}catch{}},v1=(e="mui")=>Lx(e);function ro(e,t,n,r){if(!t)return;t=t===!0?{}:t;const o=r==="dark"?"dark":"light";if(!n){e[r]=m1({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:s,...i}=Io({...n,palette:{mode:o,...t==null?void 0:t.palette}});return e[r]={...t,palette:s,opacity:{...ld(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||dd(o)},i}function w1(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:i=g1,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...d}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),h=v1(s),{[f]:x,light:y,dark:m,...b}=n,C={...b};let v=x;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.`:pt(21,f));const T=ro(C,v,d,f);y&&!C.light&&ro(C,y,void 0,"light"),m&&!C.dark&&ro(C,m,void 0,"dark");let k={defaultColorScheme:f,...T,cssVarPrefix:s,colorSchemeSelector:a,rootSelector:c,getCssVar:h,colorSchemes:C,font:{...Jx(T.typography),...T.font},spacing:b1(d.spacing)};Object.keys(k.colorSchemes).forEach(_=>{const p=k.colorSchemes[_].palette,V=B=>{const G=B.split("-"),te=G[1],ne=G[2];return h(B,p[te][ne])};if(p.mode==="light"&&(N(p.common,"background","#fff"),N(p.common,"onBackground","#000")),p.mode==="dark"&&(N(p.common,"background","#000"),N(p.common,"onBackground","#fff")),y1(p,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),p.mode==="light"){N(p.Alert,"errorColor",me(p.error.light,.6)),N(p.Alert,"infoColor",me(p.info.light,.6)),N(p.Alert,"successColor",me(p.success.light,.6)),N(p.Alert,"warningColor",me(p.warning.light,.6)),N(p.Alert,"errorFilledBg",V("palette-error-main")),N(p.Alert,"infoFilledBg",V("palette-info-main")),N(p.Alert,"successFilledBg",V("palette-success-main")),N(p.Alert,"warningFilledBg",V("palette-warning-main")),N(p.Alert,"errorFilledColor",Xe(()=>p.getContrastText(p.error.main))),N(p.Alert,"infoFilledColor",Xe(()=>p.getContrastText(p.info.main))),N(p.Alert,"successFilledColor",Xe(()=>p.getContrastText(p.success.main))),N(p.Alert,"warningFilledColor",Xe(()=>p.getContrastText(p.warning.main))),N(p.Alert,"errorStandardBg",ge(p.error.light,.9)),N(p.Alert,"infoStandardBg",ge(p.info.light,.9)),N(p.Alert,"successStandardBg",ge(p.success.light,.9)),N(p.Alert,"warningStandardBg",ge(p.warning.light,.9)),N(p.Alert,"errorIconColor",V("palette-error-main")),N(p.Alert,"infoIconColor",V("palette-info-main")),N(p.Alert,"successIconColor",V("palette-success-main")),N(p.Alert,"warningIconColor",V("palette-warning-main")),N(p.AppBar,"defaultBg",V("palette-grey-100")),N(p.Avatar,"defaultBg",V("palette-grey-400")),N(p.Button,"inheritContainedBg",V("palette-grey-300")),N(p.Button,"inheritContainedHoverBg",V("palette-grey-A100")),N(p.Chip,"defaultBorder",V("palette-grey-400")),N(p.Chip,"defaultAvatarColor",V("palette-grey-700")),N(p.Chip,"defaultIconColor",V("palette-grey-700")),N(p.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),N(p.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),N(p.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),N(p.LinearProgress,"primaryBg",ge(p.primary.main,.62)),N(p.LinearProgress,"secondaryBg",ge(p.secondary.main,.62)),N(p.LinearProgress,"errorBg",ge(p.error.main,.62)),N(p.LinearProgress,"infoBg",ge(p.info.main,.62)),N(p.LinearProgress,"successBg",ge(p.success.main,.62)),N(p.LinearProgress,"warningBg",ge(p.warning.main,.62)),N(p.Skeleton,"bg",`rgba(${V("palette-text-primaryChannel")} / 0.11)`),N(p.Slider,"primaryTrack",ge(p.primary.main,.62)),N(p.Slider,"secondaryTrack",ge(p.secondary.main,.62)),N(p.Slider,"errorTrack",ge(p.error.main,.62)),N(p.Slider,"infoTrack",ge(p.info.main,.62)),N(p.Slider,"successTrack",ge(p.success.main,.62)),N(p.Slider,"warningTrack",ge(p.warning.main,.62));const B=Wn(p.background.default,.8);N(p.SnackbarContent,"bg",B),N(p.SnackbarContent,"color",Xe(()=>p.getContrastText(B))),N(p.SpeedDialAction,"fabHoverBg",Wn(p.background.paper,.15)),N(p.StepConnector,"border",V("palette-grey-400")),N(p.StepContent,"border",V("palette-grey-400")),N(p.Switch,"defaultColor",V("palette-common-white")),N(p.Switch,"defaultDisabledColor",V("palette-grey-100")),N(p.Switch,"primaryDisabledColor",ge(p.primary.main,.62)),N(p.Switch,"secondaryDisabledColor",ge(p.secondary.main,.62)),N(p.Switch,"errorDisabledColor",ge(p.error.main,.62)),N(p.Switch,"infoDisabledColor",ge(p.info.main,.62)),N(p.Switch,"successDisabledColor",ge(p.success.main,.62)),N(p.Switch,"warningDisabledColor",ge(p.warning.main,.62)),N(p.TableCell,"border",ge(Zn(p.divider,1),.88)),N(p.Tooltip,"bg",Zn(p.grey[700],.92))}if(p.mode==="dark"){N(p.Alert,"errorColor",ge(p.error.light,.6)),N(p.Alert,"infoColor",ge(p.info.light,.6)),N(p.Alert,"successColor",ge(p.success.light,.6)),N(p.Alert,"warningColor",ge(p.warning.light,.6)),N(p.Alert,"errorFilledBg",V("palette-error-dark")),N(p.Alert,"infoFilledBg",V("palette-info-dark")),N(p.Alert,"successFilledBg",V("palette-success-dark")),N(p.Alert,"warningFilledBg",V("palette-warning-dark")),N(p.Alert,"errorFilledColor",Xe(()=>p.getContrastText(p.error.dark))),N(p.Alert,"infoFilledColor",Xe(()=>p.getContrastText(p.info.dark))),N(p.Alert,"successFilledColor",Xe(()=>p.getContrastText(p.success.dark))),N(p.Alert,"warningFilledColor",Xe(()=>p.getContrastText(p.warning.dark))),N(p.Alert,"errorStandardBg",me(p.error.light,.9)),N(p.Alert,"infoStandardBg",me(p.info.light,.9)),N(p.Alert,"successStandardBg",me(p.success.light,.9)),N(p.Alert,"warningStandardBg",me(p.warning.light,.9)),N(p.Alert,"errorIconColor",V("palette-error-main")),N(p.Alert,"infoIconColor",V("palette-info-main")),N(p.Alert,"successIconColor",V("palette-success-main")),N(p.Alert,"warningIconColor",V("palette-warning-main")),N(p.AppBar,"defaultBg",V("palette-grey-900")),N(p.AppBar,"darkBg",V("palette-background-paper")),N(p.AppBar,"darkColor",V("palette-text-primary")),N(p.Avatar,"defaultBg",V("palette-grey-600")),N(p.Button,"inheritContainedBg",V("palette-grey-800")),N(p.Button,"inheritContainedHoverBg",V("palette-grey-700")),N(p.Chip,"defaultBorder",V("palette-grey-700")),N(p.Chip,"defaultAvatarColor",V("palette-grey-300")),N(p.Chip,"defaultIconColor",V("palette-grey-300")),N(p.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),N(p.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),N(p.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),N(p.LinearProgress,"primaryBg",me(p.primary.main,.5)),N(p.LinearProgress,"secondaryBg",me(p.secondary.main,.5)),N(p.LinearProgress,"errorBg",me(p.error.main,.5)),N(p.LinearProgress,"infoBg",me(p.info.main,.5)),N(p.LinearProgress,"successBg",me(p.success.main,.5)),N(p.LinearProgress,"warningBg",me(p.warning.main,.5)),N(p.Skeleton,"bg",`rgba(${V("palette-text-primaryChannel")} / 0.13)`),N(p.Slider,"primaryTrack",me(p.primary.main,.5)),N(p.Slider,"secondaryTrack",me(p.secondary.main,.5)),N(p.Slider,"errorTrack",me(p.error.main,.5)),N(p.Slider,"infoTrack",me(p.info.main,.5)),N(p.Slider,"successTrack",me(p.success.main,.5)),N(p.Slider,"warningTrack",me(p.warning.main,.5));const B=Wn(p.background.default,.98);N(p.SnackbarContent,"bg",B),N(p.SnackbarContent,"color",Xe(()=>p.getContrastText(B))),N(p.SpeedDialAction,"fabHoverBg",Wn(p.background.paper,.15)),N(p.StepConnector,"border",V("palette-grey-600")),N(p.StepContent,"border",V("palette-grey-600")),N(p.Switch,"defaultColor",V("palette-grey-300")),N(p.Switch,"defaultDisabledColor",V("palette-grey-600")),N(p.Switch,"primaryDisabledColor",me(p.primary.main,.55)),N(p.Switch,"secondaryDisabledColor",me(p.secondary.main,.55)),N(p.Switch,"errorDisabledColor",me(p.error.main,.55)),N(p.Switch,"infoDisabledColor",me(p.info.main,.55)),N(p.Switch,"successDisabledColor",me(p.success.main,.55)),N(p.Switch,"warningDisabledColor",me(p.warning.main,.55)),N(p.TableCell,"border",me(Zn(p.divider,1),.68)),N(p.Tooltip,"bg",Zn(p.grey[700],.92))}ot(p.background,"default"),ot(p.background,"paper"),ot(p.common,"background"),ot(p.common,"onBackground"),ot(p,"divider"),Object.keys(p).forEach(B=>{const G=p[B];B!=="tonalOffset"&&G&&typeof G=="object"&&(G.main&&N(p[B],"mainChannel",fn(hn(G.main))),G.light&&N(p[B],"lightChannel",fn(hn(G.light))),G.dark&&N(p[B],"darkChannel",fn(hn(G.dark))),G.contrastText&&N(p[B],"contrastTextChannel",fn(hn(G.contrastText))),B==="text"&&(ot(p[B],"primary"),ot(p[B],"secondary")),B==="action"&&(G.active&&ot(p[B],"active"),G.selected&&ot(p[B],"selected")))})}),k=t.reduce((_,p)=>Le(_,p),k);const S={prefix:s,disableCssColorScheme:o,shouldSkipGeneratingVar:i,getSelector:x1(k)},{vars:j,generateThemeVars:P,generateStyleSheets:A}=zx(k,S);return k.vars=j,Object.entries(k.colorSchemes[k.defaultColorScheme]).forEach(([_,p])=>{k[_]=p}),k.generateThemeVars=P,k.generateStyleSheets=A,k.generateSpacing=function(){return Ql(d.spacing,Cs(this))},k.getColorSchemeSelector=Hx(a),k.spacing=k.generateSpacing(),k.shouldSkipGeneratingVar=i,k.unstable_sxConfig={...kr,...d==null?void 0:d.unstable_sxConfig},k.unstable_sx=function(p){return Jt({sx:p,theme:this})},k.toRuntimeSource=cd,k}function Ua(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ms({...n===!0?{}:n.palette,mode:t})})}function S1(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:s=n==null?void 0:n.mode,...i}=e,a=s||"light",c=o==null?void 0:o[a],d={...o,...n?{[a]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Io(e,...t);let u=n;"palette"in e||d[a]&&(d[a]!==!0?u=d[a].palette:a==="dark"&&(u={mode:"dark"}));const f=Io({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=d,f.palette.mode==="light"&&(f.colorSchemes.light={...d.light!==!0&&d.light,palette:f.palette},Ua(f,"dark",d.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:f.palette},Ua(f,"light",d.light)),f}return!n&&!("light"in d)&&a==="light"&&(d.light=!0),w1({...i,colorSchemes:d,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const k1=S1(),C1="$$material";function E1(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const T1=e=>E1(e)&&e!=="classes",A1=Ex({themeId:C1,defaultTheme:k1,rootShouldForwardProp:T1}),j1=Ox;process.env.NODE_ENV!=="production"&&(ae.node,ae.object.isRequired);function P1(e){return Fx(e)}function M1(e){return Ts("MuiSvgIcon",e)}vx("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const V1=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Mt(t)}`,`fontSize${Mt(n)}`]};return up(o,M1,r)},N1=A1("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Mt(n.color)}`],t[`fontSize${Mt(n.fontSize)}`]]}})(j1(({theme:e})=>{var t,n,r,o,s,i,a,c,d,u,f,h,x,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:i.call(s,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=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:u.call(d,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var b,C;return{props:{color:m},style:{color:(C=(b=(e.vars??e).palette)==null?void 0:b[m])==null?void 0:C.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=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:y.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),lr=g.forwardRef(function(t,n){const r=P1({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:i="inherit",component:a="svg",fontSize:c="medium",htmlColor:d,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24",...x}=r,y=g.isValidElement(o)&&o.type==="svg",m={...r,color:i,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:y},b={};u||(b.viewBox=h);const C=V1(m);return l.jsxs(N1,{as:a,className:Oo(C.root,s),focusable:"false",color:d,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...b,...x,...y&&o.props,ownerState:m,children:[y?o.props.children:o,f?l.jsx("title",{children:f}):null]})});process.env.NODE_ENV!=="production"&&(lr.propTypes={children:ae.node,classes:ae.object,className:ae.string,color:ae.oneOfType([ae.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ae.string]),component:ae.elementType,fontSize:ae.oneOfType([ae.oneOf(["inherit","large","medium","small"]),ae.string]),htmlColor:ae.string,inheritViewBox:ae.bool,shapeRendering:ae.string,sx:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.func,ae.object,ae.bool])),ae.func,ae.object]),titleAccess:ae.string,viewBox:ae.string});lr.muiName="SvgIcon";function sn(e,t){function n(r,o){return l.jsx(lr,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:o,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=lr.muiName,g.memo(g.forwardRef(n))}const R1=sn(l.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"),I1=sn(l.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"),D1=sn([l.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),l.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"),ud=sn(l.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"),fd=sn(l.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"),hd=sn(l.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"),$1=({disabled:e,capabilities:t,sessionStarted:n,ref:r,participantName:o="User",loadingText:s="Waiting for agent to connect...",theme:i="vox",client:a,displayType:c="widget",onBack:d})=>{var I,q,M,z,Q,W,U;const[u,f]=w.useState(!1),[h,x]=w.useState(!1),[y,m]=w.useState(!1),[b,C]=w.useState(()=>{var D;const E=(D=a==null?void 0:a.getCurrentInteraction)==null?void 0:D.call(a);return console.log("SessionView: Initializing with existing interaction:",(E==null?void 0:E.methodName)||"none"),E||null}),{messages:v,send:T}=J0(),k=w.useRef(null),S=w.useRef(null),{agent:{isActive:j=!1}={}}=a?Gl(a):{agent:{isActive:!1}},P=Ne(i),A=c==="popup",_=w.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),p=w.useMemo(()=>a&&typeof a.getIsAgentConnected=="function"&&a.getIsAgentConnected()||y,[a,y]),V=j||p;w.useEffect(()=>{var E,D;console.log("🤖 SessionView agent state:",{isAgentActive:j,hasActiveSession:_,isAgentActuallyConnected:p,effectiveAgentActive:V,sessionStarted:n,clientSession:(D=(E=a==null?void 0:a.getCurrentSession)==null?void 0:E.call(a))==null?void 0:D.id})},[j,_,p,V,n,a]),w.useEffect(()=>{console.log("🤖 Agent active state changed:",j)},[j]),w.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:o,effectiveAgentActive:V,chatOpen:u,currentInteraction:(b==null?void 0:b.methodName)||"none"})},[n,e,o,V,u,b]),w.useEffect(()=>{if(n&&!V){console.log("⏰ Starting agent timeout detection...");const E=setTimeout(()=>{_&&!V&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),m(!0),x(!1))},5e3),D=setTimeout(()=>{V||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),x(!0))},3e4);return()=>{clearTimeout(E),clearTimeout(D)}}else V&&(console.log("✅ Agent is active, clearing timeout"),x(!1))},[n,V,_]),w.useEffect(()=>{if(!a)return;const E=()=>{console.log("🔄 Client connection state changed:",a.connected)},D=O=>{console.log("🔴 Client disconnected:",O),C(null),f(!1),x(!1)};return a.on("connection.connected",E),a.on("connection.disconnected",D),()=>{a.off("connection.connected",E),a.off("connection.disconnected",D)}},[a]),w.useEffect(()=>{if(!a)return;const E=F=>{console.log("🤖 SessionView: Agent connected!",F),m(!0),x(!1)},D=F=>{console.log("🗣️ SessionView: Agent speaking detected!",F),y||(m(!0),x(!1))},O=F=>{console.log("🤔 SessionView: Agent thinking detected!",F),y||(m(!0),x(!1))},$=()=>{console.log("🤖 SessionView: Agent disconnected"),m(!1)};return a.on("agent.connected",E),a.on("agent.speaking",D),a.on("agent.thinking",O),a.on("connection.disconnected",$),()=>{a.off("agent.connected",E),a.off("agent.speaking",D),a.off("agent.thinking",O),a.off("connection.disconnected",$)}},[a,y]),w.useEffect(()=>{if(!a)return;const E=F=>{console.log("🎯 SessionView: RPC Interaction started:",F);const L=a.getCurrentInteraction();L&&(console.log("📱 SessionView: Setting current interaction:",L.methodName,"mode:",L.presentationMode),C(L))},D=F=>{console.log("✅ SessionView: RPC Interaction completed:",F),C(null)},O=async F=>{console.log("⏰ SessionView: RPC Interaction timeout:",F),C(null)},$=async F=>{console.log("❌ SessionView: RPC Interaction dismissed:",F),C(null)};return a.on("rpc.interaction.started",E),a.on("rpc.interaction.completed",D),a.on("rpc.interaction.timeout",O),a.on("rpc.interaction.dismissed",$),()=>{a.off("rpc.interaction.started",E),a.off("rpc.interaction.completed",D),a.off("rpc.interaction.timeout",O),a.off("rpc.interaction.dismissed",$)}},[a]),w.useEffect(()=>{if(!a)return;const E=a.getCurrentInteraction();E?(console.log("🔄 SessionView: Syncing with existing interaction:",E.methodName),C(E)):C(null)},[a]),w.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(b==null?void 0:b.methodName)||"none","mode:",(b==null?void 0:b.presentationMode)||"none")},[b]),w.useEffect(()=>{var E,D,O;console.log("📱 SessionView: Display type changed to:",c),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:V,hasSession:!!((E=a==null?void 0:a.getCurrentSession)!=null&&E.call(a)),sessionId:(O=(D=a==null?void 0:a.getCurrentSession)==null?void 0:D.call(a))==null?void 0:O.id})},[c,n,V,a]),w.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),w.useEffect(()=>{b&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),f(!1))},[b,u]),Q0(),w.useEffect(()=>{k.current&&u&&v.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",v.length),setTimeout(()=>{if(k.current){let E=k.current.parentElement;for(;E&&E.scrollHeight<=E.clientHeight;)E=E.parentElement;E?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),E.scrollTo({top:E.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),k.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[v.length,u]),w.useEffect(()=>{var O,$;console.log("📝 SessionView: Messages updated, count:",v.length),v.length>0&&console.log("📝 SessionView: Latest messages:",v.slice(-3).map(F=>{var L,J,R,ce,xe,pe,Re;return{id:F.id,message:F.message,timestamp:F.timestamp,from:((L=F.from)==null?void 0:L.name)||((J=F.from)==null?void 0:J.identity),fromType:F.from===void 0?"unknown":"participant",isLocal:((R=F.from)==null?void 0:R.identity)===((pe=(xe=(ce=a==null?void 0:a.getCurrentSession)==null?void 0:ce.call(a))==null?void 0:xe.localParticipant)==null?void 0:pe.identity),messageLength:((Re=F.message)==null?void 0:Re.length)||0}}));const E=((O=a==null?void 0:a.getTranscriptions)==null?void 0:O.call(a))||[],D=(($=a==null?void 0:a.getChatMessages)==null?void 0:$.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",E.length),console.log("📝 SessionView: Raw chat messages count:",D.length)},[v.length,v,a]),w.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:v.length,displayType:c,hasMessages:v.length>0})},[u,v.length,c]);async function B(E){await T(E)}const G=w.useCallback(E=>{console.log("📝 SessionView: Adding local message for voice session context:",E)},[]),te=w.useCallback(async E=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(E),console.log("📎 SessionView: Attachments sent successfully:",E.map(D=>D.name)))}catch(D){console.error("❌ SessionView: Failed to send attachments:",D)}},[a]),ne=w.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:V,chatOpen:u,currentInteraction:b==null?void 0:b.methodName,hasOnBack:!!d}),b&&(console.log("🎭 SessionView: Dismissing current interaction:",b.methodName),C(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),f(!1),x(!1),m(!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")),d?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),d(),console.log("✅ SessionView: onBack called")):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(E){console.error("❌ SessionView: Failed to end call:",E),C(null),f(!1),x(!1),m(!1),d&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),d())}},[a,d,b,n,V,u]);w.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:o,displayType:c,hasOnBack:!!d,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,o,c,d,a]),w.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!d,onBackType:typeof d})},[d]),w.useEffect(()=>{var D,O;const E=((O=(D=a==null?void 0:a.getCurrentSession)==null?void 0:D.call(a))==null?void 0:O.id)||null;S.current&&!E&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:E,displayType:c,sessionStarted:n,effectiveAgentActive:V}),S.current=E},[a,c,n,V]);const oe=Z("w-full flex flex-col items-center justify-center",c==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",P.main,c==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),X=d&&(c==="popup"||c==="fullscreen");return l.jsxs("main",{ref:r,className:Z(oe,"relative session-view",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[X&&l.jsx("div",{className:Z("flex items-center justify-between w-full border-b flex-shrink-0",A?"p-2":"p-4",((I=P.chatHeader)==null?void 0:I.container)||"border-gray-200"),children:l.jsx("div",{className:"flex items-center",children:l.jsxs("div",{children:[l.jsx("h3",{className:Z("font-semibold",A?"text-xs":"text-sm",P.text.primary),children:"Voice Session"}),l.jsx("p",{className:Z(A?"text-[10px]":"text-sm",P.text.muted),children:o})]})})}),l.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!V&&n&&l.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[l.jsx(ie.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:l.jsx(ws,{className:P.spinner,weight:"bold"})}),l.jsx(ie.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${P.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":s}),l.jsx(ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${P.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&&d&&l.jsx(ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:d,className:`mt-4 px-4 py-2 rounded-lg ${((q=P.chatHeader)==null?void 0:q.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),V&&l.jsxs(l.Fragment,{children:[u&&l.jsxs("div",{className:Z("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:[l.jsxs("div",{className:Z("flex-shrink-0 px-4 py-3 border-b",c==="fullscreen"?"px-8":"px-5",((M=P.chatHeader)==null?void 0:M.container)||"border-gray-200 dark:border-gray-700"),children:[l.jsx("h3",{className:Z("font-semibold text-lg",((z=P.text)==null?void 0:z.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),l.jsxs("p",{className:Z("text-sm",((Q=P.text)==null?void 0:Q.muted)||"text-gray-600 dark:text-gray-400"),children:[v.length," messages"]})]}),l.jsx("div",{className:Z("flex-1 flex flex-col min-h-0",c==="fullscreen"?"px-8":"px-5"),children:l.jsx(H0,{className:"flex-1 flex flex-col min-h-0 h-full",children:l.jsxs("div",{className:`flex-1 flex flex-col h-full w-full ${Z("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[v.length===0&&l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:Z("text-lg font-medium mb-2",((W=P.text)==null?void 0:W.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),l.jsx("p",{className:Z("text-sm",((U=P.text)==null?void 0:U.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),v.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 min-h-4"}),l.jsx("div",{ref:k,className:"space-y-4 relative whitespace-pre-wrap z-0",children:l.jsx(Wt,{mode:"popLayout",children:v.map((E,D)=>l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:D*.02},layout:!0,children:l.jsx(B0,{participantName:o,entry:E})},E.id||`message-${D}`))})})]})]})})})]}),!u&&l.jsxs("div",{className:Z("flex-1 flex flex-col items-center w-full h-full min-h-0",(b==null?void 0:b.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[l.jsx(ie.div,{className:"w-full flex justify-center",animate:{y:(b==null?void 0:b.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:l.jsx(X0,{chatOpen:u,client:a})}),l.jsx(Wt,{mode:"wait",children:b&&b.presentationMode==="embedded"&&l.jsx(ie.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:Z("w-full relative mt-4 flex justify-center z-50",c==="fullscreen"?"max-w-4xl":"max-w-md"),children:l.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden z-50 relative",style:{zIndex:50},children:l.jsx(Xt,{interaction:b,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:G})})},`embedded-${b.methodName}`)})]})]})]}),l.jsx(Wt,{mode:"wait",children:b&&b.presentationMode!=="embedded"&&!u&&l.jsx("div",{className:Z("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",c==="fullscreen"?"bg-black/70":"bg-black/50"),children:l.jsx(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Z("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:l.jsx(Xt,{interaction:b,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:G})},`modal-${b.methodName}`)})}),l.jsx(ie.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:l.jsx(F1,{capabilities:t,onSendMessage:B,onSendAttachments:te,onEndCall:ne,onChatOpenChange:f,disabled:e,theme:i,client:a,sessionStarted:n,displayType:c})})]})};function F1({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:o,disabled:s=!1,theme:i,client:a,sessionStarted:c=!1,displayType:d="widget"}){const[u,f]=w.useState(!1),h=w.useRef(null),x=w.useRef(null),y=d==="popup";w.useEffect(()=>{const k=()=>{const S=navigator.userAgent.toLowerCase(),P=["android","iphone","ipad","mobile","tablet"].some(p=>S.includes(p)),A="ontouchstart"in window||navigator.maxTouchPoints>0,_=window.innerWidth<=768;f(P||A&&_)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const m=k=>{const S=k.target.files;if(S&&S.length>0){const P=Array.from(S).filter(A=>A.type.startsWith("image/"));if(P.length===0){console.warn("No valid image files selected");return}n&&n(P),h.current&&(h.current.value="")}},b=k=>{const S=k.target.files;if(S&&S.length>0){const j=S[0];j.type.startsWith("image/")&&n&&n([j]),x.current&&(x.current.value="")}},C=()=>{!s&&h.current&&h.current.click()},v=()=>{!s&&u&&x.current&&x.current.click()},T=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:s,sessionStarted:c,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return l.jsx("div",{className:Z("w-full backdrop-blur-xl border-0 shadow-lg flex-shrink-0",y?"px-2 py-1":"px-3 py-2",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:l.jsxs("div",{className:Z("flex items-center justify-between w-full mx-auto",y?"max-w-xs":"max-w-4xl"),children:[l.jsx("input",{ref:h,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:x,type:"file",onChange:b,className:"hidden",accept:"image/*",capture:"environment"}),l.jsxs("div",{className:Z("flex items-center",y?"gap-0.5":"gap-1"),children:[l.jsx("button",{onClick:C,disabled:s,className:Z(y?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"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:l.jsx(R1,{className:y?"w-3 h-3":"w-4 h-4"})}),u&&l.jsx("button",{onClick:v,disabled:s,className:Z(y?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"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:l.jsx(D1,{className:y?"w-3 h-3":"w-4 h-4"})})]}),l.jsx("div",{className:Z("flex-1 flex justify-center",y?"px-1":"px-3"),children:l.jsx(L0,{capabilities:e,onChatOpenChange:o,onSendMessage:t,theme:i,client:a,className:Z("border-none py-0 rounded-xl w-full",y?"max-w-xs":"max-w-md")})}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:T,disabled:s||!c,className:Z(y?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s||!c?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:l.jsx(I1,{className:y?"w-3 h-3":"w-4 h-4"})})})]})})}function O1({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:o,displayType:s}){const[i,a]=g.useState(""),[c,d]=g.useState(!1),u=g.useRef(null),f=g.useRef(null),[h,x]=g.useState(!1),y=Ne(r),m=s==="popup";g.useEffect(()=>{const j=()=>{const P=navigator.userAgent.toLowerCase(),_=["android","iphone","ipad","mobile","tablet"].some(B=>P.includes(B)),p="ontouchstart"in window||navigator.maxTouchPoints>0,V=window.innerWidth<=768;x(_||p&&V)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const b=j=>{j.preventDefault(),i.trim()&&!n&&(e(i.trim()),a(""))},C=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),b(j))},v=j=>{const P=j.target.files;if(P&&P.length>0){const A=Array.from(P),_=A.filter(p=>p.type.startsWith("image/"));if(_.length===0){console.warn("No valid image files selected");return}_.length!==A.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",_),t(_),u.current&&(u.current.value="")}},T=()=>{!n&&u.current&&u.current.click()},k=()=>{!n&&h&&f.current&&f.current.click()},S=j=>{const P=j.target.files;if(P&&P.length>0){const A=P[0];A.type.startsWith("image/")?t([A]):console.warn("Selected file is not an image"),f.current&&(f.current.value="")}};return l.jsx("div",{className:`${m?"px-2 py-1":"px-4 py-3"} !w-full backdrop-blur-xl border-0 shadow-lg `,children:l.jsx("form",{onSubmit:b,className:`w-full mx-auto ${m?"max-w-xs":""}`,children:l.jsxs("div",{className:`flex items-center ${m?"gap-1":"gap-2"} !w-full backdrop-blur-md rounded-full ${m?"px-2 py-1":"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":y.chatInput.container}`,children:[l.jsx(ie.button,{type:"button",onClick:T,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 ${y.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:l.jsx(Pe.Paperclip,{className:m?"w-3 h-3":"w-4 h-4"})}),h&&l.jsx(ie.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 ${y.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:l.jsx(Pe.Camera,{className:m?"w-3 h-3":"w-4 h-4"})}),l.jsx("input",{ref:u,type:"file",multiple:!0,onChange:v,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:f,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),l.jsx("textarea",{value:i,onChange:j=>a(j.target.value),onKeyDown:C,onFocus:()=>d(!0),onBlur:()=>d(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 ${m?"px-1 py-0.5 text-xs min-h-[20px]":"px-2 py-1 text-sm min-h-[32px]"} bg-transparent resize-none max-h-20 focus:outline-none border-0 ${y.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:m?"20px":"32px"},onInput:j=>{const P=j.target;P.style.height="auto",P.style.height=`${Math.min(P.scrollHeight,m?60:80)}px`}}),l.jsx(ie.button,{type:"submit",disabled:n||!i.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 flex-shrink-0 ${i.trim()&&!n?y.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:l.jsx(Pe.SendHorizontal,{className:m?"w-3 h-3":"w-4 h-4"})}),o&&l.jsx(ie.button,{type:"button",onClick:o,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 flex-shrink-0 ${y.chatInput.endButton}`,"aria-label":"End chat",children:l.jsx(Pe.PhoneOff,{className:m?"w-3 h-3":"w-4 h-4"})})]})})})}function L1({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[o,s]=g.useState(""),[i,a]=g.useState(0);return g.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(i<e.length){const c=setTimeout(()=>{s(e.slice(0,i+1)),a(i+1)},r);return()=>clearTimeout(c)}},[e,i,t,r,n]),g.useEffect(()=>{n||(a(0),s(""))},[e,n]),l.jsxs("span",{className:"relative",children:[l.jsx("span",{className:"inline-block",children:o}),!t&&l.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(c=>l.jsx(ie.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 _1({message:e,theme:t,isOwn:n,isStreaming:r=!1,displayType:o}){var c,d;const s=Ne(t),i=o==="popup",a=e.sender.name?e.sender.name.split(" ").map(u=>u[0]).join("").toUpperCase().slice(0,2):"U";return l.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:l.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[l.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:a}),l.jsxs("div",{className:`
|
|
80
|
+
export default theme;`}function Io(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:s={},transitions:i={},typography:a={},shape:l,...d}=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.":pt(20));const u=Ms(s),f=ed(e);let h=Le(f,{mixins:Qx(f.breakpoints,r),palette:u,shadows:s1.slice(),typography:t1(u,a),transitions:c1(i),zIndex:{...d1}});if(h=Le(h,d),h=t.reduce((x,b)=>Le(x,b),h),process.env.NODE_ENV!=="production"){const x=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],b=(m,y)=>{let C;for(C in m){const v=m[C];if(x.includes(C)&&Object.keys(v).length>0){if(process.env.NODE_ENV!=="production"){const T=Ts("",C);console.error([`MUI: The \`${y}\` component increases the CSS specificity of the \`${C}\` internal state.`,"You can not override it like this: ",JSON.stringify(m,null,2),"",`Instead, you need to use the '&.${T}' syntax:`,JSON.stringify({root:{[`&.${T}`]:v}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
81
|
+
`))}m[C]={}}}};Object.keys(h.components).forEach(m=>{const y=h.components[m].styleOverrides;y&&m.startsWith("Mui")&&b(y,m)})}return h.unstable_sxConfig={...kr,...d==null?void 0:d.unstable_sxConfig},h.unstable_sx=function(b){return Jt({sx:b,theme:this})},h.toRuntimeSource=ld,h}function f1(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 h1=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=f1(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function cd(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function dd(e){return e==="dark"?h1:[]}function m1(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...o}=e,s=Ms(t);return{palette:s,opacity:{...cd(s.mode),...n},overlays:r||dd(s.mode),...o}}function g1(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 p1=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],x1=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let s=o;if(o==="class"&&(s=".%s"),o==="data"&&(s="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(s=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return p1(e.cssVarPrefix).forEach(a=>{i[a]=n[a],delete n[a]}),s==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:s?{[s.replace("%s",t)]:i,[`${r}, ${s.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(s&&s!=="media")return`${r}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(s)return s.replace("%s",String(t))}return r};function b1(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function N(e,t,n){!e[t]&&n&&(e[t]=n)}function hn(e){return typeof e!="string"||!e.startsWith("hsl")?e:sd(e)}function ot(e,t){`${t}Channel`in e||(e[`${t}Channel`]=fn(hn(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().
|
|
82
|
+
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 y1(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Xe=e=>{try{return e()}catch{}},v1=(e="mui")=>Lx(e);function ro(e,t,n,r){if(!t)return;t=t===!0?{}:t;const o=r==="dark"?"dark":"light";if(!n){e[r]=m1({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:s,...i}=Io({...n,palette:{mode:o,...t==null?void 0:t.palette}});return e[r]={...t,palette:s,opacity:{...cd(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||dd(o)},i}function w1(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:i=g1,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...d}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),h=v1(s),{[f]:x,light:b,dark:m,...y}=n,C={...y};let v=x;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.`:pt(21,f));const T=ro(C,v,d,f);b&&!C.light&&ro(C,b,void 0,"light"),m&&!C.dark&&ro(C,m,void 0,"dark");let k={defaultColorScheme:f,...T,cssVarPrefix:s,colorSchemeSelector:a,rootSelector:l,getCssVar:h,colorSchemes:C,font:{...Jx(T.typography),...T.font},spacing:y1(d.spacing)};Object.keys(k.colorSchemes).forEach(_=>{const p=k.colorSchemes[_].palette,V=B=>{const G=B.split("-"),te=G[1],ne=G[2];return h(B,p[te][ne])};if(p.mode==="light"&&(N(p.common,"background","#fff"),N(p.common,"onBackground","#000")),p.mode==="dark"&&(N(p.common,"background","#000"),N(p.common,"onBackground","#fff")),b1(p,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),p.mode==="light"){N(p.Alert,"errorColor",me(p.error.light,.6)),N(p.Alert,"infoColor",me(p.info.light,.6)),N(p.Alert,"successColor",me(p.success.light,.6)),N(p.Alert,"warningColor",me(p.warning.light,.6)),N(p.Alert,"errorFilledBg",V("palette-error-main")),N(p.Alert,"infoFilledBg",V("palette-info-main")),N(p.Alert,"successFilledBg",V("palette-success-main")),N(p.Alert,"warningFilledBg",V("palette-warning-main")),N(p.Alert,"errorFilledColor",Xe(()=>p.getContrastText(p.error.main))),N(p.Alert,"infoFilledColor",Xe(()=>p.getContrastText(p.info.main))),N(p.Alert,"successFilledColor",Xe(()=>p.getContrastText(p.success.main))),N(p.Alert,"warningFilledColor",Xe(()=>p.getContrastText(p.warning.main))),N(p.Alert,"errorStandardBg",ge(p.error.light,.9)),N(p.Alert,"infoStandardBg",ge(p.info.light,.9)),N(p.Alert,"successStandardBg",ge(p.success.light,.9)),N(p.Alert,"warningStandardBg",ge(p.warning.light,.9)),N(p.Alert,"errorIconColor",V("palette-error-main")),N(p.Alert,"infoIconColor",V("palette-info-main")),N(p.Alert,"successIconColor",V("palette-success-main")),N(p.Alert,"warningIconColor",V("palette-warning-main")),N(p.AppBar,"defaultBg",V("palette-grey-100")),N(p.Avatar,"defaultBg",V("palette-grey-400")),N(p.Button,"inheritContainedBg",V("palette-grey-300")),N(p.Button,"inheritContainedHoverBg",V("palette-grey-A100")),N(p.Chip,"defaultBorder",V("palette-grey-400")),N(p.Chip,"defaultAvatarColor",V("palette-grey-700")),N(p.Chip,"defaultIconColor",V("palette-grey-700")),N(p.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),N(p.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),N(p.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),N(p.LinearProgress,"primaryBg",ge(p.primary.main,.62)),N(p.LinearProgress,"secondaryBg",ge(p.secondary.main,.62)),N(p.LinearProgress,"errorBg",ge(p.error.main,.62)),N(p.LinearProgress,"infoBg",ge(p.info.main,.62)),N(p.LinearProgress,"successBg",ge(p.success.main,.62)),N(p.LinearProgress,"warningBg",ge(p.warning.main,.62)),N(p.Skeleton,"bg",`rgba(${V("palette-text-primaryChannel")} / 0.11)`),N(p.Slider,"primaryTrack",ge(p.primary.main,.62)),N(p.Slider,"secondaryTrack",ge(p.secondary.main,.62)),N(p.Slider,"errorTrack",ge(p.error.main,.62)),N(p.Slider,"infoTrack",ge(p.info.main,.62)),N(p.Slider,"successTrack",ge(p.success.main,.62)),N(p.Slider,"warningTrack",ge(p.warning.main,.62));const B=Wn(p.background.default,.8);N(p.SnackbarContent,"bg",B),N(p.SnackbarContent,"color",Xe(()=>p.getContrastText(B))),N(p.SpeedDialAction,"fabHoverBg",Wn(p.background.paper,.15)),N(p.StepConnector,"border",V("palette-grey-400")),N(p.StepContent,"border",V("palette-grey-400")),N(p.Switch,"defaultColor",V("palette-common-white")),N(p.Switch,"defaultDisabledColor",V("palette-grey-100")),N(p.Switch,"primaryDisabledColor",ge(p.primary.main,.62)),N(p.Switch,"secondaryDisabledColor",ge(p.secondary.main,.62)),N(p.Switch,"errorDisabledColor",ge(p.error.main,.62)),N(p.Switch,"infoDisabledColor",ge(p.info.main,.62)),N(p.Switch,"successDisabledColor",ge(p.success.main,.62)),N(p.Switch,"warningDisabledColor",ge(p.warning.main,.62)),N(p.TableCell,"border",ge(Zn(p.divider,1),.88)),N(p.Tooltip,"bg",Zn(p.grey[700],.92))}if(p.mode==="dark"){N(p.Alert,"errorColor",ge(p.error.light,.6)),N(p.Alert,"infoColor",ge(p.info.light,.6)),N(p.Alert,"successColor",ge(p.success.light,.6)),N(p.Alert,"warningColor",ge(p.warning.light,.6)),N(p.Alert,"errorFilledBg",V("palette-error-dark")),N(p.Alert,"infoFilledBg",V("palette-info-dark")),N(p.Alert,"successFilledBg",V("palette-success-dark")),N(p.Alert,"warningFilledBg",V("palette-warning-dark")),N(p.Alert,"errorFilledColor",Xe(()=>p.getContrastText(p.error.dark))),N(p.Alert,"infoFilledColor",Xe(()=>p.getContrastText(p.info.dark))),N(p.Alert,"successFilledColor",Xe(()=>p.getContrastText(p.success.dark))),N(p.Alert,"warningFilledColor",Xe(()=>p.getContrastText(p.warning.dark))),N(p.Alert,"errorStandardBg",me(p.error.light,.9)),N(p.Alert,"infoStandardBg",me(p.info.light,.9)),N(p.Alert,"successStandardBg",me(p.success.light,.9)),N(p.Alert,"warningStandardBg",me(p.warning.light,.9)),N(p.Alert,"errorIconColor",V("palette-error-main")),N(p.Alert,"infoIconColor",V("palette-info-main")),N(p.Alert,"successIconColor",V("palette-success-main")),N(p.Alert,"warningIconColor",V("palette-warning-main")),N(p.AppBar,"defaultBg",V("palette-grey-900")),N(p.AppBar,"darkBg",V("palette-background-paper")),N(p.AppBar,"darkColor",V("palette-text-primary")),N(p.Avatar,"defaultBg",V("palette-grey-600")),N(p.Button,"inheritContainedBg",V("palette-grey-800")),N(p.Button,"inheritContainedHoverBg",V("palette-grey-700")),N(p.Chip,"defaultBorder",V("palette-grey-700")),N(p.Chip,"defaultAvatarColor",V("palette-grey-300")),N(p.Chip,"defaultIconColor",V("palette-grey-300")),N(p.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),N(p.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),N(p.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),N(p.LinearProgress,"primaryBg",me(p.primary.main,.5)),N(p.LinearProgress,"secondaryBg",me(p.secondary.main,.5)),N(p.LinearProgress,"errorBg",me(p.error.main,.5)),N(p.LinearProgress,"infoBg",me(p.info.main,.5)),N(p.LinearProgress,"successBg",me(p.success.main,.5)),N(p.LinearProgress,"warningBg",me(p.warning.main,.5)),N(p.Skeleton,"bg",`rgba(${V("palette-text-primaryChannel")} / 0.13)`),N(p.Slider,"primaryTrack",me(p.primary.main,.5)),N(p.Slider,"secondaryTrack",me(p.secondary.main,.5)),N(p.Slider,"errorTrack",me(p.error.main,.5)),N(p.Slider,"infoTrack",me(p.info.main,.5)),N(p.Slider,"successTrack",me(p.success.main,.5)),N(p.Slider,"warningTrack",me(p.warning.main,.5));const B=Wn(p.background.default,.98);N(p.SnackbarContent,"bg",B),N(p.SnackbarContent,"color",Xe(()=>p.getContrastText(B))),N(p.SpeedDialAction,"fabHoverBg",Wn(p.background.paper,.15)),N(p.StepConnector,"border",V("palette-grey-600")),N(p.StepContent,"border",V("palette-grey-600")),N(p.Switch,"defaultColor",V("palette-grey-300")),N(p.Switch,"defaultDisabledColor",V("palette-grey-600")),N(p.Switch,"primaryDisabledColor",me(p.primary.main,.55)),N(p.Switch,"secondaryDisabledColor",me(p.secondary.main,.55)),N(p.Switch,"errorDisabledColor",me(p.error.main,.55)),N(p.Switch,"infoDisabledColor",me(p.info.main,.55)),N(p.Switch,"successDisabledColor",me(p.success.main,.55)),N(p.Switch,"warningDisabledColor",me(p.warning.main,.55)),N(p.TableCell,"border",me(Zn(p.divider,1),.68)),N(p.Tooltip,"bg",Zn(p.grey[700],.92))}ot(p.background,"default"),ot(p.background,"paper"),ot(p.common,"background"),ot(p.common,"onBackground"),ot(p,"divider"),Object.keys(p).forEach(B=>{const G=p[B];B!=="tonalOffset"&&G&&typeof G=="object"&&(G.main&&N(p[B],"mainChannel",fn(hn(G.main))),G.light&&N(p[B],"lightChannel",fn(hn(G.light))),G.dark&&N(p[B],"darkChannel",fn(hn(G.dark))),G.contrastText&&N(p[B],"contrastTextChannel",fn(hn(G.contrastText))),B==="text"&&(ot(p[B],"primary"),ot(p[B],"secondary")),B==="action"&&(G.active&&ot(p[B],"active"),G.selected&&ot(p[B],"selected")))})}),k=t.reduce((_,p)=>Le(_,p),k);const S={prefix:s,disableCssColorScheme:o,shouldSkipGeneratingVar:i,getSelector:x1(k)},{vars:j,generateThemeVars:P,generateStyleSheets:A}=zx(k,S);return k.vars=j,Object.entries(k.colorSchemes[k.defaultColorScheme]).forEach(([_,p])=>{k[_]=p}),k.generateThemeVars=P,k.generateStyleSheets=A,k.generateSpacing=function(){return Qc(d.spacing,Cs(this))},k.getColorSchemeSelector=Hx(a),k.spacing=k.generateSpacing(),k.shouldSkipGeneratingVar=i,k.unstable_sxConfig={...kr,...d==null?void 0:d.unstable_sxConfig},k.unstable_sx=function(p){return Jt({sx:p,theme:this})},k.toRuntimeSource=ld,k}function Ua(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ms({...n===!0?{}:n.palette,mode:t})})}function S1(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:s=n==null?void 0:n.mode,...i}=e,a=s||"light",l=o==null?void 0:o[a],d={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Io(e,...t);let u=n;"palette"in e||d[a]&&(d[a]!==!0?u=d[a].palette:a==="dark"&&(u={mode:"dark"}));const f=Io({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=d,f.palette.mode==="light"&&(f.colorSchemes.light={...d.light!==!0&&d.light,palette:f.palette},Ua(f,"dark",d.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:f.palette},Ua(f,"light",d.light)),f}return!n&&!("light"in d)&&a==="light"&&(d.light=!0),w1({...i,colorSchemes:d,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const k1=S1(),C1="$$material";function E1(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const T1=e=>E1(e)&&e!=="classes",A1=Ex({themeId:C1,defaultTheme:k1,rootShouldForwardProp:T1}),j1=Ox;process.env.NODE_ENV!=="production"&&(ae.node,ae.object.isRequired);function P1(e){return Fx(e)}function M1(e){return Ts("MuiSvgIcon",e)}vx("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const V1=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Mt(t)}`,`fontSize${Mt(n)}`]};return up(o,M1,r)},N1=A1("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Mt(n.color)}`],t[`fontSize${Mt(n.fontSize)}`]]}})(j1(({theme:e})=>{var t,n,r,o,s,i,a,l,d,u,f,h,x,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:i.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:u.call(d,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var y,C;return{props:{color:m},style:{color:(C=(y=(e.vars??e).palette)==null?void 0:y[m])==null?void 0:C.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:(b=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:b.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),cr=g.forwardRef(function(t,n){const r=P1({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:i="inherit",component:a="svg",fontSize:l="medium",htmlColor:d,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24",...x}=r,b=g.isValidElement(o)&&o.type==="svg",m={...r,color:i,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:b},y={};u||(y.viewBox=h);const C=V1(m);return c.jsxs(N1,{as:a,className:Oo(C.root,s),focusable:"false",color:d,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...y,...x,...b&&o.props,ownerState:m,children:[b?o.props.children:o,f?c.jsx("title",{children:f}):null]})});process.env.NODE_ENV!=="production"&&(cr.propTypes={children:ae.node,classes:ae.object,className:ae.string,color:ae.oneOfType([ae.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ae.string]),component:ae.elementType,fontSize:ae.oneOfType([ae.oneOf(["inherit","large","medium","small"]),ae.string]),htmlColor:ae.string,inheritViewBox:ae.bool,shapeRendering:ae.string,sx:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.func,ae.object,ae.bool])),ae.func,ae.object]),titleAccess:ae.string,viewBox:ae.string});cr.muiName="SvgIcon";function sn(e,t){function n(r,o){return c.jsx(cr,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:o,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=cr.muiName,g.memo(g.forwardRef(n))}const R1=sn(c.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"),I1=sn(c.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"),D1=sn([c.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),c.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"),ud=sn(c.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"),fd=sn(c.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"),hd=sn(c.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"),$1=({disabled:e,capabilities:t,sessionStarted:n,ref:r,participantName:o="User",loadingText:s="Waiting for agent to connect...",theme:i="vox",client:a,displayType:l="widget",onBack:d})=>{var I,q,M,z,Q,W,U;const[u,f]=w.useState(!1),[h,x]=w.useState(!1),[b,m]=w.useState(!1),[y,C]=w.useState(()=>{var D;const E=(D=a==null?void 0:a.getCurrentInteraction)==null?void 0:D.call(a);return console.log("SessionView: Initializing with existing interaction:",(E==null?void 0:E.methodName)||"none"),E||null}),{messages:v,send:T}=J0(),k=w.useRef(null),S=w.useRef(null),{agent:{isActive:j=!1}={}}=a?Gc(a):{agent:{isActive:!1}},P=Ne(i),A=l==="popup",_=w.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),p=w.useMemo(()=>a&&typeof a.getIsAgentConnected=="function"&&a.getIsAgentConnected()||b,[a,b]),V=j||p;w.useEffect(()=>{var E,D;console.log("🤖 SessionView agent state:",{isAgentActive:j,hasActiveSession:_,isAgentActuallyConnected:p,effectiveAgentActive:V,sessionStarted:n,clientSession:(D=(E=a==null?void 0:a.getCurrentSession)==null?void 0:E.call(a))==null?void 0:D.id})},[j,_,p,V,n,a]),w.useEffect(()=>{console.log("🤖 Agent active state changed:",j)},[j]),w.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:o,effectiveAgentActive:V,chatOpen:u,currentInteraction:(y==null?void 0:y.methodName)||"none"})},[n,e,o,V,u,y]),w.useEffect(()=>{if(n&&!V){console.log("⏰ Starting agent timeout detection...");const E=setTimeout(()=>{_&&!V&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),m(!0),x(!1))},5e3),D=setTimeout(()=>{V||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),x(!0))},3e4);return()=>{clearTimeout(E),clearTimeout(D)}}else V&&(console.log("✅ Agent is active, clearing timeout"),x(!1))},[n,V,_]),w.useEffect(()=>{if(!a)return;const E=()=>{console.log("🔄 Client connection state changed:",a.connected)},D=O=>{console.log("🔴 Client disconnected:",O),C(null),f(!1),x(!1)};return a.on("connection.connected",E),a.on("connection.disconnected",D),()=>{a.off("connection.connected",E),a.off("connection.disconnected",D)}},[a]),w.useEffect(()=>{if(!a)return;const E=F=>{console.log("🤖 SessionView: Agent connected!",F),m(!0),x(!1)},D=F=>{console.log("🗣️ SessionView: Agent speaking detected!",F),b||(m(!0),x(!1))},O=F=>{console.log("🤔 SessionView: Agent thinking detected!",F),b||(m(!0),x(!1))},$=()=>{console.log("🤖 SessionView: Agent disconnected"),m(!1)};return a.on("agent.connected",E),a.on("agent.speaking",D),a.on("agent.thinking",O),a.on("connection.disconnected",$),()=>{a.off("agent.connected",E),a.off("agent.speaking",D),a.off("agent.thinking",O),a.off("connection.disconnected",$)}},[a,b]),w.useEffect(()=>{if(!a)return;const E=F=>{console.log("🎯 SessionView: RPC Interaction started:",F);const L=a.getCurrentInteraction();L&&(console.log("📱 SessionView: Setting current interaction:",L.methodName,"mode:",L.presentationMode),C(L))},D=F=>{console.log("✅ SessionView: RPC Interaction completed:",F),C(null)},O=async F=>{console.log("⏰ SessionView: RPC Interaction timeout:",F),C(null)},$=async F=>{console.log("❌ SessionView: RPC Interaction dismissed:",F),C(null)};return a.on("rpc.interaction.started",E),a.on("rpc.interaction.completed",D),a.on("rpc.interaction.timeout",O),a.on("rpc.interaction.dismissed",$),()=>{a.off("rpc.interaction.started",E),a.off("rpc.interaction.completed",D),a.off("rpc.interaction.timeout",O),a.off("rpc.interaction.dismissed",$)}},[a]),w.useEffect(()=>{if(!a)return;const E=a.getCurrentInteraction();E?(console.log("🔄 SessionView: Syncing with existing interaction:",E.methodName),C(E)):C(null)},[a]),w.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(y==null?void 0:y.methodName)||"none","mode:",(y==null?void 0:y.presentationMode)||"none")},[y]),w.useEffect(()=>{var E,D,O;console.log("📱 SessionView: Display type changed to:",l),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:V,hasSession:!!((E=a==null?void 0:a.getCurrentSession)!=null&&E.call(a)),sessionId:(O=(D=a==null?void 0:a.getCurrentSession)==null?void 0:D.call(a))==null?void 0:O.id})},[l,n,V,a]),w.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),w.useEffect(()=>{y&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),f(!1))},[y,u]),Q0(),w.useEffect(()=>{k.current&&u&&v.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",v.length),setTimeout(()=>{if(k.current){let E=k.current.parentElement;for(;E&&E.scrollHeight<=E.clientHeight;)E=E.parentElement;E?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),E.scrollTo({top:E.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),k.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[v.length,u]),w.useEffect(()=>{var O,$;console.log("📝 SessionView: Messages updated, count:",v.length),v.length>0&&console.log("📝 SessionView: Latest messages:",v.slice(-3).map(F=>{var L,J,R,le,xe,pe,Re;return{id:F.id,message:F.message,timestamp:F.timestamp,from:((L=F.from)==null?void 0:L.name)||((J=F.from)==null?void 0:J.identity),fromType:F.from===void 0?"unknown":"participant",isLocal:((R=F.from)==null?void 0:R.identity)===((pe=(xe=(le=a==null?void 0:a.getCurrentSession)==null?void 0:le.call(a))==null?void 0:xe.localParticipant)==null?void 0:pe.identity),messageLength:((Re=F.message)==null?void 0:Re.length)||0}}));const E=((O=a==null?void 0:a.getTranscriptions)==null?void 0:O.call(a))||[],D=(($=a==null?void 0:a.getChatMessages)==null?void 0:$.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",E.length),console.log("📝 SessionView: Raw chat messages count:",D.length)},[v.length,v,a]),w.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:v.length,displayType:l,hasMessages:v.length>0})},[u,v.length,l]);async function B(E){await T(E)}const G=w.useCallback(E=>{console.log("📝 SessionView: Adding local message for voice session context:",E)},[]),te=w.useCallback(async E=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(E),console.log("📎 SessionView: Attachments sent successfully:",E.map(D=>D.name)))}catch(D){console.error("❌ SessionView: Failed to send attachments:",D)}},[a]),ne=w.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:V,chatOpen:u,currentInteraction:y==null?void 0:y.methodName,hasOnBack:!!d}),y&&(console.log("🎭 SessionView: Dismissing current interaction:",y.methodName),C(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),f(!1),x(!1),m(!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")),d?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),d(),console.log("✅ SessionView: onBack called")):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(E){console.error("❌ SessionView: Failed to end call:",E),C(null),f(!1),x(!1),m(!1),d&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),d())}},[a,d,y,n,V,u]);w.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:o,displayType:l,hasOnBack:!!d,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,o,l,d,a]),w.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!d,onBackType:typeof d})},[d]),w.useEffect(()=>{var D,O;const E=((O=(D=a==null?void 0:a.getCurrentSession)==null?void 0:D.call(a))==null?void 0:O.id)||null;S.current&&!E&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:E,displayType:l,sessionStarted:n,effectiveAgentActive:V}),S.current=E},[a,l,n,V]);const oe=Z("w-full flex flex-col items-center justify-center",l==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",P.main,l==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),X=d&&(l==="popup"||l==="fullscreen");return c.jsxs("main",{ref:r,className:Z(oe,"relative session-view",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[X&&c.jsx("div",{className:Z("flex items-center justify-between w-full border-b flex-shrink-0",A?"p-2":"p-4",((I=P.chatHeader)==null?void 0:I.container)||"border-gray-200"),children:c.jsx("div",{className:"flex items-center",children:c.jsxs("div",{children:[c.jsx("h3",{className:Z("font-semibold",A?"text-xs":"text-sm",P.text.primary),children:"Voice Session"}),c.jsx("p",{className:Z(A?"text-[10px]":"text-sm",P.text.muted),children:o})]})})}),c.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!V&&n&&c.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[c.jsx(ie.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:c.jsx(ws,{className:P.spinner,weight:"bold"})}),c.jsx(ie.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${P.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":s}),c.jsx(ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${P.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&&d&&c.jsx(ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:d,className:`mt-4 px-4 py-2 rounded-lg ${((q=P.chatHeader)==null?void 0:q.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),V&&c.jsxs(c.Fragment,{children:[u&&c.jsxs("div",{className:Z("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:[c.jsxs("div",{className:Z("flex-shrink-0 px-4 py-3 border-b",l==="fullscreen"?"px-8":"px-5",((M=P.chatHeader)==null?void 0:M.container)||"border-gray-200 dark:border-gray-700"),children:[c.jsx("h3",{className:Z("font-semibold text-lg",((z=P.text)==null?void 0:z.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),c.jsxs("p",{className:Z("text-sm",((Q=P.text)==null?void 0:Q.muted)||"text-gray-600 dark:text-gray-400"),children:[v.length," messages"]})]}),c.jsx("div",{className:Z("flex-1 flex flex-col min-h-0",l==="fullscreen"?"px-8":"px-5"),children:c.jsx(H0,{className:"flex-1 flex flex-col min-h-0 h-full",children:c.jsxs("div",{className:`flex-1 flex flex-col h-full w-full ${Z("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[v.length===0&&c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:Z("text-lg font-medium mb-2",((W=P.text)==null?void 0:W.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),c.jsx("p",{className:Z("text-sm",((U=P.text)==null?void 0:U.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),v.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex-1 min-h-4"}),c.jsx("div",{ref:k,className:"space-y-4 relative whitespace-pre-wrap z-0",children:c.jsx(Wt,{mode:"popLayout",children:v.map((E,D)=>c.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:D*.02},layout:!0,children:c.jsx(B0,{participantName:o,entry:E})},E.id||`message-${D}`))})})]})]})})})]}),!u&&c.jsxs("div",{className:Z("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:[c.jsx(ie.div,{className:"w-full flex justify-center",animate:{y:(y==null?void 0:y.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:c.jsx(X0,{chatOpen:u,client:a})}),c.jsx(Wt,{mode:"wait",children:y&&y.presentationMode==="embedded"&&c.jsx(ie.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:Z("w-full relative mt-4 flex justify-center z-50",l==="fullscreen"?"max-w-4xl":"max-w-md"),children:c.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden z-50 relative",style:{zIndex:50},children:c.jsx(Xt,{interaction:y,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:G})})},`embedded-${y.methodName}`)})]})]})]}),c.jsx(Wt,{mode:"wait",children:y&&y.presentationMode!=="embedded"&&!u&&c.jsx("div",{className:Z("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",l==="fullscreen"?"bg-black/70":"bg-black/50"),children:c.jsx(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Z("relative w-full overflow-hidden",l==="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:c.jsx(Xt,{interaction:y,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:G})},`modal-${y.methodName}`)})}),c.jsx(ie.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:c.jsx(F1,{capabilities:t,onSendMessage:B,onSendAttachments:te,onEndCall:ne,onChatOpenChange:f,disabled:e,theme:i,client:a,sessionStarted:n,displayType:l})})]})};function F1({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:o,disabled:s=!1,theme:i,client:a,sessionStarted:l=!1,displayType:d="widget"}){const[u,f]=w.useState(!1),h=w.useRef(null),x=w.useRef(null),b=d==="popup";w.useEffect(()=>{const k=()=>{const S=navigator.userAgent.toLowerCase(),P=["android","iphone","ipad","mobile","tablet"].some(p=>S.includes(p)),A="ontouchstart"in window||navigator.maxTouchPoints>0,_=window.innerWidth<=768;f(P||A&&_)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const m=k=>{const S=k.target.files;if(S&&S.length>0){const P=Array.from(S).filter(A=>A.type.startsWith("image/"));if(P.length===0){console.warn("No valid image files selected");return}n&&n(P),h.current&&(h.current.value="")}},y=k=>{const S=k.target.files;if(S&&S.length>0){const j=S[0];j.type.startsWith("image/")&&n&&n([j]),x.current&&(x.current.value="")}},C=()=>{!s&&h.current&&h.current.click()},v=()=>{!s&&u&&x.current&&x.current.click()},T=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:s,sessionStarted:l,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return c.jsx("div",{className:Z("w-full backdrop-blur-xl border-0 shadow-lg flex-shrink-0",b?"px-2 py-1":"px-3 py-2",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:c.jsxs("div",{className:Z("flex items-center justify-between w-full mx-auto",b?"max-w-xs":"max-w-4xl"),children:[c.jsx("input",{ref:h,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*"}),c.jsx("input",{ref:x,type:"file",onChange:y,className:"hidden",accept:"image/*",capture:"environment"}),c.jsxs("div",{className:Z("flex items-center",b?"gap-0.5":"gap-1"),children:[c.jsx("button",{onClick:C,disabled:s,className:Z(b?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"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:c.jsx(R1,{className:b?"w-3 h-3":"w-4 h-4"})}),u&&c.jsx("button",{onClick:v,disabled:s,className:Z(b?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"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:c.jsx(D1,{className:b?"w-3 h-3":"w-4 h-4"})})]}),c.jsx("div",{className:Z("flex-1 flex justify-center",b?"px-1":"px-3"),children:c.jsx(L0,{capabilities:e,onChatOpenChange:o,onSendMessage:t,theme:i,client:a,className:Z("border-none py-0 rounded-xl w-full",b?"max-w-xs":"max-w-md")})}),c.jsx("div",{className:"flex items-center",children:c.jsx("button",{onClick:T,disabled:s||!l,className:Z(b?"p-0.5 rounded-full transition-all duration-200 hover:scale-105 active:scale-95":"p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s||!l?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:c.jsx(I1,{className:b?"w-3 h-3":"w-4 h-4"})})})]})})}function O1({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:o,displayType:s}){const[i,a]=g.useState(""),[l,d]=g.useState(!1),u=g.useRef(null),f=g.useRef(null),[h,x]=g.useState(!1),b=Ne(r),m=s==="popup";g.useEffect(()=>{const j=()=>{const P=navigator.userAgent.toLowerCase(),_=["android","iphone","ipad","mobile","tablet"].some(B=>P.includes(B)),p="ontouchstart"in window||navigator.maxTouchPoints>0,V=window.innerWidth<=768;x(_||p&&V)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const y=j=>{j.preventDefault(),i.trim()&&!n&&(e(i.trim()),a(""))},C=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),y(j))},v=j=>{const P=j.target.files;if(P&&P.length>0){const A=Array.from(P),_=A.filter(p=>p.type.startsWith("image/"));if(_.length===0){console.warn("No valid image files selected");return}_.length!==A.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",_),t(_),u.current&&(u.current.value="")}},T=()=>{!n&&u.current&&u.current.click()},k=()=>{!n&&h&&f.current&&f.current.click()},S=j=>{const P=j.target.files;if(P&&P.length>0){const A=P[0];A.type.startsWith("image/")?t([A]):console.warn("Selected file is not an image"),f.current&&(f.current.value="")}};return c.jsx("div",{className:`${m?"px-2 py-1":"px-4 py-3"} !w-full backdrop-blur-xl border-0 shadow-lg `,children:c.jsx("form",{onSubmit:y,className:`w-full mx-auto ${m?"max-w-xs":""}`,children:c.jsxs("div",{className:`flex items-center ${m?"gap-1":"gap-2"} !w-full backdrop-blur-md rounded-full ${m?"px-2 py-1":"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":b.chatInput.container}`,children:[c.jsx(ie.button,{type:"button",onClick:T,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 ${b.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:c.jsx(Pe.Paperclip,{className:m?"w-3 h-3":"w-4 h-4"})}),h&&c.jsx(ie.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 ${b.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:c.jsx(Pe.Camera,{className:m?"w-3 h-3":"w-4 h-4"})}),c.jsx("input",{ref:u,type:"file",multiple:!0,onChange:v,className:"hidden",accept:"image/*"}),c.jsx("input",{ref:f,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),c.jsx("textarea",{value:i,onChange:j=>a(j.target.value),onKeyDown:C,onFocus:()=>d(!0),onBlur:()=>d(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 ${m?"px-1 py-0.5 text-xs min-h-[20px]":"px-2 py-1 text-sm min-h-[32px]"} bg-transparent resize-none max-h-20 focus:outline-none border-0 ${b.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:m?"20px":"32px"},onInput:j=>{const P=j.target;P.style.height="auto",P.style.height=`${Math.min(P.scrollHeight,m?60:80)}px`}}),c.jsx(ie.button,{type:"submit",disabled:n||!i.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 flex-shrink-0 ${i.trim()&&!n?b.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:c.jsx(Pe.SendHorizontal,{className:m?"w-3 h-3":"w-4 h-4"})}),o&&c.jsx(ie.button,{type:"button",onClick:o,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${m?"p-0.5":"p-1"} rounded-full transition-all duration-200 border-0 flex-shrink-0 ${b.chatInput.endButton}`,"aria-label":"End chat",children:c.jsx(Pe.PhoneOff,{className:m?"w-3 h-3":"w-4 h-4"})})]})})})}function L1({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[o,s]=g.useState(""),[i,a]=g.useState(0);return g.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(i<e.length){const l=setTimeout(()=>{s(e.slice(0,i+1)),a(i+1)},r);return()=>clearTimeout(l)}},[e,i,t,r,n]),g.useEffect(()=>{n||(a(0),s(""))},[e,n]),c.jsxs("span",{className:"relative",children:[c.jsx("span",{className:"inline-block",children:o}),!t&&c.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>c.jsx(ie.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:l*.2,ease:"easeInOut"}},l))})]})}function _1({message:e,theme:t,isOwn:n,isStreaming:r=!1,displayType:o}){var l,d;const s=Ne(t),i=o==="popup",a=e.sender.name?e.sender.name.split(" ").map(u=>u[0]).join("").toUpperCase().slice(0,2):"U";return c.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:c.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[c.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:a}),c.jsxs("div",{className:`
|
|
83
83
|
relative ${i?"px-2 py-1":"px-3 py-2"} rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover
|
|
84
84
|
${n?`${s.chatMessage.own} rounded-br-md`:`${s.chatMessage.other} rounded-bl-md`}
|
|
85
85
|
${r?"shimmer":""}
|
|
86
86
|
transition-all duration-200 group-hover:scale-[1.02]
|
|
87
|
-
`,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[
|
|
87
|
+
`,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[c.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:((l=e.metadata)==null?void 0:l.type)==="attachment"?c.jsx(H1,{message:e,theme:t,isOwn:n}):r&&!n?c.jsx(L1,{text:e.content,isComplete:!r,isRealTimeStream:((d=e.metadata)==null?void 0:d.streaming)===!0,speed:35}):e.content}),c.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function B1(e,t){return e.startsWith("image/")?Pe.Image:e.startsWith("video/")?Pe.Video:e.startsWith("audio/")?Pe.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?Pe.Archive:Pe.FileText}function z1(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 H1({message:e,theme:t,isOwn:n}){const r=Ne(t),o=e.metadata,s=(o==null?void 0:o.fileName)||"Unknown file",i=(o==null?void 0:o.fileSize)||0,a=(o==null?void 0:o.mimeType)||"application/octet-stream",l=o==null?void 0:o.downloading,d=o==null?void 0:o.uploading,u=(o==null?void 0:o.downloadProgress)||0,f=(o==null?void 0:o.uploadProgress)||0,h=o==null?void 0:o.downloadUrl,x=o==null?void 0:o.file,b=B1(a),m=l||d,y=l?u:f,C=l?"Downloading...":d?"Uploading...":"Complete",[v,T]=g.useState(null);g.useEffect(()=>{if(h)T(h);else if(x&&a.startsWith("image/")){const P=URL.createObjectURL(x);return T(P),()=>URL.revokeObjectURL(P)}else T(null)},[h,x,a]);const k=()=>{if(h){const P=document.createElement("a");P.href=h,P.download=s,P.click()}},j=a.startsWith("image/")&&v;return c.jsxs("div",{className:"flex flex-col gap-2 max-w-sm",children:[j&&c.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[c.jsx("img",{src:v,alt:s,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:k}),c.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),c.jsxs("div",{className:`
|
|
88
88
|
flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
|
|
89
89
|
${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
|
|
90
|
-
`,children:[
|
|
90
|
+
`,children:[c.jsx("div",{className:`
|
|
91
91
|
p-2 rounded-lg flex-shrink-0
|
|
92
92
|
${t==="light"?"bg-blue-100 text-blue-600":"bg-blue-900/50 text-blue-400"}
|
|
93
|
-
`,children:
|
|
93
|
+
`,children:c.jsx(b,{className:"w-5 h-5"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:s}),c.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[i>0&&z1(i),m&&c.jsxs(c.Fragment,{children:[i>0&&" • ",C," ",Math.round(y*100),"%"]})]}),m&&c.jsx("div",{className:`
|
|
94
94
|
w-full h-1 rounded-full mt-1 overflow-hidden
|
|
95
95
|
${t==="light"?"bg-gray-200":"bg-gray-700"}
|
|
96
|
-
`,children:
|
|
96
|
+
`,children:c.jsx(ie.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${y*100}%`},transition:{duration:.3}})})]}),h&&!m&&c.jsx(ie.button,{onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
|
|
97
97
|
p-2 rounded-lg transition-colors duration-200
|
|
98
98
|
${t==="light"?"hover:bg-gray-200 text-gray-600 hover:text-gray-800":"hover:bg-gray-600 text-gray-400 hover:text-gray-200"}
|
|
99
|
-
`,"aria-label":"Download file",children:l.jsx(Pe.Download,{className:"w-4 h-4"})})]})]})}function U1(){return l.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:[l.jsx("div",{className:"text-2xl mb-2",children:"✅"}),l.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function Z1(){return l.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:[l.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),l.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function W1({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:o="widget",onEndChat:s}){const[i,a]=g.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const E=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",E.length),E}return[]}),[c,d]=g.useState(!0),[u,f]=g.useState(()=>{const E=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),D=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!E&&!D}),[h,x]=g.useState(new Set),[y,m]=g.useState([]),[b,C]=g.useState(!1),[v,T]=g.useState(!1),[k,S]=g.useState(()=>{const E=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(E==null?void 0:E.methodName)||"none"),E}),j=g.useRef(null),P=g.useRef(null),A=Ne(t);g.useEffect(()=>{const E=()=>{const D=navigator.userAgent.toLowerCase(),$=["android","iphone","ipad","mobile","tablet"].some(R=>D.includes(R)),F="ontouchstart"in window||navigator.maxTouchPoints>0,L=window.innerWidth<=768,J=$||F&&L;C(J),J&&o==="widget"&&T(!0)};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[o]),g.useEffect(()=>(v&&b&&(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&&b&&(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,b]);const _=e.getCurrentAgentInfo(),p=(_==null?void 0:_.name)||"AI Assistant",V=p.split(" ").map(E=>E[0]).join("").toUpperCase().slice(0,2),B=g.useCallback(E=>{const D={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:E,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(O=>(console.log("ChatView: Adding local message:",D.id),[...O,D]))},[]);g.useEffect(()=>{var E,D,O,$,F;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((E=e==null?void 0:e.getCurrentSession)!=null&&E.call(e)),messagesCount:i.length,sessionId:(O=(D=e==null?void 0:e.getCurrentSession)==null?void 0:D.call(e))==null?void 0:O.id,hasStoredMessages:!!((F=($=e==null?void 0:e.getChatMessages)==null?void 0:$.call(e))!=null&&F.length),isMobile:b,isFullscreen:v})},[u,i.length,e,b,v]);const G=g.useCallback((E=!1)=>{const D=P.current;D&&(E?D.scrollTop=D.scrollHeight:D.scrollTo({top:D.scrollHeight,behavior:"smooth"}))},[]);g.useEffect(()=>{G(!0);const E=setTimeout(()=>{G(!1)},10);return()=>clearTimeout(E)},[i.length,G]),g.useEffect(()=>{if(k){G(!0);const E=setTimeout(()=>{G(!1)},50);return()=>clearTimeout(E)}},[k,G]),g.useEffect(()=>{const E=$=>{if(console.log("ChatView: Received message:",$),f(!1),k&&$.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",k.methodName),m(F=>[...F,$]);return}$.sender.type==="agent"&&d(!1),a(F=>{var J;if(F.some(R=>R.id===$.id))return console.log("ChatView: Message already exists, skipping:",$.id),F;if(console.log("ChatView: Adding new message:",$.id),$.sender.type==="agent"&&(x(R=>new Set(R).add($.id)),!((J=$.metadata)!=null&&J.streaming))){const R=$.content.length*35+1e3;setTimeout(()=>{x(ce=>{const xe=new Set(ce);return xe.delete($.id),xe})},R)}return[...F,$]}),setTimeout(()=>G(!0),0)},D=$=>{var F;if(console.log("ChatView: Updated message:",$),k&&$.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",k.methodName),m(L=>{const J=L.findIndex(R=>R.id===$.id);if(J>=0){const R=[...L];return R[J]=$,R}else return[...L,$]});return}a(L=>L.map(J=>J.id===$.id?{...$}:J)),setTimeout(()=>G(!0),0),(F=$.metadata)!=null&&F.streaming||x(L=>{const J=new Set(L);return J.delete($.id),J})},O=$=>{console.log("ChatView: Sent message:",$),f(!1),a(F=>F.some(J=>J.id===$.id)?(console.log("ChatView: Sent message already exists, skipping:",$.id),F):(console.log("ChatView: Adding sent message:",$.id),[...F,$])),setTimeout(()=>G(!0),0)};return e.on("chat.message.received",E),e.on("chat.message.updated",D),e.on("chat.message.sent",O),()=>{e.off("chat.message.received",E),e.off("chat.message.updated",D),e.off("chat.message.sent",O)}},[e,k]),g.useEffect(()=>{const E=F=>{console.log("ChatView: RPC interaction started:",F);const L=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",L==null?void 0:L.methodName),S(L),d(!1),G(!0),setTimeout(()=>{G(!1)},100)},D=F=>{if(console.log("ChatView: RPC interaction completed:",F),S(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages"),a(L=>{const J=[...L];return y.forEach(R=>{var xe;if(!J.some(pe=>pe.id===R.id)&&(console.log("ChatView: Adding queued message:",R.id),J.push(R),R.sender.type==="agent"&&(x(pe=>new Set(pe).add(R.id)),!((xe=R.metadata)!=null&&xe.streaming)))){const pe=R.content.length*35+1e3;setTimeout(()=>{x(Re=>{const tt=new Set(Re);return tt.delete(R.id),tt})},pe)}}),J}),m([]),setTimeout(()=>G(!0),0)),F&&F.response&&F.response.success){let L=null;F.response.successView?L=F.response.successView:F.successView&&(L=F.successView),a(J=>{const R=[...J].reverse().findIndex(Re=>Re.sender.type==="participant");let ce=J.length;R!==-1&&(ce=J.length-R);const xe={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:L||l.jsx(U1,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(xe);const pe=[...J];return pe.splice(ce,0,xe),pe})}},O=async F=>{k&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),S(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after timeout"),a(J=>{const R=[...J];return y.forEach(ce=>{var pe;if(!R.some(Re=>Re.id===ce.id)&&(R.push(ce),ce.sender.type==="agent"&&(x(Re=>new Set(Re).add(ce.id)),!((pe=ce.metadata)!=null&&pe.streaming)))){const Re=ce.content.length*35+1e3;setTimeout(()=>{x(tt=>{const dt=new Set(tt);return dt.delete(ce.id),dt})},Re)}}),R}),m([]),setTimeout(()=>G(!0),0));let L=null;F&&F.response&&F.response.timeoutView?L=F.response.timeoutView:F&&F.timeoutView&&(L=F.timeoutView),a(J=>{const R={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:p,type:"agent"},metadata:{type:"timeoutView",view:L||l.jsx(Z1,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(R),[...J,R]}),setTimeout(()=>{e.getCurrentInteraction()||S(null)},100)},$=async F=>{console.log("ChatView: RPC interaction dismissed:",F),console.log("ChatView: Current interaction before dismiss:",k==null?void 0:k.methodName),S(null),y.length>0&&(console.log("ChatView: Processing",y.length,"queued messages after dismissal"),a(L=>{const J=[...L];return y.forEach(R=>{var xe;if(!J.some(pe=>pe.id===R.id)&&(J.push(R),R.sender.type==="agent"&&(x(pe=>new Set(pe).add(R.id)),!((xe=R.metadata)!=null&&xe.streaming)))){const pe=R.content.length*35+1e3;setTimeout(()=>{x(Re=>{const tt=new Set(Re);return tt.delete(R.id),tt})},pe)}}),J}),m([]),setTimeout(()=>G(!0),0)),setTimeout(()=>{const L=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(L==null?void 0:L.methodName)||"null"),L===null&&S(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",E),e.on("rpc.interaction.completed",D),e.on("rpc.interaction.timeout",O),e.on("rpc.interaction.dismissed",$),()=>{e.off("rpc.interaction.started",E),e.off("rpc.interaction.completed",D),e.off("rpc.interaction.timeout",O),e.off("rpc.interaction.dismissed",$)}},[e]),g.useEffect(()=>{const E=()=>{if(console.log("ChatView: Agent is thinking"),k){console.log("ChatView: Suppressing thinking indicator due to active interaction:",k.methodName);return}d(!0)},D=()=>{console.log("ChatView: Agent is speaking"),d(!1)};return e.on("agent.thinking",E),e.on("agent.speaking",D),()=>{e.off("agent.thinking",E),e.off("agent.speaking",D)}},[e,k]),g.useEffect(()=>{const E=e.getCurrentInteraction();E?(console.log("ChatView: Restoring interaction state on mount/client change:",E.methodName),S(E)):S(null)},[e]),g.useEffect(()=>{console.log("ChatView: Display type changed to:",o,"Current interaction:",(k==null?void 0:k.methodName)||"none")},[o,k]);const te=async E=>{try{k&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),S(null)),await e.sendChatMessage(E)}catch(D){console.error("Failed to send message:",D)}},ne=async E=>{try{k&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),S(null)),await e.sendAttachments(E),console.log("Attachments sent successfully:",E.map(D=>D.name))}catch(D){console.error("Failed to send attachments:",D)}},[oe,X]=g.useState([]);if(g.useEffect(()=>{const E=D=>{X(Array.isArray(D)?D:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",E),()=>{e.off("suggested.response",E)}},[e]),u){const E=v&&b?"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 l.jsxs("div",{className:E,children:[l.jsx("div",{className:`${A.spinner} w-12 h-12 mb-6`}),l.jsxs("p",{className:`text-sm text-center ${v&&b?"text-white":""}`,children:["Connecting to ",p,"..."]})]})}const I=v&&b?"fullscreen":o,q=o==="popup",M=I==="fullscreen"?v&&b?"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 max-h-full overflow-hidden",z=I==="fullscreen"?v&&b?"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-3 pb-4 border-b ${A.chatHeader.container}`:`flex items-center w-full justify-between ${q?"px-3 pt-3 pb-3 text-xs":"px-5 pt-3 pb-5"} border-b ${A.chatHeader.container}`,Q=I==="fullscreen"?v&&b?"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 ${q?"p-2 text-xs":"p-4"} chat-scrollable min-h-0`,W="flex-shrink-0 !w-full",U=()=>{T(!1),n&&n()};return l.jsxs("div",{className:`${M} chat-view`,children:[l.jsx("div",{className:z,children:l.jsxs("div",{className:"flex items-center gap-2",children:[v&&b&&l.jsx(ie.button,{onClick:U,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${q?"p-1 text-sm":"p-2"} rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2`,"aria-label":"Exit fullscreen",children:"✕"}),l.jsxs("div",{children:[l.jsx("h3",{className:`font-semibold ${q?"text-xs":"text-base"} leading-tight ${v&&b?"text-white":A.text.primary}`,children:p}),l.jsxs("p",{className:`${q?"text-[10px]":"text-xs"} flex items-center ${q?"gap-1":"gap-1.5"} mt-0.5 ${v&&b?"text-gray-300":A.text.muted}`,children:[l.jsx("span",{className:`${q?"w-1 h-1":"w-1.5 h-1.5"} bg-green-500 rounded-full animate-pulse`}),"Online"]})]})]})}),l.jsxs("div",{ref:P,className:`${Q} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[l.jsx(ie.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:V}),l.jsxs("p",{className:`text-base mb-2 ${v&&b?"text-white":A.text.secondary}`,children:[p," is joining..."]}),l.jsx("p",{className:`text-xs ${v&&b?"text-gray-300":A.text.muted}`,children:"Your conversation will begin shortly"})]}):l.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:l.jsxs("div",{className:"space-y-3",children:[i.map((E,D)=>{var O,$;return l.jsx("div",{children:((O=E.metadata)==null?void 0:O.type)==="successView"?l.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.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"}),l.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"px-3 py-2"} rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover dark:border-gray-700 ${A.chatMessage.own}`,children:[E.metadata.view,l.jsx("div",{className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:E.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):(($=E.metadata)==null?void 0:$.type)==="timeoutView"?l.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.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:V}),l.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"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 ${A.chatMessage.other}`,children:[E.metadata.view,l.jsx("div",{className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:E.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):l.jsx(_1,{message:E,theme:t,isOwn:E.sender.type==="participant",isStreaming:h.has(E.id),displayType:o})},E.id)}),c&&!k&&l.jsx(ie.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:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.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:V}),l.jsx("div",{className:`relative ${q?"px-2 py-1":"px-3 py-2"} rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${A.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:l.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(E=>l.jsx(ie.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:E*.2,ease:"easeInOut"}},E))})})]})}),k&&k.presentationMode==="embedded"&&l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.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:V}),l.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"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 ${A.chatMessage.other}`,children:[l.jsx(Xt,{interaction:k,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:B},k.methodName),l.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),l.jsx("div",{ref:j})]})})]}),oe.length>0&&l.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:oe.map((E,D)=>{var O;return l.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
|
|
99
|
+
`,"aria-label":"Download file",children:c.jsx(Pe.Download,{className:"w-4 h-4"})})]})]})}function U1(){return c.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:[c.jsx("div",{className:"text-2xl mb-2",children:"✅"}),c.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),c.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function Z1(){return c.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:[c.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),c.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),c.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function W1({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:o="widget",onEndChat:s}){const[i,a]=g.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const E=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",E.length),E}return[]}),[l,d]=g.useState(!0),[u,f]=g.useState(()=>{const E=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),D=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!E&&!D}),[h,x]=g.useState(new Set),[b,m]=g.useState([]),[y,C]=g.useState(!1),[v,T]=g.useState(!1),[k,S]=g.useState(()=>{const E=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(E==null?void 0:E.methodName)||"none"),E}),j=g.useRef(null),P=g.useRef(null),A=Ne(t);g.useEffect(()=>{const E=()=>{const D=navigator.userAgent.toLowerCase(),$=["android","iphone","ipad","mobile","tablet"].some(R=>D.includes(R)),F="ontouchstart"in window||navigator.maxTouchPoints>0,L=window.innerWidth<=768,J=$||F&&L;C(J),J&&o==="widget"&&T(!0)};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[o]),g.useEffect(()=>(v&&y&&(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&&y&&(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,y]);const _=e.getCurrentAgentInfo(),p=(_==null?void 0:_.name)||"AI Assistant",V=p.split(" ").map(E=>E[0]).join("").toUpperCase().slice(0,2),B=g.useCallback(E=>{const D={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:E,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(O=>(console.log("ChatView: Adding local message:",D.id),[...O,D]))},[]);g.useEffect(()=>{var E,D,O,$,F;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((E=e==null?void 0:e.getCurrentSession)!=null&&E.call(e)),messagesCount:i.length,sessionId:(O=(D=e==null?void 0:e.getCurrentSession)==null?void 0:D.call(e))==null?void 0:O.id,hasStoredMessages:!!((F=($=e==null?void 0:e.getChatMessages)==null?void 0:$.call(e))!=null&&F.length),isMobile:y,isFullscreen:v})},[u,i.length,e,y,v]);const G=g.useCallback((E=!1)=>{const D=P.current;D&&(E?D.scrollTop=D.scrollHeight:D.scrollTo({top:D.scrollHeight,behavior:"smooth"}))},[]);g.useEffect(()=>{G(!0);const E=setTimeout(()=>{G(!1)},10);return()=>clearTimeout(E)},[i.length,G]),g.useEffect(()=>{if(k){G(!0);const E=setTimeout(()=>{G(!1)},50);return()=>clearTimeout(E)}},[k,G]),g.useEffect(()=>{const E=$=>{if(console.log("ChatView: Received message:",$),f(!1),k&&$.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",k.methodName),m(F=>[...F,$]);return}$.sender.type==="agent"&&d(!1),a(F=>{var J;if(F.some(R=>R.id===$.id))return console.log("ChatView: Message already exists, skipping:",$.id),F;if(console.log("ChatView: Adding new message:",$.id),$.sender.type==="agent"&&(x(R=>new Set(R).add($.id)),!((J=$.metadata)!=null&&J.streaming))){const R=$.content.length*35+1e3;setTimeout(()=>{x(le=>{const xe=new Set(le);return xe.delete($.id),xe})},R)}return[...F,$]}),setTimeout(()=>G(!0),0)},D=$=>{var F;if(console.log("ChatView: Updated message:",$),k&&$.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",k.methodName),m(L=>{const J=L.findIndex(R=>R.id===$.id);if(J>=0){const R=[...L];return R[J]=$,R}else return[...L,$]});return}a(L=>L.map(J=>J.id===$.id?{...$}:J)),setTimeout(()=>G(!0),0),(F=$.metadata)!=null&&F.streaming||x(L=>{const J=new Set(L);return J.delete($.id),J})},O=$=>{console.log("ChatView: Sent message:",$),f(!1),a(F=>F.some(J=>J.id===$.id)?(console.log("ChatView: Sent message already exists, skipping:",$.id),F):(console.log("ChatView: Adding sent message:",$.id),[...F,$])),setTimeout(()=>G(!0),0)};return e.on("chat.message.received",E),e.on("chat.message.updated",D),e.on("chat.message.sent",O),()=>{e.off("chat.message.received",E),e.off("chat.message.updated",D),e.off("chat.message.sent",O)}},[e,k]),g.useEffect(()=>{const E=F=>{console.log("ChatView: RPC interaction started:",F);const L=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",L==null?void 0:L.methodName),S(L),d(!1),G(!0),setTimeout(()=>{G(!1)},100)},D=F=>{if(console.log("ChatView: RPC interaction completed:",F),S(null),b.length>0&&(console.log("ChatView: Processing",b.length,"queued messages"),a(L=>{const J=[...L];return b.forEach(R=>{var xe;if(!J.some(pe=>pe.id===R.id)&&(console.log("ChatView: Adding queued message:",R.id),J.push(R),R.sender.type==="agent"&&(x(pe=>new Set(pe).add(R.id)),!((xe=R.metadata)!=null&&xe.streaming)))){const pe=R.content.length*35+1e3;setTimeout(()=>{x(Re=>{const tt=new Set(Re);return tt.delete(R.id),tt})},pe)}}),J}),m([]),setTimeout(()=>G(!0),0)),F&&F.response&&F.response.success){let L=null;F.response.successView?L=F.response.successView:F.successView&&(L=F.successView),a(J=>{const R=[...J].reverse().findIndex(Re=>Re.sender.type==="participant");let le=J.length;R!==-1&&(le=J.length-R);const xe={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:L||c.jsx(U1,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(xe);const pe=[...J];return pe.splice(le,0,xe),pe})}},O=async F=>{k&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),S(null),b.length>0&&(console.log("ChatView: Processing",b.length,"queued messages after timeout"),a(J=>{const R=[...J];return b.forEach(le=>{var pe;if(!R.some(Re=>Re.id===le.id)&&(R.push(le),le.sender.type==="agent"&&(x(Re=>new Set(Re).add(le.id)),!((pe=le.metadata)!=null&&pe.streaming)))){const Re=le.content.length*35+1e3;setTimeout(()=>{x(tt=>{const dt=new Set(tt);return dt.delete(le.id),dt})},Re)}}),R}),m([]),setTimeout(()=>G(!0),0));let L=null;F&&F.response&&F.response.timeoutView?L=F.response.timeoutView:F&&F.timeoutView&&(L=F.timeoutView),a(J=>{const R={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:p,type:"agent"},metadata:{type:"timeoutView",view:L||c.jsx(Z1,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(R),[...J,R]}),setTimeout(()=>{e.getCurrentInteraction()||S(null)},100)},$=async F=>{console.log("ChatView: RPC interaction dismissed:",F),console.log("ChatView: Current interaction before dismiss:",k==null?void 0:k.methodName),S(null),b.length>0&&(console.log("ChatView: Processing",b.length,"queued messages after dismissal"),a(L=>{const J=[...L];return b.forEach(R=>{var xe;if(!J.some(pe=>pe.id===R.id)&&(J.push(R),R.sender.type==="agent"&&(x(pe=>new Set(pe).add(R.id)),!((xe=R.metadata)!=null&&xe.streaming)))){const pe=R.content.length*35+1e3;setTimeout(()=>{x(Re=>{const tt=new Set(Re);return tt.delete(R.id),tt})},pe)}}),J}),m([]),setTimeout(()=>G(!0),0)),setTimeout(()=>{const L=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(L==null?void 0:L.methodName)||"null"),L===null&&S(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",E),e.on("rpc.interaction.completed",D),e.on("rpc.interaction.timeout",O),e.on("rpc.interaction.dismissed",$),()=>{e.off("rpc.interaction.started",E),e.off("rpc.interaction.completed",D),e.off("rpc.interaction.timeout",O),e.off("rpc.interaction.dismissed",$)}},[e]),g.useEffect(()=>{const E=()=>{if(console.log("ChatView: Agent is thinking"),k){console.log("ChatView: Suppressing thinking indicator due to active interaction:",k.methodName);return}d(!0)},D=()=>{console.log("ChatView: Agent is speaking"),d(!1)};return e.on("agent.thinking",E),e.on("agent.speaking",D),()=>{e.off("agent.thinking",E),e.off("agent.speaking",D)}},[e,k]),g.useEffect(()=>{const E=e.getCurrentInteraction();E?(console.log("ChatView: Restoring interaction state on mount/client change:",E.methodName),S(E)):S(null)},[e]),g.useEffect(()=>{console.log("ChatView: Display type changed to:",o,"Current interaction:",(k==null?void 0:k.methodName)||"none")},[o,k]);const te=async E=>{try{k&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),S(null)),await e.sendChatMessage(E)}catch(D){console.error("Failed to send message:",D)}},ne=async E=>{try{k&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),S(null)),await e.sendAttachments(E),console.log("Attachments sent successfully:",E.map(D=>D.name))}catch(D){console.error("Failed to send attachments:",D)}},[oe,X]=g.useState([]);if(g.useEffect(()=>{const E=D=>{X(Array.isArray(D)?D:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",E),()=>{e.off("suggested.response",E)}},[e]),u){const E=v&&y?"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 c.jsxs("div",{className:E,children:[c.jsx("div",{className:`${A.spinner} w-12 h-12 mb-6`}),c.jsxs("p",{className:`text-sm text-center ${v&&y?"text-white":""}`,children:["Connecting to ",p,"..."]})]})}const I=v&&y?"fullscreen":o,q=o==="popup",M=I==="fullscreen"?v&&y?"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 max-h-full overflow-hidden",z=I==="fullscreen"?v&&y?"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-3 pb-4 border-b ${A.chatHeader.container}`:`flex items-center w-full justify-between ${q?"px-3 pt-3 pb-3 text-xs":"px-5 pt-3 pb-5"} border-b ${A.chatHeader.container}`,Q=I==="fullscreen"?v&&y?"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 ${q?"p-2 text-xs":"p-4"} chat-scrollable min-h-0`,W="flex-shrink-0 !w-full",U=()=>{T(!1),n&&n()};return c.jsxs("div",{className:`${M} chat-view`,children:[c.jsx("div",{className:z,children:c.jsxs("div",{className:"flex items-center gap-2",children:[v&&y&&c.jsx(ie.button,{onClick:U,whileHover:{scale:1.05},whileTap:{scale:.95},className:`${q?"p-1 text-sm":"p-2"} rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2`,"aria-label":"Exit fullscreen",children:"✕"}),c.jsxs("div",{children:[c.jsx("h3",{className:`font-semibold ${q?"text-xs":"text-base"} leading-tight ${v&&y?"text-white":A.text.primary}`,children:p}),c.jsxs("p",{className:`${q?"text-[10px]":"text-xs"} flex items-center ${q?"gap-1":"gap-1.5"} mt-0.5 ${v&&y?"text-gray-300":A.text.muted}`,children:[c.jsx("span",{className:`${q?"w-1 h-1":"w-1.5 h-1.5"} bg-green-500 rounded-full animate-pulse`}),"Online"]})]})]})}),c.jsxs("div",{ref:P,className:`${Q} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[c.jsx(ie.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:V}),c.jsxs("p",{className:`text-base mb-2 ${v&&y?"text-white":A.text.secondary}`,children:[p," is joining..."]}),c.jsx("p",{className:`text-xs ${v&&y?"text-gray-300":A.text.muted}`,children:"Your conversation will begin shortly"})]}):c.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:c.jsxs("div",{className:"space-y-3",children:[i.map((E,D)=>{var O,$;return c.jsx("div",{children:((O=E.metadata)==null?void 0:O.type)==="successView"?c.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:c.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[c.jsx(ie.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"}),c.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"px-3 py-2"} rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover dark:border-gray-700 ${A.chatMessage.own}`,children:[E.metadata.view,c.jsx("div",{className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:E.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):(($=E.metadata)==null?void 0:$.type)==="timeoutView"?c.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:c.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[c.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:V}),c.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"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 ${A.chatMessage.other}`,children:[E.metadata.view,c.jsx("div",{className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:E.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):c.jsx(_1,{message:E,theme:t,isOwn:E.sender.type==="participant",isStreaming:h.has(E.id),displayType:o})},E.id)}),l&&!k&&c.jsx(ie.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:c.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[c.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:V}),c.jsx("div",{className:`relative ${q?"px-2 py-1":"px-3 py-2"} rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${A.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:c.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(E=>c.jsx(ie.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:E*.2,ease:"easeInOut"}},E))})})]})}),k&&k.presentationMode==="embedded"&&c.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[c.jsx(ie.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:V}),c.jsxs("div",{className:`flex h-full flex-col justify-between border ${q?"px-2 py-1":"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 ${A.chatMessage.other}`,children:[c.jsx(Xt,{interaction:k,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:B},k.methodName),c.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${A.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),c.jsx("div",{ref:j})]})})]}),oe.length>0&&c.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:oe.map((E,D)=>{var O;return c.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
|
|
100
100
|
${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":((O=A.suggestedResponse)==null?void 0:O.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
|
|
101
|
-
`,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{te(E),X([])},children:E},E+D)})}),k&&k.presentationMode!=="embedded"&&
|
|
101
|
+
`,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{te(E),X([])},children:E},E+D)})}),k&&k.presentationMode!=="embedded"&&c.jsx(Xt,{interaction:k,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:B},k.methodName),c.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:W,children:c.jsx(O1,{onSendMessage:te,onSendAttachments:ne,disabled:r,theme:t,onEndChat:s,displayType:o})})]})}function G1({onToggleCamera:e,onToggleScreenShare:t,onEndCall:n,onBack:r,theme:o,cameraEnabled:s,screenShareEnabled:i,isCameraLoading:a,isScreenShareLoading:l,disabled:d,displayType:u}){const f=Ne(o),h=u==="popup";return c.jsxs("div",{className:`flex items-center justify-center ${h?"gap-1 p-2":"gap-3 p-4"} ${f.video.controlsBackground}`,children:[c.jsx("button",{onClick:e,disabled:d||a,className:`${h?"p-1.5":"p-3"} rounded-full transition-all duration-200 ${s?f.video.controlEnabled:f.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:s?"Turn off camera":"Turn on camera",children:s?c.jsx(Pe.Camera,{className:h?"w-4 h-4":"w-5 h-5"}):c.jsx(Pe.CameraOff,{className:h?"w-4 h-4":"w-5 h-5"})}),c.jsx("button",{onClick:t,disabled:d||l,className:`${h?"p-1.5":"p-3"} rounded-full transition-all duration-200 ${i?f.video.controlEnabled:f.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Stop screen share":"Share screen",children:l?c.jsx("div",{className:`${h?"w-4 h-4":"w-5 h-5"} animate-spin rounded-full border-2 border-current border-t-transparent`}):i?c.jsx(Pe.MonitorOff,{className:h?"w-4 h-4":"w-5 h-5"}):c.jsx(Pe.Monitor,{className:h?"w-4 h-4":"w-5 h-5"})}),n&&c.jsx("button",{onClick:n,disabled:d,className:`${h?"p-1.5":"p-3"} rounded-full transition-all duration-200 ${f.video.endCall} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:c.jsx(Pe.PhoneOff,{className:h?"w-4 h-4":"w-5 h-5"})}),r&&c.jsx("button",{onClick:r,disabled:d,className:`p-3 rounded-full transition-all duration-200 ${f.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"Back",children:c.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})})]})}function Za({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:o}){var l;const s=Ne(o),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 c.jsxs("div",{className:`relative rounded-lg overflow-hidden ${s.video.tile} ${r}`,children:[a?c.jsx(Ie.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):c.jsx("div",{className:`w-full h-full flex items-center justify-center ${s.video.placeholder}`,children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${s.video.avatar}`,children:c.jsx(Pe.User,{className:"w-8 h-8"})}),c.jsx("p",{className:"text-sm opacity-80",children:i}),c.jsx("p",{className:"text-xs opacity-60",children:"Camera off"})]})}),c.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${s.video.nameOverlay}`,children:i}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&c.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${s.video.mutedIndicator}`,children:c.jsx(Pe.CameraOff,{className:"w-4 h-4"})})]})}function K1({trackRefs:e,participants:t,theme:n,localParticipant:r}){const o=e.find(u=>u.source===H.Track.Source.Camera&&u.participant===r),s=e.filter(u=>u.participant!==r),i=e.length,a=i<=1?1:i<=4?2:3,l="grid gap-2 h-full",d={gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoRows:"minmax(0, 1fr)"};return c.jsxs("div",{className:l,style:d,children:[o&&r&&c.jsx(Za,{trackRef:o,participant:r,isLocal:!0,theme:n,className:"min-h-0"}),s.map((u,f)=>{var h;return c.jsx(Za,{trackRef:u,participant:u.participant,isLocal:!1,theme:n,className:"min-h-0"},((h=u.publication)==null?void 0:h.trackSid)||f)}),i===0&&c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Pe.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),c.jsx("p",{className:"text-lg opacity-70",children:"Waiting for participants..."}),c.jsx("p",{className:"text-sm opacity-50",children:"Turn on your camera to start the video call"})]})})]})}function Y1({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:o,onEndCall:s}){const i=Ne(t),a=Wc(e),{videoTrackRefs:l}=M0(e),d=g.useMemo(()=>e.getRemoteParticipants(),[e,a]),u=bn(e,"camera"),f=bn(e,"screenShare"),[h,x]=g.useState(null),b=g.useCallback(async()=>{u.pending||await u.toggle()},[u]),m=g.useCallback(async()=>{f.pending||await f.toggle()},[f]),y=g.useCallback(()=>{s?s():n&&n()},[s,n]);return g.useEffect(()=>{if(!e)return;const C=v=>{console.log("📺 Video: Interactive UI state updated:",v),x(v)};return e.on("interactive.ui.update",C),e.on("interactive.ui.show",C),()=>{e.off("interactive.ui.update",C),e.off("interactive.ui.show",C)}},[e]),c.jsxs("div",{className:`flex flex-col h-full ${i.video.container}`,children:[c.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${i.video.header}`,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:`w-3 h-3 rounded-full ${i.video.statusDot}`}),c.jsx("span",{className:"font-medium",children:"Video Call"}),c.jsxs("span",{className:"text-sm opacity-70",children:[d.length+1," participant",d.length!==0?"s":""]})]}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("button",{className:`p-2 rounded-lg transition-colors ${i.video.headerButton}`,title:"Layout options",children:c.jsx(Pe.LayoutGrid,{className:"w-4 h-4"})})})]}),c.jsx("div",{className:"flex-1 p-4 min-h-0",children:c.jsx(K1,{trackRefs:l,participants:d,localParticipant:a==null?void 0:a.localParticipant,theme:t})}),h&&c.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute inset-4 z-10",children:c.jsx(Xt,{interaction:h,onDismiss:()=>x(null),theme:t})}),c.jsx(G1,{onToggleCamera:b,onToggleScreenShare:m,onEndCall:y,onBack:n,theme:t,cameraEnabled:u.enabled,screenShareEnabled:f.enabled,isCameraLoading:u.pending,isScreenShareLoading:f.pending,disabled:r,displayType:o})]})}function Gn({onClick:e,disabled:t,theme:n,displayType:r}){var l;const o=Ne(n),s=r==="popup",i=s?(l=o.popup)==null?void 0:l.buttonSizes.large:"w-20 h-20",a=s?"w-5 h-5":"w-6 h-6";return c.jsx("button",{className:`${o.micButton.replace("w-20 h-20",i||"w-20 h-20")} ${n==="vox"||n==="dark"?"text-white":""}`,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:c.jsx(fd,{className:`${a} ${n==="vox"||n==="dark"?"text-white":"text-current"}`})})}function oo({onClick:e,disabled:t,theme:n,displayType:r}){var l;const o=Ne(n),s=r==="popup",i=s?(l=o.popup)==null?void 0:l.buttonSizes.large:"w-20 h-20",a=s?"w-5 h-5":"w-6 h-6";return c.jsx("button",{className:`${o.chatButton.replace("w-20 h-20",i||"w-20 h-20")} ${n==="vox"||n==="dark"?"text-white":""}`,onClick:e,disabled:t,children:c.jsx(ud,{className:`${a} ${n==="vox"||n==="dark"?"text-white":"text-current"}`})})}function so({onClick:e,disabled:t,theme:n,displayType:r}){var l;const o=Ne(n),s=r==="popup",i=s?(l=o.popup)==null?void 0:l.buttonSizes.large:"w-20 h-20",a=s?"w-5 h-5":"w-6 h-6";return c.jsx("button",{className:`${o.videoButton.replace("w-20 h-20",i||"w-20 h-20")} ${n==="vox"||n==="dark"?"text-white":""}`,onClick:e,disabled:t,children:c.jsx(hd,{className:`${a} ${n==="vox"||n==="dark"?"text-white":"text-current"}`})})}function q1({prompts:e,theme:t,displayType:n}){const r=Ne(t),[o,s]=w.useState(0),i=n==="popup";return w.useEffect(()=>{const a=setInterval(()=>{s(l=>(l+1)%e.length)},3e3);return()=>clearInterval(a)},[e.length]),c.jsx("div",{className:`${i?"w-64 min-h-[2rem] h-8":"w-96 min-h-[3rem] h-12"} relative overflow-hidden flex items-center justify-center`,children:e.map((a,l)=>c.jsx("div",{className:`
|
|
102
102
|
${r.promptSlider} ${i?"py-1 px-1 text-xs":""}
|
|
103
|
-
${
|
|
103
|
+
${l===o?"opacity-100":"opacity-0"}
|
|
104
104
|
whitespace-pre-line break-words
|
|
105
|
-
`,style:{minHeight:i?"1.5rem":"2.5rem",display:c===o?"block":"none"},children:a},c))})}function X1({statusMessage:e,theme:t,displayType:n}){const r=Ne(t),o=n==="popup";return l.jsxs("div",{className:`z-10 flex items-center space-x-2 ${o?"mt-1 pb-1":"mt-2 pb-2"}`,children:[l.jsx("div",{className:r.statusIndicator}),l.jsx("span",{className:`text-xs ${r.text.muted}`,children:e})]})}const J1=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:o=['"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:s="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:d=["voice","chat","video"],displayType:u="widget"})=>{var P,A;const f=Ne(c),h=u==="popup",x=d.includes("voice"),y=d.includes("chat"),m=d.includes("video"),b=[x,y,m].filter(Boolean).length,C=h?"p-2":"p-8",v=h?((P=f.popup)==null?void 0:P.textSizes.title)||"text-lg":"text-xl",T=h?((A=f.popup)==null?void 0:A.textSizes.body)||"text-xs":"text-sm",k=h?"gap-1":"gap-4",S=h?"mb-2":"mb-8",j=h?60:120;return console.log("🎯 Welcome component debug:",{modalities:d,hasVoice:x,hasChat:y,hasVideo:m,totalButtons:b,onStartVideo:!!r,displayType:u,isPopup:h}),l.jsxs("div",{className:`flex ${C} flex-col items-center h-full justify-center w-full`,"aria-disabled":e,children:[l.jsxs("div",{className:`mt-1 relative flex items-center justify-center ${S} w-full`,style:{minHeight:`${j}px`},children:[l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[l.jsx("div",{className:h?"w-8 h-8 rounded-full border border-[#3B82F6]/40 pulse-ring":f.pulseRings.ring1}),l.jsx("div",{className:h?"absolute w-6 h-6 rounded-full border border-[#8B5CF6]/30 pulse-ring":f.pulseRings.ring2,style:{animationDelay:"0.5s"}}),l.jsx("div",{className:h?"absolute w-4 h-4 rounded-full border border-[#EC4899]/20 pulse-ring":f.pulseRings.ring3,style:{animationDelay:"1s"}})]}),l.jsx("div",{className:"relative z-10 flex items-center justify-center",children:x&&y&&m?l.jsxs("div",{className:`flex ${k} items-center justify-center`,children:[l.jsx(Gn,{onClick:t,disabled:e,theme:c,displayType:u}),l.jsx(oo,{onClick:n,disabled:e,theme:c,displayType:u}),l.jsx(so,{onClick:r||t,disabled:e,theme:c,displayType:u})]}):b>1?l.jsxs("div",{className:`flex ${h?"gap-3":"gap-6"} items-center justify-center`,children:[x&&l.jsx(Gn,{onClick:t,disabled:e,theme:c,displayType:u}),y&&l.jsx(oo,{onClick:n,disabled:e,theme:c,displayType:u}),m&&r&&l.jsx(so,{onClick:r,disabled:e,theme:c,displayType:u})]}):l.jsx("div",{className:"flex items-center justify-center",children:x?l.jsx(Gn,{onClick:t,disabled:e,theme:c,displayType:u}):y?l.jsx(oo,{onClick:n,disabled:e,theme:c,displayType:u}):m&&r?l.jsx(so,{onClick:r,disabled:e,theme:c,displayType:u}):l.jsx(Gn,{onClick:t,disabled:e,theme:c,displayType:u})})})]}),l.jsxs("div",{className:`text-center flex flex-col items-center ${h?"gap-y-1 mb-3":"gap-y-2 mb-6"} w-full`,children:[l.jsx("h3",{className:`${v} font-semibold ${h?"mb-0.5":"mb-2"} ${f.text.accent}`,children:i}),l.jsx("p",{className:`${T} leading-relaxed ${h?"px-1":"px-4"} ${f.text.secondary}`,children:a}),b>1&&l.jsxs("div",{className:`flex ${h?"gap-1 mt-1 text-xs":"gap-6 mt-4 text-xs"} justify-center`,children:[x&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(fd,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${c==="vox"||c==="dark"?"text-white":"text-current"}`}),l.jsx("span",{className:f.text.muted,children:"Voice"})]}),y&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(ud,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${c==="vox"||c==="dark"?"text-white":"text-current"}`}),l.jsx("span",{className:f.text.muted,children:"Chat"})]}),m&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(hd,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${c==="vox"||c==="dark"?"text-white":"text-current"}`}),l.jsx("span",{className:f.text.muted,children:"Video"})]})]})]}),l.jsx(q1,{prompts:o,theme:c,displayType:u}),l.jsx(X1,{statusMessage:s,theme:c,displayType:u})]})};function md({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:o=!0,voxketSessionId:s}={}){const[i,a]=g.useState(null),[c,d]=g.useState([]),[u,f]=g.useState(null),[h,x]=g.useState([]),y=g.useCallback((v,T)=>{const k={timestamp:new Date,event:v,data:T,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(d(S=>[...S,k]),o){const S=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");S.push(k),localStorage.setItem("voxket-session-logs",JSON.stringify(S))}return k},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,r,o]);g.useEffect(()=>{if(!e)return;const v=()=>{const p=s||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,V=new Date,B={sessionId:p,startTime:V,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(B),y("SESSION_STARTED",{sessionId:p,startTime:V}),n==null||n(p)},T=()=>{if(i){const p=new Date,V=p.getTime()-i.startTime.getTime(),B={...i,endTime:p,duration:V,events:c};y("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(V/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(B),a(null),d([])}},k=p=>{y("CONNECTION_STATE_CHANGED",{state:p}),p===H.ConnectionState.Reconnecting&&i&&(a(V=>V?{...V,connectionIssues:V.connectionIssues+1}:null),y("CONNECTION_ISSUE",{type:"reconnecting"}))},S=p=>{y("TRACK_PUBLISHED",{trackKind:p.kind,trackSource:p.source})},j=p=>{y("TRACK_UNPUBLISHED",{trackKind:p.kind,trackSource:p.source})},P=(p,V)=>{i&&a(B=>B?{...B,totalMessages:B.totalMessages+1}:null),y("DATA_RECEIVED",{participantId:V==null?void 0:V.identity,dataSize:p.length})},A=p=>{y("PARTICIPANT_CONNECTED",{participantId:p.identity,participantName:p.name}),x(V=>[...V,p]),i&&a(V=>V?{...V,participantCount:V.participantCount+1}:null)},_=p=>{y("PARTICIPANT_DISCONNECTED",{participantId:p.identity,participantName:p.name}),x(V=>V.filter(B=>B.identity!==p.identity))};return e.localParticipant&&f(e.localParticipant),e.on(H.RoomEvent.Connected,v),e.on(H.RoomEvent.Disconnected,T),e.on(H.RoomEvent.ConnectionStateChanged,k),e.on(H.RoomEvent.TrackPublished,S),e.on(H.RoomEvent.TrackUnpublished,j),e.on(H.RoomEvent.DataReceived,P),e.on(H.RoomEvent.ParticipantConnected,A),e.on(H.RoomEvent.ParticipantDisconnected,_),()=>{e.off(H.RoomEvent.Connected,v),e.off(H.RoomEvent.Disconnected,T),e.off(H.RoomEvent.ConnectionStateChanged,k),e.off(H.RoomEvent.TrackPublished,S),e.off(H.RoomEvent.TrackUnpublished,j),e.off(H.RoomEvent.DataReceived,P),e.off(H.RoomEvent.ParticipantConnected,A),e.off(H.RoomEvent.ParticipantDisconnected,_)}},[e,i,c,h.length,y,t,n]);const m=g.useCallback(()=>o?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):c,[c,o]),b=g.useCallback(()=>{o&&localStorage.removeItem("voxket-session-logs"),d([])},[o]),C=g.useCallback(()=>{const v=m(),T=JSON.stringify(v,null,2),k="data:application/json;charset=utf-8,"+encodeURIComponent(T),S=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,j=document.createElement("a");j.setAttribute("href",k),j.setAttribute("download",S),j.click()},[m]);return{sessionMetrics:i,sessionLogs:c,logEvent:y,getSessionLogs:m,clearSessionLogs:b,exportSessionLogs:C}}class Vs{constructor(){ke(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=(...o)=>{this.off(t,r),n(...o)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const o=r.indexOf(n);o>-1&&r.splice(o,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const o=[...r];for(const s of o)try{s(...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 gd{constructor(t){ke(this,"plugins",new Map);ke(this,"installedPlugins",new Set);ke(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 s of r.dependencies)this.installedPlugins.has(s)||await this.install(s);const o={...this.context,config:{...r.config,...n}};r.install&&await r.install(o),this.installedPlugins.add(t),this.setupPluginEvents(r,o)}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[o,s]of this.plugins)if(this.installedPlugins.has(o)&&((r=s.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${o}' 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 Q1(e){return e}function Ns(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 ey={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)})}},ty={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))}},ny={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})})}},pd=w.createContext(null);function xd({config:e,children:t,autoConnect:n=!1}){const[r,o]=w.useState(null),[s,i]=w.useState(!1),[a,c]=w.useState(!1),[d,u]=w.useState(null),[f,h]=w.useState(null),[x,y]=w.useState("idle"),[m,b]=w.useState(null),[C,v]=w.useState([]),[T,k]=w.useState([]),[S,j]=w.useState([]);w.useEffect(()=>{const I=new Rn(e);return o(I),P(I),n&&A(I),()=>{I.disconnect().catch(console.error)}},[e,n]);const P=I=>{I.on("connection.connecting",()=>{c(!0),u(null)}),I.on("connection.connected",()=>{i(!0),c(!1),u(null)}),I.on("connection.disconnected",()=>{i(!1),c(!1),h(null),y("idle"),v([]),k([]),j([])}),I.on("connection.error",q=>{u(q),c(!1)}),I.on("session.created",q=>{h(q),y(q.state)}),I.on("session.state.changed",q=>{y(q),f&&h({...f,state:q})}),I.on("session.ended",(q,M)=>{h(null),y("idle"),b(M),v([]),k([]),j([])}),I.on("participant.joined",q=>{v(M=>[...M,q])}),I.on("participant.left",q=>{v(M=>M.filter(z=>z.id!==q.id))}),I.on("chat.message.received",q=>{k(M=>[...M,q])}),I.on("chat.message.sent",q=>{k(M=>[...M,q])}),I.on("transcription.received",q=>{j(M=>[...M,q])})},A=async I=>{const q=I||r;if(q)try{await q.connect()}catch(M){console.error("Failed to connect:",M)}},X={client:r,isConnected:s,isConnecting:a,connectionError:d,currentSession:f,sessionState:x,sessionMetrics:m,participants:C,chatMessages:T,transcriptions:S,connect:()=>A(),disconnect:async()=>{if(r)try{await r.disconnect()}catch(I){console.error("Failed to disconnect:",I)}},createSession:async(I,q={})=>{if(!r)throw new Error("Client not initialized");const M={agentId:I,participantName:q.participantName||"User",metadata:q.metadata,modalities:q.modalities||["voice"]};return await r.createSession(M)},endSession:async()=>r?await r.endSession():null,sendChatMessage:async I=>{if(!r)throw new Error("Client not initialized");await r.sendChatMessage(I)},setMicrophoneEnabled:async I=>{if(!r)throw new Error("Client not initialized");await r.setMicrophoneEnabled(I)},setCameraEnabled:async I=>{if(!r)throw new Error("Client not initialized");await r.setCameraEnabled(I)},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 l.jsx(pd.Provider,{value:X,children:t})}function et(){const e=w.useContext(pd);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class ry extends Vs{constructor(n){super();ke(this,"room",null);ke(this,"registeredMethods",new Map);ke(this,"activeInteractions",new Map);ke(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,o="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 s={methodName:n,component:r,presentationMode:o};this.registeredMethods.set(n,s);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}':`,s);let c=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const d=await this.awaitUserInteraction(n,r,o,a,c);return JSON.stringify(d)}catch(d){throw console.error(`RpcManager: Error in RPC method '${n}':`,d),d}}),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,o,s,i){return new Promise((a,c)=>{const d=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(h,x)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(d),this.currentInteraction=null;const y={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...x?{successView:x}:{}};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(d);const x={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:x}),a(x)},dismissView:()=>{var x;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(x=this.currentInteraction)==null?void 0:x.methodName),this.clearInteraction(d),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(d),this.currentInteraction=null;const x={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:x}),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(x)}},f=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(d,{resolve:h=>a(JSON.parse(h)),reject:c,timeoutId:f}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:o,timeout:i,data:s,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:o}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,s)}catch(x){console.error("RpcManager: Error loading data into component:",x),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")}}let Wa=!1;function yd(){if(Wa||typeof document>"u")return;const e=`
|
|
105
|
+
`,style:{minHeight:i?"1.5rem":"2.5rem",display:l===o?"block":"none"},children:a},l))})}function X1({statusMessage:e,theme:t,displayType:n}){const r=Ne(t),o=n==="popup";return c.jsxs("div",{className:`z-10 flex items-center space-x-2 ${o?"mt-1 pb-1":"mt-2 pb-2"}`,children:[c.jsx("div",{className:r.statusIndicator}),c.jsx("span",{className:`text-xs ${r.text.muted}`,children:e})]})}const J1=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:o=['"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:s="Agent is ready",title:i="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:l="vox",modalities:d=["voice","chat","video"],displayType:u="widget"})=>{var P,A;const f=Ne(l),h=u==="popup",x=d.includes("voice"),b=d.includes("chat"),m=d.includes("video"),y=[x,b,m].filter(Boolean).length,C=h?"p-2":"p-8",v=h?((P=f.popup)==null?void 0:P.textSizes.title)||"text-lg":"text-xl",T=h?((A=f.popup)==null?void 0:A.textSizes.body)||"text-xs":"text-sm",k=h?"gap-1":"gap-4",S=h?"mb-2":"mb-8",j=h?60:120;return console.log("🎯 Welcome component debug:",{modalities:d,hasVoice:x,hasChat:b,hasVideo:m,totalButtons:y,onStartVideo:!!r,displayType:u,isPopup:h}),c.jsxs("div",{className:`flex ${C} flex-col items-center h-full justify-center w-full`,"aria-disabled":e,children:[c.jsxs("div",{className:`mt-1 relative flex items-center justify-center ${S} w-full`,style:{minHeight:`${j}px`},children:[c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[c.jsx("div",{className:h?"w-8 h-8 rounded-full border border-[#3B82F6]/40 pulse-ring":f.pulseRings.ring1}),c.jsx("div",{className:h?"absolute w-6 h-6 rounded-full border border-[#8B5CF6]/30 pulse-ring":f.pulseRings.ring2,style:{animationDelay:"0.5s"}}),c.jsx("div",{className:h?"absolute w-4 h-4 rounded-full border border-[#EC4899]/20 pulse-ring":f.pulseRings.ring3,style:{animationDelay:"1s"}})]}),c.jsx("div",{className:"relative z-10 flex items-center justify-center",children:x&&b&&m?c.jsxs("div",{className:`flex ${k} items-center justify-center`,children:[c.jsx(Gn,{onClick:t,disabled:e,theme:l,displayType:u}),c.jsx(oo,{onClick:n,disabled:e,theme:l,displayType:u}),c.jsx(so,{onClick:r||t,disabled:e,theme:l,displayType:u})]}):y>1?c.jsxs("div",{className:`flex ${h?"gap-3":"gap-6"} items-center justify-center`,children:[x&&c.jsx(Gn,{onClick:t,disabled:e,theme:l,displayType:u}),b&&c.jsx(oo,{onClick:n,disabled:e,theme:l,displayType:u}),m&&r&&c.jsx(so,{onClick:r,disabled:e,theme:l,displayType:u})]}):c.jsx("div",{className:"flex items-center justify-center",children:x?c.jsx(Gn,{onClick:t,disabled:e,theme:l,displayType:u}):b?c.jsx(oo,{onClick:n,disabled:e,theme:l,displayType:u}):m&&r?c.jsx(so,{onClick:r,disabled:e,theme:l,displayType:u}):c.jsx(Gn,{onClick:t,disabled:e,theme:l,displayType:u})})})]}),c.jsxs("div",{className:`text-center flex flex-col items-center ${h?"gap-y-1 mb-3":"gap-y-2 mb-6"} w-full`,children:[c.jsx("h3",{className:`${v} font-semibold ${h?"mb-0.5":"mb-2"} ${f.text.accent}`,children:i}),c.jsx("p",{className:`${T} leading-relaxed ${h?"px-1":"px-4"} ${f.text.secondary}`,children:a}),y>1&&c.jsxs("div",{className:`flex ${h?"gap-1 mt-1 text-xs":"gap-6 mt-4 text-xs"} justify-center`,children:[x&&c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx(fd,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${l==="vox"||l==="dark"?"text-white":"text-current"}`}),c.jsx("span",{className:f.text.muted,children:"Voice"})]}),b&&c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx(ud,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${l==="vox"||l==="dark"?"text-white":"text-current"}`}),c.jsx("span",{className:f.text.muted,children:"Chat"})]}),m&&c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx(hd,{className:`${h?"w-2.5 h-2.5":"w-4 h-4"} ${l==="vox"||l==="dark"?"text-white":"text-current"}`}),c.jsx("span",{className:f.text.muted,children:"Video"})]})]})]}),c.jsx(q1,{prompts:o,theme:l,displayType:u}),c.jsx(X1,{statusMessage:s,theme:l,displayType:u})]})};function md({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:o=!0,voxketSessionId:s}={}){const[i,a]=g.useState(null),[l,d]=g.useState([]),[u,f]=g.useState(null),[h,x]=g.useState([]),b=g.useCallback((v,T)=>{const k={timestamp:new Date,event:v,data:T,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(d(S=>[...S,k]),o){const S=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");S.push(k),localStorage.setItem("voxket-session-logs",JSON.stringify(S))}return k},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,r,o]);g.useEffect(()=>{if(!e)return;const v=()=>{const p=s||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,V=new Date,B={sessionId:p,startTime:V,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(B),b("SESSION_STARTED",{sessionId:p,startTime:V}),n==null||n(p)},T=()=>{if(i){const p=new Date,V=p.getTime()-i.startTime.getTime(),B={...i,endTime:p,duration:V,events:l};b("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(V/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(B),a(null),d([])}},k=p=>{b("CONNECTION_STATE_CHANGED",{state:p}),p===H.ConnectionState.Reconnecting&&i&&(a(V=>V?{...V,connectionIssues:V.connectionIssues+1}:null),b("CONNECTION_ISSUE",{type:"reconnecting"}))},S=p=>{b("TRACK_PUBLISHED",{trackKind:p.kind,trackSource:p.source})},j=p=>{b("TRACK_UNPUBLISHED",{trackKind:p.kind,trackSource:p.source})},P=(p,V)=>{i&&a(B=>B?{...B,totalMessages:B.totalMessages+1}:null),b("DATA_RECEIVED",{participantId:V==null?void 0:V.identity,dataSize:p.length})},A=p=>{b("PARTICIPANT_CONNECTED",{participantId:p.identity,participantName:p.name}),x(V=>[...V,p]),i&&a(V=>V?{...V,participantCount:V.participantCount+1}:null)},_=p=>{b("PARTICIPANT_DISCONNECTED",{participantId:p.identity,participantName:p.name}),x(V=>V.filter(B=>B.identity!==p.identity))};return e.localParticipant&&f(e.localParticipant),e.on(H.RoomEvent.Connected,v),e.on(H.RoomEvent.Disconnected,T),e.on(H.RoomEvent.ConnectionStateChanged,k),e.on(H.RoomEvent.TrackPublished,S),e.on(H.RoomEvent.TrackUnpublished,j),e.on(H.RoomEvent.DataReceived,P),e.on(H.RoomEvent.ParticipantConnected,A),e.on(H.RoomEvent.ParticipantDisconnected,_),()=>{e.off(H.RoomEvent.Connected,v),e.off(H.RoomEvent.Disconnected,T),e.off(H.RoomEvent.ConnectionStateChanged,k),e.off(H.RoomEvent.TrackPublished,S),e.off(H.RoomEvent.TrackUnpublished,j),e.off(H.RoomEvent.DataReceived,P),e.off(H.RoomEvent.ParticipantConnected,A),e.off(H.RoomEvent.ParticipantDisconnected,_)}},[e,i,l,h.length,b,t,n]);const m=g.useCallback(()=>o?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):l,[l,o]),y=g.useCallback(()=>{o&&localStorage.removeItem("voxket-session-logs"),d([])},[o]),C=g.useCallback(()=>{const v=m(),T=JSON.stringify(v,null,2),k="data:application/json;charset=utf-8,"+encodeURIComponent(T),S=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,j=document.createElement("a");j.setAttribute("href",k),j.setAttribute("download",S),j.click()},[m]);return{sessionMetrics:i,sessionLogs:l,logEvent:b,getSessionLogs:m,clearSessionLogs:y,exportSessionLogs:C}}class Vs{constructor(){ke(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=(...o)=>{this.off(t,r),n(...o)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const o=r.indexOf(n);o>-1&&r.splice(o,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const o=[...r];for(const s of o)try{s(...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 gd{constructor(t){ke(this,"plugins",new Map);ke(this,"installedPlugins",new Set);ke(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 s of r.dependencies)this.installedPlugins.has(s)||await this.install(s);const o={...this.context,config:{...r.config,...n}};r.install&&await r.install(o),this.installedPlugins.add(t),this.setupPluginEvents(r,o)}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[o,s]of this.plugins)if(this.installedPlugins.has(o)&&((r=s.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${o}' 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 Q1(e){return e}function Ns(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 eb={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)})}},tb={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))}},nb={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})})}},pd=w.createContext(null);function xd({config:e,children:t,autoConnect:n=!1}){const[r,o]=w.useState(null),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[d,u]=w.useState(null),[f,h]=w.useState(null),[x,b]=w.useState("idle"),[m,y]=w.useState(null),[C,v]=w.useState([]),[T,k]=w.useState([]),[S,j]=w.useState([]);w.useEffect(()=>{const I=new Rn(e);return o(I),P(I),n&&A(I),()=>{I.disconnect().catch(console.error)}},[e,n]);const P=I=>{I.on("connection.connecting",()=>{l(!0),u(null)}),I.on("connection.connected",()=>{i(!0),l(!1),u(null)}),I.on("connection.disconnected",()=>{i(!1),l(!1),h(null),b("idle"),v([]),k([]),j([])}),I.on("connection.error",q=>{u(q),l(!1)}),I.on("session.created",q=>{h(q),b(q.state)}),I.on("session.state.changed",q=>{b(q),f&&h({...f,state:q})}),I.on("session.ended",(q,M)=>{h(null),b("idle"),y(M),v([]),k([]),j([])}),I.on("participant.joined",q=>{v(M=>[...M,q])}),I.on("participant.left",q=>{v(M=>M.filter(z=>z.id!==q.id))}),I.on("chat.message.received",q=>{k(M=>[...M,q])}),I.on("chat.message.sent",q=>{k(M=>[...M,q])}),I.on("transcription.received",q=>{j(M=>[...M,q])})},A=async I=>{const q=I||r;if(q)try{await q.connect()}catch(M){console.error("Failed to connect:",M)}},X={client:r,isConnected:s,isConnecting:a,connectionError:d,currentSession:f,sessionState:x,sessionMetrics:m,participants:C,chatMessages:T,transcriptions:S,connect:()=>A(),disconnect:async()=>{if(r)try{await r.disconnect()}catch(I){console.error("Failed to disconnect:",I)}},createSession:async(I,q={})=>{if(!r)throw new Error("Client not initialized");const M={agentId:I,participantName:q.participantName||"User",metadata:q.metadata,modalities:q.modalities||["voice"]};return await r.createSession(M)},endSession:async()=>r?await r.endSession():null,sendChatMessage:async I=>{if(!r)throw new Error("Client not initialized");await r.sendChatMessage(I)},setMicrophoneEnabled:async I=>{if(!r)throw new Error("Client not initialized");await r.setMicrophoneEnabled(I)},setCameraEnabled:async I=>{if(!r)throw new Error("Client not initialized");await r.setCameraEnabled(I)},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 c.jsx(pd.Provider,{value:X,children:t})}function et(){const e=w.useContext(pd);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class rb extends Vs{constructor(n){super();ke(this,"room",null);ke(this,"registeredMethods",new Map);ke(this,"activeInteractions",new Map);ke(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,o="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 s={methodName:n,component:r,presentationMode:o};this.registeredMethods.set(n,s);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}':`,s);let l=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const d=await this.awaitUserInteraction(n,r,o,a,l);return JSON.stringify(d)}catch(d){throw console.error(`RpcManager: Error in RPC method '${n}':`,d),d}}),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,o,s,i){return new Promise((a,l)=>{const d=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(h,x)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(d),this.currentInteraction=null;const b={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...x?{successView:x}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:b}),a(b)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(d);const x={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:x}),a(x)},dismissView:()=>{var x;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(x=this.currentInteraction)==null?void 0:x.methodName),this.clearInteraction(d),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 b;((b=this.currentInteraction)==null?void 0:b.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(d),this.currentInteraction=null;const x={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:x}),setTimeout(()=>{var b;((b=this.currentInteraction)==null?void 0:b.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(x)}},f=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(d,{resolve:h=>a(JSON.parse(h)),reject:l,timeoutId:f}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:o,timeout:i,data:s,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:o}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,s)}catch(x){console.error("RpcManager: Error loading data into component:",x),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")}}let Wa=!1;function bd(){if(Wa||typeof document>"u")return;const e=`
|
|
106
106
|
/* Custom scrollbar styles for chat */
|
|
107
107
|
.chat-scrollable {
|
|
108
108
|
scrollbar-width: thin;
|
|
@@ -1375,7 +1375,318 @@ div[class*="fixed"][class*="z-[9999]"] {
|
|
|
1375
1375
|
.shadow-2xl {
|
|
1376
1376
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
1377
1377
|
}
|
|
1378
|
-
`,t=document.createElement("style");t.type="text/css",t.setAttribute("data-voxket-styles","true"),t.textContent=e,document.head.appendChild(t),Wa=!0}class he extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}class Rn extends Vs{constructor(n){super();ke(this,"config");ke(this,"room",null);ke(this,"pluginManager");ke(this,"rpcManager");ke(this,"isConnected",!1);ke(this,"currentSession",null);ke(this,"connectionState",H.ConnectionState.Disconnected);ke(this,"renderedComponents",new Map);ke(this,"textStreamHandlersRegistered",!1);ke(this,"currentAgentInfo",null);ke(this,"chatMessages",[]);ke(this,"isAgentConnected",!1);ke(this,"agentState","idle");yd(),this.config=n,this.pluginManager=new gd(this),this.rpcManager=new ry,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,o;this.isConnected=!1,(o=(r=this.config).onDisconnected)==null||o.call(r,n)}),this.on("connection.error",n=>{var r,o;(o=(r=this.config).onError)==null||o.call(r,n)}),this.on("chat.message.received",n=>{var r,o;this.addChatMessage(n),(o=(r=this.config).onMessageReceived)==null||o.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,o;(o=(r=this.config).onTranscriptionReceived)==null||o.call(r,n)}),this.on("session.state.changed",n=>{var r,o;(o=(r=this.config).onSessionStateChanged)==null||o.call(r,n)}),this.on("session.created",n=>{var r,o;(o=(r=this.config).onSessionStart)==null||o.call(r,n.id)}),this.on("session.ended",(n,r)=>{var o,s;(s=(o=this.config).onSessionEnd)==null||s.call(o,r)}),this.on("participant.joined",n=>{var r,o;(o=(r=this.config).onUserJoined)==null||o.call(r,n.id)}),this.on("participant.left",n=>{var r,o;(o=(r=this.config).onUserLeft)==null||o.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 H.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(H.RoomEvent.Connected,()=>{var n,r;this.connectionState=H.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 o;try{(o=this.room)!=null&&o.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(s){console.warn("VoxketClient: Failed to enable microphone after room connection:",s)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(H.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=H.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),n&&console.log("🔍 VoxketClient: Disconnect reason details:",{reason:n.toString(),currentSession:(r=this.currentSession)==null?void 0:r.id,agentConnected:this.isAgentConnected,connectionState:this.connectionState}),this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(H.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===H.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(H.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(H.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(r,o)=>{try{const s=await r.readAll(),i={id:`msg_${Date.now()}_${o.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:o.identity||"user",name:o.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",i)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("lk.transcription",async(r,o)=>{var s,i;try{const a=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let c="";const d=((s=this.currentAgentInfo)==null?void 0:s.name)||o.identity||"AI Assistant",u={id:a,content:"",timestamp:new Date,sender:{id:o.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",u);for await(const x of r){c+=x;const y=this.convertMarkdownToText(c),m={...u,content:y,metadata:{...u.metadata,streaming:!0}};this.emit("chat.message.updated",m)}const f=this.convertMarkdownToText(c),h={...u,content:f,metadata:{...u.metadata,streaming:!1}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Failed to process lk.transcription message:",a);try{const c=await r.readAll(),d=((i=this.currentAgentInfo)==null?void 0:i.name)||o.identity||"AI Assistant",u={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:c,timestamp:new Date,sender:{id:o.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",u)}catch(c){console.error("VoxketClient: Fallback failed for lk.transcription:",c)}}})}catch(r){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("suggested_response",async r=>{const o=await r.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(i){console.warn("VoxketClient: Failed to parse suggested_response:",i,o)}this.emit("suggested.response",s)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,o)=>{const s=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",s);let i={};try{i=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,s)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",i)),i.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",i)):i.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",i)):(i.new_state==="idle"||i.new_state==="listening")&&this.setAgentState("idle")})}catch(r){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("images",async(r,o)=>{try{const s=await r.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,o)=>{var s,i;try{const a=r.info,c={id:`img_${Date.now()}_${o.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:o.identity||"agent",name:o.identity||"Agent",type:o.identity===((i=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:i.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:a.name,fileSize:a.size,mimeType:a.mimeType,streamId:a.id,downloading:!0}};this.emit("chat.message.received",c),r.onProgress&&(r.onProgress=x=>{const y={...c,metadata:{...c.metadata,downloadProgress:x||0}};this.emit("chat.message.updated",y)});const d=[];for await(const x of r)d.push(x);const u=new Blob(d,{type:a.mimeType||"application/octet-stream"}),f=URL.createObjectURL(u),h={...c,metadata:{...c.metadata,downloading:!1,downloadProgress:1,downloadUrl:f,blob:u}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Error processing image attachment:",a)}})}catch(r){console.warn("VoxketClient: image handler already registered, skipping:",r)}["error","warning","status","system","debug","info"].forEach(r=>{try{this.room.registerTextStreamHandler(r,async(o,s)=>{try{const i=await o.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,i),r==="error"){let a={};try{a=typeof i=="string"?JSON.parse(i):i}catch{a={message:i}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:i,participantInfo:s})}catch(i){console.error(`VoxketClient: Failed to process '${r}' stream:`,i)}})}catch(o){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,o)}});try{this.room.registerTextStreamHandler("*",async(r,o)=>{var s;try{const i=await r.readAll(),a=((s=r.info)==null?void 0:s.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,i),this.emit("text.stream.unhandled",{topic:a,data:i,participantInfo:o})}catch(i){console.error("VoxketClient: Failed to process unhandled text stream:",i)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,o){const s=n||this.config.agentId||"default-agent",i=r||this.config.participantName||"User",a=o||this.config.modalities||["voice"];try{const c={agent_id:s,participant_name:i,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const d=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(!d.ok){let h=`HTTP ${d.status}: Failed to fetch connection details`;try{const x=await d.json();x&&(x.error?h=`API Error: ${x.error}`:x.detail?h=`API Error: ${x.detail}`:x.message&&(h=`API Error: ${x.message}`))}catch{try{const y=await d.text();y&&(h=`API Error: ${y}`)}catch{}}throw new Error(h)}const u=await d.json();let f;return u.agent_info&&(f={id:u.agent_info.id||s,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 d=new he(`Failed to fetch connection details: ${c instanceof Error?c.message:"Unknown error"}`,"CONNECTION_FAILED",c);throw this.emit("connection.error",d),d}}async connect(n,r,o){var s;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,r,o);return await((s=this.room)==null?void 0:s.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new he(`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 H.Room,this.setupRoomEventListeners()}catch(r){const o=new he("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",o),o}}async createSession(n){var r,o,s,i;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),c={id:a.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:a.agentInfo||this.currentAgentInfo};if(this.currentSession=c,this.emit("session.created",c),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(d=>setTimeout(d,500)),(o=this.room)!=null&&o.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(d){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",d)}if((s=n.modalities)!=null&&s.includes("video"))try{await new Promise(d=>setTimeout(d,200)),(i=this.room)!=null&&i.localParticipant&&(console.log("🎥 VoxketClient: Attempting to enable camera for video session"),await this.room.localParticipant.setCameraEnabled(!0),this.emit("track.unmuted",{source:"camera",enabled:!0}),console.log("🎥 VoxketClient: Camera enabled successfully"))}catch(d){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",d)}return setTimeout(()=>{var d;this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state),this.forceAgentConnected(),console.log("🤖 VoxketClient: Session marked as active:",{sessionId:this.currentSession.id,modalities:this.currentSession.activeModalities,agentConnected:this.isAgentConnected,hasRoom:!!this.room,remoteParticipants:((d=this.room)==null?void 0:d.remoteParticipants.size)||0}))},1e3),c}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof he?a:a instanceof TypeError&&a.message.includes("fetch")?new he("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new he(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new he(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,r){const o={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(o)}async endSession(){var n,r;if(!this.currentSession)return null;try{const o={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,o),await this.disconnect(),o}catch(o){throw new he("Failed to end session","SESSION_NOT_FOUND",o)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getIsAgentConnected(){return this.isAgentConnected}forceAgentConnected(){this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent manually marked as connected"),this.emit("agent.connected",{forced:!0}))}getAgentState(){return this.agentState}setAgentState(n){this.agentState!==n&&(this.agentState=n,this.emit("agent.state.changed",{state:n}))}getAgentAudioTrack(){const n=this.getRemoteParticipants();for(const r of n){const o=r.getTrackPublication(H.Track.Source.Microphone);if(o!=null&&o.track)return{source:H.Track.Source.Microphone,participant:r,publication:o}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const o=r.getTrackPublication(H.Track.Source.Camera);if(o!=null&&o.track)return{source:H.Track.Source.Camera,participant:r,publication:o}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const s=r.getTrackPublication(H.Track.Source.Camera);s!=null&&s.track&&n.push({source:H.Track.Source.Camera,participant:r,publication:s});const i=r.getTrackPublication(H.Track.Source.ScreenShare);i!=null&&i.track&&n.push({source:H.Track.Source.ScreenShare,participant:r,publication:i})}const o=this.getRemoteParticipants();for(const s of o){const i=s.getTrackPublication(H.Track.Source.Camera);i!=null&&i.track&&n.push({source:H.Track.Source.Camera,participant:s,publication:i});const a=s.getTrackPublication(H.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:H.Track.Source.ScreenShare,participant:s,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===H.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===H.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(o=>o.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(o=>o.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,d,u;const r=this.resolveTarget(n.target||"body"),o=this.getTargetKey(r),s=this.renderedComponents.get(o);s&&s.target===r||this.removeUI(r);const i=(s==null?void 0:s.root)||Hd.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:((d=n.modality)==null?void 0:d.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};if(!i||typeof i.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{i.render(w.createElement(xd,{config:this.config,autoConnect:n.autoStart||!1,children:w.createElement(bd,a)}))}catch(f){throw console.error("Error rendering Voxket widget:",f),new Error(`Failed to render Voxket widget: ${f instanceof Error?f.message:"Unknown error"}`)}this.renderedComponents.set(o,{root:i,target:r})}removeUI(n){const r=n?this.resolveTarget(n):null;if(r){const o=this.getTargetKey(r),s=this.renderedComponents.get(o);s&&(s.root.unmount(),this.renderedComponents.delete(o),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(d){console.warn("Failed to remove fixed element:",d)}}))}}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(o){console.warn("Failed to remove overlay:",o)}})}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 o;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const s={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},i=await((o=this.room)==null?void 0:o.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",s)}catch(s){throw console.error("VoxketClient: Failed to send chat message:",s),new he("Failed to send message","NETWORK_ERROR",s)}}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 he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new he("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const o=n.filter(s=>s.type.startsWith("image/"));if(o.length===0)throw new he("Only image files are allowed","INVALID_PARAMETER");o.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const s=o.map(async(i,a)=>{const d={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",d);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:h=>{const x={...d,metadata:{...d.metadata,uploadProgress:h}};this.emit("chat.message.updated",x)}});try{const h=new FileReader,x=new Promise((b,C)=>{h.onload=()=>{typeof h.result=="string"?b(h.result):C(new Error("Failed to convert to base64"))},h.onerror=C});h.readAsDataURL(i);const m={type:"image",data:await x,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const x=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(x,{topic:"lk.chat",destinationIdentities:[]})}catch(x){console.warn("VoxketClient: Failed to send image notification to agent:",x)}}const f={...d,metadata:{...d.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",f),u});await Promise.all(s)}catch(s){throw console.error("VoxketClient: Failed to send attachments:",s),new he("Failed to send attachments","NETWORK_ERROR",s)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,o;try{const s=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,i=n??!s;await((o=this.room)==null?void 0:o.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle microphone:",s),new he("Failed to toggle microphone","PERMISSION_DENIED",s)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,o;try{const s=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,i=n??!s;await((o=this.room)==null?void 0:o.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle camera:",s),new he("Failed to toggle camera","PERMISSION_DENIED",s)}}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 he("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 he("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 he("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 he("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(o){throw new he("Failed to set audio input device","DEVICE_ERROR",o)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(o){throw new he("Failed to set video input device","DEVICE_ERROR",o)}}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 o=s=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(s));return{camera:o(1),microphone:o(2),screenShare:o(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===H.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===H.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===H.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===H.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 he("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 he("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,o="embedded"){return this.rpcManager.registerFrontendRPC(n,r,o)}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 o=>{try{const s=await o.readAll();r(s)}catch(s){console.error(`Error processing event for topic '${n}':`,s)}})}catch(o){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,o)}}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()}}function Lt({title:e,description:t}){console.error(`${e}: ${t}`)}const oy=ie.create($1),sy=ie.create(W1),iy=ie.create(Y1),ay=ie.create(J1);function cy({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const o={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},s=Ne(r);return l.jsx(ie.button,{onClick:e,className:`fixed ${o[n]} z-50 px-4 py-2 rounded-full shadow-lg ${s.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 Ga({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:o="bottom-right",onExpand:s}){const i=Ne(t);if(n==="fullscreen")return l.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/40 bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",onClick:a=>{a.target===a.currentTarget&&r&&r()},children:l.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",onClick:a=>{a.stopPropagation()},children:[r&&l.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),r()},className:"absolute top-4 cursor-pointer right-4 z-[10000] 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:l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.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"})})}),l.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full w-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.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 l.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:l.jsxs("div",{className:`fixed rounded-2xl ${a[o]} pointer-events-auto`,children:[r&&l.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:"×"}),l.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full w-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return l.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card}`,style:{height:"100%",maxHeight:"100%"},children:[l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),e,l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function bd(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:o,appId:s,prompts:i,statusMessage:a,welcomeTitle:c,welcomeSubTitle:d,className:u,width:f,height:h,loadingText:x,suportsChatInput:y=!0,suportsVideoInput:m=!0,suportsScreenShare:b=!0,theme:C="vox",onSessionStart:v,onSessionEnd:T,enableSessionLogging:k=!0,onSessionLogsUpdate:S,onSessionMetricsUpdate:j,modalities:P=["voice"],displayType:A="widget",popupPosition:_="bottom-right",popupTriggerText:p="Open Chat",onPopupToggle:V,voxketClient:B,onDisplayTypeChange:G}=e,[te,ne]=g.useState(()=>B?!!B.getCurrentSession():!1),[oe,X]=g.useState(!1),[I,q]=g.useState(t||""),[M,z]=g.useState(n||"User"),[Q,W]=g.useState(()=>B?B.getCurrentSession():null),[U,E]=g.useState(()=>{var re,qe,We;if(B){const Se=B.getCurrentSession();if((re=Se==null?void 0:Se.activeModalities)!=null&&re.includes("chat"))return"chat";if((qe=Se==null?void 0:Se.activeModalities)!=null&&qe.includes("voice"))return"voice";if((We=Se==null?void 0:Se.activeModalities)!=null&&We.includes("video"))return"video"}return"welcome"}),[D,O]=g.useState(!1);g.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",A)},[A]),g.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:U,sessionStarted:te,loading:oe,currentSession:Q==null?void 0:Q.id,isPopupOpen:D})},[U,te,oe,Q,D]);const $=g.useMemo(()=>{if(B)return console.log("🔄 Using passed VoxketClient to preserve session state"),B;console.log("🆕 Creating new VoxketClient instance");const re={appId:s,appSecret:o,baseUrl:r,agentId:I,participantName:M||"User",modalities:P};return new Rn(re)},[B,s,o,r,I,M,P]),F=P,L=g.useMemo(()=>$.getRoom()||new H.Room,[$]),J={suportsChatInput:y,suportsVideoInput:m,suportsScreenShare:b},{sessionMetrics:R,sessionLogs:ce,logEvent:xe}=md({room:L,onSessionStart:v,onSessionEnd:T,enableConsoleLogging:k,enableLocalStorage:k,voxketSessionId:Q==null?void 0:Q.id});g.useEffect(()=>{S&&S(ce)},[ce,S]),g.useEffect(()=>{j&&R&&j(R)},[R,j]),g.useEffect(()=>{const re=We=>{console.log("🔴 Room disconnected:",We),X(!1),ne(!1),W(null),E("welcome")},qe=We=>{console.log("📹 Media devices error:",We),Lt({title:"Allow access to your microphone/camera",description:`${We.name}: ${We.message}`})};return L.on(H.RoomEvent.MediaDevicesError,qe),L.on(H.RoomEvent.Disconnected,re),()=>{L.off(H.RoomEvent.Disconnected,re),L.off(H.RoomEvent.MediaDevicesError,qe)}},[L]);const pe=async()=>{try{console.log("🎤 Starting voice session...",{agentId:I,participantName:M}),console.log("🎤 Pre-start state:",{currentMode:U,sessionStarted:te,loading:oe}),X(!0),ne(!0),E("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VOICE_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",re.id),W(re),X(!1),v&&v(re.id)}catch(re){console.error("❌ Failed to start voice session:",re),Lt({title:"Failed to start voice session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},Re=async()=>{try{X(!0),ne(!0),E("chat"),xe("USER_STARTED_CHAT_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["chat"]});W(re),X(!1),v&&v(re.id)}catch(re){console.error("Failed to start chat session:",re),Lt({title:"Failed to start chat session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},tt=async()=>{try{console.log("📺 Starting video session...",{agentId:I,participantName:M}),console.log("📺 Pre-start state:",{currentMode:U,sessionStarted:te,loading:oe}),X(!0),ne(!0),E("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VIDEO_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",re.id),W(re),X(!1),v&&v(re.id)}catch(re){console.error("❌ Failed to start video session:",re),Lt({title:"Failed to start video session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},dt=()=>{E("welcome"),G&&G(e.displayType||"widget"),Q&&te&&(ne(!1),W(null),$.disconnect()),A==="popup"&&!D&&O(!0)},an=()=>{const re=!D;O(re),V&&V(re),!re&&!(Q&&te)&&(E("welcome"),ne(!1),W(null))},Dd=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},$d=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const re=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");re&&re.requestFullscreen?re.requestFullscreen().catch(qe=>{console.warn("⚠️ Fullscreen API not supported or failed:",qe),Lt({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}):Lt({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}};g.useEffect(()=>{var re,qe,We;if(B&&$){console.log("🔄 Syncing widget state with existing client session state");const Se=$.getCurrentSession(),Fd=$.connected;console.log("🔍 Existing session state:",{hasSession:!!Se,sessionId:Se==null?void 0:Se.id,isConnected:Fd,activeModalities:Se==null?void 0:Se.activeModalities}),Se&&(console.log("✅ Restoring session state from existing client"),W(Se),ne(!0),X(!1),(re=Se.activeModalities)!=null&&re.includes("chat")?E("chat"):(qe=Se.activeModalities)!=null&&qe.includes("voice")?E("voice"):(We=Se.activeModalities)!=null&&We.includes("video")&&E("video"))}},[B,$]),g.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),B?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),$.disconnect())},[$,B]);let Tr="w-96",Ar="h-[25rem]",jr={};if(f&&(f.startsWith("w-")?Tr=f:(jr.width=f,Tr="")),h&&(h.startsWith("h-")?Ar=h:(jr.height=h,Ar="")),A==="popup"&&!D)return console.log("🟡 Showing popup trigger button"),l.jsx(cy,{onClick:an,text:p,position:_,theme:C});console.log("🟢 Rendering widget content, displayType:",A,"isPopupOpen:",D,"currentMode:",U,"sessionStarted:",te,"loading:",oe);let Pr=`voxket-widget-root theme-${C}`,Dn={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};A==="widget"?(Pr+=` flex items-center justify-center min-h-fit ${Tr} ${Ar} ${u}`,Dn={...Dn,...jr}):(Pr+=` ${u||""}`,Dn={});const Fs=l.jsx("div",{className:"h-full w-full flex flex-col overflow-hidden",children:l.jsxs(Wt,{mode:"wait",children:[U==="welcome"&&!oe&&l.jsx(ay,{agentId:I,participantName:M||"",onAgentIdChange:q,onParticipantNameChange:z,onStartCall:pe,onStartChat:Re,onStartVideo:tt,disabled:te||oe,prompts:i,statusMessage:a,title:c,subTitle:d,theme:C,modalities:F,displayType:A,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),U==="voice"&&l.jsxs(Ie.RoomContext.Provider,{value:L,children:[l.jsx(Ie.RoomAudioRenderer,{}),l.jsx(Ie.StartAudio,{label:"Start Audio"}),l.jsx(oy,{loadingText:x,participantName:M||"User",capabilities:J,sessionStarted:te,disabled:!te,theme:C,client:$,displayType:A,onBack:A==="popup"?an:dt,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),U==="chat"&&l.jsx(sy,{client:$,theme:C,displayType:A,onBack:A==="popup"?an:dt,onEndChat:dt,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),U==="video"&&l.jsxs(Ie.RoomContext.Provider,{value:L,children:[l.jsx(Ie.RoomAudioRenderer,{}),l.jsx(Ie.StartAudio,{label:"Start Audio"}),l.jsx(iy,{client:$,theme:C,displayType:A,onBack:A==="popup"?an:dt,onEndCall:dt,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return A==="fullscreen"||A==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",A),l.jsx(Ga,{theme:C,displayType:A,popupPosition:_,onClose:A==="fullscreen"?Dd:an,children:Fs})):(console.log("📦 Rendering widget mode"),l.jsx("div",{className:Pr,style:Dn,children:l.jsx(Ga,{theme:C,displayType:A,popupPosition:_,onExpand:$d,children:Fs})}))}class vd extends g.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 g.createElement(t,{error:this.state.error})}return g.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 ly({logs:e,onClear:t,onExport:n}){const[r,o]=w.useState(!1),[s,i]=w.useState(""),a=e.filter(c=>!s||c.event.toLowerCase().includes(s.toLowerCase()));return r?l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[l.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Filter events...",value:s,onChange:c=>i(c.target.value),className:"px-3 py-1 border rounded text-sm"}),l.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),l.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),l.jsx("button",{onClick:()=>o(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),l.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?l.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):l.jsx("div",{className:"space-y-2",children:a.map((c,d)=>l.jsxs("div",{className:"border rounded p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"font-semibold text-blue-600",children:c.event}),l.jsx("span",{className:"text-gray-500 text-xs",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.sessionId&&l.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",c.sessionId]}),c.data&&l.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:l.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(c.data,null,2)})})]},d))})})]})}):l.jsxs("button",{onClick:()=>o(!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 dy({metrics:e}){return e?l.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[l.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Session ID:"}),l.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Start Time:"}),l.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Messages:"}),l.jsx("div",{children:e.totalMessages})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Participants:"}),l.jsx("div",{children:e.participantCount})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),l.jsx("div",{children:e.connectionIssues})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Duration:"}),l.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function Vt(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:o}=et(),s=w.useCallback(async(a,c)=>await r(a,c),[r]),i=w.useCallback(async()=>await o(),[o]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:s,stop:i}}function wd(){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 Sd(){const{setMicrophoneEnabled:e,client:t}=et(),[n,r]=w.useState(!1),[o,s]=w.useState(!1),i=w.useCallback(async()=>{if(!o){s(!0);try{const d=!n;await e(d),r(d)}catch(d){console.error("Failed to toggle microphone:",d)}finally{s(!1)}}},[n,o,e]),a=w.useCallback(async()=>{if(!(n||o)){s(!0);try{await e(!0),r(!0)}catch(d){console.error("Failed to enable microphone:",d)}finally{s(!1)}}},[n,o,e]),c=w.useCallback(async()=>{if(!(!n||o)){s(!0);try{await e(!1),r(!1)}catch(d){console.error("Failed to disable microphone:",d)}finally{s(!1)}}},[n,o,e]);return{isEnabled:n,isLoading:o,toggle:i,enable:a,disable:c}}function kd(){const{setCameraEnabled:e}=et(),[t,n]=w.useState(!1),[r,o]=w.useState(!1),s=w.useCallback(async()=>{if(!r){o(!0);try{const c=!t;await e(c),n(c)}catch(c){console.error("Failed to toggle camera:",c)}finally{o(!1)}}},[t,r,e]),i=w.useCallback(async()=>{if(!(t||r)){o(!0);try{await e(!0),n(!0)}catch(c){console.error("Failed to enable camera:",c)}finally{o(!1)}}},[t,r,e]),a=w.useCallback(async()=>{if(!(!t||r)){o(!0);try{await e(!1),n(!1)}catch(c){console.error("Failed to disable camera:",c)}finally{o(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:s,enable:i,disable:a}}function Cd(){const{startScreenShare:e,stopScreenShare:t}=et(),[n,r]=w.useState(!1),[o,s]=w.useState(!1),i=w.useCallback(async()=>{if(!(n||o)){s(!0);try{await e(),r(!0)}catch(d){console.error("Failed to start screen share:",d)}finally{s(!1)}}},[n,o,e]),a=w.useCallback(async()=>{if(!(!n||o)){s(!0);try{await t(),r(!1)}catch(d){console.error("Failed to stop screen share:",d)}finally{s(!1)}}},[n,o,t]),c=w.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:o,start:i,stop:a,toggle:c}}function uy(){const{client:e}=et(),[t,n]=w.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=w.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),o=w.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),s=w.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,r]),i=w.useCallback(async()=>{try{t.tracks.find(b=>b.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=w.useCallback(m=>{n(b=>({...b,layout:m}))},[]),c=w.useCallback(m=>{n(b=>({...b,pinnedTrack:m}))},[]),d=w.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=w.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),f=w.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),h=w.useCallback(m=>t.tracks.find(b=>b.id===m),[t.tracks]),x=w.useCallback(m=>t.tracks.filter(b=>b.participantId===m),[t.tracks]),y=w.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return w.useEffect(()=>{if(!e)return;const m=v=>{n(T=>({...T,tracks:[...T.tracks.filter(k=>k.id!==v.id),v]}))},b=v=>{n(T=>{var k;return{...T,tracks:T.tracks.filter(S=>S.id!==v),pinnedTrack:((k=T.pinnedTrack)==null?void 0:k.id)===v?void 0:T.pinnedTrack}})},C=v=>{n(T=>({...T,tracks:T.tracks.map(k=>k.id===v.id?v:k)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",b),e.on("videoTrackUpdated",C),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",b),e.off("videoTrackUpdated",C)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:o,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:s,toggleScreenShare:i,setLayout:a,pinTrack:c,unpinTrack:d,startRecording:u,stopRecording:f,getTrackById:h,getTracksByParticipant:x,isTrackActive:y}}function Er(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=et(),[r,o]=w.useState(!1),s=w.useCallback(async d=>{if(!(!d.trim()||r||!n)){o(!0);try{await t(d.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{o(!1)}}},[t,r,n]),{userMessages:i,agentMessages:a,allMessages:c}=w.useMemo(()=>{const d=e.filter(f=>f.sender.type==="participant"),u=e.filter(f=>f.sender.type==="agent");return{userMessages:d,agentMessages:u,allMessages:e}},[e]);return{messages:c,userMessages:i,agentMessages:a,messageCount:c.length,isSending:r,canSend:!!n&&!r,send:s}}function fy(){const{send:e,isSending:t,canSend:n}=Er(),[r,o]=w.useState(""),s=w.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),o("")}catch(a){throw a}},[r,e,n]),i=w.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s())},[s]);return{value:r,setValue:o,send:s,handleKeyPress:i,isSending:t,canSend:n&&r.trim().length>0}}function Rs(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:o}=et(),s=w.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),i=w.useCallback(async()=>{if(e)try{await o()}catch(a){throw console.error("Failed to disconnect:",a),a}},[o,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:s,disconnect:i}}function Ed(){const{participants:e}=et();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Td=w.createContext({}),In=()=>w.useContext(Td);function Ad({children:e,...t}){return l.jsx(Td.Provider,{value:t,children:e})}function Qn({name:e,children:t,fallback:n,className:r}){return l.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function jd(e,t={}){return Object.assign(e,t)}function Pd({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:o,className:s=""}){const i=Vt(),a=Sd(),c=kd(),d=Cd(),u=In(),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",s].filter(Boolean).join(" ");return!i.isActive&&!r?l.jsx("div",{className:f,children:l.jsx("div",{className:"voxket-controls-inactive",children:l.jsx("p",{children:"Controls available during active session"})})}):l.jsxs("div",{className:f,children:[r&&l.jsx("div",{className:"voxket-session-actions",children:i.isActive?l.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):l.jsx(hy,{})}),i.isActive&&l.jsxs("div",{className:"voxket-media-controls",children:[e&&l.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:[l.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&l.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:[l.jsx("span",{className:"voxket-icon",children:"📹"}),c.isLoading?"Loading...":c.isEnabled?"Stop Video":"Start Video"]}),n&&l.jsxs("button",{onClick:d.toggle,disabled:d.isLoading,className:`voxket-button voxket-button--media ${d.isSharing?"voxket-button--active":""}`,title:d.isSharing?"Stop screen share":"Start screen share",children:[l.jsx("span",{className:"voxket-icon",children:"🖥️"}),d.isLoading?"Loading...":d.isSharing?"Stop Share":"Share Screen"]})]}),o&&l.jsx("div",{className:"voxket-custom-controls",children:o})]})}function hy(){Vt();const[e,t]=w.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 l.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Is({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const o=Vt(),s=Rs(),i=In(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,r].filter(Boolean).join(" ");return l.jsxs("div",{className:a,children:[e&&l.jsxs("div",{className:"voxket-connection-status",children:[l.jsx("div",{className:`voxket-status-indicator ${s.isConnected?"connected":"disconnected"}`}),l.jsx("span",{className:"voxket-status-text",children:s.isConnecting?"Connecting...":s.isConnected?"Connected":"Disconnected"})]}),t&&o.session&&l.jsxs("div",{className:"voxket-session-info",children:[l.jsxs("div",{className:"voxket-session-id",children:["Session: ",o.session.id.slice(-8)]}),l.jsxs("div",{className:"voxket-session-state",children:["State: ",o.state]})]}),n&&o.session&&l.jsxs("div",{className:"voxket-agent-info",children:[l.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",o.session.agentId]}),l.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",o.session.activeModalities.join(", ")]})]}),s.error&&l.jsxs("div",{className:"voxket-error-message",children:["Error: ",s.error.message]})]})}function Ds({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const o=Vt(),s=Er(),i=In(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,r].filter(Boolean).join(" ");return o.isActive?l.jsx("div",{className:a,children:n||l.jsxs(l.Fragment,{children:[e&&l.jsxs("div",{className:"voxket-chat-container",children:[l.jsxs("div",{className:"voxket-chat-messages",children:[s.messages.map(c=>l.jsxs("div",{className:`voxket-message voxket-message--${c.sender.type}`,children:[l.jsxs("div",{className:"voxket-message-header",children:[l.jsx("span",{className:"voxket-message-sender",children:c.sender.name}),l.jsx("span",{className:"voxket-message-time",children:c.timestamp.toLocaleTimeString()})]}),l.jsx("div",{className:"voxket-message-content",children:c.content})]},c.id)),s.messages.length===0&&l.jsx("div",{className:"voxket-empty-messages",children:l.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),l.jsx(my,{})]}),t&&l.jsx("div",{className:"voxket-transcriptions",children:l.jsx("div",{className:"voxket-transcription-placeholder",children:l.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):l.jsx("div",{className:a,children:l.jsx("div",{className:"voxket-inactive-state",children:l.jsxs("div",{className:"voxket-inactive-message",children:[l.jsx("h3",{children:"Start a conversation"}),l.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function my(){const e=Er(),[t,n]=w.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(s){console.error("Failed to send message:",s)}},o=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),r())};return l.jsxs("div",{className:"voxket-chat-input",children:[l.jsx("input",{type:"text",value:t,onChange:s=>n(s.target.value),onKeyPress:o,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),l.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function $s({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:o=""}){const s=Vt(),i=wd(),a=Ed(),c=In(),d=["voxket-session-footer",`voxket-session-footer--${c.variant||"default"}`,`voxket-session-footer--${c.size||"md"}`,o].filter(Boolean).join(" ");return s.isActive?l.jsx("div",{className:d,children:r||l.jsxs(l.Fragment,{children:[n&&l.jsxs("div",{className:"voxket-session-status",children:[l.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),l.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&l.jsxs("div",{className:"voxket-session-metrics",children:[l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),l.jsx("span",{className:"voxket-metric-value",children:gy(i.duration||0)})]}),l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),l.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&l.jsxs("div",{className:"voxket-participants-info",children:[l.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&l.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>l.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):l.jsx("div",{className:d,children:l.jsx("div",{className:"voxket-footer-inactive",children:l.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function gy(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 py({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:o,variant:s="default",size:i="md",theme:a,className:c="",children:d}){var x;const u=Vt(),f=Rs();w.useEffect(()=>{n&&e&&f.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,f.isConnected,u.isActive]),w.useEffect(()=>{var y;(y=u.session)!=null&&y.id&&r&&r(u.session.id)},[(x=u.session)==null?void 0:x.id,r]),w.useEffect(()=>()=>{u.isActive&&o&&u.stop().then(o).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${s}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",c].filter(Boolean).join(" ");return l.jsx(Ad,{variant:s,size:i,theme:a,className:c,children:l.jsx("div",{className:h,children:d||l.jsxs(l.Fragment,{children:[l.jsx(Qn,{name:"header",fallback:l.jsx(Is,{})}),l.jsx(Qn,{name:"content",fallback:l.jsx(Ds,{})}),l.jsx(Qn,{name:"footer",fallback:l.jsx($s,{})})]})})})}const Md=jd(py,{Header:Is,Content:Ds,Footer:$s,Controls:Pd}),Pt={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)"}},Do={...Pt,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)"}},$o={...Pt,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"}},Vd=w.createContext(null),Nd=()=>{const e=w.useContext(Vd);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function xy({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:o=""}){const[s,i]=w.useState(()=>{const h={default:Pt,dark:Do,enterprise:$o,...t};return typeof e=="string"?h[e]||Pt:e}),[a,c]=w.useState(()=>({default:Pt,dark:Do,enterprise:$o,...t})),d=h=>{if(typeof h=="string"){const x=a[h];x&&i(x)}else i(h)},u=h=>{c(x=>({...x,[h.name]:h}))};w.useEffect(()=>{if(r&&typeof document<"u"){const h=document.documentElement;Object.entries(Rd(s)).forEach(([x,y])=>{h.style.setProperty(`--voxket-${x}`,y)})}},[s,r]);const f={theme:s,setTheme:d,themes:a,registerTheme:u};return l.jsx(Vd.Provider,{value:f,children:l.jsx("div",{className:`voxket-theme voxket-theme--${s.name} ${o}`,children:n})})}function Rd(e){const t={},n=(r,o="")=>{for(const[s,i]of Object.entries(r)){const a=o?`${o}-${s}`:s;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function yy(e=Pt,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 by(e){var n;const{theme:t}=Nd();return((n=t.components)==null?void 0:n[e])||{}}const vy=Ns("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&wy(e),t.enableVoiceActivation&&Sy(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&ky(e,t)}});function wy(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 Sy(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function ky(e,t){console.log("Playing audio response:",t.content)}const Cy=Ns("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&Ey(),t.enableFileUpload&&Ty(e),t.enableCustomComponents&&Ay(),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"?jy(e,t):t.type==="text"&&n.enableRichText&&Py(e,t)}});function Ey(e){console.log("Rich text support enabled")}function Ty(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function Ay(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",My),t.set("form",Vy),t.set("card",Ny),t.set("chart",Ry)}function jy(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 Py(e,t){console.log("Processing rich text message:",t.content)}function My(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function Vy(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function Ny(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function Ry(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function er({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:o=!0,isPinned:s=!1,className:i="",onClick:a,onPin:c,onUnpin:d}){const u=w.useRef(null),[f,h]=w.useState(!1);w.useEffect(()=>{if(!u.current||!e.isEnabled)return;const b=u.current;return b.srcObject=null,()=>{b.srcObject&&(b.srcObject=null)}},[e]);const x=()=>{a==null||a(e)},y=b=>{b.stopPropagation(),s?d==null||d(e):c==null||c(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",s?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",f?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return l.jsxs("div",{className:m,onClick:x,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[l.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&l.jsxs("div",{className:"voxket-video-placeholder",children:[l.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),l.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),l.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&l.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),o&&!e.isEnabled&&l.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(f||s)&&l.jsxs("div",{className:"voxket-video-controls",children:[l.jsx("button",{className:`voxket-video-control-btn ${s?"voxket-video-control-btn--active":""}`,onClick:y,title:s?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&l.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&l.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&l.jsx("div",{className:"voxket-video-loading",children:l.jsx("div",{className:"voxket-spinner"})})]})}function Iy({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:o,maxVisibleTracks:s=9,showPagination:i=!0}){const[a,c]=w.useState(0),[d,u]=w.useState(null),f=w.useMemo(()=>{let v=[...e];t.type==="speaker"&&d&&(v=[d,...e.filter(S=>S.id!==d.id)]);const T=a*s,k=T+s;return v.slice(T,k)},[e,t,d,a,s]),h=Math.ceil(e.length/s),x=w.useMemo(()=>{const v=f.length;switch(t.type){case"grid":const T=Math.ceil(Math.sqrt(v)),k=Math.ceil(v/T);return{display:"grid",gridTemplateColumns:`repeat(${T}, 1fr)`,gridTemplateRows:`repeat(${k}, 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)},m=()=>{u(null)},b=v=>{r==null||r({...t,type:v})},C=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${f.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?l.jsx("div",{className:"voxket-video-grid-empty",children:l.jsxs("div",{className:"voxket-video-grid-empty-content",children:[l.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),l.jsx("p",{children:"No video tracks available"})]})}):l.jsxs("div",{className:C,children:[l.jsxs("div",{className:"voxket-video-grid-controls",children:[l.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(v=>l.jsx("button",{className:`voxket-layout-btn ${t.type===v?"voxket-layout-btn--active":""}`,onClick:()=>b(v),title:`Switch to ${v} layout`,children:Dy(v)},v))}),l.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),l.jsx("div",{className:"voxket-video-grid-content",style:x,children:t.type==="speaker"&&d?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"voxket-video-speaker-main",children:l.jsx(er,{track:d,participantName:`Participant ${d.participantId}`,isPinned:!0,onClick:o,onUnpin:m})}),l.jsx("div",{className:"voxket-video-speaker-sidebar",children:f.filter(v=>v.id!==d.id).map(v=>l.jsx(er,{track:v,participantName:`Participant ${v.participantId}`,showControls:!1,onClick:o,onPin:y},v.id))})]}):f.map(v=>l.jsx(er,{track:v,participantName:`Participant ${v.participantId}`,isPinned:(d==null?void 0:d.id)===v.id,onClick:o,onPin:y,onUnpin:m},v.id))}),i&&h>1&&l.jsxs("div",{className:"voxket-video-pagination",children:[l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.max(0,a-1)),disabled:a===0,children:"←"}),l.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function Dy(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function $y({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:o=!0,showCameraControls:s=!0,showScreenShareControls:i=!0,className:a=""}){const c=["voxket-video-controls",a].filter(Boolean).join(" "),d=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return l.jsxs("div",{className:c,children:[s&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),l.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:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&l.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),l.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:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),o&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),l.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})=>l.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>d(u),title:`Switch to ${h} layout`,children:[l.jsx("span",{className:"voxket-control-icon",children:f}),l.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),l.jsxs("div",{className:"voxket-video-settings",children:[l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Quality"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"high",children:"High (720p)"}),l.jsx("option",{value:"medium",children:"Medium (480p)"}),l.jsx("option",{value:"low",children:"Low (240p)"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"30",children:"30 fps"}),l.jsx("option",{value:"15",children:"15 fps"}),l.jsx("option",{value:"10",children:"10 fps"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"unlimited",children:"Unlimited"}),l.jsx("option",{value:"1000",children:"1 Mbps"}),l.jsx("option",{value:"500",children:"500 Kbps"}),l.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),l.jsxs("div",{className:"voxket-video-stats",children:[l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),l.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Source:"}),l.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Status:"}),l.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 Id=({handler:e,loadData:t,data:n,client:r,addLocalMessage:o})=>{const[s,i]=g.useState(null),[a,c]=g.useState(!0),[d,u]=g.useState(!1),[f]=g.useState(Date.now());g.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 b={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(b),console.log("📋 AssignmentView: Assignment loaded from RPC data:",b)}}catch(b){console.error("📋 AssignmentView: Error loading assignment:",b),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:m,assignment:b})=>{const C=m.toLowerCase().includes("declined"),v=C?"bg-red-50 border-red-200":"bg-green-50 border-green-200",T=C?"text-red-700":"text-green-700",k=C?"❌":"🎉";return l.jsxs("div",{className:`max-w-sm mx-auto ${v} border rounded-lg shadow p-3 flex flex-col items-center`,children:[l.jsx("div",{className:"text-2xl mb-2",children:k}),l.jsx("div",{className:`${T} font-semibold text-sm mb-1`,children:m}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:b.title}),l.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},x=async()=>{if(!(!s||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment accepted!",assignment:s}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},y=async()=>{if(!(!s||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment declined",assignment:s}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"flex items-center justify-center py-4",children:[l.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):s?l.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[l.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:l.jsx("div",{className:"flex items-center justify-between",children:l.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:s.title})})}),l.jsxs("div",{className:"p-3 text-black",children:[l.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:l.jsx("p",{className:"text-xs text-black leading-snug",children:s.description})}),l.jsx("div",{className:"mb-3 text-black",children:l.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[l.jsx("span",{className:"text-xs mr-1",children:"📅"}),l.jsxs("span",{children:["Est: ",s.estimated_time_of_completion]})]})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:x,disabled:d,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:d?l.jsxs("span",{className:"flex items-center justify-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),l.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),l.jsx("button",{onClick:y,disabled:d,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"})]})]})]}):l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"text-center py-4",children:[l.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),l.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function Fy(){const[e,t]=g.useState(null),[n,r]=g.useState([]);g.useEffect(()=>{const a=new Rn({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 o=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Id,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},s=async()=>{if(!e)return;const a=({handler:c,timeout:d})=>{const[u,f]=g.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"}],x=m=>{f(m)},y=()=>{const m=h.find(b=>b.id===u);c==null||c.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),l.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),l.jsx("div",{className:"space-y-3 mb-6",children:h.map(m=>l.jsx("div",{onClick:()=>x(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium",children:m.name}),l.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),l.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.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"}),l.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"})]}),d&&l.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",d," 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[d,u]=g.useState(0),[f,h]=g.useState(""),x=()=>{c==null||c.didSuccess({rating:d,comment:f,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),l.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(y=>l.jsx("button",{onClick:()=>u(y),className:`text-2xl ${y<=d?"text-yellow-400":"text-gray-300"}`,children:"⭐"},y))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),l.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..."})]}),l.jsxs("div",{className:"flex justify-end space-x-2",children:[l.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"}),l.jsx("button",{onClick:x,disabled:d===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 l.jsxs("div",{className:"p-6",children:[l.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),l.jsxs("div",{className:"space-y-4 mb-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),l.jsxs("div",{className:"space-x-2",children:[l.jsx("button",{onClick:o,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),l.jsx("button",{onClick:s,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),l.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?l.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>l.jsx("li",{className:"text-gray-700",children:l.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):l.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),l.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[l.jsxs("li",{children:["Register RPC methods with React components using ",l.jsx("code",{children:"client.registerFrontendRPC()"})]}),l.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),l.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),l.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),l.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),l.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),l.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),l.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
|
|
1378
|
+
|
|
1379
|
+
/* Global button and interactive element styles */
|
|
1380
|
+
.bg-gradient-to-br.from-blue-500.to-purple-600 {
|
|
1381
|
+
background: linear-gradient(to bottom right, #3b82f6, #9333ea);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
.bg-gradient-to-br.from-green-500.to-blue-600 {
|
|
1385
|
+
background: linear-gradient(to bottom right, #10b981, #2563eb);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
.bg-gradient-to-br.from-purple-500.to-pink-600 {
|
|
1389
|
+
background: linear-gradient(to bottom right, #8b5cf6, #db2777);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.bg-gradient-to-br.from-orange-500.to-red-600 {
|
|
1393
|
+
background: linear-gradient(to bottom right, #f97316, #dc2626);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/* Button hover effects */
|
|
1397
|
+
.hover\\:scale-105:hover {
|
|
1398
|
+
transform: scale(1.05);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
.hover\\:shadow-lg:hover {
|
|
1402
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
/* Button states and colors */
|
|
1406
|
+
.bg-blue-600 {
|
|
1407
|
+
background-color: #2563eb;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
.bg-green-500 {
|
|
1411
|
+
background-color: #10b981;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.bg-purple-600 {
|
|
1415
|
+
background-color: #9333ea;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
.bg-orange-500 {
|
|
1419
|
+
background-color: #f97316;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.hover\\:bg-blue-700:hover {
|
|
1423
|
+
background-color: #1d4ed8;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.hover\\:bg-green-600:hover {
|
|
1427
|
+
background-color: #059669;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.hover\\:bg-purple-700:hover {
|
|
1431
|
+
background-color: #7c3aed;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
.hover\\:bg-orange-600:hover {
|
|
1435
|
+
background-color: #ea580c;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/* Disabled button states */
|
|
1439
|
+
.disabled\\:opacity-50:disabled,
|
|
1440
|
+
.opacity-50 {
|
|
1441
|
+
opacity: 0.5;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
.disabled\\:cursor-not-allowed:disabled,
|
|
1445
|
+
.cursor-not-allowed {
|
|
1446
|
+
cursor: not-allowed;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/* Text colors for buttons */
|
|
1450
|
+
.text-gray-800 {
|
|
1451
|
+
color: #1f2937;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/* Transitions */
|
|
1455
|
+
.transition-all {
|
|
1456
|
+
transition-property: all;
|
|
1457
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1458
|
+
transition-duration: 150ms;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
.duration-200 {
|
|
1462
|
+
transition-duration: 200ms;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
.duration-300 {
|
|
1466
|
+
transition-duration: 300ms;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.ease-in-out {
|
|
1470
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
/* Bar visualizer styles */
|
|
1474
|
+
.bg-blue-400 {
|
|
1475
|
+
background-color: #60a5fa;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.bg-blue-500 {
|
|
1479
|
+
background-color: #3b82f6;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
.bg-purple-400 {
|
|
1483
|
+
background-color: #c084fc;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.bg-purple-500 {
|
|
1487
|
+
background-color: #a855f7;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.bg-pink-400 {
|
|
1491
|
+
background-color: #f472b6;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
.bg-pink-500 {
|
|
1495
|
+
background-color: #ec4899;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
/* Animation classes */
|
|
1499
|
+
.animate-pulse {
|
|
1500
|
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
@keyframes pulse {
|
|
1504
|
+
0%, 100% {
|
|
1505
|
+
opacity: 1;
|
|
1506
|
+
}
|
|
1507
|
+
50% {
|
|
1508
|
+
opacity: .5;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/* Spacing utilities */
|
|
1513
|
+
.p-2 {
|
|
1514
|
+
padding: 0.5rem;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.p-3 {
|
|
1518
|
+
padding: 0.75rem;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.p-4 {
|
|
1522
|
+
padding: 1rem;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
.px-3 {
|
|
1526
|
+
padding-left: 0.75rem;
|
|
1527
|
+
padding-right: 0.75rem;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
.px-4 {
|
|
1531
|
+
padding-left: 1rem;
|
|
1532
|
+
padding-right: 1rem;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
.px-6 {
|
|
1536
|
+
padding-left: 1.5rem;
|
|
1537
|
+
padding-right: 1.5rem;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
.py-2 {
|
|
1541
|
+
padding-top: 0.5rem;
|
|
1542
|
+
padding-bottom: 0.5rem;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
.py-3 {
|
|
1546
|
+
padding-top: 0.75rem;
|
|
1547
|
+
padding-bottom: 0.75rem;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
.m-2 {
|
|
1551
|
+
margin: 0.5rem;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
.mt-2 {
|
|
1555
|
+
margin-top: 0.5rem;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
.mt-4 {
|
|
1559
|
+
margin-top: 1rem;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.mb-2 {
|
|
1563
|
+
margin-bottom: 0.5rem;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.mb-4 {
|
|
1567
|
+
margin-bottom: 1rem;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.gap-2 {
|
|
1571
|
+
gap: 0.5rem;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.gap-3 {
|
|
1575
|
+
gap: 0.75rem;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.gap-4 {
|
|
1579
|
+
gap: 1rem;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/* Font styles */
|
|
1583
|
+
.font-medium {
|
|
1584
|
+
font-weight: 500;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
.font-semibold {
|
|
1588
|
+
font-weight: 600;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
.text-sm {
|
|
1592
|
+
font-size: 0.875rem;
|
|
1593
|
+
line-height: 1.25rem;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
.text-base {
|
|
1597
|
+
font-size: 1rem;
|
|
1598
|
+
line-height: 1.5rem;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.text-lg {
|
|
1602
|
+
font-size: 1.125rem;
|
|
1603
|
+
line-height: 1.75rem;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/* Border and radius */
|
|
1607
|
+
.border {
|
|
1608
|
+
border-width: 1px;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
.border-2 {
|
|
1612
|
+
border-width: 2px;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
.rounded {
|
|
1616
|
+
border-radius: 0.25rem;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
.rounded-lg {
|
|
1620
|
+
border-radius: 0.5rem;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
.rounded-xl {
|
|
1624
|
+
border-radius: 0.75rem;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
.rounded-full {
|
|
1628
|
+
border-radius: 9999px;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
/* Focus states */
|
|
1632
|
+
.focus\\:outline-none:focus {
|
|
1633
|
+
outline: 2px solid transparent;
|
|
1634
|
+
outline-offset: 2px;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
.focus\\:ring-2:focus {
|
|
1638
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
/* Overflow */
|
|
1642
|
+
.overflow-hidden {
|
|
1643
|
+
overflow: hidden;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/* Transform */
|
|
1647
|
+
.transform {
|
|
1648
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/* Cursor */
|
|
1652
|
+
.cursor-pointer {
|
|
1653
|
+
cursor: pointer;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
/* Popup Trigger positioning overrides for all contexts */
|
|
1657
|
+
.voxket-popup-trigger {
|
|
1658
|
+
position: fixed !important;
|
|
1659
|
+
z-index: 9999 !important;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.voxket-popup-trigger[data-position="bottom-right"] {
|
|
1663
|
+
bottom: 1rem !important;
|
|
1664
|
+
right: 1rem !important;
|
|
1665
|
+
left: auto !important;
|
|
1666
|
+
top: auto !important;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
.voxket-popup-trigger[data-position="bottom-left"] {
|
|
1670
|
+
bottom: 1rem !important;
|
|
1671
|
+
left: 1rem !important;
|
|
1672
|
+
right: auto !important;
|
|
1673
|
+
top: auto !important;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
.voxket-popup-trigger[data-position="top-right"] {
|
|
1677
|
+
top: 1rem !important;
|
|
1678
|
+
right: 1rem !important;
|
|
1679
|
+
left: auto !important;
|
|
1680
|
+
bottom: auto !important;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
.voxket-popup-trigger[data-position="top-left"] {
|
|
1684
|
+
top: 1rem !important;
|
|
1685
|
+
left: 1rem !important;
|
|
1686
|
+
right: auto !important;
|
|
1687
|
+
bottom: auto !important;
|
|
1688
|
+
}
|
|
1689
|
+
`,t=document.createElement("style");t.type="text/css",t.setAttribute("data-voxket-styles","true"),t.textContent=e,document.head.appendChild(t),Wa=!0}class he extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}class Rn extends Vs{constructor(n){super();ke(this,"config");ke(this,"room",null);ke(this,"pluginManager");ke(this,"rpcManager");ke(this,"isConnected",!1);ke(this,"currentSession",null);ke(this,"connectionState",H.ConnectionState.Disconnected);ke(this,"renderedComponents",new Map);ke(this,"textStreamHandlersRegistered",!1);ke(this,"currentAgentInfo",null);ke(this,"chatMessages",[]);ke(this,"isAgentConnected",!1);ke(this,"agentState","idle");bd(),this.config=n,this.pluginManager=new gd(this),this.rpcManager=new rb,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,o;this.isConnected=!1,(o=(r=this.config).onDisconnected)==null||o.call(r,n)}),this.on("connection.error",n=>{var r,o;(o=(r=this.config).onError)==null||o.call(r,n)}),this.on("chat.message.received",n=>{var r,o;this.addChatMessage(n),(o=(r=this.config).onMessageReceived)==null||o.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,o;(o=(r=this.config).onTranscriptionReceived)==null||o.call(r,n)}),this.on("session.state.changed",n=>{var r,o;(o=(r=this.config).onSessionStateChanged)==null||o.call(r,n)}),this.on("session.created",n=>{var r,o;(o=(r=this.config).onSessionStart)==null||o.call(r,n.id)}),this.on("session.ended",(n,r)=>{var o,s;(s=(o=this.config).onSessionEnd)==null||s.call(o,r)}),this.on("participant.joined",n=>{var r,o;(o=(r=this.config).onUserJoined)==null||o.call(r,n.id)}),this.on("participant.left",n=>{var r,o;(o=(r=this.config).onUserLeft)==null||o.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 H.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(H.RoomEvent.Connected,()=>{var n,r;this.connectionState=H.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 o;try{(o=this.room)!=null&&o.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(s){console.warn("VoxketClient: Failed to enable microphone after room connection:",s)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(H.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=H.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),n&&console.log("🔍 VoxketClient: Disconnect reason details:",{reason:n.toString(),currentSession:(r=this.currentSession)==null?void 0:r.id,agentConnected:this.isAgentConnected,connectionState:this.connectionState}),this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(H.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===H.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(H.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(H.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(r,o)=>{try{const s=await r.readAll(),i={id:`msg_${Date.now()}_${o.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:o.identity||"user",name:o.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",i)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("lk.transcription",async(r,o)=>{var s,i;try{const a=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let l="";const d=((s=this.currentAgentInfo)==null?void 0:s.name)||o.identity||"AI Assistant",u={id:a,content:"",timestamp:new Date,sender:{id:o.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",u);for await(const x of r){l+=x;const b=this.convertMarkdownToText(l),m={...u,content:b,metadata:{...u.metadata,streaming:!0}};this.emit("chat.message.updated",m)}const f=this.convertMarkdownToText(l),h={...u,content:f,metadata:{...u.metadata,streaming:!1}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Failed to process lk.transcription message:",a);try{const l=await r.readAll(),d=((i=this.currentAgentInfo)==null?void 0:i.name)||o.identity||"AI Assistant",u={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:l,timestamp:new Date,sender:{id:o.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",u)}catch(l){console.error("VoxketClient: Fallback failed for lk.transcription:",l)}}})}catch(r){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("suggested_response",async r=>{const o=await r.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(i){console.warn("VoxketClient: Failed to parse suggested_response:",i,o)}this.emit("suggested.response",s)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,o)=>{const s=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",s);let i={};try{i=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,s)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",i)),i.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",i)):i.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",i)):(i.new_state==="idle"||i.new_state==="listening")&&this.setAgentState("idle")})}catch(r){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("images",async(r,o)=>{try{const s=await r.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,o)=>{var s,i;try{const a=r.info,l={id:`img_${Date.now()}_${o.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:o.identity||"agent",name:o.identity||"Agent",type:o.identity===((i=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:i.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:a.name,fileSize:a.size,mimeType:a.mimeType,streamId:a.id,downloading:!0}};this.emit("chat.message.received",l),r.onProgress&&(r.onProgress=x=>{const b={...l,metadata:{...l.metadata,downloadProgress:x||0}};this.emit("chat.message.updated",b)});const d=[];for await(const x of r)d.push(x);const u=new Blob(d,{type:a.mimeType||"application/octet-stream"}),f=URL.createObjectURL(u),h={...l,metadata:{...l.metadata,downloading:!1,downloadProgress:1,downloadUrl:f,blob:u}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Error processing image attachment:",a)}})}catch(r){console.warn("VoxketClient: image handler already registered, skipping:",r)}["error","warning","status","system","debug","info"].forEach(r=>{try{this.room.registerTextStreamHandler(r,async(o,s)=>{try{const i=await o.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,i),r==="error"){let a={};try{a=typeof i=="string"?JSON.parse(i):i}catch{a={message:i}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:i,participantInfo:s})}catch(i){console.error(`VoxketClient: Failed to process '${r}' stream:`,i)}})}catch(o){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,o)}});try{this.room.registerTextStreamHandler("*",async(r,o)=>{var s;try{const i=await r.readAll(),a=((s=r.info)==null?void 0:s.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,i),this.emit("text.stream.unhandled",{topic:a,data:i,participantInfo:o})}catch(i){console.error("VoxketClient: Failed to process unhandled text stream:",i)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,o){const s=n||this.config.agentId||"default-agent",i=r||this.config.participantName||"User",a=o||this.config.modalities||["voice"];try{const l={agent_id:s,participant_name:i,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const d=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(l)});if(!d.ok){let h=`HTTP ${d.status}: Failed to fetch connection details`;try{const x=await d.json();x&&(x.error?h=`API Error: ${x.error}`:x.detail?h=`API Error: ${x.detail}`:x.message&&(h=`API Error: ${x.message}`))}catch{try{const b=await d.text();b&&(h=`API Error: ${b}`)}catch{}}throw new Error(h)}const u=await d.json();let f;return u.agent_info&&(f={id:u.agent_info.id||s,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(l){console.error("VoxketClient: fetchConnectionDetails failed:",l);const d=new he(`Failed to fetch connection details: ${l instanceof Error?l.message:"Unknown error"}`,"CONNECTION_FAILED",l);throw this.emit("connection.error",d),d}}async connect(n,r,o){var s;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,r,o);return await((s=this.room)==null?void 0:s.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new he(`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 H.Room,this.setupRoomEventListeners()}catch(r){const o=new he("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",o),o}}async createSession(n){var r,o,s,i;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),l={id:a.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:a.agentInfo||this.currentAgentInfo};if(this.currentSession=l,this.emit("session.created",l),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(d=>setTimeout(d,500)),(o=this.room)!=null&&o.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(d){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",d)}if((s=n.modalities)!=null&&s.includes("video"))try{await new Promise(d=>setTimeout(d,200)),(i=this.room)!=null&&i.localParticipant&&(console.log("🎥 VoxketClient: Attempting to enable camera for video session"),await this.room.localParticipant.setCameraEnabled(!0),this.emit("track.unmuted",{source:"camera",enabled:!0}),console.log("🎥 VoxketClient: Camera enabled successfully"))}catch(d){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",d)}return setTimeout(()=>{var d;this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state),this.forceAgentConnected(),console.log("🤖 VoxketClient: Session marked as active:",{sessionId:this.currentSession.id,modalities:this.currentSession.activeModalities,agentConnected:this.isAgentConnected,hasRoom:!!this.room,remoteParticipants:((d=this.room)==null?void 0:d.remoteParticipants.size)||0}))},1e3),l}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof he?a:a instanceof TypeError&&a.message.includes("fetch")?new he("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new he(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new he(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,r){const o={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(o)}async endSession(){var n,r;if(!this.currentSession)return null;try{const o={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,o),await this.disconnect(),o}catch(o){throw new he("Failed to end session","SESSION_NOT_FOUND",o)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getIsAgentConnected(){return this.isAgentConnected}forceAgentConnected(){this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent manually marked as connected"),this.emit("agent.connected",{forced:!0}))}getAgentState(){return this.agentState}setAgentState(n){this.agentState!==n&&(this.agentState=n,this.emit("agent.state.changed",{state:n}))}getAgentAudioTrack(){const n=this.getRemoteParticipants();for(const r of n){const o=r.getTrackPublication(H.Track.Source.Microphone);if(o!=null&&o.track)return{source:H.Track.Source.Microphone,participant:r,publication:o}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const o=r.getTrackPublication(H.Track.Source.Camera);if(o!=null&&o.track)return{source:H.Track.Source.Camera,participant:r,publication:o}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const s=r.getTrackPublication(H.Track.Source.Camera);s!=null&&s.track&&n.push({source:H.Track.Source.Camera,participant:r,publication:s});const i=r.getTrackPublication(H.Track.Source.ScreenShare);i!=null&&i.track&&n.push({source:H.Track.Source.ScreenShare,participant:r,publication:i})}const o=this.getRemoteParticipants();for(const s of o){const i=s.getTrackPublication(H.Track.Source.Camera);i!=null&&i.track&&n.push({source:H.Track.Source.Camera,participant:s,publication:i});const a=s.getTrackPublication(H.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:H.Track.Source.ScreenShare,participant:s,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===H.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===H.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(o=>o.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(o=>o.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,d,u;const r=this.resolveTarget(n.target||"body"),o=this.getTargetKey(r),s=this.renderedComponents.get(o);s&&s.target===r||this.removeUI(r);const i=(s==null?void 0:s.root)||Hd.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:((l=n.modality)==null?void 0:l.includes("chat"))!==!1,suportsVideoInput:((d=n.modality)==null?void 0:d.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};if(!i||typeof i.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{i.render(w.createElement(xd,{config:this.config,autoConnect:n.autoStart||!1,children:w.createElement(yd,a)}))}catch(f){throw console.error("Error rendering Voxket widget:",f),new Error(`Failed to render Voxket widget: ${f instanceof Error?f.message:"Unknown error"}`)}this.renderedComponents.set(o,{root:i,target:r})}removeUI(n){const r=n?this.resolveTarget(n):null;if(r){const o=this.getTargetKey(r),s=this.renderedComponents.get(o);s&&(s.root.unmount(),this.renderedComponents.delete(o),r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(a=>{try{a.remove()}catch(l){console.warn("Failed to remove element:",l)}}),r===document.body&&r.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(l=>{if(l.classList.contains("bg-black")&&l.classList.contains("backdrop-blur-sm"))try{l.remove()}catch(d){console.warn("Failed to remove fixed element:",d)}}))}}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(o){console.warn("Failed to remove overlay:",o)}})}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 o;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const s={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},i=await((o=this.room)==null?void 0:o.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",s)}catch(s){throw console.error("VoxketClient: Failed to send chat message:",s),new he("Failed to send message","NETWORK_ERROR",s)}}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 he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new he("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const o=n.filter(s=>s.type.startsWith("image/"));if(o.length===0)throw new he("Only image files are allowed","INVALID_PARAMETER");o.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const s=o.map(async(i,a)=>{const d={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",d);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:h=>{const x={...d,metadata:{...d.metadata,uploadProgress:h}};this.emit("chat.message.updated",x)}});try{const h=new FileReader,x=new Promise((y,C)=>{h.onload=()=>{typeof h.result=="string"?y(h.result):C(new Error("Failed to convert to base64"))},h.onerror=C});h.readAsDataURL(i);const m={type:"image",data:await x,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const x=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(x,{topic:"lk.chat",destinationIdentities:[]})}catch(x){console.warn("VoxketClient: Failed to send image notification to agent:",x)}}const f={...d,metadata:{...d.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",f),u});await Promise.all(s)}catch(s){throw console.error("VoxketClient: Failed to send attachments:",s),new he("Failed to send attachments","NETWORK_ERROR",s)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,o;try{const s=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,i=n??!s;await((o=this.room)==null?void 0:o.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle microphone:",s),new he("Failed to toggle microphone","PERMISSION_DENIED",s)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,o;try{const s=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,i=n??!s;await((o=this.room)==null?void 0:o.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle camera:",s),new he("Failed to toggle camera","PERMISSION_DENIED",s)}}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 he("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 he("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 he("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 he("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(o){throw new he("Failed to set audio input device","DEVICE_ERROR",o)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(o){throw new he("Failed to set video input device","DEVICE_ERROR",o)}}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 o=s=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(s));return{camera:o(1),microphone:o(2),screenShare:o(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===H.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===H.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===H.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===H.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 he("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 he("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,o="embedded"){return this.rpcManager.registerFrontendRPC(n,r,o)}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 o=>{try{const s=await o.readAll();r(s)}catch(s){console.error(`Error processing event for topic '${n}':`,s)}})}catch(o){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,o)}}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()}}function Lt({title:e,description:t}){console.error(`${e}: ${t}`)}const ob=ie.create($1),sb=ie.create(W1),ib=ie.create(Y1),ab=ie.create(J1);function lb({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const o={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},s=Ne(r);return c.jsx(ie.button,{onClick:e,className:`voxket-popup-trigger fixed ${o[n]} z-[9999] px-4 py-2 rounded-full shadow-lg ${s.popupTrigger} transition-all duration-200 hover:scale-105`,"data-position":n,style:{position:"fixed",zIndex:9999,...n==="bottom-right"&&{bottom:"1rem",right:"1rem",left:"auto",top:"auto"},...n==="bottom-left"&&{bottom:"1rem",left:"1rem",right:"auto",top:"auto"},...n==="top-right"&&{top:"1rem",right:"1rem",left:"auto",bottom:"auto"},...n==="top-left"&&{top:"1rem",left:"1rem",right:"auto",bottom:"auto"}},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 Ga({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:o="bottom-right",onExpand:s}){const i=Ne(t);if(n==="fullscreen")return c.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/40 bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",onClick:a=>{a.target===a.currentTarget&&r&&r()},children:c.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",onClick:a=>{a.stopPropagation()},children:[r&&c.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),r()},className:"absolute top-4 cursor-pointer right-4 z-[10000] 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:c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.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"})})}),c.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[c.jsx("div",{className:i.cardTopGradient}),c.jsx("div",{className:i.cardPurpleBlur}),c.jsx("div",{className:i.cardPinkBlur}),c.jsx("div",{className:" flex flex-col h-full w-full",children:e}),c.jsx("div",{className:i.cardPulse1}),c.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 c.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:c.jsxs("div",{className:`fixed rounded-2xl ${a[o]} pointer-events-auto`,children:[r&&c.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:"×"}),c.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[c.jsx("div",{className:i.cardPurpleBlur}),c.jsx("div",{className:i.cardPinkBlur}),c.jsx("div",{className:" flex flex-col h-full w-full",children:e}),c.jsx("div",{className:i.cardPulse1}),c.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return c.jsxs("div",{id:"voice-card",className:`theme-${t} ${i.card}`,style:{height:"100%",maxHeight:"100%"},children:[c.jsx("div",{className:i.cardTopGradient}),c.jsx("div",{className:i.cardPurpleBlur}),c.jsx("div",{className:i.cardPinkBlur}),e,c.jsx("div",{className:i.cardPulse1}),c.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function yd(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:o,appId:s,prompts:i,statusMessage:a,welcomeTitle:l,welcomeSubTitle:d,className:u,width:f,height:h,loadingText:x,suportsChatInput:b=!0,suportsVideoInput:m=!0,suportsScreenShare:y=!0,theme:C="vox",onSessionStart:v,onSessionEnd:T,enableSessionLogging:k=!0,onSessionLogsUpdate:S,onSessionMetricsUpdate:j,modalities:P=["voice"],displayType:A="widget",popupPosition:_="bottom-right",popupTriggerText:p="Open Chat",onPopupToggle:V,voxketClient:B,onDisplayTypeChange:G}=e,[te,ne]=g.useState(()=>B?!!B.getCurrentSession():!1),[oe,X]=g.useState(!1),[I,q]=g.useState(t||""),[M,z]=g.useState(n||"User"),[Q,W]=g.useState(()=>B?B.getCurrentSession():null),[U,E]=g.useState(()=>{var re,qe,We;if(B){const Se=B.getCurrentSession();if((re=Se==null?void 0:Se.activeModalities)!=null&&re.includes("chat"))return"chat";if((qe=Se==null?void 0:Se.activeModalities)!=null&&qe.includes("voice"))return"voice";if((We=Se==null?void 0:Se.activeModalities)!=null&&We.includes("video"))return"video"}return"welcome"}),[D,O]=g.useState(!1);g.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",A)},[A]),g.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:U,sessionStarted:te,loading:oe,currentSession:Q==null?void 0:Q.id,isPopupOpen:D})},[U,te,oe,Q,D]);const $=g.useMemo(()=>{if(B)return console.log("🔄 Using passed VoxketClient to preserve session state"),B;console.log("🆕 Creating new VoxketClient instance");const re={appId:s,appSecret:o,baseUrl:r,agentId:I,participantName:M||"User",modalities:P};return new Rn(re)},[B,s,o,r,I,M,P]),F=P,L=g.useMemo(()=>$.getRoom()||new H.Room,[$]),J={suportsChatInput:b,suportsVideoInput:m,suportsScreenShare:y},{sessionMetrics:R,sessionLogs:le,logEvent:xe}=md({room:L,onSessionStart:v,onSessionEnd:T,enableConsoleLogging:k,enableLocalStorage:k,voxketSessionId:Q==null?void 0:Q.id});g.useEffect(()=>{S&&S(le)},[le,S]),g.useEffect(()=>{j&&R&&j(R)},[R,j]),g.useEffect(()=>{const re=We=>{console.log("🔴 Room disconnected:",We),X(!1),ne(!1),W(null),E("welcome")},qe=We=>{console.log("📹 Media devices error:",We),Lt({title:"Allow access to your microphone/camera",description:`${We.name}: ${We.message}`})};return L.on(H.RoomEvent.MediaDevicesError,qe),L.on(H.RoomEvent.Disconnected,re),()=>{L.off(H.RoomEvent.Disconnected,re),L.off(H.RoomEvent.MediaDevicesError,qe)}},[L]);const pe=async()=>{try{console.log("🎤 Starting voice session...",{agentId:I,participantName:M}),console.log("🎤 Pre-start state:",{currentMode:U,sessionStarted:te,loading:oe}),X(!0),ne(!0),E("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VOICE_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",re.id),W(re),X(!1),v&&v(re.id)}catch(re){console.error("❌ Failed to start voice session:",re),Lt({title:"Failed to start voice session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},Re=async()=>{try{X(!0),ne(!0),E("chat"),xe("USER_STARTED_CHAT_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["chat"]});W(re),X(!1),v&&v(re.id)}catch(re){console.error("Failed to start chat session:",re),Lt({title:"Failed to start chat session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},tt=async()=>{try{console.log("📺 Starting video session...",{agentId:I,participantName:M}),console.log("📺 Pre-start state:",{currentMode:U,sessionStarted:te,loading:oe}),X(!0),ne(!0),E("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VIDEO_SESSION",{agentId:I,participantName:M});const re=await $.startSession(I,{participantName:M||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",re.id),W(re),X(!1),v&&v(re.id)}catch(re){console.error("❌ Failed to start video session:",re),Lt({title:"Failed to start video session",description:re instanceof Error?re.message:"Unknown error occurred"}),X(!1),ne(!1),E("welcome")}},dt=()=>{E("welcome"),G&&G(e.displayType||"widget"),Q&&te&&(ne(!1),W(null),$.disconnect()),A==="popup"&&!D&&O(!0)},an=()=>{const re=!D;O(re),V&&V(re),!re&&!(Q&&te)&&(E("welcome"),ne(!1),W(null))},Dd=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},$d=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const re=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");re&&re.requestFullscreen?re.requestFullscreen().catch(qe=>{console.warn("⚠️ Fullscreen API not supported or failed:",qe),Lt({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}):Lt({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}};g.useEffect(()=>{var re,qe,We;if(B&&$){console.log("🔄 Syncing widget state with existing client session state");const Se=$.getCurrentSession(),Fd=$.connected;console.log("🔍 Existing session state:",{hasSession:!!Se,sessionId:Se==null?void 0:Se.id,isConnected:Fd,activeModalities:Se==null?void 0:Se.activeModalities}),Se&&(console.log("✅ Restoring session state from existing client"),W(Se),ne(!0),X(!1),(re=Se.activeModalities)!=null&&re.includes("chat")?E("chat"):(qe=Se.activeModalities)!=null&&qe.includes("voice")?E("voice"):(We=Se.activeModalities)!=null&&We.includes("video")&&E("video"))}},[B,$]),g.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),B?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),$.disconnect())},[$,B]);let Tr="w-96",Ar="h-[25rem]",jr={};if(f&&(f.startsWith("w-")?Tr=f:(jr.width=f,Tr="")),h&&(h.startsWith("h-")?Ar=h:(jr.height=h,Ar="")),A==="popup"&&!D)return console.log("🟡 Showing popup trigger button"),c.jsx(lb,{onClick:an,text:p,position:_,theme:C});console.log("🟢 Rendering widget content, displayType:",A,"isPopupOpen:",D,"currentMode:",U,"sessionStarted:",te,"loading:",oe);let Pr=`voxket-widget-root theme-${C}`,Dn={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};A==="widget"?(Pr+=` flex items-center justify-center min-h-fit ${Tr} ${Ar} ${u}`,Dn={...Dn,...jr}):(Pr+=` ${u||""}`,Dn={});const Fs=c.jsx("div",{className:"h-full w-full flex flex-col overflow-hidden",children:c.jsxs(Wt,{mode:"wait",children:[U==="welcome"&&!oe&&c.jsx(ab,{agentId:I,participantName:M||"",onAgentIdChange:q,onParticipantNameChange:z,onStartCall:pe,onStartChat:Re,onStartVideo:tt,disabled:te||oe,prompts:i,statusMessage:a,title:l,subTitle:d,theme:C,modalities:F,displayType:A,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),U==="voice"&&c.jsxs(Ie.RoomContext.Provider,{value:L,children:[c.jsx(Ie.RoomAudioRenderer,{}),c.jsx(Ie.StartAudio,{label:"Start Audio"}),c.jsx(ob,{loadingText:x,participantName:M||"User",capabilities:J,sessionStarted:te,disabled:!te,theme:C,client:$,displayType:A,onBack:A==="popup"?an:dt,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),U==="chat"&&c.jsx(sb,{client:$,theme:C,displayType:A,onBack:A==="popup"?an:dt,onEndChat:dt,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),U==="video"&&c.jsxs(Ie.RoomContext.Provider,{value:L,children:[c.jsx(Ie.RoomAudioRenderer,{}),c.jsx(Ie.StartAudio,{label:"Start Audio"}),c.jsx(ib,{client:$,theme:C,displayType:A,onBack:A==="popup"?an:dt,onEndCall:dt,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return A==="fullscreen"||A==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",A),c.jsx(Ga,{theme:C,displayType:A,popupPosition:_,onClose:A==="fullscreen"?Dd:an,children:Fs})):(console.log("📦 Rendering widget mode"),c.jsx("div",{className:Pr,style:Dn,children:c.jsx(Ga,{theme:C,displayType:A,popupPosition:_,onExpand:$d,children:Fs})}))}class vd extends g.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 g.createElement(t,{error:this.state.error})}return g.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 cb({logs:e,onClear:t,onExport:n}){const[r,o]=w.useState(!1),[s,i]=w.useState(""),a=e.filter(l=>!s||l.event.toLowerCase().includes(s.toLowerCase()));return r?c.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:c.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[c.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[c.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"text",placeholder:"Filter events...",value:s,onChange:l=>i(l.target.value),className:"px-3 py-1 border rounded text-sm"}),c.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),c.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),c.jsx("button",{onClick:()=>o(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),c.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?c.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):c.jsx("div",{className:"space-y-2",children:a.map((l,d)=>c.jsxs("div",{className:"border rounded p-3 text-sm",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"font-semibold text-blue-600",children:l.event}),c.jsx("span",{className:"text-gray-500 text-xs",children:new Date(l.timestamp).toLocaleTimeString()})]}),l.sessionId&&c.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",l.sessionId]}),l.data&&c.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:c.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(l.data,null,2)})})]},d))})})]})}):c.jsxs("button",{onClick:()=>o(!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 db({metrics:e}){return e?c.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[c.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Session ID:"}),c.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Start Time:"}),c.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Messages:"}),c.jsx("div",{children:e.totalMessages})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Participants:"}),c.jsx("div",{children:e.participantCount})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),c.jsx("div",{children:e.connectionIssues})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-gray-600",children:"Duration:"}),c.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function Vt(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:o}=et(),s=w.useCallback(async(a,l)=>await r(a,l),[r]),i=w.useCallback(async()=>await o(),[o]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:s,stop:i}}function wd(){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 Sd(){const{setMicrophoneEnabled:e,client:t}=et(),[n,r]=w.useState(!1),[o,s]=w.useState(!1),i=w.useCallback(async()=>{if(!o){s(!0);try{const d=!n;await e(d),r(d)}catch(d){console.error("Failed to toggle microphone:",d)}finally{s(!1)}}},[n,o,e]),a=w.useCallback(async()=>{if(!(n||o)){s(!0);try{await e(!0),r(!0)}catch(d){console.error("Failed to enable microphone:",d)}finally{s(!1)}}},[n,o,e]),l=w.useCallback(async()=>{if(!(!n||o)){s(!0);try{await e(!1),r(!1)}catch(d){console.error("Failed to disable microphone:",d)}finally{s(!1)}}},[n,o,e]);return{isEnabled:n,isLoading:o,toggle:i,enable:a,disable:l}}function kd(){const{setCameraEnabled:e}=et(),[t,n]=w.useState(!1),[r,o]=w.useState(!1),s=w.useCallback(async()=>{if(!r){o(!0);try{const l=!t;await e(l),n(l)}catch(l){console.error("Failed to toggle camera:",l)}finally{o(!1)}}},[t,r,e]),i=w.useCallback(async()=>{if(!(t||r)){o(!0);try{await e(!0),n(!0)}catch(l){console.error("Failed to enable camera:",l)}finally{o(!1)}}},[t,r,e]),a=w.useCallback(async()=>{if(!(!t||r)){o(!0);try{await e(!1),n(!1)}catch(l){console.error("Failed to disable camera:",l)}finally{o(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:s,enable:i,disable:a}}function Cd(){const{startScreenShare:e,stopScreenShare:t}=et(),[n,r]=w.useState(!1),[o,s]=w.useState(!1),i=w.useCallback(async()=>{if(!(n||o)){s(!0);try{await e(),r(!0)}catch(d){console.error("Failed to start screen share:",d)}finally{s(!1)}}},[n,o,e]),a=w.useCallback(async()=>{if(!(!n||o)){s(!0);try{await t(),r(!1)}catch(d){console.error("Failed to stop screen share:",d)}finally{s(!1)}}},[n,o,t]),l=w.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:o,start:i,stop:a,toggle:l}}function ub(){const{client:e}=et(),[t,n]=w.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=w.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),o=w.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),s=w.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,r]),i=w.useCallback(async()=>{try{t.tracks.find(y=>y.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=w.useCallback(m=>{n(y=>({...y,layout:m}))},[]),l=w.useCallback(m=>{n(y=>({...y,pinnedTrack:m}))},[]),d=w.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=w.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),f=w.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),h=w.useCallback(m=>t.tracks.find(y=>y.id===m),[t.tracks]),x=w.useCallback(m=>t.tracks.filter(y=>y.participantId===m),[t.tracks]),b=w.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return w.useEffect(()=>{if(!e)return;const m=v=>{n(T=>({...T,tracks:[...T.tracks.filter(k=>k.id!==v.id),v]}))},y=v=>{n(T=>{var k;return{...T,tracks:T.tracks.filter(S=>S.id!==v),pinnedTrack:((k=T.pinnedTrack)==null?void 0:k.id)===v?void 0:T.pinnedTrack}})},C=v=>{n(T=>({...T,tracks:T.tracks.map(k=>k.id===v.id?v:k)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",y),e.on("videoTrackUpdated",C),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",y),e.off("videoTrackUpdated",C)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:o,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:s,toggleScreenShare:i,setLayout:a,pinTrack:l,unpinTrack:d,startRecording:u,stopRecording:f,getTrackById:h,getTracksByParticipant:x,isTrackActive:b}}function Er(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=et(),[r,o]=w.useState(!1),s=w.useCallback(async d=>{if(!(!d.trim()||r||!n)){o(!0);try{await t(d.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{o(!1)}}},[t,r,n]),{userMessages:i,agentMessages:a,allMessages:l}=w.useMemo(()=>{const d=e.filter(f=>f.sender.type==="participant"),u=e.filter(f=>f.sender.type==="agent");return{userMessages:d,agentMessages:u,allMessages:e}},[e]);return{messages:l,userMessages:i,agentMessages:a,messageCount:l.length,isSending:r,canSend:!!n&&!r,send:s}}function fb(){const{send:e,isSending:t,canSend:n}=Er(),[r,o]=w.useState(""),s=w.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),o("")}catch(a){throw a}},[r,e,n]),i=w.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s())},[s]);return{value:r,setValue:o,send:s,handleKeyPress:i,isSending:t,canSend:n&&r.trim().length>0}}function Rs(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:o}=et(),s=w.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),i=w.useCallback(async()=>{if(e)try{await o()}catch(a){throw console.error("Failed to disconnect:",a),a}},[o,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:s,disconnect:i}}function Ed(){const{participants:e}=et();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Td=w.createContext({}),In=()=>w.useContext(Td);function Ad({children:e,...t}){return c.jsx(Td.Provider,{value:t,children:e})}function Qn({name:e,children:t,fallback:n,className:r}){return c.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function jd(e,t={}){return Object.assign(e,t)}function Pd({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:o,className:s=""}){const i=Vt(),a=Sd(),l=kd(),d=Cd(),u=In(),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",s].filter(Boolean).join(" ");return!i.isActive&&!r?c.jsx("div",{className:f,children:c.jsx("div",{className:"voxket-controls-inactive",children:c.jsx("p",{children:"Controls available during active session"})})}):c.jsxs("div",{className:f,children:[r&&c.jsx("div",{className:"voxket-session-actions",children:i.isActive?c.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):c.jsx(hb,{})}),i.isActive&&c.jsxs("div",{className:"voxket-media-controls",children:[e&&c.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:[c.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&c.jsxs("button",{onClick:l.toggle,disabled:l.isLoading,className:`voxket-button voxket-button--media ${l.isEnabled?"voxket-button--active":""}`,title:l.isEnabled?"Stop camera":"Start camera",children:[c.jsx("span",{className:"voxket-icon",children:"📹"}),l.isLoading?"Loading...":l.isEnabled?"Stop Video":"Start Video"]}),n&&c.jsxs("button",{onClick:d.toggle,disabled:d.isLoading,className:`voxket-button voxket-button--media ${d.isSharing?"voxket-button--active":""}`,title:d.isSharing?"Stop screen share":"Start screen share",children:[c.jsx("span",{className:"voxket-icon",children:"🖥️"}),d.isLoading?"Loading...":d.isSharing?"Stop Share":"Share Screen"]})]}),o&&c.jsx("div",{className:"voxket-custom-controls",children:o})]})}function hb(){Vt();const[e,t]=w.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 c.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Is({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const o=Vt(),s=Rs(),i=In(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,r].filter(Boolean).join(" ");return c.jsxs("div",{className:a,children:[e&&c.jsxs("div",{className:"voxket-connection-status",children:[c.jsx("div",{className:`voxket-status-indicator ${s.isConnected?"connected":"disconnected"}`}),c.jsx("span",{className:"voxket-status-text",children:s.isConnecting?"Connecting...":s.isConnected?"Connected":"Disconnected"})]}),t&&o.session&&c.jsxs("div",{className:"voxket-session-info",children:[c.jsxs("div",{className:"voxket-session-id",children:["Session: ",o.session.id.slice(-8)]}),c.jsxs("div",{className:"voxket-session-state",children:["State: ",o.state]})]}),n&&o.session&&c.jsxs("div",{className:"voxket-agent-info",children:[c.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",o.session.agentId]}),c.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",o.session.activeModalities.join(", ")]})]}),s.error&&c.jsxs("div",{className:"voxket-error-message",children:["Error: ",s.error.message]})]})}function Ds({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const o=Vt(),s=Er(),i=In(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,r].filter(Boolean).join(" ");return o.isActive?c.jsx("div",{className:a,children:n||c.jsxs(c.Fragment,{children:[e&&c.jsxs("div",{className:"voxket-chat-container",children:[c.jsxs("div",{className:"voxket-chat-messages",children:[s.messages.map(l=>c.jsxs("div",{className:`voxket-message voxket-message--${l.sender.type}`,children:[c.jsxs("div",{className:"voxket-message-header",children:[c.jsx("span",{className:"voxket-message-sender",children:l.sender.name}),c.jsx("span",{className:"voxket-message-time",children:l.timestamp.toLocaleTimeString()})]}),c.jsx("div",{className:"voxket-message-content",children:l.content})]},l.id)),s.messages.length===0&&c.jsx("div",{className:"voxket-empty-messages",children:c.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),c.jsx(mb,{})]}),t&&c.jsx("div",{className:"voxket-transcriptions",children:c.jsx("div",{className:"voxket-transcription-placeholder",children:c.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):c.jsx("div",{className:a,children:c.jsx("div",{className:"voxket-inactive-state",children:c.jsxs("div",{className:"voxket-inactive-message",children:[c.jsx("h3",{children:"Start a conversation"}),c.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function mb(){const e=Er(),[t,n]=w.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(s){console.error("Failed to send message:",s)}},o=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),r())};return c.jsxs("div",{className:"voxket-chat-input",children:[c.jsx("input",{type:"text",value:t,onChange:s=>n(s.target.value),onKeyPress:o,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),c.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function $s({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:o=""}){const s=Vt(),i=wd(),a=Ed(),l=In(),d=["voxket-session-footer",`voxket-session-footer--${l.variant||"default"}`,`voxket-session-footer--${l.size||"md"}`,o].filter(Boolean).join(" ");return s.isActive?c.jsx("div",{className:d,children:r||c.jsxs(c.Fragment,{children:[n&&c.jsxs("div",{className:"voxket-session-status",children:[c.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),c.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&c.jsxs("div",{className:"voxket-session-metrics",children:[c.jsxs("div",{className:"voxket-metric",children:[c.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),c.jsx("span",{className:"voxket-metric-value",children:gb(i.duration||0)})]}),c.jsxs("div",{className:"voxket-metric",children:[c.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),c.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&c.jsxs("div",{className:"voxket-participants-info",children:[c.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&c.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>c.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):c.jsx("div",{className:d,children:c.jsx("div",{className:"voxket-footer-inactive",children:c.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function gb(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 pb({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:o,variant:s="default",size:i="md",theme:a,className:l="",children:d}){var x;const u=Vt(),f=Rs();w.useEffect(()=>{n&&e&&f.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,f.isConnected,u.isActive]),w.useEffect(()=>{var b;(b=u.session)!=null&&b.id&&r&&r(u.session.id)},[(x=u.session)==null?void 0:x.id,r]),w.useEffect(()=>()=>{u.isActive&&o&&u.stop().then(o).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${s}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",l].filter(Boolean).join(" ");return c.jsx(Ad,{variant:s,size:i,theme:a,className:l,children:c.jsx("div",{className:h,children:d||c.jsxs(c.Fragment,{children:[c.jsx(Qn,{name:"header",fallback:c.jsx(Is,{})}),c.jsx(Qn,{name:"content",fallback:c.jsx(Ds,{})}),c.jsx(Qn,{name:"footer",fallback:c.jsx($s,{})})]})})})}const Md=jd(pb,{Header:Is,Content:Ds,Footer:$s,Controls:Pd}),Pt={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)"}},Do={...Pt,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)"}},$o={...Pt,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"}},Vd=w.createContext(null),Nd=()=>{const e=w.useContext(Vd);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function xb({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:o=""}){const[s,i]=w.useState(()=>{const h={default:Pt,dark:Do,enterprise:$o,...t};return typeof e=="string"?h[e]||Pt:e}),[a,l]=w.useState(()=>({default:Pt,dark:Do,enterprise:$o,...t})),d=h=>{if(typeof h=="string"){const x=a[h];x&&i(x)}else i(h)},u=h=>{l(x=>({...x,[h.name]:h}))};w.useEffect(()=>{if(r&&typeof document<"u"){const h=document.documentElement;Object.entries(Rd(s)).forEach(([x,b])=>{h.style.setProperty(`--voxket-${x}`,b)})}},[s,r]);const f={theme:s,setTheme:d,themes:a,registerTheme:u};return c.jsx(Vd.Provider,{value:f,children:c.jsx("div",{className:`voxket-theme voxket-theme--${s.name} ${o}`,children:n})})}function Rd(e){const t={},n=(r,o="")=>{for(const[s,i]of Object.entries(r)){const a=o?`${o}-${s}`:s;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function bb(e=Pt,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 yb(e){var n;const{theme:t}=Nd();return((n=t.components)==null?void 0:n[e])||{}}const vb=Ns("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&wb(e),t.enableVoiceActivation&&Sb(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&kb(e,t)}});function wb(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 Sb(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function kb(e,t){console.log("Playing audio response:",t.content)}const Cb=Ns("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&Eb(),t.enableFileUpload&&Tb(e),t.enableCustomComponents&&Ab(),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"?jb(e,t):t.type==="text"&&n.enableRichText&&Pb(e,t)}});function Eb(e){console.log("Rich text support enabled")}function Tb(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function Ab(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",Mb),t.set("form",Vb),t.set("card",Nb),t.set("chart",Rb)}function jb(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 Pb(e,t){console.log("Processing rich text message:",t.content)}function Mb(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function Vb(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function Nb(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function Rb(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function er({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:o=!0,isPinned:s=!1,className:i="",onClick:a,onPin:l,onUnpin:d}){const u=w.useRef(null),[f,h]=w.useState(!1);w.useEffect(()=>{if(!u.current||!e.isEnabled)return;const y=u.current;return y.srcObject=null,()=>{y.srcObject&&(y.srcObject=null)}},[e]);const x=()=>{a==null||a(e)},b=y=>{y.stopPropagation(),s?d==null||d(e):l==null||l(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",s?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",f?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return c.jsxs("div",{className:m,onClick:x,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[c.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&c.jsxs("div",{className:"voxket-video-placeholder",children:[c.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),c.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),c.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&c.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),o&&!e.isEnabled&&c.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(f||s)&&c.jsxs("div",{className:"voxket-video-controls",children:[c.jsx("button",{className:`voxket-video-control-btn ${s?"voxket-video-control-btn--active":""}`,onClick:b,title:s?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&c.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&c.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&c.jsx("div",{className:"voxket-video-loading",children:c.jsx("div",{className:"voxket-spinner"})})]})}function Ib({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:o,maxVisibleTracks:s=9,showPagination:i=!0}){const[a,l]=w.useState(0),[d,u]=w.useState(null),f=w.useMemo(()=>{let v=[...e];t.type==="speaker"&&d&&(v=[d,...e.filter(S=>S.id!==d.id)]);const T=a*s,k=T+s;return v.slice(T,k)},[e,t,d,a,s]),h=Math.ceil(e.length/s),x=w.useMemo(()=>{const v=f.length;switch(t.type){case"grid":const T=Math.ceil(Math.sqrt(v)),k=Math.ceil(v/T);return{display:"grid",gridTemplateColumns:`repeat(${T}, 1fr)`,gridTemplateRows:`repeat(${k}, 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]),b=v=>{u(v)},m=()=>{u(null)},y=v=>{r==null||r({...t,type:v})},C=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${f.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?c.jsx("div",{className:"voxket-video-grid-empty",children:c.jsxs("div",{className:"voxket-video-grid-empty-content",children:[c.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),c.jsx("p",{children:"No video tracks available"})]})}):c.jsxs("div",{className:C,children:[c.jsxs("div",{className:"voxket-video-grid-controls",children:[c.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(v=>c.jsx("button",{className:`voxket-layout-btn ${t.type===v?"voxket-layout-btn--active":""}`,onClick:()=>y(v),title:`Switch to ${v} layout`,children:Db(v)},v))}),c.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),c.jsx("div",{className:"voxket-video-grid-content",style:x,children:t.type==="speaker"&&d?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"voxket-video-speaker-main",children:c.jsx(er,{track:d,participantName:`Participant ${d.participantId}`,isPinned:!0,onClick:o,onUnpin:m})}),c.jsx("div",{className:"voxket-video-speaker-sidebar",children:f.filter(v=>v.id!==d.id).map(v=>c.jsx(er,{track:v,participantName:`Participant ${v.participantId}`,showControls:!1,onClick:o,onPin:b},v.id))})]}):f.map(v=>c.jsx(er,{track:v,participantName:`Participant ${v.participantId}`,isPinned:(d==null?void 0:d.id)===v.id,onClick:o,onPin:b,onUnpin:m},v.id))}),i&&h>1&&c.jsxs("div",{className:"voxket-video-pagination",children:[c.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.max(0,a-1)),disabled:a===0,children:"←"}),c.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),c.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function Db(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function $b({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:o=!0,showCameraControls:s=!0,showScreenShareControls:i=!0,className:a=""}){const l=["voxket-video-controls",a].filter(Boolean).join(" "),d=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return c.jsxs("div",{className:l,children:[s&&c.jsxs("div",{className:"voxket-video-controls-section",children:[c.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),c.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:[c.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),c.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&c.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&c.jsxs("div",{className:"voxket-video-controls-section",children:[c.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),c.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:[c.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),c.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),o&&c.jsxs("div",{className:"voxket-video-controls-section",children:[c.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),c.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})=>c.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>d(u),title:`Switch to ${h} layout`,children:[c.jsx("span",{className:"voxket-control-icon",children:f}),c.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),c.jsxs("div",{className:"voxket-video-controls-section",children:[c.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),c.jsxs("div",{className:"voxket-video-settings",children:[c.jsxs("div",{className:"voxket-setting-group",children:[c.jsx("label",{className:"voxket-setting-label",children:"Quality"}),c.jsxs("select",{className:"voxket-setting-select",children:[c.jsx("option",{value:"high",children:"High (720p)"}),c.jsx("option",{value:"medium",children:"Medium (480p)"}),c.jsx("option",{value:"low",children:"Low (240p)"})]})]}),c.jsxs("div",{className:"voxket-setting-group",children:[c.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),c.jsxs("select",{className:"voxket-setting-select",children:[c.jsx("option",{value:"30",children:"30 fps"}),c.jsx("option",{value:"15",children:"15 fps"}),c.jsx("option",{value:"10",children:"10 fps"})]})]}),c.jsxs("div",{className:"voxket-setting-group",children:[c.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),c.jsxs("select",{className:"voxket-setting-select",children:[c.jsx("option",{value:"unlimited",children:"Unlimited"}),c.jsx("option",{value:"1000",children:"1 Mbps"}),c.jsx("option",{value:"500",children:"500 Kbps"}),c.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),c.jsxs("div",{className:"voxket-video-controls-section",children:[c.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),c.jsxs("div",{className:"voxket-video-stats",children:[c.jsxs("div",{className:"voxket-stat-item",children:[c.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),c.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),c.jsxs("div",{className:"voxket-stat-item",children:[c.jsx("span",{className:"voxket-stat-label",children:"Source:"}),c.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),c.jsxs("div",{className:"voxket-stat-item",children:[c.jsx("span",{className:"voxket-stat-label",children:"Status:"}),c.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 Id=({handler:e,loadData:t,data:n,client:r,addLocalMessage:o})=>{const[s,i]=g.useState(null),[a,l]=g.useState(!0),[d,u]=g.useState(!1),[f]=g.useState(Date.now());g.useEffect(()=>{(async()=>{try{if(l(!0),console.log("📋 AssignmentView: Loading assignment data..."),console.log("📋 AssignmentView: Received data from RPC:",n),n&&typeof n=="object"){const y={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(y),console.log("📋 AssignmentView: Assignment loaded from RPC data:",y)}}catch(y){console.error("📋 AssignmentView: Error loading assignment:",y),i({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{l(!1)}})()},[n,t]);const h=({message:m,assignment:y})=>{const C=m.toLowerCase().includes("declined"),v=C?"bg-red-50 border-red-200":"bg-green-50 border-green-200",T=C?"text-red-700":"text-green-700",k=C?"❌":"🎉";return c.jsxs("div",{className:`max-w-sm mx-auto ${v} border rounded-lg shadow p-3 flex flex-col items-center`,children:[c.jsx("div",{className:"text-2xl mb-2",children:k}),c.jsx("div",{className:`${T} font-semibold text-sm mb-1`,children:m}),c.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:y.title}),c.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},x=async()=>{if(!(!s||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,c.jsx(h,{message:"Assignment accepted!",assignment:s}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},b=async()=>{if(!(!s||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,c.jsx(h,{message:"Assignment declined",assignment:s}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?c.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:c.jsxs("div",{className:"flex items-center justify-center py-4",children:[c.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),c.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):s?c.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[c.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:s.title})})}),c.jsxs("div",{className:"p-3 text-black",children:[c.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:c.jsx("p",{className:"text-xs text-black leading-snug",children:s.description})}),c.jsx("div",{className:"mb-3 text-black",children:c.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[c.jsx("span",{className:"text-xs mr-1",children:"📅"}),c.jsxs("span",{children:["Est: ",s.estimated_time_of_completion]})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:x,disabled:d,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:d?c.jsxs("span",{className:"flex items-center justify-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),c.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),c.jsx("button",{onClick:b,disabled:d,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"})]})]})]}):c.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:c.jsxs("div",{className:"text-center py-4",children:[c.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),c.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function Fb(){const[e,t]=g.useState(null),[n,r]=g.useState([]);g.useEffect(()=>{const a=new Rn({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",l=>{console.log("RPC Method Called:",l)}),a.on("rpc.interaction.completed",l=>{console.log("RPC Interaction Completed:",l)}),()=>{a.disconnect()}},[]);const o=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Id,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},s=async()=>{if(!e)return;const a=({handler:l,timeout:d})=>{const[u,f]=g.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"}],x=m=>{f(m)},b=()=>{const m=h.find(y=>y.id===u);l==null||l.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return c.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[c.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),c.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),c.jsx("div",{className:"space-y-3 mb-6",children:h.map(m=>c.jsx("div",{onClick:()=>x(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-medium",children:m.name}),c.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),c.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),c.jsxs("div",{className:"flex justify-end space-x-3",children:[c.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),c.jsx("button",{onClick:b,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),d&&c.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",d," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const l=e.getRegisteredRpcMethods();r(l),console.log("✅ Product Recommendation RPC registered successfully")}catch(l){console.error("❌ Failed to register product recommendation RPC:",l)}},i=async()=>{if(!e)return;const a=({handler:l})=>{const[d,u]=g.useState(0),[f,h]=g.useState(""),x=()=>{l==null||l.didSuccess({rating:d,comment:f,timestamp:new Date().toISOString()})};return c.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[c.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),c.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(b=>c.jsx("button",{onClick:()=>u(b),className:`text-2xl ${b<=d?"text-yellow-400":"text-gray-300"}`,children:"⭐"},b))})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),c.jsx("textarea",{value:f,onChange:b=>h(b.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),c.jsxs("div",{className:"flex justify-end space-x-2",children:[c.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),c.jsx("button",{onClick:x,disabled:d===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 l=e.getRegisteredRpcMethods();r(l),console.log("✅ Feedback RPC registered successfully")}catch(l){console.error("❌ Failed to register feedback RPC:",l)}};return c.jsxs("div",{className:"p-6",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),c.jsxs("div",{className:"space-y-4 mb-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),c.jsxs("div",{className:"space-x-2",children:[c.jsx("button",{onClick:o,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),c.jsx("button",{onClick:s,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),c.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?c.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>c.jsx("li",{className:"text-gray-700",children:c.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):c.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),c.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[c.jsxs("li",{children:["Register RPC methods with React components using ",c.jsx("code",{children:"client.registerFrontendRPC()"})]}),c.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),c.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),c.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),c.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),c.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),c.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),c.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
|
|
1379
1690
|
const response = await participant.performRpc({
|
|
1380
1691
|
method: 'give_assignment',
|
|
1381
1692
|
data: JSON.stringify({
|
|
@@ -1386,4 +1697,4 @@ const response = await participant.performRpc({
|
|
|
1386
1697
|
})
|
|
1387
1698
|
});
|
|
1388
1699
|
|
|
1389
|
-
console.log('User response:', response);`})]})]})}const
|
|
1700
|
+
console.log('User response:', response);`})]})]})}const Ob={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}),o=JSON.parse(r);return console.log("✅ Agent: Received user response:",o),await this.processAssignmentResponse(o),o}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"}}}};bd();const Lb=e=>typeof window>"u"?null:g.createElement(vd,{children:g.createElement(yd,e)});exports.AssignmentView=Id;exports.CompoundProvider=Ad;exports.InteractiveComponent=Xt;exports.PluginManager=gd;exports.RpcExamples=Fb;exports.SessionContainer=Md;exports.SessionContent=Ds;exports.SessionControls=Pd;exports.SessionFooter=$s;exports.SessionHeader=Is;exports.SessionLogViewer=cb;exports.SessionMetricsComponent=db;exports.Slot=Qn;exports.ThemeProvider=xb;exports.VideoControls=$b;exports.VideoGrid=Ib;exports.VideoTile=er;exports.VoxketClient=Rn;exports.VoxketErrorBoundary=vd;exports.VoxketEventEmitter=Vs;exports.VoxketProvider=xd;exports.VoxketSDK=Rn;exports.VoxketSessionComponent=Md;exports.agentRpcExample=Ob;exports.analyticsPlugin=eb;exports.chatModalityPlugin=Cb;exports.createCustomTheme=bb;exports.createModalityPlugin=Ns;exports.createPlugin=Q1;exports.darkTheme=Do;exports.debugPlugin=tb;exports.default=Lb;exports.defaultTheme=Pt;exports.enterpriseTheme=$o;exports.flattenTheme=Rd;exports.metricsPlugin=nb;exports.useComponentTheme=yb;exports.useCompoundContext=In;exports.useSessionLogging=md;exports.useTheme=Nd;exports.useVoxket=et;exports.useVoxketCamera=kd;exports.useVoxketChat=Er;exports.useVoxketChatInput=fb;exports.useVoxketConnection=Rs;exports.useVoxketMetrics=wd;exports.useVoxketMicrophone=Sd;exports.useVoxketParticipants=Ed;exports.useVoxketScreenShare=Cd;exports.useVoxketSession=Vt;exports.useVoxketVideo=ub;exports.voiceModalityPlugin=vb;exports.withCompoundComponent=jd;
|