@voxket-ai/voxket-live 1.1.0 → 1.1.1

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 CHANGED
@@ -6,7 +6,7 @@
6
6
  ${p}px !important;
7
7
  top: ${u}px !important;
8
8
  }
9
- `),()=>{m.contains(g)&&m.removeChild(g)}},[t]),h.jsx(Yy,{isPresent:t,childRef:o,sizeRef:s,children:P.cloneElement(e,{ref:o})})}const Xy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=Wa(Qy),u=N.useId();let d=!0,f=N.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),N.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[n]),P.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Zy,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(No.Provider,{value:f,children:e})};function Qy(){return new Map}function dh(e=!0){const t=N.useContext(No);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=N.useId();N.useEffect(()=>{if(e)return i(o)},[e]);const s=N.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Li=e=>e.key||"";function jc(e){const t=[];return N.Children.forEach(e,n=>{N.isValidElement(n)&&t.push(n)}),t}const Tr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=dh(s),d=N.useMemo(()=>jc(e),[e]),f=s&&!c?[]:d.map(Li),p=N.useRef(!0),g=N.useRef(d),m=Wa(()=>new Map),[v,y]=N.useState(d),[E,w]=N.useState(d);vf(()=>{p.current=!1,g.current=d;for(let _=0;_<E.length;_++){const R=Li(E[_]);f.includes(R)?m.delete(R):m.get(R)!==!0&&m.set(R,!1)}},[E,f.length,f.join("-")]);const C=[];if(d!==v){let _=[...d];for(let R=0;R<E.length;R++){const A=E[R],O=Li(A);f.includes(O)||(_.splice(R,0,A),C.push(A))}return o==="wait"&&C.length&&(_=C),w(jc(_)),y(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.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}=N.useContext(Ha);return h.jsx(h.Fragment,{children:E.map(_=>{const R=Li(_),A=s&&!c?!1:d===E||f.includes(R),O=()=>{if(m.has(R))m.set(R,!0);else return;let b=!0;m.forEach(M=>{M||(b=!1)}),b&&(S==null||S(),w(g.current),s&&(u==null||u()),r&&r())};return h.jsx(Xy,{isPresent:A,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:A?void 0:O,anchorX:a,children:_},R)})})},fh=N.createContext({strict:!1}),Bc={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"]},Nr={};for(const e in Bc)Nr[e]={isEnabled:t=>Bc[e].some(n=>!!t[n])};function Jy(e){for(const t in e)Nr[t]={...Nr[t],...e[t]}}const e0=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 go(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||e0.has(e)}let hh=e=>!go(e);function t0(e){typeof e=="function"&&(hh=t=>t.startsWith("on")?!go(t):e(t))}try{t0(require("@emotion/is-prop-valid").default)}catch{}function n0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(hh(i)||n===!0&&go(i)||!t&&!go(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Ao=N.createContext({});function Mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const ml=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gl=["initial",...ml];function Ro(e){return Mo(e.animate)||gl.some(t=>ci(e[t]))}function ph(e){return!!(Ro(e)||e.variants)}function r0(e,t){if(Ro(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function i0(e){const{initial:t,animate:n}=r0(e,N.useContext(Ao));return N.useMemo(()=>({initial:t,animate:n}),[$c(t),$c(n)])}function $c(e){return Array.isArray(e)?e.join(" "):e}const ui={};function o0(e){for(const t in e)ui[t]=e[t],el(t)&&(ui[t].isCSSVariable=!0)}function mh(e,{layout:t,layoutId:n}){return Pr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ui[e]||e==="opacity")}const s0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},a0=Or.length;function l0(e,t,n){let r="",i=!0;for(let o=0;o<a0;o++){const s=Or[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=oh(a,dl[s]);if(!l){i=!1;const u=s0[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function bl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Pr.has(l)){s=!0;continue}else if(el(l)){i[l]=c;continue}else{const u=oh(c,dl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=l0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const yl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gh(e,t,n){for(const r in t)!At(t[r])&&!mh(r,n)&&(e[r]=t[r])}function c0({transformTemplate:e},t){return N.useMemo(()=>{const n=yl();return bl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function u0(e,t){const n=e.style||{},r={};return gh(r,n,e),Object.assign(r,c0(e,t)),r}function d0(e,t){const n={},r=u0(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 f0={offset:"stroke-dashoffset",array:"stroke-dasharray"},h0={offset:"strokeDashoffset",array:"strokeDasharray"};function p0(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?f0:h0;e[o.offset]=ke.transform(-r);const s=ke.transform(t),a=ke.transform(n);e[o.array]=`${s} ${a}`}function bh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(bl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&p0(d,i,o,s,!1)}const yh=()=>({...yl(),attrs:{}}),xh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m0(e,t,n,r){const i=N.useMemo(()=>{const o=yh();return bh(o,t,xh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};gh(o,e.style,e),i.style={...o,...i.style}}return i}const g0=["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 xl(e){return typeof e!="string"||e.includes("-")?!1:!!(g0.indexOf(e)>-1||/[A-Z]/u.test(e))}function b0(e,t,n,{latestValues:r},i,o=!1){const a=(xl(e)?m0:d0)(t,r,i,e),l=n0(t,typeof e=="string",o),c=e!==N.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=N.useMemo(()=>At(u)?u.get():u,[u]);return N.createElement(e,{...c,children:d})}function Vc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vl(e,t,n,r){if(typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function ro(e){return At(e)?e.get():e}function y0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:x0(n,r,i,e),renderState:t()}}function x0(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ro(o[f]);let{initial:s,animate:a}=e;const l=Ro(e),c=ph(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!Mo(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const g=vl(e,f[p]);if(g){const{transitionEnd:m,transition:v,...y}=g;for(const E in y){let w=y[E];if(Array.isArray(w)){const C=u?w.length-1:0;w=w[C]}w!==null&&(i[E]=w)}for(const E in m)i[E]=m[E]}}}return i}const vh=e=>(t,n)=>{const r=N.useContext(Ao),i=N.useContext(No),o=()=>y0(e,t,r,i);return n?o():Wa(o)};function wl(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(At(r[s])||t.style&&At(t.style[s])||mh(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const v0=vh({scrapeMotionValuesFromProps:wl,createRenderState:yl});function wh(e,t,n){const r=wl(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const o=Or.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const w0=vh({scrapeMotionValuesFromProps:wh,createRenderState:yh}),E0=Symbol.for("motionComponentSymbol");function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k0(e,t,n){return N.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xr(n)&&(n.current=r))},[t])}const El=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),S0="framerAppearId",Eh="data-"+El(S0),kh=N.createContext({});function C0(e,t,n,r,i){var m,v;const{visualElement:o}=N.useContext(Ao),s=N.useContext(fh),a=N.useContext(No),l=N.useContext(pl).reducedMotion,c=N.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=N.useContext(kh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&_0(c.current,n,i,d);const f=N.useRef(!1);N.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[Eh],g=N.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return vf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),g.current=!1),u.enteringChildren=void 0)}),u}function _0(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&xr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Sh(e){if(e)return e.options.allowProjection!==!1?e.projection:Sh(e.parent)}function ds(e,{forwardMotionProps:t=!1}={},n,r){n&&Jy(n);const i=xl(e)?w0:v0;function o(a,l){let c;const u={...N.useContext(pl),...a,layoutId:T0(a)},{isStatic:d}=u,f=i0(a),p=i(a,d);if(!d&&Ga){N0(u,n);const g=A0(u);c=g.MeasureLayout,f.visualElement=C0(e,p,u,r,g.ProjectionNode)}return h.jsxs(Ao.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,b0(e,a,k0(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=N.forwardRef(o);return s[E0]=e,s}function T0({layoutId:e}){const t=N.useContext(Ha).id;return t&&e!==void 0?t+"-"+e:e}function N0(e,t){const n=N.useContext(fh).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?Rr(!1,r,"lazy-strict-mode"):kn(!1,r,"lazy-strict-mode")}}function A0(e){const{drag:t,layout:n}=Nr;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 M0(e,t){if(typeof Proxy>"u")return ds;const n=new Map,r=(o,s)=>ds(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Xa(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,ds(s,void 0,e,t)),n.get(s))})}function Ch({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function R0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function I0(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 fs(e){return e===void 0||e===1}function ma({scale:e,scaleX:t,scaleY:n}){return!fs(e)||!fs(t)||!fs(n)}function Gn(e){return ma(e)||_h(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _h(e){return Uc(e.x)||Uc(e.y)}function Uc(e){return e&&e!=="0%"}function bo(e,t,n){const r=e-n,i=t*r;return n+i}function zc(e,t,n,r,i){return i!==void 0&&(e=bo(e,i,r)),bo(e,n,r)+t}function ga(e,t=0,n=1,r,i){e.min=zc(e.min,t,n,r,i),e.max=zc(e.max,t,n,r,i)}function Th(e,{x:t,y:n}){ga(e.x,t.translate,t.scale,t.originPoint),ga(e.y,n.translate,n.scale,n.originPoint)}const Hc=.999999999999,Wc=1.0000000000001;function O0(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&wr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Th(e,s)),r&&Gn(o.latestValues)&&wr(e,o.latestValues))}t.x<Wc&&t.x>Hc&&(t.x=1),t.y<Wc&&t.y>Hc&&(t.y=1)}function vr(e,t){e.min=e.min+t,e.max=e.max+t}function Gc(e,t,n,r,i=.5){const o=at(e.min,e.max,i);ga(e,t,n,o,r)}function wr(e,t){Gc(e.x,t.x,t.scaleX,t.scale,t.originX),Gc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nh(e,t){return Ch(I0(e.getBoundingClientRect(),t))}function P0(e,t,n){const r=Nh(e,n),{scroll:i}=t;return i&&(vr(r.x,i.offset.x),vr(r.y,i.offset.y)),r}const Kc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Er=()=>({x:Kc(),y:Kc()}),qc=()=>({min:0,max:0}),ft=()=>({x:qc(),y:qc()}),ba={current:null},Ah={current:!1};function D0(){if(Ah.current=!0,!!Ga)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ba.current=e.matches;e.addEventListener("change",t),t()}else ba.current=!1}const L0=new WeakMap;function F0(e,t,n){for(const r in t){const i=t[r],o=n[r];if(At(i))e.addValue(r,i);else if(At(o))e.addValue(r,_r(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,_r(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Yc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class j0{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=cl,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 f=Bt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,it.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Ro(n),this.isVariantNode=ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&At(p)&&p.set(l[f])}}mount(t){var n;this.current=t,L0.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,i)=>this.bindToMotionValue(i,r)),Ah.current||D0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ba.current,process.env.NODE_ENV!=="production"&&Xa(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(),Pn(this.notifyUpdate),Pn(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=Pr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&it.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nr){const n=Nr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ft()}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<Yc.length;r++){const i=Yc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=F0(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=_r(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"&&(wf(r)||kf(r))?r=parseFloat(r):!qy(r)&&Dn.test(n)&&(r=ih(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=vl(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Za),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fl.render(this.render)}}class Mh extends j0{constructor(){super(...arguments),this.KeyframeResolver=Ly}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;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rh(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function B0(e){return window.getComputedStyle(e)}class $0 extends Mh{constructor(){super(...arguments),this.type="html",this.renderInstance=Rh}readValueFromInstance(t,n){var r;if(Pr.has(n))return(r=this.projection)!=null&&r.isProjecting?la(n):ey(t,n);{const i=B0(t),o=(el(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nh(t,n)}build(t,n,r){bl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return wl(t,n,r)}}const Ih=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 V0(e,t,n,r){Rh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ih.has(i)?i:El(i),t.attrs[i])}class U0 extends Mh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ft}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pr.has(n)){const r=rh(n);return r&&r.default||0}return n=Ih.has(n)?n:El(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wh(t,n,r)}build(t,n,r){bh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){V0(t,n,r,i)}mount(t){this.isSVGTag=xh(t.tagName),super.mount(t)}}const z0=(e,t)=>xl(e)?new U0(t):new $0(t,{allowProjection:e!==N.Fragment});function kr(e,t,n){const r=e.getProps();return vl(r,t,n!==void 0?n:r.custom,e)}const ya=e=>Array.isArray(e);function H0(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_r(n))}function W0(e){return ya(e)?e[e.length-1]||0:e}function G0(e,t){const n=kr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=W0(o[s]);H0(e,s,a)}}function K0(e){return!!(At(e)&&e.add)}function xa(e,t){const n=e.getValue("willChange");if(K0(n))return n.add(t);if(!n&&Sn.WillChange){const r=new Sn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Oh(e){return e.props[Eh]}const q0=e=>e!==null;function Y0(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(q0),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Z0={type:"spring",stiffness:500,damping:25,restSpeed:10},X0=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q0={type:"keyframes",duration:.8},J0={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(e,{keyframes:t})=>t.length>2?Q0:Pr.has(e)?e.startsWith("scale")?X0(t[1]):Z0:J0;function tx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kl=(e,t,n,r={},i,o)=>s=>{const a=ul(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-on(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};tx(a)||Object.assign(u,ex(e,u)),u.duration&&(u.duration=on(u.duration)),u.repeatDelay&&(u.repeatDelay=on(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ha(u),u.delay===0&&(d=!0)),(Sn.instantAnimations||Sn.skipAnimations)&&(d=!0,ha(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=Y0(u.keyframes,a);if(f!==void 0){it.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new ll(u):new ky(u)};function nx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ph(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&nx(c,u))continue;const p={delay:n,...ul(o||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Oh(e);if(y){const E=window.MotionHandoffAnimation(y,u,it);E!==null&&(p.startTime=E,m=!0)}}xa(e,u),d.start(kl(u,d,f,e.shouldReduceMotion&&eh.has(u)?{type:!1}:p,e,m));const v=d.animation;v&&l.push(v)}return s&&Promise.all(l).then(()=>{it.update(()=>{s&&G0(e,s)})}),l}function Dh(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function va(e,t,n={}){var l;const r=kr(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Ph(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return rx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function rx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(va(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Dh(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ix(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>va(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=va(e,t,n);else{const i=typeof t=="function"?kr(e,t,n.custom):t;r=Promise.all(Ph(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lh(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 ox=gl.length;function Fh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Fh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ox;n++){const r=gl[n],i=e.props[r];(ci(i)||i===!1)&&(t[r]=i)}return t}const sx=[...ml].reverse(),ax=ml.length;function lx(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ix(e,n,r)))}function cx(e){let t=lx(e),n=Zc(),r=!0;const i=l=>(c,u)=>{var f;const d=kr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:g,...m}=d;c={...c,...m,...g}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Fh(e.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let v=0;v<ax;v++){const y=sx[v],E=n[y],w=c[y]!==void 0?c[y]:u[y],C=ci(w),S=y===l?E.isActive:null;S===!1&&(g=v);let _=w===u[y]&&w!==c[y]&&C;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),E.protectedKeys={...p},!E.isActive&&S===null||!w&&!E.prevProp||Mo(w)||typeof w=="boolean")continue;const R=ux(E.prevProp,w);let A=R||y===l&&E.isActive&&!_&&C||v>g&&C,O=!1;const b=Array.isArray(w)?w:[w];let M=b.reduce(i(y),{});S===!1&&(M={});const{prevResolvedValues:I={}}=E,F={...I,...M},D=X=>{A=!0,f.has(X)&&(O=!0,f.delete(X)),E.needsAnimating[X]=!0;const $=e.getValue(X);$&&($.liveStyle=!1)};for(const X in F){const $=M[X],U=I[X];if(p.hasOwnProperty(X))continue;let x=!1;ya($)&&ya(U)?x=!Lh($,U):x=$!==U,x?$!=null?D(X):f.add(X):$!==void 0&&f.has(X)?D(X):E.protectedKeys[X]=!0}E.prevProp=w,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(A=!1);const G=_&&R;A&&(!G||O)&&d.push(...b.map(X=>{const $={type:y};if(typeof X=="string"&&r&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,x=kr(U,X);if(U.enteringChildren&&x){const{delayChildren:B}=x.transition||{};$.delay=Dh(U.enteringChildren,e,B)}}return{animation:X,options:$}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const y=kr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const E=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),v[y]=E??null}),d.push({animation:v})}let m=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Zc(),r=!0}}}function ux(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lh(t,e):!1}function zn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zc(){return{animate:zn(!0),whileInView:zn(),whileHover:zn(),whileTap:zn(),whileDrag:zn(),whileFocus:zn(),exit:zn()}}class jn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dx extends jn{constructor(t){super(t),t.animationState||(t.animationState=cx(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mo(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 fx=0;class hx extends jn{constructor(){super(...arguments),this.id=fx++}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 i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 px={animation:{Feature:dx},exit:{Feature:hx}};function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vi(e){return{point:{x:e.pageX,y:e.pageY}}}const mx=e=>t=>hl(t)&&e(t,vi(t));function Jr(e,t,n,r){return di(e,t,mx(n),r)}const jh=1e-4,gx=1-jh,bx=1+jh,Bh=.01,yx=0-Bh,xx=0+Bh;function Dt(e){return e.max-e.min}function vx(e,t,n){return Math.abs(e-t)<=n}function Xc(e,t,n,r=.5){e.origin=r,e.originPoint=at(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=at(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gx&&e.scale<=bx||isNaN(e.scale))&&(e.scale=1),(e.translate>=yx&&e.translate<=xx||isNaN(e.translate))&&(e.translate=0)}function ei(e,t,n,r){Xc(e.x,t.x,n.x,r?r.originX:void 0),Xc(e.y,t.y,n.y,r?r.originY:void 0)}function Qc(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function wx(e,t,n){Qc(e.x,t.x,n.x),Qc(e.y,t.y,n.y)}function Jc(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function ti(e,t,n){Jc(e.x,t.x,n.x),Jc(e.y,t.y,n.y)}function Yt(e){return[e("x"),e("y")]}const $h=({current:e})=>e?e.ownerDocument.defaultView:null,eu=(e,t)=>Math.abs(e-t);function Ex(e,t){const n=eu(e.x,t.x),r=eu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Vh{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 f=ps(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=Ex(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=f,{timestamp:v}=Tt;this.history.push({...m,timestamp:v});const{onStart:y,onMove:E}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=hs(p,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ps(f.type==="pointercancel"?this.lastMoveEventInfo:hs(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,y),m&&m(f,y)},!hl(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=vi(t),l=hs(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Tt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,ps(l,this.history)),this.removeListeners=bi(Jr(this.contextWindow,"pointermove",this.handlePointerMove),Jr(this.contextWindow,"pointerup",this.handlePointerUp),Jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Pn(this.updatePoint)}}function hs(e,t){return t?{point:t(e.point)}:e}function tu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ps({point:e},t){return{point:e,delta:tu(e,Uh(t)),offset:tu(e,kx(t)),velocity:Sx(t,.1)}}function kx(e){return e[0]}function Uh(e){return e[e.length-1]}function Sx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Uh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>on(t)));)n--;if(!r)return{x:0,y:0};const o=hn(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Cx(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?at(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?at(n,e,r.max):Math.min(e,n)),e}function nu(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 _x(e,{top:t,left:n,bottom:r,right:i}){return{x:nu(e.x,n,i),y:nu(e.y,t,r)}}function ru(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 Tx(e,t){return{x:ru(e.x,t.x),y:ru(e.y,t.y)}}function Nx(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=si(t.min,t.max-r,e.min):r>i&&(n=si(e.min,e.max-i,t.min)),En(0,1,n)}function Ax(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 wa=.35;function Mx(e=wa){return e===!1?e=0:e===!0&&(e=wa),{x:iu(e,"left","right"),y:iu(e,"top","bottom")}}function iu(e,t,n){return{min:ou(e,t),max:ou(e,n)}}function ou(e,t){return typeof e=="number"?e:e[t]||0}const Rx=new WeakMap;class Ix{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=ft(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$y(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yt(y=>{let E=this.getAxisMotionValue(y).get()||0;if(pn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[y];C&&(E=Dt(C)*(parseFloat(E)/100))}}this.originPoint[y]=E}),m&&it.postRender(()=>m(d,f)),xa(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(g&&this.currentDirection===null){this.currentDirection=Ox(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Yt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Vh(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:$h(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&it.postRender(()=>a(r,i))}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:i}=this.getProps();if(!r||!Fi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=Cx(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&xr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_x(r.layoutBox,t):this.constraints=!1,this.elastic=Mx(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ax(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xr(t))return!1;const r=t.current;kn(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:i}=this.visualElement;if(!i||!i.layout)return!1;const o=P0(r,i.root,this.visualElement.getTransformPagePoint());let s=Tx(i.layout.layoutBox,o);if(n){const a=n(R0(s));this.hasMutatedConstraints=!!a,a&&(s=Ch(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Yt(u=>{if(!Fi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xa(this.visualElement,t),r.start(kl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yt(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(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yt(n=>{const{drag:r}=this.getProps();if(!Fi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-at(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=Nx({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yt(s=>{if(!Fi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(at(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const t=this.visualElement.current,n=Jr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),it.read(r);const s=di(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Yt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=wa,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Fi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ox(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Px extends jn{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new Ix(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const su=e=>(t,n)=>{e&&it.postRender(()=>e(t,n))};class Dx extends jn{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new Vh(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$h(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:su(t),onStart:su(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&it.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Jr(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 io={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function au(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=au(e,t.target.x),r=au(e,t.target.y);return`${n}% ${r}%`}},Lx={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Dn.parse(e);if(i.length>5)return r;const o=Dn.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=at(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let ms=!1;class Fx extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;o0(jx),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),io.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,ms=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||it.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),fl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ms=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zh(e){const[t,n]=dh(),r=N.useContext(Ha);return h.jsx(Fx,{...e,layoutGroup:r,switchLayoutGroup:N.useContext(kh),isPresent:t,safeToRemove:n})}const jx={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:Lx};function Bx(e,t,n){const r=At(e)?e:_r(e);return r.start(kl("",r,t,n)),r.animation}const $x=(e,t)=>e.depth-t.depth;class Vx{constructor(){this.children=[],this.isDirty=!1}add(t){Ka(this.children,t),this.isDirty=!0}remove(t){qa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($x),this.isDirty=!1,this.children.forEach(t)}}function Ux(e,t){const n=Bt.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Pn(r),e(o-t))};return it.setup(r,!0),()=>Pn(r)}const Hh=["TopLeft","TopRight","BottomLeft","BottomRight"],zx=Hh.length,lu=e=>typeof e=="string"?parseFloat(e):e,cu=e=>typeof e=="number"||ke.test(e);function Hx(e,t,n,r,i,o){i?(e.opacity=at(0,n.opacity??1,Wx(r)),e.opacityExit=at(t.opacity??1,0,Gx(r))):o&&(e.opacity=at(t.opacity??1,n.opacity??1,r));for(let s=0;s<zx;s++){const a=`border${Hh[s]}Radius`;let l=uu(t,a),c=uu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||cu(l)===cu(c)?(e[a]=Math.max(at(lu(l),lu(c),r),0),(pn.test(c)||pn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=at(t.rotate||0,n.rotate||0,r))}function uu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Wx=Wh(0,.5,Rf),Gx=Wh(.5,.95,Qt);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(si(e,t,r))}function du(e,t){e.min=t.min,e.max=t.max}function qt(e,t){du(e.x,t.x),du(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function hu(e,t,n,r,i){return e-=t,e=bo(e,1/n,r),i!==void 0&&(e=bo(e,1/i,r)),e}function Kx(e,t=0,n=1,r=.5,i,o=e,s=e){if(pn.test(t)&&(t=parseFloat(t),t=at(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=at(o.min,o.max,r);e===o&&(a-=t),e.min=hu(e.min,t,n,a,i),e.max=hu(e.max,t,n,a,i)}function pu(e,t,[n,r,i],o,s){Kx(e,t[n],t[r],t[i],t.scale,o,s)}const qx=["x","scaleX","originX"],Yx=["y","scaleY","originY"];function mu(e,t,n,r){pu(e.x,t,qx,n?n.x:void 0,r?r.x:void 0),pu(e.y,t,Yx,n?n.y:void 0,r?r.y:void 0)}function gu(e){return e.translate===0&&e.scale===1}function Gh(e){return gu(e.x)&&gu(e.y)}function bu(e,t){return e.min===t.min&&e.max===t.max}function Zx(e,t){return bu(e.x,t.x)&&bu(e.y,t.y)}function yu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Kh(e,t){return yu(e.x,t.x)&&yu(e.y,t.y)}function xu(e){return Dt(e.x)/Dt(e.y)}function vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Xx{constructor(){this.members=[]}add(t){Ka(this.members,t),t.scheduleRender()}remove(t){if(qa(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(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!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 Qx(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}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 gs=["","X","Y","Z"],Jx=1e3;let ev=0;function bs(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Oh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qh(r)}function Yh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=ev++,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(rv),this.nodes.forEach(av),this.nodes.forEach(lv),this.nodes.forEach(iv)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 Vx)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Za),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=uh(s)&&!Gy(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;it.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=Ux(f,250),io.hasAnimatedSinceResize&&(io.hasAnimatedSinceResize=!1,this.nodes.forEach(ku)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||hv,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Kh(this.targetLayout,p),E=!d&&f;if(this.options.layoutRoot||this.resumeFrom||E||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...ul(g,"layout"),onPlay:m,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,E)}else d||ku(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pn(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(cv),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Eu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sv),this.nodes.forEach(tv),this.nodes.forEach(nv)):this.nodes.forEach(Eu),this.clearAllSnapshots();const a=Bt.now();Tt.delta=En(0,1e3/60,a-Tt.timestamp),Tt.timestamp=a,Tt.isProcessing=!0,os.update.process(Tt),os.preRender.process(Tt),os.render.process(Tt),Tt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ov),this.sharedNodes.forEach(uv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(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 s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ft(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Gn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),pv(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return ft();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(mv))){const{scroll:u}=this.root;u&&(vr(a.x,u.offset.x),vr(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=ft();if(qt(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&qt(a,s),vr(a.x,d.offset.x),vr(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=ft();qt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Gn(u.latestValues)&&wr(l,u.latestValues)}return Gn(this.latestValues)&&wr(l,this.latestValues),l}removeTransform(s){const a=ft();qt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Gn(c.latestValues))continue;ma(c.latestValues)&&c.updateSnapshot();const u=ft(),d=c.measurePageBox();qt(u,d),mu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Gn(this.latestValues)&&mu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Tt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Tt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),ti(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ft(),this.targetWithTransforms=ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qt(this.target,this.layout.layoutBox),Th(this.target,this.targetDelta)):qt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),ti(this.relativeTargetOrigin,this.target,p.target),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ma(this.parent.latestValues)||_h(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 g;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Tt.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||u))return;qt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;O0(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ft());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),ei(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!vu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Er(),this.projectionDelta=Er(),this.projectionDeltaWithTransform=Er()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Er();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=ft(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,v=this.getStack(),y=!v||v.members.length<=1,E=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(fv));this.animationProgress=0;let w;this.mixTargetDelta=C=>{const S=C/1e3;Su(d.x,s.x,S),Su(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dv(this.relativeTarget,this.relativeTargetOrigin,f,S),w&&Zx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=ft()),qt(w,this.relativeTarget)),m&&(this.animationValues=u,Hx(u,c,this.latestValues,S,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Pn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{io.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_r(0)),this.currentAnimation=Bx(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Zh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ft();const d=Dt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Dt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}qt(a,l),wr(a,u),ei(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Xx),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&bs("z",s,c,this.animationValues);for(let u=0;u<gs.length;u++)bs(`rotate${gs[u]}`,s,c,this.animationValues),bs(`skew${gs[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Gn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Qx(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in ui){if(u[g]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:y}=ui[g],E=d==="none"?u[g]:m(u[g],c);if(v){const w=v.length;for(let C=0;C<w;C++)s[v[C]]=E}else y?this.options.visualElement.renderState.vars[g]=E:s[g]=E}this.options.layoutId&&(s.pointerEvents=c===this?ro(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(wu),this.root.sharedNodes.clear()}}}function tv(e){e.updateLayout()}function nv(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:i}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(f);f.min=r[d].min,f.max=f.min+p}):Zh(o,t.layoutBox,r)&&Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=Er();ei(a,r,t.layoutBox);const l=Er();s?ei(l,e.applyTransform(i,!0),t.measuredBox):ei(l,r,t.layoutBox);const c=!Gh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=ft();ti(g,t.layoutBox,f.layoutBox);const m=ft();ti(m,r,p.layoutBox),Kh(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function rv(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 iv(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ov(e){e.clearSnapshot()}function wu(e){e.clearMeasurements()}function Eu(e){e.isLayoutDirty=!1}function sv(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ku(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function av(e){e.resolveTargetDelta()}function lv(e){e.calcProjection()}function cv(e){e.resetSkewAndRotation()}function uv(e){e.removeLeadSnapshot()}function Su(e,t,n){e.translate=at(t.translate,0,n),e.scale=at(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cu(e,t,n,r){e.min=at(t.min,n.min,r),e.max=at(t.max,n.max,r)}function dv(e,t,n,r){Cu(e.x,t.x,n.x,r),Cu(e.y,t.y,n.y,r)}function fv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hv={duration:.45,ease:[.4,0,.1,1]},_u=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Tu=_u("applewebkit/")&&!_u("chrome/")?Math.round:Qt;function Nu(e){e.min=Tu(e.min),e.max=Tu(e.max)}function pv(e){Nu(e.x),Nu(e.y)}function Zh(e,t,n){return e==="position"||e==="preserve-aspect"&&!vx(xu(t),xu(n),.2)}function mv(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const gv=Yh({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ys={current:void 0},Xh=Yh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ys.current){const e=new gv({});e.mount(window),e.setOptions({layoutScroll:!0}),ys.current=e}return ys.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),bv={pan:{Feature:Dx},drag:{Feature:Px,ProjectionNode:Xh,MeasureLayout:zh}};function Au(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&it.postRender(()=>o(t,vi(t)))}class yv extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=Vy(t,(n,r)=>(Au(this.node,r,"Start"),i=>Au(this.node,i,"End"))))}unmount(){}}class xv extends jn{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=bi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mu(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 i="onTap"+(n==="End"?"":n),o=r[i];o&&it.postRender(()=>o(t,vi(t)))}class vv extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=Wy(t,(n,r)=>(Mu(this.node,r,"Start"),(i,{success:o})=>Mu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ea=new WeakMap,xs=new WeakMap,wv=e=>{const t=Ea.get(e.target);t&&t(e)},Ev=e=>{e.forEach(wv)};function kv({root:e,...t}){const n=e||document;xs.has(n)||xs.set(n,{});const r=xs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ev,{root:e,...t})),r[i]}function Sv(e,t,n){const r=kv(t);return Ea.set(e,n),r.observe(e),()=>{Ea.delete(e),r.unobserve(e)}}const Cv={some:0,all:1};class _v extends jn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Cv[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Sv(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tv(t,n))&&this.startObserver()}unmount(){}}function Tv({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Nv={inView:{Feature:_v},tap:{Feature:vv},focus:{Feature:xv},hover:{Feature:yv}},Av={layout:{ProjectionNode:Xh,MeasureLayout:zh}},Mv={...px,...Nv,...bv,...Av},De=M0(Mv,z0);function Rv(e){const[t,n]=N.useState(()=>e.getLocalParticipant()),[r,i]=N.useState(()=>e.getMicrophoneTrack());return N.useEffect(()=>{const o=()=>{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),i(l)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function oo(e,t,n){const[r,i]=N.useState(!1),[o,s]=N.useState(!1);return N.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};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:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function Iv(e){const[t,n]=N.useState(()=>e.getRoom()),[r,i]=N.useState(()=>e.getConnectionState());return N.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function Sl(e){const[t,n]=N.useState(()=>e.getIsAgentConnected()),[r,i]=N.useState(()=>e.getCurrentSession()),[o,s]=N.useState(()=>e.getCurrentAgentInfo()),[a,l]=N.useState(()=>e.getAgentState()),[c,u]=N.useState(()=>e.getAgentAudioTrack()),[d,f]=N.useState(()=>e.getAgentVideoTrack());return N.useEffect(()=>{const p=()=>{const C=e.getIsAgentConnected(),S=e.getCurrentSession(),_=e.getCurrentAgentInfo(),R=e.getAgentState(),A=e.getAgentAudioTrack(),O=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:C,hasSession:!!S,sessionId:S==null?void 0:S.id,sessionState:S==null?void 0:S.state,hasAgentInfo:!!_,agentState:R,hasAudioTrack:!!A,hasVideoTrack:!!O}),n(C),i(S),s(_),l(R),u(A),f(O)};p();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},E=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()},w=()=>{console.log("🎵 useVoxketVoiceAssistant: Track subscribed event - updating audio/video tracks"),p()};return e.on("agent.connected",g),e.on("agent.speaking",g),e.on("agent.thinking",g),e.on("agent.state.changed",E),e.on("connection.disconnected",m),e.on("session.created",v),e.on("session.ended",v),e.on("session.state.changed",v),e.on("connection.connected",y),e.on("media.track.subscribed",w),e.on("media.track.unsubscribed",w),()=>{e.off("agent.connected",g),e.off("agent.speaking",g),e.off("agent.thinking",g),e.off("agent.state.changed",E),e.off("connection.disconnected",m),e.off("session.created",v),e.off("session.ended",v),e.off("session.state.changed",v),e.off("connection.connected",y),e.off("media.track.subscribed",w),e.off("media.track.unsubscribed",w)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function Ov(e){const[t,n]=N.useState(()=>e.getVideoTrackRefs()),[r,i]=N.useState(()=>e.getCameraTrackRefs()),[o,s]=N.useState(()=>e.getScreenShareTrackRefs());return N.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),s(d)};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 c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{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",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}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:o}}const Cl="-",Pv=e=>{const t=Lv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Cl);return a[0]===""&&a.length!==1&&a.shift(),Qh(a,t)||Dv(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Qh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Qh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Cl);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Ru=/^\[(.+)\]$/,Dv=e=>{if(Ru.test(e)){const t=Ru.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lv=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ka(n[i],r,i,t);return r},ka=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Iu(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Fv(i)){ka(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ka(s,Iu(t,o),n,r)})})},Iu=(e,t)=>{let n=e;return t.split(Cl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fv=e=>e.isThemeGetter,jv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Sa="!",Ca=":",Bv=Ca.length,$v=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let m=i[g];if(s===0&&a===0){if(m===Ca){o.push(i.slice(l,g)),l=g+Bv;continue}if(m==="/"){c=g;continue}}m==="["?s++:m==="]"?s--:m==="("?a++:m===")"&&a--}const u=o.length===0?i:i.substring(l),d=Vv(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+Ca,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Vv=e=>e.endsWith(Sa)?e.substring(0,e.length-1):e.startsWith(Sa)?e.substring(1):e,Uv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},zv=e=>({cache:jv(e.cacheSize),parseClassName:$v(e),sortModifiers:Uv(e),...Pv(e)}),Hv=/\s+/,Wv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Hv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,y=r(v?g.substring(0,m):g);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const E=o(f).join(":"),w=p?E+Sa:E,C=w+y;if(s.includes(C))continue;s.push(C);const S=i(y,v);for(let _=0;_<S.length;++_){const R=S[_];s.push(w+R)}l=u+(l.length>0?" "+l:l)}return l};function Gv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jh(t))&&(r&&(r+=" "),r+=n);return r}const Jh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jh(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kv(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=zv(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Wv(l,n);return i(l,u),u}return function(){return o(Gv.apply(null,arguments))}}const Et=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qv=/^\d+\/\d+$/,Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zv=/\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$/,Xv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>qv.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),An=e=>!!e&&Number.isInteger(Number(e)),vs=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),yn=e=>Yv.test(e),ew=()=>!0,tw=e=>Zv.test(e)&&!Xv.test(e),np=()=>!1,nw=e=>Qv.test(e),rw=e=>Jv.test(e),iw=e=>!fe(e)&&!he(e),ow=e=>Dr(e,op,np),fe=e=>ep.test(e),Hn=e=>Dr(e,sp,tw),ws=e=>Dr(e,uw,Pe),Ou=e=>Dr(e,rp,np),sw=e=>Dr(e,ip,rw),ji=e=>Dr(e,ap,nw),he=e=>tp.test(e),Ur=e=>Lr(e,sp),aw=e=>Lr(e,dw),Pu=e=>Lr(e,rp),lw=e=>Lr(e,op),cw=e=>Lr(e,ip),Bi=e=>Lr(e,ap,!0),Dr=(e,t,n)=>{const r=ep.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lr=(e,t,n=!1)=>{const r=tp.exec(e);return r?r[1]?t(r[1]):n:!1},rp=e=>e==="position"||e==="percentage",ip=e=>e==="image"||e==="url",op=e=>e==="length"||e==="size"||e==="bg-size",sp=e=>e==="length",uw=e=>e==="number",dw=e=>e==="family-name",ap=e=>e==="shadow",fw=()=>{const e=Et("color"),t=Et("font"),n=Et("text"),r=Et("font-weight"),i=Et("tracking"),o=Et("leading"),s=Et("breakpoint"),a=Et("container"),l=Et("spacing"),c=Et("radius"),u=Et("shadow"),d=Et("inset-shadow"),f=Et("text-shadow"),p=Et("drop-shadow"),g=Et("blur"),m=Et("perspective"),v=Et("aspect"),y=Et("ease"),E=Et("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...C(),he,fe],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],A=()=>[he,fe,l],O=()=>[or,"full","auto",...A()],b=()=>[An,"none","subgrid",he,fe],M=()=>["auto",{span:["full",An,he,fe]},An,he,fe],I=()=>[An,"auto",he,fe],F=()=>["auto","min","max","fr",he,fe],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],ie=()=>["auto",...A()],X=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[e,he,fe],U=()=>[...C(),Pu,Ou,{position:[he,fe]}],x=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",lw,ow,{size:[he,fe]}],K=()=>[vs,Ur,Hn],k=()=>["","none","full",c,he,fe],Y=()=>["",Pe,Ur,Hn],te=()=>["solid","dashed","dotted","double"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[Pe,vs,Pu,Ou],W=()=>["","none",g,he,fe],ue=()=>["none",Pe,he,fe],Q=()=>["none",Pe,he,fe],ve=()=>[Pe,he,fe],L=()=>[or,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yn],breakpoint:[yn],color:[ew],container:[yn],"drop-shadow":[yn],ease:["in","out","in-out"],font:[iw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yn],shadow:[yn],spacing:["px",Pe],text:[yn],"text-shadow":[yn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,fe,he,v]}],container:["container"],columns:[{columns:[Pe,fe,he,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[An,"auto",he,fe]}],basis:[{basis:[or,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,or,"auto","initial","none",fe]}],grow:[{grow:["",Pe,he,fe]}],shrink:[{shrink:["",Pe,he,fe]}],order:[{order:[An,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],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:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"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:[s]},...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,Ur,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,ws]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vs,fe]}],"font-family":[{font:[aw,fe,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:[i,he,fe]}],"line-clamp":[{"line-clamp":[Pe,"none",he,ws]}],leading:[{leading:[o,...A()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",he,Hn]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Pe,"auto",he,fe]}],"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",he,fe]}],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",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:x()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},An,he,fe],radial:["",he,fe],conic:[An,he,fe]},cw,sw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,he,fe]}],"outline-w":[{outline:["",Pe,Ur,Hn]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",u,Bi,ji]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",d,Bi,ji]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Pe,Hn]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,Bi,ji]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Pe,he,fe]}],"mix-blend":[{"mix-blend":[...j(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":j()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:x()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:W()}],brightness:[{brightness:[Pe,he,fe]}],contrast:[{contrast:[Pe,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",p,Bi,ji]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Pe,he,fe]}],"hue-rotate":[{"hue-rotate":[Pe,he,fe]}],invert:[{invert:["",Pe,he,fe]}],saturate:[{saturate:[Pe,he,fe]}],sepia:[{sepia:["",Pe,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Pe,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,he,fe]}],"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",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",he,fe]}],ease:[{ease:["linear","initial",y,he,fe]}],delay:[{delay:[Pe,he,fe]}],animate:[{animate:["none",E,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,he,fe]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",he,fe]}],"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",he,fe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Pe,Ur,Hn,ws]}],stroke:[{stroke:["none",...$()]}],"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"]}},hw=Kv(fw);function Ue(...e){return hw(za.clsx(e))}function Io(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function pw(e,t){return e.capabilities[t]===!0}function Oo(e){return e.sessionSettings.session_timer||null}function lp(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function cp(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function up(e){return{...e.capabilities}}function dp(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const fp=N.forwardRef(({state:e,audioTrack:t,className:n},r)=>{var a,l,c,u,d;const i=N.useRef(null),[o,s]=N.useState(!1);return N.useEffect(()=>{i.current&&(console.log("🔊 AgentTile: Audio element created:",{autoplay:i.current.autoplay,muted:i.current.muted,volume:i.current.volume,readyState:i.current.readyState,paused:i.current.paused}),s(!0))},[t]),N.useEffect(()=>{const f=i.current;if(!f)return;const p=()=>console.log("▶️ AgentTile: Audio started playing"),g=()=>console.log("⏸️ AgentTile: Audio paused"),m=()=>console.log("⏹️ AgentTile: Audio ended"),v=w=>console.error("❌ AgentTile: Audio error:",w),y=()=>console.log("⏳ AgentTile: Audio load started"),E=()=>console.log("✅ AgentTile: Audio can play");return f.addEventListener("play",p),f.addEventListener("pause",g),f.addEventListener("ended",m),f.addEventListener("error",v),f.addEventListener("loadstart",y),f.addEventListener("canplay",E),()=>{f.removeEventListener("play",p),f.removeEventListener("pause",g),f.removeEventListener("ended",m),f.removeEventListener("error",v),f.removeEventListener("loadstart",y),f.removeEventListener("canplay",E)}},[o]),console.log("🎤 AgentTile render:",{state:e,hasAudioTrack:!!t,trackSource:t==null?void 0:t.source,participantId:(a=t==null?void 0:t.participant)==null?void 0:a.identity,publicationMuted:(l=t==null?void 0:t.publication)==null?void 0:l.isMuted,audioElementReady:o,trackMediaStreamTrack:(d=(u=(c=t==null?void 0:t.publication)==null?void 0:c.track)==null?void 0:u.mediaStreamTrack)==null?void 0:d.readyState}),h.jsxs("div",{ref:r,className:Ue("",n),children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Ot.AudioTrack,{ref:i,trackRef:t,volume:1}),h.jsx(Ot.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Ue("flex aspect-video w-40 items-center justify-center gap-1.5"),children:h.jsx("span",{className:Ue(["bg-white/90 min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-white","data-[lk-muted=true]:bg-white/30"])})})]}),!t&&h.jsx("div",{className:Ue("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1.5",children:Array.from({length:5}).map((f,p)=>h.jsx("span",{className:Ue(["bg-white/70 min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-white",e==="thinking"&&"animate-pulse bg-white/50"])},p))})})})]})});fp.displayName="AgentTile";const mw=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:Ue(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:Ue(t),children:h.jsx(Ot.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},gw=P.forwardRef(function({trackRef:t,className:n,...r},i){var o,s;return h.jsx("div",{ref:i,className:Ue("bg-muted overflow-hidden rounded-md",n),children:h.jsx(Ot.VideoTrack,{trackRef:t,width:((o=t==null?void 0:t.publication.dimensions)==null?void 0:o.width)??0,height:((s=t==null?void 0:t.publication.dimensions)==null?void 0:s.height)??0,className:Ue("h-full w-auto"),...r})})}),Du=De.create(gw),bw=De.create(fp),yw=De.create(mw),xn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},sr={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","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 xw(e,t){const{localParticipant:n}=Rv(t),r=n==null?void 0:n.getTrackPublication(e);return N.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function vw({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:i="idle",audioTrack:o,videoTrack:s}=t?Sl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null};console.log("🎨 MediaTiles render:",{chatOpen:e,isAgentActive:n,hasSession:!!r,sessionState:r==null?void 0:r.state,agentState:i,hasAudioTrack:!!o,hasVideoTrack:!!s});const[a]=Ot.useTracks([le.Track.Source.ScreenShare]),l=xw(le.Track.Source.Camera,t),c=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,d=c||u,f=n||r&&r.state==="active",p={...xn.transition,delay:e?0:.15},g={...xn.animate,scale:e?1:3,transition:p},m={...xn.animate,transition:p},v=p,y=p,E=s&&s.publication&&s.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:Ue(sr.grid),children:[f&&h.jsx("div",{className:Ue(["grid",!e&&sr.agentChatClosed,e&&d&&sr.agentChatOpenWithSecondTile,e&&!d&&sr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!E&&h.jsx(bw,{layoutId:"agent",...xn,animate:g,transition:v,state:i,audioTrack:o||void 0,className:Ue(e?"h-[90px]":"h-auto w-full")},"agent"),E&&s&&h.jsx(yw,{layoutId:"avatar",...xn,animate:m,transition:y,videoTrack:s,className:Ue(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:Ue(["grid",e&&sr.secondTileChatOpen,!e&&sr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&c&&h.jsx(Du,{layout:"position",layoutId:"camera",...xn,trackRef:l,transition:{...xn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&h.jsx(Du,{layout:"position",layoutId:"screen",...xn,trackRef:a,transition:{...xn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const ww={card:"text-gray-100 bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] border border-gray-800/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-black/90 via-black/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(75,85,99,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-gray-500/[0.12] via-gray-600/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-gray-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] rounded-3xl shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-100 font-semibold",secondary:"text-gray-200",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-300 via-gray-200 to-gray-300"},micButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 text-gray-100 font-bold hover:bg-gray-900 hover:border-gray-600 hover:scale-[1.02] hover:shadow-2xl hover:shadow-gray-600/30 focus:outline-none focus:ring-2 focus:ring-gray-600 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-gray-900/60 backdrop-blur-xl rounded-2xl text-center text-gray-200 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-700/50 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-gray-400 rounded-full animate-pulse shadow-lg shadow-gray-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-700/50 rounded-3xl py-4 flex flex-col justify-end h-full bg-gray-900/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-gray-900/80 backdrop-blur-xl border-gray-700/50 shadow-xl",textarea:"bg-gray-900/60 border border-gray-700/30 rounded-xl text-gray-100 placeholder-gray-400 font-medium px-4 py-3",sendButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 disabled:border-gray-800 disabled:opacity-40 text-gray-100 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-gray-600/30",attachButton:"text-gray-400 hover:text-gray-200 hover:bg-gray-700/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/40 hover:border-red-500/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-gray-800/70 text-gray-100 backdrop-blur-md shadow-lg border border-gray-700/50",other:"bg-gray-900/60 text-gray-100 border border-gray-700/50 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-gray-900/80 border-gray-700/50 backdrop-blur-xl shadow-xl",backButton:"text-gray-300 hover:text-gray-100 hover:bg-gray-700/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-900/70 text-gray-200 border-gray-700/50 backdrop-blur-md hover:bg-gray-800/80 hover:border-gray-600 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] text-gray-100",header:"border-gray-700/50 bg-gray-900/80 backdrop-blur-xl shadow-xl",headerButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-gray-900 via-gray-900/90 to-gray-900/60 backdrop-blur-xl border-t border-gray-700/50 shadow-2xl",controlEnabled:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 hover:shadow-xl hover:shadow-gray-600/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-900/50 hover:bg-gray-900/60 text-gray-500 border border-gray-800 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/50 hover:border-red-500/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-gray-900/70 border border-gray-700/50 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-900/60 text-gray-300",avatar:"bg-gray-800/80 text-gray-300 border-2 border-gray-700/50",nameOverlay:"bg-gradient-to-t from-gray-900 via-gray-900/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Ew={card:"text-gray-900 bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] border border-gray-200/80 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-white/90 via-white/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(59,130,246,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-blue-400/[0.12] via-purple-400/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-pink-400/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] rounded-3xl shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-900 font-semibold",secondary:"text-gray-800",muted:"text-gray-600",accent:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-blue-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",chatButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-green-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",videoButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",popupTrigger:"bg-black/90 backdrop-blur-xl border-2 border-black/80 text-white font-bold hover:bg-black hover:border-black hover:scale-[1.02] hover:shadow-2xl hover:shadow-blue-500/30 focus:outline-none focus:ring-2 focus:ring-black focus:ring-offset-2 focus:ring-offset-white transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/60 backdrop-blur-xl rounded-2xl text-center text-gray-900 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-300/80 ",statusIndicator:"w-2.5 h-2.5 bg-green-500 rounded-full animate-pulse shadow-lg shadow-green-500/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-300/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-white/80 backdrop-blur-xl border-gray-300/80 shadow-xl",textarea:"bg-white/60 border border-gray-300/50 rounded-xl text-gray-900 placeholder-gray-500 font-medium px-4 py-3",sendButton:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 disabled:border-gray-200 disabled:opacity-40 text-gray-900 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-blue-500/20",attachButton:"text-gray-600 hover:text-gray-900 hover:bg-gray-100/50 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-blue-50/70 text-gray-900 backdrop-blur-md shadow-lg border border-blue-200/80",other:"bg-white/60 text-gray-900 border border-gray-300/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-white/80 border-gray-300/80 backdrop-blur-xl shadow-xl",backButton:"text-gray-600 hover:text-gray-900 hover:bg-gray-100/50 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white/70 text-blue-700 border-gray-300/80 backdrop-blur-md hover:bg-white/80 hover:border-blue-300 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] text-gray-900",header:"border-gray-300/80 bg-white/80 backdrop-blur-xl shadow-xl",headerButton:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 text-gray-900 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-green-500 animate-pulse shadow-lg shadow-green-500/60",controlsBackground:"bg-gradient-to-t from-white via-white/90 to-white/60 backdrop-blur-xl border-t border-gray-300/80 shadow-2xl",controlEnabled:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 text-gray-900 hover:scale-105 hover:shadow-xl hover:shadow-blue-500/20 transition-all duration-300 font-semibold",controlDisabled:"bg-white/50 hover:bg-white/60 text-gray-400 border border-gray-200 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-white/70 border border-gray-300/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-white/60 text-gray-700",avatar:"bg-gray-100/80 text-gray-700 border-2 border-gray-300/80",nameOverlay:"bg-gradient-to-t from-white via-white/80 to-transparent text-gray-900 backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},kw={card:" text-white bg-gradient-to-b from-[#121212] via-[#1a1a1a] to-[#121212] border border-white/[0.12] w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#0a0a0a]/90 via-[#0a0a0a]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(99,102,241,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-indigo-500/[0.12] via-purple-500/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-violet-500/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#121212] via-[#1a1a1a] to-[#121212] rounded-3xl shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300"},micButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-indigo-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-pink-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-black/90 backdrop-blur-xl border-2 border-white/30 text-white font-bold hover:bg-black hover:border-white/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-indigo-500/30 focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-black/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-white/20 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-white/[0.15] rounded-3xl py-4 flex flex-col justify-end h-full bg-black/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-black/80 backdrop-blur-xl border-white/20 shadow-xl",textarea:"bg-black/60 border border-white/10 rounded-xl text-white placeholder-white/50 font-medium px-4 py-3",sendButton:"bg-black/90 hover:bg-black border-2 border-white/30 hover:border-white/50 disabled:border-white/10 disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-indigo-500/30",attachButton:"text-white/70 hover:text-white hover:bg-white/10 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-black/70 text-white backdrop-blur-md shadow-lg border border-white/15",other:"bg-black/60 text-white border border-white/20 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-black/80 border-white/15 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-white/10 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-white mb-2",suggestedResponse:{container:"bg-black/70 text-white border-white/20 backdrop-blur-md hover:bg-black/80 hover:border-white/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#000000] via-[#0a0a0a] to-[#000000] text-white",header:"border-white/15 bg-black/80 backdrop-blur-xl shadow-xl",headerButton:"bg-black/90 hover:bg-black border-2 border-white/25 hover:border-white/40 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-black via-black/90 to-black/60 backdrop-blur-xl border-t border-white/15 shadow-2xl",controlEnabled:"bg-black/90 hover:bg-black border-2 border-white/30 hover:border-white/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-indigo-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-black/50 hover:bg-black/60 text-white/40 border border-white/10 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-black/70 border border-white/20 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-black/60 text-white/80",avatar:"bg-black/80 text-white border-2 border-white/20",nameOverlay:"bg-gradient-to-t from-black via-black/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Sw={card:"text-white bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] border border-[#2a3142]/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#0b1220]/90 via-[#0b1220]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(34,211,238,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-cyan-500/[0.12] via-sky-500/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-cyan-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] rounded-3xl shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-300 via-sky-300 to-cyan-300"},micButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-sky-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-sky-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-sky-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 text-white font-bold hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-cyan-500/30 focus:outline-none focus:ring-2 focus:ring-cyan-400/50 focus:ring-offset-2 focus:ring-offset-[#161a25] transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-[#1c2230]/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-[#2a3142]/80 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-[#2a3142]/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-[#161a25]/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-[#1c2230]/80 backdrop-blur-xl border-[#2a3142]/80 shadow-xl",textarea:"bg-[#1c2230]/60 border border-[#2a3142]/50 rounded-xl text-white placeholder-gray-400 font-medium px-4 py-3",sendButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 disabled:border-[#2a3142] disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-cyan-500/30",attachButton:"text-gray-400 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-[#243049]/70 text-white backdrop-blur-md shadow-lg border border-[#2a3142]/80",other:"bg-[#1c2230]/60 text-white border border-[#2a3142]/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-[#1c2230]/80 border-[#2a3142]/80 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-cyan-400 mb-2",suggestedResponse:{container:"bg-[#1c2230]/70 text-white border-[#2a3142]/80 backdrop-blur-md hover:bg-[#1c2230]/80 hover:border-cyan-400/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] text-white",header:"border-[#2a3142]/80 bg-[#1c2230]/80 backdrop-blur-xl shadow-xl",headerButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-[#161a25] via-[#161a25]/90 to-[#161a25]/60 backdrop-blur-xl border-t border-[#2a3142]/80 shadow-2xl",controlEnabled:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-cyan-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-[#1c2230]/50 hover:bg-[#1c2230]/60 text-white/40 border border-[#2a3142] transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-[#1c2230]/70 border border-[#2a3142]/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-[#1c2230]/60 text-white/80",avatar:"bg-[#171b26]/80 text-white border-2 border-[#2a3142]/80",nameOverlay:"bg-gradient-to-t from-[#161a25] via-[#161a25]/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Lu={dark:ww,light:Ew,vox:kw,midnight:Sw};function Lt(e){return Lu[e]||Lu.vox}function Fu({timeout:e}){const[t,n]=N.useState(100),r=N.useRef(null),i=N.useRef(null);return N.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(De.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 fi({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=P.useState(()=>Date.now()),s=()=>e.component?P.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Tr,{children:h.jsxs(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Fu,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.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:h.jsx(st.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Tr,{children:h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Fu,{timeout:e.timeout}),s()]})})})}}function hi({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=N.useState(e),[a,l]=N.useState(!1);N.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),N.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(st.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:dp(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}function Po({modality:e,theme:t,disabled:n=!1,showMicrophone:r=!1,microphoneEnabled:i=!0,microphoneLoading:o=!1,onToggleMicrophone:s,showCamera:a=!1,cameraEnabled:l=!0,cameraLoading:c=!1,onToggleCamera:u,showScreenShare:d=!1,screenShareEnabled:f=!1,screenShareLoading:p=!1,onToggleScreenShare:g,showChatToggle:m=!1,chatOpen:v=!1,onToggleChat:y,showTextInput:E=!1,textInputPlaceholder:w="Type a message...",onSendText:C,onSendAttachments:S,supportsAttachments:_=!1,showEndCall:R=!0,onEndCall:A}){var U;const O=Lt(t),[b,M]=N.useState(""),I=N.useRef(null),F=()=>{const x=b.trim();x&&C&&(C(x),M(""))},D=x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),F())},G=x=>{const B=Array.from(x.target.files||[]);B.length>0&&S&&S(B),I.current&&(I.current.value="")},ie=Ue("flex items-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",E?"justify-between":"justify-center",t==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),X=(x,B)=>{var K,k,Y;return B==="end-call"?Ue("p-3 rounded-full transition-all duration-200",((K=O.video)==null?void 0:K.endCall)||"bg-red-500 text-white hover:bg-red-600",n?"opacity-50 cursor-not-allowed":"hover:scale-105"):Ue("p-3 rounded-full transition-all duration-200",x?((k=O.video)==null?void 0:k.controlEnabled)||"bg-green-500 text-white":((Y=O.video)==null?void 0:Y.controlDisabled)||"bg-gray-500 text-white",n?"opacity-50 cursor-not-allowed":"hover:scale-105")},$=()=>h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"});return h.jsxs("div",{className:ie,children:[E&&h.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[_&&S&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>{var x;return(x=I.current)==null?void 0:x.click()},disabled:n,className:Ue("p-2 rounded-full transition-all duration-200",t==="light"?"hover:bg-gray-100":"hover:bg-gray-800",n&&"opacity-50 cursor-not-allowed"),title:"Attach files",children:h.jsx(st.Paperclip,{className:"w-5 h-5"})}),h.jsx("input",{ref:I,type:"file",multiple:!0,accept:"image/*",onChange:G,className:"hidden"})]}),h.jsx("input",{type:"text",value:b,onChange:x=>M(x.target.value),onKeyDown:D,disabled:n,placeholder:w,className:Ue("flex-1 px-4 py-2 rounded-full border outline-none transition-all",t==="light"?"bg-gray-100 border-gray-300 focus:border-blue-500 text-gray-900":"bg-gray-800 border-gray-700 focus:border-blue-400 text-white",n&&"opacity-50 cursor-not-allowed")}),h.jsx("button",{onClick:F,disabled:n||!b.trim(),className:Ue("p-2 rounded-full transition-all duration-200",b.trim()?((U=O.video)==null?void 0:U.controlEnabled)||"bg-blue-500 text-white hover:bg-blue-600":t==="light"?"bg-gray-200 text-gray-400":"bg-gray-700 text-gray-500",n&&"opacity-50 cursor-not-allowed",b.trim()&&!n&&"hover:scale-105"),title:"Send message",children:h.jsx(st.SendHorizontal,{className:"w-5 h-5"})})]}),!E&&h.jsxs(h.Fragment,{children:[r&&s&&h.jsx("button",{onClick:s,disabled:n||o,className:X(i),title:i?"Mute microphone":"Unmute microphone",children:o?h.jsx($,{}):i?h.jsx(st.Mic,{className:"w-5 h-5"}):h.jsx(st.MicOff,{className:"w-5 h-5"})}),a&&u&&h.jsx("button",{onClick:u,disabled:n||c,className:X(l),title:l?"Turn off camera":"Turn on camera",children:c?h.jsx($,{}):l?h.jsx(st.Camera,{className:"w-5 h-5"}):h.jsx(st.CameraOff,{className:"w-5 h-5"})}),d&&g&&h.jsx("button",{onClick:g,disabled:n||p,className:X(f),title:f?"Stop screen share":"Share screen",children:p?h.jsx($,{}):h.jsx(st.Monitor,{className:"w-5 h-5"})}),m&&y&&h.jsx("button",{onClick:y,disabled:n,className:X(v),title:e==="voice"?v?"Hide transcription":"Show transcription":v?"Hide chat":"Show chat",children:h.jsx(st.MessageCircle,{className:"w-5 h-5"})})]}),R&&A&&h.jsx("button",{onClick:A,disabled:n,className:X(!1,"end-call"),title:"End call",children:h.jsx(st.PhoneOff,{className:"w-5 h-5"})})]})}Po.displayName="UnifiedControlBar";const Cw=({logLevel:e}={})=>{const t=Ot.useRoomContext();P.useEffect(()=>(le.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},hp=P.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return P.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&P.createElement("title",null,n),a,l.get(o))});hp.displayName="SSRBase";const _w=new Map([["bold",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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"}))]]),_l=P.forwardRef((e,t)=>P.createElement(hp,{ref:t,...e,weights:_w}));_l.displayName="SpinnerIcon";function Tw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=P.useState(""),[s,a]=P.useState(0);return P.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),P.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(De.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 Nw(e,t){return e.startsWith("image/")?st.Image:e.startsWith("video/")?st.Video:e.startsWith("audio/")?st.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?st.Archive:st.FileText}function Aw(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 Mw({message:e,theme:t,isOwn:n}){const r=Lt(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,g=Nw(a),m=l||c,v=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[E,w]=P.useState(null);P.useEffect(()=>{if(f)w(f);else if(p&&a.startsWith("image/")){const R=URL.createObjectURL(p);return w(R),()=>URL.revokeObjectURL(R)}else w(null)},[f,p,a]);const C=()=>{if(f){const R=document.createElement("a");R.href=f,R.download=o,R.click()}},_=a.startsWith("image/")&&E;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[_&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:E,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:C}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
9
+ `),()=>{m.contains(g)&&m.removeChild(g)}},[t]),h.jsx(Yy,{isPresent:t,childRef:o,sizeRef:s,children:P.cloneElement(e,{ref:o})})}const Xy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=Wa(Qy),u=N.useId();let d=!0,f=N.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),N.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[n]),P.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Zy,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(No.Provider,{value:f,children:e})};function Qy(){return new Map}function dh(e=!0){const t=N.useContext(No);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=N.useId();N.useEffect(()=>{if(e)return i(o)},[e]);const s=N.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Li=e=>e.key||"";function jc(e){const t=[];return N.Children.forEach(e,n=>{N.isValidElement(n)&&t.push(n)}),t}const Tr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=dh(s),d=N.useMemo(()=>jc(e),[e]),f=s&&!c?[]:d.map(Li),p=N.useRef(!0),g=N.useRef(d),m=Wa(()=>new Map),[v,y]=N.useState(d),[E,w]=N.useState(d);vf(()=>{p.current=!1,g.current=d;for(let _=0;_<E.length;_++){const R=Li(E[_]);f.includes(R)?m.delete(R):m.get(R)!==!0&&m.set(R,!1)}},[E,f.length,f.join("-")]);const C=[];if(d!==v){let _=[...d];for(let R=0;R<E.length;R++){const A=E[R],O=Li(A);f.includes(O)||(_.splice(R,0,A),C.push(A))}return o==="wait"&&C.length&&(_=C),w(jc(_)),y(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.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}=N.useContext(Ha);return h.jsx(h.Fragment,{children:E.map(_=>{const R=Li(_),A=s&&!c?!1:d===E||f.includes(R),O=()=>{if(m.has(R))m.set(R,!0);else return;let b=!0;m.forEach(M=>{M||(b=!1)}),b&&(S==null||S(),w(g.current),s&&(u==null||u()),r&&r())};return h.jsx(Xy,{isPresent:A,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:A?void 0:O,anchorX:a,children:_},R)})})},fh=N.createContext({strict:!1}),Bc={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"]},Nr={};for(const e in Bc)Nr[e]={isEnabled:t=>Bc[e].some(n=>!!t[n])};function Jy(e){for(const t in e)Nr[t]={...Nr[t],...e[t]}}const e0=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 go(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||e0.has(e)}let hh=e=>!go(e);function t0(e){typeof e=="function"&&(hh=t=>t.startsWith("on")?!go(t):e(t))}try{t0(require("@emotion/is-prop-valid").default)}catch{}function n0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(hh(i)||n===!0&&go(i)||!t&&!go(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Ao=N.createContext({});function Mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const ml=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gl=["initial",...ml];function Ro(e){return Mo(e.animate)||gl.some(t=>ci(e[t]))}function ph(e){return!!(Ro(e)||e.variants)}function r0(e,t){if(Ro(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function i0(e){const{initial:t,animate:n}=r0(e,N.useContext(Ao));return N.useMemo(()=>({initial:t,animate:n}),[$c(t),$c(n)])}function $c(e){return Array.isArray(e)?e.join(" "):e}const ui={};function o0(e){for(const t in e)ui[t]=e[t],el(t)&&(ui[t].isCSSVariable=!0)}function mh(e,{layout:t,layoutId:n}){return Pr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ui[e]||e==="opacity")}const s0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},a0=Or.length;function l0(e,t,n){let r="",i=!0;for(let o=0;o<a0;o++){const s=Or[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=oh(a,dl[s]);if(!l){i=!1;const u=s0[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function bl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Pr.has(l)){s=!0;continue}else if(el(l)){i[l]=c;continue}else{const u=oh(c,dl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=l0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const yl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gh(e,t,n){for(const r in t)!At(t[r])&&!mh(r,n)&&(e[r]=t[r])}function c0({transformTemplate:e},t){return N.useMemo(()=>{const n=yl();return bl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function u0(e,t){const n=e.style||{},r={};return gh(r,n,e),Object.assign(r,c0(e,t)),r}function d0(e,t){const n={},r=u0(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 f0={offset:"stroke-dashoffset",array:"stroke-dasharray"},h0={offset:"strokeDashoffset",array:"strokeDasharray"};function p0(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?f0:h0;e[o.offset]=ke.transform(-r);const s=ke.transform(t),a=ke.transform(n);e[o.array]=`${s} ${a}`}function bh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(bl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&p0(d,i,o,s,!1)}const yh=()=>({...yl(),attrs:{}}),xh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m0(e,t,n,r){const i=N.useMemo(()=>{const o=yh();return bh(o,t,xh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};gh(o,e.style,e),i.style={...o,...i.style}}return i}const g0=["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 xl(e){return typeof e!="string"||e.includes("-")?!1:!!(g0.indexOf(e)>-1||/[A-Z]/u.test(e))}function b0(e,t,n,{latestValues:r},i,o=!1){const a=(xl(e)?m0:d0)(t,r,i,e),l=n0(t,typeof e=="string",o),c=e!==N.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=N.useMemo(()=>At(u)?u.get():u,[u]);return N.createElement(e,{...c,children:d})}function Vc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vl(e,t,n,r){if(typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function ro(e){return At(e)?e.get():e}function y0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:x0(n,r,i,e),renderState:t()}}function x0(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ro(o[f]);let{initial:s,animate:a}=e;const l=Ro(e),c=ph(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!Mo(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const g=vl(e,f[p]);if(g){const{transitionEnd:m,transition:v,...y}=g;for(const E in y){let w=y[E];if(Array.isArray(w)){const C=u?w.length-1:0;w=w[C]}w!==null&&(i[E]=w)}for(const E in m)i[E]=m[E]}}}return i}const vh=e=>(t,n)=>{const r=N.useContext(Ao),i=N.useContext(No),o=()=>y0(e,t,r,i);return n?o():Wa(o)};function wl(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(At(r[s])||t.style&&At(t.style[s])||mh(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const v0=vh({scrapeMotionValuesFromProps:wl,createRenderState:yl});function wh(e,t,n){const r=wl(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const o=Or.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const w0=vh({scrapeMotionValuesFromProps:wh,createRenderState:yh}),E0=Symbol.for("motionComponentSymbol");function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k0(e,t,n){return N.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xr(n)&&(n.current=r))},[t])}const El=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),S0="framerAppearId",Eh="data-"+El(S0),kh=N.createContext({});function C0(e,t,n,r,i){var m,v;const{visualElement:o}=N.useContext(Ao),s=N.useContext(fh),a=N.useContext(No),l=N.useContext(pl).reducedMotion,c=N.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=N.useContext(kh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&_0(c.current,n,i,d);const f=N.useRef(!1);N.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[Eh],g=N.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return vf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),g.current=!1),u.enteringChildren=void 0)}),u}function _0(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&xr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Sh(e){if(e)return e.options.allowProjection!==!1?e.projection:Sh(e.parent)}function ds(e,{forwardMotionProps:t=!1}={},n,r){n&&Jy(n);const i=xl(e)?w0:v0;function o(a,l){let c;const u={...N.useContext(pl),...a,layoutId:T0(a)},{isStatic:d}=u,f=i0(a),p=i(a,d);if(!d&&Ga){N0(u,n);const g=A0(u);c=g.MeasureLayout,f.visualElement=C0(e,p,u,r,g.ProjectionNode)}return h.jsxs(Ao.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,b0(e,a,k0(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=N.forwardRef(o);return s[E0]=e,s}function T0({layoutId:e}){const t=N.useContext(Ha).id;return t&&e!==void 0?t+"-"+e:e}function N0(e,t){const n=N.useContext(fh).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?Rr(!1,r,"lazy-strict-mode"):kn(!1,r,"lazy-strict-mode")}}function A0(e){const{drag:t,layout:n}=Nr;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 M0(e,t){if(typeof Proxy>"u")return ds;const n=new Map,r=(o,s)=>ds(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Xa(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,ds(s,void 0,e,t)),n.get(s))})}function Ch({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function R0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function I0(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 fs(e){return e===void 0||e===1}function ma({scale:e,scaleX:t,scaleY:n}){return!fs(e)||!fs(t)||!fs(n)}function Gn(e){return ma(e)||_h(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _h(e){return Uc(e.x)||Uc(e.y)}function Uc(e){return e&&e!=="0%"}function bo(e,t,n){const r=e-n,i=t*r;return n+i}function zc(e,t,n,r,i){return i!==void 0&&(e=bo(e,i,r)),bo(e,n,r)+t}function ga(e,t=0,n=1,r,i){e.min=zc(e.min,t,n,r,i),e.max=zc(e.max,t,n,r,i)}function Th(e,{x:t,y:n}){ga(e.x,t.translate,t.scale,t.originPoint),ga(e.y,n.translate,n.scale,n.originPoint)}const Hc=.999999999999,Wc=1.0000000000001;function O0(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&wr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Th(e,s)),r&&Gn(o.latestValues)&&wr(e,o.latestValues))}t.x<Wc&&t.x>Hc&&(t.x=1),t.y<Wc&&t.y>Hc&&(t.y=1)}function vr(e,t){e.min=e.min+t,e.max=e.max+t}function Gc(e,t,n,r,i=.5){const o=at(e.min,e.max,i);ga(e,t,n,o,r)}function wr(e,t){Gc(e.x,t.x,t.scaleX,t.scale,t.originX),Gc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nh(e,t){return Ch(I0(e.getBoundingClientRect(),t))}function P0(e,t,n){const r=Nh(e,n),{scroll:i}=t;return i&&(vr(r.x,i.offset.x),vr(r.y,i.offset.y)),r}const Kc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Er=()=>({x:Kc(),y:Kc()}),qc=()=>({min:0,max:0}),ft=()=>({x:qc(),y:qc()}),ba={current:null},Ah={current:!1};function D0(){if(Ah.current=!0,!!Ga)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ba.current=e.matches;e.addEventListener("change",t),t()}else ba.current=!1}const L0=new WeakMap;function F0(e,t,n){for(const r in t){const i=t[r],o=n[r];if(At(i))e.addValue(r,i);else if(At(o))e.addValue(r,_r(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,_r(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Yc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class j0{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=cl,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 f=Bt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,it.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Ro(n),this.isVariantNode=ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&At(p)&&p.set(l[f])}}mount(t){var n;this.current=t,L0.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,i)=>this.bindToMotionValue(i,r)),Ah.current||D0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ba.current,process.env.NODE_ENV!=="production"&&Xa(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(),Pn(this.notifyUpdate),Pn(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=Pr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&it.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nr){const n=Nr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ft()}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<Yc.length;r++){const i=Yc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=F0(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=_r(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"&&(wf(r)||kf(r))?r=parseFloat(r):!qy(r)&&Dn.test(n)&&(r=ih(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=vl(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Za),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fl.render(this.render)}}class Mh extends j0{constructor(){super(...arguments),this.KeyframeResolver=Ly}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;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rh(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function B0(e){return window.getComputedStyle(e)}class $0 extends Mh{constructor(){super(...arguments),this.type="html",this.renderInstance=Rh}readValueFromInstance(t,n){var r;if(Pr.has(n))return(r=this.projection)!=null&&r.isProjecting?la(n):ey(t,n);{const i=B0(t),o=(el(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nh(t,n)}build(t,n,r){bl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return wl(t,n,r)}}const Ih=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 V0(e,t,n,r){Rh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ih.has(i)?i:El(i),t.attrs[i])}class U0 extends Mh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ft}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pr.has(n)){const r=rh(n);return r&&r.default||0}return n=Ih.has(n)?n:El(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wh(t,n,r)}build(t,n,r){bh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){V0(t,n,r,i)}mount(t){this.isSVGTag=xh(t.tagName),super.mount(t)}}const z0=(e,t)=>xl(e)?new U0(t):new $0(t,{allowProjection:e!==N.Fragment});function kr(e,t,n){const r=e.getProps();return vl(r,t,n!==void 0?n:r.custom,e)}const ya=e=>Array.isArray(e);function H0(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_r(n))}function W0(e){return ya(e)?e[e.length-1]||0:e}function G0(e,t){const n=kr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=W0(o[s]);H0(e,s,a)}}function K0(e){return!!(At(e)&&e.add)}function xa(e,t){const n=e.getValue("willChange");if(K0(n))return n.add(t);if(!n&&Sn.WillChange){const r=new Sn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Oh(e){return e.props[Eh]}const q0=e=>e!==null;function Y0(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(q0),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Z0={type:"spring",stiffness:500,damping:25,restSpeed:10},X0=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q0={type:"keyframes",duration:.8},J0={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(e,{keyframes:t})=>t.length>2?Q0:Pr.has(e)?e.startsWith("scale")?X0(t[1]):Z0:J0;function tx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kl=(e,t,n,r={},i,o)=>s=>{const a=ul(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-on(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};tx(a)||Object.assign(u,ex(e,u)),u.duration&&(u.duration=on(u.duration)),u.repeatDelay&&(u.repeatDelay=on(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ha(u),u.delay===0&&(d=!0)),(Sn.instantAnimations||Sn.skipAnimations)&&(d=!0,ha(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=Y0(u.keyframes,a);if(f!==void 0){it.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new ll(u):new ky(u)};function nx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ph(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&nx(c,u))continue;const p={delay:n,...ul(o||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Oh(e);if(y){const E=window.MotionHandoffAnimation(y,u,it);E!==null&&(p.startTime=E,m=!0)}}xa(e,u),d.start(kl(u,d,f,e.shouldReduceMotion&&eh.has(u)?{type:!1}:p,e,m));const v=d.animation;v&&l.push(v)}return s&&Promise.all(l).then(()=>{it.update(()=>{s&&G0(e,s)})}),l}function Dh(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function va(e,t,n={}){var l;const r=kr(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Ph(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return rx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function rx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(va(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Dh(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ix(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>va(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=va(e,t,n);else{const i=typeof t=="function"?kr(e,t,n.custom):t;r=Promise.all(Ph(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lh(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 ox=gl.length;function Fh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Fh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ox;n++){const r=gl[n],i=e.props[r];(ci(i)||i===!1)&&(t[r]=i)}return t}const sx=[...ml].reverse(),ax=ml.length;function lx(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ix(e,n,r)))}function cx(e){let t=lx(e),n=Zc(),r=!0;const i=l=>(c,u)=>{var f;const d=kr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:g,...m}=d;c={...c,...m,...g}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Fh(e.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let v=0;v<ax;v++){const y=sx[v],E=n[y],w=c[y]!==void 0?c[y]:u[y],C=ci(w),S=y===l?E.isActive:null;S===!1&&(g=v);let _=w===u[y]&&w!==c[y]&&C;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),E.protectedKeys={...p},!E.isActive&&S===null||!w&&!E.prevProp||Mo(w)||typeof w=="boolean")continue;const R=ux(E.prevProp,w);let A=R||y===l&&E.isActive&&!_&&C||v>g&&C,O=!1;const b=Array.isArray(w)?w:[w];let M=b.reduce(i(y),{});S===!1&&(M={});const{prevResolvedValues:I={}}=E,F={...I,...M},D=X=>{A=!0,f.has(X)&&(O=!0,f.delete(X)),E.needsAnimating[X]=!0;const $=e.getValue(X);$&&($.liveStyle=!1)};for(const X in F){const $=M[X],U=I[X];if(p.hasOwnProperty(X))continue;let x=!1;ya($)&&ya(U)?x=!Lh($,U):x=$!==U,x?$!=null?D(X):f.add(X):$!==void 0&&f.has(X)?D(X):E.protectedKeys[X]=!0}E.prevProp=w,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(A=!1);const G=_&&R;A&&(!G||O)&&d.push(...b.map(X=>{const $={type:y};if(typeof X=="string"&&r&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,x=kr(U,X);if(U.enteringChildren&&x){const{delayChildren:B}=x.transition||{};$.delay=Dh(U.enteringChildren,e,B)}}return{animation:X,options:$}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const y=kr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const E=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),v[y]=E??null}),d.push({animation:v})}let m=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Zc(),r=!0}}}function ux(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lh(t,e):!1}function zn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zc(){return{animate:zn(!0),whileInView:zn(),whileHover:zn(),whileTap:zn(),whileDrag:zn(),whileFocus:zn(),exit:zn()}}class jn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dx extends jn{constructor(t){super(t),t.animationState||(t.animationState=cx(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mo(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 fx=0;class hx extends jn{constructor(){super(...arguments),this.id=fx++}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 i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 px={animation:{Feature:dx},exit:{Feature:hx}};function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vi(e){return{point:{x:e.pageX,y:e.pageY}}}const mx=e=>t=>hl(t)&&e(t,vi(t));function Jr(e,t,n,r){return di(e,t,mx(n),r)}const jh=1e-4,gx=1-jh,bx=1+jh,Bh=.01,yx=0-Bh,xx=0+Bh;function Dt(e){return e.max-e.min}function vx(e,t,n){return Math.abs(e-t)<=n}function Xc(e,t,n,r=.5){e.origin=r,e.originPoint=at(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=at(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gx&&e.scale<=bx||isNaN(e.scale))&&(e.scale=1),(e.translate>=yx&&e.translate<=xx||isNaN(e.translate))&&(e.translate=0)}function ei(e,t,n,r){Xc(e.x,t.x,n.x,r?r.originX:void 0),Xc(e.y,t.y,n.y,r?r.originY:void 0)}function Qc(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function wx(e,t,n){Qc(e.x,t.x,n.x),Qc(e.y,t.y,n.y)}function Jc(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function ti(e,t,n){Jc(e.x,t.x,n.x),Jc(e.y,t.y,n.y)}function Yt(e){return[e("x"),e("y")]}const $h=({current:e})=>e?e.ownerDocument.defaultView:null,eu=(e,t)=>Math.abs(e-t);function Ex(e,t){const n=eu(e.x,t.x),r=eu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Vh{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 f=ps(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=Ex(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=f,{timestamp:v}=Tt;this.history.push({...m,timestamp:v});const{onStart:y,onMove:E}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=hs(p,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ps(f.type==="pointercancel"?this.lastMoveEventInfo:hs(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,y),m&&m(f,y)},!hl(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=vi(t),l=hs(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Tt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,ps(l,this.history)),this.removeListeners=bi(Jr(this.contextWindow,"pointermove",this.handlePointerMove),Jr(this.contextWindow,"pointerup",this.handlePointerUp),Jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Pn(this.updatePoint)}}function hs(e,t){return t?{point:t(e.point)}:e}function tu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ps({point:e},t){return{point:e,delta:tu(e,Uh(t)),offset:tu(e,kx(t)),velocity:Sx(t,.1)}}function kx(e){return e[0]}function Uh(e){return e[e.length-1]}function Sx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Uh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>on(t)));)n--;if(!r)return{x:0,y:0};const o=hn(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Cx(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?at(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?at(n,e,r.max):Math.min(e,n)),e}function nu(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 _x(e,{top:t,left:n,bottom:r,right:i}){return{x:nu(e.x,n,i),y:nu(e.y,t,r)}}function ru(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 Tx(e,t){return{x:ru(e.x,t.x),y:ru(e.y,t.y)}}function Nx(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=si(t.min,t.max-r,e.min):r>i&&(n=si(e.min,e.max-i,t.min)),En(0,1,n)}function Ax(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 wa=.35;function Mx(e=wa){return e===!1?e=0:e===!0&&(e=wa),{x:iu(e,"left","right"),y:iu(e,"top","bottom")}}function iu(e,t,n){return{min:ou(e,t),max:ou(e,n)}}function ou(e,t){return typeof e=="number"?e:e[t]||0}const Rx=new WeakMap;class Ix{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=ft(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$y(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yt(y=>{let E=this.getAxisMotionValue(y).get()||0;if(pn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[y];C&&(E=Dt(C)*(parseFloat(E)/100))}}this.originPoint[y]=E}),m&&it.postRender(()=>m(d,f)),xa(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(g&&this.currentDirection===null){this.currentDirection=Ox(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Yt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Vh(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:$h(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&it.postRender(()=>a(r,i))}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:i}=this.getProps();if(!r||!Fi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=Cx(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&xr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_x(r.layoutBox,t):this.constraints=!1,this.elastic=Mx(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ax(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xr(t))return!1;const r=t.current;kn(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:i}=this.visualElement;if(!i||!i.layout)return!1;const o=P0(r,i.root,this.visualElement.getTransformPagePoint());let s=Tx(i.layout.layoutBox,o);if(n){const a=n(R0(s));this.hasMutatedConstraints=!!a,a&&(s=Ch(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Yt(u=>{if(!Fi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xa(this.visualElement,t),r.start(kl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yt(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(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yt(n=>{const{drag:r}=this.getProps();if(!Fi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-at(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=Nx({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yt(s=>{if(!Fi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(at(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const t=this.visualElement.current,n=Jr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),it.read(r);const s=di(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Yt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=wa,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Fi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ox(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Px extends jn{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new Ix(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const su=e=>(t,n)=>{e&&it.postRender(()=>e(t,n))};class Dx extends jn{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new Vh(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$h(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:su(t),onStart:su(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&it.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Jr(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 io={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function au(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=au(e,t.target.x),r=au(e,t.target.y);return`${n}% ${r}%`}},Lx={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Dn.parse(e);if(i.length>5)return r;const o=Dn.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=at(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let ms=!1;class Fx extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;o0(jx),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),io.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,ms=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||it.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),fl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ms=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zh(e){const[t,n]=dh(),r=N.useContext(Ha);return h.jsx(Fx,{...e,layoutGroup:r,switchLayoutGroup:N.useContext(kh),isPresent:t,safeToRemove:n})}const jx={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:Lx};function Bx(e,t,n){const r=At(e)?e:_r(e);return r.start(kl("",r,t,n)),r.animation}const $x=(e,t)=>e.depth-t.depth;class Vx{constructor(){this.children=[],this.isDirty=!1}add(t){Ka(this.children,t),this.isDirty=!0}remove(t){qa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($x),this.isDirty=!1,this.children.forEach(t)}}function Ux(e,t){const n=Bt.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Pn(r),e(o-t))};return it.setup(r,!0),()=>Pn(r)}const Hh=["TopLeft","TopRight","BottomLeft","BottomRight"],zx=Hh.length,lu=e=>typeof e=="string"?parseFloat(e):e,cu=e=>typeof e=="number"||ke.test(e);function Hx(e,t,n,r,i,o){i?(e.opacity=at(0,n.opacity??1,Wx(r)),e.opacityExit=at(t.opacity??1,0,Gx(r))):o&&(e.opacity=at(t.opacity??1,n.opacity??1,r));for(let s=0;s<zx;s++){const a=`border${Hh[s]}Radius`;let l=uu(t,a),c=uu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||cu(l)===cu(c)?(e[a]=Math.max(at(lu(l),lu(c),r),0),(pn.test(c)||pn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=at(t.rotate||0,n.rotate||0,r))}function uu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Wx=Wh(0,.5,Rf),Gx=Wh(.5,.95,Qt);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(si(e,t,r))}function du(e,t){e.min=t.min,e.max=t.max}function qt(e,t){du(e.x,t.x),du(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function hu(e,t,n,r,i){return e-=t,e=bo(e,1/n,r),i!==void 0&&(e=bo(e,1/i,r)),e}function Kx(e,t=0,n=1,r=.5,i,o=e,s=e){if(pn.test(t)&&(t=parseFloat(t),t=at(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=at(o.min,o.max,r);e===o&&(a-=t),e.min=hu(e.min,t,n,a,i),e.max=hu(e.max,t,n,a,i)}function pu(e,t,[n,r,i],o,s){Kx(e,t[n],t[r],t[i],t.scale,o,s)}const qx=["x","scaleX","originX"],Yx=["y","scaleY","originY"];function mu(e,t,n,r){pu(e.x,t,qx,n?n.x:void 0,r?r.x:void 0),pu(e.y,t,Yx,n?n.y:void 0,r?r.y:void 0)}function gu(e){return e.translate===0&&e.scale===1}function Gh(e){return gu(e.x)&&gu(e.y)}function bu(e,t){return e.min===t.min&&e.max===t.max}function Zx(e,t){return bu(e.x,t.x)&&bu(e.y,t.y)}function yu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Kh(e,t){return yu(e.x,t.x)&&yu(e.y,t.y)}function xu(e){return Dt(e.x)/Dt(e.y)}function vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Xx{constructor(){this.members=[]}add(t){Ka(this.members,t),t.scheduleRender()}remove(t){if(qa(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(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!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 Qx(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}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 gs=["","X","Y","Z"],Jx=1e3;let ev=0;function bs(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Oh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qh(r)}function Yh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=ev++,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(rv),this.nodes.forEach(av),this.nodes.forEach(lv),this.nodes.forEach(iv)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 Vx)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Za),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=uh(s)&&!Gy(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;it.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=Ux(f,250),io.hasAnimatedSinceResize&&(io.hasAnimatedSinceResize=!1,this.nodes.forEach(ku)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||hv,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Kh(this.targetLayout,p),E=!d&&f;if(this.options.layoutRoot||this.resumeFrom||E||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...ul(g,"layout"),onPlay:m,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,E)}else d||ku(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pn(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(cv),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Eu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sv),this.nodes.forEach(tv),this.nodes.forEach(nv)):this.nodes.forEach(Eu),this.clearAllSnapshots();const a=Bt.now();Tt.delta=En(0,1e3/60,a-Tt.timestamp),Tt.timestamp=a,Tt.isProcessing=!0,os.update.process(Tt),os.preRender.process(Tt),os.render.process(Tt),Tt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ov),this.sharedNodes.forEach(uv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(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 s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ft(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Gn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),pv(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return ft();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(mv))){const{scroll:u}=this.root;u&&(vr(a.x,u.offset.x),vr(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=ft();if(qt(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&qt(a,s),vr(a.x,d.offset.x),vr(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=ft();qt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Gn(u.latestValues)&&wr(l,u.latestValues)}return Gn(this.latestValues)&&wr(l,this.latestValues),l}removeTransform(s){const a=ft();qt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Gn(c.latestValues))continue;ma(c.latestValues)&&c.updateSnapshot();const u=ft(),d=c.measurePageBox();qt(u,d),mu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Gn(this.latestValues)&&mu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Tt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Tt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),ti(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ft(),this.targetWithTransforms=ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qt(this.target,this.layout.layoutBox),Th(this.target,this.targetDelta)):qt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),ti(this.relativeTargetOrigin,this.target,p.target),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ma(this.parent.latestValues)||_h(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 g;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Tt.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||u))return;qt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;O0(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ft());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),ei(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!vu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Er(),this.projectionDelta=Er(),this.projectionDeltaWithTransform=Er()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Er();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=ft(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,v=this.getStack(),y=!v||v.members.length<=1,E=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(fv));this.animationProgress=0;let w;this.mixTargetDelta=C=>{const S=C/1e3;Su(d.x,s.x,S),Su(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dv(this.relativeTarget,this.relativeTargetOrigin,f,S),w&&Zx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=ft()),qt(w,this.relativeTarget)),m&&(this.animationValues=u,Hx(u,c,this.latestValues,S,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Pn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{io.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_r(0)),this.currentAnimation=Bx(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Zh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ft();const d=Dt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Dt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}qt(a,l),wr(a,u),ei(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Xx),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&bs("z",s,c,this.animationValues);for(let u=0;u<gs.length;u++)bs(`rotate${gs[u]}`,s,c,this.animationValues),bs(`skew${gs[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Gn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Qx(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in ui){if(u[g]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:y}=ui[g],E=d==="none"?u[g]:m(u[g],c);if(v){const w=v.length;for(let C=0;C<w;C++)s[v[C]]=E}else y?this.options.visualElement.renderState.vars[g]=E:s[g]=E}this.options.layoutId&&(s.pointerEvents=c===this?ro(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(wu),this.root.sharedNodes.clear()}}}function tv(e){e.updateLayout()}function nv(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:i}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(f);f.min=r[d].min,f.max=f.min+p}):Zh(o,t.layoutBox,r)&&Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=Er();ei(a,r,t.layoutBox);const l=Er();s?ei(l,e.applyTransform(i,!0),t.measuredBox):ei(l,r,t.layoutBox);const c=!Gh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=ft();ti(g,t.layoutBox,f.layoutBox);const m=ft();ti(m,r,p.layoutBox),Kh(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function rv(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 iv(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ov(e){e.clearSnapshot()}function wu(e){e.clearMeasurements()}function Eu(e){e.isLayoutDirty=!1}function sv(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ku(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function av(e){e.resolveTargetDelta()}function lv(e){e.calcProjection()}function cv(e){e.resetSkewAndRotation()}function uv(e){e.removeLeadSnapshot()}function Su(e,t,n){e.translate=at(t.translate,0,n),e.scale=at(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cu(e,t,n,r){e.min=at(t.min,n.min,r),e.max=at(t.max,n.max,r)}function dv(e,t,n,r){Cu(e.x,t.x,n.x,r),Cu(e.y,t.y,n.y,r)}function fv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hv={duration:.45,ease:[.4,0,.1,1]},_u=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Tu=_u("applewebkit/")&&!_u("chrome/")?Math.round:Qt;function Nu(e){e.min=Tu(e.min),e.max=Tu(e.max)}function pv(e){Nu(e.x),Nu(e.y)}function Zh(e,t,n){return e==="position"||e==="preserve-aspect"&&!vx(xu(t),xu(n),.2)}function mv(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const gv=Yh({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ys={current:void 0},Xh=Yh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ys.current){const e=new gv({});e.mount(window),e.setOptions({layoutScroll:!0}),ys.current=e}return ys.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),bv={pan:{Feature:Dx},drag:{Feature:Px,ProjectionNode:Xh,MeasureLayout:zh}};function Au(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&it.postRender(()=>o(t,vi(t)))}class yv extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=Vy(t,(n,r)=>(Au(this.node,r,"Start"),i=>Au(this.node,i,"End"))))}unmount(){}}class xv extends jn{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=bi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mu(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 i="onTap"+(n==="End"?"":n),o=r[i];o&&it.postRender(()=>o(t,vi(t)))}class vv extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=Wy(t,(n,r)=>(Mu(this.node,r,"Start"),(i,{success:o})=>Mu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ea=new WeakMap,xs=new WeakMap,wv=e=>{const t=Ea.get(e.target);t&&t(e)},Ev=e=>{e.forEach(wv)};function kv({root:e,...t}){const n=e||document;xs.has(n)||xs.set(n,{});const r=xs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ev,{root:e,...t})),r[i]}function Sv(e,t,n){const r=kv(t);return Ea.set(e,n),r.observe(e),()=>{Ea.delete(e),r.unobserve(e)}}const Cv={some:0,all:1};class _v extends jn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Cv[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Sv(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tv(t,n))&&this.startObserver()}unmount(){}}function Tv({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Nv={inView:{Feature:_v},tap:{Feature:vv},focus:{Feature:xv},hover:{Feature:yv}},Av={layout:{ProjectionNode:Xh,MeasureLayout:zh}},Mv={...px,...Nv,...bv,...Av},De=M0(Mv,z0);function Rv(e){const[t,n]=N.useState(()=>e.getLocalParticipant()),[r,i]=N.useState(()=>e.getMicrophoneTrack());return N.useEffect(()=>{const o=()=>{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),i(l)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function oo(e,t,n){const[r,i]=N.useState(!1),[o,s]=N.useState(!1);return N.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};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:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function Iv(e){const[t,n]=N.useState(()=>e.getRoom()),[r,i]=N.useState(()=>e.getConnectionState());return N.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function Sl(e){const[t,n]=N.useState(()=>e.getIsAgentConnected()),[r,i]=N.useState(()=>e.getCurrentSession()),[o,s]=N.useState(()=>e.getCurrentAgentInfo()),[a,l]=N.useState(()=>e.getAgentState()),[c,u]=N.useState(()=>e.getAgentAudioTrack()),[d,f]=N.useState(()=>e.getAgentVideoTrack());return N.useEffect(()=>{const p=()=>{const C=e.getIsAgentConnected(),S=e.getCurrentSession(),_=e.getCurrentAgentInfo(),R=e.getAgentState(),A=e.getAgentAudioTrack(),O=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:C,hasSession:!!S,sessionId:S==null?void 0:S.id,sessionState:S==null?void 0:S.state,hasAgentInfo:!!_,agentState:R,hasAudioTrack:!!A,hasVideoTrack:!!O}),n(C),i(S),s(_),l(R),u(A),f(O)};p();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},E=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()},w=()=>{console.log("🎵 useVoxketVoiceAssistant: Track subscribed event - updating audio/video tracks"),p()};return e.on("agent.connected",g),e.on("agent.speaking",g),e.on("agent.thinking",g),e.on("agent.state.changed",E),e.on("connection.disconnected",m),e.on("session.created",v),e.on("session.ended",v),e.on("session.state.changed",v),e.on("connection.connected",y),e.on("media.track.subscribed",w),e.on("media.track.unsubscribed",w),()=>{e.off("agent.connected",g),e.off("agent.speaking",g),e.off("agent.thinking",g),e.off("agent.state.changed",E),e.off("connection.disconnected",m),e.off("session.created",v),e.off("session.ended",v),e.off("session.state.changed",v),e.off("connection.connected",y),e.off("media.track.subscribed",w),e.off("media.track.unsubscribed",w)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function Ov(e){const[t,n]=N.useState(()=>e.getVideoTrackRefs()),[r,i]=N.useState(()=>e.getCameraTrackRefs()),[o,s]=N.useState(()=>e.getScreenShareTrackRefs());return N.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),s(d)};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 c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{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",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}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:o}}const Cl="-",Pv=e=>{const t=Lv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Cl);return a[0]===""&&a.length!==1&&a.shift(),Qh(a,t)||Dv(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Qh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Qh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Cl);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Ru=/^\[(.+)\]$/,Dv=e=>{if(Ru.test(e)){const t=Ru.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lv=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ka(n[i],r,i,t);return r},ka=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Iu(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Fv(i)){ka(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ka(s,Iu(t,o),n,r)})})},Iu=(e,t)=>{let n=e;return t.split(Cl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fv=e=>e.isThemeGetter,jv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Sa="!",Ca=":",Bv=Ca.length,$v=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let m=i[g];if(s===0&&a===0){if(m===Ca){o.push(i.slice(l,g)),l=g+Bv;continue}if(m==="/"){c=g;continue}}m==="["?s++:m==="]"?s--:m==="("?a++:m===")"&&a--}const u=o.length===0?i:i.substring(l),d=Vv(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+Ca,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Vv=e=>e.endsWith(Sa)?e.substring(0,e.length-1):e.startsWith(Sa)?e.substring(1):e,Uv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},zv=e=>({cache:jv(e.cacheSize),parseClassName:$v(e),sortModifiers:Uv(e),...Pv(e)}),Hv=/\s+/,Wv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Hv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,y=r(v?g.substring(0,m):g);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const E=o(f).join(":"),w=p?E+Sa:E,C=w+y;if(s.includes(C))continue;s.push(C);const S=i(y,v);for(let _=0;_<S.length;++_){const R=S[_];s.push(w+R)}l=u+(l.length>0?" "+l:l)}return l};function Gv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jh(t))&&(r&&(r+=" "),r+=n);return r}const Jh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jh(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kv(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=zv(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Wv(l,n);return i(l,u),u}return function(){return o(Gv.apply(null,arguments))}}const Et=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qv=/^\d+\/\d+$/,Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zv=/\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$/,Xv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>qv.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),An=e=>!!e&&Number.isInteger(Number(e)),vs=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),yn=e=>Yv.test(e),ew=()=>!0,tw=e=>Zv.test(e)&&!Xv.test(e),np=()=>!1,nw=e=>Qv.test(e),rw=e=>Jv.test(e),iw=e=>!fe(e)&&!he(e),ow=e=>Dr(e,op,np),fe=e=>ep.test(e),Hn=e=>Dr(e,sp,tw),ws=e=>Dr(e,uw,Pe),Ou=e=>Dr(e,rp,np),sw=e=>Dr(e,ip,rw),ji=e=>Dr(e,ap,nw),he=e=>tp.test(e),Ur=e=>Lr(e,sp),aw=e=>Lr(e,dw),Pu=e=>Lr(e,rp),lw=e=>Lr(e,op),cw=e=>Lr(e,ip),Bi=e=>Lr(e,ap,!0),Dr=(e,t,n)=>{const r=ep.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lr=(e,t,n=!1)=>{const r=tp.exec(e);return r?r[1]?t(r[1]):n:!1},rp=e=>e==="position"||e==="percentage",ip=e=>e==="image"||e==="url",op=e=>e==="length"||e==="size"||e==="bg-size",sp=e=>e==="length",uw=e=>e==="number",dw=e=>e==="family-name",ap=e=>e==="shadow",fw=()=>{const e=Et("color"),t=Et("font"),n=Et("text"),r=Et("font-weight"),i=Et("tracking"),o=Et("leading"),s=Et("breakpoint"),a=Et("container"),l=Et("spacing"),c=Et("radius"),u=Et("shadow"),d=Et("inset-shadow"),f=Et("text-shadow"),p=Et("drop-shadow"),g=Et("blur"),m=Et("perspective"),v=Et("aspect"),y=Et("ease"),E=Et("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...C(),he,fe],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],A=()=>[he,fe,l],O=()=>[or,"full","auto",...A()],b=()=>[An,"none","subgrid",he,fe],M=()=>["auto",{span:["full",An,he,fe]},An,he,fe],I=()=>[An,"auto",he,fe],F=()=>["auto","min","max","fr",he,fe],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],ie=()=>["auto",...A()],X=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[e,he,fe],U=()=>[...C(),Pu,Ou,{position:[he,fe]}],x=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",lw,ow,{size:[he,fe]}],K=()=>[vs,Ur,Hn],k=()=>["","none","full",c,he,fe],Y=()=>["",Pe,Ur,Hn],te=()=>["solid","dashed","dotted","double"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[Pe,vs,Pu,Ou],W=()=>["","none",g,he,fe],ue=()=>["none",Pe,he,fe],Q=()=>["none",Pe,he,fe],ve=()=>[Pe,he,fe],L=()=>[or,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yn],breakpoint:[yn],color:[ew],container:[yn],"drop-shadow":[yn],ease:["in","out","in-out"],font:[iw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yn],shadow:[yn],spacing:["px",Pe],text:[yn],"text-shadow":[yn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,fe,he,v]}],container:["container"],columns:[{columns:[Pe,fe,he,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[An,"auto",he,fe]}],basis:[{basis:[or,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,or,"auto","initial","none",fe]}],grow:[{grow:["",Pe,he,fe]}],shrink:[{shrink:["",Pe,he,fe]}],order:[{order:[An,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],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:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"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:[s]},...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,Ur,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,ws]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vs,fe]}],"font-family":[{font:[aw,fe,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:[i,he,fe]}],"line-clamp":[{"line-clamp":[Pe,"none",he,ws]}],leading:[{leading:[o,...A()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",he,Hn]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Pe,"auto",he,fe]}],"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",he,fe]}],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",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:x()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},An,he,fe],radial:["",he,fe],conic:[An,he,fe]},cw,sw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,he,fe]}],"outline-w":[{outline:["",Pe,Ur,Hn]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",u,Bi,ji]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",d,Bi,ji]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Pe,Hn]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,Bi,ji]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Pe,he,fe]}],"mix-blend":[{"mix-blend":[...j(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":j()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:x()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:W()}],brightness:[{brightness:[Pe,he,fe]}],contrast:[{contrast:[Pe,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",p,Bi,ji]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Pe,he,fe]}],"hue-rotate":[{"hue-rotate":[Pe,he,fe]}],invert:[{invert:["",Pe,he,fe]}],saturate:[{saturate:[Pe,he,fe]}],sepia:[{sepia:["",Pe,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Pe,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,he,fe]}],"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",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",he,fe]}],ease:[{ease:["linear","initial",y,he,fe]}],delay:[{delay:[Pe,he,fe]}],animate:[{animate:["none",E,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,he,fe]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",he,fe]}],"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",he,fe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Pe,Ur,Hn,ws]}],stroke:[{stroke:["none",...$()]}],"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"]}},hw=Kv(fw);function Ue(...e){return hw(za.clsx(e))}function Io(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function pw(e,t){return e.capabilities[t]===!0}function Oo(e){return e.sessionSettings.session_timer||null}function lp(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function cp(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function up(e){return{...e.capabilities}}function dp(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const fp=N.forwardRef(({state:e,audioTrack:t,className:n,theme:r="vox"},i)=>{var c,u,d,f,p;const o=N.useRef(null),[s,a]=N.useState(!1);N.useEffect(()=>{o.current&&(console.log("🔊 AgentTile: Audio element created:",{autoplay:o.current.autoplay,muted:o.current.muted,volume:o.current.volume,readyState:o.current.readyState,paused:o.current.paused}),a(!0))},[t]),N.useEffect(()=>{const g=o.current;if(!g)return;const m=()=>console.log("▶️ AgentTile: Audio started playing"),v=()=>console.log("⏸️ AgentTile: Audio paused"),y=()=>console.log("⏹️ AgentTile: Audio ended"),E=S=>console.error("❌ AgentTile: Audio error:",S),w=()=>console.log("⏳ AgentTile: Audio load started"),C=()=>console.log("✅ AgentTile: Audio can play");return g.addEventListener("play",m),g.addEventListener("pause",v),g.addEventListener("ended",y),g.addEventListener("error",E),g.addEventListener("loadstart",w),g.addEventListener("canplay",C),()=>{g.removeEventListener("play",m),g.removeEventListener("pause",v),g.removeEventListener("ended",y),g.removeEventListener("error",E),g.removeEventListener("loadstart",w),g.removeEventListener("canplay",C)}},[s]),console.log("🎤 AgentTile render:",{state:e,hasAudioTrack:!!t,trackSource:t==null?void 0:t.source,participantId:(c=t==null?void 0:t.participant)==null?void 0:c.identity,publicationMuted:(u=t==null?void 0:t.publication)==null?void 0:u.isMuted,audioElementReady:s,trackMediaStreamTrack:(p=(f=(d=t==null?void 0:t.publication)==null?void 0:d.track)==null?void 0:f.mediaStreamTrack)==null?void 0:p.readyState});const l=N.useMemo(()=>r==="light"?{base:"bg-black/90",highlighted:"bg-black",muted:"bg-black/30"}:{base:"bg-white/90",highlighted:"bg-white",muted:"bg-white/30"},[r]);return h.jsxs("div",{ref:i,className:Ue("",n),children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Ot.AudioTrack,{ref:o,trackRef:t,volume:1}),h.jsx(Ot.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Ue("flex aspect-video w-40 items-center justify-center gap-1.5"),children:h.jsx("span",{className:Ue([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",`data-[lk-highlighted=true]:${l.highlighted}`,`data-[lk-muted=true]:${l.muted}`])})})]}),!t&&h.jsx("div",{className:Ue("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1.5",children:Array.from({length:5}).map((g,m)=>h.jsx("span",{className:Ue([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",e==="speaking"&&`animate-pulse ${l.highlighted}`,e==="thinking"&&`animate-pulse ${l.muted}`])},m))})})})]})});fp.displayName="AgentTile";const mw=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:Ue(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:Ue(t),children:h.jsx(Ot.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},gw=P.forwardRef(function({trackRef:t,className:n,...r},i){var o,s;return h.jsx("div",{ref:i,className:Ue("bg-muted overflow-hidden rounded-md",n),children:h.jsx(Ot.VideoTrack,{trackRef:t,width:((o=t==null?void 0:t.publication.dimensions)==null?void 0:o.width)??0,height:((s=t==null?void 0:t.publication.dimensions)==null?void 0:s.height)??0,className:Ue("h-full w-auto"),...r})})}),Du=De.create(gw),bw=De.create(fp),yw=De.create(mw),xn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},sr={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","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 xw(e,t){const{localParticipant:n}=Rv(t),r=n==null?void 0:n.getTrackPublication(e);return N.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function vw({chatOpen:e,client:t,theme:n="vox"}){const{agent:{isActive:r=!1}={},session:i,state:o="idle",audioTrack:s,videoTrack:a}=t?Sl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null};console.log("🎨 MediaTiles render:",{chatOpen:e,isAgentActive:r,hasSession:!!i,sessionState:i==null?void 0:i.state,agentState:o,hasAudioTrack:!!s,hasVideoTrack:!!a});const[l]=Ot.useTracks([le.Track.Source.ScreenShare]),c=xw(le.Track.Source.Camera,t),u=c&&!c.publication.isMuted,d=l&&!l.publication.isMuted,f=u||d,p=r||i&&i.state==="active",g={...xn.transition,delay:e?0:.15},m={...xn.animate,scale:e?1:3,transition:g},v={...xn.animate,transition:g},y=g,E=g,w=a&&a.publication&&a.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:Ue(sr.grid),children:[p&&h.jsx("div",{className:Ue(["grid",!e&&sr.agentChatClosed,e&&f&&sr.agentChatOpenWithSecondTile,e&&!f&&sr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!w&&h.jsx(bw,{layoutId:"agent",...xn,animate:m,transition:y,state:o,audioTrack:s||void 0,theme:n,className:Ue(e?"h-[90px]":"h-auto w-full")},"agent"),w&&a&&h.jsx(yw,{layoutId:"avatar",...xn,animate:v,transition:E,videoTrack:a,className:Ue(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:Ue(["grid",e&&sr.secondTileChatOpen,!e&&sr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&u&&h.jsx(Du,{layout:"position",layoutId:"camera",...xn,trackRef:c,transition:{...xn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),d&&h.jsx(Du,{layout:"position",layoutId:"screen",...xn,trackRef:l,transition:{...xn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const ww={card:"text-gray-100 bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] border border-gray-800/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-black/90 via-black/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(75,85,99,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-gray-500/[0.12] via-gray-600/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-gray-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-100 font-semibold",secondary:"text-gray-200",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-300 via-gray-200 to-gray-300"},micButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 text-gray-100 font-bold hover:bg-gray-900 hover:border-gray-600 hover:scale-[1.02] hover:shadow-2xl hover:shadow-gray-600/30 focus:outline-none focus:ring-2 focus:ring-gray-600 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-gray-900/60 backdrop-blur-xl rounded-2xl text-center text-gray-200 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-700/50 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-gray-400 rounded-full animate-pulse shadow-lg shadow-gray-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-800/50 rounded-3xl py-4 flex flex-col justify-end h-full bg-black/90 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-black/90 backdrop-blur-xl border-gray-800/50 shadow-xl",textarea:"bg-black/80 border border-gray-800/50 rounded-xl text-gray-100 placeholder-gray-500 font-medium px-4 py-3",sendButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 disabled:border-gray-800 disabled:opacity-40 text-gray-100 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-gray-600/30",attachButton:"text-gray-400 hover:text-gray-200 hover:bg-gray-700/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/40 hover:border-red-500/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-gray-800/70 text-gray-100 backdrop-blur-md shadow-lg border border-gray-700/50",other:"bg-gray-900/60 text-gray-100 border border-gray-700/50 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-gray-900/80 border-gray-700/50 backdrop-blur-xl shadow-xl",backButton:"text-gray-300 hover:text-gray-100 hover:bg-gray-700/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-900/70 text-gray-200 border-gray-700/50 backdrop-blur-md hover:bg-gray-800/80 hover:border-gray-600 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] text-gray-100",header:"border-gray-700/50 bg-gray-900/80 backdrop-blur-xl shadow-xl",headerButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-gray-900 via-gray-900/90 to-gray-900/60 backdrop-blur-xl border-t border-gray-700/50 shadow-2xl",controlEnabled:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 hover:shadow-xl hover:shadow-gray-600/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-900/50 hover:bg-gray-900/60 text-gray-500 border border-gray-800 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/50 hover:border-red-500/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-gray-900/70 border border-gray-700/50 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-900/60 text-gray-300",avatar:"bg-gray-800/80 text-gray-300 border-2 border-gray-700/50",nameOverlay:"bg-gradient-to-t from-gray-900 via-gray-900/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Ew={card:"text-gray-900 bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] border border-gray-200/80 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-white/90 via-white/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(59,130,246,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-blue-400/[0.12] via-purple-400/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-pink-400/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-900 font-semibold",secondary:"text-gray-800",muted:"text-gray-600",accent:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-blue-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",chatButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-green-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",videoButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-black/80 rounded-3xl flex items-center justify-center hover:bg-black hover:border-black hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/30 transition-all duration-500 ease-out group overflow-hidden text-white",popupTrigger:"bg-black/90 backdrop-blur-xl border-2 border-black/80 text-white font-bold hover:bg-black hover:border-black hover:scale-[1.02] hover:shadow-2xl hover:shadow-blue-500/30 focus:outline-none focus:ring-2 focus:ring-black focus:ring-offset-2 focus:ring-offset-white transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/60 backdrop-blur-xl rounded-2xl text-center text-gray-900 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-300/80 ",statusIndicator:"w-2.5 h-2.5 bg-green-500 rounded-full animate-pulse shadow-lg shadow-green-500/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-300/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-white/80 backdrop-blur-xl border-gray-300/80 shadow-xl",textarea:"bg-white/60 border border-gray-300/50 rounded-xl text-gray-900 placeholder-gray-500 font-medium px-4 py-3",sendButton:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 disabled:border-gray-200 disabled:opacity-40 text-gray-900 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-blue-500/20",attachButton:"text-gray-600 hover:text-gray-900 hover:bg-gray-100/50 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-blue-50/70 text-gray-900 backdrop-blur-md shadow-lg border border-blue-200/80",other:"bg-white/60 text-gray-900 border border-gray-300/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-white/80 border-gray-300/80 backdrop-blur-xl shadow-xl",backButton:"text-gray-600 hover:text-gray-900 hover:bg-gray-100/50 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white/70 text-blue-700 border-gray-300/80 backdrop-blur-md hover:bg-white/80 hover:border-blue-300 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#fafafa] via-[#ffffff] to-[#fafafa] text-gray-900",header:"border-gray-300/80 bg-white/80 backdrop-blur-xl shadow-xl",headerButton:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 text-gray-900 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-green-500 animate-pulse shadow-lg shadow-green-500/60",controlsBackground:"bg-gradient-to-t from-white via-white/90 to-white/60 backdrop-blur-xl border-t border-gray-300/80 shadow-2xl",controlEnabled:"bg-white/90 hover:bg-white border-2 border-gray-300/80 hover:border-gray-400 text-gray-900 hover:scale-105 hover:shadow-xl hover:shadow-blue-500/20 transition-all duration-300 font-semibold",controlDisabled:"bg-white/50 hover:bg-white/60 text-gray-400 border border-gray-200 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-white/70 border border-gray-300/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-white/60 text-gray-700",avatar:"bg-gray-100/80 text-gray-700 border-2 border-gray-300/80",nameOverlay:"bg-gradient-to-t from-white via-white/80 to-transparent text-gray-900 backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},kw={card:" text-white bg-gradient-to-b from-[#0a0a0a] via-[#0f0f0f] to-[#0a0a0a] border border-white/[0.08] w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-black/95 via-black/50 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(79,70,229,0.06),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-indigo-600/[0.08] via-purple-600/[0.04] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-violet-600/[0.05] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0a0a0a] via-[#0f0f0f] to-[#0a0a0a] p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300"},micButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-indigo-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-black/90 backdrop-blur-xl border-2 border-white/30 rounded-3xl flex items-center justify-center hover:bg-black hover:border-white/50 hover:scale-105 hover:shadow-2xl hover:shadow-pink-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-black/90 backdrop-blur-xl border-2 border-white/30 text-white font-bold hover:bg-black hover:border-white/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-indigo-500/30 focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-black/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-white/20 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-white/[0.15] rounded-3xl py-4 flex flex-col justify-end h-full bg-black/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-black/80 backdrop-blur-xl border-white/20 shadow-xl",textarea:"bg-black/60 border border-white/10 rounded-xl text-white placeholder-white/50 font-medium px-4 py-3",sendButton:"bg-black/90 hover:bg-black border-2 border-white/30 hover:border-white/50 disabled:border-white/10 disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-indigo-500/30",attachButton:"text-white/70 hover:text-white hover:bg-white/10 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-black/70 text-white backdrop-blur-md shadow-lg border border-white/15",other:"bg-black/60 text-white border border-white/20 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-black/80 border-white/15 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-white/10 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-white mb-2",suggestedResponse:{container:"bg-black/70 text-white border-white/20 backdrop-blur-md hover:bg-black/80 hover:border-white/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#000000] via-[#0a0a0a] to-[#000000] text-white",header:"border-white/15 bg-black/80 backdrop-blur-xl shadow-xl",headerButton:"bg-black/90 hover:bg-black border-2 border-white/25 hover:border-white/40 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-black via-black/90 to-black/60 backdrop-blur-xl border-t border-white/15 shadow-2xl",controlEnabled:"bg-black/90 hover:bg-black border-2 border-white/30 hover:border-white/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-indigo-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-black/50 hover:bg-black/60 text-white/40 border border-white/10 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-black/70 border border-white/20 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-black/60 text-white/80",avatar:"bg-black/80 text-white border-2 border-white/20",nameOverlay:"bg-gradient-to-t from-black via-black/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Sw={card:"text-white bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] border border-[#2a3142]/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#0b1220]/90 via-[#0b1220]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(34,211,238,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-cyan-500/[0.12] via-sky-500/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-cyan-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-300 via-sky-300 to-cyan-300"},micButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-sky-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-sky-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-sky-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 text-white font-bold hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-cyan-500/30 focus:outline-none focus:ring-2 focus:ring-cyan-400/50 focus:ring-offset-2 focus:ring-offset-[#161a25] transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-[#1c2230]/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-[#2a3142]/80 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-[#2a3142]/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-[#161a25]/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-[#1c2230]/80 backdrop-blur-xl border-[#2a3142]/80 shadow-xl",textarea:"bg-[#1c2230]/60 border border-[#2a3142]/50 rounded-xl text-white placeholder-gray-400 font-medium px-4 py-3",sendButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 disabled:border-[#2a3142] disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-cyan-500/30",attachButton:"text-gray-400 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-[#243049]/70 text-white backdrop-blur-md shadow-lg border border-[#2a3142]/80",other:"bg-[#1c2230]/60 text-white border border-[#2a3142]/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-[#1c2230]/80 border-[#2a3142]/80 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-cyan-400 mb-2",suggestedResponse:{container:"bg-[#1c2230]/70 text-white border-[#2a3142]/80 backdrop-blur-md hover:bg-[#1c2230]/80 hover:border-cyan-400/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] text-white",header:"border-[#2a3142]/80 bg-[#1c2230]/80 backdrop-blur-xl shadow-xl",headerButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-[#161a25] via-[#161a25]/90 to-[#161a25]/60 backdrop-blur-xl border-t border-[#2a3142]/80 shadow-2xl",controlEnabled:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-cyan-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-[#1c2230]/50 hover:bg-[#1c2230]/60 text-white/40 border border-[#2a3142] transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-[#1c2230]/70 border border-[#2a3142]/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-[#1c2230]/60 text-white/80",avatar:"bg-[#171b26]/80 text-white border-2 border-[#2a3142]/80",nameOverlay:"bg-gradient-to-t from-[#161a25] via-[#161a25]/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Lu={dark:ww,light:Ew,vox:kw,midnight:Sw};function Lt(e){return Lu[e]||Lu.vox}function Fu({timeout:e}){const[t,n]=N.useState(100),r=N.useRef(null),i=N.useRef(null);return N.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(De.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 fi({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=P.useState(()=>Date.now()),s=()=>e.component?P.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Tr,{children:h.jsxs(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Fu,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.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:h.jsx(st.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Tr,{children:h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Fu,{timeout:e.timeout}),s()]})})})}}function hi({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=N.useState(e),[a,l]=N.useState(!1);N.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),N.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(st.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:dp(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}function Po({modality:e,theme:t,disabled:n=!1,showMicrophone:r=!1,microphoneEnabled:i=!0,microphoneLoading:o=!1,onToggleMicrophone:s,showCamera:a=!1,cameraEnabled:l=!0,cameraLoading:c=!1,onToggleCamera:u,showScreenShare:d=!1,screenShareEnabled:f=!1,screenShareLoading:p=!1,onToggleScreenShare:g,showChatToggle:m=!1,chatOpen:v=!1,onToggleChat:y,showTextInput:E=!1,textInputPlaceholder:w="Type a message...",onSendText:C,onSendAttachments:S,supportsAttachments:_=!1,showEndCall:R=!0,onEndCall:A}){var U;const O=Lt(t),[b,M]=N.useState(""),I=N.useRef(null),F=()=>{const x=b.trim();x&&C&&(C(x),M(""))},D=x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),F())},G=x=>{const B=Array.from(x.target.files||[]);B.length>0&&S&&S(B),I.current&&(I.current.value="")},ie=Ue("flex items-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",E?"justify-between":"justify-center",t==="light"?"bg-white/95 border-gray-200":"bg-black/90 border-gray-800"),X=(x,B)=>{var K,k,Y;return B==="end-call"?Ue("p-3 rounded-full transition-all duration-200",((K=O.video)==null?void 0:K.endCall)||"bg-red-500 text-white hover:bg-red-600",n?"opacity-50 cursor-not-allowed":"hover:scale-105"):Ue("p-3 rounded-full transition-all duration-200",x?((k=O.video)==null?void 0:k.controlEnabled)||"bg-green-500 text-white":((Y=O.video)==null?void 0:Y.controlDisabled)||"bg-gray-500 text-white",n?"opacity-50 cursor-not-allowed":"hover:scale-105")},$=()=>h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"});return h.jsxs("div",{className:ie,children:[E&&h.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[_&&S&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>{var x;return(x=I.current)==null?void 0:x.click()},disabled:n,className:Ue("p-2 rounded-full transition-all duration-200",t==="light"?"hover:bg-gray-100":"hover:bg-gray-800",n&&"opacity-50 cursor-not-allowed"),title:"Attach files",children:h.jsx(st.Paperclip,{className:"w-5 h-5"})}),h.jsx("input",{ref:I,type:"file",multiple:!0,accept:"image/*",onChange:G,className:"hidden"})]}),h.jsx("input",{type:"text",value:b,onChange:x=>M(x.target.value),onKeyDown:D,disabled:n,placeholder:w,className:Ue("flex-1 px-4 py-2 rounded-full border outline-none transition-all",t==="light"?"bg-gray-100 border-gray-300 focus:border-blue-500 text-gray-900":"bg-gray-800 border-gray-700 focus:border-blue-400 text-white",n&&"opacity-50 cursor-not-allowed")}),h.jsx("button",{onClick:F,disabled:n||!b.trim(),className:Ue("p-2 rounded-full transition-all duration-200",b.trim()?((U=O.video)==null?void 0:U.controlEnabled)||"bg-blue-500 text-white hover:bg-blue-600":t==="light"?"bg-gray-200 text-gray-400":"bg-gray-700 text-gray-500",n&&"opacity-50 cursor-not-allowed",b.trim()&&!n&&"hover:scale-105"),title:"Send message",children:h.jsx(st.SendHorizontal,{className:"w-5 h-5"})})]}),!E&&h.jsxs(h.Fragment,{children:[r&&s&&h.jsx("button",{onClick:s,disabled:n||o,className:X(i),title:i?"Mute microphone":"Unmute microphone",children:o?h.jsx($,{}):i?h.jsx(st.Mic,{className:"w-5 h-5"}):h.jsx(st.MicOff,{className:"w-5 h-5"})}),a&&u&&h.jsx("button",{onClick:u,disabled:n||c,className:X(l),title:l?"Turn off camera":"Turn on camera",children:c?h.jsx($,{}):l?h.jsx(st.Camera,{className:"w-5 h-5"}):h.jsx(st.CameraOff,{className:"w-5 h-5"})}),d&&g&&h.jsx("button",{onClick:g,disabled:n||p,className:X(f),title:f?"Stop screen share":"Share screen",children:p?h.jsx($,{}):h.jsx(st.Monitor,{className:"w-5 h-5"})}),m&&y&&h.jsx("button",{onClick:y,disabled:n,className:X(v),title:e==="voice"?v?"Hide transcription":"Show transcription":v?"Hide chat":"Show chat",children:h.jsx(st.MessageCircle,{className:"w-5 h-5"})})]}),R&&A&&h.jsx("button",{onClick:A,disabled:n,className:X(!1,"end-call"),title:"End call",children:h.jsx(st.PhoneOff,{className:"w-5 h-5"})})]})}Po.displayName="UnifiedControlBar";const Cw=({logLevel:e}={})=>{const t=Ot.useRoomContext();P.useEffect(()=>(le.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},hp=P.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return P.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&P.createElement("title",null,n),a,l.get(o))});hp.displayName="SSRBase";const _w=new Map([["bold",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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",P.createElement(P.Fragment,null,P.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"}))]]),_l=P.forwardRef((e,t)=>P.createElement(hp,{ref:t,...e,weights:_w}));_l.displayName="SpinnerIcon";function Tw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=P.useState(""),[s,a]=P.useState(0);return P.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),P.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(De.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 Nw(e,t){return e.startsWith("image/")?st.Image:e.startsWith("video/")?st.Video:e.startsWith("audio/")?st.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?st.Archive:st.FileText}function Aw(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 Mw({message:e,theme:t,isOwn:n}){const r=Lt(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,g=Nw(a),m=l||c,v=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[E,w]=P.useState(null);P.useEffect(()=>{if(f)w(f);else if(p&&a.startsWith("image/")){const R=URL.createObjectURL(p);return w(R),()=>URL.revokeObjectURL(R)}else w(null)},[f,p,a]);const C=()=>{if(f){const R=document.createElement("a");R.href=f,R.download=o,R.click()}},_=a.startsWith("image/")&&E;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[_&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:E,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:C}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
10
10
  flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
11
11
  ${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
12
12
  `,children:[h.jsx("div",{className:`
@@ -31,22 +31,22 @@
31
31
  `});++r<e.length;)r&&n.push({type:"text",value:`
32
32
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
33
33
  `}),n}function dd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fd(e,t){const n=mC(e,t),r=n.one(e,void 0),i=oC(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
34
- `},i),o}function vC(e,t){return e&&"run"in e?async function(n,r){const i=fd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fd(n,{file:r,...e||t})}}function hd(e){if(e)throw e}var Ts,pd;function wC(){if(pd)return Ts;pd=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Ts=function l(){var c,u,d,f,p,g,m=arguments[0],v=1,y=arguments.length,E=!1;for(typeof m=="boolean"&&(E=m,m=arguments[1]||{},v=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});v<y;++v)if(c=arguments[v],c!=null)for(u in c)d=a(m,u),f=a(c,u),m!==f&&(E&&f&&(o(f)||(p=i(f)))?(p?(p=!1,g=d&&i(d)?d:[]):g=d&&o(d)?d:{},s(m,{name:u,newValue:l(E,g,f)})):typeof f<"u"&&s(m,{name:u,newValue:f}));return m},Ts}var EC=wC();const Ns=Do(EC);function Pa(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 kC(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?SC(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function SC(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const fn={basename:CC,dirname:_C,extname:TC,join:NC,sep:"/"};function CC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Si(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function _C(e){if(Si(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TC(e){Si(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function NC(...e){let t=-1,n;for(;++t<e.length;)Si(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":AC(n)}function AC(e){Si(e);const t=e.codePointAt(0)===47;let n=MC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function MC(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Si(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RC={cwd:IC};function IC(){return"/"}function Da(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OC(e){if(typeof e=="string")e=new URL(e);else if(!Da(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PC(e)}function PC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const As=["history","path","basename","stem","extname","dirname"];class qp{constructor(t){let n;t?Da(t)?n={path:t}:typeof t=="string"||DC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":RC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<As.length;){const o=As[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)As.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fn.basename(this.path):void 0}set basename(t){Rs(t,"basename"),Ms(t,"basename"),this.path=fn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fn.dirname(this.path):void 0}set dirname(t){md(this.basename,"dirname"),this.path=fn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fn.extname(this.path):void 0}set extname(t){if(Ms(t,"extname"),md(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Da(t)&&(t=OC(t)),Rs(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fn.basename(this.path,this.extname):void 0}set stem(t){Rs(t,"stem"),Ms(t,"stem"),this.path=fn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Rt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ms(e,t){if(e&&e.includes(fn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fn.sep+"`")}function Rs(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function md(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LC=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},FC={}.hasOwnProperty;class $l extends LC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kC()}copy(){const t=new $l;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ns(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ps("data",this.frozen),this.namespace[t]=n,this):FC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ps("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ui(t),r=this.parser||this.Parser;return Is("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Is("process",this.parser||this.Parser),Os("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Ui(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);$C(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Is("processSync",this.parser||this.Parser),Os("processSync",this.compiler||this.Compiler),this.process(t,i),bd("processSync","process",n),r;function i(o,s){n=!0,hd(o),r=s}}run(t,n,r){gd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Ui(n);i.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):s?s(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),bd("runSync","run",r),i;function o(s,a){hd(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ui(n),i=this.compiler||this.Compiler;return Os("stringify",i),gd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ps("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Ns(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=r[f][1];Pa(m)&&Pa(p)&&(p=Ns(!0,m,p)),r[f]=[c,p,...g]}}}}const jC=new $l().freeze();function Is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Os(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ps(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gd(e){if(!Pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ui(e){return BC(e)?e:new qp(e)}function BC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $C(e){return typeof e=="string"||VC(e)}function VC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yd=[],xd={allowDangerousHtml:!0},zC=/^(https?|ircs?|mailto|xmpp)$/i,HC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WC(e){const t=GC(e),n=KC(e);return qC(t.runSync(t.parse(n),n),e)}function GC(e){const t=e.rehypePlugins||yd,n=e.remarkPlugins||yd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xd}:xd;return jC().use(_S).use(n).use(vC,r).use(t)}function KC(e){const t=e.children||"",n=new qp;return typeof t=="string"&&(n.value=t),n}function qC(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||YC;for(const u of HC)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+UC+u.id,void 0);return $o(e,c),cE(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in Ss)if(Object.hasOwn(Ss,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=Ss[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function YC(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||zC.test(e.slice(0,t))?e:""}function vd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ZC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XC(e,t,n){const i=ki((n||{}).ignore||[]),o=QC(t);let s=-1;for(;++s<o.length;)Kp(e,"text",a);function a(c,u){let d=-1,f;for(;++d<u.length;){const p=u[d],g=f?f.children:void 0;if(i(p,g?g.indexOf(p):void 0,f))return;f=p}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=o[s][0],p=o[s][1];let g=0;const v=d.children.indexOf(c);let y=!1,E=[];f.lastIndex=0;let w=f.exec(c.value);for(;w;){const C=w.index,S={index:w.index,input:w.input,stack:[...u,c]};let _=p(...w,S);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?f.lastIndex=C+1:(g!==C&&E.push({type:"text",value:c.value.slice(g,C)}),Array.isArray(_)?E.push(..._):_&&E.push(_),g=C+w[0].length,y=!0),!f.global)break;w=f.exec(c.value)}return y?(g<c.value.length&&E.push({type:"text",value:c.value.slice(g)}),d.children.splice(v,1,...E)):E=[c],v+E.length}}function QC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([JC(i[0]),e1(i[1])])}return t}function JC(e){return typeof e=="string"?new RegExp(ZC(e),"g"):e}function e1(e){return typeof e=="function"?e:function(){return e}}const Ds="phrasing",Ls=["autolink","link","image","label"];function t1(){return{transforms:[l1],enter:{literalAutolink:r1,literalAutolinkEmail:Fs,literalAutolinkHttp:Fs,literalAutolinkWww:Fs},exit:{literalAutolink:a1,literalAutolinkEmail:s1,literalAutolinkHttp:i1,literalAutolinkWww:o1}}}function n1(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ds,notInConstruct:Ls},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ds,notInConstruct:Ls},{character:":",before:"[ps]",after:"\\/",inConstruct:Ds,notInConstruct:Ls}]}}function r1(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Fs(e){this.config.enter.autolinkProtocol.call(this,e)}function i1(e){this.config.exit.autolinkProtocol.call(this,e)}function o1(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function s1(e){this.config.exit.autolinkEmail.call(this,e)}function a1(e){this.exit(e)}function l1(e){XC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,c1],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),u1]],{ignore:["link","linkReference"]})}function c1(e,t,n,r,i){let o="";if(!Yp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!d1(n)))return!1;const s=f1(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function u1(e,t,n,r){return!Yp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d1(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function f1(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=vd(e,"(");let o=vd(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Yp(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||er(n)||Lo(n))&&(!t||n!==47)}Zp.peek=w1;function h1(){this.buffer()}function p1(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function m1(){this.buffer()}function g1(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function b1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function y1(e){this.exit(e)}function x1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v1(e){this.exit(e)}function w1(){return"["}function Zp(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function E1(){return{enter:{gfmFootnoteCallString:h1,gfmFootnoteCall:p1,gfmFootnoteDefinitionLabelString:m1,gfmFootnoteDefinition:g1},exit:{gfmFootnoteCallString:b1,gfmFootnoteCall:y1,gfmFootnoteDefinitionLabelString:x1,gfmFootnoteDefinition:v1}}}function k1(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Zp},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
35
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Xp:S1))),c(),l}}function S1(e,t,n){return t===0?e:Xp(e,t,n)}function Xp(e,t,n){return(n?"":" ")+e}const C1=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qp.peek=M1;function _1(){return{canContainEols:["delete"],enter:{strikethrough:N1},exit:{strikethrough:A1}}}function T1(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:C1}],handlers:{delete:Qp}}}function N1(e){this.enter({type:"delete",children:[]},e)}function A1(e){this.exit(e)}function Qp(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function M1(){return"~"}function R1(e){return e.length}function I1(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||R1,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],v=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const E=O1(e[u][y]);if(n.alignDelimiters!==!1){const w=i(E);v[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}m.push(E)}s[u]=m,a[u]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=wd(r[d]);else{const m=wd(r);for(;++d<c;)o[d]=m}d=-1;const f=[],p=[];for(;++d<c;){const m=o[d];let v="",y="";m===99?(v=":",y=":"):m===108?v=":":m===114&&(y=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[d]-v.length-y.length);const w=v+"-".repeat(E)+y;n.alignDelimiters!==!1&&(E=v.length+E+y.length,E>l[d]&&(l[d]=E),p[d]=E),f[d]=w}s.splice(1,0,f),a.splice(1,0,p),u=-1;const g=[];for(;++u<s.length;){const m=s[u],v=a[u];d=-1;const y=[];for(;++d<c;){const E=m[d]||"";let w="",C="";if(n.alignDelimiters!==!1){const S=l[d]-(v[d]||0),_=o[d];_===114?w=" ".repeat(S):_===99?S%2?(w=" ".repeat(S/2+.5),C=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),C=w):C=" ".repeat(S)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(E),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
36
- `)}function O1(e){return e==null?"":String(e)}function wd(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function P1(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),D1);return i(),s}function D1(e,t,n){return">"+(n?"":" ")+e}function L1(e,t){return Ed(e,t.inConstruct,!0)&&!Ed(e,t.notInConstruct,!1)}function Ed(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function kd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
37
- `&&L1(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
38
- `}function F1(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function j1(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function B1(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function $1(e,t,n,r){const i=B1(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(j1(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(o,V1);return d(),f}const a=n.createTracker(r),l=i.repeat(Math.max(F1(o,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
34
+ `},i),o}function vC(e,t){return e&&"run"in e?async function(n,r){const i=fd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fd(n,{file:r,...e||t})}}function hd(e){if(e)throw e}var Ts,pd;function wC(){if(pd)return Ts;pd=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Ts=function l(){var c,u,d,f,p,g,m=arguments[0],v=1,y=arguments.length,E=!1;for(typeof m=="boolean"&&(E=m,m=arguments[1]||{},v=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});v<y;++v)if(c=arguments[v],c!=null)for(u in c)d=a(m,u),f=a(c,u),m!==f&&(E&&f&&(o(f)||(p=i(f)))?(p?(p=!1,g=d&&i(d)?d:[]):g=d&&o(d)?d:{},s(m,{name:u,newValue:l(E,g,f)})):typeof f<"u"&&s(m,{name:u,newValue:f}));return m},Ts}var EC=wC();const Ns=Do(EC);function Pa(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 kC(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?SC(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function SC(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const fn={basename:CC,dirname:_C,extname:TC,join:NC,sep:"/"};function CC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Si(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function _C(e){if(Si(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TC(e){Si(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function NC(...e){let t=-1,n;for(;++t<e.length;)Si(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":AC(n)}function AC(e){Si(e);const t=e.codePointAt(0)===47;let n=MC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function MC(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Si(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RC={cwd:IC};function IC(){return"/"}function Da(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OC(e){if(typeof e=="string")e=new URL(e);else if(!Da(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PC(e)}function PC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const As=["history","path","basename","stem","extname","dirname"];class qp{constructor(t){let n;t?Da(t)?n={path:t}:typeof t=="string"||DC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":RC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<As.length;){const o=As[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)As.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fn.basename(this.path):void 0}set basename(t){Rs(t,"basename"),Ms(t,"basename"),this.path=fn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fn.dirname(this.path):void 0}set dirname(t){md(this.basename,"dirname"),this.path=fn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fn.extname(this.path):void 0}set extname(t){if(Ms(t,"extname"),md(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Da(t)&&(t=OC(t)),Rs(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fn.basename(this.path,this.extname):void 0}set stem(t){Rs(t,"stem"),Ms(t,"stem"),this.path=fn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Rt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ms(e,t){if(e&&e.includes(fn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fn.sep+"`")}function Rs(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function md(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LC=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},FC={}.hasOwnProperty;class $l extends LC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kC()}copy(){const t=new $l;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ns(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ps("data",this.frozen),this.namespace[t]=n,this):FC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ps("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ui(t),r=this.parser||this.Parser;return Is("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Is("process",this.parser||this.Parser),Os("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Ui(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);$C(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Is("processSync",this.parser||this.Parser),Os("processSync",this.compiler||this.Compiler),this.process(t,i),bd("processSync","process",n),r;function i(o,s){n=!0,hd(o),r=s}}run(t,n,r){gd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Ui(n);i.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):s?s(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),bd("runSync","run",r),i;function o(s,a){hd(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ui(n),i=this.compiler||this.Compiler;return Os("stringify",i),gd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ps("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Ns(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=r[f][1];Pa(m)&&Pa(p)&&(p=Ns(!0,m,p)),r[f]=[c,p,...g]}}}}const jC=new $l().freeze();function Is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Os(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ps(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gd(e){if(!Pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ui(e){return BC(e)?e:new qp(e)}function BC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $C(e){return typeof e=="string"||VC(e)}function VC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yd=[],xd={allowDangerousHtml:!0},zC=/^(https?|ircs?|mailto|xmpp)$/i,HC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WC(e){const t=GC(e),n=KC(e);return qC(t.runSync(t.parse(n),n),e)}function GC(e){const t=e.rehypePlugins||yd,n=e.remarkPlugins||yd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xd}:xd;return jC().use(_S).use(n).use(vC,r).use(t)}function KC(e){const t=e.children||"",n=new qp;return typeof t=="string"&&(n.value=t),n}function qC(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||YC;for(const u of HC)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+UC+u.id,void 0);return $o(e,c),cE(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in Ss)if(Object.hasOwn(Ss,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=Ss[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function YC(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||zC.test(e.slice(0,t))?e:""}function vd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ZC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XC(e,t,n){const i=ki((n||{}).ignore||[]),o=QC(t);let s=-1;for(;++s<o.length;)Kp(e,"text",a);function a(c,u){let d=-1,f;for(;++d<u.length;){const p=u[d],g=f?f.children:void 0;if(i(p,g?g.indexOf(p):void 0,f))return;f=p}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=o[s][0],p=o[s][1];let g=0;const v=d.children.indexOf(c);let y=!1,E=[];f.lastIndex=0;let w=f.exec(c.value);for(;w;){const C=w.index,S={index:w.index,input:w.input,stack:[...u,c]};let _=p(...w,S);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?f.lastIndex=C+1:(g!==C&&E.push({type:"text",value:c.value.slice(g,C)}),Array.isArray(_)?E.push(..._):_&&E.push(_),g=C+w[0].length,y=!0),!f.global)break;w=f.exec(c.value)}return y?(g<c.value.length&&E.push({type:"text",value:c.value.slice(g)}),d.children.splice(v,1,...E)):E=[c],v+E.length}}function QC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([JC(i[0]),e_(i[1])])}return t}function JC(e){return typeof e=="string"?new RegExp(ZC(e),"g"):e}function e_(e){return typeof e=="function"?e:function(){return e}}const Ds="phrasing",Ls=["autolink","link","image","label"];function t_(){return{transforms:[l_],enter:{literalAutolink:r_,literalAutolinkEmail:Fs,literalAutolinkHttp:Fs,literalAutolinkWww:Fs},exit:{literalAutolink:a_,literalAutolinkEmail:s_,literalAutolinkHttp:i_,literalAutolinkWww:o_}}}function n_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ds,notInConstruct:Ls},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ds,notInConstruct:Ls},{character:":",before:"[ps]",after:"\\/",inConstruct:Ds,notInConstruct:Ls}]}}function r_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Fs(e){this.config.enter.autolinkProtocol.call(this,e)}function i_(e){this.config.exit.autolinkProtocol.call(this,e)}function o_(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function s_(e){this.config.exit.autolinkEmail.call(this,e)}function a_(e){this.exit(e)}function l_(e){XC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,c_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),u_]],{ignore:["link","linkReference"]})}function c_(e,t,n,r,i){let o="";if(!Yp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!d_(n)))return!1;const s=f_(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function u_(e,t,n,r){return!Yp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d_(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function f_(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=vd(e,"(");let o=vd(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Yp(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||er(n)||Lo(n))&&(!t||n!==47)}Zp.peek=w_;function h_(){this.buffer()}function p_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function m_(){this.buffer()}function g_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function b_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function y_(e){this.exit(e)}function x_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v_(e){this.exit(e)}function w_(){return"["}function Zp(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function E_(){return{enter:{gfmFootnoteCallString:h_,gfmFootnoteCall:p_,gfmFootnoteDefinitionLabelString:m_,gfmFootnoteDefinition:g_},exit:{gfmFootnoteCallString:b_,gfmFootnoteCall:y_,gfmFootnoteDefinitionLabelString:x_,gfmFootnoteDefinition:v_}}}function k_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Zp},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
35
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Xp:S_))),c(),l}}function S_(e,t,n){return t===0?e:Xp(e,t,n)}function Xp(e,t,n){return(n?"":" ")+e}const C_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qp.peek=M_;function __(){return{canContainEols:["delete"],enter:{strikethrough:N_},exit:{strikethrough:A_}}}function T_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:C_}],handlers:{delete:Qp}}}function N_(e){this.enter({type:"delete",children:[]},e)}function A_(e){this.exit(e)}function Qp(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function M_(){return"~"}function R_(e){return e.length}function I_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||R_,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],v=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const E=O_(e[u][y]);if(n.alignDelimiters!==!1){const w=i(E);v[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}m.push(E)}s[u]=m,a[u]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=wd(r[d]);else{const m=wd(r);for(;++d<c;)o[d]=m}d=-1;const f=[],p=[];for(;++d<c;){const m=o[d];let v="",y="";m===99?(v=":",y=":"):m===108?v=":":m===114&&(y=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[d]-v.length-y.length);const w=v+"-".repeat(E)+y;n.alignDelimiters!==!1&&(E=v.length+E+y.length,E>l[d]&&(l[d]=E),p[d]=E),f[d]=w}s.splice(1,0,f),a.splice(1,0,p),u=-1;const g=[];for(;++u<s.length;){const m=s[u],v=a[u];d=-1;const y=[];for(;++d<c;){const E=m[d]||"";let w="",C="";if(n.alignDelimiters!==!1){const S=l[d]-(v[d]||0),_=o[d];_===114?w=" ".repeat(S):_===99?S%2?(w=" ".repeat(S/2+.5),C=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),C=w):C=" ".repeat(S)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(E),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
36
+ `)}function O_(e){return e==null?"":String(e)}function wd(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function P_(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),D_);return i(),s}function D_(e,t,n){return">"+(n?"":" ")+e}function L_(e,t){return Ed(e,t.inConstruct,!0)&&!Ed(e,t.notInConstruct,!1)}function Ed(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function kd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
37
+ `&&L_(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
38
+ `}function F_(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function j_(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function B_(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function $_(e,t,n,r){const i=B_(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(j_(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(o,V_);return d(),f}const a=n.createTracker(r),l=i.repeat(Math.max(F_(o,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
39
39
  `,encode:["`"],...a.current()})),d()}return u+=a.move(`
40
40
  `),o&&(u+=a.move(o+`
41
- `)),u+=a.move(l),c(),u}function V1(e,t,n){return(n?"":" ")+e}function Vl(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function U1(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
42
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function z1(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wo(e,t,n){const r=Ar(e),i=Ar(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jp.peek=H1;function Jp(e,t,n,r){const i=z1(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=wo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=wo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+mi(d));const p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function H1(e,t,n){return n.options.emphasis||"*"}function W1(e,t){let n=!1;return $o(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ia}),!!((!e.depth||e.depth<3)&&Ol(e)&&(t.options.setext||n))}function G1(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(W1(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...o.current(),before:`
41
+ `)),u+=a.move(l),c(),u}function V_(e,t,n){return(n?"":" ")+e}function Vl(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function U_(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
42
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function z_(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wo(e,t,n){const r=Ar(e),i=Ar(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jp.peek=H_;function Jp(e,t,n,r){const i=z_(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=wo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=wo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+mi(d));const p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function H_(e,t,n){return n.options.emphasis||"*"}function W_(e,t){let n=!1;return $o(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ia}),!!((!e.depth||e.depth<3)&&Ol(e)&&(t.options.setext||n))}function G_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(W_(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...o.current(),before:`
43
43
  `,after:`
44
44
  `});return d(),u(),f+`
45
45
  `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
46
46
  `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
47
- `,...o.current()});return/^[\t ]/.test(c)&&(c=mi(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}em.peek=K1;function em(e){return e.value||""}function K1(){return"<"}tm.peek=q1;function tm(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),s(),c}function q1(){return"!"}nm.peek=Y1;function nm(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Y1(){return"!"}rm.peek=Z1;function rm(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function Z1(){return"`"}function im(e,t){const n=Ol(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}om.peek=X1;function om(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(im(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function X1(e,t,n){return im(e,n)?"<":"["}sm.peek=Q1;function sm(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Q1(){return"["}function Ul(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J1(e){const t=Ul(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function e_(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function am(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t_(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?e_(n):Ul(n);const a=e.ordered?s==="."?")":".":J1(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),am(n)===s&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function n_(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function r_(e,t,n,r){const i=n_(n);let o=n.bulletCurrent||Ul(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?o:o+" ".repeat(s-o.length))+d}}function i_(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const o_=ki(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function s_(e,t,n,r){return(e.children.some(function(s){return o_(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function a_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lm.peek=l_;function lm(e,t,n,r){const i=a_(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=wo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=wo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+mi(d));const p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function l_(e,t,n){return n.options.strong||"*"}function c_(e,t,n,r){return n.safe(e.value,r)}function u_(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function d_(e,t,n){const r=(am(n)+(n.options.ruleSpaces?" ":"")).repeat(u_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cm={blockquote:P1,break:kd,code:$1,definition:U1,emphasis:Jp,hardBreak:kd,heading:G1,html:em,image:tm,imageReference:nm,inlineCode:rm,link:om,linkReference:sm,list:t_,listItem:r_,paragraph:i_,root:s_,strong:lm,text:c_,thematicBreak:d_};function f_(){return{enter:{table:h_,tableData:Sd,tableHeader:Sd,tableRow:m_},exit:{codeText:g_,table:p_,tableData:js,tableHeader:js,tableRow:js}}}function h_(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function p_(e){this.exit(e),this.data.inTable=void 0}function m_(e){this.enter({type:"tableRow",children:[]},e)}function js(e){this.exit(e)}function Sd(e){this.enter({type:"tableCell",children:[]},e)}function g_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b_));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function b_(e,t){return t==="|"?t:e}function y_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
47
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=mi(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}em.peek=K_;function em(e){return e.value||""}function K_(){return"<"}tm.peek=q_;function tm(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),s(),c}function q_(){return"!"}nm.peek=Y_;function nm(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Y_(){return"!"}rm.peek=Z_;function rm(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function Z_(){return"`"}function im(e,t){const n=Ol(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}om.peek=X_;function om(e,t,n,r){const i=Vl(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(im(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function X_(e,t,n){return im(e,n)?"<":"["}sm.peek=Q_;function sm(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Q_(){return"["}function Ul(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J_(e){const t=Ul(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function e1(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function am(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t1(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?e1(n):Ul(n);const a=e.ordered?s==="."?")":".":J_(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),am(n)===s&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function n1(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function r1(e,t,n,r){const i=n1(n);let o=n.bulletCurrent||Ul(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?o:o+" ".repeat(s-o.length))+d}}function i1(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const o1=ki(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function s1(e,t,n,r){return(e.children.some(function(s){return o1(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function a1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lm.peek=l1;function lm(e,t,n,r){const i=a1(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=wo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=mi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=wo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+mi(d));const p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function l1(e,t,n){return n.options.strong||"*"}function c1(e,t,n,r){return n.safe(e.value,r)}function u1(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function d1(e,t,n){const r=(am(n)+(n.options.ruleSpaces?" ":"")).repeat(u1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cm={blockquote:P_,break:kd,code:$_,definition:U_,emphasis:Jp,hardBreak:kd,heading:G_,html:em,image:tm,imageReference:nm,inlineCode:rm,link:om,linkReference:sm,list:t1,listItem:r1,paragraph:i1,root:s1,strong:lm,text:c1,thematicBreak:d1};function f1(){return{enter:{table:h1,tableData:Sd,tableHeader:Sd,tableRow:m1},exit:{codeText:g1,table:p1,tableData:js,tableHeader:js,tableRow:js}}}function h1(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function p1(e){this.exit(e),this.data.inTable=void 0}function m1(e){this.enter({type:"tableRow",children:[]},e)}function js(e){this.exit(e)}function Sd(e){this.enter({type:"tableCell",children:[]},e)}function g1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function b1(e,t){return t==="|"?t:e}function y1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
48
48
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:s,tableCell:l,tableRow:a}};function s(p,g,m,v){return c(u(p,m,v),p.align)}function a(p,g,m,v){const y=d(p,m,v),E=c([y]);return E.slice(0,E.indexOf(`
49
- `))}function l(p,g,m,v){const y=m.enter("tableCell"),E=m.enter("phrasing"),w=m.containerPhrasing(p,{...v,before:o,after:o});return E(),y(),w}function c(p,g){return I1(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,m){const v=p.children;let y=-1;const E=[],w=g.enter("table");for(;++y<v.length;)E[y]=d(v[y],g,m);return w(),E}function d(p,g,m){const v=p.children;let y=-1;const E=[],w=g.enter("tableRow");for(;++y<v.length;)E[y]=l(v[y],p,g,m);return w(),E}function f(p,g,m){let v=cm.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function x_(){return{exit:{taskListCheckValueChecked:Cd,taskListCheckValueUnchecked:Cd,paragraph:w_}}}function v_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:E_}}}function Cd(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function E_(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=cm.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function k_(){return[t1(),E1(),_1(),f_(),x_()]}function S_(e){return{extensions:[n1(),k1(e),T1(),y_(e),v_()]}}const C_={tokenize:R_,partial:!0},um={tokenize:I_,partial:!0},dm={tokenize:O_,partial:!0},fm={tokenize:P_,partial:!0},__={tokenize:D_,partial:!0},hm={name:"wwwAutolink",tokenize:A_,previous:mm},pm={name:"protocolAutolink",tokenize:M_,previous:gm},_n={name:"emailAutolink",tokenize:N_,previous:bm},mn={};function T_(){return{text:mn}}let Wn=48;for(;Wn<123;)mn[Wn]=_n,Wn++,Wn===58?Wn=65:Wn===91&&(Wn=97);mn[43]=_n;mn[45]=_n;mn[46]=_n;mn[95]=_n;mn[72]=[_n,pm];mn[104]=[_n,pm];mn[87]=[_n,hm];mn[119]=[_n,hm];function N_(e,t,n){const r=this;let i,o;return s;function s(d){return!La(d)||!bm.call(r,r.previous)||zl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return La(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(__,u,c)(d):d===45||d===95||Mt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&Pt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function A_(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!mm.call(r,r.previous)||zl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C_,e.attempt(um,e.attempt(dm,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function M_(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&gm.call(r,r.previous)&&!zl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(Pt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||yo(d)||Qe(d)||er(d)||Lo(d)?n(d):e.attempt(um,e.attempt(dm,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function R_(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function I_(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(fm,l,a)(c):c===null||Qe(c)||er(c)||c!==45&&Lo(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function O_(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(fm,t,o)(s):s===null||Qe(s)||er(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function P_(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Qe(a)||er(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Qe(a)||er(a)?t(a):r(a)}function o(a){return Pt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Pt(a)?(e.consume(a),s):n(a)}}function D_(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Mt(o)?n(o):t(o)}}function mm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function gm(e){return!Pt(e)}function bm(e){return!(e===47||La(e))}function La(e){return e===43||e===45||e===46||e===95||Mt(e)}function zl(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const L_={tokenize:H_,partial:!0};function F_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:V_,continuation:{tokenize:U_},exit:z_}},text:{91:{name:"gfmFootnoteCall",tokenize:$_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j_,resolveTo:B_}}}}function j_(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const c=sn(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function B_(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function $_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!s||d===null||d===91||Qe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(sn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Qe(d)||(s=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function V_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(s>999||g===93&&!a||g===null||g===91||Qe(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=sn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Qe(g)||(a=!0),s++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Be(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function U_(e,t,n){return e.check(Ei,t,e.attempt(L_,t,n))}function z_(e){e.exit("gfmFootnoteDefinition")}function H_(e,t,n){const r=this;return Be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function W_(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",u,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&Wt(f,f.length,0,Fo(p,s.slice(c+1,l),a)),Wt(f,f.length,0,[["exit",d,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),Wt(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const c=this.previous,u=this.events;let d=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=Ar(c);if(g===126)return d>1?l(g):(s.consume(g),d++,p);if(d<2&&!n)return l(g);const v=s.exit("strikethroughSequenceTemporary"),y=Ar(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,a(g)}}}class G_{constructor(){this.map=[]}add(t,n,r){K_(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function K_(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function q_(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Y_(){return{flow:{null:{name:"table",tokenize:Z_,resolveAll:X_}}}}function Z_(e,t,n){const r=this;let i=0,o=0,s;return a;function a(b){let M=r.events.length-1;for(;M>-1;){const D=r.events[M][1].type;if(D==="lineEnding"||D==="linePrefix")M--;else break}const I=M>-1?r.events[M][1].type:null,F=I==="tableHead"||I==="tableRow"?_:l;return F===_&&r.parser.lazy[r.now().line]?n(b):F(b)}function l(b){return e.enter("tableHead"),e.enter("tableRow"),c(b)}function c(b){return b===124||(s=!0,o+=1),u(b)}function u(b){return b===null?n(b):xe(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):n(b):Le(b)?Be(e,u,"whitespace")(b):(o+=1,s&&(s=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(b)))}function d(b){return b===null||b===124||Qe(b)?(e.exit("data"),u(b)):(e.consume(b),b===92?f:d)}function f(b){return b===92||b===124?(e.consume(b),d):d(b)}function p(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),s=!1,Le(b)?Be(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?v(b):b===124?(s=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),m):S(b)}function m(b){return Le(b)?Be(e,v,"whitespace")(b):v(b)}function v(b){return b===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||xe(b)?C(b):S(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),E(b)):S(b)}function E(b){return b===45?(e.consume(b),E):b===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(b))}function w(b){return Le(b)?Be(e,C,"whitespace")(b):C(b)}function C(b){return b===124?g(b):b===null||xe(b)?!s||i!==o?S(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):S(b)}function S(b){return n(b)}function _(b){return e.enter("tableRow"),R(b)}function R(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),R):b===null||xe(b)?(e.exit("tableRow"),t(b)):Le(b)?Be(e,R,"whitespace")(b):(e.enter("data"),A(b))}function A(b){return b===null||b===124||Qe(b)?(e.exit("data"),R(b)):(e.consume(b),b===92?O:A)}function O(b){return b===92||b===124?(e.consume(b),A):A(b)}}function X_(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,d;const f=new G_;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(_d(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=zi(f,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=zi(f,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],d=zi(f,t,o,i,n,d)):s[1]!==0&&(d=zi(f,t,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&_d(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=q_(t.events,n))}return e}function zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},pr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=pr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=pr(t.events,n[2]),u=pr(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},pr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function _d(e,t,n,r,i){const o=[],s=pr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function pr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Q_={name:"tasklistCheck",tokenize:eT};function J_(){return{text:{91:Q_}}}function eT(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Qe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return xe(l)?t(l):Le(l)?e.check({tokenize:tT},t,n)(l):n(l)}}function tT(e,t,n){return Be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nT(e){return Np([T_(),F_(),W_(e),Y_(),J_()])}const rT={};function iT(e){const t=this,n=e||rT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nT(n)),o.push(k_()),s.push(S_(n))}const Td=function(e,t,n){const r=ki(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},rr=function(e){if(e==null)return aT;if(typeof e=="string")return sT(e);if(typeof e=="object")return oT(e);if(typeof e=="function")return Hl(e);throw new Error("Expected function, string, or array as `test`")};function oT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rr(e[n]);return Hl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function sT(e){return Hl(t);function t(n){return n.tagName===e}}function Hl(e){return t;function t(n,r,i){return!!(lT(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function lT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Nd=/\n/g,Ad=/[\t ]+/g,Fa=rr("br"),Md=rr(gT),cT=rr("p"),Rd=rr("tr"),uT=rr(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",mT,bT]),ym=rr(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function dT(e,t){const n=t||{},r="children"in e?e.children:[],i=ym(e),o=wm(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...vm(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...xm(r[a],e,{whitespace:o,breakBefore:a?void 0:i,breakAfter:a<r.length-1?Fa(r[a+1]):i}));const l=[];let c;for(a=-1;++a<s.length;){const u=s[a];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
49
+ `))}function l(p,g,m,v){const y=m.enter("tableCell"),E=m.enter("phrasing"),w=m.containerPhrasing(p,{...v,before:o,after:o});return E(),y(),w}function c(p,g){return I_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,m){const v=p.children;let y=-1;const E=[],w=g.enter("table");for(;++y<v.length;)E[y]=d(v[y],g,m);return w(),E}function d(p,g,m){const v=p.children;let y=-1;const E=[],w=g.enter("tableRow");for(;++y<v.length;)E[y]=l(v[y],p,g,m);return w(),E}function f(p,g,m){let v=cm.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function x1(){return{exit:{taskListCheckValueChecked:Cd,taskListCheckValueUnchecked:Cd,paragraph:w1}}}function v1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:E1}}}function Cd(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function E1(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=cm.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function k1(){return[t_(),E_(),__(),f1(),x1()]}function S1(e){return{extensions:[n_(),k_(e),T_(),y1(e),v1()]}}const C1={tokenize:R1,partial:!0},um={tokenize:I1,partial:!0},dm={tokenize:O1,partial:!0},fm={tokenize:P1,partial:!0},_1={tokenize:D1,partial:!0},hm={name:"wwwAutolink",tokenize:A1,previous:mm},pm={name:"protocolAutolink",tokenize:M1,previous:gm},_n={name:"emailAutolink",tokenize:N1,previous:bm},mn={};function T1(){return{text:mn}}let Wn=48;for(;Wn<123;)mn[Wn]=_n,Wn++,Wn===58?Wn=65:Wn===91&&(Wn=97);mn[43]=_n;mn[45]=_n;mn[46]=_n;mn[95]=_n;mn[72]=[_n,pm];mn[104]=[_n,pm];mn[87]=[_n,hm];mn[119]=[_n,hm];function N1(e,t,n){const r=this;let i,o;return s;function s(d){return!La(d)||!bm.call(r,r.previous)||zl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return La(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(_1,u,c)(d):d===45||d===95||Mt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&Pt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function A1(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!mm.call(r,r.previous)||zl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C1,e.attempt(um,e.attempt(dm,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function M1(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&gm.call(r,r.previous)&&!zl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(Pt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||yo(d)||Qe(d)||er(d)||Lo(d)?n(d):e.attempt(um,e.attempt(dm,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function R1(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function I1(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(fm,l,a)(c):c===null||Qe(c)||er(c)||c!==45&&Lo(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function O1(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(fm,t,o)(s):s===null||Qe(s)||er(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function P1(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Qe(a)||er(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Qe(a)||er(a)?t(a):r(a)}function o(a){return Pt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Pt(a)?(e.consume(a),s):n(a)}}function D1(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Mt(o)?n(o):t(o)}}function mm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function gm(e){return!Pt(e)}function bm(e){return!(e===47||La(e))}function La(e){return e===43||e===45||e===46||e===95||Mt(e)}function zl(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const L1={tokenize:H1,partial:!0};function F1(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:V1,continuation:{tokenize:U1},exit:z1}},text:{91:{name:"gfmFootnoteCall",tokenize:$1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j1,resolveTo:B1}}}}function j1(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const c=sn(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function B1(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function $1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!s||d===null||d===91||Qe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(sn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Qe(d)||(s=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function V1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(s>999||g===93&&!a||g===null||g===91||Qe(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=sn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Qe(g)||(a=!0),s++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Be(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function U1(e,t,n){return e.check(Ei,t,e.attempt(L1,t,n))}function z1(e){e.exit("gfmFootnoteDefinition")}function H1(e,t,n){const r=this;return Be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function W1(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",u,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&Wt(f,f.length,0,Fo(p,s.slice(c+1,l),a)),Wt(f,f.length,0,[["exit",d,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),Wt(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const c=this.previous,u=this.events;let d=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=Ar(c);if(g===126)return d>1?l(g):(s.consume(g),d++,p);if(d<2&&!n)return l(g);const v=s.exit("strikethroughSequenceTemporary"),y=Ar(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,a(g)}}}class G1{constructor(){this.map=[]}add(t,n,r){K1(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function K1(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function q1(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Y1(){return{flow:{null:{name:"table",tokenize:Z1,resolveAll:X1}}}}function Z1(e,t,n){const r=this;let i=0,o=0,s;return a;function a(b){let M=r.events.length-1;for(;M>-1;){const D=r.events[M][1].type;if(D==="lineEnding"||D==="linePrefix")M--;else break}const I=M>-1?r.events[M][1].type:null,F=I==="tableHead"||I==="tableRow"?_:l;return F===_&&r.parser.lazy[r.now().line]?n(b):F(b)}function l(b){return e.enter("tableHead"),e.enter("tableRow"),c(b)}function c(b){return b===124||(s=!0,o+=1),u(b)}function u(b){return b===null?n(b):xe(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):n(b):Le(b)?Be(e,u,"whitespace")(b):(o+=1,s&&(s=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(b)))}function d(b){return b===null||b===124||Qe(b)?(e.exit("data"),u(b)):(e.consume(b),b===92?f:d)}function f(b){return b===92||b===124?(e.consume(b),d):d(b)}function p(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),s=!1,Le(b)?Be(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?v(b):b===124?(s=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),m):S(b)}function m(b){return Le(b)?Be(e,v,"whitespace")(b):v(b)}function v(b){return b===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||xe(b)?C(b):S(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),E(b)):S(b)}function E(b){return b===45?(e.consume(b),E):b===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(b))}function w(b){return Le(b)?Be(e,C,"whitespace")(b):C(b)}function C(b){return b===124?g(b):b===null||xe(b)?!s||i!==o?S(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):S(b)}function S(b){return n(b)}function _(b){return e.enter("tableRow"),R(b)}function R(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),R):b===null||xe(b)?(e.exit("tableRow"),t(b)):Le(b)?Be(e,R,"whitespace")(b):(e.enter("data"),A(b))}function A(b){return b===null||b===124||Qe(b)?(e.exit("data"),R(b)):(e.consume(b),b===92?O:A)}function O(b){return b===92||b===124?(e.consume(b),A):A(b)}}function X1(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,d;const f=new G1;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(_d(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=zi(f,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=zi(f,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],d=zi(f,t,o,i,n,d)):s[1]!==0&&(d=zi(f,t,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&_d(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=q1(t.events,n))}return e}function zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},pr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=pr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=pr(t.events,n[2]),u=pr(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},pr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function _d(e,t,n,r,i){const o=[],s=pr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function pr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Q1={name:"tasklistCheck",tokenize:eT};function J1(){return{text:{91:Q1}}}function eT(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Qe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return xe(l)?t(l):Le(l)?e.check({tokenize:tT},t,n)(l):n(l)}}function tT(e,t,n){return Be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nT(e){return Np([T1(),F1(),W1(e),Y1(),J1()])}const rT={};function iT(e){const t=this,n=e||rT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nT(n)),o.push(k1()),s.push(S1(n))}const Td=function(e,t,n){const r=ki(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},rr=function(e){if(e==null)return aT;if(typeof e=="string")return sT(e);if(typeof e=="object")return oT(e);if(typeof e=="function")return Hl(e);throw new Error("Expected function, string, or array as `test`")};function oT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rr(e[n]);return Hl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function sT(e){return Hl(t);function t(n){return n.tagName===e}}function Hl(e){return t;function t(n,r,i){return!!(lT(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function lT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Nd=/\n/g,Ad=/[\t ]+/g,Fa=rr("br"),Md=rr(gT),cT=rr("p"),Rd=rr("tr"),uT=rr(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",mT,bT]),ym=rr(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function dT(e,t){const n=t||{},r="children"in e?e.children:[],i=ym(e),o=wm(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...vm(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...xm(r[a],e,{whitespace:o,breakBefore:a?void 0:i,breakAfter:a<r.length-1?Fa(r[a+1]):i}));const l=[];let c;for(a=-1;++a<s.length;){const u=s[a];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
50
50
  `.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function xm(e,t,n){return e.type==="element"?fT(e,t,n):e.type==="text"?n.whitespace==="normal"?vm(e,n):hT(e):[]}function fT(e,t,n){const r=wm(e,n),i=e.children||[];let o=-1,s=[];if(uT(e))return s;let a,l;for(Fa(e)||Rd(e)&&Td(t,e,Rd)?l=`
51
51
  `:cT(e)?(a=2,l=2):ym(e)&&(a=1,l=1);++o<i.length;)s=s.concat(xm(i[o],e,{whitespace:r,breakBefore:o?void 0:a,breakAfter:o<i.length-1?Fa(i[o+1]):l}));return Md(e)&&Td(t,e,Md)&&s.push(" "),a&&s.unshift(a),l&&s.push(l),s}function vm(e,t){const n=String(e.value),r=[],i=[];let o=0;for(;o<=n.length;){Nd.lastIndex=o;const l=Nd.exec(n),c=l&&"index"in l?l.index:n.length;r.push(pT(n.slice(o,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,c===n.length?t.breakAfter:!0)),o=c+1}let s=-1,a;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),a=void 0):r[s]?(typeof a=="number"&&i.push(a),i.push(r[s]),a=0):(s===0||s===r.length-1)&&i.push(0);return i}function hT(e){return[String(e.value)]}function pT(e,t,n){const r=[];let i=0,o;for(;i<e.length;){Ad.lastIndex=i;const s=Ad.exec(e);o=s?s.index:e.length,!i&&!o&&s&&!t&&r.push(""),i!==o&&r.push(e.slice(i,o)),i=s?o+s[0].length:o}return i!==o&&!n&&r.push(""),r.join(" ")}function wm(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function mT(e){return!!(e.properties||{}).hidden}function gT(e){return e.tagName==="td"||e.tagName==="th"}function bT(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function yT(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:_.concat([{begin:/\(/,end:/\)/,keywords:C,contains:_.concat(["self"]),relevance:0}]),relevance:0},A={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:C,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,A,S,_,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function xT(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=yT(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vT(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:v,built_in:[...E,...w,"set","shopt",...C,...S]},contains:[p,e.SHEBANG(),g,d,o,s,y,a,l,c,u,n]}}function wT(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"</",contains:[].concat(E,w,y,[d,{begin:e.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:v}}}function ET(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:_.concat([{begin:/\(/,end:/\)/,keywords:C,contains:_.concat(["self"]),relevance:0}]),relevance:0},A={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:C,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,A,S,_,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function kT(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=e.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},v=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[v,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},C]}}const ST=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),CT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_T=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TT=[...CT,..._T],NT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),AT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),MT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function IT(e){const t=e.regex,n=ST(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AT.join("|")+")"},{begin:":(:)?("+MT.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RT.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:NT.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TT.join("|")+")\\b"}]}}function OT(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function PT(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function DT(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function LT(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=t.either(l,c,u),f=t.concat(d,"(\\s*\\.\\s*",d,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}}var mr="[0-9](_*[0-9])*",Hi=`\\.(${mr})`,Wi="[0-9a-fA-F](_*[0-9a-fA-F])*",Id={className:"number",variants:[{begin:`(\\b(${mr})((${Hi})|\\.)?|(${Hi}))[eE][+-]?(${mr})[fFdD]?\\b`},{begin:`\\b(${mr})((${Hi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Hi})[fFdD]?\\b`},{begin:`\\b(${mr})[fFdD]\\b`},{begin:`\\b0[xX]((${Wi})\\.?|(${Wi})?\\.(${Wi}))[pP][+-]?(${mr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wi})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Em(e,t,n){return n===-1?"":e.replace(t,r=>Em(e,t,n-1))}function FT(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Em("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Id,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Id,c]}}const Od="[A-Za-z$_][0-9A-Za-z$_]*",jT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BT=["true","false","null","undefined","NaN","Infinity"],km=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Sm=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Cm=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$T=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],VT=[].concat(Cm,km,Sm);function UT(e){const t=e.regex,n=($,{after:U})=>{const x="</"+$[0].slice(1);return $.input.indexOf(x,U)!==-1},r=Od,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,U)=>{const x=$[0].length+$.index,B=$.input[x];if(B==="<"||B===","){U.ignoreMatch();return}B===">"&&(n($,{after:x})||U.ignoreMatch());let K;const k=$.input.substring(x);if(K=k.match(/^\s*=/)){U.ignoreMatch();return}if((K=k.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},a={$pattern:Od,keyword:jT,literal:BT,built_in:VT,"variable.language":$T},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},d];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(w)});const C=[].concat(E,f.contains),S=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(C)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},A={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...km,...Sm]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I($){return t.concat("(?!",$.join("|"),")")}const F={match:t.concat(/\b/,I([...Cm,"super","import"].map($=>`${$}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,E,{match:/\$\d+/},d,A,{scope:"attr",match:r+t.lookahead(":"),relevance:0},X,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},F,M,R,G,{match:/\$[(.]/}]}}function zT(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var gr="[0-9](_*[0-9])*",Gi=`\\.(${gr})`,Ki="[0-9a-fA-F](_*[0-9a-fA-F])*",HT={className:"number",variants:[{begin:`(\\b(${gr})((${Gi})|\\.)?|(${Gi}))[eE][+-]?(${gr})[fFdD]?\\b`},{begin:`\\b(${gr})((${Gi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gi})[fFdD]?\\b`},{begin:`\\b(${gr})[fFdD]\\b`},{begin:`\\b0[xX]((${Ki})\\.?|(${Ki})?\\.(${Ki}))[pP][+-]?(${gr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ki})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WT(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},c=HT,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,a,l,s,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
52
52
  `},c]}}const GT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),KT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],YT=[...KT,...qT],ZT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_m=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Tm=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),QT=_m.concat(Tm).sort().reverse();function JT(e){const t=GT(e),n=QT,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},c=function(w,C,S){return{className:w,begin:C,relevance:S}},u={$pattern:/[a-z-]+/,keyword:r,attribute:ZT.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},g={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XT.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+YT.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_m.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Tm.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,v,E,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function eN(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function tN(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,o,s]}}function nN(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rN(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function iN(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,v,y="\\1")=>{const E=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,y,r)},p=(m,v,y)=>t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,y,r),g=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",t.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=g,s.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function oN(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(D,G)=>{G.data._beginMatch=D[1]||D[2]},"on:end":(D,G)=>{G.data._beginMatch!==D[1]&&G.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
@@ -63,7 +63,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),wt=ee,Je=ye),je===void
63
63
  transition-all duration-200
64
64
  `,children:h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx("span",{className:`text-sm ${e==="light"?"text-gray-600":"text-gray-400"}`,children:"Thinking"}),[0,1,2].map(n=>h.jsx(De.div,{className:`w-1 h-1 rounded-full ${e==="light"?"bg-gray-400":"bg-gray-500"}`,animate:{y:[0,-3,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:n*.2,ease:"easeInOut"}},n))]})})})]})})}function ZN(){return h.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:[h.jsx("div",{className:"text-2xl mb-2",children:"✅"}),h.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function XN(){return h.jsxs("div",{className:"flex items-center gap-2 text-orange-600 dark:text-orange-400",children:[h.jsx("span",{className:"text-lg",children:"⏰"}),h.jsx("span",{className:"text-sm font-medium",children:"Request timed out"})]})}function QN({toolData:e}){return h.jsxs("div",{className:"flex items-center text-blue-600 dark:text-blue-400",children:[h.jsx("span",{className:"text-lg",children:"🛠️"}),h.jsx("span",{className:"text-sm font-medium",children:"Tool executed"})]})}function JN(e){const[t,n]=P.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[r,i]=P.useState(()=>{const c=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),u=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!c&&!u}),[o,s]=P.useState(new Set),[a,l]=P.useState([]);return{messages:t,setMessages:n,isLoading:r,setIsLoading:i,streamingMessages:o,setStreamingMessages:s,pendingMessages:a,setPendingMessages:l}}function eA(e){const[t,n]=P.useState("idle"),[r,i]=P.useState([]);return P.useEffect(()=>{(()=>{const u=e.getAgentState();n(u||"idle")})();const s=()=>n("thinking"),a=()=>n("speaking"),l=()=>n("idle"),c=u=>{console.log("Tool executed:",u),i(d=>[...d,u]),n("tool_execution"),setTimeout(()=>n("idle"),1e3)};return e.on("agent.thinking",s),e.on("agent.speaking",a),e.on("agent.idle",l),e.on("tool.executed",c),()=>{e.off("agent.thinking",s),e.off("agent.speaking",a),e.off("agent.idle",l),e.off("tool.executed",c)}},[e]),{agentState:t,setAgentState:n,toolExecutions:r,setToolExecutions:i}}function tA(e){const[t,n]=P.useState(()=>e.getCurrentInteraction());return P.useEffect(()=>{const r=e.getCurrentInteraction();r?(console.log("ChatView: Restoring interaction state on mount/client change:",r.methodName),n(r)):n(null)},[e]),{currentInteraction:t,setCurrentInteraction:n}}function nA(){const e=P.useRef(null),[t,n]=P.useState(!0),r=P.useCallback((a=!1)=>{if(e.current){const l=e.current;a?l.scrollTop=l.scrollHeight:l.scrollTo({top:l.scrollHeight,behavior:"smooth"})}},[]),i=P.useCallback(()=>{if(e.current){const{scrollTop:a,scrollHeight:l,clientHeight:c}=e.current;return l-a-c<100}return!0},[]),o=P.useCallback(()=>{const a=i();n(a)},[i]),s=P.useCallback((a=!1)=>{t&&r(a)},[t,r]);return{messagesContainerRef:e,shouldAutoScroll:t,setShouldAutoScroll:n,scrollToBottom:r,smartScrollToBottom:s,handleScroll:o}}function rA(){const[e,t]=P.useState(!1),[n,r]=P.useState(!1);return P.useEffect(()=>{const i=()=>{const o=navigator.userAgent.toLowerCase(),a=["android","iphone","ipad","mobile","tablet"].some(d=>o.includes(d)),l="ontouchstart"in window||navigator.maxTouchPoints>0,c=window.innerWidth<=768,u=a||l&&c;t(u),u&&r(!0)};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isFullscreen:n,setIsFullscreen:r}}function Gl({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:o,showTimer:s=!0}){const a=P.useMemo(()=>{const L=e.getCurrentAgentInfo();return Io(L)},[e]),{suggestedReplyEnabled:l,attachmentsEnabled:c}=P.useMemo(()=>cp(a),[a]),u=P.useMemo(()=>Oo(a),[a]),{messages:d,setMessages:f,setIsLoading:p,streamingMessages:g,setStreamingMessages:m,pendingMessages:v,setPendingMessages:y}=JN(e),{agentState:E,toolExecutions:w}=eA(e),{currentInteraction:C,setCurrentInteraction:S}=tA(e),{messagesContainerRef:_,shouldAutoScroll:R,setShouldAutoScroll:A,smartScrollToBottom:O,handleScroll:b,scrollToBottom:M}=nA(),{isMobile:I,isFullscreen:F,setIsFullscreen:D}=rA(),[G,ie]=P.useState(new Set),[X,$]=P.useState([]),U=Lt(t);P.useEffect(()=>(F&&I&&(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)),()=>{F&&I&&(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))}),[F,I]);const x=e.getCurrentAgentInfo(),B=(x==null?void 0:x.name)||"AI Assistant",K=B.split(" ").map(L=>L[0]).join("").toUpperCase().slice(0,2),k=P.useCallback(L=>{const se={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:L,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};f(Se=>[...Se,se])},[f]);P.useEffect(()=>{if(R&&d.length>0){O(!0);const L=setTimeout(()=>{R&&O(!1)},10);return()=>clearTimeout(L)}},[d.length,O,R]),P.useEffect(()=>{if(C&&R){O(!0);const L=setTimeout(()=>{R&&O(!1)},50);return()=>clearTimeout(L)}},[C,O,R]),P.useEffect(()=>{w.forEach(L=>{const se=`${L.created_at}-${L.type}`;G.has(se)||(console.log("Processing tool execution:",se),ie(Se=>new Set(Se).add(se)),setTimeout(()=>{const Se={id:`tool_${se}`,content:"",timestamp:new Date,sender:{id:"system",name:"System",type:"agent"},metadata:{type:"toolExecution",view:h.jsx(QN,{toolData:L})}};console.log("Adding tool message with timestamp:",Se.timestamp),f(me=>{if(me.some(Te=>Te.id===Se.id))return console.log("Tool message already exists, skipping"),me;console.log("Adding tool message to end of",me.length,"messages");const be=[...me,Se];return console.log("New messages array length:",be.length),be}),setTimeout(()=>{R&&O(!0)},0)},100))})},[w,G,f,R,O]),P.useEffect(()=>{const L=me=>{if(console.log("ChatView: Received message:",me),p(!1),C&&me.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",C.methodName),y(ne=>[...ne,me]);return}f(ne=>{var Te;if(ne.some(Ce=>Ce.id===me.id))return console.log("ChatView: Message already exists, skipping:",me.id),ne;if(console.log("ChatView: Adding new message:",me.id),me.sender.type==="agent"&&(m(Ce=>new Set(Ce).add(me.id)),!((Te=me.metadata)!=null&&Te.streaming))){const Ce=me.content.length*35+1e3;setTimeout(()=>{m(ce=>{const kt=new Set(ce);return kt.delete(me.id),kt})},Ce)}return[...ne,me]}),setTimeout(()=>{R&&O(!0)},0)},se=me=>{var ne;if(console.log("ChatView: Updated message:",me),C&&me.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",C.methodName),y(be=>{const Te=be.findIndex(Ce=>Ce.id===me.id);if(Te>=0){const Ce=[...be];return Ce[Te]=me,Ce}else return[...be,me]});return}f(be=>be.map(Te=>Te.id===me.id?{...me}:Te)),setTimeout(()=>{R&&O(!0)},0),(ne=me.metadata)!=null&&ne.streaming||m(be=>{const Te=new Set(be);return Te.delete(me.id),Te})},Se=me=>{console.log("ChatView: Sent message:",me),p(!1),f(ne=>ne.some(Te=>Te.id===me.id)?(console.log("ChatView: Sent message already exists, skipping:",me.id),ne):(console.log("ChatView: Adding sent message:",me.id),[...ne,me])),setTimeout(()=>{R&&O(!0)},0)};return e.on("chat.message.received",L),e.on("chat.message.updated",se),e.on("chat.message.sent",Se),()=>{e.off("chat.message.received",L),e.off("chat.message.updated",se),e.off("chat.message.sent",Se)}},[e,C,R,O,p,f,m,y]),P.useEffect(()=>{const L=ne=>{console.log("ChatView: RPC interaction started:",ne);const be=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",be==null?void 0:be.methodName),S(be),R&&(O(!0),setTimeout(()=>{R&&O(!1)},100))},se=ne=>{if(console.log("ChatView: RPC interaction completed:",ne),S(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages"),f(be=>{const Te=[...be];return v.forEach(Ce=>{var kt;if(!Te.some(Me=>Me.id===Ce.id)&&(console.log("ChatView: Adding queued message:",Ce.id),Te.push(Ce),Ce.sender.type==="agent"&&(m(Me=>new Set(Me).add(Ce.id)),!((kt=Ce.metadata)!=null&&kt.streaming)))){const Me=Ce.content.length*35+1e3;setTimeout(()=>{m(pt=>{const mt=new Set(pt);return mt.delete(Ce.id),mt})},Me)}}),Te}),y([]),setTimeout(()=>{R&&O(!0)},0)),ne&&ne.response&&ne.response.success){let be=null;ne.response.successView?be=ne.response.successView:ne.successView&&(be=ne.successView),f(Te=>{const Ce=[...Te].reverse().findIndex(pt=>pt.sender.type==="participant");let ce=Te.length;Ce!==-1&&(ce=Te.length-Ce);const kt={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:be||h.jsx(ZN,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(kt);const Me=[...Te];return Me.splice(ce,0,kt),Me})}},Se=async ne=>{C&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),S(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after timeout"),f(Te=>{const Ce=[...Te];return v.forEach(ce=>{var Me;if(!Ce.some(pt=>pt.id===ce.id)&&(Ce.push(ce),ce.sender.type==="agent"&&(m(pt=>new Set(pt).add(ce.id)),!((Me=ce.metadata)!=null&&Me.streaming)))){const pt=ce.content.length*35+1e3;setTimeout(()=>{m(mt=>{const en=new Set(mt);return en.delete(ce.id),en})},pt)}}),Ce}),y([]),setTimeout(()=>{R&&O(!0)},0));let be=null;ne&&ne.response&&ne.response.timeoutView?be=ne.response.timeoutView:ne&&ne.timeoutView&&(be=ne.timeoutView),f(Te=>{const Ce={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:B,type:"agent"},metadata:{type:"timeoutView",view:be||h.jsx(XN,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Ce),[...Te,Ce]}),setTimeout(()=>{e.getCurrentInteraction()||S(null)},100)},me=async ne=>{console.log("ChatView: RPC interaction dismissed:",ne),console.log("ChatView: Current interaction before dismiss:",C==null?void 0:C.methodName),S(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after dismissal"),f(be=>{const Te=[...be];return v.forEach(Ce=>{var kt;if(!Te.some(Me=>Me.id===Ce.id)&&(Te.push(Ce),Ce.sender.type==="agent"&&(m(Me=>new Set(Me).add(Ce.id)),!((kt=Ce.metadata)!=null&&kt.streaming)))){const Me=Ce.content.length*35+1e3;setTimeout(()=>{m(pt=>{const mt=new Set(pt);return mt.delete(Ce.id),mt})},Me)}}),Te}),y([]),setTimeout(()=>{R&&O(!0)},0)),setTimeout(()=>{const be=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(be==null?void 0:be.methodName)||"null"),be===null&&S(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",L),e.on("rpc.interaction.completed",se),e.on("rpc.interaction.timeout",Se),e.on("rpc.interaction.dismissed",me),()=>{e.off("rpc.interaction.started",L),e.off("rpc.interaction.completed",se),e.off("rpc.interaction.timeout",Se),e.off("rpc.interaction.dismissed",me)}},[e,R,O,B,v,C,S,f,m,y]),P.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(C==null?void 0:C.methodName)||"none")},[i,C]);const Y=async L=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),S(null)),await e.sendChatMessage(L)}catch(se){console.error("Failed to send message:",se)}},te=async L=>{try{C&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),S(null)),await e.sendAttachments(L),console.log("Attachments sent successfully:",L.map(se=>se.name))}catch(se){console.error("Failed to send attachments:",se)}};P.useEffect(()=>{const L=se=>{$(Array.isArray(se)?se:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",L),()=>{e.off("suggested.response",L)}},[e]);const j=F&&I?"fullscreen":i,q=j==="fullscreen"?F&&I?"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 contain-layout",W=j==="fullscreen"?F&&I?"flex items-center w-full justify-between px-3 h-11 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-5 h-12 border-b ${U.chatHeader.container}`:`flex items-center w-full justify-between px-4 h-12 border-b ${U.chatHeader.container}`,ue=j==="fullscreen"?F&&I?"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide w-full p-4 chat-scrollable min-h-0",Q="flex-shrink-0 !w-full",ve=()=>{D(!1),n&&n()};return h.jsxs("div",{className:`${q} relative`,children:[h.jsx("div",{className:W,children:h.jsxs("div",{className:"flex items-center justify-between w-full",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:`font-semibold text-sm leading-tight ${F&&I?"text-white":U.text.primary}`,children:B}),E==="idle"&&h.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${t==="light"?"bg-gray-100 text-gray-600":"bg-gray-700 text-gray-400"}`,children:"Idle"})]}),s&&u&&h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx(hi,{duration:u,theme:t,onTimerExpired:()=>{console.log("Session timer expired")},showIcon:!1,className:"text-xs"})}),n&&h.jsx(De.button,{onClick:ve,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1.5 rounded-md transition-all duration-200 ${F&&I?"hover:bg-white/10 text-white/70 hover:text-white":t==="light"?"hover:bg-gray-100 text-gray-400 hover:text-gray-600":"hover:bg-gray-700/40 text-gray-400 hover:text-gray-200"}`,"aria-label":"Close chat",children:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),h.jsx("div",{ref:_,className:`${ue} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:b,children:d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[h.jsx(De.div,{animate:{scale:[1,1.05,1]},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:K}),h.jsxs("p",{className:`text-base mb-2 ${F&&I?"text-white":U.text.secondary}`,children:[B," is joining..."]}),h.jsx("p",{className:`text-xs ${F&&I?"text-gray-300":U.text.muted}`,children:"Your conversation will begin shortly"})]}):h.jsx("div",{className:"w-full space-y-3 py-4 flex-1 flex flex-col justify-end",children:h.jsxs("div",{className:"space-y-3",children:[d.map((L,se)=>{var Se,me,ne,be;return h.jsx("div",{children:((Se=L.metadata)==null?void 0:Se.type)==="successView"?h.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(De.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:K}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${U.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[L.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:L.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((me=L.metadata)==null?void 0:me.type)==="timeoutView"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:K}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[L.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:L.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((ne=L.metadata)==null?void 0:ne.type)==="visualization"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:K}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[L.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:L.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((be=L.metadata)==null?void 0:be.type)==="toolExecution"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:K}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[L.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:L.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):h.jsx(qN,{message:L,theme:t,isOwn:L.sender.type==="participant",isStreaming:g.has(L.id)})},L.id)}),E==="thinking"&&!C&&h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},children:h.jsx(YN,{theme:t})}),C&&C.presentationMode==="embedded"&&h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(De.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:K}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx(fi,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},C.methodName),h.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})]})})}),!R&&h.jsx(De.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{A(!0),M(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),l&&X.length>0&&h.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:X.map((L,se)=>{var Se;return h.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
65
65
  ${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":((Se=U.suggestedResponse)==null?void 0:Se.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
66
- `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{Y(L),$([])},children:L},L+se)})}),C&&C.presentationMode!=="embedded"&&h.jsx(fi,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},C.methodName),h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:Q,children:h.jsx(Po,{modality:"chat",theme:t,disabled:r,showTextInput:!0,textInputPlaceholder:"Type a message...",onSendText:Y,onSendAttachments:c?te:void 0,supportsAttachments:c,showEndCall:!!o,onEndCall:o})})]})}const Bm=N.forwardRef(({disabled:e,sessionStarted:t,participantName:n="User",loadingText:r="Waiting for agent to connect...",theme:i="vox",client:o,displayType:s="widget",onBack:a},l)=>{var B,K,k,Y,te;const[c,u]=N.useState(!1),[d,f]=N.useState(!1),[p,g]=N.useState(!1),[m,v]=N.useState(()=>{var j;return((j=o==null?void 0:o.getCurrentInteraction)==null?void 0:j.call(o))||null}),[y,E]=N.useState(()=>t),w=N.useRef(null),C=N.useMemo(()=>{var q;const j=(q=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:q.call(o);return Io(j)},[o]),S=N.useMemo(()=>Oo(C),[C]);N.useMemo(()=>up(C),[C]);const _=N.useRef(null),[R,A]=N.useState(64);N.useLayoutEffect(()=>{const j=_.current;if(!j)return;const q=()=>A(j.offsetHeight||64);q();const W=new ResizeObserver(()=>q());return W.observe(j),window.addEventListener("resize",q),()=>{W.disconnect(),window.removeEventListener("resize",q)}},[]),Cw();const{agent:{isActive:O=!1}={}}=o?Sl(o):{agent:{isActive:!1}},b=oo(o,"microphone"),M=Lt(i),I=N.useMemo(()=>o!=null&&o.getCurrentSession?!!o.getCurrentSession():!1,[o]),F=N.useMemo(()=>o!=null&&o.getIsAgentConnected&&o.getIsAgentConnected()||p,[o,p]),D=O||F;N.useEffect(()=>{D&&y&&E(!1)},[D,y]),N.useEffect(()=>{if(t&&!D){const j=setTimeout(()=>{I&&!D&&(console.log("⚡ SessionView: Auto-connecting agent after room connection"),g(!0),f(!1))},3e3),q=setTimeout(()=>{D||(console.warn("⏱️ SessionView: Agent connection timeout after 30s"),f(!0))},3e4);return()=>{clearTimeout(j),clearTimeout(q)}}else D&&f(!1)},[t,D,I]),N.useEffect(()=>{if(!o)return;const j=()=>{v(null),u(!1),f(!1)};return o.on("connection.disconnected",j),()=>o.off("connection.disconnected",j)},[o]),N.useEffect(()=>{if(!o)return;const j=()=>{console.log("✅ SessionView: Agent connected event received"),g(!0),f(!1),E(!1)},q=j,W=j,ue=ve=>{console.log("👤 SessionView: Participant joined:",ve),ve.isLocal||j()},Q=()=>{g(!1),t&&E(!0)};return o.on("agent.connected",j),o.on("agent.speaking",q),o.on("agent.thinking",W),o.on("participant.joined",ue),o.on("connection.disconnected",Q),()=>{o.off("agent.connected",j),o.off("agent.speaking",q),o.off("agent.thinking",W),o.off("participant.joined",ue),o.off("connection.disconnected",Q)}},[o,t]),N.useEffect(()=>{if(!o)return;const j=()=>v(o.getCurrentInteraction()),q=()=>v(null);return o.on("rpc.interaction.started",j),o.on("rpc.interaction.completed",q),o.on("rpc.interaction.timeout",q),o.on("rpc.interaction.dismissed",q),()=>{o.off("rpc.interaction.started",j),o.off("rpc.interaction.completed",q),o.off("rpc.interaction.timeout",q),o.off("rpc.interaction.dismissed",q)}},[o]),N.useEffect(()=>{var q;if(!o)return;const j=(q=o.getCurrentInteraction)==null?void 0:q.call(o);v(j||null)},[o]),N.useEffect(()=>{var q,W;const j=((W=(q=o==null?void 0:o.getCurrentSession)==null?void 0:q.call(o))==null?void 0:W.id)||null;w.current,w.current=j},[o]),N.useEffect(()=>{m&&c&&u(!1)},[m,c]);const G=N.useCallback(j=>{},[]),ie=N.useCallback(()=>{var j,q,W;try{m&&(v(null),(j=o==null?void 0:o.dismissCurrentInteraction)==null||j.call(o)),u(!1),f(!1),(q=o==null?void 0:o.endSession)==null||q.call(o),(W=o==null?void 0:o.disconnect)==null||W.call(o),a==null||a()}catch(ue){console.error("Failed to end call:",ue),v(null),u(!1),f(!1),a==null||a()}},[o,m,a]),X=Ue("w-full flex flex-col items-center justify-center",s==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",M.main,s==="fullscreen"?"max-w-none":"","overflow-hidden h-full"),$=a&&(s==="popup"||s==="fullscreen"),U=N.useMemo(()=>d?"Agent is taking longer than expected...":I?"Room connected. Waiting for agent...":r,[d,I,r]),x=N.useMemo(()=>d?"Please check your connection or try again.":I?"The agent will join shortly.":"Agent is connecting... This may take a moment.",[d,I]);return y?h.jsx("main",{ref:l,className:Ue(X,"relative",e&&"pointer-events-none opacity-50"),children:($||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((B=M.chatHeader)==null?void 0:B.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"})}),S&&h.jsx(hi,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]})}):h.jsxs("main",{ref:l,className:Ue(X,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[($||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=M.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"})}),S&&h.jsx(hi,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!D&&h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(De.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:h.jsx(_l,{className:M.spinner,weight:"bold"})}),h.jsx(De.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:U}),h.jsx(De.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:x}),d&&a&&h.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((k=M.chatHeader)==null?void 0:k.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),D&&h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:Ue("absolute left-0 right-0 top-0 flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm","translate-y-0 opacity-100 delay-200"),style:{bottom:`${R}px`},children:h.jsx(Gl,{client:o,theme:i,displayType:s==="fullscreen"?"fullscreen":"widget",disabled:e,onBack:()=>u(!1),showTimer:!1})}),!c&&h.jsxs("div",{className:Ue("flex-1 flex flex-col items-center w-full h-full min-h-0",(m==null?void 0:m.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[h.jsx(De.div,{className:"w-full flex justify-center",animate:{y:(m==null?void 0:m.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:h.jsx(vw,{chatOpen:c,client:o},`media-tiles-${((te=(Y=o==null?void 0:o.getCurrentSession)==null?void 0:Y.call(o))==null?void 0:te.id)||"no-session"}`)}),h.jsx(Tr,{mode:"wait",children:m&&m.presentationMode==="embedded"&&h.jsx(De.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:Ue("w-full relative mt-4 flex justify-center",s==="fullscreen"?"max-w-4xl":"max-w-md"),children:h.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:h.jsx(fi,{interaction:m,theme:i,onDismiss:()=>{var j;return(j=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:j.call(o)},client:o,addLocalMessage:G})})},`embedded-${m.methodName}`)})]})]})]}),h.jsx(Tr,{mode:"wait",children:m&&m.presentationMode!=="embedded"&&!c&&h.jsx("div",{className:Ue("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",s==="fullscreen"?"bg-black/70":"bg-black/50"),children:h.jsx(De.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Ue("relative w-full overflow-hidden",s==="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:h.jsx(fi,{interaction:m,theme:i,onDismiss:()=>{var j;return(j=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:j.call(o)},client:o,addLocalMessage:G})},`modal-${m.methodName}`)})}),h.jsx("div",{ref:_,className:"relative z-30 mt-auto w-full",children:h.jsx(Po,{modality:"voice",theme:i,disabled:e,showMicrophone:!0,microphoneEnabled:b.enabled,microphoneLoading:b.pending,onToggleMicrophone:()=>b.toggle(),showChatToggle:!0,chatOpen:c,onToggleChat:()=>u(!c),showEndCall:!0,onEndCall:ie})})]})});Bm.displayName="SessionView";function Bd({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const o=Lt(i),s=(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 h.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?h.jsx(Ot.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):h.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:h.jsx("div",{className:"text-center",children:h.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:h.jsx(st.User,{className:"w-8 h-8"})})})}),h.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:s}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&h.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:h.jsx(st.CameraOff,{className:"w-4 h-4"})})]})}function $m({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:o}){var Y;const s=Lt(t),[a,l]=P.useState(!1),[c,u]=P.useState(!1),d=P.useMemo(()=>{const te=e.getCurrentAgentInfo();return Io(te)},[e]),{userVideoEnabled:f,agentAvatarEnabled:p,screenshareEnabled:g}=P.useMemo(()=>lp(d),[d]),m=P.useMemo(()=>Oo(d),[d]),v=P.useRef(null),[y,E]=P.useState(64);P.useLayoutEffect(()=>{const te=v.current;if(!te)return;const j=()=>E(te.offsetHeight||64);j();const q=new ResizeObserver(()=>j());return q.observe(te),window.addEventListener("resize",j),()=>{q.disconnect(),window.removeEventListener("resize",j)}},[]);const[w,C]=P.useState(null),S=Iv(e),{videoTrackRefs:_,screenShareTrackRefs:R}=Ov(e),{agent:{isActive:A=!1}={},state:O="idle",audioTrack:b}=e?Sl(e):{agent:{isActive:!1},state:"idle",audioTrack:null},M=P.useMemo(()=>e.getRemoteParticipants(),[e,S]),I=oo(e,"microphone"),F=oo(e,"camera"),D=oo(e,"screenShare"),G=P.useCallback(async()=>{F.pending||await F.toggle()},[F]),ie=P.useCallback(async()=>{D.pending||await D.toggle()},[D]),X=P.useCallback(()=>{l(te=>!te)},[]),$=P.useCallback(()=>{o?o():n&&n()},[o,n]);P.useEffect(()=>{if(!e)return;const te=j=>{console.log("📺 Video: Interactive UI state updated:",j),C(j)};return e.on("interactive.ui.update",te),e.on("interactive.ui.show",te),()=>{e.off("interactive.ui.update",te),e.off("interactive.ui.show",te)}},[e]),P.useEffect(()=>{if(A)u(!1);else{const te=setTimeout(()=>{A||u(!0)},3e4);return()=>{clearTimeout(te)}}},[A]);const U=S==null?void 0:S.localParticipant,x=P.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(te=>te.participant===U),[e,U]),K=_.filter(te=>te.participant!==U)[0],k=P.useMemo(()=>(R||[]).find(te=>te.participant===U),[R,U]);return h.jsxs("div",{className:`flex flex-col h-full ${s.video.container} relative`,children:[h.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${s.video.header}`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${s.video.statusDot}`}),h.jsx("span",{className:"font-medium",children:"Video Call"}),h.jsxs("span",{className:"text-sm opacity-70",children:[M.length+1," participant",M.length!==0?"s":""]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[m&&h.jsx(hi,{duration:m,theme:t,onTimerExpired:()=>{console.log("Session timer expired")}}),h.jsx("button",{className:`p-2 rounded-lg transition-colors ${s.video.headerButton}`,title:"Layout options",children:h.jsx(st.LayoutGrid,{className:"w-4 h-4"})})]})]}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[!A&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsxs("div",{className:"text-center",children:[h.jsx(De.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 mx-auto",children:h.jsx(_l,{className:s.spinner,weight:"bold"})}),c&&n&&h.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:n,className:`mt-4 px-4 py-2 rounded-lg ${((Y=s.chatHeader)==null?void 0:Y.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})}),A&&!a&&h.jsx("div",{className:"p-4 min-h-0 h-full",children:h.jsxs("div",{className:"relative w-full h-full rounded-lg overflow-hidden",children:[p?K?h.jsx(Bd,{trackRef:K,participant:K.participant,isLocal:!1,theme:t,className:"w-full h-full"}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsx(st.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"})})}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"mb-4",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#6721a4] to-[#5c64f6] flex items-center justify-center",children:h.jsx(st.User,{className:"w-8 h-8 text-white"})}),A&&(b?h.jsx(Ot.BarVisualizer,{barCount:5,state:O,options:{minHeight:5},trackRef:b,className:"flex items-center justify-center gap-1",children:h.jsx("span",{className:Ue(["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]"])})}):h.jsx("div",{className:"flex items-center justify-center gap-1",children:Array.from({length:5}).map((te,j)=>h.jsx("span",{className:Ue(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",O==="speaking"&&"bg-[#5c64f6]",O==="thinking"&&"animate-pulse bg-yellow-500"])},j))}))]})})}),k&&h.jsx("div",{className:"absolute bottom-4 left-0 sm:left-0 z-10 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[h.jsx(Ot.VideoTrack,{trackRef:k,className:"w-full h-full object-contain"}),h.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${s.video.nameOverlay}`,children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(st.Monitor,{className:"w-3 h-3"}),h.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),x&&f&&h.jsx("div",{className:"absolute bottom-4 right-0 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsx(Bd,{trackRef:x,participant:U||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})]}),h.jsx(Tr,{mode:"wait",children:a&&h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:Ue("absolute left-0 right-0 top-0 flex flex-col z-20",t==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm"),style:{bottom:`${y}px`},children:h.jsx(Gl,{client:e,theme:t,displayType:i==="fullscreen"?"fullscreen":"widget",disabled:r,onBack:()=>l(!1),showTimer:!1})})}),h.jsx("div",{ref:v,className:"relative z-30 mt-auto",children:h.jsx(Po,{modality:"video",theme:t,disabled:r,showMicrophone:!0,microphoneEnabled:I.enabled,microphoneLoading:I.pending,onToggleMicrophone:()=>I.toggle(),showCamera:f,cameraEnabled:F.enabled,cameraLoading:F.pending,onToggleCamera:G,showScreenShare:g,screenShareEnabled:D.enabled,screenShareLoading:D.pending,onToggleScreenShare:ie,showChatToggle:!0,chatOpen:a,onToggleChat:X,showEndCall:!0,onEndCall:$})})]})}const $d=e=>e,iA=()=>{let e=$d;return{configure(t){e=t},generate(t){return e(t)},reset(){e=$d}}},oA=iA();function Ln(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 tr(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Ln(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Yi={exports:{}},Zi={exports:{}},ze={};/** @license React v16.13.1
66
+ `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{Y(L),$([])},children:L},L+se)})}),C&&C.presentationMode!=="embedded"&&h.jsx(fi,{interaction:C,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},C.methodName),h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:Q,children:h.jsx(Po,{modality:"chat",theme:t,disabled:r,showTextInput:!0,textInputPlaceholder:"Type a message...",onSendText:Y,onSendAttachments:c?te:void 0,supportsAttachments:c,showEndCall:!!o,onEndCall:o})})]})}const Bm=N.forwardRef(({disabled:e,sessionStarted:t,participantName:n="User",loadingText:r="Waiting for agent to connect...",theme:i="vox",client:o,displayType:s="widget",onBack:a},l)=>{var B,K,k,Y,te;const[c,u]=N.useState(!1),[d,f]=N.useState(!1),[p,g]=N.useState(!1),[m,v]=N.useState(()=>{var j;return((j=o==null?void 0:o.getCurrentInteraction)==null?void 0:j.call(o))||null}),[y,E]=N.useState(()=>t),w=N.useRef(null),C=N.useMemo(()=>{var q;const j=(q=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:q.call(o);return Io(j)},[o]),S=N.useMemo(()=>Oo(C),[C]);N.useMemo(()=>up(C),[C]);const _=N.useRef(null),[R,A]=N.useState(64);N.useLayoutEffect(()=>{const j=_.current;if(!j)return;const q=()=>A(j.offsetHeight||64);q();const W=new ResizeObserver(()=>q());return W.observe(j),window.addEventListener("resize",q),()=>{W.disconnect(),window.removeEventListener("resize",q)}},[]),Cw();const{agent:{isActive:O=!1}={}}=o?Sl(o):{agent:{isActive:!1}},b=oo(o,"microphone"),M=Lt(i),I=N.useMemo(()=>o!=null&&o.getCurrentSession?!!o.getCurrentSession():!1,[o]),F=N.useMemo(()=>o!=null&&o.getIsAgentConnected&&o.getIsAgentConnected()||p,[o,p]),D=O||F;N.useEffect(()=>{D&&y&&E(!1)},[D,y]),N.useEffect(()=>{if(t&&!D){const j=setTimeout(()=>{I&&!D&&(console.log("⚡ SessionView: Auto-connecting agent after room connection"),g(!0),f(!1))},3e3),q=setTimeout(()=>{D||(console.warn("⏱️ SessionView: Agent connection timeout after 30s"),f(!0))},3e4);return()=>{clearTimeout(j),clearTimeout(q)}}else D&&f(!1)},[t,D,I]),N.useEffect(()=>{if(!o)return;const j=()=>{v(null),u(!1),f(!1)};return o.on("connection.disconnected",j),()=>o.off("connection.disconnected",j)},[o]),N.useEffect(()=>{if(!o)return;const j=()=>{console.log("✅ SessionView: Agent connected event received"),g(!0),f(!1),E(!1)},q=j,W=j,ue=ve=>{console.log("👤 SessionView: Participant joined:",ve),ve.isLocal||j()},Q=()=>{g(!1),t&&E(!0)};return o.on("agent.connected",j),o.on("agent.speaking",q),o.on("agent.thinking",W),o.on("participant.joined",ue),o.on("connection.disconnected",Q),()=>{o.off("agent.connected",j),o.off("agent.speaking",q),o.off("agent.thinking",W),o.off("participant.joined",ue),o.off("connection.disconnected",Q)}},[o,t]),N.useEffect(()=>{if(!o)return;const j=()=>v(o.getCurrentInteraction()),q=()=>v(null);return o.on("rpc.interaction.started",j),o.on("rpc.interaction.completed",q),o.on("rpc.interaction.timeout",q),o.on("rpc.interaction.dismissed",q),()=>{o.off("rpc.interaction.started",j),o.off("rpc.interaction.completed",q),o.off("rpc.interaction.timeout",q),o.off("rpc.interaction.dismissed",q)}},[o]),N.useEffect(()=>{var q;if(!o)return;const j=(q=o.getCurrentInteraction)==null?void 0:q.call(o);v(j||null)},[o]),N.useEffect(()=>{var q,W;const j=((W=(q=o==null?void 0:o.getCurrentSession)==null?void 0:q.call(o))==null?void 0:W.id)||null;w.current,w.current=j},[o]),N.useEffect(()=>{m&&c&&u(!1)},[m,c]);const G=N.useCallback(j=>{},[]),ie=N.useCallback(()=>{var j,q,W;try{m&&(v(null),(j=o==null?void 0:o.dismissCurrentInteraction)==null||j.call(o)),u(!1),f(!1),(q=o==null?void 0:o.endSession)==null||q.call(o),(W=o==null?void 0:o.disconnect)==null||W.call(o),a==null||a()}catch(ue){console.error("Failed to end call:",ue),v(null),u(!1),f(!1),a==null||a()}},[o,m,a]),X=Ue("w-full flex flex-col items-center justify-center",s==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",M.main,s==="fullscreen"?"max-w-none":"","overflow-hidden h-full"),$=a&&(s==="popup"||s==="fullscreen"),U=N.useMemo(()=>d?"Agent is taking longer than expected...":I?"Room connected. Waiting for agent...":r,[d,I,r]),x=N.useMemo(()=>d?"Please check your connection or try again.":I?"The agent will join shortly.":"Agent is connecting... This may take a moment.",[d,I]);return y?h.jsx("main",{ref:l,className:Ue(X,"relative",e&&"pointer-events-none opacity-50"),children:($||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((B=M.chatHeader)==null?void 0:B.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"})}),S&&h.jsx(hi,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]})}):h.jsxs("main",{ref:l,className:Ue(X,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[($||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=M.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"})}),S&&h.jsx(hi,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!D&&h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(De.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:h.jsx(_l,{className:M.spinner,weight:"bold"})}),h.jsx(De.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:U}),h.jsx(De.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:x}),d&&a&&h.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((k=M.chatHeader)==null?void 0:k.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),D&&h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:Ue("absolute left-0 right-0 top-0 flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-black backdrop-blur-sm","translate-y-0 opacity-100 delay-200"),style:{bottom:`${R}px`},children:h.jsx(Gl,{client:o,theme:i,displayType:s==="fullscreen"?"fullscreen":"widget",disabled:e,onBack:()=>u(!1),showTimer:!1})}),!c&&h.jsxs("div",{className:Ue("flex-1 flex flex-col items-center w-full h-full min-h-0",(m==null?void 0:m.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[h.jsx(De.div,{className:"w-full flex justify-center",animate:{y:(m==null?void 0:m.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:h.jsx(vw,{chatOpen:c,client:o,theme:i},`media-tiles-${((te=(Y=o==null?void 0:o.getCurrentSession)==null?void 0:Y.call(o))==null?void 0:te.id)||"no-session"}`)}),h.jsx(Tr,{mode:"wait",children:m&&m.presentationMode==="embedded"&&h.jsx(De.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:Ue("w-full relative mt-4 flex justify-center",s==="fullscreen"?"max-w-4xl":"max-w-md"),children:h.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:h.jsx(fi,{interaction:m,theme:i,onDismiss:()=>{var j;return(j=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:j.call(o)},client:o,addLocalMessage:G})})},`embedded-${m.methodName}`)})]})]})]}),h.jsx(Tr,{mode:"wait",children:m&&m.presentationMode!=="embedded"&&!c&&h.jsx("div",{className:Ue("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",s==="fullscreen"?"bg-black/70":"bg-black/50"),children:h.jsx(De.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Ue("relative w-full overflow-hidden",s==="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:h.jsx(fi,{interaction:m,theme:i,onDismiss:()=>{var j;return(j=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:j.call(o)},client:o,addLocalMessage:G})},`modal-${m.methodName}`)})}),h.jsx("div",{ref:_,className:"relative z-30 mt-auto w-full",children:h.jsx(Po,{modality:"voice",theme:i,disabled:e,showMicrophone:!0,microphoneEnabled:b.enabled,microphoneLoading:b.pending,onToggleMicrophone:()=>b.toggle(),showChatToggle:!0,chatOpen:c,onToggleChat:()=>u(!c),showEndCall:!0,onEndCall:ie})})]})});Bm.displayName="SessionView";function Bd({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const o=Lt(i),s=(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 h.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?h.jsx(Ot.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):h.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:h.jsx("div",{className:"text-center",children:h.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:h.jsx(st.User,{className:"w-8 h-8"})})})}),h.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:s}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&h.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:h.jsx(st.CameraOff,{className:"w-4 h-4"})})]})}function $m({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:o}){var Y;const s=Lt(t),[a,l]=P.useState(!1),[c,u]=P.useState(!1),d=P.useMemo(()=>{const te=e.getCurrentAgentInfo();return Io(te)},[e]),{userVideoEnabled:f,agentAvatarEnabled:p,screenshareEnabled:g}=P.useMemo(()=>lp(d),[d]),m=P.useMemo(()=>Oo(d),[d]),v=P.useRef(null),[y,E]=P.useState(64);P.useLayoutEffect(()=>{const te=v.current;if(!te)return;const j=()=>E(te.offsetHeight||64);j();const q=new ResizeObserver(()=>j());return q.observe(te),window.addEventListener("resize",j),()=>{q.disconnect(),window.removeEventListener("resize",j)}},[]);const[w,C]=P.useState(null),S=Iv(e),{videoTrackRefs:_,screenShareTrackRefs:R}=Ov(e),{agent:{isActive:A=!1}={},state:O="idle",audioTrack:b}=e?Sl(e):{agent:{isActive:!1},state:"idle",audioTrack:null},M=P.useMemo(()=>e.getRemoteParticipants(),[e,S]),I=oo(e,"microphone"),F=oo(e,"camera"),D=oo(e,"screenShare"),G=P.useCallback(async()=>{F.pending||await F.toggle()},[F]),ie=P.useCallback(async()=>{D.pending||await D.toggle()},[D]),X=P.useCallback(()=>{l(te=>!te)},[]),$=P.useCallback(()=>{o?o():n&&n()},[o,n]);P.useEffect(()=>{if(!e)return;const te=j=>{console.log("📺 Video: Interactive UI state updated:",j),C(j)};return e.on("interactive.ui.update",te),e.on("interactive.ui.show",te),()=>{e.off("interactive.ui.update",te),e.off("interactive.ui.show",te)}},[e]),P.useEffect(()=>{if(A)u(!1);else{const te=setTimeout(()=>{A||u(!0)},3e4);return()=>{clearTimeout(te)}}},[A]);const U=S==null?void 0:S.localParticipant,x=P.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(te=>te.participant===U),[e,U]),K=_.filter(te=>te.participant!==U)[0],k=P.useMemo(()=>(R||[]).find(te=>te.participant===U),[R,U]);return h.jsxs("div",{className:`flex flex-col h-full ${s.video.container} relative`,children:[h.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${s.video.header}`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${s.video.statusDot}`}),h.jsx("span",{className:"font-medium",children:"Video Call"}),h.jsxs("span",{className:"text-sm opacity-70",children:[M.length+1," participant",M.length!==0?"s":""]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[m&&h.jsx(hi,{duration:m,theme:t,onTimerExpired:()=>{console.log("Session timer expired")}}),h.jsx("button",{className:`p-2 rounded-lg transition-colors ${s.video.headerButton}`,title:"Layout options",children:h.jsx(st.LayoutGrid,{className:"w-4 h-4"})})]})]}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[!A&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsxs("div",{className:"text-center",children:[h.jsx(De.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 mx-auto",children:h.jsx(_l,{className:s.spinner,weight:"bold"})}),c&&n&&h.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:n,className:`mt-4 px-4 py-2 rounded-lg ${((Y=s.chatHeader)==null?void 0:Y.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})}),A&&!a&&h.jsx("div",{className:"p-4 min-h-0 h-full",children:h.jsxs("div",{className:"relative w-full h-full overflow-hidden",children:[p?K?h.jsx(Bd,{trackRef:K,participant:K.participant,isLocal:!1,theme:t,className:"w-full h-full"}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsx(st.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"})})}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"mb-4",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#6721a4] to-[#5c64f6] flex items-center justify-center",children:h.jsx(st.User,{className:"w-8 h-8 text-white"})}),A&&(b?h.jsx(Ot.BarVisualizer,{barCount:5,state:O,options:{minHeight:5},trackRef:b,className:"flex items-center justify-center gap-1",children:h.jsx("span",{className:Ue(["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]"])})}):h.jsx("div",{className:"flex items-center justify-center gap-1",children:Array.from({length:5}).map((te,j)=>h.jsx("span",{className:Ue(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",O==="speaking"&&"bg-[#5c64f6]",O==="thinking"&&"animate-pulse bg-yellow-500"])},j))}))]})})}),k&&h.jsx("div",{className:"absolute bottom-4 left-0 sm:left-0 z-10 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[h.jsx(Ot.VideoTrack,{trackRef:k,className:"w-full h-full object-contain"}),h.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${s.video.nameOverlay}`,children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(st.Monitor,{className:"w-3 h-3"}),h.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),x&&f&&h.jsx("div",{className:"absolute bottom-4 right-0 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsx(Bd,{trackRef:x,participant:U||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})]}),h.jsx(Tr,{mode:"wait",children:a&&h.jsx(De.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:Ue("absolute left-0 right-0 top-0 flex flex-col z-20",t==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm"),style:{bottom:`${y}px`},children:h.jsx(Gl,{client:e,theme:t,displayType:i==="fullscreen"?"fullscreen":"widget",disabled:r,onBack:()=>l(!1),showTimer:!1})})}),h.jsx("div",{ref:v,className:"relative z-30 mt-auto",children:h.jsx(Po,{modality:"video",theme:t,disabled:r,showMicrophone:!0,microphoneEnabled:I.enabled,microphoneLoading:I.pending,onToggleMicrophone:()=>I.toggle(),showCamera:f,cameraEnabled:F.enabled,cameraLoading:F.pending,onToggleCamera:G,showScreenShare:g,screenShareEnabled:D.enabled,screenShareLoading:D.pending,onToggleScreenShare:ie,showChatToggle:!0,chatOpen:a,onToggleChat:X,showEndCall:!0,onEndCall:$})})]})}const $d=e=>e,iA=()=>{let e=$d;return{configure(t){e=t},generate(t){return e(t)},reset(){e=$d}}},oA=iA();function Ln(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 tr(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Ln(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Yi={exports:{}},Zi={exports:{}},ze={};/** @license React v16.13.1
67
67
  * react-is.production.min.js
68
68
  *
69
69
  * Copyright (c) Facebook, Inc. and its affiliates.