@avatarfactory/react 0.1.40 → 0.1.41

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.
@@ -1,21 +1,21 @@
1
- (function(){'use strict';var Yw=Object.create;var uh=Object.defineProperty;var qw=Object.getOwnPropertyDescriptor;var Ww=Object.getOwnPropertyNames;var Qw=Object.getPrototypeOf,Xw=Object.prototype.hasOwnProperty;var Uv=(t,e)=>()=>(t&&(e=t(t=0)),e);var ri=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fv=(t,e)=>{for(var n in e)uh(t,n,{get:e[n],enumerable:true});},Kw=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ww(e))!Xw.call(t,r)&&r!==n&&uh(t,r,{get:()=>e[r],enumerable:!(i=qw(e,r))||i.enumerable});return t};var Se=(t,e,n)=>(n=t!=null?Yw(Qw(t)):{},Kw(!t||!t.__esModule?uh(n,"default",{value:t,enumerable:true}):n,t));var Xv=ri(xt=>{function hh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Yu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Oi(t){return t.length===0?null:t[0]}function Wu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,a=r>>>1;i<a;){var o=2*(i+1)-1,u=t[o],d=o+1,g=t[d];if(0>Yu(u,n))d<r&&0>Yu(g,u)?(t[i]=g,t[d]=n,i=d):(t[i]=u,t[o]=n,i=o);else if(d<r&&0>Yu(g,n))t[i]=g,t[d]=n,i=d;else break e}}return e}function Yu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}xt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vv=performance,xt.unstable_now=function(){return Vv.now()}):(ch=Date,Hv=ch.now(),xt.unstable_now=function(){return ch.now()-Hv});var Vv,ch,Hv,$i=[],Nr=[],Zw=1,ai=null,_n=3,mh=false,Uo=false,Fo=false,ph=false,jv=typeof setTimeout=="function"?setTimeout:null,Yv=typeof clearTimeout=="function"?clearTimeout:null,Gv=typeof setImmediate<"u"?setImmediate:null;function qu(t){for(var e=Oi(Nr);e!==null;){if(e.callback===null)Wu(Nr);else if(e.startTime<=t)Wu(Nr),e.sortIndex=e.expirationTime,hh($i,e);else break;e=Oi(Nr);}}function gh(t){if(Fo=false,qu(t),!Uo)if(Oi($i)!==null)Uo=true,gs||(gs=true,ps());else {var e=Oi(Nr);e!==null&&vh(gh,e.startTime-t);}}var gs=false,Vo=-1,qv=5,Wv=-1;function Qv(){return ph?true:!(xt.unstable_now()-Wv<qv)}function fh(){if(ph=false,gs){var t=xt.unstable_now();Wv=t;var e=true;try{e:{Uo=!1,Fo&&(Fo=!1,Yv(Vo),Vo=-1),mh=!0;var n=_n;try{t:{for(qu(t),ai=Oi($i);ai!==null&&!(ai.expirationTime>t&&Qv());){var i=ai.callback;if(typeof i=="function"){ai.callback=null,_n=ai.priorityLevel;var r=i(ai.expirationTime<=t);if(t=xt.unstable_now(),typeof r=="function"){ai.callback=r,qu(t),e=!0;break t}ai===Oi($i)&&Wu($i),qu(t);}else Wu($i);ai=Oi($i);}if(ai!==null)e=!0;else {var a=Oi(Nr);a!==null&&vh(gh,a.startTime-t),e=!1;}}break e}finally{ai=null,_n=n,mh=!1;}e=void 0;}}finally{e?ps():gs=false;}}}var ps;typeof Gv=="function"?ps=function(){Gv(fh);}:typeof MessageChannel<"u"?(dh=new MessageChannel,zv=dh.port2,dh.port1.onmessage=fh,ps=function(){zv.postMessage(null);}):ps=function(){jv(fh,0);};var dh,zv;function vh(t,e){Vo=jv(function(){t(xt.unstable_now());},e);}xt.unstable_IdlePriority=5;xt.unstable_ImmediatePriority=1;xt.unstable_LowPriority=4;xt.unstable_NormalPriority=3;xt.unstable_Profiling=null;xt.unstable_UserBlockingPriority=2;xt.unstable_cancelCallback=function(t){t.callback=null;};xt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):qv=0<t?Math.floor(1e3/t):5;};xt.unstable_getCurrentPriorityLevel=function(){return _n};xt.unstable_next=function(t){switch(_n){case 1:case 2:case 3:var e=3;break;default:e=_n;}var n=_n;_n=e;try{return t()}finally{_n=n;}};xt.unstable_requestPaint=function(){ph=true;};xt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3;}var n=_n;_n=t;try{return e()}finally{_n=n;}};xt.unstable_scheduleCallback=function(t,e,n){var i=xt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3;}return r=n+r,t={id:Zw++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,hh(Nr,t),Oi($i)===null&&t===Oi(Nr)&&(Fo?(Yv(Vo),Vo=-1):Fo=true,vh(gh,n-i))):(t.sortIndex=r,hh($i,t),Uo||mh||(Uo=true,gs||(gs=true,ps()))),t};xt.unstable_shouldYield=Qv;xt.unstable_wrapCallback=function(t){var e=_n;return function(){var n=_n;_n=e;try{return t.apply(this,arguments)}finally{_n=n;}}};});var Zv=ri((sN,Kv)=>{Kv.exports=Xv();});var lA=ri(xe=>{var bh=Symbol.for("react.transitional.element"),Jw=Symbol.for("react.portal"),$w=Symbol.for("react.fragment"),eM=Symbol.for("react.strict_mode"),tM=Symbol.for("react.profiler"),nM=Symbol.for("react.consumer"),iM=Symbol.for("react.context"),rM=Symbol.for("react.forward_ref"),aM=Symbol.for("react.suspense"),sM=Symbol.for("react.memo"),nA=Symbol.for("react.lazy"),oM=Symbol.for("react.activity"),Jv=Symbol.iterator;function lM(t){return t===null||typeof t!="object"?null:(t=Jv&&t[Jv]||t["@@iterator"],typeof t=="function"?t:null)}var iA={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rA=Object.assign,aA={};function As(t,e,n){this.props=t,this.context=e,this.refs=aA,this.updater=n||iA;}As.prototype.isReactComponent={};As.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState");};As.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate");};function sA(){}sA.prototype=As.prototype;function _h(t,e,n){this.props=t,this.context=e,this.refs=aA,this.updater=n||iA;}var Sh=_h.prototype=new sA;Sh.constructor=_h;rA(Sh,As.prototype);Sh.isPureReactComponent=true;var $v=Array.isArray;function yh(){}var yt={H:null,A:null,T:null,S:null},oA=Object.prototype.hasOwnProperty;function Eh(t,e,n){var i=n.ref;return {$$typeof:bh,type:t,key:e,ref:i!==void 0?i:null,props:n}}function uM(t,e){return Eh(t.type,e,t.props)}function wh(t){return typeof t=="object"&&t!==null&&t.$$typeof===bh}function cM(t){var e={"=":"=0",":":"=2"};return "$"+t.replace(/[=:]/g,function(n){return e[n]})}var eA=/\/+/g;function Ah(t,e){return typeof t=="object"&&t!==null&&t.key!=null?cM(""+t.key):e.toString(36)}function fM(t){switch(t.status){case "fulfilled":return t.value;case "rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(yh,yh):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e);},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e);})),t.status){case "fulfilled":return t.value;case "rejected":throw t.reason}}throw t}function vs(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=false;if(t===null)o=true;else switch(a){case "bigint":case "string":case "number":o=true;break;case "object":switch(t.$$typeof){case bh:case Jw:o=true;break;case nA:return o=t._init,vs(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+Ah(t,0):i,$v(r)?(n="",o!=null&&(n=o.replace(eA,"$&/")+"/"),vs(r,e,n,"",function(g){return g})):r!=null&&(wh(r)&&(r=uM(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(eA,"$&/")+"/")+o)),e.push(r)),1;o=0;var u=i===""?".":i+":";if($v(t))for(var d=0;d<t.length;d++)i=t[d],a=u+Ah(i,d),o+=vs(i,e,n,a,r);else if(d=lM(t),typeof d=="function")for(t=d.call(t),d=0;!(i=t.next()).done;)i=i.value,a=u+Ah(i,d++),o+=vs(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return vs(fM(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function Qu(t,e,n){if(t==null)return t;var i=[],r=0;return vs(t,i,"","",function(a){return e.call(n,a,r++)}),i}function dM(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n);},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n);}),t._status===-1&&(t._status=0,t._result=e);}if(t._status===1)return t._result.default;throw t._result}var tA=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},hM={map:Qu,forEach:function(t,e,n){Qu(t,function(){e.apply(this,arguments);},n);},count:function(t){var e=0;return Qu(t,function(){e++;}),e},toArray:function(t){return Qu(t,function(e){return e})||[]},only:function(t){if(!wh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};xe.Activity=oM;xe.Children=hM;xe.Component=As;xe.Fragment=$w;xe.Profiler=tM;xe.PureComponent=_h;xe.StrictMode=eM;xe.Suspense=aM;xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=yt;xe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return yt.H.useMemoCache(t)}};xe.cache=function(t){return function(){return t.apply(null,arguments)}};xe.cacheSignal=function(){return null};xe.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=rA({},t.props),r=t.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!oA.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var o=Array(a),u=0;u<a;u++)o[u]=arguments[u+2];i.children=o;}return Eh(t.type,r,i)};xe.createContext=function(t){return t={$$typeof:iM,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:nM,_context:t},t};xe.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)oA.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];r.children=u;}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return Eh(t,a,r)};xe.createRef=function(){return {current:null}};xe.forwardRef=function(t){return {$$typeof:rM,render:t}};xe.isValidElement=wh;xe.lazy=function(t){return {$$typeof:nA,_payload:{_status:-1,_result:t},_init:dM}};xe.memo=function(t,e){return {$$typeof:sM,type:t,compare:e===void 0?null:e}};xe.startTransition=function(t){var e=yt.T,n={};yt.T=n;try{var i=t(),r=yt.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(yh,tA);}catch(a){tA(a);}finally{e!==null&&n.types!==null&&(e.types=n.types),yt.T=e;}};xe.unstable_useCacheRefresh=function(){return yt.H.useCacheRefresh()};xe.use=function(t){return yt.H.use(t)};xe.useActionState=function(t,e,n){return yt.H.useActionState(t,e,n)};xe.useCallback=function(t,e){return yt.H.useCallback(t,e)};xe.useContext=function(t){return yt.H.useContext(t)};xe.useDebugValue=function(){};xe.useDeferredValue=function(t,e){return yt.H.useDeferredValue(t,e)};xe.useEffect=function(t,e){return yt.H.useEffect(t,e)};xe.useEffectEvent=function(t){return yt.H.useEffectEvent(t)};xe.useId=function(){return yt.H.useId()};xe.useImperativeHandle=function(t,e,n){return yt.H.useImperativeHandle(t,e,n)};xe.useInsertionEffect=function(t,e){return yt.H.useInsertionEffect(t,e)};xe.useLayoutEffect=function(t,e){return yt.H.useLayoutEffect(t,e)};xe.useMemo=function(t,e){return yt.H.useMemo(t,e)};xe.useOptimistic=function(t,e){return yt.H.useOptimistic(t,e)};xe.useReducer=function(t,e,n){return yt.H.useReducer(t,e,n)};xe.useRef=function(t){return yt.H.useRef(t)};xe.useState=function(t){return yt.H.useState(t)};xe.useSyncExternalStore=function(t,e,n){return yt.H.useSyncExternalStore(t,e,n)};xe.useTransition=function(){return yt.H.useTransition()};xe.version="19.2.6";});var dn=ri((lN,uA)=>{uA.exports=lA();});var fA=ri(Cn=>{var mM=dn();function cA(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Dr(){}var Tn={d:{f:Dr,r:function(){throw Error(cA(522))},D:Dr,C:Dr,L:Dr,m:Dr,X:Dr,S:Dr,M:Dr},p:0,findDOMNode:null},pM=Symbol.for("react.portal");function gM(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return {$$typeof:pM,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ho=mM.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Xu(t,e){if(t==="font")return "";if(typeof e=="string")return e==="use-credentials"?e:""}Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Tn;Cn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(cA(299));return gM(t,e,null,n)};Cn.flushSync=function(t){var e=Ho.T,n=Tn.p;try{if(Ho.T=null,Tn.p=2,t)return t()}finally{Ho.T=e,Tn.p=n,Tn.d.f();}};Cn.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Tn.d.C(t,e));};Cn.prefetchDNS=function(t){typeof t=="string"&&Tn.d.D(t);};Cn.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Xu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Tn.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Tn.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0});}};Cn.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Xu(e.as,e.crossOrigin);Tn.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0});}}else e==null&&Tn.d.M(t);};Cn.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Xu(n,e.crossOrigin);Tn.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0});}};Cn.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Xu(e.as,e.crossOrigin);Tn.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0});}else Tn.d.m(t);};Cn.requestFormReset=function(t){Tn.d.r(t);};Cn.unstable_batchedUpdates=function(t,e){return t(e)};Cn.useFormState=function(t,e,n){return Ho.H.useFormState(t,e,n)};Cn.useFormStatus=function(){return Ho.H.useHostTransitionStatus()};Cn.version="19.2.6";});var mA=ri((cN,hA)=>{function dA(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dA);}catch(t){console.error(t);}}dA(),hA.exports=fA();});var T_=ri(_f=>{var rn=Zv(),V0=dn(),vM=mA();function Y(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function H0(t){return !(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else {t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function G0(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function z0(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function pA(t){if(Cl(t)!==t)throw Error(Y(188))}function AM(t){var e=t.alternate;if(!e){if(e=Cl(t),e===null)throw Error(Y(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return pA(r),t;if(a===i)return pA(r),e;a=a.sibling;}throw Error(Y(188))}if(n.return!==i.return)n=r,i=a;else {for(var o=false,u=r.child;u;){if(u===n){o=true,n=r,i=a;break}if(u===i){o=true,i=r,n=a;break}u=u.sibling;}if(!o){for(u=a.child;u;){if(u===n){o=true,n=a,i=r;break}if(u===i){o=true,i=a,n=r;break}u=u.sibling;}if(!o)throw Error(Y(189))}}if(n.alternate!==i)throw Error(Y(190))}if(n.tag!==3)throw Error(Y(188));return n.stateNode.current===n?t:e}function j0(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=j0(t),e!==null)return e;t=t.sibling;}return null}var St=Object.assign,yM=Symbol.for("react.element"),Ku=Symbol.for("react.transitional.element"),Xo=Symbol.for("react.portal"),ws=Symbol.for("react.fragment"),Y0=Symbol.for("react.strict_mode"),rm=Symbol.for("react.profiler"),q0=Symbol.for("react.consumer"),or=Symbol.for("react.context"),$m=Symbol.for("react.forward_ref"),am=Symbol.for("react.suspense"),sm=Symbol.for("react.suspense_list"),ep=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),om=Symbol.for("react.activity"),bM=Symbol.for("react.memo_cache_sentinel"),gA=Symbol.iterator;function Go(t){return t===null||typeof t!="object"?null:(t=gA&&t[gA]||t["@@iterator"],typeof t=="function"?t:null)}var _M=Symbol.for("react.client.reference");function lm(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===_M?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ws:return "Fragment";case rm:return "Profiler";case Y0:return "StrictMode";case am:return "Suspense";case sm:return "SuspenseList";case om:return "Activity"}if(typeof t=="object")switch(t.$$typeof){case Xo:return "Portal";case or:return t.displayName||"Context";case q0:return (t._context.displayName||"Context")+".Consumer";case $m:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ep:return e=t.displayName||null,e!==null?e:lm(t.type)||"Memo";case Lr:e=t._payload,t=t._init;try{return lm(t(e))}catch{}}return null}var Ko=Array.isArray,Te=V0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it=vM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xa={pending:false,data:null,method:null,action:null},um=[],Ms=-1;function Pi(t){return {current:t}}function fn(t){0>Ms||(t.current=um[Ms],um[Ms]=null,Ms--);}function gt(t,e){Ms++,um[Ms]=t.current,t.current=e;}var Li=Pi(null),hl=Pi(null),qr=Pi(null),kc=Pi(null);function xc(t,e){switch(gt(qr,e),gt(hl,t),gt(Li,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?E0(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=E0(e),t=d_(e,t);else switch(t){case "svg":t=1;break;case "math":t=2;break;default:t=0;}}fn(Li),gt(Li,t);}function zs(){fn(Li),fn(hl),fn(qr);}function cm(t){t.memoizedState!==null&&gt(kc,t);var e=Li.current,n=d_(e,t.type);e!==n&&(gt(hl,t),gt(Li,n));}function Oc(t){hl.current===t&&(fn(Li),fn(hl)),kc.current===t&&(fn(kc),wl._currentValue=xa);}var Mh,vA;function Ta(t){if(Mh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Mh=e&&e[1]||"",vA=-1<n.stack.indexOf(`
1
+ (function(){'use strict';var qw=Object.create;var ch=Object.defineProperty;var Qw=Object.getOwnPropertyDescriptor;var Xw=Object.getOwnPropertyNames;var Kw=Object.getPrototypeOf,Zw=Object.prototype.hasOwnProperty;var Vv=(t,e)=>()=>(t&&(e=t(t=0)),e);var ri=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Hv=(t,e)=>{for(var n in e)ch(t,n,{get:e[n],enumerable:true});},Jw=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xw(e))!Zw.call(t,r)&&r!==n&&ch(t,r,{get:()=>e[r],enumerable:!(i=Qw(e,r))||i.enumerable});return t};var Se=(t,e,n)=>(n=t!=null?qw(Kw(t)):{},Jw(!t||!t.__esModule?ch(n,"default",{value:t,enumerable:true}):n,t));var Zv=ri(xt=>{function mh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Wu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Oi(t){return t.length===0?null:t[0]}function Qu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,a=r>>>1;i<a;){var o=2*(i+1)-1,u=t[o],d=o+1,g=t[d];if(0>Wu(u,n))d<r&&0>Wu(g,u)?(t[i]=g,t[d]=n,i=d):(t[i]=u,t[o]=n,i=o);else if(d<r&&0>Wu(g,n))t[i]=g,t[d]=n,i=d;else break e}}return e}function Wu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}xt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Gv=performance,xt.unstable_now=function(){return Gv.now()}):(fh=Date,zv=fh.now(),xt.unstable_now=function(){return fh.now()-zv});var Gv,fh,zv,$i=[],Nr=[],$w=1,ai=null,_n=3,ph=false,Uo=false,Fo=false,gh=false,Wv=typeof setTimeout=="function"?setTimeout:null,qv=typeof clearTimeout=="function"?clearTimeout:null,jv=typeof setImmediate<"u"?setImmediate:null;function qu(t){for(var e=Oi(Nr);e!==null;){if(e.callback===null)Qu(Nr);else if(e.startTime<=t)Qu(Nr),e.sortIndex=e.expirationTime,mh($i,e);else break;e=Oi(Nr);}}function vh(t){if(Fo=false,qu(t),!Uo)if(Oi($i)!==null)Uo=true,gs||(gs=true,ps());else {var e=Oi(Nr);e!==null&&Ah(vh,e.startTime-t);}}var gs=false,Vo=-1,Qv=5,Xv=-1;function Kv(){return gh?true:!(xt.unstable_now()-Xv<Qv)}function dh(){if(gh=false,gs){var t=xt.unstable_now();Xv=t;var e=true;try{e:{Uo=!1,Fo&&(Fo=!1,qv(Vo),Vo=-1),ph=!0;var n=_n;try{t:{for(qu(t),ai=Oi($i);ai!==null&&!(ai.expirationTime>t&&Kv());){var i=ai.callback;if(typeof i=="function"){ai.callback=null,_n=ai.priorityLevel;var r=i(ai.expirationTime<=t);if(t=xt.unstable_now(),typeof r=="function"){ai.callback=r,qu(t),e=!0;break t}ai===Oi($i)&&Qu($i),qu(t);}else Qu($i);ai=Oi($i);}if(ai!==null)e=!0;else {var a=Oi(Nr);a!==null&&Ah(vh,a.startTime-t),e=!1;}}break e}finally{ai=null,_n=n,ph=!1;}e=void 0;}}finally{e?ps():gs=false;}}}var ps;typeof jv=="function"?ps=function(){jv(dh);}:typeof MessageChannel<"u"?(hh=new MessageChannel,Yv=hh.port2,hh.port1.onmessage=dh,ps=function(){Yv.postMessage(null);}):ps=function(){Wv(dh,0);};var hh,Yv;function Ah(t,e){Vo=Wv(function(){t(xt.unstable_now());},e);}xt.unstable_IdlePriority=5;xt.unstable_ImmediatePriority=1;xt.unstable_LowPriority=4;xt.unstable_NormalPriority=3;xt.unstable_Profiling=null;xt.unstable_UserBlockingPriority=2;xt.unstable_cancelCallback=function(t){t.callback=null;};xt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Qv=0<t?Math.floor(1e3/t):5;};xt.unstable_getCurrentPriorityLevel=function(){return _n};xt.unstable_next=function(t){switch(_n){case 1:case 2:case 3:var e=3;break;default:e=_n;}var n=_n;_n=e;try{return t()}finally{_n=n;}};xt.unstable_requestPaint=function(){gh=true;};xt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3;}var n=_n;_n=t;try{return e()}finally{_n=n;}};xt.unstable_scheduleCallback=function(t,e,n){var i=xt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3;}return r=n+r,t={id:$w++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,mh(Nr,t),Oi($i)===null&&t===Oi(Nr)&&(Fo?(qv(Vo),Vo=-1):Fo=true,Ah(vh,n-i))):(t.sortIndex=r,mh($i,t),Uo||ph||(Uo=true,gs||(gs=true,ps()))),t};xt.unstable_shouldYield=Kv;xt.unstable_wrapCallback=function(t){var e=_n;return function(){var n=_n;_n=e;try{return t.apply(this,arguments)}finally{_n=n;}}};});var $v=ri((fN,Jv)=>{Jv.exports=Zv();});var cA=ri(xe=>{var _h=Symbol.for("react.transitional.element"),eM=Symbol.for("react.portal"),tM=Symbol.for("react.fragment"),nM=Symbol.for("react.strict_mode"),iM=Symbol.for("react.profiler"),rM=Symbol.for("react.consumer"),aM=Symbol.for("react.context"),sM=Symbol.for("react.forward_ref"),oM=Symbol.for("react.suspense"),lM=Symbol.for("react.memo"),rA=Symbol.for("react.lazy"),uM=Symbol.for("react.activity"),eA=Symbol.iterator;function cM(t){return t===null||typeof t!="object"?null:(t=eA&&t[eA]||t["@@iterator"],typeof t=="function"?t:null)}var aA={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sA=Object.assign,oA={};function As(t,e,n){this.props=t,this.context=e,this.refs=oA,this.updater=n||aA;}As.prototype.isReactComponent={};As.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState");};As.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate");};function lA(){}lA.prototype=As.prototype;function Sh(t,e,n){this.props=t,this.context=e,this.refs=oA,this.updater=n||aA;}var Eh=Sh.prototype=new lA;Eh.constructor=Sh;sA(Eh,As.prototype);Eh.isPureReactComponent=true;var tA=Array.isArray;function bh(){}var yt={H:null,A:null,T:null,S:null},uA=Object.prototype.hasOwnProperty;function wh(t,e,n){var i=n.ref;return {$$typeof:_h,type:t,key:e,ref:i!==void 0?i:null,props:n}}function fM(t,e){return wh(t.type,e,t.props)}function Mh(t){return typeof t=="object"&&t!==null&&t.$$typeof===_h}function dM(t){var e={"=":"=0",":":"=2"};return "$"+t.replace(/[=:]/g,function(n){return e[n]})}var nA=/\/+/g;function yh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?dM(""+t.key):e.toString(36)}function hM(t){switch(t.status){case "fulfilled":return t.value;case "rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(bh,bh):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e);},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e);})),t.status){case "fulfilled":return t.value;case "rejected":throw t.reason}}throw t}function vs(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=false;if(t===null)o=true;else switch(a){case "bigint":case "string":case "number":o=true;break;case "object":switch(t.$$typeof){case _h:case eM:o=true;break;case rA:return o=t._init,vs(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+yh(t,0):i,tA(r)?(n="",o!=null&&(n=o.replace(nA,"$&/")+"/"),vs(r,e,n,"",function(g){return g})):r!=null&&(Mh(r)&&(r=fM(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(nA,"$&/")+"/")+o)),e.push(r)),1;o=0;var u=i===""?".":i+":";if(tA(t))for(var d=0;d<t.length;d++)i=t[d],a=u+yh(i,d),o+=vs(i,e,n,a,r);else if(d=cM(t),typeof d=="function")for(t=d.call(t),d=0;!(i=t.next()).done;)i=i.value,a=u+yh(i,d++),o+=vs(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return vs(hM(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function Xu(t,e,n){if(t==null)return t;var i=[],r=0;return vs(t,i,"","",function(a){return e.call(n,a,r++)}),i}function mM(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n);},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n);}),t._status===-1&&(t._status=0,t._result=e);}if(t._status===1)return t._result.default;throw t._result}var iA=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},pM={map:Xu,forEach:function(t,e,n){Xu(t,function(){e.apply(this,arguments);},n);},count:function(t){var e=0;return Xu(t,function(){e++;}),e},toArray:function(t){return Xu(t,function(e){return e})||[]},only:function(t){if(!Mh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};xe.Activity=uM;xe.Children=pM;xe.Component=As;xe.Fragment=tM;xe.Profiler=iM;xe.PureComponent=Sh;xe.StrictMode=nM;xe.Suspense=oM;xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=yt;xe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return yt.H.useMemoCache(t)}};xe.cache=function(t){return function(){return t.apply(null,arguments)}};xe.cacheSignal=function(){return null};xe.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=sA({},t.props),r=t.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!uA.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var o=Array(a),u=0;u<a;u++)o[u]=arguments[u+2];i.children=o;}return wh(t.type,r,i)};xe.createContext=function(t){return t={$$typeof:aM,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:rM,_context:t},t};xe.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)uA.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];r.children=u;}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return wh(t,a,r)};xe.createRef=function(){return {current:null}};xe.forwardRef=function(t){return {$$typeof:sM,render:t}};xe.isValidElement=Mh;xe.lazy=function(t){return {$$typeof:rA,_payload:{_status:-1,_result:t},_init:mM}};xe.memo=function(t,e){return {$$typeof:lM,type:t,compare:e===void 0?null:e}};xe.startTransition=function(t){var e=yt.T,n={};yt.T=n;try{var i=t(),r=yt.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(bh,iA);}catch(a){iA(a);}finally{e!==null&&n.types!==null&&(e.types=n.types),yt.T=e;}};xe.unstable_useCacheRefresh=function(){return yt.H.useCacheRefresh()};xe.use=function(t){return yt.H.use(t)};xe.useActionState=function(t,e,n){return yt.H.useActionState(t,e,n)};xe.useCallback=function(t,e){return yt.H.useCallback(t,e)};xe.useContext=function(t){return yt.H.useContext(t)};xe.useDebugValue=function(){};xe.useDeferredValue=function(t,e){return yt.H.useDeferredValue(t,e)};xe.useEffect=function(t,e){return yt.H.useEffect(t,e)};xe.useEffectEvent=function(t){return yt.H.useEffectEvent(t)};xe.useId=function(){return yt.H.useId()};xe.useImperativeHandle=function(t,e,n){return yt.H.useImperativeHandle(t,e,n)};xe.useInsertionEffect=function(t,e){return yt.H.useInsertionEffect(t,e)};xe.useLayoutEffect=function(t,e){return yt.H.useLayoutEffect(t,e)};xe.useMemo=function(t,e){return yt.H.useMemo(t,e)};xe.useOptimistic=function(t,e){return yt.H.useOptimistic(t,e)};xe.useReducer=function(t,e,n){return yt.H.useReducer(t,e,n)};xe.useRef=function(t){return yt.H.useRef(t)};xe.useState=function(t){return yt.H.useState(t)};xe.useSyncExternalStore=function(t,e,n){return yt.H.useSyncExternalStore(t,e,n)};xe.useTransition=function(){return yt.H.useTransition()};xe.version="19.2.6";});var dn=ri((hN,fA)=>{fA.exports=cA();});var hA=ri(Cn=>{var gM=dn();function dA(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Dr(){}var Tn={d:{f:Dr,r:function(){throw Error(dA(522))},D:Dr,C:Dr,L:Dr,m:Dr,X:Dr,S:Dr,M:Dr},p:0,findDOMNode:null},vM=Symbol.for("react.portal");function AM(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return {$$typeof:vM,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ho=gM.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ku(t,e){if(t==="font")return "";if(typeof e=="string")return e==="use-credentials"?e:""}Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Tn;Cn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(dA(299));return AM(t,e,null,n)};Cn.flushSync=function(t){var e=Ho.T,n=Tn.p;try{if(Ho.T=null,Tn.p=2,t)return t()}finally{Ho.T=e,Tn.p=n,Tn.d.f();}};Cn.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Tn.d.C(t,e));};Cn.prefetchDNS=function(t){typeof t=="string"&&Tn.d.D(t);};Cn.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Ku(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Tn.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Tn.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0});}};Cn.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Ku(e.as,e.crossOrigin);Tn.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0});}}else e==null&&Tn.d.M(t);};Cn.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Ku(n,e.crossOrigin);Tn.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0});}};Cn.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Ku(e.as,e.crossOrigin);Tn.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0});}else Tn.d.m(t);};Cn.requestFormReset=function(t){Tn.d.r(t);};Cn.unstable_batchedUpdates=function(t,e){return t(e)};Cn.useFormState=function(t,e,n){return Ho.H.useFormState(t,e,n)};Cn.useFormStatus=function(){return Ho.H.useHostTransitionStatus()};Cn.version="19.2.6";});var gA=ri((pN,pA)=>{function mA(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mA);}catch(t){console.error(t);}}mA(),pA.exports=hA();});var R_=ri(Sf=>{var rn=$v(),G0=dn(),yM=gA();function Y(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function z0(t){return !(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else {t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function j0(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Y0(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function vA(t){if(Cl(t)!==t)throw Error(Y(188))}function bM(t){var e=t.alternate;if(!e){if(e=Cl(t),e===null)throw Error(Y(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return vA(r),t;if(a===i)return vA(r),e;a=a.sibling;}throw Error(Y(188))}if(n.return!==i.return)n=r,i=a;else {for(var o=false,u=r.child;u;){if(u===n){o=true,n=r,i=a;break}if(u===i){o=true,i=r,n=a;break}u=u.sibling;}if(!o){for(u=a.child;u;){if(u===n){o=true,n=a,i=r;break}if(u===i){o=true,i=a,n=r;break}u=u.sibling;}if(!o)throw Error(Y(189))}}if(n.alternate!==i)throw Error(Y(190))}if(n.tag!==3)throw Error(Y(188));return n.stateNode.current===n?t:e}function W0(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=W0(t),e!==null)return e;t=t.sibling;}return null}var St=Object.assign,_M=Symbol.for("react.element"),Zu=Symbol.for("react.transitional.element"),Xo=Symbol.for("react.portal"),ws=Symbol.for("react.fragment"),q0=Symbol.for("react.strict_mode"),am=Symbol.for("react.profiler"),Q0=Symbol.for("react.consumer"),or=Symbol.for("react.context"),ep=Symbol.for("react.forward_ref"),sm=Symbol.for("react.suspense"),om=Symbol.for("react.suspense_list"),tp=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),lm=Symbol.for("react.activity"),SM=Symbol.for("react.memo_cache_sentinel"),AA=Symbol.iterator;function Go(t){return t===null||typeof t!="object"?null:(t=AA&&t[AA]||t["@@iterator"],typeof t=="function"?t:null)}var EM=Symbol.for("react.client.reference");function um(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===EM?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ws:return "Fragment";case am:return "Profiler";case q0:return "StrictMode";case sm:return "Suspense";case om:return "SuspenseList";case lm:return "Activity"}if(typeof t=="object")switch(t.$$typeof){case Xo:return "Portal";case or:return t.displayName||"Context";case Q0:return (t._context.displayName||"Context")+".Consumer";case ep:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case tp:return e=t.displayName||null,e!==null?e:um(t.type)||"Memo";case Lr:e=t._payload,t=t._init;try{return um(t(e))}catch{}}return null}var Ko=Array.isArray,Te=G0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it=yM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xa={pending:false,data:null,method:null,action:null},cm=[],Ms=-1;function Pi(t){return {current:t}}function fn(t){0>Ms||(t.current=cm[Ms],cm[Ms]=null,Ms--);}function gt(t,e){Ms++,cm[Ms]=t.current,t.current=e;}var Li=Pi(null),hl=Pi(null),Wr=Pi(null),xc=Pi(null);function Oc(t,e){switch(gt(Wr,e),gt(hl,t),gt(Li,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?M0(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=M0(e),t=m_(e,t);else switch(t){case "svg":t=1;break;case "math":t=2;break;default:t=0;}}fn(Li),gt(Li,t);}function zs(){fn(Li),fn(hl),fn(Wr);}function fm(t){t.memoizedState!==null&&gt(xc,t);var e=Li.current,n=m_(e,t.type);e!==n&&(gt(hl,t),gt(Li,n));}function Ic(t){hl.current===t&&(fn(Li),fn(hl)),xc.current===t&&(fn(xc),wl._currentValue=xa);}var Th,yA;function Ta(t){if(Th===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Th=e&&e[1]||"",yA=-1<n.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":"";}return `
3
- `+Mh+t+vA}var Th=false;function Ch(t,e){if(!t||Th)return "";Th=true;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[]);}catch(_){var p=_;}Reflect.construct(t,[],A);}else {try{A.call();}catch(_){p=_;}t.call(A.prototype);}}else {try{throw Error()}catch(_){p=_;}(A=t())&&typeof A.catch=="function"&&A.catch(function(){});}}catch(_){if(_&&p&&typeof _.stack=="string")return [_.stack,p.stack]}return [null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),o=a[0],u=a[1];if(o&&u){var d=o.split(`
3
+ `+Th+t+yA}var Ch=false;function Rh(t,e){if(!t||Ch)return "";Ch=true;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[]);}catch(_){var p=_;}Reflect.construct(t,[],A);}else {try{A.call();}catch(_){p=_;}t.call(A.prototype);}}else {try{throw Error()}catch(_){p=_;}(A=t())&&typeof A.catch=="function"&&A.catch(function(){});}}catch(_){if(_&&p&&typeof _.stack=="string")return [_.stack,p.stack]}return [null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),o=a[0],u=a[1];if(o&&u){var d=o.split(`
4
4
  `),g=u.split(`
5
5
  `);for(r=i=0;i<d.length&&!d[i].includes("DetermineComponentFrameRoot");)i++;for(;r<g.length&&!g[r].includes("DetermineComponentFrameRoot");)r++;if(i===d.length||r===g.length)for(i=d.length-1,r=g.length-1;1<=i&&0<=r&&d[i]!==g[r];)r--;for(;1<=i&&0<=r;i--,r--)if(d[i]!==g[r]){if(i!==1||r!==1)do if(i--,r--,0>r||d[i]!==g[r]){var y=`
6
- `+d[i].replace(" at new "," at ");return t.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",t.displayName)),y}while(1<=i&&0<=r);break}}}finally{Th=false,Error.prepareStackTrace=n;}return (n=t?t.displayName||t.name:"")?Ta(n):""}function SM(t,e){switch(t.tag){case 26:case 27:case 5:return Ta(t.type);case 16:return Ta("Lazy");case 13:return t.child!==e&&e!==null?Ta("Suspense Fallback"):Ta("Suspense");case 19:return Ta("SuspenseList");case 0:case 15:return Ch(t.type,false);case 11:return Ch(t.type.render,false);case 1:return Ch(t.type,true);case 31:return Ta("Activity");default:return ""}}function AA(t){try{var e="",n=null;do e+=SM(t,n),n=t,t=t.return;while(t);return e}catch(i){return `
6
+ `+d[i].replace(" at new "," at ");return t.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",t.displayName)),y}while(1<=i&&0<=r);break}}}finally{Ch=false,Error.prepareStackTrace=n;}return (n=t?t.displayName||t.name:"")?Ta(n):""}function wM(t,e){switch(t.tag){case 26:case 27:case 5:return Ta(t.type);case 16:return Ta("Lazy");case 13:return t.child!==e&&e!==null?Ta("Suspense Fallback"):Ta("Suspense");case 19:return Ta("SuspenseList");case 0:case 15:return Rh(t.type,false);case 11:return Rh(t.type.render,false);case 1:return Rh(t.type,true);case 31:return Ta("Activity");default:return ""}}function bA(t){try{var e="",n=null;do e+=wM(t,n),n=t,t=t.return;while(t);return e}catch(i){return `
7
7
  Error generating stack: `+i.message+`
8
- `+i.stack}}var fm=Object.prototype.hasOwnProperty,tp=rn.unstable_scheduleCallback,Rh=rn.unstable_cancelCallback,EM=rn.unstable_shouldYield,wM=rn.unstable_requestPaint,Wn=rn.unstable_now,MM=rn.unstable_getCurrentPriorityLevel,W0=rn.unstable_ImmediatePriority,Q0=rn.unstable_UserBlockingPriority,Ic=rn.unstable_NormalPriority,TM=rn.unstable_LowPriority,X0=rn.unstable_IdlePriority,CM=rn.log,RM=rn.unstable_setDisableYieldValue,Rl=null,Qn=null;function Hr(t){if(typeof CM=="function"&&RM(t),Qn&&typeof Qn.setStrictMode=="function")try{Qn.setStrictMode(Rl,t);}catch{}}var Xn=Math.clz32?Math.clz32:OM,kM=Math.log,xM=Math.LN2;function OM(t){return t>>>=0,t===0?32:31-(kM(t)/xM|0)|0}var Zu=256,Ju=262144,$u=4194304;function Ca(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function af(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var u=i&134217727;return u!==0?(i=u&~a,i!==0?r=Ca(i):(o&=u,o!==0?r=Ca(o):n||(n=u&~t,n!==0&&(r=Ca(n))))):(u=i&~a,u!==0?r=Ca(u):o!==0?r=Ca(o):n||(n=i&~t,n!==0&&(r=Ca(n)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function kl(t,e){return (t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function IM(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return -1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return -1;default:return -1}}function K0(){var t=$u;return $u<<=1,($u&62914560)===0&&($u=4194304),t}function kh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function xl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0);}function NM(t,e,n,i,r,a){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var u=t.entanglements,d=t.expirationTimes,g=t.hiddenUpdates;for(n=o&~n;0<n;){var y=31-Xn(n),A=1<<y;u[y]=0,d[y]=-1;var p=g[y];if(p!==null)for(g[y]=null,y=0;y<p.length;y++){var _=p[y];_!==null&&(_.lane&=-536870913);}n&=~A;}i!==0&&Z0(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(o&~e));}function Z0(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-Xn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930;}function J0(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Xn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r;}}function $0(t,e){var n=e&-e;return n=(n&42)!==0?1:np(n),(n&(t.suspendedLanes|e))!==0?0:n}function np(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0;}return t}function ip(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ey(){var t=it.p;return t!==0?t:(t=window.event,t===void 0?32:E_(t.type))}function yA(t,e){var n=it.p;try{return it.p=t,e()}finally{it.p=n;}}var aa=Math.random().toString(36).slice(2),mn="__reactFiber$"+aa,Pn="__reactProps$"+aa,eo="__reactContainer$"+aa,dm="__reactEvents$"+aa,DM="__reactListeners$"+aa,LM="__reactHandles$"+aa,bA="__reactResources$"+aa,Ol="__reactMarker$"+aa;function rp(t){delete t[mn],delete t[Pn],delete t[dm],delete t[DM],delete t[LM];}function Ts(t){var e=t[mn];if(e)return e;for(var n=t.parentNode;n;){if(e=n[eo]||n[mn]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=R0(t);t!==null;){if(n=t[mn])return n;t=R0(t);}return e}t=n,n=t.parentNode;}return null}function to(t){if(t=t[mn]||t[eo]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Zo(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(Y(33))}function Ps(t){var e=t[bA];return e||(e=t[bA]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function cn(t){t[Ol]=true;}var ty=new Set,ny={};function Va(t,e){js(t,e),js(t+"Capture",e);}function js(t,e){for(ny[t]=e,t=0;t<e.length;t++)ty.add(e[t]);}var PM=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),_A={},SA={};function BM(t){return fm.call(SA,t)?true:fm.call(_A,t)?false:PM.test(t)?SA[t]=true:(_A[t]=true,false)}function mc(t,e,n){if(BM(e))if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":t.removeAttribute(e);return;case "boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n);}}function ec(t,e,n){if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n);}}function er(t,e,n,i){if(i===null)t.removeAttribute(n);else {switch(typeof i){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i);}}function oi(t){switch(typeof t){case "bigint":case "boolean":case "number":case "string":case "undefined":return t;case "object":return t;default:return ""}}function iy(t){var e=t.type;return (t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UM(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(t,e,{configurable:true,get:function(){return r.call(this)},set:function(o){n=""+o,a.call(this,o);}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o;},stopTracking:function(){t._valueTracker=null,delete t[e];}}}}function hm(t){if(!t._valueTracker){var e=iy(t)?"checked":"value";t._valueTracker=UM(t,e,""+t[e]);}}function ry(t){if(!t)return false;var e=t._valueTracker;if(!e)return true;var n=e.getValue(),i="";return t&&(i=iy(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),true):false}function Nc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var FM=/[\n"\\]/g;function ci(t){return t.replace(FM,function(e){return "\\"+e.charCodeAt(0).toString(16)+" "})}function mm(t,e,n,i,r,a,o,u){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+oi(e)):t.value!==""+oi(e)&&(t.value=""+oi(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?pm(t,o,oi(e)):n!=null?pm(t,o,oi(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?t.name=""+oi(u):t.removeAttribute("name");}function ay(t,e,n,i,r,a,o,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){hm(t);return}n=n!=null?""+oi(n):"",e=e!=null?""+oi(e):n,u||e===t.value||(t.value=e),t.defaultValue=e;}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=u?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),hm(t);}function pm(t,e,n){e==="number"&&Nc(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n);}function Bs(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=true;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=true);}else {for(n=""+oi(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=true,i&&(t[r].defaultSelected=true);return}e!==null||t[r].disabled||(e=t[r]);}e!==null&&(e.selected=true);}}function sy(t,e,n){if(e!=null&&(e=""+oi(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+oi(n):"";}function oy(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(Y(92));if(Ko(i)){if(1<i.length)throw Error(Y(93));i=i[0];}n=i;}n==null&&(n=""),e=n;}n=oi(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),hm(t);}function Ys(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e;}var VM=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function EA(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||VM.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px";}function ly(t,e,n){if(e!=null&&typeof e!="object")throw Error(Y(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&EA(t,r,i);}else for(var a in e)e.hasOwnProperty(a)&&EA(t,a,e[a]);}function ap(t){if(t.indexOf("-")===-1)return false;switch(t){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return false;default:return true}}var HM=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),GM=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function pc(t){return GM.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function lr(){}var gm=null;function sp(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cs=null,Us=null;function wA(t){var e=to(t);if(e&&(t=e.stateNode)){var n=t[Pn]||null;e:switch(t=e.stateNode,e.type){case "input":if(mm(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ci(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Pn]||null;if(!r)throw Error(Y(90));mm(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name);}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&ry(i);}break e;case "textarea":sy(t,n.value,n.defaultValue);break e;case "select":e=n.value,e!=null&&Bs(t,!!n.multiple,e,false);}}}var xh=false;function uy(t,e,n){if(xh)return t(e,n);xh=true;try{var i=t(e);return i}finally{if(xh=false,(Cs!==null||Us!==null)&&(vf(),Cs&&(e=Cs,t=Us,Us=Cs=null,wA(e),t)))for(e=0;e<t.length;e++)wA(t[e]);}}function ml(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Pn]||null;if(i===null)return null;n=i[e];e:switch(e){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=false;}if(t)return null;if(n&&typeof n!="function")throw Error(Y(231,e,typeof n));return n}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vm=false;if(hr)try{ys={},Object.defineProperty(ys,"passive",{get:function(){vm=!0;}}),window.addEventListener("test",ys,ys),window.removeEventListener("test",ys,ys);}catch{vm=false;}var ys,Gr=null,op=null,gc=null;function cy(){if(gc)return gc;var t,e=op,n=e.length,i,r="value"in Gr?Gr.value:Gr.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[a-i];i++);return gc=r.slice(t,1<i?1-i:void 0)}function vc(t){var e=t.keyCode;return "charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function tc(){return true}function MA(){return false}function Bn(t){function e(n,i,r,a,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===false)?tc:MA,this.isPropagationStopped=MA,this}return St(e.prototype,{preventDefault:function(){this.defaultPrevented=true;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=false),this.isDefaultPrevented=tc);},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=true),this.isPropagationStopped=tc);},persist:function(){},isPersistent:tc}),e}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sf=Bn(Ha),Il=St({},Ha,{view:0,detail:0}),zM=Bn(Il),Oh,Ih,zo,of=St({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lp,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return "movementX"in t?t.movementX:(t!==zo&&(zo&&t.type==="mousemove"?(Oh=t.screenX-zo.screenX,Ih=t.screenY-zo.screenY):Ih=Oh=0,zo=t),Oh)},movementY:function(t){return "movementY"in t?t.movementY:Ih}}),TA=Bn(of),jM=St({},of,{dataTransfer:0}),YM=Bn(jM),qM=St({},Il,{relatedTarget:0}),Nh=Bn(qM),WM=St({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),QM=Bn(WM),XM=St({},Ha,{clipboardData:function(t){return "clipboardData"in t?t.clipboardData:window.clipboardData}}),KM=Bn(XM),ZM=St({},Ha,{data:0}),CA=Bn(ZM),JM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$M={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=eT[t])?!!e[t]:false}function lp(){return tT}var nT=St({},Il,{key:function(t){if(t.key){var e=JM[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=vc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$M[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lp,charCode:function(t){return t.type==="keypress"?vc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?vc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),iT=Bn(nT),rT=St({},of,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RA=Bn(rT),aT=St({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lp}),sT=Bn(aT),oT=St({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),lT=Bn(oT),uT=St({},of,{deltaX:function(t){return "deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return "deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),cT=Bn(uT),fT=St({},Ha,{newState:0,oldState:0}),dT=Bn(fT),hT=[9,13,27,32],up=hr&&"CompositionEvent"in window,el=null;hr&&"documentMode"in document&&(el=document.documentMode);var mT=hr&&"TextEvent"in window&&!el,fy=hr&&(!up||el&&8<el&&11>=el),kA=" ",xA=false;function dy(t,e){switch(t){case "keyup":return hT.indexOf(e.keyCode)!==-1;case "keydown":return e.keyCode!==229;case "keypress":case "mousedown":case "focusout":return true;default:return false}}function hy(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rs=false;function pT(t,e){switch(t){case "compositionend":return hy(e);case "keypress":return e.which!==32?null:(xA=true,kA);case "textInput":return t=e.data,t===kA&&xA?null:t;default:return null}}function gT(t,e){if(Rs)return t==="compositionend"||!up&&dy(t,e)?(t=cy(),gc=op=Gr=null,Rs=false,t):null;switch(t){case "paste":return null;case "keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case "compositionend":return fy&&e.locale!=="ko"?null:e.data;default:return null}}var vT={color:true,date:true,datetime:true,"datetime-local":true,email:true,month:true,number:true,password:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true};function OA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!vT[t.type]:e==="textarea"}function my(t,e,n,i){Cs?Us?Us.push(i):Us=[i]:Cs=i,e=Zc(e,"onChange"),0<e.length&&(n=new sf("onChange","change",null,n,i),t.push({event:n,listeners:e}));}var tl=null,pl=null;function AT(t){u_(t,0);}function lf(t){var e=Zo(t);if(ry(e))return t}function IA(t,e){if(t==="change")return e}var py=false;hr&&(hr?(ic="oninput"in document,ic||(Dh=document.createElement("div"),Dh.setAttribute("oninput","return;"),ic=typeof Dh.oninput=="function"),nc=ic):nc=false,py=nc&&(!document.documentMode||9<document.documentMode));var nc,ic,Dh;function NA(){tl&&(tl.detachEvent("onpropertychange",gy),pl=tl=null);}function gy(t){if(t.propertyName==="value"&&lf(pl)){var e=[];my(e,pl,t,sp(t)),uy(AT,e);}}function yT(t,e,n){t==="focusin"?(NA(),tl=e,pl=n,tl.attachEvent("onpropertychange",gy)):t==="focusout"&&NA();}function bT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return lf(pl)}function _T(t,e){if(t==="click")return lf(e)}function ST(t,e){if(t==="input"||t==="change")return lf(e)}function ET(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Zn=typeof Object.is=="function"?Object.is:ET;function gl(t,e){if(Zn(t,e))return true;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return false;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return false;for(i=0;i<n.length;i++){var r=n[i];if(!fm.call(e,r)||!Zn(t[r],e[r]))return false}return true}function DA(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function LA(t,e){var n=DA(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return {node:n,offset:e-t};t=i;}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode;}n=void 0;}n=DA(n);}}function vy(t,e){return t&&e?t===e?true:t&&t.nodeType===3?false:e&&e.nodeType===3?vy(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):false:false}function Ay(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Nc(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string";}catch{n=false;}if(n)t=e.contentWindow;else break;e=Nc(t.document);}return e}function cp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var wT=hr&&"documentMode"in document&&11>=document.documentMode,ks=null,Am=null,nl=null,ym=false;function PA(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ym||ks==null||ks!==Nc(i)||(i=ks,"selectionStart"in i&&cp(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nl&&gl(nl,i)||(nl=i,i=Zc(Am,"onSelect"),0<i.length&&(e=new sf("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=ks)));}function Ma(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xs={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionrun:Ma("Transition","TransitionRun"),transitionstart:Ma("Transition","TransitionStart"),transitioncancel:Ma("Transition","TransitionCancel"),transitionend:Ma("Transition","TransitionEnd")},Lh={},yy={};hr&&(yy=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Ga(t){if(Lh[t])return Lh[t];if(!xs[t])return t;var e=xs[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in yy)return Lh[t]=e[n];return t}var by=Ga("animationend"),_y=Ga("animationiteration"),Sy=Ga("animationstart"),MT=Ga("transitionrun"),TT=Ga("transitionstart"),CT=Ga("transitioncancel"),Ey=Ga("transitionend"),wy=new Map,bm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");bm.push("scrollEnd");function wi(t,e){wy.set(t,e),Va(e,[t]);}var Dc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},si=[],Os=0,fp=0;function uf(){for(var t=Os,e=fp=Os=0;e<t;){var n=si[e];si[e++]=null;var i=si[e];si[e++]=null;var r=si[e];si[e++]=null;var a=si[e];if(si[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r;}a!==0&&My(n,r,a);}}function cf(t,e,n,i){si[Os++]=t,si[Os++]=e,si[Os++]=n,si[Os++]=i,fp|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i);}function dp(t,e,n,i){return cf(t,e,n,i),Lc(t)}function za(t,e){return cf(t,null,null,e),Lc(t)}function My(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=false,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=true)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-Xn(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function Lc(t){if(50<fl)throw fl=0,Hm=null,Error(Y(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Is={};function RT(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null;}function Yn(t,e,n,i){return new RT(t,e,n,i)}function hp(t){return t=t.prototype,!(!t||!t.isReactComponent)}function cr(t,e){var n=t.alternate;return n===null?(n=Yn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function Ty(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Ac(t,e,n,i,r,a){var o=0;if(i=t,typeof t=="function")hp(t)&&(o=1);else if(typeof t=="string")o=OC(t,n,Li.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case om:return t=Yn(31,n,e,r),t.elementType=om,t.lanes=a,t;case ws:return Oa(n.children,r,a,e);case Y0:o=8,r|=24;break;case rm:return t=Yn(12,n,e,r|2),t.elementType=rm,t.lanes=a,t;case am:return t=Yn(13,n,e,r),t.elementType=am,t.lanes=a,t;case sm:return t=Yn(19,n,e,r),t.elementType=sm,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case or:o=10;break e;case q0:o=9;break e;case $m:o=11;break e;case ep:o=14;break e;case Lr:o=16,i=null;break e}o=29,n=Error(Y(130,t===null?"null":typeof t,"")),i=null;}return e=Yn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function Oa(t,e,n,i){return t=Yn(7,t,i,e),t.lanes=n,t}function Ph(t,e,n){return t=Yn(6,t,null,e),t.lanes=n,t}function Cy(t){var e=Yn(18,null,null,0);return e.stateNode=t,e}function Bh(t,e,n){return e=Yn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var BA=new WeakMap;function fi(t,e){if(typeof t=="object"&&t!==null){var n=BA.get(t);return n!==void 0?n:(e={value:t,source:e,stack:AA(e)},BA.set(t,e),e)}return {value:t,source:e,stack:AA(e)}}var Ns=[],Ds=0,Pc=null,vl=0,li=[],ui=0,ta=null,Ii=1,Ni="";function ar(t,e){Ns[Ds++]=vl,Ns[Ds++]=Pc,Pc=t,vl=e;}function Ry(t,e,n){li[ui++]=Ii,li[ui++]=Ni,li[ui++]=ta,ta=t;var i=Ii;t=Ni;var r=32-Xn(i)-1;i&=~(1<<r),n+=1;var a=32-Xn(e)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Ii=1<<32-Xn(e)+r|n<<r|i,Ni=a+t;}else Ii=1<<a|n<<r|i,Ni=t;}function mp(t){t.return!==null&&(ar(t,1),Ry(t,1,0));}function pp(t){for(;t===Pc;)Pc=Ns[--Ds],Ns[Ds]=null,vl=Ns[--Ds],Ns[Ds]=null;for(;t===ta;)ta=li[--ui],li[ui]=null,Ni=li[--ui],li[ui]=null,Ii=li[--ui],li[ui]=null;}function ky(t,e){li[ui++]=Ii,li[ui++]=Ni,li[ui++]=ta,Ii=e.id,Ni=e.overflow,ta=t;}var pn=null,_t=null,We=false,Wr=null,di=false,_m=Error(Y(519));function na(t){var e=Error(Y(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Al(fi(e,t)),_m}function UA(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mn]=t,e[Pn]=i,n){case "dialog":He("cancel",e),He("close",e);break;case "iframe":case "object":case "embed":He("load",e);break;case "video":case "audio":for(n=0;n<Sl.length;n++)He(Sl[n],e);break;case "source":He("error",e);break;case "img":case "image":case "link":He("error",e),He("load",e);break;case "details":He("toggle",e);break;case "input":He("invalid",e),ay(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,true);break;case "select":He("invalid",e);break;case "textarea":He("invalid",e),oy(e,i.value,i.defaultValue,i.children);}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===true||f_(e.textContent,n)?(i.popover!=null&&(He("beforetoggle",e),He("toggle",e)),i.onScroll!=null&&He("scroll",e),i.onScrollEnd!=null&&He("scrollend",e),i.onClick!=null&&(e.onclick=lr),e=true):e=false,e||na(t,true);}function FA(t){for(pn=t.return;pn;)switch(pn.tag){case 5:case 31:case 13:di=false;return;case 27:case 3:di=true;return;default:pn=pn.return;}}function bs(t){if(t!==pn)return false;if(!We)return FA(t),We=true,false;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||qm(t.type,t.memoizedProps)),n=!n),n&&_t&&na(t),FA(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));_t=C0(t);}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));_t=C0(t);}else e===27?(e=_t,sa(t.type)?(t=Km,Km=null,_t=t):_t=e):_t=pn?mi(t.stateNode.nextSibling):null;return true}function La(){_t=pn=null,We=false;}function Uh(){var t=Wr;return t!==null&&(Dn===null?Dn=t:Dn.push.apply(Dn,t),Wr=null),t}function Al(t){Wr===null?Wr=[t]:Wr.push(t);}var Sm=Pi(null),ja=null,ur=null;function Br(t,e,n){gt(Sm,e._currentValue),e._currentValue=n;}function fr(t){t._currentValue=Sm.current,fn(Sm);}function Em(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return;}}function wm(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var o=r.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=r;for(var d=0;d<e.length;d++)if(u.context===e[d]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Em(a.return,n,t),i||(o=null);break e}a=u.next;}}else if(r.tag===18){if(o=r.return,o===null)throw Error(Y(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Em(o,n,t),o=null;}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return;}r=o;}}function no(t,e,n,i){t=null;for(var r=e,a=false;r!==null;){if(!a){if((r.flags&524288)!==0)a=true;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(Y(387));if(o=o.memoizedProps,o!==null){var u=r.type;Zn(r.pendingProps.value,o.value)||(t!==null?t.push(u):t=[u]);}}else if(r===kc.current){if(o=r.alternate,o===null)throw Error(Y(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(wl):t=[wl]);}r=r.return;}t!==null&&wm(e,t,n,i),e.flags|=262144;}function Bc(t){for(t=t.firstContext;t!==null;){if(!Zn(t.context._currentValue,t.memoizedValue))return true;t=t.next;}return false}function Pa(t){ja=t,ur=null,t=t.dependencies,t!==null&&(t.firstContext=null);}function gn(t){return xy(ja,t)}function rc(t,e){return ja===null&&Pa(t),xy(t,e)}function xy(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},ur===null){if(t===null)throw Error(Y(308));ur=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288;}else ur=ur.next=e;return n}var kT=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:false,addEventListener:function(n,i){t.push(i);}};this.abort=function(){e.aborted=true,t.forEach(function(n){return n()});};},xT=rn.unstable_scheduleCallback,OT=rn.unstable_NormalPriority,Zt={$$typeof:or,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gp(){return {controller:new kT,data:new Map,refCount:0}}function Nl(t){t.refCount--,t.refCount===0&&xT(OT,function(){t.controller.abort();});}var il=null,Mm=0,qs=0,Fs=null;function IT(t,e){if(il===null){var n=il=[];Mm=0,qs=Hp(),Fs={status:"pending",value:void 0,then:function(i){n.push(i);}};}return Mm++,e.then(VA,VA),e}function VA(){if(--Mm===0&&il!==null){Fs!==null&&(Fs.status="fulfilled");var t=il;il=null,qs=0,Fs=null;for(var e=0;e<t.length;e++)(0, t[e])();}}function NT(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r);}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0, n[r])(e);},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0, n[r])(void 0);}),i}var HA=Te.S;Te.S=function(t,e){jb=Wn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&IT(t,e),HA!==null&&HA(t,e);};var Ia=Pi(null);function vp(){var t=Ia.current;return t!==null?t:mt.pooledCache}function yc(t,e){e===null?gt(Ia,Ia.current):gt(Ia,e.pool);}function Oy(){var t=vp();return t===null?null:{parent:Zt._currentValue,pool:t}}var io=Error(Y(460)),Ap=Error(Y(474)),ff=Error(Y(542)),Uc={then:function(){}};function GA(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Iy(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(lr,lr),e=n),e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,jA(t),t;default:if(typeof e.status=="string")e.then(lr,lr);else {if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(Y(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i;}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i;}});}switch(e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,jA(t),t}throw Na=e,io}}function Ra(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Na=n,io):n}}var Na=null;function zA(){if(Na===null)throw Error(Y(459));var t=Na;return Na=null,t}function jA(t){if(t===io||t===ff)throw Error(Y(483))}var Vs=null,yl=0;function ac(t){var e=yl;return yl+=1,Vs===null&&(Vs=[]),Iy(Vs,t,e)}function jo(t,e){e=e.props.ref,t.ref=e!==void 0?e:null;}function sc(t,e){throw e.$$typeof===yM?Error(Y(525)):(t=Object.prototype.toString.call(e),Error(Y(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Ny(t){function e(M,w){if(t){var R=M.deletions;R===null?(M.deletions=[w],M.flags|=16):R.push(w);}}function n(M,w){if(!t)return null;for(;w!==null;)e(M,w),w=w.sibling;return null}function i(M){for(var w=new Map;M!==null;)M.key!==null?w.set(M.key,M):w.set(M.index,M),M=M.sibling;return w}function r(M,w){return M=cr(M,w),M.index=0,M.sibling=null,M}function a(M,w,R){return M.index=R,t?(R=M.alternate,R!==null?(R=R.index,R<w?(M.flags|=67108866,w):R):(M.flags|=67108866,w)):(M.flags|=1048576,w)}function o(M){return t&&M.alternate===null&&(M.flags|=67108866),M}function u(M,w,R,D){return w===null||w.tag!==6?(w=Ph(R,M.mode,D),w.return=M,w):(w=r(w,R),w.return=M,w)}function d(M,w,R,D){var G=R.type;return G===ws?y(M,w,R.props.children,D,R.key):w!==null&&(w.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Lr&&Ra(G)===w.type)?(w=r(w,R.props),jo(w,R),w.return=M,w):(w=Ac(R.type,R.key,R.props,null,M.mode,D),jo(w,R),w.return=M,w)}function g(M,w,R,D){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=Bh(R,M.mode,D),w.return=M,w):(w=r(w,R.children||[]),w.return=M,w)}function y(M,w,R,D,G){return w===null||w.tag!==7?(w=Oa(R,M.mode,D,G),w.return=M,w):(w=r(w,R),w.return=M,w)}function A(M,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ph(""+w,M.mode,R),w.return=M,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ku:return R=Ac(w.type,w.key,w.props,null,M.mode,R),jo(R,w),R.return=M,R;case Xo:return w=Bh(w,M.mode,R),w.return=M,w;case Lr:return w=Ra(w),A(M,w,R)}if(Ko(w)||Go(w))return w=Oa(w,M.mode,R,null),w.return=M,w;if(typeof w.then=="function")return A(M,ac(w),R);if(w.$$typeof===or)return A(M,rc(M,w),R);sc(M,w);}return null}function p(M,w,R,D){var G=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return G!==null?null:u(M,w,""+R,D);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Ku:return R.key===G?d(M,w,R,D):null;case Xo:return R.key===G?g(M,w,R,D):null;case Lr:return R=Ra(R),p(M,w,R,D)}if(Ko(R)||Go(R))return G!==null?null:y(M,w,R,D,null);if(typeof R.then=="function")return p(M,w,ac(R),D);if(R.$$typeof===or)return p(M,w,rc(M,R),D);sc(M,R);}return null}function _(M,w,R,D,G){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return M=M.get(R)||null,u(w,M,""+D,G);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case Ku:return M=M.get(D.key===null?R:D.key)||null,d(w,M,D,G);case Xo:return M=M.get(D.key===null?R:D.key)||null,g(w,M,D,G);case Lr:return D=Ra(D),_(M,w,R,D,G)}if(Ko(D)||Go(D))return M=M.get(R)||null,y(w,M,D,G,null);if(typeof D.then=="function")return _(M,w,R,ac(D),G);if(D.$$typeof===or)return _(M,w,R,rc(w,D),G);sc(w,D);}return null}function C(M,w,R,D){for(var G=null,ne=null,U=w,H=w=0,ee=null;U!==null&&H<R.length;H++){U.index>H?(ee=U,U=null):ee=U.sibling;var Q=p(M,U,R[H],D);if(Q===null){U===null&&(U=ee);break}t&&U&&Q.alternate===null&&e(M,U),w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q,U=ee;}if(H===R.length)return n(M,U),We&&ar(M,H),G;if(U===null){for(;H<R.length;H++)U=A(M,R[H],D),U!==null&&(w=a(U,w,H),ne===null?G=U:ne.sibling=U,ne=U);return We&&ar(M,H),G}for(U=i(U);H<R.length;H++)ee=_(U,M,H,R[H],D),ee!==null&&(t&&ee.alternate!==null&&U.delete(ee.key===null?H:ee.key),w=a(ee,w,H),ne===null?G=ee:ne.sibling=ee,ne=ee);return t&&U.forEach(function(Ee){return e(M,Ee)}),We&&ar(M,H),G}function N(M,w,R,D){if(R==null)throw Error(Y(151));for(var G=null,ne=null,U=w,H=w=0,ee=null,Q=R.next();U!==null&&!Q.done;H++,Q=R.next()){U.index>H?(ee=U,U=null):ee=U.sibling;var Ee=p(M,U,Q.value,D);if(Ee===null){U===null&&(U=ee);break}t&&U&&Ee.alternate===null&&e(M,U),w=a(Ee,w,H),ne===null?G=Ee:ne.sibling=Ee,ne=Ee,U=ee;}if(Q.done)return n(M,U),We&&ar(M,H),G;if(U===null){for(;!Q.done;H++,Q=R.next())Q=A(M,Q.value,D),Q!==null&&(w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q);return We&&ar(M,H),G}for(U=i(U);!Q.done;H++,Q=R.next())Q=_(U,M,H,Q.value,D),Q!==null&&(t&&Q.alternate!==null&&U.delete(Q.key===null?H:Q.key),w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q);return t&&U.forEach(function(Ce){return e(M,Ce)}),We&&ar(M,H),G}function B(M,w,R,D){if(typeof R=="object"&&R!==null&&R.type===ws&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case Ku:e:{for(var G=R.key;w!==null;){if(w.key===G){if(G=R.type,G===ws){if(w.tag===7){n(M,w.sibling),D=r(w,R.props.children),D.return=M,M=D;break e}}else if(w.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Lr&&Ra(G)===w.type){n(M,w.sibling),D=r(w,R.props),jo(D,R),D.return=M,M=D;break e}n(M,w);break}else e(M,w);w=w.sibling;}R.type===ws?(D=Oa(R.props.children,M.mode,D,R.key),D.return=M,M=D):(D=Ac(R.type,R.key,R.props,null,M.mode,D),jo(D,R),D.return=M,M=D);}return o(M);case Xo:e:{for(G=R.key;w!==null;){if(w.key===G)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){n(M,w.sibling),D=r(w,R.children||[]),D.return=M,M=D;break e}else {n(M,w);break}else e(M,w);w=w.sibling;}D=Bh(R,M.mode,D),D.return=M,M=D;}return o(M);case Lr:return R=Ra(R),B(M,w,R,D)}if(Ko(R))return C(M,w,R,D);if(Go(R)){if(G=Go(R),typeof G!="function")throw Error(Y(150));return R=G.call(R),N(M,w,R,D)}if(typeof R.then=="function")return B(M,w,ac(R),D);if(R.$$typeof===or)return B(M,w,rc(M,R),D);sc(M,R);}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(n(M,w.sibling),D=r(w,R),D.return=M,M=D):(n(M,w),D=Ph(R,M.mode,D),D.return=M,M=D),o(M)):n(M,w)}return function(M,w,R,D){try{yl=0;var G=B(M,w,R,D);return Vs=null,G}catch(U){if(U===io||U===ff)throw U;var ne=Yn(29,U,null,M.mode);return ne.lanes=D,ne.return=M,ne}}}var Ba=Ny(true),Dy=Ny(false),Pr=false;function yp(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null};}function Tm(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null});}function Qr(t){return {lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(nt&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Lc(t),My(t,null,n),e}return cf(t,i,e,n),Lc(t)}function rl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,J0(t,n);}}function Fh(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=o:a=a.next=o,n=n.next;}while(n!==null);a===null?r=a=e:a=a.next=e;}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e;}var Cm=false;function al(){if(Cm){var t=Fs;if(t!==null)throw t}}function sl(t,e,n,i){Cm=false;var r=t.updateQueue;Pr=false;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,u=r.shared.pending;if(u!==null){r.shared.pending=null;var d=u,g=d.next;d.next=null,o===null?a=g:o.next=g,o=d;var y=t.alternate;y!==null&&(y=y.updateQueue,u=y.lastBaseUpdate,u!==o&&(u===null?y.firstBaseUpdate=g:u.next=g,y.lastBaseUpdate=d));}if(a!==null){var A=r.baseState;o=0,y=g=d=null,u=a;do{var p=u.lane&-536870913,_=p!==u.lane;if(_?(je&p)===p:(i&p)===p){p!==0&&p===qs&&(Cm=true),y!==null&&(y=y.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var C=t,N=u;p=e;var B=n;switch(N.tag){case 1:if(C=N.payload,typeof C=="function"){A=C.call(B,A,p);break e}A=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=N.payload,p=typeof C=="function"?C.call(B,A,p):C,p==null)break e;A=St({},A,p);break e;case 2:Pr=true;}}p=u.callback,p!==null&&(t.flags|=64,_&&(t.flags|=8192),_=r.callbacks,_===null?r.callbacks=[p]:_.push(p));}else _={lane:p,tag:u.tag,payload:u.payload,callback:u.callback,next:null},y===null?(g=y=_,d=A):y=y.next=_,o|=p;if(u=u.next,u===null){if(u=r.shared.pending,u===null)break;_=u,u=_.next,_.next=null,r.lastBaseUpdate=_,r.shared.pending=null;}}while(true);y===null&&(d=A),r.baseState=d,r.firstBaseUpdate=g,r.lastBaseUpdate=y,a===null&&(r.shared.lanes=0),ra|=o,t.lanes=o,t.memoizedState=A;}}function Ly(t,e){if(typeof t!="function")throw Error(Y(191,t));t.call(e);}function Py(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)Ly(n[t],e);}var Ws=Pi(null),Fc=Pi(0);function YA(t,e){t=vr,gt(Fc,t),gt(Ws,e),vr=t|e.baseLanes;}function Rm(){gt(Fc,vr),gt(Ws,Ws.current);}function bp(){vr=Fc.current,fn(Ws),fn(Fc);}var Jn=Pi(null),hi=null;function Ur(t){var e=t.alternate;gt(jt,jt.current&1),gt(Jn,t),hi===null&&(e===null||Ws.current!==null||e.memoizedState!==null)&&(hi=t);}function km(t){gt(jt,jt.current),gt(Jn,t),hi===null&&(hi=t);}function By(t){t.tag===22?(gt(jt,jt.current),gt(Jn,t),hi===null&&(hi=t)):Fr();}function Fr(){gt(jt,jt.current),gt(Jn,Jn.current);}function jn(t){fn(Jn),hi===t&&(hi=null),fn(jt);}var jt=Pi(0);function Vc(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Qm(n)||Xm(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return;}e.sibling.return=e.return,e=e.sibling;}return null}var mr=0,Oe=null,ft=null,Xt=null,Hc=false,Hs=false,Ua=false,Gc=0,bl=0,Gs=null,DT=0;function Ut(){throw Error(Y(321))}function _p(t,e){if(e===null)return false;for(var n=0;n<e.length&&n<t.length;n++)if(!Zn(t[n],e[n]))return false;return true}function Sp(t,e,n,i,r,a){return mr=a,Oe=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Te.H=t===null||t.memoizedState===null?mb:Np,Ua=false,a=n(i,r),Ua=false,Hs&&(a=Fy(e,n,i,r)),Uy(t),a}function Uy(t){Te.H=_l;var e=ft!==null&&ft.next!==null;if(mr=0,Xt=ft=Oe=null,Hc=false,bl=0,Gs=null,e)throw Error(Y(300));t===null||Jt||(t=t.dependencies,t!==null&&Bc(t)&&(Jt=true));}function Fy(t,e,n,i){Oe=t;var r=0;do{if(Hs&&(Gs=null),bl=0,Hs=false,25<=r)throw Error(Y(301));if(r+=1,Xt=ft=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0);}Te.H=pb,a=e(n,i);}while(Hs);return a}function LT(){var t=Te.H,e=t.useState()[0];return e=typeof e.then=="function"?Dl(e):e,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(Oe.flags|=1024),e}function Ep(){var t=Gc!==0;return Gc=0,t}function wp(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n;}function Mp(t){if(Hc){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next;}Hc=false;}mr=0,Xt=ft=Oe=null,Hs=false,bl=Gc=0,Gs=null;}function Rn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Oe.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function Yt(){if(ft===null){var t=Oe.alternate;t=t!==null?t.memoizedState:null;}else t=ft.next;var e=Xt===null?Oe.memoizedState:Xt.next;if(e!==null)Xt=e,ft=t;else {if(t===null)throw Oe.alternate===null?Error(Y(467)):Error(Y(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Xt===null?Oe.memoizedState=Xt=t:Xt=Xt.next=t;}return Xt}function df(){return {lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(t){var e=bl;return bl+=1,Gs===null&&(Gs=[]),t=Iy(Gs,t,e),e=Oe,(Xt===null?e.memoizedState:Xt.next)===null&&(e=e.alternate,Te.H=e===null||e.memoizedState===null?mb:Np),t}function hf(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Dl(t);if(t.$$typeof===or)return gn(t)}throw Error(Y(438,String(t)))}function Tp(t){var e=null,n=Oe.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=Oe.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})));}if(e==null&&(e={data:[],index:0}),n===null&&(n=df(),Oe.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=bM;return e.index++,n}function pr(t,e){return typeof e=="function"?e(t):e}function bc(t){var e=Yt();return Cp(e,ft,t)}function Cp(t,e,n){var i=t.queue;if(i===null)throw Error(Y(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o;}e.baseQueue=r=a,i.pending=null;}if(a=t.baseState,r===null)t.memoizedState=a;else {e=r.next;var u=o=null,d=null,g=e,y=false;do{var A=g.lane&-536870913;if(A!==g.lane?(je&A)===A:(mr&A)===A){var p=g.revertLane;if(p===0)d!==null&&(d=d.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),A===qs&&(y=true);else if((mr&p)===p){g=g.next,p===qs&&(y=true);continue}else A={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=A,o=a):d=d.next=A,Oe.lanes|=p,ra|=p;A=g.action,Ua&&n(a,A),a=g.hasEagerState?g.eagerState:n(a,A);}else p={lane:A,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=p,o=a):d=d.next=p,Oe.lanes|=A,ra|=A;g=g.next;}while(g!==null&&g!==e);if(d===null?o=a:d.next=u,!Zn(a,t.memoizedState)&&(Jt=true,y&&(n=Fs,n!==null)))throw n;t.memoizedState=a,t.baseState=o,t.baseQueue=d,i.lastRenderedState=a;}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Vh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=t(a,o.action),o=o.next;while(o!==r);Zn(a,e.memoizedState)||(Jt=true),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a;}return [a,i]}function Vy(t,e,n){var i=Oe,r=Yt(),a=We;if(a){if(n===void 0)throw Error(Y(407));n=n();}else n=e();var o=!Zn((ft||r).memoizedState,n);if(o&&(r.memoizedState=n,Jt=true),r=r.queue,Rp(zy.bind(null,i,r,t),[t]),r.getSnapshot!==e||o||Xt!==null&&Xt.memoizedState.tag&1){if(i.flags|=2048,Qs(9,{destroy:void 0},Gy.bind(null,i,r,n,e),null),mt===null)throw Error(Y(349));a||(mr&127)!==0||Hy(i,e,n);}return n}function Hy(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Oe.updateQueue,e===null?(e=df(),Oe.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t));}function Gy(t,e,n,i){e.value=n,e.getSnapshot=i,jy(e)&&Yy(t);}function zy(t,e,n){return n(function(){jy(e)&&Yy(t);})}function jy(t){var e=t.getSnapshot;t=t.value;try{var n=e();return !Zn(t,n)}catch{return true}}function Yy(t){var e=za(t,2);e!==null&&Ln(e,t,2);}function xm(t){var e=Rn();if(typeof t=="function"){var n=t;if(t=n(),Ua){Hr(true);try{n();}finally{Hr(false);}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:t},e}function qy(t,e,n,i){return t.baseState=n,Cp(t,ft,typeof i=="function"?i:pr)}function PT(t,e,n,i,r){if(pf(t))throw Error(Y(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:true,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o);}};Te.T!==null?n(true):a.isTransition=false,i(a),n=e.pending,n===null?(a.next=e.pending=a,Wy(e,a)):(a.next=n.next,e.pending=n.next=a);}}function Wy(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Te.T,o={};Te.T=o;try{var u=n(r,i),d=Te.S;d!==null&&d(o,u),qA(t,e,u);}catch(g){Om(t,e,g);}finally{a!==null&&o.types!==null&&(a.types=o.types),Te.T=a;}}else try{a=n(r,i),qA(t,e,a);}catch(g){Om(t,e,g);}}function qA(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){WA(t,e,i);},function(i){return Om(t,e,i)}):WA(t,e,n);}function WA(t,e,n){e.status="fulfilled",e.value=n,Qy(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,Wy(t,n)));}function Om(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,Qy(e),e=e.next;while(e!==i)}t.action=null;}function Qy(t){t=t.listeners;for(var e=0;e<t.length;e++)(0, t[e])();}function Xy(t,e){return e}function QA(t,e){if(We){var n=mt.formState;if(n!==null){e:{var i=Oe;if(We){if(_t){t:{for(var r=_t,a=di;r.nodeType!==8;){if(!a){r=null;break t}if(r=mi(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null;}if(r){_t=mi(r.nextSibling),i=r.data==="F!";break e}}na(i);}i=false;}i&&(e=n[0]);}}return n=Rn(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xy,lastRenderedState:e},n.queue=i,n=fb.bind(null,Oe,i),i.dispatch=n,i=xm(false),a=Ip.bind(null,Oe,false,i.queue),i=Rn(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=PT.bind(null,Oe,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,false]}function XA(t){var e=Yt();return Ky(e,ft,t)}function Ky(t,e,n){if(e=Cp(t,e,Xy)[0],t=bc(pr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Dl(e);}catch(o){throw o===io?ff:o}else i=e;e=Yt();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(Oe.flags|=2048,Qs(9,{destroy:void 0},BT.bind(null,r,n),null)),[i,a,t]}function BT(t,e){t.action=e;}function KA(t){var e=Yt(),n=ft;if(n!==null)return Ky(e,n,t);Yt(),e=e.memoizedState,n=Yt();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,false]}function Qs(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=Oe.updateQueue,e===null&&(e=df(),Oe.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Zy(){return Yt().memoizedState}function _c(t,e,n,i){var r=Rn();Oe.flags|=t,r.memoizedState=Qs(1|e,{destroy:void 0},n,i===void 0?null:i);}function mf(t,e,n,i){var r=Yt();i=i===void 0?null:i;var a=r.memoizedState.inst;ft!==null&&i!==null&&_p(i,ft.memoizedState.deps)?r.memoizedState=Qs(e,a,n,i):(Oe.flags|=t,r.memoizedState=Qs(1|e,a,n,i));}function ZA(t,e){_c(8390656,8,t,e);}function Rp(t,e){mf(2048,8,t,e);}function UT(t){Oe.flags|=4;var e=Oe.updateQueue;if(e===null)e=df(),Oe.updateQueue=e,e.events=[t];else {var n=e.events;n===null?e.events=[t]:n.push(t);}}function Jy(t){var e=Yt().memoizedState;return UT({ref:e,nextImpl:t}),function(){if((nt&2)!==0)throw Error(Y(440));return e.impl.apply(void 0,arguments)}}function $y(t,e){return mf(4,2,t,e)}function eb(t,e){return mf(4,4,t,e)}function tb(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null);}}if(e!=null)return t=t(),e.current=t,function(){e.current=null;}}function nb(t,e,n){n=n!=null?n.concat([t]):null,mf(4,4,tb.bind(null,e,t),n);}function kp(){}function ib(t,e){var n=Yt();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&_p(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function rb(t,e){var n=Yt();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&_p(e,i[1]))return i[0];if(i=t(),Ua){Hr(true);try{t();}finally{Hr(false);}}return n.memoizedState=[i,e],i}function xp(t,e,n){return n===void 0||(mr&1073741824)!==0&&(je&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=qb(),Oe.lanes|=t,ra|=t,n)}function ab(t,e,n,i){return Zn(n,e)?n:Ws.current!==null?(t=xp(t,n,i),Zn(t,e)||(Jt=true),t):(mr&42)===0||(mr&1073741824)!==0&&(je&261930)===0?(Jt=true,t.memoizedState=n):(t=qb(),Oe.lanes|=t,ra|=t,e)}function sb(t,e,n,i,r){var a=it.p;it.p=a!==0&&8>a?a:8;var o=Te.T,u={};Te.T=u,Ip(t,false,e,n);try{var d=r(),g=Te.S;if(g!==null&&g(u,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var y=NT(d,i);ol(t,e,y,Kn(t));}else ol(t,e,i,Kn(t));}catch(A){ol(t,e,{then:function(){},status:"rejected",reason:A},Kn());}finally{it.p=a,o!==null&&u.types!==null&&(o.types=u.types),Te.T=o;}}function FT(){}function Im(t,e,n,i){if(t.tag!==5)throw Error(Y(476));var r=ob(t).queue;sb(t,r,e,xa,n===null?FT:function(){return lb(t),n(i)});}function ob(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:xa,baseState:xa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:xa},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function lb(t){var e=ob(t);e.next===null&&(e=t.alternate.memoizedState),ol(t,e.next.queue,{},Kn());}function Op(){return gn(wl)}function ub(){return Yt().memoizedState}function cb(){return Yt().memoizedState}function VT(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Kn();t=Qr(n);var i=Xr(e,t,n);i!==null&&(Ln(i,e,n),rl(i,e,n)),e={cache:gp()},t.payload=e;return}e=e.return;}}function HT(t,e,n){var i=Kn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null},pf(t)?db(e,n):(n=dp(t,e,n,i),n!==null&&(Ln(n,t,i),hb(n,e,i)));}function fb(t,e,n){var i=Kn();ol(t,e,n,i);}function ol(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null};if(pf(t))db(e,r);else {var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,u=a(o,n);if(r.hasEagerState=!0,r.eagerState=u,Zn(u,o))return cf(t,e,r,0),mt===null&&uf(),!1}catch{}if(n=dp(t,e,r,i),n!==null)return Ln(n,t,i),hb(n,e,i),true}return false}function Ip(t,e,n,i){if(i={lane:2,revertLane:Hp(),gesture:null,action:i,hasEagerState:false,eagerState:null,next:null},pf(t)){if(e)throw Error(Y(479))}else e=dp(t,n,i,2),e!==null&&Ln(e,t,2);}function pf(t){var e=t.alternate;return t===Oe||e!==null&&e===Oe}function db(t,e){Hs=Hc=true;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e;}function hb(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,J0(t,n);}}var _l={readContext:gn,use:hf,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};_l.useEffectEvent=Ut;var mb={readContext:gn,use:hf,useCallback:function(t,e){return Rn().memoizedState=[t,e===void 0?null:e],t},useContext:gn,useEffect:ZA,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,_c(4194308,4,tb.bind(null,e,t),n);},useLayoutEffect:function(t,e){return _c(4194308,4,t,e)},useInsertionEffect:function(t,e){_c(4,2,t,e);},useMemo:function(t,e){var n=Rn();e=e===void 0?null:e;var i=t();if(Ua){Hr(true);try{t();}finally{Hr(false);}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Rn();if(n!==void 0){var r=n(e);if(Ua){Hr(true);try{n(e);}finally{Hr(false);}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=HT.bind(null,Oe,t),[i.memoizedState,t]},useRef:function(t){var e=Rn();return t={current:t},e.memoizedState=t},useState:function(t){t=xm(t);var e=t.queue,n=fb.bind(null,Oe,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:kp,useDeferredValue:function(t,e){var n=Rn();return xp(n,t,e)},useTransition:function(){var t=xm(false);return t=sb.bind(null,Oe,t.queue,true,false),Rn().memoizedState=t,[false,t]},useSyncExternalStore:function(t,e,n){var i=Oe,r=Rn();if(We){if(n===void 0)throw Error(Y(407));n=n();}else {if(n=e(),mt===null)throw Error(Y(349));(je&127)!==0||Hy(i,e,n);}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,ZA(zy.bind(null,i,a,t),[t]),i.flags|=2048,Qs(9,{destroy:void 0},Gy.bind(null,i,a,n,e),null),n},useId:function(){var t=Rn(),e=mt.identifierPrefix;if(We){var n=Ni,i=Ii;n=(i&~(1<<32-Xn(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Gc++,0<n&&(e+="H"+n.toString(32)),e+="_";}else n=DT++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Op,useFormState:QA,useActionState:QA,useOptimistic:function(t){var e=Rn();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Ip.bind(null,Oe,true,n),n.dispatch=e,[t,e]},useMemoCache:Tp,useCacheRefresh:function(){return Rn().memoizedState=VT.bind(null,Oe)},useEffectEvent:function(t){var e=Rn(),n={impl:t};return e.memoizedState=n,function(){if((nt&2)!==0)throw Error(Y(440));return n.impl.apply(void 0,arguments)}}},Np={readContext:gn,use:hf,useCallback:ib,useContext:gn,useEffect:Rp,useImperativeHandle:nb,useInsertionEffect:$y,useLayoutEffect:eb,useMemo:rb,useReducer:bc,useRef:Zy,useState:function(){return bc(pr)},useDebugValue:kp,useDeferredValue:function(t,e){var n=Yt();return ab(n,ft.memoizedState,t,e)},useTransition:function(){var t=bc(pr)[0],e=Yt().memoizedState;return [typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:Vy,useId:ub,useHostTransitionStatus:Op,useFormState:XA,useActionState:XA,useOptimistic:function(t,e){var n=Yt();return qy(n,ft,t,e)},useMemoCache:Tp,useCacheRefresh:cb};Np.useEffectEvent=Jy;var pb={readContext:gn,use:hf,useCallback:ib,useContext:gn,useEffect:Rp,useImperativeHandle:nb,useInsertionEffect:$y,useLayoutEffect:eb,useMemo:rb,useReducer:Vh,useRef:Zy,useState:function(){return Vh(pr)},useDebugValue:kp,useDeferredValue:function(t,e){var n=Yt();return ft===null?xp(n,t,e):ab(n,ft.memoizedState,t,e)},useTransition:function(){var t=Vh(pr)[0],e=Yt().memoizedState;return [typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:Vy,useId:ub,useHostTransitionStatus:Op,useFormState:KA,useActionState:KA,useOptimistic:function(t,e){var n=Yt();return ft!==null?qy(n,ft,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Tp,useCacheRefresh:cb};pb.useEffectEvent=Jy;function Hh(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:St({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n);}var Nm={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=Kn(),r=Qr(i);r.payload=e,n!=null&&(r.callback=n),e=Xr(t,r,i),e!==null&&(Ln(e,t,i),rl(e,t,i));},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=Kn(),r=Qr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Xr(t,r,i),e!==null&&(Ln(e,t,i),rl(e,t,i));},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Kn(),i=Qr(n);i.tag=2,e!=null&&(i.callback=e),e=Xr(t,i,n),e!==null&&(Ln(e,t,n),rl(e,t,n));}};function JA(t,e,n,i,r,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,o):e.prototype&&e.prototype.isPureReactComponent?!gl(n,i)||!gl(r,a):true}function $A(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Nm.enqueueReplaceState(e,e.state,null);}function Fa(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i]);}if(t=t.defaultProps){n===e&&(n=St({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r]);}return n}function gb(t){Dc(t);}function vb(t){console.error(t);}function Ab(t){Dc(t);}function zc(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack});}catch(i){setTimeout(function(){throw i});}}function e0(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null});}catch(r){setTimeout(function(){throw r});}}function Dm(t,e,n){return n=Qr(n),n.tag=3,n.payload={element:null},n.callback=function(){zc(t,e);},n}function yb(t){return t=Qr(t),t.tag=3,t}function bb(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){e0(e,n,i);};}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){e0(e,n,i),typeof r!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var u=i.stack;this.componentDidCatch(i.value,{componentStack:u!==null?u:""});});}function GT(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&no(e,n,r,true),n=Jn.current,n!==null){switch(n.tag){case 31:case 13:return hi===null?Qc():n.alternate===null&&Ft===0&&(Ft=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Uc?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Jh(t,i,r)),false;case 22:return n.flags|=65536,i===Uc?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Jh(t,i,r)),false}throw Error(Y(435,n.tag))}return Jh(t,i,r),Qc(),false}if(We)return e=Jn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==_m&&(t=Error(Y(422),{cause:i}),Al(fi(t,n)))):(i!==_m&&(e=Error(Y(423),{cause:i}),Al(fi(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=fi(i,n),r=Dm(t.stateNode,i,r),Fh(t,r),Ft!==4&&(Ft=2)),false;var a=Error(Y(520),{cause:i});if(a=fi(a,n),cl===null?cl=[a]:cl.push(a),Ft!==4&&(Ft=2),e===null)return true;i=fi(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Dm(n.stateNode,i,t),Fh(n,t),false;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Kr===null||!Kr.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=yb(r),bb(r,t,n,i),Fh(n,r),false}n=n.return;}while(n!==null);return false}var Dp=Error(Y(461)),Jt=false;function hn(t,e,n,i){e.child=t===null?Dy(e,null,n,i):Ba(e,t.child,n,i);}function t0(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var o={};for(var u in i)u!=="ref"&&(o[u]=i[u]);}else o=i;return Pa(e),i=Sp(t,e,n,o,a,r),u=Ep(),t!==null&&!Jt?(wp(t,e,r),gr(t,e,r)):(We&&u&&mp(e),e.flags|=1,hn(t,e,i,r),e.child)}function n0(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!hp(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,_b(t,e,a,i,r)):(t=Ac(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!Lp(t,r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:gl,n(o,i)&&t.ref===e.ref)return gr(t,e,r)}return e.flags|=1,t=cr(a,i),t.ref=e.ref,t.return=e,e.child=t}function _b(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(gl(a,i)&&t.ref===e.ref)if(Jt=false,e.pendingProps=i=a,Lp(t,r))(t.flags&131072)!==0&&(Jt=true);else return e.lanes=t.lanes,gr(t,e,r)}return Lm(t,e,n,i,r)}function Sb(t,e,n,i){var r=i.children,a=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a;}else i=0,e.child=null;return i0(t,e,a,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&yc(e,a!==null?a.cachePool:null),a!==null?YA(e,a):Rm(),By(e);else return i=e.lanes=536870912,i0(t,e,a!==null?a.baseLanes|n:n,n,i)}else a!==null?(yc(e,a.cachePool),YA(e,a),Fr(),e.memoizedState=null):(t!==null&&yc(e,null),Rm(),Fr());return hn(t,e,r,n),e.child}function Jo(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function i0(t,e,n,i,r){var a=vp();return a=a===null?null:{parent:Zt._currentValue,pool:a},e.memoizedState={baseLanes:n,cachePool:a},t!==null&&yc(e,null),Rm(),By(e),t!==null&&no(t,e,i,true),e.childLanes=r,null}function Sc(t,e){return e=jc({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function r0(t,e,n){return Ba(e,t.child,null,n),t=Sc(e,e.pendingProps),t.flags|=2,jn(e),e.memoizedState=null,t}function zT(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(We){if(i.mode==="hidden")return t=Sc(e,i),e.lanes=536870912,Jo(null,t);if(km(e),(t=_t)?(t=m_(t,di),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ta!==null?{id:Ii,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},n=Cy(t),n.return=e,e.child=n,pn=e,_t=null)):t=null,t===null)throw na(e);return e.lanes=536870912,null}return Sc(e,i)}var a=t.memoizedState;if(a!==null){var o=a.dehydrated;if(km(e),r)if(e.flags&256)e.flags&=-257,e=r0(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(Y(558));else if(Jt||no(t,e,n,false),r=(n&t.childLanes)!==0,Jt||r){if(i=mt,i!==null&&(o=$0(i,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,za(t,o),Ln(i,t,o),Dp;Qc(),e=r0(t,e,n);}else t=a.treeContext,_t=mi(o.nextSibling),pn=e,We=true,Wr=null,di=false,t!==null&&ky(e,t),e=Sc(e,i),e.flags|=4096;return e}return t=cr(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Ec(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else {if(typeof n!="function"&&typeof n!="object")throw Error(Y(284));(t===null||t.ref!==n)&&(e.flags|=4194816);}}function Lm(t,e,n,i,r){return Pa(e),n=Sp(t,e,n,i,void 0,r),i=Ep(),t!==null&&!Jt?(wp(t,e,r),gr(t,e,r)):(We&&i&&mp(e),e.flags|=1,hn(t,e,n,r),e.child)}function a0(t,e,n,i,r,a){return Pa(e),e.updateQueue=null,n=Fy(e,i,n,r),Uy(t),i=Ep(),t!==null&&!Jt?(wp(t,e,a),gr(t,e,a)):(We&&i&&mp(e),e.flags|=1,hn(t,e,n,a),e.child)}function s0(t,e,n,i,r){if(Pa(e),e.stateNode===null){var a=Is,o=n.contextType;typeof o=="object"&&o!==null&&(a=gn(o)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Nm,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},yp(e),o=n.contextType,a.context=typeof o=="object"&&o!==null?gn(o):Is,a.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Hh(e,n,o,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&Nm.enqueueReplaceState(a,a.state,null),sl(e,i,a,r),al(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=true;}else if(t===null){a=e.stateNode;var u=e.memoizedProps,d=Fa(n,u);a.props=d;var g=a.context,y=n.contextType;o=Is,typeof y=="object"&&y!==null&&(o=gn(y));var A=n.getDerivedStateFromProps;y=typeof A=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=e.pendingProps!==u,y||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||g!==o)&&$A(e,a,i,o),Pr=false;var p=e.memoizedState;a.state=p,sl(e,i,a,r),al(),g=e.memoizedState,u||p!==g||Pr?(typeof A=="function"&&(Hh(e,n,A,i),g=e.memoizedState),(d=Pr||JA(e,n,d,i,p,g,o))?(y||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=g),a.props=i,a.state=g,a.context=o,i=d):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=false);}else {a=e.stateNode,Tm(t,e),o=e.memoizedProps,y=Fa(n,o),a.props=y,A=e.pendingProps,p=a.context,g=n.contextType,d=Is,typeof g=="object"&&g!==null&&(d=gn(g)),u=n.getDerivedStateFromProps,(g=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==A||p!==d)&&$A(e,a,i,d),Pr=false,p=e.memoizedState,a.state=p,sl(e,i,a,r),al();var _=e.memoizedState;o!==A||p!==_||Pr||t!==null&&t.dependencies!==null&&Bc(t.dependencies)?(typeof u=="function"&&(Hh(e,n,u,i),_=e.memoizedState),(y=Pr||JA(e,n,y,i,p,_,d)||t!==null&&t.dependencies!==null&&Bc(t.dependencies))?(g||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,_,d),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,_,d)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=_),a.props=i,a.state=_,a.context=d,i=y):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),i=false);}return a=i,Ec(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=Ba(e,t.child,null,r),e.child=Ba(e,null,n,r)):hn(t,e,n,r),e.memoizedState=a.state,t=e.child):t=gr(t,e,r),t}function o0(t,e,n,i){return La(),e.flags|=256,hn(t,e,n,i),e.child}var Gh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zh(t){return {baseLanes:t,cachePool:Oy()}}function jh(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=qn),t}function Eb(t,e,n){var i=e.pendingProps,r=false,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?false:(jt.current&2)!==0),o&&(r=true,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(We){if(r?Ur(e):Fr(),(t=_t)?(t=m_(t,di),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ta!==null?{id:Ii,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},n=Cy(t),n.return=e,e.child=n,pn=e,_t=null)):t=null,t===null)throw na(e);return Xm(t)?e.lanes=32:e.lanes=536870912,null}var u=i.children;return i=i.fallback,r?(Fr(),r=e.mode,u=jc({mode:"hidden",children:u},r),i=Oa(i,r,n,null),u.return=e,i.return=e,u.sibling=i,e.child=u,i=e.child,i.memoizedState=zh(n),i.childLanes=jh(t,o,n),e.memoizedState=Gh,Jo(null,i)):(Ur(e),Pm(e,u))}var d=t.memoizedState;if(d!==null&&(u=d.dehydrated,u!==null)){if(a)e.flags&256?(Ur(e),e.flags&=-257,e=Yh(t,e,n)):e.memoizedState!==null?(Fr(),e.child=t.child,e.flags|=128,e=null):(Fr(),u=i.fallback,r=e.mode,i=jc({mode:"visible",children:i.children},r),u=Oa(u,r,n,null),u.flags|=2,i.return=e,u.return=e,i.sibling=u,e.child=i,Ba(e,t.child,null,n),i=e.child,i.memoizedState=zh(n),i.childLanes=jh(t,o,n),e.memoizedState=Gh,e=Jo(null,i));else if(Ur(e),Xm(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var g=o.dgst;o=g,i=Error(Y(419)),i.stack="",i.digest=o,Al({value:i,source:null,stack:null}),e=Yh(t,e,n);}else if(Jt||no(t,e,n,false),o=(n&t.childLanes)!==0,Jt||o){if(o=mt,o!==null&&(i=$0(o,n),i!==0&&i!==d.retryLane))throw d.retryLane=i,za(t,i),Ln(o,t,i),Dp;Qm(u)||Qc(),e=Yh(t,e,n);}else Qm(u)?(e.flags|=192,e.child=t.child,e=null):(t=d.treeContext,_t=mi(u.nextSibling),pn=e,We=true,Wr=null,di=false,t!==null&&ky(e,t),e=Pm(e,i.children),e.flags|=4096);return e}return r?(Fr(),u=i.fallback,r=e.mode,d=t.child,g=d.sibling,i=cr(d,{mode:"hidden",children:i.children}),i.subtreeFlags=d.subtreeFlags&65011712,g!==null?u=cr(g,u):(u=Oa(u,r,n,null),u.flags|=2),u.return=e,i.return=e,i.sibling=u,e.child=i,Jo(null,i),i=e.child,u=t.child.memoizedState,u===null?u=zh(n):(r=u.cachePool,r!==null?(d=Zt._currentValue,r=r.parent!==d?{parent:d,pool:d}:r):r=Oy(),u={baseLanes:u.baseLanes|n,cachePool:r}),i.memoizedState=u,i.childLanes=jh(t,o,n),e.memoizedState=Gh,Jo(t.child,i)):(Ur(e),n=t.child,t=n.sibling,n=cr(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function Pm(t,e){return e=jc({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function jc(t,e){return t=Yn(22,t,null,e),t.lanes=0,t}function Yh(t,e,n){return Ba(e,t.child,null,n),t=Pm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function l0(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Em(t.return,e,n);}function qh(t,e,n,i,r,a){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r,o.treeForkCount=a);}function wb(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var o=jt.current,u=(o&2)!==0;if(u?(o=o&1|2,e.flags|=128):o&=1,gt(jt,o),hn(t,e,i,n),i=We?vl:0,!u&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&l0(t,n,e);else if(t.tag===19)l0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return;}t.sibling.return=t.return,t=t.sibling;}switch(r){case "forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Vc(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),qh(e,false,r,n,a,i);break;case "backwards":case "unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Vc(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t;}qh(e,true,n,null,a,i);break;case "together":qh(e,false,null,null,void 0,i);break;default:e.memoizedState=null;}return e.child}function gr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ra|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(no(t,e,n,false),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(Y(153));if(e.child!==null){for(t=e.child,n=cr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=cr(t,t.pendingProps),n.return=e;n.sibling=null;}return e.child}function Lp(t,e){return (t.lanes&e)!==0?true:(t=t.dependencies,!!(t!==null&&Bc(t)))}function jT(t,e,n){switch(e.tag){case 3:xc(e,e.stateNode.containerInfo),Br(e,Zt,t.memoizedState.cache),La();break;case 27:case 5:cm(e);break;case 4:xc(e,e.stateNode.containerInfo);break;case 10:Br(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,km(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(Ur(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Eb(t,e,n):(Ur(e),t=gr(t,e,n),t!==null?t.sibling:null);Ur(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(no(t,e,n,false),i=(n&e.childLanes)!==0),r){if(i)return wb(t,e,n);e.flags|=128;}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),gt(jt,jt.current),i)break;return null;case 22:return e.lanes=0,Sb(t,e,n,e.pendingProps);case 24:Br(e,Zt,t.memoizedState.cache);}return gr(t,e,n)}function Mb(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Jt=true;else {if(!Lp(t,n)&&(e.flags&128)===0)return Jt=false,jT(t,e,n);Jt=(t.flags&131072)!==0;}else Jt=false,We&&(e.flags&1048576)!==0&&Ry(e,vl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=Ra(e.elementType),e.type=t,typeof t=="function")hp(t)?(i=Fa(t,i),e.tag=1,e=s0(null,e,t,i,n)):(e.tag=0,e=Lm(null,e,t,i,n));else {if(t!=null){var r=t.$$typeof;if(r===$m){e.tag=11,e=t0(null,e,t,i,n);break e}else if(r===ep){e.tag=14,e=n0(null,e,t,i,n);break e}}throw e=lm(t)||t,Error(Y(306,e,""))}}return e;case 0:return Lm(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Fa(i,e.pendingProps),s0(t,e,i,r,n);case 3:e:{if(xc(e,e.stateNode.containerInfo),t===null)throw Error(Y(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,Tm(t,e),sl(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Br(e,Zt,i),i!==a.cache&&wm(e,[Zt],n,true),al(),i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:false,cache:o.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=o0(t,e,i,n);break e}else if(i!==r){r=fi(Error(Y(424)),e),Al(r),e=o0(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,_t=mi(t.firstChild),pn=e,We=true,Wr=null,di=true,n=Dy(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else {if(La(),i===r){e=gr(t,e,n);break e}hn(t,e,i,n);}e=e.child;}return e;case 26:return Ec(t,e),t===null?(n=x0(e.type,null,e.pendingProps,null))?e.memoizedState=n:We||(n=e.type,t=e.pendingProps,i=Jc(qr.current).createElement(n),i[mn]=e,i[Pn]=t,vn(i,n,t),cn(i),e.stateNode=i):e.memoizedState=x0(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return cm(e),t===null&&We&&(i=e.stateNode=p_(e.type,e.pendingProps,qr.current),pn=e,di=true,r=_t,sa(e.type)?(Km=r,_t=mi(i.firstChild)):_t=r),hn(t,e,e.pendingProps.children,n),Ec(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&We&&((r=i=_t)&&(i=AC(i,e.type,e.pendingProps,di),i!==null?(e.stateNode=i,pn=e,_t=mi(i.firstChild),di=false,r=true):r=false),r||na(e)),cm(e),r=e.type,a=e.pendingProps,o=t!==null?t.memoizedProps:null,i=a.children,qm(r,a)?i=null:o!==null&&qm(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=Sp(t,e,LT,null,null,n),wl._currentValue=r),Ec(t,e),hn(t,e,i,n),e.child;case 6:return t===null&&We&&((t=n=_t)&&(n=yC(n,e.pendingProps,di),n!==null?(e.stateNode=n,pn=e,_t=null,t=true):t=false),t||na(e)),null;case 13:return Eb(t,e,n);case 4:return xc(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Ba(e,null,i,n):hn(t,e,i,n),e.child;case 11:return t0(t,e,e.type,e.pendingProps,n);case 7:return hn(t,e,e.pendingProps,n),e.child;case 8:return hn(t,e,e.pendingProps.children,n),e.child;case 12:return hn(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Br(e,e.type,i.value),hn(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Pa(e),r=gn(r),i=i(r),e.flags|=1,hn(t,e,i,n),e.child;case 14:return n0(t,e,e.type,e.pendingProps,n);case 15:return _b(t,e,e.type,e.pendingProps,n);case 19:return wb(t,e,n);case 31:return zT(t,e,n);case 22:return Sb(t,e,n,e.pendingProps);case 24:return Pa(e),i=gn(Zt),t===null?(r=vp(),r===null&&(r=mt,a=gp(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},yp(e),Br(e,Zt,r)):((t.lanes&n)!==0&&(Tm(t,e),sl(e,null,null,n),al()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Br(e,Zt,i)):(i=a.cache,Br(e,Zt,i),i!==r.cache&&wm(e,[Zt],n,true))),hn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(Y(156,e.tag))}function tr(t){t.flags|=4;}function Wh(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=false),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(Xb())t.flags|=8192;else throw Na=Uc,Ap}else t.flags&=-16777217;}function u0(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!A_(e))if(Xb())t.flags|=8192;else throw Na=Uc,Ap}function oc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?K0():536870912,t.lanes|=e,Xs|=e);}function Yo(t,e){if(!We)switch(t.tailMode){case "hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case "collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null;}}function bt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function YT(t,e,n){var i=e.pendingProps;switch(pp(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(e),null;case 1:return bt(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),fr(Zt),zs(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(bs(e)?tr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Uh())),bt(e),null;case 26:var r=e.type,a=e.memoizedState;return t===null?(tr(e),a!==null?(bt(e),u0(e,a)):(bt(e),Wh(e,r,null,i,n))):a?a!==t.memoizedState?(tr(e),bt(e),u0(e,a)):(bt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&tr(e),bt(e),Wh(e,r,t,i,n)),null;case 27:if(Oc(e),n=qr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(!i){if(e.stateNode===null)throw Error(Y(166));return bt(e),null}t=Li.current,bs(e)?UA(e):(t=p_(r,i,n),e.stateNode=t,tr(e));}return bt(e),null;case 5:if(Oc(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(!i){if(e.stateNode===null)throw Error(Y(166));return bt(e),null}if(a=Li.current,bs(e))UA(e);else {var o=Jc(qr.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case "svg":a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case "math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case "script":a=o.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case "select":a=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?a.multiple=true:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r);}}a[mn]=e,a[Pn]=i;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return;}o.sibling.return=o.return,o=o.sibling;}e.stateNode=a;e:switch(vn(a,r,i),r){case "button":case "input":case "select":case "textarea":i=!!i.autoFocus;break e;case "img":i=true;break e;default:i=false;}i&&tr(e);}}return bt(e),Wh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(typeof i!="string"&&e.stateNode===null)throw Error(Y(166));if(t=qr.current,bs(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=pn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps;}t[mn]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===true||f_(t.nodeValue,n)),t||na(e,true);}else t=Jc(t).createTextNode(i),t[mn]=e,e.stateNode=t;}return bt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=bs(e),n!==null){if(t===null){if(!i)throw Error(Y(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(557));t[mn]=e;}else La(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;bt(e),t=false;}else n=Uh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=true;if(!t)return e.flags&256?(jn(e),e):(jn(e),null);if((e.flags&128)!==0)throw Error(Y(558))}return bt(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=bs(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(Y(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Y(317));r[mn]=e;}else La(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;bt(e),r=false;}else r=Uh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=true;if(!r)return e.flags&256?(jn(e),e):(jn(e),null)}return jn(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),oc(e,e.updateQueue),bt(e),null);case 4:return zs(),t===null&&Gp(e.stateNode.containerInfo),bt(e),null;case 10:return fr(e.type),bt(e),null;case 19:if(fn(jt),i=e.memoizedState,i===null)return bt(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)Yo(i,false);else {if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=Vc(t),a!==null){for(e.flags|=128,Yo(i,false),t=a.updateQueue,e.updateQueue=t,oc(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Ty(n,t),n=n.sibling;return gt(jt,jt.current&1|2),We&&ar(e,i.treeForkCount),e.child}t=t.sibling;}i.tail!==null&&Wn()>qc&&(e.flags|=128,r=true,Yo(i,false),e.lanes=4194304);}else {if(!r)if(t=Vc(a),t!==null){if(e.flags|=128,r=true,t=t.updateQueue,e.updateQueue=t,oc(e,t),Yo(i,true),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!We)return bt(e),null}else 2*Wn()-i.renderingStartTime>qc&&n!==536870912&&(e.flags|=128,r=true,Yo(i,false),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a);}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Wn(),t.sibling=null,n=jt.current,gt(jt,r?n&1|2:n&1),We&&ar(e,i.treeForkCount),t):(bt(e),null);case 22:case 23:return jn(e),bp(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(bt(e),e.subtreeFlags&6&&(e.flags|=8192)):bt(e),n=e.updateQueue,n!==null&&oc(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&fn(Ia),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),fr(Zt),bt(e),null;case 25:return null;case 30:return null}throw Error(Y(156,e.tag))}function qT(t,e){switch(pp(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fr(Zt),zs(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Oc(e),null;case 31:if(e.memoizedState!==null){if(jn(e),e.alternate===null)throw Error(Y(340));La();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(jn(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Y(340));La();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fn(jt),null;case 4:return zs(),null;case 10:return fr(e.type),null;case 22:case 23:return jn(e),bp(),t!==null&&fn(Ia),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return fr(Zt),null;case 25:return null;default:return null}}function Tb(t,e){switch(pp(e),e.tag){case 3:fr(Zt),zs();break;case 26:case 27:case 5:Oc(e);break;case 4:zs();break;case 31:e.memoizedState!==null&&jn(e);break;case 13:jn(e);break;case 19:fn(jt);break;case 10:fr(e.type);break;case 22:case 23:jn(e),bp(),t!==null&&fn(Ia);break;case 24:fr(Zt);}}function Ll(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,o=n.inst;i=a(),o.destroy=i;}n=n.next;}while(n!==r)}}catch(u){ot(e,e.return,u);}}function ia(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var o=i.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,r=e;var d=n,g=u;try{g();}catch(y){ot(r,d,y);}}}i=i.next;}while(i!==a)}}catch(y){ot(e,e.return,y);}}function Cb(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Py(e,n);}catch(i){ot(t,t.return,i);}}}function Rb(t,e,n){n.props=Fa(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount();}catch(i){ot(t,e,i);}}function ll(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode;}typeof n=="function"?t.refCleanup=n(i):n.current=i;}}catch(r){ot(t,e,r);}}function Di(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i();}catch(r){ot(t,e,r);}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null);}else if(typeof n=="function")try{n(null);}catch(r){ot(t,e,r);}else n.current=null;}function kb(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case "button":case "input":case "select":case "textarea":n.autoFocus&&i.focus();break e;case "img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet);}}catch(r){ot(t,t.return,r);}}function Qh(t,e,n){try{var i=t.stateNode;dC(i,t.type,n,e),i[Pn]=e;}catch(r){ot(t,t.return,r);}}function xb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&sa(t.type)||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xb(t.return))return null;t=t.return;}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child;}if(!(t.flags&2))return t.stateNode}}function Bm(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=lr));else if(i!==4&&(i===27&&sa(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Bm(t,e,n),t=t.sibling;t!==null;)Bm(t,e,n),t=t.sibling;}function Yc(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&sa(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Yc(t,e,n),t=t.sibling;t!==null;)Yc(t,e,n),t=t.sibling;}function Ob(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);vn(e,i,n),e[mn]=t,e[Pn]=n;}catch(a){ot(t,t.return,a);}}var sr=false,Kt=false,Kh=false,c0=typeof WeakSet=="function"?WeakSet:Set,un=null;function WT(t,e){if(t=t.containerInfo,jm=nf,t=Ay(t),cp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType;}catch{n=null;break e}var o=0,u=-1,d=-1,g=0,y=0,A=t,p=null;t:for(;;){for(var _;A!==n||r!==0&&A.nodeType!==3||(u=o+r),A!==a||i!==0&&A.nodeType!==3||(d=o+i),A.nodeType===3&&(o+=A.nodeValue.length),(_=A.firstChild)!==null;)p=A,A=_;for(;;){if(A===t)break t;if(p===n&&++g===r&&(u=o),p===a&&++y===i&&(d=o),(_=A.nextSibling)!==null)break;A=p,p=A.parentNode;}A=_;}n=u===-1||d===-1?null:{start:u,end:d};}else n=null;}n=n||{start:0,end:0};}else n=null;for(Ym={focusedElem:t,selectionRange:n},nf=false,un=e;un!==null;)if(e=un,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,un=t;else for(;un!==null;){switch(e=un,a=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var C=Fa(n.type,r);t=i.getSnapshotBeforeUpdate(C,a),i.__reactInternalSnapshotBeforeUpdate=t;}catch(N){ot(n,n.return,N);}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Wm(t);else if(n===1)switch(t.nodeName){case "HEAD":case "HTML":case "BODY":Wm(t);break;default:t.textContent="";}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(Y(163))}if(t=e.sibling,t!==null){t.return=e.return,un=t;break}un=e.return;}}function Ib(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ir(t,n),i&4&&Ll(5,n);break;case 1:if(ir(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount();}catch(o){ot(n,n.return,o);}else {var r=Fa(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate);}catch(o){ot(n,n.return,o);}}i&64&&Cb(n),i&512&&ll(n,n.return);break;case 3:if(ir(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode;}try{Py(t,e);}catch(o){ot(n,n.return,o);}}break;case 27:e===null&&i&4&&Ob(n);case 26:case 5:ir(t,n),e===null&&i&4&&kb(n),i&512&&ll(n,n.return);break;case 12:ir(t,n);break;case 31:ir(t,n),i&4&&Lb(t,n);break;case 13:ir(t,n),i&4&&Pb(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=nC.bind(null,n),bC(t,n))));break;case 22:if(i=n.memoizedState!==null||sr,!i){e=e!==null&&e.memoizedState!==null||Kt,r=sr;var a=Kt;sr=i,(Kt=e)&&!a?rr(t,n,(n.subtreeFlags&8772)!==0):ir(t,n),sr=r,Kt=a;}break;case 30:break;default:ir(t,n);}}function Nb(t){var e=t.alternate;e!==null&&(t.alternate=null,Nb(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&rp(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null;}var Ot=null,Nn=false;function nr(t,e,n){for(n=n.child;n!==null;)Db(t,e,n),n=n.sibling;}function Db(t,e,n){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Rl,n);}catch{}switch(n.tag){case 26:Kt||Di(n,e),nr(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kt||Di(n,e);var i=Ot,r=Nn;sa(n.type)&&(Ot=n.stateNode,Nn=false),nr(t,e,n),dl(n.stateNode),Ot=i,Nn=r;break;case 5:Kt||Di(n,e);case 6:if(i=Ot,r=Nn,Ot=null,nr(t,e,n),Ot=i,Nn=r,Ot!==null)if(Nn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(n.stateNode);}catch(a){ot(n,e,a);}else try{Ot.removeChild(n.stateNode);}catch(a){ot(n,e,a);}break;case 18:Ot!==null&&(Nn?(t=Ot,M0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),$s(t)):M0(Ot,n.stateNode));break;case 4:i=Ot,r=Nn,Ot=n.stateNode.containerInfo,Nn=true,nr(t,e,n),Ot=i,Nn=r;break;case 0:case 11:case 14:case 15:ia(2,n,e),Kt||ia(4,n,e),nr(t,e,n);break;case 1:Kt||(Di(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Rb(n,e,i)),nr(t,e,n);break;case 21:nr(t,e,n);break;case 22:Kt=(i=Kt)||n.memoizedState!==null,nr(t,e,n),Kt=i;break;default:nr(t,e,n);}}function Lb(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{$s(t);}catch(n){ot(e,e.return,n);}}}function Pb(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{$s(t);}catch(n){ot(e,e.return,n);}}function QT(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new c0),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new c0),e;default:throw Error(Y(435,t.tag))}}function lc(t,e){var n=QT(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=iC.bind(null,t,i);i.then(r,r);}});}function On(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,o=e,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(sa(u.type)){Ot=u.stateNode,Nn=false;break e}break;case 5:Ot=u.stateNode,Nn=false;break e;case 3:case 4:Ot=u.stateNode.containerInfo,Nn=true;break e}u=u.return;}if(Ot===null)throw Error(Y(160));Db(a,o,r),Ot=null,Nn=false,a=r.alternate,a!==null&&(a.return=null),r.return=null;}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Bb(e,t),e=e.sibling;}var Ei=null;function Bb(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:On(e,t),In(t),i&4&&(ia(3,t,t.return),Ll(3,t),ia(5,t,t.return));break;case 1:On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),i&64&&sr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Ei;if(On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case "title":a=r.getElementsByTagName("title")[0],(!a||a[Ol]||a[mn]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),vn(a,i,n),a[mn]=t,cn(a),i=a;break e;case "link":var o=I0("link","href",r).get(i+(n.href||""));if(o){for(var u=0;u<o.length;u++)if(a=o[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(u,1);break t}}a=r.createElement(i),vn(a,i,n),r.head.appendChild(a);break;case "meta":if(o=I0("meta","content",r).get(i+(n.content||""))){for(u=0;u<o.length;u++)if(a=o[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(u,1);break t}}a=r.createElement(i),vn(a,i,n),r.head.appendChild(a);break;default:throw Error(Y(468,i))}a[mn]=t,cn(a),i=a;}t.stateNode=i;}else N0(r,t.type,t.stateNode);else t.stateNode=O0(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?N0(r,t.type,t.stateNode):O0(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Qh(t,t.memoizedProps,n.memoizedProps);}break;case 27:On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),n!==null&&i&4&&Qh(t,t.memoizedProps,n.memoizedProps);break;case 5:if(On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),t.flags&32){r=t.stateNode;try{Ys(r,"");}catch(C){ot(t,t.return,C);}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Qh(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Kh=true);break;case 6:if(On(e,t),In(t),i&4){if(t.stateNode===null)throw Error(Y(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i;}catch(C){ot(t,t.return,C);}}break;case 3:if(Tc=null,r=Ei,Ei=$c(e.containerInfo),On(e,t),Ei=r,In(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{$s(e.containerInfo);}catch(C){ot(t,t.return,C);}Kh&&(Kh=false,Ub(t));break;case 4:i=Ei,Ei=$c(t.stateNode.containerInfo),On(e,t),In(t),Ei=i;break;case 12:On(e,t),In(t);break;case 31:On(e,t),In(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,lc(t,i)));break;case 13:On(e,t),In(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(gf=Wn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,lc(t,i)));break;case 22:r=t.memoizedState!==null;var d=n!==null&&n.memoizedState!==null,g=sr,y=Kt;if(sr=g||r,Kt=y||d,On(e,t),Kt=y,sr=g,In(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||d||sr||Kt||ka(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){d=n=e;try{if(a=d.stateNode,r)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else {u=d.stateNode;var A=d.memoizedProps.style,p=A!=null&&A.hasOwnProperty("display")?A.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim();}}catch(C){ot(d,d.return,C);}}}else if(e.tag===6){if(n===null){d=e;try{d.stateNode.nodeValue=r?"":d.memoizedProps;}catch(C){ot(d,d.return,C);}}}else if(e.tag===18){if(n===null){d=e;try{var _=d.stateNode;r?T0(_,!0):T0(d.stateNode,!1);}catch(C){ot(d,d.return,C);}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return;}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling;}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,lc(t,n))));break;case 19:On(e,t),In(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,lc(t,i)));break;case 30:break;case 21:break;default:On(e,t),In(t);}}function In(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(xb(i)){n=i;break}i=i.return;}if(n==null)throw Error(Y(160));switch(n.tag){case 27:var r=n.stateNode,a=Xh(t);Yc(t,a,r);break;case 5:var o=n.stateNode;n.flags&32&&(Ys(o,""),n.flags&=-33);var u=Xh(t);Yc(t,u,o);break;case 3:case 4:var d=n.stateNode.containerInfo,g=Xh(t);Bm(t,g,d);break;default:throw Error(Y(161))}}catch(y){ot(t,t.return,y);}t.flags&=-3;}e&4096&&(t.flags&=-4097);}function Ub(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Ub(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling;}}function ir(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Ib(t,e.alternate,e),e=e.sibling;}function ka(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ia(4,e,e.return),ka(e);break;case 1:Di(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Rb(e,e.return,n),ka(e);break;case 27:dl(e.stateNode);case 26:case 5:Di(e,e.return),ka(e);break;case 22:e.memoizedState===null&&ka(e);break;case 30:ka(e);break;default:ka(e);}t=t.sibling;}}function rr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,o=a.flags;switch(a.tag){case 0:case 11:case 15:rr(r,a,n),Ll(4,a);break;case 1:if(rr(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount();}catch(g){ot(i,i.return,g);}if(i=a,r=i.updateQueue,r!==null){var u=i.stateNode;try{var d=r.shared.hiddenCallbacks;if(d!==null)for(r.shared.hiddenCallbacks=null,r=0;r<d.length;r++)Ly(d[r],u);}catch(g){ot(i,i.return,g);}}n&&o&64&&Cb(a),ll(a,a.return);break;case 27:Ob(a);case 26:case 5:rr(r,a,n),n&&i===null&&o&4&&kb(a),ll(a,a.return);break;case 12:rr(r,a,n);break;case 31:rr(r,a,n),n&&o&4&&Lb(r,a);break;case 13:rr(r,a,n),n&&o&4&&Pb(r,a);break;case 22:a.memoizedState===null&&rr(r,a,n),ll(a,a.return);break;case 30:break;default:rr(r,a,n);}e=e.sibling;}}function Pp(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Nl(n));}function Bp(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t));}function Si(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fb(t,e,n,i),e=e.sibling;}function Fb(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Si(t,e,n,i),r&2048&&Ll(9,e);break;case 1:Si(t,e,n,i);break;case 3:Si(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t)));break;case 12:if(r&2048){Si(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,o=a.id,u=a.onPostCommit;typeof u=="function"&&u(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0);}catch(d){ot(e,e.return,d);}}else Si(t,e,n,i);break;case 31:Si(t,e,n,i);break;case 13:Si(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,o=e.alternate,e.memoizedState!==null?a._visibility&2?Si(t,e,n,i):ul(t,e):a._visibility&2?Si(t,e,n,i):(a._visibility|=2,Ss(t,e,n,i,(e.subtreeFlags&10256)!==0||false)),r&2048&&Pp(o,e);break;case 24:Si(t,e,n,i),r&2048&&Bp(e.alternate,e);break;default:Si(t,e,n,i);}}function Ss(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||false),e=e.child;e!==null;){var a=t,o=e,u=n,d=i,g=o.flags;switch(o.tag){case 0:case 11:case 15:Ss(a,o,u,d,r),Ll(8,o);break;case 23:break;case 22:var y=o.stateNode;o.memoizedState!==null?y._visibility&2?Ss(a,o,u,d,r):ul(a,o):(y._visibility|=2,Ss(a,o,u,d,r)),r&&g&2048&&Pp(o.alternate,o);break;case 24:Ss(a,o,u,d,r),r&&g&2048&&Bp(o.alternate,o);break;default:Ss(a,o,u,d,r);}e=e.sibling;}}function ul(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ul(n,i),r&2048&&Pp(i.alternate,i);break;case 24:ul(n,i),r&2048&&Bp(i.alternate,i);break;default:ul(n,i);}e=e.sibling;}}var $o=8192;function _s(t,e,n){if(t.subtreeFlags&$o)for(t=t.child;t!==null;)Vb(t,e,n),t=t.sibling;}function Vb(t,e,n){switch(t.tag){case 26:_s(t,e,n),t.flags&$o&&t.memoizedState!==null&&IC(n,Ei,t.memoizedState,t.memoizedProps);break;case 5:_s(t,e,n);break;case 3:case 4:var i=Ei;Ei=$c(t.stateNode.containerInfo),_s(t,e,n),Ei=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=$o,$o=16777216,_s(t,e,n),$o=i):_s(t,e,n));break;default:_s(t,e,n);}}function Hb(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function qo(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];un=i,zb(i,t);}Hb(t);}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gb(t),t=t.sibling;}function Gb(t){switch(t.tag){case 0:case 11:case 15:qo(t),t.flags&2048&&ia(9,t,t.return);break;case 3:qo(t);break;case 12:qo(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,wc(t)):qo(t);break;default:qo(t);}}function wc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];un=i,zb(i,t);}Hb(t);}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ia(8,e,e.return),wc(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,wc(e));break;default:wc(e);}t=t.sibling;}}function zb(t,e){for(;un!==null;){var n=un;switch(n.tag){case 0:case 11:case 15:ia(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++;}break;case 24:Nl(n.memoizedState.cache);}if(i=n.child,i!==null)i.return=n,un=i;else e:for(n=t;un!==null;){i=un;var r=i.sibling,a=i.return;if(Nb(i),i===n){un=null;break e}if(r!==null){r.return=a,un=r;break e}un=a;}}}var XT={getCacheForType:function(t){var e=gn(Zt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return gn(Zt).controller.signal}},KT=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,Ge=null,je=0,st=0,zn=null,zr=false,ro=false,Up=false,vr=0,Ft=0,ra=0,Da=0,Fp=0,qn=0,Xs=0,cl=null,Dn=null,Um=false,gf=0,jb=0,qc=1/0,Wc=null,Kr=null,nn=0,Zr=null,Ks=null,dr=0,Fm=0,Vm=null,Yb=null,fl=0,Hm=null;function Kn(){return (nt&2)!==0&&je!==0?je&-je:Te.T!==null?Hp():ey()}function qb(){if(qn===0)if((je&536870912)===0||We){var t=Ju;Ju<<=1,(Ju&3932160)===0&&(Ju=262144),qn=t;}else qn=536870912;return t=Jn.current,t!==null&&(t.flags|=32),qn}function Ln(t,e,n){(t===mt&&(st===2||st===9)||t.cancelPendingCommit!==null)&&(Zs(t,0),jr(t,je,qn,false)),xl(t,n),((nt&2)===0||t!==mt)&&(t===mt&&((nt&2)===0&&(Da|=n),Ft===4&&jr(t,je,qn,false)),Bi(t));}function Wb(t,e,n){if((nt&6)!==0)throw Error(Y(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||kl(t,e),r=i?$T(t,e):Zh(t,e,true),a=i;do{if(r===0){ro&&!i&&jr(t,e,0,false);break}else {if(n=t.current.alternate,a&&!ZT(n)){r=Zh(t,e,false),a=false;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var u=t;r=cl;var d=u.current.memoizedState.isDehydrated;if(d&&(Zs(u,o).flags|=256),o=Zh(u,o,false),o!==2){if(Up&&!d){u.errorRecoveryDisabledLanes|=a,Da|=a,r=4;break e}a=Dn,Dn=r,a!==null&&(Dn===null?Dn=a:Dn.push.apply(Dn,a));}r=o;}if(a=false,r!==2)continue}}if(r===1){Zs(t,0),jr(t,e,0,true);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(Y(345));case 4:if((e&4194048)!==e)break;case 6:jr(i,e,qn,!zr);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(Y(329))}if((e&62914560)===e&&(r=gf+300-Wn(),10<r)){if(jr(i,e,qn,!zr),af(i,0,true)!==0)break e;dr=e,i.timeoutHandle=h_(f0.bind(null,i,n,Dn,Wc,Um,e,qn,Da,Xs,zr,a,"Throttled",-0,0),r);break e}f0(i,n,Dn,Wc,Um,e,qn,Da,Xs,zr,a,null,-0,0);}}break}while(true);Bi(t);}function f0(t,e,n,i,r,a,o,u,d,g,y,A,p,_){if(t.timeoutHandle=-1,A=e.subtreeFlags,A&8192||(A&16785408)===16785408){A={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:true,waitingForViewTransition:false,unsuspend:lr},Vb(e,a,A);var C=(a&62914560)===a?gf-Wn():(a&4194048)===a?jb-Wn():0;if(C=NC(A,C),C!==null){dr=a,t.cancelPendingCommit=C(h0.bind(null,t,e,a,n,i,r,o,u,d,y,A,null,p,_)),jr(t,a,o,!g);return}}h0(t,e,a,n,i,r,o,u,d);}function ZT(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!Zn(a(),r))return !1}catch{return false}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else {if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return true;e=e.return;}e.sibling.return=e.return,e=e.sibling;}}return true}function jr(t,e,n,i){e&=~Fp,e&=~Da,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-Xn(r),o=1<<a;i[a]=-1,r&=~o;}n!==0&&Z0(t,n,e);}function vf(){return (nt&6)===0?(Pl(0),false):true}function Vp(){if(Ge!==null){if(st===0)var t=Ge.return;else t=Ge,ur=ja=null,Mp(t),Vs=null,yl=0,t=Ge;for(;t!==null;)Tb(t.alternate,t),t=t.return;Ge=null;}}function Zs(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,pC(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),dr=0,Vp(),mt=t,Ge=n=cr(t.current,null),je=e,st=0,zn=null,zr=false,ro=kl(t,e),Up=false,Xs=qn=Fp=Da=ra=Ft=0,Dn=cl=null,Um=false,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-Xn(i),a=1<<r;e|=t[r],i&=~a;}return vr=e,uf(),n}function Qb(t,e){Oe=null,Te.H=_l,e===io||e===ff?(e=zA(),st=3):e===Ap?(e=zA(),st=4):st=e===Dp?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,zn=e,Ge===null&&(Ft=1,zc(t,fi(e,t.current)));}function Xb(){var t=Jn.current;return t===null?true:(je&4194048)===je?hi===null:(je&62914560)===je||(je&536870912)!==0?t===hi:false}function Kb(){var t=Te.H;return Te.H=_l,t===null?_l:t}function Zb(){var t=Te.A;return Te.A=XT,t}function Qc(){Ft=4,zr||(je&4194048)!==je&&Jn.current!==null||(ro=true),(ra&134217727)===0&&(Da&134217727)===0||mt===null||jr(mt,je,qn,false);}function Zh(t,e,n){var i=nt;nt|=2;var r=Kb(),a=Zb();(mt!==t||je!==e)&&(Wc=null,Zs(t,e)),e=false;var o=Ft;e:do try{if(st!==0&&Ge!==null){var u=Ge,d=zn;switch(st){case 8:Vp(),o=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(e=!0);var g=st;if(st=0,zn=null,Ls(t,u,d,g),n&&ro){o=0;break e}break;default:g=st,st=0,zn=null,Ls(t,u,d,g);}}JT(),o=Ft;break}catch(y){Qb(t,y);}while(true);return e&&t.shellSuspendCounter++,ur=ja=null,nt=i,Te.H=r,Te.A=a,Ge===null&&(mt=null,je=0,uf()),o}function JT(){for(;Ge!==null;)Jb(Ge);}function $T(t,e){var n=nt;nt|=2;var i=Kb(),r=Zb();mt!==t||je!==e?(Wc=null,qc=Wn()+500,Zs(t,e)):ro=kl(t,e);e:do try{if(st!==0&&Ge!==null){e=Ge;var a=zn;t:switch(st){case 1:st=0,zn=null,Ls(t,e,a,1);break;case 2:case 9:if(GA(a)){st=0,zn=null,d0(e);break}e=function(){st!==2&&st!==9||mt!==t||(st=7),Bi(t);},a.then(e,e);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:GA(a)?(st=0,zn=null,d0(e)):(st=0,zn=null,Ls(t,e,a,7));break;case 5:var o=null;switch(Ge.tag){case 26:o=Ge.memoizedState;case 5:case 27:var u=Ge;if(o?A_(o):u.stateNode.complete){st=0,zn=null;var d=u.sibling;if(d!==null)Ge=d;else {var g=u.return;g!==null?(Ge=g,Af(g)):Ge=null;}break t}}st=0,zn=null,Ls(t,e,a,5);break;case 6:st=0,zn=null,Ls(t,e,a,6);break;case 8:Vp(),Ft=6;break e;default:throw Error(Y(462))}}eC();break}catch(y){Qb(t,y);}while(true);return ur=ja=null,Te.H=i,Te.A=r,nt=n,Ge!==null?0:(mt=null,je=0,uf(),Ft)}function eC(){for(;Ge!==null&&!EM();)Jb(Ge);}function Jb(t){var e=Mb(t.alternate,t,vr);t.memoizedProps=t.pendingProps,e===null?Af(t):Ge=e;}function d0(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=a0(n,e,e.pendingProps,e.type,void 0,je);break;case 11:e=a0(n,e,e.pendingProps,e.type.render,e.ref,je);break;case 5:Mp(e);default:Tb(n,e),e=Ge=Ty(e,vr),e=Mb(n,e,vr);}t.memoizedProps=t.pendingProps,e===null?Af(t):Ge=e;}function Ls(t,e,n,i){ur=ja=null,Mp(e),Vs=null,yl=0;var r=e.return;try{if(GT(t,r,e,n,je)){Ft=1,zc(t,fi(n,t.current)),Ge=null;return}}catch(a){if(r!==null)throw Ge=r,a;Ft=1,zc(t,fi(n,t.current)),Ge=null;return}e.flags&32768?(We||i===1?t=true:ro||(je&536870912)!==0?t=false:(zr=t=true,(i===2||i===9||i===3||i===6)&&(i=Jn.current,i!==null&&i.tag===13&&(i.flags|=16384))),$b(e,t)):Af(e);}function Af(t){var e=t;do{if((e.flags&32768)!==0){$b(e,zr);return}t=e.return;var n=YT(e.alternate,e,vr);if(n!==null){Ge=n;return}if(e=e.sibling,e!==null){Ge=e;return}Ge=e=t;}while(e!==null);Ft===0&&(Ft=5);}function $b(t,e){do{var n=qT(t.alternate,t);if(n!==null){n.flags&=32767,Ge=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ge=t;return}Ge=t=n;}while(t!==null);Ft=6,Ge=null;}function h0(t,e,n,i,r,a,o,u,d){t.cancelPendingCommit=null;do yf();while(nn!==0);if((nt&6)!==0)throw Error(Y(327));if(e!==null){if(e===t.current)throw Error(Y(177));if(a=e.lanes|e.childLanes,a|=fp,NM(t,n,a,o,u,d),t===mt&&(Ge=mt=null,je=0),Ks=e,Zr=t,dr=n,Fm=a,Vm=r,Yb=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,rC(Ic,function(){return r_(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Te.T,Te.T=null,r=it.p,it.p=2,o=nt,nt|=4;try{WT(t,e,n);}finally{nt=o,it.p=r,Te.T=i;}}nn=1,e_(),t_(),n_();}}function e_(){if(nn===1){nn=0;var t=Zr,e=Ks,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Te.T,Te.T=null;var i=it.p;it.p=2;var r=nt;nt|=4;try{Bb(e,t);var a=Ym,o=Ay(t.containerInfo),u=a.focusedElem,d=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&vy(u.ownerDocument.documentElement,u)){if(d!==null&&cp(u)){var g=d.start,y=d.end;if(y===void 0&&(y=g),"selectionStart"in u)u.selectionStart=g,u.selectionEnd=Math.min(y,u.value.length);else {var A=u.ownerDocument||document,p=A&&A.defaultView||window;if(p.getSelection){var _=p.getSelection(),C=u.textContent.length,N=Math.min(d.start,C),B=d.end===void 0?N:Math.min(d.end,C);!_.extend&&N>B&&(o=B,B=N,N=o);var M=LA(u,N),w=LA(u,B);if(M&&w&&(_.rangeCount!==1||_.anchorNode!==M.node||_.anchorOffset!==M.offset||_.focusNode!==w.node||_.focusOffset!==w.offset)){var R=A.createRange();R.setStart(M.node,M.offset),_.removeAllRanges(),N>B?(_.addRange(R),_.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),_.addRange(R));}}}}for(A=[],_=u;_=_.parentNode;)_.nodeType===1&&A.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<A.length;u++){var D=A[u];D.element.scrollLeft=D.left,D.element.scrollTop=D.top;}}nf=!!jm,Ym=jm=null;}finally{nt=r,it.p=i,Te.T=n;}}t.current=e,nn=2;}}function t_(){if(nn===2){nn=0;var t=Zr,e=Ks,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Te.T,Te.T=null;var i=it.p;it.p=2;var r=nt;nt|=4;try{Ib(t,e.alternate,e);}finally{nt=r,it.p=i,Te.T=n;}}nn=3;}}function n_(){if(nn===4||nn===3){nn=0,wM();var t=Zr,e=Ks,n=dr,i=Yb;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?nn=5:(nn=0,Ks=Zr=null,i_(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Kr=null),ip(n),e=e.stateNode,Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Rl,e,void 0,(e.current.flags&128)===128);}catch{}if(i!==null){e=Te.T,r=it.p,it.p=2,Te.T=null;try{for(var a=t.onRecoverableError,o=0;o<i.length;o++){var u=i[o];a(u.value,{componentStack:u.stack});}}finally{Te.T=e,it.p=r;}}(dr&3)!==0&&yf(),Bi(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Hm?fl++:(fl=0,Hm=t):fl=0,Pl(0);}}function i_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Nl(e)));}function yf(){return e_(),t_(),n_(),r_()}function r_(){if(nn!==5)return false;var t=Zr,e=Fm;Fm=0;var n=ip(dr),i=Te.T,r=it.p;try{it.p=32>n?32:n,Te.T=null,n=Vm,Vm=null;var a=Zr,o=dr;if(nn=0,Ks=Zr=null,dr=0,(nt&6)!==0)throw Error(Y(331));var u=nt;if(nt|=4,Gb(a.current),Fb(a,a.current,o,n),nt=u,Pl(0,!1),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Rl,a);}catch{}return !0}finally{it.p=r,Te.T=i,i_(t,e);}}function m0(t,e,n){e=fi(n,e),e=Dm(t.stateNode,e,2),t=Xr(t,e,2),t!==null&&(xl(t,2),Bi(t));}function ot(t,e,n){if(t.tag===3)m0(t,t,n);else for(;e!==null;){if(e.tag===3){m0(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kr===null||!Kr.has(i))){t=fi(n,t),n=yb(2),i=Xr(e,n,2),i!==null&&(bb(n,i,e,t),xl(i,2),Bi(i));break}}e=e.return;}}function Jh(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new KT;var r=new Set;i.set(e,r);}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Up=true,r.add(n),t=tC.bind(null,t,e,n),e.then(t,t));}function tC(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,mt===t&&(je&n)===n&&(Ft===4||Ft===3&&(je&62914560)===je&&300>Wn()-gf?(nt&2)===0&&Zs(t,0):Fp|=n,Xs===je&&(Xs=0)),Bi(t);}function a_(t,e){e===0&&(e=K0()),t=za(t,e),t!==null&&(xl(t,e),Bi(t));}function nC(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),a_(t,n);}function iC(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(Y(314))}i!==null&&i.delete(e),a_(t,n);}function rC(t,e){return tp(t,e)}var Xc=null,Es=null,Gm=false,Kc=false,$h=false,Yr=0;function Bi(t){t!==Es&&t.next===null&&(Es===null?Xc=Es=t:Es=Es.next=t),Kc=true,Gm||(Gm=true,sC());}function Pl(t,e){if(!$h&&Kc){$h=true;do for(var n=false,i=Xc;i!==null;){if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else {var o=i.suspendedLanes,u=i.pingedLanes;a=(1<<31-Xn(42|t)+1)-1,a&=r&~(o&~u),a=a&201326741?a&201326741|1:a?a|2:0;}a!==0&&(n=true,p0(i,a));}else a=je,a=af(i,i===mt?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||kl(i,a)||(n=true,p0(i,a));i=i.next;}while(n);$h=false;}}function aC(){s_();}function s_(){Kc=Gm=false;var t=0;Yr!==0&&mC()&&(t=Yr);for(var e=Wn(),n=null,i=Xc;i!==null;){var r=i.next,a=o_(i,e);a===0?(i.next=null,n===null?Xc=r:n.next=r,r===null&&(Es=n)):(n=i,(t!==0||(a&3)!==0)&&(Kc=true)),i=r;}nn!==0&&nn!==5||Pl(t),Yr!==0&&(Yr=0);}function o_(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var o=31-Xn(a),u=1<<o,d=r[o];d===-1?((u&n)===0||(u&i)!==0)&&(r[o]=IM(u,e)):d<=e&&(t.expiredLanes|=u),a&=~u;}if(e=mt,n=je,n=af(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(st===2||st===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Rh(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||kl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Rh(i),ip(n)){case 2:case 8:n=Q0;break;case 32:n=Ic;break;case 268435456:n=X0;break;default:n=Ic;}return i=l_.bind(null,t),n=tp(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Rh(i),t.callbackPriority=2,t.callbackNode=null,2}function l_(t,e){if(nn!==0&&nn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(yf()&&t.callbackNode!==n)return null;var i=je;return i=af(t,t===mt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Wb(t,i,e),o_(t,Wn()),t.callbackNode!=null&&t.callbackNode===n?l_.bind(null,t):null)}function p0(t,e){if(yf())return null;Wb(t,e,true);}function sC(){gC(function(){(nt&6)!==0?tp(W0,aC):s_();});}function Hp(){if(Yr===0){var t=qs;t===0&&(t=Zu,Zu<<=1,(Zu&261888)===0&&(Zu=256)),Yr=t;}return Yr}function g0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pc(""+t)}function v0(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function oC(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=g0((r[Pn]||null).action),o=i.submitter;o&&(e=(e=o[Pn]||null)?g0(e.formAction):o.getAttribute("formAction"),e!==null&&(a=e,o=null));var u=new sf("action","action",null,i,r);t.push({event:u,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yr!==0){var d=o?v0(r,o):new FormData(r);Im(n,{pending:true,data:d,method:r.method,action:a},null,d);}}else typeof a=="function"&&(u.preventDefault(),d=o?v0(r,o):new FormData(r),Im(n,{pending:true,data:d,method:r.method,action:a},a,d));},currentTarget:r}]});}}for(uc=0;uc<bm.length;uc++)cc=bm[uc],A0=cc.toLowerCase(),y0=cc[0].toUpperCase()+cc.slice(1),wi(A0,"on"+y0);var cc,A0,y0,uc;wi(by,"onAnimationEnd");wi(_y,"onAnimationIteration");wi(Sy,"onAnimationStart");wi("dblclick","onDoubleClick");wi("focusin","onFocus");wi("focusout","onBlur");wi(MT,"onTransitionRun");wi(TT,"onTransitionStart");wi(CT,"onTransitionCancel");wi(Ey,"onTransitionEnd");js("onMouseEnter",["mouseout","mouseover"]);js("onMouseLeave",["mouseout","mouseover"]);js("onPointerEnter",["pointerout","pointerover"]);js("onPointerLeave",["pointerout","pointerover"]);Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Va("onBeforeInput",["compositionend","keypress","textInput","paste"]);Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function u_(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var o=i.length-1;0<=o;o--){var u=i[o],d=u.instance,g=u.currentTarget;if(u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(y){Dc(y);}r.currentTarget=null,a=d;}else for(o=0;o<i.length;o++){if(u=i[o],d=u.instance,g=u.currentTarget,u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(y){Dc(y);}r.currentTarget=null,a=d;}}}}function He(t,e){var n=e[dm];n===void 0&&(n=e[dm]=new Set);var i=t+"__bubble";n.has(i)||(c_(e,t,2,false),n.add(i));}function em(t,e,n){var i=0;e&&(i|=4),c_(n,t,i,e);}var fc="_reactListening"+Math.random().toString(36).slice(2);function Gp(t){if(!t[fc]){t[fc]=true,ty.forEach(function(n){n!=="selectionchange"&&(lC.has(n)||em(n,false,t),em(n,true,t));});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[fc]||(e[fc]=true,em("selectionchange",false,e));}}function c_(t,e,n,i){switch(E_(e)){case 2:var r=PC;break;case 8:r=BC;break;default:r=qp;}n=r.bind(null,e,n,t),r=void 0,!vm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=true),i?r!==void 0?t.addEventListener(e,n,{capture:true,passive:r}):t.addEventListener(e,n,true):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,false);}function tm(t,e,n,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var u=i.stateNode.containerInfo;if(u===r)break;if(o===4)for(o=i.return;o!==null;){var d=o.tag;if((d===3||d===4)&&o.stateNode.containerInfo===r)return;o=o.return;}for(;u!==null;){if(o=Ts(u),o===null)return;if(d=o.tag,d===5||d===6||d===26||d===27){i=a=o;continue e}u=u.parentNode;}}i=i.return;}uy(function(){var g=a,y=sp(n),A=[];e:{var p=wy.get(t);if(p!==void 0){var _=sf,C=t;switch(t){case "keypress":if(vc(n)===0)break e;case "keydown":case "keyup":_=iT;break;case "focusin":C="focus",_=Nh;break;case "focusout":C="blur",_=Nh;break;case "beforeblur":case "afterblur":_=Nh;break;case "click":if(n.button===2)break e;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":_=TA;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":_=YM;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":_=sT;break;case by:case _y:case Sy:_=QM;break;case Ey:_=lT;break;case "scroll":case "scrollend":_=zM;break;case "wheel":_=cT;break;case "copy":case "cut":case "paste":_=KM;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":_=RA;break;case "toggle":case "beforetoggle":_=dT;}var N=(e&4)!==0,B=!N&&(t==="scroll"||t==="scrollend"),M=N?p!==null?p+"Capture":null:p;N=[];for(var w=g,R;w!==null;){var D=w;if(R=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||R===null||M===null||(D=ml(w,M),D!=null&&N.push(El(w,D,R))),B)break;w=w.return;}0<N.length&&(p=new _(p,C,null,n,y),A.push({event:p,listeners:N}));}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",_=t==="mouseout"||t==="pointerout",p&&n!==gm&&(C=n.relatedTarget||n.fromElement)&&(Ts(C)||C[eo]))break e;if((_||p)&&(p=y.window===y?y:(p=y.ownerDocument)?p.defaultView||p.parentWindow:window,_?(C=n.relatedTarget||n.toElement,_=g,C=C?Ts(C):null,C!==null&&(B=Cl(C),N=C.tag,C!==B||N!==5&&N!==27&&N!==6)&&(C=null)):(_=null,C=g),_!==C)){if(N=TA,D="onMouseLeave",M="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(N=RA,D="onPointerLeave",M="onPointerEnter",w="pointer"),B=_==null?p:Zo(_),R=C==null?p:Zo(C),p=new N(D,w+"leave",_,n,y),p.target=B,p.relatedTarget=R,D=null,Ts(y)===g&&(N=new N(M,w+"enter",C,n,y),N.target=R,N.relatedTarget=B,D=N),B=D,_&&C)t:{for(N=uC,M=_,w=C,R=0,D=M;D;D=N(D))R++;D=0;for(var G=w;G;G=N(G))D++;for(;0<R-D;)M=N(M),R--;for(;0<D-R;)w=N(w),D--;for(;R--;){if(M===w||w!==null&&M===w.alternate){N=M;break t}M=N(M),w=N(w);}N=null;}else N=null;_!==null&&b0(A,p,_,N,!1),C!==null&&B!==null&&b0(A,B,C,N,!0);}}e:{if(p=g?Zo(g):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var ne=IA;else if(OA(p))if(py)ne=ST;else {ne=bT;var U=yT;}else _=p.nodeName,!_||_.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&ap(g.elementType)&&(ne=IA):ne=_T;if(ne&&(ne=ne(t,g))){my(A,ne,n,y);break e}U&&U(t,p,g),t==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&pm(p,"number",p.value);}switch(U=g?Zo(g):window,t){case "focusin":(OA(U)||U.contentEditable==="true")&&(ks=U,Am=g,nl=null);break;case "focusout":nl=Am=ks=null;break;case "mousedown":ym=!0;break;case "contextmenu":case "mouseup":case "dragend":ym=!1,PA(A,n,y);break;case "selectionchange":if(wT)break;case "keydown":case "keyup":PA(A,n,y);}var H;if(up)e:{switch(t){case "compositionstart":var ee="onCompositionStart";break e;case "compositionend":ee="onCompositionEnd";break e;case "compositionupdate":ee="onCompositionUpdate";break e}ee=void 0;}else Rs?dy(t,n)&&(ee="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(ee="onCompositionStart");ee&&(fy&&n.locale!=="ko"&&(Rs||ee!=="onCompositionStart"?ee==="onCompositionEnd"&&Rs&&(H=cy()):(Gr=y,op="value"in Gr?Gr.value:Gr.textContent,Rs=!0)),U=Zc(g,ee),0<U.length&&(ee=new CA(ee,t,null,n,y),A.push({event:ee,listeners:U}),H?ee.data=H:(H=hy(n),H!==null&&(ee.data=H)))),(H=mT?pT(t,n):gT(t,n))&&(ee=Zc(g,"onBeforeInput"),0<ee.length&&(U=new CA("onBeforeInput","beforeinput",null,n,y),A.push({event:U,listeners:ee}),U.data=H)),oC(A,t,g,n,y);}u_(A,e);});}function El(t,e,n){return {instance:t,listener:e,currentTarget:n}}function Zc(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=ml(t,n),r!=null&&i.unshift(El(t,r,a)),r=ml(t,e),r!=null&&i.push(El(t,r,a))),t.tag===3)return i;t=t.return;}return []}function uC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function b0(t,e,n,i,r){for(var a=e._reactName,o=[];n!==null&&n!==i;){var u=n,d=u.alternate,g=u.stateNode;if(u=u.tag,d!==null&&d===i)break;u!==5&&u!==26&&u!==27||g===null||(d=g,r?(g=ml(n,a),g!=null&&o.unshift(El(n,g,d))):r||(g=ml(n,a),g!=null&&o.push(El(n,g,d)))),n=n.return;}o.length!==0&&t.push({event:e,listeners:o});}var cC=/\r\n?/g,fC=/\u0000|\uFFFD/g;function _0(t){return (typeof t=="string"?t:""+t).replace(cC,`
9
- `).replace(fC,"")}function f_(t,e){return e=_0(e),_0(t)===e}function ct(t,e,n,i,r,a){switch(n){case "children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Ys(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Ys(t,""+i);break;case "className":ec(t,"class",i);break;case "tabIndex":ec(t,"tabindex",i);break;case "dir":case "role":case "viewBox":case "width":case "height":ec(t,n,i);break;case "style":ly(t,i,a);break;case "data":if(e!=="object"){ec(t,"data",i);break}case "src":case "href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pc(""+i),t.setAttribute(n,i);break;case "action":case "formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&ct(t,e,"name",r.name,r,null),ct(t,e,"formEncType",r.formEncType,r,null),ct(t,e,"formMethod",r.formMethod,r,null),ct(t,e,"formTarget",r.formTarget,r,null)):(ct(t,e,"encType",r.encType,r,null),ct(t,e,"method",r.method,r,null),ct(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pc(""+i),t.setAttribute(n,i);break;case "onClick":i!=null&&(t.onclick=lr);break;case "onScroll":i!=null&&He("scroll",t);break;case "onScrollEnd":i!=null&&He("scrollend",t);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Y(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Y(60));t.innerHTML=n;}}break;case "multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case "muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "defaultValue":case "defaultChecked":case "innerHTML":case "ref":break;case "autoFocus":break;case "xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=pc(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case "contentEditable":case "spellCheck":case "draggable":case "value":case "autoReverse":case "externalResourcesRequired":case "focusable":case "preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case "inert":case "allowFullScreen":case "async":case "autoPlay":case "controls":case "default":case "defer":case "disabled":case "disablePictureInPicture":case "disableRemotePlayback":case "formNoValidate":case "hidden":case "loop":case "noModule":case "noValidate":case "open":case "playsInline":case "readOnly":case "required":case "reversed":case "scoped":case "seamless":case "itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case "capture":case "download":i===true?t.setAttribute(n,""):i!==false&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case "cols":case "rows":case "size":case "span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case "rowSpan":case "start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case "popover":He("beforetoggle",t),He("toggle",t),mc(t,"popover",i);break;case "xlinkActuate":er(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case "xlinkArcrole":er(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case "xlinkRole":er(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case "xlinkShow":er(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case "xlinkTitle":er(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case "xlinkType":er(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case "xmlBase":er(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case "xmlLang":er(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case "xmlSpace":er(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case "is":mc(t,"is",i);break;case "innerText":case "textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=HM.get(n)||n,mc(t,n,i));}}function zm(t,e,n,i,r,a){switch(n){case "style":ly(t,i,a);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Y(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Y(60));t.innerHTML=n;}}break;case "children":typeof i=="string"?Ys(t,i):(typeof i=="number"||typeof i=="bigint")&&Ys(t,""+i);break;case "onScroll":i!=null&&He("scroll",t);break;case "onScrollEnd":i!=null&&He("scrollend",t);break;case "onClick":i!=null&&(t.onclick=lr);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "innerHTML":case "ref":break;case "innerText":case "textContent":break;default:if(!ny.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Pn]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===true?t.setAttribute(n,""):mc(t,n,i);}}}function vn(t,e,n){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "img":He("error",t),He("load",t);var i=false,r=false,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case "src":i=true;break;case "srcSet":r=true;break;case "children":case "dangerouslySetInnerHTML":throw Error(Y(137,e));default:ct(t,e,a,o,n,null);}}r&&ct(t,e,"srcSet",n.srcSet,n,null),i&&ct(t,e,"src",n.src,n,null);return;case "input":He("invalid",t);var u=a=o=r=null,d=null,g=null;for(i in n)if(n.hasOwnProperty(i)){var y=n[i];if(y!=null)switch(i){case "name":r=y;break;case "type":o=y;break;case "checked":d=y;break;case "defaultChecked":g=y;break;case "value":a=y;break;case "defaultValue":u=y;break;case "children":case "dangerouslySetInnerHTML":if(y!=null)throw Error(Y(137,e));break;default:ct(t,e,i,y,n,null);}}ay(t,a,u,d,g,o,r,false);return;case "select":He("invalid",t),i=o=a=null;for(r in n)if(n.hasOwnProperty(r)&&(u=n[r],u!=null))switch(r){case "value":a=u;break;case "defaultValue":o=u;break;case "multiple":i=u;default:ct(t,e,r,u,n,null);}e=a,n=o,t.multiple=!!i,e!=null?Bs(t,!!i,e,false):n!=null&&Bs(t,!!i,n,true);return;case "textarea":He("invalid",t),a=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case "value":i=u;break;case "defaultValue":r=u;break;case "children":a=u;break;case "dangerouslySetInnerHTML":if(u!=null)throw Error(Y(91));break;default:ct(t,e,o,u,n,null);}oy(t,i,r,a);return;case "option":for(d in n)n.hasOwnProperty(d)&&(i=n[d],i!=null)&&(d==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":ct(t,e,d,i,n,null));return;case "dialog":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case "iframe":case "object":He("load",t);break;case "video":case "audio":for(i=0;i<Sl.length;i++)He(Sl[i],t);break;case "image":He("error",t),He("load",t);break;case "details":He("toggle",t);break;case "embed":case "source":case "link":He("error",t),He("load",t);case "area":case "base":case "br":case "col":case "hr":case "keygen":case "meta":case "param":case "track":case "wbr":case "menuitem":for(g in n)if(n.hasOwnProperty(g)&&(i=n[g],i!=null))switch(g){case "children":case "dangerouslySetInnerHTML":throw Error(Y(137,e));default:ct(t,e,g,i,n,null);}return;default:if(ap(e)){for(y in n)n.hasOwnProperty(y)&&(i=n[y],i!==void 0&&zm(t,e,y,i,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!=null&&ct(t,e,u,i,n,null));}function dC(t,e,n,i){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "input":var r=null,a=null,o=null,u=null,d=null,g=null,y=null;for(_ in n){var A=n[_];if(n.hasOwnProperty(_)&&A!=null)switch(_){case "checked":break;case "value":break;case "defaultValue":d=A;default:i.hasOwnProperty(_)||ct(t,e,_,null,i,A);}}for(var p in i){var _=i[p];if(A=n[p],i.hasOwnProperty(p)&&(_!=null||A!=null))switch(p){case "type":a=_;break;case "name":r=_;break;case "checked":g=_;break;case "defaultChecked":y=_;break;case "value":o=_;break;case "defaultValue":u=_;break;case "children":case "dangerouslySetInnerHTML":if(_!=null)throw Error(Y(137,e));break;default:_!==A&&ct(t,e,p,_,i,A);}}mm(t,o,u,d,g,y,a,r);return;case "select":_=o=u=p=null;for(a in n)if(d=n[a],n.hasOwnProperty(a)&&d!=null)switch(a){case "value":break;case "multiple":_=d;default:i.hasOwnProperty(a)||ct(t,e,a,null,i,d);}for(r in i)if(a=i[r],d=n[r],i.hasOwnProperty(r)&&(a!=null||d!=null))switch(r){case "value":p=a;break;case "defaultValue":u=a;break;case "multiple":o=a;default:a!==d&&ct(t,e,r,a,i,d);}e=u,n=o,i=_,p!=null?Bs(t,!!n,p,false):!!i!=!!n&&(e!=null?Bs(t,!!n,e,true):Bs(t,!!n,n?[]:"",false));return;case "textarea":_=p=null;for(u in n)if(r=n[u],n.hasOwnProperty(u)&&r!=null&&!i.hasOwnProperty(u))switch(u){case "value":break;case "children":break;default:ct(t,e,u,null,i,r);}for(o in i)if(r=i[o],a=n[o],i.hasOwnProperty(o)&&(r!=null||a!=null))switch(o){case "value":p=r;break;case "defaultValue":_=r;break;case "children":break;case "dangerouslySetInnerHTML":if(r!=null)throw Error(Y(91));break;default:r!==a&&ct(t,e,o,r,i,a);}sy(t,p,_);return;case "option":for(var C in n)p=n[C],n.hasOwnProperty(C)&&p!=null&&!i.hasOwnProperty(C)&&(C==="selected"?t.selected=false:ct(t,e,C,null,i,p));for(d in i)p=i[d],_=n[d],i.hasOwnProperty(d)&&p!==_&&(p!=null||_!=null)&&(d==="selected"?t.selected=p&&typeof p!="function"&&typeof p!="symbol":ct(t,e,d,p,i,_));return;case "img":case "link":case "area":case "base":case "br":case "col":case "embed":case "hr":case "keygen":case "meta":case "param":case "source":case "track":case "wbr":case "menuitem":for(var N in n)p=n[N],n.hasOwnProperty(N)&&p!=null&&!i.hasOwnProperty(N)&&ct(t,e,N,null,i,p);for(g in i)if(p=i[g],_=n[g],i.hasOwnProperty(g)&&p!==_&&(p!=null||_!=null))switch(g){case "children":case "dangerouslySetInnerHTML":if(p!=null)throw Error(Y(137,e));break;default:ct(t,e,g,p,i,_);}return;default:if(ap(e)){for(var B in n)p=n[B],n.hasOwnProperty(B)&&p!==void 0&&!i.hasOwnProperty(B)&&zm(t,e,B,void 0,i,p);for(y in i)p=i[y],_=n[y],!i.hasOwnProperty(y)||p===_||p===void 0&&_===void 0||zm(t,e,y,p,i,_);return}}for(var M in n)p=n[M],n.hasOwnProperty(M)&&p!=null&&!i.hasOwnProperty(M)&&ct(t,e,M,null,i,p);for(A in i)p=i[A],_=n[A],!i.hasOwnProperty(A)||p===_||p==null&&_==null||ct(t,e,A,p,i,_);}function S0(t){switch(t){case "css":case "script":case "font":case "img":case "image":case "input":case "link":return true;default:return false}}function hC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],a=r.transferSize,o=r.initiatorType,u=r.duration;if(a&&u&&S0(o)){for(o=0,u=r.responseEnd,i+=1;i<n.length;i++){var d=n[i],g=d.startTime;if(g>u)break;var y=d.transferSize,A=d.initiatorType;y&&S0(A)&&(d=d.responseEnd,o+=y*(d<u?1:(u-g)/(d-g)));}if(--i,e+=8*(a+o)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var jm=null,Ym=null;function Jc(t){return t.nodeType===9?t:t.ownerDocument}function E0(t){switch(t){case "http://www.w3.org/2000/svg":return 1;case "http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function d_(t,e){if(t===0)switch(e){case "svg":return 1;case "math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function qm(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var nm=null;function mC(){var t=window.event;return t&&t.type==="popstate"?t===nm?false:(nm=t,true):(nm=null,false)}var h_=typeof setTimeout=="function"?setTimeout:void 0,pC=typeof clearTimeout=="function"?clearTimeout:void 0,w0=typeof Promise=="function"?Promise:void 0,gC=typeof queueMicrotask=="function"?queueMicrotask:typeof w0<"u"?function(t){return w0.resolve(null).then(t).catch(vC)}:h_;function vC(t){setTimeout(function(){throw t});}function sa(t){return t==="head"}function M0(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),$s(e);return}i--;}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")dl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,dl(n);for(var a=n.firstChild;a;){var o=a.nextSibling,u=a.nodeName;a[Ol]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=o;}}else n==="body"&&dl(t.ownerDocument.body);n=r;}while(n);$s(e);}function T0(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--;}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i;}while(n)}function Wm(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case "HTML":case "HEAD":case "BODY":Wm(n),rp(n);continue;case "SCRIPT":case "STYLE":continue;case "LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n);}}function AC(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Ol])switch(e){case "meta":if(!t.hasAttribute("itemprop"))break;return t;case "link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case "style":if(t.hasAttribute("data-precedence"))break;return t;case "script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=mi(t.nextSibling),t===null)break}return null}function yC(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=mi(t.nextSibling),t===null))return null;return t}function m_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=mi(t.nextSibling),t===null))return null;return t}function Qm(t){return t.data==="$?"||t.data==="$~"}function Xm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function bC(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else {var i=function(){e(),n.removeEventListener("DOMContentLoaded",i);};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i;}}function mi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Km=null;function C0(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return mi(t.nextSibling);e--;}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++;}t=t.nextSibling;}return null}function R0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--;}else n!=="/$"&&n!=="/&"||e++;}t=t.previousSibling;}return null}function p_(t,e,n){switch(e=Jc(n),t){case "html":if(t=e.documentElement,!t)throw Error(Y(452));return t;case "head":if(t=e.head,!t)throw Error(Y(453));return t;case "body":if(t=e.body,!t)throw Error(Y(454));return t;default:throw Error(Y(451))}}function dl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);rp(t);}var pi=new Map,k0=new Set;function $c(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=it.d;it.d={f:_C,r:SC,D:EC,C:wC,L:MC,m:TC,X:RC,S:CC,M:kC};function _C(){var t=Ar.f(),e=vf();return t||e}function SC(t){var e=to(t);e!==null&&e.tag===5&&e.type==="form"?lb(e):Ar.r(t);}var ao=typeof document>"u"?null:document;function g_(t,e,n){var i=ao;if(i&&typeof e=="string"&&e){var r=ci(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),k0.has(r)||(k0.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),vn(e,"link",t),cn(e),i.head.appendChild(e)));}}function EC(t){Ar.D(t),g_("dns-prefetch",t,null);}function wC(t,e){Ar.C(t,e),g_("preconnect",t,e);}function MC(t,e,n){Ar.L(t,e,n);var i=ao;if(i&&t&&e){var r='link[rel="preload"][as="'+ci(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ci(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+ci(n.imageSizes)+'"]')):r+='[href="'+ci(t)+'"]';var a=r;switch(e){case "style":a=Js(t);break;case "script":a=so(t);}pi.has(a)||(t=St({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),pi.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Bl(a))||e==="script"&&i.querySelector(Ul(a))||(e=i.createElement("link"),vn(e,"link",t),cn(e),i.head.appendChild(e)));}}function TC(t,e){Ar.m(t,e);var n=ao;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+ci(i)+'"][href="'+ci(t)+'"]',a=r;switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":a=so(t);}if(!pi.has(a)&&(t=St({rel:"modulepreload",href:t},e),pi.set(a,t),n.querySelector(r)===null)){switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":if(n.querySelector(Ul(a)))return}i=n.createElement("link"),vn(i,"link",t),cn(i),n.head.appendChild(i);}}}function CC(t,e,n){Ar.S(t,e,n);var i=ao;if(i&&t){var r=Ps(i).hoistableStyles,a=Js(t);e=e||"default";var o=r.get(a);if(!o){var u={loading:0,preload:null};if(o=i.querySelector(Bl(a)))u.loading=5;else {t=St({rel:"stylesheet",href:t,"data-precedence":e},n),(n=pi.get(a))&&zp(t,n);var d=o=i.createElement("link");cn(d),vn(d,"link",t),d._p=new Promise(function(g,y){d.onload=g,d.onerror=y;}),d.addEventListener("load",function(){u.loading|=1;}),d.addEventListener("error",function(){u.loading|=2;}),u.loading|=4,Mc(o,e,i);}o={type:"stylesheet",instance:o,count:1,state:u},r.set(a,o);}}}function RC(t,e){Ar.X(t,e);var n=ao;if(n&&t){var i=Ps(n).hoistableScripts,r=so(t),a=i.get(r);a||(a=n.querySelector(Ul(r)),a||(t=St({src:t,async:true},e),(e=pi.get(r))&&jp(t,e),a=n.createElement("script"),cn(a),vn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function kC(t,e){Ar.M(t,e);var n=ao;if(n&&t){var i=Ps(n).hoistableScripts,r=so(t),a=i.get(r);a||(a=n.querySelector(Ul(r)),a||(t=St({src:t,async:true,type:"module"},e),(e=pi.get(r))&&jp(t,e),a=n.createElement("script"),cn(a),vn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function x0(t,e,n,i){var r=(r=qr.current)?$c(r):null;if(!r)throw Error(Y(446));switch(t){case "meta":case "title":return null;case "style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Js(n.href),n=Ps(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case "link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Js(n.href);var a=Ps(r).hoistableStyles,o=a.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,o),(a=r.querySelector(Bl(t)))&&!a._p&&(o.instance=a,o.state.loading=5),pi.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pi.set(t,n),a||xC(r,t,n,o.state))),e&&i===null)throw Error(Y(528,""));return o}if(e&&i!==null)throw Error(Y(529,""));return null;case "script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=so(n),n=Ps(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Y(444,t))}}function Js(t){return 'href="'+ci(t)+'"'}function Bl(t){return 'link[rel="stylesheet"]['+t+"]"}function v_(t){return St({},t,{"data-precedence":t.precedence,precedence:null})}function xC(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),vn(e,"link",n),cn(e),t.head.appendChild(e));}function so(t){return '[src="'+ci(t)+'"]'}function Ul(t){return "script[async]"+t}function O0(t,e,n){if(e.count++,e.instance===null)switch(e.type){case "style":var i=t.querySelector('style[data-href~="'+ci(n.href)+'"]');if(i)return e.instance=i,cn(i),i;var r=St({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),cn(i),vn(i,"style",r),Mc(i,n.precedence,t),e.instance=i;case "stylesheet":r=Js(n.href);var a=t.querySelector(Bl(r));if(a)return e.state.loading|=4,e.instance=a,cn(a),a;i=v_(n),(r=pi.get(r))&&zp(i,r),a=(t.ownerDocument||t).createElement("link"),cn(a);var o=a;return o._p=new Promise(function(u,d){o.onload=u,o.onerror=d;}),vn(a,"link",i),e.state.loading|=4,Mc(a,n.precedence,t),e.instance=a;case "script":return a=so(n.src),(r=t.querySelector(Ul(a)))?(e.instance=r,cn(r),r):(i=n,(r=pi.get(a))&&(i=St({},n),jp(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),cn(r),vn(r,"link",i),t.head.appendChild(r),e.instance=r);case "void":return null;default:throw Error(Y(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Mc(i,n.precedence,t));return e.instance}function Mc(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var u=i[o];if(u.dataset.precedence===e)a=u;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild));}function zp(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title);}function jp(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity);}var Tc=null;function I0(t,e,n){if(Tc===null){var i=new Map,r=Tc=new Map;r.set(n,i);}else r=Tc,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[Ol]||a[mn]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(e)||"";o=t+o;var u=i.get(o);u?u.push(a):i.set(o,[a]);}}return i}function N0(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null);}function OC(t,e,n){if(n===1||e.itemProp!=null)return false;switch(t){case "meta":case "title":return true;case "style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return true;case "link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):true;case "script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return true}return false}function A_(t){return !(t.type==="stylesheet"&&(t.state.loading&3)===0)}function IC(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==false)&&(n.state.loading&4)===0){if(n.instance===null){var r=Js(i.href),a=e.querySelector(Bl(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ef.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=a,cn(a);return}a=e.ownerDocument||e,i=v_(i),(r=pi.get(r))&&zp(i,r),a=a.createElement("link"),cn(a);var o=a;o._p=new Promise(function(u,d){o.onload=u,o.onerror=d;}),vn(a,"link",i),n.instance=a;}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=ef.bind(t),e.addEventListener("load",n),e.addEventListener("error",n));}}var im=0;function NC(t,e){return t.stylesheets&&t.count===0&&Cc(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a();}},6e4+e);0<t.imgBytes&&im===0&&(im=62500*hC());var r=setTimeout(function(){if(t.waitingForImages=false,t.count===0&&(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend)){var a=t.unsuspend;t.unsuspend=null,a();}},(t.imgBytes>im?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r);}}:null}function ef(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t();}}}var tf=null;function Cc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tf=new Map,e.forEach(DC,t),tf=null,ef.call(t));}function DC(t,e){if(!(e.state.loading&4)){var n=tf.get(t);if(n)var i=n.get(null);else {n=new Map,tf.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o);}i&&n.set(null,i);}r=e.instance,o=r.getAttribute("data-precedence"),a=n.get(o)||i,a===i&&n.set(null,r),n.set(o,r),this.count++,i=ef.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4;}}var wl={$$typeof:or,Provider:null,Consumer:null,_currentValue:xa,_currentValue2:xa,_threadCount:0};function LC(t,e,n,i,r,a,o,u,d){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kh(0),this.hiddenUpdates=kh(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=d,this.incompleteTransitions=new Map;}function y_(t,e,n,i,r,a,o,u,d,g,y,A){return t=new LC(t,e,n,o,d,g,y,A,u),e=1,a===true&&(e|=24),a=Yn(3,null,null,e),t.current=a,a.stateNode=t,e=gp(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},yp(a),t}function b_(t){return t?(t=Is,t):Is}function __(t,e,n,i,r,a){r=b_(r),i.context===null?i.context=r:i.pendingContext=r,i=Qr(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=Xr(t,i,e),n!==null&&(Ln(n,t,e),rl(n,t,e));}function D0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e;}}function Yp(t,e){D0(t,e),(t=t.alternate)&&D0(t,e);}function S_(t){if(t.tag===13||t.tag===31){var e=za(t,67108864);e!==null&&Ln(e,t,67108864),Yp(t,67108864);}}function L0(t){if(t.tag===13||t.tag===31){var e=Kn();e=np(e);var n=za(t,e);n!==null&&Ln(n,t,e),Yp(t,e);}}var nf=true;function PC(t,e,n,i){var r=Te.T;Te.T=null;var a=it.p;try{it.p=2,qp(t,e,n,i);}finally{it.p=a,Te.T=r;}}function BC(t,e,n,i){var r=Te.T;Te.T=null;var a=it.p;try{it.p=8,qp(t,e,n,i);}finally{it.p=a,Te.T=r;}}function qp(t,e,n,i){if(nf){var r=Zm(i);if(r===null)tm(t,e,i,rf,n),P0(t,i);else if(FC(r,t,e,n,i))i.stopPropagation();else if(P0(t,i),e&4&&-1<UC.indexOf(t)){for(;r!==null;){var a=to(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ca(a.pendingLanes);if(o!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var d=1<<31-Xn(o);u.entanglements[1]|=d,o&=~d;}Bi(a),(nt&6)===0&&(qc=Wn()+500,Pl(0));}}break;case 31:case 13:u=za(a,2),u!==null&&Ln(u,a,2),vf(),Yp(a,2);}if(a=Zm(i),a===null&&tm(t,e,i,rf,n),a===r)break;r=a;}r!==null&&i.stopPropagation();}else tm(t,e,i,null,n);}}function Zm(t){return t=sp(t),Wp(t)}var rf=null;function Wp(t){if(rf=null,t=Ts(t),t!==null){var e=Cl(t);if(e===null)t=null;else {var n=e.tag;if(n===13){if(t=G0(e),t!==null)return t;t=null;}else if(n===31){if(t=z0(e),t!==null)return t;t=null;}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null;}else e!==t&&(t=null);}}return rf=t,null}function E_(t){switch(t){case "beforetoggle":case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "toggle":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 2;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 8;case "message":switch(MM()){case W0:return 2;case Q0:return 8;case Ic:case TM:return 32;case X0:return 268435456;default:return 32}default:return 32}}var Jm=false,Jr=null,$r=null,ea=null,Ml=new Map,Tl=new Map,Vr=[],UC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function P0(t,e){switch(t){case "focusin":case "focusout":Jr=null;break;case "dragenter":case "dragleave":$r=null;break;case "mouseover":case "mouseout":ea=null;break;case "pointerover":case "pointerout":Ml.delete(e.pointerId);break;case "gotpointercapture":case "lostpointercapture":Tl.delete(e.pointerId);}}function Wo(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=to(e),e!==null&&S_(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function FC(t,e,n,i,r){switch(e){case "focusin":return Jr=Wo(Jr,t,e,n,i,r),true;case "dragenter":return $r=Wo($r,t,e,n,i,r),true;case "mouseover":return ea=Wo(ea,t,e,n,i,r),true;case "pointerover":var a=r.pointerId;return Ml.set(a,Wo(Ml.get(a)||null,t,e,n,i,r)),true;case "gotpointercapture":return a=r.pointerId,Tl.set(a,Wo(Tl.get(a)||null,t,e,n,i,r)),true}return false}function w_(t){var e=Ts(t.target);if(e!==null){var n=Cl(e);if(n!==null){if(e=n.tag,e===13){if(e=G0(n),e!==null){t.blockedOn=e,yA(t.priority,function(){L0(n);});return}}else if(e===31){if(e=z0(n),e!==null){t.blockedOn=e,yA(t.priority,function(){L0(n);});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null;}function Rc(t){if(t.blockedOn!==null)return false;for(var e=t.targetContainers;0<e.length;){var n=Zm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);gm=i,n.target.dispatchEvent(i),gm=null;}else return e=to(n),e!==null&&S_(e),t.blockedOn=n,false;e.shift();}return true}function B0(t,e,n){Rc(t)&&n.delete(e);}function VC(){Jm=false,Jr!==null&&Rc(Jr)&&(Jr=null),$r!==null&&Rc($r)&&($r=null),ea!==null&&Rc(ea)&&(ea=null),Ml.forEach(B0),Tl.forEach(B0);}function dc(t,e){t.blockedOn===e&&(t.blockedOn=null,Jm||(Jm=true,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,VC)));}var hc=null;function U0(t){hc!==t&&(hc=t,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,function(){hc===t&&(hc=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(Wp(i||n)===null)continue;break}var a=to(n);a!==null&&(t.splice(e,3),e-=3,Im(a,{pending:true,data:r,method:n.method,action:i},i,r));}}));}function $s(t){function e(d){return dc(d,t)}Jr!==null&&dc(Jr,t),$r!==null&&dc($r,t),ea!==null&&dc(ea,t),Ml.forEach(e),Tl.forEach(e);for(var n=0;n<Vr.length;n++){var i=Vr[n];i.blockedOn===t&&(i.blockedOn=null);}for(;0<Vr.length&&(n=Vr[0],n.blockedOn===null);)w_(n),n.blockedOn===null&&Vr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],o=r[Pn]||null;if(typeof a=="function")o||U0(n);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Pn]||null)u=o.formAction;else if(Wp(r)!==null)continue}else u=o.action;typeof u=="function"?n[i+1]=u:(n.splice(i,3),i-=3),U0(n);}}}function M_(){function t(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"});}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20);}function n(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"});}}if(typeof navigation=="object"){var i=false,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=true,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null);}}}function Qp(t){this._internalRoot=t;}bf.prototype.render=Qp.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Y(409));var n=e.current,i=Kn();__(n,i,t,e,null,null);};bf.prototype.unmount=Qp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;__(t.current,2,null,t,null,null),vf(),e[eo]=null;}};function bf(t){this._internalRoot=t;}bf.prototype.unstable_scheduleHydration=function(t){if(t){var e=ey();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Vr.length&&e!==0&&e<Vr[n].priority;n++);Vr.splice(n,0,t),n===0&&w_(t);}};var F0=V0.version;if(F0!=="19.2.6")throw Error(Y(527,F0,"19.2.6"));it.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Y(188)):(t=Object.keys(t).join(","),Error(Y(268,t)));return t=AM(e),t=t!==null?j0(t):null,t=t===null?null:t.stateNode,t};var HC={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qo=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qo.isDisabled&&Qo.supportsFiber))try{Rl=Qo.inject(HC),Qn=Qo;}catch{}var Qo;_f.createRoot=function(t,e){if(!H0(t))throw Error(Y(299));var n=false,i="",r=gb,a=vb,o=Ab;return e!=null&&(e.unstable_strictMode===true&&(n=true),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=y_(t,1,false,null,null,n,i,null,r,a,o,M_),t[eo]=e.current,Gp(t),new Qp(e)};_f.hydrateRoot=function(t,e,n){if(!H0(t))throw Error(Y(299));var i=false,r="",a=gb,o=vb,u=Ab,d=null;return n!=null&&(n.unstable_strictMode===true&&(i=true),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(d=n.formState)),e=y_(t,1,true,e,n??null,i,r,d,a,o,u,M_),e.context=b_(null),n=e.current,i=Kn(),i=np(i),r=Qr(i),r.callback=null,Xr(n,r,i),n=i,e.current.lanes=n,xl(e,n),Bi(e),t[eo]=e.current,Gp(t),new bf(e)};_f.version="19.2.6";});var k_=ri((dN,R_)=>{function C_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C_);}catch(t){console.error(t);}}C_(),R_.exports=T_();});var A1={};Fv(A1,{VAD_WORKER_SOURCE:()=>ak});var ak,y1=Uv(()=>{ak='"use strict";(()=>{var Ft=Object.defineProperty;var Et=(t,s)=>()=>(t&&(s=t(t=0)),s);var gt=(t,s)=>{for(var n in s)Ft(t,n,{get:s[n],enumerable:!0})};var St={};gt(St,{cmvn:()=>Yt,graph:()=>$t});var $t,Yt,Tt=Et(()=>{"use strict";$t={inputs:["feat","caches_in"],outputs:["probs","caches_out"],cache_shape:[8,1,128,19],nodes:[{op:"Gather",inputs:["caches_in","/Constant_output_0"],outputs:["/Gather_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_1_output_0"],outputs:["/Gather_1_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_2_output_0"],outputs:["/Gather_2_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_3_output_0"],outputs:["/Gather_3_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_4_output_0"],outputs:["/Gather_4_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_5_output_0"],outputs:["/Gather_5_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_6_output_0"],outputs:["/Gather_6_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_7_output_0"],outputs:["/Gather_7_output_0"],attrs:{axis:0}},{op:"MatMul",inputs:["feat","onnx::MatMul_403"],outputs:["/model/dfsmn/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc1.0.bias","/model/dfsmn/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0","onnx::MatMul_404"],outputs:["/model/dfsmn/fc2/fc2.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc2.0.bias","/model/dfsmn/fc2/fc2.0/MatMul_output_0"],outputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],outputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_output_0","/model/dfsmn/fsmn1/Transpose_output_0"],outputs:["/model/dfsmn/fsmn1/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmn1/Concat_output_0","model.dfsmn.fsmn1.lookback_filter.weight"],outputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmn1/Transpose_output_0","/model/dfsmn/fsmn1/Slice_2_output_0"],outputs:["/model/dfsmn/fsmn1/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmn1/Add_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"MatMul",inputs:["/model/dfsmn/fsmn1/Transpose_1_output_0","onnx::MatMul_417"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.0.fc1.0.bias","/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0","onnx::MatMul_418"],outputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_1_output_0","/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","model.dfsmn.fsmns.0.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0","/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0","/model/dfsmn/fsmn1/Transpose_1_output_0"],outputs:["/model/dfsmn/fsmns.0/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/Add_output_0","onnx::MatMul_431"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.1.fc1.0.bias","/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0","onnx::MatMul_432"],outputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_2_output_0","/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","model.dfsmn.fsmns.1.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0","/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/Add_output_0","onnx::MatMul_445"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.2.fc1.0.bias","/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0","onnx::MatMul_446"],outputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_3_output_0","/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","model.dfsmn.fsmns.2.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0","/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.1/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/Add_output_0","onnx::MatMul_459"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.3.fc1.0.bias","/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0","onnx::MatMul_460"],outputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_4_output_0","/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","model.dfsmn.fsmns.3.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0","/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.2/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/Add_output_0","onnx::MatMul_473"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.4.fc1.0.bias","/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0","onnx::MatMul_474"],outputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_5_output_0","/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","model.dfsmn.fsmns.4.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0","/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.3/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/Add_output_0","onnx::MatMul_487"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.5.fc1.0.bias","/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0","onnx::MatMul_488"],outputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_6_output_0","/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","model.dfsmn.fsmns.5.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0","/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.4/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/Add_output_0","onnx::MatMul_501"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.6.fc1.0.bias","/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0","onnx::MatMul_502"],outputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_7_output_0","/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","model.dfsmn.fsmns.6.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0","/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.5/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/Add_output_0","onnx::MatMul_515"],outputs:["/model/dfsmn/dnns/dnns.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.dnns.0.bias","/model/dfsmn/dnns/dnns.0/MatMul_output_0"],outputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],outputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0","onnx::MatMul_516"],outputs:["/model/out/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.out.bias","/model/out/MatMul_output_0"],outputs:["/model/out/Add_output_0"],attrs:{}},{op:"Sigmoid",inputs:["/model/out/Add_output_0"],outputs:["probs"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmn1/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_1_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_2_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_3_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_4_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_5_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_6_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_7_output_0"],attrs:{}},{op:"Concat",inputs:["/Unsqueeze_output_0","/Unsqueeze_1_output_0","/Unsqueeze_2_output_0","/Unsqueeze_3_output_0","/Unsqueeze_4_output_0","/Unsqueeze_5_output_0","/Unsqueeze_6_output_0","/Unsqueeze_7_output_0"],outputs:["caches_out"],attrs:{axis:0}}],weights:{"model.dfsmn.fc1.0.bias":{dtype:"fp32",shape:[256],off:0},"model.dfsmn.fc2.0.bias":{dtype:"fp32",shape:[128],off:1024},"model.dfsmn.fsmn1.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:1536,scale_off:4096,scale_shape:[1,1,20]},"model.dfsmn.fsmns.0.fc1.0.bias":{dtype:"fp32",shape:[256],off:4176},"model.dfsmn.fsmns.0.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:5200,scale_off:7760,scale_shape:[1,1,20]},"model.dfsmn.fsmns.1.fc1.0.bias":{dtype:"fp32",shape:[256],off:7840},"model.dfsmn.fsmns.1.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:8864,scale_off:11424,scale_shape:[1,1,20]},"model.dfsmn.fsmns.2.fc1.0.bias":{dtype:"fp32",shape:[256],off:11504},"model.dfsmn.fsmns.2.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:12528,scale_off:15088,scale_shape:[1,1,20]},"model.dfsmn.fsmns.3.fc1.0.bias":{dtype:"fp32",shape:[256],off:15168},"model.dfsmn.fsmns.3.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:16192,scale_off:18752,scale_shape:[1,1,20]},"model.dfsmn.fsmns.4.fc1.0.bias":{dtype:"fp32",shape:[256],off:18832},"model.dfsmn.fsmns.4.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:19856,scale_off:22416,scale_shape:[1,1,20]},"model.dfsmn.fsmns.5.fc1.0.bias":{dtype:"fp32",shape:[256],off:22496},"model.dfsmn.fsmns.5.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:23520,scale_off:26080,scale_shape:[1,1,20]},"model.dfsmn.fsmns.6.fc1.0.bias":{dtype:"fp32",shape:[256],off:26160},"model.dfsmn.fsmns.6.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:27184,scale_off:29744,scale_shape:[1,1,20]},"model.dfsmn.dnns.0.bias":{dtype:"fp32",shape:[256],off:29824},"model.out.bias":{dtype:"fp32",shape:[1],off:30848},"onnx::MatMul_403":{dtype:"int8_pc",shape:[80,256],off:30852,scale_off:51332,scale_shape:[1,256]},"onnx::MatMul_404":{dtype:"int8_pc",shape:[256,128],off:52356,scale_off:85124,scale_shape:[1,128]},"onnx::MatMul_417":{dtype:"int8_pc",shape:[128,256],off:85636,scale_off:118404,scale_shape:[1,256]},"onnx::MatMul_418":{dtype:"int8_pc",shape:[256,128],off:119428,scale_off:152196,scale_shape:[1,128]},"onnx::MatMul_431":{dtype:"int8_pc",shape:[128,256],off:152708,scale_off:185476,scale_shape:[1,256]},"onnx::MatMul_432":{dtype:"int8_pc",shape:[256,128],off:186500,scale_off:219268,scale_shape:[1,128]},"onnx::MatMul_445":{dtype:"int8_pc",shape:[128,256],off:219780,scale_off:252548,scale_shape:[1,256]},"onnx::MatMul_446":{dtype:"int8_pc",shape:[256,128],off:253572,scale_off:286340,scale_shape:[1,128]},"onnx::MatMul_459":{dtype:"int8_pc",shape:[128,256],off:286852,scale_off:319620,scale_shape:[1,256]},"onnx::MatMul_460":{dtype:"int8_pc",shape:[256,128],off:320644,scale_off:353412,scale_shape:[1,128]},"onnx::MatMul_473":{dtype:"int8_pc",shape:[128,256],off:353924,scale_off:386692,scale_shape:[1,256]},"onnx::MatMul_474":{dtype:"int8_pc",shape:[256,128],off:387716,scale_off:420484,scale_shape:[1,128]},"onnx::MatMul_487":{dtype:"int8_pc",shape:[128,256],off:420996,scale_off:453764,scale_shape:[1,256]},"onnx::MatMul_488":{dtype:"int8_pc",shape:[256,128],off:454788,scale_off:487556,scale_shape:[1,128]},"onnx::MatMul_501":{dtype:"int8_pc",shape:[128,256],off:488068,scale_off:520836,scale_shape:[1,256]},"onnx::MatMul_502":{dtype:"int8_pc",shape:[256,128],off:521860,scale_off:554628,scale_shape:[1,128]},"onnx::MatMul_515":{dtype:"int8_pc",shape:[128,256],off:555140,scale_off:587908,scale_shape:[1,256]},"onnx::MatMul_516":{dtype:"fp32",shape:[256,1],off:588932},"/Constant_output_0":{dtype:"int32",shape:[],off:589956},"/Constant_1_output_0":{dtype:"int32",shape:[],off:589960},"/Constant_2_output_0":{dtype:"int32",shape:[],off:589964},"/Constant_3_output_0":{dtype:"int32",shape:[],off:589968},"/Constant_4_output_0":{dtype:"int32",shape:[],off:589972},"/Constant_5_output_0":{dtype:"int32",shape:[],off:589976},"/Constant_6_output_0":{dtype:"int32",shape:[],off:589980},"/Constant_7_output_0":{dtype:"int32",shape:[],off:589984},"/model/dfsmn/fsmn1/Constant_output_0":{dtype:"int32",shape:[1],off:589988},"/model/dfsmn/fsmn1/Constant_1_output_0":{dtype:"int32",shape:[1],off:589992},"/model/dfsmn/fsmn1/Constant_2_output_0":{dtype:"int32",shape:[1],off:589996},"/model/dfsmn/fsmn1/Constant_3_output_0":{dtype:"int32",shape:[1],off:59e4},"/model/dfsmn/fsmn1/Constant_5_output_0":{dtype:"int32",shape:[1],off:590004},"/model/dfsmn/fsmn1/Constant_9_output_0":{dtype:"int32",shape:[1],off:590008}}},Yt={means:[10.42295174919564,10.862097411631494,11.764544378124809,12.490164701573908,13.25983008289003,13.89594383242307,14.364940238918987,14.593948347480778,14.749723601612253,14.668315348346496,14.730796723156509,14.775052459167833,14.9890519821556,15.178004932637085,15.253520314586988,15.328637048782031,15.334018588850057,15.288641702136166,15.4276616890477,15.246266155846598,15.092573799088989,15.290421940704482,15.07575008669762,15.186772872540853,15.088673242416798,15.170797396442111,15.070178088017926,15.150795340269006,15.108532832116397,15.115345080167454,15.141279987705998,15.131832359605129,15.145195868641611,15.19151892676777,15.235478667211774,15.306369752614641,15.373021476906201,15.416394625766584,15.459857436373436,15.39143273165164,15.46357624247469,15.399661212735632,15.462907917820873,15.441629120393843,15.484969525295984,15.552401775001249,15.638091925650645,15.705489346158819,15.767008852632651,15.855123781367105,15.867269782501769,15.891537408746947,15.9231448295521,15.978382613315533,16.014801667676718,16.048674939996204,16.082029914992358,16.09680075379873,16.093736693349236,16.07247919506059,16.075509664672943,16.02227087563821,15.976762101902347,15.89786454765505,15.812741644368487,15.711205109067762,15.604198886052728,15.553519438005933,15.51025275187747,15.460023817226517,15.4156843628003,15.37602764551613,15.328348980305998,15.295370796331634,15.185470194591382,15.017044975516262,14.905080029850632,14.623806569017782,14.138093813776406,13.313870348004635],inv_std:[.2494980879825924,.23563235243542163,.23145152525802104,.2332233926481505,.23182660283718737,.22853356937894798,.2243486976577694,.21898920450844725,.21832438092730974,.22082592767700662,.2229673556813116,.22288416257259386,.22234810686081127,.22100642502031184,.21994202276343874,.22005444019015313,.22070092118977014,.22150809748461409,.22236667273698002,.22305291750035372,.22335341587062665,.22438905727453648,.22547701626910854,.2269007560258811,.22823023223045188,.22931472070164832,.23046728075908798,.23083553439603108,.23143382733873202,.2322065940520882,.2325798897870885,.2336197007969686,.23437240620327746,.23508252486137127,.23578078965798868,.235892002292441,.2360209777141303,.23663799549538955,.2374987640063862,.2379845180109627,.23899377757763487,.239748152899516,.24030835895648858,.2409769361661754,.24143248909906587,.24135465696291541,.24079937967447773,.24047405396120294,.23995525139180407,.23952287673801784,.2394808893818449,.2393650908183211,.23929339134427347,.23902199338028696,.23857873289710127,.23814701563685442,.23804621120577427,.23824193788738984,.2386009552212688,.23915406501238878,.23922540730102645,.2393830803524144,.2397336021407156,.2396056154523928,.24028502694537057,.2406181323375118,.2406792985927079,.24096201908324874,.24043605546026958,.24021526735270676,.23972514279402155,.23871998076352863,.2374413126648784,.23619509194955604,.23337281484306663,.2268023271445609,.2257750261856693,.22503847248255957,.2263113742246566,.2289949344716713]}});var J=11920929e-14,Y=t=>1127*Math.log(1+t/700),kt=(()=>{let t=new Float64Array(400),s=2*Math.PI/399;for(let n=0;n<400;n++)t[n]=Math.pow(.5-.5*Math.cos(s*n),.85);return t})(),vt=(()=>{let s=Y(20),o=(Y(8e3)-s)/81,u=[];for(let a=0;a<80;a++){let e=s+a*o,f=s+(a+1)*o,p=s+(a+2)*o,m=new Float64Array(256),_=-1,d=-1;for(let r=0;r<256;r++){let l=Y(31.25*r);l>e&&l<p&&(m[r]=l<=f?(l-e)/(f-e):(p-l)/(p-f),_===-1&&(_=r),d=r)}u.push({offset:_,weights:m.slice(_,d+1)})}return u})(),Rt=(()=>{let t=new Uint16Array(512),s=Math.log2(512);for(let n=0;n<512;n++){let o=n,u=0;for(let a=0;a<s;a++)u=u<<1|o&1,o>>=1;t[n]=u}return t})(),st=new Float64Array(512/2),nt=new Float64Array(512/2);for(let t=0;t<512/2;t++)st[t]=Math.cos(-2*Math.PI*t/512),nt[t]=Math.sin(-2*Math.PI*t/512);function Nt(t,s,n){for(let o=0;o<512;o++){let u=Rt[o];if(u>o){let a=t[o];t[o]=t[u],t[u]=a;let e=s[o];s[o]=s[u],s[u]=e}}for(let o=2;o<=512;o<<=1){let u=o>>1,a=512/o;for(let e=0;e<512;e+=o)for(let f=0;f<u;f++){let p=st[f*a],m=nt[f*a],_=e+f,d=_+u,r=t[d]*p-s[d]*m,l=t[d]*m+s[d]*p;t[d]=t[_]-r,s[d]=s[_]-l,t[_]+=r,s[_]+=l}}for(let o=0;o<=256;o++)n[o]=t[o]*t[o]+s[o]*s[o]}var E=new Float64Array(512),K=new Float64Array(512),tt=new Float64Array(257);function It(t,s,n,o){for(let e=0;e<400;e++)E[e]=t[s+e];let u=0;for(let e=0;e<400;e++)u+=E[e];let a=u/400;for(let e=0;e<400;e++)E[e]-=a;for(let e=399;e>0;e--)E[e]-=.97*E[e-1];E[0]-=.97*E[0];for(let e=0;e<400;e++)E[e]*=kt[e];for(let e=400;e<512;e++)E[e]=0;K.fill(0),Nt(E,K,tt);for(let e=0;e<80;e++){let{offset:f,weights:p}=vt[e],m=0;for(let _=0;_<p.length;_++)m+=p[_]*tt[f+_];m<J&&(m=J),n[o+e]=Math.log(m)}}function ot(t){let s=new Float64Array(t.length);for(let n=0;n<t.length;n++){let o=t[n];o>1?o=1:o<-1&&(o=-1),s[n]=Math.trunc(Math.fround(o*32767))}return s}function Dt(t,s,n){let{means:o,inv_std:u}=n;for(let a=0;a<s;a++){let e=a*80;for(let f=0;f<80;f++)t[e+f]=(t[e+f]-o[f])*u[f]}}var O=class{constructor(s){this.buffer=[];this.bufferStart=0;this.nextFrame=0;this.cmvn=s}reset(){this.buffer=[],this.bufferStart=0,this.nextFrame=0}push(s){for(let f=0;f<s.length;f++)this.buffer.push(s[f]);let n=this.bufferStart+this.buffer.length,o=[],u=0;for(;this.nextFrame*160+400<=n;){let f=this.nextFrame*160-this.bufferStart,p=new Float32Array(80);It(this.buffer,f,p,0),Dt(p,1,this.cmvn);for(let m=0;m<80;m++)o.push(p[m]);this.nextFrame++,u++}let a=this.nextFrame*160,e=a-this.bufferStart;return e>0&&(this.buffer=this.buffer.slice(e),this.bufferStart=a),{feats:new Float32Array(o),n:u}}};var b=class{constructor(s,n){this.shape=s;this.data=n}get rank(){return this.shape.length}get isInt(){return this.data instanceof Int32Array}};function w(t){let s=1;for(let n of t)s*=n;return s}function S(t){let s=new Array(t.length),n=1;for(let o=t.length-1;o>=0;o--)s[o]=n,n*=t[o];return s}function ut(t){return new b(t.slice(),new Float32Array(w(t)))}function ft(t,s){let n=Math.max(t.length,s.length),o=new Array(n);for(let u=0;u<n;u++){let a=t[t.length-1-u]??1,e=s[s.length-1-u]??1;if(a!==e&&a!==1&&e!==1)throw new Error(`broadcast mismatch ${t} vs ${s}`);o[n-1-u]=Math.max(a,e)}return o}function mt(t,s,n){let o=ft(t.shape,s.shape),u=w(o),a=new Float32Array(u),e=o.length,f=S(t.shape),p=S(s.shape),m=new Int32Array(e),_=new Int32Array(e);for(let c=0;c<e;c++){let M=c-(e-t.rank),y=c-(e-s.rank);m[c]=M>=0&&t.shape[M]!==1?f[M]:0,_[c]=y>=0&&s.shape[y]!==1?p[y]:0}let d=new Int32Array(e),r=t.data,l=s.data,A=0,h=0;for(let c=0;c<u;c++){a[c]=n(r[A],l[h]);for(let M=e-1;M>=0;M--){if(++d[M]<o[M]){A+=m[M],h+=_[M];break}d[M]=0,A-=m[M]*(o[M]-1),h-=_[M]*(o[M]-1)}}return new b(o,a)}function at(t,s){return mt(t,s,(n,o)=>n+o)}function pt(t,s){return mt(t,s,(n,o)=>n*o)}function _t(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=t.data[n]>0?t.data[n]:0;return new b(t.shape.slice(),s)}function dt(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=1/(1+Math.exp(-t.data[n]));return new b(t.shape.slice(),s)}function lt(t,s){let n=s??t.shape.map((r,l)=>t.rank-1-l),o=n.map(r=>t.shape[r]),u=t.data.length,a=new Float32Array(u),e=S(t.shape),f=o.length,p=new Int32Array(f);for(let r=0;r<f;r++)p[r]=e[n[r]];let m=new Int32Array(f),_=t.data,d=0;for(let r=0;r<u;r++){a[r]=_[d];for(let l=f-1;l>=0;l--){if(++m[l]<o[l]){d+=p[l];break}m[l]=0,d-=p[l]*(o[l]-1)}}return new b(o,a)}function rt(t,s){let n=t[0],o=n.rank,u=s<0?s+o:s,a=n.shape.slice();a[u]=t.reduce((m,_)=>m+_.shape[u],0);let e=new Float32Array(w(a)),f=S(a),p=0;for(let m of t){let _=S(m.shape),d=new Array(o).fill(0);for(let r=0;r<m.data.length;r++){let l=r;for(let h=0;h<o;h++)d[h]=Math.floor(l/_[h]),l-=d[h]*_[h];let A=0;for(let h=0;h<o;h++){let c=h===u?d[h]+p:d[h];A+=c*f[h]}e[A]=m.data[r]}p+=m.shape[u]}return new b(a,e)}function ct(t,s,n){let o=t.rank,u=n<0?n+o:n,a=S(t.shape),e=s.rank===0,f=e?[s.data[0]]:Array.from(s.data),p=e?[]:s.shape.slice(),m=[...t.shape.slice(0,u),...p,...t.shape.slice(u+1)],_=new Float32Array(w(m)),d=S(m),r=p.length;for(let l=0;l<_.length;l++){let A=l,h=new Array(m.length);for(let i=0;i<m.length;i++)h[i]=Math.floor(A/d[i]),A-=h[i]*d[i];let c=0;for(let i=0;i<u;i++)c+=h[i]*a[i];let M=0;for(let i=0;i<r;i++)M=M*p[i]+h[u+i];let y=f[e?0:M];y<0&&(y+=t.shape[u]),c+=y*a[u];for(let i=u+1;i<o;i++)c+=h[i-1+r]*a[i];_[l]=t.data[c]}return new b(m,_)}function it(t,s){let n=t.rank+s.length,o=s.map(e=>e<0?e+n:e).sort((e,f)=>e-f),u=t.shape.slice();for(let e of o)u.splice(e,0,1);let a=t.data instanceof Int32Array?Int32Array.from(t.data):Float32Array.from(t.data);return new b(u,a)}var Gt=2**31-1;function ht(t,s,n,o,u){let a=t.rank,e=o??s.map((c,M)=>M),f=u??s.map(()=>1),p=new Array(a).fill(0),m=t.shape.slice(),_=new Array(a).fill(1);for(let c=0;c<e.length;c++){let M=e[c]<0?e[c]+a:e[c],y=t.shape[M],i=s[c];i<0&&(i+=y),i=Math.max(0,Math.min(i,y));let T=n[c];T>=Gt?T=y:(T<0&&(T+=y),T=Math.max(0,Math.min(T,y))),p[M]=i,m[M]=T,_[M]=f[c]}let d=new Array(a);for(let c=0;c<a;c++)d[c]=Math.max(0,Math.ceil((m[c]-p[c])/_[c]));let r=S(t.shape),l=S(d),h=t.data instanceof Int32Array?new Int32Array(w(d)):new Float32Array(w(d));for(let c=0;c<h.length;c++){let M=c,y=0;for(let i=0;i<a;i++){let T=Math.floor(M/l[i]);M-=T*l[i],y+=(p[i]+T*_[i])*r[i]}h[c]=t.data[y]}return new b(d,h)}function Mt(t,s){let n=t,o=s,u=!1,a=!1;n.rank===1&&(n=new b([1,n.shape[0]],n.data),u=!0),o.rank===1&&(o=new b([o.shape[0],1],o.data),a=!0);let e=n.shape[n.rank-2],f=n.shape[n.rank-1],p=o.shape[o.rank-2],m=o.shape[o.rank-1];if(f!==p)throw new Error(`matmul inner dim ${f} vs ${p}`);let _=n.shape.slice(0,n.rank-2),d=o.shape.slice(0,o.rank-2),r=ft(_,d),l=w(r),A=[...r,e,m],h=new Float32Array(w(A)),c=e*f,M=p*m,y=e*m,i=S(r),T=S(_),B=S(d),D=new Array(r.length);for(let g=0;g<l;g++){let G=g;for(let C=0;C<r.length;C++)D[C]=Math.floor(G/i[C]),G-=D[C]*i[C];let L=0;for(let C=0;C<_.length;C++){let R=D[C+(r.length-_.length)];L+=(_[C]===1?0:R)*T[C]}let v=0;for(let C=0;C<d.length;C++){let R=D[C+(r.length-d.length)];v+=(d[C]===1?0:R)*B[C]}let U=L*c,$=v*M,P=g*y;for(let C=0;C<e;C++){let R=U+C*f;for(let H=0;H<m;H++){let N=0;for(let k=0;k<f;k++)N+=n.data[R+k]*o.data[$+k*m+H];h[P+C*m+H]=N}}}let x=new b(A,h);return u&&(x=et(x,x.rank-2)),a&&(x=et(x,x.rank-1)),x}function et(t,s){let n=t.shape.slice();return n.splice(s,1),new b(n,t.data)}function At(t,s,n,o,u,a,e){let[f,p,m]=t.shape,[_,d,r]=s.shape,l=u[0],A=a[0],h=e[0],c=m+l+u[1],M=Math.floor((c-(A*(r-1)+1))/h)+1,y=new Float32Array(f*_*M),i=S(t.shape),T=S(s.shape),B=_/o,D=p/o;for(let x=0;x<f;x++)for(let g=0;g<o;g++)for(let G=0;G<B;G++){let L=g*B+G;for(let v=0;v<M;v++){let U=0,$=v*h-l;for(let P=0;P<d;P++){let C=g*D+P,R=x*i[0]+C*i[1],H=L*T[0]+P*T[1];for(let N=0;N<r;N++){let k=$+N*A;k<0||k>=m||(U+=s.data[H+N]*t.data[R+k])}}n&&(U+=n.data[L]),y[x*_*M+L*M+v]=U}}return new b([f,_,M],y)}var Lt=80;function Pt(t,s){let n=w(t.shape);if(t.dtype==="int8_pc"){let u=new Float32Array(n);for(let f=0;f<n;f++)u[f]=s.getInt8(t.off+f);let a=w(t.scale_shape),e=new Float32Array(a);for(let f=0;f<a;f++)e[f]=s.getFloat32(t.scale_off+f*4,!0);return pt(new b(t.shape.slice(),u),new b(t.scale_shape.slice(),e))}if(t.dtype==="int32"){let u=new Int32Array(n);for(let a=0;a<n;a++)u[a]=s.getInt32(t.off+a*4,!0);return new b(t.shape.slice(),u)}let o=new Float32Array(n);for(let u=0;u<n;u++)o[u]=s.getFloat32(t.off+u*4,!0);return new b(t.shape.slice(),o)}var q=class{constructor(s,n){this.weights={};this.nodes=s.nodes,this.inputNames=s.inputs,this.outputNames=s.outputs,this.cacheShape=s.cache_shape;let o=new DataView(n.buffer,n.byteOffset,n.byteLength);for(let[u,a]of Object.entries(s.weights))this.weights[u]=Pt(a,o);this.reset()}reset(){this.cache=ut(this.cacheShape)}get cacheState(){return this.cache.data}step(s,n){let o={...this.weights};o[this.inputNames[0]]=new b([1,n,Lt],s),o[this.inputNames[1]]=this.cache;for(let f of this.nodes){let p=f.attrs,m=f.inputs.map(d=>d?o[d]:null),_;switch(f.op){case"MatMul":_=Mt(m[0],m[1]);break;case"Add":_=at(m[0],m[1]);break;case"Relu":_=_t(m[0]);break;case"Sigmoid":_=dt(m[0]);break;case"Transpose":_=lt(m[0],p.perm);break;case"Concat":_=rt(m.filter(d=>d!==null),p.axis);break;case"Gather":_=ct(m[0],m[1],p.axis??0);break;case"Unsqueeze":{let d=m.length>1&&m[1]!==null?Array.from(m[1].data):p.axes;_=it(m[0],d);break}case"Slice":{let d=Array.from(m[1].data),r=Array.from(m[2].data),l=m.length>3&&m[3]!==null?Array.from(m[3].data):void 0,A=m.length>4&&m[4]!==null?Array.from(m[4].data):void 0;_=ht(m[0],d,r,l,A);break}case"Conv":_=At(m[0],m[1],m.length>2?m[2]:null,p.group??1,p.pads??[0,0],p.dilations??[1],p.strides??[1]);break;default:throw new Error("unhandled op "+f.op)}o[f.outputs[0]]=_}this.cache=o[this.outputNames[1]];let u=o[this.outputNames[0]],a=S(u.shape),e=new Float32Array(n);for(let f=0;f<n;f++)e[f]=u.data[f*a[1]];return e}};var I=80,bt=160/16e3*1e3,Ht=1e3/bt,Ut=700,F=Math.round(Ut/bt),yt=8,Z=yt+1,zt=.2,Bt=.75,Ot=15,qt=4,Vt=50;function Wt(t,s,n){let o=0;for(let p=0;p<s;p++)o+=t[p];o/=s;let u=n*s/Ht,a=2*Math.cos(2*Math.PI*u/s),e=0,f=0;for(let p=0;p<s;p++){let m=t[p]-o+a*e-f;f=e,e=m}return Math.sqrt(Math.max(0,e*e+f*f-a*e*f))/s}function Qt(t,s){let n=0;for(let u=0;u<s;u++)n+=t[u];n/=s;let o=0;for(let u=0;u<s;u++)o+=(t[u]-n)**2;return Math.sqrt(o/s)}function Ct(t,s,n){let o=Math.min(s-1,Math.max(0,Math.round(n*(s-1))));return t[o]}var V=class{constructor(){this.motion=new Float64Array(F);this.flux=new Float64Array(F);this.level=new Float64Array(F);this.candidate=new Uint8Array(F);this.count=0;this.position=0;this.history=new Float32Array(Z*I);this.historyNorm=new Float64Array(Z);this.historyPosition=0;this.seen=0;this.scratchMotion=new Float64Array(F);this.scratchFlux=new Float64Array(F);this.scratchLevel=new Float64Array(F)}reset(){this.count=0,this.position=0,this.historyPosition=0,this.seen=0}push(s,n,o){let u=0,a=0,e=this.historyPosition*I;for(let l=0;l<I;l++){let A=s[n+l];this.history[e+l]=A,u+=A,a+=A*A}let f=Math.sqrt(a);this.historyNorm[this.historyPosition]=f;let p=(this.historyPosition+1)%Z;if(this.historyPosition=p,this.seen++,this.seen<=yt)return;let m=p*I,_=0,d=0;for(let l=0;l<I;l++)_+=this.history[e+l]*this.history[m+l],d+=Math.abs(this.history[e+l]-this.history[m+l]);let r=f*this.historyNorm[p];this.motion[this.position]=r>1e-9?1-_/r:0,this.flux[this.position]=d/I,this.level[this.position]=u/I,this.candidate[this.position]=o>=zt?1:0,this.position=(this.position+1)%F,this.count<F&&this.count++}score(){let s=this.count<F?0:this.position,n=0;for(let e=0;e<this.count;e++){let f=(s+e)%F;this.scratchLevel[e]=this.level[f],this.candidate[f]&&(this.scratchMotion[n]=this.motion[f],this.scratchFlux[n]=this.flux[f],n++)}if(n<Ot)return null;let o=this.scratchMotion.subarray(0,n),u=this.scratchFlux.subarray(0,n);o.sort(),u.sort();let a=0;if(this.count>=Vt){let e=Qt(this.scratchLevel,this.count);e>1e-6&&(a=Wt(this.scratchLevel,this.count,qt)/e)}return{motion:Ct(o,n,Bt),medianFlux:Ct(u,n,.5),modulation:a,frames:n}}};var z=5,Zt=80,jt=160/16e3*1e3;function xt(t){let s=new O(t.cmvn),n=new q(t.graph,t.weights),o=new V,u=new Float64Array(z),a=0,e=0,f=0,p=0,m=null;function _(d){return a<z?(u[e]=d,f+=d,a++,e=(e+1)%z,f/a):(f+=d-u[e],u[e]=d,e=(e+1)%z,f/z)}return{pushPcm(d){let{feats:r,n:l}=s.push(ot(d));if(l===0)return;let A=n.step(r,l);if(!m){p+=l;return}for(let h=0;h<l;h++){p++;let c=_(A[h]);o.push(r,h*Zt,c),m(c,p*jt,o.score())}},onProb(d){m=d},reset(){s.reset(),n.reset(),o.reset(),u.fill(0),a=0,e=0,f=0,p=0}}}async function wt(t){let s=await Promise.resolve().then(()=>(Tt(),St));return{graph:s.graph,cmvn:s.cmvn,weights:t}}var W=self,Q=null;async function Xt(t){let s=await wt(new Uint8Array(t));Q=xt(s),Q.onProb((n,o,u)=>W.postMessage({type:"prob",prob:n,tMs:o,speech:u})),W.postMessage({type:"ready"})}W.onmessage=t=>{let s=t.data;switch(s.type){case"init":Xt(s.weights).catch(n=>W.postMessage({type:"error",message:String(n)}));return;case"pcm":Q?.pushPcm(new Float32Array(s.buffer));return;case"reset":Q?.reset();return}};})();\n';});var _1={};Fv(_1,{MOOD_WORKER_SOURCE:()=>uk});var uk,S1=Uv(()=>{uk=`"use strict";(()=>{var o=self,l=/^(INFO: |[IW]\\d{4} |Graph successfully started running)/;for(let t of["log","info","warn","error"]){let e=console[t].bind(console);console[t]=(...r)=>{typeof r[0]=="string"&&l.test(r[0])||e(...r)}}var s=null,i=(t,e,r)=>t.FaceLandmarker.createFromOptions({wasmLoaderPath:e.loaderUrl,wasmBinaryPath:e.wasmUrl},{baseOptions:{modelAssetBuffer:e.model,delegate:r},runningMode:"VIDEO",numFaces:1,outputFaceBlendshapes:!0});async function d(t){o.importScripts(t.bundleUrl);let e=o.Vision;if(!e?.FaceLandmarker)throw new Error("MediaPipe bundle defined no Vision global");if(t.delegate==="GPU")try{s=await i(e,t,"GPU"),o.postMessage({type:"ready",delegate:"GPU"});return}catch{}s=await i(e,t,"CPU"),o.postMessage({type:"ready",delegate:"CPU"})}function p(t,e){try{if(!s)throw new Error("frame before init");let n=s.detectForVideo(t,e).faceBlendshapes?.[0]?.categories;o.postMessage({type:"result",blendshapes:n?Object.fromEntries(n.map(a=>[a.categoryName,a.score])):null})}catch(r){o.postMessage({type:"error",message:String(r)})}finally{t.close()}}o.onmessage=t=>{let e=t.data;e.type==="init"?d(e).catch(r=>o.postMessage({type:"error",message:String(r)})):p(e.frame,e.timestampMs)};})();
10
- `;});var pu=ri((mu,$g)=>{(function(e,n){typeof mu=="object"&&typeof $g=="object"?$g.exports=n():typeof define=="function"&&define.amd?define([],n):typeof mu=="object"?mu.rive=n():e.rive=n();})(mu,()=>(()=>{var t=[,((r,a,o)=>{o.r(a),o.d(a,{Animation:()=>u.Animation});var u=o(2);}),((r,a,o)=>{o.r(a),o.d(a,{Animation:()=>u});var u=(function(){function d(g,y,A,p){this.animation=g,this.artboard=y,this.playing=p,this.loopCount=0,this.scrubTo=null,this.instance=new A.LinearAnimationInstance(g,y);}return Object.defineProperty(d.prototype,"name",{get:function(){return this.animation.name},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"time",{get:function(){return this.instance.time},set:function(g){this.instance.time=g;},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:false,configurable:true}),d.prototype.advance=function(g){this.scrubTo===null?this.instance.advance(g):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null);},d.prototype.apply=function(g){this.instance.apply(g);},d.prototype.cleanup=function(){this.instance.delete();},d})();}),((r,a,o)=>{o.r(a),o.d(a,{RuntimeLoader:()=>y});var u=o(4),d=o(5),g=function(){return g=Object.assign||function(A){for(var p,_=1,C=arguments.length;_<C;_++){p=arguments[_];for(var N in p)Object.prototype.hasOwnProperty.call(p,N)&&(A[N]=p[N]);}return A},g.apply(this,arguments)},y=(function(){function A(){}return A.notifyError=function(p){var _;for(A.isLoading=false;A.errorCallbackQueue.length>0;)(_=A.errorCallbackQueue.shift())===null||_===void 0||_(p);A.callBackQueue=[];},A.loadRuntime=function(){var p=A.wasmURL,_=A.wasmBinary;A.enablePerfMarks&&performance.mark("rive:wasm-init:start"),u.default(g({locateFile:function(){return p}},_?{wasmBinary:_}:{})).then(function(C){var N;for(A.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),A.runtime=C,A.errorCallbackQueue=[];A.callBackQueue.length>0;)(N=A.callBackQueue.shift())===null||N===void 0||N(A.runtime);}).catch(function(C){var N={message:C?.message||"Unknown error",type:C?.name||"Error",wasmError:C instanceof WebAssembly.CompileError||C instanceof WebAssembly.RuntimeError,originalError:C};console.debug("Rive WASM load error details:",N);var B=A.wasmFallbackURL,M=B!==null&&p.toLowerCase()===B.toLowerCase();if(B!==null&&!M)console.warn("Failed to load WASM from ".concat(p," (").concat(N.message,"), trying fallback URL: ").concat(B)),A.wasmBinary=null,A.setWasmUrl(B),A.loadRuntime();else {var w=M?"the configured WASM URL or its fallback (".concat(B,")"):p,R=["Could not load Rive WASM file from ".concat(w,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
8
+ `+i.stack}}var dm=Object.prototype.hasOwnProperty,np=rn.unstable_scheduleCallback,kh=rn.unstable_cancelCallback,MM=rn.unstable_shouldYield,TM=rn.unstable_requestPaint,qn=rn.unstable_now,CM=rn.unstable_getCurrentPriorityLevel,X0=rn.unstable_ImmediatePriority,K0=rn.unstable_UserBlockingPriority,Nc=rn.unstable_NormalPriority,RM=rn.unstable_LowPriority,Z0=rn.unstable_IdlePriority,kM=rn.log,xM=rn.unstable_setDisableYieldValue,Rl=null,Qn=null;function Hr(t){if(typeof kM=="function"&&xM(t),Qn&&typeof Qn.setStrictMode=="function")try{Qn.setStrictMode(Rl,t);}catch{}}var Xn=Math.clz32?Math.clz32:NM,OM=Math.log,IM=Math.LN2;function NM(t){return t>>>=0,t===0?32:31-(OM(t)/IM|0)|0}var Ju=256,$u=262144,ec=4194304;function Ca(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function sf(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var u=i&134217727;return u!==0?(i=u&~a,i!==0?r=Ca(i):(o&=u,o!==0?r=Ca(o):n||(n=u&~t,n!==0&&(r=Ca(n))))):(u=i&~a,u!==0?r=Ca(u):o!==0?r=Ca(o):n||(n=i&~t,n!==0&&(r=Ca(n)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function kl(t,e){return (t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function DM(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return -1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return -1;default:return -1}}function J0(){var t=ec;return ec<<=1,(ec&62914560)===0&&(ec=4194304),t}function xh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function xl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0);}function LM(t,e,n,i,r,a){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var u=t.entanglements,d=t.expirationTimes,g=t.hiddenUpdates;for(n=o&~n;0<n;){var y=31-Xn(n),A=1<<y;u[y]=0,d[y]=-1;var p=g[y];if(p!==null)for(g[y]=null,y=0;y<p.length;y++){var _=p[y];_!==null&&(_.lane&=-536870913);}n&=~A;}i!==0&&$0(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(o&~e));}function $0(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-Xn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930;}function ey(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Xn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r;}}function ty(t,e){var n=e&-e;return n=(n&42)!==0?1:ip(n),(n&(t.suspendedLanes|e))!==0?0:n}function ip(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0;}return t}function rp(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ny(){var t=it.p;return t!==0?t:(t=window.event,t===void 0?32:M_(t.type))}function _A(t,e){var n=it.p;try{return it.p=t,e()}finally{it.p=n;}}var aa=Math.random().toString(36).slice(2),mn="__reactFiber$"+aa,Pn="__reactProps$"+aa,eo="__reactContainer$"+aa,hm="__reactEvents$"+aa,PM="__reactListeners$"+aa,BM="__reactHandles$"+aa,SA="__reactResources$"+aa,Ol="__reactMarker$"+aa;function ap(t){delete t[mn],delete t[Pn],delete t[hm],delete t[PM],delete t[BM];}function Ts(t){var e=t[mn];if(e)return e;for(var n=t.parentNode;n;){if(e=n[eo]||n[mn]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=x0(t);t!==null;){if(n=t[mn])return n;t=x0(t);}return e}t=n,n=t.parentNode;}return null}function to(t){if(t=t[mn]||t[eo]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Zo(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(Y(33))}function Ps(t){var e=t[SA];return e||(e=t[SA]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function cn(t){t[Ol]=true;}var iy=new Set,ry={};function Va(t,e){js(t,e),js(t+"Capture",e);}function js(t,e){for(ry[t]=e,t=0;t<e.length;t++)iy.add(e[t]);}var UM=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),EA={},wA={};function FM(t){return dm.call(wA,t)?true:dm.call(EA,t)?false:UM.test(t)?wA[t]=true:(EA[t]=true,false)}function pc(t,e,n){if(FM(e))if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":t.removeAttribute(e);return;case "boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n);}}function tc(t,e,n){if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n);}}function er(t,e,n,i){if(i===null)t.removeAttribute(n);else {switch(typeof i){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i);}}function oi(t){switch(typeof t){case "bigint":case "boolean":case "number":case "string":case "undefined":return t;case "object":return t;default:return ""}}function ay(t){var e=t.type;return (t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VM(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(t,e,{configurable:true,get:function(){return r.call(this)},set:function(o){n=""+o,a.call(this,o);}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o;},stopTracking:function(){t._valueTracker=null,delete t[e];}}}}function mm(t){if(!t._valueTracker){var e=ay(t)?"checked":"value";t._valueTracker=VM(t,e,""+t[e]);}}function sy(t){if(!t)return false;var e=t._valueTracker;if(!e)return true;var n=e.getValue(),i="";return t&&(i=ay(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),true):false}function Dc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var HM=/[\n"\\]/g;function ci(t){return t.replace(HM,function(e){return "\\"+e.charCodeAt(0).toString(16)+" "})}function pm(t,e,n,i,r,a,o,u){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+oi(e)):t.value!==""+oi(e)&&(t.value=""+oi(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?gm(t,o,oi(e)):n!=null?gm(t,o,oi(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?t.name=""+oi(u):t.removeAttribute("name");}function oy(t,e,n,i,r,a,o,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){mm(t);return}n=n!=null?""+oi(n):"",e=e!=null?""+oi(e):n,u||e===t.value||(t.value=e),t.defaultValue=e;}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=u?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),mm(t);}function gm(t,e,n){e==="number"&&Dc(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n);}function Bs(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=true;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=true);}else {for(n=""+oi(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=true,i&&(t[r].defaultSelected=true);return}e!==null||t[r].disabled||(e=t[r]);}e!==null&&(e.selected=true);}}function ly(t,e,n){if(e!=null&&(e=""+oi(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+oi(n):"";}function uy(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(Y(92));if(Ko(i)){if(1<i.length)throw Error(Y(93));i=i[0];}n=i;}n==null&&(n=""),e=n;}n=oi(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),mm(t);}function Ys(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e;}var GM=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function MA(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||GM.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px";}function cy(t,e,n){if(e!=null&&typeof e!="object")throw Error(Y(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&MA(t,r,i);}else for(var a in e)e.hasOwnProperty(a)&&MA(t,a,e[a]);}function sp(t){if(t.indexOf("-")===-1)return false;switch(t){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return false;default:return true}}var zM=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jM=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gc(t){return jM.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function lr(){}var vm=null;function op(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cs=null,Us=null;function TA(t){var e=to(t);if(e&&(t=e.stateNode)){var n=t[Pn]||null;e:switch(t=e.stateNode,e.type){case "input":if(pm(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ci(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Pn]||null;if(!r)throw Error(Y(90));pm(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name);}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&sy(i);}break e;case "textarea":ly(t,n.value,n.defaultValue);break e;case "select":e=n.value,e!=null&&Bs(t,!!n.multiple,e,false);}}}var Oh=false;function fy(t,e,n){if(Oh)return t(e,n);Oh=true;try{var i=t(e);return i}finally{if(Oh=false,(Cs!==null||Us!==null)&&(Af(),Cs&&(e=Cs,t=Us,Us=Cs=null,TA(e),t)))for(e=0;e<t.length;e++)TA(t[e]);}}function ml(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Pn]||null;if(i===null)return null;n=i[e];e:switch(e){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=false;}if(t)return null;if(n&&typeof n!="function")throw Error(Y(231,e,typeof n));return n}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Am=false;if(hr)try{ys={},Object.defineProperty(ys,"passive",{get:function(){Am=!0;}}),window.addEventListener("test",ys,ys),window.removeEventListener("test",ys,ys);}catch{Am=false;}var ys,Gr=null,lp=null,vc=null;function dy(){if(vc)return vc;var t,e=lp,n=e.length,i,r="value"in Gr?Gr.value:Gr.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[a-i];i++);return vc=r.slice(t,1<i?1-i:void 0)}function Ac(t){var e=t.keyCode;return "charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function nc(){return true}function CA(){return false}function Bn(t){function e(n,i,r,a,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===false)?nc:CA,this.isPropagationStopped=CA,this}return St(e.prototype,{preventDefault:function(){this.defaultPrevented=true;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=false),this.isDefaultPrevented=nc);},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=true),this.isPropagationStopped=nc);},persist:function(){},isPersistent:nc}),e}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},of=Bn(Ha),Il=St({},Ha,{view:0,detail:0}),YM=Bn(Il),Ih,Nh,zo,lf=St({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:up,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return "movementX"in t?t.movementX:(t!==zo&&(zo&&t.type==="mousemove"?(Ih=t.screenX-zo.screenX,Nh=t.screenY-zo.screenY):Nh=Ih=0,zo=t),Ih)},movementY:function(t){return "movementY"in t?t.movementY:Nh}}),RA=Bn(lf),WM=St({},lf,{dataTransfer:0}),qM=Bn(WM),QM=St({},Il,{relatedTarget:0}),Dh=Bn(QM),XM=St({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),KM=Bn(XM),ZM=St({},Ha,{clipboardData:function(t){return "clipboardData"in t?t.clipboardData:window.clipboardData}}),JM=Bn(ZM),$M=St({},Ha,{data:0}),kA=Bn($M),eT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},nT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=nT[t])?!!e[t]:false}function up(){return iT}var rT=St({},Il,{key:function(t){if(t.key){var e=eT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Ac(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?tT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:up,charCode:function(t){return t.type==="keypress"?Ac(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ac(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),aT=Bn(rT),sT=St({},lf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xA=Bn(sT),oT=St({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:up}),lT=Bn(oT),uT=St({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),cT=Bn(uT),fT=St({},lf,{deltaX:function(t){return "deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return "deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),dT=Bn(fT),hT=St({},Ha,{newState:0,oldState:0}),mT=Bn(hT),pT=[9,13,27,32],cp=hr&&"CompositionEvent"in window,el=null;hr&&"documentMode"in document&&(el=document.documentMode);var gT=hr&&"TextEvent"in window&&!el,hy=hr&&(!cp||el&&8<el&&11>=el),OA=" ",IA=false;function my(t,e){switch(t){case "keyup":return pT.indexOf(e.keyCode)!==-1;case "keydown":return e.keyCode!==229;case "keypress":case "mousedown":case "focusout":return true;default:return false}}function py(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rs=false;function vT(t,e){switch(t){case "compositionend":return py(e);case "keypress":return e.which!==32?null:(IA=true,OA);case "textInput":return t=e.data,t===OA&&IA?null:t;default:return null}}function AT(t,e){if(Rs)return t==="compositionend"||!cp&&my(t,e)?(t=dy(),vc=lp=Gr=null,Rs=false,t):null;switch(t){case "paste":return null;case "keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case "compositionend":return hy&&e.locale!=="ko"?null:e.data;default:return null}}var yT={color:true,date:true,datetime:true,"datetime-local":true,email:true,month:true,number:true,password:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true};function NA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!yT[t.type]:e==="textarea"}function gy(t,e,n,i){Cs?Us?Us.push(i):Us=[i]:Cs=i,e=Jc(e,"onChange"),0<e.length&&(n=new of("onChange","change",null,n,i),t.push({event:n,listeners:e}));}var tl=null,pl=null;function bT(t){f_(t,0);}function uf(t){var e=Zo(t);if(sy(e))return t}function DA(t,e){if(t==="change")return e}var vy=false;hr&&(hr?(rc="oninput"in document,rc||(Lh=document.createElement("div"),Lh.setAttribute("oninput","return;"),rc=typeof Lh.oninput=="function"),ic=rc):ic=false,vy=ic&&(!document.documentMode||9<document.documentMode));var ic,rc,Lh;function LA(){tl&&(tl.detachEvent("onpropertychange",Ay),pl=tl=null);}function Ay(t){if(t.propertyName==="value"&&uf(pl)){var e=[];gy(e,pl,t,op(t)),fy(bT,e);}}function _T(t,e,n){t==="focusin"?(LA(),tl=e,pl=n,tl.attachEvent("onpropertychange",Ay)):t==="focusout"&&LA();}function ST(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return uf(pl)}function ET(t,e){if(t==="click")return uf(e)}function wT(t,e){if(t==="input"||t==="change")return uf(e)}function MT(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Zn=typeof Object.is=="function"?Object.is:MT;function gl(t,e){if(Zn(t,e))return true;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return false;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return false;for(i=0;i<n.length;i++){var r=n[i];if(!dm.call(e,r)||!Zn(t[r],e[r]))return false}return true}function PA(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function BA(t,e){var n=PA(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return {node:n,offset:e-t};t=i;}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode;}n=void 0;}n=PA(n);}}function yy(t,e){return t&&e?t===e?true:t&&t.nodeType===3?false:e&&e.nodeType===3?yy(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):false:false}function by(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Dc(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string";}catch{n=false;}if(n)t=e.contentWindow;else break;e=Dc(t.document);}return e}function fp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var TT=hr&&"documentMode"in document&&11>=document.documentMode,ks=null,ym=null,nl=null,bm=false;function UA(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bm||ks==null||ks!==Dc(i)||(i=ks,"selectionStart"in i&&fp(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nl&&gl(nl,i)||(nl=i,i=Jc(ym,"onSelect"),0<i.length&&(e=new of("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=ks)));}function Ma(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xs={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionrun:Ma("Transition","TransitionRun"),transitionstart:Ma("Transition","TransitionStart"),transitioncancel:Ma("Transition","TransitionCancel"),transitionend:Ma("Transition","TransitionEnd")},Ph={},_y={};hr&&(_y=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Ga(t){if(Ph[t])return Ph[t];if(!xs[t])return t;var e=xs[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in _y)return Ph[t]=e[n];return t}var Sy=Ga("animationend"),Ey=Ga("animationiteration"),wy=Ga("animationstart"),CT=Ga("transitionrun"),RT=Ga("transitionstart"),kT=Ga("transitioncancel"),My=Ga("transitionend"),Ty=new Map,_m="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_m.push("scrollEnd");function wi(t,e){Ty.set(t,e),Va(e,[t]);}var Lc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},si=[],Os=0,dp=0;function cf(){for(var t=Os,e=dp=Os=0;e<t;){var n=si[e];si[e++]=null;var i=si[e];si[e++]=null;var r=si[e];si[e++]=null;var a=si[e];if(si[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r;}a!==0&&Cy(n,r,a);}}function ff(t,e,n,i){si[Os++]=t,si[Os++]=e,si[Os++]=n,si[Os++]=i,dp|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i);}function hp(t,e,n,i){return ff(t,e,n,i),Pc(t)}function za(t,e){return ff(t,null,null,e),Pc(t)}function Cy(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=false,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=true)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-Xn(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function Pc(t){if(50<fl)throw fl=0,Gm=null,Error(Y(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Is={};function xT(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null;}function Yn(t,e,n,i){return new xT(t,e,n,i)}function mp(t){return t=t.prototype,!(!t||!t.isReactComponent)}function cr(t,e){var n=t.alternate;return n===null?(n=Yn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function Ry(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function yc(t,e,n,i,r,a){var o=0;if(i=t,typeof t=="function")mp(t)&&(o=1);else if(typeof t=="string")o=NC(t,n,Li.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case lm:return t=Yn(31,n,e,r),t.elementType=lm,t.lanes=a,t;case ws:return Oa(n.children,r,a,e);case q0:o=8,r|=24;break;case am:return t=Yn(12,n,e,r|2),t.elementType=am,t.lanes=a,t;case sm:return t=Yn(13,n,e,r),t.elementType=sm,t.lanes=a,t;case om:return t=Yn(19,n,e,r),t.elementType=om,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case or:o=10;break e;case Q0:o=9;break e;case ep:o=11;break e;case tp:o=14;break e;case Lr:o=16,i=null;break e}o=29,n=Error(Y(130,t===null?"null":typeof t,"")),i=null;}return e=Yn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function Oa(t,e,n,i){return t=Yn(7,t,i,e),t.lanes=n,t}function Bh(t,e,n){return t=Yn(6,t,null,e),t.lanes=n,t}function ky(t){var e=Yn(18,null,null,0);return e.stateNode=t,e}function Uh(t,e,n){return e=Yn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var FA=new WeakMap;function fi(t,e){if(typeof t=="object"&&t!==null){var n=FA.get(t);return n!==void 0?n:(e={value:t,source:e,stack:bA(e)},FA.set(t,e),e)}return {value:t,source:e,stack:bA(e)}}var Ns=[],Ds=0,Bc=null,vl=0,li=[],ui=0,ta=null,Ii=1,Ni="";function ar(t,e){Ns[Ds++]=vl,Ns[Ds++]=Bc,Bc=t,vl=e;}function xy(t,e,n){li[ui++]=Ii,li[ui++]=Ni,li[ui++]=ta,ta=t;var i=Ii;t=Ni;var r=32-Xn(i)-1;i&=~(1<<r),n+=1;var a=32-Xn(e)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Ii=1<<32-Xn(e)+r|n<<r|i,Ni=a+t;}else Ii=1<<a|n<<r|i,Ni=t;}function pp(t){t.return!==null&&(ar(t,1),xy(t,1,0));}function gp(t){for(;t===Bc;)Bc=Ns[--Ds],Ns[Ds]=null,vl=Ns[--Ds],Ns[Ds]=null;for(;t===ta;)ta=li[--ui],li[ui]=null,Ni=li[--ui],li[ui]=null,Ii=li[--ui],li[ui]=null;}function Oy(t,e){li[ui++]=Ii,li[ui++]=Ni,li[ui++]=ta,Ii=e.id,Ni=e.overflow,ta=t;}var pn=null,_t=null,qe=false,qr=null,di=false,Sm=Error(Y(519));function na(t){var e=Error(Y(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Al(fi(e,t)),Sm}function VA(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mn]=t,e[Pn]=i,n){case "dialog":He("cancel",e),He("close",e);break;case "iframe":case "object":case "embed":He("load",e);break;case "video":case "audio":for(n=0;n<Sl.length;n++)He(Sl[n],e);break;case "source":He("error",e);break;case "img":case "image":case "link":He("error",e),He("load",e);break;case "details":He("toggle",e);break;case "input":He("invalid",e),oy(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,true);break;case "select":He("invalid",e);break;case "textarea":He("invalid",e),uy(e,i.value,i.defaultValue,i.children);}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===true||h_(e.textContent,n)?(i.popover!=null&&(He("beforetoggle",e),He("toggle",e)),i.onScroll!=null&&He("scroll",e),i.onScrollEnd!=null&&He("scrollend",e),i.onClick!=null&&(e.onclick=lr),e=true):e=false,e||na(t,true);}function HA(t){for(pn=t.return;pn;)switch(pn.tag){case 5:case 31:case 13:di=false;return;case 27:case 3:di=true;return;default:pn=pn.return;}}function bs(t){if(t!==pn)return false;if(!qe)return HA(t),qe=true,false;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||qm(t.type,t.memoizedProps)),n=!n),n&&_t&&na(t),HA(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));_t=k0(t);}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));_t=k0(t);}else e===27?(e=_t,sa(t.type)?(t=Zm,Zm=null,_t=t):_t=e):_t=pn?mi(t.stateNode.nextSibling):null;return true}function La(){_t=pn=null,qe=false;}function Fh(){var t=qr;return t!==null&&(Dn===null?Dn=t:Dn.push.apply(Dn,t),qr=null),t}function Al(t){qr===null?qr=[t]:qr.push(t);}var Em=Pi(null),ja=null,ur=null;function Br(t,e,n){gt(Em,e._currentValue),e._currentValue=n;}function fr(t){t._currentValue=Em.current,fn(Em);}function wm(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return;}}function Mm(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var o=r.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=r;for(var d=0;d<e.length;d++)if(u.context===e[d]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),wm(a.return,n,t),i||(o=null);break e}a=u.next;}}else if(r.tag===18){if(o=r.return,o===null)throw Error(Y(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),wm(o,n,t),o=null;}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return;}r=o;}}function no(t,e,n,i){t=null;for(var r=e,a=false;r!==null;){if(!a){if((r.flags&524288)!==0)a=true;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(Y(387));if(o=o.memoizedProps,o!==null){var u=r.type;Zn(r.pendingProps.value,o.value)||(t!==null?t.push(u):t=[u]);}}else if(r===xc.current){if(o=r.alternate,o===null)throw Error(Y(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(wl):t=[wl]);}r=r.return;}t!==null&&Mm(e,t,n,i),e.flags|=262144;}function Uc(t){for(t=t.firstContext;t!==null;){if(!Zn(t.context._currentValue,t.memoizedValue))return true;t=t.next;}return false}function Pa(t){ja=t,ur=null,t=t.dependencies,t!==null&&(t.firstContext=null);}function gn(t){return Iy(ja,t)}function ac(t,e){return ja===null&&Pa(t),Iy(t,e)}function Iy(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},ur===null){if(t===null)throw Error(Y(308));ur=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288;}else ur=ur.next=e;return n}var OT=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:false,addEventListener:function(n,i){t.push(i);}};this.abort=function(){e.aborted=true,t.forEach(function(n){return n()});};},IT=rn.unstable_scheduleCallback,NT=rn.unstable_NormalPriority,Zt={$$typeof:or,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vp(){return {controller:new OT,data:new Map,refCount:0}}function Nl(t){t.refCount--,t.refCount===0&&IT(NT,function(){t.controller.abort();});}var il=null,Tm=0,Ws=0,Fs=null;function DT(t,e){if(il===null){var n=il=[];Tm=0,Ws=Gp(),Fs={status:"pending",value:void 0,then:function(i){n.push(i);}};}return Tm++,e.then(GA,GA),e}function GA(){if(--Tm===0&&il!==null){Fs!==null&&(Fs.status="fulfilled");var t=il;il=null,Ws=0,Fs=null;for(var e=0;e<t.length;e++)(0, t[e])();}}function LT(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r);}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0, n[r])(e);},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0, n[r])(void 0);}),i}var zA=Te.S;Te.S=function(t,e){Wb=qn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&DT(t,e),zA!==null&&zA(t,e);};var Ia=Pi(null);function Ap(){var t=Ia.current;return t!==null?t:mt.pooledCache}function bc(t,e){e===null?gt(Ia,Ia.current):gt(Ia,e.pool);}function Ny(){var t=Ap();return t===null?null:{parent:Zt._currentValue,pool:t}}var io=Error(Y(460)),yp=Error(Y(474)),df=Error(Y(542)),Fc={then:function(){}};function jA(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Dy(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(lr,lr),e=n),e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,WA(t),t;default:if(typeof e.status=="string")e.then(lr,lr);else {if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(Y(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i;}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i;}});}switch(e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,WA(t),t}throw Na=e,io}}function Ra(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Na=n,io):n}}var Na=null;function YA(){if(Na===null)throw Error(Y(459));var t=Na;return Na=null,t}function WA(t){if(t===io||t===df)throw Error(Y(483))}var Vs=null,yl=0;function sc(t){var e=yl;return yl+=1,Vs===null&&(Vs=[]),Dy(Vs,t,e)}function jo(t,e){e=e.props.ref,t.ref=e!==void 0?e:null;}function oc(t,e){throw e.$$typeof===_M?Error(Y(525)):(t=Object.prototype.toString.call(e),Error(Y(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Ly(t){function e(M,w){if(t){var R=M.deletions;R===null?(M.deletions=[w],M.flags|=16):R.push(w);}}function n(M,w){if(!t)return null;for(;w!==null;)e(M,w),w=w.sibling;return null}function i(M){for(var w=new Map;M!==null;)M.key!==null?w.set(M.key,M):w.set(M.index,M),M=M.sibling;return w}function r(M,w){return M=cr(M,w),M.index=0,M.sibling=null,M}function a(M,w,R){return M.index=R,t?(R=M.alternate,R!==null?(R=R.index,R<w?(M.flags|=67108866,w):R):(M.flags|=67108866,w)):(M.flags|=1048576,w)}function o(M){return t&&M.alternate===null&&(M.flags|=67108866),M}function u(M,w,R,D){return w===null||w.tag!==6?(w=Bh(R,M.mode,D),w.return=M,w):(w=r(w,R),w.return=M,w)}function d(M,w,R,D){var G=R.type;return G===ws?y(M,w,R.props.children,D,R.key):w!==null&&(w.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Lr&&Ra(G)===w.type)?(w=r(w,R.props),jo(w,R),w.return=M,w):(w=yc(R.type,R.key,R.props,null,M.mode,D),jo(w,R),w.return=M,w)}function g(M,w,R,D){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=Uh(R,M.mode,D),w.return=M,w):(w=r(w,R.children||[]),w.return=M,w)}function y(M,w,R,D,G){return w===null||w.tag!==7?(w=Oa(R,M.mode,D,G),w.return=M,w):(w=r(w,R),w.return=M,w)}function A(M,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Bh(""+w,M.mode,R),w.return=M,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Zu:return R=yc(w.type,w.key,w.props,null,M.mode,R),jo(R,w),R.return=M,R;case Xo:return w=Uh(w,M.mode,R),w.return=M,w;case Lr:return w=Ra(w),A(M,w,R)}if(Ko(w)||Go(w))return w=Oa(w,M.mode,R,null),w.return=M,w;if(typeof w.then=="function")return A(M,sc(w),R);if(w.$$typeof===or)return A(M,ac(M,w),R);oc(M,w);}return null}function p(M,w,R,D){var G=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return G!==null?null:u(M,w,""+R,D);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Zu:return R.key===G?d(M,w,R,D):null;case Xo:return R.key===G?g(M,w,R,D):null;case Lr:return R=Ra(R),p(M,w,R,D)}if(Ko(R)||Go(R))return G!==null?null:y(M,w,R,D,null);if(typeof R.then=="function")return p(M,w,sc(R),D);if(R.$$typeof===or)return p(M,w,ac(M,R),D);oc(M,R);}return null}function _(M,w,R,D,G){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return M=M.get(R)||null,u(w,M,""+D,G);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case Zu:return M=M.get(D.key===null?R:D.key)||null,d(w,M,D,G);case Xo:return M=M.get(D.key===null?R:D.key)||null,g(w,M,D,G);case Lr:return D=Ra(D),_(M,w,R,D,G)}if(Ko(D)||Go(D))return M=M.get(R)||null,y(w,M,D,G,null);if(typeof D.then=="function")return _(M,w,R,sc(D),G);if(D.$$typeof===or)return _(M,w,R,ac(w,D),G);oc(w,D);}return null}function C(M,w,R,D){for(var G=null,ne=null,U=w,H=w=0,ee=null;U!==null&&H<R.length;H++){U.index>H?(ee=U,U=null):ee=U.sibling;var Q=p(M,U,R[H],D);if(Q===null){U===null&&(U=ee);break}t&&U&&Q.alternate===null&&e(M,U),w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q,U=ee;}if(H===R.length)return n(M,U),qe&&ar(M,H),G;if(U===null){for(;H<R.length;H++)U=A(M,R[H],D),U!==null&&(w=a(U,w,H),ne===null?G=U:ne.sibling=U,ne=U);return qe&&ar(M,H),G}for(U=i(U);H<R.length;H++)ee=_(U,M,H,R[H],D),ee!==null&&(t&&ee.alternate!==null&&U.delete(ee.key===null?H:ee.key),w=a(ee,w,H),ne===null?G=ee:ne.sibling=ee,ne=ee);return t&&U.forEach(function(Ee){return e(M,Ee)}),qe&&ar(M,H),G}function N(M,w,R,D){if(R==null)throw Error(Y(151));for(var G=null,ne=null,U=w,H=w=0,ee=null,Q=R.next();U!==null&&!Q.done;H++,Q=R.next()){U.index>H?(ee=U,U=null):ee=U.sibling;var Ee=p(M,U,Q.value,D);if(Ee===null){U===null&&(U=ee);break}t&&U&&Ee.alternate===null&&e(M,U),w=a(Ee,w,H),ne===null?G=Ee:ne.sibling=Ee,ne=Ee,U=ee;}if(Q.done)return n(M,U),qe&&ar(M,H),G;if(U===null){for(;!Q.done;H++,Q=R.next())Q=A(M,Q.value,D),Q!==null&&(w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q);return qe&&ar(M,H),G}for(U=i(U);!Q.done;H++,Q=R.next())Q=_(U,M,H,Q.value,D),Q!==null&&(t&&Q.alternate!==null&&U.delete(Q.key===null?H:Q.key),w=a(Q,w,H),ne===null?G=Q:ne.sibling=Q,ne=Q);return t&&U.forEach(function(Ce){return e(M,Ce)}),qe&&ar(M,H),G}function B(M,w,R,D){if(typeof R=="object"&&R!==null&&R.type===ws&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case Zu:e:{for(var G=R.key;w!==null;){if(w.key===G){if(G=R.type,G===ws){if(w.tag===7){n(M,w.sibling),D=r(w,R.props.children),D.return=M,M=D;break e}}else if(w.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Lr&&Ra(G)===w.type){n(M,w.sibling),D=r(w,R.props),jo(D,R),D.return=M,M=D;break e}n(M,w);break}else e(M,w);w=w.sibling;}R.type===ws?(D=Oa(R.props.children,M.mode,D,R.key),D.return=M,M=D):(D=yc(R.type,R.key,R.props,null,M.mode,D),jo(D,R),D.return=M,M=D);}return o(M);case Xo:e:{for(G=R.key;w!==null;){if(w.key===G)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){n(M,w.sibling),D=r(w,R.children||[]),D.return=M,M=D;break e}else {n(M,w);break}else e(M,w);w=w.sibling;}D=Uh(R,M.mode,D),D.return=M,M=D;}return o(M);case Lr:return R=Ra(R),B(M,w,R,D)}if(Ko(R))return C(M,w,R,D);if(Go(R)){if(G=Go(R),typeof G!="function")throw Error(Y(150));return R=G.call(R),N(M,w,R,D)}if(typeof R.then=="function")return B(M,w,sc(R),D);if(R.$$typeof===or)return B(M,w,ac(M,R),D);oc(M,R);}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(n(M,w.sibling),D=r(w,R),D.return=M,M=D):(n(M,w),D=Bh(R,M.mode,D),D.return=M,M=D),o(M)):n(M,w)}return function(M,w,R,D){try{yl=0;var G=B(M,w,R,D);return Vs=null,G}catch(U){if(U===io||U===df)throw U;var ne=Yn(29,U,null,M.mode);return ne.lanes=D,ne.return=M,ne}}}var Ba=Ly(true),Py=Ly(false),Pr=false;function bp(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null};}function Cm(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null});}function Qr(t){return {lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(nt&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Pc(t),Cy(t,null,n),e}return ff(t,i,e,n),Pc(t)}function rl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,ey(t,n);}}function Vh(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=o:a=a.next=o,n=n.next;}while(n!==null);a===null?r=a=e:a=a.next=e;}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e;}var Rm=false;function al(){if(Rm){var t=Fs;if(t!==null)throw t}}function sl(t,e,n,i){Rm=false;var r=t.updateQueue;Pr=false;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,u=r.shared.pending;if(u!==null){r.shared.pending=null;var d=u,g=d.next;d.next=null,o===null?a=g:o.next=g,o=d;var y=t.alternate;y!==null&&(y=y.updateQueue,u=y.lastBaseUpdate,u!==o&&(u===null?y.firstBaseUpdate=g:u.next=g,y.lastBaseUpdate=d));}if(a!==null){var A=r.baseState;o=0,y=g=d=null,u=a;do{var p=u.lane&-536870913,_=p!==u.lane;if(_?(je&p)===p:(i&p)===p){p!==0&&p===Ws&&(Rm=true),y!==null&&(y=y.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var C=t,N=u;p=e;var B=n;switch(N.tag){case 1:if(C=N.payload,typeof C=="function"){A=C.call(B,A,p);break e}A=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=N.payload,p=typeof C=="function"?C.call(B,A,p):C,p==null)break e;A=St({},A,p);break e;case 2:Pr=true;}}p=u.callback,p!==null&&(t.flags|=64,_&&(t.flags|=8192),_=r.callbacks,_===null?r.callbacks=[p]:_.push(p));}else _={lane:p,tag:u.tag,payload:u.payload,callback:u.callback,next:null},y===null?(g=y=_,d=A):y=y.next=_,o|=p;if(u=u.next,u===null){if(u=r.shared.pending,u===null)break;_=u,u=_.next,_.next=null,r.lastBaseUpdate=_,r.shared.pending=null;}}while(true);y===null&&(d=A),r.baseState=d,r.firstBaseUpdate=g,r.lastBaseUpdate=y,a===null&&(r.shared.lanes=0),ra|=o,t.lanes=o,t.memoizedState=A;}}function By(t,e){if(typeof t!="function")throw Error(Y(191,t));t.call(e);}function Uy(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)By(n[t],e);}var qs=Pi(null),Vc=Pi(0);function qA(t,e){t=vr,gt(Vc,t),gt(qs,e),vr=t|e.baseLanes;}function km(){gt(Vc,vr),gt(qs,qs.current);}function _p(){vr=Vc.current,fn(qs),fn(Vc);}var Jn=Pi(null),hi=null;function Ur(t){var e=t.alternate;gt(jt,jt.current&1),gt(Jn,t),hi===null&&(e===null||qs.current!==null||e.memoizedState!==null)&&(hi=t);}function xm(t){gt(jt,jt.current),gt(Jn,t),hi===null&&(hi=t);}function Fy(t){t.tag===22?(gt(jt,jt.current),gt(Jn,t),hi===null&&(hi=t)):Fr();}function Fr(){gt(jt,jt.current),gt(Jn,Jn.current);}function jn(t){fn(Jn),hi===t&&(hi=null),fn(jt);}var jt=Pi(0);function Hc(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xm(n)||Km(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return;}e.sibling.return=e.return,e=e.sibling;}return null}var mr=0,Oe=null,ft=null,Xt=null,Gc=false,Hs=false,Ua=false,zc=0,bl=0,Gs=null,PT=0;function Ut(){throw Error(Y(321))}function Sp(t,e){if(e===null)return false;for(var n=0;n<e.length&&n<t.length;n++)if(!Zn(t[n],e[n]))return false;return true}function Ep(t,e,n,i,r,a){return mr=a,Oe=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Te.H=t===null||t.memoizedState===null?gb:Dp,Ua=false,a=n(i,r),Ua=false,Hs&&(a=Hy(e,n,i,r)),Vy(t),a}function Vy(t){Te.H=_l;var e=ft!==null&&ft.next!==null;if(mr=0,Xt=ft=Oe=null,Gc=false,bl=0,Gs=null,e)throw Error(Y(300));t===null||Jt||(t=t.dependencies,t!==null&&Uc(t)&&(Jt=true));}function Hy(t,e,n,i){Oe=t;var r=0;do{if(Hs&&(Gs=null),bl=0,Hs=false,25<=r)throw Error(Y(301));if(r+=1,Xt=ft=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0);}Te.H=vb,a=e(n,i);}while(Hs);return a}function BT(){var t=Te.H,e=t.useState()[0];return e=typeof e.then=="function"?Dl(e):e,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(Oe.flags|=1024),e}function wp(){var t=zc!==0;return zc=0,t}function Mp(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n;}function Tp(t){if(Gc){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next;}Gc=false;}mr=0,Xt=ft=Oe=null,Hs=false,bl=zc=0,Gs=null;}function Rn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Oe.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function Yt(){if(ft===null){var t=Oe.alternate;t=t!==null?t.memoizedState:null;}else t=ft.next;var e=Xt===null?Oe.memoizedState:Xt.next;if(e!==null)Xt=e,ft=t;else {if(t===null)throw Oe.alternate===null?Error(Y(467)):Error(Y(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Xt===null?Oe.memoizedState=Xt=t:Xt=Xt.next=t;}return Xt}function hf(){return {lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(t){var e=bl;return bl+=1,Gs===null&&(Gs=[]),t=Dy(Gs,t,e),e=Oe,(Xt===null?e.memoizedState:Xt.next)===null&&(e=e.alternate,Te.H=e===null||e.memoizedState===null?gb:Dp),t}function mf(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Dl(t);if(t.$$typeof===or)return gn(t)}throw Error(Y(438,String(t)))}function Cp(t){var e=null,n=Oe.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=Oe.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})));}if(e==null&&(e={data:[],index:0}),n===null&&(n=hf(),Oe.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=SM;return e.index++,n}function pr(t,e){return typeof e=="function"?e(t):e}function _c(t){var e=Yt();return Rp(e,ft,t)}function Rp(t,e,n){var i=t.queue;if(i===null)throw Error(Y(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o;}e.baseQueue=r=a,i.pending=null;}if(a=t.baseState,r===null)t.memoizedState=a;else {e=r.next;var u=o=null,d=null,g=e,y=false;do{var A=g.lane&-536870913;if(A!==g.lane?(je&A)===A:(mr&A)===A){var p=g.revertLane;if(p===0)d!==null&&(d=d.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),A===Ws&&(y=true);else if((mr&p)===p){g=g.next,p===Ws&&(y=true);continue}else A={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=A,o=a):d=d.next=A,Oe.lanes|=p,ra|=p;A=g.action,Ua&&n(a,A),a=g.hasEagerState?g.eagerState:n(a,A);}else p={lane:A,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=p,o=a):d=d.next=p,Oe.lanes|=A,ra|=A;g=g.next;}while(g!==null&&g!==e);if(d===null?o=a:d.next=u,!Zn(a,t.memoizedState)&&(Jt=true,y&&(n=Fs,n!==null)))throw n;t.memoizedState=a,t.baseState=o,t.baseQueue=d,i.lastRenderedState=a;}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Hh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=t(a,o.action),o=o.next;while(o!==r);Zn(a,e.memoizedState)||(Jt=true),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a;}return [a,i]}function Gy(t,e,n){var i=Oe,r=Yt(),a=qe;if(a){if(n===void 0)throw Error(Y(407));n=n();}else n=e();var o=!Zn((ft||r).memoizedState,n);if(o&&(r.memoizedState=n,Jt=true),r=r.queue,kp(Yy.bind(null,i,r,t),[t]),r.getSnapshot!==e||o||Xt!==null&&Xt.memoizedState.tag&1){if(i.flags|=2048,Qs(9,{destroy:void 0},jy.bind(null,i,r,n,e),null),mt===null)throw Error(Y(349));a||(mr&127)!==0||zy(i,e,n);}return n}function zy(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Oe.updateQueue,e===null?(e=hf(),Oe.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t));}function jy(t,e,n,i){e.value=n,e.getSnapshot=i,Wy(e)&&qy(t);}function Yy(t,e,n){return n(function(){Wy(e)&&qy(t);})}function Wy(t){var e=t.getSnapshot;t=t.value;try{var n=e();return !Zn(t,n)}catch{return true}}function qy(t){var e=za(t,2);e!==null&&Ln(e,t,2);}function Om(t){var e=Rn();if(typeof t=="function"){var n=t;if(t=n(),Ua){Hr(true);try{n();}finally{Hr(false);}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:t},e}function Qy(t,e,n,i){return t.baseState=n,Rp(t,ft,typeof i=="function"?i:pr)}function UT(t,e,n,i,r){if(gf(t))throw Error(Y(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:true,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o);}};Te.T!==null?n(true):a.isTransition=false,i(a),n=e.pending,n===null?(a.next=e.pending=a,Xy(e,a)):(a.next=n.next,e.pending=n.next=a);}}function Xy(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Te.T,o={};Te.T=o;try{var u=n(r,i),d=Te.S;d!==null&&d(o,u),QA(t,e,u);}catch(g){Im(t,e,g);}finally{a!==null&&o.types!==null&&(a.types=o.types),Te.T=a;}}else try{a=n(r,i),QA(t,e,a);}catch(g){Im(t,e,g);}}function QA(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){XA(t,e,i);},function(i){return Im(t,e,i)}):XA(t,e,n);}function XA(t,e,n){e.status="fulfilled",e.value=n,Ky(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,Xy(t,n)));}function Im(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,Ky(e),e=e.next;while(e!==i)}t.action=null;}function Ky(t){t=t.listeners;for(var e=0;e<t.length;e++)(0, t[e])();}function Zy(t,e){return e}function KA(t,e){if(qe){var n=mt.formState;if(n!==null){e:{var i=Oe;if(qe){if(_t){t:{for(var r=_t,a=di;r.nodeType!==8;){if(!a){r=null;break t}if(r=mi(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null;}if(r){_t=mi(r.nextSibling),i=r.data==="F!";break e}}na(i);}i=false;}i&&(e=n[0]);}}return n=Rn(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zy,lastRenderedState:e},n.queue=i,n=hb.bind(null,Oe,i),i.dispatch=n,i=Om(false),a=Np.bind(null,Oe,false,i.queue),i=Rn(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=UT.bind(null,Oe,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,false]}function ZA(t){var e=Yt();return Jy(e,ft,t)}function Jy(t,e,n){if(e=Rp(t,e,Zy)[0],t=_c(pr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Dl(e);}catch(o){throw o===io?df:o}else i=e;e=Yt();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(Oe.flags|=2048,Qs(9,{destroy:void 0},FT.bind(null,r,n),null)),[i,a,t]}function FT(t,e){t.action=e;}function JA(t){var e=Yt(),n=ft;if(n!==null)return Jy(e,n,t);Yt(),e=e.memoizedState,n=Yt();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,false]}function Qs(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=Oe.updateQueue,e===null&&(e=hf(),Oe.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function $y(){return Yt().memoizedState}function Sc(t,e,n,i){var r=Rn();Oe.flags|=t,r.memoizedState=Qs(1|e,{destroy:void 0},n,i===void 0?null:i);}function pf(t,e,n,i){var r=Yt();i=i===void 0?null:i;var a=r.memoizedState.inst;ft!==null&&i!==null&&Sp(i,ft.memoizedState.deps)?r.memoizedState=Qs(e,a,n,i):(Oe.flags|=t,r.memoizedState=Qs(1|e,a,n,i));}function $A(t,e){Sc(8390656,8,t,e);}function kp(t,e){pf(2048,8,t,e);}function VT(t){Oe.flags|=4;var e=Oe.updateQueue;if(e===null)e=hf(),Oe.updateQueue=e,e.events=[t];else {var n=e.events;n===null?e.events=[t]:n.push(t);}}function eb(t){var e=Yt().memoizedState;return VT({ref:e,nextImpl:t}),function(){if((nt&2)!==0)throw Error(Y(440));return e.impl.apply(void 0,arguments)}}function tb(t,e){return pf(4,2,t,e)}function nb(t,e){return pf(4,4,t,e)}function ib(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null);}}if(e!=null)return t=t(),e.current=t,function(){e.current=null;}}function rb(t,e,n){n=n!=null?n.concat([t]):null,pf(4,4,ib.bind(null,e,t),n);}function xp(){}function ab(t,e){var n=Yt();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Sp(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function sb(t,e){var n=Yt();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Sp(e,i[1]))return i[0];if(i=t(),Ua){Hr(true);try{t();}finally{Hr(false);}}return n.memoizedState=[i,e],i}function Op(t,e,n){return n===void 0||(mr&1073741824)!==0&&(je&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=Qb(),Oe.lanes|=t,ra|=t,n)}function ob(t,e,n,i){return Zn(n,e)?n:qs.current!==null?(t=Op(t,n,i),Zn(t,e)||(Jt=true),t):(mr&42)===0||(mr&1073741824)!==0&&(je&261930)===0?(Jt=true,t.memoizedState=n):(t=Qb(),Oe.lanes|=t,ra|=t,e)}function lb(t,e,n,i,r){var a=it.p;it.p=a!==0&&8>a?a:8;var o=Te.T,u={};Te.T=u,Np(t,false,e,n);try{var d=r(),g=Te.S;if(g!==null&&g(u,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var y=LT(d,i);ol(t,e,y,Kn(t));}else ol(t,e,i,Kn(t));}catch(A){ol(t,e,{then:function(){},status:"rejected",reason:A},Kn());}finally{it.p=a,o!==null&&u.types!==null&&(o.types=u.types),Te.T=o;}}function HT(){}function Nm(t,e,n,i){if(t.tag!==5)throw Error(Y(476));var r=ub(t).queue;lb(t,r,e,xa,n===null?HT:function(){return cb(t),n(i)});}function ub(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:xa,baseState:xa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:xa},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function cb(t){var e=ub(t);e.next===null&&(e=t.alternate.memoizedState),ol(t,e.next.queue,{},Kn());}function Ip(){return gn(wl)}function fb(){return Yt().memoizedState}function db(){return Yt().memoizedState}function GT(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Kn();t=Qr(n);var i=Xr(e,t,n);i!==null&&(Ln(i,e,n),rl(i,e,n)),e={cache:vp()},t.payload=e;return}e=e.return;}}function zT(t,e,n){var i=Kn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null},gf(t)?mb(e,n):(n=hp(t,e,n,i),n!==null&&(Ln(n,t,i),pb(n,e,i)));}function hb(t,e,n){var i=Kn();ol(t,e,n,i);}function ol(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null};if(gf(t))mb(e,r);else {var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,u=a(o,n);if(r.hasEagerState=!0,r.eagerState=u,Zn(u,o))return ff(t,e,r,0),mt===null&&cf(),!1}catch{}if(n=hp(t,e,r,i),n!==null)return Ln(n,t,i),pb(n,e,i),true}return false}function Np(t,e,n,i){if(i={lane:2,revertLane:Gp(),gesture:null,action:i,hasEagerState:false,eagerState:null,next:null},gf(t)){if(e)throw Error(Y(479))}else e=hp(t,n,i,2),e!==null&&Ln(e,t,2);}function gf(t){var e=t.alternate;return t===Oe||e!==null&&e===Oe}function mb(t,e){Hs=Gc=true;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e;}function pb(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,ey(t,n);}}var _l={readContext:gn,use:mf,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};_l.useEffectEvent=Ut;var gb={readContext:gn,use:mf,useCallback:function(t,e){return Rn().memoizedState=[t,e===void 0?null:e],t},useContext:gn,useEffect:$A,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Sc(4194308,4,ib.bind(null,e,t),n);},useLayoutEffect:function(t,e){return Sc(4194308,4,t,e)},useInsertionEffect:function(t,e){Sc(4,2,t,e);},useMemo:function(t,e){var n=Rn();e=e===void 0?null:e;var i=t();if(Ua){Hr(true);try{t();}finally{Hr(false);}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Rn();if(n!==void 0){var r=n(e);if(Ua){Hr(true);try{n(e);}finally{Hr(false);}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=zT.bind(null,Oe,t),[i.memoizedState,t]},useRef:function(t){var e=Rn();return t={current:t},e.memoizedState=t},useState:function(t){t=Om(t);var e=t.queue,n=hb.bind(null,Oe,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:xp,useDeferredValue:function(t,e){var n=Rn();return Op(n,t,e)},useTransition:function(){var t=Om(false);return t=lb.bind(null,Oe,t.queue,true,false),Rn().memoizedState=t,[false,t]},useSyncExternalStore:function(t,e,n){var i=Oe,r=Rn();if(qe){if(n===void 0)throw Error(Y(407));n=n();}else {if(n=e(),mt===null)throw Error(Y(349));(je&127)!==0||zy(i,e,n);}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,$A(Yy.bind(null,i,a,t),[t]),i.flags|=2048,Qs(9,{destroy:void 0},jy.bind(null,i,a,n,e),null),n},useId:function(){var t=Rn(),e=mt.identifierPrefix;if(qe){var n=Ni,i=Ii;n=(i&~(1<<32-Xn(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=zc++,0<n&&(e+="H"+n.toString(32)),e+="_";}else n=PT++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Ip,useFormState:KA,useActionState:KA,useOptimistic:function(t){var e=Rn();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Np.bind(null,Oe,true,n),n.dispatch=e,[t,e]},useMemoCache:Cp,useCacheRefresh:function(){return Rn().memoizedState=GT.bind(null,Oe)},useEffectEvent:function(t){var e=Rn(),n={impl:t};return e.memoizedState=n,function(){if((nt&2)!==0)throw Error(Y(440));return n.impl.apply(void 0,arguments)}}},Dp={readContext:gn,use:mf,useCallback:ab,useContext:gn,useEffect:kp,useImperativeHandle:rb,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:_c,useRef:$y,useState:function(){return _c(pr)},useDebugValue:xp,useDeferredValue:function(t,e){var n=Yt();return ob(n,ft.memoizedState,t,e)},useTransition:function(){var t=_c(pr)[0],e=Yt().memoizedState;return [typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:Gy,useId:fb,useHostTransitionStatus:Ip,useFormState:ZA,useActionState:ZA,useOptimistic:function(t,e){var n=Yt();return Qy(n,ft,t,e)},useMemoCache:Cp,useCacheRefresh:db};Dp.useEffectEvent=eb;var vb={readContext:gn,use:mf,useCallback:ab,useContext:gn,useEffect:kp,useImperativeHandle:rb,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:Hh,useRef:$y,useState:function(){return Hh(pr)},useDebugValue:xp,useDeferredValue:function(t,e){var n=Yt();return ft===null?Op(n,t,e):ob(n,ft.memoizedState,t,e)},useTransition:function(){var t=Hh(pr)[0],e=Yt().memoizedState;return [typeof t=="boolean"?t:Dl(t),e]},useSyncExternalStore:Gy,useId:fb,useHostTransitionStatus:Ip,useFormState:JA,useActionState:JA,useOptimistic:function(t,e){var n=Yt();return ft!==null?Qy(n,ft,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Cp,useCacheRefresh:db};vb.useEffectEvent=eb;function Gh(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:St({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n);}var Dm={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=Kn(),r=Qr(i);r.payload=e,n!=null&&(r.callback=n),e=Xr(t,r,i),e!==null&&(Ln(e,t,i),rl(e,t,i));},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=Kn(),r=Qr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Xr(t,r,i),e!==null&&(Ln(e,t,i),rl(e,t,i));},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Kn(),i=Qr(n);i.tag=2,e!=null&&(i.callback=e),e=Xr(t,i,n),e!==null&&(Ln(e,t,n),rl(e,t,n));}};function e0(t,e,n,i,r,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,o):e.prototype&&e.prototype.isPureReactComponent?!gl(n,i)||!gl(r,a):true}function t0(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Dm.enqueueReplaceState(e,e.state,null);}function Fa(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i]);}if(t=t.defaultProps){n===e&&(n=St({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r]);}return n}function Ab(t){Lc(t);}function yb(t){console.error(t);}function bb(t){Lc(t);}function jc(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack});}catch(i){setTimeout(function(){throw i});}}function n0(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null});}catch(r){setTimeout(function(){throw r});}}function Lm(t,e,n){return n=Qr(n),n.tag=3,n.payload={element:null},n.callback=function(){jc(t,e);},n}function _b(t){return t=Qr(t),t.tag=3,t}function Sb(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){n0(e,n,i);};}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){n0(e,n,i),typeof r!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var u=i.stack;this.componentDidCatch(i.value,{componentStack:u!==null?u:""});});}function jT(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&no(e,n,r,true),n=Jn.current,n!==null){switch(n.tag){case 31:case 13:return hi===null?Xc():n.alternate===null&&Ft===0&&(Ft=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Fc?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),$h(t,i,r)),false;case 22:return n.flags|=65536,i===Fc?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),$h(t,i,r)),false}throw Error(Y(435,n.tag))}return $h(t,i,r),Xc(),false}if(qe)return e=Jn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Sm&&(t=Error(Y(422),{cause:i}),Al(fi(t,n)))):(i!==Sm&&(e=Error(Y(423),{cause:i}),Al(fi(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=fi(i,n),r=Lm(t.stateNode,i,r),Vh(t,r),Ft!==4&&(Ft=2)),false;var a=Error(Y(520),{cause:i});if(a=fi(a,n),cl===null?cl=[a]:cl.push(a),Ft!==4&&(Ft=2),e===null)return true;i=fi(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Lm(n.stateNode,i,t),Vh(n,t),false;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Kr===null||!Kr.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=_b(r),Sb(r,t,n,i),Vh(n,r),false}n=n.return;}while(n!==null);return false}var Lp=Error(Y(461)),Jt=false;function hn(t,e,n,i){e.child=t===null?Py(e,null,n,i):Ba(e,t.child,n,i);}function i0(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var o={};for(var u in i)u!=="ref"&&(o[u]=i[u]);}else o=i;return Pa(e),i=Ep(t,e,n,o,a,r),u=wp(),t!==null&&!Jt?(Mp(t,e,r),gr(t,e,r)):(qe&&u&&pp(e),e.flags|=1,hn(t,e,i,r),e.child)}function r0(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!mp(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,Eb(t,e,a,i,r)):(t=yc(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!Pp(t,r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:gl,n(o,i)&&t.ref===e.ref)return gr(t,e,r)}return e.flags|=1,t=cr(a,i),t.ref=e.ref,t.return=e,e.child=t}function Eb(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(gl(a,i)&&t.ref===e.ref)if(Jt=false,e.pendingProps=i=a,Pp(t,r))(t.flags&131072)!==0&&(Jt=true);else return e.lanes=t.lanes,gr(t,e,r)}return Pm(t,e,n,i,r)}function wb(t,e,n,i){var r=i.children,a=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a;}else i=0,e.child=null;return a0(t,e,a,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&bc(e,a!==null?a.cachePool:null),a!==null?qA(e,a):km(),Fy(e);else return i=e.lanes=536870912,a0(t,e,a!==null?a.baseLanes|n:n,n,i)}else a!==null?(bc(e,a.cachePool),qA(e,a),Fr(),e.memoizedState=null):(t!==null&&bc(e,null),km(),Fr());return hn(t,e,r,n),e.child}function Jo(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function a0(t,e,n,i,r){var a=Ap();return a=a===null?null:{parent:Zt._currentValue,pool:a},e.memoizedState={baseLanes:n,cachePool:a},t!==null&&bc(e,null),km(),Fy(e),t!==null&&no(t,e,i,true),e.childLanes=r,null}function Ec(t,e){return e=Yc({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function s0(t,e,n){return Ba(e,t.child,null,n),t=Ec(e,e.pendingProps),t.flags|=2,jn(e),e.memoizedState=null,t}function YT(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(qe){if(i.mode==="hidden")return t=Ec(e,i),e.lanes=536870912,Jo(null,t);if(xm(e),(t=_t)?(t=g_(t,di),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ta!==null?{id:Ii,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},n=ky(t),n.return=e,e.child=n,pn=e,_t=null)):t=null,t===null)throw na(e);return e.lanes=536870912,null}return Ec(e,i)}var a=t.memoizedState;if(a!==null){var o=a.dehydrated;if(xm(e),r)if(e.flags&256)e.flags&=-257,e=s0(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(Y(558));else if(Jt||no(t,e,n,false),r=(n&t.childLanes)!==0,Jt||r){if(i=mt,i!==null&&(o=ty(i,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,za(t,o),Ln(i,t,o),Lp;Xc(),e=s0(t,e,n);}else t=a.treeContext,_t=mi(o.nextSibling),pn=e,qe=true,qr=null,di=false,t!==null&&Oy(e,t),e=Ec(e,i),e.flags|=4096;return e}return t=cr(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function wc(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else {if(typeof n!="function"&&typeof n!="object")throw Error(Y(284));(t===null||t.ref!==n)&&(e.flags|=4194816);}}function Pm(t,e,n,i,r){return Pa(e),n=Ep(t,e,n,i,void 0,r),i=wp(),t!==null&&!Jt?(Mp(t,e,r),gr(t,e,r)):(qe&&i&&pp(e),e.flags|=1,hn(t,e,n,r),e.child)}function o0(t,e,n,i,r,a){return Pa(e),e.updateQueue=null,n=Hy(e,i,n,r),Vy(t),i=wp(),t!==null&&!Jt?(Mp(t,e,a),gr(t,e,a)):(qe&&i&&pp(e),e.flags|=1,hn(t,e,n,a),e.child)}function l0(t,e,n,i,r){if(Pa(e),e.stateNode===null){var a=Is,o=n.contextType;typeof o=="object"&&o!==null&&(a=gn(o)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Dm,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},bp(e),o=n.contextType,a.context=typeof o=="object"&&o!==null?gn(o):Is,a.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Gh(e,n,o,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&Dm.enqueueReplaceState(a,a.state,null),sl(e,i,a,r),al(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=true;}else if(t===null){a=e.stateNode;var u=e.memoizedProps,d=Fa(n,u);a.props=d;var g=a.context,y=n.contextType;o=Is,typeof y=="object"&&y!==null&&(o=gn(y));var A=n.getDerivedStateFromProps;y=typeof A=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=e.pendingProps!==u,y||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||g!==o)&&t0(e,a,i,o),Pr=false;var p=e.memoizedState;a.state=p,sl(e,i,a,r),al(),g=e.memoizedState,u||p!==g||Pr?(typeof A=="function"&&(Gh(e,n,A,i),g=e.memoizedState),(d=Pr||e0(e,n,d,i,p,g,o))?(y||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=g),a.props=i,a.state=g,a.context=o,i=d):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=false);}else {a=e.stateNode,Cm(t,e),o=e.memoizedProps,y=Fa(n,o),a.props=y,A=e.pendingProps,p=a.context,g=n.contextType,d=Is,typeof g=="object"&&g!==null&&(d=gn(g)),u=n.getDerivedStateFromProps,(g=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==A||p!==d)&&t0(e,a,i,d),Pr=false,p=e.memoizedState,a.state=p,sl(e,i,a,r),al();var _=e.memoizedState;o!==A||p!==_||Pr||t!==null&&t.dependencies!==null&&Uc(t.dependencies)?(typeof u=="function"&&(Gh(e,n,u,i),_=e.memoizedState),(y=Pr||e0(e,n,y,i,p,_,d)||t!==null&&t.dependencies!==null&&Uc(t.dependencies))?(g||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,_,d),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,_,d)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=_),a.props=i,a.state=_,a.context=d,i=y):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),i=false);}return a=i,wc(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=Ba(e,t.child,null,r),e.child=Ba(e,null,n,r)):hn(t,e,n,r),e.memoizedState=a.state,t=e.child):t=gr(t,e,r),t}function u0(t,e,n,i){return La(),e.flags|=256,hn(t,e,n,i),e.child}var zh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jh(t){return {baseLanes:t,cachePool:Ny()}}function Yh(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Wn),t}function Mb(t,e,n){var i=e.pendingProps,r=false,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?false:(jt.current&2)!==0),o&&(r=true,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(qe){if(r?Ur(e):Fr(),(t=_t)?(t=g_(t,di),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ta!==null?{id:Ii,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},n=ky(t),n.return=e,e.child=n,pn=e,_t=null)):t=null,t===null)throw na(e);return Km(t)?e.lanes=32:e.lanes=536870912,null}var u=i.children;return i=i.fallback,r?(Fr(),r=e.mode,u=Yc({mode:"hidden",children:u},r),i=Oa(i,r,n,null),u.return=e,i.return=e,u.sibling=i,e.child=u,i=e.child,i.memoizedState=jh(n),i.childLanes=Yh(t,o,n),e.memoizedState=zh,Jo(null,i)):(Ur(e),Bm(e,u))}var d=t.memoizedState;if(d!==null&&(u=d.dehydrated,u!==null)){if(a)e.flags&256?(Ur(e),e.flags&=-257,e=Wh(t,e,n)):e.memoizedState!==null?(Fr(),e.child=t.child,e.flags|=128,e=null):(Fr(),u=i.fallback,r=e.mode,i=Yc({mode:"visible",children:i.children},r),u=Oa(u,r,n,null),u.flags|=2,i.return=e,u.return=e,i.sibling=u,e.child=i,Ba(e,t.child,null,n),i=e.child,i.memoizedState=jh(n),i.childLanes=Yh(t,o,n),e.memoizedState=zh,e=Jo(null,i));else if(Ur(e),Km(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var g=o.dgst;o=g,i=Error(Y(419)),i.stack="",i.digest=o,Al({value:i,source:null,stack:null}),e=Wh(t,e,n);}else if(Jt||no(t,e,n,false),o=(n&t.childLanes)!==0,Jt||o){if(o=mt,o!==null&&(i=ty(o,n),i!==0&&i!==d.retryLane))throw d.retryLane=i,za(t,i),Ln(o,t,i),Lp;Xm(u)||Xc(),e=Wh(t,e,n);}else Xm(u)?(e.flags|=192,e.child=t.child,e=null):(t=d.treeContext,_t=mi(u.nextSibling),pn=e,qe=true,qr=null,di=false,t!==null&&Oy(e,t),e=Bm(e,i.children),e.flags|=4096);return e}return r?(Fr(),u=i.fallback,r=e.mode,d=t.child,g=d.sibling,i=cr(d,{mode:"hidden",children:i.children}),i.subtreeFlags=d.subtreeFlags&65011712,g!==null?u=cr(g,u):(u=Oa(u,r,n,null),u.flags|=2),u.return=e,i.return=e,i.sibling=u,e.child=i,Jo(null,i),i=e.child,u=t.child.memoizedState,u===null?u=jh(n):(r=u.cachePool,r!==null?(d=Zt._currentValue,r=r.parent!==d?{parent:d,pool:d}:r):r=Ny(),u={baseLanes:u.baseLanes|n,cachePool:r}),i.memoizedState=u,i.childLanes=Yh(t,o,n),e.memoizedState=zh,Jo(t.child,i)):(Ur(e),n=t.child,t=n.sibling,n=cr(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function Bm(t,e){return e=Yc({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Yc(t,e){return t=Yn(22,t,null,e),t.lanes=0,t}function Wh(t,e,n){return Ba(e,t.child,null,n),t=Bm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function c0(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),wm(t.return,e,n);}function qh(t,e,n,i,r,a){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r,o.treeForkCount=a);}function Tb(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var o=jt.current,u=(o&2)!==0;if(u?(o=o&1|2,e.flags|=128):o&=1,gt(jt,o),hn(t,e,i,n),i=qe?vl:0,!u&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&c0(t,n,e);else if(t.tag===19)c0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return;}t.sibling.return=t.return,t=t.sibling;}switch(r){case "forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Hc(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),qh(e,false,r,n,a,i);break;case "backwards":case "unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Hc(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t;}qh(e,true,n,null,a,i);break;case "together":qh(e,false,null,null,void 0,i);break;default:e.memoizedState=null;}return e.child}function gr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ra|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(no(t,e,n,false),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(Y(153));if(e.child!==null){for(t=e.child,n=cr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=cr(t,t.pendingProps),n.return=e;n.sibling=null;}return e.child}function Pp(t,e){return (t.lanes&e)!==0?true:(t=t.dependencies,!!(t!==null&&Uc(t)))}function WT(t,e,n){switch(e.tag){case 3:Oc(e,e.stateNode.containerInfo),Br(e,Zt,t.memoizedState.cache),La();break;case 27:case 5:fm(e);break;case 4:Oc(e,e.stateNode.containerInfo);break;case 10:Br(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,xm(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(Ur(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Mb(t,e,n):(Ur(e),t=gr(t,e,n),t!==null?t.sibling:null);Ur(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(no(t,e,n,false),i=(n&e.childLanes)!==0),r){if(i)return Tb(t,e,n);e.flags|=128;}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),gt(jt,jt.current),i)break;return null;case 22:return e.lanes=0,wb(t,e,n,e.pendingProps);case 24:Br(e,Zt,t.memoizedState.cache);}return gr(t,e,n)}function Cb(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Jt=true;else {if(!Pp(t,n)&&(e.flags&128)===0)return Jt=false,WT(t,e,n);Jt=(t.flags&131072)!==0;}else Jt=false,qe&&(e.flags&1048576)!==0&&xy(e,vl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=Ra(e.elementType),e.type=t,typeof t=="function")mp(t)?(i=Fa(t,i),e.tag=1,e=l0(null,e,t,i,n)):(e.tag=0,e=Pm(null,e,t,i,n));else {if(t!=null){var r=t.$$typeof;if(r===ep){e.tag=11,e=i0(null,e,t,i,n);break e}else if(r===tp){e.tag=14,e=r0(null,e,t,i,n);break e}}throw e=um(t)||t,Error(Y(306,e,""))}}return e;case 0:return Pm(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Fa(i,e.pendingProps),l0(t,e,i,r,n);case 3:e:{if(Oc(e,e.stateNode.containerInfo),t===null)throw Error(Y(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,Cm(t,e),sl(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Br(e,Zt,i),i!==a.cache&&Mm(e,[Zt],n,true),al(),i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:false,cache:o.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=u0(t,e,i,n);break e}else if(i!==r){r=fi(Error(Y(424)),e),Al(r),e=u0(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,_t=mi(t.firstChild),pn=e,qe=true,qr=null,di=true,n=Py(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else {if(La(),i===r){e=gr(t,e,n);break e}hn(t,e,i,n);}e=e.child;}return e;case 26:return wc(t,e),t===null?(n=I0(e.type,null,e.pendingProps,null))?e.memoizedState=n:qe||(n=e.type,t=e.pendingProps,i=$c(Wr.current).createElement(n),i[mn]=e,i[Pn]=t,vn(i,n,t),cn(i),e.stateNode=i):e.memoizedState=I0(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return fm(e),t===null&&qe&&(i=e.stateNode=v_(e.type,e.pendingProps,Wr.current),pn=e,di=true,r=_t,sa(e.type)?(Zm=r,_t=mi(i.firstChild)):_t=r),hn(t,e,e.pendingProps.children,n),wc(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&qe&&((r=i=_t)&&(i=bC(i,e.type,e.pendingProps,di),i!==null?(e.stateNode=i,pn=e,_t=mi(i.firstChild),di=false,r=true):r=false),r||na(e)),fm(e),r=e.type,a=e.pendingProps,o=t!==null?t.memoizedProps:null,i=a.children,qm(r,a)?i=null:o!==null&&qm(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=Ep(t,e,BT,null,null,n),wl._currentValue=r),wc(t,e),hn(t,e,i,n),e.child;case 6:return t===null&&qe&&((t=n=_t)&&(n=_C(n,e.pendingProps,di),n!==null?(e.stateNode=n,pn=e,_t=null,t=true):t=false),t||na(e)),null;case 13:return Mb(t,e,n);case 4:return Oc(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Ba(e,null,i,n):hn(t,e,i,n),e.child;case 11:return i0(t,e,e.type,e.pendingProps,n);case 7:return hn(t,e,e.pendingProps,n),e.child;case 8:return hn(t,e,e.pendingProps.children,n),e.child;case 12:return hn(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Br(e,e.type,i.value),hn(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Pa(e),r=gn(r),i=i(r),e.flags|=1,hn(t,e,i,n),e.child;case 14:return r0(t,e,e.type,e.pendingProps,n);case 15:return Eb(t,e,e.type,e.pendingProps,n);case 19:return Tb(t,e,n);case 31:return YT(t,e,n);case 22:return wb(t,e,n,e.pendingProps);case 24:return Pa(e),i=gn(Zt),t===null?(r=Ap(),r===null&&(r=mt,a=vp(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},bp(e),Br(e,Zt,r)):((t.lanes&n)!==0&&(Cm(t,e),sl(e,null,null,n),al()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Br(e,Zt,i)):(i=a.cache,Br(e,Zt,i),i!==r.cache&&Mm(e,[Zt],n,true))),hn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(Y(156,e.tag))}function tr(t){t.flags|=4;}function Qh(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=false),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(Zb())t.flags|=8192;else throw Na=Fc,yp}else t.flags&=-16777217;}function f0(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!b_(e))if(Zb())t.flags|=8192;else throw Na=Fc,yp}function lc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?J0():536870912,t.lanes|=e,Xs|=e);}function Yo(t,e){if(!qe)switch(t.tailMode){case "hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case "collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null;}}function bt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function qT(t,e,n){var i=e.pendingProps;switch(gp(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(e),null;case 1:return bt(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),fr(Zt),zs(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(bs(e)?tr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Fh())),bt(e),null;case 26:var r=e.type,a=e.memoizedState;return t===null?(tr(e),a!==null?(bt(e),f0(e,a)):(bt(e),Qh(e,r,null,i,n))):a?a!==t.memoizedState?(tr(e),bt(e),f0(e,a)):(bt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&tr(e),bt(e),Qh(e,r,t,i,n)),null;case 27:if(Ic(e),n=Wr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(!i){if(e.stateNode===null)throw Error(Y(166));return bt(e),null}t=Li.current,bs(e)?VA(e):(t=v_(r,i,n),e.stateNode=t,tr(e));}return bt(e),null;case 5:if(Ic(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(!i){if(e.stateNode===null)throw Error(Y(166));return bt(e),null}if(a=Li.current,bs(e))VA(e);else {var o=$c(Wr.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case "svg":a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case "math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case "script":a=o.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case "select":a=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?a.multiple=true:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r);}}a[mn]=e,a[Pn]=i;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return;}o.sibling.return=o.return,o=o.sibling;}e.stateNode=a;e:switch(vn(a,r,i),r){case "button":case "input":case "select":case "textarea":i=!!i.autoFocus;break e;case "img":i=true;break e;default:i=false;}i&&tr(e);}}return bt(e),Qh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&tr(e);else {if(typeof i!="string"&&e.stateNode===null)throw Error(Y(166));if(t=Wr.current,bs(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=pn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps;}t[mn]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===true||h_(t.nodeValue,n)),t||na(e,true);}else t=$c(t).createTextNode(i),t[mn]=e,e.stateNode=t;}return bt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=bs(e),n!==null){if(t===null){if(!i)throw Error(Y(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(557));t[mn]=e;}else La(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;bt(e),t=false;}else n=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=true;if(!t)return e.flags&256?(jn(e),e):(jn(e),null);if((e.flags&128)!==0)throw Error(Y(558))}return bt(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=bs(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(Y(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Y(317));r[mn]=e;}else La(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;bt(e),r=false;}else r=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=true;if(!r)return e.flags&256?(jn(e),e):(jn(e),null)}return jn(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),lc(e,e.updateQueue),bt(e),null);case 4:return zs(),t===null&&zp(e.stateNode.containerInfo),bt(e),null;case 10:return fr(e.type),bt(e),null;case 19:if(fn(jt),i=e.memoizedState,i===null)return bt(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)Yo(i,false);else {if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=Hc(t),a!==null){for(e.flags|=128,Yo(i,false),t=a.updateQueue,e.updateQueue=t,lc(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Ry(n,t),n=n.sibling;return gt(jt,jt.current&1|2),qe&&ar(e,i.treeForkCount),e.child}t=t.sibling;}i.tail!==null&&qn()>qc&&(e.flags|=128,r=true,Yo(i,false),e.lanes=4194304);}else {if(!r)if(t=Hc(a),t!==null){if(e.flags|=128,r=true,t=t.updateQueue,e.updateQueue=t,lc(e,t),Yo(i,true),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qe)return bt(e),null}else 2*qn()-i.renderingStartTime>qc&&n!==536870912&&(e.flags|=128,r=true,Yo(i,false),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a);}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=qn(),t.sibling=null,n=jt.current,gt(jt,r?n&1|2:n&1),qe&&ar(e,i.treeForkCount),t):(bt(e),null);case 22:case 23:return jn(e),_p(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(bt(e),e.subtreeFlags&6&&(e.flags|=8192)):bt(e),n=e.updateQueue,n!==null&&lc(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&fn(Ia),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),fr(Zt),bt(e),null;case 25:return null;case 30:return null}throw Error(Y(156,e.tag))}function QT(t,e){switch(gp(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fr(Zt),zs(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ic(e),null;case 31:if(e.memoizedState!==null){if(jn(e),e.alternate===null)throw Error(Y(340));La();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(jn(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Y(340));La();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fn(jt),null;case 4:return zs(),null;case 10:return fr(e.type),null;case 22:case 23:return jn(e),_p(),t!==null&&fn(Ia),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return fr(Zt),null;case 25:return null;default:return null}}function Rb(t,e){switch(gp(e),e.tag){case 3:fr(Zt),zs();break;case 26:case 27:case 5:Ic(e);break;case 4:zs();break;case 31:e.memoizedState!==null&&jn(e);break;case 13:jn(e);break;case 19:fn(jt);break;case 10:fr(e.type);break;case 22:case 23:jn(e),_p(),t!==null&&fn(Ia);break;case 24:fr(Zt);}}function Ll(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,o=n.inst;i=a(),o.destroy=i;}n=n.next;}while(n!==r)}}catch(u){ot(e,e.return,u);}}function ia(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var o=i.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,r=e;var d=n,g=u;try{g();}catch(y){ot(r,d,y);}}}i=i.next;}while(i!==a)}}catch(y){ot(e,e.return,y);}}function kb(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Uy(e,n);}catch(i){ot(t,t.return,i);}}}function xb(t,e,n){n.props=Fa(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount();}catch(i){ot(t,e,i);}}function ll(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode;}typeof n=="function"?t.refCleanup=n(i):n.current=i;}}catch(r){ot(t,e,r);}}function Di(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i();}catch(r){ot(t,e,r);}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null);}else if(typeof n=="function")try{n(null);}catch(r){ot(t,e,r);}else n.current=null;}function Ob(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case "button":case "input":case "select":case "textarea":n.autoFocus&&i.focus();break e;case "img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet);}}catch(r){ot(t,t.return,r);}}function Xh(t,e,n){try{var i=t.stateNode;mC(i,t.type,n,e),i[Pn]=e;}catch(r){ot(t,t.return,r);}}function Ib(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&sa(t.type)||t.tag===4}function Kh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ib(t.return))return null;t=t.return;}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child;}if(!(t.flags&2))return t.stateNode}}function Um(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=lr));else if(i!==4&&(i===27&&sa(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Um(t,e,n),t=t.sibling;t!==null;)Um(t,e,n),t=t.sibling;}function Wc(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&sa(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Wc(t,e,n),t=t.sibling;t!==null;)Wc(t,e,n),t=t.sibling;}function Nb(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);vn(e,i,n),e[mn]=t,e[Pn]=n;}catch(a){ot(t,t.return,a);}}var sr=false,Kt=false,Zh=false,d0=typeof WeakSet=="function"?WeakSet:Set,un=null;function XT(t,e){if(t=t.containerInfo,Ym=rf,t=by(t),fp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType;}catch{n=null;break e}var o=0,u=-1,d=-1,g=0,y=0,A=t,p=null;t:for(;;){for(var _;A!==n||r!==0&&A.nodeType!==3||(u=o+r),A!==a||i!==0&&A.nodeType!==3||(d=o+i),A.nodeType===3&&(o+=A.nodeValue.length),(_=A.firstChild)!==null;)p=A,A=_;for(;;){if(A===t)break t;if(p===n&&++g===r&&(u=o),p===a&&++y===i&&(d=o),(_=A.nextSibling)!==null)break;A=p,p=A.parentNode;}A=_;}n=u===-1||d===-1?null:{start:u,end:d};}else n=null;}n=n||{start:0,end:0};}else n=null;for(Wm={focusedElem:t,selectionRange:n},rf=false,un=e;un!==null;)if(e=un,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,un=t;else for(;un!==null;){switch(e=un,a=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var C=Fa(n.type,r);t=i.getSnapshotBeforeUpdate(C,a),i.__reactInternalSnapshotBeforeUpdate=t;}catch(N){ot(n,n.return,N);}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Qm(t);else if(n===1)switch(t.nodeName){case "HEAD":case "HTML":case "BODY":Qm(t);break;default:t.textContent="";}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(Y(163))}if(t=e.sibling,t!==null){t.return=e.return,un=t;break}un=e.return;}}function Db(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ir(t,n),i&4&&Ll(5,n);break;case 1:if(ir(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount();}catch(o){ot(n,n.return,o);}else {var r=Fa(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate);}catch(o){ot(n,n.return,o);}}i&64&&kb(n),i&512&&ll(n,n.return);break;case 3:if(ir(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode;}try{Uy(t,e);}catch(o){ot(n,n.return,o);}}break;case 27:e===null&&i&4&&Nb(n);case 26:case 5:ir(t,n),e===null&&i&4&&Ob(n),i&512&&ll(n,n.return);break;case 12:ir(t,n);break;case 31:ir(t,n),i&4&&Bb(t,n);break;case 13:ir(t,n),i&4&&Ub(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=rC.bind(null,n),SC(t,n))));break;case 22:if(i=n.memoizedState!==null||sr,!i){e=e!==null&&e.memoizedState!==null||Kt,r=sr;var a=Kt;sr=i,(Kt=e)&&!a?rr(t,n,(n.subtreeFlags&8772)!==0):ir(t,n),sr=r,Kt=a;}break;case 30:break;default:ir(t,n);}}function Lb(t){var e=t.alternate;e!==null&&(t.alternate=null,Lb(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&ap(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null;}var Ot=null,Nn=false;function nr(t,e,n){for(n=n.child;n!==null;)Pb(t,e,n),n=n.sibling;}function Pb(t,e,n){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Rl,n);}catch{}switch(n.tag){case 26:Kt||Di(n,e),nr(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kt||Di(n,e);var i=Ot,r=Nn;sa(n.type)&&(Ot=n.stateNode,Nn=false),nr(t,e,n),dl(n.stateNode),Ot=i,Nn=r;break;case 5:Kt||Di(n,e);case 6:if(i=Ot,r=Nn,Ot=null,nr(t,e,n),Ot=i,Nn=r,Ot!==null)if(Nn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(n.stateNode);}catch(a){ot(n,e,a);}else try{Ot.removeChild(n.stateNode);}catch(a){ot(n,e,a);}break;case 18:Ot!==null&&(Nn?(t=Ot,C0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),$s(t)):C0(Ot,n.stateNode));break;case 4:i=Ot,r=Nn,Ot=n.stateNode.containerInfo,Nn=true,nr(t,e,n),Ot=i,Nn=r;break;case 0:case 11:case 14:case 15:ia(2,n,e),Kt||ia(4,n,e),nr(t,e,n);break;case 1:Kt||(Di(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&xb(n,e,i)),nr(t,e,n);break;case 21:nr(t,e,n);break;case 22:Kt=(i=Kt)||n.memoizedState!==null,nr(t,e,n),Kt=i;break;default:nr(t,e,n);}}function Bb(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{$s(t);}catch(n){ot(e,e.return,n);}}}function Ub(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{$s(t);}catch(n){ot(e,e.return,n);}}function KT(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new d0),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new d0),e;default:throw Error(Y(435,t.tag))}}function uc(t,e){var n=KT(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=aC.bind(null,t,i);i.then(r,r);}});}function On(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,o=e,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(sa(u.type)){Ot=u.stateNode,Nn=false;break e}break;case 5:Ot=u.stateNode,Nn=false;break e;case 3:case 4:Ot=u.stateNode.containerInfo,Nn=true;break e}u=u.return;}if(Ot===null)throw Error(Y(160));Pb(a,o,r),Ot=null,Nn=false,a=r.alternate,a!==null&&(a.return=null),r.return=null;}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Fb(e,t),e=e.sibling;}var Ei=null;function Fb(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:On(e,t),In(t),i&4&&(ia(3,t,t.return),Ll(3,t),ia(5,t,t.return));break;case 1:On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),i&64&&sr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Ei;if(On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case "title":a=r.getElementsByTagName("title")[0],(!a||a[Ol]||a[mn]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),vn(a,i,n),a[mn]=t,cn(a),i=a;break e;case "link":var o=D0("link","href",r).get(i+(n.href||""));if(o){for(var u=0;u<o.length;u++)if(a=o[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(u,1);break t}}a=r.createElement(i),vn(a,i,n),r.head.appendChild(a);break;case "meta":if(o=D0("meta","content",r).get(i+(n.content||""))){for(u=0;u<o.length;u++)if(a=o[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(u,1);break t}}a=r.createElement(i),vn(a,i,n),r.head.appendChild(a);break;default:throw Error(Y(468,i))}a[mn]=t,cn(a),i=a;}t.stateNode=i;}else L0(r,t.type,t.stateNode);else t.stateNode=N0(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?L0(r,t.type,t.stateNode):N0(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Xh(t,t.memoizedProps,n.memoizedProps);}break;case 27:On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),n!==null&&i&4&&Xh(t,t.memoizedProps,n.memoizedProps);break;case 5:if(On(e,t),In(t),i&512&&(Kt||n===null||Di(n,n.return)),t.flags&32){r=t.stateNode;try{Ys(r,"");}catch(C){ot(t,t.return,C);}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Xh(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Zh=true);break;case 6:if(On(e,t),In(t),i&4){if(t.stateNode===null)throw Error(Y(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i;}catch(C){ot(t,t.return,C);}}break;case 3:if(Cc=null,r=Ei,Ei=ef(e.containerInfo),On(e,t),Ei=r,In(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{$s(e.containerInfo);}catch(C){ot(t,t.return,C);}Zh&&(Zh=false,Vb(t));break;case 4:i=Ei,Ei=ef(t.stateNode.containerInfo),On(e,t),In(t),Ei=i;break;case 12:On(e,t),In(t);break;case 31:On(e,t),In(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,uc(t,i)));break;case 13:On(e,t),In(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(vf=qn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,uc(t,i)));break;case 22:r=t.memoizedState!==null;var d=n!==null&&n.memoizedState!==null,g=sr,y=Kt;if(sr=g||r,Kt=y||d,On(e,t),Kt=y,sr=g,In(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||d||sr||Kt||ka(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){d=n=e;try{if(a=d.stateNode,r)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else {u=d.stateNode;var A=d.memoizedProps.style,p=A!=null&&A.hasOwnProperty("display")?A.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim();}}catch(C){ot(d,d.return,C);}}}else if(e.tag===6){if(n===null){d=e;try{d.stateNode.nodeValue=r?"":d.memoizedProps;}catch(C){ot(d,d.return,C);}}}else if(e.tag===18){if(n===null){d=e;try{var _=d.stateNode;r?R0(_,!0):R0(d.stateNode,!1);}catch(C){ot(d,d.return,C);}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return;}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling;}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,uc(t,n))));break;case 19:On(e,t),In(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,uc(t,i)));break;case 30:break;case 21:break;default:On(e,t),In(t);}}function In(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(Ib(i)){n=i;break}i=i.return;}if(n==null)throw Error(Y(160));switch(n.tag){case 27:var r=n.stateNode,a=Kh(t);Wc(t,a,r);break;case 5:var o=n.stateNode;n.flags&32&&(Ys(o,""),n.flags&=-33);var u=Kh(t);Wc(t,u,o);break;case 3:case 4:var d=n.stateNode.containerInfo,g=Kh(t);Um(t,g,d);break;default:throw Error(Y(161))}}catch(y){ot(t,t.return,y);}t.flags&=-3;}e&4096&&(t.flags&=-4097);}function Vb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Vb(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling;}}function ir(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Db(t,e.alternate,e),e=e.sibling;}function ka(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ia(4,e,e.return),ka(e);break;case 1:Di(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&xb(e,e.return,n),ka(e);break;case 27:dl(e.stateNode);case 26:case 5:Di(e,e.return),ka(e);break;case 22:e.memoizedState===null&&ka(e);break;case 30:ka(e);break;default:ka(e);}t=t.sibling;}}function rr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,o=a.flags;switch(a.tag){case 0:case 11:case 15:rr(r,a,n),Ll(4,a);break;case 1:if(rr(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount();}catch(g){ot(i,i.return,g);}if(i=a,r=i.updateQueue,r!==null){var u=i.stateNode;try{var d=r.shared.hiddenCallbacks;if(d!==null)for(r.shared.hiddenCallbacks=null,r=0;r<d.length;r++)By(d[r],u);}catch(g){ot(i,i.return,g);}}n&&o&64&&kb(a),ll(a,a.return);break;case 27:Nb(a);case 26:case 5:rr(r,a,n),n&&i===null&&o&4&&Ob(a),ll(a,a.return);break;case 12:rr(r,a,n);break;case 31:rr(r,a,n),n&&o&4&&Bb(r,a);break;case 13:rr(r,a,n),n&&o&4&&Ub(r,a);break;case 22:a.memoizedState===null&&rr(r,a,n),ll(a,a.return);break;case 30:break;default:rr(r,a,n);}e=e.sibling;}}function Bp(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Nl(n));}function Up(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t));}function Si(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hb(t,e,n,i),e=e.sibling;}function Hb(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Si(t,e,n,i),r&2048&&Ll(9,e);break;case 1:Si(t,e,n,i);break;case 3:Si(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nl(t)));break;case 12:if(r&2048){Si(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,o=a.id,u=a.onPostCommit;typeof u=="function"&&u(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0);}catch(d){ot(e,e.return,d);}}else Si(t,e,n,i);break;case 31:Si(t,e,n,i);break;case 13:Si(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,o=e.alternate,e.memoizedState!==null?a._visibility&2?Si(t,e,n,i):ul(t,e):a._visibility&2?Si(t,e,n,i):(a._visibility|=2,Ss(t,e,n,i,(e.subtreeFlags&10256)!==0||false)),r&2048&&Bp(o,e);break;case 24:Si(t,e,n,i),r&2048&&Up(e.alternate,e);break;default:Si(t,e,n,i);}}function Ss(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||false),e=e.child;e!==null;){var a=t,o=e,u=n,d=i,g=o.flags;switch(o.tag){case 0:case 11:case 15:Ss(a,o,u,d,r),Ll(8,o);break;case 23:break;case 22:var y=o.stateNode;o.memoizedState!==null?y._visibility&2?Ss(a,o,u,d,r):ul(a,o):(y._visibility|=2,Ss(a,o,u,d,r)),r&&g&2048&&Bp(o.alternate,o);break;case 24:Ss(a,o,u,d,r),r&&g&2048&&Up(o.alternate,o);break;default:Ss(a,o,u,d,r);}e=e.sibling;}}function ul(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ul(n,i),r&2048&&Bp(i.alternate,i);break;case 24:ul(n,i),r&2048&&Up(i.alternate,i);break;default:ul(n,i);}e=e.sibling;}}var $o=8192;function _s(t,e,n){if(t.subtreeFlags&$o)for(t=t.child;t!==null;)Gb(t,e,n),t=t.sibling;}function Gb(t,e,n){switch(t.tag){case 26:_s(t,e,n),t.flags&$o&&t.memoizedState!==null&&DC(n,Ei,t.memoizedState,t.memoizedProps);break;case 5:_s(t,e,n);break;case 3:case 4:var i=Ei;Ei=ef(t.stateNode.containerInfo),_s(t,e,n),Ei=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=$o,$o=16777216,_s(t,e,n),$o=i):_s(t,e,n));break;default:_s(t,e,n);}}function zb(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Wo(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];un=i,Yb(i,t);}zb(t);}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jb(t),t=t.sibling;}function jb(t){switch(t.tag){case 0:case 11:case 15:Wo(t),t.flags&2048&&ia(9,t,t.return);break;case 3:Wo(t);break;case 12:Wo(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Mc(t)):Wo(t);break;default:Wo(t);}}function Mc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];un=i,Yb(i,t);}zb(t);}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ia(8,e,e.return),Mc(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Mc(e));break;default:Mc(e);}t=t.sibling;}}function Yb(t,e){for(;un!==null;){var n=un;switch(n.tag){case 0:case 11:case 15:ia(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++;}break;case 24:Nl(n.memoizedState.cache);}if(i=n.child,i!==null)i.return=n,un=i;else e:for(n=t;un!==null;){i=un;var r=i.sibling,a=i.return;if(Lb(i),i===n){un=null;break e}if(r!==null){r.return=a,un=r;break e}un=a;}}}var ZT={getCacheForType:function(t){var e=gn(Zt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return gn(Zt).controller.signal}},JT=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,Ge=null,je=0,st=0,zn=null,zr=false,ro=false,Fp=false,vr=0,Ft=0,ra=0,Da=0,Vp=0,Wn=0,Xs=0,cl=null,Dn=null,Fm=false,vf=0,Wb=0,qc=1/0,Qc=null,Kr=null,nn=0,Zr=null,Ks=null,dr=0,Vm=0,Hm=null,qb=null,fl=0,Gm=null;function Kn(){return (nt&2)!==0&&je!==0?je&-je:Te.T!==null?Gp():ny()}function Qb(){if(Wn===0)if((je&536870912)===0||qe){var t=$u;$u<<=1,($u&3932160)===0&&($u=262144),Wn=t;}else Wn=536870912;return t=Jn.current,t!==null&&(t.flags|=32),Wn}function Ln(t,e,n){(t===mt&&(st===2||st===9)||t.cancelPendingCommit!==null)&&(Zs(t,0),jr(t,je,Wn,false)),xl(t,n),((nt&2)===0||t!==mt)&&(t===mt&&((nt&2)===0&&(Da|=n),Ft===4&&jr(t,je,Wn,false)),Bi(t));}function Xb(t,e,n){if((nt&6)!==0)throw Error(Y(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||kl(t,e),r=i?tC(t,e):Jh(t,e,true),a=i;do{if(r===0){ro&&!i&&jr(t,e,0,false);break}else {if(n=t.current.alternate,a&&!$T(n)){r=Jh(t,e,false),a=false;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var u=t;r=cl;var d=u.current.memoizedState.isDehydrated;if(d&&(Zs(u,o).flags|=256),o=Jh(u,o,false),o!==2){if(Fp&&!d){u.errorRecoveryDisabledLanes|=a,Da|=a,r=4;break e}a=Dn,Dn=r,a!==null&&(Dn===null?Dn=a:Dn.push.apply(Dn,a));}r=o;}if(a=false,r!==2)continue}}if(r===1){Zs(t,0),jr(t,e,0,true);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(Y(345));case 4:if((e&4194048)!==e)break;case 6:jr(i,e,Wn,!zr);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(Y(329))}if((e&62914560)===e&&(r=vf+300-qn(),10<r)){if(jr(i,e,Wn,!zr),sf(i,0,true)!==0)break e;dr=e,i.timeoutHandle=p_(h0.bind(null,i,n,Dn,Qc,Fm,e,Wn,Da,Xs,zr,a,"Throttled",-0,0),r);break e}h0(i,n,Dn,Qc,Fm,e,Wn,Da,Xs,zr,a,null,-0,0);}}break}while(true);Bi(t);}function h0(t,e,n,i,r,a,o,u,d,g,y,A,p,_){if(t.timeoutHandle=-1,A=e.subtreeFlags,A&8192||(A&16785408)===16785408){A={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:true,waitingForViewTransition:false,unsuspend:lr},Gb(e,a,A);var C=(a&62914560)===a?vf-qn():(a&4194048)===a?Wb-qn():0;if(C=LC(A,C),C!==null){dr=a,t.cancelPendingCommit=C(p0.bind(null,t,e,a,n,i,r,o,u,d,y,A,null,p,_)),jr(t,a,o,!g);return}}p0(t,e,a,n,i,r,o,u,d);}function $T(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!Zn(a(),r))return !1}catch{return false}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else {if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return true;e=e.return;}e.sibling.return=e.return,e=e.sibling;}}return true}function jr(t,e,n,i){e&=~Vp,e&=~Da,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-Xn(r),o=1<<a;i[a]=-1,r&=~o;}n!==0&&$0(t,n,e);}function Af(){return (nt&6)===0?(Pl(0),false):true}function Hp(){if(Ge!==null){if(st===0)var t=Ge.return;else t=Ge,ur=ja=null,Tp(t),Vs=null,yl=0,t=Ge;for(;t!==null;)Rb(t.alternate,t),t=t.return;Ge=null;}}function Zs(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,vC(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),dr=0,Hp(),mt=t,Ge=n=cr(t.current,null),je=e,st=0,zn=null,zr=false,ro=kl(t,e),Fp=false,Xs=Wn=Vp=Da=ra=Ft=0,Dn=cl=null,Fm=false,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-Xn(i),a=1<<r;e|=t[r],i&=~a;}return vr=e,cf(),n}function Kb(t,e){Oe=null,Te.H=_l,e===io||e===df?(e=YA(),st=3):e===yp?(e=YA(),st=4):st=e===Lp?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,zn=e,Ge===null&&(Ft=1,jc(t,fi(e,t.current)));}function Zb(){var t=Jn.current;return t===null?true:(je&4194048)===je?hi===null:(je&62914560)===je||(je&536870912)!==0?t===hi:false}function Jb(){var t=Te.H;return Te.H=_l,t===null?_l:t}function $b(){var t=Te.A;return Te.A=ZT,t}function Xc(){Ft=4,zr||(je&4194048)!==je&&Jn.current!==null||(ro=true),(ra&134217727)===0&&(Da&134217727)===0||mt===null||jr(mt,je,Wn,false);}function Jh(t,e,n){var i=nt;nt|=2;var r=Jb(),a=$b();(mt!==t||je!==e)&&(Qc=null,Zs(t,e)),e=false;var o=Ft;e:do try{if(st!==0&&Ge!==null){var u=Ge,d=zn;switch(st){case 8:Hp(),o=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(e=!0);var g=st;if(st=0,zn=null,Ls(t,u,d,g),n&&ro){o=0;break e}break;default:g=st,st=0,zn=null,Ls(t,u,d,g);}}eC(),o=Ft;break}catch(y){Kb(t,y);}while(true);return e&&t.shellSuspendCounter++,ur=ja=null,nt=i,Te.H=r,Te.A=a,Ge===null&&(mt=null,je=0,cf()),o}function eC(){for(;Ge!==null;)e_(Ge);}function tC(t,e){var n=nt;nt|=2;var i=Jb(),r=$b();mt!==t||je!==e?(Qc=null,qc=qn()+500,Zs(t,e)):ro=kl(t,e);e:do try{if(st!==0&&Ge!==null){e=Ge;var a=zn;t:switch(st){case 1:st=0,zn=null,Ls(t,e,a,1);break;case 2:case 9:if(jA(a)){st=0,zn=null,m0(e);break}e=function(){st!==2&&st!==9||mt!==t||(st=7),Bi(t);},a.then(e,e);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:jA(a)?(st=0,zn=null,m0(e)):(st=0,zn=null,Ls(t,e,a,7));break;case 5:var o=null;switch(Ge.tag){case 26:o=Ge.memoizedState;case 5:case 27:var u=Ge;if(o?b_(o):u.stateNode.complete){st=0,zn=null;var d=u.sibling;if(d!==null)Ge=d;else {var g=u.return;g!==null?(Ge=g,yf(g)):Ge=null;}break t}}st=0,zn=null,Ls(t,e,a,5);break;case 6:st=0,zn=null,Ls(t,e,a,6);break;case 8:Hp(),Ft=6;break e;default:throw Error(Y(462))}}nC();break}catch(y){Kb(t,y);}while(true);return ur=ja=null,Te.H=i,Te.A=r,nt=n,Ge!==null?0:(mt=null,je=0,cf(),Ft)}function nC(){for(;Ge!==null&&!MM();)e_(Ge);}function e_(t){var e=Cb(t.alternate,t,vr);t.memoizedProps=t.pendingProps,e===null?yf(t):Ge=e;}function m0(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=o0(n,e,e.pendingProps,e.type,void 0,je);break;case 11:e=o0(n,e,e.pendingProps,e.type.render,e.ref,je);break;case 5:Tp(e);default:Rb(n,e),e=Ge=Ry(e,vr),e=Cb(n,e,vr);}t.memoizedProps=t.pendingProps,e===null?yf(t):Ge=e;}function Ls(t,e,n,i){ur=ja=null,Tp(e),Vs=null,yl=0;var r=e.return;try{if(jT(t,r,e,n,je)){Ft=1,jc(t,fi(n,t.current)),Ge=null;return}}catch(a){if(r!==null)throw Ge=r,a;Ft=1,jc(t,fi(n,t.current)),Ge=null;return}e.flags&32768?(qe||i===1?t=true:ro||(je&536870912)!==0?t=false:(zr=t=true,(i===2||i===9||i===3||i===6)&&(i=Jn.current,i!==null&&i.tag===13&&(i.flags|=16384))),t_(e,t)):yf(e);}function yf(t){var e=t;do{if((e.flags&32768)!==0){t_(e,zr);return}t=e.return;var n=qT(e.alternate,e,vr);if(n!==null){Ge=n;return}if(e=e.sibling,e!==null){Ge=e;return}Ge=e=t;}while(e!==null);Ft===0&&(Ft=5);}function t_(t,e){do{var n=QT(t.alternate,t);if(n!==null){n.flags&=32767,Ge=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ge=t;return}Ge=t=n;}while(t!==null);Ft=6,Ge=null;}function p0(t,e,n,i,r,a,o,u,d){t.cancelPendingCommit=null;do bf();while(nn!==0);if((nt&6)!==0)throw Error(Y(327));if(e!==null){if(e===t.current)throw Error(Y(177));if(a=e.lanes|e.childLanes,a|=dp,LM(t,n,a,o,u,d),t===mt&&(Ge=mt=null,je=0),Ks=e,Zr=t,dr=n,Vm=a,Hm=r,qb=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,sC(Nc,function(){return s_(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Te.T,Te.T=null,r=it.p,it.p=2,o=nt,nt|=4;try{XT(t,e,n);}finally{nt=o,it.p=r,Te.T=i;}}nn=1,n_(),i_(),r_();}}function n_(){if(nn===1){nn=0;var t=Zr,e=Ks,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Te.T,Te.T=null;var i=it.p;it.p=2;var r=nt;nt|=4;try{Fb(e,t);var a=Wm,o=by(t.containerInfo),u=a.focusedElem,d=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&yy(u.ownerDocument.documentElement,u)){if(d!==null&&fp(u)){var g=d.start,y=d.end;if(y===void 0&&(y=g),"selectionStart"in u)u.selectionStart=g,u.selectionEnd=Math.min(y,u.value.length);else {var A=u.ownerDocument||document,p=A&&A.defaultView||window;if(p.getSelection){var _=p.getSelection(),C=u.textContent.length,N=Math.min(d.start,C),B=d.end===void 0?N:Math.min(d.end,C);!_.extend&&N>B&&(o=B,B=N,N=o);var M=BA(u,N),w=BA(u,B);if(M&&w&&(_.rangeCount!==1||_.anchorNode!==M.node||_.anchorOffset!==M.offset||_.focusNode!==w.node||_.focusOffset!==w.offset)){var R=A.createRange();R.setStart(M.node,M.offset),_.removeAllRanges(),N>B?(_.addRange(R),_.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),_.addRange(R));}}}}for(A=[],_=u;_=_.parentNode;)_.nodeType===1&&A.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<A.length;u++){var D=A[u];D.element.scrollLeft=D.left,D.element.scrollTop=D.top;}}rf=!!Ym,Wm=Ym=null;}finally{nt=r,it.p=i,Te.T=n;}}t.current=e,nn=2;}}function i_(){if(nn===2){nn=0;var t=Zr,e=Ks,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Te.T,Te.T=null;var i=it.p;it.p=2;var r=nt;nt|=4;try{Db(t,e.alternate,e);}finally{nt=r,it.p=i,Te.T=n;}}nn=3;}}function r_(){if(nn===4||nn===3){nn=0,TM();var t=Zr,e=Ks,n=dr,i=qb;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?nn=5:(nn=0,Ks=Zr=null,a_(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Kr=null),rp(n),e=e.stateNode,Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Rl,e,void 0,(e.current.flags&128)===128);}catch{}if(i!==null){e=Te.T,r=it.p,it.p=2,Te.T=null;try{for(var a=t.onRecoverableError,o=0;o<i.length;o++){var u=i[o];a(u.value,{componentStack:u.stack});}}finally{Te.T=e,it.p=r;}}(dr&3)!==0&&bf(),Bi(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Gm?fl++:(fl=0,Gm=t):fl=0,Pl(0);}}function a_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Nl(e)));}function bf(){return n_(),i_(),r_(),s_()}function s_(){if(nn!==5)return false;var t=Zr,e=Vm;Vm=0;var n=rp(dr),i=Te.T,r=it.p;try{it.p=32>n?32:n,Te.T=null,n=Hm,Hm=null;var a=Zr,o=dr;if(nn=0,Ks=Zr=null,dr=0,(nt&6)!==0)throw Error(Y(331));var u=nt;if(nt|=4,jb(a.current),Hb(a,a.current,o,n),nt=u,Pl(0,!1),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Rl,a);}catch{}return !0}finally{it.p=r,Te.T=i,a_(t,e);}}function g0(t,e,n){e=fi(n,e),e=Lm(t.stateNode,e,2),t=Xr(t,e,2),t!==null&&(xl(t,2),Bi(t));}function ot(t,e,n){if(t.tag===3)g0(t,t,n);else for(;e!==null;){if(e.tag===3){g0(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kr===null||!Kr.has(i))){t=fi(n,t),n=_b(2),i=Xr(e,n,2),i!==null&&(Sb(n,i,e,t),xl(i,2),Bi(i));break}}e=e.return;}}function $h(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new JT;var r=new Set;i.set(e,r);}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Fp=true,r.add(n),t=iC.bind(null,t,e,n),e.then(t,t));}function iC(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,mt===t&&(je&n)===n&&(Ft===4||Ft===3&&(je&62914560)===je&&300>qn()-vf?(nt&2)===0&&Zs(t,0):Vp|=n,Xs===je&&(Xs=0)),Bi(t);}function o_(t,e){e===0&&(e=J0()),t=za(t,e),t!==null&&(xl(t,e),Bi(t));}function rC(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),o_(t,n);}function aC(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(Y(314))}i!==null&&i.delete(e),o_(t,n);}function sC(t,e){return np(t,e)}var Kc=null,Es=null,zm=false,Zc=false,em=false,Yr=0;function Bi(t){t!==Es&&t.next===null&&(Es===null?Kc=Es=t:Es=Es.next=t),Zc=true,zm||(zm=true,lC());}function Pl(t,e){if(!em&&Zc){em=true;do for(var n=false,i=Kc;i!==null;){if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else {var o=i.suspendedLanes,u=i.pingedLanes;a=(1<<31-Xn(42|t)+1)-1,a&=r&~(o&~u),a=a&201326741?a&201326741|1:a?a|2:0;}a!==0&&(n=true,v0(i,a));}else a=je,a=sf(i,i===mt?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||kl(i,a)||(n=true,v0(i,a));i=i.next;}while(n);em=false;}}function oC(){l_();}function l_(){Zc=zm=false;var t=0;Yr!==0&&gC()&&(t=Yr);for(var e=qn(),n=null,i=Kc;i!==null;){var r=i.next,a=u_(i,e);a===0?(i.next=null,n===null?Kc=r:n.next=r,r===null&&(Es=n)):(n=i,(t!==0||(a&3)!==0)&&(Zc=true)),i=r;}nn!==0&&nn!==5||Pl(t),Yr!==0&&(Yr=0);}function u_(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var o=31-Xn(a),u=1<<o,d=r[o];d===-1?((u&n)===0||(u&i)!==0)&&(r[o]=DM(u,e)):d<=e&&(t.expiredLanes|=u),a&=~u;}if(e=mt,n=je,n=sf(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(st===2||st===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&kh(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||kl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&kh(i),rp(n)){case 2:case 8:n=K0;break;case 32:n=Nc;break;case 268435456:n=Z0;break;default:n=Nc;}return i=c_.bind(null,t),n=np(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&kh(i),t.callbackPriority=2,t.callbackNode=null,2}function c_(t,e){if(nn!==0&&nn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(bf()&&t.callbackNode!==n)return null;var i=je;return i=sf(t,t===mt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Xb(t,i,e),u_(t,qn()),t.callbackNode!=null&&t.callbackNode===n?c_.bind(null,t):null)}function v0(t,e){if(bf())return null;Xb(t,e,true);}function lC(){AC(function(){(nt&6)!==0?np(X0,oC):l_();});}function Gp(){if(Yr===0){var t=Ws;t===0&&(t=Ju,Ju<<=1,(Ju&261888)===0&&(Ju=256)),Yr=t;}return Yr}function A0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:gc(""+t)}function y0(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function uC(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=A0((r[Pn]||null).action),o=i.submitter;o&&(e=(e=o[Pn]||null)?A0(e.formAction):o.getAttribute("formAction"),e!==null&&(a=e,o=null));var u=new of("action","action",null,i,r);t.push({event:u,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yr!==0){var d=o?y0(r,o):new FormData(r);Nm(n,{pending:true,data:d,method:r.method,action:a},null,d);}}else typeof a=="function"&&(u.preventDefault(),d=o?y0(r,o):new FormData(r),Nm(n,{pending:true,data:d,method:r.method,action:a},a,d));},currentTarget:r}]});}}for(cc=0;cc<_m.length;cc++)fc=_m[cc],b0=fc.toLowerCase(),_0=fc[0].toUpperCase()+fc.slice(1),wi(b0,"on"+_0);var fc,b0,_0,cc;wi(Sy,"onAnimationEnd");wi(Ey,"onAnimationIteration");wi(wy,"onAnimationStart");wi("dblclick","onDoubleClick");wi("focusin","onFocus");wi("focusout","onBlur");wi(CT,"onTransitionRun");wi(RT,"onTransitionStart");wi(kT,"onTransitionCancel");wi(My,"onTransitionEnd");js("onMouseEnter",["mouseout","mouseover"]);js("onMouseLeave",["mouseout","mouseover"]);js("onPointerEnter",["pointerout","pointerover"]);js("onPointerLeave",["pointerout","pointerover"]);Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Va("onBeforeInput",["compositionend","keypress","textInput","paste"]);Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function f_(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var o=i.length-1;0<=o;o--){var u=i[o],d=u.instance,g=u.currentTarget;if(u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(y){Lc(y);}r.currentTarget=null,a=d;}else for(o=0;o<i.length;o++){if(u=i[o],d=u.instance,g=u.currentTarget,u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(y){Lc(y);}r.currentTarget=null,a=d;}}}}function He(t,e){var n=e[hm];n===void 0&&(n=e[hm]=new Set);var i=t+"__bubble";n.has(i)||(d_(e,t,2,false),n.add(i));}function tm(t,e,n){var i=0;e&&(i|=4),d_(n,t,i,e);}var dc="_reactListening"+Math.random().toString(36).slice(2);function zp(t){if(!t[dc]){t[dc]=true,iy.forEach(function(n){n!=="selectionchange"&&(cC.has(n)||tm(n,false,t),tm(n,true,t));});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[dc]||(e[dc]=true,tm("selectionchange",false,e));}}function d_(t,e,n,i){switch(M_(e)){case 2:var r=UC;break;case 8:r=FC;break;default:r=qp;}n=r.bind(null,e,n,t),r=void 0,!Am||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=true),i?r!==void 0?t.addEventListener(e,n,{capture:true,passive:r}):t.addEventListener(e,n,true):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,false);}function nm(t,e,n,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var u=i.stateNode.containerInfo;if(u===r)break;if(o===4)for(o=i.return;o!==null;){var d=o.tag;if((d===3||d===4)&&o.stateNode.containerInfo===r)return;o=o.return;}for(;u!==null;){if(o=Ts(u),o===null)return;if(d=o.tag,d===5||d===6||d===26||d===27){i=a=o;continue e}u=u.parentNode;}}i=i.return;}fy(function(){var g=a,y=op(n),A=[];e:{var p=Ty.get(t);if(p!==void 0){var _=of,C=t;switch(t){case "keypress":if(Ac(n)===0)break e;case "keydown":case "keyup":_=aT;break;case "focusin":C="focus",_=Dh;break;case "focusout":C="blur",_=Dh;break;case "beforeblur":case "afterblur":_=Dh;break;case "click":if(n.button===2)break e;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":_=RA;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":_=qM;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":_=lT;break;case Sy:case Ey:case wy:_=KM;break;case My:_=cT;break;case "scroll":case "scrollend":_=YM;break;case "wheel":_=dT;break;case "copy":case "cut":case "paste":_=JM;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":_=xA;break;case "toggle":case "beforetoggle":_=mT;}var N=(e&4)!==0,B=!N&&(t==="scroll"||t==="scrollend"),M=N?p!==null?p+"Capture":null:p;N=[];for(var w=g,R;w!==null;){var D=w;if(R=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||R===null||M===null||(D=ml(w,M),D!=null&&N.push(El(w,D,R))),B)break;w=w.return;}0<N.length&&(p=new _(p,C,null,n,y),A.push({event:p,listeners:N}));}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",_=t==="mouseout"||t==="pointerout",p&&n!==vm&&(C=n.relatedTarget||n.fromElement)&&(Ts(C)||C[eo]))break e;if((_||p)&&(p=y.window===y?y:(p=y.ownerDocument)?p.defaultView||p.parentWindow:window,_?(C=n.relatedTarget||n.toElement,_=g,C=C?Ts(C):null,C!==null&&(B=Cl(C),N=C.tag,C!==B||N!==5&&N!==27&&N!==6)&&(C=null)):(_=null,C=g),_!==C)){if(N=RA,D="onMouseLeave",M="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(N=xA,D="onPointerLeave",M="onPointerEnter",w="pointer"),B=_==null?p:Zo(_),R=C==null?p:Zo(C),p=new N(D,w+"leave",_,n,y),p.target=B,p.relatedTarget=R,D=null,Ts(y)===g&&(N=new N(M,w+"enter",C,n,y),N.target=R,N.relatedTarget=B,D=N),B=D,_&&C)t:{for(N=fC,M=_,w=C,R=0,D=M;D;D=N(D))R++;D=0;for(var G=w;G;G=N(G))D++;for(;0<R-D;)M=N(M),R--;for(;0<D-R;)w=N(w),D--;for(;R--;){if(M===w||w!==null&&M===w.alternate){N=M;break t}M=N(M),w=N(w);}N=null;}else N=null;_!==null&&S0(A,p,_,N,!1),C!==null&&B!==null&&S0(A,B,C,N,!0);}}e:{if(p=g?Zo(g):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var ne=DA;else if(NA(p))if(vy)ne=wT;else {ne=ST;var U=_T;}else _=p.nodeName,!_||_.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&sp(g.elementType)&&(ne=DA):ne=ET;if(ne&&(ne=ne(t,g))){gy(A,ne,n,y);break e}U&&U(t,p,g),t==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&gm(p,"number",p.value);}switch(U=g?Zo(g):window,t){case "focusin":(NA(U)||U.contentEditable==="true")&&(ks=U,ym=g,nl=null);break;case "focusout":nl=ym=ks=null;break;case "mousedown":bm=!0;break;case "contextmenu":case "mouseup":case "dragend":bm=!1,UA(A,n,y);break;case "selectionchange":if(TT)break;case "keydown":case "keyup":UA(A,n,y);}var H;if(cp)e:{switch(t){case "compositionstart":var ee="onCompositionStart";break e;case "compositionend":ee="onCompositionEnd";break e;case "compositionupdate":ee="onCompositionUpdate";break e}ee=void 0;}else Rs?my(t,n)&&(ee="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(ee="onCompositionStart");ee&&(hy&&n.locale!=="ko"&&(Rs||ee!=="onCompositionStart"?ee==="onCompositionEnd"&&Rs&&(H=dy()):(Gr=y,lp="value"in Gr?Gr.value:Gr.textContent,Rs=!0)),U=Jc(g,ee),0<U.length&&(ee=new kA(ee,t,null,n,y),A.push({event:ee,listeners:U}),H?ee.data=H:(H=py(n),H!==null&&(ee.data=H)))),(H=gT?vT(t,n):AT(t,n))&&(ee=Jc(g,"onBeforeInput"),0<ee.length&&(U=new kA("onBeforeInput","beforeinput",null,n,y),A.push({event:U,listeners:ee}),U.data=H)),uC(A,t,g,n,y);}f_(A,e);});}function El(t,e,n){return {instance:t,listener:e,currentTarget:n}}function Jc(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=ml(t,n),r!=null&&i.unshift(El(t,r,a)),r=ml(t,e),r!=null&&i.push(El(t,r,a))),t.tag===3)return i;t=t.return;}return []}function fC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function S0(t,e,n,i,r){for(var a=e._reactName,o=[];n!==null&&n!==i;){var u=n,d=u.alternate,g=u.stateNode;if(u=u.tag,d!==null&&d===i)break;u!==5&&u!==26&&u!==27||g===null||(d=g,r?(g=ml(n,a),g!=null&&o.unshift(El(n,g,d))):r||(g=ml(n,a),g!=null&&o.push(El(n,g,d)))),n=n.return;}o.length!==0&&t.push({event:e,listeners:o});}var dC=/\r\n?/g,hC=/\u0000|\uFFFD/g;function E0(t){return (typeof t=="string"?t:""+t).replace(dC,`
9
+ `).replace(hC,"")}function h_(t,e){return e=E0(e),E0(t)===e}function ct(t,e,n,i,r,a){switch(n){case "children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Ys(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Ys(t,""+i);break;case "className":tc(t,"class",i);break;case "tabIndex":tc(t,"tabindex",i);break;case "dir":case "role":case "viewBox":case "width":case "height":tc(t,n,i);break;case "style":cy(t,i,a);break;case "data":if(e!=="object"){tc(t,"data",i);break}case "src":case "href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=gc(""+i),t.setAttribute(n,i);break;case "action":case "formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&ct(t,e,"name",r.name,r,null),ct(t,e,"formEncType",r.formEncType,r,null),ct(t,e,"formMethod",r.formMethod,r,null),ct(t,e,"formTarget",r.formTarget,r,null)):(ct(t,e,"encType",r.encType,r,null),ct(t,e,"method",r.method,r,null),ct(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=gc(""+i),t.setAttribute(n,i);break;case "onClick":i!=null&&(t.onclick=lr);break;case "onScroll":i!=null&&He("scroll",t);break;case "onScrollEnd":i!=null&&He("scrollend",t);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Y(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Y(60));t.innerHTML=n;}}break;case "multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case "muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "defaultValue":case "defaultChecked":case "innerHTML":case "ref":break;case "autoFocus":break;case "xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=gc(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case "contentEditable":case "spellCheck":case "draggable":case "value":case "autoReverse":case "externalResourcesRequired":case "focusable":case "preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case "inert":case "allowFullScreen":case "async":case "autoPlay":case "controls":case "default":case "defer":case "disabled":case "disablePictureInPicture":case "disableRemotePlayback":case "formNoValidate":case "hidden":case "loop":case "noModule":case "noValidate":case "open":case "playsInline":case "readOnly":case "required":case "reversed":case "scoped":case "seamless":case "itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case "capture":case "download":i===true?t.setAttribute(n,""):i!==false&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case "cols":case "rows":case "size":case "span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case "rowSpan":case "start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case "popover":He("beforetoggle",t),He("toggle",t),pc(t,"popover",i);break;case "xlinkActuate":er(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case "xlinkArcrole":er(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case "xlinkRole":er(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case "xlinkShow":er(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case "xlinkTitle":er(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case "xlinkType":er(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case "xmlBase":er(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case "xmlLang":er(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case "xmlSpace":er(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case "is":pc(t,"is",i);break;case "innerText":case "textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=zM.get(n)||n,pc(t,n,i));}}function jm(t,e,n,i,r,a){switch(n){case "style":cy(t,i,a);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Y(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Y(60));t.innerHTML=n;}}break;case "children":typeof i=="string"?Ys(t,i):(typeof i=="number"||typeof i=="bigint")&&Ys(t,""+i);break;case "onScroll":i!=null&&He("scroll",t);break;case "onScrollEnd":i!=null&&He("scrollend",t);break;case "onClick":i!=null&&(t.onclick=lr);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "innerHTML":case "ref":break;case "innerText":case "textContent":break;default:if(!ry.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Pn]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===true?t.setAttribute(n,""):pc(t,n,i);}}}function vn(t,e,n){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "img":He("error",t),He("load",t);var i=false,r=false,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case "src":i=true;break;case "srcSet":r=true;break;case "children":case "dangerouslySetInnerHTML":throw Error(Y(137,e));default:ct(t,e,a,o,n,null);}}r&&ct(t,e,"srcSet",n.srcSet,n,null),i&&ct(t,e,"src",n.src,n,null);return;case "input":He("invalid",t);var u=a=o=r=null,d=null,g=null;for(i in n)if(n.hasOwnProperty(i)){var y=n[i];if(y!=null)switch(i){case "name":r=y;break;case "type":o=y;break;case "checked":d=y;break;case "defaultChecked":g=y;break;case "value":a=y;break;case "defaultValue":u=y;break;case "children":case "dangerouslySetInnerHTML":if(y!=null)throw Error(Y(137,e));break;default:ct(t,e,i,y,n,null);}}oy(t,a,u,d,g,o,r,false);return;case "select":He("invalid",t),i=o=a=null;for(r in n)if(n.hasOwnProperty(r)&&(u=n[r],u!=null))switch(r){case "value":a=u;break;case "defaultValue":o=u;break;case "multiple":i=u;default:ct(t,e,r,u,n,null);}e=a,n=o,t.multiple=!!i,e!=null?Bs(t,!!i,e,false):n!=null&&Bs(t,!!i,n,true);return;case "textarea":He("invalid",t),a=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case "value":i=u;break;case "defaultValue":r=u;break;case "children":a=u;break;case "dangerouslySetInnerHTML":if(u!=null)throw Error(Y(91));break;default:ct(t,e,o,u,n,null);}uy(t,i,r,a);return;case "option":for(d in n)n.hasOwnProperty(d)&&(i=n[d],i!=null)&&(d==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":ct(t,e,d,i,n,null));return;case "dialog":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case "iframe":case "object":He("load",t);break;case "video":case "audio":for(i=0;i<Sl.length;i++)He(Sl[i],t);break;case "image":He("error",t),He("load",t);break;case "details":He("toggle",t);break;case "embed":case "source":case "link":He("error",t),He("load",t);case "area":case "base":case "br":case "col":case "hr":case "keygen":case "meta":case "param":case "track":case "wbr":case "menuitem":for(g in n)if(n.hasOwnProperty(g)&&(i=n[g],i!=null))switch(g){case "children":case "dangerouslySetInnerHTML":throw Error(Y(137,e));default:ct(t,e,g,i,n,null);}return;default:if(sp(e)){for(y in n)n.hasOwnProperty(y)&&(i=n[y],i!==void 0&&jm(t,e,y,i,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!=null&&ct(t,e,u,i,n,null));}function mC(t,e,n,i){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "input":var r=null,a=null,o=null,u=null,d=null,g=null,y=null;for(_ in n){var A=n[_];if(n.hasOwnProperty(_)&&A!=null)switch(_){case "checked":break;case "value":break;case "defaultValue":d=A;default:i.hasOwnProperty(_)||ct(t,e,_,null,i,A);}}for(var p in i){var _=i[p];if(A=n[p],i.hasOwnProperty(p)&&(_!=null||A!=null))switch(p){case "type":a=_;break;case "name":r=_;break;case "checked":g=_;break;case "defaultChecked":y=_;break;case "value":o=_;break;case "defaultValue":u=_;break;case "children":case "dangerouslySetInnerHTML":if(_!=null)throw Error(Y(137,e));break;default:_!==A&&ct(t,e,p,_,i,A);}}pm(t,o,u,d,g,y,a,r);return;case "select":_=o=u=p=null;for(a in n)if(d=n[a],n.hasOwnProperty(a)&&d!=null)switch(a){case "value":break;case "multiple":_=d;default:i.hasOwnProperty(a)||ct(t,e,a,null,i,d);}for(r in i)if(a=i[r],d=n[r],i.hasOwnProperty(r)&&(a!=null||d!=null))switch(r){case "value":p=a;break;case "defaultValue":u=a;break;case "multiple":o=a;default:a!==d&&ct(t,e,r,a,i,d);}e=u,n=o,i=_,p!=null?Bs(t,!!n,p,false):!!i!=!!n&&(e!=null?Bs(t,!!n,e,true):Bs(t,!!n,n?[]:"",false));return;case "textarea":_=p=null;for(u in n)if(r=n[u],n.hasOwnProperty(u)&&r!=null&&!i.hasOwnProperty(u))switch(u){case "value":break;case "children":break;default:ct(t,e,u,null,i,r);}for(o in i)if(r=i[o],a=n[o],i.hasOwnProperty(o)&&(r!=null||a!=null))switch(o){case "value":p=r;break;case "defaultValue":_=r;break;case "children":break;case "dangerouslySetInnerHTML":if(r!=null)throw Error(Y(91));break;default:r!==a&&ct(t,e,o,r,i,a);}ly(t,p,_);return;case "option":for(var C in n)p=n[C],n.hasOwnProperty(C)&&p!=null&&!i.hasOwnProperty(C)&&(C==="selected"?t.selected=false:ct(t,e,C,null,i,p));for(d in i)p=i[d],_=n[d],i.hasOwnProperty(d)&&p!==_&&(p!=null||_!=null)&&(d==="selected"?t.selected=p&&typeof p!="function"&&typeof p!="symbol":ct(t,e,d,p,i,_));return;case "img":case "link":case "area":case "base":case "br":case "col":case "embed":case "hr":case "keygen":case "meta":case "param":case "source":case "track":case "wbr":case "menuitem":for(var N in n)p=n[N],n.hasOwnProperty(N)&&p!=null&&!i.hasOwnProperty(N)&&ct(t,e,N,null,i,p);for(g in i)if(p=i[g],_=n[g],i.hasOwnProperty(g)&&p!==_&&(p!=null||_!=null))switch(g){case "children":case "dangerouslySetInnerHTML":if(p!=null)throw Error(Y(137,e));break;default:ct(t,e,g,p,i,_);}return;default:if(sp(e)){for(var B in n)p=n[B],n.hasOwnProperty(B)&&p!==void 0&&!i.hasOwnProperty(B)&&jm(t,e,B,void 0,i,p);for(y in i)p=i[y],_=n[y],!i.hasOwnProperty(y)||p===_||p===void 0&&_===void 0||jm(t,e,y,p,i,_);return}}for(var M in n)p=n[M],n.hasOwnProperty(M)&&p!=null&&!i.hasOwnProperty(M)&&ct(t,e,M,null,i,p);for(A in i)p=i[A],_=n[A],!i.hasOwnProperty(A)||p===_||p==null&&_==null||ct(t,e,A,p,i,_);}function w0(t){switch(t){case "css":case "script":case "font":case "img":case "image":case "input":case "link":return true;default:return false}}function pC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],a=r.transferSize,o=r.initiatorType,u=r.duration;if(a&&u&&w0(o)){for(o=0,u=r.responseEnd,i+=1;i<n.length;i++){var d=n[i],g=d.startTime;if(g>u)break;var y=d.transferSize,A=d.initiatorType;y&&w0(A)&&(d=d.responseEnd,o+=y*(d<u?1:(u-g)/(d-g)));}if(--i,e+=8*(a+o)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ym=null,Wm=null;function $c(t){return t.nodeType===9?t:t.ownerDocument}function M0(t){switch(t){case "http://www.w3.org/2000/svg":return 1;case "http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function m_(t,e){if(t===0)switch(e){case "svg":return 1;case "math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function qm(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var im=null;function gC(){var t=window.event;return t&&t.type==="popstate"?t===im?false:(im=t,true):(im=null,false)}var p_=typeof setTimeout=="function"?setTimeout:void 0,vC=typeof clearTimeout=="function"?clearTimeout:void 0,T0=typeof Promise=="function"?Promise:void 0,AC=typeof queueMicrotask=="function"?queueMicrotask:typeof T0<"u"?function(t){return T0.resolve(null).then(t).catch(yC)}:p_;function yC(t){setTimeout(function(){throw t});}function sa(t){return t==="head"}function C0(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),$s(e);return}i--;}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")dl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,dl(n);for(var a=n.firstChild;a;){var o=a.nextSibling,u=a.nodeName;a[Ol]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=o;}}else n==="body"&&dl(t.ownerDocument.body);n=r;}while(n);$s(e);}function R0(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--;}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i;}while(n)}function Qm(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case "HTML":case "HEAD":case "BODY":Qm(n),ap(n);continue;case "SCRIPT":case "STYLE":continue;case "LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n);}}function bC(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Ol])switch(e){case "meta":if(!t.hasAttribute("itemprop"))break;return t;case "link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case "style":if(t.hasAttribute("data-precedence"))break;return t;case "script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=mi(t.nextSibling),t===null)break}return null}function _C(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=mi(t.nextSibling),t===null))return null;return t}function g_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=mi(t.nextSibling),t===null))return null;return t}function Xm(t){return t.data==="$?"||t.data==="$~"}function Km(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function SC(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else {var i=function(){e(),n.removeEventListener("DOMContentLoaded",i);};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i;}}function mi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Zm=null;function k0(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return mi(t.nextSibling);e--;}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++;}t=t.nextSibling;}return null}function x0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--;}else n!=="/$"&&n!=="/&"||e++;}t=t.previousSibling;}return null}function v_(t,e,n){switch(e=$c(n),t){case "html":if(t=e.documentElement,!t)throw Error(Y(452));return t;case "head":if(t=e.head,!t)throw Error(Y(453));return t;case "body":if(t=e.body,!t)throw Error(Y(454));return t;default:throw Error(Y(451))}}function dl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);ap(t);}var pi=new Map,O0=new Set;function ef(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=it.d;it.d={f:EC,r:wC,D:MC,C:TC,L:CC,m:RC,X:xC,S:kC,M:OC};function EC(){var t=Ar.f(),e=Af();return t||e}function wC(t){var e=to(t);e!==null&&e.tag===5&&e.type==="form"?cb(e):Ar.r(t);}var ao=typeof document>"u"?null:document;function A_(t,e,n){var i=ao;if(i&&typeof e=="string"&&e){var r=ci(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),O0.has(r)||(O0.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),vn(e,"link",t),cn(e),i.head.appendChild(e)));}}function MC(t){Ar.D(t),A_("dns-prefetch",t,null);}function TC(t,e){Ar.C(t,e),A_("preconnect",t,e);}function CC(t,e,n){Ar.L(t,e,n);var i=ao;if(i&&t&&e){var r='link[rel="preload"][as="'+ci(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ci(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+ci(n.imageSizes)+'"]')):r+='[href="'+ci(t)+'"]';var a=r;switch(e){case "style":a=Js(t);break;case "script":a=so(t);}pi.has(a)||(t=St({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),pi.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Bl(a))||e==="script"&&i.querySelector(Ul(a))||(e=i.createElement("link"),vn(e,"link",t),cn(e),i.head.appendChild(e)));}}function RC(t,e){Ar.m(t,e);var n=ao;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+ci(i)+'"][href="'+ci(t)+'"]',a=r;switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":a=so(t);}if(!pi.has(a)&&(t=St({rel:"modulepreload",href:t},e),pi.set(a,t),n.querySelector(r)===null)){switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":if(n.querySelector(Ul(a)))return}i=n.createElement("link"),vn(i,"link",t),cn(i),n.head.appendChild(i);}}}function kC(t,e,n){Ar.S(t,e,n);var i=ao;if(i&&t){var r=Ps(i).hoistableStyles,a=Js(t);e=e||"default";var o=r.get(a);if(!o){var u={loading:0,preload:null};if(o=i.querySelector(Bl(a)))u.loading=5;else {t=St({rel:"stylesheet",href:t,"data-precedence":e},n),(n=pi.get(a))&&jp(t,n);var d=o=i.createElement("link");cn(d),vn(d,"link",t),d._p=new Promise(function(g,y){d.onload=g,d.onerror=y;}),d.addEventListener("load",function(){u.loading|=1;}),d.addEventListener("error",function(){u.loading|=2;}),u.loading|=4,Tc(o,e,i);}o={type:"stylesheet",instance:o,count:1,state:u},r.set(a,o);}}}function xC(t,e){Ar.X(t,e);var n=ao;if(n&&t){var i=Ps(n).hoistableScripts,r=so(t),a=i.get(r);a||(a=n.querySelector(Ul(r)),a||(t=St({src:t,async:true},e),(e=pi.get(r))&&Yp(t,e),a=n.createElement("script"),cn(a),vn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function OC(t,e){Ar.M(t,e);var n=ao;if(n&&t){var i=Ps(n).hoistableScripts,r=so(t),a=i.get(r);a||(a=n.querySelector(Ul(r)),a||(t=St({src:t,async:true,type:"module"},e),(e=pi.get(r))&&Yp(t,e),a=n.createElement("script"),cn(a),vn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function I0(t,e,n,i){var r=(r=Wr.current)?ef(r):null;if(!r)throw Error(Y(446));switch(t){case "meta":case "title":return null;case "style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Js(n.href),n=Ps(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case "link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Js(n.href);var a=Ps(r).hoistableStyles,o=a.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,o),(a=r.querySelector(Bl(t)))&&!a._p&&(o.instance=a,o.state.loading=5),pi.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pi.set(t,n),a||IC(r,t,n,o.state))),e&&i===null)throw Error(Y(528,""));return o}if(e&&i!==null)throw Error(Y(529,""));return null;case "script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=so(n),n=Ps(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Y(444,t))}}function Js(t){return 'href="'+ci(t)+'"'}function Bl(t){return 'link[rel="stylesheet"]['+t+"]"}function y_(t){return St({},t,{"data-precedence":t.precedence,precedence:null})}function IC(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),vn(e,"link",n),cn(e),t.head.appendChild(e));}function so(t){return '[src="'+ci(t)+'"]'}function Ul(t){return "script[async]"+t}function N0(t,e,n){if(e.count++,e.instance===null)switch(e.type){case "style":var i=t.querySelector('style[data-href~="'+ci(n.href)+'"]');if(i)return e.instance=i,cn(i),i;var r=St({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),cn(i),vn(i,"style",r),Tc(i,n.precedence,t),e.instance=i;case "stylesheet":r=Js(n.href);var a=t.querySelector(Bl(r));if(a)return e.state.loading|=4,e.instance=a,cn(a),a;i=y_(n),(r=pi.get(r))&&jp(i,r),a=(t.ownerDocument||t).createElement("link"),cn(a);var o=a;return o._p=new Promise(function(u,d){o.onload=u,o.onerror=d;}),vn(a,"link",i),e.state.loading|=4,Tc(a,n.precedence,t),e.instance=a;case "script":return a=so(n.src),(r=t.querySelector(Ul(a)))?(e.instance=r,cn(r),r):(i=n,(r=pi.get(a))&&(i=St({},n),Yp(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),cn(r),vn(r,"link",i),t.head.appendChild(r),e.instance=r);case "void":return null;default:throw Error(Y(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Tc(i,n.precedence,t));return e.instance}function Tc(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var u=i[o];if(u.dataset.precedence===e)a=u;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild));}function jp(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title);}function Yp(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity);}var Cc=null;function D0(t,e,n){if(Cc===null){var i=new Map,r=Cc=new Map;r.set(n,i);}else r=Cc,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[Ol]||a[mn]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(e)||"";o=t+o;var u=i.get(o);u?u.push(a):i.set(o,[a]);}}return i}function L0(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null);}function NC(t,e,n){if(n===1||e.itemProp!=null)return false;switch(t){case "meta":case "title":return true;case "style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return true;case "link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):true;case "script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return true}return false}function b_(t){return !(t.type==="stylesheet"&&(t.state.loading&3)===0)}function DC(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==false)&&(n.state.loading&4)===0){if(n.instance===null){var r=Js(i.href),a=e.querySelector(Bl(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=tf.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=a,cn(a);return}a=e.ownerDocument||e,i=y_(i),(r=pi.get(r))&&jp(i,r),a=a.createElement("link"),cn(a);var o=a;o._p=new Promise(function(u,d){o.onload=u,o.onerror=d;}),vn(a,"link",i),n.instance=a;}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=tf.bind(t),e.addEventListener("load",n),e.addEventListener("error",n));}}var rm=0;function LC(t,e){return t.stylesheets&&t.count===0&&Rc(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Rc(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a();}},6e4+e);0<t.imgBytes&&rm===0&&(rm=62500*pC());var r=setTimeout(function(){if(t.waitingForImages=false,t.count===0&&(t.stylesheets&&Rc(t,t.stylesheets),t.unsuspend)){var a=t.unsuspend;t.unsuspend=null,a();}},(t.imgBytes>rm?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r);}}:null}function tf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t();}}}var nf=null;function Rc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nf=new Map,e.forEach(PC,t),nf=null,tf.call(t));}function PC(t,e){if(!(e.state.loading&4)){var n=nf.get(t);if(n)var i=n.get(null);else {n=new Map,nf.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o);}i&&n.set(null,i);}r=e.instance,o=r.getAttribute("data-precedence"),a=n.get(o)||i,a===i&&n.set(null,r),n.set(o,r),this.count++,i=tf.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4;}}var wl={$$typeof:or,Provider:null,Consumer:null,_currentValue:xa,_currentValue2:xa,_threadCount:0};function BC(t,e,n,i,r,a,o,u,d){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xh(0),this.hiddenUpdates=xh(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=d,this.incompleteTransitions=new Map;}function __(t,e,n,i,r,a,o,u,d,g,y,A){return t=new BC(t,e,n,o,d,g,y,A,u),e=1,a===true&&(e|=24),a=Yn(3,null,null,e),t.current=a,a.stateNode=t,e=vp(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},bp(a),t}function S_(t){return t?(t=Is,t):Is}function E_(t,e,n,i,r,a){r=S_(r),i.context===null?i.context=r:i.pendingContext=r,i=Qr(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=Xr(t,i,e),n!==null&&(Ln(n,t,e),rl(n,t,e));}function P0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e;}}function Wp(t,e){P0(t,e),(t=t.alternate)&&P0(t,e);}function w_(t){if(t.tag===13||t.tag===31){var e=za(t,67108864);e!==null&&Ln(e,t,67108864),Wp(t,67108864);}}function B0(t){if(t.tag===13||t.tag===31){var e=Kn();e=ip(e);var n=za(t,e);n!==null&&Ln(n,t,e),Wp(t,e);}}var rf=true;function UC(t,e,n,i){var r=Te.T;Te.T=null;var a=it.p;try{it.p=2,qp(t,e,n,i);}finally{it.p=a,Te.T=r;}}function FC(t,e,n,i){var r=Te.T;Te.T=null;var a=it.p;try{it.p=8,qp(t,e,n,i);}finally{it.p=a,Te.T=r;}}function qp(t,e,n,i){if(rf){var r=Jm(i);if(r===null)nm(t,e,i,af,n),U0(t,i);else if(HC(r,t,e,n,i))i.stopPropagation();else if(U0(t,i),e&4&&-1<VC.indexOf(t)){for(;r!==null;){var a=to(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ca(a.pendingLanes);if(o!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var d=1<<31-Xn(o);u.entanglements[1]|=d,o&=~d;}Bi(a),(nt&6)===0&&(qc=qn()+500,Pl(0));}}break;case 31:case 13:u=za(a,2),u!==null&&Ln(u,a,2),Af(),Wp(a,2);}if(a=Jm(i),a===null&&nm(t,e,i,af,n),a===r)break;r=a;}r!==null&&i.stopPropagation();}else nm(t,e,i,null,n);}}function Jm(t){return t=op(t),Qp(t)}var af=null;function Qp(t){if(af=null,t=Ts(t),t!==null){var e=Cl(t);if(e===null)t=null;else {var n=e.tag;if(n===13){if(t=j0(e),t!==null)return t;t=null;}else if(n===31){if(t=Y0(e),t!==null)return t;t=null;}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null;}else e!==t&&(t=null);}}return af=t,null}function M_(t){switch(t){case "beforetoggle":case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "toggle":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 2;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 8;case "message":switch(CM()){case X0:return 2;case K0:return 8;case Nc:case RM:return 32;case Z0:return 268435456;default:return 32}default:return 32}}var $m=false,Jr=null,$r=null,ea=null,Ml=new Map,Tl=new Map,Vr=[],VC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function U0(t,e){switch(t){case "focusin":case "focusout":Jr=null;break;case "dragenter":case "dragleave":$r=null;break;case "mouseover":case "mouseout":ea=null;break;case "pointerover":case "pointerout":Ml.delete(e.pointerId);break;case "gotpointercapture":case "lostpointercapture":Tl.delete(e.pointerId);}}function qo(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=to(e),e!==null&&w_(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function HC(t,e,n,i,r){switch(e){case "focusin":return Jr=qo(Jr,t,e,n,i,r),true;case "dragenter":return $r=qo($r,t,e,n,i,r),true;case "mouseover":return ea=qo(ea,t,e,n,i,r),true;case "pointerover":var a=r.pointerId;return Ml.set(a,qo(Ml.get(a)||null,t,e,n,i,r)),true;case "gotpointercapture":return a=r.pointerId,Tl.set(a,qo(Tl.get(a)||null,t,e,n,i,r)),true}return false}function T_(t){var e=Ts(t.target);if(e!==null){var n=Cl(e);if(n!==null){if(e=n.tag,e===13){if(e=j0(n),e!==null){t.blockedOn=e,_A(t.priority,function(){B0(n);});return}}else if(e===31){if(e=Y0(n),e!==null){t.blockedOn=e,_A(t.priority,function(){B0(n);});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null;}function kc(t){if(t.blockedOn!==null)return false;for(var e=t.targetContainers;0<e.length;){var n=Jm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);vm=i,n.target.dispatchEvent(i),vm=null;}else return e=to(n),e!==null&&w_(e),t.blockedOn=n,false;e.shift();}return true}function F0(t,e,n){kc(t)&&n.delete(e);}function GC(){$m=false,Jr!==null&&kc(Jr)&&(Jr=null),$r!==null&&kc($r)&&($r=null),ea!==null&&kc(ea)&&(ea=null),Ml.forEach(F0),Tl.forEach(F0);}function hc(t,e){t.blockedOn===e&&(t.blockedOn=null,$m||($m=true,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,GC)));}var mc=null;function V0(t){mc!==t&&(mc=t,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,function(){mc===t&&(mc=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(Qp(i||n)===null)continue;break}var a=to(n);a!==null&&(t.splice(e,3),e-=3,Nm(a,{pending:true,data:r,method:n.method,action:i},i,r));}}));}function $s(t){function e(d){return hc(d,t)}Jr!==null&&hc(Jr,t),$r!==null&&hc($r,t),ea!==null&&hc(ea,t),Ml.forEach(e),Tl.forEach(e);for(var n=0;n<Vr.length;n++){var i=Vr[n];i.blockedOn===t&&(i.blockedOn=null);}for(;0<Vr.length&&(n=Vr[0],n.blockedOn===null);)T_(n),n.blockedOn===null&&Vr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],o=r[Pn]||null;if(typeof a=="function")o||V0(n);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Pn]||null)u=o.formAction;else if(Qp(r)!==null)continue}else u=o.action;typeof u=="function"?n[i+1]=u:(n.splice(i,3),i-=3),V0(n);}}}function C_(){function t(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"});}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20);}function n(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"});}}if(typeof navigation=="object"){var i=false,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=true,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null);}}}function Xp(t){this._internalRoot=t;}_f.prototype.render=Xp.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Y(409));var n=e.current,i=Kn();E_(n,i,t,e,null,null);};_f.prototype.unmount=Xp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;E_(t.current,2,null,t,null,null),Af(),e[eo]=null;}};function _f(t){this._internalRoot=t;}_f.prototype.unstable_scheduleHydration=function(t){if(t){var e=ny();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Vr.length&&e!==0&&e<Vr[n].priority;n++);Vr.splice(n,0,t),n===0&&T_(t);}};var H0=G0.version;if(H0!=="19.2.6")throw Error(Y(527,H0,"19.2.6"));it.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Y(188)):(t=Object.keys(t).join(","),Error(Y(268,t)));return t=bM(e),t=t!==null?W0(t):null,t=t===null?null:t.stateNode,t};var zC={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qo=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qo.isDisabled&&Qo.supportsFiber))try{Rl=Qo.inject(zC),Qn=Qo;}catch{}var Qo;Sf.createRoot=function(t,e){if(!z0(t))throw Error(Y(299));var n=false,i="",r=Ab,a=yb,o=bb;return e!=null&&(e.unstable_strictMode===true&&(n=true),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=__(t,1,false,null,null,n,i,null,r,a,o,C_),t[eo]=e.current,zp(t),new Xp(e)};Sf.hydrateRoot=function(t,e,n){if(!z0(t))throw Error(Y(299));var i=false,r="",a=Ab,o=yb,u=bb,d=null;return n!=null&&(n.unstable_strictMode===true&&(i=true),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(d=n.formState)),e=__(t,1,true,e,n??null,i,r,d,a,o,u,C_),e.context=S_(null),n=e.current,i=Kn(),i=ip(i),r=Qr(i),r.callback=null,Xr(n,r,i),n=i,e.current.lanes=n,xl(e,n),Bi(e),t[eo]=e.current,zp(t),new _f(e)};Sf.version="19.2.6";});var O_=ri((vN,x_)=>{function k_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k_);}catch(t){console.error(t);}}k_(),x_.exports=R_();});var b1={};Hv(b1,{VAD_WORKER_SOURCE:()=>ck});var ck,_1=Vv(()=>{ck='"use strict";(()=>{var Ft=Object.defineProperty;var Et=(t,s)=>()=>(t&&(s=t(t=0)),s);var gt=(t,s)=>{for(var n in s)Ft(t,n,{get:s[n],enumerable:!0})};var St={};gt(St,{cmvn:()=>Yt,graph:()=>$t});var $t,Yt,Tt=Et(()=>{"use strict";$t={inputs:["feat","caches_in"],outputs:["probs","caches_out"],cache_shape:[8,1,128,19],nodes:[{op:"Gather",inputs:["caches_in","/Constant_output_0"],outputs:["/Gather_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_1_output_0"],outputs:["/Gather_1_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_2_output_0"],outputs:["/Gather_2_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_3_output_0"],outputs:["/Gather_3_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_4_output_0"],outputs:["/Gather_4_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_5_output_0"],outputs:["/Gather_5_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_6_output_0"],outputs:["/Gather_6_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_7_output_0"],outputs:["/Gather_7_output_0"],attrs:{axis:0}},{op:"MatMul",inputs:["feat","onnx::MatMul_403"],outputs:["/model/dfsmn/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc1.0.bias","/model/dfsmn/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0","onnx::MatMul_404"],outputs:["/model/dfsmn/fc2/fc2.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc2.0.bias","/model/dfsmn/fc2/fc2.0/MatMul_output_0"],outputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],outputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_output_0","/model/dfsmn/fsmn1/Transpose_output_0"],outputs:["/model/dfsmn/fsmn1/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmn1/Concat_output_0","model.dfsmn.fsmn1.lookback_filter.weight"],outputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmn1/Transpose_output_0","/model/dfsmn/fsmn1/Slice_2_output_0"],outputs:["/model/dfsmn/fsmn1/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmn1/Add_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"MatMul",inputs:["/model/dfsmn/fsmn1/Transpose_1_output_0","onnx::MatMul_417"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.0.fc1.0.bias","/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0","onnx::MatMul_418"],outputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_1_output_0","/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","model.dfsmn.fsmns.0.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0","/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0","/model/dfsmn/fsmn1/Transpose_1_output_0"],outputs:["/model/dfsmn/fsmns.0/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/Add_output_0","onnx::MatMul_431"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.1.fc1.0.bias","/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0","onnx::MatMul_432"],outputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_2_output_0","/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","model.dfsmn.fsmns.1.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0","/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/Add_output_0","onnx::MatMul_445"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.2.fc1.0.bias","/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0","onnx::MatMul_446"],outputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_3_output_0","/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","model.dfsmn.fsmns.2.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0","/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.1/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/Add_output_0","onnx::MatMul_459"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.3.fc1.0.bias","/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0","onnx::MatMul_460"],outputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_4_output_0","/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","model.dfsmn.fsmns.3.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0","/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.2/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/Add_output_0","onnx::MatMul_473"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.4.fc1.0.bias","/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0","onnx::MatMul_474"],outputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_5_output_0","/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","model.dfsmn.fsmns.4.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0","/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.3/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/Add_output_0","onnx::MatMul_487"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.5.fc1.0.bias","/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0","onnx::MatMul_488"],outputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_6_output_0","/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","model.dfsmn.fsmns.5.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0","/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.4/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/Add_output_0","onnx::MatMul_501"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.6.fc1.0.bias","/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0","onnx::MatMul_502"],outputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_7_output_0","/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","model.dfsmn.fsmns.6.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0","/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.5/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/Add_output_0","onnx::MatMul_515"],outputs:["/model/dfsmn/dnns/dnns.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.dnns.0.bias","/model/dfsmn/dnns/dnns.0/MatMul_output_0"],outputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],outputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0","onnx::MatMul_516"],outputs:["/model/out/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.out.bias","/model/out/MatMul_output_0"],outputs:["/model/out/Add_output_0"],attrs:{}},{op:"Sigmoid",inputs:["/model/out/Add_output_0"],outputs:["probs"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmn1/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_1_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_2_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_3_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_4_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_5_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_6_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_7_output_0"],attrs:{}},{op:"Concat",inputs:["/Unsqueeze_output_0","/Unsqueeze_1_output_0","/Unsqueeze_2_output_0","/Unsqueeze_3_output_0","/Unsqueeze_4_output_0","/Unsqueeze_5_output_0","/Unsqueeze_6_output_0","/Unsqueeze_7_output_0"],outputs:["caches_out"],attrs:{axis:0}}],weights:{"model.dfsmn.fc1.0.bias":{dtype:"fp32",shape:[256],off:0},"model.dfsmn.fc2.0.bias":{dtype:"fp32",shape:[128],off:1024},"model.dfsmn.fsmn1.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:1536,scale_off:4096,scale_shape:[1,1,20]},"model.dfsmn.fsmns.0.fc1.0.bias":{dtype:"fp32",shape:[256],off:4176},"model.dfsmn.fsmns.0.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:5200,scale_off:7760,scale_shape:[1,1,20]},"model.dfsmn.fsmns.1.fc1.0.bias":{dtype:"fp32",shape:[256],off:7840},"model.dfsmn.fsmns.1.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:8864,scale_off:11424,scale_shape:[1,1,20]},"model.dfsmn.fsmns.2.fc1.0.bias":{dtype:"fp32",shape:[256],off:11504},"model.dfsmn.fsmns.2.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:12528,scale_off:15088,scale_shape:[1,1,20]},"model.dfsmn.fsmns.3.fc1.0.bias":{dtype:"fp32",shape:[256],off:15168},"model.dfsmn.fsmns.3.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:16192,scale_off:18752,scale_shape:[1,1,20]},"model.dfsmn.fsmns.4.fc1.0.bias":{dtype:"fp32",shape:[256],off:18832},"model.dfsmn.fsmns.4.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:19856,scale_off:22416,scale_shape:[1,1,20]},"model.dfsmn.fsmns.5.fc1.0.bias":{dtype:"fp32",shape:[256],off:22496},"model.dfsmn.fsmns.5.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:23520,scale_off:26080,scale_shape:[1,1,20]},"model.dfsmn.fsmns.6.fc1.0.bias":{dtype:"fp32",shape:[256],off:26160},"model.dfsmn.fsmns.6.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:27184,scale_off:29744,scale_shape:[1,1,20]},"model.dfsmn.dnns.0.bias":{dtype:"fp32",shape:[256],off:29824},"model.out.bias":{dtype:"fp32",shape:[1],off:30848},"onnx::MatMul_403":{dtype:"int8_pc",shape:[80,256],off:30852,scale_off:51332,scale_shape:[1,256]},"onnx::MatMul_404":{dtype:"int8_pc",shape:[256,128],off:52356,scale_off:85124,scale_shape:[1,128]},"onnx::MatMul_417":{dtype:"int8_pc",shape:[128,256],off:85636,scale_off:118404,scale_shape:[1,256]},"onnx::MatMul_418":{dtype:"int8_pc",shape:[256,128],off:119428,scale_off:152196,scale_shape:[1,128]},"onnx::MatMul_431":{dtype:"int8_pc",shape:[128,256],off:152708,scale_off:185476,scale_shape:[1,256]},"onnx::MatMul_432":{dtype:"int8_pc",shape:[256,128],off:186500,scale_off:219268,scale_shape:[1,128]},"onnx::MatMul_445":{dtype:"int8_pc",shape:[128,256],off:219780,scale_off:252548,scale_shape:[1,256]},"onnx::MatMul_446":{dtype:"int8_pc",shape:[256,128],off:253572,scale_off:286340,scale_shape:[1,128]},"onnx::MatMul_459":{dtype:"int8_pc",shape:[128,256],off:286852,scale_off:319620,scale_shape:[1,256]},"onnx::MatMul_460":{dtype:"int8_pc",shape:[256,128],off:320644,scale_off:353412,scale_shape:[1,128]},"onnx::MatMul_473":{dtype:"int8_pc",shape:[128,256],off:353924,scale_off:386692,scale_shape:[1,256]},"onnx::MatMul_474":{dtype:"int8_pc",shape:[256,128],off:387716,scale_off:420484,scale_shape:[1,128]},"onnx::MatMul_487":{dtype:"int8_pc",shape:[128,256],off:420996,scale_off:453764,scale_shape:[1,256]},"onnx::MatMul_488":{dtype:"int8_pc",shape:[256,128],off:454788,scale_off:487556,scale_shape:[1,128]},"onnx::MatMul_501":{dtype:"int8_pc",shape:[128,256],off:488068,scale_off:520836,scale_shape:[1,256]},"onnx::MatMul_502":{dtype:"int8_pc",shape:[256,128],off:521860,scale_off:554628,scale_shape:[1,128]},"onnx::MatMul_515":{dtype:"int8_pc",shape:[128,256],off:555140,scale_off:587908,scale_shape:[1,256]},"onnx::MatMul_516":{dtype:"fp32",shape:[256,1],off:588932},"/Constant_output_0":{dtype:"int32",shape:[],off:589956},"/Constant_1_output_0":{dtype:"int32",shape:[],off:589960},"/Constant_2_output_0":{dtype:"int32",shape:[],off:589964},"/Constant_3_output_0":{dtype:"int32",shape:[],off:589968},"/Constant_4_output_0":{dtype:"int32",shape:[],off:589972},"/Constant_5_output_0":{dtype:"int32",shape:[],off:589976},"/Constant_6_output_0":{dtype:"int32",shape:[],off:589980},"/Constant_7_output_0":{dtype:"int32",shape:[],off:589984},"/model/dfsmn/fsmn1/Constant_output_0":{dtype:"int32",shape:[1],off:589988},"/model/dfsmn/fsmn1/Constant_1_output_0":{dtype:"int32",shape:[1],off:589992},"/model/dfsmn/fsmn1/Constant_2_output_0":{dtype:"int32",shape:[1],off:589996},"/model/dfsmn/fsmn1/Constant_3_output_0":{dtype:"int32",shape:[1],off:59e4},"/model/dfsmn/fsmn1/Constant_5_output_0":{dtype:"int32",shape:[1],off:590004},"/model/dfsmn/fsmn1/Constant_9_output_0":{dtype:"int32",shape:[1],off:590008}}},Yt={means:[10.42295174919564,10.862097411631494,11.764544378124809,12.490164701573908,13.25983008289003,13.89594383242307,14.364940238918987,14.593948347480778,14.749723601612253,14.668315348346496,14.730796723156509,14.775052459167833,14.9890519821556,15.178004932637085,15.253520314586988,15.328637048782031,15.334018588850057,15.288641702136166,15.4276616890477,15.246266155846598,15.092573799088989,15.290421940704482,15.07575008669762,15.186772872540853,15.088673242416798,15.170797396442111,15.070178088017926,15.150795340269006,15.108532832116397,15.115345080167454,15.141279987705998,15.131832359605129,15.145195868641611,15.19151892676777,15.235478667211774,15.306369752614641,15.373021476906201,15.416394625766584,15.459857436373436,15.39143273165164,15.46357624247469,15.399661212735632,15.462907917820873,15.441629120393843,15.484969525295984,15.552401775001249,15.638091925650645,15.705489346158819,15.767008852632651,15.855123781367105,15.867269782501769,15.891537408746947,15.9231448295521,15.978382613315533,16.014801667676718,16.048674939996204,16.082029914992358,16.09680075379873,16.093736693349236,16.07247919506059,16.075509664672943,16.02227087563821,15.976762101902347,15.89786454765505,15.812741644368487,15.711205109067762,15.604198886052728,15.553519438005933,15.51025275187747,15.460023817226517,15.4156843628003,15.37602764551613,15.328348980305998,15.295370796331634,15.185470194591382,15.017044975516262,14.905080029850632,14.623806569017782,14.138093813776406,13.313870348004635],inv_std:[.2494980879825924,.23563235243542163,.23145152525802104,.2332233926481505,.23182660283718737,.22853356937894798,.2243486976577694,.21898920450844725,.21832438092730974,.22082592767700662,.2229673556813116,.22288416257259386,.22234810686081127,.22100642502031184,.21994202276343874,.22005444019015313,.22070092118977014,.22150809748461409,.22236667273698002,.22305291750035372,.22335341587062665,.22438905727453648,.22547701626910854,.2269007560258811,.22823023223045188,.22931472070164832,.23046728075908798,.23083553439603108,.23143382733873202,.2322065940520882,.2325798897870885,.2336197007969686,.23437240620327746,.23508252486137127,.23578078965798868,.235892002292441,.2360209777141303,.23663799549538955,.2374987640063862,.2379845180109627,.23899377757763487,.239748152899516,.24030835895648858,.2409769361661754,.24143248909906587,.24135465696291541,.24079937967447773,.24047405396120294,.23995525139180407,.23952287673801784,.2394808893818449,.2393650908183211,.23929339134427347,.23902199338028696,.23857873289710127,.23814701563685442,.23804621120577427,.23824193788738984,.2386009552212688,.23915406501238878,.23922540730102645,.2393830803524144,.2397336021407156,.2396056154523928,.24028502694537057,.2406181323375118,.2406792985927079,.24096201908324874,.24043605546026958,.24021526735270676,.23972514279402155,.23871998076352863,.2374413126648784,.23619509194955604,.23337281484306663,.2268023271445609,.2257750261856693,.22503847248255957,.2263113742246566,.2289949344716713]}});var J=11920929e-14,Y=t=>1127*Math.log(1+t/700),kt=(()=>{let t=new Float64Array(400),s=2*Math.PI/399;for(let n=0;n<400;n++)t[n]=Math.pow(.5-.5*Math.cos(s*n),.85);return t})(),vt=(()=>{let s=Y(20),o=(Y(8e3)-s)/81,u=[];for(let a=0;a<80;a++){let e=s+a*o,f=s+(a+1)*o,p=s+(a+2)*o,m=new Float64Array(256),_=-1,d=-1;for(let r=0;r<256;r++){let l=Y(31.25*r);l>e&&l<p&&(m[r]=l<=f?(l-e)/(f-e):(p-l)/(p-f),_===-1&&(_=r),d=r)}u.push({offset:_,weights:m.slice(_,d+1)})}return u})(),Rt=(()=>{let t=new Uint16Array(512),s=Math.log2(512);for(let n=0;n<512;n++){let o=n,u=0;for(let a=0;a<s;a++)u=u<<1|o&1,o>>=1;t[n]=u}return t})(),st=new Float64Array(512/2),nt=new Float64Array(512/2);for(let t=0;t<512/2;t++)st[t]=Math.cos(-2*Math.PI*t/512),nt[t]=Math.sin(-2*Math.PI*t/512);function Nt(t,s,n){for(let o=0;o<512;o++){let u=Rt[o];if(u>o){let a=t[o];t[o]=t[u],t[u]=a;let e=s[o];s[o]=s[u],s[u]=e}}for(let o=2;o<=512;o<<=1){let u=o>>1,a=512/o;for(let e=0;e<512;e+=o)for(let f=0;f<u;f++){let p=st[f*a],m=nt[f*a],_=e+f,d=_+u,r=t[d]*p-s[d]*m,l=t[d]*m+s[d]*p;t[d]=t[_]-r,s[d]=s[_]-l,t[_]+=r,s[_]+=l}}for(let o=0;o<=256;o++)n[o]=t[o]*t[o]+s[o]*s[o]}var E=new Float64Array(512),K=new Float64Array(512),tt=new Float64Array(257);function It(t,s,n,o){for(let e=0;e<400;e++)E[e]=t[s+e];let u=0;for(let e=0;e<400;e++)u+=E[e];let a=u/400;for(let e=0;e<400;e++)E[e]-=a;for(let e=399;e>0;e--)E[e]-=.97*E[e-1];E[0]-=.97*E[0];for(let e=0;e<400;e++)E[e]*=kt[e];for(let e=400;e<512;e++)E[e]=0;K.fill(0),Nt(E,K,tt);for(let e=0;e<80;e++){let{offset:f,weights:p}=vt[e],m=0;for(let _=0;_<p.length;_++)m+=p[_]*tt[f+_];m<J&&(m=J),n[o+e]=Math.log(m)}}function ot(t){let s=new Float64Array(t.length);for(let n=0;n<t.length;n++){let o=t[n];o>1?o=1:o<-1&&(o=-1),s[n]=Math.trunc(Math.fround(o*32767))}return s}function Dt(t,s,n){let{means:o,inv_std:u}=n;for(let a=0;a<s;a++){let e=a*80;for(let f=0;f<80;f++)t[e+f]=(t[e+f]-o[f])*u[f]}}var O=class{constructor(s){this.buffer=[];this.bufferStart=0;this.nextFrame=0;this.cmvn=s}reset(){this.buffer=[],this.bufferStart=0,this.nextFrame=0}push(s){for(let f=0;f<s.length;f++)this.buffer.push(s[f]);let n=this.bufferStart+this.buffer.length,o=[],u=0;for(;this.nextFrame*160+400<=n;){let f=this.nextFrame*160-this.bufferStart,p=new Float32Array(80);It(this.buffer,f,p,0),Dt(p,1,this.cmvn);for(let m=0;m<80;m++)o.push(p[m]);this.nextFrame++,u++}let a=this.nextFrame*160,e=a-this.bufferStart;return e>0&&(this.buffer=this.buffer.slice(e),this.bufferStart=a),{feats:new Float32Array(o),n:u}}};var b=class{constructor(s,n){this.shape=s;this.data=n}get rank(){return this.shape.length}get isInt(){return this.data instanceof Int32Array}};function w(t){let s=1;for(let n of t)s*=n;return s}function S(t){let s=new Array(t.length),n=1;for(let o=t.length-1;o>=0;o--)s[o]=n,n*=t[o];return s}function ut(t){return new b(t.slice(),new Float32Array(w(t)))}function ft(t,s){let n=Math.max(t.length,s.length),o=new Array(n);for(let u=0;u<n;u++){let a=t[t.length-1-u]??1,e=s[s.length-1-u]??1;if(a!==e&&a!==1&&e!==1)throw new Error(`broadcast mismatch ${t} vs ${s}`);o[n-1-u]=Math.max(a,e)}return o}function mt(t,s,n){let o=ft(t.shape,s.shape),u=w(o),a=new Float32Array(u),e=o.length,f=S(t.shape),p=S(s.shape),m=new Int32Array(e),_=new Int32Array(e);for(let c=0;c<e;c++){let M=c-(e-t.rank),y=c-(e-s.rank);m[c]=M>=0&&t.shape[M]!==1?f[M]:0,_[c]=y>=0&&s.shape[y]!==1?p[y]:0}let d=new Int32Array(e),r=t.data,l=s.data,A=0,h=0;for(let c=0;c<u;c++){a[c]=n(r[A],l[h]);for(let M=e-1;M>=0;M--){if(++d[M]<o[M]){A+=m[M],h+=_[M];break}d[M]=0,A-=m[M]*(o[M]-1),h-=_[M]*(o[M]-1)}}return new b(o,a)}function at(t,s){return mt(t,s,(n,o)=>n+o)}function pt(t,s){return mt(t,s,(n,o)=>n*o)}function _t(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=t.data[n]>0?t.data[n]:0;return new b(t.shape.slice(),s)}function dt(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=1/(1+Math.exp(-t.data[n]));return new b(t.shape.slice(),s)}function lt(t,s){let n=s??t.shape.map((r,l)=>t.rank-1-l),o=n.map(r=>t.shape[r]),u=t.data.length,a=new Float32Array(u),e=S(t.shape),f=o.length,p=new Int32Array(f);for(let r=0;r<f;r++)p[r]=e[n[r]];let m=new Int32Array(f),_=t.data,d=0;for(let r=0;r<u;r++){a[r]=_[d];for(let l=f-1;l>=0;l--){if(++m[l]<o[l]){d+=p[l];break}m[l]=0,d-=p[l]*(o[l]-1)}}return new b(o,a)}function rt(t,s){let n=t[0],o=n.rank,u=s<0?s+o:s,a=n.shape.slice();a[u]=t.reduce((m,_)=>m+_.shape[u],0);let e=new Float32Array(w(a)),f=S(a),p=0;for(let m of t){let _=S(m.shape),d=new Array(o).fill(0);for(let r=0;r<m.data.length;r++){let l=r;for(let h=0;h<o;h++)d[h]=Math.floor(l/_[h]),l-=d[h]*_[h];let A=0;for(let h=0;h<o;h++){let c=h===u?d[h]+p:d[h];A+=c*f[h]}e[A]=m.data[r]}p+=m.shape[u]}return new b(a,e)}function ct(t,s,n){let o=t.rank,u=n<0?n+o:n,a=S(t.shape),e=s.rank===0,f=e?[s.data[0]]:Array.from(s.data),p=e?[]:s.shape.slice(),m=[...t.shape.slice(0,u),...p,...t.shape.slice(u+1)],_=new Float32Array(w(m)),d=S(m),r=p.length;for(let l=0;l<_.length;l++){let A=l,h=new Array(m.length);for(let i=0;i<m.length;i++)h[i]=Math.floor(A/d[i]),A-=h[i]*d[i];let c=0;for(let i=0;i<u;i++)c+=h[i]*a[i];let M=0;for(let i=0;i<r;i++)M=M*p[i]+h[u+i];let y=f[e?0:M];y<0&&(y+=t.shape[u]),c+=y*a[u];for(let i=u+1;i<o;i++)c+=h[i-1+r]*a[i];_[l]=t.data[c]}return new b(m,_)}function it(t,s){let n=t.rank+s.length,o=s.map(e=>e<0?e+n:e).sort((e,f)=>e-f),u=t.shape.slice();for(let e of o)u.splice(e,0,1);let a=t.data instanceof Int32Array?Int32Array.from(t.data):Float32Array.from(t.data);return new b(u,a)}var Gt=2**31-1;function ht(t,s,n,o,u){let a=t.rank,e=o??s.map((c,M)=>M),f=u??s.map(()=>1),p=new Array(a).fill(0),m=t.shape.slice(),_=new Array(a).fill(1);for(let c=0;c<e.length;c++){let M=e[c]<0?e[c]+a:e[c],y=t.shape[M],i=s[c];i<0&&(i+=y),i=Math.max(0,Math.min(i,y));let T=n[c];T>=Gt?T=y:(T<0&&(T+=y),T=Math.max(0,Math.min(T,y))),p[M]=i,m[M]=T,_[M]=f[c]}let d=new Array(a);for(let c=0;c<a;c++)d[c]=Math.max(0,Math.ceil((m[c]-p[c])/_[c]));let r=S(t.shape),l=S(d),h=t.data instanceof Int32Array?new Int32Array(w(d)):new Float32Array(w(d));for(let c=0;c<h.length;c++){let M=c,y=0;for(let i=0;i<a;i++){let T=Math.floor(M/l[i]);M-=T*l[i],y+=(p[i]+T*_[i])*r[i]}h[c]=t.data[y]}return new b(d,h)}function Mt(t,s){let n=t,o=s,u=!1,a=!1;n.rank===1&&(n=new b([1,n.shape[0]],n.data),u=!0),o.rank===1&&(o=new b([o.shape[0],1],o.data),a=!0);let e=n.shape[n.rank-2],f=n.shape[n.rank-1],p=o.shape[o.rank-2],m=o.shape[o.rank-1];if(f!==p)throw new Error(`matmul inner dim ${f} vs ${p}`);let _=n.shape.slice(0,n.rank-2),d=o.shape.slice(0,o.rank-2),r=ft(_,d),l=w(r),A=[...r,e,m],h=new Float32Array(w(A)),c=e*f,M=p*m,y=e*m,i=S(r),T=S(_),B=S(d),D=new Array(r.length);for(let g=0;g<l;g++){let G=g;for(let C=0;C<r.length;C++)D[C]=Math.floor(G/i[C]),G-=D[C]*i[C];let L=0;for(let C=0;C<_.length;C++){let R=D[C+(r.length-_.length)];L+=(_[C]===1?0:R)*T[C]}let v=0;for(let C=0;C<d.length;C++){let R=D[C+(r.length-d.length)];v+=(d[C]===1?0:R)*B[C]}let U=L*c,$=v*M,P=g*y;for(let C=0;C<e;C++){let R=U+C*f;for(let H=0;H<m;H++){let N=0;for(let k=0;k<f;k++)N+=n.data[R+k]*o.data[$+k*m+H];h[P+C*m+H]=N}}}let x=new b(A,h);return u&&(x=et(x,x.rank-2)),a&&(x=et(x,x.rank-1)),x}function et(t,s){let n=t.shape.slice();return n.splice(s,1),new b(n,t.data)}function At(t,s,n,o,u,a,e){let[f,p,m]=t.shape,[_,d,r]=s.shape,l=u[0],A=a[0],h=e[0],c=m+l+u[1],M=Math.floor((c-(A*(r-1)+1))/h)+1,y=new Float32Array(f*_*M),i=S(t.shape),T=S(s.shape),B=_/o,D=p/o;for(let x=0;x<f;x++)for(let g=0;g<o;g++)for(let G=0;G<B;G++){let L=g*B+G;for(let v=0;v<M;v++){let U=0,$=v*h-l;for(let P=0;P<d;P++){let C=g*D+P,R=x*i[0]+C*i[1],H=L*T[0]+P*T[1];for(let N=0;N<r;N++){let k=$+N*A;k<0||k>=m||(U+=s.data[H+N]*t.data[R+k])}}n&&(U+=n.data[L]),y[x*_*M+L*M+v]=U}}return new b([f,_,M],y)}var Lt=80;function Pt(t,s){let n=w(t.shape);if(t.dtype==="int8_pc"){let u=new Float32Array(n);for(let f=0;f<n;f++)u[f]=s.getInt8(t.off+f);let a=w(t.scale_shape),e=new Float32Array(a);for(let f=0;f<a;f++)e[f]=s.getFloat32(t.scale_off+f*4,!0);return pt(new b(t.shape.slice(),u),new b(t.scale_shape.slice(),e))}if(t.dtype==="int32"){let u=new Int32Array(n);for(let a=0;a<n;a++)u[a]=s.getInt32(t.off+a*4,!0);return new b(t.shape.slice(),u)}let o=new Float32Array(n);for(let u=0;u<n;u++)o[u]=s.getFloat32(t.off+u*4,!0);return new b(t.shape.slice(),o)}var q=class{constructor(s,n){this.weights={};this.nodes=s.nodes,this.inputNames=s.inputs,this.outputNames=s.outputs,this.cacheShape=s.cache_shape;let o=new DataView(n.buffer,n.byteOffset,n.byteLength);for(let[u,a]of Object.entries(s.weights))this.weights[u]=Pt(a,o);this.reset()}reset(){this.cache=ut(this.cacheShape)}get cacheState(){return this.cache.data}step(s,n){let o={...this.weights};o[this.inputNames[0]]=new b([1,n,Lt],s),o[this.inputNames[1]]=this.cache;for(let f of this.nodes){let p=f.attrs,m=f.inputs.map(d=>d?o[d]:null),_;switch(f.op){case"MatMul":_=Mt(m[0],m[1]);break;case"Add":_=at(m[0],m[1]);break;case"Relu":_=_t(m[0]);break;case"Sigmoid":_=dt(m[0]);break;case"Transpose":_=lt(m[0],p.perm);break;case"Concat":_=rt(m.filter(d=>d!==null),p.axis);break;case"Gather":_=ct(m[0],m[1],p.axis??0);break;case"Unsqueeze":{let d=m.length>1&&m[1]!==null?Array.from(m[1].data):p.axes;_=it(m[0],d);break}case"Slice":{let d=Array.from(m[1].data),r=Array.from(m[2].data),l=m.length>3&&m[3]!==null?Array.from(m[3].data):void 0,A=m.length>4&&m[4]!==null?Array.from(m[4].data):void 0;_=ht(m[0],d,r,l,A);break}case"Conv":_=At(m[0],m[1],m.length>2?m[2]:null,p.group??1,p.pads??[0,0],p.dilations??[1],p.strides??[1]);break;default:throw new Error("unhandled op "+f.op)}o[f.outputs[0]]=_}this.cache=o[this.outputNames[1]];let u=o[this.outputNames[0]],a=S(u.shape),e=new Float32Array(n);for(let f=0;f<n;f++)e[f]=u.data[f*a[1]];return e}};var I=80,bt=160/16e3*1e3,Ht=1e3/bt,Ut=700,F=Math.round(Ut/bt),yt=8,Z=yt+1,zt=.2,Bt=.75,Ot=15,qt=4,Vt=50;function Wt(t,s,n){let o=0;for(let p=0;p<s;p++)o+=t[p];o/=s;let u=n*s/Ht,a=2*Math.cos(2*Math.PI*u/s),e=0,f=0;for(let p=0;p<s;p++){let m=t[p]-o+a*e-f;f=e,e=m}return Math.sqrt(Math.max(0,e*e+f*f-a*e*f))/s}function Qt(t,s){let n=0;for(let u=0;u<s;u++)n+=t[u];n/=s;let o=0;for(let u=0;u<s;u++)o+=(t[u]-n)**2;return Math.sqrt(o/s)}function Ct(t,s,n){let o=Math.min(s-1,Math.max(0,Math.round(n*(s-1))));return t[o]}var V=class{constructor(){this.motion=new Float64Array(F);this.flux=new Float64Array(F);this.level=new Float64Array(F);this.candidate=new Uint8Array(F);this.count=0;this.position=0;this.history=new Float32Array(Z*I);this.historyNorm=new Float64Array(Z);this.historyPosition=0;this.seen=0;this.scratchMotion=new Float64Array(F);this.scratchFlux=new Float64Array(F);this.scratchLevel=new Float64Array(F)}reset(){this.count=0,this.position=0,this.historyPosition=0,this.seen=0}push(s,n,o){let u=0,a=0,e=this.historyPosition*I;for(let l=0;l<I;l++){let A=s[n+l];this.history[e+l]=A,u+=A,a+=A*A}let f=Math.sqrt(a);this.historyNorm[this.historyPosition]=f;let p=(this.historyPosition+1)%Z;if(this.historyPosition=p,this.seen++,this.seen<=yt)return;let m=p*I,_=0,d=0;for(let l=0;l<I;l++)_+=this.history[e+l]*this.history[m+l],d+=Math.abs(this.history[e+l]-this.history[m+l]);let r=f*this.historyNorm[p];this.motion[this.position]=r>1e-9?1-_/r:0,this.flux[this.position]=d/I,this.level[this.position]=u/I,this.candidate[this.position]=o>=zt?1:0,this.position=(this.position+1)%F,this.count<F&&this.count++}score(){let s=this.count<F?0:this.position,n=0;for(let e=0;e<this.count;e++){let f=(s+e)%F;this.scratchLevel[e]=this.level[f],this.candidate[f]&&(this.scratchMotion[n]=this.motion[f],this.scratchFlux[n]=this.flux[f],n++)}if(n<Ot)return null;let o=this.scratchMotion.subarray(0,n),u=this.scratchFlux.subarray(0,n);o.sort(),u.sort();let a=0;if(this.count>=Vt){let e=Qt(this.scratchLevel,this.count);e>1e-6&&(a=Wt(this.scratchLevel,this.count,qt)/e)}return{motion:Ct(o,n,Bt),medianFlux:Ct(u,n,.5),modulation:a,frames:n}}};var z=5,Zt=80,jt=160/16e3*1e3;function xt(t){let s=new O(t.cmvn),n=new q(t.graph,t.weights),o=new V,u=new Float64Array(z),a=0,e=0,f=0,p=0,m=null;function _(d){return a<z?(u[e]=d,f+=d,a++,e=(e+1)%z,f/a):(f+=d-u[e],u[e]=d,e=(e+1)%z,f/z)}return{pushPcm(d){let{feats:r,n:l}=s.push(ot(d));if(l===0)return;let A=n.step(r,l);if(!m){p+=l;return}for(let h=0;h<l;h++){p++;let c=_(A[h]);o.push(r,h*Zt,c),m(c,p*jt,o.score())}},onProb(d){m=d},reset(){s.reset(),n.reset(),o.reset(),u.fill(0),a=0,e=0,f=0,p=0}}}async function wt(t){let s=await Promise.resolve().then(()=>(Tt(),St));return{graph:s.graph,cmvn:s.cmvn,weights:t}}var W=self,Q=null;async function Xt(t){let s=await wt(new Uint8Array(t));Q=xt(s),Q.onProb((n,o,u)=>W.postMessage({type:"prob",prob:n,tMs:o,speech:u})),W.postMessage({type:"ready"})}W.onmessage=t=>{let s=t.data;switch(s.type){case"init":Xt(s.weights).catch(n=>W.postMessage({type:"error",message:String(n)}));return;case"pcm":Q?.pushPcm(new Float32Array(s.buffer));return;case"reset":Q?.reset();return}};})();\n';});var E1={};Hv(E1,{MOOD_WORKER_SOURCE:()=>mk});var mk,w1=Vv(()=>{mk=`"use strict";(()=>{var o=self,l=/^(INFO: |[IW]\\d{4} |Graph successfully started running)/;for(let t of["log","info","warn","error"]){let e=console[t].bind(console);console[t]=(...r)=>{typeof r[0]=="string"&&l.test(r[0])||e(...r)}}var s=null,i=(t,e,r)=>t.FaceLandmarker.createFromOptions({wasmLoaderPath:e.loaderUrl,wasmBinaryPath:e.wasmUrl},{baseOptions:{modelAssetBuffer:e.model,delegate:r},runningMode:"VIDEO",numFaces:1,outputFaceBlendshapes:!0});async function d(t){o.importScripts(t.bundleUrl);let e=o.Vision;if(!e?.FaceLandmarker)throw new Error("MediaPipe bundle defined no Vision global");if(t.delegate==="GPU")try{s=await i(e,t,"GPU"),o.postMessage({type:"ready",delegate:"GPU"});return}catch{}s=await i(e,t,"CPU"),o.postMessage({type:"ready",delegate:"CPU"})}function p(t,e){try{if(!s)throw new Error("frame before init");let n=s.detectForVideo(t,e).faceBlendshapes?.[0]?.categories;o.postMessage({type:"result",blendshapes:n?Object.fromEntries(n.map(a=>[a.categoryName,a.score])):null})}catch(r){o.postMessage({type:"error",message:String(r)})}finally{t.close()}}o.onmessage=t=>{let e=t.data;e.type==="init"?d(e).catch(r=>o.postMessage({type:"error",message:String(r)})):p(e.frame,e.timestampMs)};})();
10
+ `;});var gu=ri((pu,tv)=>{(function(e,n){typeof pu=="object"&&typeof tv=="object"?tv.exports=n():typeof define=="function"&&define.amd?define([],n):typeof pu=="object"?pu.rive=n():e.rive=n();})(pu,()=>(()=>{var t=[,((r,a,o)=>{o.r(a),o.d(a,{Animation:()=>u.Animation});var u=o(2);}),((r,a,o)=>{o.r(a),o.d(a,{Animation:()=>u});var u=(function(){function d(g,y,A,p){this.animation=g,this.artboard=y,this.playing=p,this.loopCount=0,this.scrubTo=null,this.instance=new A.LinearAnimationInstance(g,y);}return Object.defineProperty(d.prototype,"name",{get:function(){return this.animation.name},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"time",{get:function(){return this.instance.time},set:function(g){this.instance.time=g;},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:false,configurable:true}),d.prototype.advance=function(g){this.scrubTo===null?this.instance.advance(g):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null);},d.prototype.apply=function(g){this.instance.apply(g);},d.prototype.cleanup=function(){this.instance.delete();},d})();}),((r,a,o)=>{o.r(a),o.d(a,{RuntimeLoader:()=>y});var u=o(4),d=o(5),g=function(){return g=Object.assign||function(A){for(var p,_=1,C=arguments.length;_<C;_++){p=arguments[_];for(var N in p)Object.prototype.hasOwnProperty.call(p,N)&&(A[N]=p[N]);}return A},g.apply(this,arguments)},y=(function(){function A(){}return A.notifyError=function(p){var _;for(A.isLoading=false;A.errorCallbackQueue.length>0;)(_=A.errorCallbackQueue.shift())===null||_===void 0||_(p);A.callBackQueue=[];},A.loadRuntime=function(){var p=A.wasmURL,_=A.wasmBinary;A.enablePerfMarks&&performance.mark("rive:wasm-init:start"),u.default(g({locateFile:function(){return p}},_?{wasmBinary:_}:{})).then(function(C){var N;for(A.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),A.runtime=C,A.errorCallbackQueue=[];A.callBackQueue.length>0;)(N=A.callBackQueue.shift())===null||N===void 0||N(A.runtime);}).catch(function(C){var N={message:C?.message||"Unknown error",type:C?.name||"Error",wasmError:C instanceof WebAssembly.CompileError||C instanceof WebAssembly.RuntimeError,originalError:C};console.debug("Rive WASM load error details:",N);var B=A.wasmFallbackURL,M=B!==null&&p.toLowerCase()===B.toLowerCase();if(B!==null&&!M)console.warn("Failed to load WASM from ".concat(p," (").concat(N.message,"), trying fallback URL: ").concat(B)),A.wasmBinary=null,A.setWasmUrl(B),A.loadRuntime();else {var w=M?"the configured WASM URL or its fallback (".concat(B,")"):p,R=["Could not load Rive WASM file from ".concat(w,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
11
11
  Error details:`,"- Type: ".concat(N.type),"- Message: ".concat(N.message),"- WebAssembly-specific error: ".concat(N.wasmError),`
12
12
  To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.awaitInstance() again"].join(`
13
- `);console.error(R),A.notifyError(new Error(R));}});},A.getInstance=function(p,_){A.isLoading||(A.isLoading=true,A.loadRuntime()),A.runtime?p(A.runtime):(A.callBackQueue.push(p),_&&A.errorCallbackQueue.push(_));},A.awaitInstance=function(){return new Promise(function(p,_){return A.getInstance(p,_)})},A.setWasmUrl=function(p){A.wasmURL=p;},A.getWasmUrl=function(){return A.wasmURL},A.setWasmFallbackUrl=function(p){A.wasmFallbackURL=p;},A.getWasmFallbackUrl=function(){return A.wasmFallbackURL},A.setWasmBinary=function(p){if(p instanceof ArrayBuffer||p===null){A.wasmBinary=p;return}console.error("setWasmBinary expects an ArrayBuffer or null");},A.getWasmBinary=function(){return A.wasmBinary},A.isLoading=false,A.callBackQueue=[],A.wasmURL="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/rive.wasm"),A.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(d.name,"@").concat(d.version,"/rive_fallback.wasm"),A.wasmBinary=null,A.errorCallbackQueue=[],A.enablePerfMarks=false,A})();}),((r,a,o)=>{o.r(a),o.d(a,{default:()=>d});var u=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return(function(y={}){var A,p=y,_,C,N=new Promise((s,l)=>{_=s,C=l;}),B=typeof window=="object",M=typeof importScripts=="function";function w(){function s(k){let O=h;f=l=0,h=new Map,O.forEach(F=>{try{F(k);}catch(P){console.error(P);}}),this.mb(),v&&v.Nb();}let l=0,f=0,h=new Map,v=null,S=null;this.requestAnimationFrame=function(k){l||(l=requestAnimationFrame(s.bind(this)));let O=++f;return h.set(O,k),O},this.cancelAnimationFrame=function(k){h.delete(k),l&&h.size==0&&(cancelAnimationFrame(l),l=0);},this.Lb=function(k){S&&(document.body.remove(S),S=null),k||(S=document.createElement("div"),S.style.backgroundColor="black",S.style.position="fixed",S.style.right=0,S.style.top=0,S.style.color="white",S.style.padding="4px",S.innerHTML="RIVE FPS",k=function(O){S.innerHTML="RIVE FPS "+O.toFixed(1);},document.body.appendChild(S)),v=new function(){let O=0,F=0;this.Nb=function(){var P=performance.now();F?(++O,P-=F,1e3<P&&(k(1e3*O/P),O=F=0)):(F=P,O=0);};};},this.mb=function(){};}function R(){console.assert(true);let s=new Map,l=-1/0;this.push=function(f){return f=f+255>>8,s.has(f)&&clearTimeout(s.get(f)),s.set(f,setTimeout(function(){s.delete(f),s.length==0?l=-1/0:f==l&&(l=Math.max(...s.keys()),console.assert(l<f));},1e3)),l=Math.max(f,l),l<<8};}let D=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){D&&D();let s=p.decodeAudio;p.decodeAudio=function(S,k){S=s(S),k(S);};let l=p.decodeFont;p.decodeFont=function(S,k){S=l(S),k(S);};let f=p.setFallbackFontCb;p.setFallbackFontCallback=typeof f=="function"?function(S){f(S);}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");};let h=p.FileAssetLoader;p.ptrToAsset=S=>{let k=p.ptrToFileAsset(S);return k.isImage?p.ptrToImageAsset(S):k.isFont?p.ptrToFontAsset(S):k.isAudio?p.ptrToAudioAsset(S):k},p.CustomFileAssetLoader=h.extend("CustomFileAssetLoader",{__construct:function({loadContents:S}){this.__parent.__construct.call(this),this.Bb=S;},loadContents:function(S,k){return S=p.ptrToAsset(S),this.Bb(S,k)}}),p.CDNFileAssetLoader=h.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);},loadContents:function(S){let k=p.ptrToAsset(S);return S=k.cdnUuid,S===""?false:((function(O,F){var P=new XMLHttpRequest;P.responseType="arraybuffer",P.onreadystatechange=function(){P.readyState==4&&P.status==200&&F(P);},P.open("GET",O,true),P.send(null);})(k.cdnBaseUrl+"/"+S,O=>{k.decode(new Uint8Array(O.response));}),true)}}),p.FallbackFileAssetLoader=h.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.ib=[];},addLoader:function(S){this.ib.push(S);},loadContents:function(S,k){for(let O of this.ib)if(O.loadContents(S,k))return true;return false}});let v=p.computeAlignment;p.computeAlignment=function(S,k,O,F,P=1){return v.call(this,S,k,O,F,P)};};let G=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){function s(J){this.G=J,this.Ab=J.getContext("2d"),this.Eb=h,this.S=[],this.ja=0,this.clear=function(){console.assert(this.ja==0),this.S=[],v.delete(this);},this.save=function(){++this.ja,this.S.push(h.save.bind(h));},this.restore=function(){0<this.ja&&(this.S.push(h.restore.bind(h)),--this.ja);},this.transform=function(te){this.S.push(h.transform.bind(h,te));},this.align=function(te,_e,Me,Pe,ht=1){this.S.push(h.align.bind(h,te,_e,Me,Pe,ht));},this.flush=function(){console.assert(this.ja==0),v.add(this),h.Ya||f();},this.delete=function(){};}function l(J,te=false){var _e={alpha:true,depth:te,stencil:te,antialias:te,premultipliedAlpha:true,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:false,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};if(te=J.getContext("webgl2",_e),!te)return null;_e=Hw(te,_e),nh(_e);let Me=S(J.width,J.height);Me.Ma=_e,Me.G=J,Me.Na=J.width,Me.Za=J.height,Me.T=te;var Pe=Me.delete;return Me.delete=function(){Pe.call(this);var ht=this.Ma;Ki===ln[ht]&&(Ki=null),typeof JSEvents=="object"&&JSEvents.Qc(ln[ht].F.canvas),ln[ht]&&ln[ht].F.canvas&&(ln[ht].F.canvas.zb=void 0),this.Ma=this.G=this.Na=this.T=ln[ht]=null;},Me}function f(){if(h){var J=h.Db,te=0,_e=0,Me=0,Pe=Array(v.size),ht=0;for(var Rt of v)Rt.ea=Math.min(Rt.G.width,J),Rt.da=Math.min(Rt.G.height,J),Rt.Ka=Rt.da*Rt.ea,te=Math.max(te,Rt.ea),_e=Math.max(_e,Rt.da),Me+=Rt.Ka,Pe[ht++]=Rt;if(v.clear(),!(0>=Me)){for(te=1<<(0>=te?0:32-Math.clz32(te-1)),_e=1<<(0>=_e?0:32-Math.clz32(_e-1));_e*te<Me;)te<=_e?te*=2:_e*=2;for(te=Math.min(te,J),te=Math.min(_e,J),Pe.sort((Ji,lh)=>lh.Ka-Ji.Ka),Me=new p.DynamicRectanizer(J),Rt=0;Rt<Pe.length;){for(Me.reset(te,_e),ht=Rt;ht<Pe.length;++ht){var kt=Pe[ht],pt=Me.addRect(kt.ea,kt.da);if(0>pt){console.assert(ht>Rt);break}kt.pa=pt&65535,kt.qa=pt>>16;}for(kt=F.push(Me.drawWidth()),pt=P.push(Me.drawHeight()),console.assert(kt>=Me.drawWidth()),console.assert(pt>=Me.drawHeight()),console.assert(kt<=J),console.assert(pt<=J),h.G.width!=kt&&(h.G.width=kt),h.G.height!=pt&&(h.G.height=pt),h.clear(),kt=Rt;kt<ht;++kt){pt=Pe[kt],h.saveClipRect(pt.pa,pt.qa,pt.pa+pt.ea,pt.qa+pt.da);let Ji=new p.Mat2D;Ji.xx=pt.ea/pt.G.width,Ji.yy=pt.da/pt.G.height,Ji.xy=Ji.yx=0,Ji.tx=pt.pa,Ji.ty=pt.qa,h.transform(Ji);for(let lh of pt.S)lh();h.restoreClipRect(),pt.S=[];}for(h.flush();Rt<ht;++Rt)kt=Pe[Rt],pt=kt.Ab,pt.globalCompositeOperation="copy",pt.drawImage(h.G,kt.pa,kt.qa,kt.ea,kt.da,0,0,kt.G.width,kt.G.height);Rt=ht;}}}}G&&G();let h=null,v=new Set,S=p.makeRenderer;p.makeRenderer=function(J,te){if(!h){let _e=function(Me){var Pe=document.createElement("canvas");return Pe.width=1,Pe.height=1,h=l(Pe,Me),h?(h.Ya=!!h.T.getExtension("WEBGL_shader_pixel_local_storage"),h.Db=Math.min(h.T.getParameter(h.T.MAX_RENDERBUFFER_SIZE),h.T.getParameter(h.T.MAX_TEXTURE_SIZE)),h.La=!h.Ya,(Me=h.T.getExtension("WEBGL_debug_renderer_info"))&&(Pe=h.T.getParameter(Me.UNMASKED_RENDERER_WEBGL),h.T.getParameter(Me.UNMASKED_VENDOR_WEBGL).includes("Google")&&Pe.includes("ANGLE Metal Renderer")&&(h.La=false)),h):null};if(h=_e(true),!h)throw "Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";h.La||(h=_e(false));}return te?new s(J):l(J,h.La)};let k=p.Artboard.prototype.delete;p.Artboard.prototype.delete=function(){this.Fb=true,k.call(this);};let O=p.Artboard.prototype.draw;p.Artboard.prototype.draw=function(J){J.S?J.S.push(()=>{this.Fb||O.call(this,J.Eb);}):O.call(this,J);};let F=new R,P=new R,$=new w;p.requestAnimationFrame=$.requestAnimationFrame.bind($),p.cancelAnimationFrame=$.cancelAnimationFrame.bind($),p.enableFPSCounter=$.Lb.bind($),$.mb=f,p.resolveAnimationFrame=f;let he=p.load;p.load=function(J,te,_e=true){let Me=new p.FallbackFileAssetLoader;return te!==void 0&&Me.addLoader(te),_e&&(te=new p.CDNFileAssetLoader,Me.addLoader(te)),Promise.resolve(he(J,Me))};let ge=p.WebGL2Renderer.prototype.clear;p.WebGL2Renderer.prototype.clear=function(){nh(this.Ma);let J=this.G;(this.Na!=J.width||this.Za!=J.height)&&(this.resize(J.width,J.height),this.Na=J.width,this.Za=J.height),ge.call(this);},p.decodeImage=function(J,te){J=p.decodeWebGL2Image(J),te(J);};let V=p.Renderer.prototype.align;p.Renderer.prototype.align=function(J,te,_e,Me,Pe=1){V.call(this,J,te,_e,Me,Pe);};};var ne=Object.assign({},p),U="./this.program",H="",ee,Q;(B||M)&&(M?H=self.location.href:typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),g&&(H=g),H.startsWith("blob:")?H="":H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1),M&&(Q=s=>{var l=new XMLHttpRequest;return l.open("GET",s,false),l.responseType="arraybuffer",l.send(null),new Uint8Array(l.response)}),ee=(s,l,f)=>{if(Ne(s)){var h=new XMLHttpRequest;h.open("GET",s,true),h.responseType="arraybuffer",h.onload=()=>{h.status==200||h.status==0&&h.response?l(h.response):f();},h.onerror=f,h.send(null);}else fetch(s,{credentials:"same-origin"}).then(v=>v.ok?v.arrayBuffer():Promise.reject(Error(v.status+" : "+v.url))).then(l,f);});var Ee=p.print||console.log.bind(console),Ce=p.printErr||console.error.bind(console);Object.assign(p,ne),ne=null,p.thisProgram&&(U=p.thisProgram);var Ue;p.wasmBinary&&(Ue=p.wasmBinary);var Be,fe=false,ye,ce,j,X,K,me,Ie,qe;function Dt(){var s=Be.buffer;p.HEAP8=ye=new Int8Array(s),p.HEAP16=j=new Int16Array(s),p.HEAPU8=ce=new Uint8Array(s),p.HEAPU16=X=new Uint16Array(s),p.HEAP32=K=new Int32Array(s),p.HEAPU32=me=new Uint32Array(s),p.HEAPF32=Ie=new Float32Array(s),p.HEAPF64=qe=new Float64Array(s);}var Je=[],Qe=[],Wt=[];function en(){var s=p.preRun.shift();Je.unshift(s);}var Et=0,Lt=null;function wn(s){throw p.onAbort?.(s),s="Aborted("+s+")",Ce(s),fe=true,s=new WebAssembly.RuntimeError(s+". Build with -sASSERTIONS for more info."),C(s),s}var Xe=s=>s.startsWith("data:application/octet-stream;base64,"),Ne=s=>s.startsWith("file://"),Un;function Mn(s){if(s==Un&&Ue)return new Uint8Array(Ue);if(Q)return Q(s);throw "both async and sync fetching of the wasm failed"}function xn(s){return Ue?Promise.resolve().then(()=>Mn(s)):new Promise((l,f)=>{ee(s,h=>l(new Uint8Array(h)),()=>{try{l(Mn(s));}catch(h){f(h);}});})}function Qt(s,l,f){return xn(s).then(h=>WebAssembly.instantiate(h,l)).then(f,h=>{Ce(`failed to asynchronously prepare wasm: ${h}`),wn(h);})}function tn(s,l){var f=Un;return Ue||typeof WebAssembly.instantiateStreaming!="function"||Xe(f)||Ne(f)||typeof fetch!="function"?Qt(f,s,l):fetch(f,{credentials:"same-origin"}).then(h=>WebAssembly.instantiateStreaming(h,s).then(l,function(v){return Ce(`wasm streaming compile failed: ${v}`),Ce("falling back to ArrayBuffer instantiation"),Qt(f,s,l)}))}var It,Pt,lt={570520:(s,l,f,h,v)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.h>"u"){window.h={Fa:0},window.h.I={},window.h.I.Ca=s,window.h.I.capture=l,window.h.I.Pa=f,window.h.ha={},window.h.ha.stopped=h,window.h.ha.ub=v;let S=window.h;S.C=[],S.mc=function(k){for(var O=0;O<S.C.length;++O)if(S.C[O]==null)return S.C[O]=k,O;return S.C.push(k),S.C.length-1},S.yb=function(k){for(S.C[k]=null;0<S.C.length&&S.C[S.C.length-1]==null;)S.C.pop();},S.Tc=function(k){for(var O=0;O<S.C.length;++O)if(S.C[O]==k)return S.yb(O)},S.ta=function(k){return S.C[k]},S.Xa=["touchend","click"],S.unlock=function(){for(var k=0;k<S.C.length;++k){var O=S.C[k];O!=null&&O.K!=null&&O.state===S.ha.ub&&O.K.resume().then(()=>{Ov(O.nb);},F=>{console.error("Failed to resume audiocontext",F);});}S.Xa.map(function(F){document.removeEventListener(F,S.unlock,true);});},S.Xa.map(function(k){document.addEventListener(k,S.unlock,true);});}return window.h.Fa+=1,1},572698:()=>{typeof window.h<"u"&&(window.h.Xa.map(function(s){document.removeEventListener(s,window.h.unlock,true);}),--window.h.Fa,window.h.Fa===0&&delete window.h);},573002:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,573106:()=>{try{var s=new(window.AudioContext||window.webkitAudioContext),l=s.sampleRate;return s.close(),l}catch{return 0}},573277:(s,l,f,h,v,S)=>{if(typeof window.h>"u")return -1;var k={},O={};return s==window.h.I.Ca&&f!=0&&(O.sampleRate=f),k.K=new(window.AudioContext||window.webkitAudioContext)(O),k.K.suspend(),k.state=window.h.ha.stopped,f=0,s!=window.h.I.Ca&&(f=l),k.Y=k.K.createScriptProcessor(h,f,l),k.Y.onaudioprocess=function(F){if((k.ua==null||k.ua.length==0)&&(k.ua=new Float32Array(Ie.buffer,v,h*l)),s==window.h.I.capture||s==window.h.I.Pa){for(var P=0;P<l;P+=1)for(var $=F.inputBuffer.getChannelData(P),he=k.ua,ge=0;ge<h;ge+=1)he[ge*l+P]=$[ge];Iv(S,h,v);}if(s==window.h.I.Ca||s==window.h.I.Pa)for(Nv(S,h,v),P=0;P<F.outputBuffer.numberOfChannels;++P)for($=F.outputBuffer.getChannelData(P),he=k.ua,ge=0;ge<h;ge+=1)$[ge]=he[ge*l+P];else for(P=0;P<F.outputBuffer.numberOfChannels;++P)F.outputBuffer.getChannelData(P).fill(0);},s!=window.h.I.capture&&s!=window.h.I.Pa||navigator.mediaDevices.getUserMedia({audio:true,video:false}).then(function(F){k.Ga=k.K.createMediaStreamSource(F),k.Ga.connect(k.Y),k.Y.connect(k.K.destination);}).catch(function(F){console.log("Failed to get user media: "+F);}),s==window.h.I.Ca&&k.Y.connect(k.K.destination),k.nb=S,window.h.mc(k)},576154:s=>window.h.ta(s).K.sampleRate,576227:s=>{s=window.h.ta(s),s.Y!==void 0&&(s.Y.onaudioprocess=function(){},s.Y.disconnect(),s.Y=void 0),s.Ga!==void 0&&(s.Ga.disconnect(),s.Ga=void 0),s.K.close(),s.K=void 0,s.nb=void 0;},576627:s=>{window.h.yb(s);},576677:s=>{s=window.h.ta(s),s.K.resume(),s.state=window.h.ha.ub;},576816:s=>{s=window.h.ta(s),s.K.suspend(),s.state=window.h.ha.stopped;}},Re=s=>{for(;0<s.length;)s.shift()(p);};function b(){var s=K[+va>>2];return va+=4,s}var c=(s,l)=>{for(var f=0,h=s.length-1;0<=h;h--){var v=s[h];v==="."?s.splice(h,1):v===".."?(s.splice(h,1),f++):f&&(s.splice(h,1),f--);}if(l)for(;f;f--)s.unshift("..");return s},m=s=>{var l=s.charAt(0)==="/",f=s.substr(-1)==="/";return (s=c(s.split("/").filter(h=>!!h),!l).join("/"))||l||(s="."),s&&f&&(s+="/"),(l?"/":"")+s},E=s=>{var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(s).slice(1);return s=l[0],l=l[1],!s&&!l?".":(l&&(l=l.substr(0,l.length-1)),s+l)},x=s=>{if(s==="/")return "/";s=m(s),s=s.replace(/\/$/,"");var l=s.lastIndexOf("/");return l===-1?s:s.substr(l+1)},L=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return s=>crypto.getRandomValues(s);wn("initRandomDevice");},z=s=>(z=L())(s),ae=(...s)=>{for(var l="",f=false,h=s.length-1;-1<=h&&!f;h--){if(f=0<=h?s[h]:"/",typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!f)return "";l=f+"/"+l,f=f.charAt(0)==="/";}return l=c(l.split("/").filter(v=>!!v),!f).join("/"),(f?"/":"")+l||"."},be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,re=(s,l,f)=>{var h=l+f;for(f=l;s[f]&&!(f>=h);)++f;if(16<f-l&&s.buffer&&be)return be.decode(s.subarray(l,f));for(h="";l<f;){var v=s[l++];if(v&128){var S=s[l++]&63;if((v&224)==192)h+=String.fromCharCode((v&31)<<6|S);else {var k=s[l++]&63;v=(v&240)==224?(v&15)<<12|S<<6|k:(v&7)<<18|S<<12|k<<6|s[l++]&63,65536>v?h+=String.fromCharCode(v):(v-=65536,h+=String.fromCharCode(55296|v>>10,56320|v&1023));}}else h+=String.fromCharCode(v);}return h},pe=[],tt=s=>{for(var l=0,f=0;f<s.length;++f){var h=s.charCodeAt(f);127>=h?l++:2047>=h?l+=2:55296<=h&&57343>=h?(l+=4,++f):l+=3;}return l},Ke=(s,l,f,h)=>{if(!(0<h))return 0;var v=f;h=f+h-1;for(var S=0;S<s.length;++S){var k=s.charCodeAt(S);if(55296<=k&&57343>=k){var O=s.charCodeAt(++S);k=65536+((k&1023)<<10)|O&1023;}if(127>=k){if(f>=h)break;l[f++]=k;}else {if(2047>=k){if(f+1>=h)break;l[f++]=192|k>>6;}else {if(65535>=k){if(f+2>=h)break;l[f++]=224|k>>12;}else {if(f+3>=h)break;l[f++]=240|k>>18,l[f++]=128|k>>12&63;}l[f++]=128|k>>6&63;}l[f++]=128|k&63;}}return l[f]=0,f-v};function De(s,l){var f=Array(tt(s)+1);return s=Ke(s,f,0,f.length),l&&(f.length=s),f}var wt=[];function Gt(s,l){wt[s]={input:[],H:[],V:l},Ve(s,Fe);}var Fe={open(s){var l=wt[s.node.Ea];if(!l)throw new le(43);s.s=l,s.seekable=false;},close(s){s.s.V.sa(s.s);},sa(s){s.s.V.sa(s.s);},read(s,l,f,h){if(!s.s||!s.s.V.hb)throw new le(60);for(var v=0,S=0;S<h;S++){try{var k=s.s.V.hb(s.s);}catch{throw new le(29)}if(k===void 0&&v===0)throw new le(6);if(k==null)break;v++,l[f+S]=k;}return v&&(s.node.timestamp=Date.now()),v},write(s,l,f,h){if(!s.s||!s.s.V.Sa)throw new le(60);try{for(var v=0;v<h;v++)s.s.V.Sa(s.s,l[f+v]);}catch{throw new le(29)}return h&&(s.node.timestamp=Date.now()),v}},zt={hb(){e:{if(!pe.length){var s=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(s=window.prompt("Input: "),s!==null&&(s+=`
14
- `)),!s){s=null;break e}pe=De(s,true);}s=pe.shift();}return s},Sa(s,l){l===null||l===10?(Ee(re(s.H,0)),s.H=[]):l!=0&&s.H.push(l);},sa(s){s.H&&0<s.H.length&&(Ee(re(s.H,0)),s.H=[]);},Wb(){return {xc:25856,zc:5,wc:191,yc:35387,vc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Xb(){return 0},Yb(){return [24,80]}},Mt={Sa(s,l){l===null||l===10?(Ce(re(s.H,0)),s.H=[]):l!=0&&s.H.push(l);},sa(s){s.H&&0<s.H.length&&(Ce(re(s.H,0)),s.H=[]);}};function Tt(s,l){var f=s.l?s.l.length:0;f>=l||(l=Math.max(l,f*(1048576>f?2:1.125)>>>0),f!=0&&(l=Math.max(l,256)),f=s.l,s.l=new Uint8Array(l),0<s.v&&s.l.set(f.subarray(0,s.v),0));}var ve={N:null,U(){return ve.createNode(null,"/",16895,0)},createNode(s,l,f,h){if((f&61440)===24576||(f&61440)===4096)throw new le(63);return ve.N||(ve.N={dir:{node:{X:ve.j.X,P:ve.j.P,ka:ve.j.ka,Aa:ve.j.Aa,sb:ve.j.sb,xb:ve.j.xb,tb:ve.j.tb,rb:ve.j.rb,Ha:ve.j.Ha},stream:{aa:ve.m.aa}},file:{node:{X:ve.j.X,P:ve.j.P},stream:{aa:ve.m.aa,read:ve.m.read,write:ve.m.write,$a:ve.m.$a,jb:ve.m.jb,lb:ve.m.lb}},link:{node:{X:ve.j.X,P:ve.j.P,la:ve.j.la},stream:{}},ab:{node:{X:ve.j.X,P:ve.j.P},stream:Ze}}),f=Tr(s,l,f,h),(f.mode&61440)===16384?(f.j=ve.N.dir.node,f.m=ve.N.dir.stream,f.l={}):(f.mode&61440)===32768?(f.j=ve.N.file.node,f.m=ve.N.file.stream,f.v=0,f.l=null):(f.mode&61440)===40960?(f.j=ve.N.link.node,f.m=ve.N.link.stream):(f.mode&61440)===8192&&(f.j=ve.N.ab.node,f.m=ve.N.ab.stream),f.timestamp=Date.now(),s&&(s.l[l]=f,s.timestamp=f.timestamp),f},Fc(s){return s.l?s.l.subarray?s.l.subarray(0,s.v):new Uint8Array(s.l):new Uint8Array(0)},j:{X(s){var l={};return l.Cc=(s.mode&61440)===8192?s.id:1,l.Hc=s.id,l.mode=s.mode,l.Nc=1,l.uid=0,l.Gc=0,l.Ea=s.Ea,(s.mode&61440)===16384?l.size=4096:(s.mode&61440)===32768?l.size=s.v:(s.mode&61440)===40960?l.size=s.link.length:l.size=0,l.tc=new Date(s.timestamp),l.Mc=new Date(s.timestamp),l.Ac=new Date(s.timestamp),l.Gb=4096,l.uc=Math.ceil(l.size/l.Gb),l},P(s,l){if(l.mode!==void 0&&(s.mode=l.mode),l.timestamp!==void 0&&(s.timestamp=l.timestamp),l.size!==void 0&&(l=l.size,s.v!=l))if(l==0)s.l=null,s.v=0;else {var f=s.l;s.l=new Uint8Array(l),f&&s.l.set(f.subarray(0,Math.min(l,s.v))),s.v=l;}},ka(){throw Hn[44]},Aa(s,l,f,h){return ve.createNode(s,l,f,h)},sb(s,l,f){if((s.mode&61440)===16384){try{var h=ji(l,f);}catch{}if(h)for(var v in h.l)throw new le(55)}delete s.parent.l[s.name],s.parent.timestamp=Date.now(),s.name=f,l.l[f]=s,l.timestamp=s.parent.timestamp;},xb(s,l){delete s.l[l],s.timestamp=Date.now();},tb(s,l){var f=ji(s,l),h;for(h in f.l)throw new le(55);delete s.l[l],s.timestamp=Date.now();},rb(s){var l=[".",".."],f;for(f of Object.keys(s.l))l.push(f);return l},Ha(s,l,f){return s=ve.createNode(s,l,41471,0),s.link=f,s},la(s){if((s.mode&61440)!==40960)throw new le(28);return s.link}},m:{read(s,l,f,h,v){var S=s.node.l;if(v>=s.node.v)return 0;if(s=Math.min(s.node.v-v,h),8<s&&S.subarray)l.set(S.subarray(v,v+s),f);else for(h=0;h<s;h++)l[f+h]=S[v+h];return s},write(s,l,f,h,v,S){if(l.buffer===ye.buffer&&(S=false),!h)return 0;if(s=s.node,s.timestamp=Date.now(),l.subarray&&(!s.l||s.l.subarray)){if(S)return s.l=l.subarray(f,f+h),s.v=h;if(s.v===0&&v===0)return s.l=l.slice(f,f+h),s.v=h;if(v+h<=s.v)return s.l.set(l.subarray(f,f+h),v),h}if(Tt(s,v+h),s.l.subarray&&l.subarray)s.l.set(l.subarray(f,f+h),v);else for(S=0;S<h;S++)s.l[v+S]=l[f+S];return s.v=Math.max(s.v,v+h),h},aa(s,l,f){if(f===1?l+=s.position:f===2&&(s.node.mode&61440)===32768&&(l+=s.node.v),0>l)throw new le(28);return l},$a(s,l,f){Tt(s.node,l+f),s.node.v=Math.max(s.node.v,l+f);},jb(s,l,f,h,v){if((s.node.mode&61440)!==32768)throw new le(43);if(s=s.node.l,v&2||s.buffer!==ye.buffer){if((0<f||f+l<s.length)&&(s.subarray?s=s.subarray(f,f+l):s=Array.prototype.slice.call(s,f,f+l)),f=true,wn(),l=void 0,!l)throw new le(48);ye.set(s,l);}else f=false,l=s.byteOffset;return {o:l,sc:f}},lb(s,l,f,h){return ve.m.write(s,l,0,h,f,false),0}}},ki=(s,l)=>{var f=0;return s&&(f|=365),l&&(f|=146),f},Fn=null,I={},vi=[],wr=1,Vn=null,xi=true,le=class{constructor(s){this.name="ErrnoError",this.$=s;}},Hn={},Mr=class{constructor(){this.h={},this.node=null;}get flags(){return this.h.flags}set flags(s){this.h.flags=s;}get position(){return this.h.position}set position(s){this.h.position=s;}},pa=class{constructor(s,l,f,h){s||(s=this),this.parent=s,this.U=s.U,this.Ba=null,this.id=wr++,this.name=l,this.mode=f,this.j={},this.m={},this.Ea=h;}get read(){return (this.mode&365)===365}set read(s){s?this.mode|=365:this.mode&=-366;}get write(){return (this.mode&146)===146}set write(s){s?this.mode|=146:this.mode&=-147;}};function ti(s,l={}){if(s=ae(s),!s)return {path:"",node:null};if(l=Object.assign({gb:true,Ua:0},l),8<l.Ua)throw new le(32);s=s.split("/").filter(k=>!!k);for(var f=Fn,h="/",v=0;v<s.length;v++){var S=v===s.length-1;if(S&&l.parent)break;if(f=ji(f,s[v]),h=m(h+"/"+s[v]),f.Ba&&(!S||S&&l.gb)&&(f=f.Ba.root),!S||l.fb){for(S=0;(f.mode&61440)===40960;)if(f=Ld(h),h=ae(E(h),f),f=ti(h,{Ua:l.Ua+1}).node,40<S++)throw new le(32)}}return {path:h,node:f}}function zi(s){for(var l;;){if(s===s.parent)return s=s.U.kb,l?s[s.length-1]!=="/"?`${s}/${l}`:s+l:s;l=l?`${s.name}/${l}`:s.name,s=s.parent;}}function es(s,l){for(var f=0,h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h)|0;return (s+f>>>0)%Vn.length}function ji(s,l){var f=(s.mode&61440)===16384?(f=de(s,"x"))?f:s.j.ka?0:2:54;if(f)throw new le(f);for(f=Vn[es(s.id,l)];f;f=f.ac){var h=f.name;if(f.parent.id===s.id&&h===l)return f}return s.j.ka(s,l)}function Tr(s,l,f,h){return s=new pa(s,l,f,h),l=es(s.parent.id,s.name),s.ac=Vn[l],Vn[l]=s}function Z(s){var l=["r","w","rw"][s&3];return s&512&&(l+="w"),l}function de(s,l){if(xi)return 0;if(!l.includes("r")||s.mode&292){if(l.includes("w")&&!(s.mode&146)||l.includes("x")&&!(s.mode&73))return 2}else return 2;return 0}function Ae(s,l){try{return ji(s,l),20}catch{}return de(s,"wx")}function ke(s){if(s=vi[s],!s)throw new le(8);return s}function $e(s,l=-1){if(s=Object.assign(new Mr,s),l==-1)e:{for(l=0;4096>=l;l++)if(!vi[l])break e;throw new le(33)}return s.W=l,vi[l]=s}function Bt(s,l=-1){return s=$e(s,l),s.m?.Ec?.(s),s}var Ze={open(s){s.m=I[s.node.Ea].m,s.m.open?.(s);},aa(){throw new le(70)}};function Ve(s,l){I[s]={m:l};}function ut(s,l){var f=l==="/";if(f&&Fn)throw new le(10);if(!f&&l){var h=ti(l,{gb:false});if(l=h.path,h=h.node,h.Ba)throw new le(10);if((h.mode&61440)!==16384)throw new le(54)}l={type:s,Pc:{},kb:l,Zb:[]},s=s.U(l),s.U=l,l.root=s,f?Fn=s:h&&(h.Ba=l,h.U&&h.U.Zb.push(l));}function dt(s,l,f){var h=ti(s,{parent:true}).node;if(s=x(s),!s||s==="."||s==="..")throw new le(28);var v=Ae(h,s);if(v)throw new le(v);if(!h.j.Aa)throw new le(63);return h.j.Aa(h,s,l,f)}function rt(s){return dt(s,16895,0)}function an(s,l,f){typeof f>"u"&&(f=l,l=438),dt(s,l|8192,f);}function Yi(s,l){if(!ae(s))throw new le(44);var f=ti(l,{parent:true}).node;if(!f)throw new le(44);l=x(l);var h=Ae(f,l);if(h)throw new le(h);if(!f.j.Ha)throw new le(63);f.j.Ha(f,l,s);}function Ld(s){if(s=ti(s).node,!s)throw new le(44);if(!s.j.la)throw new le(28);return ae(zi(s.parent),s.j.la(s))}function ts(s,l,f){if(s==="")throw new le(44);if(typeof l=="string"){var h={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[l];if(typeof h>"u")throw Error(`Unknown file open mode: ${l}`);l=h;}if(f=l&64?(typeof f>"u"?438:f)&4095|32768:0,typeof s=="object")var v=s;else {s=m(s);try{v=ti(s,{fb:!(l&131072)}).node;}catch{}}if(h=false,l&64)if(v){if(l&128)throw new le(20)}else v=dt(s,f,0),h=true;if(!v)throw new le(44);if((v.mode&61440)===8192&&(l&=-513),l&65536&&(v.mode&61440)!==16384)throw new le(54);if(!h&&(f=v?(v.mode&61440)===40960?32:(v.mode&61440)===16384&&(Z(l)!=="r"||l&512)?31:de(v,Z(l)):44))throw new le(f);if(l&512&&!h){if(f=v,f=typeof f=="string"?ti(f,{fb:true}).node:f,!f.j.P)throw new le(63);if((f.mode&61440)===16384)throw new le(31);if((f.mode&61440)!==32768)throw new le(28);if(h=de(f,"w"))throw new le(h);f.j.P(f,{size:0,timestamp:Date.now()});}return l&=-131713,v=$e({node:v,path:zi(v),flags:l,seekable:true,position:0,m:v.m,nc:[],error:false}),v.m.open&&v.m.open(v),!p.logReadFiles||l&1||(To||(To={}),s in To||(To[s]=1)),v}function Su(s,l,f){if(s.W===null)throw new le(8);if(!s.seekable||!s.m.aa)throw new le(70);if(f!=0&&f!=1&&f!=2)throw new le(28);s.position=s.m.aa(s,l,f),s.nc=[];}var Eu;function ga(s,l,f){s=m("/dev/"+s);var h=ki(!!l,!!f);wu||(wu=64);var v=wu++<<8|0;Ve(v,{open(S){S.seekable=false;},close(){f?.buffer?.length&&f(10);},read(S,k,O,F){for(var P=0,$=0;$<F;$++){try{var he=l();}catch{throw new le(29)}if(he===void 0&&P===0)throw new le(6);if(he==null)break;P++,k[O+$]=he;}return P&&(S.node.timestamp=Date.now()),P},write(S,k,O,F){for(var P=0;P<F;P++)try{f(k[O+P]);}catch{throw new le(29)}return F&&(S.node.timestamp=Date.now()),P}}),an(s,h,v);}var wu,qi={},To,va=void 0,Cr=(s,l)=>Object.defineProperty(l,"name",{value:s}),Co=[],Ai=[],we,Gn=s=>{if(!s)throw new we("Cannot use deleted val. handle = "+s);return Ai[s]},yi=s=>{switch(s){case void 0:return 2;case null:return 4;case true:return 6;case false:return 8;default:let l=Co.pop()||Ai.length;return Ai[l]=s,Ai[l+1]=1,l}},Mu=s=>{var l=Error,f=Cr(s,function(h){this.name=s,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
15
- `+h.replace(/^Error(:[^\n]*)?\n/,""));});return f.prototype=Object.create(l.prototype),f.prototype.constructor=f,f.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},f},Tu,Cu,Nt=s=>{for(var l="";ce[s];)l+=Cu[ce[s++]];return l},Aa=[],ns=()=>{for(;Aa.length;){var s=Aa.pop();s.g.ga=false,s.delete();}},Rr,ni={},kr=(s,l)=>{if(l===void 0)throw new we("ptr should not be undefined");for(;s.B;)l=s.na(l),s=s.B;return l},Wi={},Ro=s=>{s=xv(s);var l=Nt(s);return Zi(s),l},xr=(s,l)=>{var f=Wi[s];if(f===void 0)throw s=`${l} has unknown type ${Ro(s)}`,new we(s);return f},ya=()=>{},is=false,Ru=(s,l,f)=>l===f?s:f.B===void 0?null:(s=Ru(s,l,f.B),s===null?null:f.Jb(s)),ku={},Pd=(s,l)=>(l=kr(s,l),ni[l]),ba,rs=(s,l)=>{if(!l.u||!l.o)throw new ba("makeClassHandle requires ptr and ptrType");if(!!l.J!=!!l.D)throw new ba("Both smartPtrType and smartPtr must be specified");return l.count={value:1},Or(Object.create(s,{g:{value:l,writable:true}}))},Or=s=>typeof FinalizationRegistry>"u"?(Or=l=>l,s):(is=new FinalizationRegistry(l=>{l=l.g,--l.count.value,l.count.value===0&&(l.D?l.J.O(l.D):l.u.i.O(l.o));}),Or=l=>{var f=l.g;return f.D&&is.register(l,{g:f},l),l},ya=l=>{is.unregister(l);},Or(s)),as={},_a=s=>{for(;s.length;){var l=s.pop();s.pop()(l);}};function Qi(s){return this.fromWireType(me[s>>2])}var Ir={},ss={},yn=(s,l,f)=>{function h(O){if(O=f(O),O.length!==s.length)throw new ba("Mismatched type converter count");for(var F=0;F<s.length;++F)ii(s[F],O[F]);}s.forEach(function(O){ss[O]=l;});var v=Array(l.length),S=[],k=0;l.forEach((O,F)=>{Wi.hasOwnProperty(O)?v[F]=Wi[O]:(S.push(O),Ir.hasOwnProperty(O)||(Ir[O]=[]),Ir[O].push(()=>{v[F]=Wi[O],++k,k===S.length&&h(v);}));}),S.length===0&&h(v);};function Bd(s,l,f={}){var h=l.name;if(!s)throw new we(`type "${h}" must have a positive integer typeid pointer`);if(Wi.hasOwnProperty(s)){if(f.Tb)return;throw new we(`Cannot register type '${h}' twice`)}Wi[s]=l,delete ss[s],Ir.hasOwnProperty(s)&&(l=Ir[s],delete Ir[s],l.forEach(v=>v()));}function ii(s,l,f={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Bd(s,l,f)}var os=s=>{throw new we(s.g.u.i.name+" instance already deleted")};function ls(){}var ko=(s,l,f)=>{if(s[l].A===void 0){var h=s[l];s[l]=function(...v){if(!s[l].A.hasOwnProperty(v.length))throw new we(`Function '${f}' called with an invalid number of arguments (${v.length}) - expects one of (${s[l].A})!`);return s[l].A[v.length].apply(this,v)},s[l].A=[],s[l].A[h.fa]=h;}},xo=(s,l,f)=>{if(p.hasOwnProperty(s)){if(f===void 0||p[s].A!==void 0&&p[s].A[f]!==void 0)throw new we(`Cannot register public name '${s}' twice`);if(ko(p,s,s),p.hasOwnProperty(f))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${f})!`);p[s].A[f]=l;}else p[s]=l,f!==void 0&&(p[s].Oc=f);},oe=s=>{if(s===void 0)return "_unknown";s=s.replace(/[^a-zA-Z0-9_]/g,"$");var l=s.charCodeAt(0);return 48<=l&&57>=l?`_${s}`:s};function et(s,l,f,h,v,S,k,O){this.name=s,this.constructor=l,this.M=f,this.O=h,this.B=v,this.Ob=S,this.na=k,this.Jb=O,this.ob=[];}var Ct=(s,l,f)=>{for(;l!==f;){if(!l.na)throw new we(`Expected null or instance of ${f.name}, got an instance of ${l.name}`);s=l.na(s),l=l.B;}return s};function Xi(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return Ct(l.g.o,l.g.u.i,this.i)}function Ud(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);if(this.wa){var f=this.Ta();return s!==null&&s.push(this.O,f),f}return 0}if(!l||!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.va&&l.g.u.va)throw new we(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);if(f=Ct(l.g.o,l.g.u.i,this.i),this.wa){if(l.g.D===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.hc){case 0:if(l.g.J===this)f=l.g.D;else throw new we(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);break;case 1:f=l.g.D;break;case 2:if(l.g.J===this)f=l.g.D;else {var h=l.clone();f=this.cc(f,yi(()=>h.delete())),s!==null&&s.push(this.O,f);}break;default:throw new we("Unsupporting sharing policy")}}return f}function Fd(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(l.g.u.va)throw new we(`Cannot convert argument of type ${l.g.u.name} to parameter type ${this.name}`);return Ct(l.g.o,l.g.u.i,this.i)}function us(s,l,f,h,v,S,k,O,F,P,$){this.name=s,this.i=l,this.Ra=f,this.va=h,this.wa=v,this.bc=S,this.hc=k,this.qb=O,this.Ta=F,this.cc=P,this.O=$,v||l.B!==void 0?this.toWireType=Ud:(this.toWireType=h?Xi:Fd,this.L=null);}var xu=(s,l,f)=>{if(!p.hasOwnProperty(s))throw new ba("Replacing nonexistent public symbol");p[s].A!==void 0&&f!==void 0?p[s].A[f]=l:(p[s]=l,p[s].fa=f);},cs=[],Ou,Sa=s=>{var l=cs[s];return l||(s>=cs.length&&(cs.length=s+1),cs[s]=l=Ou.get(s)),l},Vd=(s,l,f=[])=>(s.includes("j")?(s=s.replace(/p/g,"i"),l=(0, p["dynCall_"+s])(l,...f)):l=Sa(l)(...f),l),Hd=(s,l)=>(...f)=>Vd(s,l,f),sn=(s,l)=>{s=Nt(s);var f=s.includes("j")?Hd(s,l):Sa(l);if(typeof f!="function")throw new we(`unknown function pointer with signature ${s}: ${l}`);return f},Iu,bi=(s,l)=>{function f(S){v[S]||Wi[S]||(ss[S]?ss[S].forEach(f):(h.push(S),v[S]=true));}var h=[],v={};throw l.forEach(f),new Iu(`${s}: `+h.map(Ro).join([", "]))};function Gd(s){for(var l=1;l<s.length;++l)if(s[l]!==null&&s[l].L===void 0)return true;return false}function fs(s,l,f,h,v){var S=l.length;if(2>S)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=l[1]!==null&&f!==null,O=Gd(l),F=l[0].name!=="void",P=S-2,$=Array(P),he=[],ge=[];return Cr(s,function(...V){if(V.length!==P)throw new we(`function ${s} called with ${V.length} arguments, expected ${P}`);if(ge.length=0,he.length=k?2:1,he[0]=v,k){var J=l[1].toWireType(ge,this);he[1]=J;}for(var te=0;te<P;++te)$[te]=l[te+2].toWireType(ge,V[te]),he.push($[te]);if(V=h(...he),O)_a(ge);else for(te=k?1:2;te<l.length;te++){var _e=te===1?J:$[te-2];l[te].L!==null&&l[te].L(_e);}return J=F?l[0].fromWireType(V):void 0,J})}var Ea=(s,l)=>{for(var f=[],h=0;h<s;h++)f.push(me[l+4*h>>2]);return f},Oo=s=>{s=s.trim();let l=s.indexOf("(");return l!==-1?s.substr(0,l):s},Io=(s,l,f)=>{if(!(s instanceof Object))throw new we(`${f} with invalid "this": ${s}`);if(!(s instanceof l.i.constructor))throw new we(`${f} incompatible with "this" of type ${s.constructor.name}`);if(!s.g.o)throw new we(`cannot call emscripten binding method ${f} on deleted object`);return Ct(s.g.o,s.g.u.i,l.i)},No=s=>{9<s&&--Ai[s+1]===0&&(Ai[s]=void 0,Co.push(s));},zd={name:"emscripten::val",fromWireType:s=>{var l=Gn(s);return No(s),l},toWireType:(s,l)=>yi(l),argPackAdvance:8,readValueFromPointer:Qi,L:null},jd=(s,l,f)=>{switch(l){case 1:return f?function(h){return this.fromWireType(ye[h])}:function(h){return this.fromWireType(ce[h])};case 2:return f?function(h){return this.fromWireType(j[h>>1])}:function(h){return this.fromWireType(X[h>>1])};case 4:return f?function(h){return this.fromWireType(K[h>>2])}:function(h){return this.fromWireType(me[h>>2])};default:throw new TypeError(`invalid integer width (${l}): ${s}`)}},Do=s=>{if(s===null)return "null";var l=typeof s;return l==="object"||l==="array"||l==="function"?s.toString():""+s},Yd=(s,l)=>{switch(l){case 4:return function(f){return this.fromWireType(Ie[f>>2])};case 8:return function(f){return this.fromWireType(qe[f>>3])};default:throw new TypeError(`invalid float width (${l}): ${s}`)}},qd=(s,l,f)=>{switch(l){case 1:return f?h=>ye[h]:h=>ce[h];case 2:return f?h=>j[h>>1]:h=>X[h>>1];case 4:return f?h=>K[h>>2]:h=>me[h>>2];default:throw new TypeError(`invalid integer width (${l}): ${s}`)}},Nu=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Wd=(s,l)=>{for(var f=s>>1,h=f+l/2;!(f>=h)&&X[f];)++f;if(f<<=1,32<f-s&&Nu)return Nu.decode(ce.subarray(s,f));for(f="",h=0;!(h>=l/2);++h){var v=j[s+2*h>>1];if(v==0)break;f+=String.fromCharCode(v);}return f},Qd=(s,l,f)=>{if(f??(f=2147483647),2>f)return 0;f-=2;var h=l;f=f<2*s.length?f/2:s.length;for(var v=0;v<f;++v)j[l>>1]=s.charCodeAt(v),l+=2;return j[l>>1]=0,l-h},Xd=s=>2*s.length,Kd=(s,l)=>{for(var f=0,h="";!(f>=l/4);){var v=K[s+4*f>>2];if(v==0)break;++f,65536<=v?(v-=65536,h+=String.fromCharCode(55296|v>>10,56320|v&1023)):h+=String.fromCharCode(v);}return h},Zd=(s,l,f)=>{if(f??(f=2147483647),4>f)return 0;var h=l;f=h+f-4;for(var v=0;v<s.length;++v){var S=s.charCodeAt(v);if(55296<=S&&57343>=S){var k=s.charCodeAt(++v);S=65536+((S&1023)<<10)|k&1023;}if(K[l>>2]=S,l+=4,l+4>f)break}return K[l>>2]=0,l-h},Jd=s=>{for(var l=0,f=0;f<s.length;++f){var h=s.charCodeAt(f);55296<=h&&57343>=h&&++f,l+=4;}return l},Du=(s,l,f)=>{var h=[];return s=s.toWireType(h,f),h.length&&(me[l>>2]=yi(h)),s},ds=[],Lu={},Pu=s=>{var l=Lu[s];return l===void 0?Nt(s):l},$d=s=>{var l=ds.length;return ds.push(s),l},ue=(s,l)=>{for(var f=Array(s),h=0;h<s;++h)f[h]=xr(me[l+4*h>>2],"parameter "+h);return f},Le=Reflect.construct,on=s=>s%4===0&&(s%100!==0||s%400===0),hs=[0,31,60,91,121,152,182,213,244,274,305,335],Bu=[0,31,59,90,120,151,181,212,243,273,304,334],eh=[],gv=s=>{s.Dc=s.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");},vv=s=>{s.Lc=s.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");},Av=s=>{var l="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");return (s.getSupportedExtensions()||[]).filter(f=>l.includes(f))},yv=1,Lo=[],_i=[],Uu=[],Po=[],ms=[],wa=[],Fu=[],ln=[],bv={},th=4,_v=0,Vu=s=>{for(var l=yv++,f=s.length;f<l;f++)s[f]=null;return l},Bo=(s,l,f,h)=>{for(var v=0;v<s;v++){var S=q[f](),k=S&&Vu(h);S?(S.name=k,h[k]=S):bn||(bn=1282),K[l+4*v>>2]=k;}},Hw=(s,l)=>{var f=Vu(ln),h={handle:f,attributes:l,version:l.Kc,F:s};return s.canvas&&(s.canvas.zb=h),ln[f]=h,(typeof l.Kb>"u"||l.Kb)&&Gw(h),f},nh=s=>(Ki=ln[s],p.Bc=q=Ki?.F,!(s&&!q)),Gw=s=>{if(s||(s=Ki),!s.Ub){s.Ub=true;var l=s.F;gv(l),vv(l),2<=s.version&&(l.cb=l.getExtension("EXT_disjoint_timer_query_webgl2")),(2>s.version||!l.cb)&&(l.cb=l.getExtension("EXT_disjoint_timer_query")),l.$b=l.getExtension("WEBGL_multi_draw"),Av(l).forEach(f=>{f.includes("lose_context")||f.includes("debug")||l.getExtension(f);});}},bn,Ki,ih={},Sv=()=>{if(!rh){var s={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:U||"./this.program"},l;for(l in ih)ih[l]===void 0?delete s[l]:s[l]=ih[l];var f=[];for(l in s)f.push(`${l}=${s[l]}`);rh=f;}return rh},rh,ah=[];function Ev(){var s=Av(q);return s=s.concat(s.map(l=>"GL_"+l))}var zw=(s,l)=>{if(l){var f=void 0;switch(s){case 36346:f=1;break;case 36344:return;case 34814:case 36345:f=0;break;case 34466:var h=q.getParameter(34467);f=h?h.length:0;break;case 33309:if(2>Ki.version){bn||(bn=1282);return}f=Ev().length;break;case 33307:case 33308:if(2>Ki.version){bn||(bn=1280);return}f=s==33307?3:0;}if(f===void 0)switch(h=q.getParameter(s),typeof h){case "number":f=h;break;case "boolean":f=h?1:0;break;case "string":bn||(bn=1280);return;case "object":if(h===null)switch(s){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:f=0;break;default:bn||(bn=1280);return}else {if(h instanceof Float32Array||h instanceof Uint32Array||h instanceof Int32Array||h instanceof Array){for(s=0;s<h.length;++s)K[l+4*s>>2]=h[s];return}try{f=h.name|0;}catch(v){bn||(bn=1280),Ce(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${s})! (error: ${v})`);return}}break;default:bn||(bn=1280),Ce(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${s}) and it returns ${h} of type ${typeof h}!`);return}K[l>>2]=f;}else bn||(bn=1281);},Hu=s=>{var l=tt(s)+1,f=zu(l);return f&&Ke(s,ce,f,l),f},wv=s=>s.slice(-1)=="]"&&s.lastIndexOf("["),sh=s=>(s-=5120,s==0?ye:s==1?ce:s==2?j:s==4?K:s==6?Ie:s==5||s==28922||s==28520||s==30779||s==30782?me:X),Mv=[31,29,31,30,31,30,31,31,30,31,30,31],Tv=[31,28,31,30,31,30,31,31,30,31,30,31],Cv=(s,l,f,h)=>{function v(V,J,te){for(V=typeof V=="number"?V.toString():V||"";V.length<J;)V=te[0]+V;return V}function S(V,J){return v(V,J,"0")}function k(V,J){function te(Me){return 0>Me?-1:0<Me?1:0}var _e;return (_e=te(V.getFullYear()-J.getFullYear()))===0&&(_e=te(V.getMonth()-J.getMonth()))===0&&(_e=te(V.getDate()-J.getDate())),_e}function O(V){switch(V.getDay()){case 0:return new Date(V.getFullYear()-1,11,29);case 1:return V;case 2:return new Date(V.getFullYear(),0,3);case 3:return new Date(V.getFullYear(),0,2);case 4:return new Date(V.getFullYear(),0,1);case 5:return new Date(V.getFullYear()-1,11,31);case 6:return new Date(V.getFullYear()-1,11,30)}}function F(V){var J=V.ba;for(V=new Date(new Date(V.ca+1900,0,1).getTime());0<J;){var te=V.getMonth(),_e=(on(V.getFullYear())?Mv:Tv)[te];if(J>_e-V.getDate())J-=_e-V.getDate()+1,V.setDate(1),11>te?V.setMonth(te+1):(V.setMonth(0),V.setFullYear(V.getFullYear()+1));else {V.setDate(V.getDate()+J);break}}return te=new Date(V.getFullYear()+1,0,4),J=O(new Date(V.getFullYear(),0,4)),te=O(te),0>=k(J,V)?0>=k(te,V)?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var P=me[h+40>>2];h={kc:K[h>>2],jc:K[h+4>>2],Ia:K[h+8>>2],Va:K[h+12>>2],Ja:K[h+16>>2],ca:K[h+20>>2],R:K[h+24>>2],ba:K[h+28>>2],Sc:K[h+32>>2],ic:K[h+36>>2],lc:P&&P?re(ce,P):""},f=f?re(ce,f):"",P={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var $ in P)f=f.replace(new RegExp($,"g"),P[$]);var he="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ge="January February March April May June July August September October November December".split(" ");P={"%a":V=>he[V.R].substring(0,3),"%A":V=>he[V.R],"%b":V=>ge[V.Ja].substring(0,3),"%B":V=>ge[V.Ja],"%C":V=>S((V.ca+1900)/100|0,2),"%d":V=>S(V.Va,2),"%e":V=>v(V.Va,2," "),"%g":V=>F(V).toString().substring(2),"%G":F,"%H":V=>S(V.Ia,2),"%I":V=>(V=V.Ia,V==0?V=12:12<V&&(V-=12),S(V,2)),"%j":V=>{for(var J=0,te=0;te<=V.Ja-1;J+=(on(V.ca+1900)?Mv:Tv)[te++]);return S(V.Va+J,3)},"%m":V=>S(V.Ja+1,2),"%M":V=>S(V.jc,2),"%n":()=>`
16
- `,"%p":V=>0<=V.Ia&&12>V.Ia?"AM":"PM","%S":V=>S(V.kc,2),"%t":()=>" ","%u":V=>V.R||7,"%U":V=>S(Math.floor((V.ba+7-V.R)/7),2),"%V":V=>{var J=Math.floor((V.ba+7-(V.R+6)%7)/7);if(2>=(V.R+371-V.ba-2)%7&&J++,J)J==53&&(te=(V.R+371-V.ba)%7,te==4||te==3&&on(V.ca)||(J=1));else {J=52;var te=(V.R+7-V.ba-1)%7;(te==4||te==5&&on(V.ca%400-1))&&J++;}return S(J,2)},"%w":V=>V.R,"%W":V=>S(Math.floor((V.ba+7-(V.R+6)%7)/7),2),"%y":V=>(V.ca+1900).toString().substring(2),"%Y":V=>V.ca+1900,"%z":V=>{V=V.ic;var J=0<=V;return V=Math.abs(V)/60,(J?"+":"-")+("0000"+(V/60*100+V%60)).slice(-4)},"%Z":V=>V.lc,"%%":()=>"%"},f=f.replace(/%%/g,"\0\0");for($ in P)f.includes($)&&(f=f.replace(new RegExp($,"g"),P[$](h)));return f=f.replace(/\0\0/g,"%"),$=De(f,false),$.length>l?0:(ye.set($,s),$.length-1)};[44].forEach(s=>{Hn[s]=new le(s),Hn[s].stack="<generic error, no stack>";}),Vn=Array(4096),ut(ve,"/"),rt("/tmp"),rt("/home"),rt("/home/web_user"),(function(){rt("/dev"),Ve(259,{read:()=>0,write:(h,v,S,k)=>k}),an("/dev/null",259),Gt(1280,zt),Gt(1536,Mt),an("/dev/tty",1280),an("/dev/tty1",1536);var s=new Uint8Array(1024),l=0,f=()=>(l===0&&(l=z(s).byteLength),s[--l]);ga("random",f),ga("urandom",f),rt("/dev/shm"),rt("/dev/shm/tmp");})(),(function(){rt("/proc");var s=rt("/proc/self");rt("/proc/self/fd"),ut({U(){var l=Tr(s,"fd",16895,73);return l.j={ka(f,h){var v=ke(+h);return f={parent:null,U:{kb:"fake"},j:{la:()=>v.path}},f.parent=f}},l}},"/proc/self/fd");})(),we=p.BindingError=class extends Error{constructor(s){super(s),this.name="BindingError";}},Ai.push(0,1,void 0,1,null,1,true,1,false,1),p.count_emval_handles=()=>Ai.length/2-5-Co.length,Tu=p.PureVirtualError=Mu("PureVirtualError");for(var Rv=Array(256),Gu=0;256>Gu;++Gu)Rv[Gu]=String.fromCharCode(Gu);Cu=Rv,p.getInheritedInstanceCount=()=>Object.keys(ni).length,p.getLiveInheritedInstances=()=>{var s=[],l;for(l in ni)ni.hasOwnProperty(l)&&s.push(ni[l]);return s},p.flushPendingDeletes=ns,p.setDelayFunction=s=>{Rr=s,Aa.length&&Rr&&Rr(ns);},ba=p.InternalError=class extends Error{constructor(s){super(s),this.name="InternalError";}},Object.assign(ls.prototype,{isAliasOf:function(s){if(!(this instanceof ls&&s instanceof ls))return false;var l=this.g.u.i,f=this.g.o;s.g=s.g;var h=s.g.u.i;for(s=s.g.o;l.B;)f=l.na(f),l=l.B;for(;h.B;)s=h.na(s),h=h.B;return l===h&&f===s},clone:function(){if(this.g.o||os(this),this.g.ia)return this.g.count.value+=1,this;var s=Or,l=Object,f=l.create,h=Object.getPrototypeOf(this),v=this.g;return s=s(f.call(l,h,{g:{value:{count:v.count,ga:v.ga,ia:v.ia,o:v.o,u:v.u,D:v.D,J:v.J}}})),s.g.count.value+=1,s.g.ga=false,s},delete(){if(this.g.o||os(this),this.g.ga&&!this.g.ia)throw new we("Object already scheduled for deletion");ya(this);var s=this.g;--s.count.value,s.count.value===0&&(s.D?s.J.O(s.D):s.u.i.O(s.o)),this.g.ia||(this.g.D=void 0,this.g.o=void 0);},isDeleted:function(){return !this.g.o},deleteLater:function(){if(this.g.o||os(this),this.g.ga&&!this.g.ia)throw new we("Object already scheduled for deletion");return Aa.push(this),Aa.length===1&&Rr&&Rr(ns),this.g.ga=true,this}}),Object.assign(us.prototype,{Pb(s){return this.qb&&(s=this.qb(s)),s},bb(s){this.O?.(s);},argPackAdvance:8,readValueFromPointer:Qi,fromWireType:function(s){function l(){return this.wa?rs(this.i.M,{u:this.bc,o:f,J:this,D:s}):rs(this.i.M,{u:this,o:s})}var f=this.Pb(s);if(!f)return this.bb(s),null;var h=Pd(this.i,f);if(h!==void 0)return h.g.count.value===0?(h.g.o=f,h.g.D=s,h.clone()):(h=h.clone(),this.bb(s),h);if(h=this.i.Ob(f),h=ku[h],!h)return l.call(this);h=this.va?h.Hb:h.pointerType;var v=Ru(f,this.i,h.i);return v===null?l.call(this):this.wa?rs(h.i.M,{u:h,o:v,J:this,D:s}):rs(h.i.M,{u:h,o:v})}}),Iu=p.UnboundTypeError=Mu("UnboundTypeError");for(var q,oh=0;32>oh;++oh)ah.push(Array(oh));var kv={__syscall_fcntl64:function(s,l,f){va=f;try{var h=ke(s);switch(l){case 0:var v=b();if(0>v)break;for(;vi[v];)v++;return Bt(h,v).W;case 1:case 2:return 0;case 3:return h.flags;case 4:return v=b(),h.flags|=v,0;case 12:return v=b(),j[v+0>>1]=2,0;case 13:case 14:return 0}return -28}catch(S){if(typeof qi>"u"||S.name!=="ErrnoError")throw S;return -S.$}},__syscall_ioctl:function(s,l,f){va=f;try{var h=ke(s);switch(l){case 21509:return h.s?0:-59;case 21505:if(!h.s)return -59;if(h.s.V.Wb){s=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var v=b();K[v>>2]=25856,K[v+4>>2]=5,K[v+8>>2]=191,K[v+12>>2]=35387;for(var S=0;32>S;S++)ye[v+S+17]=s[S]||0;}return 0;case 21510:case 21511:case 21512:return h.s?0:-59;case 21506:case 21507:case 21508:if(!h.s)return -59;if(h.s.V.Xb)for(v=b(),s=[],S=0;32>S;S++)s.push(ye[v+S+17]);return 0;case 21519:return h.s?(v=b(),K[v>>2]=0):-59;case 21520:return h.s?-28:-59;case 21531:if(v=b(),!h.m.Vb)throw new le(59);return h.m.Vb(h,l,v);case 21523:return h.s?(h.s.V.Yb&&(S=[24,80],v=b(),j[v>>1]=S[0],j[v+2>>1]=S[1]),0):-59;case 21524:return h.s?0:-59;case 21515:return h.s?0:-59;default:return -28}}catch(k){if(typeof qi>"u"||k.name!=="ErrnoError")throw k;return -k.$}},__syscall_openat:function(s,l,f,h){va=h;try{l=l?re(ce,l):"";var v=l;if(v.charAt(0)==="/")l=v;else {var S=s===-100?"/":ke(s).path;if(v.length==0)throw new le(44);l=m(S+"/"+v);}var k=h?b():0;return ts(l,f,k).W}catch(O){if(typeof qi>"u"||O.name!=="ErrnoError")throw O;return -O.$}},_abort_js:()=>{wn("");},_embind_create_inheriting_constructor:(s,l,f)=>{s=Nt(s),l=xr(l,"wrapper"),f=Gn(f);var h=l.i,v=h.M,S=h.B.M,k=h.B.constructor;return s=Cr(s,function(...O){h.B.ob.forEach(function(F){if(this[F]===S[F])throw new Tu(`Pure virtual function ${F} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:v}),this.__construct(...O);}),v.__construct=function(...O){if(this===v)throw new we("Pass correct 'this' to __construct");O=k.implement(this,...O),ya(O);var F=O.g;if(O.notifyOnDestruction(),F.ia=true,Object.defineProperties(this,{g:{value:F}}),Or(this),O=F.o,O=kr(h,O),ni.hasOwnProperty(O))throw new we(`Tried to register registered instance: ${O}`);ni[O]=this;},v.__destruct=function(){if(this===v)throw new we("Pass correct 'this' to __destruct");ya(this);var O=this.g.o;if(O=kr(h,O),ni.hasOwnProperty(O))delete ni[O];else throw new we(`Tried to unregister unregistered instance: ${O}`)},s.prototype=Object.create(v),Object.assign(s.prototype,f),yi(s)},_embind_finalize_value_object:s=>{var l=as[s];delete as[s];var f=l.Ta,h=l.O,v=l.eb,S=v.map(k=>k.Sb).concat(v.map(k=>k.ec));yn([s],S,k=>{var O={};return v.forEach((F,P)=>{var $=k[P],he=F.Qb,ge=F.Rb,V=k[P+v.length],J=F.dc,te=F.fc;O[F.Mb]={read:_e=>$.fromWireType(he(ge,_e)),write:(_e,Me)=>{var Pe=[];J(te,_e,V.toWireType(Pe,Me)),_a(Pe);}};}),[{name:l.name,fromWireType:F=>{var P={},$;for($ in O)P[$]=O[$].read(F);return h(F),P},toWireType:(F,P)=>{for(var $ in O)if(!($ in P))throw new TypeError(`Missing field: "${$}"`);var he=f();for($ in O)O[$].write(he,P[$]);return F!==null&&F.push(h,he),he},argPackAdvance:8,readValueFromPointer:Qi,L:h}]});},_embind_register_bigint:()=>{},_embind_register_bool:(s,l,f,h)=>{l=Nt(l),ii(s,{name:l,fromWireType:function(v){return !!v},toWireType:function(v,S){return S?f:h},argPackAdvance:8,readValueFromPointer:function(v){return this.fromWireType(ce[v])},L:null});},_embind_register_class:(s,l,f,h,v,S,k,O,F,P,$,he,ge)=>{$=Nt($),S=sn(v,S),O&&(O=sn(k,O)),P&&(P=sn(F,P)),ge=sn(he,ge);var V=oe($);xo(V,function(){bi(`Cannot construct ${$} due to unbound types`,[h]);}),yn([s,l,f],h?[h]:[],J=>{if(J=J[0],h)var te=J.i,_e=te.M;else _e=ls.prototype;J=Cr($,function(...Rt){if(Object.getPrototypeOf(this)!==Me)throw new we("Use 'new' to construct "+$);if(Pe.Z===void 0)throw new we($+" has no accessible constructor");var kt=Pe.Z[Rt.length];if(kt===void 0)throw new we(`Tried to invoke ctor of ${$} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(Pe.Z).toString()}) parameters instead!`);return kt.apply(this,Rt)});var Me=Object.create(_e,{constructor:{value:J}});J.prototype=Me;var Pe=new et($,J,Me,ge,te,S,O,P);if(Pe.B){var ht;(ht=Pe.B).oa??(ht.oa=[]),Pe.B.oa.push(Pe);}return te=new us($,Pe,true,false,false),ht=new us($+"*",Pe,false,false,false),_e=new us($+" const*",Pe,false,true,false),ku[s]={pointerType:ht,Hb:_e},xu(V,J),[te,ht,_e]});},_embind_register_class_class_function:(s,l,f,h,v,S,k)=>{var O=Ea(f,h);l=Nt(l),l=Oo(l),S=sn(v,S),yn([],[s],F=>{function P(){bi(`Cannot call ${$} due to unbound types`,O);}F=F[0];var $=`${F.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var he=F.i.constructor;return he[l]===void 0?(P.fa=f-1,he[l]=P):(ko(he,l,$),he[l].A[f-1]=P),yn([],O,ge=>{if(ge=fs($,[ge[0],null].concat(ge.slice(1)),null,S,k),he[l].A===void 0?(ge.fa=f-1,he[l]=ge):he[l].A[f-1]=ge,F.i.oa)for(let V of F.i.oa)V.constructor.hasOwnProperty(l)||(V.constructor[l]=ge);return []}),[]});},_embind_register_class_class_property:(s,l,f,h,v,S,k,O)=>{l=Nt(l),S=sn(v,S),yn([],[s],F=>{F=F[0];var P=`${F.name}.${l}`,$={get(){bi(`Cannot access ${P} due to unbound types`,[f]);},enumerable:true,configurable:true};return $.set=O?()=>{bi(`Cannot access ${P} due to unbound types`,[f]);}:()=>{throw new we(`${P} is a read-only property`)},Object.defineProperty(F.i.constructor,l,$),yn([],[f],he=>{he=he[0];var ge={get(){return he.fromWireType(S(h))},enumerable:true};return O&&(O=sn(k,O),ge.set=V=>{var J=[];O(h,he.toWireType(J,V)),_a(J);}),Object.defineProperty(F.i.constructor,l,ge),[]}),[]});},_embind_register_class_constructor:(s,l,f,h,v,S)=>{var k=Ea(l,f);v=sn(h,v),yn([],[s],O=>{O=O[0];var F=`constructor ${O.name}`;if(O.i.Z===void 0&&(O.i.Z=[]),O.i.Z[l-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${l-1}) for class '${O.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return O.i.Z[l-1]=()=>{bi(`Cannot construct ${O.name} due to unbound types`,k);},yn([],k,P=>(P.splice(1,0,null),O.i.Z[l-1]=fs(F,P,null,v,S),[])),[]});},_embind_register_class_function:(s,l,f,h,v,S,k,O)=>{var F=Ea(f,h);l=Nt(l),l=Oo(l),S=sn(v,S),yn([],[s],P=>{function $(){bi(`Cannot call ${he} due to unbound types`,F);}P=P[0];var he=`${P.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),O&&P.i.ob.push(l);var ge=P.i.M,V=ge[l];return V===void 0||V.A===void 0&&V.className!==P.name&&V.fa===f-2?($.fa=f-2,$.className=P.name,ge[l]=$):(ko(ge,l,he),ge[l].A[f-2]=$),yn([],F,J=>(J=fs(he,J,P,S,k),ge[l].A===void 0?(J.fa=f-2,ge[l]=J):ge[l].A[f-2]=J,[])),[]});},_embind_register_class_property:(s,l,f,h,v,S,k,O,F,P)=>{l=Nt(l),v=sn(h,v),yn([],[s],$=>{$=$[0];var he=`${$.name}.${l}`,ge={get(){bi(`Cannot access ${he} due to unbound types`,[f,k]);},enumerable:true,configurable:true};return ge.set=F?()=>bi(`Cannot access ${he} due to unbound types`,[f,k]):()=>{throw new we(he+" is a read-only property")},Object.defineProperty($.i.M,l,ge),yn([],F?[f,k]:[f],V=>{var J=V[0],te={get(){var Me=Io(this,$,he+" getter");return J.fromWireType(v(S,Me))},enumerable:true};if(F){F=sn(O,F);var _e=V[1];te.set=function(Me){var Pe=Io(this,$,he+" setter"),ht=[];F(P,Pe,_e.toWireType(ht,Me)),_a(ht);};}return Object.defineProperty($.i.M,l,te),[]}),[]});},_embind_register_emval:s=>ii(s,zd),_embind_register_enum:(s,l,f,h)=>{function v(){}l=Nt(l),v.values={},ii(s,{name:l,constructor:v,fromWireType:function(S){return this.constructor.values[S]},toWireType:(S,k)=>k.value,argPackAdvance:8,readValueFromPointer:jd(l,f,h),L:null}),xo(l,v);},_embind_register_enum_value:(s,l,f)=>{var h=xr(s,"enum");l=Nt(l),s=h.constructor,h=Object.create(h.constructor.prototype,{value:{value:f},constructor:{value:Cr(`${h.name}_${l}`,function(){})}}),s.values[f]=h,s[l]=h;},_embind_register_float:(s,l,f)=>{l=Nt(l),ii(s,{name:l,fromWireType:h=>h,toWireType:(h,v)=>v,argPackAdvance:8,readValueFromPointer:Yd(l,f),L:null});},_embind_register_function:(s,l,f,h,v,S)=>{var k=Ea(l,f);s=Nt(s),s=Oo(s),v=sn(h,v),xo(s,function(){bi(`Cannot call ${s} due to unbound types`,k);},l-1),yn([],k,O=>(xu(s,fs(s,[O[0],null].concat(O.slice(1)),null,v,S),l-1),[]));},_embind_register_integer:(s,l,f,h,v)=>{if(l=Nt(l),v===-1&&(v=4294967295),v=O=>O,h===0){var S=32-8*f;v=O=>O<<S>>>S;}var k=l.includes("unsigned")?function(O,F){return F>>>0}:function(O,F){return F};ii(s,{name:l,fromWireType:v,toWireType:k,argPackAdvance:8,readValueFromPointer:qd(l,f,h!==0),L:null});},_embind_register_memory_view:(s,l,f)=>{function h(S){return new v(ye.buffer,me[S+4>>2],me[S>>2])}var v=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];f=Nt(f),ii(s,{name:f,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{Tb:true});},_embind_register_std_string:(s,l)=>{l=Nt(l);var f=l==="std::string";ii(s,{name:l,fromWireType:function(h){var v=me[h>>2],S=h+4;if(f)for(var k=S,O=0;O<=v;++O){var F=S+O;if(O==v||ce[F]==0){if(k=k?re(ce,k,F-k):"",P===void 0)var P=k;else P+="\0",P+=k;k=F+1;}}else {for(P=Array(v),O=0;O<v;++O)P[O]=String.fromCharCode(ce[S+O]);P=P.join("");}return Zi(h),P},toWireType:function(h,v){v instanceof ArrayBuffer&&(v=new Uint8Array(v));var S=typeof v=="string";if(!(S||v instanceof Uint8Array||v instanceof Uint8ClampedArray||v instanceof Int8Array))throw new we("Cannot pass non-string to std::string");var k=f&&S?tt(v):v.length,O=zu(4+k+1),F=O+4;if(me[O>>2]=k,f&&S)Ke(v,ce,F,k+1);else if(S)for(S=0;S<k;++S){var P=v.charCodeAt(S);if(255<P)throw Zi(F),new we("String has UTF-16 code units that do not fit in 8 bits");ce[F+S]=P;}else for(S=0;S<k;++S)ce[F+S]=v[S];return h!==null&&h.push(Zi,O),O},argPackAdvance:8,readValueFromPointer:Qi,L(h){Zi(h);}});},_embind_register_std_wstring:(s,l,f)=>{if(f=Nt(f),l===2)var h=Wd,v=Qd,S=Xd,k=O=>X[O>>1];else l===4&&(h=Kd,v=Zd,S=Jd,k=O=>me[O>>2]);ii(s,{name:f,fromWireType:O=>{for(var F=me[O>>2],P,$=O+4,he=0;he<=F;++he){var ge=O+4+he*l;(he==F||k(ge)==0)&&($=h($,ge-$),P===void 0?P=$:(P+="\0",P+=$),$=ge+l);}return Zi(O),P},toWireType:(O,F)=>{if(typeof F!="string")throw new we(`Cannot pass non-string to C++ string type ${f}`);var P=S(F),$=zu(4+P+l);return me[$>>2]=P/l,v(F,$+4,P+l),O!==null&&O.push(Zi,$),$},argPackAdvance:8,readValueFromPointer:Qi,L(O){Zi(O);}});},_embind_register_value_object:(s,l,f,h,v,S)=>{as[s]={name:Nt(l),Ta:sn(f,h),O:sn(v,S),eb:[]};},_embind_register_value_object_field:(s,l,f,h,v,S,k,O,F,P)=>{as[s].eb.push({Mb:Nt(l),Sb:f,Qb:sn(h,v),Rb:S,ec:k,dc:sn(O,F),fc:P});},_embind_register_void:(s,l)=>{l=Nt(l),ii(s,{Ic:true,name:l,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(s,l,f)=>ce.copyWithin(s,l,l+f),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(s,l,f)=>(s=Gn(s),l=xr(l,"emval::as"),Du(l,f,s)),_emval_call:(s,l,f,h)=>(s=ds[s],l=Gn(l),s(null,l,f,h)),_emval_call_method:(s,l,f,h,v)=>(s=ds[s],l=Gn(l),f=Pu(f),s(l,l[f],h,v)),_emval_decref:No,_emval_get_method_caller:(s,l,f)=>{var h=ue(s,l),v=h.shift();s--;var S=Array(s);return l=`methodCaller<(${h.map(k=>k.name).join(", ")}) => ${v.name}>`,$d(Cr(l,(k,O,F,P)=>{for(var $=0,he=0;he<s;++he)S[he]=h[he].readValueFromPointer(P+$),$+=h[he].argPackAdvance;return k=f===1?Le(O,S):O.apply(k,S),Du(v,F,k)}))},_emval_get_property:(s,l)=>(s=Gn(s),l=Gn(l),yi(s[l])),_emval_incref:s=>{9<s&&(Ai[s+1]+=1);},_emval_new_array:()=>yi([]),_emval_new_cstring:s=>yi(Pu(s)),_emval_new_object:()=>yi({}),_emval_run_destructors:s=>{var l=Gn(s);_a(l),No(s);},_emval_set_property:(s,l,f)=>{s=Gn(s),l=Gn(l),f=Gn(f),s[l]=f;},_emval_take_value:(s,l)=>(s=xr(s,"_emval_take_value"),s=s.readValueFromPointer(l),yi(s)),_gmtime_js:function(s,l,f){s=new Date(1e3*(l+2097152>>>0<4194305-!!s?(s>>>0)+4294967296*l:NaN)),K[f>>2]=s.getUTCSeconds(),K[f+4>>2]=s.getUTCMinutes(),K[f+8>>2]=s.getUTCHours(),K[f+12>>2]=s.getUTCDate(),K[f+16>>2]=s.getUTCMonth(),K[f+20>>2]=s.getUTCFullYear()-1900,K[f+24>>2]=s.getUTCDay(),K[f+28>>2]=(s.getTime()-Date.UTC(s.getUTCFullYear(),0,1,0,0,0,0))/864e5|0;},_localtime_js:function(s,l,f){s=new Date(1e3*(l+2097152>>>0<4194305-!!s?(s>>>0)+4294967296*l:NaN)),K[f>>2]=s.getSeconds(),K[f+4>>2]=s.getMinutes(),K[f+8>>2]=s.getHours(),K[f+12>>2]=s.getDate(),K[f+16>>2]=s.getMonth(),K[f+20>>2]=s.getFullYear()-1900,K[f+24>>2]=s.getDay(),K[f+28>>2]=(on(s.getFullYear())?hs:Bu)[s.getMonth()]+s.getDate()-1|0,K[f+36>>2]=-(60*s.getTimezoneOffset()),l=new Date(s.getFullYear(),6,1).getTimezoneOffset();var h=new Date(s.getFullYear(),0,1).getTimezoneOffset();K[f+32>>2]=(l!=h&&s.getTimezoneOffset()==Math.min(h,l))|0;},_tzset_js:(s,l,f,h)=>{var v=new Date().getFullYear(),S=new Date(v,0,1),k=new Date(v,6,1);v=S.getTimezoneOffset();var O=k.getTimezoneOffset();me[s>>2]=60*Math.max(v,O),K[l>>2]=+(v!=O),s=F=>F.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1],S=s(S),k=s(k),O<v?(Ke(S,ce,f,17),Ke(k,ce,h,17)):(Ke(S,ce,h,17),Ke(k,ce,f,17));},beginPixelLocalStorageWEBGL:function(s,l,f){(s=ln[s].F.Da)&&s.beginPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},decode_image:function(s,l,f){var h=p.images;h||(h=new Map,p.images=h);var v=new Image;h.set(s,v),l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),v.src=URL.createObjectURL(new Blob([f],{type:"image/png"})),v.onload=function(){p._setWebImage(s,v.width,v.height);};},delete_image:function(s){var l=p.images;l&&l.get(s)&&l.delete(s);},emscripten_asm_const_int:(s,l,f)=>{eh.length=0;for(var h;h=ce[l++];){var v=h!=105;v&=h!=112,f+=v&&f%8?4:0,eh.push(h==112?me[f>>2]:h==105?K[f>>2]:qe[f>>3]),f+=v?8:4;}return lt[s](...eh)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:s=>{var l=ce.length;if(s>>>=0,2147483648<s)return false;for(var f=1;4>=f;f*=2){var h=l*(1+.2/f);h=Math.min(h,s+100663296);var v=Math;h=Math.max(s,h);e:{v=(v.min.call(v,2147483648,h+(65536-h%65536)%65536)-Be.buffer.byteLength+65535)/65536;try{Be.grow(v),Dt();var S=1;break e}catch{}S=void 0;}if(S)return true}return false},emscripten_webgl_enable_extension:(s,l)=>(s=ln[s],l=l?re(ce,l):"",l.startsWith("GL_")&&(l=l.substr(3)),l=="WEBGL_draw_instanced_base_vertex_base_instance"&&gv(q),l=="WEBGL_multi_draw_instanced_base_vertex_base_instance"&&vv(q),l=="WEBGL_multi_draw"&&(q.$b=q.getExtension("WEBGL_multi_draw")),!!s.F.getExtension(l)),emscripten_webgl_get_current_context:()=>Ki?Ki.handle:0,emscripten_webgl_make_context_current:s=>nh(s)?0:-5,enable_WEBGL_provoking_vertex:function(s){return s=ln[s].F,s.pb=s.getExtension("WEBGL_provoking_vertex"),!!s.pb},enable_WEBGL_shader_pixel_local_storage_coherent:function(s){s=ln[s].F;let l=s.getExtension("WEBGL_shader_pixel_local_storage");return l&&l.isCoherent()&&l.framebufferTexturePixelLocalStorageWEBGL.length==5?(s.Da=l,true):false},endPixelLocalStorageWEBGL:function(s,l,f){(s=ln[s].F.Da)&&s.endPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},environ_get:(s,l)=>{var f=0;return Sv().forEach((h,v)=>{var S=l+f;for(v=me[s+4*v>>2]=S,S=0;S<h.length;++S)ye[v++]=h.charCodeAt(S);ye[v]=0,f+=h.length+1;}),0},environ_sizes_get:(s,l)=>{var f=Sv();me[s>>2]=f.length;var h=0;return f.forEach(v=>h+=v.length+1),me[l>>2]=h,0},fd_close:function(s){try{var l=ke(s);if(l.W===null)throw new le(8);l.Qa&&(l.Qa=null);try{l.m.close&&l.m.close(l);}catch(f){throw f}finally{vi[l.W]=null;}return l.W=null,0}catch(f){if(typeof qi>"u"||f.name!=="ErrnoError")throw f;return f.$}},fd_read:function(s,l,f,h){try{e:{var v=ke(s);s=l;for(var S,k=l=0;k<f;k++){var O=me[s>>2],F=me[s+4>>2];s+=8;var P=v,$=S,he=ye;if(0>F||0>$)throw new le(28);if(P.W===null)throw new le(8);if((P.flags&2097155)===1)throw new le(8);if((P.node.mode&61440)===16384)throw new le(31);if(!P.m.read)throw new le(28);var ge=typeof $<"u";if(!ge)$=P.position;else if(!P.seekable)throw new le(70);var V=P.m.read(P,he,O,F,$);ge||(P.position+=V);var J=V;if(0>J){var te=-1;break e}if(l+=J,J<F)break;typeof S<"u"&&(S+=J);}te=l;}return me[h>>2]=te,0}catch(_e){if(typeof qi>"u"||_e.name!=="ErrnoError")throw _e;return _e.$}},fd_seek:function(s,l,f,h,v){l=f+2097152>>>0<4194305-!!l?(l>>>0)+4294967296*f:NaN;try{if(isNaN(l))return 61;var S=ke(s);return Su(S,l,h),Pt=[S.position>>>0,(It=S.position,1<=+Math.abs(It)?0<It?+Math.floor(It/4294967296)>>>0:~~+Math.ceil((It-+(~~It>>>0))/4294967296)>>>0:0)],K[v>>2]=Pt[0],K[v+4>>2]=Pt[1],S.Qa&&l===0&&h===0&&(S.Qa=null),0}catch(k){if(typeof qi>"u"||k.name!=="ErrnoError")throw k;return k.$}},fd_write:function(s,l,f,h){try{e:{var v=ke(s);s=l;for(var S,k=l=0;k<f;k++){var O=me[s>>2],F=me[s+4>>2];s+=8;var P=v,$=O,he=F,ge=S,V=ye;if(0>he||0>ge)throw new le(28);if(P.W===null)throw new le(8);if((P.flags&2097155)===0)throw new le(8);if((P.node.mode&61440)===16384)throw new le(31);if(!P.m.write)throw new le(28);P.seekable&&P.flags&1024&&Su(P,0,2);var J=typeof ge<"u";if(!J)ge=P.position;else if(!P.seekable)throw new le(70);var te=P.m.write(P,V,$,he,ge,void 0);J||(P.position+=te);var _e=te;if(0>_e){var Me=-1;break e}l+=_e,typeof S<"u"&&(S+=_e);}Me=l;}return me[h>>2]=Me,0}catch(Pe){if(typeof qi>"u"||Pe.name!=="ErrnoError")throw Pe;return Pe.$}},framebufferPixelLocalClearValuefvWEBGL:function(s,l,f,h,v,S){(s=ln[s].F.Da)&&s.framebufferPixelLocalClearValuefvWEBGL(l,[f,h,v,S]);},framebufferTexturePixelLocalStorageWEBGL:function(s,l,f,h,v,S){(s=ln[s].F.Da)&&s.framebufferTexturePixelLocalStorageWEBGL(l,ms[f],h,v,S);},glActiveTexture:s=>q.activeTexture(s),glAttachShader:(s,l)=>{q.attachShader(_i[s],wa[l]);},glBindBuffer:(s,l)=>{s==35051?q.Oa=l:s==35052&&(q.ra=l),q.bindBuffer(s,Lo[l]);},glBindBufferRange:(s,l,f,h,v)=>{q.bindBufferRange(s,l,Lo[f],h,v);},glBindFramebuffer:(s,l)=>{q.bindFramebuffer(s,Uu[l]);},glBindRenderbuffer:(s,l)=>{q.bindRenderbuffer(s,Po[l]);},glBindTexture:(s,l)=>{q.bindTexture(s,ms[l]);},glBindVertexArray:s=>{q.bindVertexArray(Fu[s]);},glBlendEquation:s=>q.blendEquation(s),glBlendFunc:(s,l)=>q.blendFunc(s,l),glBlitFramebuffer:(s,l,f,h,v,S,k,O,F,P)=>q.blitFramebuffer(s,l,f,h,v,S,k,O,F,P),glBufferData:(s,l,f,h)=>{f&&l?q.bufferData(s,ce,h,f,l):q.bufferData(s,l,h);},glBufferSubData:(s,l,f,h)=>{f&&q.bufferSubData(s,l,ce,h,f);},glClear:s=>q.clear(s),glClearBufferfv:(s,l,f)=>{q.clearBufferfv(s,l,Ie,f>>2);},glClearBufferuiv:(s,l,f)=>{q.clearBufferuiv(s,l,me,f>>2);},glClearColor:(s,l,f,h)=>q.clearColor(s,l,f,h),glClearDepthf:s=>q.clearDepth(s),glClearStencil:s=>q.clearStencil(s),glColorMask:(s,l,f,h)=>{q.colorMask(!!s,!!l,!!f,!!h);},glCompileShader:s=>{q.compileShader(wa[s]);},glCompressedTexSubImage2D:(s,l,f,h,v,S,k,O,F)=>{q.ra||!O?q.compressedTexSubImage2D(s,l,f,h,v,S,k,O,F):q.compressedTexSubImage2D(s,l,f,h,v,S,k,ce,F,O);},glCreateProgram:()=>{var s=Vu(_i),l=q.createProgram();return l.name=s,l.za=l.xa=l.ya=0,l.Wa=1,_i[s]=l,s},glCreateShader:s=>{var l=Vu(wa);return wa[l]=q.createShader(s),l},glCullFace:s=>q.cullFace(s),glDeleteBuffers:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=Lo[h];v&&(q.deleteBuffer(v),v.name=0,Lo[h]=null,h==q.Oa&&(q.Oa=0),h==q.ra&&(q.ra=0));}},glDeleteFramebuffers:(s,l)=>{for(var f=0;f<s;++f){var h=K[l+4*f>>2],v=Uu[h];v&&(q.deleteFramebuffer(v),v.name=0,Uu[h]=null);}},glDeleteProgram:s=>{if(s){var l=_i[s];l?(q.deleteProgram(l),l.name=0,_i[s]=null):bn||(bn=1281);}},glDeleteRenderbuffers:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=Po[h];v&&(q.deleteRenderbuffer(v),v.name=0,Po[h]=null);}},glDeleteShader:s=>{if(s){var l=wa[s];l?(q.deleteShader(l),wa[s]=null):bn||(bn=1281);}},glDeleteTextures:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=ms[h];v&&(q.deleteTexture(v),v.name=0,ms[h]=null);}},glDeleteVertexArrays:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2];q.deleteVertexArray(Fu[h]),Fu[h]=null;}},glDepthFunc:s=>q.depthFunc(s),glDepthMask:s=>{q.depthMask(!!s);},glDepthRangef:(s,l)=>q.depthRange(s,l),glDisable:s=>q.disable(s),glDrawArrays:(s,l,f)=>{q.drawArrays(s,l,f);},glDrawArraysInstanced:(s,l,f,h)=>{q.drawArraysInstanced(s,l,f,h);},glDrawBuffers:(s,l)=>{for(var f=ah[s],h=0;h<s;h++)f[h]=K[l+4*h>>2];q.drawBuffers(f);},glDrawElements:(s,l,f,h)=>{q.drawElements(s,l,f,h);},glDrawElementsInstanced:(s,l,f,h,v)=>{q.drawElementsInstanced(s,l,f,h,v);},glEnable:s=>q.enable(s),glEnableVertexAttribArray:s=>{q.enableVertexAttribArray(s);},glFlush:()=>q.flush(),glFramebufferRenderbuffer:(s,l,f,h)=>{q.framebufferRenderbuffer(s,l,f,Po[h]);},glFramebufferTexture2D:(s,l,f,h,v)=>{q.framebufferTexture2D(s,l,f,ms[h],v);},glFrontFace:s=>q.frontFace(s),glGenBuffers:(s,l)=>{Bo(s,l,"createBuffer",Lo);},glGenFramebuffers:(s,l)=>{Bo(s,l,"createFramebuffer",Uu);},glGenRenderbuffers:(s,l)=>{Bo(s,l,"createRenderbuffer",Po);},glGenTextures:(s,l)=>{Bo(s,l,"createTexture",ms);},glGenVertexArrays:(s,l)=>{Bo(s,l,"createVertexArray",Fu);},glGenerateMipmap:s=>q.generateMipmap(s),glGetIntegerv:(s,l)=>zw(s,l),glGetProgramiv:(s,l,f)=>{if(f)if(s>=yv)bn||(bn=1281);else if(s=_i[s],l==35716)s=q.getProgramInfoLog(s),s===null&&(s="(unknown error)"),K[f>>2]=s.length+1;else if(l==35719){if(!s.za)for(l=0;l<q.getProgramParameter(s,35718);++l)s.za=Math.max(s.za,q.getActiveUniform(s,l).name.length+1);K[f>>2]=s.za;}else if(l==35722){if(!s.xa)for(l=0;l<q.getProgramParameter(s,35721);++l)s.xa=Math.max(s.xa,q.getActiveAttrib(s,l).name.length+1);K[f>>2]=s.xa;}else if(l==35381){if(!s.ya)for(l=0;l<q.getProgramParameter(s,35382);++l)s.ya=Math.max(s.ya,q.getActiveUniformBlockName(s,l).length+1);K[f>>2]=s.ya;}else K[f>>2]=q.getProgramParameter(s,l);else bn||(bn=1281);},glGetString:s=>{var l=bv[s];if(!l){switch(s){case 7939:l=Hu(Ev().join(" "));break;case 7936:case 7937:case 37445:case 37446:(l=q.getParameter(s))||bn||(bn=1280),l=l?Hu(l):0;break;case 7938:l=Hu(`OpenGL ES 3.0 (${q.getParameter(7938)})`);break;case 35724:l=q.getParameter(35724);var f=l.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);f!==null&&(f[1].length==3&&(f[1]+="0"),l=`OpenGL ES GLSL ES ${f[1]} (${l})`),l=Hu(l);break;default:bn||(bn=1280);}bv[s]=l;}return l},glGetUniformBlockIndex:(s,l)=>q.getUniformBlockIndex(_i[s],l?re(ce,l):""),glGetUniformLocation:(s,l)=>{if(l=l?re(ce,l):"",s=_i[s]){var f=s,h=f.ma,v=f.wb,S;if(!h)for(f.ma=h={},f.vb={},S=0;S<q.getProgramParameter(f,35718);++S){var k=q.getActiveUniform(f,S),O=k.name;k=k.size;var F=wv(O);F=0<F?O.slice(0,F):O;var P=f.Wa;for(f.Wa+=k,v[F]=[k,P],O=0;O<k;++O)h[P]=O,f.vb[P++]=F;}if(f=s.ma,h=0,v=l,S=wv(l),0<S&&(h=parseInt(l.slice(S+1))>>>0,v=l.slice(0,S)),(v=s.wb[v])&&h<v[0]&&(h+=v[1],f[h]=f[h]||q.getUniformLocation(s,l)))return h}else bn||(bn=1281);return -1},glInvalidateFramebuffer:(s,l,f)=>{for(var h=ah[l],v=0;v<l;v++)h[v]=K[f+4*v>>2];q.invalidateFramebuffer(s,h);},glLinkProgram:s=>{s=_i[s],q.linkProgram(s),s.ma=0,s.wb={};},glPixelStorei:(s,l)=>{s==3317?th=l:s==3314&&(_v=l),q.pixelStorei(s,l);},glReadPixels:(s,l,f,h,v,S,k)=>{if(q.Oa)q.readPixels(s,l,f,h,v,S,k);else {var O=sh(S);k>>>=31-Math.clz32(O.BYTES_PER_ELEMENT),q.readPixels(s,l,f,h,v,S,O,k);}},glRenderbufferStorageMultisample:(s,l,f,h,v)=>q.renderbufferStorageMultisample(s,l,f,h,v),glScissor:(s,l,f,h)=>q.scissor(s,l,f,h),glShaderSource:(s,l,f,h)=>{for(var v="",S=0;S<l;++S){var k=(k=me[f+4*S>>2])?re(ce,k,h?me[h+4*S>>2]:void 0):"";v+=k;}q.shaderSource(wa[s],v);},glStencilFunc:(s,l,f)=>q.stencilFunc(s,l,f),glStencilFuncSeparate:(s,l,f,h)=>q.stencilFuncSeparate(s,l,f,h),glStencilMask:s=>q.stencilMask(s),glStencilOp:(s,l,f)=>q.stencilOp(s,l,f),glStencilOpSeparate:(s,l,f,h)=>q.stencilOpSeparate(s,l,f,h),glTexParameteri:(s,l,f)=>q.texParameteri(s,l,f),glTexStorage2D:(s,l,f,h,v)=>q.texStorage2D(s,l,f,h,v),glTexStorage3D:(s,l,f,h,v,S)=>q.texStorage3D(s,l,f,h,v,S),glTexSubImage2D:(s,l,f,h,v,S,k,O,F)=>{if(q.ra)q.texSubImage2D(s,l,f,h,v,S,k,O,F);else if(F){var P=sh(O);q.texSubImage2D(s,l,f,h,v,S,k,O,P,F>>>31-Math.clz32(P.BYTES_PER_ELEMENT));}else {if(F){P=sh(O);var $=S*((_v||v)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[k-6402]||1)*P.BYTES_PER_ELEMENT+th-1&-th);F=P.subarray(F>>>31-Math.clz32(P.BYTES_PER_ELEMENT),F+$>>>31-Math.clz32(P.BYTES_PER_ELEMENT));}else F=null;q.texSubImage2D(s,l,f,h,v,S,k,O,F);}},glUniform1i:(s,l)=>{var f=q,h=f.uniform1i,v=q.Ib;if(v){var S=v.ma[s];typeof S=="number"&&(v.ma[s]=S=q.getUniformLocation(v,v.vb[s]+(0<S?`[${S}]`:""))),s=S;}else bn||(bn=1282),s=void 0;h.call(f,s,l);},glUniformBlockBinding:(s,l,f)=>{s=_i[s],q.uniformBlockBinding(s,l,f);},glUseProgram:s=>{s=_i[s],q.useProgram(s),q.Ib=s;},glVertexAttribDivisor:(s,l)=>{q.vertexAttribDivisor(s,l);},glVertexAttribIPointer:(s,l,f,h,v)=>{q.vertexAttribIPointer(s,l,f,h,v);},glVertexAttribPointer:(s,l,f,h,v,S)=>{q.vertexAttribPointer(s,l,f,!!h,v,S);},glViewport:(s,l,f,h)=>q.viewport(s,l,f,h),invoke_vii:jw,isWindowsBrowser:function(){return -1<navigator.platform.indexOf("Win")},provokingVertexWEBGL:function(s,l){(s=ln[s].F.pb)&&s.provokingVertexWEBGL(l);},strftime:Cv,strftime_l:(s,l,f,h)=>Cv(s,l,f,h),upload_image:function(s,l){var f=p.images;f&&(l=f.get(l))&&(s=ln[s].F,s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,l),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false));},wasm_start_image_decode:function(s,l,f){l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),createImageBitmap(new Blob([f])).then(function(h){var v=new OffscreenCanvas(h.width,h.height).getContext("2d");v.drawImage(h,0,0),v=v.getImageData(0,0,h.width,h.height);var S=v.data.length,k=p.Cb(S);p.oc.set(v.data,k),p.qc(s,h.width,h.height,k,S);}).catch(function(h){h=h.message||"decode failed";var v=p.Jc(h)+1,S=p.Cb(v);p.Rc(h,S,v),p.rc(s,S),p.pc(S);});}},at=(function(){function s(f){return at=f.exports,Be=at.memory,Dt(),Ou=at.__indirect_function_table,Qe.unshift(at.__wasm_call_ctors),Et--,p.monitorRunDependencies?.(Et),Et==0&&(Lt&&(f=Lt,Lt=null,f())),at}var l={env:kv,wasi_snapshot_preview1:kv};if(Et++,p.monitorRunDependencies?.(Et),p.instantiateWasm)try{return p.instantiateWasm(l,s)}catch(f){Ce(`Module.instantiateWasm callback failed with error: ${f}`),C(f);}return Un||(Un=Xe("webgl2_advanced.wasm")?"webgl2_advanced.wasm":p.locateFile?p.locateFile("webgl2_advanced.wasm",H):H+"webgl2_advanced.wasm"),tn(l,function(f){s(f.instance);}).catch(C),{}})(),Zi=s=>(Zi=at.free)(s),zu=s=>(zu=at.malloc)(s);p._setWebImage=(s,l,f)=>(p._setWebImage=at.setWebImage)(s,l,f);var xv=s=>(xv=at.__getTypeName)(s);p._wasm_image_decode_complete=(s,l,f,h,v)=>(p._wasm_image_decode_complete=at.wasm_image_decode_complete)(s,l,f,h,v),p._wasm_image_decode_error=(s,l)=>(p._wasm_image_decode_error=at.wasm_image_decode_error)(s,l);var Ov=p._ma_device__on_notification_unlocked=s=>(Ov=p._ma_device__on_notification_unlocked=at.ma_device__on_notification_unlocked)(s);p._ma_malloc_emscripten=(s,l)=>(p._ma_malloc_emscripten=at.ma_malloc_emscripten)(s,l),p._ma_free_emscripten=(s,l)=>(p._ma_free_emscripten=at.ma_free_emscripten)(s,l);var Iv=p._ma_device_process_pcm_frames_capture__webaudio=(s,l,f)=>(Iv=p._ma_device_process_pcm_frames_capture__webaudio=at.ma_device_process_pcm_frames_capture__webaudio)(s,l,f),Nv=p._ma_device_process_pcm_frames_playback__webaudio=(s,l,f)=>(Nv=p._ma_device_process_pcm_frames_playback__webaudio=at.ma_device_process_pcm_frames_playback__webaudio)(s,l,f),Dv=(s,l)=>(Dv=at.setThrew)(s,l),Lv=s=>(Lv=at._emscripten_stack_restore)(s),Pv=()=>(Pv=at.emscripten_stack_get_current)();p.dynCall_iiiji=(s,l,f,h,v,S)=>(p.dynCall_iiiji=at.dynCall_iiiji)(s,l,f,h,v,S),p.dynCall_iij=(s,l,f,h)=>(p.dynCall_iij=at.dynCall_iij)(s,l,f,h),p.dynCall_iiji=(s,l,f,h,v)=>(p.dynCall_iiji=at.dynCall_iiji)(s,l,f,h,v),p.dynCall_jii=(s,l,f)=>(p.dynCall_jii=at.dynCall_jii)(s,l,f),p.dynCall_vijj=(s,l,f,h,v,S)=>(p.dynCall_vijj=at.dynCall_vijj)(s,l,f,h,v,S),p.dynCall_jiji=(s,l,f,h,v)=>(p.dynCall_jiji=at.dynCall_jiji)(s,l,f,h,v),p.dynCall_viijii=(s,l,f,h,v,S,k)=>(p.dynCall_viijii=at.dynCall_viijii)(s,l,f,h,v,S,k),p.dynCall_iiiiij=(s,l,f,h,v,S,k)=>(p.dynCall_iiiiij=at.dynCall_iiiiij)(s,l,f,h,v,S,k),p.dynCall_iiiiijj=(s,l,f,h,v,S,k,O,F)=>(p.dynCall_iiiiijj=at.dynCall_iiiiijj)(s,l,f,h,v,S,k,O,F),p.dynCall_iiiiiijj=(s,l,f,h,v,S,k,O,F,P)=>(p.dynCall_iiiiiijj=at.dynCall_iiiiiijj)(s,l,f,h,v,S,k,O,F,P);function jw(s,l,f){var h=Pv();try{Sa(s)(l,f);}catch(v){if(Lv(h),v!==v+0)throw v;Dv(1,0);}}var ju;Lt=function s(){ju||Bv(),ju||(Lt=s);};function Bv(){function s(){if(!ju&&(ju=true,p.calledRun=true,!fe)){if(p.noFSInit||Eu||(Eu=true,p.stdin=p.stdin,p.stdout=p.stdout,p.stderr=p.stderr,p.stdin?ga("stdin",p.stdin):Yi("/dev/tty","/dev/stdin"),p.stdout?ga("stdout",null,p.stdout):Yi("/dev/tty","/dev/stdout"),p.stderr?ga("stderr",null,p.stderr):Yi("/dev/tty1","/dev/stderr"),ts("/dev/stdin",0),ts("/dev/stdout",1),ts("/dev/stderr",1)),xi=false,Re(Qe),_(p),p.onRuntimeInitialized&&p.onRuntimeInitialized(),p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;){var l=p.postRun.shift();Wt.unshift(l);}Re(Wt);}}if(!(0<Et)){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)en();Re(Je),0<Et||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("");},1),s();},1)):s());}}if(p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);0<p.preInit.length;)p.preInit.pop()();return Bv(),A=N,A})})();let d=u;}),(r=>{r.exports=JSON.parse(`{"name":"@rive-app/webgl2","version":"2.38.0","description":"Rive's webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`);}),((r,a,o)=>{o.r(a),o.d(a,{AudioAssetWrapper:()=>y.AudioAssetWrapper,AudioWrapper:()=>y.AudioWrapper,BLANK_URL:()=>g.BLANK_URL,CustomFileAssetLoaderWrapper:()=>y.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>y.FileAssetWrapper,FileFinalizer:()=>y.FileFinalizer,FocusSessionState:()=>d.FocusSessionState,FontAssetWrapper:()=>y.FontAssetWrapper,FontWrapper:()=>y.FontWrapper,ImageAssetWrapper:()=>y.ImageAssetWrapper,ImageWrapper:()=>y.ImageWrapper,KeyboardInteractions:()=>d.KeyboardInteractions,RiveFont:()=>A.RiveFont,createFinalization:()=>y.createFinalization,finalizationRegistry:()=>y.finalizationRegistry,registerTouchInteractions:()=>u.registerTouchInteractions,sanitizeUrl:()=>g.sanitizeUrl});var u=o(7),d=o(8),g=o(9),y=o(10),A=o(11);}),((r,a,o)=>{o.r(a),o.d(a,{registerTouchInteractions:()=>y});var u=void 0,d=function(A,p,_){var C,N=[];if(p)for(var B=0;B<A.length;B++){var M=A[B];N.push({clientX:M.clientX,clientY:M.clientY,identifier:M.identifier});}else {var w=_!==null?(C=Array.from(A).find(function(R){return R.identifier===_}))!==null&&C!==void 0?C:null:A[0];w&&N.push({clientX:w.clientX,clientY:w.clientY,identifier:w.identifier});}return N},g=function(A,p,_,C){var N,B=A;return !((N=B.changedTouches)===null||N===void 0)&&N.length?(!p&&["touchstart","touchmove"].includes(A.type)&&A.preventDefault(),d(B.changedTouches,_,C)):[{clientX:A.clientX,clientY:A.clientY,identifier:0}]},y=function(A){var p=A.canvas,_=A.artboard,C=A.stateMachines,N=C===void 0?[]:C,B=A.renderer,M=A.rive,w=A.fit,R=A.alignment,D=A.isTouchScrollEnabled,G=D===void 0?false:D,ne=A.dispatchPointerExit,U=ne===void 0?true:ne,H=A.enableMultiTouch,ee=H===void 0?false:H,Q=A.layoutScaleFactor,Ee=Q===void 0?1:Q,Ce=A.advanceAndDrain;if(!p||!N.length||!B||!M||!_||typeof window>"u")return null;var Ue=null,Be=false,fe=null,ye=function(X){var K;if(Be&&X instanceof MouseEvent){X.type=="mouseup"&&(Be=false);return}Be=G&&X.type==="touchend"&&Ue==="touchstart",Ue=X.type;var me=X.currentTarget.getBoundingClientRect();if(!ee&&X.type==="touchstart"&&fe===null){var Ie=(K=X.changedTouches)===null||K===void 0?void 0:K[0];Ie&&(fe=Ie.identifier);}var qe=g(X,G,ee,ee?null:fe),Dt=M.computeAlignment(w,R,{minX:0,minY:0,maxX:me.width,maxY:me.height},_.bounds,Ee),Je=new M.Mat2D;switch(Dt.invert(Je),qe.forEach(function(lt){var Re=lt.clientX,b=lt.clientY;if(!(!Re&&!b)){var c=Re-me.left,m=b-me.top,E=new M.Vec2D(c,m),x=M.mapXY(Je,E),L=x.x(),z=x.y();lt.transformedX=L,lt.transformedY=z,x.delete(),E.delete();}}),Je.delete(),Dt.delete(),X.type){case "mouseout":for(var Qe=function(lt){U?qe.forEach(function(Re){lt.pointerExit(Re.transformedX,Re.transformedY,Re.identifier);}):qe.forEach(function(Re){lt.pointerMove(Re.transformedX,Re.transformedY,Re.identifier);});},Wt=0,en=N;Wt<en.length;Wt++){var Et=en[Wt];Qe(Et);}break;case "touchmove":case "mouseover":case "mousemove":{for(var kn=function(lt){qe.forEach(function(Re){lt.pointerMove(Re.transformedX,Re.transformedY,Re.identifier);});},Lt=0,wn=N;Lt<wn.length;Lt++){var Et=wn[Lt];kn(Et);}break}case "touchstart":case "mousedown":{for(var Xe=function(lt){qe.forEach(function(Re){lt.pointerDown(Re.transformedX,Re.transformedY,Re.identifier);});},Ne=0,Un=N;Ne<Un.length;Ne++){var Et=Un[Ne];Xe(Et);}Ce(0);break}case "touchend":{for(var Mn=function(lt){qe.forEach(function(Re){lt.pointerUp(Re.transformedX,Re.transformedY,Re.identifier),lt.pointerExit(Re.transformedX,Re.transformedY,Re.identifier);});},xn=0,Qt=N;xn<Qt.length;xn++){var Et=Qt[xn];Mn(Et);}Ce(0),!ee&&qe.some(function(lt){return lt.identifier===fe})&&(fe=null);break}case "mouseup":{for(var tn=function(lt){qe.forEach(function(Re){lt.pointerUp(Re.transformedX,Re.transformedY,Re.identifier);});},It=0,Pt=N;It<Pt.length;It++){var Et=Pt[It];tn(Et);}Ce(0);break}}},ce=function(){fe=null;},j=ye.bind(u);return p.addEventListener("mouseover",j),p.addEventListener("mouseout",j),p.addEventListener("mousemove",j),p.addEventListener("mousedown",j),p.addEventListener("mouseup",j),p.addEventListener("touchmove",j,{passive:G}),p.addEventListener("touchstart",j,{passive:G}),p.addEventListener("touchend",j),p.addEventListener("touchcancel",ce),function(){p.removeEventListener("mouseover",j),p.removeEventListener("mouseout",j),p.removeEventListener("mousemove",j),p.removeEventListener("mousedown",j),p.removeEventListener("mouseup",j),p.removeEventListener("touchmove",j),p.removeEventListener("touchstart",j),p.removeEventListener("touchend",j),p.removeEventListener("touchcancel",ce);}};}),((r,a,o)=>{o.r(a),o.d(a,{FocusSessionState:()=>u,KeyboardInteractions:()=>d});var u;(function(g){g.NotFocused="notFocused",g.EntryPending="entryPending",g.RiveFocused="riveFocused";})(u||(u={}));var d=(function(){function g(y){var A=y.canvas,p=y.stateMachine,_=y.hasFocusNodes,C=this;this.focusSessionState=u.NotFocused,this.onCanvasFocus=function(N){if(C.hasFocusNodes&&!C.mainSm.focusState().hasFocus&&(C.focusSessionState=u.EntryPending,!!C.isKeyboardDrivenFocus())){var B=C.cameFromBeforeCanvas(N.relatedTarget);(B?C.mainSm.focusNext():C.mainSm.focusPrevious())&&(C.focusSessionState=u.RiveFocused);}},this.onCanvasBlur=function(N){C.focusSessionState=u.NotFocused;},this.onKeyDown=function(N){if(C.focusSessionState!==u.NotFocused&&N.code==="Tab"&&C.hasFocusNodes){var B=!N.shiftKey,M=B?C.mainSm.focusNext():C.mainSm.focusPrevious();M?(C.focusSessionState=u.RiveFocused,N.preventDefault()):C.focusSessionState=u.NotFocused;}},this.canvas=A,this.mainSm=p,this.hasFocusNodes=_,A.addEventListener("focus",this.onCanvasFocus),A.addEventListener("blur",this.onCanvasBlur),A.addEventListener("keydown",this.onKeyDown);}return g.prototype.setFocusSessionState=function(y){this.focusSessionState=y;},g.prototype.notifyRiveFocused=function(){this.focusSessionState=u.RiveFocused;},g.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return false}},g.prototype.cameFromBeforeCanvas=function(y){if(!y)return true;var A=this.canvas.compareDocumentPosition(y);return A&Node.DOCUMENT_POSITION_PRECEDING?true:!(A&Node.DOCUMENT_POSITION_FOLLOWING)},g.prototype.cleanup=function(){this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown);},g})();}),((r,a,o)=>{o.r(a),o.d(a,{BLANK_URL:()=>_,sanitizeUrl:()=>B});var u=/^([^\w]*)(javascript|data|vbscript)/im,d=/&#(\w+)(^\w|;)?/g,g=/&(newline|tab);/gi,y=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,A=/^.+(:|&colon;)/gim,p=[".","/"],_="about:blank";function C(M){return p.indexOf(M[0])>-1}function N(M){var w=M.replace(y,"");return w.replace(d,function(R,D){return String.fromCharCode(D)})}function B(M){if(!M)return _;var w=N(M).replace(g,"").replace(y,"").trim();if(!w)return _;if(C(w))return w;var R=w.match(A);if(!R)return w;var D=R[0];return u.test(D)?_:w}}),((r,a,o)=>{o.r(a),o.d(a,{AudioAssetWrapper:()=>M,AudioWrapper:()=>p,CustomFileAssetLoaderWrapper:()=>C,FileAssetWrapper:()=>N,FileFinalizer:()=>d,FontAssetWrapper:()=>w,FontWrapper:()=>_,ImageAssetWrapper:()=>B,ImageWrapper:()=>A,createFinalization:()=>ne,finalizationRegistry:()=>G});var u=(function(){var U=function(H,ee){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,Ee){Q.__proto__=Ee;}||function(Q,Ee){for(var Ce in Ee)Object.prototype.hasOwnProperty.call(Ee,Ce)&&(Q[Ce]=Ee[Ce]);},U(H,ee)};return function(H,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");U(H,ee);function Q(){this.constructor=H;}H.prototype=ee===null?Object.create(ee):(Q.prototype=ee.prototype,new Q);}})(),d=(function(){function U(H){this.selfUnref=false,this._file=H;}return U.prototype.unref=function(){this._file&&this._file.unref();},U})(),g=(function(){function U(H){this._finalizableObject=H;}return U.prototype.unref=function(){this._finalizableObject.unref();},U})(),y=(function(){function U(){this.selfUnref=false;}return U.prototype.unref=function(){},U})(),A=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeImage=ee,Q}return Object.defineProperty(H.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref();},H})(y),p=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeAudio=ee,Q}return Object.defineProperty(H.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref();},H})(y),_=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeFont=ee,Q}return Object.defineProperty(H.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref();},H})(y),C=(function(){function U(H,ee){this._assetLoaderCallback=ee,this.assetLoader=new H.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)});}return U.prototype.loadContents=function(H,ee){var Q;if(H.isImage)Q=new B(H);else if(H.isAudio)Q=new M(H);else if(H.isFont)Q=new w(H);else return false;return this._assetLoaderCallback(Q,ee)},U})(),N=(function(){function U(H){this._nativeFileAsset=H;}return U.prototype.decode=function(H){this._nativeFileAsset.decode(H);},Object.defineProperty(U.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:false,configurable:true}),U})(),B=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setRenderImage=function(ee){this._nativeFileAsset.setRenderImage(ee.nativeImage);},H})(N),M=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setAudioSource=function(ee){this._nativeFileAsset.setAudioSource(ee.nativeAudio);},H})(N),w=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setFont=function(ee){this._nativeFileAsset.setFont(ee.nativeFont);},H})(N),R=(function(){function U(H){}return U.prototype.register=function(H){H.selfUnref=true;},U.prototype.unregister=function(H){},U})(),D=typeof FinalizationRegistry<"u"?FinalizationRegistry:R,G=new D(function(U){U?.unref();}),ne=function(U,H){var ee=new g(H);G.register(U,ee);};}),((r,a,o)=>{o.r(a),o.d(a,{RiveFont:()=>d});var u=o(3),d=(function(){function g(){}return g.setFallbackFontCallback=function(y){g._fallbackFontCallback=y??null,g._wireFallbackProc();},g._fontToPtr=function(y){var A;if(y==null)return null;var p=y.nativeFont,_=(A=p?.ptr)===null||A===void 0?void 0:A.call(p);return _??null},g._getFallbackPtr=function(y,A){return A<0||A>=y.length?null:g._fontToPtr(y[A])},g._wireFallbackProc=function(){u.RuntimeLoader.getInstance(function(y){var A=g._fallbackFontCallback;A?y.setFallbackFontCallback((function(p,_,C){var N=A(p,C);return N?Array.isArray(N)?g._getFallbackPtr(N,_):_===0?g._fontToPtr(N):null:null})):y.setFallbackFontCallback(null);});},g._fallbackFontCallback=null,g})();})],e={};function n(r){var a=e[r];if(a!==void 0)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(r,a)=>{for(var o in a)n.o(a,o)&&!n.o(r,o)&&Object.defineProperty(r,o,{enumerable:true,get:a[o]});},n.o=(r,a)=>Object.prototype.hasOwnProperty.call(r,a),n.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:true});};var i={};return (()=>{n.r(i),n.d(i,{Alignment:()=>N,DataEnum:()=>Je,DataType:()=>qe,DrawOptimizationOptions:()=>B,EventType:()=>Q,Fit:()=>C,Layout:()=>M,LoopType:()=>Ee,Rive:()=>Ie,RiveEventType:()=>D,RiveFile:()=>me,RiveFont:()=>o.RiveFont,RuntimeLoader:()=>a.RuntimeLoader,StateMachineInput:()=>R,StateMachineInputType:()=>w,Testing:()=>It,ViewModel:()=>Dt,ViewModelInstance:()=>Wt,ViewModelInstanceArtboard:()=>xn,ViewModelInstanceAssetImage:()=>Mn,ViewModelInstanceBoolean:()=>Lt,ViewModelInstanceColor:()=>Un,ViewModelInstanceEnum:()=>Xe,ViewModelInstanceList:()=>Ne,ViewModelInstanceNumber:()=>kn,ViewModelInstanceString:()=>Et,ViewModelInstanceTrigger:()=>wn,ViewModelInstanceValue:()=>en,decodeAudio:()=>Pt,decodeFont:()=>Re,decodeImage:()=>lt});var r=n(1),a=n(3),o=n(6),u=(function(){var b=function(c,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,x){E.__proto__=x;}||function(E,x){for(var L in x)Object.prototype.hasOwnProperty.call(x,L)&&(E[L]=x[L]);},b(c,m)};return function(c,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");b(c,m);function E(){this.constructor=c;}c.prototype=m===null?Object.create(m):(E.prototype=m.prototype,new E);}})(),d=function(){return d=Object.assign||function(b){for(var c,m=1,E=arguments.length;m<E;m++){c=arguments[m];for(var x in c)Object.prototype.hasOwnProperty.call(c,x)&&(b[x]=c[x]);}return b},d.apply(this,arguments)},g=function(b,c,m,E){function x(L){return L instanceof m?L:new m(function(z){z(L);})}return new(m||(m=Promise))(function(L,z){function ae(pe){try{re(E.next(pe));}catch(tt){z(tt);}}function be(pe){try{re(E.throw(pe));}catch(tt){z(tt);}}function re(pe){pe.done?L(pe.value):x(pe.value).then(ae,be);}re((E=E.apply(b,[])).next());})},y=function(b,c){var m={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},E,x,L,z=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return z.next=ae(0),z.throw=ae(1),z.return=ae(2),typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function ae(re){return function(pe){return be([re,pe])}}function be(re){if(E)throw new TypeError("Generator is already executing.");for(;z&&(z=0,re[0]&&(m=0)),m;)try{if(E=1,x&&(L=re[0]&2?x.return:re[0]?x.throw||((L=x.return)&&L.call(x),0):x.next)&&!(L=L.call(x,re[1])).done)return L;switch(x=0,L&&(re=[re[0]&2,L.value]),re[0]){case 0:case 1:L=re;break;case 4:return m.label++,{value:re[1],done:!1};case 5:m.label++,x=re[1],re=[0];continue;case 7:re=m.ops.pop(),m.trys.pop();continue;default:if(L=m.trys,!(L=L.length>0&&L[L.length-1])&&(re[0]===6||re[0]===2)){m=0;continue}if(re[0]===3&&(!L||re[1]>L[0]&&re[1]<L[3])){m.label=re[1];break}if(re[0]===6&&m.label<L[1]){m.label=L[1],L=re;break}if(L&&m.label<L[2]){m.label=L[2],m.ops.push(re);break}L[2]&&m.ops.pop(),m.trys.pop();continue}re=c.call(b,m);}catch(pe){re=[6,pe],x=0;}finally{E=L=0;}if(re[0]&5)throw re[1];return {value:re[0]?re[1]:void 0,done:true}}},A=function(b,c,m){for(var E=0,x=c.length,L;E<x;E++)(L||!(E in c))&&(L||(L=Array.prototype.slice.call(c,0,E)),L[E]=c[E]);return b.concat(L||Array.prototype.slice.call(c))},p=(function(b){u(c,b);function c(){var m=b!==null&&b.apply(this,arguments)||this;return m.isHandledError=true,m}return c})(Error),_=function(b){return b&&b.isHandledError?b.message:"Problem loading file; may be corrupt!"},C;(function(b){b.Cover="cover",b.Contain="contain",b.Fill="fill",b.FitWidth="fitWidth",b.FitHeight="fitHeight",b.None="none",b.ScaleDown="scaleDown",b.Layout="layout";})(C||(C={}));var N;(function(b){b.Center="center",b.TopLeft="topLeft",b.TopCenter="topCenter",b.TopRight="topRight",b.CenterLeft="centerLeft",b.CenterRight="centerRight",b.BottomLeft="bottomLeft",b.BottomCenter="bottomCenter",b.BottomRight="bottomRight";})(N||(N={}));var B;(function(b){b.AlwaysDraw="alwaysDraw",b.DrawOnChanged="drawOnChanged";})(B||(B={}));var M=(function(){function b(c){var m,E,x,L,z,ae,be;this.fit=(m=c?.fit)!==null&&m!==void 0?m:C.Contain,this.alignment=(E=c?.alignment)!==null&&E!==void 0?E:N.Center,this.layoutScaleFactor=(x=c?.layoutScaleFactor)!==null&&x!==void 0?x:1,this.minX=(L=c?.minX)!==null&&L!==void 0?L:0,this.minY=(z=c?.minY)!==null&&z!==void 0?z:0,this.maxX=(ae=c?.maxX)!==null&&ae!==void 0?ae:0,this.maxY=(be=c?.maxY)!==null&&be!==void 0?be:0;}return b.new=function(c){var m=c.fit,E=c.alignment,x=c.minX,L=c.minY,z=c.maxX,ae=c.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new b({fit:m,alignment:E,minX:x,minY:L,maxX:z,maxY:ae})},b.prototype.copyWith=function(c){var m=c.fit,E=c.alignment,x=c.layoutScaleFactor,L=c.minX,z=c.minY,ae=c.maxX,be=c.maxY;return new b({fit:m??this.fit,alignment:E??this.alignment,layoutScaleFactor:x??this.layoutScaleFactor,minX:L??this.minX,minY:z??this.minY,maxX:ae??this.maxX,maxY:be??this.maxY})},b.prototype.runtimeFit=function(c){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var m;return this.fit===C.Cover?m=c.Fit.cover:this.fit===C.Contain?m=c.Fit.contain:this.fit===C.Fill?m=c.Fit.fill:this.fit===C.FitWidth?m=c.Fit.fitWidth:this.fit===C.FitHeight?m=c.Fit.fitHeight:this.fit===C.ScaleDown?m=c.Fit.scaleDown:this.fit===C.Layout?m=c.Fit.layout:m=c.Fit.none,this.cachedRuntimeFit=m,m},b.prototype.runtimeAlignment=function(c){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var m;return this.alignment===N.TopLeft?m=c.Alignment.topLeft:this.alignment===N.TopCenter?m=c.Alignment.topCenter:this.alignment===N.TopRight?m=c.Alignment.topRight:this.alignment===N.CenterLeft?m=c.Alignment.centerLeft:this.alignment===N.CenterRight?m=c.Alignment.centerRight:this.alignment===N.BottomLeft?m=c.Alignment.bottomLeft:this.alignment===N.BottomCenter?m=c.Alignment.bottomCenter:this.alignment===N.BottomRight?m=c.Alignment.bottomRight:m=c.Alignment.center,this.cachedRuntimeAlignment=m,m},b})(),w;(function(b){b[b.Number=56]="Number",b[b.Trigger=58]="Trigger",b[b.Boolean=59]="Boolean";})(w||(w={}));var R=(function(){function b(c,m){this.type=c,this.runtimeInput=m;}return Object.defineProperty(b.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(c){this.runtimeInput.value=c;},enumerable:false,configurable:true}),b.prototype.fire=function(){this.type===w.Trigger&&this.runtimeInput.fire();},b.prototype.delete=function(){this.runtimeInput=null;},b})(),D;(function(b){b[b.General=128]="General",b[b.OpenUrl=131]="OpenUrl";})(D||(D={}));var G=(function(){function b(c){this.isBindableArtboard=false,this.isBindableArtboard=c;}return b})(),ne=(function(b){u(c,b);function c(m,E){var x=b.call(this,false)||this;return x.nativeArtboard=m,x.file=E,x}return c})(G),U=(function(b){u(c,b);function c(m){var E=b.call(this,true)||this;return E.selfUnref=false,E.nativeArtboard=m,E}return Object.defineProperty(c.prototype,"viewModel",{set:function(m){this.nativeViewModel=m.nativeInstance;},enumerable:false,configurable:true}),c.prototype.destroy=function(){var m;this.selfUnref&&(this.nativeArtboard.unref(),(m=this.nativeViewModel)===null||m===void 0||m.unref());},c})(G),H=(function(){function b(c,m,E,x){this.stateMachine=c,this.playing=E,this.artboard=x,this.inputs=[],this.instance=new m.StateMachineInstance(c,x),this.initInputs(m),this.hasFocusNodes=this.instance.hasFocusNodes();}return Object.defineProperty(b.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"statesChanged",{get:function(){for(var c=[],m=0;m<this.instance.stateChangedCount();m++)c.push(this.instance.stateChangedNameByIndex(m));return c},enumerable:false,configurable:true}),b.prototype.advance=function(c){this.instance.advance(c);},b.prototype.advanceAndApply=function(c){this.instance.advanceAndApply(c);},b.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},b.prototype.reportedEventAt=function(c){return this.instance.reportedEventAt(c)},b.prototype.initInputs=function(c){for(var m=0;m<this.instance.inputCount();m++){var E=this.instance.input(m);this.inputs.push(this.mapRuntimeInput(E,c));}},b.prototype.mapRuntimeInput=function(c,m){if(c.type===m.SMIInput.bool)return new R(w.Boolean,c.asBool());if(c.type===m.SMIInput.number)return new R(w.Number,c.asNumber());if(c.type===m.SMIInput.trigger)return new R(w.Trigger,c.asTrigger())},b.prototype.cleanup=function(){this.inputs.forEach(function(c){c.delete();}),this.inputs.length=0,this.instance.delete();},b.prototype.bindViewModelInstance=function(c){c.runtimeInstance!=null&&this.instance.bindViewModelInstance(c.runtimeInstance);},b.prototype.focusState=function(){return this.instance.focusState()},b.prototype.clearFocus=function(){this.instance.clearFocus();},b})(),ee=(function(){function b(c,m,E,x,L){x===void 0&&(x=[]),L===void 0&&(L=[]),this.runtime=c,this.artboard=m,this.eventManager=E,this.animations=x,this.stateMachines=L;}return b.prototype.add=function(c,m,E){if(E===void 0&&(E=true),c=tn(c),c.length===0)this.animations.forEach(function(De){return De.playing=m}),this.stateMachines.forEach(function(De){return De.playing=m});else for(var x=this.animations.map(function(De){return De.name}),L=this.stateMachines.map(function(De){return De.name}),z=0;z<c.length;z++){var ae=x.indexOf(c[z]),be=L.indexOf(c[z]);if(ae>=0||be>=0)ae>=0?this.animations[ae].playing=m:this.stateMachines[be].playing=m;else {var re=this.artboard.animationByName(c[z]);if(re){var pe=new r.Animation(re,this.artboard,this.runtime,m);pe.advance(0),pe.apply(1),this.animations.push(pe);}else {var tt=this.artboard.stateMachineByName(c[z]);if(tt){var Ke=new H(tt,this.runtime,m,this.artboard);this.stateMachines.push(Ke);}}}}return E&&(m?this.eventManager.fire({type:Q.Play,data:this.playing}):this.eventManager.fire({type:Q.Pause,data:this.paused})),m?this.playing:this.paused},b.prototype.initLinearAnimations=function(c,m,E){E===void 0&&(E=false);for(var x=this.animations.map(function(pe){return pe.name}),L=0;L<c.length;L++){var z=x.indexOf(c[L]);if(z>=0)this.animations[z].playing=m;else {var ae=this.artboard.animationByName(c[L]);if(ae){var be=new r.Animation(ae,this.artboard,this.runtime,m);be.advance(0),be.apply(1),this.animations.push(be);}else if(E){var re="State Machine with name ".concat(c[L]," not found");throw new p(re)}else console.error("Animation with name ".concat(c[L]," not found."));}}},b.prototype.initStateMachines=function(c,m){for(var E=this.stateMachines.map(function(be){return be.name}),x=0;x<c.length;x++){var L=E.indexOf(c[x]);if(L>=0)this.stateMachines[L].playing=m;else {var z=this.artboard.stateMachineByName(c[x]);if(z){var ae=new H(z,this.runtime,m,this.artboard);this.stateMachines.push(ae);}else console.warn("State Machine with name ".concat(c[x]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([c[x]],m,true);}}},b.prototype.play=function(c){return this.add(c,true)},b.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(c){c.playing||c.advanceAndApply(0);});},b.prototype.pause=function(c){return this.add(c,false)},b.prototype.scrub=function(c,m){var E=this.animations.filter(function(x){return c.includes(x.name)});return E.forEach(function(x){return x.scrubTo=m}),E.map(function(x){return x.name})},Object.defineProperty(b.prototype,"playing",{get:function(){return this.animations.filter(function(c){return c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"paused",{get:function(){return this.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),b.prototype.stop=function(c){var m=this;c=tn(c);var E=[];if(c.length===0)E=this.animations.map(function(z){return z.name}).concat(this.stateMachines.map(function(z){return z.name})),this.animations.forEach(function(z){return z.cleanup()}),this.stateMachines.forEach(function(z){return z.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else {var x=this.animations.filter(function(z){return c.includes(z.name)});x.forEach(function(z){z.cleanup(),m.animations.splice(m.animations.indexOf(z),1);});var L=this.stateMachines.filter(function(z){return c.includes(z.name)});L.forEach(function(z){z.cleanup(),m.stateMachines.splice(m.stateMachines.indexOf(z),1);}),E=x.map(function(z){return z.name}).concat(L.map(function(z){return z.name}));}return this.eventManager.fire({type:Q.Stop,data:E}),E},Object.defineProperty(b.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(c,m){return c||m.playing},false)||this.stateMachines.reduce(function(c,m){return c||m.playing},false)},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPaused",{get:function(){return !this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:false,configurable:true}),b.prototype.atLeastOne=function(c,m){m===void 0&&(m=true);var E;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([E=this.artboard.animationByIndex(0).name],c,m):this.artboard.stateMachineCount()>0&&this.add([E=this.artboard.stateMachineByIndex(0).name],c,m)),E},b.prototype.handleLooping=function(){for(var c=0,m=this.animations.filter(function(x){return x.playing});c<m.length;c++){var E=m[c];E.loopValue===0&&E.loopCount?(E.loopCount=0,this.stop(E.name)):E.loopValue===1&&E.loopCount?(this.eventManager.fire({type:Q.Loop,data:{animation:E.name,type:Ee.Loop}}),E.loopCount=0):E.loopValue===2&&E.loopCount>1&&(this.eventManager.fire({type:Q.Loop,data:{animation:E.name,type:Ee.PingPong}}),E.loopCount=0);}},b.prototype.handleStateChanges=function(){for(var c=[],m=0,E=this.stateMachines.filter(function(L){return L.playing});m<E.length;m++){var x=E[m];c.push.apply(c,x.statesChanged);}c.length>0&&this.eventManager.fire({type:Q.StateChange,data:c});},b.prototype.handleAdvancing=function(c){this.eventManager.fire({type:Q.Advance,data:c});},b})(),Q;(function(b){b.Load="load",b.LoadError="loaderror",b.Play="play",b.Pause="pause",b.Stop="stop",b.Loop="loop",b.Draw="draw",b.Advance="advance",b.StateChange="statechange",b.RiveEvent="riveevent",b.AudioStatusChange="audiostatuschange";})(Q||(Q={}));var Ee;(function(b){b.OneShot="oneshot",b.Loop="loop",b.PingPong="pingpong";})(Ee||(Ee={}));var Ce=(function(){function b(c){c===void 0&&(c=[]),this.listeners=c;}return b.prototype.getListeners=function(c){return this.listeners.filter(function(m){return m.type===c})},b.prototype.add=function(c){this.listeners.includes(c)||this.listeners.push(c);},b.prototype.remove=function(c){for(var m=0;m<this.listeners.length;m++){var E=this.listeners[m];if(E.type===c.type&&E.callback===c.callback){this.listeners.splice(m,1);break}}},b.prototype.removeAll=function(c){var m=this;c?this.listeners.filter(function(E){return E.type===c}).forEach(function(E){return m.remove(E)}):this.listeners.splice(0,this.listeners.length);},b.prototype.fire=function(c){var m=this.getListeners(c.type);m.forEach(function(E){return E.callback(c)});},b})(),Ue=(function(){function b(c){this.eventManager=c,this.queue=[];}return b.prototype.add=function(c){this.queue.push(c);},b.prototype.process=function(){for(;this.queue.length>0;){var c=this.queue.shift();c?.action&&c.action(),c?.event&&this.eventManager.fire(c.event);}},b})(),Be;(function(b){b[b.AVAILABLE=0]="AVAILABLE",b[b.UNAVAILABLE=1]="UNAVAILABLE";})(Be||(Be={}));var fe=(function(b){u(c,b);function c(){var m=b!==null&&b.apply(this,arguments)||this;return m._started=false,m._enabled=false,m._status=Be.UNAVAILABLE,m}return c.prototype.delay=function(m){return g(this,void 0,void 0,function(){return y(this,function(E){return [2,new Promise(function(x){return setTimeout(x,m)})]})})},c.prototype.timeout=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return [2,new Promise(function(E,x){return setTimeout(x,50)})]})})},c.prototype.reportToListeners=function(){this.fire({type:Q.AudioStatusChange}),this.removeAll();},c.prototype.enableAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return this._enabled||(this._enabled=true,this._status=Be.AVAILABLE,this.reportToListeners()),[2]})})},c.prototype.testAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(E){switch(E.label){case 0:if(!(this._status===Be.UNAVAILABLE&&this._audioContext!==null))return [3,4];E.label=1;case 1:return E.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return E.sent(),this.enableAudio(),[3,4];case 3:return E.sent(),[3,4];case 4:return [2]}})})},c.prototype._establishAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){switch(m.label){case 0:return this._started?[3,5]:(this._started=true,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),m.label=2;case 2:return this._status!==Be.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return m.sent(),[4,this.delay(1e3)];case 4:return m.sent(),[3,2];case 5:return [2]}})})},c.prototype.listenForUserAction=function(){var m=this,E=function(){return g(m,void 0,void 0,function(){return y(this,function(x){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",E,{once:true});},c.prototype.establishAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return this._establishAudio(),[2]})})},Object.defineProperty(c.prototype,"systemVolume",{get:function(){return this._status===Be.UNAVAILABLE?(this.testAudio(),0):1},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"status",{get:function(){return this._status},enumerable:false,configurable:true}),c})(Ce),ye=new fe,ce=(function(){function b(){}return b.prototype.observe=function(){},b.prototype.unobserve=function(){},b.prototype.disconnect=function(){},b})(),j=globalThis.ResizeObserver||ce,X=(function(){function b(){var c=this;this._elementsMap=new Map,this._onObservedEntry=function(m){var E=c._elementsMap.get(m.target);E!==null?E.onResize(m.target.clientWidth==0||m.target.clientHeight==0):c._resizeObserver.unobserve(m.target);},this._onObserved=function(m){m.forEach(c._onObservedEntry);},this._resizeObserver=new j(this._onObserved);}return b.prototype.add=function(c,m){var E={onResize:m,element:c};return this._elementsMap.set(c,E),this._resizeObserver.observe(c),E},b.prototype.remove=function(c){this._resizeObserver.unobserve(c.element),this._elementsMap.delete(c.element);},b})(),K=new X,me=(function(){function b(c){this.enableRiveAssetCDN=true,this.enablePerfMarks=false,this.referenceCount=0,this.destroyed=false,this.selfUnref=false,this.bindableArtboards=[],this.src=c.src,this.buffer=c.buffer,c.assetLoader&&(this.assetLoader=c.assetLoader),this.enableRiveAssetCDN=typeof c.enableRiveAssetCDN=="boolean"?c.enableRiveAssetCDN:true,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this.eventManager=new Ce,c.onLoad&&this.on(Q.Load,c.onLoad),c.onLoadError&&this.on(Q.LoadError,c.onLoadError);}return b.prototype.releaseFile=function(){var c;this.selfUnref&&((c=this.file)===null||c===void 0||c.unref()),this.file=null;},b.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(c){return c.destroy()});},b.prototype.initData=function(){return g(this,void 0,void 0,function(){var c,m,E,x,L,z;return y(this,function(ae){switch(ae.label){case 0:if(!(this.src&&!this.buffer))return [3,4];ae.label=1;case 1:return ae.trys.push([1,3,,4]),c=this,[4,Qt(this.src)];case 2:return c.buffer=ae.sent(),[3,4];case 3:throw m=ae.sent(),m instanceof Error?m:new p(b.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(x=new o.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),E=x.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),L=this,[4,this.runtime.load(new Uint8Array(this.buffer),E,this.enableRiveAssetCDN)]);case 5:return L.file=ae.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),z=new o.FileFinalizer(this.file),o.finalizationRegistry.register(this,z),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:Q.Load,data:this}):this.fireLoadError(b.fileLoadErrorMessage),[2])}})})},b.prototype.loadRiveFileBytes=function(){return g(this,void 0,void 0,function(){var c;return y(this,function(m){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),c=this.src?Qt(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&c.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end");}),[2,c]})})},b.prototype.loadRuntime=function(){return g(this,void 0,void 0,function(){var c;return y(this,function(m){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),c=a.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&c.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end");}),[2,c]})})},b.prototype.init=function(){return g(this,void 0,void 0,function(){var c,m,E,x;return y(this,function(L){switch(L.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(b.missingErrorMessage),[2];L.label=1;case 1:return L.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return c=L.sent(),m=c[0],E=c[1],this.destroyed?[2]:(this.buffer=m,this.runtime=E,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()]);case 3:return L.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return x=L.sent(),this.fireLoadError(x instanceof Error?x.message:b.fileLoadErrorMessage),[3,5];case 5:return [2]}})})},b.prototype.fireLoadError=function(c){throw this.eventManager.fire({type:Q.LoadError,data:c}),new p(c)},b.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},b.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},b.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=true);},b.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},b.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},b.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup();},b.prototype.createBindableArtboard=function(c){if(c!=null){var m=new U(c);return (0, o.createFinalization)(m,m.nativeArtboard),this.bindableArtboards.push(m),m}return null},b.prototype.getArtboard=function(c){var m=this.file.artboardByName(c);if(m!=null)return new ne(m,this)},b.prototype.getBindableArtboard=function(c){var m=this.file.bindableArtboardByName(c);return this.createBindableArtboard(m)},b.prototype.getDefaultBindableArtboard=function(){var c=this.file.bindableArtboardDefault();return this.createBindableArtboard(c)},b.prototype.internalBindableArtboardFromArtboard=function(c){var m=this.file.internalBindableArtboardFromArtboard(c);return this.createBindableArtboard(m)},b.prototype.viewModelByName=function(c){var m=this.file.viewModelByName(c);return m!==null?new Dt(m):null},b.missingErrorMessage="Rive source file or data buffer required",b.fileLoadErrorMessage="The file failed to load",b})(),Ie=(function(){function b(c){var m=this,E,x,L;this.loaded=false,this.destroyed=false,this._observed=null,this.readyForPlaying=false,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=false,this.automaticallyHandleEvents=false,this.dispatchPointerExit=true,this.enableMultiTouch=false,this.enableRiveAssetCDN=true,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=false,this._needsRedraw=false,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._pageVisibilityHandler=null,this._explicitlyStoppedRendering=false,this._viewModelInstance=null,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=false,this._focusOptions={allowFocusInterrupt:false},this.drawOptimization=B.DrawOnChanged,this.enablePerfMarks=false,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=false,this.onCanvasResize=function(z){var ae=m._hasZeroSize!==z;m._hasZeroSize=z,z?(!m._layout.maxX||!m._layout.maxY)&&m.resizeToCanvas():ae&&m.resizeDrawingSurfaceToCanvas();},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=c.canvas,c.canvas.constructor===HTMLCanvasElement&&(this._observed=K.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=c.src,this.buffer=c.buffer,this.riveFile=c.riveFile,this.layout=(E=c.layout)!==null&&E!==void 0?E:new M,this.shouldDisableRiveListeners=!!c.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!c.isTouchScrollEnabled,this.automaticallyHandleEvents=!!c.automaticallyHandleEvents,this.dispatchPointerExit=c.dispatchPointerExit===false?c.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!c.enableMultiTouch,this.drawOptimization=(x=c.drawingOptions)!==null&&x!==void 0?x:this.drawOptimization,this.enableRiveAssetCDN=c.enableRiveAssetCDN===void 0?true:c.enableRiveAssetCDN,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this._focusOptions=(L=c.focusOptions)!==null&&L!==void 0?L:this._focusOptions,this.eventManager=new Ce,c.onLoad&&this.on(Q.Load,c.onLoad),c.onLoadError&&this.on(Q.LoadError,c.onLoadError),c.onPlay&&this.on(Q.Play,c.onPlay),c.onPause&&this.on(Q.Pause,c.onPause),c.onStop&&this.on(Q.Stop,c.onStop),c.onLoop&&this.on(Q.Loop,c.onLoop),c.onStateChange&&this.on(Q.StateChange,c.onStateChange),c.onAdvance&&this.on(Q.Advance,c.onAdvance),c.onload&&!c.onLoad&&this.on(Q.Load,c.onload),c.onloaderror&&!c.onLoadError&&this.on(Q.LoadError,c.onloaderror),c.onplay&&!c.onPlay&&this.on(Q.Play,c.onplay),c.onpause&&!c.onPause&&this.on(Q.Pause,c.onpause),c.onstop&&!c.onStop&&this.on(Q.Stop,c.onstop),c.onloop&&!c.onLoop&&this.on(Q.Loop,c.onloop),c.onstatechange&&!c.onStateChange&&this.on(Q.StateChange,c.onstatechange),c.assetLoader&&(this.assetLoader=c.assetLoader),this.taskQueue=new Ue(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:c.autoplay,autoBind:c.autoBind,animations:c.animations,stateMachines:c.stateMachines,artboard:c.artboard,useOffscreenRenderer:c.useOffscreenRenderer,tabIndex:c.tabIndex});}return Object.defineProperty(b.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:false,configurable:true}),b.new=function(c){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new b(c)},b.prototype.onSystemAudioChanged=function(){this.volume=this._volume;},b.prototype.init=function(c){var m=this,E=c.src,x=c.buffer,L=c.riveFile,z=c.animations,ae=c.stateMachines,be=c.artboard,re=c.autoplay,pe=re===void 0?false:re,tt=c.useOffscreenRenderer,Ke=tt===void 0?false:tt,De=c.autoBind,wt=De===void 0?false:De,Gt=c.tabIndex;if(!this.destroyed){if(this.src=E,this.buffer=x,this.riveFile=L,this._tabIndex=Gt??null,!this.src&&!this.buffer&&!this.riveFile)throw new p(b.missingErrorMessage);var Fe=tn(z),zt=tn(ae);this.loaded=false,this.readyForPlaying=false,a.RuntimeLoader.awaitInstance().then(function(Mt){if(!m.destroyed){m.runtime=Mt,m.removeRiveListeners(),m.deleteRiveRenderer(),m.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(m.renderer=m.runtime.makeRenderer(m.canvas,Ke),!m.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(Tt){throw console.error(Tt),new p("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}m.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),m.canvas.width||m.canvas.height||m.resizeDrawingSurfaceToCanvas(),m.initData(be,Fe,zt,pe,wt).then(function(Tt){if(Tt)return m.setupRiveListeners()}).catch(function(Tt){console.error(Tt);});}}).catch(function(Mt){m.eventManager.fire({type:Q.LoadError,data:Mt.message});});}},b.prototype.setupRiveListeners=function(c){var m=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var E=this.animator.stateMachines.filter(function(pe){return pe.playing}),x=E.filter(function(pe){return m.runtime.hasListeners(pe.instance)}).map(function(pe){return pe.instance}),L=this.isTouchScrollEnabled,z=this.dispatchPointerExit,ae=this.enableMultiTouch;c&&"isTouchScrollEnabled"in c&&(L=c.isTouchScrollEnabled),this.eventCleanup=(0, o.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:x,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:L,dispatchPointerExit:z,enableMultiTouch:ae,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)});var be=E.filter(function(pe){return pe.hasFocusNodes});if(be.length){var re=this.canvas.tabIndex;(re===-1||isNaN(re))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),typeof window<"u"&&(this._keyboardInteractions=new o.KeyboardInteractions({canvas:this.canvas,stateMachine:be[0].instance,hasFocusNodes:true}));}}},b.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null);},b.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions();},b.prototype.initializeAudio=function(){var c=this,m;ye.status==Be.UNAVAILABLE&&(this.file.hasAudio||!((m=this.artboard)===null||m===void 0)&&m.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:Q.AudioStatusChange,callback:function(){return c.onSystemAudioChanged()}},ye.add(this._audioEventListener),ye.establishAudio());},b.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height);},b.prototype.initData=function(c,m,E,x,L){return g(this,void 0,void 0,function(){var z,ae,be,re;return y(this,function(pe){switch(pe.label){case 0:return pe.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(z=new me({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=z,[4,z.init()]);case 1:if(pe.sent(),this.destroyed)return z.destroyIfUnused(),[2,false];pe.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(c,m,E,x,L),this.initArtboardSize(),this.initializeAudio();try{this.loaded=!0,this.eventManager.fire({type:Q.Load,data:(re=this.src)!==null&&re!==void 0?re:"buffer"});}catch(tt){console.error(tt);}return this.animator.advanceIfPaused(),this.readyForPlaying=true,this.taskQueue.process(),this.drawFrame(),[2,true];case 3:return ae=pe.sent(),be=_(ae),this.eventManager.fire({type:Q.LoadError,data:be}),[2,Promise.reject(be)];case 4:return [2]}})})},b.prototype.initArtboard=function(c,m,E,x,L){if(this.file){var z=c?this.file.artboardByName(c):this.file.defaultArtboard();if(!z)throw new p("Invalid artboard name or no default artboard");this.artboard=z,z.volume=this._volume*ye.systemVolume,this.animator=new ee(this.runtime,this.artboard,this.eventManager);var ae;if(m.length>0||E.length>0?(ae=m.concat(E),this.animator.initLinearAnimations(m,x),this.animator.initStateMachines(E,x)):ae=[this.animator.atLeastOne(x,false)],this.taskQueue.add({event:{type:x?Q.Play:Q.Pause,data:ae}}),L){var be=this.file.defaultArtboardViewModel(z);if(be!==null){var re=be.defaultInstance();if(re!==null){var pe=new Wt(re,null);(0, o.createFinalization)(pe,pe.runtimeInstance),this.bindViewModelInstance(pe);}}}}},b.prototype.drawFrame=function(){var c,m;!((c=document?.timeline)===null||c===void 0)&&c.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(m=this.runtime)===null||m===void 0||m.resolveAnimationFrame()):this.scheduleRendering();},b.prototype._canvasSizeChanged=function(){var c=false;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,c=true),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,c=true)),c},b.prototype.pollFocusState=function(){if(!this._keyboardInteractions){this._prevHasFocus=false;return}var c=this.animator.stateMachines.find(function(E){return E.playing&&E.hasFocusNodes});if(!c){this._prevHasFocus=false;return}if(this.canvas instanceof HTMLCanvasElement){var m=c.focusState().hasFocus;if(m){this._keyboardInteractions.notifyRiveFocused(),this._prevHasFocus||(this.canvas!==document.activeElement&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=true);return}this._prevHasFocus=false,this._keyboardInteractions.focusSessionState===o.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(o.FocusSessionState.NotFocused);}},b.prototype.advanceAndReportChanges=function(c){for(var m,E=this.animator.animations.filter(function(ve){return ve.playing||ve.needsScrub}).sort(function(ve){return ve.needsScrub?-1:1}),x=0,L=E;x<L.length;x++){var z=L[x];z.advance(c),z.instance.didLoop&&(z.loopCount+=1),z.apply(1);}for(var ae=this.animator.stateMachines.filter(function(ve){return ve.playing}),be=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,re=0,pe=ae;re<pe.length;re++){var tt=pe[re],Ke=tt.reportedEventCount();if(Ke)for(var De=0;De<Ke;De++){var wt=tt.reportedEventAt(De);if(wt)if(wt.type===D.OpenUrl){if(this.eventManager.fire({type:Q.RiveEvent,data:wt}),this.automaticallyHandleEvents){var Gt=document.createElement("a"),Fe=wt,zt=Fe.url,Mt=Fe.target,Tt=(0, o.sanitizeUrl)(zt);zt&&Gt.setAttribute("href",Tt),Mt&&Gt.setAttribute("target",Mt),Tt&&Tt!==o.BLANK_URL&&Gt.click();}}else this.eventManager.fire({type:Q.RiveEvent,data:wt});}be>=0&&performance.mark("rive:sm-advance:start:f".concat(be)),tt.advanceAndApply(c),be>=0&&(performance.mark("rive:sm-advance:end:f".concat(be)),performance.measure("rive:sm-advance:f".concat(be),"rive:sm-advance:start:f".concat(be),"rive:sm-advance:end:f".concat(be)));}this.animator.stateMachines.length==0&&this.artboard.advance(c),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(c),this.pollFocusState(),(m=this._viewModelInstance)===null||m===void 0||m.handleCallbacks();},b.prototype.draw=function(c,m){this.frameRequestId=null;var E=performance.now(),x=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=c),this.renderSecondTimer+=c-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,m?.());var L=(c-this.lastRenderTime)/1e3;this.lastRenderTime=c,this.advanceAndReportChanges(L);var z=this.renderer;this._hasZeroSize||(this.drawOptimization==B.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(z.clear(),z.save(),x>=0&&performance.mark("rive:align-renderer:start:f".concat(x)),this.alignRenderer(),x>=0&&(performance.mark("rive:align-renderer:end:f".concat(x)),performance.measure("rive:align-renderer:f".concat(x),"rive:align-renderer:start:f".concat(x),"rive:align-renderer:end:f".concat(x))),x>=0&&performance.mark("rive:artboard-draw:start:f".concat(x)),this.artboard.draw(z),x>=0&&(performance.mark("rive:artboard-draw:end:f".concat(x)),performance.measure("rive:artboard-draw:f".concat(x),"rive:artboard-draw:start:f".concat(x),"rive:artboard-draw:end:f".concat(x))),z.restore(),x>=0&&performance.mark("rive:renderer-flush:start:f".concat(x)),z.flush(),x>=0&&(performance.mark("rive:renderer-flush:end:f".concat(x)),performance.measure("rive:renderer-flush:f".concat(x),"rive:renderer-flush:start:f".concat(x),"rive:renderer-flush:end:f".concat(x))),this._needsRedraw=false),this.frameCount++;var ae=performance.now();for(this.frameTimes.push(ae),this.durations.push(ae-E);this.frameTimes[0]<=ae-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0);},b.prototype.alignRenderer=function(){var c=this,m=c.renderer,E=c.runtime,x=c._layout,L=c.artboard;m.align(x.runtimeFit(E),x.runtimeAlignment(E),{minX:x.minX,minY:x.minY,maxX:x.maxX,maxY:x.maxY},L.bounds,this._devicePixelRatioUsed*x.layoutScaleFactor);},Object.defineProperty(b.prototype,"fps",{get:function(){return this.durations.length},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(c,m){return c+m},0)/this.durations.length).toFixed(4)},enumerable:false,configurable:true}),b.prototype.cleanup=function(){var c,m;this.destroyed=true,this.stopRendering(),this.cleanupInstances(),this._observed!==null&&K.remove(this._observed),this.removeRiveListeners(),this.file&&((c=this.riveFile)===null||c===void 0||c.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(ye.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=null,this._dataEnums=null;},b.prototype.deleteRiveRenderer=function(){var c;(c=this.renderer)===null||c===void 0||c.delete(),this.renderer=null;},b.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null);},b.prototype.retrieveTextRun=function(c){var m;if(!c){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var E=this.artboard.textRun(c);if(!E){console.warn("Could not access a text run with name '".concat(c,"' in the '").concat((m=this.artboard)===null||m===void 0?void 0:m.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return E},b.prototype.getTextRunValue=function(c){var m=this.retrieveTextRun(c);return m?m.text:void 0},b.prototype.setTextRunValue=function(c,m){var E=this.retrieveTextRun(c);E&&(E.text=m);},b.prototype.play=function(c,m){var E=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return E.play(c,m)}});return}this.animator.play(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering();},b.prototype.pause=function(c){var m=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.pause(c)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(c);},b.prototype.scrub=function(c,m){var E=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return E.scrub(c,m)}});return}this.animator.scrub(c,m||0),this.drawFrame();},b.prototype.stop=function(c){var m=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.stop(c)}});return}this.animator&&this.animator.stop(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions();},b.prototype.reset=function(c){var m,E,x=c?.artboard,L=tn(c?.animations),z=tn(c?.stateMachines),ae=(m=c?.autoplay)!==null&&m!==void 0?m:false,be=(E=c?.autoBind)!==null&&E!==void 0?E:false;this.cleanupInstances(),this.initArtboard(x,L,z,ae,be),this.taskQueue.process();},b.prototype.load=function(c){this.file=null,this.stop(),this.init(c);},Object.defineProperty(b.prototype,"layout",{get:function(){return this._layout},set:function(c){this._layout=c,(!c.maxX||!c.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame();},enumerable:false,configurable:true}),b.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height});},b.prototype.resizeDrawingSurfaceToCanvas=function(c){if(this.canvas instanceof HTMLCanvasElement&&window){var m=this.canvas.getBoundingClientRect(),E=m.width,x=m.height,L=c||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=L,this.canvas.width=L*E,this.canvas.height=L*x,this._needsRedraw=true,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===C.Layout){var z=this._layout.layoutScaleFactor;this.artboard.width=E/z,this.artboard.height=x/z;}}},Object.defineProperty(b.prototype,"source",{get:function(){return this.src},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.animationCount();m++)c.push(this.artboard.animationByIndex(m).name);return c},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.stateMachineCount();m++)c.push(this.artboard.stateMachineByIndex(m).name);return c},enumerable:false,configurable:true}),b.prototype.stateMachineInputs=function(c){if(this.loaded){var m=this.animator.stateMachines.find(function(E){return E.name===c});return m?.inputs}},b.prototype.retrieveInputAtPath=function(c,m){if(!c){console.warn("No input name provided for path '".concat(m,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var E=this.artboard.inputByPath(c,m);if(!E){console.warn("Could not access an input with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E},b.prototype.setBooleanStateAtPath=function(c,m,E){var x=this.retrieveInputAtPath(c,E);x&&(x.type===w.Boolean?x.asBool().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(E,"' is not a boolean")));},b.prototype.setNumberStateAtPath=function(c,m,E){var x=this.retrieveInputAtPath(c,E);x&&(x.type===w.Number?x.asNumber().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(E,"' is not a number")));},b.prototype.fireStateAtPath=function(c,m){var E=this.retrieveInputAtPath(c,m);E&&(E.type===w.Trigger?E.asTrigger().fire():console.warn("Input with name: '".concat(c,"', at path:'").concat(m,"' is not a trigger")));},b.prototype.retrieveTextAtPath=function(c,m){if(!c){console.warn("No text name provided for path '".concat(m,"'"));return}if(!m){console.warn("No path provided for text '".concat(c,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var E=this.artboard.textByPath(c,m);if(!E){console.warn("Could not access text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E},b.prototype.getTextRunValueAtPath=function(c,m){var E=this.retrieveTextAtPath(c,m);if(!E){console.warn("Could not get text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E.text},b.prototype.setTextRunValueAtPath=function(c,m,E){var x=this.retrieveTextAtPath(c,E);if(!x){console.warn("Could not set text with name: '".concat(c,"', at path:'").concat(E,"'"));return}x.text=m;},Object.defineProperty(b.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isStopped",{get:function(){var c,m;return (m=(c=this.animator)===null||c===void 0?void 0:c.isStopped)!==null&&m!==void 0?m:true},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:false,configurable:true}),b.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},b.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},b.prototype.unsubscribe=function(c,m){console.warn("This function is deprecated: please use `off()` instead."),this.off(c,m);},b.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},b.prototype.unsubscribeAll=function(c){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(c);},b.prototype.stopRendering=function(){this._explicitlyStoppedRendering=true,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null);},b.prototype.startRendering=function(){this._explicitlyStoppedRendering=false,this.drawFrame();},b.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw));},b.prototype._onPageVisibilityChange=function(){var c,m;document.hidden?(this.frameRequestId!==null&&(!((c=this.runtime)===null||c===void 0)&&c.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((m=this.animator)===null||m===void 0)&&m.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering();},b.prototype.enableFPSCounter=function(c){this.runtime.enableFPSCounter(c);},b.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter();},Object.defineProperty(b.prototype,"contents",{get:function(){if(this.loaded){for(var c={artboards:[]},m=0;m<this.file.artboardCount();m++){for(var E=this.file.artboardByIndex(m),x={name:E.name,animations:[],stateMachines:[]},L=0;L<E.animationCount();L++){var z=E.animationByIndex(L);x.animations.push(z.name);}for(var ae=0;ae<E.stateMachineCount();ae++){for(var be=E.stateMachineByIndex(ae),re=be.name,pe=new this.runtime.StateMachineInstance(be,E),tt=[],Ke=0;Ke<pe.inputCount();Ke++){var De=pe.input(Ke);tt.push({name:De.name,type:De.type});}x.stateMachines.push({name:re,inputs:tt});}c.artboards.push(x);}return c}},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(c){this._volume=c,this.artboard&&(this.artboard.volume=c*ye.systemVolume);},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"artboardWidth",{get:function(){var c;return this.artboard?this.artboard.width:(c=this._artboardWidth)!==null&&c!==void 0?c:0},set:function(c){this._artboardWidth=c,this.artboard&&(this.artboard.width=c);},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"artboardHeight",{get:function(){var c;return this.artboard?this.artboard.height:(c=this._artboardHeight)!==null&&c!==void 0?c:0},set:function(c){this._artboardHeight=c,this.artboard&&(this.artboard.height=c);},enumerable:false,configurable:true}),b.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0);},Object.defineProperty(b.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(c){this._devicePixelRatioUsed=c;},enumerable:false,configurable:true}),b.prototype.bindViewModelInstance=function(c){var m;this.artboard&&!this.destroyed&&c&&c.runtimeInstance&&(c.internalIncrementReferenceCount(),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=c,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(E){return E.bindViewModelInstance(c)}):this.artboard.bindViewModelInstance(c.runtimeInstance));},Object.defineProperty(b.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:false,configurable:true}),b.prototype.viewModelByIndex=function(c){var m=this.file.viewModelByIndex(c);return m!==null?new Dt(m):null},b.prototype.viewModelByName=function(c){var m;return (m=this.riveFile)===null||m===void 0?void 0:m.viewModelByName(c)},b.prototype.enums=function(){if(this._dataEnums===null){var c=this.file.enums();this._dataEnums=c.map(function(m){return new Je(m)});}return this._dataEnums},b.prototype.defaultViewModel=function(){if(this.artboard){var c=this.file.defaultArtboardViewModel(this.artboard);if(c)return new Dt(c)}return null},b.prototype.getArtboard=function(c){var m,E;return (E=(m=this.riveFile)===null||m===void 0?void 0:m.getArtboard(c))!==null&&E!==void 0?E:null},b.prototype.getBindableArtboard=function(c){var m,E;return (E=(m=this.riveFile)===null||m===void 0?void 0:m.getBindableArtboard(c))!==null&&E!==void 0?E:null},b.prototype.getDefaultBindableArtboard=function(){var c,m;return (m=(c=this.riveFile)===null||c===void 0?void 0:c.getDefaultBindableArtboard())!==null&&m!==void 0?m:null},b.prototype.clearFocus=function(){var c=this.animator.stateMachines.filter(function(m){return m.playing&&m.hasFocusNodes});c.forEach(function(m){return m.clearFocus()});},b.missingErrorMessage="Rive source file or data buffer required",b.cleanupErrorMessage="Attempt to use file after calling cleanup.",b})(),qe;(function(b){b.none="none",b.string="string",b.number="number",b.boolean="boolean",b.color="color",b.list="list",b.enumType="enumType",b.trigger="trigger",b.viewModel="viewModel",b.integer="integer",b.listIndex="listIndex",b.image="image",b.artboard="artboard";})(qe||(qe={}));var Dt=(function(){function b(c){this._viewModel=c;}return Object.defineProperty(b.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"name",{get:function(){return this._viewModel.name},enumerable:false,configurable:true}),b.prototype.instanceByIndex=function(c){var m=this._viewModel.instanceByIndex(c);if(m!==null){var E=new Wt(m,null);return (0, o.createFinalization)(E,m),E}return null},b.prototype.instanceByName=function(c){var m=this._viewModel.instanceByName(c);if(m!==null){var E=new Wt(m,null);return (0, o.createFinalization)(E,m),E}return null},b.prototype.defaultInstance=function(){var c=this._viewModel.defaultInstance();if(c!==null){var m=new Wt(c,null);return (0, o.createFinalization)(m,c),m}return null},b.prototype.instance=function(){var c=this._viewModel.instance();if(c!==null){var m=new Wt(c,null);return (0, o.createFinalization)(m,c),m}return null},Object.defineProperty(b.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:false,configurable:true}),b})(),Je=(function(){function b(c){this._dataEnum=c;}return Object.defineProperty(b.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:false,configurable:true}),b})(),Qe;(function(b){b.Number="number",b.String="string",b.Boolean="boolean",b.Color="color",b.Trigger="trigger",b.Enum="enum",b.List="list",b.Image="image",b.Artboard="artboard";})(Qe||(Qe={}));var Wt=(function(){function b(c,m){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=false,this._runtimeInstance=c,m!==null&&this._parents.push(m);}return Object.defineProperty(b.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),b.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(c){c.handleCallbacks();}),this._propertiesWithCallbacks.forEach(function(c){c.clearChanges();})),this._children.forEach(function(c){return c.handleCallbacks()});},b.prototype.addParent=function(c){this._parents.includes(c)||(this._parents.push(c),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&c.addToViewModelCallbacks(this));},b.prototype.removeParent=function(c){var m=this._parents.indexOf(c);if(m!==-1){var E=this._parents[m];E.removeFromViewModelCallbacks(this),this._parents.splice(m,1);}},b.prototype.addToPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)||(this._propertiesWithCallbacks.push(c),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(E){E.addToViewModelCallbacks(m);}));},b.prototype.removeFromPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(E){return E!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(E){E.removeFromViewModelCallbacks(m);}));},b.prototype.addToViewModelCallbacks=function(c){var m=this;this._children.includes(c)||(this._children.push(c),this._parents.forEach(function(E){E.addToViewModelCallbacks(m);}));},b.prototype.removeFromViewModelCallbacks=function(c){var m=this;this._children.includes(c)&&(this._children=this._children.filter(function(E){return E!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(E){E.removeFromViewModelCallbacks(m);}));},b.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(c){c.clearCallbacks();});},b.prototype.propertyFromPath=function(c,m){var E=c.split("/");return this.propertyFromPathSegments(E,0,m)},b.prototype.viewModelFromPathSegments=function(c,m){var E=this.internalViewModelInstance(c[m]);return E!==null?m==c.length-1?E:E.viewModelFromPathSegments(c,m++):null},b.prototype.propertyFromPathSegments=function(c,m,E){var x,L,z,ae,be,re,pe,tt,Ke,De,wt,Gt,Fe,zt,Mt,Tt,ve,ki;if(m<c.length-1){var Fn=this.internalViewModelInstance(c[m]);return Fn!==null?Fn.propertyFromPathSegments(c,m+1,E):null}var I=null;switch(E){case Qe.Number:if(I=(L=(x=this._runtimeInstance)===null||x===void 0?void 0:x.number(c[m]))!==null&&L!==void 0?L:null,I!==null)return new kn(I,this);break;case Qe.String:if(I=(ae=(z=this._runtimeInstance)===null||z===void 0?void 0:z.string(c[m]))!==null&&ae!==void 0?ae:null,I!==null)return new Et(I,this);break;case Qe.Boolean:if(I=(re=(be=this._runtimeInstance)===null||be===void 0?void 0:be.boolean(c[m]))!==null&&re!==void 0?re:null,I!==null)return new Lt(I,this);break;case Qe.Color:if(I=(tt=(pe=this._runtimeInstance)===null||pe===void 0?void 0:pe.color(c[m]))!==null&&tt!==void 0?tt:null,I!==null)return new Un(I,this);break;case Qe.Trigger:if(I=(De=(Ke=this._runtimeInstance)===null||Ke===void 0?void 0:Ke.trigger(c[m]))!==null&&De!==void 0?De:null,I!==null)return new wn(I,this);break;case Qe.Enum:if(I=(Gt=(wt=this._runtimeInstance)===null||wt===void 0?void 0:wt.enum(c[m]))!==null&&Gt!==void 0?Gt:null,I!==null)return new Xe(I,this);break;case Qe.List:if(I=(zt=(Fe=this._runtimeInstance)===null||Fe===void 0?void 0:Fe.list(c[m]))!==null&&zt!==void 0?zt:null,I!==null)return new Ne(I,this);break;case Qe.Image:if(I=(Tt=(Mt=this._runtimeInstance)===null||Mt===void 0?void 0:Mt.image(c[m]))!==null&&Tt!==void 0?Tt:null,I!==null)return new Mn(I,this);break;case Qe.Artboard:if(I=(ki=(ve=this._runtimeInstance)===null||ve===void 0?void 0:ve.artboard(c[m]))!==null&&ki!==void 0?ki:null,I!==null)return new xn(I,this);break}return null},b.prototype.internalViewModelInstance=function(c){var m;if(this._viewModelInstances.has(c))return this._viewModelInstances.get(c);var E=(m=this._runtimeInstance)===null||m===void 0?void 0:m.viewModel(c);if(E!==null){var x=new b(E,this);return (0, o.createFinalization)(x,E),x.internalIncrementReferenceCount(),this._viewModelInstances.set(c,x),x}return null},b.prototype.number=function(c){var m=this.propertyFromPath(c,Qe.Number);return m},b.prototype.string=function(c){var m=this.propertyFromPath(c,Qe.String);return m},b.prototype.boolean=function(c){var m=this.propertyFromPath(c,Qe.Boolean);return m},b.prototype.color=function(c){var m=this.propertyFromPath(c,Qe.Color);return m},b.prototype.trigger=function(c){var m=this.propertyFromPath(c,Qe.Trigger);return m},b.prototype.enum=function(c){var m=this.propertyFromPath(c,Qe.Enum);return m},b.prototype.list=function(c){var m=this.propertyFromPath(c,Qe.List);return m},b.prototype.image=function(c){var m=this.propertyFromPath(c,Qe.Image);return m},b.prototype.artboard=function(c){var m=this.propertyFromPath(c,Qe.Artboard);return m},b.prototype.viewModel=function(c){var m=c.split("/"),E=m.length>1?this.viewModelFromPathSegments(m.slice(0,m.length-1),0):this;return E!=null?E.internalViewModelInstance(m[m.length-1]):null},b.prototype.internalReplaceViewModel=function(c,m){var E;if(m.runtimeInstance!==null){var x=((E=this._runtimeInstance)===null||E===void 0?void 0:E.replaceViewModel(c,m.runtimeInstance))||false;if(x){m.internalIncrementReferenceCount();var L=this.internalViewModelInstance(c);L!==null&&(L.removeParent(this),this._children.includes(L)&&(this._children=this._children.filter(function(z){return z!==L})),L.cleanup()),this._viewModelInstances.set(c,m),m.addParent(this);}return x}return false},b.prototype.replaceViewModel=function(c,m){var E,x=c.split("/"),L=x.length>1?this.viewModelFromPathSegments(x.slice(0,x.length-1),0):this;return (E=L?.internalReplaceViewModel(x[x.length-1],m))!==null&&E!==void 0?E:false},b.prototype.incrementReferenceCount=function(){var c;this._referenceCount++,(c=this._runtimeInstance)===null||c===void 0||c.incrementReferenceCount();},b.prototype.decrementReferenceCount=function(){var c;this._referenceCount--,(c=this._runtimeInstance)===null||c===void 0||c.decrementReferenceCount();},Object.defineProperty(b.prototype,"properties",{get:function(){var c;return ((c=this._runtimeInstance)===null||c===void 0?void 0:c.getProperties().map(function(m){return d({},m)}))||[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"viewModelName",{get:function(){var c,m;return (m=(c=this._runtimeInstance)===null||c===void 0?void 0:c.getViewModelName())!==null&&m!==void 0?m:""},enumerable:false,configurable:true}),b.prototype.internalIncrementReferenceCount=function(){this._referenceCount++;},b.prototype.cleanup=function(){var c=this,m;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((m=this._runtimeInstance)===null||m===void 0||m.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(L){L.cleanup();}),this._viewModelInstances.clear();var E=A([],this._children);this._children.length=0;var x=A([],this._parents);this._parents.length=0,E.forEach(function(L){L.removeParent(c);}),x.forEach(function(L){L.removeFromViewModelCallbacks(c);});}},b})(),en=(function(){function b(c,m){this.callbacks=[],this._viewModelInstanceValue=c,this._parentViewModel=m;}return b.prototype.on=function(c){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(c)||(this.callbacks.push(c),this._parentViewModel.addToPropertyCallbacks(this));},b.prototype.off=function(c){c?this.callbacks=this.callbacks.filter(function(m){return m!==c}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this);},b.prototype.internalHandleCallback=function(c){},b.prototype.handleCallbacks=function(){var c=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(m){c.internalHandleCallback(m);});},b.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges();},b.prototype.clearCallbacks=function(){this.callbacks.length=0;},Object.defineProperty(b.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:false,configurable:true}),b})(),Et=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),kn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Lt=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),wn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return c.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},c.prototype.internalHandleCallback=function(m){m();},c})(en),Xe=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(m){this._viewModelInstanceValue.valueIndex=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Ne=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:false,configurable:true}),c.prototype.addInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(m.runtimeInstance),m.addParent(this._parentViewModel));},c.prototype.addInstanceAt=function(m,E){return m.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(m.runtimeInstance,E)?(m.addParent(this._parentViewModel),true):false},c.prototype.removeInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(m.runtimeInstance),m.removeParent(this._parentViewModel));},c.prototype.removeInstanceAt=function(m){this._viewModelInstanceValue.removeInstanceAt(m);},c.prototype.instanceAt=function(m){var E=this._viewModelInstanceValue.instanceAt(m);if(E!=null){var x=new Wt(E,this._parentViewModel);return (0, o.createFinalization)(x,E),x}return null},c.prototype.swap=function(m,E){this._viewModelInstanceValue.swap(m,E);},c.prototype.internalHandleCallback=function(m){m();},c})(en),Un=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.rgb=function(m,E,x){this._viewModelInstanceValue.rgb(m,E,x);},c.prototype.rgba=function(m,E,x,L){this._viewModelInstanceValue.argb(L,m,E,x);},c.prototype.argb=function(m,E,x,L){this._viewModelInstanceValue.argb(m,E,x,L);},c.prototype.alpha=function(m){this._viewModelInstanceValue.alpha(m);},c.prototype.opacity=function(m){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,m))*255));},c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Mn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var E;this._viewModelInstanceValue.value((E=m?.nativeImage)!==null&&E!==void 0?E:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(en),xn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var E,x,L;m.isBindableArtboard?L=m:L=m.file.internalBindableArtboardFromArtboard(m.nativeArtboard),this._viewModelInstanceValue.value((E=L?.nativeArtboard)!==null&&E!==void 0?E:null),L?.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((x=L?.nativeViewModel)!==null&&x!==void 0?x:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(en),Qt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Request(b),[4,fetch(c)];case 1:if(m=x.sent(),!m.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(m.status));return [4,m.arrayBuffer()];case 2:return E=x.sent(),[2,E]}})})},tn=function(b){return typeof b=="string"?[b]:b instanceof Array?b:[]},It={EventManager:Ce,TaskQueueManager:Ue},Pt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeAudio(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.AudioWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})},lt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeImage(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.ImageWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})},Re=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeFont(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.FontWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})};})(),i})());});var DE=ri(_d=>{var cO=Symbol.for("react.transitional.element"),fO=Symbol.for("react.fragment");function NE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r]);}else n=e;return e=n.ref,{$$typeof:cO,type:t,key:i,ref:e!==void 0?e:null,props:n}}_d.Fragment=fO;_d.jsx=NE;_d.jsxs=NE;});var ze=ri((t4,LE)=>{LE.exports=DE();});var sv=ri($t=>{Object.defineProperty($t,"__esModule",{value:true});var av,se=dn(),Ci=pu();function IO(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var xd=IO(se);function KE(t){var e=t||WE(),n=se.useState(e),i=n[0],r=n[1];return se.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var a=function(){r(t||WE());},o=window.matchMedia("screen and (resolution: "+i+"dppx)");return o.hasOwnProperty("addEventListener")?o.addEventListener("change",a):o.addListener(a),function(){o.hasOwnProperty("removeEventListener")?o.removeEventListener("change",a):o.removeListener(a);}}},[i,t]),i}function WE(){return Math.min(Math.max(1,"u">typeof window&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:1),3)}var NO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})();function DO(t,e){var n=0;return function(){for(var i=this,r=arguments.length,a=Array(r),o=0;o<r;o++)a[o]=arguments[o];clearTimeout(n),n=window.setTimeout(function(){return t.apply(i,a)},e);}}var LO=globalThis.ResizeObserver||NO,PO=globalThis.ResizeObserver!==void 0,kd=PO,BO=!kd;function UO(t,e){e===void 0&&(e=true);var n=se.useState({width:0,height:0}),i=n[0],r=n[1];se.useEffect(function(){if("u">typeof window&&e){var o=function(){r({width:window.innerWidth,height:window.innerHeight});};return BO&&(o(),window.addEventListener("resize",o)),function(){return window.removeEventListener("resize",o)}}},[]);var a=se.useRef(new LO(DO(function(o){kd&&r({width:o[o.length-1].contentRect.width,height:o[o.length-1].contentRect.height});},0)));return se.useEffect(function(){var o=a.current;if(!e)return void o.disconnect();var u=t.current;return t.current&&kd&&o.observe(t.current),function(){o.disconnect(),u&&kd&&o.unobserve(u);}},[t,a]),i}var FO={useDevicePixelRatio:true,fitCanvasToArtboardHeight:false,useOffscreenRenderer:true,shouldResizeCanvasToContainer:true};function ZE(t){return Object.assign({},FO,t)}function JE(t){var e=t.riveLoaded,n=e!==void 0&&e,i=t.canvasElem,r=t.containerRef,a=t.options,o=t.onCanvasHasResized,u=t.artboardBounds,d=ZE(a===void 0?{}:a),g=se.useState({height:0,width:0}),y=g[0],A=y.height,p=y.width,_=g[1],C=se.useState({height:0,width:0}),N=C[0],B=N.height,M=N.width,w=C[1],R=se.useState(true),D=R[0],G=R[1],ne=d.fitCanvasToArtboardHeight,U=d.shouldResizeCanvasToContainer,H=d.useDevicePixelRatio,ee=d.customDevicePixelRatio,Q=UO(r,U),Ee=KE(ee),Ce=u??{},Ue=Ce.maxX,Be=Ce.maxY,fe=se.useCallback(function(){var ye,ce,j,X,K=(ye=(j=r.current)==null?void 0:j.clientWidth)!=null?ye:0,me=(ce=(X=r.current)==null?void 0:X.clientHeight)!=null?ce:0;return ne&&u?{width:K,height:u.maxY/u.maxX*K}:{width:K,height:me}},[r,ne,Ue,Be]);se.useEffect(function(){if(U&&r.current&&n){var ye=fe(),ce=ye.width,j=ye.height,X=false;if(i){var K=ce!==p||j!==A;if(d.fitCanvasToArtboardHeight&&K&&(r.current.style.height=j+"px",X=true),d.useDevicePixelRatio){var me=ce*Ee!==M||j*Ee!==B;if(K||me){var Ie=Ee*ce,qe=Ee*j;i.width=Ie,i.height=qe,i.style.width=ce+"px",i.style.height=j+"px",w({width:Ie,height:qe}),X=true;}}else K&&(i.width=ce,i.height=j,w({width:ce,height:j}),X=true);_({width:ce,height:j});}o&&(D||X)&&o&&o(),D&&G(false);}},[i,r,Q,Ee,fe,D,G,B,M,A,p,o,U,ne,H,n]),se.useEffect(function(){w({width:0,height:0});},[i]);}var VO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})(),HO=globalThis.IntersectionObserver||VO,GO=(function(){function t(){var n=this;this.elementsMap=new Map,this.onObserved=function(i){i.forEach(function(r){var a=n.elementsMap.get(r.target);a&&a(r);});},this.observer=new HO(this.onObserved);}var e=t.prototype;return e.registerCallback=function(n,i){this.observer.observe(n),this.elementsMap.set(n,i);},e.removeCallback=function(n){this.observer.unobserve(n),this.elementsMap.delete(n);},t})(),QE=function(){return av||(av=new GO),av};function zO(){return {observe:se.useCallback(function(t,e){QE().registerCallback(t,e);},[]),unobserve:se.useCallback(function(t){QE().removeCallback(t);},[])}}function _o(){return (_o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function $E(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}function jO(t){var e=t.setContainerRef,n=t.setCanvasRef,i=t.className,r=i===void 0?"":i,a=t.style,o=t.children,u=$E(t,["setContainerRef","setCanvasRef","className","style","children"]),d=_o({width:"100%",height:"100%"},a);return xd.default.createElement("div",_o({ref:e,className:r},!r&&{style:d}),xd.default.createElement("canvas",_o({ref:n,style:{verticalAlign:"top",width:0,height:0}},u),o))}function ew(t,e){e===void 0&&(e={});var n=se.useState(null),i=n[0],r=n[1],a=se.useRef(null),o=se.useRef(null),u=se.useState(null),d=u[0],g=u[1],y=!!t,A=ZE(e),p=KE(),_=se.useCallback(function(){if(d){if(d.layout&&d.layout.fit===Ci.Fit.Layout&&i){var G=p*d.layout.layoutScaleFactor;d.devicePixelRatioUsed=p,d.artboardWidth=i?.width/G,d.artboardHeight=i?.height/G;}d.startRendering(),d.resizeToCanvas();}},[d,p]);JE({riveLoaded:!!d,canvasElem:i,containerRef:a,options:A,onCanvasHasResized:_,artboardBounds:d?.bounds});var C=se.useCallback(function(G){G===null&&i&&(i.height=0,i.width=0),r(G);},[]);se.useEffect(function(){if(i&&t){var G,ne=d!=null;if(d==null){var U=A.useOffscreenRenderer,H=t.onRiveReady,ee=$E(t,["onRiveReady"]);G=new Ci.Rive(_o({useOffscreenRenderer:U},ee,{canvas:i})),o.current!=null&&o.current.cleanup(),o.current=G,G.on(Ci.EventType.Load,function(){ne=true,H&&H(G),i?g(G):G.cleanup();});}return function(){ne||G==null||G.cleanup();}}},[i,y,d]);var N=se.useCallback(function(G){a.current=G;},[]),B=zO(),M=B.observe,w=B.unobserve;se.useEffect(function(){var G,ne=false,U=function(){if(i&&ne){var H=i.getBoundingClientRect();H.width>0&&H.height>0&&H.top<(window.innerHeight||document.documentElement.clientHeight)&&H.bottom>0&&H.left<(window.innerWidth||document.documentElement.clientWidth)&&H.right>0&&(d?.startRendering(),ne=false);}};return i&&A.shouldUseIntersectionObserver!==false&&M(i,function(H){H.isIntersecting?d&&d.startRendering():d&&d.stopRendering(),ne=!H.isIntersecting,clearTimeout(G),H.isIntersecting||H.boundingClientRect.width!==0||(G=setTimeout(U,10));}),function(){i&&w(i);}},[M,w,d,i,A.shouldUseIntersectionObserver]),se.useEffect(function(){return function(){d&&(d.cleanup(),g(null));}},[d,i]),se.useEffect(function(){return function(){o.current!=null&&o.current.cleanup();}},[]);var R=t?.animations;se.useEffect(function(){d&&R&&(d.isPlaying?(d.stop(d.animationNames),d.play(R)):d.isPaused&&(d.stop(d.animationNames),d.pause(R)));},[R,d]);var D=se.useCallback(function(G){return xd.default.createElement(jO,_o({setContainerRef:N,setCanvasRef:C},G))},[C,N]);return {canvas:i,container:a.current,setCanvasRef:C,setContainerRef:N,rive:d,RiveComponent:D}}function YO(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}var qO=function(t){var e=t.src,n=t.artboard,i=t.animations,r=t.stateMachines,a=t.layout,o=t.useOffscreenRenderer,u=t.shouldDisableRiveListeners,d=t.shouldResizeCanvasToContainer,g=t.automaticallyHandleEvents,y=t.children,A=YO(t,["src","artboard","animations","stateMachines","layout","useOffscreenRenderer","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),p=ew({src:e,artboard:n,animations:i,layout:a,stateMachines:r,autoplay:true,shouldDisableRiveListeners:u!==void 0&&u,automaticallyHandleEvents:g!==void 0&&g},{useOffscreenRenderer:o===void 0||o,shouldResizeCanvasToContainer:d===void 0||d}).RiveComponent;return xd.default.createElement(p,A,y)};function WO(t,e,n,i){var r=se.useState(null),a=r[0],o=r[1];return se.useEffect(function(){var u=function(){if(t&&e&&n||o(null),t&&e&&n){var d=t.stateMachineInputs(e);if(d){var g=d.find(function(y){return y.name===n});i!==void 0&&g&&(g.value=i),o(g||null);}}else o(null);};u(),t&&t.on(Ci.EventType.Load,function(){u();});},[t]),a}function QO(t,e){var n=e??{},i=n.name,r=n.useDefault,a=se.useState(null),o=a[0],u=a[1];return se.useEffect(function(){var d=function(){if(!t)return void u(null);u(i!=null?(t.viewModelByName==null?void 0:t.viewModelByName.call(t,i))||null:t.defaultViewModel()||null);};return d(),t&&t.on(Ci.EventType.Load,d),function(){t&&t.off(Ci.EventType.Load,d);}},[t,i,r!==void 0&&r]),o}function XO(t,e){var n=e??{},i=n.name,r=n.useDefault,a=r!==void 0&&r,o=n.useNew,u=o!==void 0&&o,d=n.rive,g=se.useState(null),y=g[0],A=g[1];return se.useEffect(function(){if(!t)return void A(null);var p=null;A(p=i!=null?t.instanceByName(i)||null:a?(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null:u?(t.instance==null?void 0:t.instance.call(t))||null:(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null),d&&p&&d.viewModelInstance!==p&&d.bindViewModelInstance(p);},[t,i,a,u,d]),y}function tw(){return (tw=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function Sr(t,e,n){var i=se.useState(null),r=i[0],a=i[1],o=se.useState(n.defaultValue),u=o[0],d=o[1],g=se.useState(null),y=g[0],A=g[1],p=se.useRef(null),_=se.useRef(t),C=se.useRef(n);se.useEffect(function(){C.current=n;},[n]);var N=se.useCallback(function(){var R=p.current,D=_.current,G=C.current;if(!R||!D)return a(null),d(G.defaultValue),A(null),function(){};var ne=G.getProperty(R,D);if(ne){a(ne),d(G.getValue(ne)),G.getExtendedData&&A(G.getExtendedData(ne));var U=function(){d(G.getValue(ne)),G.getExtendedData&&A(G.getExtendedData(ne)),G.onPropertyEvent&&G.onPropertyEvent();};return ne.on(U),function(){ne.off(U);}}return function(){}},[]);se.useEffect(function(){return p.current=e,_.current=t,N()},[e,t,N]);var B=se.useCallback(function(R){if(r&&p.current===e)try{R(r),C.current.getExtendedData&&A(C.current.getExtendedData(r));return}catch{}if(p.current)try{var D=C.current.getProperty(p.current,_.current);D&&(a(D),R(D),C.current.getExtendedData&&A(C.current.getExtendedData(D)));}catch{}},[r,e]),M=se.useMemo(function(){return C.current.buildPropertyOperations(B)},[B]),w=tw({value:u},M);return n.getExtendedData&&(w.extendedData=y),w}function KO(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.number(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function ZO(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.string(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function JO(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.boolean(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function $O(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.color(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});},setRgb:function(r,a,o){i(function(u){u.rgb(r,a,o);});},setRgba:function(r,a,o,u){i(function(d){d.rgba(r,a,o,u);});},setAlpha:function(r){i(function(a){a.alpha(r);});},setOpacity:function(r){i(function(a){a.opacity(r);});}}},[])});return {value:n.value,setValue:n.setValue,setRgb:n.setRgb,setRgba:n.setRgba,setAlpha:n.setAlpha,setOpacity:n.setOpacity}}function eI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.enum(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,getExtendedData:se.useCallback(function(i){return i.values},[]),buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,values:n.extendedData||[],setValue:n.setValue}}function tI(t,e,n){var i=(n??{}).onTrigger;return {trigger:Sr(t,e,{getProperty:se.useCallback(function(r,a){return r.trigger(a)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:i,buildPropertyOperations:se.useCallback(function(r){return {trigger:function(){r(function(a){a.trigger();});}}},[])}).trigger}}function nI(t,e){return {setValue:Sr(t,e,{getProperty:se.useCallback(function(n,i){return n.image(i)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}function iI(t,e){var n,i=se.useState(0)[1],r=Sr(t,e,{getProperty:se.useCallback(function(a,o){return a.list(o)},[]),getValue:se.useCallback(function(a){return a.length},[]),defaultValue:null,onPropertyEvent:function(){i(function(a){return a+1});},buildPropertyOperations:se.useCallback(function(a){return {addInstance:function(o){a(function(u){return u.addInstance(o)});},addInstanceAt:function(o,u){var d=false;return a(function(g){d=g.addInstanceAt(o,u);}),d},removeInstance:function(o){a(function(u){return u.removeInstance(o)});},removeInstanceAt:function(o){a(function(u){return u.removeInstanceAt(o)});},getInstanceAt:function(o){var u=null;return a(function(d){u=d.instanceAt(o);}),u},swap:function(o,u){a(function(d){return d.swap(o,u)});}}},[])});return {length:(n=r.value)!=null?n:0,addInstance:r.addInstance,addInstanceAt:r.addInstanceAt,removeInstance:r.removeInstance,removeInstanceAt:r.removeInstanceAt,getInstanceAt:r.getInstanceAt,swap:r.swap}}function XE(t,e,n,i,r,a,o){try{var u=t[a](o),d=u.value;}catch(g){n(g);return}u.done?e(d):Promise.resolve(d).then(i,r);}function rI(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function o(d){XE(a,i,r,o,u,"next",d);}function u(d){XE(a,i,r,o,u,"throw",d);}o(void 0);})}}function aI(t,e){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:d(0)}),u(o,"throw",{value:d(1)}),u(o,"return",{value:d(2)}),typeof Symbol=="function"&&u(o,Symbol.iterator,{value:function(){return this}}),o;function d(g){return function(y){var A=[g,y];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,A[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&A[0]?i.return:A[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,A[1])).done)return r;switch(i=0,r&&(A=[2&A[0],r.value]),A[0]){case 0:case 1:r=A;break;case 4:return a.label++,{value:A[1],done:!1};case 5:a.label++,i=A[1],A=[0];continue;case 7:A=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(A[0]===6||A[0]===2)){a=0;continue}if(A[0]===3&&(!r||A[1]>r[0]&&A[1]<r[3])){a.label=A[1];break}if(A[0]===6&&a.label<r[1]){a.label=r[1],r=A;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(A);break}r[2]&&a.ops.pop(),a.trys.pop();continue}A=e.call(t,a);}catch(p){A=[6,p],i=0;}finally{n=r=0;}if(5&A[0])throw A[1];return {value:A[0]?A[1]:void 0,done:true}}}}function sI(t){var e=se.useState(null),n=e[0],i=e[1],r=se.useState("idle"),a=r[0],o=r[1];return se.useEffect(function(){var u=null;return rI(function(){return aI(this,function(d){try{o("loading"),(u=new Ci.RiveFile(t)).init(),u.on(Ci.EventType.Load,function(){u?.getInstance(),i(u),o("success");}),u.on(Ci.EventType.LoadError,function(){o("failed");}),i(u);}catch(g){console.error(g),o("failed");}return [2]})})(),function(){u?.cleanup();}},[t.src,t.buffer]),{riveFile:n,status:a}}function oI(t,e){return {setValue:Sr(t,e,{getProperty:se.useCallback(function(n,i){return n.artboard(i)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}$t.default=qO,$t.useResizeCanvas=JE,$t.useRive=ew,$t.useRiveFile=sI,$t.useStateMachineInput=WO,$t.useViewModel=QO,$t.useViewModelInstance=XO,$t.useViewModelInstanceArtboard=oI,$t.useViewModelInstanceBoolean=JO,$t.useViewModelInstanceColor=$O,$t.useViewModelInstanceEnum=eI,$t.useViewModelInstanceImage=nI,$t.useViewModelInstanceList=iI,$t.useViewModelInstanceNumber=KO,$t.useViewModelInstanceString=ZO,$t.useViewModelInstanceTrigger=tI,Object.keys(Ci).forEach(function(t){t==="default"||$t.hasOwnProperty(t)||Object.defineProperty($t,t,{enumerable:true,get:function(){return Ci[t]}});});});var Fw=Se(k_());var Mo=Se(dn());var Sd=Se(dn());var W=Se(dn());var Sf="33d964ca31c2dcf0c6ef3bfe4204c140829a7400bc73242e39b6b121fa174ce0";var Ef="api.avatarfactory.in",Xp=()=>`wss://${Ef}`,Fl=()=>`https://${Ef}`,x_=()=>`https://${Ef}/v1/vad/weights-${Sf}.bin`,Kp=(t,e)=>`https://${Ef}/v1/assets/${t}.${e}`;var Vl=class Vl{static setLogLevel(e){this.level=e;}static sanitize(e){return e.map(n=>{if(n&&typeof n=="object"){let i={...n};for(let r of Vl.SENSITIVE_FIELDS)r in i&&(i[r]="[REDACTED]");return i}return n})}static format(e,n,i){return `[${new Date().toISOString()}] [${e}] [${n}] ${i}`}static muted(e){return this.level>e&&!this.onLog}static debug(e,n,...i){if(this.muted(0))return;let r=this.sanitize(i);this.onLog?.(0,e,n,...r),this.level<=0&&console.debug(this.format("DEBUG",e,n),...r);}static info(e,n,...i){if(this.muted(1))return;let r=this.sanitize(i);this.onLog?.(1,e,n,...r),this.level<=1&&console.info(this.format("INFO",e,n),...r);}static warn(e,n,...i){if(this.muted(2))return;let r=this.sanitize(i);this.onLog?.(2,e,n,...r),this.level<=2&&console.warn(this.format("WARN",e,n),...r);}static error(e,n,...i){if(this.muted(3))return;let r=this.sanitize(i);this.onLog?.(3,e,n,...r),this.level<=3&&console.error(this.format("ERROR",e,n),...r);}static event(e,n,...i){this.info(`Event:${e}`,n,...i);}};Vl.level=4,Vl.SENSITIVE_FIELDS=["apiKey","sessionToken","getSessionToken","byok"];var T=Vl;var Zp=new Map;function Hl(t,e,n){let i=Zp.get(t.sha256);if(i)return i;let r=GC(t,e,n).catch(a=>{throw Zp.delete(t.sha256),a});return Zp.set(t.sha256,r),r}async function GC(t,e,n){let i=await zC(t.sha256,n);if(i&&await O_(i,t))return i;let r=await fetch(e,{priority:"low"});if(!r.ok)throw new Error(`asset ${t.sha256} HTTP ${r.status}`);let a=new Uint8Array(await r.arrayBuffer());if(!await O_(a,t))throw new Error(`asset ${t.sha256} failed integrity check (${a.byteLength}B)`);return n?.write(t.sha256,a)?.catch(o=>{T.warn("Assets","failed to cache asset",{sha256:t.sha256,cause:o});}),a}async function zC(t,e){try{return await e?.read(t)??null}catch(n){return T.warn("Assets","asset cache read failed",{sha256:t,cause:n}),null}}async function O_(t,e){if(t.byteLength!==e.byteLength)return false;let n=globalThis.crypto?.subtle;if(!n)return T.warn("Assets","no SubtleCrypto \u2014 asset checked by length only"),true;let i=await n.digest("SHA-256",t);return jC(new Uint8Array(i))===e.sha256}function jC(t){let e="";for(let n=0;n<t.length;n++)e+=t[n].toString(16).padStart(2,"0");return e}function I_(t,e){return Hl({sha256:Sf,byteLength:590012},t,e&&{read:n=>e.getCachedVadWeights?.(n),write:(n,i)=>e.setCachedVadWeights?.(n,i)})}var Jp={A:2,E:4,I:6,O:8,U:7,Y:6,P:21,B:21,M:21,F:18,V:18,T:19,D:19,N:19,S:15,Z:15,L:14,R:13,K:20,C:20,G:20,Q:20,H:12,W:7,J:16,X:15," ":0,".":0,",":0,"!":0,"?":0,":":0,";":0,"-":0,"(":0,")":0,'"':0,"'":0,DEFAULT:0},wf={TH:19,SH:16,CH:16,PH:18,GH:0,CK:20,NG:20,AI:4,AU:8,EA:6,EE:6,IE:6,OA:8,OO:7,OU:8,OW:8,UE:7,ER:5,IR:5,UR:5,AR:2,OR:8};var $p=400,N_=4e3,oa={loop:true,volume:.4,fadeOutMs:350},D_=15e3,eg=500,L_=4010,P_=4011,B_=6e3,U_=1500,F_=[1e3,2e3,4e3,8e3,15e3],V_={echoCancellation:false,noiseSuppression:false,autoGainControl:false,channelCount:1},tg=350,ng=-9999,ig=9999,Ui=Number.NEGATIVE_INFINITY,Gl=.28,Mf=1,rg=.15,ag=2.5,Tf=1,sg=.2,og=2,Cf=1,lg=.25,ug=1.6,Rf=60,cg=.1,fg=200,kf=40,dg=0,hg=100,mg=12e3,pg=1e3,xf=0,Of=250,H_=3,G_=10,gg=2500;var vg=1e3,zl=.25,If=.25,Nf=.01,z_=200,j_=250,Y_=12e4,q_=12e3;var Df=t=>{if(!Array.isArray(t))return null;let e=[];for(let n of t){let{visemeId:i,start:r,end:a}=n??{};!Number.isInteger(i)||!Number.isFinite(r)||!Number.isFinite(a)||e.push({char:"",visemeId:i,start:r,end:a});}return e},Ag=(t,e)=>{let n=[],i=t[0];for(let a=1;a<t.length;a++){let o=t[a];o.start*1e3-i.start*1e3<=e&&o.char!==" "&&i.char!==" "?i={...i,end:o.end,char:i.char+o.char}:(wf?.[i.char]&&(i={...i,visemeId:wf?.[i.char]??0}),n.push(i),i=o);}n.push(i);let r=n.length-1;for(;r>=0&&n[r].visemeId===0;)r--;if(r<n.length-1){let a=n[n.length-1];n[r]={...n[r],end:a.start},n.splice(r+1,n.length-(r+1),{...a,start:n[r].end});}return n},Lf=(t,e=40)=>{if(!t||!Array.isArray(t.character_start_times_seconds))return [];let n=t.characters.map((i,r)=>{let a=t.character_start_times_seconds[r]??0,o=t.character_end_times_seconds[r]??a+.05,u=(i||" ").toUpperCase();return {char:i,start:a,end:o,visemeId:Jp[u]??0}});return Ag(n,e)},jl=(t,{defaultDurationMs:e=50}={})=>{if(!t)return null;let n=Array.isArray(t.chars)?t.chars:[],i=Array.isArray(t.charStartTimesMs)?t.charStartTimesMs:[],r=Array.isArray(t.charDurationsMs)?t.charDurationsMs:[],a=n.length,o=new Array(a).fill(0),u=new Array(a).fill(e);for(let y=0;y<a;y++){let A=i[y],p=A==null?NaN:Number(A);o[y]=Number.isFinite(p)?p:0;let _=r[y],C=_==null?NaN:Number(_);u[y]=Number.isFinite(C)&&C>=0?C:NaN;}for(let y=0;y<a;y++)Number.isFinite(u[y])||(u[y]=y+1<a&&Number.isFinite(o[y+1])&&o[y+1]>o[y]?o[y+1]-o[y]:e);let d=new Array(a),g=new Array(a);for(let y=0;y<a;y++){let A=o[y]/1e3,p=(o[y]+Math.max(0,u[y]))/1e3;d[y]=Number.isFinite(A)?A:0,g[y]=Number.isFinite(p)?Math.max(d[y],p):d[y]+.001;}return {characters:n,character_start_times_seconds:d,character_end_times_seconds:g}};var yg=["idle","listening","thinking","talking"];var W_=t=>typeof t=="string"&&yg.includes(t),oo=t=>typeof t=="string"&&t.trim()&&t.length<=64?t:null,la=t=>{let e=Number(t);return Number.isFinite(e)&&e>0?Math.min(Math.round(e),6e5):0};function qC(t){if(!t||typeof t!="object")return null;let e=t,n=oo(e.gate),i=oo(e.act),r=i&&Array.isArray(e.acts)?e.acts.filter(a=>Number.isInteger(a)&&a>0&&a<=99):[];return !n&&!i?null:{gate:n,act:i,acts:r,...W_(e.fallback)&&{fallback:e.fallback}}}var WC=["oneShot","loop","pingPong"],QC=/^[^\0\r\n]{1,120}$/;function XC(t){if(!t||typeof t!="object")return null;let e=t,n=oo(e.gate),i=oo(e.act),r=la(e.windowMaxMs);if(!n||!i||!r)return null;let a=Math.min(la(e.windowMinMs),r),o=[];for(let u of Array.isArray(e.acts)?e.acts:[]){let d=u??{},g=d.id,y=la(d.ms);if(!Number.isInteger(g)||g<1||g>99||!y||o.some(_=>_.id===g))continue;let A=WC.includes(d.loop)?d.loop:"loop",p=typeof d.timeline=="string"&&QC.test(d.timeline)?d.timeline:void 0;o.push({id:g,ms:y,loop:A,...p&&{timeline:p}});}return o.length?{gate:n,act:i,acts:o,windowMinMs:a,windowMaxMs:r}:null}var KC=12,ZC=4;function JC(t){let e=(Array.isArray(t)?t:[]).map(oo).filter(n=>!!n);return [...new Set(e)].slice(0,ZC)}function $C(t){if(!t||typeof t!="object")return null;let e=t,n=[];for(let i of Array.isArray(e.gestures)?e.gestures:[]){let r=i??{},a=oo(r.trigger),o=la(r.ms);if(!(!a||!o||n.some(u=>u.trigger===a))&&(n.push({trigger:a,ms:o}),n.length===KC))break}return n.length?{gestures:n}:null}function Q_(t,e,n,i,r=Math.random){if(!t?.length||n<i)return null;let a=t.filter(u=>u.trigger!==e),o=a.length?a:t;return o[Math.floor(r()*o.length)]}function Pf(t){if(!t||typeof t!="object")return null;let e=t,n=e.branches??{},i={};for(let u of yg){let d=qC(n[u]);d&&(i[u]=d);}let r=XC(e.idleActs);if(r&&(i.idle={gate:r.gate,act:r.act,acts:r.acts.map(u=>u.id)}),!Object.keys(i).length)return null;let a=$C(e.playful),o=JC(e.idleTriggers);return {version:Number(e.version)||1,branches:i,quietToIdleMs:la(e.quietToIdleMs),idleCycleMs:la(e.idleCycleMs),playfulAfterMs:la(e.playfulAfterMs),playfulRoles:Array.isArray(e.playfulRoles)?e.playfulRoles.filter(W_):[],thinkingMaxMs:la(e.thinkingMaxMs),...r&&{idleActs:r},...a&&{playful:a},...o.length&&{idleTriggers:o}}}var bg=t=>t.trim().replace(/\s+/g," ").slice(0,$p).trimEnd(),e2=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e.toString(16).padStart(8,"0")},_g=(t,e,n)=>`${t}:${e}:${e2(n)}`;var Yl=t=>t.environment!=="meeting"?t:{...t,autoStart:t.autoStart??true,controls:t.controls??{enabled:false},statusBanner:{enabled:false,...t.statusBanner},thinkingIndicator:{enabled:false,...t.thinkingIndicator},connectTone:t.connectTone??{enabled:false},turnTaking:{echoGate:false,clientBargeIn:false,...t.turnTaking}};var X_=()=>{if(typeof document>"u")return true;let t=document.permissionsPolicy??document.featurePolicy;return typeof t?.allowsFeature!="function"||t.allowsFeature("microphone")!==false};var Fi=1e3,lo=(t,e,n,i)=>typeof t=="number"&&Number.isFinite(t)?Math.max(e,Math.min(n,t)):i,yr=class{constructor(){this.speed=Mf;this.jawSpeed=Tf;this.openness=Cf;this.holdSec=Rf/Fi;this.rest=kf;this.offsetSec=xf/Fi;this.maxStepFrames=H_;}apply(e){e&&(this.speed=lo(e.mouthSpeed,rg,ag,this.speed),this.jawSpeed=lo(e.jawSpeed,sg,og,this.jawSpeed),this.openness=lo(e.mouthOpenness,lg,ug,this.openness),this.holdSec=lo(e.mouthHold,cg,fg,this.holdSec*Fi)/Fi,this.rest=lo(e.mouthRest,dg,hg,this.rest),this.offsetSec=lo(e.offsetMs,-Of,Of,this.offsetSec*Fi)/Fi);}reset(e){this.speed=Mf,this.jawSpeed=Tf,this.openness=Cf,this.holdSec=Rf/Fi,this.rest=kf,this.offsetSec=xf/Fi,this.apply(e);}snapshot(){return {offsetMs:Math.round(this.offsetSec*Fi),mouthSpeed:this.speed,jawSpeed:this.jawSpeed,mouthOpenness:this.openness,mouthHold:Math.round(this.holdSec*Fi),mouthRest:this.rest}}};var Bf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Sg(t){let e="",n=t.length;for(let i=0;i<n;i+=3){let r=t[i],a=i+1<n?t[i+1]:0,o=i+2<n?t[i+2]:0;e+=Bf[r>>2],e+=Bf[(r&3)<<4|a>>4],e+=i+1<n?Bf[(a&15)<<2|o>>6]:"=",e+=i+2<n?Bf[o&63]:"=";}return e}var ql=t=>t.characters.join("").replace(/\s+/g," ").trim(),Uf=t=>{let{characters:e,character_start_times_seconds:n,character_end_times_seconds:i}=t,r=[],a="",o=0,u=0,d=()=>{a&&(r.push({text:a,start:o,end:u}),a="");};for(let g=0;g<e.length;g++){let y=e[g];if(/\s/.test(y)){d();continue}a||(o=n[g]??0),a+=y,u=i[g]??o;}return d(),r},Eg=t=>t.split(/\s+/).filter(Boolean).map(e=>({text:e,start:0,end:0})),Ff=(t,e)=>{let n=0;for(;n<t.words.length&&t.words[n].start<=e;)n++;return n},wg=(t,e)=>t.words.slice(0,Ff(t,e)).map(n=>n.text).join(" ").trim();var Mg=["hmm","hmmm","mhm","mhmm","mm","mmm","uh","um","umm","uh huh","yeah","yep","ok","okay","right","haan","han","achha","accha","theek hai","theek"];var Vf={mode:"healthy",commitPostPauseMs:680,settleMs:60,circuitBreakerEnabled:true},Tg={mode:"degraded",commitPostPauseMs:100,settleMs:100,circuitBreakerEnabled:false},K_=1200,Z_=600,J_=5,$_=3,eS=6e4,tS=400,nS=6e3,iS=.5,rS=80,aS=3,sS=100,oS=2,lS=.6,uS=.8,cS=4,dS=400,hS=40;function kg(t){let e="idle",n=null,i=null,r=0,a=0,o=0,u=0,d="",g=null,y=0,A=0,p=0,_=0,C=0,N=0;function B(){return t.getPolicy?.()??Vf}function M(){return B().circuitBreakerEnabled?{pause:C,threshold:N}:{pause:0,threshold:0}}function w(){return Math.min(.95,(e==="soft_pause"?.3:.5)+M().threshold)}function R(){return d.trim().length>0&&!mS(d)}function D(fe){return g===null||g.motion>=fe}function G(){return g?{speechMotion:g.motion,speechMedianFlux:g.medianFlux,speechModulation:g.modulation}:{}}function ne(){n=null,i=null,r=0,a=0,o=0,u=0,d="",g=null;}function U(){A=0,p=0;}function H(){e="idle",ne(),U(),_=0,C=0,N=0;}function ee(fe){t.onTelemetry?.({voiceOnsetToPauseMs:o-r,outcome:"commit",commitClause:fe,totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:B().mode,...G()}),t.commitInterrupt(),H();}function Q(fe){d.trim().length===0&&u<60?_++:_=0,t.onTelemetry?.({voiceOnsetToPauseMs:o-r,outcome:"resume",totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:B().mode,...G()}),t.resumePlayback(),B().circuitBreakerEnabled&&_>=3&&(C=150,N=.1),a>=100?(A=a,p=fe+500):U(),e="speaking",ne();}function Ee(fe,ye,ce){if(ce!==void 0&&(g=ce),y=ye,!t.isAvatarSpeaking()){e!=="idle"&&Be();return}if(e==="idle"&&(e="speaking",ne()),fe>=w()){if(n===null&&(n=ye),i!==null){let me=ye-i;me>0&&me<=150&&(a+=me,e==="soft_pause"&&ye-o>B().settleMs&&(u+=Math.min(me,30)));}i=ye;}else i!==null&&ye-i>150&&(n=null);if(e==="speaking"){n!==null&&ye-n>=70+M().pause&&(e="soft_pause",r=n,o=ye,t.pausePlayback());return}if(u>=B().commitPostPauseMs&&!R()&&D(.02)){ee("post_pause");return}let K=i!==null&&ye-i<=150;if(K&&ye-r>=1e3&&!R()&&D(.02)){ee("sustained");return}if(!K&&i!==null&&ye-i>=900){Q(ye);return}}function Ce(fe){if(e==="idle"||!fe||t.getActiveScriptTail&&gS(fe,t.getActiveScriptTail()))return;d=d?`${d} ${fe}`:fe;let ye=p>0&&y<=p,ce=a<100;(ce&&ye?A:a)<100||mS(fe)&&(e==="speaking"&&(e="soft_pause",r=n??0,o=0,t.pausePlayback()),ee(ce?"words_late":"words"));}function Ue(){e!=="idle"&&(e==="speaking"&&(e="soft_pause",o=0,t.pausePlayback()),ee("manual"));}function Be(){e==="soft_pause"&&t.resumePlayback(),H();}return {onVadProb:Ee,onPartialTranscript:Ce,manualStop:Ue,abort:Be,reset:Be}}function Hf(t){return t.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function pS(t){return t.replace(/(.)\1+/g,"$1")}var v2=new Set(Mg.filter(t=>!t.includes(" ")).map(pS)),A2=Mg.filter(t=>t.includes(" "));function mS(t){let e=Hf(t);if(!e)return false;for(let i of A2)e=e.replace(new RegExp(`(^| )${i}( |$)`,"g")," ");return e.split(" ").filter(Boolean).some(i=>!v2.has(pS(i)))}function gS(t,e,n=lS){let i=Hf(t).split(" ").filter(Boolean);if(i.length===0)return false;let r=new Set(Hf(e).split(" ").filter(Boolean));if(r.size===0)return false;let a=0;for(let o of i)r.has(o)&&a++;return a/i.length>=n}function vS(t,e){return Hf(t).split(" ").filter(Boolean).length<cS?false:gS(t,e,uS)}var AS=/^[a-z0-9][a-z0-9_.]{0,63}$/;var Gf=class{constructor(){this.sentByName=new Map;this.windowStartedAt=0;this.windowCount=0;}validate(e){if(!AS.test(e.name))return {ok:false,reason:"invalid_name",message:`notify() name must be a slug matching ${AS} \u2014 got "${e.name}"`};if(e.say!==void 0&&e.say.length>1e3)return {ok:false,reason:"say_too_long",message:"notify() say is too long (max 1000 chars)"};if(e.data===void 0)return {ok:true};let n;if(typeof e.data=="string")n=e.data;else try{n=JSON.stringify(e.data);}catch{return {ok:false,reason:"data_invalid",message:"notify() data is not serializable"}}return n.length>512?{ok:false,reason:"data_too_long",message:"notify() data is too long (max 512 chars serialized)"}:{ok:true,data:n}}admit(e,n,i){let r=this.sentByName.get(e);return r&&i-r.sentAt<n?{ok:false,reason:"cooldown"}:(i-this.windowStartedAt>=1e4&&(this.windowStartedAt=i,this.windowCount=0),this.windowCount>=5?{ok:false,reason:"rate_limit"}:(this.windowCount+=1,this.sweepExpired(i),this.sentByName.set(e,{sentAt:i,cooldownMs:n}),{ok:true}))}sweepExpired(e){if(!(this.sentByName.size<64))for(let[n,i]of this.sentByName)e-i.sentAt>=i.cooldownMs&&this.sentByName.delete(n);}};var yS=/^[a-z][a-z0-9_]{0,63}$/,bS=/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,y2=new Set(["confirm_action","cancel_action"]),_S=16,SS=8,ES=300,wS=120,MS=20,b2=1e3,_2=250,Ya={unavailable:"that action is not available right now",invalidArgs:"the details did not match what that action needs",failed:"the action failed",timedOut:"it took too long"},S2=new Set(["string","email","phone","date","datetime","number","boolean","enum"]),TS="[]",zf=class{constructor(e){this.transport=e;this.actions=new Map;this.lastSent=TS;this.syncTimer=null;}get size(){return this.actions.size}get(e){return this.actions.get(e)}register(e){let n=w2(e);if(n)return {ok:false,message:`registerAction(): ${n}`};if(!this.actions.has(e.name)&&this.actions.size>=_S)return {ok:false,message:`registerAction(): at most ${_S} actions at once \u2014 "${e.name}" was not added`};let i={declaration:E2(e),handler:e.handler,...e.check&&{check:e.check}};return this.actions.set(e.name,i),this.scheduleSync(),{ok:true,unregister:()=>{this.actions.get(e.name)===i&&(this.actions.delete(e.name),this.scheduleSync());}}}declarations(){return [...this.actions.values()].map(e=>e.declaration).sort((e,n)=>e.name<n.name?-1:e.name>n.name?1:0)}syncNow(){if(this.clearSyncTimer(),!this.transport.canDeclare())return;let e=this.declarations(),n=JSON.stringify(e);n!==this.lastSent&&this.transport.send(e)&&(this.lastSent=n);}resetSession(){this.clearSyncTimer(),this.lastSent=TS;}scheduleSync(){this.clearSyncTimer(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.syncNow();},_2);}clearSyncTimer(){this.syncTimer!==null&&(clearTimeout(this.syncTimer),this.syncTimer=null);}},E2=t=>{let e={};for(let[i,r]of Object.entries(t.params??{}))e[i]={type:r.type,...r.description!==void 0&&{description:r.description},...r.required!==void 0&&{required:r.required},...r.type==="enum"&&{values:[...r.values??[]]},...r.check===true&&{check:true}};let n=t.ui&&{...t.ui.inputs!==void 0&&{inputs:t.ui.inputs==="*"?"*":[...t.ui.inputs]},...t.ui.review!==void 0&&{review:t.ui.review}};return {name:t.name,description:t.description.trim(),params:e,...t.kind==="lookup"&&{kind:"lookup"},...t.undoable===true&&{undoable:true},...n&&{ui:n}}},ua=t=>!!t&&typeof t=="object"&&!Array.isArray(t),w2=t=>{if(!ua(t))return "the action must be an object";let{name:e,description:n,params:i,handler:r}=t;if(typeof e!="string"||!yS.test(e))return `name must match ${yS} \u2014 got "${String(e)}"`;if(y2.has(e))return `"${e}" is reserved`;if(typeof n!="string"||!n.trim())return `"${e}" needs a description`;if(n.length>ES)return `"${e}" description is too long (max ${ES} chars)`;if(typeof r!="function")return `"${e}" needs a handler`;let a=M2(t);if(a)return `"${e}" ${a}`;if(i===void 0)return null;if(!ua(i))return `"${e}" params must be an object`;let o=Object.entries(i);if(o.length>SS)return `"${e}" has too many params (max ${SS})`;for(let[u,d]of o){let g=T2(u,d);if(g)return `"${e}" param "${u}": ${g}`}return null},M2=t=>{let{kind:e,ui:n,check:i,undoable:r}=t,a=ua(t.params)?t.params:{};if(e!==void 0&&e!=="action"&&e!=="lookup")return `kind must be "action" or "lookup" \u2014 got "${String(e)}"`;if(r!==void 0&&typeof r!="boolean")return "undoable must be a boolean";if(e==="lookup"&&r)return "is a lookup, which changes nothing to undo";let o=Object.values(a).some(g=>ua(g)&&g.check===true);if(e==="lookup"&&(o||i!==void 0))return "is a lookup, which cannot check values";if(o&&typeof i!="function")return "marks a param check: true but has no check function";if(i!==void 0&&typeof i!="function")return "check must be a function";if(n===void 0)return null;if(!ua(n))return "ui must be an object";if(n.review!==void 0&&typeof n.review!="boolean")return "ui.review must be a boolean";if(e==="lookup"&&n.review)return "is a lookup, which has no review";let{inputs:u}=n;if(u===void 0||u==="*")return null;if(!Array.isArray(u))return 'ui.inputs must be "*" or a list of params';let d=u.find(g=>!(String(g)in a));return d===void 0?null:`ui.inputs names "${String(d)}", which is not a param`},T2=(t,e)=>{if(!bS.test(t))return `name must match ${bS}`;if(!ua(e))return "must be an object";if(!S2.has(e.type))return `unknown type "${String(e.type)}"`;if(e.description!==void 0&&(typeof e.description!="string"||e.description.length>wS))return `description must be a string of at most ${wS} chars`;if(e.required!==void 0&&typeof e.required!="boolean")return "required must be a boolean";if(e.check!==void 0&&typeof e.check!="boolean")return "check must be a boolean";if(e.type!=="enum")return null;let n=e.values;return Array.isArray(n)&&n.length>0&&n.length<=MS&&n.every(r=>typeof r=="string"&&r.trim())?null:`an enum needs 1\u2013${MS} non-empty string values`},C2=/^\d{4}-\d{2}-\d{2}$/,R2=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/,xg=(t,e)=>{switch(t.type){case "string":case "email":case "phone":return typeof e=="string";case "date":return typeof e=="string"&&C2.test(e);case "datetime":return typeof e=="string"&&R2.test(e);case "number":return typeof e=="number"&&Number.isFinite(e);case "boolean":return typeof e=="boolean";case "enum":return typeof e=="string"&&!!t.values?.includes(e)}},RS=(t,e)=>{if(e!==void 0&&!ua(e))return null;let n=e??{},i={};for(let[r,a]of Object.entries(t.params)){let o=n[r];if(o==null||o===""){if(a.required!==false)return null;continue}if(!xg(a,o))return null;i[r]=o;}return i},CS=t=>String(t).slice(0,b2),kS=t=>ua(t)?t.ok===true?t.result===void 0||t.result===null?{ok:true}:{ok:true,result:CS(t.result)}:t.ok===false?{ok:false,error:(t.error===void 0||t.error===null?"":CS(t.error).trim())||Ya.failed}:null:null;var xS=2500,k2=200,x2=5,Wl=t=>!!t&&typeof t=="object"&&!Array.isArray(t),OS=t=>{if(!Wl(t))return null;let{actionId:e,revision:n,name:i,stage:r,args:a,missing:o,awaiting:u,outcome:d}=t;return typeof e!="string"||!e||typeof n!="number"||!Number.isFinite(n)||typeof i!="string"||typeof r!="string"?null:{actionId:e,revision:n,name:i,stage:r,args:Wl(a)?{...a}:{},missing:Array.isArray(o)?o.filter(g=>typeof g=="string"):[],awaiting:Wl(u)&&typeof u.kind=="string"?{...u}:null,...Wl(d)&&typeof d.ok=="boolean"&&{outcome:{ok:d.ok,message:typeof d.message=="string"?d.message:""}}}},O2=new Set(["done","cancelled","expired"]),jf=class{constructor(){this.current=null;}get flow(){return this.current}apply(e){let n=this.current;return n&&n.actionId===e.actionId&&e.revision<=n.revision?false:(this.current=e,true)}get isLive(){return !!this.current&&!O2.has(this.current.stage)}clear(){this.current=null;}},IS=(t,e)=>{let n={};for(let[i,r]of Object.entries(e)){let a=t.params[i];if(!a)return {ok:false,message:`"${t.name}" has no param "${i}"`};if(!xg(a,r))return {ok:false,message:`"${t.name}" param "${i}" must be a ${a.type}`};n[i]=r;}return Object.keys(n).length?{ok:true,args:n}:{ok:false,message:"input needs at least one value"}},NS=async(t,e,n,i)=>{if(!t)return {ok:true,unverified:true};let r,a=Promise.resolve().then(()=>t(e,n,i)).then(I2,()=>null),o=new Promise(d=>{r=setTimeout(()=>d(null),xS);}),u=await Promise.race([a,o]);return clearTimeout(r),u??{ok:true,unverified:true}},I2=t=>{if(!Wl(t)||typeof t.ok!="boolean")return null;if(t.ok)return t.value===void 0?{ok:true}:{ok:true,value:t.value};let e=typeof t.reason=="string"?t.reason.slice(0,k2):void 0,n=Array.isArray(t.suggestions)?t.suggestions.slice(0,x2):void 0,i=typeof t.param=="string"&&t.param?t.param:void 0;return {ok:false,...e&&{reason:e},...n?.length&&{suggestions:n},...i&&{param:i}}};var DS=t=>{let e=t.cause?.name;return typeof e=="string"&&e!==""&&e!=="Error"?e:null};var LS=t=>`Initialization Failed: ${t.code} (${DS(t)??t.message})`.slice(0,123);var N2=50,D2=4e3,Yf=class{constructor(e,n=N2){this.onChange=e;this.entries=[];this.activeUserEntryId=null;this.lastFinalText="";this.lastFinalAt=0;this.activeAvatarEntryId=null;this.activeAvatarJobId=null;this.entryCounter=0;this.consumedChunks=0;this.openChars=[];this.openStarts=[];this.openEnds=[];this.maxEntries=Math.max(1,n);}applyUserTranscript({text:e,isFinal:n,turnId:i}){let r=e?.trim()??"";if(!r)return;let a=this.findEntry(this.activeUserEntryId);if(a&&a.turnId!==i&&(this.upsert({...a,isFinal:true}),a=null),a&&a.text===r&&a.isFinal===n||!a&&r===this.lastFinalText&&Date.now()-this.lastFinalAt<D2)return;let o={id:a?.id??this.nextId("user"),speaker:"user",text:r,words:Eg(r),isFinal:n,turnId:i,createdAt:a?.createdAt??Date.now()};this.upsert(o),this.activeUserEntryId=n?null:o.id,n&&(this.lastFinalText=r,this.lastFinalAt=Date.now()),this.emit();}applyAvatarSpeech(e){let n=e.alignments??[],i=e.chunkOffset??0,r=i+n.length;if(this.activeAvatarJobId!==e.jobId&&(this.finalizeAvatar(),this.activeAvatarJobId=e.jobId,this.consumedChunks=0),r<=this.consumedChunks)return;this.activeAvatarEntryId||(this.activeAvatarEntryId=this.nextId("avatar"),this.openChars=[],this.openStarts=[],this.openEnds=[]);for(let d=Math.max(0,this.consumedChunks-i);d<n.length;d++){let g=e.displayAlignments?.[d]??n[d];g?.characters?.length&&(this.openChars.push(...g.characters),this.openStarts.push(...g.character_start_times_seconds),this.openEnds.push(...g.character_end_times_seconds));}if(this.consumedChunks=r,!this.openChars.length)return;let a={characters:this.openChars,character_start_times_seconds:this.openStarts,character_end_times_seconds:this.openEnds},o=ql(a);if(!o)return;let u=this.findEntry(this.activeAvatarEntryId);u?.text!==o&&(this.upsert({id:this.activeAvatarEntryId,speaker:"avatar",text:o,words:Uf(a),isFinal:false,turnId:e.turnId,createdAt:u?.createdAt??Date.now()}),this.emit());}finalizeAvatar(){let e=this.findEntry(this.activeAvatarEntryId);this.activeAvatarEntryId=null,this.openChars=[],this.openStarts=[],this.openEnds=[],!(!e||e.isFinal)&&(this.upsert({...e,isFinal:true}),this.emit());}reset(){let e=this.entries.length>0;this.entries=[],this.activeUserEntryId=null,this.lastFinalText="",this.lastFinalAt=0,this.activeAvatarEntryId=null,this.activeAvatarJobId=null,this.consumedChunks=0,this.openChars=[],this.openStarts=[],this.openEnds=[],e&&this.emit();}getEntries(){return [...this.entries]}upsert(e){let n=this.entries.findIndex(i=>i.id===e.id);if(n>=0){this.entries[n]=e;return}this.entries.push(e),this.entries.length>this.maxEntries&&this.entries.splice(0,this.entries.length-this.maxEntries);}findEntry(e){return e?this.entries.find(n=>n.id===e)??null:null}nextId(e){return `${e}-${++this.entryCounter}`}emit(){this.onChange(this.getEntries());}};var qf=class{constructor(e){this.deps=e;this.held=false;this.open=false;this.preRollToFlush=[];this.recentFrames=[];this.tailTimer=null;this.maxHoldTimer=null;this.silenceByteSize=new Map;}isHeld(){return this.held}isTurnOpen(){return this.open}press(){if(this.held)return false;this.held=true;let e=this.open;return this.clearTailTimer(),this.open=true,e||(this.preRollToFlush=this.recentFrames.map(n=>n.buffer),this.recentFrames=[]),this.maxHoldTimer=setTimeout(()=>{this.maxHoldTimer=null,T.warn("PushToTalk","hold hit its ceiling \u2014 releasing"),this.release();},Y_),T.event("ptt","press",{isContinuation:e,preRollFrames:this.preRollToFlush.length}),this.deps.onHeldChange(true),e||this.deps.onTurnStart(),!e}release(){this.held&&(this.held=false,this.clearMaxHoldTimer(),T.event("ptt","release"),this.deps.onHeldChange(false),this.tailTimer=setTimeout(()=>{this.tailTimer=null,this.closeTurn();},j_));}gate(e){if(!this.open)return this.rememberFrame(e),[this.silenceOfSize(e.byteLength)];if(!this.preRollToFlush.length)return [e];let n=this.preRollToFlush;return this.preRollToFlush=[],n.push(e),n}reset(){this.held=false,this.open=false,this.preRollToFlush=[],this.recentFrames=[],this.clearTailTimer(),this.clearMaxHoldTimer();}closeTurn(){this.open&&(this.open=false,this.preRollToFlush=[],this.deps.onTurnEnd());}rememberFrame(e){let n=Date.now();for(this.recentFrames.push({capturedAt:n,buffer:e.slice(0)});this.recentFrames.length&&n-this.recentFrames[0].capturedAt>z_;)this.recentFrames.shift();}silenceOfSize(e){let n=this.silenceByteSize.get(e);return n||(n=new ArrayBuffer(e),this.silenceByteSize.size>8&&this.silenceByteSize.clear(),this.silenceByteSize.set(e,n)),n}clearTailTimer(){this.tailTimer&&(clearTimeout(this.tailTimer),this.tailTimer=null);}clearMaxHoldTimer(){this.maxHoldTimer&&(clearTimeout(this.maxHoldTimer),this.maxHoldTimer=null);}};var PS="server_tick";var Wf=class{constructor(){this.wedge=[];}note(e,n){if(typeof e!="number"||!Number.isFinite(e))return null;let i=n-e;for(;this.wedge.length>0&&this.wedge[this.wedge.length-1].offset>=i;)this.wedge.pop();for(this.wedge.push({offset:i,at:n});this.wedge.length>0&&n-this.wedge[0].at>6e4;)this.wedge.shift();let r=i-this.wedge[0].offset;return r<25?0:r}minOffset(){return this.wedge.length>0?this.wedge[0].offset:null}hasSamples(){return this.wedge.length>0}reset(){this.wedge=[];}};var Qf=class{constructor(e){this.opts=e;this.timer=null;this.lastProbeAt=0;this.lastMessageAt=0;this.loopLagPeak=0;this.ticksSeen=false;this.suspended=false;this.degraded=false;this.degradedAt=0;this.cleanSince=null;this.lastSeq=null;this.seqAtGap=null;this.resumeAt=null;this.resumeSeqJump=null;this.resumeCount=0;}begin(e=Date.now()){this.lastProbeAt=e,this.lastMessageAt=e;}start(e=Date.now()){this.timer||(this.begin(e),this.timer=setInterval(()=>this.tick(Date.now()),100));}stop(){this.timer&&clearInterval(this.timer),this.timer=null;}noteMessage(e,n,i=false){let r=this.expired(n)||this.degraded;this.lastMessageAt=n,this.loopLagPeak=0,this.suspended=false,i&&(this.ticksSeen=true);let a=typeof e=="number"&&Number.isFinite(e)?e:null;r&&this.resumeAt===null&&(this.resumeAt=n,this.seqAtGap=this.lastSeq),this.resumeAt!==null&&n-this.resumeAt<=300&&(this.resumeCount++,a!==null&&this.seqAtGap!==null&&(this.resumeSeqJump=a-this.seqAtGap)),a!==null&&(this.lastSeq=a),this.degraded&&this.cleanSince===null&&(this.cleanSince=n);}reset(){this.stop(),this.lastMessageAt=0,this.loopLagPeak=0,this.ticksSeen=false,this.suspended=false,this.degraded=false,this.degradedAt=0,this.cleanSince=null,this.lastSeq=null,this.seqAtGap=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}tick(e){let n=Math.max(0,e-this.lastProbeAt-100);if(this.lastProbeAt=e,n>this.loopLagPeak&&(this.loopLagPeak=n),this.degraded){this.evaluateRecovery(e);return}let i=this.currentGap(e);i!==null&&(this.degraded=true,this.degradedAt=e,this.cleanSince=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0,this.opts.onVerdict({state:"degraded",scope:this.loopLagPeak>=this.opts.loopLagHighMs?"device":"network",gapMs:i,loopLagMs:this.loopLagPeak}));}currentGap(e,n=1e3){if(!this.ticksSeen||this.suspended)return null;let i=e-this.lastMessageAt;return i>=n?i:null}evaluateRecovery(e){if(e-this.degradedAt>6e4){this.suspended=true,this.clear(e);return}if(this.currentGap(e,700)!==null){this.cleanSince=null;return}this.cleanSince!==null&&e-this.cleanSince>=2500&&this.clear(e);}clear(e){this.degraded=false,this.cleanSince=null;let n=this.resumeCount>=4&&this.resumeSeqJump!==null?this.resumeSeqJump:void 0;this.opts.onVerdict({state:"ok",scope:"network",gapMs:e-this.degradedAt,...n!==void 0&&{seqJump:n}}),this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}expired(e){return this.currentGap(e)!==null}};var Ql=class{constructor(){this.listeners={};}on(e,n){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(n),()=>{this.listeners[e].delete(n);}}emit(e,...n){let i=this.listeners[e];if(i)for(let r of i)r(...n);}hasListeners(e){return (this.listeners[e]?.size??0)>0}removeAll(){for(let e in this.listeners)this.listeners[e]?.clear();}};var US=t=>{let e=[];return t.fieldType&&e.push(t.fieldType),t.filled!==void 0&&e.push(t.filled?"filled":"empty"),t.checked!==void 0&&e.push(t.checked?"checked":"not checked"),t.shows&&e.push(`shows "${t.shows}"`),t.choiceOf&&e.push(`choice in ${t.choiceOf}`),t.options?.length&&e.push(`one of: ${t.options.join(" | ")}`),t.submits&&e.push("submits form"),t.count&&e.push(`${t.count} identical`),t.disabled&&e.push("disabled"),t.sensitive&&e.push("never fillable"),t.path&&e.push(t.path),t.site&&e.push(t.site),t.current&&e.push("this page"),t.children&&e.push(`contains ${t.children.join(" ")}`),e},FS=t=>t.length>0?` [${t.join(", ")}]`:"",z2=(t,e)=>{let n=e.filter(r=>r.item?.screenPosition).length,i=[`list${t.id} "${t.name}" \u2014 ${t.total} items, ${n} on screen`];for(let r of e){let a=r.item,o=US(r);a.screenPosition&&o.unshift(`on screen #${a.screenPosition}`);let u=a.detail?` \u2014 ${a.detail}`:"";i.push(` ${a.position}. ${r.handle} ${r.kind} "${r.name}"${u}${FS(o)}`);}return i};function Og(t){let e=[`On the ${t.pageName} page \u2014 ${t.url} \u2014 "${t.title}"`],n=a=>`${a.handle} ${a.kind} "${a.name}"${FS(US(a))}`,i=t.lists??[];if(i.length===0){for(let a of t.nodes)e.push(n(a));return e.join(`
17
- `)}let r=t.nodes.filter(a=>!a.item);for(let a of r)a.kind!=="link"&&e.push(n(a));for(let a of i){let o=t.nodes.filter(u=>u.item?.list===a.id).sort((u,d)=>u.item.position-d.item.position);o.length>0&&e.push(...z2(a,o));}for(let a of r)a.kind==="link"&&e.push(n(a));return e.join(`
18
- `)}function VS(t){return t.nodes.map(e=>({h:e.handle,n:e.name,...e.kind==="field"&&e.fieldType&&{t:e.fieldType},...e.sensitive&&{sensitive:true},...e.submits&&{submit:true},...e.item&&{card:{list:e.item.list,position:e.item.position,...e.item.screenPosition&&{screen:e.item.screenPosition},...e.item.detail&&{detail:e.item.detail}}}}))}var HS=t=>{let e=t?.fields;if(!Array.isArray(e))return [];let n=new Map;for(let i of e){if(n.size>=12)break;let{h:r,v:a}=i??{};typeof r!="string"||typeof a!="string"||n.set(r,a.slice(0,2e3));}return [...n].map(([i,r])=>({handle:i,value:r}))},j2={stale:"the page changed since it was read",unknown_target:"it is not on this page",not_fillable:"it is not a box the avatar can type into",sensitive:"passwords and payment details are only theirs to type",disabled:"it is disabled right now",read_only:"it is read-only",no_such_option:"none of its choices matches",rejected:"the page would not take that value",invalid:"the site says that value is not valid"},GS=t=>{let e=t.filter(r=>r.outcome!=="ok");if(e.length===0)return;let n=t.filter(r=>r.outcome==="ok").map(r=>`"${r.name}"`),i=e.map(r=>{let a=j2[r.outcome];return `"${r.name}" (${a}${r.detail?`: ${r.detail}`:""})`});return [n.length>0?`filled ${n.join(", ")}`:"",`could not fill ${i.join(", ")}`].filter(Boolean).join("; ")},zS={stale:"the page has changed since it was read",unknown_target:"that button is not on this page",not_a_submit:"that button does not send a form",disabled:"that button is disabled right now",invalid:"the form is not complete yet",requires_reload:"sending this form would open a new page and end this call, so they need to press it themselves"};var ca={camera:true,screen:false,micMute:true,endCall:true,actions:false,mood:false,page:{read:false,scroll:false,navigate:false,click:false,fill:false,submit:false}},Mi=(t,e)=>typeof t=="boolean"?t:e,jS=t=>{if(!t||typeof t!="object")return ca;let e=t,n=e.page&&typeof e.page=="object"?e.page:{},i=Mi(n.read,ca.page.read),r=i&&Mi(n.click,false);return {camera:Mi(e.camera,ca.camera),screen:Mi(e.screen,ca.screen),micMute:Mi(e.micMute,ca.micMute),endCall:Mi(e.endCall,ca.endCall),actions:Mi(e.actions,ca.actions),mood:Mi(e.mood,ca.mood),page:{read:i,scroll:i&&Mi(n.scroll,false),navigate:i&&Mi(n.navigate,false),click:r,fill:i&&Mi(n.fill,false),submit:r}}};var Y2=/^([xy])=([+-]?)(\d{1,5})(%?)$/;var q2=t=>{let e=Y2.exec(t);if(!e)return null;let[,n,i,r,a]=e,o=Number(r);return !a&&o>2e4||a&&o>100?null:{axis:n,move:{value:i==="-"?-o:o,percent:a==="%",relative:i!==""}}},Xl=t=>{let e=t.split(",");if(e.length>2)return null;let n={};for(let i of e){let r=q2(i.trim());if(!r||n[r.axis])return null;n[r.axis]=r.move;}return n.x||n.y?n:null};var W2=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),Q2=/^bounce(?:=(.+))?$/,X2=new Set(["forever","loop","infinite"]),K2=5,Z2=t=>{if(t===void 0)return 1;if(X2.has(t))return "forever";if(!/^\d{1,3}$/.test(t))return null;let e=Number(t);return e<1?null:Math.min(e,K2)},Xf=t=>{let e=t.trim().toLowerCase();if(!e)return null;if(W2.has(e))return {kind:"spot",spot:e};if(e==="expand")return {kind:"stage",open:true};if(e==="collapse")return {kind:"stage",open:false};if(e==="stop"||e==="still")return {kind:"effect",effect:"stop"};let n=Q2.exec(e);if(n){let r=Z2(n[1]);return r===null?null:{kind:"effect",effect:"bounce",times:r}}let i=Xl(e);return i?{kind:"move",...i}:null};var J2=new Set(["search","open","new_tab","switch","close","reload"]),$2=new Set(["search","open","switch"]);function YS(t){if(typeof t!="string")return null;let e=t.indexOf("="),n=(e<0?t:t.slice(0,e)).trim(),i=e<0?"":t.slice(e+1).trim();return !J2.has(n)||$2.has(n)&&!i?null:i?{action:n,target:i}:{action:n}}var rR=new Set(["CONNECTION_FAILED","SERVER_ERROR","SESSION_TOKEN_FETCH_FAILED"]),qS=1e3,WS=1e3,aR=50,sR=600,oR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that place is not on this page"},lR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that link is not on this page",not_navigable:"that is not a link on this site",requires_reload:"opening that page would end this call",already_here:"they are already on that page",no_history:"there is nowhere in this call's history to go"},uR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that is not on this page",not_clickable:"that is not a button or field the avatar can press",submits_form:"that button submits a form, which needs a confirmed action",requires_reload:"pressing that would open a new page and end this call",disabled:"that is disabled right now"},cR=400,fR=[300,1e3,2500],dR=3e3,hR="the page could not be reached",mR={ok:void 0,not_found:"no open tab matches that",blocked:"that is not a web address it can open",failed:"the browser refused"},pR=1e3,QS=12e3,Ig=()=>{},gR=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}catch{return}},Kl=t=>typeof t?.arg=="string"?t.arg:"",vR=t=>t?.arg==="tab"||t?.arg==="window"||t?.arg==="screen"?t.arg:null,Zl=t=>typeof t?.generation=="number"?t.generation:void 0,Jl=class extends Error{constructor(n){super("Failed to fetch session token");this.reason=n;this.name="SessionTokenError";}},$l=class{constructor(e,n){this.sessionPhase="idle";this.paintPhase="none";this.turnPhase="idle";this.playful={last:null,busyUntilMs:0};this.sessionId=0;this.turnId=0;this.isConnected=false;this.lifecycle=0;this.userStoppedAt=null;this.speakReportedForStop=false;this.deliveryLagMs=null;this.firstAudioAt=null;this.firstAudioLagMs=null;this.transit=new Wf;this.reconnectAttempt=0;this.hasBeenLive=false;this.reconnectTimer=null;this.intentionalClose=false;this.serverInitiatedReason=null;this.lastEmittedError=null;this.noticeReceived=false;this.noticeOnly=false;this.visualState="normal";this.micMuted=false;this.speakerMuted=false;this.pushToTalk=null;this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"};this.downlinkScope="network";this.downlinkVerdict=null;this.netStatusLastSentAt=0;this.netStatusTimer=null;this.moodDetectionOn=false;this.moodLatest=null;this.moodLastSentKey=null;this.moodLastSentAt=0;this.moodTimer=null;this.appEvents=new Gf;this.actions=new zf({canDeclare:()=>this.canDeclareActions(),send:e=>this.sendActionsSet(e)});this.actionCallsSeen=new Set;this.actionFlows=new jf;this.actionsGrantWarned=false;this.actionRereadTimer=null;this.jobQueue=[];this.processing=false;this.turnOpen=false;this.scriptTail={jobId:-1,upto:0,text:""};this.activeStream=null;this.ws=null;this.micStream=null;this.micStartedAt=null;this.agcEnabled=true;this.agcRestoreTimer=null;this.events=new Ql;this.transcript=null;this.greetingText="";this.greetingLanguage="en";this.greetingKey="";this.greetingEntry=null;this.greetingDecided=false;this.greetingDecisionTimer=null;this.greetingAwaitingPlayback=false;this.greetingDelayTimer=null;this.greetingAwaitingPaint=null;this.greetingPaintTimer=null;this.greetingAwaitingMic=null;this.greetingMicTimer=null;this.micPipelineSettled=false;this.talkingArmed=false;this.playerLeadInTimer=null;this.connectTonePlaying=false;this.connectToneTimer=null;this.connectToneStartedAt=null;this.tonePainted=false;this.toneSessionLive=false;this.greetingPlayed=false;this.skipGreetingOnce=false;this.greetedThisSession=false;this.jobCounter=0;this.riveReady=false;this.avatarConfig=null;this.serverReady=false;this.voiceSettings=null;this.watermark=false;this.lipSyncTuning=new yr;this.rivSrc=null;this.pendingRivBytes=null;this.pendingSession=false;this.pendingContext=[];this.lastContextSnapshot=null;this.firstPage=null;this.pageGeneration=0;this.lastPageContext=null;this.pageReadThisUtterance=false;this.pageWork=Promise.resolve();this.pageSession=0;this.heardSpeech=null;this.pendingTours=new Map;this.tourRequestSeq=0;this.sessionCapabilities=null;this.initAckPromise=null;this.initAckResolve=null;this.initAckReject=null;this.loadInFlight=null;this.startInvoked=false;this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null};this.firstChunkPending=true;this.responseSlow=false;this.heldResumeToken=null;this.stopCount=0;this.mountSurface="inline";this.load=()=>this.serverReady?Promise.resolve():this.loadInFlight?this.loadInFlight:(this.loadInFlight=this.runLoad().finally(()=>{this.loadInFlight=null;}),this.loadInFlight);this.runLoad=async()=>{let e=this.lifecycle;this.setPaintPhase("loading");try{if(this.mode==="player")await this.paintFromCache(e)?this.revalidatePaint(e):await this.fetchRenderConfig(e);else {let n=await this.paintFromCache(e);this.mode==="call"&&!this.startInvoked&&(n?await this.revalidatePaint(e):await this.fetchRenderConfig(e));}}catch(n){if(this.stale(e))return;T.error("Runtime","Avatar load failed",n),this.setPaintPhase("failed");let i=n instanceof Jl;this.emitError(i?"SESSION_TOKEN_FETCH_FAILED":"AVATAR_LOAD_FAILED",i?"Failed to fetch session token":"Failed to load avatar","sdk",{cause:i?n.reason:n});return}this.stale(e)||this.mode!=="call"&&this.start();};this.start=async()=>{let e=this.lifecycle,n=this.stopCount;if(this.cancelReconnect(),this.startInvoked=true,this.lastEmittedError=null,this.startConnectTone(),this.mode!=="player"&&this.setSessionPhase("connecting"),await this.load(),!this.stale(e)){if(this.paintPhase==="failed"){this.setSessionPhase("idle");return}if(this.mode==="player"){this.setSessionPhase("active");return}try{(!this.ws||this.ws.readyState===WebSocket.CLOSED)&&await this.openWebSocket();let i=this.ws;if(this.staleSocket(e,i)||(this.initAckPromise&&(T.debug("Runtime","Waiting for server to acknowledge init..."),await this.initAckPromise),this.staleSocket(e,i))||this.noticeOnly)return;this.ws?.send(JSON.stringify({type:"start"}));}catch(i){if(this.stopCount!==n&&!this.lastEmittedError||(!this.stale(e)&&this.paintPhase!=="painted"&&this.setPaintPhase("failed"),this.lastEmittedError))return;if(i instanceof Jl){this.emitError("SESSION_TOKEN_FETCH_FAILED","Failed to fetch session token","sdk",{cause:i.reason});return}this.emitError("UNKNOWN","Unexpected runtime error","sdk",{cause:i});}}};this.paintFromCache=async e=>{let[n,i]=await Promise.all([this.cache.getCachedRiv(this.avatarId),this.cache.getCachedAvatarConfig(this.avatarId)]);if(this.stale(e))return false;if(this.cachedConfigVersion=i?.configVersion,this.cachedRivVersion=n?.rivVersion,n&&i){let r=await this.urlResolver.bytesToSrc(n.bytes);return this.stale(e)?(this.urlResolver.revokeSrc(r),false):(this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig={...i,rive:{...i.rive,src:r}},this.pendingRivBytes=n.bytes,this.serverReady=true,this.onRivReady(),true)}return n&&(this.pendingRivBytes=n.bytes),false};this.resolveSessionToken=async()=>{try{let e=await this.getSessionToken();if(!e)throw new Error("getSessionToken() returned an empty token");return e}catch(e){throw new Jl(e)}};this.fetchRenderConfig=async e=>{let n={"Content-Type":"application/json"},i={avatarId:this.avatarId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin},needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion}},r="";this.deployId?r=this.deployId:this.getSessionToken?r=await this.resolveSessionToken():this.apiKey&&(r=this.apiKey),n.Authorization=`Bearer ${r}`;let a=await fetch(`${this.httpUrl}/v1/avatar/config`,{method:"POST",headers:n,body:JSON.stringify(i)});if(!a.ok)throw new Error(`config route HTTP ${a.status}`);let o=await a.json();if(this.serverReady)return this.repaintFromPayload(o,e);let u=o.rivUrl?await this.fetchRivBytes(o.rivUrl):this.pendingRivBytes;if(!u)throw new Error("config response had no rivUrl and no cache");await this.applyRenderPayload(o,u,e);};this.paintForNotice=async()=>{let e=this.lifecycle;try{T.info("Runtime","notice with nothing painted \u2014 resolving config"),await this.fetchRenderConfig(e);}catch(n){if(this.stale(e))return;T.error("Runtime","Notice paint failed \u2014 notice will be silent",n),this.setPaintPhase("failed");}};this.revalidatePaint=async e=>{try{await this.fetchRenderConfig(e);}catch(n){T.warn("Runtime","Revalidation failed \u2014 keeping the cached paint",n);}};this.repaintFromPayload=async(e,n)=>{let i=e.rivUrl?await this.fetchRivBytes(e.rivUrl):null;if(e.rivUrl&&!i&&T.warn("Rive","New rig failed to download \u2014 keeping the painted one"),i)return this.applyRenderPayload(e,i,n);if(this.stale(n))return;let r=e.watermark===true!==this.watermark;this.watermark=e.watermark===true;let a=e.configVersion!==void 0&&e.configVersion!==this.avatarConfig?.configVersion,o=JSON.stringify(Pf(e.performance)??null)!==JSON.stringify(this.avatarConfig?.performance??null);!a&&!r&&!o||(this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.cachedConfigVersion=e.configVersion,e.rivVersion!==void 0&&(this.cachedRivVersion=e.rivVersion),(a||o)&&e.cacheable!==false&&this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{}),this.onRivReady());};this.applyRenderPayload=async(e,n,i)=>{let r=await this.urlResolver.bytesToSrc(n);if(this.stale(i))return this.urlResolver.revokeSrc(r);this.watermark=e.watermark===true,this.cachedConfigVersion=e.configVersion,this.cachedRivVersion=e.rivVersion,this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.serverReady=true,e.cacheable!==false&&(e.rivVersion!==void 0&&this.cache.setCachedRiv(this.avatarId,n,e.rivVersion).catch(()=>{}),this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{})),this.pendingRivBytes=n,this.onRivReady();};this.setMountSurface=e=>{this.mountSurface=e;};this.getLipSyncTuning=()=>this.lipSyncTuning;this.speakAudio=async e=>{if(this.mode!=="audio"){this.emitError("INVALID_MODE","speakAudio can only be used in audio mode","sdk",{fatal:false});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakAudio() needs a live session \u2014 call start() first","sdk",{fatal:false});return}try{let n;e instanceof Blob?n=await e.arrayBuffer():e instanceof Float32Array?n=e.buffer:n=e;let i=15*1024*1024;if(n.byteLength>i){this.emitError("INVALID_INPUT","Audio payload too large (max 15MB)","sdk",{fatal:!1});return}this.ws?.send(n);}catch(n){this.emitError("UNKNOWN","Failed to process audio payload","sdk",{cause:n,fatal:false});}};this.isPushToTalk=()=>this.turnTaking==="push-to-talk";this.isTalking=()=>this.pushToTalk?.isHeld()??false;this.startTalking=()=>{this.pushToTalk&&this.sessionPhase==="active"&&(this.noticeReceived||this.pushToTalk.press());};this.stopTalking=()=>{this.pushToTalk?.release();};this.setMicMuted=e=>{this.micMuted!==e&&(this.micMuted=e,this.queueClientNetStatus(),this.events.emit("mic-muted",e));};this.setSpeakerMuted=e=>{this.speakerMuted!==e&&(this.speakerMuted=e,this.events.emit("speaker-muted",e));};this.getMicMuted=()=>this.micMuted;this.getSpeakerMuted=()=>this.speakerMuted;this.commandHandlers={stop:e=>{this.cancelSpeech(),this.reportCommandStatus("stop",this.commandTurnId(e),"ok");},request_vision:e=>{this.events.emit("vision-request",this.commandTurnId(e));},flip_camera:e=>{let n=typeof e?.args=="string"?e.args:null,i=n==="front"?"front":n==="back"?"back":"toggle";this.events.emit("camera-flip",i,this.commandTurnId(e));},mute_mic:e=>{if(this.environment==="meeting"){this.reportCommandStatus("mute_mic",this.commandTurnId(e),"unsupported");return}this.setMicMuted(true),this.reportCommandStatus("mute_mic",this.commandTurnId(e),"ok");},unmute_mic:e=>{this.setMicMuted(false),this.reportCommandStatus("unmute_mic",this.commandTurnId(e),"ok");},close_camera:e=>{this.events.emit("camera-close",this.commandTurnId(e));},open_camera:e=>{this.events.emit("camera-open",this.commandTurnId(e));},request_screen:e=>{let n=this.commandTurnId(e);if(!this.capabilities?.screen){this.reportScreenStatus("unavailable",n,{reason:"not granted"});return}if(!this.perception?.screen||!this.events.hasListeners("screen-request")){this.reportScreenStatus("unavailable",n,{reason:"screen sharing is not enabled here"});return}this.events.emit("screen-request",vR(e),n);},stop_screen:e=>{let n=this.commandTurnId(e);if(!this.events.hasListeners("screen-stop")){this.reportCommandStatus("stop_screen",n,"unsupported");return}this.events.emit("screen-stop",n);},scroll_to:e=>this.runPageCommand("scroll_to",e,n=>n.scroll,async(n,i)=>{let r=await n.scroll(Kl(e),Zl(e));this.reportCommandStatus("scroll_to",i,r==="ok"?"ok":"failed",oR[r]);}),navigate_to:e=>this.runPageCommand("navigate_to",e,n=>n.navigate,async(n,i)=>{let r=await n.navigate(Kl(e),Zl(e));this.reportCommandStatus("navigate_to",i,r==="ok"?"ok":"failed",lR[r]);}),click_element:e=>this.runPageCommand("click_element",e,n=>n.click,async(n,i)=>{let r=await n.click(Kl(e),Zl(e));this.reportCommandStatus("click_element",i,r==="ok"?"ok":"failed",uR[r]),r==="ok"&&this.scheduleReadAfterAction();}),fill_fields:e=>this.runPageCommand("fill_fields",e,n=>n.fill,async(n,i)=>{let r=HS(e);if(r.length===0){this.reportCommandStatus("fill_fields",i,"failed","there was nothing to fill");return}let a=await n.fill(r,Zl(e)),o=GS(a);T.event("page","Fields filled",{fields:a.map(u=>`${u.handle}:${u.outcome}`)}),this.reportCommandStatus("fill_fields",i,o?"failed":"ok",o),a.some(u=>u.outcome==="ok")&&this.scheduleReadAfterAction();}),submit_form:e=>this.runPageCommand("submit_form",e,n=>n.submit,async(n,i)=>{let{outcome:r,detail:a}=await n.submit(Kl(e),Zl(e)),o=r==="ok"?void 0:`${zS[r]}${a?`: ${a}`:""}`;this.reportCommandStatus("submit_form",i,r==="ok"?"ok":"failed",o),r==="ok"&&this.scheduleReadAfterAction();}),widget_control:e=>{let n=this.commandTurnId(e);if(this.mountSurface!=="widget"){this.reportCommandStatus("widget_control",n,"unsupported","the avatar is not in a widget here");return}let i=Xf(Kl(e));if(!i){this.reportCommandStatus("widget_control",n,"failed","that is not somewhere the avatar can put itself");return}this.events.emit("widget-command",i,n);},browser:e=>{let n=this.commandTurnId(e),i=this.browser;if(!i){this.reportCommandStatus("browser",n,"unsupported","this client cannot drive the browser");return}let r=YS(e?.arg);if(!r){this.reportCommandStatus("browser",n,"failed","that is not a browser command");return}Promise.resolve().then(()=>i.run(r)).catch(a=>(T.warn("Runtime","browser command threw",{error:String(a)}),"failed")).then(a=>this.reportCommandStatus("browser",n,a==="ok"?"ok":"failed",mR[a]));},close_call:e=>{this.reportCommandStatus("close_call",this.commandTurnId(e),"ok"),this.stop({intentionalClose:true,code:4001,reason:"Closed by server command"});}};this.loadCachedGreeting=async()=>{if(!(!this.greeting?.enabled||this.greetingEntry))try{let e=await this.cache.getCachedGreeting(this.greetingKey);if(!e)return;this.greetingEntry=e,this.sentGreetingId=e.greetingId,T.debug("Greeting","Loaded greeting from cache",{greetingId:e.greetingId});}catch{}};this.openWebSocket=async()=>{if(!this.wsUrl)throw new Error("WebSocket URL not resolved");if(this.ws&&this.ws.readyState===WebSocket.OPEN)return;if(!this.pendingRivBytes){let n=await this.cache.getCachedRiv(this.avatarId);this.pendingRivBytes=n?.bytes??null,this.cachedRivVersion=n?.rivVersion;}await this.loadCachedGreeting();let e=this.getSessionToken?await this.resolveSessionToken():void 0;return this.initAckPromise=new Promise((n,i)=>{this.initAckResolve=n,this.initAckReject=i;}),new Promise((n,i)=>{try{let r=new WebSocket(this.wsUrl);this.ws=r,r.binaryType="arraybuffer",r.onopen=()=>{if(this.ws!==r)return;T.event("WebSocket","Connection opened"),this.intentionalClose=!1,this.serverInitiatedReason=null;let a=gR();r.send(JSON.stringify({type:"init",...this.deployId?{deployId:this.deployId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin}}:{avatarId:this.avatarId,...e?{sessionToken:e}:{apiKey:this.apiKey}},...this.onResumeState&&{resumable:!0},...this.resumeKept&&{resume:this.resumeKept},...this.voiceSettings&&{voiceSettings:this.voiceSettings},...this.brain&&{brain:this.brain},...this.languages!==void 0&&{languages:this.languages},...this.perception&&{perception:{...this.perception,...this.readsMood&&{mood:!0}}},...this.greeting?.enabled&&{greeting:{enabled:!0,...this.greetingText&&{message:this.greetingText},language:this.greetingLanguage,...this.sentGreetingId&&{cachedGreetingId:this.sentGreetingId}}},...this.useOwnVoice!==void 0&&{useOwnVoice:this.useOwnVoice},...this.useOwnBrain!==void 0&&{useOwnBrain:this.useOwnBrain},mode:this.mode,turnTaking:this.turnTaking,systemPrompt:this.systemPrompt,needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion},...this.platform&&{platform:this.platform},...this.browser&&{browser:!0},surface:this.mountSurface,...this.framed!==void 0&&{framed:this.framed},...this.micBlocked()&&{micBlocked:!0},...a&&{timeZone:a}})),n();},r.onmessage=a=>{this.ws===r&&this.handleServerMessage(a);},r.onclose=a=>{if(this.ws!==r){T.debug("WebSocket","Ignoring onclose \u2014 already handled");return}let o=this.intentionalClose,u=this.serverInitiatedReason;if(this.isConnected=!1,this.events.emit("connection-status",!1),u)T.info("WebSocket","Closed following server message",{...u});else if(a.code===L_)T.info("WebSocket","Meeting ended; closed by the server");else if(a.code===P_)T.info("WebSocket","A newer session took over this meeting");else if(o)T.info("WebSocket","Connection closed gracefully");else {let{code:d,message:g}=this.classifyClose(a);this.emitError(d,g,"network",{cause:a?.reason});}this.ws=null,this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket closed before init acknowledged"),this.stop();},r.onerror=a=>{if(this.ws!==r)return;let o=this.intentionalClose,u=this.serverInitiatedReason;u?T.info("WebSocket","Transport error after server message",{...u}):o?T.info("WebSocket","Transport error during intentional close"):this.emitError("CONNECTION_FAILED","Transport error on the connection to the avatar service","network",{cause:a}),this.ws=null,this.isConnected=!1,this.events.emit("connection-status",!1),this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket error before init acknowledged"),this.stop(),i(a);};}catch(r){this.emitError("CONNECTION_FAILED","Could not open a connection to the avatar service","network",{cause:r}),i(r);}})};this.onRivReady=async()=>{if(!this.avatarConfig)return;this.setPaintPhase("painted");let e=this.avatarConfig.rive,n=this.voiceSettings?.visimeMs;this.lipSyncTuning.reset(this.avatarConfig.lipSync),this.lipSyncTuning.apply(this.voiceSettings?.lipSync),T.event("Runtime","lip-sync tuning seeded",{configVersion:this.avatarConfig.configVersion,fromConfig:!!this.avatarConfig.lipSync,overridden:!!this.voiceSettings?.lipSync,...this.lipSyncTuning.snapshot()}),this.events.emit("avatar-config",{...this.avatarConfig,rive:{...e,src:this.rivSrc,watermark:this.watermark},lipSync:{...this.avatarConfig.lipSync,...n!==void 0?{visemeMs:n}:{}}}),this.pendingSession&&(this.pendingSession=false,T.info("Runtime","Riv ready \u2014 starting deferred session"),this.startSession());};this.micBlocked=()=>this.mode==="call"&&this.usesDefaultMic&&!X_();this.startMic=async()=>{let e=this.ws;if(this.micBlocked())return this.emitError("MIC_PERMISSION_DENIED","This page does not allow the microphone","sdk"),false;let n;try{n=await this.getMicStreamFn();}catch(i){return this.emitError("MIC_PERMISSION_DENIED","Microphone permission denied","sdk",{cause:i}),false}return this.ws!==e||e?.readyState!==WebSocket.OPEN?(T.warn("Runtime","session closed while awaiting mic \u2014 releasing it"),n.getTracks().forEach(i=>i.stop()),false):(this.micStream=n,this.micPipelineSettled=false,this.micStartedAt=Date.now(),this.agcEnabled=true,this.events.emit("mic-start",this.micStream),true)};this.setAgcForAvatarSpeech=e=>{if(!(!this.micStream||this.environment==="meeting")){if(this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),e){this.applyAgc(false);return}this.agcRestoreTimer=setTimeout(()=>{this.agcRestoreTimer=null,this.applyAgc(true);},sR);}};this.fetchRivBytes=async(e,n=false)=>{try{let i=await fetch(e);if(!i.ok)throw new Error(`HTTP ${i.status}`);return await i.arrayBuffer()}catch(i){return n?(T.error("Rive","Riv fetch failed after retry",{cause:i}),null):(T.warn("Rive","Riv fetch failed \u2014 retrying once",{cause:i}),this.fetchRivBytes(e,true))}};let i=Yl(e);if(this.environment=i.environment,this.environment==="meeting"&&(this.lipSyncTuning.maxStepFrames=G_),i.debug&&T.setLogLevel(0),T.debug("Runtime","Initializing with config",i),this.mode=i.mode||"call",this.turnTaking=this.mode==="call"&&i.turnTaking?.mode==="push-to-talk"?"push-to-talk":"auto",this.turnTaking==="push-to-talk"&&(this.pushToTalk=new qf({onTurnStart:()=>this.openUserTurn(),onTurnEnd:()=>this.closeUserTurn(),onHeldChange:r=>this.events.emit("ptt-held",r)})),this.greeting=n.embedResume?.kept?void 0:i.avatar?.greeting,this.connectTone=n.embedResume?.kept?void 0:i.connectTone,this.avatarId=i.avatar?.avatarId||"default",this.systemPrompt=i.avatar?.systemPrompt,this.apiKey=i.apiKey,this.getSessionToken=i.getSessionToken,this.deployId=i.deployId,this.voiceSettings=i.avatar?.voiceSettings||null,!this.apiKey&&!this.getSessionToken&&!this.deployId)throw new Error("AvatarConfig requires apiKey, getSessionToken, or deployId");this.useOwnVoice=i.avatar?.voiceSettings?.useOwnVoice,this.useOwnBrain=i.avatar?.brain?.useOwnBrain,this.brain=i.avatar?.brain,this.languages=i.avatar?.languages,this.perception=i.perception,this.readsMood=this.mode==="call"&&!!i.perception?.camera&&!!n.readsMood,this.wsUrl=Xp(),this.httpUrl=Fl(),this.greeting?.enabled&&(this.greetingLanguage=this.greeting.language??"en",this.greetingText=this.greeting.message?bg(this.greeting.message):"",this.greetingKey=_g(this.avatarId,this.greetingLanguage,this.greetingText)),i.transcript?.enabled&&(this.transcript=new Yf(r=>this.events.emit("transcript",r),i.transcript.maxEntries)),this.cache=n.cache,this.urlResolver=n.urlResolver,this.pageSurface=n.pageSurface,this.browser=n.browser,this.pageBeforeLive=n.pageBeforeLive??false,this.reportsMicPipeline=n.reportsMicPipeline??false,this.usesDefaultMic=!n.getMicStream,this.getMicStreamFn=n.getMicStream??(async()=>{let r=await navigator.mediaDevices.getUserMedia({audio:this.environment==="meeting"?V_:{echoCancellation:true,noiseSuppression:true,autoGainControl:false,channelCount:1}});return T.event("mic","settings",{...r.getAudioTracks()[0]?.getSettings()}),r}),this.platform=n.platform,this.framed=n.framed,this.embedHostOrigin=n.embedHostOrigin,this.onResumeState=n.embedResume?.onState,this.resumeKept=n.embedResume?.kept,this.downlinkWatchdog=new Qf({loopLagHighMs:this.platform?500:250,onVerdict:r=>this.applyDownlinkVerdict(r)});}paintedConfigFrom(e,n){return {avatarId:e.avatarId,configVersion:e.configVersion,pipelineMode:e.pipelineMode,rive:{...e.rive??{artboard:"",stateMachine:"",layout:{}},src:n},lipSync:e.lipSync,performance:Pf(e.performance)??void 0}}toCacheableConfig(e){return {...e,rive:{...e.rive,src:"",watermark:void 0}}}async startSession(){if(this.isConnected||(this.resetHealth(),this.mode==="call"&&!this.noticeOnly&&!await this.startMic()))return;if(this.pageBeforeLive&&this.firstPage){let n=this.pageSession;if(await Promise.race([this.firstPage,new Promise(i=>setTimeout(i,dR))]),n!==this.pageSession)return}if(this.isConnected=true,this.downlinkWatchdog.start(),this.mode==="call"&&!this.noticeOnly&&this.queueClientNetStatus(),this.pushToTalk&&this.sendClientVadStatus(true,"push_to_talk"),this.events.emit("connection-status",true),this.heldResumeToken&&this.onResumeState?.(this.heldResumeToken),this.heldResumeToken=null,this.setSessionPhase("active"),this.reconnectAttempt=0,this.hasBeenLive=true,this.markToneSessionLive(),this.noticeOnly)return;this.actions.syncNow(),this.greetingPlayed=false;let e=this.skipGreetingOnce;if(this.skipGreetingOnce=false,this.greetedThisSession=!!this.greeting?.enabled&&!e,!this.greeting?.enabled||e){this.greetingPlayed=e,this.enterListening();return}if(!this.playGreeting()){if(!this.greetingDecided){this.greetingAwaitingPlayback=true,this.setTurnPhase("greeting"),this.armGreetingBackstop();return}this.enterListening();}}stop(e={intentionalClose:false}){this.stopCount++,e.intentionalClose&&(this.intentionalClose=true,this.cancelReconnect()),this.teardownSession(e.code,e.reason,true),this.setSessionPhase("idle");}scheduleReconnect(e){if(this.environment!=="meeting"||this.reconnectTimer||!rR.has(e.code))return;let n=F_[this.reconnectAttempt];if(n===void 0){T.warn("Runtime","Meeting reconnect attempts exhausted",{attempts:this.reconnectAttempt});return}this.reconnectAttempt++,T.event("session","reconnect_scheduled",{attempt:this.reconnectAttempt,delayMs:n,code:e.code}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.hasBeenLive&&this.skipNextGreeting(),this.start();},n);}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);}setLipSyncTuning(e){this.lipSyncTuning.apply(e);}speakText(e){try{if(this.mode!=="tts"){this.emitError("INVALID_MODE","speakText() is only available in text mode","sdk",{fatal:!1});return}if(!e.trim()){this.emitError("INVALID_INPUT","speakText() needs non-empty text","sdk",{fatal:!1});return}if(e.length>5e3){this.emitError("INVALID_INPUT","Text too long (max 5000 chars)","sdk",{fatal:!1});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakText() needs a live session \u2014 call start() first","sdk",{fatal:!1});return}this.ws?.send(JSON.stringify({type:"input",payload:{text:e}}));}catch(n){this.emitError("UNKNOWN","Unexpected error in speakText()","sdk",{cause:n,fatal:false});}}addLiveContext({context:e,update:n}){if(!e||e.trim().length===0){this.emitError("INVALID_INPUT","Context cannot be empty","sdk",{fatal:false});return}if(e.length>2e3){this.emitError("INVALID_INPUT","Context too long (max 2000 chars)","sdk",{fatal:false});return}let i=e.trim();if(!(!n&&i===this.lastContextSnapshot)){if(n||(this.lastContextSnapshot=i),this.ws?.readyState!==WebSocket.OPEN||!this.sessionCapabilities){n||(this.pendingContext=[]),this.pendingContext.push({context:i,update:n}),this.pendingContext.length>16&&this.pendingContext.shift();return}this.sendLiveContext(i,n);}}get capabilities(){return this.sessionCapabilities}pageSendSkipReason(e){return this.mode!=="call"?"wrong_mode":this.ws?.readyState!==WebSocket.OPEN?"no_session":this.capabilities?.page.read?e===this.lastPageContext?"unchanged":null:"not_granted"}skipNextGreeting(){this.skipGreetingOnce=true;}async requestTour(){if(!this.isConnected||!this.ws)return null;let e=await this.readPage();if(!e||e.reason==="not_granted"||e.reason==="wrong_mode"||e.reason==="no_session")return T.warn("Runtime","requestTour(): the page cannot be sent",{reason:e?.reason??"no_page_surface"}),null;let n=`t${++this.tourRequestSeq}`;return new Promise(i=>{let r=o=>{clearTimeout(a),this.pendingTours.delete(n),i(o);},a=setTimeout(()=>r(null),q_);this.pendingTours.set(n,r),this.ws?.send(JSON.stringify({type:"tour_request",requestId:n,greeted:this.greetedThisSession}));})}async sendFirstPage(){if(!this.pageSurface||!this.capabilities?.page.read)return;let e=this.pageSession;for(let n of [...fR,null]){let i=await this.readPage();if(i?.sent||this.pageGeneration>0||e!==this.pageSession||i)return;if(n===null){T.warn("Runtime","The page never answered at call start; waiting for a change");return}if(T.warn("Runtime","First page read reached no page \u2014 retrying",{delayMs:n}),await new Promise(r=>setTimeout(r,n)),e!==this.pageSession)return}}readPage(){let e=this.pageSurface;return e?this.queuePageWork(()=>this.readPageNow(e)):(T.debug("Runtime","readPage(): no page surface on this platform"),Promise.resolve(null))}async readPageNow(e){let n=this.pageSession;try{let i=this.pageGeneration+1,r=await e.read(i);if(!r)return null;let a=Og(r),o=r.unreadable?`${a} (${r.unreadable})`:a,u=n===this.pageSession?this.pageSendSkipReason(o):"no_session";return u?(await e.retag(this.pageGeneration),r.generation=this.pageGeneration):(this.pageGeneration=i,this.lastPageContext=o,this.ws?.send(JSON.stringify({type:"page_context",context:a,url:r.url,generation:r.generation,handles:VS(r),...r.covered&&{covered:r.covered},...r.unreadable&&{unreadable:r.unreadable}}))),T.event("page","Page read",{generation:r.generation,page:r.pageName,pageNamedBy:r.pageNamedBy,nodes:r.nodes.length,unnamed:Object.values(r.unnamed).reduce((d,g)=>d+g,0),characters:a.length,sent:!u,...u&&{reason:u}}),{index:r,context:a,sent:!u,...u&&{reason:u}}}catch(i){return this.emitError("UNKNOWN","Failed to read the host page","sdk",{cause:i,fatal:false}),null}}queuePageWork(e){let n=this.pageWork.then(e,e);return this.pageWork=n.catch(()=>{}),n}sendLiveContext(e,n){try{this.ws?.send(JSON.stringify({type:"live_context",context:e,update:n}));}catch(i){this.emitError("UNKNOWN","Failed to send live context","sdk",{cause:i,fatal:false});}}flushPendingContext(){if(this.pendingContext.length===0)return;let e=this.pendingContext;this.pendingContext=[];for(let n of e)this.sendLiveContext(n.context,n.update);}notify(e){try{if(this.mode==="player"){this.emitError("INVALID_MODE","notify() needs a session \u2014 player mode never opens a socket","sdk",{fatal:!1});return}let n=this.appEvents.validate(e);if(!n.ok){this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1});return}let i=e.policy??"idle_only";if(!(this.ws?.readyState===WebSocket.OPEN)&&i!=="context_only"){T.event("app","Event dropped",{name:e.name,reason:"no_session"});return}let a=e.cooldownMs??5e3,o=this.appEvents.admit(e.name,a,Date.now());if(!o.ok){T.event("app","Event dropped",{name:e.name,reason:o.reason});return}if(i==="context_only"){this.addLiveContext({context:n.data?`${e.name}: ${n.data}`:e.name,update:!0});return}this.ws?.send(JSON.stringify({type:"app_event",name:e.name,data:n.data,policy:i,say:e.say})),T.event("app","Event sent",{name:e.name,policy:i});}catch(n){this.emitError("UNKNOWN","Unexpected error in notify()","sdk",{cause:n,fatal:false});}}registerAction(e){try{if(this.mode!=="call")return this.emitError("INVALID_MODE","registerAction() needs call mode \u2014 only a call can confirm an action","sdk",{fatal:!1}),Ig;let n=this.actions.register(e);return n.ok?n.unregister:(this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1}),Ig)}catch(n){return this.emitError("UNKNOWN","Unexpected error in registerAction()","sdk",{cause:n,fatal:false}),Ig}}canDeclareActions(){if(this.ws?.readyState!==WebSocket.OPEN)return false;let e=this.capabilities;return e?e.actions?true:(this.actions.size>0&&!this.actionsGrantWarned&&(this.actionsGrantWarned=true,T.warn("Runtime","actions not granted for this avatar",{registered:this.actions.size})),false):false}sendActionsSet(e){try{return this.ws?.send(JSON.stringify({type:"actions_set",actions:e})),T.event("action","Actions declared",{names:e.map(n=>n.name)}),!0}catch(n){return T.warn("Runtime","failed to send actions_set",{err:n}),false}}async handleActionRun(e){let n=typeof e?.callId=="string"?e.callId:"",i=typeof e?.name=="string"?e.name:"";if(!n){T.warn("Runtime","action_run without a callId cannot be answered",{name:i});return}if(this.actionCallsSeen.has(n)){T.warn("Runtime","duplicate action_run ignored",{callId:n,name:i});return}this.actionCallsSeen.add(n);let r=this.ws,a=Date.now();T.event("action","Action run",{callId:n,name:i});let o=await this.runAction(n,i,e.args);if(T.event("action","Action result",{callId:n,name:i,ok:o.ok,ms:Date.now()-a}),r===null||r!==this.ws||r.readyState!==WebSocket.OPEN){T.warn("Runtime","action_result not sent: the session ended mid-run",{callId:n,name:i,ok:o.ok});return}try{r.send(JSON.stringify({type:"action_result",callId:n,...o}));}catch(u){T.warn("Runtime","failed to send action_result",{callId:n,err:u});}}async runAction(e,n,i){let r=this.actions.get(n);if(!r)return T.warn("Runtime","action_run for an unregistered action",{name:n}),{ok:false,error:Ya.unavailable};let a=RS(r.declaration,i);if(!a)return T.warn("Runtime","action_run args do not match the declaration",{name:n,params:Object.keys(r.declaration.params)}),{ok:false,error:Ya.invalidArgs};let o=new AbortController,u=Promise.resolve().then(()=>r.handler(a,{callId:e,signal:o.signal})).then(g=>{let y=kS(g);return y||(T.warn("Runtime","action handler returned no { ok } result",{name:n}),{ok:false,error:Ya.failed})},g=>(T.error("Runtime","action handler threw",{name:n,err:g}),{ok:false,error:Ya.failed})),d=new Promise(g=>{let y=setTimeout(()=>{o.abort(),T.warn("Runtime","action handler timed out",{name:n,timeoutMs:QS}),g({ok:false,error:Ya.timedOut});},QS);u.then(()=>clearTimeout(y));});return Promise.race([u,d])}getActionFlow(){return this.actionFlows.flow}sendActionUi(e,n,i){let r=this.ws;if(!r||r.readyState!==WebSocket.OPEN)return this.emitError("NOT_CONNECTED","sendActionUi() needs a live session","sdk",{fatal:false}),false;let a=this.actionFlows.isLive?this.actionFlows.flow:null,o;if(e==="input"){let u=a?.name??i??"",d=this.actions.get(u),g=d?IS(d.declaration,n??{}):{ok:false,message:`no registered action "${u}"`};if(!g.ok)return this.emitError("INVALID_INPUT",`sendActionUi(): ${g.message}`,"sdk",{fatal:false}),false;o={type:"action_ui",op:e,...a?{actionId:a.actionId}:{name:u},args:g.args};}else {if(!a)return this.emitError("INVALID_INPUT",`sendActionUi("${e}") needs an action in progress`,"sdk",{fatal:false}),false;o={type:"action_ui",op:e,actionId:a.actionId,revision:a.revision};}try{return r.send(JSON.stringify(o)),T.event("action","Action UI sent",{op:e,actionId:a?.actionId,params:n?Object.keys(n):[]}),!0}catch(u){return T.warn("Runtime","failed to send action_ui",{op:e,err:u}),false}}handleActionState(e){let n=OS(e);if(!n){T.warn("Runtime","action_state ignored: not a flow");return}this.actionFlows.apply(n)&&(T.event("action","Action flow",{actionId:n.actionId,name:n.name,stage:n.stage,revision:n.revision,awaiting:n.awaiting?.kind??null}),this.events.emit("action-flow",n));}async handleActionCheck(e){let n=typeof e?.checkId=="string"?e.checkId:"",i=typeof e?.name=="string"?e.name:"",r=typeof e?.param=="string"?e.param:"";if(!n){T.warn("Runtime","action_check without a checkId cannot be answered",{name:i});return}let a=this.ws,o=e?.args&&typeof e.args=="object"&&!Array.isArray(e.args)?e.args:{},u=await NS(this.actions.get(i)?.check,r,e?.value,o);if(T.event("action","Action check answered",{checkId:n,name:i,param:r,ok:u.ok,unverified:u.unverified===true}),a===null||a!==this.ws||a.readyState!==WebSocket.OPEN){T.warn("Runtime","action_check_result not sent: the session ended",{checkId:n});return}try{a.send(JSON.stringify({type:"action_check_result",checkId:n,...u}));}catch(d){T.warn("Runtime","failed to send action_check_result",{checkId:n,err:d});}}reportPerceptionOutcome(e,n,i){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","reportPerceptionOutcome() needs a live session","sdk",{fatal:false});return}try{this.ws.send(JSON.stringify({type:"perception_status",turnId:n,outcome:e,...e==="granted"&&{hasHistory:!!i?.hasHistory,feed:i?.feed??"off"}}));}catch(r){this.emitError("UNKNOWN","Failed to send perception status","sdk",{cause:r,fatal:false});}}sendCameraState(e){if(this.ws?.readyState===WebSocket.OPEN&&!(e.access===void 0&&e.feed===void 0&&e.facing===void 0&&e.canFlip===void 0&&e.availableCameras===void 0)){try{this.ws.send(JSON.stringify({type:"camera_state",...e.access!==void 0&&{access:e.access},...e.feed!==void 0&&{feed:e.feed},...e.facing!==void 0&&{facing:e.facing},...e.canFlip!==void 0&&{canFlip:e.canFlip},...e.availableCameras!==void 0&&{availableCameras:e.availableCameras}}));}catch(n){T.warn("Runtime","failed to send camera_state",{err:n});}(e.feed==="off"||e.access&&e.access!=="granted")&&this.clearMood();}}get canReadMood(){return this.readsMood&&!!this.capabilities?.mood}get isMoodDetectionOn(){return this.moodDetectionOn}setMoodDetection(e){e!==this.moodDetectionOn&&(this.moodDetectionOn=e,this.moodLatest=null,this.events.emit("mood-detection",e),this.queueMoodState());}reportMood(e){!this.canReadMood||!this.moodDetectionOn||(this.moodLatest=e,this.queueMoodState());}resyncMoodSwitch(){this.moodLastSentKey="off",this.queueMoodState();}moodStateKey(){return this.moodDetectionOn?this.moodLatest?.state??"on":"off"}queueMoodState(){if(!this.canReadMood||this.moodTimer||this.moodStateKey()===this.moodLastSentKey)return;let e=Date.now()-this.moodLastSentAt;if(e>=WS){this.sendMoodState();return}this.moodTimer=setTimeout(()=>{this.moodTimer=null,this.sendMoodState();},WS-e);}sendMoodState(){let e=this.moodStateKey();if(e===this.moodLastSentKey||this.ws?.readyState!==WebSocket.OPEN)return;let n=this.moodDetectionOn?this.moodLatest:null;try{this.ws.send(JSON.stringify({type:"mood_state",enabled:this.moodDetectionOn,...n&&{label:n.state,confidence:n.confidence}})),this.moodLastSentKey=e,this.moodLastSentAt=Date.now(),T.debug("Runtime","mood_state sent",{key:e});}catch(i){T.warn("Runtime","failed to send mood_state",{err:i});}}clearMood(){this.moodLatest=null,this.moodLastSentKey!=="off"&&this.moodLastSentKey!==null&&(this.moodLastSentKey="on");}reportScreenStatus(e,n,i){if(T.event("screen","Share status",{outcome:e,turnId:n,surface:i?.surface??null,browser:i?.browser??null,reason:i?.reason??null}),this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_status",turnId:n,outcome:e,...i?.surface&&{surface:i.surface},...i?.browser&&{browser:i.browser},...i?.reason&&{reason:i.reason}}));}catch(r){T.warn("Runtime","failed to send screen_status",{err:r});}}sendScreenState(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_state",feed:e.feed,...e.surface&&{surface:e.surface}}));}catch(n){T.warn("Runtime","failed to send screen_state",{err:n});}}sendScreenFrame(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_frame",format:"jpeg",width:e.width,height:e.height,frame:Sg(e.bytes)}));}catch(n){T.warn("Runtime","failed to send screen_frame",{err:n});}}reportCommandStatus(e,n,i,r){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"command_status",command:e,turnId:n,outcome:i,...r&&{reason:r}}));}catch(a){T.warn("Runtime","failed to send command_status",{err:a});}}loadVadWeights(){return I_(x_(),this.cache)}noteUserVoice(){this.events.emit("user-voice");}sendClientVadStatus(e,n){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"client_vad_status",active:e,...n&&{reason:n}}));}catch(i){T.warn("Runtime","failed to send client_vad_status",{err:i});}}sendClientNetStatus(){if(this.ws?.readyState===WebSocket.OPEN){try{this.ws.send(JSON.stringify({type:"client_net_status",micMuted:this.micMuted,...this.downlinkVerdict&&{downlink:this.downlinkVerdict}})),this.downlinkVerdict?.state==="ok"&&(this.downlinkVerdict=null);}catch(e){T.warn("Runtime","failed to send client_net_status",{err:e});}this.netStatusLastSentAt=Date.now();}}queueClientNetStatus(){if(this.netStatusTimer)return;let e=Date.now()-this.netStatusLastSentAt;if(e>=qS){this.sendClientNetStatus();return}this.netStatusTimer=setTimeout(()=>{this.netStatusTimer=null,this.sendClientNetStatus();},qS-e);}sendVisionFrames(e,n){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","sendVisionFrames() needs a live session","sdk",{fatal:false});return}if(!e.length){T.warn("Runtime","vision frames requested but buffer is empty",{turnId:n});return}try{let i=e.map(r=>Sg(r));this.ws.send(JSON.stringify({type:"vision_query",turnId:n,format:"jpeg",frames:i}));}catch(i){this.emitError("UNKNOWN","Failed to send vision frames","sdk",{cause:i,fatal:false});}}play(e){if(this.mode!=="player"){this.emitError("INVALID_MODE","play() can only be used in player mode","sdk",{fatal:false});return}this.jobQueue.push({...e,sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,chunkOffset:0}),!(this.processing||this.playerLeadInTimer)&&(this.setTalkingArmed(true),this.playerLeadInTimer=setTimeout(()=>{this.playerLeadInTimer=null,this.setTalkingArmed(false),this.processQueue();},tg));}setTalkingArmed(e){this.talkingArmed!==e&&(this.talkingArmed=e,this.events.emit("talking-armed",e));}clearPlayerLeadIn(){this.playerLeadInTimer&&(clearTimeout(this.playerLeadInTimer),this.playerLeadInTimer=null),this.setTalkingArmed(false);}sendPcmChunk(e){if(!this.micMuted&&!this.noticeReceived&&!(this.ws?.readyState!==WebSocket.OPEN||!this.isConnected)){if(!this.pushToTalk){this.ws.send(e);return}for(let n of this.pushToTalk.gate(e))this.ws.send(n);}}openUserTurn(){(this.turnPhase==="speaking"||this.turnPhase==="greeting")&&this.interrupt({notifyServer:true,reason:"push_to_talk"}),this.sendClientTurnSignal("client_turn_start");}closeUserTurn(){this.sendClientTurnSignal("client_turn_end");}sendClientTurnSignal(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:e,turnId:this.turnId}));}catch(n){T.warn("Runtime",`failed to send ${e}`,{err:n});}}interrupt(e){T.event("bargein","interrupt",{reason:e?.reason??"api",turnId:this.turnId,turnPhase:this.turnPhase});let n=this.turnId;this.sessionId++,this.turnId++,e?.notifyServer&&this.sendClientInterruptToServer(n,e.reason),this.resetSpeechPipeline(),this.setResponseSlow(false),this.events.emit("interrupt"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setHeardSpeechProvider(e){this.heardSpeech=e;}readHeardSpeech(){try{let e=this.heardSpeech?.()?.trim();return e?e.slice(0,pR):void 0}catch{return}}sendClientInterruptToServer(e,n){if(this.ws&&this.ws.readyState===WebSocket.OPEN){let i=this.readHeardSpeech();try{this.ws.send(JSON.stringify({type:"client_interrupt",turnId:e,...n&&{reason:n},...i&&{heard:i}}));}catch{}}}stopSpeaking(){this.sessionPhase==="active"&&(T.event("Runtime","User stopped the avatar"),this.interrupt({notifyServer:true,reason:"user_cancel"}));}cancelSpeech(){T.event("bargein","server_cancel_speech",{turnId:this.turnId,turnPhase:this.turnPhase}),this.resetSpeechPipeline(),this.events.emit("speech-cancelled"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setResponseSlow(e){this.responseSlow!==e&&(this.responseSlow=e,this.events.emit("avatar_slow_response",e));}armFirstChunk(){this.firstChunkPending=true;}resetSpeechPipeline(){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.jobQueue=[],this.processing=false,this.turnOpen=false,this.activeStream=null,this.clearPlayerLeadIn(),this.armFirstChunk(),this.sendAvatarSpeakingSignalToServer(false),this.transcript?.finalizeAvatar();}grantedPageSurface(e,n,i){let r=this.capabilities?.page;return !r||!i(r)?(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","this avatar is not allowed to do that to the page"),null):this.pageSurface?this.pageSurface:(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","no page surface on this platform"),null)}runPageCommand(e,n,i,r){let a=this.grantedPageSurface(e,n,i);if(!a)return;let o=this.commandTurnId(n);this.queuePageWork(()=>r(a,o)).catch(u=>{T.warn("Runtime","page command failed",{command:e,error:String(u)}),this.reportCommandStatus(e,o,"failed",hR);});}scheduleReadAfterAction(){this.actionRereadTimer&&clearTimeout(this.actionRereadTimer),this.actionRereadTimer=setTimeout(()=>{this.actionRereadTimer=null,this.readPage();},cR);}commandTurnId(e){return typeof e?.turnId=="number"&&Number.isFinite(e.turnId)?e.turnId:this.turnId}handleCommand(e){let n=typeof e?.intent=="string"?e.intent:null;if(!n){T.warn("Runtime","command message missing intent",{msg:e});return}this.setResponseSlow(false);let i=this.commandHandlers[n];if(!i){T.warn("Runtime","unknown command intent",{intent:n}),this.reportCommandStatus(n,this.commandTurnId(e),"unsupported","unknown command");return}i(e);}dispose(e="SDK Disposed"){this.lifecycle++,this.cancelReconnect(),this.loadInFlight=null,this.teardownSession(4003,e,false),this.setSessionPhase("idle"),this.setPaintPhase("none");}setAvatarId(e){let n=e||"default";return n===this.avatarId?false:(T.event("Runtime","Avatar changed",{from:this.avatarId,to:n}),this.dispose("Avatar changed"),this.avatarId=n,this.startInvoked=false,this.load(),true)}stale(e){return e!==this.lifecycle}staleSocket(e,n){return this.stale(e)?(this.ws===n&&(this.ws=null),n?.close(4003,"SDK Disposed"),true):false}destroy(){this.dispose(),this.events.removeAll();}getPaintPhase(){return this.paintPhase}getSessionPhase(){return this.sessionPhase}getMode(){return this.mode}getTurnPhase(){return this.turnPhase}getTalkingArmed(){return this.talkingArmed}getSessionId(){return this.sessionId}on(e,n){return this.events.on(e,n)}markRiveReady(){this.riveReady||(this.riveReady=true,this.events.emit("avatar-ready"),this.releaseGreetingForPaint("rive-ready"),this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()));}notifyPlaybackEnded(){this.processing&&(this.processing=false,this.activeStream=null,this.armFirstChunk(),this.processQueue());}notifyAvatarLoadError(e){this.setPaintPhase("failed"),this.emitError("AVATAR_LOAD_FAILED","Failed to load avatar","sdk",{cause:e});}getAvatarConfig(){return this.serverReady?this.avatarConfig:null}getAvailableActions(){return Object.keys(this.avatarConfig?.rive?.gestures??{})}triggerAction(e){e&&this.events.emit("gesture",e);}avatarClicked(){if(this.turnPhase==="speaking"||this.turnPhase==="greeting")return;if(this.sessionPhase==="active"){try{this.ws?.send(JSON.stringify({type:"avatar_click"}));}catch{}return}let e=Date.now(),n=Q_(this.avatarConfig?.performance?.playful?.gestures,this.playful.last,e,this.playful.busyUntilMs);n&&(this.playful={last:n.trigger,busyUntilMs:e+n.ms},this.events.emit("gesture",n.trigger));}setSessionPhase(e){this.sessionPhase!==e&&(this.sessionPhase=e,T.debug("Runtime","Session phase",{next:e}),this.events.emit("session-phase",e),e!=="active"&&this.turnPhase!=="idle"&&this.setTurnPhase("idle"));}setPaintPhase(e){this.paintPhase!==e&&(this.paintPhase=e,T.debug("Runtime","Paint phase",{next:e}),this.events.emit("paint-phase",e),e==="painted"&&this.markTonePainted(),e==="failed"&&this.stopConnectTone("paint-failed"),e==="failed"&&this.releaseGreetingForPaint("paint-failed"));}setTurnPhase(e){this.turnPhase!==e&&(this.turnPhase=e,T.debug("Runtime","Turn phase",{next:e}),this.events.emit("turn-phase",e));}startConnectTone(){!this.connectTone?.enabled||this.connectTonePlaying||this.mode!=="player"&&(this.tonePainted=this.paintPhase==="painted",this.toneSessionLive=this.sessionPhase==="active",!(this.tonePainted&&this.toneSessionLive)&&(this.connectTonePlaying=true,this.connectToneStartedAt=Date.now(),T.event("ConnectTone","Ringback start",{paintedOnEntry:this.tonePainted,liveOnEntry:this.toneSessionLive}),this.events.emit("connect-tone","start",this.resolvedConnectTone()),this.connectToneTimer=setTimeout(()=>{T.warn("ConnectTone","Ringback hit its ceiling \u2014 stopping"),this.stopConnectTone("ceiling");},D_)));}stopConnectTone(e){this.connectToneTimer&&(clearTimeout(this.connectToneTimer),this.connectToneTimer=null),this.connectTonePlaying&&(this.connectTonePlaying=false,T.event("ConnectTone","Ringback stop",{reason:e,audibleMs:this.connectToneStartedAt?Date.now()-this.connectToneStartedAt:null}),this.connectToneStartedAt=null,this.events.emit("connect-tone","stop"));}resolvedConnectTone(){return {...oa,...this.connectTone}}getPendingConnectTone(){return this.connectTonePlaying?this.resolvedConnectTone():null}markTonePainted(){this.tonePainted=true,this.toneSessionLive&&this.stopConnectTone("painted+live");}markToneSessionLive(){this.toneSessionLive=true,this.tonePainted&&this.stopConnectTone("painted+live");}settleGreeting(e){this.greetingDecided||(this.greetingDecided=true,this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),T.event("Greeting","Decision settled",{outcome:e}));}armGreetingBackstop(){this.greetingDecided||this.greetingDecisionTimer||(this.greetingDecisionTimer=setTimeout(()=>{this.greetingDecisionTimer=null,T.warn("Greeting","No greeting decision from server \u2014 listening"),this.settleGreeting("timeout"),this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&this.enterListening();},N_));}handleGreetingPayload(e,n){if(!n?.audio_base64){this.settleGreeting("empty-payload"),this.resolveGreetingPlayback();return}let i={greetingId:e,audioChunks:[n.audio_base64],alignments:[n.normalized_alignment??n.alignment??null],...n.visemes&&{visemes:[Df(n.visemes)]},cachedAt:Date.now()};this.greetingEntry=i,this.sentGreetingId=e,this.cache.setCachedGreeting(this.greetingKey,i).catch(()=>{}),this.settleGreeting("synthesized"),this.resolveGreetingPlayback();}resolveGreetingPlayback(){this.greetingAwaitingPlayback&&(this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&(this.playGreeting()||this.enterListening()));}playGreeting(){if(this.greetingPlayed)return false;let e=this.greetingEntry;if(!e?.audioChunks.length)return false;this.greetingPlayed=true,T.event("Greeting","Playing greeting",{greetingId:e.greetingId}),this.setTurnPhase("greeting");let n={audioChunks:e.audioChunks,alignments:e.alignments,...e.visemes&&{visemes:e.visemes},sessionId:this.sessionId,turnId:this.turnId,isGreeting:true,jobId:++this.jobCounter,chunkOffset:0},i=()=>{this.greetingDelayTimer=setTimeout(()=>{this.greetingDelayTimer=null,n.sessionId===this.sessionId&&this.sessionPhase==="active"&&this.enqueueJob(n);},eg);},r=()=>{this.greetingWaitsForPaint()?this.holdGreetingForPaint(i):i();};return this.greetingWaitsForMic()?this.holdGreetingForMic(r):r(),true}reportMicPipelineSettled(){this.micPipelineSettled=true,this.releaseGreetingForMic("settled");}greetingWaitsForMic(){return this.reportsMicPipeline&&!!this.micStream&&!this.micPipelineSettled}holdGreetingForMic(e){this.greetingAwaitingMic=e,this.greetingMicTimer=setTimeout(()=>this.releaseGreetingForMic("timeout"),U_),T.event("Greeting","Held for mic pipeline");}releaseGreetingForMic(e){let n=this.greetingAwaitingMic;this.clearGreetingMicHold(),n&&(T.event("Greeting","Released after mic hold",{reason:e}),n());}clearGreetingMicHold(){this.greetingAwaitingMic=null,this.greetingMicTimer&&(clearTimeout(this.greetingMicTimer),this.greetingMicTimer=null);}greetingWaitsForPaint(){return this.environment==="meeting"&&!this.riveReady&&this.paintPhase!=="failed"}holdGreetingForPaint(e){this.greetingAwaitingPaint=e,this.greetingPaintTimer=setTimeout(()=>this.releaseGreetingForPaint("timeout"),B_),T.event("Greeting","Held for first paint");}releaseGreetingForPaint(e){let n=this.greetingAwaitingPaint;this.clearGreetingPaintHold(),n&&(T.event("Greeting","Released after paint hold",{reason:e}),n());}clearGreetingPaintHold(){this.greetingAwaitingPaint=null,this.greetingPaintTimer&&(clearTimeout(this.greetingPaintTimer),this.greetingPaintTimer=null);}enterListening(){this.setTurnPhase("listening");}enterThinking(){this.setTurnPhase("thinking"),this.events.emit("avatar_thinking");}holdsSpeech(){return this.processing||this.jobQueue.length>0||this.utteranceBuffer.audio.length>0}enqueueJob(e){this.jobQueue.push(e),this.processQueue();}processQueue(){if(this.processing)return;let e=this.jobQueue.shift();if(!e){this.transcript?.finalizeAvatar(),this.turnOpen?this.enterThinking():this.enterListening(),this.sendAvatarSpeakingSignalToServer(false);return}if(e.sessionId!==this.sessionId){this.processQueue();return}this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(e),this.sendAvatarSpeakingSignalToServer(true);}emitSpeak(e){this.setResponseSlow(false),this.rollScriptTail(e),this.transcript?.applyAvatarSpeech(e),this.events.emit("speak",e);}rollScriptTail(e){let n=this.scriptTail;n.jobId!==e.jobId&&(n.jobId=e.jobId,n.upto=0,n.text="");let i=e.alignments??[],r=e.chunkOffset+i.length;if(r<=n.upto)return;let a=[];for(let o=Math.max(0,n.upto-e.chunkOffset);o<i.length;o++){let u=i[o];if(!u)continue;let d=ql(u);d&&a.push(d);}n.upto=r,n.text=[n.text,...a].join(" ").slice(-200);}getScriptTail(){return this.scriptTail.text}applyAgc(e){if(this.agcEnabled===e||typeof this.micStream?.getAudioTracks!="function")return;let n=this.micStream.getAudioTracks()[0];n&&(this.agcEnabled=e,T.event("mic","agc",{enabled:e}),n.applyConstraints({autoGainControl:e}).catch(i=>T.warn("Runtime","AGC toggle rejected",{enabled:e,error:i})));}async handleServerMessage(e){if(typeof e.data!="string")return;let n=Date.now(),i;try{i=JSON.parse(e.data);}catch{return}let r=this.transit.note(i.sentAt,n);switch(this.downlinkWatchdog.noteMessage(i.seq,n,i.type===PS),i.type){case "avatar_config":{let a=i.config;if(!a?.rive&&!this.serverReady){this.emitError("AVATAR_LOAD_FAILED","Server config had no rive configuration","server"),this.rejectInitAck("Server config missing rive configuration");return}if(this.serverReady)await this.repaintFromPayload(a,this.lifecycle);else {let o=a.rivUrl?await this.fetchRivBytes(a.rivUrl):this.pendingRivBytes;if(!o){this.emitError("AVATAR_LOAD_FAILED","No rivUrl in avatar_config and no cache","server"),this.rejectInitAck("no riv bytes");return}await this.applyRenderPayload(a,o,this.lifecycle);}this.resolveInitAck();break}case "greeting_current":{T.event("Greeting","Server confirmed cached greeting",{greetingId:i.greetingId}),this.settleGreeting("cache-hit"),this.resolveGreetingPlayback();break}case "greeting":{T.event("Greeting","Received greeting audio",{greetingId:i.greetingId}),this.handleGreetingPayload(i.greetingId,i.job);break}case "greeting_unavailable":{T.info("Greeting","Server sent no greeting",{reason:i.reason??null}),this.settleGreeting(`unavailable:${i.reason??"unspecified"}`),this.resolveGreetingPlayback();break}case "notice_only":{this.noticeOnly=true,T.info("Runtime","notice_only \u2014 suppressing mic/greeting",{kind:i.kind}),this.serverReady||await this.paintForNotice(),this.setSessionPhase("idle"),this.resolveInitAck();break}case "resume_state":{if(typeof i.token!="string")break;this.isConnected?this.onResumeState?.(i.token):this.heldResumeToken=i.token;break}case "session_started":{this.resumeKept=void 0,this.heldResumeToken=null,this.sessionCapabilities=jS(i.capabilities);let{camera:a,screen:o,micMute:u,endCall:d,actions:g,page:y}=this.sessionCapabilities;T.event("session","Capabilities resolved",{camera:a,screen:o,micMute:u,endCall:d,actions:g,pageRead:y.read,pageScroll:y.scroll,pageNavigate:y.navigate,pageClick:y.click}),this.resyncMoodSwitch(),this.flushPendingContext(),this.noticeOnly||(this.firstPage=this.sendFirstPage()),this.serverReady?this.startSession():(T.info("Runtime","session_started before riv ready \u2014 deferring"),this.pendingSession=true);break}case "error":case "closed":{let a=i.type==="error",o=a?"SERVER_ERROR":"SERVER_CLOSE_REQUESTED",u=i.message||(a?"Server error":"Server requested closure");this.serverInitiatedReason={code:o,message:u},this.emitError(o,u,"server"),this.rejectInitAck(u);return}case "usage_limit_reached":case "avatar_not_allowed":{let a=i.type==="usage_limit_reached",o=i.message||(a?"Usage limit reached":"This avatar is not in your active slots, and your active slots are full");this.serverInitiatedReason={code:i.type,message:o},this.handleNotice({kind:i.kind??"plan",action:i.action,message:o});return}case "brain_error":{let a=i.message||"The assistant failed to respond";this.emitError("BRAIN_ERROR",a,"server",{fatal:false}),this.turnOpen=false,this.turnPhase==="thinking"&&this.enterListening();return}case "stream_health":{let a=i.service,o=i.state;if(!this.isHealthService(a)||!this.isHealthState(o)){T.warn("Runtime","stream_health: unknown service/state",{service:i.service,state:i.state});return}T.event("Runtime","stream_health",{service:a,state:o,code:i.code??null,detail:i.detail??null}),this.health[a]=o,this.emitHealth(a,i.code);return}case "tts_alignment":{if(i.turnId!==this.turnId)return;let a=i.audio_base64??i.audio_base64_string??"";if(!a)return;this.firstAudioAt===null&&(this.firstAudioAt=n,this.firstAudioLagMs=r);let o=this.mode==="call"&&!this.noticeOnly?jl(i.normalized_alignment??i.alignment):i.normalized_alignment??null;T.debug("TTS","Processed alignment",o);let u=i.display_alignment?jl(i.display_alignment):null;if(this.utteranceBuffer.audio.push(a),this.utteranceBuffer.alignments.push(o),this.utteranceBuffer.displayAlignments.push(u),this.utteranceBuffer.visemes.push(Df(i.visemes)),!this.utteranceBuffer.flushTimer){let d=this.firstChunkPending?0:aR;this.firstChunkPending=false,this.utteranceBuffer.flushTimer=setTimeout(()=>{this.flushUtterance();},d);}return}case "user_transcript":{T.debug("Transcript","user_transcript received",{text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??null,event:i.event??null,msSinceMicStart:this.micStartedAt===null?null:Date.now()-this.micStartedAt,micMuted:this.micMuted,turnPhase:this.turnPhase});let a=this.turnPhase==="speaking"&&vS(i.text??"",this.getScriptTail());a||this.transcript?.applyUserTranscript({text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??this.turnId}),i.text&&this.events.emit("user-partial",i.text,!!i.isFinal),i.text&&!a&&!this.pageReadThisUtterance&&this.capabilities?.page.read&&(this.pageReadThisUtterance=true,this.readPage());return}case "user_speaking":{this.events.emit("user-speaking");return}case "user_stopped_speaking":{this.deliveryLagMs=r,this.pageReadThisUtterance=false,this.userStoppedAt=n-(r??0),this.speakReportedForStop=false,this.firstAudioAt=null,this.firstAudioLagMs=null;return}case "avatar_thinking":{if(i.settles===true&&(this.turnOpen=true,this.holdsSpeech()))return;this.enterThinking();return}case "turn_settled":{this.turnOpen=false,this.turnPhase==="thinking"&&i.audioPending!==true&&!this.holdsSpeech()&&this.enterListening();return}case "avatar_slow_response":{this.setResponseSlow(true);return}case "avatar_speech_starting":{this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()),this.transcript?.finalizeAvatar(),this.armFirstChunk(),this.events.emit("avatar_speech_starting");return}case "interrupt":{T.event("bargein","server_interrupt",{turnId:this.turnId,turnPhase:this.turnPhase}),this.interrupt({reason:"server"});return}case "command":{this.handleCommand(i);return}case "tour":{let a=Array.isArray(i.steps)?i.steps:null;this.pendingTours.get(i.requestId)?.(a);return}case "tour_unavailable":{T.warn("Runtime","Server could not write a tour",{reason:i.reason}),this.pendingTours.get(i.requestId)?.(null);return}case "action_run":{this.handleActionRun(i);return}case "action_state":{this.handleActionState(i);return}case "action_check":{this.handleActionCheck(i);return}case "gesture":{if(typeof i.name=="string"){let a=typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,o=typeof i.speechless=="boolean"?i.speechless:void 0;this.events.emit("gesture",i.name,a,o);}return}case "beep":{this.events.emit("beep",typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,typeof i.speechless=="boolean"?i.speechless:void 0);return}}}teardownSession(e,n,i=true){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.turnOpen=false,this.stopConnectTone("session-teardown"),this.toneSessionLive=false,this.greetingDelayTimer&&(clearTimeout(this.greetingDelayTimer),this.greetingDelayTimer=null),this.clearGreetingPaintHold(),this.clearGreetingMicHold(),this.clearPlayerLeadIn(),this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),this.greetingDecided=false,this.greetingAwaitingPlayback=false,this.greetingPlayed=false,this.sessionCapabilities=null,this.pageGeneration=0,this.lastPageContext=null,this.firstPage=null,this.pageSession++;for(let a of [...this.pendingTours.values()])a(null);this.actionRereadTimer&&(clearTimeout(this.actionRereadTimer),this.actionRereadTimer=null),this.actions.resetSession(),this.actionCallsSeen.clear(),this.actionFlows.flow&&(this.actionFlows.clear(),this.events.emit("action-flow",null)),this.actionsGrantWarned=false,this.armFirstChunk(),this.setResponseSlow(false),this.micMuted&&(this.micMuted=false,this.events.emit("mic-muted",false)),this.speakerMuted&&(this.speakerMuted=false,this.events.emit("speaker-muted",false)),this.sendAvatarSpeakingSignalToServer(false),this.isConnected&&(this.isConnected=false,this.events.emit("connection-status",false)),this.downlinkWatchdog.reset(),this.resetHealth(),this.heldResumeToken=null,this.lastContextSnapshot&&(this.pendingContext=[{context:this.lastContextSnapshot}]),this.netStatusTimer&&(clearTimeout(this.netStatusTimer),this.netStatusTimer=null),this.netStatusLastSentAt=0,this.moodTimer&&(clearTimeout(this.moodTimer),this.moodTimer=null),this.moodLatest=null,this.moodLastSentKey=null,this.moodLastSentAt=0,this.intentionalClose=false,this.serverInitiatedReason=null;let r=this.ws;this.ws=null,r?.close(e,n),this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),this.micStream&&(this.micStream.getTracks().forEach(a=>a.stop()),this.micStream=null,this.micStartedAt=null,this.events.emit("mic-stop")),this.pushToTalk?.reset(),this.jobQueue=[],this.processing=false,this.activeStream=null,this.turnId=0,this.sessionId=0,this.userStoppedAt=null,this.speakReportedForStop=false,this.deliveryLagMs=null,this.firstAudioAt=null,this.firstAudioLagMs=null,this.transit.reset(),this.pendingSession=false,this.rejectInitAck("Runtime stopped"),this.transcript?.reset(),this.scriptTail={jobId:-1,upto:0,text:""},this.noticeReceived=false,this.noticeOnly=false,this.visualState="normal",i||(this.serverReady=false,this.rivSrc&&(this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=null),this.pendingRivBytes=null,this.riveReady=false,this.avatarConfig=null,this.cachedConfigVersion=void 0,this.watermark=false);}sendAvatarSpeakingSignalToServer(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_speaking",value:e}));}catch{}}resolveInitAck(){this.initAckResolve?.(),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}rejectInitAck(e){this.initAckReject?.(new Error(e)),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}emitError(e,n,i,r){let a=r?.fatal??true,o={code:e,message:n,source:i,cause:r?.cause,fatal:a,retryable:a&&e!=="MIC_PERMISSION_DENIED"};if(this.lastEmittedError=o,T.error("Runtime",`${i.toUpperCase()} ERROR: ${n}`,{code:e,fatal:a}),this.events.emit("error",o),!a)return;let u=i==="server"&&this.initAckReject!==null;this.failSession(o),u||this.scheduleReconnect(o);}reportAudioBlocked(e){this.emitError("UNKNOWN",`Audio ${e} is blocked: the page has not had a user gesture`,"sdk",{fatal:false});}classifyClose(e){let n=e?.reason?.trim();switch(e?.code){case 4008:return {code:"SESSION_IDLE_TIMEOUT",message:n||"Session disconnected due to inactivity"};case 1008:return {code:"SERVER_CLOSE_REQUESTED",message:n||"The service ended the session"};case 1009:return {code:"SERVER_CLOSE_REQUESTED",message:n||"Message too big"};case 1011:return {code:"SERVER_ERROR",message:"The service ended the session after a component failure"};default:return {code:"CONNECTION_FAILED",message:n?`Connection to the avatar service closed: ${n}`:"Connection to the avatar service was lost unexpectedly"}}}failSession(e){if(e.code==="SESSION_IDLE_TIMEOUT"){this.stop({intentionalClose:true,code:4002,reason:"Idle timeout reached"});return}if(e.code==="AVATAR_LOAD_FAILED"||e.code==="MIC_PERMISSION_DENIED"||e.source==="sdk"){this.stop({intentionalClose:true,code:4004,reason:LS(e)});return}this.stop({intentionalClose:false,code:4e3,reason:e.message});}setVisualState(e){this.visualState!==e&&(this.visualState=e,T.event("Runtime","Visual state",{state:e}),this.events.emit("visual",e));}applyDownlinkVerdict(e){if(this.noticeReceived)return;let n=e.state==="degraded"?"degraded":"ok";this.downlinkVerdict=e,this.downlinkScope=e.scope,T.event("Runtime","downlink_health",{...e}),this.health.downlink!==n&&(this.health.downlink=n,this.emitHealth("downlink","DOWNLINK_SLOW")),this.queueClientNetStatus();}transcriptPathDegraded(){return this.health.downlink!=="ok"&&this.downlinkScope!=="device"||this.health.ingest!=="ok"||this.health.stt!=="ok"}isHealthService(e){return e==="ingest"||e==="stt"||e==="llm"||e==="tts"}isHealthState(e){return e==="ok"||e==="degraded"||e==="failed"}resolveHealthConcern(e,n){let i=o=>o===e?n:void 0;if(this.health.ingest!=="ok")return {scope:"network",service:"ingest",state:this.health.ingest,code:i("ingest")};if(this.health.downlink!=="ok")return {scope:this.downlinkScope,service:"downlink",state:this.health.downlink,code:i("downlink")};let r=["stt","llm","tts"],a=null;for(let o of r){let u=this.health[o];if(u==="failed"){a=o;break}u==="degraded"&&a===null&&(a=o);}return a===null?null:{scope:"service",service:a,state:this.health[a],code:i(a)}}emitHealth(e,n){let i={services:{...this.health},concern:this.resolveHealthConcern(e,n)};this.events.emit("health",i);}resetHealth(){let e=Object.values(this.health).some(n=>n!=="ok");this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},this.downlinkScope="network",this.downlinkVerdict=null,e&&this.emitHealth();}handleNotice(e){this.noticeReceived=true,this.downlinkWatchdog.stop(),this.downlinkVerdict=null,this.health.downlink!=="ok"&&(this.health.downlink="ok",this.emitHealth()),T.event("Runtime","Session notice",{...e}),this.stopConnectTone("notice"),this.events.emit("notice",e),this.setVisualState("expired");}flushUtterance(){let e=this.utteranceBuffer;if(e.flushTimer=null,!e.audio.length)return;if(!this.riveReady){T.debug("Runtime","Holding speech \u2014 renderer not ready",{chunks:e.audio.length});return}(!this.activeStream||this.activeStream.turnId!==this.turnId)&&(this.activeStream={sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,emittedChunks:0});let n={audioChunks:e.audio,alignments:e.alignments,displayAlignments:e.displayAlignments,visemes:e.visemes,sessionId:this.activeStream.sessionId,turnId:this.activeStream.turnId,jobId:this.activeStream.jobId,chunkOffset:this.activeStream.emittedChunks};this.activeStream.emittedChunks+=e.audio.length,e.audio=[],e.alignments=[],e.displayAlignments=[],e.visemes=[],this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(n),this.sendAvatarSpeakingSignalToServer(true),this.reportAvatarStartedSpeaking();}reportAvatarStartedSpeaking(){if(this.speakReportedForStop)return;this.speakReportedForStop=true;let e=Date.now(),n=this.userStoppedAt!==null?e-this.userStoppedAt:null,i=this.firstAudioAt!==null?e-this.firstAudioAt:null;if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_started_speaking",turnId:this.turnId,clientLatencyMs:n,deliveryLagMs:this.firstAudioLagMs,stopNoticeLagMs:this.deliveryLagMs,clientRenderMs:i}));}catch{}}};var Ng=t=>{let e=new Uint8Array(t.length/4);for(let n=0;n<e.length;n+=1){let i=n*4;e[n]=(t[i]+t[i+1]+t[i+2])/3;}return e},AR=(t,e)=>{let n=0,i=0;for(let r=0;r<e.length;r+=1){let a=Math.abs(t[r]-e[r]);n+=a,a>i&&(i=a);}return {mean:e.length?n/e.length:0,max:i}},Dg=(t,e,n)=>{if(!t||t.length!==e.length)return true;let{mean:i,max:r}=AR(t,e);return i>=4?true:r>=8&&n>=4e3};var n1={happy:[{shape:"mouthSmile",weight:.8},{shape:"cheekSquint",weight:.2}],surprised:[{shape:"browInnerUp",weight:.25},{shape:"browOuterUp",weight:.25},{shape:"eyeWide",weight:.1},{shape:"jawOpen",weight:.4,mouth:true}],angry:[{shape:"browDown",weight:.85},{shape:"noseSneer",weight:.15}],sad:[{shape:"mouthFrown",weight:.55,mouth:true},{shape:"browInnerUp",weight:.45}]},yR={happy:.45,surprised:.3,angry:.2,sad:.35},JS=.3,$S=.2,bR={neutral:1,happy:1,surprised:1,angry:.7,sad:.7},_R=1500,SR=.6,ER=1e3,wR=2e3,MR=.03,TR=.2,CR=new Set(["browInnerUp","browOuterUp","eyeWide"]),e1=.1,t1=.3,Kf=t=>Math.round(t*100)/100,eu=[...new Set([...Object.values(n1).flatMap(t=>t.map(e=>e.shape)),"eyeBlink"])],tu=(t,e)=>{let n=t[e];if(typeof n=="number")return n;let i=t[`${e}Left`]??0,r=t[`${e}Right`]??0;return (i+r)/2},nu=class{constructor(){this.baseline=new Map;this.window=[];this.current=null;this.candidate=null;this.faceLostAtMs=null;this.last=null;}update(e,n,i){if(!e)return this.noteNoFace(n);if(this.faceLostAtMs=null,this.baseline.size===0)for(let d of eu)this.baseline.set(d,Math.min(tu(e,d),t1));let r=new Map;for(let d of eu){let g=this.baseline.get(d)??0,y=tu(e,d);r.set(d,g<1?Math.max(0,(y-g)/(1-g)):0);}let{label:a,scores:o}=this.frameLabel(r,i),u=["browInnerUp","browOuterUp"].reduce((d,g)=>d+Math.max(0,(this.baseline.get(g)??0)-tu(e,g)),0)/2;if(this.last={raw:Object.fromEntries(eu.map(d=>[d,Kf(tu(e,d))])),baseline:Object.fromEntries(eu.map(d=>[d,Kf(this.baseline.get(d)??0)])),browDrop:Kf(u),scores:o,label:a},a==="neutral"&&!i&&this.learnBaseline(e),a==="neutral"&&i)return this.candidate=null,this.current;for(this.window.push({atMs:n,label:a});this.window.length&&n-this.window[0].atMs>_R;)this.window.shift();return this.vote(n)}inspect(){return this.last}reset(){this.last=null,this.baseline.clear(),this.window=[],this.current=null,this.candidate=null,this.faceLostAtMs=null;}frameLabel(e,n){let i={},r="neutral",a=0;for(let[o,u]of Object.entries(n1)){let d=0;for(let y of u)y.mouth&&n||(d+=y.weight*(e.get(y.shape)??0));if(o==="angry"||o==="sad"){let y=e.get("mouthSmile")??0;d*=1-Math.max(0,y-$S)/(1-$S);}if(o==="surprised"){let y=e.get("eyeBlink")??0;d*=1-Math.max(0,y-JS)/(1-JS);}i[o]=Kf(d);let g=d-yR[o];g>a&&(r=o,a=g);}return {label:r,scores:i}}learnBaseline(e){for(let n of eu){let i=tu(e,n),r=this.baseline.get(n)??0;if(i-r>e1)continue;let a=CR.has(n);if(a&&r-i>e1)continue;let o=i<r&&!a?TR:MR;this.baseline.set(n,Math.min(r+o*(i-r),t1));}}vote(e){let n=new Map;for(let o of this.window)n.set(o.label,(n.get(o.label)??0)+1);let i=null,r=0;for(let[o,u]of n){let d=u/this.window.length;d>r&&(i=o,r=d);}if(!i||r<SR)return this.candidate=null,this.current;let a=Math.round(r*bR[i]*100)/100;return this.current?.state===i?(this.candidate=null,this.current={state:i,confidence:a},this.current):(this.candidate?.label!==i&&(this.candidate={label:i,sinceMs:e}),e-this.candidate.sinceMs>=ER&&(this.current={state:i,confidence:a},this.candidate=null),this.current)}noteNoFace(e){return this.faceLostAtMs??(this.faceLostAtMs=e),e-this.faceLostAtMs<wR?this.current:(this.window=[],this.candidate=null,this.baseline.clear(),this.current={state:"no_face",confidence:1},this.current)}};var RR={top:"top",middle:"middle",center:"middle",centre:"middle",bottom:"bottom"},kR=new Set(["up","down"]),Lg=t=>{let e=t.trim().toLowerCase();if(!e)return null;let n=RR[e];if(n)return {kind:"edge",edge:n};if(kR.has(e))return {kind:"step",direction:e};let i=Xl(e);return i?{kind:"axis",...i}:null};function iu(t){let e=t,n=new Set;return {subscribe(i){return n.add(i),()=>n.delete(i)},getSnapshot:()=>e,getServerSnapshot:()=>t,set(i){if(!Object.is(e,i)){e=i;for(let r of n)r();}}}}var ru=class{constructor(e,n=Math.random){this.idleActs=e;this.random=n;this.pass=[];this.round=[];this.lastId=null;}next(){this.round.length||(this.round=this.planRound());let e=this.round.shift();return this.lastId=e.id,e}planRound(){let{windowMinMs:e,windowMaxMs:n}=this.idleActs;this.pass.length||(this.pass=this.shuffled());let i=[],r=0;for(let o of [...this.pass])i.length&&r+o.ms>n||(i.push({act:o,holdMs:o.ms}),r+=o.ms,this.pass.splice(this.pass.indexOf(o),1));let a=o=>o.holdMs/o.act.ms;for(;r<e;){let o=n-r,u=i.filter(({act:g})=>g.loop!=="oneShot"&&g.ms<=o);if(!u.length)break;let d=u.reduce((g,y)=>a(y)<a(g)||a(y)===a(g)&&y.act.ms>g.act.ms?y:g);d.holdMs+=d.act.ms,r+=d.act.ms;}return i.map(({act:o,holdMs:u})=>({id:o.id,holdMs:u,cycleMs:o.ms,...o.timeline&&{timeline:o.timeline}}))}shuffled(){let e=[...this.idleActs.acts];for(let n=e.length-1;n>0;n--){let i=Math.floor(this.random()*(n+1));[e[n],e[i]]=[e[i],e[n]];}return e.length>1&&e[0].id===this.lastId&&e.push(e.shift()),e}};var i1={quietToIdleMs:mg,idleCycleMs:0,playfulAfterMs:0,playfulRoles:[],idleTriggers:[],thinkingMaxMs:0},xR={has:()=>false,fire:()=>{}},Zf="trigger:",OR=.5,au=class{constructor(e,n={},i=()=>{},r=()=>true,a=xR){this.writeMode=e;this.cycle=i;this.rigHas=r;this.rigTriggers=a;this.phase="off";this.timer=null;this.cycleTimer=null;this.attending=false;this.idleSince=0;this.idleRole="idle";this.idleStep="idle";this.planner=null;this.hold=null;this.holdStartMs=0;this.holdEntered=false;this.followsRig=false;this.rigPose=null;this.timings={...i1,...typeof n=="number"?{quietToIdleMs:n}:n},this.planner=this.timings.idleActs?new ru(this.timings.idleActs):null,this.followsRig=this.namesActs();}setMode(e,n){e!=="idle"&&(this.rigPose=null),this.writeMode(e,n);}namesActs(){return !!this.timings.idleActs?.acts.some(e=>e.timeline)}configure(e){this.timings={...i1,...e},this.planner=this.timings.idleActs?new ru(this.timings.idleActs):null,this.hold=null,this.followsRig=this.namesActs(),this.phase==="listening"?this.listen(false):this.phase==="idle"?this.settle():this.phase==="thinking"&&this.armThinkingLimit();}rest(e){if(this.clear(),!e){this.phase="off",this.setMode("idle");return}this.listen(true);}connect(){this.clear(),this.phase="off",this.idleSince=Date.now(),this.settle();}resume(e){switch(this.phase){case "busy":return;case "off":e?this.connect():this.setMode("idle");return;case "listening":this.setMode("listening");return;case "idle":this.setMode(this.idleRole,this.idleRole==="idle"?this.hold?.id:void 0);return;case "thinking":this.setMode("thinking");return}}think(){if(!(this.phase==="busy"||this.phase==="off")){if(this.phase==="thinking"){this.armThinkingLimit();return}this.startThinking();}}restThinking(){this.startThinking();}startThinking(){this.clear(),this.phase="thinking",this.setMode("thinking"),this.armThinkingLimit();}stopThinking(){this.phase==="thinking"&&this.listen(true);}userActivity(){this.phase==="busy"||this.phase==="off"||this.listen(false);}setAttending(e){e!==this.attending&&(this.attending=e,this.userActivity());}busy(){this.clear(),this.phase="busy",this.rigPose=null;}dispose(){this.clear();}rigEntered(e){this.timings.idleActs?.acts.some(n=>n.timeline===e)&&(this.rigPose={timeline:e,sinceMs:Date.now()},!(this.phase!=="idle"||this.idleRole!=="idle"||this.holdEntered||e!==this.hold?.timeline)&&(this.holdEntered=true,this.holdStartMs=Date.now(),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.cycleTimer=null,this.armCycle()));}get current(){return this.phase}listen(e){this.clear(),(e||this.phase!=="listening")&&this.setMode("listening"),this.phase="listening",this.timings.quietToIdleMs>0&&!this.attending&&(this.timer=setTimeout(()=>{this.timer=null,!(this.phase!=="listening"||this.attending)&&(this.idleSince=Date.now(),this.settle());},this.timings.quietToIdleMs));}settle(){this.clear(),this.phase!=="idle"?(this.phase="idle",this.idleRole="idle",this.idleStep="idle",this.setMode("idle",this.nextHold(Date.now()))):this.idleRole==="idle"&&this.planner&&!this.hold&&this.cycle(this.nextHold(Date.now())),this.armCycle();}nextHold(e){if(this.hold=this.planner?.next()??null,this.holdStartMs=e,this.holdEntered=false,this.hold?.timeline&&this.rigPose&&this.rigPose.timeline===this.hold.timeline){let n=Math.floor((e-this.rigPose.sinceMs)/this.hold.cycleMs);this.holdStartMs=this.rigPose.sinceMs+Math.max(0,n)*this.hold.cycleMs,this.holdEntered=true;}return this.hold?.id}armCycle(){let e=this.idleRole==="idle"?this.hold:null;if(!e){this.timings.idleCycleMs>0&&this.armTimer(this.timings.idleCycleMs,()=>this.onCycle());return}if(this.followsRig&&!this.holdEntered){let i=Math.max(...this.timings.idleActs?.acts.map(r=>r.ms)??[0]);this.armTimer(this.holdStartMs+i+e.cycleMs-Date.now(),()=>{this.followsRig=false,this.holdEntered=true,this.holdStartMs=Date.now(),this.armCycle();});return}let n=this.holdStartMs+e.holdMs-e.cycleMs*(1-OR);this.armTimer(n-Date.now(),()=>this.onCycle());}armTimer(e,n){this.cycleTimer=setTimeout(()=>{this.cycleTimer=null,n();},Math.max(0,e));}onCycle(){if(this.phase!=="idle")return;let{playfulAfterMs:e,playfulRoles:n,idleTriggers:i=[]}=this.timings,r=n.length>0||i.length>0,o=e>0&&r&&Date.now()-this.idleSince>=e?this.nextIdleStep(n,i):"idle";if(o.startsWith(Zf)){this.idleRole!=="idle"&&(this.idleRole="idle",this.setMode("idle",this.nextHold(Date.now()))),this.idleStep=o,this.rigTriggers.fire(o.slice(Zf.length)),this.armCycle();return}let u=o;this.idleStep=u;let d=this.idleRole==="idle"&&this.hold?this.holdStartMs+this.hold.holdMs:Date.now(),g=u==="idle"?this.nextHold(d):void 0;u===this.idleRole?this.cycle(g):(this.idleRole=u,this.setMode(u,g)),this.armCycle();}nextIdleStep(e,n){let i=[...e.filter(r=>r!==this.idleStep&&(r===this.idleRole||this.rigHas(r))),...n.map(r=>Zf+r).filter(r=>r!==this.idleStep&&this.rigTriggers.has(r.slice(Zf.length)))];return i.length?i[Math.floor(Math.random()*i.length)]:this.idleRole}armThinkingLimit(){this.timer!==null&&clearTimeout(this.timer),this.timer=null,!(this.timings.thinkingMaxMs<=0)&&(this.timer=setTimeout(()=>{this.timer=null,this.phase==="thinking"&&this.listen(true);},this.timings.thinkingMaxMs));}clear(){this.timer!==null&&clearTimeout(this.timer),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.timer=null,this.cycleTimer=null;}};var IR=2,su=class{constructor(e){this.writeControl=e;this.policy=null;this.role=null;this.lastAct={};}setPolicy(e){e!==this.policy&&(this.policy=e,this.role=null,this.lastAct={});}get hasPolicy(){return this.policy!==null}get mode(){return this.role}get act(){return this.role?this.lastAct[this.role]??null:null}setMode(e,n){return e===this.role&&(n===void 0||n===this.lastAct[e])?true:this.enter(e,n)}cycle(e){return this.role?this.enter(this.role,e):false}reapply(){let e=this.role;return e?this.write(e,this.lastAct[e]??0):false}has(e){if(e==="idle"||e===this.role)return true;let n=this.policy?.branches[e]?.gate;return !!n&&this.writeControl(n,false)}stop(){this.role=null;}enter(e,n){if(!this.policy)return T.debug("BranchToggler","no performance policy \u2014 branch not written",{role:e}),false;let i=n??this.pickAct(e);return this.write(e,i)?(this.lastAct[e]=i,this.role=e,true):(T.debug("BranchToggler","branch write did not land \u2014 staying put",{wanted:e,role:this.role}),false)}pickAct(e){let n=this.policy?.branches[e]?.acts??[];if(!n.length)return 0;let i=n.length>1?n.filter(r=>r!==this.lastAct[e]):n;return i[Math.floor(Math.random()*i.length)]}resolve(e){let n=e;for(let i=0;i<=IR;i++){let r=this.policy?.branches[n];if(!r)return null;if(!r.gate||!r.fallback||this.writeControl(r.gate,false))return r;n=r.fallback;}return null}write(e,n){let i=this.resolve(e);if(!i&&e!=="idle")return false;let r=Object.values(this.policy?.branches??{}).filter(d=>d!==i),a=new Set(r.map(d=>d.gate).filter(d=>!!d&&d!==i?.gate)),o=new Set(r.map(d=>d.act).filter(d=>!!d&&d!==i?.act)),u=[];i?.act&&n&&u.push(this.writeControl(i.act,n));for(let d of a)u.push(this.writeControl(d,false));i?.gate&&u.push(this.writeControl(i.gate,true));for(let d of o)u.push(this.writeControl(d,0));return u.some(Boolean)}};var ou=(t,e,n)=>{let i=e?.[t];return {input:i?.input??t,type:i?.type??"trigger",value:i?.value??1,binding:i?.binding??(n?"data-binding":"input"),resetMs:i?.resetMs,returnMs:i?.returnMs??gg}};var lu=class{constructor(){this.segments=[];this.playable=0;}schedule(e,n,i){let r=this.segments[this.segments.length-1],a=i??(r?r.start+r.duration:0);return this.segments.push({at:e,start:a,duration:n}),r&&e<r.at&&this.segments.sort((o,u)=>o.at-u.at),this.playable=Math.max(this.playable,a+n),a}isAnchored(){return this.segments.length>0}timeAt(e){let n=this.segments;if(n.length===0)return ng;for(;n.length>1&&n[1].at<=e;)n.shift();let i=n[0];return i.start+(e-i.at)}playableTime(){return this.playable}reanchor(){this.segments.length=0;}reset(){this.segments.length=0,this.playable=0;}};var Jf="viseme",$f={plain:t=>`${t}`,prefix:t=>`${Jf}${t}`,"prefix-space":t=>`${Jf} ${t}`,suffix:t=>`${t}${Jf}`},r1=["plain","prefix","prefix-space","suffix"],DR=/^(?:viseme\s*(\d+)|(\d+)\s*viseme|(\d+))$/i,qa=t=>{let e=t.trim().match(DR);if(!e)return null;let n=e[1]??e[2]??e[3];if(n===void 0)return null;let i=Number(n);return Number.isNaN(i)?null:i};function uu(t){let e=[0,1,2,6,21];for(let n of r1){let i=$f[n];for(let r of e){let a=false;try{a=t(i(r));}catch{a=false;}if(a)return {format:i,shape:n,matched:true}}}return {format:$f.plain,shape:"plain",matched:false}}var ed="Watermark_opacity";var LR=4e3,PR=6,BR=.2,s1=-90,UR=25,FR=200,td=-50,VR=18,o1=10,HR=10,GR=500,zR=1e3,jR=3,YR=10,qR=500,WR=30,QR=30,XR=-50,KR=-30,fo=80,ZR=400,br=t=>t<=1e-7?-140:20*Math.log10(t),co=t=>t.length?br(t.reduce((e,n)=>e+n,0)/t.length):-140;function l1(t,e){let n=0,i=0,r=0;for(let a=0;a<t.length;a++){for(i+=t[a].mic*t[a].mic;r<a&&t[a].t-t[r].t>e;)i-=t[r].mic*t[r].mic,r++;t[a].t-t[r].t<e*.9||(n=Math.max(n,i/(a-r+1)));}return br(Math.sqrt(n))}var nd=class{constructor(){this.buf=[];this.pausedAt=null;this.floorDb=null;this.floorComputedAt=0;this.erlSamples=[];this.erlSampledAt=0;this.micDb=-140;this.gateOpen=false;this.gateHoldUntil=0;this.gateLevelDb=-140;this.renderAudibleSince=null;}push(e,n){let i=Date.now();this.buf.push({t:i,mic:e,render:n});let r=i-LR,a=0;for(;a<this.buf.length&&this.buf[a].t<r;)a++;a&&this.buf.splice(0,a),br(n)>=td?this.renderAudibleSince===null&&(this.renderAudibleSince=i):this.renderAudibleSince=null,this.micDb=br(e),this.updateFloor(),this.updateErl(),this.updateGate();}updateErl(){let e=Date.now();if(e-this.erlSampledAt<GR)return;let n=this.recent(zR);!n||n.renderDb<td||this.floorDb!==null&&this.pausedAt===null&&(n.micDb<=s1||n.micDb<this.floorDb+YR&&(this.renderAudibleSince===null||e-this.renderAudibleSince<qR)||(this.erlSampledAt=e,this.erlSamples.push(n.erlDb),this.erlSamples.length>HR&&this.erlSamples.shift()));}erlEstimateDb(){if(this.erlSamples.length<jR)return VR;let e=[...this.erlSamples].sort((n,i)=>n-i);return Math.min(e[Math.floor(e.length/2)],WR)}updateFloor(){let e=Date.now();if(this.floorDb!==null&&e-this.floorComputedAt<FR)return;let n=[];for(let i of this.buf){let r=br(i.mic);r>s1&&n.push(r);}n.length<UR||(n.sort((i,r)=>i-r),this.floorDb=n[Math.floor((n.length-1)*BR)],this.floorComputedAt=e);}updateGate(){this.gateLevelDb=br(this.meanMicRms(fo));let e=this.gateThresholdDb();if(this.gateLevelDb>=e){this.gateHoldUntil=Date.now()+ZR,this.gateOpen=true;return}this.gateOpen=Date.now()<this.gateHoldUntil;}gateThresholdDb(){let e=this.floorDb===null?-1/0:this.floorDb+QR,n=br(this.meanRenderRms(fo)),i=n>=td?n-this.erlEstimateDb()+o1:-1/0;return Math.min(Math.max(XR,e,i),KR)}meanMicRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].mic,r++;return r?i/r:0}meanRenderRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].render,r++;return r?i/r:0}isLive(){return this.gateOpen}levels(){return {micNowDb:+this.micDb.toFixed(1),gateLevelDb:+this.gateLevelDb.toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),floorDb:+(this.floorDb??-140).toFixed(1),erlEstDb:+this.erlEstimateDb().toFixed(1)}}markPaused(){this.pausedAt=Date.now();}clearPaused(){this.pausedAt=null;}report(){if(this.buf.length<10)return null;let e=Date.now(),n=this.pausedAt??e,i=this.buf.filter(A=>A.t>=n-500&&A.t<=n),r=this.buf.filter(A=>A.t>n),a=co(i.map(A=>A.mic)),o=co(i.map(A=>A.render)),u=this.floorDb??-140,d=u+PR,g=-1;for(let A of r)if(br(A.mic)<=d){g=A.t-n;break}let y=i.length?Math.max(...i.map(A=>br(A.mic))):-140;return {micPreDb:+a.toFixed(1),renderPreDb:+o.toFixed(1),erlDb:+(o-a).toFixed(1),micPostDb:+co(r.map(A=>A.mic)).toFixed(1),micFloorDb:+u.toFixed(1),micPeakDb:+y.toFixed(1),micPostSustainedDb:+l1(this.buf.filter(A=>A.t>n+60),fo).toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),micDecayMs:g}}provablyNotEcho(e,n){if(this.pausedAt===null)return false;let i=this.pausedAt,r=this.buf.filter(d=>d.t>=i-500&&d.t<=i),a=this.buf.filter(d=>d.t>i+n);if(r.length===0||a.length===0)return false;let o=co(r.map(d=>d.render));if(o<td)return false;let u=o-this.erlEstimateDb()+o1;return l1(a,fo)>=u+e}recent(e){let n=Date.now()-e,i=this.buf.filter(o=>o.t>=n);if(i.length<5)return null;let r=co(i.map(o=>o.mic)),a=co(i.map(o=>o.render));return {micDb:+r.toFixed(1),renderDb:+a.toFixed(1),erlDb:+(a-r).toFixed(1)}}reset(){this.buf=[],this.pausedAt=null,this.floorDb=null,this.floorComputedAt=0,this.erlSamples=[],this.erlSampledAt=0,this.micDb=-140,this.gateOpen=false,this.gateHoldUntil=0,this.gateLevelDb=-140,this.renderAudibleSince=null;}};function u1(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e/Math.max(1,t.length))}var id=class{constructor(e){this.onModeChange=e;this.pending=null;this.samples=[];this.blackoutStreak=0;this.lastEpisodeAt=0;this.mode="healthy";this.episodesInMode=0;}noteVoiceFrame(e,n){this.expirePending(n);let i=this.pending;if(e<iS){i&&i.endedAt===null&&n-i.lastVoicedAt>150&&(i.endedAt=n);return}if(!i){this.pending={onsetAt:n,voicedMs:0,lastVoicedAt:n,endedAt:null};return}i.endedAt=null;let r=n-i.lastVoicedAt;r>0&&r<=150&&(i.voicedMs+=r),i.lastVoicedAt=n;}noteTranscript(e){let n=this.pending;n&&(this.pending=null,this.blackoutStreak=0,this.samples.push(e-n.onsetAt),this.samples.length>J_&&this.samples.shift(),this.closeEpisode(e));}policy(e,n=false){return this.isStale(e)&&this.setMode("healthy","stale"),n?Tg:this.mode==="degraded"?Tg:Vf}currentMode(){return this.mode}lagMs(){return this.median()}getBlackoutStreak(){return this.blackoutStreak}clearPending(){this.pending=null;}reset(){this.pending=null,this.samples=[],this.blackoutStreak=0,this.lastEpisodeAt=0,this.mode="healthy",this.episodesInMode=0;}expirePending(e){let n=this.pending;!n||n.endedAt===null||e-n.endedAt<nS||(this.pending=null,!(n.voicedMs<tS)&&(this.blackoutStreak++,this.closeEpisode(e)));}closeEpisode(e){this.lastEpisodeAt=e,this.episodesInMode++,!(this.episodesInMode<$_)&&this.setMode(this.verdict(e),"lag");}setMode(e,n){if(e===this.mode)return;let i=this.mode;this.mode=e,this.episodesInMode=0,this.onModeChange?.({from:i,to:e,reason:n,lagMs:this.median(),blackoutStreak:this.blackoutStreak,samples:this.samples.length});}isStale(e){return this.lastEpisodeAt===0||e-this.lastEpisodeAt>eS}median(){if(this.samples.length===0)return null;let e=[...this.samples].sort((n,i)=>n-i);return e[Math.floor(e.length/2)]}verdict(e){let n=this.median();return n===null||this.isStale(e)?"healthy":n>K_?"degraded":n<Z_?"healthy":this.mode}};var cu=class{constructor(e,n,i){this.runtime=e;this.sensorProvider=n;this.vad=null;this.controller=null;this.initPromise=null;this.playback=null;this.speaking=false;this.micMuted=false;this.handedBack=false;this.framesPushed=0;this.voicedFramesSeen=0;this.userVoicedAtMs=0;this.voiceRunStartedAt=0;this.voiceWakeSent=false;this.partialsWhileBlind=0;this.trace=new nd;this.asrLag=new id(e=>T.event("bargein","policy",e));this.lastEchoLogAt=0;this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0};this.dutyBreaches=0;this.sessionStartedAt=Date.now();this.gatedFrames=0;this.farEndMs=0;this.softPaused=false;this.uplinkDelay=[];this.echoGate=i?.echoGate??true;}setPlaybackControls(e){this.playback=e;}setSpeaking(e){let n=this.speaking!==e;this.speaking=e,n&&this.runtime.setAgcForAvatarSpeech(e),e||(this.softPaused=false),n&&e&&this.resetBlindWatch();}isUserVoiced(){return Date.now()-this.userVoicedAtMs<dS}isAvatarAudible(){return this.speaking||(this.playback?.hasPendingAudio?.()??false)}setMicMuted(e){this.micMuted!==e&&(this.micMuted=e,e&&(this.controller?.abort(),this.vad?.reset(),this.trace.reset(),this.uplinkDelay=[],this.asrLag.clearPending()));}effectivePolicy(){return this.asrLag.policy(Date.now(),this.runtime.transcriptPathDegraded())}prefetch(){this.runtime.loadVadWeights().catch(()=>{});}async ensureInit(){if(this.sessionStartedAt=Date.now(),this.controller){this.runtime.sendClientVadStatus(true);return}return this.initPromise||(this.initPromise=this.init()),this.initPromise}async init(){try{let e=await this.sensorProvider.create(await this.runtime.loadVadWeights()),n=kg({isAvatarSpeaking:()=>this.isAvatarAudible(),pausePlayback:()=>{T.event("bargein","soft_pause",{mode:this.effectivePolicy().mode,...this.trace.levels()}),this.softPaused=!0,this.trace.markPaused(),this.playback?.pause();},resumePlayback:()=>{this.softPaused=!1,this.trace.clearPaused(),this.playback?.resume();},commitInterrupt:()=>this.runtime.interrupt({notifyServer:!0,reason:"barge_in"}),getActiveScriptTail:()=>this.runtime.getScriptTail(),isProvablyNotEcho:()=>this.trace.provablyNotEcho(10,60),getPolicy:()=>this.effectivePolicy(),onTelemetry:i=>T.event("bargein",i.outcome,{mode:i.mode,policySource:i.mode==="degraded"&&this.asrLag.currentMode()!=="degraded"?"health":"measured",pathFault:this.runtime.transcriptPathDegraded(),blackoutStreak:this.asrLag.getBlackoutStreak(),asrLagMs:this.asrLag.lagMs(),clause:i.commitClause,onsetToPauseMs:i.voiceOnsetToPauseMs,voicedMs:i.totalVoicedMs,postPauseMs:i.postPauseVoicedMs,wordlessStreak:i.wordlessResumeStreak,transcript:i.transcript,motion:i.speechMotion,medianFlux:i.speechMedianFlux,modulation:i.speechModulation,...this.trace.report()??{}})});e.onProb((i,r,a)=>{if(this.isAvatarAudible()?this.voiceRunStartedAt=0:(this.asrLag.noteVoiceFrame(i,Date.now()),i>=.5&&(this.userVoicedAtMs=Date.now()),this.noteVoiceForWake(i)),i>=.5&&this.voicedFramesSeen++,!this.echoGate||this.trace.isLive()&&!this.isWarming()){n.onVadProb(i,r,a);return}i>=.5&&this.gatedFrames++,n.onVadProb(0,r,null);}),this.vad=e,this.controller=n,this.handedBack=!1,this.resetBlindWatch(),T.debug("BargeIn","client VAD initialized"),this.runtime.sendClientVadStatus(!0);}catch(e){T.error("BargeIn","failed to init client VAD",e),this.initPromise=null,this.handedBack=true,this.runtime.sendClientVadStatus(false,"asset_load_failed");}}disable(e){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null,this.dutyBreaches=0,this.handedBack=true,T.warn("BargeIn","client VAD disabled",{reason:e}),this.runtime.sendClientVadStatus(false,e);}pushLevel(e,n){this.micMuted||(this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=n/16e3*1e3),this.trace.push(e,this.playback?.getOutputLevel?.()??0),this.logEchoHealth());}pushPcm(e){if(this.micMuted)return;this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=e.length/16e3*1e3),this.trace.push(u1(e),this.playback?.getOutputLevel?.()??0),this.logEchoHealth();let n=e.length,i=Date.now();this.vad&&(this.vad.pushPcm(e),this.framesPushed++),this.noteVadCost(Date.now()-i,n);}noteVadCost(e,n){let i=this.vadCost;i.calls++,i.totalMs+=e,i.audioMs+=n/16e3*1e3,e>i.maxMs&&(i.maxMs=e);let r=Date.now();if(i.at===0){i.at=r;return}let a=r-i.at;if(a<1e3)return;let o=Math.round(i.totalMs/a*100);this.vadCost={at:r,calls:0,totalMs:0,maxMs:0,audioMs:0},this.noteSensorHealth(o);}noteSensorHealth(e){if(this.vad){if(e<rS){this.dutyBreaches=0;return}++this.dutyBreaches<aS||(T.warn("BargeIn","client VAD cannot keep up",{dutyPct:e}),this.disable("sensor_too_slow"));}}isWarming(){return this.isAvatarAudible()&&this.farEndMs<1500}logEchoHealth(){}onPartialTranscript(e){e&&this.asrLag.noteTranscript(Date.now()),e&&this.noteBlindSensor(),this.controller?.onPartialTranscript(e);}noteBlindSensor(){!this.controller||this.micMuted||this.isAvatarAudible()&&(this.farEndMs<1500||this.framesPushed<sS||this.voicedFramesSeen>0||++this.partialsWhileBlind<oS||(T.warn("BargeIn","client VAD scored nothing while ASR returned words",{framesPushed:this.framesPushed}),this.disable("sensor_blind")));}resetBlindWatch(){this.framesPushed=0,this.voicedFramesSeen=0,this.partialsWhileBlind=0;}shouldUplink(){return this.handedBack||!this.isAvatarAudible()||this.softPaused?true:this.isWarming()?false:this.trace.isLive()}noteVoiceForWake(e){if(e<.5||!this.trace.isLive()){this.voiceRunStartedAt=0,this.voiceWakeSent=false;return}let n=Date.now();this.voiceRunStartedAt||(this.voiceRunStartedAt=n),!(this.voiceWakeSent||n-this.voiceRunStartedAt<hS)&&(this.voiceWakeSent=true,this.runtime.noteUserVoice());}releaseUplinkFrames(e){if(!this.echoGate)return [e];if(!this.isAvatarAudible()){let a=this.uplinkDelay.map(o=>o.frame);return this.uplinkDelay=[],[...a,e]}let n=Date.now();this.uplinkDelay.push({t:n,frame:e});let i=this.shouldUplink(),r=[];for(;this.uplinkDelay.length>0&&n-this.uplinkDelay[0].t>=fo;){let a=this.uplinkDelay.shift();i||a.frame.fill(0),r.push(a.frame);}return r}reset(){this.vad?.reset(),this.controller?.reset(),this.trace.reset(),this.sessionStartedAt=Date.now(),this.softPaused=false,this.uplinkDelay=[],this.farEndMs=0,this.asrLag.reset(),this.dutyBreaches=0,this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0},this.userVoicedAtMs=0,this.voiceRunStartedAt=0,this.voiceWakeSent=false,this.resetBlindWatch();}dispose(){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null;}};var c1=`
13
+ `);console.error(R),A.notifyError(new Error(R));}});},A.getInstance=function(p,_){A.isLoading||(A.isLoading=true,A.loadRuntime()),A.runtime?p(A.runtime):(A.callBackQueue.push(p),_&&A.errorCallbackQueue.push(_));},A.awaitInstance=function(){return new Promise(function(p,_){return A.getInstance(p,_)})},A.setWasmUrl=function(p){A.wasmURL=p;},A.getWasmUrl=function(){return A.wasmURL},A.setWasmFallbackUrl=function(p){A.wasmFallbackURL=p;},A.getWasmFallbackUrl=function(){return A.wasmFallbackURL},A.setWasmBinary=function(p){if(p instanceof ArrayBuffer||p===null){A.wasmBinary=p;return}console.error("setWasmBinary expects an ArrayBuffer or null");},A.getWasmBinary=function(){return A.wasmBinary},A.isLoading=false,A.callBackQueue=[],A.wasmURL="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/rive.wasm"),A.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(d.name,"@").concat(d.version,"/rive_fallback.wasm"),A.wasmBinary=null,A.errorCallbackQueue=[],A.enablePerfMarks=false,A})();}),((r,a,o)=>{o.r(a),o.d(a,{default:()=>d});var u=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return(function(y={}){var A,p=y,_,C,N=new Promise((s,l)=>{_=s,C=l;}),B=typeof window=="object",M=typeof importScripts=="function";function w(){function s(k){let O=h;f=l=0,h=new Map,O.forEach(F=>{try{F(k);}catch(P){console.error(P);}}),this.mb(),v&&v.Nb();}let l=0,f=0,h=new Map,v=null,S=null;this.requestAnimationFrame=function(k){l||(l=requestAnimationFrame(s.bind(this)));let O=++f;return h.set(O,k),O},this.cancelAnimationFrame=function(k){h.delete(k),l&&h.size==0&&(cancelAnimationFrame(l),l=0);},this.Lb=function(k){S&&(document.body.remove(S),S=null),k||(S=document.createElement("div"),S.style.backgroundColor="black",S.style.position="fixed",S.style.right=0,S.style.top=0,S.style.color="white",S.style.padding="4px",S.innerHTML="RIVE FPS",k=function(O){S.innerHTML="RIVE FPS "+O.toFixed(1);},document.body.appendChild(S)),v=new function(){let O=0,F=0;this.Nb=function(){var P=performance.now();F?(++O,P-=F,1e3<P&&(k(1e3*O/P),O=F=0)):(F=P,O=0);};};},this.mb=function(){};}function R(){console.assert(true);let s=new Map,l=-1/0;this.push=function(f){return f=f+255>>8,s.has(f)&&clearTimeout(s.get(f)),s.set(f,setTimeout(function(){s.delete(f),s.length==0?l=-1/0:f==l&&(l=Math.max(...s.keys()),console.assert(l<f));},1e3)),l=Math.max(f,l),l<<8};}let D=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){D&&D();let s=p.decodeAudio;p.decodeAudio=function(S,k){S=s(S),k(S);};let l=p.decodeFont;p.decodeFont=function(S,k){S=l(S),k(S);};let f=p.setFallbackFontCb;p.setFallbackFontCallback=typeof f=="function"?function(S){f(S);}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");};let h=p.FileAssetLoader;p.ptrToAsset=S=>{let k=p.ptrToFileAsset(S);return k.isImage?p.ptrToImageAsset(S):k.isFont?p.ptrToFontAsset(S):k.isAudio?p.ptrToAudioAsset(S):k},p.CustomFileAssetLoader=h.extend("CustomFileAssetLoader",{__construct:function({loadContents:S}){this.__parent.__construct.call(this),this.Bb=S;},loadContents:function(S,k){return S=p.ptrToAsset(S),this.Bb(S,k)}}),p.CDNFileAssetLoader=h.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);},loadContents:function(S){let k=p.ptrToAsset(S);return S=k.cdnUuid,S===""?false:((function(O,F){var P=new XMLHttpRequest;P.responseType="arraybuffer",P.onreadystatechange=function(){P.readyState==4&&P.status==200&&F(P);},P.open("GET",O,true),P.send(null);})(k.cdnBaseUrl+"/"+S,O=>{k.decode(new Uint8Array(O.response));}),true)}}),p.FallbackFileAssetLoader=h.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.ib=[];},addLoader:function(S){this.ib.push(S);},loadContents:function(S,k){for(let O of this.ib)if(O.loadContents(S,k))return true;return false}});let v=p.computeAlignment;p.computeAlignment=function(S,k,O,F,P=1){return v.call(this,S,k,O,F,P)};};let G=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){function s(J){this.G=J,this.Ab=J.getContext("2d"),this.Eb=h,this.S=[],this.ja=0,this.clear=function(){console.assert(this.ja==0),this.S=[],v.delete(this);},this.save=function(){++this.ja,this.S.push(h.save.bind(h));},this.restore=function(){0<this.ja&&(this.S.push(h.restore.bind(h)),--this.ja);},this.transform=function(te){this.S.push(h.transform.bind(h,te));},this.align=function(te,_e,Me,Pe,ht=1){this.S.push(h.align.bind(h,te,_e,Me,Pe,ht));},this.flush=function(){console.assert(this.ja==0),v.add(this),h.Ya||f();},this.delete=function(){};}function l(J,te=false){var _e={alpha:true,depth:te,stencil:te,antialias:te,premultipliedAlpha:true,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:false,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};if(te=J.getContext("webgl2",_e),!te)return null;_e=zw(te,_e),ih(_e);let Me=S(J.width,J.height);Me.Ma=_e,Me.G=J,Me.Na=J.width,Me.Za=J.height,Me.T=te;var Pe=Me.delete;return Me.delete=function(){Pe.call(this);var ht=this.Ma;Ki===ln[ht]&&(Ki=null),typeof JSEvents=="object"&&JSEvents.Qc(ln[ht].F.canvas),ln[ht]&&ln[ht].F.canvas&&(ln[ht].F.canvas.zb=void 0),this.Ma=this.G=this.Na=this.T=ln[ht]=null;},Me}function f(){if(h){var J=h.Db,te=0,_e=0,Me=0,Pe=Array(v.size),ht=0;for(var Rt of v)Rt.ea=Math.min(Rt.G.width,J),Rt.da=Math.min(Rt.G.height,J),Rt.Ka=Rt.da*Rt.ea,te=Math.max(te,Rt.ea),_e=Math.max(_e,Rt.da),Me+=Rt.Ka,Pe[ht++]=Rt;if(v.clear(),!(0>=Me)){for(te=1<<(0>=te?0:32-Math.clz32(te-1)),_e=1<<(0>=_e?0:32-Math.clz32(_e-1));_e*te<Me;)te<=_e?te*=2:_e*=2;for(te=Math.min(te,J),te=Math.min(_e,J),Pe.sort((Ji,uh)=>uh.Ka-Ji.Ka),Me=new p.DynamicRectanizer(J),Rt=0;Rt<Pe.length;){for(Me.reset(te,_e),ht=Rt;ht<Pe.length;++ht){var kt=Pe[ht],pt=Me.addRect(kt.ea,kt.da);if(0>pt){console.assert(ht>Rt);break}kt.pa=pt&65535,kt.qa=pt>>16;}for(kt=F.push(Me.drawWidth()),pt=P.push(Me.drawHeight()),console.assert(kt>=Me.drawWidth()),console.assert(pt>=Me.drawHeight()),console.assert(kt<=J),console.assert(pt<=J),h.G.width!=kt&&(h.G.width=kt),h.G.height!=pt&&(h.G.height=pt),h.clear(),kt=Rt;kt<ht;++kt){pt=Pe[kt],h.saveClipRect(pt.pa,pt.qa,pt.pa+pt.ea,pt.qa+pt.da);let Ji=new p.Mat2D;Ji.xx=pt.ea/pt.G.width,Ji.yy=pt.da/pt.G.height,Ji.xy=Ji.yx=0,Ji.tx=pt.pa,Ji.ty=pt.qa,h.transform(Ji);for(let uh of pt.S)uh();h.restoreClipRect(),pt.S=[];}for(h.flush();Rt<ht;++Rt)kt=Pe[Rt],pt=kt.Ab,pt.globalCompositeOperation="copy",pt.drawImage(h.G,kt.pa,kt.qa,kt.ea,kt.da,0,0,kt.G.width,kt.G.height);Rt=ht;}}}}G&&G();let h=null,v=new Set,S=p.makeRenderer;p.makeRenderer=function(J,te){if(!h){let _e=function(Me){var Pe=document.createElement("canvas");return Pe.width=1,Pe.height=1,h=l(Pe,Me),h?(h.Ya=!!h.T.getExtension("WEBGL_shader_pixel_local_storage"),h.Db=Math.min(h.T.getParameter(h.T.MAX_RENDERBUFFER_SIZE),h.T.getParameter(h.T.MAX_TEXTURE_SIZE)),h.La=!h.Ya,(Me=h.T.getExtension("WEBGL_debug_renderer_info"))&&(Pe=h.T.getParameter(Me.UNMASKED_RENDERER_WEBGL),h.T.getParameter(Me.UNMASKED_VENDOR_WEBGL).includes("Google")&&Pe.includes("ANGLE Metal Renderer")&&(h.La=false)),h):null};if(h=_e(true),!h)throw "Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";h.La||(h=_e(false));}return te?new s(J):l(J,h.La)};let k=p.Artboard.prototype.delete;p.Artboard.prototype.delete=function(){this.Fb=true,k.call(this);};let O=p.Artboard.prototype.draw;p.Artboard.prototype.draw=function(J){J.S?J.S.push(()=>{this.Fb||O.call(this,J.Eb);}):O.call(this,J);};let F=new R,P=new R,$=new w;p.requestAnimationFrame=$.requestAnimationFrame.bind($),p.cancelAnimationFrame=$.cancelAnimationFrame.bind($),p.enableFPSCounter=$.Lb.bind($),$.mb=f,p.resolveAnimationFrame=f;let he=p.load;p.load=function(J,te,_e=true){let Me=new p.FallbackFileAssetLoader;return te!==void 0&&Me.addLoader(te),_e&&(te=new p.CDNFileAssetLoader,Me.addLoader(te)),Promise.resolve(he(J,Me))};let ge=p.WebGL2Renderer.prototype.clear;p.WebGL2Renderer.prototype.clear=function(){ih(this.Ma);let J=this.G;(this.Na!=J.width||this.Za!=J.height)&&(this.resize(J.width,J.height),this.Na=J.width,this.Za=J.height),ge.call(this);},p.decodeImage=function(J,te){J=p.decodeWebGL2Image(J),te(J);};let V=p.Renderer.prototype.align;p.Renderer.prototype.align=function(J,te,_e,Me,Pe=1){V.call(this,J,te,_e,Me,Pe);};};var ne=Object.assign({},p),U="./this.program",H="",ee,Q;(B||M)&&(M?H=self.location.href:typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),g&&(H=g),H.startsWith("blob:")?H="":H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1),M&&(Q=s=>{var l=new XMLHttpRequest;return l.open("GET",s,false),l.responseType="arraybuffer",l.send(null),new Uint8Array(l.response)}),ee=(s,l,f)=>{if(Ne(s)){var h=new XMLHttpRequest;h.open("GET",s,true),h.responseType="arraybuffer",h.onload=()=>{h.status==200||h.status==0&&h.response?l(h.response):f();},h.onerror=f,h.send(null);}else fetch(s,{credentials:"same-origin"}).then(v=>v.ok?v.arrayBuffer():Promise.reject(Error(v.status+" : "+v.url))).then(l,f);});var Ee=p.print||console.log.bind(console),Ce=p.printErr||console.error.bind(console);Object.assign(p,ne),ne=null,p.thisProgram&&(U=p.thisProgram);var Ue;p.wasmBinary&&(Ue=p.wasmBinary);var Be,fe=false,ye,ce,j,X,K,me,Ie,We;function Dt(){var s=Be.buffer;p.HEAP8=ye=new Int8Array(s),p.HEAP16=j=new Int16Array(s),p.HEAPU8=ce=new Uint8Array(s),p.HEAPU16=X=new Uint16Array(s),p.HEAP32=K=new Int32Array(s),p.HEAPU32=me=new Uint32Array(s),p.HEAPF32=Ie=new Float32Array(s),p.HEAPF64=We=new Float64Array(s);}var Je=[],Qe=[],qt=[];function en(){var s=p.preRun.shift();Je.unshift(s);}var Et=0,Lt=null;function wn(s){throw p.onAbort?.(s),s="Aborted("+s+")",Ce(s),fe=true,s=new WebAssembly.RuntimeError(s+". Build with -sASSERTIONS for more info."),C(s),s}var Xe=s=>s.startsWith("data:application/octet-stream;base64,"),Ne=s=>s.startsWith("file://"),Un;function Mn(s){if(s==Un&&Ue)return new Uint8Array(Ue);if(Q)return Q(s);throw "both async and sync fetching of the wasm failed"}function xn(s){return Ue?Promise.resolve().then(()=>Mn(s)):new Promise((l,f)=>{ee(s,h=>l(new Uint8Array(h)),()=>{try{l(Mn(s));}catch(h){f(h);}});})}function Qt(s,l,f){return xn(s).then(h=>WebAssembly.instantiate(h,l)).then(f,h=>{Ce(`failed to asynchronously prepare wasm: ${h}`),wn(h);})}function tn(s,l){var f=Un;return Ue||typeof WebAssembly.instantiateStreaming!="function"||Xe(f)||Ne(f)||typeof fetch!="function"?Qt(f,s,l):fetch(f,{credentials:"same-origin"}).then(h=>WebAssembly.instantiateStreaming(h,s).then(l,function(v){return Ce(`wasm streaming compile failed: ${v}`),Ce("falling back to ArrayBuffer instantiation"),Qt(f,s,l)}))}var It,Pt,lt={570520:(s,l,f,h,v)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.h>"u"){window.h={Fa:0},window.h.I={},window.h.I.Ca=s,window.h.I.capture=l,window.h.I.Pa=f,window.h.ha={},window.h.ha.stopped=h,window.h.ha.ub=v;let S=window.h;S.C=[],S.mc=function(k){for(var O=0;O<S.C.length;++O)if(S.C[O]==null)return S.C[O]=k,O;return S.C.push(k),S.C.length-1},S.yb=function(k){for(S.C[k]=null;0<S.C.length&&S.C[S.C.length-1]==null;)S.C.pop();},S.Tc=function(k){for(var O=0;O<S.C.length;++O)if(S.C[O]==k)return S.yb(O)},S.ta=function(k){return S.C[k]},S.Xa=["touchend","click"],S.unlock=function(){for(var k=0;k<S.C.length;++k){var O=S.C[k];O!=null&&O.K!=null&&O.state===S.ha.ub&&O.K.resume().then(()=>{Nv(O.nb);},F=>{console.error("Failed to resume audiocontext",F);});}S.Xa.map(function(F){document.removeEventListener(F,S.unlock,true);});},S.Xa.map(function(k){document.addEventListener(k,S.unlock,true);});}return window.h.Fa+=1,1},572698:()=>{typeof window.h<"u"&&(window.h.Xa.map(function(s){document.removeEventListener(s,window.h.unlock,true);}),--window.h.Fa,window.h.Fa===0&&delete window.h);},573002:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,573106:()=>{try{var s=new(window.AudioContext||window.webkitAudioContext),l=s.sampleRate;return s.close(),l}catch{return 0}},573277:(s,l,f,h,v,S)=>{if(typeof window.h>"u")return -1;var k={},O={};return s==window.h.I.Ca&&f!=0&&(O.sampleRate=f),k.K=new(window.AudioContext||window.webkitAudioContext)(O),k.K.suspend(),k.state=window.h.ha.stopped,f=0,s!=window.h.I.Ca&&(f=l),k.Y=k.K.createScriptProcessor(h,f,l),k.Y.onaudioprocess=function(F){if((k.ua==null||k.ua.length==0)&&(k.ua=new Float32Array(Ie.buffer,v,h*l)),s==window.h.I.capture||s==window.h.I.Pa){for(var P=0;P<l;P+=1)for(var $=F.inputBuffer.getChannelData(P),he=k.ua,ge=0;ge<h;ge+=1)he[ge*l+P]=$[ge];Dv(S,h,v);}if(s==window.h.I.Ca||s==window.h.I.Pa)for(Lv(S,h,v),P=0;P<F.outputBuffer.numberOfChannels;++P)for($=F.outputBuffer.getChannelData(P),he=k.ua,ge=0;ge<h;ge+=1)$[ge]=he[ge*l+P];else for(P=0;P<F.outputBuffer.numberOfChannels;++P)F.outputBuffer.getChannelData(P).fill(0);},s!=window.h.I.capture&&s!=window.h.I.Pa||navigator.mediaDevices.getUserMedia({audio:true,video:false}).then(function(F){k.Ga=k.K.createMediaStreamSource(F),k.Ga.connect(k.Y),k.Y.connect(k.K.destination);}).catch(function(F){console.log("Failed to get user media: "+F);}),s==window.h.I.Ca&&k.Y.connect(k.K.destination),k.nb=S,window.h.mc(k)},576154:s=>window.h.ta(s).K.sampleRate,576227:s=>{s=window.h.ta(s),s.Y!==void 0&&(s.Y.onaudioprocess=function(){},s.Y.disconnect(),s.Y=void 0),s.Ga!==void 0&&(s.Ga.disconnect(),s.Ga=void 0),s.K.close(),s.K=void 0,s.nb=void 0;},576627:s=>{window.h.yb(s);},576677:s=>{s=window.h.ta(s),s.K.resume(),s.state=window.h.ha.ub;},576816:s=>{s=window.h.ta(s),s.K.suspend(),s.state=window.h.ha.stopped;}},Re=s=>{for(;0<s.length;)s.shift()(p);};function b(){var s=K[+va>>2];return va+=4,s}var c=(s,l)=>{for(var f=0,h=s.length-1;0<=h;h--){var v=s[h];v==="."?s.splice(h,1):v===".."?(s.splice(h,1),f++):f&&(s.splice(h,1),f--);}if(l)for(;f;f--)s.unshift("..");return s},m=s=>{var l=s.charAt(0)==="/",f=s.substr(-1)==="/";return (s=c(s.split("/").filter(h=>!!h),!l).join("/"))||l||(s="."),s&&f&&(s+="/"),(l?"/":"")+s},E=s=>{var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(s).slice(1);return s=l[0],l=l[1],!s&&!l?".":(l&&(l=l.substr(0,l.length-1)),s+l)},x=s=>{if(s==="/")return "/";s=m(s),s=s.replace(/\/$/,"");var l=s.lastIndexOf("/");return l===-1?s:s.substr(l+1)},L=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return s=>crypto.getRandomValues(s);wn("initRandomDevice");},z=s=>(z=L())(s),ae=(...s)=>{for(var l="",f=false,h=s.length-1;-1<=h&&!f;h--){if(f=0<=h?s[h]:"/",typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!f)return "";l=f+"/"+l,f=f.charAt(0)==="/";}return l=c(l.split("/").filter(v=>!!v),!f).join("/"),(f?"/":"")+l||"."},be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,re=(s,l,f)=>{var h=l+f;for(f=l;s[f]&&!(f>=h);)++f;if(16<f-l&&s.buffer&&be)return be.decode(s.subarray(l,f));for(h="";l<f;){var v=s[l++];if(v&128){var S=s[l++]&63;if((v&224)==192)h+=String.fromCharCode((v&31)<<6|S);else {var k=s[l++]&63;v=(v&240)==224?(v&15)<<12|S<<6|k:(v&7)<<18|S<<12|k<<6|s[l++]&63,65536>v?h+=String.fromCharCode(v):(v-=65536,h+=String.fromCharCode(55296|v>>10,56320|v&1023));}}else h+=String.fromCharCode(v);}return h},pe=[],tt=s=>{for(var l=0,f=0;f<s.length;++f){var h=s.charCodeAt(f);127>=h?l++:2047>=h?l+=2:55296<=h&&57343>=h?(l+=4,++f):l+=3;}return l},Ke=(s,l,f,h)=>{if(!(0<h))return 0;var v=f;h=f+h-1;for(var S=0;S<s.length;++S){var k=s.charCodeAt(S);if(55296<=k&&57343>=k){var O=s.charCodeAt(++S);k=65536+((k&1023)<<10)|O&1023;}if(127>=k){if(f>=h)break;l[f++]=k;}else {if(2047>=k){if(f+1>=h)break;l[f++]=192|k>>6;}else {if(65535>=k){if(f+2>=h)break;l[f++]=224|k>>12;}else {if(f+3>=h)break;l[f++]=240|k>>18,l[f++]=128|k>>12&63;}l[f++]=128|k>>6&63;}l[f++]=128|k&63;}}return l[f]=0,f-v};function De(s,l){var f=Array(tt(s)+1);return s=Ke(s,f,0,f.length),l&&(f.length=s),f}var wt=[];function Gt(s,l){wt[s]={input:[],H:[],V:l},Ve(s,Fe);}var Fe={open(s){var l=wt[s.node.Ea];if(!l)throw new le(43);s.s=l,s.seekable=false;},close(s){s.s.V.sa(s.s);},sa(s){s.s.V.sa(s.s);},read(s,l,f,h){if(!s.s||!s.s.V.hb)throw new le(60);for(var v=0,S=0;S<h;S++){try{var k=s.s.V.hb(s.s);}catch{throw new le(29)}if(k===void 0&&v===0)throw new le(6);if(k==null)break;v++,l[f+S]=k;}return v&&(s.node.timestamp=Date.now()),v},write(s,l,f,h){if(!s.s||!s.s.V.Sa)throw new le(60);try{for(var v=0;v<h;v++)s.s.V.Sa(s.s,l[f+v]);}catch{throw new le(29)}return h&&(s.node.timestamp=Date.now()),v}},zt={hb(){e:{if(!pe.length){var s=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(s=window.prompt("Input: "),s!==null&&(s+=`
14
+ `)),!s){s=null;break e}pe=De(s,true);}s=pe.shift();}return s},Sa(s,l){l===null||l===10?(Ee(re(s.H,0)),s.H=[]):l!=0&&s.H.push(l);},sa(s){s.H&&0<s.H.length&&(Ee(re(s.H,0)),s.H=[]);},Wb(){return {xc:25856,zc:5,wc:191,yc:35387,vc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Xb(){return 0},Yb(){return [24,80]}},Mt={Sa(s,l){l===null||l===10?(Ce(re(s.H,0)),s.H=[]):l!=0&&s.H.push(l);},sa(s){s.H&&0<s.H.length&&(Ce(re(s.H,0)),s.H=[]);}};function Tt(s,l){var f=s.l?s.l.length:0;f>=l||(l=Math.max(l,f*(1048576>f?2:1.125)>>>0),f!=0&&(l=Math.max(l,256)),f=s.l,s.l=new Uint8Array(l),0<s.v&&s.l.set(f.subarray(0,s.v),0));}var ve={N:null,U(){return ve.createNode(null,"/",16895,0)},createNode(s,l,f,h){if((f&61440)===24576||(f&61440)===4096)throw new le(63);return ve.N||(ve.N={dir:{node:{X:ve.j.X,P:ve.j.P,ka:ve.j.ka,Aa:ve.j.Aa,sb:ve.j.sb,xb:ve.j.xb,tb:ve.j.tb,rb:ve.j.rb,Ha:ve.j.Ha},stream:{aa:ve.m.aa}},file:{node:{X:ve.j.X,P:ve.j.P},stream:{aa:ve.m.aa,read:ve.m.read,write:ve.m.write,$a:ve.m.$a,jb:ve.m.jb,lb:ve.m.lb}},link:{node:{X:ve.j.X,P:ve.j.P,la:ve.j.la},stream:{}},ab:{node:{X:ve.j.X,P:ve.j.P},stream:Ze}}),f=Tr(s,l,f,h),(f.mode&61440)===16384?(f.j=ve.N.dir.node,f.m=ve.N.dir.stream,f.l={}):(f.mode&61440)===32768?(f.j=ve.N.file.node,f.m=ve.N.file.stream,f.v=0,f.l=null):(f.mode&61440)===40960?(f.j=ve.N.link.node,f.m=ve.N.link.stream):(f.mode&61440)===8192&&(f.j=ve.N.ab.node,f.m=ve.N.ab.stream),f.timestamp=Date.now(),s&&(s.l[l]=f,s.timestamp=f.timestamp),f},Fc(s){return s.l?s.l.subarray?s.l.subarray(0,s.v):new Uint8Array(s.l):new Uint8Array(0)},j:{X(s){var l={};return l.Cc=(s.mode&61440)===8192?s.id:1,l.Hc=s.id,l.mode=s.mode,l.Nc=1,l.uid=0,l.Gc=0,l.Ea=s.Ea,(s.mode&61440)===16384?l.size=4096:(s.mode&61440)===32768?l.size=s.v:(s.mode&61440)===40960?l.size=s.link.length:l.size=0,l.tc=new Date(s.timestamp),l.Mc=new Date(s.timestamp),l.Ac=new Date(s.timestamp),l.Gb=4096,l.uc=Math.ceil(l.size/l.Gb),l},P(s,l){if(l.mode!==void 0&&(s.mode=l.mode),l.timestamp!==void 0&&(s.timestamp=l.timestamp),l.size!==void 0&&(l=l.size,s.v!=l))if(l==0)s.l=null,s.v=0;else {var f=s.l;s.l=new Uint8Array(l),f&&s.l.set(f.subarray(0,Math.min(l,s.v))),s.v=l;}},ka(){throw Hn[44]},Aa(s,l,f,h){return ve.createNode(s,l,f,h)},sb(s,l,f){if((s.mode&61440)===16384){try{var h=ji(l,f);}catch{}if(h)for(var v in h.l)throw new le(55)}delete s.parent.l[s.name],s.parent.timestamp=Date.now(),s.name=f,l.l[f]=s,l.timestamp=s.parent.timestamp;},xb(s,l){delete s.l[l],s.timestamp=Date.now();},tb(s,l){var f=ji(s,l),h;for(h in f.l)throw new le(55);delete s.l[l],s.timestamp=Date.now();},rb(s){var l=[".",".."],f;for(f of Object.keys(s.l))l.push(f);return l},Ha(s,l,f){return s=ve.createNode(s,l,41471,0),s.link=f,s},la(s){if((s.mode&61440)!==40960)throw new le(28);return s.link}},m:{read(s,l,f,h,v){var S=s.node.l;if(v>=s.node.v)return 0;if(s=Math.min(s.node.v-v,h),8<s&&S.subarray)l.set(S.subarray(v,v+s),f);else for(h=0;h<s;h++)l[f+h]=S[v+h];return s},write(s,l,f,h,v,S){if(l.buffer===ye.buffer&&(S=false),!h)return 0;if(s=s.node,s.timestamp=Date.now(),l.subarray&&(!s.l||s.l.subarray)){if(S)return s.l=l.subarray(f,f+h),s.v=h;if(s.v===0&&v===0)return s.l=l.slice(f,f+h),s.v=h;if(v+h<=s.v)return s.l.set(l.subarray(f,f+h),v),h}if(Tt(s,v+h),s.l.subarray&&l.subarray)s.l.set(l.subarray(f,f+h),v);else for(S=0;S<h;S++)s.l[v+S]=l[f+S];return s.v=Math.max(s.v,v+h),h},aa(s,l,f){if(f===1?l+=s.position:f===2&&(s.node.mode&61440)===32768&&(l+=s.node.v),0>l)throw new le(28);return l},$a(s,l,f){Tt(s.node,l+f),s.node.v=Math.max(s.node.v,l+f);},jb(s,l,f,h,v){if((s.node.mode&61440)!==32768)throw new le(43);if(s=s.node.l,v&2||s.buffer!==ye.buffer){if((0<f||f+l<s.length)&&(s.subarray?s=s.subarray(f,f+l):s=Array.prototype.slice.call(s,f,f+l)),f=true,wn(),l=void 0,!l)throw new le(48);ye.set(s,l);}else f=false,l=s.byteOffset;return {o:l,sc:f}},lb(s,l,f,h){return ve.m.write(s,l,0,h,f,false),0}}},ki=(s,l)=>{var f=0;return s&&(f|=365),l&&(f|=146),f},Fn=null,I={},vi=[],wr=1,Vn=null,xi=true,le=class{constructor(s){this.name="ErrnoError",this.$=s;}},Hn={},Mr=class{constructor(){this.h={},this.node=null;}get flags(){return this.h.flags}set flags(s){this.h.flags=s;}get position(){return this.h.position}set position(s){this.h.position=s;}},pa=class{constructor(s,l,f,h){s||(s=this),this.parent=s,this.U=s.U,this.Ba=null,this.id=wr++,this.name=l,this.mode=f,this.j={},this.m={},this.Ea=h;}get read(){return (this.mode&365)===365}set read(s){s?this.mode|=365:this.mode&=-366;}get write(){return (this.mode&146)===146}set write(s){s?this.mode|=146:this.mode&=-147;}};function ti(s,l={}){if(s=ae(s),!s)return {path:"",node:null};if(l=Object.assign({gb:true,Ua:0},l),8<l.Ua)throw new le(32);s=s.split("/").filter(k=>!!k);for(var f=Fn,h="/",v=0;v<s.length;v++){var S=v===s.length-1;if(S&&l.parent)break;if(f=ji(f,s[v]),h=m(h+"/"+s[v]),f.Ba&&(!S||S&&l.gb)&&(f=f.Ba.root),!S||l.fb){for(S=0;(f.mode&61440)===40960;)if(f=Pd(h),h=ae(E(h),f),f=ti(h,{Ua:l.Ua+1}).node,40<S++)throw new le(32)}}return {path:h,node:f}}function zi(s){for(var l;;){if(s===s.parent)return s=s.U.kb,l?s[s.length-1]!=="/"?`${s}/${l}`:s+l:s;l=l?`${s.name}/${l}`:s.name,s=s.parent;}}function es(s,l){for(var f=0,h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h)|0;return (s+f>>>0)%Vn.length}function ji(s,l){var f=(s.mode&61440)===16384?(f=de(s,"x"))?f:s.j.ka?0:2:54;if(f)throw new le(f);for(f=Vn[es(s.id,l)];f;f=f.ac){var h=f.name;if(f.parent.id===s.id&&h===l)return f}return s.j.ka(s,l)}function Tr(s,l,f,h){return s=new pa(s,l,f,h),l=es(s.parent.id,s.name),s.ac=Vn[l],Vn[l]=s}function Z(s){var l=["r","w","rw"][s&3];return s&512&&(l+="w"),l}function de(s,l){if(xi)return 0;if(!l.includes("r")||s.mode&292){if(l.includes("w")&&!(s.mode&146)||l.includes("x")&&!(s.mode&73))return 2}else return 2;return 0}function Ae(s,l){try{return ji(s,l),20}catch{}return de(s,"wx")}function ke(s){if(s=vi[s],!s)throw new le(8);return s}function $e(s,l=-1){if(s=Object.assign(new Mr,s),l==-1)e:{for(l=0;4096>=l;l++)if(!vi[l])break e;throw new le(33)}return s.W=l,vi[l]=s}function Bt(s,l=-1){return s=$e(s,l),s.m?.Ec?.(s),s}var Ze={open(s){s.m=I[s.node.Ea].m,s.m.open?.(s);},aa(){throw new le(70)}};function Ve(s,l){I[s]={m:l};}function ut(s,l){var f=l==="/";if(f&&Fn)throw new le(10);if(!f&&l){var h=ti(l,{gb:false});if(l=h.path,h=h.node,h.Ba)throw new le(10);if((h.mode&61440)!==16384)throw new le(54)}l={type:s,Pc:{},kb:l,Zb:[]},s=s.U(l),s.U=l,l.root=s,f?Fn=s:h&&(h.Ba=l,h.U&&h.U.Zb.push(l));}function dt(s,l,f){var h=ti(s,{parent:true}).node;if(s=x(s),!s||s==="."||s==="..")throw new le(28);var v=Ae(h,s);if(v)throw new le(v);if(!h.j.Aa)throw new le(63);return h.j.Aa(h,s,l,f)}function rt(s){return dt(s,16895,0)}function an(s,l,f){typeof f>"u"&&(f=l,l=438),dt(s,l|8192,f);}function Yi(s,l){if(!ae(s))throw new le(44);var f=ti(l,{parent:true}).node;if(!f)throw new le(44);l=x(l);var h=Ae(f,l);if(h)throw new le(h);if(!f.j.Ha)throw new le(63);f.j.Ha(f,l,s);}function Pd(s){if(s=ti(s).node,!s)throw new le(44);if(!s.j.la)throw new le(28);return ae(zi(s.parent),s.j.la(s))}function ts(s,l,f){if(s==="")throw new le(44);if(typeof l=="string"){var h={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[l];if(typeof h>"u")throw Error(`Unknown file open mode: ${l}`);l=h;}if(f=l&64?(typeof f>"u"?438:f)&4095|32768:0,typeof s=="object")var v=s;else {s=m(s);try{v=ti(s,{fb:!(l&131072)}).node;}catch{}}if(h=false,l&64)if(v){if(l&128)throw new le(20)}else v=dt(s,f,0),h=true;if(!v)throw new le(44);if((v.mode&61440)===8192&&(l&=-513),l&65536&&(v.mode&61440)!==16384)throw new le(54);if(!h&&(f=v?(v.mode&61440)===40960?32:(v.mode&61440)===16384&&(Z(l)!=="r"||l&512)?31:de(v,Z(l)):44))throw new le(f);if(l&512&&!h){if(f=v,f=typeof f=="string"?ti(f,{fb:true}).node:f,!f.j.P)throw new le(63);if((f.mode&61440)===16384)throw new le(31);if((f.mode&61440)!==32768)throw new le(28);if(h=de(f,"w"))throw new le(h);f.j.P(f,{size:0,timestamp:Date.now()});}return l&=-131713,v=$e({node:v,path:zi(v),flags:l,seekable:true,position:0,m:v.m,nc:[],error:false}),v.m.open&&v.m.open(v),!p.logReadFiles||l&1||(To||(To={}),s in To||(To[s]=1)),v}function Eu(s,l,f){if(s.W===null)throw new le(8);if(!s.seekable||!s.m.aa)throw new le(70);if(f!=0&&f!=1&&f!=2)throw new le(28);s.position=s.m.aa(s,l,f),s.nc=[];}var wu;function ga(s,l,f){s=m("/dev/"+s);var h=ki(!!l,!!f);Mu||(Mu=64);var v=Mu++<<8|0;Ve(v,{open(S){S.seekable=false;},close(){f?.buffer?.length&&f(10);},read(S,k,O,F){for(var P=0,$=0;$<F;$++){try{var he=l();}catch{throw new le(29)}if(he===void 0&&P===0)throw new le(6);if(he==null)break;P++,k[O+$]=he;}return P&&(S.node.timestamp=Date.now()),P},write(S,k,O,F){for(var P=0;P<F;P++)try{f(k[O+P]);}catch{throw new le(29)}return F&&(S.node.timestamp=Date.now()),P}}),an(s,h,v);}var Mu,Wi={},To,va=void 0,Cr=(s,l)=>Object.defineProperty(l,"name",{value:s}),Co=[],Ai=[],we,Gn=s=>{if(!s)throw new we("Cannot use deleted val. handle = "+s);return Ai[s]},yi=s=>{switch(s){case void 0:return 2;case null:return 4;case true:return 6;case false:return 8;default:let l=Co.pop()||Ai.length;return Ai[l]=s,Ai[l+1]=1,l}},Tu=s=>{var l=Error,f=Cr(s,function(h){this.name=s,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
15
+ `+h.replace(/^Error(:[^\n]*)?\n/,""));});return f.prototype=Object.create(l.prototype),f.prototype.constructor=f,f.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},f},Cu,Ru,Nt=s=>{for(var l="";ce[s];)l+=Ru[ce[s++]];return l},Aa=[],ns=()=>{for(;Aa.length;){var s=Aa.pop();s.g.ga=false,s.delete();}},Rr,ni={},kr=(s,l)=>{if(l===void 0)throw new we("ptr should not be undefined");for(;s.B;)l=s.na(l),s=s.B;return l},qi={},Ro=s=>{s=Iv(s);var l=Nt(s);return Zi(s),l},xr=(s,l)=>{var f=qi[s];if(f===void 0)throw s=`${l} has unknown type ${Ro(s)}`,new we(s);return f},ya=()=>{},is=false,ku=(s,l,f)=>l===f?s:f.B===void 0?null:(s=ku(s,l,f.B),s===null?null:f.Jb(s)),xu={},Bd=(s,l)=>(l=kr(s,l),ni[l]),ba,rs=(s,l)=>{if(!l.u||!l.o)throw new ba("makeClassHandle requires ptr and ptrType");if(!!l.J!=!!l.D)throw new ba("Both smartPtrType and smartPtr must be specified");return l.count={value:1},Or(Object.create(s,{g:{value:l,writable:true}}))},Or=s=>typeof FinalizationRegistry>"u"?(Or=l=>l,s):(is=new FinalizationRegistry(l=>{l=l.g,--l.count.value,l.count.value===0&&(l.D?l.J.O(l.D):l.u.i.O(l.o));}),Or=l=>{var f=l.g;return f.D&&is.register(l,{g:f},l),l},ya=l=>{is.unregister(l);},Or(s)),as={},_a=s=>{for(;s.length;){var l=s.pop();s.pop()(l);}};function Qi(s){return this.fromWireType(me[s>>2])}var Ir={},ss={},yn=(s,l,f)=>{function h(O){if(O=f(O),O.length!==s.length)throw new ba("Mismatched type converter count");for(var F=0;F<s.length;++F)ii(s[F],O[F]);}s.forEach(function(O){ss[O]=l;});var v=Array(l.length),S=[],k=0;l.forEach((O,F)=>{qi.hasOwnProperty(O)?v[F]=qi[O]:(S.push(O),Ir.hasOwnProperty(O)||(Ir[O]=[]),Ir[O].push(()=>{v[F]=qi[O],++k,k===S.length&&h(v);}));}),S.length===0&&h(v);};function Ud(s,l,f={}){var h=l.name;if(!s)throw new we(`type "${h}" must have a positive integer typeid pointer`);if(qi.hasOwnProperty(s)){if(f.Tb)return;throw new we(`Cannot register type '${h}' twice`)}qi[s]=l,delete ss[s],Ir.hasOwnProperty(s)&&(l=Ir[s],delete Ir[s],l.forEach(v=>v()));}function ii(s,l,f={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ud(s,l,f)}var os=s=>{throw new we(s.g.u.i.name+" instance already deleted")};function ls(){}var ko=(s,l,f)=>{if(s[l].A===void 0){var h=s[l];s[l]=function(...v){if(!s[l].A.hasOwnProperty(v.length))throw new we(`Function '${f}' called with an invalid number of arguments (${v.length}) - expects one of (${s[l].A})!`);return s[l].A[v.length].apply(this,v)},s[l].A=[],s[l].A[h.fa]=h;}},xo=(s,l,f)=>{if(p.hasOwnProperty(s)){if(f===void 0||p[s].A!==void 0&&p[s].A[f]!==void 0)throw new we(`Cannot register public name '${s}' twice`);if(ko(p,s,s),p.hasOwnProperty(f))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${f})!`);p[s].A[f]=l;}else p[s]=l,f!==void 0&&(p[s].Oc=f);},oe=s=>{if(s===void 0)return "_unknown";s=s.replace(/[^a-zA-Z0-9_]/g,"$");var l=s.charCodeAt(0);return 48<=l&&57>=l?`_${s}`:s};function et(s,l,f,h,v,S,k,O){this.name=s,this.constructor=l,this.M=f,this.O=h,this.B=v,this.Ob=S,this.na=k,this.Jb=O,this.ob=[];}var Ct=(s,l,f)=>{for(;l!==f;){if(!l.na)throw new we(`Expected null or instance of ${f.name}, got an instance of ${l.name}`);s=l.na(s),l=l.B;}return s};function Xi(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return Ct(l.g.o,l.g.u.i,this.i)}function Fd(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);if(this.wa){var f=this.Ta();return s!==null&&s.push(this.O,f),f}return 0}if(!l||!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.va&&l.g.u.va)throw new we(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);if(f=Ct(l.g.o,l.g.u.i,this.i),this.wa){if(l.g.D===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.hc){case 0:if(l.g.J===this)f=l.g.D;else throw new we(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);break;case 1:f=l.g.D;break;case 2:if(l.g.J===this)f=l.g.D;else {var h=l.clone();f=this.cc(f,yi(()=>h.delete())),s!==null&&s.push(this.O,f);}break;default:throw new we("Unsupporting sharing policy")}}return f}function Vd(s,l){if(l===null){if(this.Ra)throw new we(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new we(`Cannot pass "${Do(l)}" as a ${this.name}`);if(!l.g.o)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(l.g.u.va)throw new we(`Cannot convert argument of type ${l.g.u.name} to parameter type ${this.name}`);return Ct(l.g.o,l.g.u.i,this.i)}function us(s,l,f,h,v,S,k,O,F,P,$){this.name=s,this.i=l,this.Ra=f,this.va=h,this.wa=v,this.bc=S,this.hc=k,this.qb=O,this.Ta=F,this.cc=P,this.O=$,v||l.B!==void 0?this.toWireType=Fd:(this.toWireType=h?Xi:Vd,this.L=null);}var Ou=(s,l,f)=>{if(!p.hasOwnProperty(s))throw new ba("Replacing nonexistent public symbol");p[s].A!==void 0&&f!==void 0?p[s].A[f]=l:(p[s]=l,p[s].fa=f);},cs=[],Iu,Sa=s=>{var l=cs[s];return l||(s>=cs.length&&(cs.length=s+1),cs[s]=l=Iu.get(s)),l},Hd=(s,l,f=[])=>(s.includes("j")?(s=s.replace(/p/g,"i"),l=(0, p["dynCall_"+s])(l,...f)):l=Sa(l)(...f),l),Gd=(s,l)=>(...f)=>Hd(s,l,f),sn=(s,l)=>{s=Nt(s);var f=s.includes("j")?Gd(s,l):Sa(l);if(typeof f!="function")throw new we(`unknown function pointer with signature ${s}: ${l}`);return f},Nu,bi=(s,l)=>{function f(S){v[S]||qi[S]||(ss[S]?ss[S].forEach(f):(h.push(S),v[S]=true));}var h=[],v={};throw l.forEach(f),new Nu(`${s}: `+h.map(Ro).join([", "]))};function zd(s){for(var l=1;l<s.length;++l)if(s[l]!==null&&s[l].L===void 0)return true;return false}function fs(s,l,f,h,v){var S=l.length;if(2>S)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=l[1]!==null&&f!==null,O=zd(l),F=l[0].name!=="void",P=S-2,$=Array(P),he=[],ge=[];return Cr(s,function(...V){if(V.length!==P)throw new we(`function ${s} called with ${V.length} arguments, expected ${P}`);if(ge.length=0,he.length=k?2:1,he[0]=v,k){var J=l[1].toWireType(ge,this);he[1]=J;}for(var te=0;te<P;++te)$[te]=l[te+2].toWireType(ge,V[te]),he.push($[te]);if(V=h(...he),O)_a(ge);else for(te=k?1:2;te<l.length;te++){var _e=te===1?J:$[te-2];l[te].L!==null&&l[te].L(_e);}return J=F?l[0].fromWireType(V):void 0,J})}var Ea=(s,l)=>{for(var f=[],h=0;h<s;h++)f.push(me[l+4*h>>2]);return f},Oo=s=>{s=s.trim();let l=s.indexOf("(");return l!==-1?s.substr(0,l):s},Io=(s,l,f)=>{if(!(s instanceof Object))throw new we(`${f} with invalid "this": ${s}`);if(!(s instanceof l.i.constructor))throw new we(`${f} incompatible with "this" of type ${s.constructor.name}`);if(!s.g.o)throw new we(`cannot call emscripten binding method ${f} on deleted object`);return Ct(s.g.o,s.g.u.i,l.i)},No=s=>{9<s&&--Ai[s+1]===0&&(Ai[s]=void 0,Co.push(s));},jd={name:"emscripten::val",fromWireType:s=>{var l=Gn(s);return No(s),l},toWireType:(s,l)=>yi(l),argPackAdvance:8,readValueFromPointer:Qi,L:null},Yd=(s,l,f)=>{switch(l){case 1:return f?function(h){return this.fromWireType(ye[h])}:function(h){return this.fromWireType(ce[h])};case 2:return f?function(h){return this.fromWireType(j[h>>1])}:function(h){return this.fromWireType(X[h>>1])};case 4:return f?function(h){return this.fromWireType(K[h>>2])}:function(h){return this.fromWireType(me[h>>2])};default:throw new TypeError(`invalid integer width (${l}): ${s}`)}},Do=s=>{if(s===null)return "null";var l=typeof s;return l==="object"||l==="array"||l==="function"?s.toString():""+s},Wd=(s,l)=>{switch(l){case 4:return function(f){return this.fromWireType(Ie[f>>2])};case 8:return function(f){return this.fromWireType(We[f>>3])};default:throw new TypeError(`invalid float width (${l}): ${s}`)}},qd=(s,l,f)=>{switch(l){case 1:return f?h=>ye[h]:h=>ce[h];case 2:return f?h=>j[h>>1]:h=>X[h>>1];case 4:return f?h=>K[h>>2]:h=>me[h>>2];default:throw new TypeError(`invalid integer width (${l}): ${s}`)}},Du=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qd=(s,l)=>{for(var f=s>>1,h=f+l/2;!(f>=h)&&X[f];)++f;if(f<<=1,32<f-s&&Du)return Du.decode(ce.subarray(s,f));for(f="",h=0;!(h>=l/2);++h){var v=j[s+2*h>>1];if(v==0)break;f+=String.fromCharCode(v);}return f},Xd=(s,l,f)=>{if(f??(f=2147483647),2>f)return 0;f-=2;var h=l;f=f<2*s.length?f/2:s.length;for(var v=0;v<f;++v)j[l>>1]=s.charCodeAt(v),l+=2;return j[l>>1]=0,l-h},Kd=s=>2*s.length,Zd=(s,l)=>{for(var f=0,h="";!(f>=l/4);){var v=K[s+4*f>>2];if(v==0)break;++f,65536<=v?(v-=65536,h+=String.fromCharCode(55296|v>>10,56320|v&1023)):h+=String.fromCharCode(v);}return h},Jd=(s,l,f)=>{if(f??(f=2147483647),4>f)return 0;var h=l;f=h+f-4;for(var v=0;v<s.length;++v){var S=s.charCodeAt(v);if(55296<=S&&57343>=S){var k=s.charCodeAt(++v);S=65536+((S&1023)<<10)|k&1023;}if(K[l>>2]=S,l+=4,l+4>f)break}return K[l>>2]=0,l-h},$d=s=>{for(var l=0,f=0;f<s.length;++f){var h=s.charCodeAt(f);55296<=h&&57343>=h&&++f,l+=4;}return l},Lu=(s,l,f)=>{var h=[];return s=s.toWireType(h,f),h.length&&(me[l>>2]=yi(h)),s},ds=[],Pu={},Bu=s=>{var l=Pu[s];return l===void 0?Nt(s):l},eh=s=>{var l=ds.length;return ds.push(s),l},ue=(s,l)=>{for(var f=Array(s),h=0;h<s;++h)f[h]=xr(me[l+4*h>>2],"parameter "+h);return f},Le=Reflect.construct,on=s=>s%4===0&&(s%100!==0||s%400===0),hs=[0,31,60,91,121,152,182,213,244,274,305,335],Uu=[0,31,59,90,120,151,181,212,243,273,304,334],th=[],Av=s=>{s.Dc=s.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");},yv=s=>{s.Lc=s.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");},bv=s=>{var l="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");return (s.getSupportedExtensions()||[]).filter(f=>l.includes(f))},_v=1,Lo=[],_i=[],Fu=[],Po=[],ms=[],wa=[],Vu=[],ln=[],Sv={},nh=4,Ev=0,Hu=s=>{for(var l=_v++,f=s.length;f<l;f++)s[f]=null;return l},Bo=(s,l,f,h)=>{for(var v=0;v<s;v++){var S=W[f](),k=S&&Hu(h);S?(S.name=k,h[k]=S):bn||(bn=1282),K[l+4*v>>2]=k;}},zw=(s,l)=>{var f=Hu(ln),h={handle:f,attributes:l,version:l.Kc,F:s};return s.canvas&&(s.canvas.zb=h),ln[f]=h,(typeof l.Kb>"u"||l.Kb)&&jw(h),f},ih=s=>(Ki=ln[s],p.Bc=W=Ki?.F,!(s&&!W)),jw=s=>{if(s||(s=Ki),!s.Ub){s.Ub=true;var l=s.F;Av(l),yv(l),2<=s.version&&(l.cb=l.getExtension("EXT_disjoint_timer_query_webgl2")),(2>s.version||!l.cb)&&(l.cb=l.getExtension("EXT_disjoint_timer_query")),l.$b=l.getExtension("WEBGL_multi_draw"),bv(l).forEach(f=>{f.includes("lose_context")||f.includes("debug")||l.getExtension(f);});}},bn,Ki,rh={},wv=()=>{if(!ah){var s={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:U||"./this.program"},l;for(l in rh)rh[l]===void 0?delete s[l]:s[l]=rh[l];var f=[];for(l in s)f.push(`${l}=${s[l]}`);ah=f;}return ah},ah,sh=[];function Mv(){var s=bv(W);return s=s.concat(s.map(l=>"GL_"+l))}var Yw=(s,l)=>{if(l){var f=void 0;switch(s){case 36346:f=1;break;case 36344:return;case 34814:case 36345:f=0;break;case 34466:var h=W.getParameter(34467);f=h?h.length:0;break;case 33309:if(2>Ki.version){bn||(bn=1282);return}f=Mv().length;break;case 33307:case 33308:if(2>Ki.version){bn||(bn=1280);return}f=s==33307?3:0;}if(f===void 0)switch(h=W.getParameter(s),typeof h){case "number":f=h;break;case "boolean":f=h?1:0;break;case "string":bn||(bn=1280);return;case "object":if(h===null)switch(s){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:f=0;break;default:bn||(bn=1280);return}else {if(h instanceof Float32Array||h instanceof Uint32Array||h instanceof Int32Array||h instanceof Array){for(s=0;s<h.length;++s)K[l+4*s>>2]=h[s];return}try{f=h.name|0;}catch(v){bn||(bn=1280),Ce(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${s})! (error: ${v})`);return}}break;default:bn||(bn=1280),Ce(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${s}) and it returns ${h} of type ${typeof h}!`);return}K[l>>2]=f;}else bn||(bn=1281);},Gu=s=>{var l=tt(s)+1,f=ju(l);return f&&Ke(s,ce,f,l),f},Tv=s=>s.slice(-1)=="]"&&s.lastIndexOf("["),oh=s=>(s-=5120,s==0?ye:s==1?ce:s==2?j:s==4?K:s==6?Ie:s==5||s==28922||s==28520||s==30779||s==30782?me:X),Cv=[31,29,31,30,31,30,31,31,30,31,30,31],Rv=[31,28,31,30,31,30,31,31,30,31,30,31],kv=(s,l,f,h)=>{function v(V,J,te){for(V=typeof V=="number"?V.toString():V||"";V.length<J;)V=te[0]+V;return V}function S(V,J){return v(V,J,"0")}function k(V,J){function te(Me){return 0>Me?-1:0<Me?1:0}var _e;return (_e=te(V.getFullYear()-J.getFullYear()))===0&&(_e=te(V.getMonth()-J.getMonth()))===0&&(_e=te(V.getDate()-J.getDate())),_e}function O(V){switch(V.getDay()){case 0:return new Date(V.getFullYear()-1,11,29);case 1:return V;case 2:return new Date(V.getFullYear(),0,3);case 3:return new Date(V.getFullYear(),0,2);case 4:return new Date(V.getFullYear(),0,1);case 5:return new Date(V.getFullYear()-1,11,31);case 6:return new Date(V.getFullYear()-1,11,30)}}function F(V){var J=V.ba;for(V=new Date(new Date(V.ca+1900,0,1).getTime());0<J;){var te=V.getMonth(),_e=(on(V.getFullYear())?Cv:Rv)[te];if(J>_e-V.getDate())J-=_e-V.getDate()+1,V.setDate(1),11>te?V.setMonth(te+1):(V.setMonth(0),V.setFullYear(V.getFullYear()+1));else {V.setDate(V.getDate()+J);break}}return te=new Date(V.getFullYear()+1,0,4),J=O(new Date(V.getFullYear(),0,4)),te=O(te),0>=k(J,V)?0>=k(te,V)?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var P=me[h+40>>2];h={kc:K[h>>2],jc:K[h+4>>2],Ia:K[h+8>>2],Va:K[h+12>>2],Ja:K[h+16>>2],ca:K[h+20>>2],R:K[h+24>>2],ba:K[h+28>>2],Sc:K[h+32>>2],ic:K[h+36>>2],lc:P&&P?re(ce,P):""},f=f?re(ce,f):"",P={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var $ in P)f=f.replace(new RegExp($,"g"),P[$]);var he="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ge="January February March April May June July August September October November December".split(" ");P={"%a":V=>he[V.R].substring(0,3),"%A":V=>he[V.R],"%b":V=>ge[V.Ja].substring(0,3),"%B":V=>ge[V.Ja],"%C":V=>S((V.ca+1900)/100|0,2),"%d":V=>S(V.Va,2),"%e":V=>v(V.Va,2," "),"%g":V=>F(V).toString().substring(2),"%G":F,"%H":V=>S(V.Ia,2),"%I":V=>(V=V.Ia,V==0?V=12:12<V&&(V-=12),S(V,2)),"%j":V=>{for(var J=0,te=0;te<=V.Ja-1;J+=(on(V.ca+1900)?Cv:Rv)[te++]);return S(V.Va+J,3)},"%m":V=>S(V.Ja+1,2),"%M":V=>S(V.jc,2),"%n":()=>`
16
+ `,"%p":V=>0<=V.Ia&&12>V.Ia?"AM":"PM","%S":V=>S(V.kc,2),"%t":()=>" ","%u":V=>V.R||7,"%U":V=>S(Math.floor((V.ba+7-V.R)/7),2),"%V":V=>{var J=Math.floor((V.ba+7-(V.R+6)%7)/7);if(2>=(V.R+371-V.ba-2)%7&&J++,J)J==53&&(te=(V.R+371-V.ba)%7,te==4||te==3&&on(V.ca)||(J=1));else {J=52;var te=(V.R+7-V.ba-1)%7;(te==4||te==5&&on(V.ca%400-1))&&J++;}return S(J,2)},"%w":V=>V.R,"%W":V=>S(Math.floor((V.ba+7-(V.R+6)%7)/7),2),"%y":V=>(V.ca+1900).toString().substring(2),"%Y":V=>V.ca+1900,"%z":V=>{V=V.ic;var J=0<=V;return V=Math.abs(V)/60,(J?"+":"-")+("0000"+(V/60*100+V%60)).slice(-4)},"%Z":V=>V.lc,"%%":()=>"%"},f=f.replace(/%%/g,"\0\0");for($ in P)f.includes($)&&(f=f.replace(new RegExp($,"g"),P[$](h)));return f=f.replace(/\0\0/g,"%"),$=De(f,false),$.length>l?0:(ye.set($,s),$.length-1)};[44].forEach(s=>{Hn[s]=new le(s),Hn[s].stack="<generic error, no stack>";}),Vn=Array(4096),ut(ve,"/"),rt("/tmp"),rt("/home"),rt("/home/web_user"),(function(){rt("/dev"),Ve(259,{read:()=>0,write:(h,v,S,k)=>k}),an("/dev/null",259),Gt(1280,zt),Gt(1536,Mt),an("/dev/tty",1280),an("/dev/tty1",1536);var s=new Uint8Array(1024),l=0,f=()=>(l===0&&(l=z(s).byteLength),s[--l]);ga("random",f),ga("urandom",f),rt("/dev/shm"),rt("/dev/shm/tmp");})(),(function(){rt("/proc");var s=rt("/proc/self");rt("/proc/self/fd"),ut({U(){var l=Tr(s,"fd",16895,73);return l.j={ka(f,h){var v=ke(+h);return f={parent:null,U:{kb:"fake"},j:{la:()=>v.path}},f.parent=f}},l}},"/proc/self/fd");})(),we=p.BindingError=class extends Error{constructor(s){super(s),this.name="BindingError";}},Ai.push(0,1,void 0,1,null,1,true,1,false,1),p.count_emval_handles=()=>Ai.length/2-5-Co.length,Cu=p.PureVirtualError=Tu("PureVirtualError");for(var xv=Array(256),zu=0;256>zu;++zu)xv[zu]=String.fromCharCode(zu);Ru=xv,p.getInheritedInstanceCount=()=>Object.keys(ni).length,p.getLiveInheritedInstances=()=>{var s=[],l;for(l in ni)ni.hasOwnProperty(l)&&s.push(ni[l]);return s},p.flushPendingDeletes=ns,p.setDelayFunction=s=>{Rr=s,Aa.length&&Rr&&Rr(ns);},ba=p.InternalError=class extends Error{constructor(s){super(s),this.name="InternalError";}},Object.assign(ls.prototype,{isAliasOf:function(s){if(!(this instanceof ls&&s instanceof ls))return false;var l=this.g.u.i,f=this.g.o;s.g=s.g;var h=s.g.u.i;for(s=s.g.o;l.B;)f=l.na(f),l=l.B;for(;h.B;)s=h.na(s),h=h.B;return l===h&&f===s},clone:function(){if(this.g.o||os(this),this.g.ia)return this.g.count.value+=1,this;var s=Or,l=Object,f=l.create,h=Object.getPrototypeOf(this),v=this.g;return s=s(f.call(l,h,{g:{value:{count:v.count,ga:v.ga,ia:v.ia,o:v.o,u:v.u,D:v.D,J:v.J}}})),s.g.count.value+=1,s.g.ga=false,s},delete(){if(this.g.o||os(this),this.g.ga&&!this.g.ia)throw new we("Object already scheduled for deletion");ya(this);var s=this.g;--s.count.value,s.count.value===0&&(s.D?s.J.O(s.D):s.u.i.O(s.o)),this.g.ia||(this.g.D=void 0,this.g.o=void 0);},isDeleted:function(){return !this.g.o},deleteLater:function(){if(this.g.o||os(this),this.g.ga&&!this.g.ia)throw new we("Object already scheduled for deletion");return Aa.push(this),Aa.length===1&&Rr&&Rr(ns),this.g.ga=true,this}}),Object.assign(us.prototype,{Pb(s){return this.qb&&(s=this.qb(s)),s},bb(s){this.O?.(s);},argPackAdvance:8,readValueFromPointer:Qi,fromWireType:function(s){function l(){return this.wa?rs(this.i.M,{u:this.bc,o:f,J:this,D:s}):rs(this.i.M,{u:this,o:s})}var f=this.Pb(s);if(!f)return this.bb(s),null;var h=Bd(this.i,f);if(h!==void 0)return h.g.count.value===0?(h.g.o=f,h.g.D=s,h.clone()):(h=h.clone(),this.bb(s),h);if(h=this.i.Ob(f),h=xu[h],!h)return l.call(this);h=this.va?h.Hb:h.pointerType;var v=ku(f,this.i,h.i);return v===null?l.call(this):this.wa?rs(h.i.M,{u:h,o:v,J:this,D:s}):rs(h.i.M,{u:h,o:v})}}),Nu=p.UnboundTypeError=Tu("UnboundTypeError");for(var W,lh=0;32>lh;++lh)sh.push(Array(lh));var Ov={__syscall_fcntl64:function(s,l,f){va=f;try{var h=ke(s);switch(l){case 0:var v=b();if(0>v)break;for(;vi[v];)v++;return Bt(h,v).W;case 1:case 2:return 0;case 3:return h.flags;case 4:return v=b(),h.flags|=v,0;case 12:return v=b(),j[v+0>>1]=2,0;case 13:case 14:return 0}return -28}catch(S){if(typeof Wi>"u"||S.name!=="ErrnoError")throw S;return -S.$}},__syscall_ioctl:function(s,l,f){va=f;try{var h=ke(s);switch(l){case 21509:return h.s?0:-59;case 21505:if(!h.s)return -59;if(h.s.V.Wb){s=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var v=b();K[v>>2]=25856,K[v+4>>2]=5,K[v+8>>2]=191,K[v+12>>2]=35387;for(var S=0;32>S;S++)ye[v+S+17]=s[S]||0;}return 0;case 21510:case 21511:case 21512:return h.s?0:-59;case 21506:case 21507:case 21508:if(!h.s)return -59;if(h.s.V.Xb)for(v=b(),s=[],S=0;32>S;S++)s.push(ye[v+S+17]);return 0;case 21519:return h.s?(v=b(),K[v>>2]=0):-59;case 21520:return h.s?-28:-59;case 21531:if(v=b(),!h.m.Vb)throw new le(59);return h.m.Vb(h,l,v);case 21523:return h.s?(h.s.V.Yb&&(S=[24,80],v=b(),j[v>>1]=S[0],j[v+2>>1]=S[1]),0):-59;case 21524:return h.s?0:-59;case 21515:return h.s?0:-59;default:return -28}}catch(k){if(typeof Wi>"u"||k.name!=="ErrnoError")throw k;return -k.$}},__syscall_openat:function(s,l,f,h){va=h;try{l=l?re(ce,l):"";var v=l;if(v.charAt(0)==="/")l=v;else {var S=s===-100?"/":ke(s).path;if(v.length==0)throw new le(44);l=m(S+"/"+v);}var k=h?b():0;return ts(l,f,k).W}catch(O){if(typeof Wi>"u"||O.name!=="ErrnoError")throw O;return -O.$}},_abort_js:()=>{wn("");},_embind_create_inheriting_constructor:(s,l,f)=>{s=Nt(s),l=xr(l,"wrapper"),f=Gn(f);var h=l.i,v=h.M,S=h.B.M,k=h.B.constructor;return s=Cr(s,function(...O){h.B.ob.forEach(function(F){if(this[F]===S[F])throw new Cu(`Pure virtual function ${F} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:v}),this.__construct(...O);}),v.__construct=function(...O){if(this===v)throw new we("Pass correct 'this' to __construct");O=k.implement(this,...O),ya(O);var F=O.g;if(O.notifyOnDestruction(),F.ia=true,Object.defineProperties(this,{g:{value:F}}),Or(this),O=F.o,O=kr(h,O),ni.hasOwnProperty(O))throw new we(`Tried to register registered instance: ${O}`);ni[O]=this;},v.__destruct=function(){if(this===v)throw new we("Pass correct 'this' to __destruct");ya(this);var O=this.g.o;if(O=kr(h,O),ni.hasOwnProperty(O))delete ni[O];else throw new we(`Tried to unregister unregistered instance: ${O}`)},s.prototype=Object.create(v),Object.assign(s.prototype,f),yi(s)},_embind_finalize_value_object:s=>{var l=as[s];delete as[s];var f=l.Ta,h=l.O,v=l.eb,S=v.map(k=>k.Sb).concat(v.map(k=>k.ec));yn([s],S,k=>{var O={};return v.forEach((F,P)=>{var $=k[P],he=F.Qb,ge=F.Rb,V=k[P+v.length],J=F.dc,te=F.fc;O[F.Mb]={read:_e=>$.fromWireType(he(ge,_e)),write:(_e,Me)=>{var Pe=[];J(te,_e,V.toWireType(Pe,Me)),_a(Pe);}};}),[{name:l.name,fromWireType:F=>{var P={},$;for($ in O)P[$]=O[$].read(F);return h(F),P},toWireType:(F,P)=>{for(var $ in O)if(!($ in P))throw new TypeError(`Missing field: "${$}"`);var he=f();for($ in O)O[$].write(he,P[$]);return F!==null&&F.push(h,he),he},argPackAdvance:8,readValueFromPointer:Qi,L:h}]});},_embind_register_bigint:()=>{},_embind_register_bool:(s,l,f,h)=>{l=Nt(l),ii(s,{name:l,fromWireType:function(v){return !!v},toWireType:function(v,S){return S?f:h},argPackAdvance:8,readValueFromPointer:function(v){return this.fromWireType(ce[v])},L:null});},_embind_register_class:(s,l,f,h,v,S,k,O,F,P,$,he,ge)=>{$=Nt($),S=sn(v,S),O&&(O=sn(k,O)),P&&(P=sn(F,P)),ge=sn(he,ge);var V=oe($);xo(V,function(){bi(`Cannot construct ${$} due to unbound types`,[h]);}),yn([s,l,f],h?[h]:[],J=>{if(J=J[0],h)var te=J.i,_e=te.M;else _e=ls.prototype;J=Cr($,function(...Rt){if(Object.getPrototypeOf(this)!==Me)throw new we("Use 'new' to construct "+$);if(Pe.Z===void 0)throw new we($+" has no accessible constructor");var kt=Pe.Z[Rt.length];if(kt===void 0)throw new we(`Tried to invoke ctor of ${$} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(Pe.Z).toString()}) parameters instead!`);return kt.apply(this,Rt)});var Me=Object.create(_e,{constructor:{value:J}});J.prototype=Me;var Pe=new et($,J,Me,ge,te,S,O,P);if(Pe.B){var ht;(ht=Pe.B).oa??(ht.oa=[]),Pe.B.oa.push(Pe);}return te=new us($,Pe,true,false,false),ht=new us($+"*",Pe,false,false,false),_e=new us($+" const*",Pe,false,true,false),xu[s]={pointerType:ht,Hb:_e},Ou(V,J),[te,ht,_e]});},_embind_register_class_class_function:(s,l,f,h,v,S,k)=>{var O=Ea(f,h);l=Nt(l),l=Oo(l),S=sn(v,S),yn([],[s],F=>{function P(){bi(`Cannot call ${$} due to unbound types`,O);}F=F[0];var $=`${F.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var he=F.i.constructor;return he[l]===void 0?(P.fa=f-1,he[l]=P):(ko(he,l,$),he[l].A[f-1]=P),yn([],O,ge=>{if(ge=fs($,[ge[0],null].concat(ge.slice(1)),null,S,k),he[l].A===void 0?(ge.fa=f-1,he[l]=ge):he[l].A[f-1]=ge,F.i.oa)for(let V of F.i.oa)V.constructor.hasOwnProperty(l)||(V.constructor[l]=ge);return []}),[]});},_embind_register_class_class_property:(s,l,f,h,v,S,k,O)=>{l=Nt(l),S=sn(v,S),yn([],[s],F=>{F=F[0];var P=`${F.name}.${l}`,$={get(){bi(`Cannot access ${P} due to unbound types`,[f]);},enumerable:true,configurable:true};return $.set=O?()=>{bi(`Cannot access ${P} due to unbound types`,[f]);}:()=>{throw new we(`${P} is a read-only property`)},Object.defineProperty(F.i.constructor,l,$),yn([],[f],he=>{he=he[0];var ge={get(){return he.fromWireType(S(h))},enumerable:true};return O&&(O=sn(k,O),ge.set=V=>{var J=[];O(h,he.toWireType(J,V)),_a(J);}),Object.defineProperty(F.i.constructor,l,ge),[]}),[]});},_embind_register_class_constructor:(s,l,f,h,v,S)=>{var k=Ea(l,f);v=sn(h,v),yn([],[s],O=>{O=O[0];var F=`constructor ${O.name}`;if(O.i.Z===void 0&&(O.i.Z=[]),O.i.Z[l-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${l-1}) for class '${O.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return O.i.Z[l-1]=()=>{bi(`Cannot construct ${O.name} due to unbound types`,k);},yn([],k,P=>(P.splice(1,0,null),O.i.Z[l-1]=fs(F,P,null,v,S),[])),[]});},_embind_register_class_function:(s,l,f,h,v,S,k,O)=>{var F=Ea(f,h);l=Nt(l),l=Oo(l),S=sn(v,S),yn([],[s],P=>{function $(){bi(`Cannot call ${he} due to unbound types`,F);}P=P[0];var he=`${P.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),O&&P.i.ob.push(l);var ge=P.i.M,V=ge[l];return V===void 0||V.A===void 0&&V.className!==P.name&&V.fa===f-2?($.fa=f-2,$.className=P.name,ge[l]=$):(ko(ge,l,he),ge[l].A[f-2]=$),yn([],F,J=>(J=fs(he,J,P,S,k),ge[l].A===void 0?(J.fa=f-2,ge[l]=J):ge[l].A[f-2]=J,[])),[]});},_embind_register_class_property:(s,l,f,h,v,S,k,O,F,P)=>{l=Nt(l),v=sn(h,v),yn([],[s],$=>{$=$[0];var he=`${$.name}.${l}`,ge={get(){bi(`Cannot access ${he} due to unbound types`,[f,k]);},enumerable:true,configurable:true};return ge.set=F?()=>bi(`Cannot access ${he} due to unbound types`,[f,k]):()=>{throw new we(he+" is a read-only property")},Object.defineProperty($.i.M,l,ge),yn([],F?[f,k]:[f],V=>{var J=V[0],te={get(){var Me=Io(this,$,he+" getter");return J.fromWireType(v(S,Me))},enumerable:true};if(F){F=sn(O,F);var _e=V[1];te.set=function(Me){var Pe=Io(this,$,he+" setter"),ht=[];F(P,Pe,_e.toWireType(ht,Me)),_a(ht);};}return Object.defineProperty($.i.M,l,te),[]}),[]});},_embind_register_emval:s=>ii(s,jd),_embind_register_enum:(s,l,f,h)=>{function v(){}l=Nt(l),v.values={},ii(s,{name:l,constructor:v,fromWireType:function(S){return this.constructor.values[S]},toWireType:(S,k)=>k.value,argPackAdvance:8,readValueFromPointer:Yd(l,f,h),L:null}),xo(l,v);},_embind_register_enum_value:(s,l,f)=>{var h=xr(s,"enum");l=Nt(l),s=h.constructor,h=Object.create(h.constructor.prototype,{value:{value:f},constructor:{value:Cr(`${h.name}_${l}`,function(){})}}),s.values[f]=h,s[l]=h;},_embind_register_float:(s,l,f)=>{l=Nt(l),ii(s,{name:l,fromWireType:h=>h,toWireType:(h,v)=>v,argPackAdvance:8,readValueFromPointer:Wd(l,f),L:null});},_embind_register_function:(s,l,f,h,v,S)=>{var k=Ea(l,f);s=Nt(s),s=Oo(s),v=sn(h,v),xo(s,function(){bi(`Cannot call ${s} due to unbound types`,k);},l-1),yn([],k,O=>(Ou(s,fs(s,[O[0],null].concat(O.slice(1)),null,v,S),l-1),[]));},_embind_register_integer:(s,l,f,h,v)=>{if(l=Nt(l),v===-1&&(v=4294967295),v=O=>O,h===0){var S=32-8*f;v=O=>O<<S>>>S;}var k=l.includes("unsigned")?function(O,F){return F>>>0}:function(O,F){return F};ii(s,{name:l,fromWireType:v,toWireType:k,argPackAdvance:8,readValueFromPointer:qd(l,f,h!==0),L:null});},_embind_register_memory_view:(s,l,f)=>{function h(S){return new v(ye.buffer,me[S+4>>2],me[S>>2])}var v=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];f=Nt(f),ii(s,{name:f,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{Tb:true});},_embind_register_std_string:(s,l)=>{l=Nt(l);var f=l==="std::string";ii(s,{name:l,fromWireType:function(h){var v=me[h>>2],S=h+4;if(f)for(var k=S,O=0;O<=v;++O){var F=S+O;if(O==v||ce[F]==0){if(k=k?re(ce,k,F-k):"",P===void 0)var P=k;else P+="\0",P+=k;k=F+1;}}else {for(P=Array(v),O=0;O<v;++O)P[O]=String.fromCharCode(ce[S+O]);P=P.join("");}return Zi(h),P},toWireType:function(h,v){v instanceof ArrayBuffer&&(v=new Uint8Array(v));var S=typeof v=="string";if(!(S||v instanceof Uint8Array||v instanceof Uint8ClampedArray||v instanceof Int8Array))throw new we("Cannot pass non-string to std::string");var k=f&&S?tt(v):v.length,O=ju(4+k+1),F=O+4;if(me[O>>2]=k,f&&S)Ke(v,ce,F,k+1);else if(S)for(S=0;S<k;++S){var P=v.charCodeAt(S);if(255<P)throw Zi(F),new we("String has UTF-16 code units that do not fit in 8 bits");ce[F+S]=P;}else for(S=0;S<k;++S)ce[F+S]=v[S];return h!==null&&h.push(Zi,O),O},argPackAdvance:8,readValueFromPointer:Qi,L(h){Zi(h);}});},_embind_register_std_wstring:(s,l,f)=>{if(f=Nt(f),l===2)var h=Qd,v=Xd,S=Kd,k=O=>X[O>>1];else l===4&&(h=Zd,v=Jd,S=$d,k=O=>me[O>>2]);ii(s,{name:f,fromWireType:O=>{for(var F=me[O>>2],P,$=O+4,he=0;he<=F;++he){var ge=O+4+he*l;(he==F||k(ge)==0)&&($=h($,ge-$),P===void 0?P=$:(P+="\0",P+=$),$=ge+l);}return Zi(O),P},toWireType:(O,F)=>{if(typeof F!="string")throw new we(`Cannot pass non-string to C++ string type ${f}`);var P=S(F),$=ju(4+P+l);return me[$>>2]=P/l,v(F,$+4,P+l),O!==null&&O.push(Zi,$),$},argPackAdvance:8,readValueFromPointer:Qi,L(O){Zi(O);}});},_embind_register_value_object:(s,l,f,h,v,S)=>{as[s]={name:Nt(l),Ta:sn(f,h),O:sn(v,S),eb:[]};},_embind_register_value_object_field:(s,l,f,h,v,S,k,O,F,P)=>{as[s].eb.push({Mb:Nt(l),Sb:f,Qb:sn(h,v),Rb:S,ec:k,dc:sn(O,F),fc:P});},_embind_register_void:(s,l)=>{l=Nt(l),ii(s,{Ic:true,name:l,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(s,l,f)=>ce.copyWithin(s,l,l+f),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(s,l,f)=>(s=Gn(s),l=xr(l,"emval::as"),Lu(l,f,s)),_emval_call:(s,l,f,h)=>(s=ds[s],l=Gn(l),s(null,l,f,h)),_emval_call_method:(s,l,f,h,v)=>(s=ds[s],l=Gn(l),f=Bu(f),s(l,l[f],h,v)),_emval_decref:No,_emval_get_method_caller:(s,l,f)=>{var h=ue(s,l),v=h.shift();s--;var S=Array(s);return l=`methodCaller<(${h.map(k=>k.name).join(", ")}) => ${v.name}>`,eh(Cr(l,(k,O,F,P)=>{for(var $=0,he=0;he<s;++he)S[he]=h[he].readValueFromPointer(P+$),$+=h[he].argPackAdvance;return k=f===1?Le(O,S):O.apply(k,S),Lu(v,F,k)}))},_emval_get_property:(s,l)=>(s=Gn(s),l=Gn(l),yi(s[l])),_emval_incref:s=>{9<s&&(Ai[s+1]+=1);},_emval_new_array:()=>yi([]),_emval_new_cstring:s=>yi(Bu(s)),_emval_new_object:()=>yi({}),_emval_run_destructors:s=>{var l=Gn(s);_a(l),No(s);},_emval_set_property:(s,l,f)=>{s=Gn(s),l=Gn(l),f=Gn(f),s[l]=f;},_emval_take_value:(s,l)=>(s=xr(s,"_emval_take_value"),s=s.readValueFromPointer(l),yi(s)),_gmtime_js:function(s,l,f){s=new Date(1e3*(l+2097152>>>0<4194305-!!s?(s>>>0)+4294967296*l:NaN)),K[f>>2]=s.getUTCSeconds(),K[f+4>>2]=s.getUTCMinutes(),K[f+8>>2]=s.getUTCHours(),K[f+12>>2]=s.getUTCDate(),K[f+16>>2]=s.getUTCMonth(),K[f+20>>2]=s.getUTCFullYear()-1900,K[f+24>>2]=s.getUTCDay(),K[f+28>>2]=(s.getTime()-Date.UTC(s.getUTCFullYear(),0,1,0,0,0,0))/864e5|0;},_localtime_js:function(s,l,f){s=new Date(1e3*(l+2097152>>>0<4194305-!!s?(s>>>0)+4294967296*l:NaN)),K[f>>2]=s.getSeconds(),K[f+4>>2]=s.getMinutes(),K[f+8>>2]=s.getHours(),K[f+12>>2]=s.getDate(),K[f+16>>2]=s.getMonth(),K[f+20>>2]=s.getFullYear()-1900,K[f+24>>2]=s.getDay(),K[f+28>>2]=(on(s.getFullYear())?hs:Uu)[s.getMonth()]+s.getDate()-1|0,K[f+36>>2]=-(60*s.getTimezoneOffset()),l=new Date(s.getFullYear(),6,1).getTimezoneOffset();var h=new Date(s.getFullYear(),0,1).getTimezoneOffset();K[f+32>>2]=(l!=h&&s.getTimezoneOffset()==Math.min(h,l))|0;},_tzset_js:(s,l,f,h)=>{var v=new Date().getFullYear(),S=new Date(v,0,1),k=new Date(v,6,1);v=S.getTimezoneOffset();var O=k.getTimezoneOffset();me[s>>2]=60*Math.max(v,O),K[l>>2]=+(v!=O),s=F=>F.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1],S=s(S),k=s(k),O<v?(Ke(S,ce,f,17),Ke(k,ce,h,17)):(Ke(S,ce,h,17),Ke(k,ce,f,17));},beginPixelLocalStorageWEBGL:function(s,l,f){(s=ln[s].F.Da)&&s.beginPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},decode_image:function(s,l,f){var h=p.images;h||(h=new Map,p.images=h);var v=new Image;h.set(s,v),l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),v.src=URL.createObjectURL(new Blob([f],{type:"image/png"})),v.onload=function(){p._setWebImage(s,v.width,v.height);};},delete_image:function(s){var l=p.images;l&&l.get(s)&&l.delete(s);},emscripten_asm_const_int:(s,l,f)=>{th.length=0;for(var h;h=ce[l++];){var v=h!=105;v&=h!=112,f+=v&&f%8?4:0,th.push(h==112?me[f>>2]:h==105?K[f>>2]:We[f>>3]),f+=v?8:4;}return lt[s](...th)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:s=>{var l=ce.length;if(s>>>=0,2147483648<s)return false;for(var f=1;4>=f;f*=2){var h=l*(1+.2/f);h=Math.min(h,s+100663296);var v=Math;h=Math.max(s,h);e:{v=(v.min.call(v,2147483648,h+(65536-h%65536)%65536)-Be.buffer.byteLength+65535)/65536;try{Be.grow(v),Dt();var S=1;break e}catch{}S=void 0;}if(S)return true}return false},emscripten_webgl_enable_extension:(s,l)=>(s=ln[s],l=l?re(ce,l):"",l.startsWith("GL_")&&(l=l.substr(3)),l=="WEBGL_draw_instanced_base_vertex_base_instance"&&Av(W),l=="WEBGL_multi_draw_instanced_base_vertex_base_instance"&&yv(W),l=="WEBGL_multi_draw"&&(W.$b=W.getExtension("WEBGL_multi_draw")),!!s.F.getExtension(l)),emscripten_webgl_get_current_context:()=>Ki?Ki.handle:0,emscripten_webgl_make_context_current:s=>ih(s)?0:-5,enable_WEBGL_provoking_vertex:function(s){return s=ln[s].F,s.pb=s.getExtension("WEBGL_provoking_vertex"),!!s.pb},enable_WEBGL_shader_pixel_local_storage_coherent:function(s){s=ln[s].F;let l=s.getExtension("WEBGL_shader_pixel_local_storage");return l&&l.isCoherent()&&l.framebufferTexturePixelLocalStorageWEBGL.length==5?(s.Da=l,true):false},endPixelLocalStorageWEBGL:function(s,l,f){(s=ln[s].F.Da)&&s.endPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},environ_get:(s,l)=>{var f=0;return wv().forEach((h,v)=>{var S=l+f;for(v=me[s+4*v>>2]=S,S=0;S<h.length;++S)ye[v++]=h.charCodeAt(S);ye[v]=0,f+=h.length+1;}),0},environ_sizes_get:(s,l)=>{var f=wv();me[s>>2]=f.length;var h=0;return f.forEach(v=>h+=v.length+1),me[l>>2]=h,0},fd_close:function(s){try{var l=ke(s);if(l.W===null)throw new le(8);l.Qa&&(l.Qa=null);try{l.m.close&&l.m.close(l);}catch(f){throw f}finally{vi[l.W]=null;}return l.W=null,0}catch(f){if(typeof Wi>"u"||f.name!=="ErrnoError")throw f;return f.$}},fd_read:function(s,l,f,h){try{e:{var v=ke(s);s=l;for(var S,k=l=0;k<f;k++){var O=me[s>>2],F=me[s+4>>2];s+=8;var P=v,$=S,he=ye;if(0>F||0>$)throw new le(28);if(P.W===null)throw new le(8);if((P.flags&2097155)===1)throw new le(8);if((P.node.mode&61440)===16384)throw new le(31);if(!P.m.read)throw new le(28);var ge=typeof $<"u";if(!ge)$=P.position;else if(!P.seekable)throw new le(70);var V=P.m.read(P,he,O,F,$);ge||(P.position+=V);var J=V;if(0>J){var te=-1;break e}if(l+=J,J<F)break;typeof S<"u"&&(S+=J);}te=l;}return me[h>>2]=te,0}catch(_e){if(typeof Wi>"u"||_e.name!=="ErrnoError")throw _e;return _e.$}},fd_seek:function(s,l,f,h,v){l=f+2097152>>>0<4194305-!!l?(l>>>0)+4294967296*f:NaN;try{if(isNaN(l))return 61;var S=ke(s);return Eu(S,l,h),Pt=[S.position>>>0,(It=S.position,1<=+Math.abs(It)?0<It?+Math.floor(It/4294967296)>>>0:~~+Math.ceil((It-+(~~It>>>0))/4294967296)>>>0:0)],K[v>>2]=Pt[0],K[v+4>>2]=Pt[1],S.Qa&&l===0&&h===0&&(S.Qa=null),0}catch(k){if(typeof Wi>"u"||k.name!=="ErrnoError")throw k;return k.$}},fd_write:function(s,l,f,h){try{e:{var v=ke(s);s=l;for(var S,k=l=0;k<f;k++){var O=me[s>>2],F=me[s+4>>2];s+=8;var P=v,$=O,he=F,ge=S,V=ye;if(0>he||0>ge)throw new le(28);if(P.W===null)throw new le(8);if((P.flags&2097155)===0)throw new le(8);if((P.node.mode&61440)===16384)throw new le(31);if(!P.m.write)throw new le(28);P.seekable&&P.flags&1024&&Eu(P,0,2);var J=typeof ge<"u";if(!J)ge=P.position;else if(!P.seekable)throw new le(70);var te=P.m.write(P,V,$,he,ge,void 0);J||(P.position+=te);var _e=te;if(0>_e){var Me=-1;break e}l+=_e,typeof S<"u"&&(S+=_e);}Me=l;}return me[h>>2]=Me,0}catch(Pe){if(typeof Wi>"u"||Pe.name!=="ErrnoError")throw Pe;return Pe.$}},framebufferPixelLocalClearValuefvWEBGL:function(s,l,f,h,v,S){(s=ln[s].F.Da)&&s.framebufferPixelLocalClearValuefvWEBGL(l,[f,h,v,S]);},framebufferTexturePixelLocalStorageWEBGL:function(s,l,f,h,v,S){(s=ln[s].F.Da)&&s.framebufferTexturePixelLocalStorageWEBGL(l,ms[f],h,v,S);},glActiveTexture:s=>W.activeTexture(s),glAttachShader:(s,l)=>{W.attachShader(_i[s],wa[l]);},glBindBuffer:(s,l)=>{s==35051?W.Oa=l:s==35052&&(W.ra=l),W.bindBuffer(s,Lo[l]);},glBindBufferRange:(s,l,f,h,v)=>{W.bindBufferRange(s,l,Lo[f],h,v);},glBindFramebuffer:(s,l)=>{W.bindFramebuffer(s,Fu[l]);},glBindRenderbuffer:(s,l)=>{W.bindRenderbuffer(s,Po[l]);},glBindTexture:(s,l)=>{W.bindTexture(s,ms[l]);},glBindVertexArray:s=>{W.bindVertexArray(Vu[s]);},glBlendEquation:s=>W.blendEquation(s),glBlendFunc:(s,l)=>W.blendFunc(s,l),glBlitFramebuffer:(s,l,f,h,v,S,k,O,F,P)=>W.blitFramebuffer(s,l,f,h,v,S,k,O,F,P),glBufferData:(s,l,f,h)=>{f&&l?W.bufferData(s,ce,h,f,l):W.bufferData(s,l,h);},glBufferSubData:(s,l,f,h)=>{f&&W.bufferSubData(s,l,ce,h,f);},glClear:s=>W.clear(s),glClearBufferfv:(s,l,f)=>{W.clearBufferfv(s,l,Ie,f>>2);},glClearBufferuiv:(s,l,f)=>{W.clearBufferuiv(s,l,me,f>>2);},glClearColor:(s,l,f,h)=>W.clearColor(s,l,f,h),glClearDepthf:s=>W.clearDepth(s),glClearStencil:s=>W.clearStencil(s),glColorMask:(s,l,f,h)=>{W.colorMask(!!s,!!l,!!f,!!h);},glCompileShader:s=>{W.compileShader(wa[s]);},glCompressedTexSubImage2D:(s,l,f,h,v,S,k,O,F)=>{W.ra||!O?W.compressedTexSubImage2D(s,l,f,h,v,S,k,O,F):W.compressedTexSubImage2D(s,l,f,h,v,S,k,ce,F,O);},glCreateProgram:()=>{var s=Hu(_i),l=W.createProgram();return l.name=s,l.za=l.xa=l.ya=0,l.Wa=1,_i[s]=l,s},glCreateShader:s=>{var l=Hu(wa);return wa[l]=W.createShader(s),l},glCullFace:s=>W.cullFace(s),glDeleteBuffers:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=Lo[h];v&&(W.deleteBuffer(v),v.name=0,Lo[h]=null,h==W.Oa&&(W.Oa=0),h==W.ra&&(W.ra=0));}},glDeleteFramebuffers:(s,l)=>{for(var f=0;f<s;++f){var h=K[l+4*f>>2],v=Fu[h];v&&(W.deleteFramebuffer(v),v.name=0,Fu[h]=null);}},glDeleteProgram:s=>{if(s){var l=_i[s];l?(W.deleteProgram(l),l.name=0,_i[s]=null):bn||(bn=1281);}},glDeleteRenderbuffers:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=Po[h];v&&(W.deleteRenderbuffer(v),v.name=0,Po[h]=null);}},glDeleteShader:s=>{if(s){var l=wa[s];l?(W.deleteShader(l),wa[s]=null):bn||(bn=1281);}},glDeleteTextures:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2],v=ms[h];v&&(W.deleteTexture(v),v.name=0,ms[h]=null);}},glDeleteVertexArrays:(s,l)=>{for(var f=0;f<s;f++){var h=K[l+4*f>>2];W.deleteVertexArray(Vu[h]),Vu[h]=null;}},glDepthFunc:s=>W.depthFunc(s),glDepthMask:s=>{W.depthMask(!!s);},glDepthRangef:(s,l)=>W.depthRange(s,l),glDisable:s=>W.disable(s),glDrawArrays:(s,l,f)=>{W.drawArrays(s,l,f);},glDrawArraysInstanced:(s,l,f,h)=>{W.drawArraysInstanced(s,l,f,h);},glDrawBuffers:(s,l)=>{for(var f=sh[s],h=0;h<s;h++)f[h]=K[l+4*h>>2];W.drawBuffers(f);},glDrawElements:(s,l,f,h)=>{W.drawElements(s,l,f,h);},glDrawElementsInstanced:(s,l,f,h,v)=>{W.drawElementsInstanced(s,l,f,h,v);},glEnable:s=>W.enable(s),glEnableVertexAttribArray:s=>{W.enableVertexAttribArray(s);},glFlush:()=>W.flush(),glFramebufferRenderbuffer:(s,l,f,h)=>{W.framebufferRenderbuffer(s,l,f,Po[h]);},glFramebufferTexture2D:(s,l,f,h,v)=>{W.framebufferTexture2D(s,l,f,ms[h],v);},glFrontFace:s=>W.frontFace(s),glGenBuffers:(s,l)=>{Bo(s,l,"createBuffer",Lo);},glGenFramebuffers:(s,l)=>{Bo(s,l,"createFramebuffer",Fu);},glGenRenderbuffers:(s,l)=>{Bo(s,l,"createRenderbuffer",Po);},glGenTextures:(s,l)=>{Bo(s,l,"createTexture",ms);},glGenVertexArrays:(s,l)=>{Bo(s,l,"createVertexArray",Vu);},glGenerateMipmap:s=>W.generateMipmap(s),glGetIntegerv:(s,l)=>Yw(s,l),glGetProgramiv:(s,l,f)=>{if(f)if(s>=_v)bn||(bn=1281);else if(s=_i[s],l==35716)s=W.getProgramInfoLog(s),s===null&&(s="(unknown error)"),K[f>>2]=s.length+1;else if(l==35719){if(!s.za)for(l=0;l<W.getProgramParameter(s,35718);++l)s.za=Math.max(s.za,W.getActiveUniform(s,l).name.length+1);K[f>>2]=s.za;}else if(l==35722){if(!s.xa)for(l=0;l<W.getProgramParameter(s,35721);++l)s.xa=Math.max(s.xa,W.getActiveAttrib(s,l).name.length+1);K[f>>2]=s.xa;}else if(l==35381){if(!s.ya)for(l=0;l<W.getProgramParameter(s,35382);++l)s.ya=Math.max(s.ya,W.getActiveUniformBlockName(s,l).length+1);K[f>>2]=s.ya;}else K[f>>2]=W.getProgramParameter(s,l);else bn||(bn=1281);},glGetString:s=>{var l=Sv[s];if(!l){switch(s){case 7939:l=Gu(Mv().join(" "));break;case 7936:case 7937:case 37445:case 37446:(l=W.getParameter(s))||bn||(bn=1280),l=l?Gu(l):0;break;case 7938:l=Gu(`OpenGL ES 3.0 (${W.getParameter(7938)})`);break;case 35724:l=W.getParameter(35724);var f=l.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);f!==null&&(f[1].length==3&&(f[1]+="0"),l=`OpenGL ES GLSL ES ${f[1]} (${l})`),l=Gu(l);break;default:bn||(bn=1280);}Sv[s]=l;}return l},glGetUniformBlockIndex:(s,l)=>W.getUniformBlockIndex(_i[s],l?re(ce,l):""),glGetUniformLocation:(s,l)=>{if(l=l?re(ce,l):"",s=_i[s]){var f=s,h=f.ma,v=f.wb,S;if(!h)for(f.ma=h={},f.vb={},S=0;S<W.getProgramParameter(f,35718);++S){var k=W.getActiveUniform(f,S),O=k.name;k=k.size;var F=Tv(O);F=0<F?O.slice(0,F):O;var P=f.Wa;for(f.Wa+=k,v[F]=[k,P],O=0;O<k;++O)h[P]=O,f.vb[P++]=F;}if(f=s.ma,h=0,v=l,S=Tv(l),0<S&&(h=parseInt(l.slice(S+1))>>>0,v=l.slice(0,S)),(v=s.wb[v])&&h<v[0]&&(h+=v[1],f[h]=f[h]||W.getUniformLocation(s,l)))return h}else bn||(bn=1281);return -1},glInvalidateFramebuffer:(s,l,f)=>{for(var h=sh[l],v=0;v<l;v++)h[v]=K[f+4*v>>2];W.invalidateFramebuffer(s,h);},glLinkProgram:s=>{s=_i[s],W.linkProgram(s),s.ma=0,s.wb={};},glPixelStorei:(s,l)=>{s==3317?nh=l:s==3314&&(Ev=l),W.pixelStorei(s,l);},glReadPixels:(s,l,f,h,v,S,k)=>{if(W.Oa)W.readPixels(s,l,f,h,v,S,k);else {var O=oh(S);k>>>=31-Math.clz32(O.BYTES_PER_ELEMENT),W.readPixels(s,l,f,h,v,S,O,k);}},glRenderbufferStorageMultisample:(s,l,f,h,v)=>W.renderbufferStorageMultisample(s,l,f,h,v),glScissor:(s,l,f,h)=>W.scissor(s,l,f,h),glShaderSource:(s,l,f,h)=>{for(var v="",S=0;S<l;++S){var k=(k=me[f+4*S>>2])?re(ce,k,h?me[h+4*S>>2]:void 0):"";v+=k;}W.shaderSource(wa[s],v);},glStencilFunc:(s,l,f)=>W.stencilFunc(s,l,f),glStencilFuncSeparate:(s,l,f,h)=>W.stencilFuncSeparate(s,l,f,h),glStencilMask:s=>W.stencilMask(s),glStencilOp:(s,l,f)=>W.stencilOp(s,l,f),glStencilOpSeparate:(s,l,f,h)=>W.stencilOpSeparate(s,l,f,h),glTexParameteri:(s,l,f)=>W.texParameteri(s,l,f),glTexStorage2D:(s,l,f,h,v)=>W.texStorage2D(s,l,f,h,v),glTexStorage3D:(s,l,f,h,v,S)=>W.texStorage3D(s,l,f,h,v,S),glTexSubImage2D:(s,l,f,h,v,S,k,O,F)=>{if(W.ra)W.texSubImage2D(s,l,f,h,v,S,k,O,F);else if(F){var P=oh(O);W.texSubImage2D(s,l,f,h,v,S,k,O,P,F>>>31-Math.clz32(P.BYTES_PER_ELEMENT));}else {if(F){P=oh(O);var $=S*((Ev||v)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[k-6402]||1)*P.BYTES_PER_ELEMENT+nh-1&-nh);F=P.subarray(F>>>31-Math.clz32(P.BYTES_PER_ELEMENT),F+$>>>31-Math.clz32(P.BYTES_PER_ELEMENT));}else F=null;W.texSubImage2D(s,l,f,h,v,S,k,O,F);}},glUniform1i:(s,l)=>{var f=W,h=f.uniform1i,v=W.Ib;if(v){var S=v.ma[s];typeof S=="number"&&(v.ma[s]=S=W.getUniformLocation(v,v.vb[s]+(0<S?`[${S}]`:""))),s=S;}else bn||(bn=1282),s=void 0;h.call(f,s,l);},glUniformBlockBinding:(s,l,f)=>{s=_i[s],W.uniformBlockBinding(s,l,f);},glUseProgram:s=>{s=_i[s],W.useProgram(s),W.Ib=s;},glVertexAttribDivisor:(s,l)=>{W.vertexAttribDivisor(s,l);},glVertexAttribIPointer:(s,l,f,h,v)=>{W.vertexAttribIPointer(s,l,f,h,v);},glVertexAttribPointer:(s,l,f,h,v,S)=>{W.vertexAttribPointer(s,l,f,!!h,v,S);},glViewport:(s,l,f,h)=>W.viewport(s,l,f,h),invoke_vii:Ww,isWindowsBrowser:function(){return -1<navigator.platform.indexOf("Win")},provokingVertexWEBGL:function(s,l){(s=ln[s].F.pb)&&s.provokingVertexWEBGL(l);},strftime:kv,strftime_l:(s,l,f,h)=>kv(s,l,f,h),upload_image:function(s,l){var f=p.images;f&&(l=f.get(l))&&(s=ln[s].F,s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,l),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false));},wasm_start_image_decode:function(s,l,f){l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),createImageBitmap(new Blob([f])).then(function(h){var v=new OffscreenCanvas(h.width,h.height).getContext("2d");v.drawImage(h,0,0),v=v.getImageData(0,0,h.width,h.height);var S=v.data.length,k=p.Cb(S);p.oc.set(v.data,k),p.qc(s,h.width,h.height,k,S);}).catch(function(h){h=h.message||"decode failed";var v=p.Jc(h)+1,S=p.Cb(v);p.Rc(h,S,v),p.rc(s,S),p.pc(S);});}},at=(function(){function s(f){return at=f.exports,Be=at.memory,Dt(),Iu=at.__indirect_function_table,Qe.unshift(at.__wasm_call_ctors),Et--,p.monitorRunDependencies?.(Et),Et==0&&(Lt&&(f=Lt,Lt=null,f())),at}var l={env:Ov,wasi_snapshot_preview1:Ov};if(Et++,p.monitorRunDependencies?.(Et),p.instantiateWasm)try{return p.instantiateWasm(l,s)}catch(f){Ce(`Module.instantiateWasm callback failed with error: ${f}`),C(f);}return Un||(Un=Xe("webgl2_advanced.wasm")?"webgl2_advanced.wasm":p.locateFile?p.locateFile("webgl2_advanced.wasm",H):H+"webgl2_advanced.wasm"),tn(l,function(f){s(f.instance);}).catch(C),{}})(),Zi=s=>(Zi=at.free)(s),ju=s=>(ju=at.malloc)(s);p._setWebImage=(s,l,f)=>(p._setWebImage=at.setWebImage)(s,l,f);var Iv=s=>(Iv=at.__getTypeName)(s);p._wasm_image_decode_complete=(s,l,f,h,v)=>(p._wasm_image_decode_complete=at.wasm_image_decode_complete)(s,l,f,h,v),p._wasm_image_decode_error=(s,l)=>(p._wasm_image_decode_error=at.wasm_image_decode_error)(s,l);var Nv=p._ma_device__on_notification_unlocked=s=>(Nv=p._ma_device__on_notification_unlocked=at.ma_device__on_notification_unlocked)(s);p._ma_malloc_emscripten=(s,l)=>(p._ma_malloc_emscripten=at.ma_malloc_emscripten)(s,l),p._ma_free_emscripten=(s,l)=>(p._ma_free_emscripten=at.ma_free_emscripten)(s,l);var Dv=p._ma_device_process_pcm_frames_capture__webaudio=(s,l,f)=>(Dv=p._ma_device_process_pcm_frames_capture__webaudio=at.ma_device_process_pcm_frames_capture__webaudio)(s,l,f),Lv=p._ma_device_process_pcm_frames_playback__webaudio=(s,l,f)=>(Lv=p._ma_device_process_pcm_frames_playback__webaudio=at.ma_device_process_pcm_frames_playback__webaudio)(s,l,f),Pv=(s,l)=>(Pv=at.setThrew)(s,l),Bv=s=>(Bv=at._emscripten_stack_restore)(s),Uv=()=>(Uv=at.emscripten_stack_get_current)();p.dynCall_iiiji=(s,l,f,h,v,S)=>(p.dynCall_iiiji=at.dynCall_iiiji)(s,l,f,h,v,S),p.dynCall_iij=(s,l,f,h)=>(p.dynCall_iij=at.dynCall_iij)(s,l,f,h),p.dynCall_iiji=(s,l,f,h,v)=>(p.dynCall_iiji=at.dynCall_iiji)(s,l,f,h,v),p.dynCall_jii=(s,l,f)=>(p.dynCall_jii=at.dynCall_jii)(s,l,f),p.dynCall_vijj=(s,l,f,h,v,S)=>(p.dynCall_vijj=at.dynCall_vijj)(s,l,f,h,v,S),p.dynCall_jiji=(s,l,f,h,v)=>(p.dynCall_jiji=at.dynCall_jiji)(s,l,f,h,v),p.dynCall_viijii=(s,l,f,h,v,S,k)=>(p.dynCall_viijii=at.dynCall_viijii)(s,l,f,h,v,S,k),p.dynCall_iiiiij=(s,l,f,h,v,S,k)=>(p.dynCall_iiiiij=at.dynCall_iiiiij)(s,l,f,h,v,S,k),p.dynCall_iiiiijj=(s,l,f,h,v,S,k,O,F)=>(p.dynCall_iiiiijj=at.dynCall_iiiiijj)(s,l,f,h,v,S,k,O,F),p.dynCall_iiiiiijj=(s,l,f,h,v,S,k,O,F,P)=>(p.dynCall_iiiiiijj=at.dynCall_iiiiiijj)(s,l,f,h,v,S,k,O,F,P);function Ww(s,l,f){var h=Uv();try{Sa(s)(l,f);}catch(v){if(Bv(h),v!==v+0)throw v;Pv(1,0);}}var Yu;Lt=function s(){Yu||Fv(),Yu||(Lt=s);};function Fv(){function s(){if(!Yu&&(Yu=true,p.calledRun=true,!fe)){if(p.noFSInit||wu||(wu=true,p.stdin=p.stdin,p.stdout=p.stdout,p.stderr=p.stderr,p.stdin?ga("stdin",p.stdin):Yi("/dev/tty","/dev/stdin"),p.stdout?ga("stdout",null,p.stdout):Yi("/dev/tty","/dev/stdout"),p.stderr?ga("stderr",null,p.stderr):Yi("/dev/tty1","/dev/stderr"),ts("/dev/stdin",0),ts("/dev/stdout",1),ts("/dev/stderr",1)),xi=false,Re(Qe),_(p),p.onRuntimeInitialized&&p.onRuntimeInitialized(),p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;){var l=p.postRun.shift();qt.unshift(l);}Re(qt);}}if(!(0<Et)){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)en();Re(Je),0<Et||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("");},1),s();},1)):s());}}if(p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);0<p.preInit.length;)p.preInit.pop()();return Fv(),A=N,A})})();let d=u;}),(r=>{r.exports=JSON.parse(`{"name":"@rive-app/webgl2","version":"2.38.0","description":"Rive's webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`);}),((r,a,o)=>{o.r(a),o.d(a,{AudioAssetWrapper:()=>y.AudioAssetWrapper,AudioWrapper:()=>y.AudioWrapper,BLANK_URL:()=>g.BLANK_URL,CustomFileAssetLoaderWrapper:()=>y.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>y.FileAssetWrapper,FileFinalizer:()=>y.FileFinalizer,FocusSessionState:()=>d.FocusSessionState,FontAssetWrapper:()=>y.FontAssetWrapper,FontWrapper:()=>y.FontWrapper,ImageAssetWrapper:()=>y.ImageAssetWrapper,ImageWrapper:()=>y.ImageWrapper,KeyboardInteractions:()=>d.KeyboardInteractions,RiveFont:()=>A.RiveFont,createFinalization:()=>y.createFinalization,finalizationRegistry:()=>y.finalizationRegistry,registerTouchInteractions:()=>u.registerTouchInteractions,sanitizeUrl:()=>g.sanitizeUrl});var u=o(7),d=o(8),g=o(9),y=o(10),A=o(11);}),((r,a,o)=>{o.r(a),o.d(a,{registerTouchInteractions:()=>y});var u=void 0,d=function(A,p,_){var C,N=[];if(p)for(var B=0;B<A.length;B++){var M=A[B];N.push({clientX:M.clientX,clientY:M.clientY,identifier:M.identifier});}else {var w=_!==null?(C=Array.from(A).find(function(R){return R.identifier===_}))!==null&&C!==void 0?C:null:A[0];w&&N.push({clientX:w.clientX,clientY:w.clientY,identifier:w.identifier});}return N},g=function(A,p,_,C){var N,B=A;return !((N=B.changedTouches)===null||N===void 0)&&N.length?(!p&&["touchstart","touchmove"].includes(A.type)&&A.preventDefault(),d(B.changedTouches,_,C)):[{clientX:A.clientX,clientY:A.clientY,identifier:0}]},y=function(A){var p=A.canvas,_=A.artboard,C=A.stateMachines,N=C===void 0?[]:C,B=A.renderer,M=A.rive,w=A.fit,R=A.alignment,D=A.isTouchScrollEnabled,G=D===void 0?false:D,ne=A.dispatchPointerExit,U=ne===void 0?true:ne,H=A.enableMultiTouch,ee=H===void 0?false:H,Q=A.layoutScaleFactor,Ee=Q===void 0?1:Q,Ce=A.advanceAndDrain;if(!p||!N.length||!B||!M||!_||typeof window>"u")return null;var Ue=null,Be=false,fe=null,ye=function(X){var K;if(Be&&X instanceof MouseEvent){X.type=="mouseup"&&(Be=false);return}Be=G&&X.type==="touchend"&&Ue==="touchstart",Ue=X.type;var me=X.currentTarget.getBoundingClientRect();if(!ee&&X.type==="touchstart"&&fe===null){var Ie=(K=X.changedTouches)===null||K===void 0?void 0:K[0];Ie&&(fe=Ie.identifier);}var We=g(X,G,ee,ee?null:fe),Dt=M.computeAlignment(w,R,{minX:0,minY:0,maxX:me.width,maxY:me.height},_.bounds,Ee),Je=new M.Mat2D;switch(Dt.invert(Je),We.forEach(function(lt){var Re=lt.clientX,b=lt.clientY;if(!(!Re&&!b)){var c=Re-me.left,m=b-me.top,E=new M.Vec2D(c,m),x=M.mapXY(Je,E),L=x.x(),z=x.y();lt.transformedX=L,lt.transformedY=z,x.delete(),E.delete();}}),Je.delete(),Dt.delete(),X.type){case "mouseout":for(var Qe=function(lt){U?We.forEach(function(Re){lt.pointerExit(Re.transformedX,Re.transformedY,Re.identifier);}):We.forEach(function(Re){lt.pointerMove(Re.transformedX,Re.transformedY,Re.identifier);});},qt=0,en=N;qt<en.length;qt++){var Et=en[qt];Qe(Et);}break;case "touchmove":case "mouseover":case "mousemove":{for(var kn=function(lt){We.forEach(function(Re){lt.pointerMove(Re.transformedX,Re.transformedY,Re.identifier);});},Lt=0,wn=N;Lt<wn.length;Lt++){var Et=wn[Lt];kn(Et);}break}case "touchstart":case "mousedown":{for(var Xe=function(lt){We.forEach(function(Re){lt.pointerDown(Re.transformedX,Re.transformedY,Re.identifier);});},Ne=0,Un=N;Ne<Un.length;Ne++){var Et=Un[Ne];Xe(Et);}Ce(0);break}case "touchend":{for(var Mn=function(lt){We.forEach(function(Re){lt.pointerUp(Re.transformedX,Re.transformedY,Re.identifier),lt.pointerExit(Re.transformedX,Re.transformedY,Re.identifier);});},xn=0,Qt=N;xn<Qt.length;xn++){var Et=Qt[xn];Mn(Et);}Ce(0),!ee&&We.some(function(lt){return lt.identifier===fe})&&(fe=null);break}case "mouseup":{for(var tn=function(lt){We.forEach(function(Re){lt.pointerUp(Re.transformedX,Re.transformedY,Re.identifier);});},It=0,Pt=N;It<Pt.length;It++){var Et=Pt[It];tn(Et);}Ce(0);break}}},ce=function(){fe=null;},j=ye.bind(u);return p.addEventListener("mouseover",j),p.addEventListener("mouseout",j),p.addEventListener("mousemove",j),p.addEventListener("mousedown",j),p.addEventListener("mouseup",j),p.addEventListener("touchmove",j,{passive:G}),p.addEventListener("touchstart",j,{passive:G}),p.addEventListener("touchend",j),p.addEventListener("touchcancel",ce),function(){p.removeEventListener("mouseover",j),p.removeEventListener("mouseout",j),p.removeEventListener("mousemove",j),p.removeEventListener("mousedown",j),p.removeEventListener("mouseup",j),p.removeEventListener("touchmove",j),p.removeEventListener("touchstart",j),p.removeEventListener("touchend",j),p.removeEventListener("touchcancel",ce);}};}),((r,a,o)=>{o.r(a),o.d(a,{FocusSessionState:()=>u,KeyboardInteractions:()=>d});var u;(function(g){g.NotFocused="notFocused",g.EntryPending="entryPending",g.RiveFocused="riveFocused";})(u||(u={}));var d=(function(){function g(y){var A=y.canvas,p=y.stateMachine,_=y.hasFocusNodes,C=this;this.focusSessionState=u.NotFocused,this.onCanvasFocus=function(N){if(C.hasFocusNodes&&!C.mainSm.focusState().hasFocus&&(C.focusSessionState=u.EntryPending,!!C.isKeyboardDrivenFocus())){var B=C.cameFromBeforeCanvas(N.relatedTarget);(B?C.mainSm.focusNext():C.mainSm.focusPrevious())&&(C.focusSessionState=u.RiveFocused);}},this.onCanvasBlur=function(N){C.focusSessionState=u.NotFocused;},this.onKeyDown=function(N){if(C.focusSessionState!==u.NotFocused&&N.code==="Tab"&&C.hasFocusNodes){var B=!N.shiftKey,M=B?C.mainSm.focusNext():C.mainSm.focusPrevious();M?(C.focusSessionState=u.RiveFocused,N.preventDefault()):C.focusSessionState=u.NotFocused;}},this.canvas=A,this.mainSm=p,this.hasFocusNodes=_,A.addEventListener("focus",this.onCanvasFocus),A.addEventListener("blur",this.onCanvasBlur),A.addEventListener("keydown",this.onKeyDown);}return g.prototype.setFocusSessionState=function(y){this.focusSessionState=y;},g.prototype.notifyRiveFocused=function(){this.focusSessionState=u.RiveFocused;},g.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return false}},g.prototype.cameFromBeforeCanvas=function(y){if(!y)return true;var A=this.canvas.compareDocumentPosition(y);return A&Node.DOCUMENT_POSITION_PRECEDING?true:!(A&Node.DOCUMENT_POSITION_FOLLOWING)},g.prototype.cleanup=function(){this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown);},g})();}),((r,a,o)=>{o.r(a),o.d(a,{BLANK_URL:()=>_,sanitizeUrl:()=>B});var u=/^([^\w]*)(javascript|data|vbscript)/im,d=/&#(\w+)(^\w|;)?/g,g=/&(newline|tab);/gi,y=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,A=/^.+(:|&colon;)/gim,p=[".","/"],_="about:blank";function C(M){return p.indexOf(M[0])>-1}function N(M){var w=M.replace(y,"");return w.replace(d,function(R,D){return String.fromCharCode(D)})}function B(M){if(!M)return _;var w=N(M).replace(g,"").replace(y,"").trim();if(!w)return _;if(C(w))return w;var R=w.match(A);if(!R)return w;var D=R[0];return u.test(D)?_:w}}),((r,a,o)=>{o.r(a),o.d(a,{AudioAssetWrapper:()=>M,AudioWrapper:()=>p,CustomFileAssetLoaderWrapper:()=>C,FileAssetWrapper:()=>N,FileFinalizer:()=>d,FontAssetWrapper:()=>w,FontWrapper:()=>_,ImageAssetWrapper:()=>B,ImageWrapper:()=>A,createFinalization:()=>ne,finalizationRegistry:()=>G});var u=(function(){var U=function(H,ee){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,Ee){Q.__proto__=Ee;}||function(Q,Ee){for(var Ce in Ee)Object.prototype.hasOwnProperty.call(Ee,Ce)&&(Q[Ce]=Ee[Ce]);},U(H,ee)};return function(H,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");U(H,ee);function Q(){this.constructor=H;}H.prototype=ee===null?Object.create(ee):(Q.prototype=ee.prototype,new Q);}})(),d=(function(){function U(H){this.selfUnref=false,this._file=H;}return U.prototype.unref=function(){this._file&&this._file.unref();},U})(),g=(function(){function U(H){this._finalizableObject=H;}return U.prototype.unref=function(){this._finalizableObject.unref();},U})(),y=(function(){function U(){this.selfUnref=false;}return U.prototype.unref=function(){},U})(),A=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeImage=ee,Q}return Object.defineProperty(H.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref();},H})(y),p=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeAudio=ee,Q}return Object.defineProperty(H.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref();},H})(y),_=(function(U){u(H,U);function H(ee){var Q=U.call(this)||this;return Q._nativeFont=ee,Q}return Object.defineProperty(H.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref();},H})(y),C=(function(){function U(H,ee){this._assetLoaderCallback=ee,this.assetLoader=new H.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)});}return U.prototype.loadContents=function(H,ee){var Q;if(H.isImage)Q=new B(H);else if(H.isAudio)Q=new M(H);else if(H.isFont)Q=new w(H);else return false;return this._assetLoaderCallback(Q,ee)},U})(),N=(function(){function U(H){this._nativeFileAsset=H;}return U.prototype.decode=function(H){this._nativeFileAsset.decode(H);},Object.defineProperty(U.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:false,configurable:true}),Object.defineProperty(U.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:false,configurable:true}),U})(),B=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setRenderImage=function(ee){this._nativeFileAsset.setRenderImage(ee.nativeImage);},H})(N),M=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setAudioSource=function(ee){this._nativeFileAsset.setAudioSource(ee.nativeAudio);},H})(N),w=(function(U){u(H,U);function H(){return U!==null&&U.apply(this,arguments)||this}return H.prototype.setFont=function(ee){this._nativeFileAsset.setFont(ee.nativeFont);},H})(N),R=(function(){function U(H){}return U.prototype.register=function(H){H.selfUnref=true;},U.prototype.unregister=function(H){},U})(),D=typeof FinalizationRegistry<"u"?FinalizationRegistry:R,G=new D(function(U){U?.unref();}),ne=function(U,H){var ee=new g(H);G.register(U,ee);};}),((r,a,o)=>{o.r(a),o.d(a,{RiveFont:()=>d});var u=o(3),d=(function(){function g(){}return g.setFallbackFontCallback=function(y){g._fallbackFontCallback=y??null,g._wireFallbackProc();},g._fontToPtr=function(y){var A;if(y==null)return null;var p=y.nativeFont,_=(A=p?.ptr)===null||A===void 0?void 0:A.call(p);return _??null},g._getFallbackPtr=function(y,A){return A<0||A>=y.length?null:g._fontToPtr(y[A])},g._wireFallbackProc=function(){u.RuntimeLoader.getInstance(function(y){var A=g._fallbackFontCallback;A?y.setFallbackFontCallback((function(p,_,C){var N=A(p,C);return N?Array.isArray(N)?g._getFallbackPtr(N,_):_===0?g._fontToPtr(N):null:null})):y.setFallbackFontCallback(null);});},g._fallbackFontCallback=null,g})();})],e={};function n(r){var a=e[r];if(a!==void 0)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(r,a)=>{for(var o in a)n.o(a,o)&&!n.o(r,o)&&Object.defineProperty(r,o,{enumerable:true,get:a[o]});},n.o=(r,a)=>Object.prototype.hasOwnProperty.call(r,a),n.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:true});};var i={};return (()=>{n.r(i),n.d(i,{Alignment:()=>N,DataEnum:()=>Je,DataType:()=>We,DrawOptimizationOptions:()=>B,EventType:()=>Q,Fit:()=>C,Layout:()=>M,LoopType:()=>Ee,Rive:()=>Ie,RiveEventType:()=>D,RiveFile:()=>me,RiveFont:()=>o.RiveFont,RuntimeLoader:()=>a.RuntimeLoader,StateMachineInput:()=>R,StateMachineInputType:()=>w,Testing:()=>It,ViewModel:()=>Dt,ViewModelInstance:()=>qt,ViewModelInstanceArtboard:()=>xn,ViewModelInstanceAssetImage:()=>Mn,ViewModelInstanceBoolean:()=>Lt,ViewModelInstanceColor:()=>Un,ViewModelInstanceEnum:()=>Xe,ViewModelInstanceList:()=>Ne,ViewModelInstanceNumber:()=>kn,ViewModelInstanceString:()=>Et,ViewModelInstanceTrigger:()=>wn,ViewModelInstanceValue:()=>en,decodeAudio:()=>Pt,decodeFont:()=>Re,decodeImage:()=>lt});var r=n(1),a=n(3),o=n(6),u=(function(){var b=function(c,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,x){E.__proto__=x;}||function(E,x){for(var L in x)Object.prototype.hasOwnProperty.call(x,L)&&(E[L]=x[L]);},b(c,m)};return function(c,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");b(c,m);function E(){this.constructor=c;}c.prototype=m===null?Object.create(m):(E.prototype=m.prototype,new E);}})(),d=function(){return d=Object.assign||function(b){for(var c,m=1,E=arguments.length;m<E;m++){c=arguments[m];for(var x in c)Object.prototype.hasOwnProperty.call(c,x)&&(b[x]=c[x]);}return b},d.apply(this,arguments)},g=function(b,c,m,E){function x(L){return L instanceof m?L:new m(function(z){z(L);})}return new(m||(m=Promise))(function(L,z){function ae(pe){try{re(E.next(pe));}catch(tt){z(tt);}}function be(pe){try{re(E.throw(pe));}catch(tt){z(tt);}}function re(pe){pe.done?L(pe.value):x(pe.value).then(ae,be);}re((E=E.apply(b,[])).next());})},y=function(b,c){var m={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},E,x,L,z=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return z.next=ae(0),z.throw=ae(1),z.return=ae(2),typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function ae(re){return function(pe){return be([re,pe])}}function be(re){if(E)throw new TypeError("Generator is already executing.");for(;z&&(z=0,re[0]&&(m=0)),m;)try{if(E=1,x&&(L=re[0]&2?x.return:re[0]?x.throw||((L=x.return)&&L.call(x),0):x.next)&&!(L=L.call(x,re[1])).done)return L;switch(x=0,L&&(re=[re[0]&2,L.value]),re[0]){case 0:case 1:L=re;break;case 4:return m.label++,{value:re[1],done:!1};case 5:m.label++,x=re[1],re=[0];continue;case 7:re=m.ops.pop(),m.trys.pop();continue;default:if(L=m.trys,!(L=L.length>0&&L[L.length-1])&&(re[0]===6||re[0]===2)){m=0;continue}if(re[0]===3&&(!L||re[1]>L[0]&&re[1]<L[3])){m.label=re[1];break}if(re[0]===6&&m.label<L[1]){m.label=L[1],L=re;break}if(L&&m.label<L[2]){m.label=L[2],m.ops.push(re);break}L[2]&&m.ops.pop(),m.trys.pop();continue}re=c.call(b,m);}catch(pe){re=[6,pe],x=0;}finally{E=L=0;}if(re[0]&5)throw re[1];return {value:re[0]?re[1]:void 0,done:true}}},A=function(b,c,m){for(var E=0,x=c.length,L;E<x;E++)(L||!(E in c))&&(L||(L=Array.prototype.slice.call(c,0,E)),L[E]=c[E]);return b.concat(L||Array.prototype.slice.call(c))},p=(function(b){u(c,b);function c(){var m=b!==null&&b.apply(this,arguments)||this;return m.isHandledError=true,m}return c})(Error),_=function(b){return b&&b.isHandledError?b.message:"Problem loading file; may be corrupt!"},C;(function(b){b.Cover="cover",b.Contain="contain",b.Fill="fill",b.FitWidth="fitWidth",b.FitHeight="fitHeight",b.None="none",b.ScaleDown="scaleDown",b.Layout="layout";})(C||(C={}));var N;(function(b){b.Center="center",b.TopLeft="topLeft",b.TopCenter="topCenter",b.TopRight="topRight",b.CenterLeft="centerLeft",b.CenterRight="centerRight",b.BottomLeft="bottomLeft",b.BottomCenter="bottomCenter",b.BottomRight="bottomRight";})(N||(N={}));var B;(function(b){b.AlwaysDraw="alwaysDraw",b.DrawOnChanged="drawOnChanged";})(B||(B={}));var M=(function(){function b(c){var m,E,x,L,z,ae,be;this.fit=(m=c?.fit)!==null&&m!==void 0?m:C.Contain,this.alignment=(E=c?.alignment)!==null&&E!==void 0?E:N.Center,this.layoutScaleFactor=(x=c?.layoutScaleFactor)!==null&&x!==void 0?x:1,this.minX=(L=c?.minX)!==null&&L!==void 0?L:0,this.minY=(z=c?.minY)!==null&&z!==void 0?z:0,this.maxX=(ae=c?.maxX)!==null&&ae!==void 0?ae:0,this.maxY=(be=c?.maxY)!==null&&be!==void 0?be:0;}return b.new=function(c){var m=c.fit,E=c.alignment,x=c.minX,L=c.minY,z=c.maxX,ae=c.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new b({fit:m,alignment:E,minX:x,minY:L,maxX:z,maxY:ae})},b.prototype.copyWith=function(c){var m=c.fit,E=c.alignment,x=c.layoutScaleFactor,L=c.minX,z=c.minY,ae=c.maxX,be=c.maxY;return new b({fit:m??this.fit,alignment:E??this.alignment,layoutScaleFactor:x??this.layoutScaleFactor,minX:L??this.minX,minY:z??this.minY,maxX:ae??this.maxX,maxY:be??this.maxY})},b.prototype.runtimeFit=function(c){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var m;return this.fit===C.Cover?m=c.Fit.cover:this.fit===C.Contain?m=c.Fit.contain:this.fit===C.Fill?m=c.Fit.fill:this.fit===C.FitWidth?m=c.Fit.fitWidth:this.fit===C.FitHeight?m=c.Fit.fitHeight:this.fit===C.ScaleDown?m=c.Fit.scaleDown:this.fit===C.Layout?m=c.Fit.layout:m=c.Fit.none,this.cachedRuntimeFit=m,m},b.prototype.runtimeAlignment=function(c){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var m;return this.alignment===N.TopLeft?m=c.Alignment.topLeft:this.alignment===N.TopCenter?m=c.Alignment.topCenter:this.alignment===N.TopRight?m=c.Alignment.topRight:this.alignment===N.CenterLeft?m=c.Alignment.centerLeft:this.alignment===N.CenterRight?m=c.Alignment.centerRight:this.alignment===N.BottomLeft?m=c.Alignment.bottomLeft:this.alignment===N.BottomCenter?m=c.Alignment.bottomCenter:this.alignment===N.BottomRight?m=c.Alignment.bottomRight:m=c.Alignment.center,this.cachedRuntimeAlignment=m,m},b})(),w;(function(b){b[b.Number=56]="Number",b[b.Trigger=58]="Trigger",b[b.Boolean=59]="Boolean";})(w||(w={}));var R=(function(){function b(c,m){this.type=c,this.runtimeInput=m;}return Object.defineProperty(b.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(c){this.runtimeInput.value=c;},enumerable:false,configurable:true}),b.prototype.fire=function(){this.type===w.Trigger&&this.runtimeInput.fire();},b.prototype.delete=function(){this.runtimeInput=null;},b})(),D;(function(b){b[b.General=128]="General",b[b.OpenUrl=131]="OpenUrl";})(D||(D={}));var G=(function(){function b(c){this.isBindableArtboard=false,this.isBindableArtboard=c;}return b})(),ne=(function(b){u(c,b);function c(m,E){var x=b.call(this,false)||this;return x.nativeArtboard=m,x.file=E,x}return c})(G),U=(function(b){u(c,b);function c(m){var E=b.call(this,true)||this;return E.selfUnref=false,E.nativeArtboard=m,E}return Object.defineProperty(c.prototype,"viewModel",{set:function(m){this.nativeViewModel=m.nativeInstance;},enumerable:false,configurable:true}),c.prototype.destroy=function(){var m;this.selfUnref&&(this.nativeArtboard.unref(),(m=this.nativeViewModel)===null||m===void 0||m.unref());},c})(G),H=(function(){function b(c,m,E,x){this.stateMachine=c,this.playing=E,this.artboard=x,this.inputs=[],this.instance=new m.StateMachineInstance(c,x),this.initInputs(m),this.hasFocusNodes=this.instance.hasFocusNodes();}return Object.defineProperty(b.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"statesChanged",{get:function(){for(var c=[],m=0;m<this.instance.stateChangedCount();m++)c.push(this.instance.stateChangedNameByIndex(m));return c},enumerable:false,configurable:true}),b.prototype.advance=function(c){this.instance.advance(c);},b.prototype.advanceAndApply=function(c){this.instance.advanceAndApply(c);},b.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},b.prototype.reportedEventAt=function(c){return this.instance.reportedEventAt(c)},b.prototype.initInputs=function(c){for(var m=0;m<this.instance.inputCount();m++){var E=this.instance.input(m);this.inputs.push(this.mapRuntimeInput(E,c));}},b.prototype.mapRuntimeInput=function(c,m){if(c.type===m.SMIInput.bool)return new R(w.Boolean,c.asBool());if(c.type===m.SMIInput.number)return new R(w.Number,c.asNumber());if(c.type===m.SMIInput.trigger)return new R(w.Trigger,c.asTrigger())},b.prototype.cleanup=function(){this.inputs.forEach(function(c){c.delete();}),this.inputs.length=0,this.instance.delete();},b.prototype.bindViewModelInstance=function(c){c.runtimeInstance!=null&&this.instance.bindViewModelInstance(c.runtimeInstance);},b.prototype.focusState=function(){return this.instance.focusState()},b.prototype.clearFocus=function(){this.instance.clearFocus();},b})(),ee=(function(){function b(c,m,E,x,L){x===void 0&&(x=[]),L===void 0&&(L=[]),this.runtime=c,this.artboard=m,this.eventManager=E,this.animations=x,this.stateMachines=L;}return b.prototype.add=function(c,m,E){if(E===void 0&&(E=true),c=tn(c),c.length===0)this.animations.forEach(function(De){return De.playing=m}),this.stateMachines.forEach(function(De){return De.playing=m});else for(var x=this.animations.map(function(De){return De.name}),L=this.stateMachines.map(function(De){return De.name}),z=0;z<c.length;z++){var ae=x.indexOf(c[z]),be=L.indexOf(c[z]);if(ae>=0||be>=0)ae>=0?this.animations[ae].playing=m:this.stateMachines[be].playing=m;else {var re=this.artboard.animationByName(c[z]);if(re){var pe=new r.Animation(re,this.artboard,this.runtime,m);pe.advance(0),pe.apply(1),this.animations.push(pe);}else {var tt=this.artboard.stateMachineByName(c[z]);if(tt){var Ke=new H(tt,this.runtime,m,this.artboard);this.stateMachines.push(Ke);}}}}return E&&(m?this.eventManager.fire({type:Q.Play,data:this.playing}):this.eventManager.fire({type:Q.Pause,data:this.paused})),m?this.playing:this.paused},b.prototype.initLinearAnimations=function(c,m,E){E===void 0&&(E=false);for(var x=this.animations.map(function(pe){return pe.name}),L=0;L<c.length;L++){var z=x.indexOf(c[L]);if(z>=0)this.animations[z].playing=m;else {var ae=this.artboard.animationByName(c[L]);if(ae){var be=new r.Animation(ae,this.artboard,this.runtime,m);be.advance(0),be.apply(1),this.animations.push(be);}else if(E){var re="State Machine with name ".concat(c[L]," not found");throw new p(re)}else console.error("Animation with name ".concat(c[L]," not found."));}}},b.prototype.initStateMachines=function(c,m){for(var E=this.stateMachines.map(function(be){return be.name}),x=0;x<c.length;x++){var L=E.indexOf(c[x]);if(L>=0)this.stateMachines[L].playing=m;else {var z=this.artboard.stateMachineByName(c[x]);if(z){var ae=new H(z,this.runtime,m,this.artboard);this.stateMachines.push(ae);}else console.warn("State Machine with name ".concat(c[x]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([c[x]],m,true);}}},b.prototype.play=function(c){return this.add(c,true)},b.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(c){c.playing||c.advanceAndApply(0);});},b.prototype.pause=function(c){return this.add(c,false)},b.prototype.scrub=function(c,m){var E=this.animations.filter(function(x){return c.includes(x.name)});return E.forEach(function(x){return x.scrubTo=m}),E.map(function(x){return x.name})},Object.defineProperty(b.prototype,"playing",{get:function(){return this.animations.filter(function(c){return c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"paused",{get:function(){return this.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),b.prototype.stop=function(c){var m=this;c=tn(c);var E=[];if(c.length===0)E=this.animations.map(function(z){return z.name}).concat(this.stateMachines.map(function(z){return z.name})),this.animations.forEach(function(z){return z.cleanup()}),this.stateMachines.forEach(function(z){return z.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else {var x=this.animations.filter(function(z){return c.includes(z.name)});x.forEach(function(z){z.cleanup(),m.animations.splice(m.animations.indexOf(z),1);});var L=this.stateMachines.filter(function(z){return c.includes(z.name)});L.forEach(function(z){z.cleanup(),m.stateMachines.splice(m.stateMachines.indexOf(z),1);}),E=x.map(function(z){return z.name}).concat(L.map(function(z){return z.name}));}return this.eventManager.fire({type:Q.Stop,data:E}),E},Object.defineProperty(b.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(c,m){return c||m.playing},false)||this.stateMachines.reduce(function(c,m){return c||m.playing},false)},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPaused",{get:function(){return !this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:false,configurable:true}),b.prototype.atLeastOne=function(c,m){m===void 0&&(m=true);var E;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([E=this.artboard.animationByIndex(0).name],c,m):this.artboard.stateMachineCount()>0&&this.add([E=this.artboard.stateMachineByIndex(0).name],c,m)),E},b.prototype.handleLooping=function(){for(var c=0,m=this.animations.filter(function(x){return x.playing});c<m.length;c++){var E=m[c];E.loopValue===0&&E.loopCount?(E.loopCount=0,this.stop(E.name)):E.loopValue===1&&E.loopCount?(this.eventManager.fire({type:Q.Loop,data:{animation:E.name,type:Ee.Loop}}),E.loopCount=0):E.loopValue===2&&E.loopCount>1&&(this.eventManager.fire({type:Q.Loop,data:{animation:E.name,type:Ee.PingPong}}),E.loopCount=0);}},b.prototype.handleStateChanges=function(){for(var c=[],m=0,E=this.stateMachines.filter(function(L){return L.playing});m<E.length;m++){var x=E[m];c.push.apply(c,x.statesChanged);}c.length>0&&this.eventManager.fire({type:Q.StateChange,data:c});},b.prototype.handleAdvancing=function(c){this.eventManager.fire({type:Q.Advance,data:c});},b})(),Q;(function(b){b.Load="load",b.LoadError="loaderror",b.Play="play",b.Pause="pause",b.Stop="stop",b.Loop="loop",b.Draw="draw",b.Advance="advance",b.StateChange="statechange",b.RiveEvent="riveevent",b.AudioStatusChange="audiostatuschange";})(Q||(Q={}));var Ee;(function(b){b.OneShot="oneshot",b.Loop="loop",b.PingPong="pingpong";})(Ee||(Ee={}));var Ce=(function(){function b(c){c===void 0&&(c=[]),this.listeners=c;}return b.prototype.getListeners=function(c){return this.listeners.filter(function(m){return m.type===c})},b.prototype.add=function(c){this.listeners.includes(c)||this.listeners.push(c);},b.prototype.remove=function(c){for(var m=0;m<this.listeners.length;m++){var E=this.listeners[m];if(E.type===c.type&&E.callback===c.callback){this.listeners.splice(m,1);break}}},b.prototype.removeAll=function(c){var m=this;c?this.listeners.filter(function(E){return E.type===c}).forEach(function(E){return m.remove(E)}):this.listeners.splice(0,this.listeners.length);},b.prototype.fire=function(c){var m=this.getListeners(c.type);m.forEach(function(E){return E.callback(c)});},b})(),Ue=(function(){function b(c){this.eventManager=c,this.queue=[];}return b.prototype.add=function(c){this.queue.push(c);},b.prototype.process=function(){for(;this.queue.length>0;){var c=this.queue.shift();c?.action&&c.action(),c?.event&&this.eventManager.fire(c.event);}},b})(),Be;(function(b){b[b.AVAILABLE=0]="AVAILABLE",b[b.UNAVAILABLE=1]="UNAVAILABLE";})(Be||(Be={}));var fe=(function(b){u(c,b);function c(){var m=b!==null&&b.apply(this,arguments)||this;return m._started=false,m._enabled=false,m._status=Be.UNAVAILABLE,m}return c.prototype.delay=function(m){return g(this,void 0,void 0,function(){return y(this,function(E){return [2,new Promise(function(x){return setTimeout(x,m)})]})})},c.prototype.timeout=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return [2,new Promise(function(E,x){return setTimeout(x,50)})]})})},c.prototype.reportToListeners=function(){this.fire({type:Q.AudioStatusChange}),this.removeAll();},c.prototype.enableAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return this._enabled||(this._enabled=true,this._status=Be.AVAILABLE,this.reportToListeners()),[2]})})},c.prototype.testAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(E){switch(E.label){case 0:if(!(this._status===Be.UNAVAILABLE&&this._audioContext!==null))return [3,4];E.label=1;case 1:return E.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return E.sent(),this.enableAudio(),[3,4];case 3:return E.sent(),[3,4];case 4:return [2]}})})},c.prototype._establishAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){switch(m.label){case 0:return this._started?[3,5]:(this._started=true,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),m.label=2;case 2:return this._status!==Be.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return m.sent(),[4,this.delay(1e3)];case 4:return m.sent(),[3,2];case 5:return [2]}})})},c.prototype.listenForUserAction=function(){var m=this,E=function(){return g(m,void 0,void 0,function(){return y(this,function(x){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",E,{once:true});},c.prototype.establishAudio=function(){return g(this,void 0,void 0,function(){return y(this,function(m){return this._establishAudio(),[2]})})},Object.defineProperty(c.prototype,"systemVolume",{get:function(){return this._status===Be.UNAVAILABLE?(this.testAudio(),0):1},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"status",{get:function(){return this._status},enumerable:false,configurable:true}),c})(Ce),ye=new fe,ce=(function(){function b(){}return b.prototype.observe=function(){},b.prototype.unobserve=function(){},b.prototype.disconnect=function(){},b})(),j=globalThis.ResizeObserver||ce,X=(function(){function b(){var c=this;this._elementsMap=new Map,this._onObservedEntry=function(m){var E=c._elementsMap.get(m.target);E!==null?E.onResize(m.target.clientWidth==0||m.target.clientHeight==0):c._resizeObserver.unobserve(m.target);},this._onObserved=function(m){m.forEach(c._onObservedEntry);},this._resizeObserver=new j(this._onObserved);}return b.prototype.add=function(c,m){var E={onResize:m,element:c};return this._elementsMap.set(c,E),this._resizeObserver.observe(c),E},b.prototype.remove=function(c){this._resizeObserver.unobserve(c.element),this._elementsMap.delete(c.element);},b})(),K=new X,me=(function(){function b(c){this.enableRiveAssetCDN=true,this.enablePerfMarks=false,this.referenceCount=0,this.destroyed=false,this.selfUnref=false,this.bindableArtboards=[],this.src=c.src,this.buffer=c.buffer,c.assetLoader&&(this.assetLoader=c.assetLoader),this.enableRiveAssetCDN=typeof c.enableRiveAssetCDN=="boolean"?c.enableRiveAssetCDN:true,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this.eventManager=new Ce,c.onLoad&&this.on(Q.Load,c.onLoad),c.onLoadError&&this.on(Q.LoadError,c.onLoadError);}return b.prototype.releaseFile=function(){var c;this.selfUnref&&((c=this.file)===null||c===void 0||c.unref()),this.file=null;},b.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(c){return c.destroy()});},b.prototype.initData=function(){return g(this,void 0,void 0,function(){var c,m,E,x,L,z;return y(this,function(ae){switch(ae.label){case 0:if(!(this.src&&!this.buffer))return [3,4];ae.label=1;case 1:return ae.trys.push([1,3,,4]),c=this,[4,Qt(this.src)];case 2:return c.buffer=ae.sent(),[3,4];case 3:throw m=ae.sent(),m instanceof Error?m:new p(b.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(x=new o.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),E=x.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),L=this,[4,this.runtime.load(new Uint8Array(this.buffer),E,this.enableRiveAssetCDN)]);case 5:return L.file=ae.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),z=new o.FileFinalizer(this.file),o.finalizationRegistry.register(this,z),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:Q.Load,data:this}):this.fireLoadError(b.fileLoadErrorMessage),[2])}})})},b.prototype.loadRiveFileBytes=function(){return g(this,void 0,void 0,function(){var c;return y(this,function(m){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),c=this.src?Qt(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&c.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end");}),[2,c]})})},b.prototype.loadRuntime=function(){return g(this,void 0,void 0,function(){var c;return y(this,function(m){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),c=a.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&c.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end");}),[2,c]})})},b.prototype.init=function(){return g(this,void 0,void 0,function(){var c,m,E,x;return y(this,function(L){switch(L.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(b.missingErrorMessage),[2];L.label=1;case 1:return L.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return c=L.sent(),m=c[0],E=c[1],this.destroyed?[2]:(this.buffer=m,this.runtime=E,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()]);case 3:return L.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return x=L.sent(),this.fireLoadError(x instanceof Error?x.message:b.fileLoadErrorMessage),[3,5];case 5:return [2]}})})},b.prototype.fireLoadError=function(c){throw this.eventManager.fire({type:Q.LoadError,data:c}),new p(c)},b.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},b.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},b.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=true);},b.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},b.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},b.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup();},b.prototype.createBindableArtboard=function(c){if(c!=null){var m=new U(c);return (0, o.createFinalization)(m,m.nativeArtboard),this.bindableArtboards.push(m),m}return null},b.prototype.getArtboard=function(c){var m=this.file.artboardByName(c);if(m!=null)return new ne(m,this)},b.prototype.getBindableArtboard=function(c){var m=this.file.bindableArtboardByName(c);return this.createBindableArtboard(m)},b.prototype.getDefaultBindableArtboard=function(){var c=this.file.bindableArtboardDefault();return this.createBindableArtboard(c)},b.prototype.internalBindableArtboardFromArtboard=function(c){var m=this.file.internalBindableArtboardFromArtboard(c);return this.createBindableArtboard(m)},b.prototype.viewModelByName=function(c){var m=this.file.viewModelByName(c);return m!==null?new Dt(m):null},b.missingErrorMessage="Rive source file or data buffer required",b.fileLoadErrorMessage="The file failed to load",b})(),Ie=(function(){function b(c){var m=this,E,x,L;this.loaded=false,this.destroyed=false,this._observed=null,this.readyForPlaying=false,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=false,this.automaticallyHandleEvents=false,this.dispatchPointerExit=true,this.enableMultiTouch=false,this.enableRiveAssetCDN=true,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=false,this._needsRedraw=false,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._pageVisibilityHandler=null,this._explicitlyStoppedRendering=false,this._viewModelInstance=null,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=false,this._focusOptions={allowFocusInterrupt:false},this.drawOptimization=B.DrawOnChanged,this.enablePerfMarks=false,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=false,this.onCanvasResize=function(z){var ae=m._hasZeroSize!==z;m._hasZeroSize=z,z?(!m._layout.maxX||!m._layout.maxY)&&m.resizeToCanvas():ae&&m.resizeDrawingSurfaceToCanvas();},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=c.canvas,c.canvas.constructor===HTMLCanvasElement&&(this._observed=K.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=c.src,this.buffer=c.buffer,this.riveFile=c.riveFile,this.layout=(E=c.layout)!==null&&E!==void 0?E:new M,this.shouldDisableRiveListeners=!!c.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!c.isTouchScrollEnabled,this.automaticallyHandleEvents=!!c.automaticallyHandleEvents,this.dispatchPointerExit=c.dispatchPointerExit===false?c.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!c.enableMultiTouch,this.drawOptimization=(x=c.drawingOptions)!==null&&x!==void 0?x:this.drawOptimization,this.enableRiveAssetCDN=c.enableRiveAssetCDN===void 0?true:c.enableRiveAssetCDN,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this._focusOptions=(L=c.focusOptions)!==null&&L!==void 0?L:this._focusOptions,this.eventManager=new Ce,c.onLoad&&this.on(Q.Load,c.onLoad),c.onLoadError&&this.on(Q.LoadError,c.onLoadError),c.onPlay&&this.on(Q.Play,c.onPlay),c.onPause&&this.on(Q.Pause,c.onPause),c.onStop&&this.on(Q.Stop,c.onStop),c.onLoop&&this.on(Q.Loop,c.onLoop),c.onStateChange&&this.on(Q.StateChange,c.onStateChange),c.onAdvance&&this.on(Q.Advance,c.onAdvance),c.onload&&!c.onLoad&&this.on(Q.Load,c.onload),c.onloaderror&&!c.onLoadError&&this.on(Q.LoadError,c.onloaderror),c.onplay&&!c.onPlay&&this.on(Q.Play,c.onplay),c.onpause&&!c.onPause&&this.on(Q.Pause,c.onpause),c.onstop&&!c.onStop&&this.on(Q.Stop,c.onstop),c.onloop&&!c.onLoop&&this.on(Q.Loop,c.onloop),c.onstatechange&&!c.onStateChange&&this.on(Q.StateChange,c.onstatechange),c.assetLoader&&(this.assetLoader=c.assetLoader),this.taskQueue=new Ue(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:c.autoplay,autoBind:c.autoBind,animations:c.animations,stateMachines:c.stateMachines,artboard:c.artboard,useOffscreenRenderer:c.useOffscreenRenderer,tabIndex:c.tabIndex});}return Object.defineProperty(b.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:false,configurable:true}),b.new=function(c){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new b(c)},b.prototype.onSystemAudioChanged=function(){this.volume=this._volume;},b.prototype.init=function(c){var m=this,E=c.src,x=c.buffer,L=c.riveFile,z=c.animations,ae=c.stateMachines,be=c.artboard,re=c.autoplay,pe=re===void 0?false:re,tt=c.useOffscreenRenderer,Ke=tt===void 0?false:tt,De=c.autoBind,wt=De===void 0?false:De,Gt=c.tabIndex;if(!this.destroyed){if(this.src=E,this.buffer=x,this.riveFile=L,this._tabIndex=Gt??null,!this.src&&!this.buffer&&!this.riveFile)throw new p(b.missingErrorMessage);var Fe=tn(z),zt=tn(ae);this.loaded=false,this.readyForPlaying=false,a.RuntimeLoader.awaitInstance().then(function(Mt){if(!m.destroyed){m.runtime=Mt,m.removeRiveListeners(),m.deleteRiveRenderer(),m.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(m.renderer=m.runtime.makeRenderer(m.canvas,Ke),!m.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(Tt){throw console.error(Tt),new p("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}m.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),m.canvas.width||m.canvas.height||m.resizeDrawingSurfaceToCanvas(),m.initData(be,Fe,zt,pe,wt).then(function(Tt){if(Tt)return m.setupRiveListeners()}).catch(function(Tt){console.error(Tt);});}}).catch(function(Mt){m.eventManager.fire({type:Q.LoadError,data:Mt.message});});}},b.prototype.setupRiveListeners=function(c){var m=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var E=this.animator.stateMachines.filter(function(pe){return pe.playing}),x=E.filter(function(pe){return m.runtime.hasListeners(pe.instance)}).map(function(pe){return pe.instance}),L=this.isTouchScrollEnabled,z=this.dispatchPointerExit,ae=this.enableMultiTouch;c&&"isTouchScrollEnabled"in c&&(L=c.isTouchScrollEnabled),this.eventCleanup=(0, o.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:x,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:L,dispatchPointerExit:z,enableMultiTouch:ae,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)});var be=E.filter(function(pe){return pe.hasFocusNodes});if(be.length){var re=this.canvas.tabIndex;(re===-1||isNaN(re))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),typeof window<"u"&&(this._keyboardInteractions=new o.KeyboardInteractions({canvas:this.canvas,stateMachine:be[0].instance,hasFocusNodes:true}));}}},b.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null);},b.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions();},b.prototype.initializeAudio=function(){var c=this,m;ye.status==Be.UNAVAILABLE&&(this.file.hasAudio||!((m=this.artboard)===null||m===void 0)&&m.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:Q.AudioStatusChange,callback:function(){return c.onSystemAudioChanged()}},ye.add(this._audioEventListener),ye.establishAudio());},b.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height);},b.prototype.initData=function(c,m,E,x,L){return g(this,void 0,void 0,function(){var z,ae,be,re;return y(this,function(pe){switch(pe.label){case 0:return pe.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(z=new me({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=z,[4,z.init()]);case 1:if(pe.sent(),this.destroyed)return z.destroyIfUnused(),[2,false];pe.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(c,m,E,x,L),this.initArtboardSize(),this.initializeAudio();try{this.loaded=!0,this.eventManager.fire({type:Q.Load,data:(re=this.src)!==null&&re!==void 0?re:"buffer"});}catch(tt){console.error(tt);}return this.animator.advanceIfPaused(),this.readyForPlaying=true,this.taskQueue.process(),this.drawFrame(),[2,true];case 3:return ae=pe.sent(),be=_(ae),this.eventManager.fire({type:Q.LoadError,data:be}),[2,Promise.reject(be)];case 4:return [2]}})})},b.prototype.initArtboard=function(c,m,E,x,L){if(this.file){var z=c?this.file.artboardByName(c):this.file.defaultArtboard();if(!z)throw new p("Invalid artboard name or no default artboard");this.artboard=z,z.volume=this._volume*ye.systemVolume,this.animator=new ee(this.runtime,this.artboard,this.eventManager);var ae;if(m.length>0||E.length>0?(ae=m.concat(E),this.animator.initLinearAnimations(m,x),this.animator.initStateMachines(E,x)):ae=[this.animator.atLeastOne(x,false)],this.taskQueue.add({event:{type:x?Q.Play:Q.Pause,data:ae}}),L){var be=this.file.defaultArtboardViewModel(z);if(be!==null){var re=be.defaultInstance();if(re!==null){var pe=new qt(re,null);(0, o.createFinalization)(pe,pe.runtimeInstance),this.bindViewModelInstance(pe);}}}}},b.prototype.drawFrame=function(){var c,m;!((c=document?.timeline)===null||c===void 0)&&c.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(m=this.runtime)===null||m===void 0||m.resolveAnimationFrame()):this.scheduleRendering();},b.prototype._canvasSizeChanged=function(){var c=false;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,c=true),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,c=true)),c},b.prototype.pollFocusState=function(){if(!this._keyboardInteractions){this._prevHasFocus=false;return}var c=this.animator.stateMachines.find(function(E){return E.playing&&E.hasFocusNodes});if(!c){this._prevHasFocus=false;return}if(this.canvas instanceof HTMLCanvasElement){var m=c.focusState().hasFocus;if(m){this._keyboardInteractions.notifyRiveFocused(),this._prevHasFocus||(this.canvas!==document.activeElement&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=true);return}this._prevHasFocus=false,this._keyboardInteractions.focusSessionState===o.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(o.FocusSessionState.NotFocused);}},b.prototype.advanceAndReportChanges=function(c){for(var m,E=this.animator.animations.filter(function(ve){return ve.playing||ve.needsScrub}).sort(function(ve){return ve.needsScrub?-1:1}),x=0,L=E;x<L.length;x++){var z=L[x];z.advance(c),z.instance.didLoop&&(z.loopCount+=1),z.apply(1);}for(var ae=this.animator.stateMachines.filter(function(ve){return ve.playing}),be=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,re=0,pe=ae;re<pe.length;re++){var tt=pe[re],Ke=tt.reportedEventCount();if(Ke)for(var De=0;De<Ke;De++){var wt=tt.reportedEventAt(De);if(wt)if(wt.type===D.OpenUrl){if(this.eventManager.fire({type:Q.RiveEvent,data:wt}),this.automaticallyHandleEvents){var Gt=document.createElement("a"),Fe=wt,zt=Fe.url,Mt=Fe.target,Tt=(0, o.sanitizeUrl)(zt);zt&&Gt.setAttribute("href",Tt),Mt&&Gt.setAttribute("target",Mt),Tt&&Tt!==o.BLANK_URL&&Gt.click();}}else this.eventManager.fire({type:Q.RiveEvent,data:wt});}be>=0&&performance.mark("rive:sm-advance:start:f".concat(be)),tt.advanceAndApply(c),be>=0&&(performance.mark("rive:sm-advance:end:f".concat(be)),performance.measure("rive:sm-advance:f".concat(be),"rive:sm-advance:start:f".concat(be),"rive:sm-advance:end:f".concat(be)));}this.animator.stateMachines.length==0&&this.artboard.advance(c),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(c),this.pollFocusState(),(m=this._viewModelInstance)===null||m===void 0||m.handleCallbacks();},b.prototype.draw=function(c,m){this.frameRequestId=null;var E=performance.now(),x=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=c),this.renderSecondTimer+=c-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,m?.());var L=(c-this.lastRenderTime)/1e3;this.lastRenderTime=c,this.advanceAndReportChanges(L);var z=this.renderer;this._hasZeroSize||(this.drawOptimization==B.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(z.clear(),z.save(),x>=0&&performance.mark("rive:align-renderer:start:f".concat(x)),this.alignRenderer(),x>=0&&(performance.mark("rive:align-renderer:end:f".concat(x)),performance.measure("rive:align-renderer:f".concat(x),"rive:align-renderer:start:f".concat(x),"rive:align-renderer:end:f".concat(x))),x>=0&&performance.mark("rive:artboard-draw:start:f".concat(x)),this.artboard.draw(z),x>=0&&(performance.mark("rive:artboard-draw:end:f".concat(x)),performance.measure("rive:artboard-draw:f".concat(x),"rive:artboard-draw:start:f".concat(x),"rive:artboard-draw:end:f".concat(x))),z.restore(),x>=0&&performance.mark("rive:renderer-flush:start:f".concat(x)),z.flush(),x>=0&&(performance.mark("rive:renderer-flush:end:f".concat(x)),performance.measure("rive:renderer-flush:f".concat(x),"rive:renderer-flush:start:f".concat(x),"rive:renderer-flush:end:f".concat(x))),this._needsRedraw=false),this.frameCount++;var ae=performance.now();for(this.frameTimes.push(ae),this.durations.push(ae-E);this.frameTimes[0]<=ae-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0);},b.prototype.alignRenderer=function(){var c=this,m=c.renderer,E=c.runtime,x=c._layout,L=c.artboard;m.align(x.runtimeFit(E),x.runtimeAlignment(E),{minX:x.minX,minY:x.minY,maxX:x.maxX,maxY:x.maxY},L.bounds,this._devicePixelRatioUsed*x.layoutScaleFactor);},Object.defineProperty(b.prototype,"fps",{get:function(){return this.durations.length},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(c,m){return c+m},0)/this.durations.length).toFixed(4)},enumerable:false,configurable:true}),b.prototype.cleanup=function(){var c,m;this.destroyed=true,this.stopRendering(),this.cleanupInstances(),this._observed!==null&&K.remove(this._observed),this.removeRiveListeners(),this.file&&((c=this.riveFile)===null||c===void 0||c.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(ye.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=null,this._dataEnums=null;},b.prototype.deleteRiveRenderer=function(){var c;(c=this.renderer)===null||c===void 0||c.delete(),this.renderer=null;},b.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null);},b.prototype.retrieveTextRun=function(c){var m;if(!c){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var E=this.artboard.textRun(c);if(!E){console.warn("Could not access a text run with name '".concat(c,"' in the '").concat((m=this.artboard)===null||m===void 0?void 0:m.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return E},b.prototype.getTextRunValue=function(c){var m=this.retrieveTextRun(c);return m?m.text:void 0},b.prototype.setTextRunValue=function(c,m){var E=this.retrieveTextRun(c);E&&(E.text=m);},b.prototype.play=function(c,m){var E=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return E.play(c,m)}});return}this.animator.play(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering();},b.prototype.pause=function(c){var m=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.pause(c)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(c);},b.prototype.scrub=function(c,m){var E=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return E.scrub(c,m)}});return}this.animator.scrub(c,m||0),this.drawFrame();},b.prototype.stop=function(c){var m=this;if(c=tn(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.stop(c)}});return}this.animator&&this.animator.stop(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions();},b.prototype.reset=function(c){var m,E,x=c?.artboard,L=tn(c?.animations),z=tn(c?.stateMachines),ae=(m=c?.autoplay)!==null&&m!==void 0?m:false,be=(E=c?.autoBind)!==null&&E!==void 0?E:false;this.cleanupInstances(),this.initArtboard(x,L,z,ae,be),this.taskQueue.process();},b.prototype.load=function(c){this.file=null,this.stop(),this.init(c);},Object.defineProperty(b.prototype,"layout",{get:function(){return this._layout},set:function(c){this._layout=c,(!c.maxX||!c.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame();},enumerable:false,configurable:true}),b.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height});},b.prototype.resizeDrawingSurfaceToCanvas=function(c){if(this.canvas instanceof HTMLCanvasElement&&window){var m=this.canvas.getBoundingClientRect(),E=m.width,x=m.height,L=c||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=L,this.canvas.width=L*E,this.canvas.height=L*x,this._needsRedraw=true,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===C.Layout){var z=this._layout.layoutScaleFactor;this.artboard.width=E/z,this.artboard.height=x/z;}}},Object.defineProperty(b.prototype,"source",{get:function(){return this.src},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.animationCount();m++)c.push(this.artboard.animationByIndex(m).name);return c},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.stateMachineCount();m++)c.push(this.artboard.stateMachineByIndex(m).name);return c},enumerable:false,configurable:true}),b.prototype.stateMachineInputs=function(c){if(this.loaded){var m=this.animator.stateMachines.find(function(E){return E.name===c});return m?.inputs}},b.prototype.retrieveInputAtPath=function(c,m){if(!c){console.warn("No input name provided for path '".concat(m,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var E=this.artboard.inputByPath(c,m);if(!E){console.warn("Could not access an input with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E},b.prototype.setBooleanStateAtPath=function(c,m,E){var x=this.retrieveInputAtPath(c,E);x&&(x.type===w.Boolean?x.asBool().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(E,"' is not a boolean")));},b.prototype.setNumberStateAtPath=function(c,m,E){var x=this.retrieveInputAtPath(c,E);x&&(x.type===w.Number?x.asNumber().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(E,"' is not a number")));},b.prototype.fireStateAtPath=function(c,m){var E=this.retrieveInputAtPath(c,m);E&&(E.type===w.Trigger?E.asTrigger().fire():console.warn("Input with name: '".concat(c,"', at path:'").concat(m,"' is not a trigger")));},b.prototype.retrieveTextAtPath=function(c,m){if(!c){console.warn("No text name provided for path '".concat(m,"'"));return}if(!m){console.warn("No path provided for text '".concat(c,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var E=this.artboard.textByPath(c,m);if(!E){console.warn("Could not access text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E},b.prototype.getTextRunValueAtPath=function(c,m){var E=this.retrieveTextAtPath(c,m);if(!E){console.warn("Could not get text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return E.text},b.prototype.setTextRunValueAtPath=function(c,m,E){var x=this.retrieveTextAtPath(c,E);if(!x){console.warn("Could not set text with name: '".concat(c,"', at path:'").concat(E,"'"));return}x.text=m;},Object.defineProperty(b.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"isStopped",{get:function(){var c,m;return (m=(c=this.animator)===null||c===void 0?void 0:c.isStopped)!==null&&m!==void 0?m:true},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:false,configurable:true}),b.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},b.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},b.prototype.unsubscribe=function(c,m){console.warn("This function is deprecated: please use `off()` instead."),this.off(c,m);},b.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},b.prototype.unsubscribeAll=function(c){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(c);},b.prototype.stopRendering=function(){this._explicitlyStoppedRendering=true,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null);},b.prototype.startRendering=function(){this._explicitlyStoppedRendering=false,this.drawFrame();},b.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw));},b.prototype._onPageVisibilityChange=function(){var c,m;document.hidden?(this.frameRequestId!==null&&(!((c=this.runtime)===null||c===void 0)&&c.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((m=this.animator)===null||m===void 0)&&m.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering();},b.prototype.enableFPSCounter=function(c){this.runtime.enableFPSCounter(c);},b.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter();},Object.defineProperty(b.prototype,"contents",{get:function(){if(this.loaded){for(var c={artboards:[]},m=0;m<this.file.artboardCount();m++){for(var E=this.file.artboardByIndex(m),x={name:E.name,animations:[],stateMachines:[]},L=0;L<E.animationCount();L++){var z=E.animationByIndex(L);x.animations.push(z.name);}for(var ae=0;ae<E.stateMachineCount();ae++){for(var be=E.stateMachineByIndex(ae),re=be.name,pe=new this.runtime.StateMachineInstance(be,E),tt=[],Ke=0;Ke<pe.inputCount();Ke++){var De=pe.input(Ke);tt.push({name:De.name,type:De.type});}x.stateMachines.push({name:re,inputs:tt});}c.artboards.push(x);}return c}},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(c){this._volume=c,this.artboard&&(this.artboard.volume=c*ye.systemVolume);},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"artboardWidth",{get:function(){var c;return this.artboard?this.artboard.width:(c=this._artboardWidth)!==null&&c!==void 0?c:0},set:function(c){this._artboardWidth=c,this.artboard&&(this.artboard.width=c);},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"artboardHeight",{get:function(){var c;return this.artboard?this.artboard.height:(c=this._artboardHeight)!==null&&c!==void 0?c:0},set:function(c){this._artboardHeight=c,this.artboard&&(this.artboard.height=c);},enumerable:false,configurable:true}),b.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0);},Object.defineProperty(b.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(c){this._devicePixelRatioUsed=c;},enumerable:false,configurable:true}),b.prototype.bindViewModelInstance=function(c){var m;this.artboard&&!this.destroyed&&c&&c.runtimeInstance&&(c.internalIncrementReferenceCount(),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=c,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(E){return E.bindViewModelInstance(c)}):this.artboard.bindViewModelInstance(c.runtimeInstance));},Object.defineProperty(b.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:false,configurable:true}),b.prototype.viewModelByIndex=function(c){var m=this.file.viewModelByIndex(c);return m!==null?new Dt(m):null},b.prototype.viewModelByName=function(c){var m;return (m=this.riveFile)===null||m===void 0?void 0:m.viewModelByName(c)},b.prototype.enums=function(){if(this._dataEnums===null){var c=this.file.enums();this._dataEnums=c.map(function(m){return new Je(m)});}return this._dataEnums},b.prototype.defaultViewModel=function(){if(this.artboard){var c=this.file.defaultArtboardViewModel(this.artboard);if(c)return new Dt(c)}return null},b.prototype.getArtboard=function(c){var m,E;return (E=(m=this.riveFile)===null||m===void 0?void 0:m.getArtboard(c))!==null&&E!==void 0?E:null},b.prototype.getBindableArtboard=function(c){var m,E;return (E=(m=this.riveFile)===null||m===void 0?void 0:m.getBindableArtboard(c))!==null&&E!==void 0?E:null},b.prototype.getDefaultBindableArtboard=function(){var c,m;return (m=(c=this.riveFile)===null||c===void 0?void 0:c.getDefaultBindableArtboard())!==null&&m!==void 0?m:null},b.prototype.clearFocus=function(){var c=this.animator.stateMachines.filter(function(m){return m.playing&&m.hasFocusNodes});c.forEach(function(m){return m.clearFocus()});},b.missingErrorMessage="Rive source file or data buffer required",b.cleanupErrorMessage="Attempt to use file after calling cleanup.",b})(),We;(function(b){b.none="none",b.string="string",b.number="number",b.boolean="boolean",b.color="color",b.list="list",b.enumType="enumType",b.trigger="trigger",b.viewModel="viewModel",b.integer="integer",b.listIndex="listIndex",b.image="image",b.artboard="artboard";})(We||(We={}));var Dt=(function(){function b(c){this._viewModel=c;}return Object.defineProperty(b.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"name",{get:function(){return this._viewModel.name},enumerable:false,configurable:true}),b.prototype.instanceByIndex=function(c){var m=this._viewModel.instanceByIndex(c);if(m!==null){var E=new qt(m,null);return (0, o.createFinalization)(E,m),E}return null},b.prototype.instanceByName=function(c){var m=this._viewModel.instanceByName(c);if(m!==null){var E=new qt(m,null);return (0, o.createFinalization)(E,m),E}return null},b.prototype.defaultInstance=function(){var c=this._viewModel.defaultInstance();if(c!==null){var m=new qt(c,null);return (0, o.createFinalization)(m,c),m}return null},b.prototype.instance=function(){var c=this._viewModel.instance();if(c!==null){var m=new qt(c,null);return (0, o.createFinalization)(m,c),m}return null},Object.defineProperty(b.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:false,configurable:true}),b})(),Je=(function(){function b(c){this._dataEnum=c;}return Object.defineProperty(b.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:false,configurable:true}),b})(),Qe;(function(b){b.Number="number",b.String="string",b.Boolean="boolean",b.Color="color",b.Trigger="trigger",b.Enum="enum",b.List="list",b.Image="image",b.Artboard="artboard";})(Qe||(Qe={}));var qt=(function(){function b(c,m){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=false,this._runtimeInstance=c,m!==null&&this._parents.push(m);}return Object.defineProperty(b.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),b.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(c){c.handleCallbacks();}),this._propertiesWithCallbacks.forEach(function(c){c.clearChanges();})),this._children.forEach(function(c){return c.handleCallbacks()});},b.prototype.addParent=function(c){this._parents.includes(c)||(this._parents.push(c),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&c.addToViewModelCallbacks(this));},b.prototype.removeParent=function(c){var m=this._parents.indexOf(c);if(m!==-1){var E=this._parents[m];E.removeFromViewModelCallbacks(this),this._parents.splice(m,1);}},b.prototype.addToPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)||(this._propertiesWithCallbacks.push(c),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(E){E.addToViewModelCallbacks(m);}));},b.prototype.removeFromPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(E){return E!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(E){E.removeFromViewModelCallbacks(m);}));},b.prototype.addToViewModelCallbacks=function(c){var m=this;this._children.includes(c)||(this._children.push(c),this._parents.forEach(function(E){E.addToViewModelCallbacks(m);}));},b.prototype.removeFromViewModelCallbacks=function(c){var m=this;this._children.includes(c)&&(this._children=this._children.filter(function(E){return E!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(E){E.removeFromViewModelCallbacks(m);}));},b.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(c){c.clearCallbacks();});},b.prototype.propertyFromPath=function(c,m){var E=c.split("/");return this.propertyFromPathSegments(E,0,m)},b.prototype.viewModelFromPathSegments=function(c,m){var E=this.internalViewModelInstance(c[m]);return E!==null?m==c.length-1?E:E.viewModelFromPathSegments(c,m++):null},b.prototype.propertyFromPathSegments=function(c,m,E){var x,L,z,ae,be,re,pe,tt,Ke,De,wt,Gt,Fe,zt,Mt,Tt,ve,ki;if(m<c.length-1){var Fn=this.internalViewModelInstance(c[m]);return Fn!==null?Fn.propertyFromPathSegments(c,m+1,E):null}var I=null;switch(E){case Qe.Number:if(I=(L=(x=this._runtimeInstance)===null||x===void 0?void 0:x.number(c[m]))!==null&&L!==void 0?L:null,I!==null)return new kn(I,this);break;case Qe.String:if(I=(ae=(z=this._runtimeInstance)===null||z===void 0?void 0:z.string(c[m]))!==null&&ae!==void 0?ae:null,I!==null)return new Et(I,this);break;case Qe.Boolean:if(I=(re=(be=this._runtimeInstance)===null||be===void 0?void 0:be.boolean(c[m]))!==null&&re!==void 0?re:null,I!==null)return new Lt(I,this);break;case Qe.Color:if(I=(tt=(pe=this._runtimeInstance)===null||pe===void 0?void 0:pe.color(c[m]))!==null&&tt!==void 0?tt:null,I!==null)return new Un(I,this);break;case Qe.Trigger:if(I=(De=(Ke=this._runtimeInstance)===null||Ke===void 0?void 0:Ke.trigger(c[m]))!==null&&De!==void 0?De:null,I!==null)return new wn(I,this);break;case Qe.Enum:if(I=(Gt=(wt=this._runtimeInstance)===null||wt===void 0?void 0:wt.enum(c[m]))!==null&&Gt!==void 0?Gt:null,I!==null)return new Xe(I,this);break;case Qe.List:if(I=(zt=(Fe=this._runtimeInstance)===null||Fe===void 0?void 0:Fe.list(c[m]))!==null&&zt!==void 0?zt:null,I!==null)return new Ne(I,this);break;case Qe.Image:if(I=(Tt=(Mt=this._runtimeInstance)===null||Mt===void 0?void 0:Mt.image(c[m]))!==null&&Tt!==void 0?Tt:null,I!==null)return new Mn(I,this);break;case Qe.Artboard:if(I=(ki=(ve=this._runtimeInstance)===null||ve===void 0?void 0:ve.artboard(c[m]))!==null&&ki!==void 0?ki:null,I!==null)return new xn(I,this);break}return null},b.prototype.internalViewModelInstance=function(c){var m;if(this._viewModelInstances.has(c))return this._viewModelInstances.get(c);var E=(m=this._runtimeInstance)===null||m===void 0?void 0:m.viewModel(c);if(E!==null){var x=new b(E,this);return (0, o.createFinalization)(x,E),x.internalIncrementReferenceCount(),this._viewModelInstances.set(c,x),x}return null},b.prototype.number=function(c){var m=this.propertyFromPath(c,Qe.Number);return m},b.prototype.string=function(c){var m=this.propertyFromPath(c,Qe.String);return m},b.prototype.boolean=function(c){var m=this.propertyFromPath(c,Qe.Boolean);return m},b.prototype.color=function(c){var m=this.propertyFromPath(c,Qe.Color);return m},b.prototype.trigger=function(c){var m=this.propertyFromPath(c,Qe.Trigger);return m},b.prototype.enum=function(c){var m=this.propertyFromPath(c,Qe.Enum);return m},b.prototype.list=function(c){var m=this.propertyFromPath(c,Qe.List);return m},b.prototype.image=function(c){var m=this.propertyFromPath(c,Qe.Image);return m},b.prototype.artboard=function(c){var m=this.propertyFromPath(c,Qe.Artboard);return m},b.prototype.viewModel=function(c){var m=c.split("/"),E=m.length>1?this.viewModelFromPathSegments(m.slice(0,m.length-1),0):this;return E!=null?E.internalViewModelInstance(m[m.length-1]):null},b.prototype.internalReplaceViewModel=function(c,m){var E;if(m.runtimeInstance!==null){var x=((E=this._runtimeInstance)===null||E===void 0?void 0:E.replaceViewModel(c,m.runtimeInstance))||false;if(x){m.internalIncrementReferenceCount();var L=this.internalViewModelInstance(c);L!==null&&(L.removeParent(this),this._children.includes(L)&&(this._children=this._children.filter(function(z){return z!==L})),L.cleanup()),this._viewModelInstances.set(c,m),m.addParent(this);}return x}return false},b.prototype.replaceViewModel=function(c,m){var E,x=c.split("/"),L=x.length>1?this.viewModelFromPathSegments(x.slice(0,x.length-1),0):this;return (E=L?.internalReplaceViewModel(x[x.length-1],m))!==null&&E!==void 0?E:false},b.prototype.incrementReferenceCount=function(){var c;this._referenceCount++,(c=this._runtimeInstance)===null||c===void 0||c.incrementReferenceCount();},b.prototype.decrementReferenceCount=function(){var c;this._referenceCount--,(c=this._runtimeInstance)===null||c===void 0||c.decrementReferenceCount();},Object.defineProperty(b.prototype,"properties",{get:function(){var c;return ((c=this._runtimeInstance)===null||c===void 0?void 0:c.getProperties().map(function(m){return d({},m)}))||[]},enumerable:false,configurable:true}),Object.defineProperty(b.prototype,"viewModelName",{get:function(){var c,m;return (m=(c=this._runtimeInstance)===null||c===void 0?void 0:c.getViewModelName())!==null&&m!==void 0?m:""},enumerable:false,configurable:true}),b.prototype.internalIncrementReferenceCount=function(){this._referenceCount++;},b.prototype.cleanup=function(){var c=this,m;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((m=this._runtimeInstance)===null||m===void 0||m.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(L){L.cleanup();}),this._viewModelInstances.clear();var E=A([],this._children);this._children.length=0;var x=A([],this._parents);this._parents.length=0,E.forEach(function(L){L.removeParent(c);}),x.forEach(function(L){L.removeFromViewModelCallbacks(c);});}},b})(),en=(function(){function b(c,m){this.callbacks=[],this._viewModelInstanceValue=c,this._parentViewModel=m;}return b.prototype.on=function(c){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(c)||(this.callbacks.push(c),this._parentViewModel.addToPropertyCallbacks(this));},b.prototype.off=function(c){c?this.callbacks=this.callbacks.filter(function(m){return m!==c}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this);},b.prototype.internalHandleCallback=function(c){},b.prototype.handleCallbacks=function(){var c=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(m){c.internalHandleCallback(m);});},b.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges();},b.prototype.clearCallbacks=function(){this.callbacks.length=0;},Object.defineProperty(b.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:false,configurable:true}),b})(),Et=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),kn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Lt=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),wn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return c.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},c.prototype.internalHandleCallback=function(m){m();},c})(en),Xe=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(m){this._viewModelInstanceValue.valueIndex=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Ne=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:false,configurable:true}),c.prototype.addInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(m.runtimeInstance),m.addParent(this._parentViewModel));},c.prototype.addInstanceAt=function(m,E){return m.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(m.runtimeInstance,E)?(m.addParent(this._parentViewModel),true):false},c.prototype.removeInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(m.runtimeInstance),m.removeParent(this._parentViewModel));},c.prototype.removeInstanceAt=function(m){this._viewModelInstanceValue.removeInstanceAt(m);},c.prototype.instanceAt=function(m){var E=this._viewModelInstanceValue.instanceAt(m);if(E!=null){var x=new qt(E,this._parentViewModel);return (0, o.createFinalization)(x,E),x}return null},c.prototype.swap=function(m,E){this._viewModelInstanceValue.swap(m,E);},c.prototype.internalHandleCallback=function(m){m();},c})(en),Un=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.rgb=function(m,E,x){this._viewModelInstanceValue.rgb(m,E,x);},c.prototype.rgba=function(m,E,x,L){this._viewModelInstanceValue.argb(L,m,E,x);},c.prototype.argb=function(m,E,x,L){this._viewModelInstanceValue.argb(m,E,x,L);},c.prototype.alpha=function(m){this._viewModelInstanceValue.alpha(m);},c.prototype.opacity=function(m){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,m))*255));},c.prototype.internalHandleCallback=function(m){m(this.value);},c})(en),Mn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var E;this._viewModelInstanceValue.value((E=m?.nativeImage)!==null&&E!==void 0?E:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(en),xn=(function(b){u(c,b);function c(m,E){return b.call(this,m,E)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var E,x,L;m.isBindableArtboard?L=m:L=m.file.internalBindableArtboardFromArtboard(m.nativeArtboard),this._viewModelInstanceValue.value((E=L?.nativeArtboard)!==null&&E!==void 0?E:null),L?.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((x=L?.nativeViewModel)!==null&&x!==void 0?x:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(en),Qt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Request(b),[4,fetch(c)];case 1:if(m=x.sent(),!m.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(m.status));return [4,m.arrayBuffer()];case 2:return E=x.sent(),[2,E]}})})},tn=function(b){return typeof b=="string"?[b]:b instanceof Array?b:[]},It={EventManager:Ce,TaskQueueManager:Ue},Pt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeAudio(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.AudioWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})},lt=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeImage(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.ImageWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})},Re=function(b){return g(void 0,void 0,void 0,function(){var c,m,E;return y(this,function(x){switch(x.label){case 0:return c=new Promise(function(L){return a.RuntimeLoader.getInstance(function(z){z.decodeFont(b,L);})}),[4,c];case 1:return m=x.sent(),E=new o.FontWrapper(m),o.finalizationRegistry.register(E,m),[2,E]}})})};})(),i})());});var PE=ri(Sd=>{var pO=Symbol.for("react.transitional.element"),gO=Symbol.for("react.fragment");function LE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r]);}else n=e;return e=n.ref,{$$typeof:pO,type:t,key:i,ref:e!==void 0?e:null,props:n}}Sd.Fragment=gO;Sd.jsx=LE;Sd.jsxs=LE;});var ze=ri((s4,BE)=>{BE.exports=PE();});var lv=ri($t=>{Object.defineProperty($t,"__esModule",{value:true});var ov,se=dn(),Ci=gu();function BO(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Od=BO(se);function JE(t){var e=t||XE(),n=se.useState(e),i=n[0],r=n[1];return se.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var a=function(){r(t||XE());},o=window.matchMedia("screen and (resolution: "+i+"dppx)");return o.hasOwnProperty("addEventListener")?o.addEventListener("change",a):o.addListener(a),function(){o.hasOwnProperty("removeEventListener")?o.removeEventListener("change",a):o.removeListener(a);}}},[i,t]),i}function XE(){return Math.min(Math.max(1,"u">typeof window&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:1),3)}var UO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})();function FO(t,e){var n=0;return function(){for(var i=this,r=arguments.length,a=Array(r),o=0;o<r;o++)a[o]=arguments[o];clearTimeout(n),n=window.setTimeout(function(){return t.apply(i,a)},e);}}var VO=globalThis.ResizeObserver||UO,HO=globalThis.ResizeObserver!==void 0,xd=HO,GO=!xd;function zO(t,e){e===void 0&&(e=true);var n=se.useState({width:0,height:0}),i=n[0],r=n[1];se.useEffect(function(){if("u">typeof window&&e){var o=function(){r({width:window.innerWidth,height:window.innerHeight});};return GO&&(o(),window.addEventListener("resize",o)),function(){return window.removeEventListener("resize",o)}}},[]);var a=se.useRef(new VO(FO(function(o){xd&&r({width:o[o.length-1].contentRect.width,height:o[o.length-1].contentRect.height});},0)));return se.useEffect(function(){var o=a.current;if(!e)return void o.disconnect();var u=t.current;return t.current&&xd&&o.observe(t.current),function(){o.disconnect(),u&&xd&&o.unobserve(u);}},[t,a]),i}var jO={useDevicePixelRatio:true,fitCanvasToArtboardHeight:false,useOffscreenRenderer:true,shouldResizeCanvasToContainer:true};function $E(t){return Object.assign({},jO,t)}function ew(t){var e=t.riveLoaded,n=e!==void 0&&e,i=t.canvasElem,r=t.containerRef,a=t.options,o=t.onCanvasHasResized,u=t.artboardBounds,d=$E(a===void 0?{}:a),g=se.useState({height:0,width:0}),y=g[0],A=y.height,p=y.width,_=g[1],C=se.useState({height:0,width:0}),N=C[0],B=N.height,M=N.width,w=C[1],R=se.useState(true),D=R[0],G=R[1],ne=d.fitCanvasToArtboardHeight,U=d.shouldResizeCanvasToContainer,H=d.useDevicePixelRatio,ee=d.customDevicePixelRatio,Q=zO(r,U),Ee=JE(ee),Ce=u??{},Ue=Ce.maxX,Be=Ce.maxY,fe=se.useCallback(function(){var ye,ce,j,X,K=(ye=(j=r.current)==null?void 0:j.clientWidth)!=null?ye:0,me=(ce=(X=r.current)==null?void 0:X.clientHeight)!=null?ce:0;return ne&&u?{width:K,height:u.maxY/u.maxX*K}:{width:K,height:me}},[r,ne,Ue,Be]);se.useEffect(function(){if(U&&r.current&&n){var ye=fe(),ce=ye.width,j=ye.height,X=false;if(i){var K=ce!==p||j!==A;if(d.fitCanvasToArtboardHeight&&K&&(r.current.style.height=j+"px",X=true),d.useDevicePixelRatio){var me=ce*Ee!==M||j*Ee!==B;if(K||me){var Ie=Ee*ce,We=Ee*j;i.width=Ie,i.height=We,i.style.width=ce+"px",i.style.height=j+"px",w({width:Ie,height:We}),X=true;}}else K&&(i.width=ce,i.height=j,w({width:ce,height:j}),X=true);_({width:ce,height:j});}o&&(D||X)&&o&&o(),D&&G(false);}},[i,r,Q,Ee,fe,D,G,B,M,A,p,o,U,ne,H,n]),se.useEffect(function(){w({width:0,height:0});},[i]);}var YO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})(),WO=globalThis.IntersectionObserver||YO,qO=(function(){function t(){var n=this;this.elementsMap=new Map,this.onObserved=function(i){i.forEach(function(r){var a=n.elementsMap.get(r.target);a&&a(r);});},this.observer=new WO(this.onObserved);}var e=t.prototype;return e.registerCallback=function(n,i){this.observer.observe(n),this.elementsMap.set(n,i);},e.removeCallback=function(n){this.observer.unobserve(n),this.elementsMap.delete(n);},t})(),KE=function(){return ov||(ov=new qO),ov};function QO(){return {observe:se.useCallback(function(t,e){KE().registerCallback(t,e);},[]),unobserve:se.useCallback(function(t){KE().removeCallback(t);},[])}}function _o(){return (_o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function tw(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}function XO(t){var e=t.setContainerRef,n=t.setCanvasRef,i=t.className,r=i===void 0?"":i,a=t.style,o=t.children,u=tw(t,["setContainerRef","setCanvasRef","className","style","children"]),d=_o({width:"100%",height:"100%"},a);return Od.default.createElement("div",_o({ref:e,className:r},!r&&{style:d}),Od.default.createElement("canvas",_o({ref:n,style:{verticalAlign:"top",width:0,height:0}},u),o))}function nw(t,e){e===void 0&&(e={});var n=se.useState(null),i=n[0],r=n[1],a=se.useRef(null),o=se.useRef(null),u=se.useState(null),d=u[0],g=u[1],y=!!t,A=$E(e),p=JE(),_=se.useCallback(function(){if(d){if(d.layout&&d.layout.fit===Ci.Fit.Layout&&i){var G=p*d.layout.layoutScaleFactor;d.devicePixelRatioUsed=p,d.artboardWidth=i?.width/G,d.artboardHeight=i?.height/G;}d.startRendering(),d.resizeToCanvas();}},[d,p]);ew({riveLoaded:!!d,canvasElem:i,containerRef:a,options:A,onCanvasHasResized:_,artboardBounds:d?.bounds});var C=se.useCallback(function(G){G===null&&i&&(i.height=0,i.width=0),r(G);},[]);se.useEffect(function(){if(i&&t){var G,ne=d!=null;if(d==null){var U=A.useOffscreenRenderer,H=t.onRiveReady,ee=tw(t,["onRiveReady"]);G=new Ci.Rive(_o({useOffscreenRenderer:U},ee,{canvas:i})),o.current!=null&&o.current.cleanup(),o.current=G,G.on(Ci.EventType.Load,function(){ne=true,H&&H(G),i?g(G):G.cleanup();});}return function(){ne||G==null||G.cleanup();}}},[i,y,d]);var N=se.useCallback(function(G){a.current=G;},[]),B=QO(),M=B.observe,w=B.unobserve;se.useEffect(function(){var G,ne=false,U=function(){if(i&&ne){var H=i.getBoundingClientRect();H.width>0&&H.height>0&&H.top<(window.innerHeight||document.documentElement.clientHeight)&&H.bottom>0&&H.left<(window.innerWidth||document.documentElement.clientWidth)&&H.right>0&&(d?.startRendering(),ne=false);}};return i&&A.shouldUseIntersectionObserver!==false&&M(i,function(H){H.isIntersecting?d&&d.startRendering():d&&d.stopRendering(),ne=!H.isIntersecting,clearTimeout(G),H.isIntersecting||H.boundingClientRect.width!==0||(G=setTimeout(U,10));}),function(){i&&w(i);}},[M,w,d,i,A.shouldUseIntersectionObserver]),se.useEffect(function(){return function(){d&&(d.cleanup(),g(null));}},[d,i]),se.useEffect(function(){return function(){o.current!=null&&o.current.cleanup();}},[]);var R=t?.animations;se.useEffect(function(){d&&R&&(d.isPlaying?(d.stop(d.animationNames),d.play(R)):d.isPaused&&(d.stop(d.animationNames),d.pause(R)));},[R,d]);var D=se.useCallback(function(G){return Od.default.createElement(XO,_o({setContainerRef:N,setCanvasRef:C},G))},[C,N]);return {canvas:i,container:a.current,setCanvasRef:C,setContainerRef:N,rive:d,RiveComponent:D}}function KO(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}var ZO=function(t){var e=t.src,n=t.artboard,i=t.animations,r=t.stateMachines,a=t.layout,o=t.useOffscreenRenderer,u=t.shouldDisableRiveListeners,d=t.shouldResizeCanvasToContainer,g=t.automaticallyHandleEvents,y=t.children,A=KO(t,["src","artboard","animations","stateMachines","layout","useOffscreenRenderer","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),p=nw({src:e,artboard:n,animations:i,layout:a,stateMachines:r,autoplay:true,shouldDisableRiveListeners:u!==void 0&&u,automaticallyHandleEvents:g!==void 0&&g},{useOffscreenRenderer:o===void 0||o,shouldResizeCanvasToContainer:d===void 0||d}).RiveComponent;return Od.default.createElement(p,A,y)};function JO(t,e,n,i){var r=se.useState(null),a=r[0],o=r[1];return se.useEffect(function(){var u=function(){if(t&&e&&n||o(null),t&&e&&n){var d=t.stateMachineInputs(e);if(d){var g=d.find(function(y){return y.name===n});i!==void 0&&g&&(g.value=i),o(g||null);}}else o(null);};u(),t&&t.on(Ci.EventType.Load,function(){u();});},[t]),a}function $O(t,e){var n=e??{},i=n.name,r=n.useDefault,a=se.useState(null),o=a[0],u=a[1];return se.useEffect(function(){var d=function(){if(!t)return void u(null);u(i!=null?(t.viewModelByName==null?void 0:t.viewModelByName.call(t,i))||null:t.defaultViewModel()||null);};return d(),t&&t.on(Ci.EventType.Load,d),function(){t&&t.off(Ci.EventType.Load,d);}},[t,i,r!==void 0&&r]),o}function eI(t,e){var n=e??{},i=n.name,r=n.useDefault,a=r!==void 0&&r,o=n.useNew,u=o!==void 0&&o,d=n.rive,g=se.useState(null),y=g[0],A=g[1];return se.useEffect(function(){if(!t)return void A(null);var p=null;A(p=i!=null?t.instanceByName(i)||null:a?(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null:u?(t.instance==null?void 0:t.instance.call(t))||null:(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null),d&&p&&d.viewModelInstance!==p&&d.bindViewModelInstance(p);},[t,i,a,u,d]),y}function iw(){return (iw=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function Sr(t,e,n){var i=se.useState(null),r=i[0],a=i[1],o=se.useState(n.defaultValue),u=o[0],d=o[1],g=se.useState(null),y=g[0],A=g[1],p=se.useRef(null),_=se.useRef(t),C=se.useRef(n);se.useEffect(function(){C.current=n;},[n]);var N=se.useCallback(function(){var R=p.current,D=_.current,G=C.current;if(!R||!D)return a(null),d(G.defaultValue),A(null),function(){};var ne=G.getProperty(R,D);if(ne){a(ne),d(G.getValue(ne)),G.getExtendedData&&A(G.getExtendedData(ne));var U=function(){d(G.getValue(ne)),G.getExtendedData&&A(G.getExtendedData(ne)),G.onPropertyEvent&&G.onPropertyEvent();};return ne.on(U),function(){ne.off(U);}}return function(){}},[]);se.useEffect(function(){return p.current=e,_.current=t,N()},[e,t,N]);var B=se.useCallback(function(R){if(r&&p.current===e)try{R(r),C.current.getExtendedData&&A(C.current.getExtendedData(r));return}catch{}if(p.current)try{var D=C.current.getProperty(p.current,_.current);D&&(a(D),R(D),C.current.getExtendedData&&A(C.current.getExtendedData(D)));}catch{}},[r,e]),M=se.useMemo(function(){return C.current.buildPropertyOperations(B)},[B]),w=iw({value:u},M);return n.getExtendedData&&(w.extendedData=y),w}function tI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.number(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function nI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.string(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function iI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.boolean(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function rI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.color(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});},setRgb:function(r,a,o){i(function(u){u.rgb(r,a,o);});},setRgba:function(r,a,o,u){i(function(d){d.rgba(r,a,o,u);});},setAlpha:function(r){i(function(a){a.alpha(r);});},setOpacity:function(r){i(function(a){a.opacity(r);});}}},[])});return {value:n.value,setValue:n.setValue,setRgb:n.setRgb,setRgba:n.setRgba,setAlpha:n.setAlpha,setOpacity:n.setOpacity}}function aI(t,e){var n=Sr(t,e,{getProperty:se.useCallback(function(i,r){return i.enum(r)},[]),getValue:se.useCallback(function(i){return i.value},[]),defaultValue:null,getExtendedData:se.useCallback(function(i){return i.values},[]),buildPropertyOperations:se.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,values:n.extendedData||[],setValue:n.setValue}}function sI(t,e,n){var i=(n??{}).onTrigger;return {trigger:Sr(t,e,{getProperty:se.useCallback(function(r,a){return r.trigger(a)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:i,buildPropertyOperations:se.useCallback(function(r){return {trigger:function(){r(function(a){a.trigger();});}}},[])}).trigger}}function oI(t,e){return {setValue:Sr(t,e,{getProperty:se.useCallback(function(n,i){return n.image(i)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}function lI(t,e){var n,i=se.useState(0)[1],r=Sr(t,e,{getProperty:se.useCallback(function(a,o){return a.list(o)},[]),getValue:se.useCallback(function(a){return a.length},[]),defaultValue:null,onPropertyEvent:function(){i(function(a){return a+1});},buildPropertyOperations:se.useCallback(function(a){return {addInstance:function(o){a(function(u){return u.addInstance(o)});},addInstanceAt:function(o,u){var d=false;return a(function(g){d=g.addInstanceAt(o,u);}),d},removeInstance:function(o){a(function(u){return u.removeInstance(o)});},removeInstanceAt:function(o){a(function(u){return u.removeInstanceAt(o)});},getInstanceAt:function(o){var u=null;return a(function(d){u=d.instanceAt(o);}),u},swap:function(o,u){a(function(d){return d.swap(o,u)});}}},[])});return {length:(n=r.value)!=null?n:0,addInstance:r.addInstance,addInstanceAt:r.addInstanceAt,removeInstance:r.removeInstance,removeInstanceAt:r.removeInstanceAt,getInstanceAt:r.getInstanceAt,swap:r.swap}}function ZE(t,e,n,i,r,a,o){try{var u=t[a](o),d=u.value;}catch(g){n(g);return}u.done?e(d):Promise.resolve(d).then(i,r);}function uI(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function o(d){ZE(a,i,r,o,u,"next",d);}function u(d){ZE(a,i,r,o,u,"throw",d);}o(void 0);})}}function cI(t,e){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:d(0)}),u(o,"throw",{value:d(1)}),u(o,"return",{value:d(2)}),typeof Symbol=="function"&&u(o,Symbol.iterator,{value:function(){return this}}),o;function d(g){return function(y){var A=[g,y];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,A[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&A[0]?i.return:A[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,A[1])).done)return r;switch(i=0,r&&(A=[2&A[0],r.value]),A[0]){case 0:case 1:r=A;break;case 4:return a.label++,{value:A[1],done:!1};case 5:a.label++,i=A[1],A=[0];continue;case 7:A=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(A[0]===6||A[0]===2)){a=0;continue}if(A[0]===3&&(!r||A[1]>r[0]&&A[1]<r[3])){a.label=A[1];break}if(A[0]===6&&a.label<r[1]){a.label=r[1],r=A;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(A);break}r[2]&&a.ops.pop(),a.trys.pop();continue}A=e.call(t,a);}catch(p){A=[6,p],i=0;}finally{n=r=0;}if(5&A[0])throw A[1];return {value:A[0]?A[1]:void 0,done:true}}}}function fI(t){var e=se.useState(null),n=e[0],i=e[1],r=se.useState("idle"),a=r[0],o=r[1];return se.useEffect(function(){var u=null;return uI(function(){return cI(this,function(d){try{o("loading"),(u=new Ci.RiveFile(t)).init(),u.on(Ci.EventType.Load,function(){u?.getInstance(),i(u),o("success");}),u.on(Ci.EventType.LoadError,function(){o("failed");}),i(u);}catch(g){console.error(g),o("failed");}return [2]})})(),function(){u?.cleanup();}},[t.src,t.buffer]),{riveFile:n,status:a}}function dI(t,e){return {setValue:Sr(t,e,{getProperty:se.useCallback(function(n,i){return n.artboard(i)},[]),getValue:se.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:se.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}$t.default=ZO,$t.useResizeCanvas=ew,$t.useRive=nw,$t.useRiveFile=fI,$t.useStateMachineInput=JO,$t.useViewModel=$O,$t.useViewModelInstance=eI,$t.useViewModelInstanceArtboard=dI,$t.useViewModelInstanceBoolean=iI,$t.useViewModelInstanceColor=rI,$t.useViewModelInstanceEnum=aI,$t.useViewModelInstanceImage=oI,$t.useViewModelInstanceList=lI,$t.useViewModelInstanceNumber=tI,$t.useViewModelInstanceString=nI,$t.useViewModelInstanceTrigger=sI,Object.keys(Ci).forEach(function(t){t==="default"||$t.hasOwnProperty(t)||Object.defineProperty($t,t,{enumerable:true,get:function(){return Ci[t]}});});});var Hw=Se(O_());var Mo=Se(dn());var Ed=Se(dn());var q=Se(dn());var Ef="33d964ca31c2dcf0c6ef3bfe4204c140829a7400bc73242e39b6b121fa174ce0";var wf="api.avatarfactory.in",Kp=()=>`wss://${wf}`,Fl=()=>`https://${wf}`,I_=()=>`https://${wf}/v1/vad/weights-${Ef}.bin`,Zp=(t,e)=>`https://${wf}/v1/assets/${t}.${e}`;var Vl=class Vl{static setLogLevel(e){this.level=e;}static sanitize(e){return e.map(n=>{if(n&&typeof n=="object"){let i={...n};for(let r of Vl.SENSITIVE_FIELDS)r in i&&(i[r]="[REDACTED]");return i}return n})}static format(e,n,i){return `[${new Date().toISOString()}] [${e}] [${n}] ${i}`}static muted(e){return this.level>e&&!this.onLog}static debug(e,n,...i){if(this.muted(0))return;let r=this.sanitize(i);this.onLog?.(0,e,n,...r),this.level<=0&&console.debug(this.format("DEBUG",e,n),...r);}static info(e,n,...i){if(this.muted(1))return;let r=this.sanitize(i);this.onLog?.(1,e,n,...r),this.level<=1&&console.info(this.format("INFO",e,n),...r);}static warn(e,n,...i){if(this.muted(2))return;let r=this.sanitize(i);this.onLog?.(2,e,n,...r),this.level<=2&&console.warn(this.format("WARN",e,n),...r);}static error(e,n,...i){if(this.muted(3))return;let r=this.sanitize(i);this.onLog?.(3,e,n,...r),this.level<=3&&console.error(this.format("ERROR",e,n),...r);}static event(e,n,...i){this.info(`Event:${e}`,n,...i);}};Vl.level=4,Vl.SENSITIVE_FIELDS=["apiKey","sessionToken","getSessionToken","byok"];var T=Vl;var Jp=new Map;function Hl(t,e,n){let i=Jp.get(t.sha256);if(i)return i;let r=jC(t,e,n).catch(a=>{throw Jp.delete(t.sha256),a});return Jp.set(t.sha256,r),r}async function jC(t,e,n){let i=await YC(t.sha256,n);if(i&&await N_(i,t))return i;let r=await fetch(e,{priority:"low"});if(!r.ok)throw new Error(`asset ${t.sha256} HTTP ${r.status}`);let a=new Uint8Array(await r.arrayBuffer());if(!await N_(a,t))throw new Error(`asset ${t.sha256} failed integrity check (${a.byteLength}B)`);return n?.write(t.sha256,a)?.catch(o=>{T.warn("Assets","failed to cache asset",{sha256:t.sha256,cause:o});}),a}async function YC(t,e){try{return await e?.read(t)??null}catch(n){return T.warn("Assets","asset cache read failed",{sha256:t,cause:n}),null}}async function N_(t,e){if(t.byteLength!==e.byteLength)return false;let n=globalThis.crypto?.subtle;if(!n)return T.warn("Assets","no SubtleCrypto \u2014 asset checked by length only"),true;let i=await n.digest("SHA-256",t);return WC(new Uint8Array(i))===e.sha256}function WC(t){let e="";for(let n=0;n<t.length;n++)e+=t[n].toString(16).padStart(2,"0");return e}function D_(t,e){return Hl({sha256:Ef,byteLength:590012},t,e&&{read:n=>e.getCachedVadWeights?.(n),write:(n,i)=>e.setCachedVadWeights?.(n,i)})}var $p={A:2,E:4,I:6,O:8,U:7,Y:6,P:21,B:21,M:21,F:18,V:18,T:19,D:19,N:19,S:15,Z:15,L:14,R:13,K:20,C:20,G:20,Q:20,H:12,W:7,J:16,X:15," ":0,".":0,",":0,"!":0,"?":0,":":0,";":0,"-":0,"(":0,")":0,'"':0,"'":0,DEFAULT:0},Mf={TH:19,SH:16,CH:16,PH:18,GH:0,CK:20,NG:20,AI:4,AU:8,EA:6,EE:6,IE:6,OA:8,OO:7,OU:8,OW:8,UE:7,ER:5,IR:5,UR:5,AR:2,OR:8};var eg=400,L_=4e3,oa={loop:true,volume:.4,fadeOutMs:350},P_=15e3,tg=500,B_=4010,U_=4011,F_=6e3,V_=1500,H_=[1e3,2e3,4e3,8e3,15e3],G_={echoCancellation:false,noiseSuppression:false,autoGainControl:false,channelCount:1},ng=350,ig=-9999,rg=9999,Ui=Number.NEGATIVE_INFINITY,Gl=.28,Tf=1,ag=.15,sg=2.5,Cf=1,og=.2,lg=2,Rf=1,ug=.25,cg=1.6,kf=60,fg=.1,dg=200,xf=40,hg=0,mg=100,pg=12e3,gg=1e3,Of=0,If=250,z_=3,j_=10,vg=2500;var Ag=1e3,zl=.25,Nf=.25,Df=.01,Y_=200,W_=250,q_=12e4,Q_=12e3;var Lf=t=>{if(!Array.isArray(t))return null;let e=[];for(let n of t){let{visemeId:i,start:r,end:a}=n??{};!Number.isInteger(i)||!Number.isFinite(r)||!Number.isFinite(a)||e.push({char:"",visemeId:i,start:r,end:a});}return e},yg=(t,e)=>{let n=[],i=t[0];for(let a=1;a<t.length;a++){let o=t[a];o.start*1e3-i.start*1e3<=e&&o.char!==" "&&i.char!==" "?i={...i,end:o.end,char:i.char+o.char}:(Mf?.[i.char]&&(i={...i,visemeId:Mf?.[i.char]??0}),n.push(i),i=o);}n.push(i);let r=n.length-1;for(;r>=0&&n[r].visemeId===0;)r--;if(r<n.length-1){let a=n[n.length-1];n[r]={...n[r],end:a.start},n.splice(r+1,n.length-(r+1),{...a,start:n[r].end});}return n},Pf=(t,e=40)=>{if(!t||!Array.isArray(t.character_start_times_seconds))return [];let n=t.characters.map((i,r)=>{let a=t.character_start_times_seconds[r]??0,o=t.character_end_times_seconds[r]??a+.05,u=(i||" ").toUpperCase();return {char:i,start:a,end:o,visemeId:$p[u]??0}});return yg(n,e)},jl=(t,{defaultDurationMs:e=50}={})=>{if(!t)return null;let n=Array.isArray(t.chars)?t.chars:[],i=Array.isArray(t.charStartTimesMs)?t.charStartTimesMs:[],r=Array.isArray(t.charDurationsMs)?t.charDurationsMs:[],a=n.length,o=new Array(a).fill(0),u=new Array(a).fill(e);for(let y=0;y<a;y++){let A=i[y],p=A==null?NaN:Number(A);o[y]=Number.isFinite(p)?p:0;let _=r[y],C=_==null?NaN:Number(_);u[y]=Number.isFinite(C)&&C>=0?C:NaN;}for(let y=0;y<a;y++)Number.isFinite(u[y])||(u[y]=y+1<a&&Number.isFinite(o[y+1])&&o[y+1]>o[y]?o[y+1]-o[y]:e);let d=new Array(a),g=new Array(a);for(let y=0;y<a;y++){let A=o[y]/1e3,p=(o[y]+Math.max(0,u[y]))/1e3;d[y]=Number.isFinite(A)?A:0,g[y]=Number.isFinite(p)?Math.max(d[y],p):d[y]+.001;}return {characters:n,character_start_times_seconds:d,character_end_times_seconds:g}};var bg=["idle","listening","thinking","talking"];var X_=t=>typeof t=="string"&&bg.includes(t),oo=t=>typeof t=="string"&&t.trim()&&t.length<=64?t:null,la=t=>{let e=Number(t);return Number.isFinite(e)&&e>0?Math.min(Math.round(e),6e5):0};function QC(t){if(!t||typeof t!="object")return null;let e=t,n=oo(e.gate),i=oo(e.act),r=i&&Array.isArray(e.acts)?e.acts.filter(a=>Number.isInteger(a)&&a>0&&a<=99):[];return !n&&!i?null:{gate:n,act:i,acts:r,...X_(e.fallback)&&{fallback:e.fallback}}}var XC=["oneShot","loop","pingPong"],KC=/^[^\0\r\n]{1,120}$/;function ZC(t){if(!t||typeof t!="object")return null;let e=t,n=oo(e.gate),i=oo(e.act),r=la(e.windowMaxMs);if(!n||!i||!r)return null;let a=Math.min(la(e.windowMinMs),r),o=[];for(let u of Array.isArray(e.acts)?e.acts:[]){let d=u??{},g=d.id,y=la(d.ms);if(!Number.isInteger(g)||g<1||g>99||!y||o.some(_=>_.id===g))continue;let A=XC.includes(d.loop)?d.loop:"loop",p=typeof d.timeline=="string"&&KC.test(d.timeline)?d.timeline:void 0;o.push({id:g,ms:y,loop:A,...p&&{timeline:p}});}return o.length?{gate:n,act:i,acts:o,windowMinMs:a,windowMaxMs:r}:null}var JC=12,$C=4;function e2(t){let e=(Array.isArray(t)?t:[]).map(oo).filter(n=>!!n);return [...new Set(e)].slice(0,$C)}function t2(t){if(!t||typeof t!="object")return null;let e=t,n=[];for(let i of Array.isArray(e.gestures)?e.gestures:[]){let r=i??{},a=oo(r.trigger),o=la(r.ms);if(!(!a||!o||n.some(u=>u.trigger===a))&&(n.push({trigger:a,ms:o}),n.length===JC))break}return n.length?{gestures:n}:null}function K_(t,e,n,i,r=Math.random){if(!t?.length||n<i)return null;let a=t.filter(u=>u.trigger!==e),o=a.length?a:t;return o[Math.floor(r()*o.length)]}function Bf(t){if(!t||typeof t!="object")return null;let e=t,n=e.branches??{},i={};for(let u of bg){let d=QC(n[u]);d&&(i[u]=d);}let r=ZC(e.idleActs);if(r&&(i.idle={gate:r.gate,act:r.act,acts:r.acts.map(u=>u.id)}),!Object.keys(i).length)return null;let a=t2(e.playful),o=e2(e.idleTriggers);return {version:Number(e.version)||1,branches:i,quietToIdleMs:la(e.quietToIdleMs),idleCycleMs:la(e.idleCycleMs),playfulAfterMs:la(e.playfulAfterMs),playfulRoles:Array.isArray(e.playfulRoles)?e.playfulRoles.filter(X_):[],thinkingMaxMs:la(e.thinkingMaxMs),...r&&{idleActs:r},...a&&{playful:a},...o.length&&{idleTriggers:o}}}var _g=t=>t.trim().replace(/\s+/g," ").slice(0,eg).trimEnd(),n2=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e.toString(16).padStart(8,"0")},Sg=(t,e,n)=>`${t}:${e}:${n2(n)}`;var Yl=t=>t.environment!=="meeting"?t:{...t,autoStart:t.autoStart??true,controls:t.controls??{enabled:false},statusBanner:{enabled:false,...t.statusBanner},thinkingIndicator:{enabled:false,...t.thinkingIndicator},connectTone:t.connectTone??{enabled:false},turnTaking:{echoGate:false,clientBargeIn:false,...t.turnTaking}};var Z_=()=>{if(typeof document>"u")return true;let t=document.permissionsPolicy??document.featurePolicy;return typeof t?.allowsFeature!="function"||t.allowsFeature("microphone")!==false};var Fi=1e3,lo=(t,e,n,i)=>typeof t=="number"&&Number.isFinite(t)?Math.max(e,Math.min(n,t)):i,yr=class{constructor(){this.speed=Tf;this.jawSpeed=Cf;this.openness=Rf;this.holdSec=kf/Fi;this.rest=xf;this.offsetSec=Of/Fi;this.maxStepFrames=z_;}apply(e){e&&(this.speed=lo(e.mouthSpeed,ag,sg,this.speed),this.jawSpeed=lo(e.jawSpeed,og,lg,this.jawSpeed),this.openness=lo(e.mouthOpenness,ug,cg,this.openness),this.holdSec=lo(e.mouthHold,fg,dg,this.holdSec*Fi)/Fi,this.rest=lo(e.mouthRest,hg,mg,this.rest),this.offsetSec=lo(e.offsetMs,-If,If,this.offsetSec*Fi)/Fi);}reset(e){this.speed=Tf,this.jawSpeed=Cf,this.openness=Rf,this.holdSec=kf/Fi,this.rest=xf,this.offsetSec=Of/Fi,this.apply(e);}snapshot(){return {offsetMs:Math.round(this.offsetSec*Fi),mouthSpeed:this.speed,jawSpeed:this.jawSpeed,mouthOpenness:this.openness,mouthHold:Math.round(this.holdSec*Fi),mouthRest:this.rest}}};var Uf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Eg(t){let e="",n=t.length;for(let i=0;i<n;i+=3){let r=t[i],a=i+1<n?t[i+1]:0,o=i+2<n?t[i+2]:0;e+=Uf[r>>2],e+=Uf[(r&3)<<4|a>>4],e+=i+1<n?Uf[(a&15)<<2|o>>6]:"=",e+=i+2<n?Uf[o&63]:"=";}return e}var Wl=t=>t.characters.join("").replace(/\s+/g," ").trim(),Ff=t=>{let{characters:e,character_start_times_seconds:n,character_end_times_seconds:i}=t,r=[],a="",o=0,u=0,d=()=>{a&&(r.push({text:a,start:o,end:u}),a="");};for(let g=0;g<e.length;g++){let y=e[g];if(/\s/.test(y)){d();continue}a||(o=n[g]??0),a+=y,u=i[g]??o;}return d(),r},wg=t=>t.split(/\s+/).filter(Boolean).map(e=>({text:e,start:0,end:0})),Vf=(t,e)=>{let n=0;for(;n<t.words.length&&t.words[n].start<=e;)n++;return n},Mg=(t,e)=>t.words.slice(0,Vf(t,e)).map(n=>n.text).join(" ").trim();var Tg=["hmm","hmmm","mhm","mhmm","mm","mmm","uh","um","umm","uh huh","yeah","yep","ok","okay","right","haan","han","achha","accha","theek hai","theek"];var Hf={mode:"healthy",commitPostPauseMs:680,settleMs:60,circuitBreakerEnabled:true},Cg={mode:"degraded",commitPostPauseMs:100,settleMs:100,circuitBreakerEnabled:false},J_=1200,$_=600,eS=5,tS=3,nS=6e4,iS=400,rS=6e3,aS=.5,sS=80,oS=3,lS=100,uS=2,cS=.6,fS=.8,dS=4,mS=400,pS=40;function xg(t){let e="idle",n=null,i=null,r=0,a=0,o=0,u=0,d="",g=null,y=0,A=0,p=0,_=0,C=0,N=0;function B(){return t.getPolicy?.()??Hf}function M(){return B().circuitBreakerEnabled?{pause:C,threshold:N}:{pause:0,threshold:0}}function w(){return Math.min(.95,(e==="soft_pause"?.3:.5)+M().threshold)}function R(){return d.trim().length>0&&!gS(d)}function D(fe){return g===null||g.motion>=fe}function G(){return g?{speechMotion:g.motion,speechMedianFlux:g.medianFlux,speechModulation:g.modulation}:{}}function ne(){n=null,i=null,r=0,a=0,o=0,u=0,d="",g=null;}function U(){A=0,p=0;}function H(){e="idle",ne(),U(),_=0,C=0,N=0;}function ee(fe){t.onTelemetry?.({voiceOnsetToPauseMs:o-r,outcome:"commit",commitClause:fe,totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:B().mode,...G()}),t.commitInterrupt(),H();}function Q(fe){d.trim().length===0&&u<60?_++:_=0,t.onTelemetry?.({voiceOnsetToPauseMs:o-r,outcome:"resume",totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:B().mode,...G()}),t.resumePlayback(),B().circuitBreakerEnabled&&_>=3&&(C=150,N=.1),a>=100?(A=a,p=fe+500):U(),e="speaking",ne();}function Ee(fe,ye,ce){if(ce!==void 0&&(g=ce),y=ye,!t.isAvatarSpeaking()){e!=="idle"&&Be();return}if(e==="idle"&&(e="speaking",ne()),fe>=w()){if(n===null&&(n=ye),i!==null){let me=ye-i;me>0&&me<=150&&(a+=me,e==="soft_pause"&&ye-o>B().settleMs&&(u+=Math.min(me,30)));}i=ye;}else i!==null&&ye-i>150&&(n=null);if(e==="speaking"){n!==null&&ye-n>=70+M().pause&&(e="soft_pause",r=n,o=ye,t.pausePlayback());return}if(u>=B().commitPostPauseMs&&!R()&&D(.02)){ee("post_pause");return}let K=i!==null&&ye-i<=150;if(K&&ye-r>=1e3&&!R()&&D(.02)){ee("sustained");return}if(!K&&i!==null&&ye-i>=900){Q(ye);return}}function Ce(fe){if(e==="idle"||!fe||t.getActiveScriptTail&&AS(fe,t.getActiveScriptTail()))return;d=d?`${d} ${fe}`:fe;let ye=p>0&&y<=p,ce=a<100;(ce&&ye?A:a)<100||gS(fe)&&(e==="speaking"&&(e="soft_pause",r=n??0,o=0,t.pausePlayback()),ee(ce?"words_late":"words"));}function Ue(){e!=="idle"&&(e==="speaking"&&(e="soft_pause",o=0,t.pausePlayback()),ee("manual"));}function Be(){e==="soft_pause"&&t.resumePlayback(),H();}return {onVadProb:Ee,onPartialTranscript:Ce,manualStop:Ue,abort:Be,reset:Be}}function Gf(t){return t.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function vS(t){return t.replace(/(.)\1+/g,"$1")}var y2=new Set(Tg.filter(t=>!t.includes(" ")).map(vS)),b2=Tg.filter(t=>t.includes(" "));function gS(t){let e=Gf(t);if(!e)return false;for(let i of b2)e=e.replace(new RegExp(`(^| )${i}( |$)`,"g")," ");return e.split(" ").filter(Boolean).some(i=>!y2.has(vS(i)))}function AS(t,e,n=cS){let i=Gf(t).split(" ").filter(Boolean);if(i.length===0)return false;let r=new Set(Gf(e).split(" ").filter(Boolean));if(r.size===0)return false;let a=0;for(let o of i)r.has(o)&&a++;return a/i.length>=n}function yS(t,e){return Gf(t).split(" ").filter(Boolean).length<dS?false:AS(t,e,fS)}var bS=/^[a-z0-9][a-z0-9_.]{0,63}$/;var zf=class{constructor(){this.sentByName=new Map;this.windowStartedAt=0;this.windowCount=0;}validate(e){if(!bS.test(e.name))return {ok:false,reason:"invalid_name",message:`notify() name must be a slug matching ${bS} \u2014 got "${e.name}"`};if(e.say!==void 0&&e.say.length>1e3)return {ok:false,reason:"say_too_long",message:"notify() say is too long (max 1000 chars)"};if(e.data===void 0)return {ok:true};let n;if(typeof e.data=="string")n=e.data;else try{n=JSON.stringify(e.data);}catch{return {ok:false,reason:"data_invalid",message:"notify() data is not serializable"}}return n.length>512?{ok:false,reason:"data_too_long",message:"notify() data is too long (max 512 chars serialized)"}:{ok:true,data:n}}admit(e,n,i){let r=this.sentByName.get(e);return r&&i-r.sentAt<n?{ok:false,reason:"cooldown"}:(i-this.windowStartedAt>=1e4&&(this.windowStartedAt=i,this.windowCount=0),this.windowCount>=5?{ok:false,reason:"rate_limit"}:(this.windowCount+=1,this.sweepExpired(i),this.sentByName.set(e,{sentAt:i,cooldownMs:n}),{ok:true}))}sweepExpired(e){if(!(this.sentByName.size<64))for(let[n,i]of this.sentByName)e-i.sentAt>=i.cooldownMs&&this.sentByName.delete(n);}};var _S=/^[a-z][a-z0-9_]{0,63}$/,SS=/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,_2=new Set(["confirm_action","cancel_action"]),ES=16,wS=8,MS=300,TS=120,CS=20,S2=1e3,E2=250,Ya={unavailable:"that action is not available right now",invalidArgs:"the details did not match what that action needs",failed:"the action failed",timedOut:"it took too long"},w2=new Set(["string","email","phone","date","datetime","number","boolean","enum"]),RS="[]",jf=class{constructor(e){this.transport=e;this.actions=new Map;this.lastSent=RS;this.syncTimer=null;}get size(){return this.actions.size}get(e){return this.actions.get(e)}register(e){let n=T2(e);if(n)return {ok:false,message:`registerAction(): ${n}`};if(!this.actions.has(e.name)&&this.actions.size>=ES)return {ok:false,message:`registerAction(): at most ${ES} actions at once \u2014 "${e.name}" was not added`};let i={declaration:M2(e),handler:e.handler,...e.check&&{check:e.check}};return this.actions.set(e.name,i),this.scheduleSync(),{ok:true,unregister:()=>{this.actions.get(e.name)===i&&(this.actions.delete(e.name),this.scheduleSync());}}}declarations(){return [...this.actions.values()].map(e=>e.declaration).sort((e,n)=>e.name<n.name?-1:e.name>n.name?1:0)}syncNow(){if(this.clearSyncTimer(),!this.transport.canDeclare())return;let e=this.declarations(),n=JSON.stringify(e);n!==this.lastSent&&this.transport.send(e)&&(this.lastSent=n);}resetSession(){this.clearSyncTimer(),this.lastSent=RS;}scheduleSync(){this.clearSyncTimer(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.syncNow();},E2);}clearSyncTimer(){this.syncTimer!==null&&(clearTimeout(this.syncTimer),this.syncTimer=null);}},M2=t=>{let e={};for(let[i,r]of Object.entries(t.params??{}))e[i]={type:r.type,...r.description!==void 0&&{description:r.description},...r.required!==void 0&&{required:r.required},...r.type==="enum"&&{values:[...r.values??[]]},...r.check===true&&{check:true}};let n=t.ui&&{...t.ui.inputs!==void 0&&{inputs:t.ui.inputs==="*"?"*":[...t.ui.inputs]},...t.ui.review!==void 0&&{review:t.ui.review}};return {name:t.name,description:t.description.trim(),params:e,...t.kind==="lookup"&&{kind:"lookup"},...t.undoable===true&&{undoable:true},...n&&{ui:n}}},ua=t=>!!t&&typeof t=="object"&&!Array.isArray(t),T2=t=>{if(!ua(t))return "the action must be an object";let{name:e,description:n,params:i,handler:r}=t;if(typeof e!="string"||!_S.test(e))return `name must match ${_S} \u2014 got "${String(e)}"`;if(_2.has(e))return `"${e}" is reserved`;if(typeof n!="string"||!n.trim())return `"${e}" needs a description`;if(n.length>MS)return `"${e}" description is too long (max ${MS} chars)`;if(typeof r!="function")return `"${e}" needs a handler`;let a=C2(t);if(a)return `"${e}" ${a}`;if(i===void 0)return null;if(!ua(i))return `"${e}" params must be an object`;let o=Object.entries(i);if(o.length>wS)return `"${e}" has too many params (max ${wS})`;for(let[u,d]of o){let g=R2(u,d);if(g)return `"${e}" param "${u}": ${g}`}return null},C2=t=>{let{kind:e,ui:n,check:i,undoable:r}=t,a=ua(t.params)?t.params:{};if(e!==void 0&&e!=="action"&&e!=="lookup")return `kind must be "action" or "lookup" \u2014 got "${String(e)}"`;if(r!==void 0&&typeof r!="boolean")return "undoable must be a boolean";if(e==="lookup"&&r)return "is a lookup, which changes nothing to undo";let o=Object.values(a).some(g=>ua(g)&&g.check===true);if(e==="lookup"&&(o||i!==void 0))return "is a lookup, which cannot check values";if(o&&typeof i!="function")return "marks a param check: true but has no check function";if(i!==void 0&&typeof i!="function")return "check must be a function";if(n===void 0)return null;if(!ua(n))return "ui must be an object";if(n.review!==void 0&&typeof n.review!="boolean")return "ui.review must be a boolean";if(e==="lookup"&&n.review)return "is a lookup, which has no review";let{inputs:u}=n;if(u===void 0||u==="*")return null;if(!Array.isArray(u))return 'ui.inputs must be "*" or a list of params';let d=u.find(g=>!(String(g)in a));return d===void 0?null:`ui.inputs names "${String(d)}", which is not a param`},R2=(t,e)=>{if(!SS.test(t))return `name must match ${SS}`;if(!ua(e))return "must be an object";if(!w2.has(e.type))return `unknown type "${String(e.type)}"`;if(e.description!==void 0&&(typeof e.description!="string"||e.description.length>TS))return `description must be a string of at most ${TS} chars`;if(e.required!==void 0&&typeof e.required!="boolean")return "required must be a boolean";if(e.check!==void 0&&typeof e.check!="boolean")return "check must be a boolean";if(e.type!=="enum")return null;let n=e.values;return Array.isArray(n)&&n.length>0&&n.length<=CS&&n.every(r=>typeof r=="string"&&r.trim())?null:`an enum needs 1\u2013${CS} non-empty string values`},k2=/^\d{4}-\d{2}-\d{2}$/,x2=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/,Og=(t,e)=>{switch(t.type){case "string":case "email":case "phone":return typeof e=="string";case "date":return typeof e=="string"&&k2.test(e);case "datetime":return typeof e=="string"&&x2.test(e);case "number":return typeof e=="number"&&Number.isFinite(e);case "boolean":return typeof e=="boolean";case "enum":return typeof e=="string"&&!!t.values?.includes(e)}},xS=(t,e)=>{if(e!==void 0&&!ua(e))return null;let n=e??{},i={};for(let[r,a]of Object.entries(t.params)){let o=n[r];if(o==null||o===""){if(a.required!==false)return null;continue}if(!Og(a,o))return null;i[r]=o;}return i},kS=t=>String(t).slice(0,S2),OS=t=>ua(t)?t.ok===true?t.result===void 0||t.result===null?{ok:true}:{ok:true,result:kS(t.result)}:t.ok===false?{ok:false,error:(t.error===void 0||t.error===null?"":kS(t.error).trim())||Ya.failed}:null:null;var IS=2500,O2=200,I2=5,ql=t=>!!t&&typeof t=="object"&&!Array.isArray(t),NS=t=>{if(!ql(t))return null;let{actionId:e,revision:n,name:i,stage:r,args:a,missing:o,awaiting:u,outcome:d}=t;return typeof e!="string"||!e||typeof n!="number"||!Number.isFinite(n)||typeof i!="string"||typeof r!="string"?null:{actionId:e,revision:n,name:i,stage:r,args:ql(a)?{...a}:{},missing:Array.isArray(o)?o.filter(g=>typeof g=="string"):[],awaiting:ql(u)&&typeof u.kind=="string"?{...u}:null,...ql(d)&&typeof d.ok=="boolean"&&{outcome:{ok:d.ok,message:typeof d.message=="string"?d.message:""}}}},N2=new Set(["done","cancelled","expired"]),Yf=class{constructor(){this.current=null;}get flow(){return this.current}apply(e){let n=this.current;return n&&n.actionId===e.actionId&&e.revision<=n.revision?false:(this.current=e,true)}get isLive(){return !!this.current&&!N2.has(this.current.stage)}clear(){this.current=null;}},DS=(t,e)=>{let n={};for(let[i,r]of Object.entries(e)){let a=t.params[i];if(!a)return {ok:false,message:`"${t.name}" has no param "${i}"`};if(!Og(a,r))return {ok:false,message:`"${t.name}" param "${i}" must be a ${a.type}`};n[i]=r;}return Object.keys(n).length?{ok:true,args:n}:{ok:false,message:"input needs at least one value"}},LS=async(t,e,n,i)=>{if(!t)return {ok:true,unverified:true};let r,a=Promise.resolve().then(()=>t(e,n,i)).then(D2,()=>null),o=new Promise(d=>{r=setTimeout(()=>d(null),IS);}),u=await Promise.race([a,o]);return clearTimeout(r),u??{ok:true,unverified:true}},D2=t=>{if(!ql(t)||typeof t.ok!="boolean")return null;if(t.ok)return t.value===void 0?{ok:true}:{ok:true,value:t.value};let e=typeof t.reason=="string"?t.reason.slice(0,O2):void 0,n=Array.isArray(t.suggestions)?t.suggestions.slice(0,I2):void 0,i=typeof t.param=="string"&&t.param?t.param:void 0;return {ok:false,...e&&{reason:e},...n?.length&&{suggestions:n},...i&&{param:i}}};var PS=t=>{let e=t.cause?.name;return typeof e=="string"&&e!==""&&e!=="Error"?e:null},L2="embed_unauthorized_domain",P2=/unauthorized domain/i,Ig=(t,e)=>t===L2||typeof e=="string"&&P2.test(e),Ql=class extends Error{constructor(e,n){let i=n??{},r=typeof i.error=="string"?i.error:void 0;super(`config route HTTP ${e}${r?`: ${r}`:""}`),this.name="ConfigRouteError",this.status=e,this.serverCode=typeof i.code=="string"?i.code:void 0,this.serverMessage=r;}},B2=123,BS=t=>`Initialization Failed: ${t.code} (${PS(t)??t.message})`.slice(0,B2);var U2=50,F2=4e3,Wf=class{constructor(e,n=U2){this.onChange=e;this.entries=[];this.activeUserEntryId=null;this.lastFinalText="";this.lastFinalAt=0;this.activeAvatarEntryId=null;this.activeAvatarJobId=null;this.entryCounter=0;this.consumedChunks=0;this.openChars=[];this.openStarts=[];this.openEnds=[];this.maxEntries=Math.max(1,n);}applyUserTranscript({text:e,isFinal:n,turnId:i}){let r=e?.trim()??"";if(!r)return;let a=this.findEntry(this.activeUserEntryId);if(a&&a.turnId!==i&&(this.upsert({...a,isFinal:true}),a=null),a&&a.text===r&&a.isFinal===n||!a&&r===this.lastFinalText&&Date.now()-this.lastFinalAt<F2)return;let o={id:a?.id??this.nextId("user"),speaker:"user",text:r,words:wg(r),isFinal:n,turnId:i,createdAt:a?.createdAt??Date.now()};this.upsert(o),this.activeUserEntryId=n?null:o.id,n&&(this.lastFinalText=r,this.lastFinalAt=Date.now()),this.emit();}applyAvatarSpeech(e){let n=e.alignments??[],i=e.chunkOffset??0,r=i+n.length;if(this.activeAvatarJobId!==e.jobId&&(this.finalizeAvatar(),this.activeAvatarJobId=e.jobId,this.consumedChunks=0),r<=this.consumedChunks)return;this.activeAvatarEntryId||(this.activeAvatarEntryId=this.nextId("avatar"),this.openChars=[],this.openStarts=[],this.openEnds=[]);for(let d=Math.max(0,this.consumedChunks-i);d<n.length;d++){let g=e.displayAlignments?.[d]??n[d];g?.characters?.length&&(this.openChars.push(...g.characters),this.openStarts.push(...g.character_start_times_seconds),this.openEnds.push(...g.character_end_times_seconds));}if(this.consumedChunks=r,!this.openChars.length)return;let a={characters:this.openChars,character_start_times_seconds:this.openStarts,character_end_times_seconds:this.openEnds},o=Wl(a);if(!o)return;let u=this.findEntry(this.activeAvatarEntryId);u?.text!==o&&(this.upsert({id:this.activeAvatarEntryId,speaker:"avatar",text:o,words:Ff(a),isFinal:false,turnId:e.turnId,createdAt:u?.createdAt??Date.now()}),this.emit());}finalizeAvatar(){let e=this.findEntry(this.activeAvatarEntryId);this.activeAvatarEntryId=null,this.openChars=[],this.openStarts=[],this.openEnds=[],!(!e||e.isFinal)&&(this.upsert({...e,isFinal:true}),this.emit());}reset(){let e=this.entries.length>0;this.entries=[],this.activeUserEntryId=null,this.lastFinalText="",this.lastFinalAt=0,this.activeAvatarEntryId=null,this.activeAvatarJobId=null,this.consumedChunks=0,this.openChars=[],this.openStarts=[],this.openEnds=[],e&&this.emit();}getEntries(){return [...this.entries]}upsert(e){let n=this.entries.findIndex(i=>i.id===e.id);if(n>=0){this.entries[n]=e;return}this.entries.push(e),this.entries.length>this.maxEntries&&this.entries.splice(0,this.entries.length-this.maxEntries);}findEntry(e){return e?this.entries.find(n=>n.id===e)??null:null}nextId(e){return `${e}-${++this.entryCounter}`}emit(){this.onChange(this.getEntries());}};var qf=class{constructor(e){this.deps=e;this.held=false;this.open=false;this.preRollToFlush=[];this.recentFrames=[];this.tailTimer=null;this.maxHoldTimer=null;this.silenceByteSize=new Map;}isHeld(){return this.held}isTurnOpen(){return this.open}press(){if(this.held)return false;this.held=true;let e=this.open;return this.clearTailTimer(),this.open=true,e||(this.preRollToFlush=this.recentFrames.map(n=>n.buffer),this.recentFrames=[]),this.maxHoldTimer=setTimeout(()=>{this.maxHoldTimer=null,T.warn("PushToTalk","hold hit its ceiling \u2014 releasing"),this.release();},q_),T.event("ptt","press",{isContinuation:e,preRollFrames:this.preRollToFlush.length}),this.deps.onHeldChange(true),e||this.deps.onTurnStart(),!e}release(){this.held&&(this.held=false,this.clearMaxHoldTimer(),T.event("ptt","release"),this.deps.onHeldChange(false),this.tailTimer=setTimeout(()=>{this.tailTimer=null,this.closeTurn();},W_));}gate(e){if(!this.open)return this.rememberFrame(e),[this.silenceOfSize(e.byteLength)];if(!this.preRollToFlush.length)return [e];let n=this.preRollToFlush;return this.preRollToFlush=[],n.push(e),n}reset(){this.held=false,this.open=false,this.preRollToFlush=[],this.recentFrames=[],this.clearTailTimer(),this.clearMaxHoldTimer();}closeTurn(){this.open&&(this.open=false,this.preRollToFlush=[],this.deps.onTurnEnd());}rememberFrame(e){let n=Date.now();for(this.recentFrames.push({capturedAt:n,buffer:e.slice(0)});this.recentFrames.length&&n-this.recentFrames[0].capturedAt>Y_;)this.recentFrames.shift();}silenceOfSize(e){let n=this.silenceByteSize.get(e);return n||(n=new ArrayBuffer(e),this.silenceByteSize.size>8&&this.silenceByteSize.clear(),this.silenceByteSize.set(e,n)),n}clearTailTimer(){this.tailTimer&&(clearTimeout(this.tailTimer),this.tailTimer=null);}clearMaxHoldTimer(){this.maxHoldTimer&&(clearTimeout(this.maxHoldTimer),this.maxHoldTimer=null);}};var US="server_tick";var Qf=class{constructor(){this.wedge=[];}note(e,n){if(typeof e!="number"||!Number.isFinite(e))return null;let i=n-e;for(;this.wedge.length>0&&this.wedge[this.wedge.length-1].offset>=i;)this.wedge.pop();for(this.wedge.push({offset:i,at:n});this.wedge.length>0&&n-this.wedge[0].at>6e4;)this.wedge.shift();let r=i-this.wedge[0].offset;return r<25?0:r}minOffset(){return this.wedge.length>0?this.wedge[0].offset:null}hasSamples(){return this.wedge.length>0}reset(){this.wedge=[];}};var Xf=class{constructor(e){this.opts=e;this.timer=null;this.lastProbeAt=0;this.lastMessageAt=0;this.loopLagPeak=0;this.ticksSeen=false;this.suspended=false;this.degraded=false;this.degradedAt=0;this.cleanSince=null;this.lastSeq=null;this.seqAtGap=null;this.resumeAt=null;this.resumeSeqJump=null;this.resumeCount=0;}begin(e=Date.now()){this.lastProbeAt=e,this.lastMessageAt=e;}start(e=Date.now()){this.timer||(this.begin(e),this.timer=setInterval(()=>this.tick(Date.now()),100));}stop(){this.timer&&clearInterval(this.timer),this.timer=null;}noteMessage(e,n,i=false){let r=this.expired(n)||this.degraded;this.lastMessageAt=n,this.loopLagPeak=0,this.suspended=false,i&&(this.ticksSeen=true);let a=typeof e=="number"&&Number.isFinite(e)?e:null;r&&this.resumeAt===null&&(this.resumeAt=n,this.seqAtGap=this.lastSeq),this.resumeAt!==null&&n-this.resumeAt<=300&&(this.resumeCount++,a!==null&&this.seqAtGap!==null&&(this.resumeSeqJump=a-this.seqAtGap)),a!==null&&(this.lastSeq=a),this.degraded&&this.cleanSince===null&&(this.cleanSince=n);}reset(){this.stop(),this.lastMessageAt=0,this.loopLagPeak=0,this.ticksSeen=false,this.suspended=false,this.degraded=false,this.degradedAt=0,this.cleanSince=null,this.lastSeq=null,this.seqAtGap=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}tick(e){let n=Math.max(0,e-this.lastProbeAt-100);if(this.lastProbeAt=e,n>this.loopLagPeak&&(this.loopLagPeak=n),this.degraded){this.evaluateRecovery(e);return}let i=this.currentGap(e);i!==null&&(this.degraded=true,this.degradedAt=e,this.cleanSince=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0,this.opts.onVerdict({state:"degraded",scope:this.loopLagPeak>=this.opts.loopLagHighMs?"device":"network",gapMs:i,loopLagMs:this.loopLagPeak}));}currentGap(e,n=1e3){if(!this.ticksSeen||this.suspended)return null;let i=e-this.lastMessageAt;return i>=n?i:null}evaluateRecovery(e){if(e-this.degradedAt>6e4){this.suspended=true,this.clear(e);return}if(this.currentGap(e,700)!==null){this.cleanSince=null;return}this.cleanSince!==null&&e-this.cleanSince>=2500&&this.clear(e);}clear(e){this.degraded=false,this.cleanSince=null;let n=this.resumeCount>=4&&this.resumeSeqJump!==null?this.resumeSeqJump:void 0;this.opts.onVerdict({state:"ok",scope:"network",gapMs:e-this.degradedAt,...n!==void 0&&{seqJump:n}}),this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}expired(e){return this.currentGap(e)!==null}};var Xl=class{constructor(){this.listeners={};}on(e,n){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(n),()=>{this.listeners[e].delete(n);}}emit(e,...n){let i=this.listeners[e];if(i)for(let r of i)r(...n);}hasListeners(e){return (this.listeners[e]?.size??0)>0}removeAll(){for(let e in this.listeners)this.listeners[e]?.clear();}};var VS=t=>{let e=[];return t.fieldType&&e.push(t.fieldType),t.filled!==void 0&&e.push(t.filled?"filled":"empty"),t.checked!==void 0&&e.push(t.checked?"checked":"not checked"),t.shows&&e.push(`shows "${t.shows}"`),t.choiceOf&&e.push(`choice in ${t.choiceOf}`),t.options?.length&&e.push(`one of: ${t.options.join(" | ")}`),t.submits&&e.push("submits form"),t.count&&e.push(`${t.count} identical`),t.disabled&&e.push("disabled"),t.sensitive&&e.push("never fillable"),t.path&&e.push(t.path),t.site&&e.push(t.site),t.current&&e.push("this page"),t.children&&e.push(`contains ${t.children.join(" ")}`),e},HS=t=>t.length>0?` [${t.join(", ")}]`:"",Q2=(t,e)=>{let n=e.filter(r=>r.item?.screenPosition).length,i=[`list${t.id} "${t.name}" \u2014 ${t.total} items, ${n} on screen`];for(let r of e){let a=r.item,o=VS(r);a.screenPosition&&o.unshift(`on screen #${a.screenPosition}`);let u=a.detail?` \u2014 ${a.detail}`:"";i.push(` ${a.position}. ${r.handle} ${r.kind} "${r.name}"${u}${HS(o)}`);}return i};function Ng(t){let e=[`On the ${t.pageName} page \u2014 ${t.url} \u2014 "${t.title}"`],n=a=>`${a.handle} ${a.kind} "${a.name}"${HS(VS(a))}`,i=t.lists??[];if(i.length===0){for(let a of t.nodes)e.push(n(a));return e.join(`
17
+ `)}let r=t.nodes.filter(a=>!a.item);for(let a of r)a.kind!=="link"&&e.push(n(a));for(let a of i){let o=t.nodes.filter(u=>u.item?.list===a.id).sort((u,d)=>u.item.position-d.item.position);o.length>0&&e.push(...Q2(a,o));}for(let a of r)a.kind==="link"&&e.push(n(a));return e.join(`
18
+ `)}function GS(t){return t.nodes.map(e=>({h:e.handle,n:e.name,...e.kind==="field"&&e.fieldType&&{t:e.fieldType},...e.sensitive&&{sensitive:true},...e.submits&&{submit:true},...e.item&&{card:{list:e.item.list,position:e.item.position,...e.item.screenPosition&&{screen:e.item.screenPosition},...e.item.detail&&{detail:e.item.detail}}}}))}var zS=t=>{let e=t?.fields;if(!Array.isArray(e))return [];let n=new Map;for(let i of e){if(n.size>=12)break;let{h:r,v:a}=i??{};typeof r!="string"||typeof a!="string"||n.set(r,a.slice(0,2e3));}return [...n].map(([i,r])=>({handle:i,value:r}))},X2={stale:"the page changed since it was read",unknown_target:"it is not on this page",not_fillable:"it is not a box the avatar can type into",sensitive:"passwords and payment details are only theirs to type",disabled:"it is disabled right now",read_only:"it is read-only",no_such_option:"none of its choices matches",rejected:"the page would not take that value",invalid:"the site says that value is not valid"},jS=t=>{let e=t.filter(r=>r.outcome!=="ok");if(e.length===0)return;let n=t.filter(r=>r.outcome==="ok").map(r=>`"${r.name}"`),i=e.map(r=>{let a=X2[r.outcome];return `"${r.name}" (${a}${r.detail?`: ${r.detail}`:""})`});return [n.length>0?`filled ${n.join(", ")}`:"",`could not fill ${i.join(", ")}`].filter(Boolean).join("; ")},YS={stale:"the page has changed since it was read",unknown_target:"that button is not on this page",not_a_submit:"that button does not send a form",disabled:"that button is disabled right now",invalid:"the form is not complete yet",requires_reload:"sending this form would open a new page and end this call, so they need to press it themselves"};var ca={camera:true,screen:false,micMute:true,endCall:true,actions:false,mood:false,page:{read:false,scroll:false,navigate:false,click:false,fill:false,submit:false}},Mi=(t,e)=>typeof t=="boolean"?t:e,WS=t=>{if(!t||typeof t!="object")return ca;let e=t,n=e.page&&typeof e.page=="object"?e.page:{},i=Mi(n.read,ca.page.read),r=i&&Mi(n.click,false);return {camera:Mi(e.camera,ca.camera),screen:Mi(e.screen,ca.screen),micMute:Mi(e.micMute,ca.micMute),endCall:Mi(e.endCall,ca.endCall),actions:Mi(e.actions,ca.actions),mood:Mi(e.mood,ca.mood),page:{read:i,scroll:i&&Mi(n.scroll,false),navigate:i&&Mi(n.navigate,false),click:r,fill:i&&Mi(n.fill,false),submit:r}}};var K2=/^([xy])=([+-]?)(\d{1,5})(%?)$/;var Z2=t=>{let e=K2.exec(t);if(!e)return null;let[,n,i,r,a]=e,o=Number(r);return !a&&o>2e4||a&&o>100?null:{axis:n,move:{value:i==="-"?-o:o,percent:a==="%",relative:i!==""}}},Kl=t=>{let e=t.split(",");if(e.length>2)return null;let n={};for(let i of e){let r=Z2(i.trim());if(!r||n[r.axis])return null;n[r.axis]=r.move;}return n.x||n.y?n:null};var J2=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),$2=/^bounce(?:=(.+))?$/,eR=new Set(["forever","loop","infinite"]),tR=5,nR=t=>{if(t===void 0)return 1;if(eR.has(t))return "forever";if(!/^\d{1,3}$/.test(t))return null;let e=Number(t);return e<1?null:Math.min(e,tR)},Kf=t=>{let e=t.trim().toLowerCase();if(!e)return null;if(J2.has(e))return {kind:"spot",spot:e};if(e==="expand")return {kind:"stage",open:true};if(e==="collapse")return {kind:"stage",open:false};if(e==="stop"||e==="still")return {kind:"effect",effect:"stop"};let n=$2.exec(e);if(n){let r=nR(n[1]);return r===null?null:{kind:"effect",effect:"bounce",times:r}}let i=Kl(e);return i?{kind:"move",...i}:null};var iR=new Set(["search","open","new_tab","switch","close","reload"]),rR=new Set(["search","open","switch"]);function qS(t){if(typeof t!="string")return null;let e=t.indexOf("="),n=(e<0?t:t.slice(0,e)).trim(),i=e<0?"":t.slice(e+1).trim();return !iR.has(n)||rR.has(n)&&!i?null:i?{action:n,target:i}:{action:n}}var uR=new Set(["CONNECTION_FAILED","SERVER_ERROR","SESSION_TOKEN_FETCH_FAILED"]),QS=1e3,XS=1e3,cR=50,fR=600,dR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that place is not on this page"},hR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that link is not on this page",not_navigable:"that is not a link on this site",requires_reload:"opening that page would end this call",already_here:"they are already on that page",no_history:"there is nowhere in this call's history to go"},mR={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that is not on this page",not_clickable:"that is not a button or field the avatar can press",submits_form:"that button submits a form, which needs a confirmed action",requires_reload:"pressing that would open a new page and end this call",disabled:"that is disabled right now"},pR=400,gR=[300,1e3,2500],vR=3e3,AR="the page could not be reached",yR={ok:void 0,not_found:"no open tab matches that",blocked:"that is not a web address it can open",failed:"the browser refused"},bR=1e3,KS=12e3,Dg=()=>{},_R=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}catch{return}},Zl=t=>typeof t?.arg=="string"?t.arg:"",SR=t=>t?.arg==="tab"||t?.arg==="window"||t?.arg==="screen"?t.arg:null,Jl=t=>typeof t?.generation=="number"?t.generation:void 0,$l=class extends Error{constructor(n){super("Failed to fetch session token");this.reason=n;this.name="SessionTokenError";}},eu=class{constructor(e,n){this.sessionPhase="idle";this.paintPhase="none";this.turnPhase="idle";this.playful={last:null,busyUntilMs:0};this.sessionId=0;this.turnId=0;this.isConnected=false;this.lifecycle=0;this.userStoppedAt=null;this.speakReportedForStop=false;this.deliveryLagMs=null;this.firstAudioAt=null;this.firstAudioLagMs=null;this.transit=new Qf;this.reconnectAttempt=0;this.hasBeenLive=false;this.reconnectTimer=null;this.intentionalClose=false;this.serverInitiatedReason=null;this.lastEmittedError=null;this.noticeReceived=false;this.noticeOnly=false;this.visualState="normal";this.micMuted=false;this.speakerMuted=false;this.pushToTalk=null;this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"};this.downlinkScope="network";this.downlinkVerdict=null;this.netStatusLastSentAt=0;this.netStatusTimer=null;this.moodDetectionOn=false;this.moodLatest=null;this.moodLastSentKey=null;this.moodLastSentAt=0;this.moodTimer=null;this.appEvents=new zf;this.actions=new jf({canDeclare:()=>this.canDeclareActions(),send:e=>this.sendActionsSet(e)});this.actionCallsSeen=new Set;this.actionFlows=new Yf;this.actionsGrantWarned=false;this.actionRereadTimer=null;this.jobQueue=[];this.processing=false;this.turnOpen=false;this.scriptTail={jobId:-1,upto:0,text:""};this.activeStream=null;this.ws=null;this.micStream=null;this.micStartedAt=null;this.agcEnabled=true;this.agcRestoreTimer=null;this.events=new Xl;this.transcript=null;this.greetingText="";this.greetingLanguage="en";this.greetingKey="";this.greetingEntry=null;this.greetingDecided=false;this.greetingDecisionTimer=null;this.greetingAwaitingPlayback=false;this.greetingDelayTimer=null;this.greetingAwaitingPaint=null;this.greetingPaintTimer=null;this.greetingAwaitingMic=null;this.greetingMicTimer=null;this.micPipelineSettled=false;this.talkingArmed=false;this.playerLeadInTimer=null;this.connectTonePlaying=false;this.connectToneTimer=null;this.connectToneStartedAt=null;this.tonePainted=false;this.toneSessionLive=false;this.greetingPlayed=false;this.skipGreetingOnce=false;this.greetedThisSession=false;this.jobCounter=0;this.riveReady=false;this.avatarConfig=null;this.serverReady=false;this.voiceSettings=null;this.watermark=false;this.lipSyncTuning=new yr;this.rivSrc=null;this.pendingRivBytes=null;this.pendingSession=false;this.pendingContext=[];this.lastContextSnapshot=null;this.firstPage=null;this.pageGeneration=0;this.lastPageContext=null;this.pageReadThisUtterance=false;this.pageWork=Promise.resolve();this.pageSession=0;this.heardSpeech=null;this.pendingTours=new Map;this.tourRequestSeq=0;this.sessionCapabilities=null;this.initAckPromise=null;this.initAckResolve=null;this.initAckReject=null;this.loadInFlight=null;this.startInvoked=false;this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null};this.firstChunkPending=true;this.responseSlow=false;this.heldResumeToken=null;this.stopCount=0;this.mountSurface="inline";this.load=()=>this.serverReady?Promise.resolve():this.loadInFlight?this.loadInFlight:(this.loadInFlight=this.runLoad().finally(()=>{this.loadInFlight=null;}),this.loadInFlight);this.runLoad=async()=>{let e=this.lifecycle;this.setPaintPhase("loading");try{if(this.mode==="player")await this.paintFromCache(e)?this.revalidatePaint(e):await this.fetchRenderConfig(e);else {let n=await this.paintFromCache(e);this.mode==="call"&&!this.startInvoked&&(n?await this.revalidatePaint(e):await this.fetchRenderConfig(e));}}catch(n){if(this.stale(e))return;if(T.error("Runtime","Avatar load failed",n),this.setPaintPhase("failed"),n instanceof Ql&&Ig(n.serverCode,n.serverMessage)){this.emitError("DOMAIN_NOT_ALLOWED","This page's domain is not in the deployment's authorised domains","server",{cause:n});return}let i=n instanceof $l;this.emitError(i?"SESSION_TOKEN_FETCH_FAILED":"AVATAR_LOAD_FAILED",i?"Failed to fetch session token":"Failed to load avatar","sdk",{cause:i?n.reason:n});return}this.stale(e)||this.mode!=="call"&&this.start();};this.start=async()=>{let e=this.lifecycle,n=this.stopCount;if(this.cancelReconnect(),this.startInvoked=true,this.lastEmittedError=null,this.startConnectTone(),this.mode!=="player"&&this.setSessionPhase("connecting"),await this.load(),!this.stale(e)){if(this.paintPhase==="failed"){this.setSessionPhase("idle");return}if(this.mode==="player"){this.setSessionPhase("active");return}try{(!this.ws||this.ws.readyState===WebSocket.CLOSED)&&await this.openWebSocket();let i=this.ws;if(this.staleSocket(e,i)||(this.initAckPromise&&(T.debug("Runtime","Waiting for server to acknowledge init..."),await this.initAckPromise),this.staleSocket(e,i))||this.noticeOnly)return;this.ws?.send(JSON.stringify({type:"start"}));}catch(i){if(this.stopCount!==n&&!this.lastEmittedError||(!this.stale(e)&&this.paintPhase!=="painted"&&this.setPaintPhase("failed"),this.lastEmittedError))return;if(i instanceof $l){this.emitError("SESSION_TOKEN_FETCH_FAILED","Failed to fetch session token","sdk",{cause:i.reason});return}this.emitError("UNKNOWN","Unexpected runtime error","sdk",{cause:i});}}};this.paintFromCache=async e=>{let[n,i]=await Promise.all([this.cache.getCachedRiv(this.avatarId),this.cache.getCachedAvatarConfig(this.avatarId)]);if(this.stale(e))return false;if(this.cachedConfigVersion=i?.configVersion,this.cachedRivVersion=n?.rivVersion,n&&i){let r=await this.urlResolver.bytesToSrc(n.bytes);return this.stale(e)?(this.urlResolver.revokeSrc(r),false):(this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig={...i,rive:{...i.rive,src:r}},this.pendingRivBytes=n.bytes,this.serverReady=true,this.onRivReady(),true)}return n&&(this.pendingRivBytes=n.bytes),false};this.resolveSessionToken=async()=>{try{let e=await this.getSessionToken();if(!e)throw new Error("getSessionToken() returned an empty token");return e}catch(e){throw new $l(e)}};this.fetchRenderConfig=async e=>{let n={"Content-Type":"application/json"},i={avatarId:this.avatarId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin},needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion}},r="";this.deployId?r=this.deployId:this.getSessionToken?r=await this.resolveSessionToken():this.apiKey&&(r=this.apiKey),n.Authorization=`Bearer ${r}`;let a=await fetch(`${this.httpUrl}/v1/avatar/config`,{method:"POST",headers:n,body:JSON.stringify(i)});if(!a.ok)throw new Ql(a.status,await a.json().catch(()=>null));let o=await a.json();if(this.serverReady)return this.repaintFromPayload(o,e);let u=o.rivUrl?await this.fetchRivBytes(o.rivUrl):this.pendingRivBytes;if(!u)throw new Error("config response had no rivUrl and no cache");await this.applyRenderPayload(o,u,e);};this.paintForNotice=async()=>{let e=this.lifecycle;try{T.info("Runtime","notice with nothing painted \u2014 resolving config"),await this.fetchRenderConfig(e);}catch(n){if(this.stale(e))return;T.error("Runtime","Notice paint failed \u2014 notice will be silent",n),this.setPaintPhase("failed");}};this.revalidatePaint=async e=>{try{await this.fetchRenderConfig(e);}catch(n){T.warn("Runtime","Revalidation failed \u2014 keeping the cached paint",n);}};this.repaintFromPayload=async(e,n)=>{let i=e.rivUrl?await this.fetchRivBytes(e.rivUrl):null;if(e.rivUrl&&!i&&T.warn("Rive","New rig failed to download \u2014 keeping the painted one"),i)return this.applyRenderPayload(e,i,n);if(this.stale(n))return;let r=e.watermark===true!==this.watermark;this.watermark=e.watermark===true;let a=e.configVersion!==void 0&&e.configVersion!==this.avatarConfig?.configVersion,o=JSON.stringify(Bf(e.performance)??null)!==JSON.stringify(this.avatarConfig?.performance??null);!a&&!r&&!o||(this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.cachedConfigVersion=e.configVersion,e.rivVersion!==void 0&&(this.cachedRivVersion=e.rivVersion),(a||o)&&e.cacheable!==false&&this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{}),this.onRivReady());};this.applyRenderPayload=async(e,n,i)=>{let r=await this.urlResolver.bytesToSrc(n);if(this.stale(i))return this.urlResolver.revokeSrc(r);this.watermark=e.watermark===true,this.cachedConfigVersion=e.configVersion,this.cachedRivVersion=e.rivVersion,this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.serverReady=true,e.cacheable!==false&&(e.rivVersion!==void 0&&this.cache.setCachedRiv(this.avatarId,n,e.rivVersion).catch(()=>{}),this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{})),this.pendingRivBytes=n,this.onRivReady();};this.setMountSurface=e=>{this.mountSurface=e;};this.getLipSyncTuning=()=>this.lipSyncTuning;this.speakAudio=async e=>{if(this.mode!=="audio"){this.emitError("INVALID_MODE","speakAudio can only be used in audio mode","sdk",{fatal:false});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakAudio() needs a live session \u2014 call start() first","sdk",{fatal:false});return}try{let n;e instanceof Blob?n=await e.arrayBuffer():e instanceof Float32Array?n=e.buffer:n=e;let i=15*1024*1024;if(n.byteLength>i){this.emitError("INVALID_INPUT","Audio payload too large (max 15MB)","sdk",{fatal:!1});return}this.ws?.send(n);}catch(n){this.emitError("UNKNOWN","Failed to process audio payload","sdk",{cause:n,fatal:false});}};this.isPushToTalk=()=>this.turnTaking==="push-to-talk";this.isTalking=()=>this.pushToTalk?.isHeld()??false;this.startTalking=()=>{this.pushToTalk&&this.sessionPhase==="active"&&(this.noticeReceived||this.pushToTalk.press());};this.stopTalking=()=>{this.pushToTalk?.release();};this.setMicMuted=e=>{this.micMuted!==e&&(this.micMuted=e,this.queueClientNetStatus(),this.events.emit("mic-muted",e));};this.setSpeakerMuted=e=>{this.speakerMuted!==e&&(this.speakerMuted=e,this.events.emit("speaker-muted",e));};this.getMicMuted=()=>this.micMuted;this.getSpeakerMuted=()=>this.speakerMuted;this.commandHandlers={stop:e=>{this.cancelSpeech(),this.reportCommandStatus("stop",this.commandTurnId(e),"ok");},request_vision:e=>{this.events.emit("vision-request",this.commandTurnId(e));},flip_camera:e=>{let n=typeof e?.args=="string"?e.args:null,i=n==="front"?"front":n==="back"?"back":"toggle";this.events.emit("camera-flip",i,this.commandTurnId(e));},mute_mic:e=>{if(this.environment==="meeting"){this.reportCommandStatus("mute_mic",this.commandTurnId(e),"unsupported");return}this.setMicMuted(true),this.reportCommandStatus("mute_mic",this.commandTurnId(e),"ok");},unmute_mic:e=>{this.setMicMuted(false),this.reportCommandStatus("unmute_mic",this.commandTurnId(e),"ok");},close_camera:e=>{this.events.emit("camera-close",this.commandTurnId(e));},open_camera:e=>{this.events.emit("camera-open",this.commandTurnId(e));},request_screen:e=>{let n=this.commandTurnId(e);if(!this.capabilities?.screen){this.reportScreenStatus("unavailable",n,{reason:"not granted"});return}if(!this.perception?.screen||!this.events.hasListeners("screen-request")){this.reportScreenStatus("unavailable",n,{reason:"screen sharing is not enabled here"});return}this.events.emit("screen-request",SR(e),n);},stop_screen:e=>{let n=this.commandTurnId(e);if(!this.events.hasListeners("screen-stop")){this.reportCommandStatus("stop_screen",n,"unsupported");return}this.events.emit("screen-stop",n);},scroll_to:e=>this.runPageCommand("scroll_to",e,n=>n.scroll,async(n,i)=>{let r=await n.scroll(Zl(e),Jl(e));this.reportCommandStatus("scroll_to",i,r==="ok"?"ok":"failed",dR[r]);}),navigate_to:e=>this.runPageCommand("navigate_to",e,n=>n.navigate,async(n,i)=>{let r=await n.navigate(Zl(e),Jl(e));this.reportCommandStatus("navigate_to",i,r==="ok"?"ok":"failed",hR[r]);}),click_element:e=>this.runPageCommand("click_element",e,n=>n.click,async(n,i)=>{let r=await n.click(Zl(e),Jl(e));this.reportCommandStatus("click_element",i,r==="ok"?"ok":"failed",mR[r]),r==="ok"&&this.scheduleReadAfterAction();}),fill_fields:e=>this.runPageCommand("fill_fields",e,n=>n.fill,async(n,i)=>{let r=zS(e);if(r.length===0){this.reportCommandStatus("fill_fields",i,"failed","there was nothing to fill");return}let a=await n.fill(r,Jl(e)),o=jS(a);T.event("page","Fields filled",{fields:a.map(u=>`${u.handle}:${u.outcome}`)}),this.reportCommandStatus("fill_fields",i,o?"failed":"ok",o),a.some(u=>u.outcome==="ok")&&this.scheduleReadAfterAction();}),submit_form:e=>this.runPageCommand("submit_form",e,n=>n.submit,async(n,i)=>{let{outcome:r,detail:a}=await n.submit(Zl(e),Jl(e)),o=r==="ok"?void 0:`${YS[r]}${a?`: ${a}`:""}`;this.reportCommandStatus("submit_form",i,r==="ok"?"ok":"failed",o),r==="ok"&&this.scheduleReadAfterAction();}),widget_control:e=>{let n=this.commandTurnId(e);if(this.mountSurface!=="widget"){this.reportCommandStatus("widget_control",n,"unsupported","the avatar is not in a widget here");return}let i=Kf(Zl(e));if(!i){this.reportCommandStatus("widget_control",n,"failed","that is not somewhere the avatar can put itself");return}this.events.emit("widget-command",i,n);},browser:e=>{let n=this.commandTurnId(e),i=this.browser;if(!i){this.reportCommandStatus("browser",n,"unsupported","this client cannot drive the browser");return}let r=qS(e?.arg);if(!r){this.reportCommandStatus("browser",n,"failed","that is not a browser command");return}Promise.resolve().then(()=>i.run(r)).catch(a=>(T.warn("Runtime","browser command threw",{error:String(a)}),"failed")).then(a=>this.reportCommandStatus("browser",n,a==="ok"?"ok":"failed",yR[a]));},close_call:e=>{this.reportCommandStatus("close_call",this.commandTurnId(e),"ok"),this.stop({intentionalClose:true,code:4001,reason:"Closed by server command"});}};this.loadCachedGreeting=async()=>{if(!(!this.greeting?.enabled||this.greetingEntry))try{let e=await this.cache.getCachedGreeting(this.greetingKey);if(!e)return;this.greetingEntry=e,this.sentGreetingId=e.greetingId,T.debug("Greeting","Loaded greeting from cache",{greetingId:e.greetingId});}catch{}};this.openWebSocket=async()=>{if(!this.wsUrl)throw new Error("WebSocket URL not resolved");if(this.ws&&this.ws.readyState===WebSocket.OPEN)return;if(!this.pendingRivBytes){let n=await this.cache.getCachedRiv(this.avatarId);this.pendingRivBytes=n?.bytes??null,this.cachedRivVersion=n?.rivVersion;}await this.loadCachedGreeting();let e=this.getSessionToken?await this.resolveSessionToken():void 0;return this.initAckPromise=new Promise((n,i)=>{this.initAckResolve=n,this.initAckReject=i;}),new Promise((n,i)=>{try{let r=new WebSocket(this.wsUrl);this.ws=r,r.binaryType="arraybuffer",r.onopen=()=>{if(this.ws!==r)return;T.event("WebSocket","Connection opened"),this.intentionalClose=!1,this.serverInitiatedReason=null;let a=_R();r.send(JSON.stringify({type:"init",...this.deployId?{deployId:this.deployId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin}}:{avatarId:this.avatarId,...e?{sessionToken:e}:{apiKey:this.apiKey}},...this.onResumeState&&{resumable:!0},...this.resumeKept&&{resume:this.resumeKept},...this.voiceSettings&&{voiceSettings:this.voiceSettings},...this.brain&&{brain:this.brain},...this.languages!==void 0&&{languages:this.languages},...this.perception&&{perception:{...this.perception,...this.readsMood&&{mood:!0}}},...this.greeting?.enabled&&{greeting:{enabled:!0,...this.greetingText&&{message:this.greetingText},language:this.greetingLanguage,...this.sentGreetingId&&{cachedGreetingId:this.sentGreetingId}}},...this.useOwnVoice!==void 0&&{useOwnVoice:this.useOwnVoice},...this.useOwnBrain!==void 0&&{useOwnBrain:this.useOwnBrain},mode:this.mode,turnTaking:this.turnTaking,systemPrompt:this.systemPrompt,needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion},...this.platform&&{platform:this.platform},...this.browser&&{browser:!0},surface:this.mountSurface,...this.framed!==void 0&&{framed:this.framed},...this.micBlocked()&&{micBlocked:!0},...a&&{timeZone:a}})),n();},r.onmessage=a=>{this.ws===r&&this.handleServerMessage(a);},r.onclose=a=>{if(this.ws!==r){T.debug("WebSocket","Ignoring onclose \u2014 already handled");return}let o=this.intentionalClose,u=this.serverInitiatedReason;if(this.isConnected=!1,this.events.emit("connection-status",!1),u)T.info("WebSocket","Closed following server message",{...u});else if(a.code===B_)T.info("WebSocket","Meeting ended; closed by the server");else if(a.code===U_)T.info("WebSocket","A newer session took over this meeting");else if(o)T.info("WebSocket","Connection closed gracefully");else {let{code:d,message:g}=this.classifyClose(a);this.emitError(d,g,"network",{cause:a?.reason});}this.ws=null,this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket closed before init acknowledged"),this.stop();},r.onerror=a=>{if(this.ws!==r)return;let o=this.intentionalClose,u=this.serverInitiatedReason;u?T.info("WebSocket","Transport error after server message",{...u}):o?T.info("WebSocket","Transport error during intentional close"):this.emitError("CONNECTION_FAILED","Transport error on the connection to the avatar service","network",{cause:a}),this.ws=null,this.isConnected=!1,this.events.emit("connection-status",!1),this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket error before init acknowledged"),this.stop(),i(a);};}catch(r){this.emitError("CONNECTION_FAILED","Could not open a connection to the avatar service","network",{cause:r}),i(r);}})};this.onRivReady=async()=>{if(!this.avatarConfig)return;this.setPaintPhase("painted");let e=this.avatarConfig.rive,n=this.voiceSettings?.visimeMs;this.lipSyncTuning.reset(this.avatarConfig.lipSync),this.lipSyncTuning.apply(this.voiceSettings?.lipSync),T.event("Runtime","lip-sync tuning seeded",{configVersion:this.avatarConfig.configVersion,fromConfig:!!this.avatarConfig.lipSync,overridden:!!this.voiceSettings?.lipSync,...this.lipSyncTuning.snapshot()}),this.events.emit("avatar-config",{...this.avatarConfig,rive:{...e,src:this.rivSrc,watermark:this.watermark},lipSync:{...this.avatarConfig.lipSync,...n!==void 0?{visemeMs:n}:{}}}),this.pendingSession&&(this.pendingSession=false,T.info("Runtime","Riv ready \u2014 starting deferred session"),this.startSession());};this.micBlocked=()=>this.mode==="call"&&this.usesDefaultMic&&!Z_();this.startMic=async()=>{let e=this.ws;if(this.micBlocked())return this.emitError("MIC_PERMISSION_DENIED","This page does not allow the microphone","sdk"),false;let n;try{n=await this.getMicStreamFn();}catch(i){return this.emitError("MIC_PERMISSION_DENIED","Microphone permission denied","sdk",{cause:i}),false}return this.ws!==e||e?.readyState!==WebSocket.OPEN?(T.warn("Runtime","session closed while awaiting mic \u2014 releasing it"),n.getTracks().forEach(i=>i.stop()),false):(this.micStream=n,this.micPipelineSettled=false,this.micStartedAt=Date.now(),this.agcEnabled=true,this.events.emit("mic-start",this.micStream),true)};this.setAgcForAvatarSpeech=e=>{if(!(!this.micStream||this.environment==="meeting")){if(this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),e){this.applyAgc(false);return}this.agcRestoreTimer=setTimeout(()=>{this.agcRestoreTimer=null,this.applyAgc(true);},fR);}};this.fetchRivBytes=async(e,n=false)=>{try{let i=await fetch(e);if(!i.ok)throw new Error(`HTTP ${i.status}`);return await i.arrayBuffer()}catch(i){return n?(T.error("Rive","Riv fetch failed after retry",{cause:i}),null):(T.warn("Rive","Riv fetch failed \u2014 retrying once",{cause:i}),this.fetchRivBytes(e,true))}};let i=Yl(e);if(this.environment=i.environment,this.environment==="meeting"&&(this.lipSyncTuning.maxStepFrames=j_),i.debug&&T.setLogLevel(0),T.debug("Runtime","Initializing with config",i),this.mode=i.mode||"call",this.turnTaking=this.mode==="call"&&i.turnTaking?.mode==="push-to-talk"?"push-to-talk":"auto",this.turnTaking==="push-to-talk"&&(this.pushToTalk=new qf({onTurnStart:()=>this.openUserTurn(),onTurnEnd:()=>this.closeUserTurn(),onHeldChange:r=>this.events.emit("ptt-held",r)})),this.greeting=n.embedResume?.kept?void 0:i.avatar?.greeting,this.connectTone=n.embedResume?.kept?void 0:i.connectTone,this.avatarId=i.avatar?.avatarId||"default",this.systemPrompt=i.avatar?.systemPrompt,this.apiKey=i.apiKey,this.getSessionToken=i.getSessionToken,this.deployId=i.deployId,this.voiceSettings=i.avatar?.voiceSettings||null,!this.apiKey&&!this.getSessionToken&&!this.deployId)throw new Error("AvatarConfig requires apiKey, getSessionToken, or deployId");this.useOwnVoice=i.avatar?.voiceSettings?.useOwnVoice,this.useOwnBrain=i.avatar?.brain?.useOwnBrain,this.brain=i.avatar?.brain,this.languages=i.avatar?.languages,this.perception=i.perception,this.readsMood=this.mode==="call"&&!!i.perception?.camera&&!!n.readsMood,this.wsUrl=Kp(),this.httpUrl=Fl(),this.greeting?.enabled&&(this.greetingLanguage=this.greeting.language??"en",this.greetingText=this.greeting.message?_g(this.greeting.message):"",this.greetingKey=Sg(this.avatarId,this.greetingLanguage,this.greetingText)),i.transcript?.enabled&&(this.transcript=new Wf(r=>this.events.emit("transcript",r),i.transcript.maxEntries)),this.cache=n.cache,this.urlResolver=n.urlResolver,this.pageSurface=n.pageSurface,this.browser=n.browser,this.pageBeforeLive=n.pageBeforeLive??false,this.reportsMicPipeline=n.reportsMicPipeline??false,this.usesDefaultMic=!n.getMicStream,this.getMicStreamFn=n.getMicStream??(async()=>{let r=await navigator.mediaDevices.getUserMedia({audio:this.environment==="meeting"?G_:{echoCancellation:true,noiseSuppression:true,autoGainControl:false,channelCount:1}});return T.event("mic","settings",{...r.getAudioTracks()[0]?.getSettings()}),r}),this.platform=n.platform,this.framed=n.framed,this.embedHostOrigin=n.embedHostOrigin,this.onResumeState=n.embedResume?.onState,this.resumeKept=n.embedResume?.kept,this.downlinkWatchdog=new Xf({loopLagHighMs:this.platform?500:250,onVerdict:r=>this.applyDownlinkVerdict(r)});}paintedConfigFrom(e,n){return {avatarId:e.avatarId,configVersion:e.configVersion,pipelineMode:e.pipelineMode,rive:{...e.rive??{artboard:"",stateMachine:"",layout:{}},src:n},lipSync:e.lipSync,performance:Bf(e.performance)??void 0}}toCacheableConfig(e){return {...e,rive:{...e.rive,src:"",watermark:void 0}}}async startSession(){if(this.isConnected||(this.resetHealth(),this.mode==="call"&&!this.noticeOnly&&!await this.startMic()))return;if(this.pageBeforeLive&&this.firstPage){let n=this.pageSession;if(await Promise.race([this.firstPage,new Promise(i=>setTimeout(i,vR))]),n!==this.pageSession)return}if(this.isConnected=true,this.downlinkWatchdog.start(),this.mode==="call"&&!this.noticeOnly&&this.queueClientNetStatus(),this.pushToTalk&&this.sendClientVadStatus(true,"push_to_talk"),this.events.emit("connection-status",true),this.heldResumeToken&&this.onResumeState?.(this.heldResumeToken),this.heldResumeToken=null,this.setSessionPhase("active"),this.reconnectAttempt=0,this.hasBeenLive=true,this.markToneSessionLive(),this.noticeOnly)return;this.actions.syncNow(),this.greetingPlayed=false;let e=this.skipGreetingOnce;if(this.skipGreetingOnce=false,this.greetedThisSession=!!this.greeting?.enabled&&!e,!this.greeting?.enabled||e){this.greetingPlayed=e,this.enterListening();return}if(!this.playGreeting()){if(!this.greetingDecided){this.greetingAwaitingPlayback=true,this.setTurnPhase("greeting"),this.armGreetingBackstop();return}this.enterListening();}}stop(e={intentionalClose:false}){this.stopCount++,e.intentionalClose&&(this.intentionalClose=true,this.cancelReconnect()),this.teardownSession(e.code,e.reason,true),this.setSessionPhase("idle");}scheduleReconnect(e){if(this.environment!=="meeting"||this.reconnectTimer||!uR.has(e.code))return;let n=H_[this.reconnectAttempt];if(n===void 0){T.warn("Runtime","Meeting reconnect attempts exhausted",{attempts:this.reconnectAttempt});return}this.reconnectAttempt++,T.event("session","reconnect_scheduled",{attempt:this.reconnectAttempt,delayMs:n,code:e.code}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.hasBeenLive&&this.skipNextGreeting(),this.start();},n);}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);}setLipSyncTuning(e){this.lipSyncTuning.apply(e);}speakText(e){try{if(this.mode!=="tts"){this.emitError("INVALID_MODE","speakText() is only available in text mode","sdk",{fatal:!1});return}if(!e.trim()){this.emitError("INVALID_INPUT","speakText() needs non-empty text","sdk",{fatal:!1});return}if(e.length>5e3){this.emitError("INVALID_INPUT","Text too long (max 5000 chars)","sdk",{fatal:!1});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakText() needs a live session \u2014 call start() first","sdk",{fatal:!1});return}this.ws?.send(JSON.stringify({type:"input",payload:{text:e}}));}catch(n){this.emitError("UNKNOWN","Unexpected error in speakText()","sdk",{cause:n,fatal:false});}}addLiveContext({context:e,update:n}){if(!e||e.trim().length===0){this.emitError("INVALID_INPUT","Context cannot be empty","sdk",{fatal:false});return}if(e.length>2e3){this.emitError("INVALID_INPUT","Context too long (max 2000 chars)","sdk",{fatal:false});return}let i=e.trim();if(!(!n&&i===this.lastContextSnapshot)){if(n||(this.lastContextSnapshot=i),this.ws?.readyState!==WebSocket.OPEN||!this.sessionCapabilities){n||(this.pendingContext=[]),this.pendingContext.push({context:i,update:n}),this.pendingContext.length>16&&this.pendingContext.shift();return}this.sendLiveContext(i,n);}}get capabilities(){return this.sessionCapabilities}pageSendSkipReason(e){return this.mode!=="call"?"wrong_mode":this.ws?.readyState!==WebSocket.OPEN?"no_session":this.capabilities?.page.read?e===this.lastPageContext?"unchanged":null:"not_granted"}skipNextGreeting(){this.skipGreetingOnce=true;}async requestTour(){if(!this.isConnected||!this.ws)return null;let e=await this.readPage();if(!e||e.reason==="not_granted"||e.reason==="wrong_mode"||e.reason==="no_session")return T.warn("Runtime","requestTour(): the page cannot be sent",{reason:e?.reason??"no_page_surface"}),null;let n=`t${++this.tourRequestSeq}`;return new Promise(i=>{let r=o=>{clearTimeout(a),this.pendingTours.delete(n),i(o);},a=setTimeout(()=>r(null),Q_);this.pendingTours.set(n,r),this.ws?.send(JSON.stringify({type:"tour_request",requestId:n,greeted:this.greetedThisSession}));})}async sendFirstPage(){if(!this.pageSurface||!this.capabilities?.page.read)return;let e=this.pageSession;for(let n of [...gR,null]){let i=await this.readPage();if(i?.sent||this.pageGeneration>0||e!==this.pageSession||i)return;if(n===null){T.warn("Runtime","The page never answered at call start; waiting for a change");return}if(T.warn("Runtime","First page read reached no page \u2014 retrying",{delayMs:n}),await new Promise(r=>setTimeout(r,n)),e!==this.pageSession)return}}readPage(){let e=this.pageSurface;return e?this.queuePageWork(()=>this.readPageNow(e)):(T.debug("Runtime","readPage(): no page surface on this platform"),Promise.resolve(null))}async readPageNow(e){let n=this.pageSession;try{let i=this.pageGeneration+1,r=await e.read(i);if(!r)return null;let a=Ng(r),o=r.unreadable?`${a} (${r.unreadable})`:a,u=n===this.pageSession?this.pageSendSkipReason(o):"no_session";return u?(await e.retag(this.pageGeneration),r.generation=this.pageGeneration):(this.pageGeneration=i,this.lastPageContext=o,this.ws?.send(JSON.stringify({type:"page_context",context:a,url:r.url,generation:r.generation,handles:GS(r),...r.covered&&{covered:r.covered},...r.unreadable&&{unreadable:r.unreadable}}))),T.event("page","Page read",{generation:r.generation,page:r.pageName,pageNamedBy:r.pageNamedBy,nodes:r.nodes.length,unnamed:Object.values(r.unnamed).reduce((d,g)=>d+g,0),characters:a.length,sent:!u,...u&&{reason:u}}),{index:r,context:a,sent:!u,...u&&{reason:u}}}catch(i){return this.emitError("UNKNOWN","Failed to read the host page","sdk",{cause:i,fatal:false}),null}}queuePageWork(e){let n=this.pageWork.then(e,e);return this.pageWork=n.catch(()=>{}),n}sendLiveContext(e,n){try{this.ws?.send(JSON.stringify({type:"live_context",context:e,update:n}));}catch(i){this.emitError("UNKNOWN","Failed to send live context","sdk",{cause:i,fatal:false});}}flushPendingContext(){if(this.pendingContext.length===0)return;let e=this.pendingContext;this.pendingContext=[];for(let n of e)this.sendLiveContext(n.context,n.update);}notify(e){try{if(this.mode==="player"){this.emitError("INVALID_MODE","notify() needs a session \u2014 player mode never opens a socket","sdk",{fatal:!1});return}let n=this.appEvents.validate(e);if(!n.ok){this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1});return}let i=e.policy??"idle_only";if(!(this.ws?.readyState===WebSocket.OPEN)&&i!=="context_only"){T.event("app","Event dropped",{name:e.name,reason:"no_session"});return}let a=e.cooldownMs??5e3,o=this.appEvents.admit(e.name,a,Date.now());if(!o.ok){T.event("app","Event dropped",{name:e.name,reason:o.reason});return}if(i==="context_only"){this.addLiveContext({context:n.data?`${e.name}: ${n.data}`:e.name,update:!0});return}this.ws?.send(JSON.stringify({type:"app_event",name:e.name,data:n.data,policy:i,say:e.say})),T.event("app","Event sent",{name:e.name,policy:i});}catch(n){this.emitError("UNKNOWN","Unexpected error in notify()","sdk",{cause:n,fatal:false});}}registerAction(e){try{if(this.mode!=="call")return this.emitError("INVALID_MODE","registerAction() needs call mode \u2014 only a call can confirm an action","sdk",{fatal:!1}),Dg;let n=this.actions.register(e);return n.ok?n.unregister:(this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1}),Dg)}catch(n){return this.emitError("UNKNOWN","Unexpected error in registerAction()","sdk",{cause:n,fatal:false}),Dg}}canDeclareActions(){if(this.ws?.readyState!==WebSocket.OPEN)return false;let e=this.capabilities;return e?e.actions?true:(this.actions.size>0&&!this.actionsGrantWarned&&(this.actionsGrantWarned=true,T.warn("Runtime","actions not granted for this avatar",{registered:this.actions.size})),false):false}sendActionsSet(e){try{return this.ws?.send(JSON.stringify({type:"actions_set",actions:e})),T.event("action","Actions declared",{names:e.map(n=>n.name)}),!0}catch(n){return T.warn("Runtime","failed to send actions_set",{err:n}),false}}async handleActionRun(e){let n=typeof e?.callId=="string"?e.callId:"",i=typeof e?.name=="string"?e.name:"";if(!n){T.warn("Runtime","action_run without a callId cannot be answered",{name:i});return}if(this.actionCallsSeen.has(n)){T.warn("Runtime","duplicate action_run ignored",{callId:n,name:i});return}this.actionCallsSeen.add(n);let r=this.ws,a=Date.now();T.event("action","Action run",{callId:n,name:i});let o=await this.runAction(n,i,e.args);if(T.event("action","Action result",{callId:n,name:i,ok:o.ok,ms:Date.now()-a}),r===null||r!==this.ws||r.readyState!==WebSocket.OPEN){T.warn("Runtime","action_result not sent: the session ended mid-run",{callId:n,name:i,ok:o.ok});return}try{r.send(JSON.stringify({type:"action_result",callId:n,...o}));}catch(u){T.warn("Runtime","failed to send action_result",{callId:n,err:u});}}async runAction(e,n,i){let r=this.actions.get(n);if(!r)return T.warn("Runtime","action_run for an unregistered action",{name:n}),{ok:false,error:Ya.unavailable};let a=xS(r.declaration,i);if(!a)return T.warn("Runtime","action_run args do not match the declaration",{name:n,params:Object.keys(r.declaration.params)}),{ok:false,error:Ya.invalidArgs};let o=new AbortController,u=Promise.resolve().then(()=>r.handler(a,{callId:e,signal:o.signal})).then(g=>{let y=OS(g);return y||(T.warn("Runtime","action handler returned no { ok } result",{name:n}),{ok:false,error:Ya.failed})},g=>(T.error("Runtime","action handler threw",{name:n,err:g}),{ok:false,error:Ya.failed})),d=new Promise(g=>{let y=setTimeout(()=>{o.abort(),T.warn("Runtime","action handler timed out",{name:n,timeoutMs:KS}),g({ok:false,error:Ya.timedOut});},KS);u.then(()=>clearTimeout(y));});return Promise.race([u,d])}getActionFlow(){return this.actionFlows.flow}sendActionUi(e,n,i){let r=this.ws;if(!r||r.readyState!==WebSocket.OPEN)return this.emitError("NOT_CONNECTED","sendActionUi() needs a live session","sdk",{fatal:false}),false;let a=this.actionFlows.isLive?this.actionFlows.flow:null,o;if(e==="input"){let u=a?.name??i??"",d=this.actions.get(u),g=d?DS(d.declaration,n??{}):{ok:false,message:`no registered action "${u}"`};if(!g.ok)return this.emitError("INVALID_INPUT",`sendActionUi(): ${g.message}`,"sdk",{fatal:false}),false;o={type:"action_ui",op:e,...a?{actionId:a.actionId}:{name:u},args:g.args};}else {if(!a)return this.emitError("INVALID_INPUT",`sendActionUi("${e}") needs an action in progress`,"sdk",{fatal:false}),false;o={type:"action_ui",op:e,actionId:a.actionId,revision:a.revision};}try{return r.send(JSON.stringify(o)),T.event("action","Action UI sent",{op:e,actionId:a?.actionId,params:n?Object.keys(n):[]}),!0}catch(u){return T.warn("Runtime","failed to send action_ui",{op:e,err:u}),false}}handleActionState(e){let n=NS(e);if(!n){T.warn("Runtime","action_state ignored: not a flow");return}this.actionFlows.apply(n)&&(T.event("action","Action flow",{actionId:n.actionId,name:n.name,stage:n.stage,revision:n.revision,awaiting:n.awaiting?.kind??null}),this.events.emit("action-flow",n));}async handleActionCheck(e){let n=typeof e?.checkId=="string"?e.checkId:"",i=typeof e?.name=="string"?e.name:"",r=typeof e?.param=="string"?e.param:"";if(!n){T.warn("Runtime","action_check without a checkId cannot be answered",{name:i});return}let a=this.ws,o=e?.args&&typeof e.args=="object"&&!Array.isArray(e.args)?e.args:{},u=await LS(this.actions.get(i)?.check,r,e?.value,o);if(T.event("action","Action check answered",{checkId:n,name:i,param:r,ok:u.ok,unverified:u.unverified===true}),a===null||a!==this.ws||a.readyState!==WebSocket.OPEN){T.warn("Runtime","action_check_result not sent: the session ended",{checkId:n});return}try{a.send(JSON.stringify({type:"action_check_result",checkId:n,...u}));}catch(d){T.warn("Runtime","failed to send action_check_result",{checkId:n,err:d});}}reportPerceptionOutcome(e,n,i){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","reportPerceptionOutcome() needs a live session","sdk",{fatal:false});return}try{this.ws.send(JSON.stringify({type:"perception_status",turnId:n,outcome:e,...e==="granted"&&{hasHistory:!!i?.hasHistory,feed:i?.feed??"off"}}));}catch(r){this.emitError("UNKNOWN","Failed to send perception status","sdk",{cause:r,fatal:false});}}sendCameraState(e){if(this.ws?.readyState===WebSocket.OPEN&&!(e.access===void 0&&e.feed===void 0&&e.facing===void 0&&e.canFlip===void 0&&e.availableCameras===void 0)){try{this.ws.send(JSON.stringify({type:"camera_state",...e.access!==void 0&&{access:e.access},...e.feed!==void 0&&{feed:e.feed},...e.facing!==void 0&&{facing:e.facing},...e.canFlip!==void 0&&{canFlip:e.canFlip},...e.availableCameras!==void 0&&{availableCameras:e.availableCameras}}));}catch(n){T.warn("Runtime","failed to send camera_state",{err:n});}(e.feed==="off"||e.access&&e.access!=="granted")&&this.clearMood();}}get canReadMood(){return this.readsMood&&!!this.capabilities?.mood}get isMoodDetectionOn(){return this.moodDetectionOn}setMoodDetection(e){e!==this.moodDetectionOn&&(this.moodDetectionOn=e,this.moodLatest=null,this.events.emit("mood-detection",e),this.queueMoodState());}reportMood(e){!this.canReadMood||!this.moodDetectionOn||(this.moodLatest=e,this.queueMoodState());}resyncMoodSwitch(){this.moodLastSentKey="off",this.queueMoodState();}moodStateKey(){return this.moodDetectionOn?this.moodLatest?.state??"on":"off"}queueMoodState(){if(!this.canReadMood||this.moodTimer||this.moodStateKey()===this.moodLastSentKey)return;let e=Date.now()-this.moodLastSentAt;if(e>=XS){this.sendMoodState();return}this.moodTimer=setTimeout(()=>{this.moodTimer=null,this.sendMoodState();},XS-e);}sendMoodState(){let e=this.moodStateKey();if(e===this.moodLastSentKey||this.ws?.readyState!==WebSocket.OPEN)return;let n=this.moodDetectionOn?this.moodLatest:null;try{this.ws.send(JSON.stringify({type:"mood_state",enabled:this.moodDetectionOn,...n&&{label:n.state,confidence:n.confidence}})),this.moodLastSentKey=e,this.moodLastSentAt=Date.now(),T.debug("Runtime","mood_state sent",{key:e});}catch(i){T.warn("Runtime","failed to send mood_state",{err:i});}}clearMood(){this.moodLatest=null,this.moodLastSentKey!=="off"&&this.moodLastSentKey!==null&&(this.moodLastSentKey="on");}reportScreenStatus(e,n,i){if(T.event("screen","Share status",{outcome:e,turnId:n,surface:i?.surface??null,browser:i?.browser??null,reason:i?.reason??null}),this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_status",turnId:n,outcome:e,...i?.surface&&{surface:i.surface},...i?.browser&&{browser:i.browser},...i?.reason&&{reason:i.reason}}));}catch(r){T.warn("Runtime","failed to send screen_status",{err:r});}}sendScreenState(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_state",feed:e.feed,...e.surface&&{surface:e.surface}}));}catch(n){T.warn("Runtime","failed to send screen_state",{err:n});}}sendScreenFrame(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_frame",format:"jpeg",width:e.width,height:e.height,frame:Eg(e.bytes)}));}catch(n){T.warn("Runtime","failed to send screen_frame",{err:n});}}reportCommandStatus(e,n,i,r){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"command_status",command:e,turnId:n,outcome:i,...r&&{reason:r}}));}catch(a){T.warn("Runtime","failed to send command_status",{err:a});}}loadVadWeights(){return D_(I_(),this.cache)}noteUserVoice(){this.events.emit("user-voice");}sendClientVadStatus(e,n){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"client_vad_status",active:e,...n&&{reason:n}}));}catch(i){T.warn("Runtime","failed to send client_vad_status",{err:i});}}sendClientNetStatus(){if(this.ws?.readyState===WebSocket.OPEN){try{this.ws.send(JSON.stringify({type:"client_net_status",micMuted:this.micMuted,...this.downlinkVerdict&&{downlink:this.downlinkVerdict}})),this.downlinkVerdict?.state==="ok"&&(this.downlinkVerdict=null);}catch(e){T.warn("Runtime","failed to send client_net_status",{err:e});}this.netStatusLastSentAt=Date.now();}}queueClientNetStatus(){if(this.netStatusTimer)return;let e=Date.now()-this.netStatusLastSentAt;if(e>=QS){this.sendClientNetStatus();return}this.netStatusTimer=setTimeout(()=>{this.netStatusTimer=null,this.sendClientNetStatus();},QS-e);}sendVisionFrames(e,n){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","sendVisionFrames() needs a live session","sdk",{fatal:false});return}if(!e.length){T.warn("Runtime","vision frames requested but buffer is empty",{turnId:n});return}try{let i=e.map(r=>Eg(r));this.ws.send(JSON.stringify({type:"vision_query",turnId:n,format:"jpeg",frames:i}));}catch(i){this.emitError("UNKNOWN","Failed to send vision frames","sdk",{cause:i,fatal:false});}}play(e){if(this.mode!=="player"){this.emitError("INVALID_MODE","play() can only be used in player mode","sdk",{fatal:false});return}this.jobQueue.push({...e,sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,chunkOffset:0}),!(this.processing||this.playerLeadInTimer)&&(this.setTalkingArmed(true),this.playerLeadInTimer=setTimeout(()=>{this.playerLeadInTimer=null,this.setTalkingArmed(false),this.processQueue();},ng));}setTalkingArmed(e){this.talkingArmed!==e&&(this.talkingArmed=e,this.events.emit("talking-armed",e));}clearPlayerLeadIn(){this.playerLeadInTimer&&(clearTimeout(this.playerLeadInTimer),this.playerLeadInTimer=null),this.setTalkingArmed(false);}sendPcmChunk(e){if(!this.micMuted&&!this.noticeReceived&&!(this.ws?.readyState!==WebSocket.OPEN||!this.isConnected)){if(!this.pushToTalk){this.ws.send(e);return}for(let n of this.pushToTalk.gate(e))this.ws.send(n);}}openUserTurn(){(this.turnPhase==="speaking"||this.turnPhase==="greeting")&&this.interrupt({notifyServer:true,reason:"push_to_talk"}),this.sendClientTurnSignal("client_turn_start");}closeUserTurn(){this.sendClientTurnSignal("client_turn_end");}sendClientTurnSignal(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:e,turnId:this.turnId}));}catch(n){T.warn("Runtime",`failed to send ${e}`,{err:n});}}interrupt(e){T.event("bargein","interrupt",{reason:e?.reason??"api",turnId:this.turnId,turnPhase:this.turnPhase});let n=this.turnId;this.sessionId++,this.turnId++,e?.notifyServer&&this.sendClientInterruptToServer(n,e.reason),this.resetSpeechPipeline(),this.setResponseSlow(false),this.events.emit("interrupt"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setHeardSpeechProvider(e){this.heardSpeech=e;}readHeardSpeech(){try{let e=this.heardSpeech?.()?.trim();return e?e.slice(0,bR):void 0}catch{return}}sendClientInterruptToServer(e,n){if(this.ws&&this.ws.readyState===WebSocket.OPEN){let i=this.readHeardSpeech();try{this.ws.send(JSON.stringify({type:"client_interrupt",turnId:e,...n&&{reason:n},...i&&{heard:i}}));}catch{}}}stopSpeaking(){this.sessionPhase==="active"&&(T.event("Runtime","User stopped the avatar"),this.interrupt({notifyServer:true,reason:"user_cancel"}));}cancelSpeech(){T.event("bargein","server_cancel_speech",{turnId:this.turnId,turnPhase:this.turnPhase}),this.resetSpeechPipeline(),this.events.emit("speech-cancelled"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setResponseSlow(e){this.responseSlow!==e&&(this.responseSlow=e,this.events.emit("avatar_slow_response",e));}armFirstChunk(){this.firstChunkPending=true;}resetSpeechPipeline(){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.jobQueue=[],this.processing=false,this.turnOpen=false,this.activeStream=null,this.clearPlayerLeadIn(),this.armFirstChunk(),this.sendAvatarSpeakingSignalToServer(false),this.transcript?.finalizeAvatar();}grantedPageSurface(e,n,i){let r=this.capabilities?.page;return !r||!i(r)?(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","this avatar is not allowed to do that to the page"),null):this.pageSurface?this.pageSurface:(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","no page surface on this platform"),null)}runPageCommand(e,n,i,r){let a=this.grantedPageSurface(e,n,i);if(!a)return;let o=this.commandTurnId(n);this.queuePageWork(()=>r(a,o)).catch(u=>{T.warn("Runtime","page command failed",{command:e,error:String(u)}),this.reportCommandStatus(e,o,"failed",AR);});}scheduleReadAfterAction(){this.actionRereadTimer&&clearTimeout(this.actionRereadTimer),this.actionRereadTimer=setTimeout(()=>{this.actionRereadTimer=null,this.readPage();},pR);}commandTurnId(e){return typeof e?.turnId=="number"&&Number.isFinite(e.turnId)?e.turnId:this.turnId}handleCommand(e){let n=typeof e?.intent=="string"?e.intent:null;if(!n){T.warn("Runtime","command message missing intent",{msg:e});return}this.setResponseSlow(false);let i=this.commandHandlers[n];if(!i){T.warn("Runtime","unknown command intent",{intent:n}),this.reportCommandStatus(n,this.commandTurnId(e),"unsupported","unknown command");return}i(e);}dispose(e="SDK Disposed"){this.lifecycle++,this.cancelReconnect(),this.loadInFlight=null,this.teardownSession(4003,e,false),this.setSessionPhase("idle"),this.setPaintPhase("none");}setAvatarId(e){let n=e||"default";return n===this.avatarId?false:(T.event("Runtime","Avatar changed",{from:this.avatarId,to:n}),this.dispose("Avatar changed"),this.avatarId=n,this.startInvoked=false,this.load(),true)}stale(e){return e!==this.lifecycle}staleSocket(e,n){return this.stale(e)?(this.ws===n&&(this.ws=null),n?.close(4003,"SDK Disposed"),true):false}destroy(){this.dispose(),this.events.removeAll();}getPaintPhase(){return this.paintPhase}getSessionPhase(){return this.sessionPhase}getMode(){return this.mode}getTurnPhase(){return this.turnPhase}getTalkingArmed(){return this.talkingArmed}getSessionId(){return this.sessionId}on(e,n){return this.events.on(e,n)}markRiveReady(){this.riveReady||(this.riveReady=true,this.events.emit("avatar-ready"),this.releaseGreetingForPaint("rive-ready"),this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()));}notifyPlaybackEnded(){this.processing&&(this.processing=false,this.activeStream=null,this.armFirstChunk(),this.processQueue());}notifyAvatarLoadError(e){this.setPaintPhase("failed"),this.emitError("AVATAR_LOAD_FAILED","Failed to load avatar","sdk",{cause:e});}getAvatarConfig(){return this.serverReady?this.avatarConfig:null}getAvailableActions(){return Object.keys(this.avatarConfig?.rive?.gestures??{})}triggerAction(e){e&&this.events.emit("gesture",e);}avatarClicked(){if(this.turnPhase==="speaking"||this.turnPhase==="greeting")return;if(this.sessionPhase==="active"){try{this.ws?.send(JSON.stringify({type:"avatar_click"}));}catch{}return}let e=Date.now(),n=K_(this.avatarConfig?.performance?.playful?.gestures,this.playful.last,e,this.playful.busyUntilMs);n&&(this.playful={last:n.trigger,busyUntilMs:e+n.ms},this.events.emit("gesture",n.trigger));}setSessionPhase(e){this.sessionPhase!==e&&(this.sessionPhase=e,T.debug("Runtime","Session phase",{next:e}),this.events.emit("session-phase",e),e!=="active"&&this.turnPhase!=="idle"&&this.setTurnPhase("idle"));}setPaintPhase(e){this.paintPhase!==e&&(this.paintPhase=e,T.debug("Runtime","Paint phase",{next:e}),this.events.emit("paint-phase",e),e==="painted"&&this.markTonePainted(),e==="failed"&&this.stopConnectTone("paint-failed"),e==="failed"&&this.releaseGreetingForPaint("paint-failed"));}setTurnPhase(e){this.turnPhase!==e&&(this.turnPhase=e,T.debug("Runtime","Turn phase",{next:e}),this.events.emit("turn-phase",e));}startConnectTone(){!this.connectTone?.enabled||this.connectTonePlaying||this.mode!=="player"&&(this.tonePainted=this.paintPhase==="painted",this.toneSessionLive=this.sessionPhase==="active",!(this.tonePainted&&this.toneSessionLive)&&(this.connectTonePlaying=true,this.connectToneStartedAt=Date.now(),T.event("ConnectTone","Ringback start",{paintedOnEntry:this.tonePainted,liveOnEntry:this.toneSessionLive}),this.events.emit("connect-tone","start",this.resolvedConnectTone()),this.connectToneTimer=setTimeout(()=>{T.warn("ConnectTone","Ringback hit its ceiling \u2014 stopping"),this.stopConnectTone("ceiling");},P_)));}stopConnectTone(e){this.connectToneTimer&&(clearTimeout(this.connectToneTimer),this.connectToneTimer=null),this.connectTonePlaying&&(this.connectTonePlaying=false,T.event("ConnectTone","Ringback stop",{reason:e,audibleMs:this.connectToneStartedAt?Date.now()-this.connectToneStartedAt:null}),this.connectToneStartedAt=null,this.events.emit("connect-tone","stop"));}resolvedConnectTone(){return {...oa,...this.connectTone}}getPendingConnectTone(){return this.connectTonePlaying?this.resolvedConnectTone():null}markTonePainted(){this.tonePainted=true,this.toneSessionLive&&this.stopConnectTone("painted+live");}markToneSessionLive(){this.toneSessionLive=true,this.tonePainted&&this.stopConnectTone("painted+live");}settleGreeting(e){this.greetingDecided||(this.greetingDecided=true,this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),T.event("Greeting","Decision settled",{outcome:e}));}armGreetingBackstop(){this.greetingDecided||this.greetingDecisionTimer||(this.greetingDecisionTimer=setTimeout(()=>{this.greetingDecisionTimer=null,T.warn("Greeting","No greeting decision from server \u2014 listening"),this.settleGreeting("timeout"),this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&this.enterListening();},L_));}handleGreetingPayload(e,n){if(!n?.audio_base64){this.settleGreeting("empty-payload"),this.resolveGreetingPlayback();return}let i={greetingId:e,audioChunks:[n.audio_base64],alignments:[n.normalized_alignment??n.alignment??null],...n.visemes&&{visemes:[Lf(n.visemes)]},cachedAt:Date.now()};this.greetingEntry=i,this.sentGreetingId=e,this.cache.setCachedGreeting(this.greetingKey,i).catch(()=>{}),this.settleGreeting("synthesized"),this.resolveGreetingPlayback();}resolveGreetingPlayback(){this.greetingAwaitingPlayback&&(this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&(this.playGreeting()||this.enterListening()));}playGreeting(){if(this.greetingPlayed)return false;let e=this.greetingEntry;if(!e?.audioChunks.length)return false;this.greetingPlayed=true,T.event("Greeting","Playing greeting",{greetingId:e.greetingId}),this.setTurnPhase("greeting");let n={audioChunks:e.audioChunks,alignments:e.alignments,...e.visemes&&{visemes:e.visemes},sessionId:this.sessionId,turnId:this.turnId,isGreeting:true,jobId:++this.jobCounter,chunkOffset:0},i=()=>{this.greetingDelayTimer=setTimeout(()=>{this.greetingDelayTimer=null,n.sessionId===this.sessionId&&this.sessionPhase==="active"&&this.enqueueJob(n);},tg);},r=()=>{this.greetingWaitsForPaint()?this.holdGreetingForPaint(i):i();};return this.greetingWaitsForMic()?this.holdGreetingForMic(r):r(),true}reportMicPipelineSettled(){this.micPipelineSettled=true,this.releaseGreetingForMic("settled");}greetingWaitsForMic(){return this.reportsMicPipeline&&!!this.micStream&&!this.micPipelineSettled}holdGreetingForMic(e){this.greetingAwaitingMic=e,this.greetingMicTimer=setTimeout(()=>this.releaseGreetingForMic("timeout"),V_),T.event("Greeting","Held for mic pipeline");}releaseGreetingForMic(e){let n=this.greetingAwaitingMic;this.clearGreetingMicHold(),n&&(T.event("Greeting","Released after mic hold",{reason:e}),n());}clearGreetingMicHold(){this.greetingAwaitingMic=null,this.greetingMicTimer&&(clearTimeout(this.greetingMicTimer),this.greetingMicTimer=null);}greetingWaitsForPaint(){return this.environment==="meeting"&&!this.riveReady&&this.paintPhase!=="failed"}holdGreetingForPaint(e){this.greetingAwaitingPaint=e,this.greetingPaintTimer=setTimeout(()=>this.releaseGreetingForPaint("timeout"),F_),T.event("Greeting","Held for first paint");}releaseGreetingForPaint(e){let n=this.greetingAwaitingPaint;this.clearGreetingPaintHold(),n&&(T.event("Greeting","Released after paint hold",{reason:e}),n());}clearGreetingPaintHold(){this.greetingAwaitingPaint=null,this.greetingPaintTimer&&(clearTimeout(this.greetingPaintTimer),this.greetingPaintTimer=null);}enterListening(){this.setTurnPhase("listening");}enterThinking(){this.setTurnPhase("thinking"),this.events.emit("avatar_thinking");}holdsSpeech(){return this.processing||this.jobQueue.length>0||this.utteranceBuffer.audio.length>0}enqueueJob(e){this.jobQueue.push(e),this.processQueue();}processQueue(){if(this.processing)return;let e=this.jobQueue.shift();if(!e){this.transcript?.finalizeAvatar(),this.turnOpen?this.enterThinking():this.enterListening(),this.sendAvatarSpeakingSignalToServer(false);return}if(e.sessionId!==this.sessionId){this.processQueue();return}this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(e),this.sendAvatarSpeakingSignalToServer(true);}emitSpeak(e){this.setResponseSlow(false),this.rollScriptTail(e),this.transcript?.applyAvatarSpeech(e),this.events.emit("speak",e);}rollScriptTail(e){let n=this.scriptTail;n.jobId!==e.jobId&&(n.jobId=e.jobId,n.upto=0,n.text="");let i=e.alignments??[],r=e.chunkOffset+i.length;if(r<=n.upto)return;let a=[];for(let o=Math.max(0,n.upto-e.chunkOffset);o<i.length;o++){let u=i[o];if(!u)continue;let d=Wl(u);d&&a.push(d);}n.upto=r,n.text=[n.text,...a].join(" ").slice(-200);}getScriptTail(){return this.scriptTail.text}applyAgc(e){if(this.agcEnabled===e||typeof this.micStream?.getAudioTracks!="function")return;let n=this.micStream.getAudioTracks()[0];n&&(this.agcEnabled=e,T.event("mic","agc",{enabled:e}),n.applyConstraints({autoGainControl:e}).catch(i=>T.warn("Runtime","AGC toggle rejected",{enabled:e,error:i})));}async handleServerMessage(e){if(typeof e.data!="string")return;let n=Date.now(),i;try{i=JSON.parse(e.data);}catch{return}let r=this.transit.note(i.sentAt,n);switch(this.downlinkWatchdog.noteMessage(i.seq,n,i.type===US),i.type){case "avatar_config":{let a=i.config;if(!a?.rive&&!this.serverReady){this.emitError("AVATAR_LOAD_FAILED","Server config had no rive configuration","server"),this.rejectInitAck("Server config missing rive configuration");return}if(this.serverReady)await this.repaintFromPayload(a,this.lifecycle);else {let o=a.rivUrl?await this.fetchRivBytes(a.rivUrl):this.pendingRivBytes;if(!o){this.emitError("AVATAR_LOAD_FAILED","No rivUrl in avatar_config and no cache","server"),this.rejectInitAck("no riv bytes");return}await this.applyRenderPayload(a,o,this.lifecycle);}this.resolveInitAck();break}case "greeting_current":{T.event("Greeting","Server confirmed cached greeting",{greetingId:i.greetingId}),this.settleGreeting("cache-hit"),this.resolveGreetingPlayback();break}case "greeting":{T.event("Greeting","Received greeting audio",{greetingId:i.greetingId}),this.handleGreetingPayload(i.greetingId,i.job);break}case "greeting_unavailable":{T.info("Greeting","Server sent no greeting",{reason:i.reason??null}),this.settleGreeting(`unavailable:${i.reason??"unspecified"}`),this.resolveGreetingPlayback();break}case "notice_only":{this.noticeOnly=true,T.info("Runtime","notice_only \u2014 suppressing mic/greeting",{kind:i.kind}),this.serverReady||await this.paintForNotice(),this.setSessionPhase("idle"),this.resolveInitAck();break}case "resume_state":{if(typeof i.token!="string")break;this.isConnected?this.onResumeState?.(i.token):this.heldResumeToken=i.token;break}case "session_started":{this.resumeKept=void 0,this.heldResumeToken=null,this.sessionCapabilities=WS(i.capabilities);let{camera:a,screen:o,micMute:u,endCall:d,actions:g,page:y}=this.sessionCapabilities;T.event("session","Capabilities resolved",{camera:a,screen:o,micMute:u,endCall:d,actions:g,pageRead:y.read,pageScroll:y.scroll,pageNavigate:y.navigate,pageClick:y.click}),this.resyncMoodSwitch(),this.flushPendingContext(),this.noticeOnly||(this.firstPage=this.sendFirstPage()),this.serverReady?this.startSession():(T.info("Runtime","session_started before riv ready \u2014 deferring"),this.pendingSession=true);break}case "error":case "closed":{let a=i.type==="error",o=a?"SERVER_ERROR":"SERVER_CLOSE_REQUESTED",u=i.message||(a?"Server error":"Server requested closure");this.serverInitiatedReason={code:o,message:u},this.emitError(o,u,"server"),this.rejectInitAck(u);return}case "usage_limit_reached":case "avatar_not_allowed":{let a=i.type==="usage_limit_reached",o=i.message||(a?"Usage limit reached":"This avatar is not in your active slots, and your active slots are full");this.serverInitiatedReason={code:i.type,message:o},this.handleNotice({kind:i.kind??"plan",action:i.action,message:o});return}case "brain_error":{let a=i.message||"The assistant failed to respond";this.emitError("BRAIN_ERROR",a,"server",{fatal:false}),this.turnOpen=false,this.turnPhase==="thinking"&&this.enterListening();return}case "stream_health":{let a=i.service,o=i.state;if(!this.isHealthService(a)||!this.isHealthState(o)){T.warn("Runtime","stream_health: unknown service/state",{service:i.service,state:i.state});return}T.event("Runtime","stream_health",{service:a,state:o,code:i.code??null,detail:i.detail??null}),this.health[a]=o,this.emitHealth(a,i.code);return}case "tts_alignment":{if(i.turnId!==this.turnId)return;let a=i.audio_base64??i.audio_base64_string??"";if(!a)return;this.firstAudioAt===null&&(this.firstAudioAt=n,this.firstAudioLagMs=r);let o=this.mode==="call"&&!this.noticeOnly?jl(i.normalized_alignment??i.alignment):i.normalized_alignment??null;T.debug("TTS","Processed alignment",o);let u=i.display_alignment?jl(i.display_alignment):null;if(this.utteranceBuffer.audio.push(a),this.utteranceBuffer.alignments.push(o),this.utteranceBuffer.displayAlignments.push(u),this.utteranceBuffer.visemes.push(Lf(i.visemes)),!this.utteranceBuffer.flushTimer){let d=this.firstChunkPending?0:cR;this.firstChunkPending=false,this.utteranceBuffer.flushTimer=setTimeout(()=>{this.flushUtterance();},d);}return}case "user_transcript":{T.debug("Transcript","user_transcript received",{text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??null,event:i.event??null,msSinceMicStart:this.micStartedAt===null?null:Date.now()-this.micStartedAt,micMuted:this.micMuted,turnPhase:this.turnPhase});let a=this.turnPhase==="speaking"&&yS(i.text??"",this.getScriptTail());a||this.transcript?.applyUserTranscript({text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??this.turnId}),i.text&&this.events.emit("user-partial",i.text,!!i.isFinal),i.text&&!a&&!this.pageReadThisUtterance&&this.capabilities?.page.read&&(this.pageReadThisUtterance=true,this.readPage());return}case "user_speaking":{this.events.emit("user-speaking");return}case "user_stopped_speaking":{this.deliveryLagMs=r,this.pageReadThisUtterance=false,this.userStoppedAt=n-(r??0),this.speakReportedForStop=false,this.firstAudioAt=null,this.firstAudioLagMs=null;return}case "avatar_thinking":{if(i.settles===true&&(this.turnOpen=true,this.holdsSpeech()))return;this.enterThinking();return}case "turn_settled":{this.turnOpen=false,this.turnPhase==="thinking"&&i.audioPending!==true&&!this.holdsSpeech()&&this.enterListening();return}case "avatar_slow_response":{this.setResponseSlow(true);return}case "avatar_speech_starting":{this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()),this.transcript?.finalizeAvatar(),this.armFirstChunk(),this.events.emit("avatar_speech_starting");return}case "interrupt":{T.event("bargein","server_interrupt",{turnId:this.turnId,turnPhase:this.turnPhase}),this.interrupt({reason:"server"});return}case "command":{this.handleCommand(i);return}case "tour":{let a=Array.isArray(i.steps)?i.steps:null;this.pendingTours.get(i.requestId)?.(a);return}case "tour_unavailable":{T.warn("Runtime","Server could not write a tour",{reason:i.reason}),this.pendingTours.get(i.requestId)?.(null);return}case "action_run":{this.handleActionRun(i);return}case "action_state":{this.handleActionState(i);return}case "action_check":{this.handleActionCheck(i);return}case "gesture":{if(typeof i.name=="string"){let a=typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,o=typeof i.speechless=="boolean"?i.speechless:void 0;this.events.emit("gesture",i.name,a,o);}return}case "beep":{this.events.emit("beep",typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,typeof i.speechless=="boolean"?i.speechless:void 0);return}}}teardownSession(e,n,i=true){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.turnOpen=false,this.stopConnectTone("session-teardown"),this.toneSessionLive=false,this.greetingDelayTimer&&(clearTimeout(this.greetingDelayTimer),this.greetingDelayTimer=null),this.clearGreetingPaintHold(),this.clearGreetingMicHold(),this.clearPlayerLeadIn(),this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),this.greetingDecided=false,this.greetingAwaitingPlayback=false,this.greetingPlayed=false,this.sessionCapabilities=null,this.pageGeneration=0,this.lastPageContext=null,this.firstPage=null,this.pageSession++;for(let a of [...this.pendingTours.values()])a(null);this.actionRereadTimer&&(clearTimeout(this.actionRereadTimer),this.actionRereadTimer=null),this.actions.resetSession(),this.actionCallsSeen.clear(),this.actionFlows.flow&&(this.actionFlows.clear(),this.events.emit("action-flow",null)),this.actionsGrantWarned=false,this.armFirstChunk(),this.setResponseSlow(false),this.micMuted&&(this.micMuted=false,this.events.emit("mic-muted",false)),this.speakerMuted&&(this.speakerMuted=false,this.events.emit("speaker-muted",false)),this.sendAvatarSpeakingSignalToServer(false),this.isConnected&&(this.isConnected=false,this.events.emit("connection-status",false)),this.downlinkWatchdog.reset(),this.resetHealth(),this.heldResumeToken=null,this.lastContextSnapshot&&(this.pendingContext=[{context:this.lastContextSnapshot}]),this.netStatusTimer&&(clearTimeout(this.netStatusTimer),this.netStatusTimer=null),this.netStatusLastSentAt=0,this.moodTimer&&(clearTimeout(this.moodTimer),this.moodTimer=null),this.moodLatest=null,this.moodLastSentKey=null,this.moodLastSentAt=0,this.intentionalClose=false,this.serverInitiatedReason=null;let r=this.ws;this.ws=null,r?.close(e,n),this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),this.micStream&&(this.micStream.getTracks().forEach(a=>a.stop()),this.micStream=null,this.micStartedAt=null,this.events.emit("mic-stop")),this.pushToTalk?.reset(),this.jobQueue=[],this.processing=false,this.activeStream=null,this.turnId=0,this.sessionId=0,this.userStoppedAt=null,this.speakReportedForStop=false,this.deliveryLagMs=null,this.firstAudioAt=null,this.firstAudioLagMs=null,this.transit.reset(),this.pendingSession=false,this.rejectInitAck("Runtime stopped"),this.transcript?.reset(),this.scriptTail={jobId:-1,upto:0,text:""},this.noticeReceived=false,this.noticeOnly=false,this.visualState="normal",i||(this.serverReady=false,this.rivSrc&&(this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=null),this.pendingRivBytes=null,this.riveReady=false,this.avatarConfig=null,this.cachedConfigVersion=void 0,this.watermark=false);}sendAvatarSpeakingSignalToServer(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_speaking",value:e}));}catch{}}resolveInitAck(){this.initAckResolve?.(),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}rejectInitAck(e){this.initAckReject?.(new Error(e)),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}emitError(e,n,i,r){let a=r?.fatal??true,o={code:e,message:n,source:i,cause:r?.cause,fatal:a,retryable:a&&e!=="MIC_PERMISSION_DENIED"&&e!=="DOMAIN_NOT_ALLOWED"};if(this.lastEmittedError=o,T.error("Runtime",`${i.toUpperCase()} ERROR: ${n}`,{code:e,fatal:a}),this.events.emit("error",o),!a)return;let u=i==="server"&&this.initAckReject!==null;this.failSession(o),u||this.scheduleReconnect(o);}reportAudioBlocked(e){this.emitError("UNKNOWN",`Audio ${e} is blocked: the page has not had a user gesture`,"sdk",{fatal:false});}classifyClose(e){let n=e?.reason?.trim();switch(e?.code){case 4008:return {code:"SESSION_IDLE_TIMEOUT",message:n||"Session disconnected due to inactivity"};case 1008:return Ig(void 0,n)?{code:"DOMAIN_NOT_ALLOWED",message:"This page's domain is not in the deployment's authorised domains"}:{code:"SERVER_CLOSE_REQUESTED",message:n||"The service ended the session"};case 1009:return {code:"SERVER_CLOSE_REQUESTED",message:n||"Message too big"};case 1011:return {code:"SERVER_ERROR",message:"The service ended the session after a component failure"};default:return {code:"CONNECTION_FAILED",message:n?`Connection to the avatar service closed: ${n}`:"Connection to the avatar service was lost unexpectedly"}}}failSession(e){if(e.code==="SESSION_IDLE_TIMEOUT"){this.stop({intentionalClose:true,code:4002,reason:"Idle timeout reached"});return}if(e.code==="AVATAR_LOAD_FAILED"||e.code==="DOMAIN_NOT_ALLOWED"||e.code==="MIC_PERMISSION_DENIED"||e.source==="sdk"){this.stop({intentionalClose:true,code:4004,reason:BS(e)});return}this.stop({intentionalClose:false,code:4e3,reason:e.message});}setVisualState(e){this.visualState!==e&&(this.visualState=e,T.event("Runtime","Visual state",{state:e}),this.events.emit("visual",e));}applyDownlinkVerdict(e){if(this.noticeReceived)return;let n=e.state==="degraded"?"degraded":"ok";this.downlinkVerdict=e,this.downlinkScope=e.scope,T.event("Runtime","downlink_health",{...e}),this.health.downlink!==n&&(this.health.downlink=n,this.emitHealth("downlink","DOWNLINK_SLOW")),this.queueClientNetStatus();}transcriptPathDegraded(){return this.health.downlink!=="ok"&&this.downlinkScope!=="device"||this.health.ingest!=="ok"||this.health.stt!=="ok"}isHealthService(e){return e==="ingest"||e==="stt"||e==="llm"||e==="tts"}isHealthState(e){return e==="ok"||e==="degraded"||e==="failed"}resolveHealthConcern(e,n){let i=o=>o===e?n:void 0;if(this.health.ingest!=="ok")return {scope:"network",service:"ingest",state:this.health.ingest,code:i("ingest")};if(this.health.downlink!=="ok")return {scope:this.downlinkScope,service:"downlink",state:this.health.downlink,code:i("downlink")};let r=["stt","llm","tts"],a=null;for(let o of r){let u=this.health[o];if(u==="failed"){a=o;break}u==="degraded"&&a===null&&(a=o);}return a===null?null:{scope:"service",service:a,state:this.health[a],code:i(a)}}emitHealth(e,n){let i={services:{...this.health},concern:this.resolveHealthConcern(e,n)};this.events.emit("health",i);}resetHealth(){let e=Object.values(this.health).some(n=>n!=="ok");this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},this.downlinkScope="network",this.downlinkVerdict=null,e&&this.emitHealth();}handleNotice(e){this.noticeReceived=true,this.downlinkWatchdog.stop(),this.downlinkVerdict=null,this.health.downlink!=="ok"&&(this.health.downlink="ok",this.emitHealth()),T.event("Runtime","Session notice",{...e}),this.stopConnectTone("notice"),this.events.emit("notice",e),this.setVisualState("expired");}flushUtterance(){let e=this.utteranceBuffer;if(e.flushTimer=null,!e.audio.length)return;if(!this.riveReady){T.debug("Runtime","Holding speech \u2014 renderer not ready",{chunks:e.audio.length});return}(!this.activeStream||this.activeStream.turnId!==this.turnId)&&(this.activeStream={sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,emittedChunks:0});let n={audioChunks:e.audio,alignments:e.alignments,displayAlignments:e.displayAlignments,visemes:e.visemes,sessionId:this.activeStream.sessionId,turnId:this.activeStream.turnId,jobId:this.activeStream.jobId,chunkOffset:this.activeStream.emittedChunks};this.activeStream.emittedChunks+=e.audio.length,e.audio=[],e.alignments=[],e.displayAlignments=[],e.visemes=[],this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(n),this.sendAvatarSpeakingSignalToServer(true),this.reportAvatarStartedSpeaking();}reportAvatarStartedSpeaking(){if(this.speakReportedForStop)return;this.speakReportedForStop=true;let e=Date.now(),n=this.userStoppedAt!==null?e-this.userStoppedAt:null,i=this.firstAudioAt!==null?e-this.firstAudioAt:null;if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_started_speaking",turnId:this.turnId,clientLatencyMs:n,deliveryLagMs:this.firstAudioLagMs,stopNoticeLagMs:this.deliveryLagMs,clientRenderMs:i}));}catch{}}};var Lg=t=>{let e=new Uint8Array(t.length/4);for(let n=0;n<e.length;n+=1){let i=n*4;e[n]=(t[i]+t[i+1]+t[i+2])/3;}return e},ER=(t,e)=>{let n=0,i=0;for(let r=0;r<e.length;r+=1){let a=Math.abs(t[r]-e[r]);n+=a,a>i&&(i=a);}return {mean:e.length?n/e.length:0,max:i}},Pg=(t,e,n)=>{if(!t||t.length!==e.length)return true;let{mean:i,max:r}=ER(t,e);return i>=4?true:r>=8&&n>=4e3};var r1={happy:[{shape:"mouthSmile",weight:.8},{shape:"cheekSquint",weight:.2}],surprised:[{shape:"browInnerUp",weight:.25},{shape:"browOuterUp",weight:.25},{shape:"eyeWide",weight:.1},{shape:"jawOpen",weight:.4,mouth:true}],angry:[{shape:"browDown",weight:.85},{shape:"noseSneer",weight:.15}],sad:[{shape:"mouthFrown",weight:.55,mouth:true},{shape:"browInnerUp",weight:.45}]},wR={happy:.45,surprised:.3,angry:.2,sad:.35},e1=.3,t1=.2,MR={neutral:1,happy:1,surprised:1,angry:.7,sad:.7},TR=1500,CR=.6,RR=1e3,kR=2e3,xR=.03,OR=.2,IR=new Set(["browInnerUp","browOuterUp","eyeWide"]),n1=.1,i1=.3,Zf=t=>Math.round(t*100)/100,tu=[...new Set([...Object.values(r1).flatMap(t=>t.map(e=>e.shape)),"eyeBlink"])],nu=(t,e)=>{let n=t[e];if(typeof n=="number")return n;let i=t[`${e}Left`]??0,r=t[`${e}Right`]??0;return (i+r)/2},iu=class{constructor(){this.baseline=new Map;this.window=[];this.current=null;this.candidate=null;this.faceLostAtMs=null;this.last=null;}update(e,n,i){if(!e)return this.noteNoFace(n);if(this.faceLostAtMs=null,this.baseline.size===0)for(let d of tu)this.baseline.set(d,Math.min(nu(e,d),i1));let r=new Map;for(let d of tu){let g=this.baseline.get(d)??0,y=nu(e,d);r.set(d,g<1?Math.max(0,(y-g)/(1-g)):0);}let{label:a,scores:o}=this.frameLabel(r,i),u=["browInnerUp","browOuterUp"].reduce((d,g)=>d+Math.max(0,(this.baseline.get(g)??0)-nu(e,g)),0)/2;if(this.last={raw:Object.fromEntries(tu.map(d=>[d,Zf(nu(e,d))])),baseline:Object.fromEntries(tu.map(d=>[d,Zf(this.baseline.get(d)??0)])),browDrop:Zf(u),scores:o,label:a},a==="neutral"&&!i&&this.learnBaseline(e),a==="neutral"&&i)return this.candidate=null,this.current;for(this.window.push({atMs:n,label:a});this.window.length&&n-this.window[0].atMs>TR;)this.window.shift();return this.vote(n)}inspect(){return this.last}reset(){this.last=null,this.baseline.clear(),this.window=[],this.current=null,this.candidate=null,this.faceLostAtMs=null;}frameLabel(e,n){let i={},r="neutral",a=0;for(let[o,u]of Object.entries(r1)){let d=0;for(let y of u)y.mouth&&n||(d+=y.weight*(e.get(y.shape)??0));if(o==="angry"||o==="sad"){let y=e.get("mouthSmile")??0;d*=1-Math.max(0,y-t1)/(1-t1);}if(o==="surprised"){let y=e.get("eyeBlink")??0;d*=1-Math.max(0,y-e1)/(1-e1);}i[o]=Zf(d);let g=d-wR[o];g>a&&(r=o,a=g);}return {label:r,scores:i}}learnBaseline(e){for(let n of tu){let i=nu(e,n),r=this.baseline.get(n)??0;if(i-r>n1)continue;let a=IR.has(n);if(a&&r-i>n1)continue;let o=i<r&&!a?OR:xR;this.baseline.set(n,Math.min(r+o*(i-r),i1));}}vote(e){let n=new Map;for(let o of this.window)n.set(o.label,(n.get(o.label)??0)+1);let i=null,r=0;for(let[o,u]of n){let d=u/this.window.length;d>r&&(i=o,r=d);}if(!i||r<CR)return this.candidate=null,this.current;let a=Math.round(r*MR[i]*100)/100;return this.current?.state===i?(this.candidate=null,this.current={state:i,confidence:a},this.current):(this.candidate?.label!==i&&(this.candidate={label:i,sinceMs:e}),e-this.candidate.sinceMs>=RR&&(this.current={state:i,confidence:a},this.candidate=null),this.current)}noteNoFace(e){return this.faceLostAtMs??(this.faceLostAtMs=e),e-this.faceLostAtMs<kR?this.current:(this.window=[],this.candidate=null,this.baseline.clear(),this.current={state:"no_face",confidence:1},this.current)}};var NR={top:"top",middle:"middle",center:"middle",centre:"middle",bottom:"bottom"},DR=new Set(["up","down"]),Bg=t=>{let e=t.trim().toLowerCase();if(!e)return null;let n=NR[e];if(n)return {kind:"edge",edge:n};if(DR.has(e))return {kind:"step",direction:e};let i=Kl(e);return i?{kind:"axis",...i}:null};function ru(t){let e=t,n=new Set;return {subscribe(i){return n.add(i),()=>n.delete(i)},getSnapshot:()=>e,getServerSnapshot:()=>t,set(i){if(!Object.is(e,i)){e=i;for(let r of n)r();}}}}var au=class{constructor(e,n=Math.random){this.idleActs=e;this.random=n;this.pass=[];this.round=[];this.lastId=null;}next(){this.round.length||(this.round=this.planRound());let e=this.round.shift();return this.lastId=e.id,e}planRound(){let{windowMinMs:e,windowMaxMs:n}=this.idleActs;this.pass.length||(this.pass=this.shuffled());let i=[],r=0;for(let o of [...this.pass])i.length&&r+o.ms>n||(i.push({act:o,holdMs:o.ms}),r+=o.ms,this.pass.splice(this.pass.indexOf(o),1));let a=o=>o.holdMs/o.act.ms;for(;r<e;){let o=n-r,u=i.filter(({act:g})=>g.loop!=="oneShot"&&g.ms<=o);if(!u.length)break;let d=u.reduce((g,y)=>a(y)<a(g)||a(y)===a(g)&&y.act.ms>g.act.ms?y:g);d.holdMs+=d.act.ms,r+=d.act.ms;}return i.map(({act:o,holdMs:u})=>({id:o.id,holdMs:u,cycleMs:o.ms,...o.timeline&&{timeline:o.timeline}}))}shuffled(){let e=[...this.idleActs.acts];for(let n=e.length-1;n>0;n--){let i=Math.floor(this.random()*(n+1));[e[n],e[i]]=[e[i],e[n]];}return e.length>1&&e[0].id===this.lastId&&e.push(e.shift()),e}};var a1={quietToIdleMs:pg,idleCycleMs:0,playfulAfterMs:0,playfulRoles:[],idleTriggers:[],thinkingMaxMs:0},LR={has:()=>false,fire:()=>{}},Jf="trigger:",PR=.5,su=class{constructor(e,n={},i=()=>{},r=()=>true,a=LR){this.writeMode=e;this.cycle=i;this.rigHas=r;this.rigTriggers=a;this.phase="off";this.timer=null;this.cycleTimer=null;this.attending=false;this.idleSince=0;this.idleRole="idle";this.idleStep="idle";this.planner=null;this.hold=null;this.holdStartMs=0;this.holdEntered=false;this.followsRig=false;this.rigPose=null;this.timings={...a1,...typeof n=="number"?{quietToIdleMs:n}:n},this.planner=this.timings.idleActs?new au(this.timings.idleActs):null,this.followsRig=this.namesActs();}setMode(e,n){e!=="idle"&&(this.rigPose=null),this.writeMode(e,n);}namesActs(){return !!this.timings.idleActs?.acts.some(e=>e.timeline)}configure(e){this.timings={...a1,...e},this.planner=this.timings.idleActs?new au(this.timings.idleActs):null,this.hold=null,this.followsRig=this.namesActs(),this.phase==="listening"?this.listen(false):this.phase==="idle"?this.settle():this.phase==="thinking"&&this.armThinkingLimit();}rest(e){if(this.clear(),!e){this.phase="off",this.setMode("idle");return}this.listen(true);}connect(){this.clear(),this.phase="off",this.idleSince=Date.now(),this.settle();}resume(e){switch(this.phase){case "busy":return;case "off":e?this.connect():this.setMode("idle");return;case "listening":this.setMode("listening");return;case "idle":this.setMode(this.idleRole,this.idleRole==="idle"?this.hold?.id:void 0);return;case "thinking":this.setMode("thinking");return}}think(){if(!(this.phase==="busy"||this.phase==="off")){if(this.phase==="thinking"){this.armThinkingLimit();return}this.startThinking();}}restThinking(){this.startThinking();}startThinking(){this.clear(),this.phase="thinking",this.setMode("thinking"),this.armThinkingLimit();}stopThinking(){this.phase==="thinking"&&this.listen(true);}userActivity(){this.phase==="busy"||this.phase==="off"||this.listen(false);}setAttending(e){e!==this.attending&&(this.attending=e,this.userActivity());}busy(){this.clear(),this.phase="busy",this.rigPose=null;}dispose(){this.clear();}rigEntered(e){this.timings.idleActs?.acts.some(n=>n.timeline===e)&&(this.rigPose={timeline:e,sinceMs:Date.now()},!(this.phase!=="idle"||this.idleRole!=="idle"||this.holdEntered||e!==this.hold?.timeline)&&(this.holdEntered=true,this.holdStartMs=Date.now(),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.cycleTimer=null,this.armCycle()));}get current(){return this.phase}listen(e){this.clear(),(e||this.phase!=="listening")&&this.setMode("listening"),this.phase="listening",this.timings.quietToIdleMs>0&&!this.attending&&(this.timer=setTimeout(()=>{this.timer=null,!(this.phase!=="listening"||this.attending)&&(this.idleSince=Date.now(),this.settle());},this.timings.quietToIdleMs));}settle(){this.clear(),this.phase!=="idle"?(this.phase="idle",this.idleRole="idle",this.idleStep="idle",this.setMode("idle",this.nextHold(Date.now()))):this.idleRole==="idle"&&this.planner&&!this.hold&&this.cycle(this.nextHold(Date.now())),this.armCycle();}nextHold(e){if(this.hold=this.planner?.next()??null,this.holdStartMs=e,this.holdEntered=false,this.hold?.timeline&&this.rigPose&&this.rigPose.timeline===this.hold.timeline){let n=Math.floor((e-this.rigPose.sinceMs)/this.hold.cycleMs);this.holdStartMs=this.rigPose.sinceMs+Math.max(0,n)*this.hold.cycleMs,this.holdEntered=true;}return this.hold?.id}armCycle(){let e=this.idleRole==="idle"?this.hold:null;if(!e){this.timings.idleCycleMs>0&&this.armTimer(this.timings.idleCycleMs,()=>this.onCycle());return}if(this.followsRig&&!this.holdEntered){let i=Math.max(...this.timings.idleActs?.acts.map(r=>r.ms)??[0]);this.armTimer(this.holdStartMs+i+e.cycleMs-Date.now(),()=>{this.followsRig=false,this.holdEntered=true,this.holdStartMs=Date.now(),this.armCycle();});return}let n=this.holdStartMs+e.holdMs-e.cycleMs*(1-PR);this.armTimer(n-Date.now(),()=>this.onCycle());}armTimer(e,n){this.cycleTimer=setTimeout(()=>{this.cycleTimer=null,n();},Math.max(0,e));}onCycle(){if(this.phase!=="idle")return;let{playfulAfterMs:e,playfulRoles:n,idleTriggers:i=[]}=this.timings,r=n.length>0||i.length>0,o=e>0&&r&&Date.now()-this.idleSince>=e?this.nextIdleStep(n,i):"idle";if(o.startsWith(Jf)){this.idleRole!=="idle"&&(this.idleRole="idle",this.setMode("idle",this.nextHold(Date.now()))),this.idleStep=o,this.rigTriggers.fire(o.slice(Jf.length)),this.armCycle();return}let u=o;this.idleStep=u;let d=this.idleRole==="idle"&&this.hold?this.holdStartMs+this.hold.holdMs:Date.now(),g=u==="idle"?this.nextHold(d):void 0;u===this.idleRole?this.cycle(g):(this.idleRole=u,this.setMode(u,g)),this.armCycle();}nextIdleStep(e,n){let i=[...e.filter(r=>r!==this.idleStep&&(r===this.idleRole||this.rigHas(r))),...n.map(r=>Jf+r).filter(r=>r!==this.idleStep&&this.rigTriggers.has(r.slice(Jf.length)))];return i.length?i[Math.floor(Math.random()*i.length)]:this.idleRole}armThinkingLimit(){this.timer!==null&&clearTimeout(this.timer),this.timer=null,!(this.timings.thinkingMaxMs<=0)&&(this.timer=setTimeout(()=>{this.timer=null,this.phase==="thinking"&&this.listen(true);},this.timings.thinkingMaxMs));}clear(){this.timer!==null&&clearTimeout(this.timer),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.timer=null,this.cycleTimer=null;}};var BR=2,ou=class{constructor(e){this.writeControl=e;this.policy=null;this.role=null;this.lastAct={};}setPolicy(e){e!==this.policy&&(this.policy=e,this.role=null,this.lastAct={});}get hasPolicy(){return this.policy!==null}get mode(){return this.role}get act(){return this.role?this.lastAct[this.role]??null:null}setMode(e,n){return e===this.role&&(n===void 0||n===this.lastAct[e])?true:this.enter(e,n)}cycle(e){return this.role?this.enter(this.role,e):false}reapply(){let e=this.role;return e?this.write(e,this.lastAct[e]??0):false}has(e){if(e==="idle"||e===this.role)return true;let n=this.policy?.branches[e]?.gate;return !!n&&this.writeControl(n,false)}stop(){this.role=null;}enter(e,n){if(!this.policy)return T.debug("BranchToggler","no performance policy \u2014 branch not written",{role:e}),false;let i=n??this.pickAct(e);return this.write(e,i)?(this.lastAct[e]=i,this.role=e,true):(T.debug("BranchToggler","branch write did not land \u2014 staying put",{wanted:e,role:this.role}),false)}pickAct(e){let n=this.policy?.branches[e]?.acts??[];if(!n.length)return 0;let i=n.length>1?n.filter(r=>r!==this.lastAct[e]):n;return i[Math.floor(Math.random()*i.length)]}resolve(e){let n=e;for(let i=0;i<=BR;i++){let r=this.policy?.branches[n];if(!r)return null;if(!r.gate||!r.fallback||this.writeControl(r.gate,false))return r;n=r.fallback;}return null}write(e,n){let i=this.resolve(e);if(!i&&e!=="idle")return false;let r=Object.values(this.policy?.branches??{}).filter(d=>d!==i),a=new Set(r.map(d=>d.gate).filter(d=>!!d&&d!==i?.gate)),o=new Set(r.map(d=>d.act).filter(d=>!!d&&d!==i?.act)),u=[];i?.act&&n&&u.push(this.writeControl(i.act,n));for(let d of a)u.push(this.writeControl(d,false));i?.gate&&u.push(this.writeControl(i.gate,true));for(let d of o)u.push(this.writeControl(d,0));return u.some(Boolean)}};var lu=(t,e,n)=>{let i=e?.[t];return {input:i?.input??t,type:i?.type??"trigger",value:i?.value??1,binding:i?.binding??(n?"data-binding":"input"),resetMs:i?.resetMs,returnMs:i?.returnMs??vg}};var uu=class{constructor(){this.segments=[];this.playable=0;}schedule(e,n,i){let r=this.segments[this.segments.length-1],a=i??(r?r.start+r.duration:0);return this.segments.push({at:e,start:a,duration:n}),r&&e<r.at&&this.segments.sort((o,u)=>o.at-u.at),this.playable=Math.max(this.playable,a+n),a}isAnchored(){return this.segments.length>0}timeAt(e){let n=this.segments;if(n.length===0)return ig;for(;n.length>1&&n[1].at<=e;)n.shift();let i=n[0];return i.start+(e-i.at)}playableTime(){return this.playable}reanchor(){this.segments.length=0;}reset(){this.segments.length=0,this.playable=0;}};var $f="viseme",ed={plain:t=>`${t}`,prefix:t=>`${$f}${t}`,"prefix-space":t=>`${$f} ${t}`,suffix:t=>`${t}${$f}`},s1=["plain","prefix","prefix-space","suffix"],FR=/^(?:viseme\s*(\d+)|(\d+)\s*viseme|(\d+))$/i,Wa=t=>{let e=t.trim().match(FR);if(!e)return null;let n=e[1]??e[2]??e[3];if(n===void 0)return null;let i=Number(n);return Number.isNaN(i)?null:i};function cu(t){let e=[0,1,2,6,21];for(let n of s1){let i=ed[n];for(let r of e){let a=false;try{a=t(i(r));}catch{a=false;}if(a)return {format:i,shape:n,matched:true}}}return {format:ed.plain,shape:"plain",matched:false}}var td="Watermark_opacity";var VR=4e3,HR=6,GR=.2,l1=-90,zR=25,jR=200,nd=-50,YR=18,u1=10,WR=10,qR=500,QR=1e3,XR=3,KR=10,ZR=500,JR=30,$R=30,ek=-50,tk=-30,fo=80,nk=400,br=t=>t<=1e-7?-140:20*Math.log10(t),co=t=>t.length?br(t.reduce((e,n)=>e+n,0)/t.length):-140;function c1(t,e){let n=0,i=0,r=0;for(let a=0;a<t.length;a++){for(i+=t[a].mic*t[a].mic;r<a&&t[a].t-t[r].t>e;)i-=t[r].mic*t[r].mic,r++;t[a].t-t[r].t<e*.9||(n=Math.max(n,i/(a-r+1)));}return br(Math.sqrt(n))}var id=class{constructor(){this.buf=[];this.pausedAt=null;this.floorDb=null;this.floorComputedAt=0;this.erlSamples=[];this.erlSampledAt=0;this.micDb=-140;this.gateOpen=false;this.gateHoldUntil=0;this.gateLevelDb=-140;this.renderAudibleSince=null;}push(e,n){let i=Date.now();this.buf.push({t:i,mic:e,render:n});let r=i-VR,a=0;for(;a<this.buf.length&&this.buf[a].t<r;)a++;a&&this.buf.splice(0,a),br(n)>=nd?this.renderAudibleSince===null&&(this.renderAudibleSince=i):this.renderAudibleSince=null,this.micDb=br(e),this.updateFloor(),this.updateErl(),this.updateGate();}updateErl(){let e=Date.now();if(e-this.erlSampledAt<qR)return;let n=this.recent(QR);!n||n.renderDb<nd||this.floorDb!==null&&this.pausedAt===null&&(n.micDb<=l1||n.micDb<this.floorDb+KR&&(this.renderAudibleSince===null||e-this.renderAudibleSince<ZR)||(this.erlSampledAt=e,this.erlSamples.push(n.erlDb),this.erlSamples.length>WR&&this.erlSamples.shift()));}erlEstimateDb(){if(this.erlSamples.length<XR)return YR;let e=[...this.erlSamples].sort((n,i)=>n-i);return Math.min(e[Math.floor(e.length/2)],JR)}updateFloor(){let e=Date.now();if(this.floorDb!==null&&e-this.floorComputedAt<jR)return;let n=[];for(let i of this.buf){let r=br(i.mic);r>l1&&n.push(r);}n.length<zR||(n.sort((i,r)=>i-r),this.floorDb=n[Math.floor((n.length-1)*GR)],this.floorComputedAt=e);}updateGate(){this.gateLevelDb=br(this.meanMicRms(fo));let e=this.gateThresholdDb();if(this.gateLevelDb>=e){this.gateHoldUntil=Date.now()+nk,this.gateOpen=true;return}this.gateOpen=Date.now()<this.gateHoldUntil;}gateThresholdDb(){let e=this.floorDb===null?-1/0:this.floorDb+$R,n=br(this.meanRenderRms(fo)),i=n>=nd?n-this.erlEstimateDb()+u1:-1/0;return Math.min(Math.max(ek,e,i),tk)}meanMicRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].mic,r++;return r?i/r:0}meanRenderRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].render,r++;return r?i/r:0}isLive(){return this.gateOpen}levels(){return {micNowDb:+this.micDb.toFixed(1),gateLevelDb:+this.gateLevelDb.toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),floorDb:+(this.floorDb??-140).toFixed(1),erlEstDb:+this.erlEstimateDb().toFixed(1)}}markPaused(){this.pausedAt=Date.now();}clearPaused(){this.pausedAt=null;}report(){if(this.buf.length<10)return null;let e=Date.now(),n=this.pausedAt??e,i=this.buf.filter(A=>A.t>=n-500&&A.t<=n),r=this.buf.filter(A=>A.t>n),a=co(i.map(A=>A.mic)),o=co(i.map(A=>A.render)),u=this.floorDb??-140,d=u+HR,g=-1;for(let A of r)if(br(A.mic)<=d){g=A.t-n;break}let y=i.length?Math.max(...i.map(A=>br(A.mic))):-140;return {micPreDb:+a.toFixed(1),renderPreDb:+o.toFixed(1),erlDb:+(o-a).toFixed(1),micPostDb:+co(r.map(A=>A.mic)).toFixed(1),micFloorDb:+u.toFixed(1),micPeakDb:+y.toFixed(1),micPostSustainedDb:+c1(this.buf.filter(A=>A.t>n+60),fo).toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),micDecayMs:g}}provablyNotEcho(e,n){if(this.pausedAt===null)return false;let i=this.pausedAt,r=this.buf.filter(d=>d.t>=i-500&&d.t<=i),a=this.buf.filter(d=>d.t>i+n);if(r.length===0||a.length===0)return false;let o=co(r.map(d=>d.render));if(o<nd)return false;let u=o-this.erlEstimateDb()+u1;return c1(a,fo)>=u+e}recent(e){let n=Date.now()-e,i=this.buf.filter(o=>o.t>=n);if(i.length<5)return null;let r=co(i.map(o=>o.mic)),a=co(i.map(o=>o.render));return {micDb:+r.toFixed(1),renderDb:+a.toFixed(1),erlDb:+(a-r).toFixed(1)}}reset(){this.buf=[],this.pausedAt=null,this.floorDb=null,this.floorComputedAt=0,this.erlSamples=[],this.erlSampledAt=0,this.micDb=-140,this.gateOpen=false,this.gateHoldUntil=0,this.gateLevelDb=-140,this.renderAudibleSince=null;}};function f1(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e/Math.max(1,t.length))}var rd=class{constructor(e){this.onModeChange=e;this.pending=null;this.samples=[];this.blackoutStreak=0;this.lastEpisodeAt=0;this.mode="healthy";this.episodesInMode=0;}noteVoiceFrame(e,n){this.expirePending(n);let i=this.pending;if(e<aS){i&&i.endedAt===null&&n-i.lastVoicedAt>150&&(i.endedAt=n);return}if(!i){this.pending={onsetAt:n,voicedMs:0,lastVoicedAt:n,endedAt:null};return}i.endedAt=null;let r=n-i.lastVoicedAt;r>0&&r<=150&&(i.voicedMs+=r),i.lastVoicedAt=n;}noteTranscript(e){let n=this.pending;n&&(this.pending=null,this.blackoutStreak=0,this.samples.push(e-n.onsetAt),this.samples.length>eS&&this.samples.shift(),this.closeEpisode(e));}policy(e,n=false){return this.isStale(e)&&this.setMode("healthy","stale"),n?Cg:this.mode==="degraded"?Cg:Hf}currentMode(){return this.mode}lagMs(){return this.median()}getBlackoutStreak(){return this.blackoutStreak}clearPending(){this.pending=null;}reset(){this.pending=null,this.samples=[],this.blackoutStreak=0,this.lastEpisodeAt=0,this.mode="healthy",this.episodesInMode=0;}expirePending(e){let n=this.pending;!n||n.endedAt===null||e-n.endedAt<rS||(this.pending=null,!(n.voicedMs<iS)&&(this.blackoutStreak++,this.closeEpisode(e)));}closeEpisode(e){this.lastEpisodeAt=e,this.episodesInMode++,!(this.episodesInMode<tS)&&this.setMode(this.verdict(e),"lag");}setMode(e,n){if(e===this.mode)return;let i=this.mode;this.mode=e,this.episodesInMode=0,this.onModeChange?.({from:i,to:e,reason:n,lagMs:this.median(),blackoutStreak:this.blackoutStreak,samples:this.samples.length});}isStale(e){return this.lastEpisodeAt===0||e-this.lastEpisodeAt>nS}median(){if(this.samples.length===0)return null;let e=[...this.samples].sort((n,i)=>n-i);return e[Math.floor(e.length/2)]}verdict(e){let n=this.median();return n===null||this.isStale(e)?"healthy":n>J_?"degraded":n<$_?"healthy":this.mode}};var fu=class{constructor(e,n,i){this.runtime=e;this.sensorProvider=n;this.vad=null;this.controller=null;this.initPromise=null;this.playback=null;this.speaking=false;this.micMuted=false;this.handedBack=false;this.framesPushed=0;this.voicedFramesSeen=0;this.userVoicedAtMs=0;this.voiceRunStartedAt=0;this.voiceWakeSent=false;this.partialsWhileBlind=0;this.trace=new id;this.asrLag=new rd(e=>T.event("bargein","policy",e));this.lastEchoLogAt=0;this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0};this.dutyBreaches=0;this.sessionStartedAt=Date.now();this.gatedFrames=0;this.farEndMs=0;this.softPaused=false;this.uplinkDelay=[];this.echoGate=i?.echoGate??true;}setPlaybackControls(e){this.playback=e;}setSpeaking(e){let n=this.speaking!==e;this.speaking=e,n&&this.runtime.setAgcForAvatarSpeech(e),e||(this.softPaused=false),n&&e&&this.resetBlindWatch();}isUserVoiced(){return Date.now()-this.userVoicedAtMs<mS}isAvatarAudible(){return this.speaking||(this.playback?.hasPendingAudio?.()??false)}setMicMuted(e){this.micMuted!==e&&(this.micMuted=e,e&&(this.controller?.abort(),this.vad?.reset(),this.trace.reset(),this.uplinkDelay=[],this.asrLag.clearPending()));}effectivePolicy(){return this.asrLag.policy(Date.now(),this.runtime.transcriptPathDegraded())}prefetch(){this.runtime.loadVadWeights().catch(()=>{});}async ensureInit(){if(this.sessionStartedAt=Date.now(),this.controller){this.runtime.sendClientVadStatus(true);return}return this.initPromise||(this.initPromise=this.init()),this.initPromise}async init(){try{let e=await this.sensorProvider.create(await this.runtime.loadVadWeights()),n=xg({isAvatarSpeaking:()=>this.isAvatarAudible(),pausePlayback:()=>{T.event("bargein","soft_pause",{mode:this.effectivePolicy().mode,...this.trace.levels()}),this.softPaused=!0,this.trace.markPaused(),this.playback?.pause();},resumePlayback:()=>{this.softPaused=!1,this.trace.clearPaused(),this.playback?.resume();},commitInterrupt:()=>this.runtime.interrupt({notifyServer:!0,reason:"barge_in"}),getActiveScriptTail:()=>this.runtime.getScriptTail(),isProvablyNotEcho:()=>this.trace.provablyNotEcho(10,60),getPolicy:()=>this.effectivePolicy(),onTelemetry:i=>T.event("bargein",i.outcome,{mode:i.mode,policySource:i.mode==="degraded"&&this.asrLag.currentMode()!=="degraded"?"health":"measured",pathFault:this.runtime.transcriptPathDegraded(),blackoutStreak:this.asrLag.getBlackoutStreak(),asrLagMs:this.asrLag.lagMs(),clause:i.commitClause,onsetToPauseMs:i.voiceOnsetToPauseMs,voicedMs:i.totalVoicedMs,postPauseMs:i.postPauseVoicedMs,wordlessStreak:i.wordlessResumeStreak,transcript:i.transcript,motion:i.speechMotion,medianFlux:i.speechMedianFlux,modulation:i.speechModulation,...this.trace.report()??{}})});e.onProb((i,r,a)=>{if(this.isAvatarAudible()?this.voiceRunStartedAt=0:(this.asrLag.noteVoiceFrame(i,Date.now()),i>=.5&&(this.userVoicedAtMs=Date.now()),this.noteVoiceForWake(i)),i>=.5&&this.voicedFramesSeen++,!this.echoGate||this.trace.isLive()&&!this.isWarming()){n.onVadProb(i,r,a);return}i>=.5&&this.gatedFrames++,n.onVadProb(0,r,null);}),this.vad=e,this.controller=n,this.handedBack=!1,this.resetBlindWatch(),T.debug("BargeIn","client VAD initialized"),this.runtime.sendClientVadStatus(!0);}catch(e){T.error("BargeIn","failed to init client VAD",e),this.initPromise=null,this.handedBack=true,this.runtime.sendClientVadStatus(false,"asset_load_failed");}}disable(e){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null,this.dutyBreaches=0,this.handedBack=true,T.warn("BargeIn","client VAD disabled",{reason:e}),this.runtime.sendClientVadStatus(false,e);}pushLevel(e,n){this.micMuted||(this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=n/16e3*1e3),this.trace.push(e,this.playback?.getOutputLevel?.()??0),this.logEchoHealth());}pushPcm(e){if(this.micMuted)return;this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=e.length/16e3*1e3),this.trace.push(f1(e),this.playback?.getOutputLevel?.()??0),this.logEchoHealth();let n=e.length,i=Date.now();this.vad&&(this.vad.pushPcm(e),this.framesPushed++),this.noteVadCost(Date.now()-i,n);}noteVadCost(e,n){let i=this.vadCost;i.calls++,i.totalMs+=e,i.audioMs+=n/16e3*1e3,e>i.maxMs&&(i.maxMs=e);let r=Date.now();if(i.at===0){i.at=r;return}let a=r-i.at;if(a<1e3)return;let o=Math.round(i.totalMs/a*100);this.vadCost={at:r,calls:0,totalMs:0,maxMs:0,audioMs:0},this.noteSensorHealth(o);}noteSensorHealth(e){if(this.vad){if(e<sS){this.dutyBreaches=0;return}++this.dutyBreaches<oS||(T.warn("BargeIn","client VAD cannot keep up",{dutyPct:e}),this.disable("sensor_too_slow"));}}isWarming(){return this.isAvatarAudible()&&this.farEndMs<1500}logEchoHealth(){}onPartialTranscript(e){e&&this.asrLag.noteTranscript(Date.now()),e&&this.noteBlindSensor(),this.controller?.onPartialTranscript(e);}noteBlindSensor(){!this.controller||this.micMuted||this.isAvatarAudible()&&(this.farEndMs<1500||this.framesPushed<lS||this.voicedFramesSeen>0||++this.partialsWhileBlind<uS||(T.warn("BargeIn","client VAD scored nothing while ASR returned words",{framesPushed:this.framesPushed}),this.disable("sensor_blind")));}resetBlindWatch(){this.framesPushed=0,this.voicedFramesSeen=0,this.partialsWhileBlind=0;}shouldUplink(){return this.handedBack||!this.isAvatarAudible()||this.softPaused?true:this.isWarming()?false:this.trace.isLive()}noteVoiceForWake(e){if(e<.5||!this.trace.isLive()){this.voiceRunStartedAt=0,this.voiceWakeSent=false;return}let n=Date.now();this.voiceRunStartedAt||(this.voiceRunStartedAt=n),!(this.voiceWakeSent||n-this.voiceRunStartedAt<pS)&&(this.voiceWakeSent=true,this.runtime.noteUserVoice());}releaseUplinkFrames(e){if(!this.echoGate)return [e];if(!this.isAvatarAudible()){let a=this.uplinkDelay.map(o=>o.frame);return this.uplinkDelay=[],[...a,e]}let n=Date.now();this.uplinkDelay.push({t:n,frame:e});let i=this.shouldUplink(),r=[];for(;this.uplinkDelay.length>0&&n-this.uplinkDelay[0].t>=fo;){let a=this.uplinkDelay.shift();i||a.frame.fill(0),r.push(a.frame);}return r}reset(){this.vad?.reset(),this.controller?.reset(),this.trace.reset(),this.sessionStartedAt=Date.now(),this.softPaused=false,this.uplinkDelay=[],this.farEndMs=0,this.asrLag.reset(),this.dutyBreaches=0,this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0},this.userVoicedAtMs=0,this.voiceRunStartedAt=0,this.voiceWakeSent=false,this.resetBlindWatch();}dispose(){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null;}};var d1=`
19
19
  class PCMProcessor extends AudioWorkletProcessor {
20
20
  process(inputs) {
21
21
  const input = inputs[0];
@@ -29,11 +29,11 @@ class PCMProcessor extends AudioWorkletProcessor {
29
29
  }
30
30
 
31
31
  registerProcessor("pcm-processor", PCMProcessor);
32
- `;var $R={};var Qa=()=>$R;async function ad(t){let e=()=>t.state==="running";for(let n=0;n<5;n++){if(e())return true;if(t.state==="closed")return false;await Promise.race([t.resume().catch(()=>{}),new Promise(i=>setTimeout(i,400))]);}return e()}function f1(t,e){let n=2*Math.PI*t/e,i=Math.cos(n),r=Math.sin(n)/(2*Math.SQRT1_2),a=1+r,o=(1-i)/2/a,u=(1-i)/a,d=o,g=-2*i/a,y=(1-r)/a,A=0,p=0,_=0,C=0;return N=>{for(let B=0;B<N.length;B++){let M=N[B],w=o*M+u*A+d*p-g*_-y*C;p=A,A=M,C=_,_=w,N[B]=w;}}}function ek(t){let e=t/16e3,n=t>16e3?f1(7e3,t):null,i=t>16e3?f1(7e3,t):null,r=1,a=0;return o=>{let u=o.length;if(u===0)return new Float32Array(0);let d=o.slice();n&&i&&(n(d),i(d));let g=Math.max(0,Math.ceil((u-r)/e)),y=new Float32Array(g);for(let A=0;A<g;A++){let p=Math.floor(r),_=r-p,C=p===0?a:d[p-1],N=d[p];y[A]=C*(1-_)+N*_,r+=e;}return a=d[u-1],r-=u,y}}async function d1(t,e,n){let i=new AudioContext(n!=null?{sampleRate:n}:void 0);try{await i.audioWorklet.addModule(e);let r=i.createMediaStreamSource(t),a=new AudioWorkletNode(i,"pcm-processor");return {ctx:i,source:r,worklet:a}}catch(r){throw i.state!=="closed"&&i.close().catch(()=>{}),r}}async function h1(t,e,n){let i=n?.sampleRate??16e3,r=n?.workletUrl??Qa().pcmWorklet,a=r??URL.createObjectURL(new Blob([c1],{type:"application/javascript"})),o;try{try{o=await d1(t,a,i);}catch(C){T.warn("Audio","Mic graph failed at requested rate; retrying at hardware rate",{requested:i,error:String(C)}),o=await d1(t,a,void 0);}}finally{r||URL.revokeObjectURL(a);}let{ctx:u,source:d,worklet:g}=o;ad(u).then(C=>{n?.onSettled?.(),!(C||u.state==="closed")&&(T.warn("Audio","Mic AudioContext stayed suspended; uplink is silent"),n?.onBlocked?.());});let y=u.sampleRate,A=y!==16e3,p=A?ek(y):null;A&&T.warn("Audio","AudioContext rate is not 16kHz; resampling mic uplink",{requested:i,actual:y});let _=n?.onFloat32;return g.port.onmessage=C=>{let N=C.data,B=p?p(N):N;if(B.length===0)return;let M=new Int16Array(B.length);for(let w=0;w<B.length;w++)M[w]=Math.max(-1,Math.min(1,B[w]))*32767;_&&_(p?B:B.slice()),e(M);},d.connect(g),{stop(){try{g.disconnect();}catch{}try{d.disconnect();}catch{}try{u.state!=="closed"&&u.close().catch(()=>{});}catch{}}}}var m1="data:audio/mpeg;base64,//NoxAAQoEqwX0YYAgWUtG/4iIiP4gmnbGEAQgg8Hwffghh/D+UdwflAxhgDg+D4P1AgGMH//0f/xOD74gBAEDkTg+f1BjB8P/xOH//lAQTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAyU8beX5qYAoBQKBQKBQKRWKhaLRaI66OG/9uYyG5nliZ+kagG+7LE/aonsG5wGQguIG4Buhk4VQwHQwFRjnDPEBJgvkKpRHG4gOK4LMH8zHkZMrmiZgbtoldJM8Zm6kFLrq5u6CabS2QA8SBP0urqQKiaCFNZoXzU+m6zdP/17ugzJGhoT5FB6JkkhhEAJEUiITDIjm/9tNjRbp6lpvxWghcmSZJIc4qk+XiGk0LmHk+b///ZbvdNr/5iRMexwJEMIeOQQwi45iBBy4fWbm5uRRMA//NoxAAxM6qIDd2gAAtTM1rEplLKRQC2TSSBGtNNMAAdMJiRM2QgMGwMZMn6o2UACYSlOdTBiYyCmYPAypqocIQAEBRBEmyqVTQdAJjgMDJANEAKBiQHkXQFQADAYQCI4gKBOsXh3OklOniuhWgdLpgipTutkUUUWRRR6VJKit0HRRy8pjJToOK4bKMUTVFFraSST6LM9FJ0kkv86pMsD4E4l1FT3SrVbrqSSRZFettLRRszoE+I2SWicU9X/U6Js+o1fZReRRV0TyyImQlhj9+lMQU1FAAA//NoxAAlK8acvtjbTcHLdvf5d9i9yXPS99B9utHCoOi1FG4OeF8C3ZhQwfsRpePfGLdnVu1VuY8pyoFWX1jeGqCRZ5579mRST6Yxcoq+R8FEv/Skv4kmLJofL6TM0FrLE00PmyXZSOs460ElPf91JJuXA+BSl5NKp7LXUqtbsu3//6hiiRbX9n++dJSjLtbcxL7vsplBFjymSLpQNn4hp+XSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAqO8ZwHOpbLAoVyV2U25ungghAEmA93XVf1ebIiExzTMHEk1eo5GCIDAUCTAqCDagsRwNAEAu480iMvJFY/HHnh0lAQwQE+CEHl1RkugFQUhvSMpCe4yzZtjvvwED1vV2yyq/dz1GU36mpNPVnPR2ok8EhKaJ1GtVRl9T6nVMUdVS209FFRkEEJS61amu6/XWtv/tq60R9BaE7myP/+t2qTX90n+kZjhIDrOoGZpvfydCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxw9qxVsofVoQGvVss/nr/weufw+o1xZagafii6k2sP27AikB07rRSG5fKHftP5ORNy5cwycYhFY3G599IEic/Xt4A0MLeKp7SveyzyDHvdj4Mm0l40k9FeKhXIp7SqyDCw/AoRBcyT7IFBovANx6JLwKKKKL2KGFnwL2iS8Gg9QxwU4+nNOPU/GUdnk0HNP7a3Ahv4DyVQNbPI8mY3N4/wyVf3s8uXQOFjjxJr71/n/4zf7tjX+bZtT3+vu+NZ3TKncMXjtGIe/iPJQ2ho6tMQU1F//NoxAAvM96kBt5QmQXNLKmeW5Owl+r8uX1HQYPmnYxgi+D0DVORLLLIJh4cwXig5DFqCcym0QQ2hSXq6Z0tsAhh+xraSravxAQhKMA2y2B+YCi0qcGxcv3t0sax0noIQ6smuxEHs0qQHaXbWNEnMeUKnXNWw4c3K4bD2lqLGSsNRTuqHOa4rRQ8k1oprpUaV5W2ldtq+Pu/uogtVHRbyOKtozb4ememuuJ9I9l5jsdfIxDnHbOa0c010LGzMMo4erQcbMLUOQ+IWTEFNRQMACQgABAAAAAA//NoxAArM9qUDuNRbSqPeP1MZyq/qTpQIYk5j+s6hZjXOHMRihcqyfp27CITiRpkWdnPCVzdaedhhzUiQDGfQenohPg6Vt6BQcRI+KxV/qH7k1f5jrVe9paK2WZF50rI0kUcyNjFCutFSWmkZO3mTOy0FhYmjr1ttpWqM3C1/yTXEcM26zE1XCKrX1yt8RDMdyvqv/w1//P/txxMSuugswsc0hl2qclSih0M2qjr4p4Kuq1NgioQZ8WVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsY8J8FurLUQgbjjXprUEPq5QWAEWLhPxaqfDcwwFTG2CD5kIzDkBx4QS+6D69gsD40hr/U7d2nvtLn9d6ILJQtHQHKoKmgAwBQD0M1RCEBxICAqEJkqEwyAcALpe+KmhQ1FjIVmKjlGjnNeeTfFw6W6TYh0N9rozj//69gFyfF9/Ef9BJeecSeZ6mYuxWvXqzmtsy0Mli5SpVWIeT1ar5hG/b+bEs4kIPooQD5Lzy3H1GxcXfBjDvapTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAA//NoxAAo88KEHu6alA4pJZaPlaT1YgzAMFVyIzKmhgABDD0CjlkaDLiUoXTeF8UpDUB3ihbY5VTR6U8lUPQxcLwH9SiTZVUwQtTKGBwicAwxCMxqzVLpgU3ZVGbMy5ifN32ol1BVVZyrer+l+yC2TE9BtGpQQZR2q30vSZf79SV/PJrUtKi95qkfQWpnWizbsfTSU1uuvff//1mJtH030rOYrWm2+ktGYJnjxV2FRLUhMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAnpA6cFNGHQRqf7P+fuVt0QEpdoC0w2DppmNsnVXAYYxByHznltQVqJsPS/UHQcWI/FWhib7ppgwu0R9JBlZdMqi1TuPRW5eAwGFkyd46dhxbv13c4gAAO7v8iObn/9d3dz/d3d3Afd3f0Rz/iIjn8RERz9EREPRERE+Iif5In7u6fa7u5e7u7n9f/R3dzRE//JE0AAAQgQARMi//0T///rv/XdwNw9MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3BqMDOZQlSCNTWuW5mWJPGGAKY0TQYSWvOK6JiRPnjw6jMiUBioHQlBWwDZAEQDFFml1LNXTZdpYZQJFZnTzAmJvbUOPsy0YfSgh93n2hVIUDYRnDktrCIWvJJnmVFRU0VFYlRUVFRUV/+pVVZmj6VWFmv6Ulm5quV+a/H88rXBzKqrVQ2qytZTWtfdlM39tcX////fzX/zUmrWqk1Iqq338M2xtcCxTeq8MzXx1DM3BTft3DMocs+bhSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAArLA54HuoPWQnGoQI699JMZNAEYQBgwGD7KGK4KhUBlZ1gjB1mzt8OgwH14EIcv0vAwHEAwjBOOv4+bpAkCI4gOzwp5qCEyRkVWgOnFZDGhwHwcDCpX5m7OD4jDXFHJNNSmWRoypr2Uyf8aElrWNo+yJ4ZZniFqJr4XqaZnH+vN40Uu++skZf9eMCOILtHoY7QW3JuSOhdzed/uv/82Pln6b/5hyETMwThIR06f//99yrEiBjCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAm7BaIHuDbUDLtu5JRS4Y/Gh0BCQAMHoAOb85HUEBDNTW5MazDjLYZpGBGAAFbn+zbPbkR7hYpJG04wIGGkvHJpvNmI0KXN1f5ktGyE+TIcqsDL/2G/OgxCFrTEV1OcdsEpZZaqR59G2p+uYk2ndPMTqlIdnCyMXWtlLQdJJlmClpvdTt////8usp0q1Jpf1rUSKaOkYCSrXV2/a//vuyZiVsxkmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3A5kEu7UlA+TMr9eJij5vKARGQUMXwWDNuQSJumEIEGInhm/BGGeD4qCCEwU0IA8Kkp+QUUDMplzvhQCfmUMXlcZdIYA2bGzno8HLYXwzVh46HGLBNRB2fuQMPDyYhICakWyVGdXKV6FWMVzR4jEF0Rh+eQkp1B9myxhXfRHMoa5i6a1IqfmemQi0vdnQ93W88hMO////9jqj4ZFlupmb+e5jiuMTXdRWEEUPq19Pu3nulNqzRkE4lsAqYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAAty/6QFt5Q0RwRSkYmaac37GGvg09K0N8oHZ+KyJOkLNVrXIoMVCM2GFOHZxHcEsGy2VEBZgsoi+icqFMMcAQNM1cuuBACsIt+nIsCHDiAouyDk1V2nJ0K3u8/ErmrGHM/rePc9Ke1eop4W7mbririUmKn+klqLKBYJR7wtpL/9Xz1//9f/zfM2hZ6TFJPVpNpFOlWk308U8K83XHdSNF4q0n/4+eIp4Mn6/9Sf/+pKDxjC2UXhXeB1pNpzZAtTiYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAt076MFuLbVS/tpkqofr4v87zvkhhDBlDkuUxFWeJZFHFbbHYm1UwFezFwUBQFEIAUmgqXKcR712zTc3hZkomYcFHKdtXca8jKHAlTKC5fFX2MxtND0pU6Gxw1Fh57YPSx9Xd8OPe2Xxc0bQfahUfcLtuToCw7jFMtSlrns5qq31USla/9y6G1H06KQ1AzopqOIG61Uj51A8ZOtmpNexx2mLo1s6zpqdG9kkb//9+cPfWa/49ShU5xf9/u9ZDQmhMQU1FAwAJCAAEAAAAAAAAAAAAA//NoxAAvJBZ4FuGbTB/ils3LMpXORFhqUoAX4YGFotYIQOYetZyQOjwVdNR9PVV5kz+nojQHCRCqCla3UbE15tqCRL6h9BCYdKKyI2pGRzUNMXmK+djZI4K9TvOHq/y10/+fUa318ue1ajRL82m11Y1TCnQUdDljxUpStExMfpIMy0mWXal6j/60VxJgzvb1rQWr9Tosy2q6TfUqeDietT7KRq12UbHVmhkiSJpapZKDuLVGC1KLpcApxyuplKR2WzIakUzFBe0+pMQU1FAwAJCAAEAAAAAA//NoxAAp665wFu5azS6adkuuUU5DELbgxMwGKcHGQmO4DBTBZTRqXCICFSKAShN0xMRE7wCk4EFTwhZz84RWjhpfZdFySoOfXC1VlLXlkoW2PBNjhdq5ibpHqT7OWeeMXVrpHmWugYmr0mVNbqqov6Jg+sFZNnV11p+yy63ahf2/XuTgflKVt3t+r0etdBvu7mYQqKtvZ2+pmdVKSqCFSlkskipFaBgcGgli+CaXTIO/Le/80mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxQ6pcDV6gADyrAkVsO/AzW0eiyRgzAvlYiBfwWAMMC8BkwGBozIOATMCwBwv+YE4BoEAgBgAhgJBnGiEH6YJAMBECaFABlAU4g/oyZUEfkGBvwdYhoBYMM0FvIFQQbIJAHlGgMaFzQ6xO58ihKG6aalmayePNbRRXsgYe9SCqNGbutF00y89BWkzLUIDKNC+ZuowLhcQTLhcLiDG9N13MXu7snd7bY6BJk0l1JdKy70Gr9//1qQLwoMtMmbI//60Pa3ZLX3NiOSebV3XrTEFNRQAA//NoxAAx6/Lpn494AqQAABPPLtvXdrv//fCR9MafKhArcG4r7MTRbXmjSKaMrzr5vdn3ojBt/D5aHrdoXfZxA1oWcbn/4xFIqHC9pYL22/bf3/SnpSiHwXr2E+Zov/xvezLQtfFvPMMCqnAHDUnoJ+ohSoShsb/5m//OhwViscGePu990PcB8kiRyJP46kOg6xjwcf//0x6f4o/vun//3WDCYnL2fQWWbVreTfrTWJf8TfWb7pr6vd48iP7//3vf729i40zQYi5bma1vbNdf59t5tqTaYgpo//NoxAAwzBaAF9yoAAWapz+2asSQRGEQ8YlehlAkmFAE0Iz8WzIIgMPjoyX6DfZDIAIAg8llWMAhQxisjLglCBC7L8WYwLnFkkEFzEoBAAiukYBjJngYRBgGCwADhEYCbRKIIiELmI4gouEmSZYutUkpaToUJoh9bfWi/vR2ddXo1VpD8JGXS6km7uuyupIzXdSkk0dt7+utZKEiujtrP1K6uqtKpTrooppsupOOg3RomKn///db+db7pMkk5gpyfSZSZoZJlE2VNUUlPpGR9SYgpqKAAAAA//NoxAAli+KUHttPUFt975se9vdhksMQ8HrmbkZGrPE8JgswEs6kpA8EbpRkoWBkXzWd3tLVqxyNRSJAVCjcXUfeXUBoXS2zl+82SSSaub0E0yTSu1aCt8vLQV00TJOq0/1rZSGXgbxgaIMt1KZHf6KPm2TU82j0+OigMv/UKoy2foples5XuutQoE5A5HX//p1Mf47+0Iw9zkOMImnI0wci1SYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArw95oEujPSSQClnSR6q4a6TBljjVEC3AC4MmBD1sPRgMdT6E/HDhuCAVMEQLAwNonmDo9BjPlAFsQTrRjeqYfmNw+y9iBQCQGDIwmRtQJJEHAsr1ZQhBMwcAZ1LViHrgUAAcw/TAIdIKBDHbad83wFRpM9tXOs/NZ2qxoAOY9KO2/1nfpnvtU2PiIHv+ijQXjY6z0NT7K6/+p420X/+c6mPQKk2tlWOTzCo4Lj1HBSLBvc4tYqrtMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAww9ZwBO6UmBnhdqVydu66TAswDRMAQcE4wDBjwjg0JRhMBxg+e50KBgChw+ShyYUDS5mYZs3QQgBwgCAC1iiZgARehxKrc0T2HlBw4bgeclrmvPwvsCi1UQYEBQBCuAkeEUHla2u9nb/zlent3rUnJz3MMJDHQgMMY8jJyRp9z1qe7zDGoxjKUD0VD2bzz3z1vtf+6Cod3dUYWQTeZpx8RTfaeljL+ayqqWQ0hE07Hx/q/+26E5C3com3RxkNmVx4QlnPljw9D6yWIExBTUUDAAkI//NoxAAuE9Z4FuZQ0QCDakronZdSnYiYFERqcREAtFiiaXWaXJgMGAXqnKSIIQyBgYh2DAa74kTTRoTUIWw4wUFBSr6vzGHpQCtouYv8mNah503kSpIjTjUASy0waAWSQ2bukS11+ZqCnZitrJmOO6Thm+oKO5JNWFX+vZfZr9WutYFlrtdfmFX4/9v6/hjpVe2q6EoBmEFViOWrn9Y66+P69lmrZoxvXrVQ0/H//8/mh16123/6Xp1A+xKaxRsJnVUU3nUTEFNRQMACQgABAAAAAAAAAAAA//NoxAAv0/5gFOjVbQWWtr6qzvJL05fwwJGszTAtYo8fpuoiRhCAxgyDhiZx5iSNhhEDpfIoA54gSERgyUhn6FhCAbcmMvyWWeFpHIk1uOpGMvEgyWc7qqkGv4DQEMHwBpYYn4Xqal9NunfipKaTilrQr/HNR1otiONMjOnux005omh3rrD9FQwQV53d36z5iYmMYbVEQgEcIz1OeqHPOO+k9c9kv5vaqkw8MSs7v/zzEy49M2QjK6H3uLBhcgOOcfNIizMQ6kqIReJWExBTUUDAAkIAAQAA//NoxAAm+95sFuYOlSeJbjQ3a5GI5FR0ymMRoQDYMUJ0caDyEKoCMXWU2IDiZq/lGG3sGOSCCabu7kvYbKYpqharB8PJuuu71E5b5St/zEaWTuNuWMSeOkWUOWql1IDrXOuuXOZv5ph8vFBJTGqfO7GGbT6uguOXvqd/zRkgv7nhMqvb//Kula19Hf0UR2Z2z26f7NULk36nnaPzzUnGo5FqGGSmpPkOQpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAvS4JQCu7QmAkp1haUiAFgYVAoUTkwsDUwUSox0Dk6+wMxxBURhUYsPWc0AqRIsZMFMBYaHCUyx8PJVzDA5/kGE4kyGiJ6uUzlYQeBl8kIKZwErFgd3G8SSYCbUUrFcWk3UuwmzuZZTavvLYttCKfST+qqB5MStTctGPSnoqLjmG1/yx381NwNqE6/5El81NGxFB6rJc/bCAFxgxZlOonruPrJ/+MfP0MleJc2xCmK+xqxx/P/svmkXz2MF75I/ACZAM719iYgpqKBgASEAAIAAAAA//NoxAAqe7qAFtjLeRkTk1fP7VLSkAyCigVKlEjKbIvYsgwYHNQAYGUweVVQACRmjQaQyGdCAkASVda71iRSPrDq7afTK2IBEF3PYAkImIuyG3HtumzufqRiMXs69i7T2zRCcQm7+WX38uIVe6I+hZ/u8RCDgYGIru8RE0Trno76fn/u5/1zAEAABHQuIhdSF1w79d34nohV30I6aJ5Tqc//zs0+hJCTndAEAjsHA4xsZmx7454AmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtzAK1fsIe+8AhKa3bb54a/9yWcgyVjI6KmbuoTDNS1jAQj83GYl1NTU0QzarQByQajijg6tV5lVhrba8VWijlhm/vMKO1Ug4WWBZpFVWpWtrkletdQk8SI6lU1KJm3V7rEaurQo19QaMNYuvi1s2fRrfMF7XXq+HjNZ8+rWtaxcb19f1q9VrLb1rWa0K3+7bzXWWMxXHVf62/tCt/8//G7e2sf/fvi2sPrbmgtrA9iywI0PcPEj7dsSXx/4NWYKYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAxA7JYHOrbVAE5WKcsdopW05uRgENJkcD4NEwDFEaeIEEGEnuYADCa0BuYCgshJb5E4wWBkxnvI2RAkBBsRBA05LAcCcdABC1mEyzCUOSu4xiAwtSzVMBj8oJQQFgLXNGpTM9OsNag9mBmVX7Wl3U88sa9eO4PSyumuuEl4qz1Ut7rhM1A8Ph0vrOtk1l1uf3Pdyv9XFRNNp17uipY8AhEkWdJTqqm2ips6gtmqa2paTIKUmmOAPKTpLb//+5r86a99U1QY4BgM0hbcqlMQU1FAAAA//NoxAAvw8ZQFuobURlBhCKjX2xzL/LZAATmZQeAEECIsjXEugESgGA8xCL4x2E8MBNQUKA0YVgQAQFMT4cH3WCBfSISedYcAIKAAxd3Z4RgW+C1iqBhMiyhS31it3dxEIiE5psvv0NXLqgxdDAuKj6ofoT9tsw6hOM+eqh76i/1e55uo/oOzTjl36hV/9aR/qq2/XUoXAlc4s2RdaatWronEGTdFJFVJ0D5TKDJmx4OgLWXS6bOy1//7NMU/njCyqqSjps6S1LNUKHcTEFNRQMACQgABAAA//NoxAAs+8JcHuFbTA065GY9yWxykcJlZoIFkAZMOgc048QABXqMEPA1SFRwALVbmjknoYdJh6UXBgviD3MyQTKOL/m6ZeENwO6IGCKvGUu7RRZ6mPbt5/6mLRaCxHZSwUUF0vlZB67FSrspkUtWFF5EWyBqbhJTVZuaWTUkYoGyDOpb0zJJ9Gyr6l6k5wQQjH0TVJFzyGqySClqQSM0UNrrW6jBbnq0jcqCmurdd/1d0l62W1dJJmPtzAy7WPvIXpiCmooGABIQAAgAAAAAAAAAAAAAAAAA//NoxAApEgp0Ft5QlRgCttHzlHBqHQx46EoEEgqfgWXC9adRl2sawwGIKhKLwoOgYYBmDe5WuLCBAaKiW7GVfyuRw2/ZbQy3wx8zzxAMrxrEMryQCPTCp6znCwjkNQ9BcYt1cVdSi3aD0dJjVv//mJtHSfllKBYSUUt06TEzEsOPFCxhRo8wMjAqS9U6wY//0fdH//tuxXXKTBx7EWr////9Xs6r+p6a9ByaLfn6+8/WUxBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAlmtp0HtjbSFLK7tabUomL1OF4gBFaKCKJmqKttdBh9Yd0FqwQuSRFpgXQAdfS+xuQvtXf65NUL2PWWxNSN1Y2O1ZTyalkuq7s9sXgZY4kyPIQKt/FBanmnYe30K2RX7rRY3JgLMsmKDqXUnXoqWp51S7tqrbf9j6KB+srPorNVOm3sikj2mtmQOgNKK6Rk34gaWOkLipMUFxRAWXEE8mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAwq6JIFO7WzAKShgrdGUJzrSTvMFYaNhRDICqLfmwiPAYljAwRTAeoDUItTAAGlbSQC4cGAQMIR6BVbJdqKJJKwjAWuV0o+/Kw7d2HKqH4uwIBjCw4tgwZqogAhole2XSKvYehdqJbJSutspxU7c62oqN9L//B5tKPnPuuGucet+fAznbPnWlLpbV/XFxbbmbfmrP93/7YX/4falKenM9dtY3uHXFWyFYqqps8X9O76+47+OXnoVPkk9bmqJmrjrLfbjoxTw+whbcrYmIKaigYAEhA//NoxAApe2JIFObKlBkSRnEOOcmktctSYlzh/sNGCVUCisehLYOJAyHTG/+P8pkycGEiUAAiTZICGBqonJNTWFbnG1ZmMqyua87XmMwCqQ6BDIAFo6uZVEknAEd3KteriYXRYjMZitdRJy0dwZCuwlYxtWuOk19zjqM9gGS+q7edGPVF6KUny/2bRCi5ZTuHTPOk4nKlUDpxZEILGbqRO856W/SWRDjSLY+waCYW0OIWVdiYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAu+2JIDO7KmCLJAzd5LA6eiOhiKYRx2A5hSIA0eZqYWJgWEYoBhiOMh16DhhYoYQJgpmNFCTIjQUmzDigzQWMPJzDQAxQOFQUBDDMXSdxiblKhQEGsjS7U50kC96JQAAhYGUqFgQCADkv0kQ7r3v48bvyu5epx8TsQj72VFlVCHQXVlRNSK+pxjkOjB9GOgOinR5O5Luky3rLVfVmZTiDKhboPa6jggOMVZGM7aDH3cZWkmrpS7P//rEQOtOieJCOXstvWmIKaigYAEhAACAAAAAAA//NoxAAq0oJkDt4Q0SOWt8JM3TKHYSBSEfxjAREaUjNWQHAqe5rtGbC2GKiZEWmBgQIAjIygyz/K+09fH2nPANuL0AAWUL+XLAjLnhXbI2SwFDRc0gYe7ibAcIcCs9MFbTD1LXCib8xKxfr3jpppuvn5qUuaadov/27Xb4tVphqNKHNrF1FrO01/8ft8TE1C000ooGxFZv33lhyKzPr/p70KqmvrympAoYmI8RdymqzvWWmZ7ztufpMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAApUt5MHOjNcAnHXCdL7KDKQaS9xg+ept2HBhiSY8VZhoqoICcGASYjRea0AMAgtIgmhoAAGYBgkYAEWbMhgX9ROUVWqVAJXmsWQQ4z2GnryREdmGoajUZAASiQMyNrNHKaD6W53DWrt+WoZNTIuJgKIEy/blNqFcSG2CgKnUkbKNlDnNzp9//mxeV5qV3m72ORD5lutHDe7bj427kt8x56PzILw2+5VDLu/AuJY1MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArmqowAO6K0PQ5Fl0mxEDIEAQwJ3U5LHAxHZcwxDox2owwgActOZxaSffBqY4AsYqgkjgWXAAcGPMonKpAHFBlC8HB4EBhQZCg5CgFhlpiB7dGVm/TLyl8CQ1Hhg2NiXidO/zV6zV3KKbCZlnGoo0cNOyKhhcVEm1L9WIpTVUm3TR1ufSl7rx2ri7bqQzvRWc3IFAw0oeKLOOCRrvOqPaKu3hZakdfLPTZUUdiR8WCYxQ8sggYbWmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkImpUHubQWE7tLYLMqq8pGQFiGiggMBDcIKTV4MoEUVTDDs3IjHghobYZM0gwfjMSOGLtIZ9XkbtNrPYMKo6alLu40tX1DIERSpruI4nGjhqfA2xBj/xKJmMiWx9d/Ag5LySPJrqyLcd6EslzdjFLMMv+etZf+OquW+YRuxICuGk1x4VDwqeHgQUc5os54oH1ssWplXNXeUTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAr+vJEBO5G0FknWtqDusnIFQGMKGDNEgRAgLmCQBGdxcJ7opmAQSDRSMcTlMAASFQQMOAyMFYvM3hBO9M01zHDV21ks+X3Lllpy25f8wSTNBC4RnkquXIgETUTvBI5jhlr0rH4nM5+VxuG5fY+kwQIAAAgw4t3P64d3d3/vuLd35l/7hw4GBvogGBgYdzhZ9tO2xEXpu+RLTe1CQYZcGHQsjpFm06WeSaJC8kQiriwc//fsQUBAEAAmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAj44pwHtjLSBNZt+NY2cqaChwvB1Ao5FQUzsdkxi4PRRWE2HXUBMGmQMfN/NLqZUsE4sZjuFWtLqcmDoalViZlLAYFq3JTGaUBEr/+Zsx1ozMzNqX7ZMqku1PahjFLoJAYPB5cxkM/0ZqOxSllpKrK0qpMPDHRUGlY0WEmzGK7qUqb3K3KUoqIkVS9n+y7fpViP2KcRMOiVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtGm40DO7QzBQAEASw6gLjOir8xGM872IEKBwYMA+cCBaYbgCYQCSYuPSYChwFgkCAWEQVGEgYmCoeGK3pmhR1GBB4sDKWlgOC4/F10MySoEIayBNJX53RaXNMGASzkteNCSmrNyuU/UFxBs+RPEBENu45GtU8fnNT3tc/w4cq13XVevzcxg1g26/mftach6t5GKL46bhkac63ThwyGqse49gCsiHb2RV67GttL7/lX4X1NXWSPNDZNTh27WmIKaigYAEhAACAAAAAAAAAAAAAAAAA//NoxAAoqnY0Cu6UzBQR6kF5frBVKTBYag9bCAFhgCjZNmjBIFCQAzGA1zIYIAgNR4ExAFoCBQwxEAyArE+IIA6gM0IEeAt6tRZhfF5GqkQlmLtqVHvbFvmzoOsmgpIxB9wKK/czPKnnyppA46yS5VFfe6KcWbc7RlUjZ2bIGSr7zHBwscfpdE7tMWpeuer3ObM1Y5VJT1OV0QpSWfGahNaneJv9VMlsfetDGTynL3piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAmKnpEHO4WyAU7eF9sciYO8id4EI41CBEDAIgJMbjRZ2FQAMEguMWALJQMS5bsl4XbMMh9OYAVGuve2JiThQRBdyUvA5UM3zs9a8IdR5y8Mg9FbNjXZ764s3qfnbf/e6a+IuqfTanpW7cnMS6slPhiQC4QRKnnpZM1Uf8/3PeyWd1/9IXKJEN2StNtpPC7FywNTjXGzQNJFhc5c/7Mr/9EgmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArgu5QFtmHVBgCsDM6OeuZKZmFSh3Q0YUKF6jLVgHHYgADBEw2QoMmDgwYVvdQEgpgpoeoimFEQCGGjls1JumkGzCMu2ytJ4xYmMwJgElhQAXA/dYuAgY3Nl8OuPWQaILTLJ7Cj04z03d2QTx02QdPobH/e/Hj3piB6d20PphCSBpPYwnpCiEk6BFA6wdMxC0zELh7aPcT+volldC3/z/iURvErxYEJ0QGTDBcPja9ou6TRpJukExBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArqoZADObQzHlI2drcekaygqBCX1GojuGHlFQx4HQ4fggAmETOeUFoCCCmCcaOQWD5iR1nhgCY8HrQBwUoUCg3Nf6RLSlbnTJgAxtCPZJyIDBAYLByk3VQ8f1l0rkUpluUdBxZw022tTdSLhtUtGlYZ6/bRZWFRpNNKsk4lRh0g2KAWKBsebRVio5YFnFRwseCk4VNKOlWaGlY9a4tqtGdmu4vNSwJPDowLjCUKMZXX+vsbUOd7UpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtgqokAPdQXELE5l4lsAuAIYBgDZgqpCGMGEeMBEAYSTNslDEUKCIRDFotztQXzCcBggNVnA0GAECZk8Dp7cGpg8BQYAaRIsBZgKBjaK3LqYUhaIAOBIAmFwbmoQuFuTAMKl8JJtIUcWNAUVvTMgFwbBDI+XJklubkcISP1yXUfFQsXzBR9/+aOr4sZfySo396djrsb9u3j4z82Yi4577+Jnpmm/J+L7uP8dBadMVyWKB9XzLGqdqPWVY+QdfpTEFNRQMACQgABAAAAAAAAAAAAAAA//NoxAAi2qJEHuDNNEpNtCGvxuMxhz18mI5AEh8GhxS8xQGw4LFo0XDLQpGAqu92WzPUBEIbGErEHzdprLXYDm6SXxGhZ4+hj8CpfODq2BAjJ5vJfn0Uve0xp8YGHMvcMPDBf36/L/IYY0cPwgfUdLCFJeYVdMu5hSbx63MdT/qOVlJumWk0FU8pbYnU1GoQfvLPVF5FSf2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAoAqIsFO8QXAbtBw7C62kIRhwEmJa5B7zjQbmEQwahRA6EgECzB4OHjcFwQs9M1EQmCwUzhgg2uEv1oi6otTtLiuViUsKLdgZcq4UOd+BIbgyH4Efi9L4sKGi6DikiZXmpzP4nQLT/D/f7il73FJcXEWEg+8hrsR671Z1si+A9uMfOLLF/YlHXD8QIr1GMkRFuaG1sp1jnajqDjbx3sUZ/Zd/uaouj6uxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtSg4wDO6M0A0AwJ3YLLOJ+rmMBwxOgQWMDwxHgMMMj5MEwCYyYcCIBhEGAWEYDlUHDBcPDEwXzRUbDL8XDUETYljXAw7sbYgYw4YNeKnAQHDBREVLfLlLxFtggiDlQRIEl50NRUumtQBDUaIg4mAACOaeC11iKZrsdh05VFRyJJFawS2fcdkt/9w7Mez0RrN2LKdpZ3JK1nZ/8+fvv1sZyX307iWOmQKaExQg1kNCtLScXvV092n//dp5z8gmIKaigYAEhAACAAAAAAAAAAAAAAAA//NoxAAtq0YkDO6QzB0APAUxaEpXF1zBICDBA7zactDAYfTD4CjC5xDEgNxYNhk0jPAHhQFAwFAgCjAUFgMC5jhbJnQDQcPYYGL06Ro2DTAs2RRpHdlD9OszGVyqBUVmBGbpG/PDI9AIoYnOpEFwTC8FmsNQqah5WW/5IP+fvt5tat+riU5l4eYburp+GtL65XHGDnYejCS2YbT1dZtqLJGtsU7j5lpEVK2iJ7tr5qe/m//hZ5+6////xvTw17CZ/byHemIKaigYAEhAACAAAAAAAAAAAAAA//NoxAAtk7oYAumFWIL4Hgwj8CKODwNmHAjkylGEglGPAlmqOtipVgYViQ1DYgMxABAOCIWBNBAAQoMQKJA10t3EIXmCAMpsgoBYwq9/JFHlqZZ14tAVA9UOoFI/NDnOSnI/Qq1irfDdd6c0SGf59uhH9Ksk+/bdF8+s0tGf7P8Zm9D/Xdz/Zfdpj0HOay0elunUnK95jlVdwwf72nn/tTs3Yo1gq3aqj1D5hf5+9l61K5H1c9166prpxKNOADKSCmO6ExBTUUDAAkIAAQAAAAAAAAAAAAAA//NoxAAsw0oYAO4QyCAAC9K+QuEIFBsw7AAwPFAyvHswKLYEgWcFUkYfh+Y3gIQDwbfCcBgRMDAkGALFgFL3GK8wnPwxBOTCYAMTyAoLrwzkRetwaGlkrf38eCjhKES0Xo4ecFSqDG1mc92q84YH91EHze0Uli7TDvS8/dpaQ8dvKx9d3DJRCxntx3OmxiNC3jmT3G3vfG23c/U46amPeNR/pNY+a7m4+vyom28ZdlIiWJkR1wgFCdApQWOIkvZqTEFNRQMACQgABAAAAAAAAAAAAAAAAAAA//NoxAArCrYoDODNcDMADgSXkV242KM4iKxk0sAQjAQFnW0iJIVoxiQ7HOA+IQWXMVc8YgFBrZmnLjGXWZCUAZhC4VhFVS/aeinBd9dQAAScoCBiS6zi2ClIOAZfRCh04qw9530pYfoIcqzkrl+g4HCAxG3WsABS00R0T67hFMu3t6btEDsIBmBsl0p/IfS87topTv9PKQfvrSpk+oXSi9hbO/v/8paC6ddRw125ZyKsV6yiLdTsMc6mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArk2Y8BOZG0Z4jDK2CxFNBCeQDQz+MRCCBCAzRB1Egs/hpVTmrA0BQA8I0IQYBxkeG0aCY+SAUXZc/pjgMRgEuqh2V8XlRwTGS6CSS2KzS0ykzABFDhYYuaxBYWBFjQ3FZiHqGWzMZh6qJDCgEQAo1RuUy5rx2vxy3P/h1F2okMLEgWzlDX/7WUp1vKKl+/5dn8GZjpMagnb/Iz8MU2BgmMNbelEFKRn5fy/+5fSYLxHrH4yuldxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkInY4FOYGzBvvSC3wcJTR7y9LIw8HGHwULDYxiajB4AEQRMlPcz8KRYKNwEgU/4wDTFGzPhCAaiz1zYkiM0p+InRPvL5e7QLlBj/TEKrNypoHxyr8Ow6WDQcizWZ/5Is/aX+rBaRTjAiNVMwbkpqZX/LKs/Mi85CzzkX8smQjpjhh6PwMYKiNQSHyoDSCpNTHOH19+vs+vtTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuKpIgCu+QsAoMGgGLZJoNGTSUVMM0FOOQCMJxLDgAMJxMIhsMIwEMOhxMaQJMGgGLICwYrCA4CowwBvTROBTMEwABS9KxmYwAbAqaydU27jcF2sAMEACdds4taHuOFKG+w+S8FwlDSw2SHoj3ED5kPqe1gaPObqVZmvZ8VrmVZU42ZSpqiLdk5iensb1v9jxm+Oq4sq5x92hMdyOxOp8STnw7D5OEiRJrjMetK3JU9sC1zOdD1JGLMuahcgZYeuyaYgpqKBgASEAAIAAAAAAAAAAA//NoxAAsk4YcAujLdEDICLSXOpYXDFgRMK4XNvyQMMwrMQwdMVm3BoGA4LgYJxkOIiJRgmBAOA4DBSYLBYZBJwfcF2ChsWHX6luYDgcXMWnD0ZfiIxeGDDEIJe8Tw1fu00WvVbNyxjRWeYfvGmFtSVwakWTiVyFQXn6aqq2fJntDZe3TVDhzbMjLQzgtaRHxIZFZtAA1yHrbkoKo7ILWH23Ml9XyLv3oT7p3wo36PRqj0JpRsPHoSDi4cyB33UrTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAA//NoxAAr6mYkCuZMzBoFgq1tajwgoAmGgcYe84Q4zIIVMHAQzVoEgTBJXM/kMzeVTAQoMSAcgCJiIoGUDgYeih5Q2iFYS1RuassCCBlSI8AQAwBDKOM5g5Lh+gLGFAKt8nlDZQqKDg0x0ACxIowRMGpEAAg6Hwv8WFk917Pp3Lv29wQMxlb19shsgqLZ7t3fdyMjPj7V9y7u2yK8Zjae///bHynZ1OsegkXiUc2Fyjfqr6NVFlq+l4oKN3dCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAA//NoxAAp0tYsDObG0BFApN9HxSKYYp0DdGb+WThkoZNs6ExAKzBAjMvOs9uRgMSxIOSMs8YFEBjsKHLCKZYNmGAq3XLX6vpMmPNjRRfh7zDSQcnzIyYmHnSYk0UKBocARuCnda61mHYZhmWymU00al2AYMKlbY22OuqhVVV2ZhWz1c22Y84ff0FVVEqvc2MzP5VoXuu1PM/ypjakMerIx1IL40LHySTv0VcKDTEn9xd37vzj0xBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArq0YcAOoFVEiTBEGjA4Fw4SwgAE1jCyhz94GzBIIgqHxzpQwYQRbEwiHU2ZGgwGFNc6hSwSHMwMGw04BNO51GhqbIZMqSKkTsS+EF3UExgKRyegOBJrjgRphMCwNfu5T6KT2N+AmquZgfIzTrEaJa2jrVoU+7G1TTcMOuxv9y8zVjKq7e+eR3Mj0sQLa77RoioZGu8yPMpnUZGjpp8GzzvV9Mja6kppdmqkLQ9qrUu++0A8g5sOpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsC04cAO7QeE/mHKDBQCQIABhWAZkknZ/gFQ0Thdw6LC4yMAcxMKGQ818KDgUOfl9pEJOmAahzwiz5qrZYytmON2qzzdrEnUJHE9GpOWdoqCjfdz/paudOFrZLYaLy+J+RBsfkrZAXKtLE1tFw8oJnlbbGXVSjiUffSRt1PfW437Pm85qLx1N4hQ+dFwozpKkR/8bZfd3PfzVyN66jkf/8H/7Q91HPP/6j7WV4kVUtKEnVocbrBDX1piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAte/IkC12IAB8S9oGjF0DBIHjBQBjAoiDq4VQEPJi0MBuMoZjuKZgiBphqKJggExYAQOBpJ1FAHAwYEGAQg6pczBlGE4OYTZcKZJl+QcBOKhBiDkXc3LRWSN5fQRJ0+xkkpjFKtk3NTdNXUW1qSun7vN84k6zZF0KSjxupk05cdbo6CKR9nerUlRQQT6dtWYe6Zm6+pM4gpnWtJlqZbMfdk6zM/tplv10var6jB/rT9Tn2+qyt0kFV6n+cdkggmIKaigYAEhAACAAAAAAAAAAAAAAA//NoxAAybBbhH42gAgCARROByOhyOx8L/UtdKXxxakALwA2+aLcV0li94AQcChAAJYB0FzEOEdjB2wMlbA968KEBawbGyZJhGr8MYgYkaHiC08ZcWWYqfV/FnjjIOJwLIzYcYj0WR/5Ax3g3UEakGAxQoLhQGgYCgBuVEUWR//D+hYuLaDcsN/H8MjixigxmyuRcgJGEVRKRdmVSX//k+5cRTPE2VzAuMaMmgUnWVTAfzUmDh00l1Rj////oUGoN/OsViImBwyENHaYjydHJOpmZMkVKBLpg//NoxAAuy76UF9yoAT0Tk0ctYzkFvqMDMwwBpFWjAqAEAQo6jpZFAIKQDKDMBfVdMG9fmC3zyJ4pkCFJCUwbtAAA4GHBuBpgfAYaDYBADAsKQxiH6i4AFBaHKjXIkOcpJTonDJE6ZJXLpdLs8tbPTN3Z12ZK1TpI+q3tXpEcGXhmzxkXjZ/79SRsmykq0epWmitlJJJPR1rRbq9kUbVzIvU0Vl0y+pSX0UW20kn7ot1JGJqjSMiLGyVq60V6kjJJYn0FFSlH/eEmIKaigYAEhAACAAAAAAAA//NoxAAsnBJ8DutLbCtxxrtemjUy0YADOLLRDDAHdtFoDElQBv3zCcDUgVV37ayvltGtOcjrI5qRRiHMU3CIAg4EQgLDQkUwSFBCBQWAEtcj2FwiMMw1DAOfZTNVd+4PjElxs3MPkFMooMiuSb+bl1lUKZhoLYyU6/7Zec7ZTmISIzY0tRUfXkcwuMdWdA622lKEV/1TmdTS6RjGEgV4oecTClHNbyfv+v8tmxMOl5Bgw2yzXSskUnRmdu869FHJiCmooGABIQAAgAAAAAAAAAAAAAAAAAAA//NoxAAr/A6AFurLUTWdj0siDsTctekwCAcOSV1Ggu4roMBQwhI88FEIID8v0u984Zp2G08g7NTkNNinI2j6uYqgAj8ZPAeCAHcqDgCASt5gOAoKappiVNE1uA5OEq2sooJcGhPc1rh9Xd200hvxscfiuEdnE23X/kx6l0wqBls9cXMM9WRsokaZfrzkiJOkTbVyoxn3Eyisw9mGGaOKwsq+i/p+36v7B0JJ3FzNXtNzOLCLOhbprGOjtUawmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAt2+5wFu7KnCUKbgcAzEYIUHpG6gwNDMYEQYADTSUDguAZKExg/LZ8mVSAMDDyh6V6giom6wM2VsT10zbQIyGgUzXIj+KgR4s0YuIAkCAI4LAwBABR3N8RggHTOUOT6s2qWbyzrY0zfaitTtuzjbtb1rQfE3Oyb0qMH23W4ga40QZH5gGM31L+/dq//Eha3qiXYwxjmH6ldHIDOzSMH3V1W2hv//93VjJDoeKWUoQFG9nMRIxzoHloORxHjjTI8kmIKaigYAEhAACAAAAAAAAAAAAA//NoxAAua45oDusPRCNxpY2bxRlcDcyQhjFYA6eDguAwqBIgCow3805NKIZBIwFAILALKgCABedDoj+kYvBx3bYczeOugpaiM3ACg2YoIaYTAmHA+QgiDgMW+CAxMeBfAQIJkx9G6XHTIfTVc0PZIKp4+5HzrTrW5CJipjOqKtjZp0787y30GoL9mv+ytNdB1TTVT1S5o8hdqGsYh8ufH0LDqVNqyXec7HC0ieNZj6or+e7/v0t2uPEU9y2PQIiw4dU5VgvuemIKaigYAEhAACAAAAAAAAAA//NoxAAmC8J8HuNLUBbfv9ZmzZzmMyEaILyB7XKgsGAYwR8TAYyS9YhK7UrsxXCliUis26vY513YeTKBpQfyO241TQWyerOZb062bmJrND6tR01RZI6ikz1VHTyLVJJJa3VRRVYvUSVSRUWg5SkUp65ieM3frVpld7aU8rruuMGIDhwcKGOoZjDlbqyuk9EjK01u1SX9P9635N9GflR0rx8hfeP2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuu45YDPbamC1opznSstnG7mAOFkDhaxUBJhYOAbSDHgKzCWV5NEoUw1Q/QFKdmCgKb7tNEeVvkn1cMqc6cht/i/4wAioCYuMmh/4KGETAUdotppDgel8DguGntYe+k7di+X67N1o2ggpqJMfeShP+ta1VVLdq3eXmsszYxZdEkwhjQ8bNW9Lq12pmjqvdVO6aFCaIO60k3WbF5I2m0ooVd1u7HD6ajmmpR5VFa1svX//6NTKUg3UySCzqKbXnFANFKNSYgpqKBgASEAAIAAAAAAAA//NoxAAsC4JwH12gABG5bq6SrT2ZpuA6DQ0U6a6pErWfmD4emD7jnVwbGQQfBAWEQAL4WEZxHJDWsPZmbEUYhxiRQNtHNAyzAERkUEKDDZBnQkJALyjLDIlMcxIzLKCCl2NUXTVWpM3Wi6BiXVfQT9aK0W8xbUcWmylSiOlTrWiir+talrM1KU7ar1oJJl2jVtRRPosY5gm+iiiitKylNNUtExbdba6lrZv/3SouxdMndrn4ADYUG4GXIT30JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAu4lpkC52gACSQHMHQDkYgAkwhA8wIDgw3EQdGEiMAtuYKBqYxAUZC/qZICSbsF8aAgebDugZdhqFgi2LlEaigxYwNMRAzoAAowMaPgA5GAMWGaEtCASAwBDCANAIuYaYIEQGMBkINpEB4IBREITGaJVEaCDRZZAEjSqo6tSOLKHgWWSpAh2NSqftVkUIekSROF8u+ZH0Nutubk4ZGJuZmDHv/vX/1m6BseNzoMBEDm9nu/CIbCALjkBZ/7P/0BdA0OmakxBTUUDAAkIAAQAAAAAAA//NoxAAvAkIsAdp4AAsNM4pNcvNQfBSEVEGbVG3fG/eGYFsQa2YQuaRSaQqFAhq4h06xrj6IiKThggCYIClyX2MKGCtHcA7AQgkRYjtBsgZSXN5bScnTEL8F8DmQk/h6jKdsKGoarbVrIxK6M2q2NKwq1WxYSeOplhK5XPrvU6oY0F7F1Z8+t8bzWusWri1rWy9e2zBi19nz6uLW+a1r869rbzX+ta6xZ8MBo8CobEp0sDWJZ6DUFR4KuEQcLP/yUGnA1Ep1H/wVTEFNRQMACQgABAAAAAAA";var tk=[440,480],Bg=2,nk=4,ik=4,g1=.02,v1=1e-4,rk=.02,sd=class{constructor(e){this.audioOut=e;this.ctx=null;this.gain=null;this.sources=[];this.stopTimer=null;this.generation=0;this.muted=false;this.volume=oa.volume;}start(e){this.stopImmediate();let n=++this.generation,{src:i,loop:r=oa.loop,volume:a=oa.volume}=e;this.volume=a;let o=this.audioOut.acquire();if(!o)return;let u=o.createGain();u.connect(o.destination),this.ctx=o,this.gain=u,T.debug("ConnectTone","Player start",{state:o.state,builtIn:!i,loop:r,volume:a,muted:this.muted}),(async()=>{if(o.state==="suspended"){try{await o.resume();}catch(y){T.warn("ConnectTone","resume() rejected \u2014 autoplay blocked",{err:String(y)});}if(n!==this.generation)return;let g=o.state;if(T.debug("ConnectTone","Post-resume state",{state:g}),g!=="running"){T.warn("ConnectTone","Context still suspended \u2014 no user gesture, ringback will be silent",{state:g});return}}let d=!i;u.gain.value=this.muted?0:a;try{let g=await fetch(i??m1).then(_=>_.arrayBuffer()),y=await o.decodeAudioData(g);if(n!==this.generation)return;let A=o.createBufferSource();A.buffer=y,A.loop=r;let p=d?this.applyLoopWindow(A,y):0;A.connect(u),A.start(0,p),this.sources.push(A),T.debug("ConnectTone","Decoded tone playing",{builtIn:d,durationS:y.duration,loopStart:A.loopStart,loopEnd:A.loopEnd});}catch(g){T.warn("ConnectTone","Decoded tone failed \u2014 falling back to synth",{builtIn:d,err:String(g)}),n===this.generation&&this.startSynthesized(o,u,r);}})();}applyLoopWindow(e,n){let i=n.getChannelData(0),r=0;for(;r<i.length&&Math.abs(i[r])<rk;)r++;let a=r/n.sampleRate;return r>=i.length||a+2.7315>n.duration?(T.warn("ConnectTone","Loop window not found \u2014 looping whole buffer",{startS:a,durationS:n.duration}),0):(e.loopStart=a,e.loopEnd=a+2.7315,a)}startSynthesized(e,n,i){let r=e.currentTime,a=Bg+nk,o=i?ik:1,u=this.muted?0:this.volume;try{n.gain.setValueAtTime(0,r);for(let d=0;d<o;d++){let g=r+d*a;n.gain.setValueAtTime(0,g),n.gain.linearRampToValueAtTime(u,g+g1),n.gain.setValueAtTime(u,g+Bg-g1),n.gain.linearRampToValueAtTime(0,g+Bg);}for(let d of tk){let g=e.createOscillator();g.type="sine",g.frequency.value=d,g.connect(n),g.start(r),g.stop(r+o*a),this.sources.push(g);}T.debug("ConnectTone","Synthesized ringback scheduled",{cycles:o,level:u,ctxTime:r});}catch(d){T.warn("ConnectTone","Failed to schedule ringback",{err:String(d)});}}stop(e=oa.fadeOutMs){this.generation++;let n=this.ctx,i=this.gain;if(!n||!i){this.stopImmediate();return}let r=Math.max(0,e)/1e3;try{let a=n.currentTime,o=i.gain;if(typeof o.cancelAndHoldAtTime=="function")o.cancelAndHoldAtTime(a);else {let d=o.value;o.cancelScheduledValues(a),o.setValueAtTime(d,a);}let u=Math.max(o.value,v1);o.setValueAtTime(u,a),o.exponentialRampToValueAtTime(v1,a+r),o.setValueAtTime(0,a+r);}catch{}this.stopTimer=setTimeout(()=>this.stopImmediate(),e+20);}setMuted(e){if(this.muted=e,!(!this.gain||!this.ctx||this.ctx.state==="closed"))try{e?this.gain.disconnect():this.gain.connect(this.ctx.destination);}catch{}}destroy(){this.generation++,this.stopImmediate();}stopImmediate(){this.stopTimer&&(clearTimeout(this.stopTimer),this.stopTimer=null);for(let e of this.sources){try{e.stop();}catch{}try{e.disconnect();}catch{}}this.sources=[];try{this.gain?.disconnect();}catch{}this.gain=null,this.ctx=null;}};var od=class{constructor(){this.ctx=null;this.released=false;}acquire(){if(this.released)return null;if(this.ctx&&this.ctx.state!=="closed")return this.ctx;try{this.ctx=new AudioContext;}catch(e){T.warn("AudioOut","AudioContext unavailable",{err:String(e)}),this.ctx=null;}return this.ctx}peek(){return this.ctx&&this.ctx.state!=="closed"?this.ctx:null}warm(){let e=this.acquire();if(e)try{e.state==="suspended"&&e.resume().catch(()=>{});let n=e.createBufferSource();n.buffer=e.createBuffer(1,1,e.sampleRate),n.connect(e.destination),n.start();}catch{}}ensureRunning(){let e=this.acquire();return e?ad(e):Promise.resolve(false)}release(){this.released=true;let e=this.ctx;this.ctx=null,!(!e||e.state==="closed")&&e.close().catch(()=>{});}};async function sk(t){if(typeof Worker>"u")return Promise.reject(new Error("Web Workers unavailable"));let e=Qa().vadWorker??URL.createObjectURL(new Blob([(await Promise.resolve().then(()=>(y1(),A1))).VAD_WORKER_SOURCE],{type:"application/javascript"})),n=new Worker(e),i=null;return new Promise((r,a)=>{n.onmessage=o=>{let u=o.data;u.type==="prob"?i?.(u.prob,u.tMs,u.speech??null):u.type==="ready"?r({pushPcm(d){n.postMessage({type:"pcm",buffer:d.buffer},[d.buffer]);},onProb(d){i=d;},reset(){n.postMessage({type:"reset"});},destroy(){n.terminate(),URL.revokeObjectURL(e);}}):u.type==="error"&&(n.terminate(),URL.revokeObjectURL(e),a(new Error(u.message)));},n.onerror=o=>{n.terminate(),URL.revokeObjectURL(e),a(new Error(o.message||"VAD worker failed"));},n.postMessage({type:"init",weights:t.slice().buffer});})}var b1={create:sk};var ok=6,lk=1500,ld=class{constructor(e){this.stream=null;this.video=null;this.canvas=null;this.timer=null;this.buffer=[];this.startedAt=0;this.capturing=false;this.listeners=new Set;this.stateListeners=new Set;this.frameWaiters=new Set;this.blockedTicks=0;this.permissionStatus=null;this.everGranted=false;this.sessionOpen=false;this.userDisabled=false;this.stopped=false;this.pendingOpen=null;this.capabilities=null;this.handleTrackEnded=()=>{this.isActive&&(T.warn("Perception","camera track ended unexpectedly"),this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange());};this.handlePermissionChange=()=>{this.permissionStatus?.state==="denied"&&(T.warn("Perception","camera permission revoked mid-session"),this.everGranted=false,this.teardownCapture(),this.emitStateChange({access:"denied",feed:"off"}),this.emitChange());};this.fps=e?.fps??3,this.bufferMs=e?.bufferMs??12e3,this.maxEdge=e?.maxEdge??512,this.jpegQuality=e?.jpegQuality??.7,this.historyThresholdMs=e?.historyThresholdMs??3e3,this.facing=e?.facing??"user",this.maxFrames=Math.max(1,e?.maxFrames??3);}get isActive(){return this.stream!==null}get isSessionOpen(){return this.sessionOpen}get isVideoOff(){return this.userDisabled}get feed(){return this.isActive?"live":"off"}getStream(){return this.stream}getVideoElement(){return this.video}getFacing(){return this.facing}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}onStateChange(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}hasHistory(){return this.isActive&&Date.now()-this.startedAt>=this.historyThresholdMs}waitForFrames(e){if(this.freshFrames().length>0)return Promise.resolve(this.snapshot());if(!this.isActive)return Promise.resolve([]);this.buffer.length>0&&T.warn("Perception","newest frame is stale \u2014 waiting for a fresh one",{ageMs:Date.now()-this.buffer[this.buffer.length-1].t});let n=Date.now();return new Promise(i=>{let r=()=>{clearTimeout(a),this.frameWaiters.delete(r);let o=this.snapshot();T.info("Perception","waited for frames",{count:o.length,waitedMs:Date.now()-n}),i(o);},a=setTimeout(r,e);this.frameWaiters.add(r);})}async willPrompt(){if(this.isActive||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return false;try{let e=await navigator.permissions?.query({name:"camera"});if(e)return e.state==="prompt"}catch{}return !this.everGranted}async ensureCamera(){if(this.isActive)return "granted";if(this.stopped||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return "unavailable";let e;try{e=await this.openCamera();}catch(n){let i=n?.name;return T.warn("Perception","camera getUserMedia failed",{name:i}),i==="NotAllowedError"||i==="SecurityError"?"denied":"unavailable"}return e?(this.sessionOpen=true,this.userDisabled=false,this.emitChange(),this.emitStateChange({facing:this.facingLabel()}),this.reportCapabilities(),"granted"):"unavailable"}async setVideoEnabled(e){if(e){if(this.stopped||(this.userDisabled=false,this.isActive))return;let n;try{n=await this.openCamera();}catch(i){let r=i?.name;T.warn("Perception","failed to re-enable video",{name:r});let a=r==="NotAllowedError"||r==="SecurityError";a&&(this.everGranted=false),this.emitStateChange(a?{access:"denied",feed:"off"}:{feed:"off"}),this.emitChange();return}if(!n)return;this.sessionOpen=true,this.emitStateChange({feed:"live",facing:this.facingLabel()}),this.emitChange(),this.reportCapabilities();return}this.userDisabled=true,this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange();}snapshot(){return this.freshFrames().slice(-this.maxFrames).map(e=>e.bytes)}freshFrames(){let e=Date.now()-lk;return this.buffer.filter(n=>n.t>=e)}openCamera(){return this.stream?Promise.resolve(true):(this.pendingOpen??(this.pendingOpen=this.openStream(this.facing).then(e=>(this.everGranted=true,this.stopped||this.userDisabled?(e.getTracks().forEach(n=>n.stop()),T.info("Perception","released a camera opened after teardown"),false):(this.stream=e,this.attachTrackWatchers(),this.watchPermission(),this.startCaptureLoop(),true))).finally(()=>{this.pendingOpen=null;})),this.pendingOpen)}stop(){let e=this.sessionOpen||this.isActive;this.stopped=true,this.teardownCapture(),this.permissionStatus&&(this.permissionStatus.removeEventListener("change",this.handlePermissionChange),this.permissionStatus=null),this.sessionOpen=false,this.userDisabled=false,e&&this.emitChange();}async flip(e="toggle"){if(!this.isActive)return "unavailable";let n=e==="front"?"user":e==="back"||this.facing==="user"?"environment":"user";if(n===this.facing)return "unchanged";let i;try{i=await this.openStream(n);}catch(r){let a=r?.name;return T.warn("Perception","camera flip failed \u2014 keeping current camera",{name:a,next:n}),a==="OverconstrainedError"||a==="NotFoundError"?"unavailable":"failed"}return this.stopped||this.userDisabled||!this.stream?(i.getTracks().forEach(r=>r.stop()),"unavailable"):(this.detachTrackWatchers(),this.stream?.getTracks().forEach(r=>r.stop()),this.stream=i,this.facing=n,this.attachTrackWatchers(),this.video&&(this.video.srcObject=i),this.emitStateChange({facing:this.facingLabel()}),this.emitChange(),"switched")}facingLabel(){return this.facing==="environment"?"back":"front"}teardownCapture(){if(this.detachTrackWatchers(),this.timer&&(clearInterval(this.timer),this.timer=null),this.video){try{this.video.pause();}catch{}this.video.srcObject=null,this.video.remove(),this.video=null;}this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.buffer=[],this.canvas=null,this.capturing=false,this.startedAt=0,this.blockedTicks=0,[...this.frameWaiters].forEach(e=>e());}openStream(e){return navigator.mediaDevices.getUserMedia({video:{facingMode:e},audio:false})}async reportCapabilities(){try{this.capabilities||(this.capabilities=await this.detectCapabilities()),this.emitStateChange({canFlip:this.capabilities.canFlip,availableCameras:this.capabilities.availableCameras});}catch{}}async detectCapabilities(){let e=this.stream?.getVideoTracks()[0]?.getCapabilities?.().facingMode??[],n=e.includes("user")&&e.includes("environment"),i=0;try{i=(await navigator.mediaDevices.enumerateDevices()).filter(d=>d.kind==="videoinput").length;}catch{}let r=navigator.mediaDevices.getSupportedConstraints?.().facingMode??false,a=n||r&&i>=2,o=a?["front","back"]:[this.facing==="environment"?"back":"front"];return {canFlip:a,availableCameras:o}}emitChange(){this.listeners.forEach(e=>{try{e();}catch{}});}emitStateChange(e){this.stateListeners.forEach(n=>{try{n(e);}catch{}});}async watchPermission(){if(!this.permissionStatus)try{let e=await navigator.permissions?.query({name:"camera"});if(!e)return;this.permissionStatus=e,e.addEventListener("change",this.handlePermissionChange);}catch{}}attachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.addEventListener("ended",this.handleTrackEnded));}detachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded));}startCaptureLoop(){let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),this.video=e,this.canvas=document.createElement("canvas"),this.startedAt=Date.now(),e.play().catch(i=>T.error("Perception","capture video failed to play",{name:i?.name,message:i?.message}));let n=Math.max(1,Math.round(1e3/this.fps));this.timer=setInterval(()=>{this.captureFrame();},n);}async captureFrame(){if(this.capturing||!this.video||!this.canvas)return;let e=this.video.videoWidth,n=this.video.videoHeight;if(!e||!n){this.blockedTicks+=1,this.blockedTicks===ok&&T.error("Perception","capture video is not producing frames",{afterMs:Date.now()-this.startedAt,paused:this.video.paused,readyState:this.video.readyState,inDocument:this.video.isConnected});return}this.capturing=true;try{let i=Math.min(1,this.maxEdge/Math.max(e,n)),r=Math.max(1,Math.round(e*i)),a=Math.max(1,Math.round(n*i));this.canvas.width=r,this.canvas.height=a;let o=this.canvas.getContext("2d");if(!o)return;o.drawImage(this.video,0,0,r,a);let u=await this.canvasToJpegBytes(this.canvas);if(u){let d=Date.now(),g=this.buffer.length===0;this.buffer.push({t:d,bytes:u}),this.pruneBuffer(d),g&&T.info("Perception","first frame captured",{afterMs:d-this.startedAt,blockedTicks:this.blockedTicks}),this.frameWaiters.size>0&&[...this.frameWaiters].forEach(y=>y());}}catch(i){T.warn("Perception","frame capture failed",{err:i});}finally{this.capturing=false;}}canvasToJpegBytes(e){return new Promise(n=>{e.toBlob(i=>{if(!i)return n(null);i.arrayBuffer().then(r=>n(new Uint8Array(r))).catch(()=>n(null));},"image/jpeg",this.jpegQuality);})}pruneBuffer(e){let n=e-this.bufferMs,i=0;for(;i<this.buffer.length&&this.buffer[i].t<n;)i++;i>0&&this.buffer.splice(0,i);}};var ho={bundle:{sha256:"98db72469ffb176f5e9f2687be0f70783893aca681f7789c34b872b0a764371a",byteLength:155465,ext:"js"},loader:{sha256:"e170ee67dd4e16c1a6fcd8840a206687e5a59b22c20e4a902bc445b095454d73",byteLength:323377,ext:"js"},wasm:{sha256:"8da277a733926eacd0474b8704b36742d6ec3231c57a860c5b889dff8f1df886",byteLength:11756954,ext:"wasm"},model:{sha256:"64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",byteLength:3758596,ext:"task"}};var ck="CPU",fk=3e4;async function E1(t){if(typeof Worker>"u")throw new Error("Web Workers unavailable");let e=Qa().moodAssets?.replace(/\/+$/,""),n=g=>e?`${e}/${g.sha256}.${g.ext}`:Kp(g.sha256,g.ext),i=t?.getCachedAsset?{read:g=>t.getCachedAsset?.(g),write:(g,y)=>t.setCachedAsset?.(g,y)}:void 0,r=g=>Hl(g,n(g),i),a=[],o=(g,y)=>{let A=URL.createObjectURL(new Blob([g],{type:y}));return a.push(A),A},u=async g=>e?n(g):o(await r(g),"text/javascript"),d=null;try{let[g,y,A,p,_]=await Promise.all([Qa().moodWorker??Promise.resolve().then(()=>(S1(),_1)).then(({MOOD_WORKER_SOURCE:B})=>o(B,"text/javascript")),u(ho.bundle),u(ho.loader),r(ho.wasm).then(B=>o(B,"application/wasm")),r(ho.model)]);d=new Worker(g);let C={type:"init",bundleUrl:y,loaderUrl:A,wasmUrl:p,model:_,delegate:ck};d.postMessage(C);let N=await dk(d);return t?.pruneCachedAssets?.(Object.values(ho).map(B=>B.sha256)).catch(()=>{}),hk(d,N)}catch(g){throw d?.terminate(),g}finally{for(let g of a)URL.revokeObjectURL(g);}}function dk(t){return new Promise((e,n)=>{let i=setTimeout(()=>n(new Error("mood worker did not start in time")),fk);t.onerror=r=>{clearTimeout(i),n(new Error(r.message||"mood worker failed to load"));},t.onmessage=r=>{let a=r.data;a.type==="ready"?(clearTimeout(i),e(a.delegate)):a.type==="error"&&(clearTimeout(i),n(new Error(a.message)));};})}function hk(t,e){let n=null,i=r=>{let a=n;n=null,a&&("error"in r?a.reject(r.error):a.resolve(r.blendshapes));};return t.onerror=r=>i({error:new Error(r.message||"mood worker crashed")}),t.onmessage=r=>{let a=r.data;a.type==="result"?i({blendshapes:a.blendshapes}):a.type==="error"&&i({error:new Error(a.message)});},{delegate:e,detect:(r,a)=>n?(r.close(),Promise.reject(new Error("detect already pending"))):new Promise((o,u)=>{n={resolve:o,reject:u};let d={type:"frame",frame:r,timestampMs:a};t.postMessage(d,[r]);}),terminate:()=>{i({error:new Error("mood worker terminated")}),t.terminate();}}}var w1=5,M1=480,mk="afx:mood-debug",pk=()=>{try{return globalThis.localStorage?.getItem(mk)==="1"}catch{return false}},gk=t=>{if(typeof VideoFrame=="function")try{return Promise.resolve(new VideoFrame(t))}catch{}return createImageBitmap(t,{resizeWidth:M1,resizeHeight:Math.round(M1*t.videoHeight/t.videoWidth),resizeQuality:"low"})},ud=class{constructor(e){this.options=e;this.classifier=new nu;this.worker=null;this.timer=null;this.generation=0;this.detecting=false;this.failed=false;this.timestampMs=0;this.debug=false;this.ticks=0;}start(){if(this.timer||this.failed)return;this.worker??(this.worker=E1(this.options.cache));let e=this.generation;this.worker.then(n=>{e!==this.generation||this.timer||(this.debug=pk(),T.info("Mood","face model ready",{delegate:n.delegate,debug:this.debug}),this.timer=setInterval(()=>{this.tick(n);},1e3/w1));},n=>{e===this.generation&&this.fail("face model failed to load",n);});}stop(){this.generation+=1,this.timer&&(clearInterval(this.timer),this.timer=null),this.classifier.reset();}dispose(){this.stop(),this.worker?.then(e=>e.terminate(),()=>{}),this.worker=null;}async tick(e){if(this.detecting)return;let n=this.options.getVideo();if(!n||n.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||!n.videoWidth)return;let i=this.generation;this.detecting=true;try{let r=await gk(n);this.timestampMs=Math.max(performance.now(),this.timestampMs+1);let a=await e.detect(r,this.timestampMs);if(i!==this.generation)return;let o=this.classifier.update(a,Date.now(),this.options.isUserSpeaking());o&&this.options.onReading(o),this.debug&&++this.ticks%w1===0&&this.logFrame(o);}catch(r){i===this.generation&&this.fail("face detection failed",r);}finally{this.detecting=false;}}logFrame(e){let n=this.classifier.inspect();if(!n)return;let i=r=>Object.entries(r).map(([a,o])=>`${a}=${o}`).join(" ");T.info("Mood",`frame label=${n.label} reading=${e?.state??"none"} | scores ${i(n.scores)} | browDrop=${n.browDrop} | raw ${i(n.raw)} | base ${i(n.baseline)}`);}fail(e,n){this.failed=true,this.dispose(),T.warn("Mood",`${e}; mood reading is off for this session`,{cause:n});}};var vk=1280,Ak=.75,yk=1e3,T1=5,C1=300,bk=6e4,_k=2500,Sk=3,Ek=new Set(["InvalidAccessError","InvalidStateError","NotAllowedError"]),wk={tab:"browser",window:"window",screen:"monitor"},Mk=()=>{if(typeof navigator>"u")return "other";let t=navigator.userAgentData?.brands??[];if(t.some(n=>/Edge/i.test(n.brand)))return "edge";if(t.some(n=>/Chrom/i.test(n.brand)))return "chrome";let e=navigator.userAgent;return /Edg\//.test(e)?"edge":/Firefox\//.test(e)?"firefox":/Chrome\//.test(e)?"chrome":/Safari\//.test(e)?"safari":"other"},Tk=t=>t==="browser"?"tab":t==="window"?"window":t==="monitor"?"screen":void 0,Ck=()=>{if(typeof navigator>"u"||typeof document>"u")return "no browser";if(navigator.userAgentData?.mobile===true||/Android|iPhone|iPad|iPod/i.test(navigator.userAgent))return "mobile browsers cannot share a screen";if(typeof navigator.mediaDevices?.getDisplayMedia!="function")return "this browser cannot share a screen";let e=document.permissionsPolicy??document.featurePolicy;return typeof e?.allowsFeature=="function"&&!e.allowsFeature("display-capture")?"the embedding page does not allow display-capture":null},cd=class{constructor(e){this.browser=Mk();this.phase="idle";this.surface=null;this.requestedSurface=null;this.turnId=null;this.clickTimer=null;this.listeners=new Set;this.disposed=false;this.stream=null;this.imageCapture=null;this.grabFailures=0;this.video=null;this.thumbCanvas=null;this.frameCanvas=null;this.sampleTimer=null;this.sampling=false;this.lastTickAt=0;this.throttleLogged=false;this.lastSentThumb=null;this.lastSentAt=0;this.handleTrackEnded=()=>{this.phase==="live"&&(T.info("Perception","screen share ended by the user"),this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"}));};this.handlers=e;}get currentPhase(){return this.phase}get currentSurface(){return this.surface}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,n){if(this.disposed){this.handlers.onStatus("unavailable",n,{reason:"session ended"});return}let i=Ck();if(i){this.handlers.onStatus("unavailable",n,{reason:i});return}if(this.turnId=n,this.phase==="live"){this.report("granted",{surface:this.surface??void 0}),this.turnId=null;return}if(this.phase==="awaiting_click"){this.report("awaiting_click");return}this.phase!=="picking"&&(this.requestedSurface=e,this.pick(false));}shareFromClick(){this.phase!=="awaiting_click"||this.disposed||(this.clearClickTimer(),this.pick(true));}dismiss(){this.phase==="awaiting_click"&&(this.clearClickTimer(),this.finish("declined","dismissed"));}stop(){if(this.phase==="live"){this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"});return}(this.phase==="awaiting_click"||this.phase==="picking")&&(this.clearClickTimer(),this.finish("declined","withdrawn"));}dispose(){this.disposed=true,this.clearClickTimer(),this.releaseCapture(),this.turnId=null,this.setPhase("idle"),this.listeners.clear();}async pick(e){this.setPhase("picking");let n=navigator.userActivation?.isActive??e,i=Date.now(),r=setTimeout(()=>{this.phase==="picking"&&!this.disposed&&this.report("picking");},C1),a;try{a=await navigator.mediaDevices.getDisplayMedia(this.pickerOptions());}catch(o){if(clearTimeout(r),this.disposed||this.phase!=="picking")return;let u=o?.name??"Error",d=Date.now()-i<C1;if(T.info("Perception","screen picker refused",{name:u,fromClick:e,hadActivation:n,afterMs:Date.now()-i}),!e&&!n&&d&&Ek.has(u)){this.awaitClick();return}if(u==="NotAllowedError"){this.finish("declined",d?"blocked by the browser":"cancelled");return}this.finish("unavailable",u);return}if(clearTimeout(r),this.disposed||this.phase!=="picking"){a.getTracks().forEach(o=>o.stop()),T.info("Perception","released a screen shared after the request ended");return}this.adopt(a);}pickerOptions(){return {video:{frameRate:{ideal:T1,max:T1},...this.requestedSurface&&{displaySurface:wk[this.requestedSurface]}},audio:false,selfBrowserSurface:"exclude",surfaceSwitching:"include"}}awaitClick(){this.setPhase("awaiting_click"),this.report("awaiting_click"),this.clickTimer=setTimeout(()=>{this.clickTimer=null,this.phase==="awaiting_click"&&this.finish("declined","no click");},bk);}adopt(e){let n=e.getVideoTracks()[0];if(!n){e.getTracks().forEach(i=>i.stop()),this.finish("unavailable","no video track");return}this.stream=e,this.surface=Tk(n.getSettings?.().displaySurface)??this.requestedSurface,n.addEventListener("ended",this.handleTrackEnded),this.setPhase("live"),this.report("granted",{surface:this.surface??void 0}),this.turnId=null,this.startSampler(n);}report(e,n){this.turnId!==null&&this.handlers.onStatus(e,this.turnId,{browser:this.browser,...n});}finish(e,n){this.report(e,{reason:n}),this.turnId=null,this.setPhase("idle");}clearClickTimer(){this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=null;}setPhase(e){this.phase!==e&&(this.phase=e,this.listeners.forEach(n=>{try{n();}catch{}}));}startSampler(e){let n=globalThis.ImageCapture;typeof n=="function"?this.imageCapture=new n(e):this.attachVideo(),this.thumbCanvas=document.createElement("canvas"),this.thumbCanvas.width=32,this.thumbCanvas.height=32,this.frameCanvas=document.createElement("canvas"),this.lastTickAt=Date.now(),this.sampleTimer=setInterval(()=>{this.sample();},yk);}attachVideo(){if(this.video||!this.stream)return;let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),e.play().catch(()=>{}),this.video=e;}async sample(){if(this.sampling||!this.stream)return;let e=Date.now(),n=e-this.lastTickAt;this.lastTickAt=e,n>_k&&!this.throttleLogged&&(this.throttleLogged=true,T.warn("Perception","screen sampling throttled",{gapMs:n,hidden:document.hidden})),this.sampling=true;let i=null;try{if(i=await this.grabSource(),!i||!this.thumbCanvas||!this.stream)return;let r=this.thumbCanvas.getContext("2d",{willReadFrequently:!0});if(!r)return;r.drawImage(i.image,0,0,32,32);let a=Ng(r.getImageData(0,0,32,32).data);if(!Dg(this.lastSentThumb,a,e-this.lastSentAt))return;let o=await this.encode(i);if(!o||!this.stream)return;this.lastSentThumb=a,this.lastSentAt=e,this.handlers.onFrame(o);}catch(r){T.warn("Perception","screen frame failed",{name:r?.name});}finally{i?.release(),this.sampling=false;}}async grabSource(){if(this.imageCapture)try{let n=await this.imageCapture.grabFrame();return this.grabFailures=0,{image:n,width:n.width,height:n.height,release:()=>n.close()}}catch(n){return this.grabFailures+=1,this.grabFailures>=Sk&&(T.warn("Perception","grabFrame keeps failing \u2014 using a video element",{name:n?.name}),this.imageCapture=null,this.attachVideo()),null}let e=this.video;return !e||!e.videoWidth||!e.videoHeight?null:{image:e,width:e.videoWidth,height:e.videoHeight,release:()=>{}}}encode(e){let n=this.frameCanvas;if(!n)return Promise.resolve(null);let i=Math.min(1,vk/Math.max(e.width,e.height)),r=Math.max(1,Math.round(e.width*i)),a=Math.max(1,Math.round(e.height*i));return n.width=r,n.height=a,n.getContext("2d")?.drawImage(e.image,0,0,r,a),new Promise(o=>{n.toBlob(u=>{if(!u)return o(null);u.arrayBuffer().then(d=>o({bytes:new Uint8Array(d),width:r,height:a})).catch(()=>o(null));},"image/jpeg",Ak);})}releaseCapture(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded)),this.sampleTimer&&clearInterval(this.sampleTimer),this.sampleTimer=null,this.video&&(this.video.srcObject=null,this.video.remove(),this.video=null),this.stream?.getTracks().forEach(e=>e.stop()),this.stream=null,this.imageCapture=null,this.grabFailures=0,this.thumbCanvas=null,this.frameCanvas=null,this.lastSentThumb=null,this.lastSentAt=0,this.throttleLogged=false,this.surface=null;}};var Rk="avatarfactory-riv-cache",_r="riv-files",fa="avatar-configs",po="greetings",go="vad-weights",dd="cache-keys",da="content-assets";var R1="riv-wrap-key";var mo=null;function gi(){return mo||(mo=new Promise((e,n)=>{let i=indexedDB.open(Rk,6);i.onupgradeneeded=r=>{let a=i.result;a.objectStoreNames.contains(_r)?r.oldVersion<5&&i.transaction?.objectStore(_r).clear():a.createObjectStore(_r),a.objectStoreNames.contains(fa)||a.createObjectStore(fa),a.objectStoreNames.contains(po)||a.createObjectStore(po),a.objectStoreNames.contains(go)||a.createObjectStore(go),a.objectStoreNames.contains(dd)||a.createObjectStore(dd),a.objectStoreNames.contains(da)||a.createObjectStore(da);},i.onblocked=()=>n(new Error("indexedDB upgrade to v6 blocked")),i.onsuccess=()=>{let r=i.result;r.onversionchange=()=>{r.close(),mo=null;},e(r);},i.onerror=()=>n(i.error);}).catch(e=>{throw mo=null,e}),mo)}var fd=null;function k1(t){return fd||(fd=kk(t).catch(()=>null).then(e=>(e||(fd=null),e))),fd}async function kk(t){let e=globalThis.crypto?.subtle;if(!e)return null;let n=await e.generateKey({name:"AES-GCM",length:256},false,["encrypt","decrypt"]);return new Promise(i=>{let r=t.transaction(dd,"readwrite"),a=r.objectStore(dd),o=a.get(R1),u=n;o.onsuccess=()=>{let d=o.result;d?u=d:a.put(n,R1);},r.oncomplete=()=>i(u),r.onerror=()=>i(null);})}async function x1(t){try{let e=await gi(),n=await k1(e);if(!n)return null;let i=await new Promise(a=>{let u=e.transaction(_r,"readonly").objectStore(_r).get(t);u.onsuccess=()=>{let d=u.result;a(d?.cipher?d:null);},u.onerror=()=>a(null);});return i?{bytes:await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:i.iv},n,i.cipher),rivVersion:i.rivVersion}:null}catch{return null}}async function O1(t,e,n){try{let i=await gi(),r=await k1(i);if(!r)return;let a=globalThis.crypto.getRandomValues(new Uint8Array(12)),o=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:a},r,e);return new Promise(u=>{let d={cipher:o,iv:a,rivVersion:n},g=i.transaction(_r,"readwrite");g.objectStore(_r).put(d,t),g.oncomplete=()=>u(),g.onerror=()=>u();})}catch{}}async function xk(t){try{let e=await gi();return new Promise(n=>{let i=e.transaction([_r,fa],"readwrite");i.objectStore(_r).delete(t),i.objectStore(fa).delete(t),i.oncomplete=()=>n(),i.onerror=()=>n();})}catch{}}async function I1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(fa,"readonly").objectStore(fa).get(t);r.onsuccess=()=>{let a=r.result;if(!a){n(null);return}let o=a;if(!o.cachedAt||Date.now()-o.cachedAt>6048e5){xk(t),n(null);return}n(o.config);},r.onerror=()=>n(null);})}catch{return null}}async function N1(t,e){try{let n=await gi();return new Promise(i=>{let r={config:e,cachedAt:Date.now()},a=n.transaction(fa,"readwrite");a.objectStore(fa).put(r,t),a.oncomplete=()=>i(),a.onerror=()=>i();})}catch{}}async function D1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(po,"readonly").objectStore(po).get(t);r.onsuccess=()=>{let a=r.result;if(!a?.cachedAt||Date.now()-a.cachedAt>2592e6){n(null);return}n(a);},r.onerror=()=>n(null);})}catch{return null}}async function L1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(po,"readwrite"),a=r.objectStore(po);a.put(e,t);let o=t.slice(0,t.indexOf(":"));if(o){let u=IDBKeyRange.bound(`${o}:`,`${o}:\uFFFF`),d=a.openKeyCursor(u);d.onsuccess=()=>{let g=d.result;g&&(g.key!==t&&a.delete(g.key),g.continue());};}r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function P1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(go,"readonly").objectStore(go).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function B1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(go,"readwrite"),a=r.objectStore(go);a.put(e,t);let o=a.openKeyCursor();o.onsuccess=()=>{let u=o.result;u&&(u.key!==t&&a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function U1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(da,"readonly").objectStore(da).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function F1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(da,"readwrite");r.objectStore(da).put(e,t),r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function V1(t){try{let e=await gi(),n=new Set(t);return new Promise(i=>{let r=e.transaction(da,"readwrite"),a=r.objectStore(da),o=a.openKeyCursor();o.onsuccess=()=>{let u=o.result;u&&(n.has(String(u.key))||a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}var Ug={getCachedRiv:x1,setCachedRiv:O1,getCachedAvatarConfig:I1,setCachedAvatarConfig:N1,getCachedGreeting:D1,setCachedGreeting:L1,getCachedVadWeights:P1,setCachedVadWeights:B1,getCachedAsset:U1,setCachedAsset:F1,pruneCachedAssets:V1};var H1={async bytesToSrc(t){let e=new Blob([t],{type:"application/octet-stream"});return URL.createObjectURL(e)},revokeSrc(t){URL.revokeObjectURL(t);}};var Ok=/^(cc-|new-password|current-password|one-time-code)/,Ik=/\b(?:card (?:number|no|num)|cc (?:number|num|no)|cvv|cvc|csc|security code|iban|ssn|social security|otp)\b/,Nk=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase(),hd=(t,e="")=>{if(t.getAttribute("type")==="password"||Ok.test(t.getAttribute("autocomplete")||""))return true;let n=["name","id","aria-label","placeholder"].map(i=>t.getAttribute(i)||"").concat(e).join(" ");return Ik.test(Nk(n))},fu=t=>(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&(t.type==="submit"||t.type==="image")&&t.form!==null;var Dk=/\bsponsored\b/i,Lk="nav, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]",Fg=t=>{if(t.closest(Lk))return true;let e=t.closest("header, footer");return !!e&&!e.parentElement?.closest("article, section, main, [role=main]")},Pk=t=>{let e=t.getAttribute("role"),n=Array.from(t.classList).sort().slice(0,3).join(".");return `${t.tagName}${e?`[${e}]`:""}${n?`.${n}`:""}`},Bk=t=>[t,t.parentElement,t.parentElement?.parentElement].map(e=>e?Pk(e):"").join("<"),Uk=t=>{let e=0;for(let n=t.parentElement;n;n=n.parentElement)e+=1;return e},G1=(t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Fk=t=>{let e=t.ownerDocument.defaultView;if(!e)return false;let n=t.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return i>=0&&r>=0&&i<=e.innerWidth&&r<=e.innerHeight},md=(t,e)=>{if(t.length<=e)return t;let n=t.slice(0,e),i=n.lastIndexOf(" ");return `${i>0?n.slice(0,i):n}\u2026`},Vk=t=>{let e=new Map,n=new Map;for(let r of t){let a=r.el;for(let o=0;a&&o<=8&&a!==a.ownerDocument.body;o+=1){let u=Bk(a),d=e.get(u);d||e.set(u,d=new Set),d.add(a);let g=n.get(a);g||n.set(a,g=[]),g.push(r),a=a.parentElement;}}let i=[];for(let r of e.values()){if(r.size<3)continue;let a=Array.from(r).sort(G1);a.some((o,u)=>u>0&&a[u-1].contains(o))||i.push({cards:a,depth:a.reduce((o,u)=>o+Uk(u),0)/a.length});}return {groups:i,controlsIn:n}},Hk=t=>{let e=new Set;for(let n of t){let i=new Set(n.cards);for(let r of t){let a=r.depth-n.depth;if(r===n||a<=0||a>8)continue;let o=new Map;for(let d of r.cards){let g=d.parentElement;for(let y=0;g&&y<8;y+=1,g=g.parentElement)if(i.has(g)){o.set(g,(o.get(g)??0)+1);break}}if(o.size<3)continue;Array.from(o.values()).reduce((d,g)=>d+g,0)/o.size>=1.5?e.add(n):e.add(r);}}return t.filter(n=>!e.has(n))};function z1(t,e){let n=new Map,i=p=>{let _=n.get(p);return _===void 0&&n.set(p,_=e.textOf(p)),_},{groups:r,controlsIn:a}=Vk(t),o=p=>{if(Fg(p)||Dk.test(i(p)))return false;let _=a.get(p)??[];return _.length!==1?_.length>1:i(p).length>_[0].name.length+3},u=p=>{let _=(B,M)=>i(M.el).length-i(B.el).length,C=p.filter(({el:B})=>B.matches("a[href], [role=link]"));return [...C.filter(({el:B})=>e.pathOf(B))].sort(_)[0]??[...C].sort(_)[0]??p[0]},d=(p,_)=>{let C=p[0].parentElement;for(let N=0;C&&N<3;N+=1,C=C.parentElement){let B=C.getAttribute("aria-label")?.trim();if(B)return md(B,60);let M=C.previousElementSibling;for(let w=0;M&&w<3;w+=1){let R=M.matches("h1, h2, h3, [role=heading]")?M:M.querySelector("h1, h2, h3, [role=heading]"),D=R?i(R):"";if(D)return md(D,60);M=M.previousElementSibling;}}return `List ${_}`},g=Hk(r.map(p=>({...p,cards:p.cards.filter(o)})).filter(p=>p.cards.length>=3)).sort((p,_)=>G1(p.cards[0],_.cards[0])),y={lists:[],primary:new Map,secondary:new Set},A=new Set;for(let p of g){if(y.lists.length>=6)break;let _=y.lists.length+1,C=[],N=[],B=0;for(let M of p.cards){let w=(a.get(M)??[]).filter(({el:ne})=>!A.has(ne)),R=u(w);if(!R)continue;let D=i(R.el),G=md(i(M).replace(D," ").replace(/\s+/g," ").trim(),90);C.push([R.el,{list:_,position:C.length+1,...Fk(M)&&{screenPosition:++B},...G&&{detail:G},name:md(D,60)||R.name}]);for(let{el:ne}of w)ne!==R.el&&N.push(ne);}if(!(C.length<3)){y.lists.push({id:_,name:d(p.cards,_),total:C.length});for(let[M,w]of C)y.primary.set(M,w),A.add(M);for(let M of N)y.secondary.add(M),A.add(M);}}return y}var Vg=/^skip (?:to\b|navigation\b|nav\b|main\b|links\b)/i,Gk=25,zk=60,jk=40,Yg={maxControls:zk,reservedLinks:0,groupLists:false,maxItems:0,preferVisible:false};var Z1=60,Yk=120,qk=200,j1=2,J1="main, section, article, aside, nav, header, footer, [role=region], [role=tabpanel], [role=main], [role=navigation], [role=banner], [role=contentinfo]",$1="h1, h2, h3, [role=heading]",eE="button, summary, [role=button], [role=tab], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=option], input[type=submit], input[type=button], input[type=reset]",Wk=new Set(["option","menuitemradio","menuitemcheckbox"]),tE="a[href], [role=link]",zg="input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea, [contenteditable=''], [contenteditable=true], [role=textbox], [role=combobox]",Qk="form, [role=form]",Y1={section:"s",button:"b",link:"l",field:"f",form:"frm"},Vt=(t,e)=>(t.getAttribute(e)||"").trim(),nE=/\s*[.(]?\s*opens? in (?:a )?new (?:tab|window)\)?\.?/gi,An=(t,e=Z1)=>t.replace(nE,"").replace(/\s+/g," ").trim().slice(0,e),iE=(t,e)=>{let n=An(t,1/0);if(n.length<=e)return n;let i=n.slice(0,e),r=i.lastIndexOf(" ");return r>0?i.slice(0,r):i},Xk=t=>!!t.body&&t.body.getBoundingClientRect().width>0,qg=(t,e)=>{let n=t;if(typeof n.checkVisibility=="function"&&!n.checkVisibility({contentVisibilityAuto:true,visibilityProperty:true}))return false;if(!e)return true;let i=t.getBoundingClientRect();return i.width>=j1&&i.height>=j1},Kk=(t,e)=>{let n=e.defaultView;if(!n)return false;let i=t.getBoundingClientRect(),r=i.left+i.width/2,a=i.top+i.height/2;if(r<0||a<0||r>n.innerWidth||a>n.innerHeight)return false;let o=e.elementFromPoint(r,a);return !!o&&o!==t&&!t.contains(o)&&!o.contains(t)},Zk=(t,e)=>{let n=e.defaultView;if(!n)return true;let i=t.getBoundingClientRect();return i.bottom>0&&i.right>0&&i.top<n.innerHeight&&i.left<n.innerWidth},Jk=(t,e)=>{if(t.closest("[inert]"))return true;let n=e.defaultView;return n?n.getComputedStyle(t).pointerEvents==="none":false},vd=t=>{let e=Vt(t,"aria-label");if(e)return An(e);let n=Vt(t,"aria-labelledby");if(!n)return "";let i=n.split(/\s+/).map(r=>{let a=t.ownerDocument.getElementById(r);return a?ha(a):""}).join(" ");return An(i)},$k=new Set(["A","ABBR","B","BDI","BDO","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","RUBY","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]),rE="script, style, [aria-hidden=true], [hidden]",ha=(t,e,n=true)=>{if(t.nodeType===Node.TEXT_NODE)return t.nodeValue||"";if(t.nodeType!==Node.ELEMENT_NODE)return "";let i=t;if(!n&&e&&i.matches(e))return "";let r="";for(let a of Array.from(i.childNodes))r+=ha(a,e,false);return $k.has(i.tagName)?r:` ${r} `},aE=(t,e)=>{let n=[],i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:r=>r!==t&&r.nodeType===Node.ELEMENT_NODE&&r.matches(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let r=i.nextNode();r;r=i.nextNode())r.nodeType===Node.TEXT_NODE&&n.push(r.nodeValue??"");return n},ex=t=>{let e=An(ha(t,rE));return e.length>qk?"":e},tx=t=>{let e=t.querySelector("img[alt], [role=img][aria-label]");return e?An(Vt(e,"alt")||Vt(e,"aria-label")):""},nx=t=>{let e=t.labels?.[0];if(e)return An(ha(e));if(t.id){let i=t.ownerDocument.querySelector(`label[for="${CSS.escape(t.id)}"]`);if(i)return An(ha(i))}let n=t.closest("label");return n?An(ha(n)):""},ix=t=>t.length>=3&&/[a-z]/i.test(t)&&/[aeiou]/i.test(t)&&!/\d{3}/.test(t),vo=t=>{if(!t)return "";let e=An(t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase());return ix(e)?e:""},rx=t=>{let e=Vt(t,"autocomplete");if(e&&e!=="off"&&e!=="on")return vo(e);let n=Vt(t,"type");return n&&n!=="text"?`${n} field`:""},ax=(t,e)=>{for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.matches(J1))return false;return true},sE=t=>{for(let e of Array.from(t.querySelectorAll($1)))if(ax(t,e))return An(ha(e));return ""},sx=4,oE=30,du=t=>{for(let[e,n]of t){let i=n();if(i)return {name:i,namedBy:e}}return {name:"",namedBy:"none"}},ox={nav:"navigation",header:"header",footer:"footer",main:"main content",aside:"sidebar"},lx=t=>du([["aria",()=>vd(t)],["heading",()=>sE(t)],["id",()=>vo(t.id)],["landmark",()=>ox[t.tagName.toLowerCase()]??""]]),q1=t=>du([["aria",()=>vd(t)],["text",()=>ex(t)],["img-alt",()=>tx(t)],["title",()=>Vt(t,"title")],["id",()=>vo(Vt(t,"name")||t.id)]]),ux=t=>du([["aria",()=>vd(t)],["label",()=>nx(t)],["placeholder",()=>Vt(t,"placeholder")],["title",()=>Vt(t,"title")],["id",()=>vo(Vt(t,"name")||t.id)],["type",()=>rx(t)]]),lE=t=>Vt(t,"role")==="combobox"&&!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement),cx=t=>t.hasAttribute("data-placeholder")?"":An(aE(t,"[aria-hidden=true]").join("")),fx=(t,e)=>{if(!Wk.has(Vt(t,"role")))return null;let n=t.closest("[role=listbox], [role=menu]");if(!n?.id)return null;let i=CSS.escape(n.id);return e.querySelector(`[aria-controls~="${i}"], [aria-owns~="${i}"]`)},dx=t=>{let e=Vt(t,"type");if(e==="checkbox"||e==="radio")return e;if(lE(t))return "combobox";let n=Vt(t,"autocomplete");if(n&&n!=="off"&&n!=="on")return n;if(e)return e;let i=t.tagName.toLowerCase();return i==="select"||i==="textarea"||i==="input"?i:Vt(t,"role")==="combobox"?"combobox":"text"},hx=t=>t instanceof HTMLInputElement&&(t.type==="checkbox"||t.type==="radio"),Hg=12,mx=t=>{let e=Array.from(t.options).filter(i=>!i.disabled&&i.value!=="").map(i=>An(i.label||i.text,Z1)).filter(Boolean);if(e.length<=Hg)return e;let n=e.length-Hg;return [...e.slice(0,Hg),`+${n} more`]},W1=t=>t.disabled===true||Vt(t,"aria-disabled")==="true",px=t=>{if(hx(t))return {checked:t.checked};if(!lE(t))return {filled:gx(t)};let e=cx(t);return e?{shows:e}:{filled:false}},gx=t=>{let e=t.value;return typeof e=="string"?e.trim().length>0:An(t.textContent||"").length>0},Q1=(t,e)=>{let n=Vt(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return i.origin===e.location.origin?i.pathname+i.search:void 0}catch{return}},Gg=60,vx=t=>{if(t.length<=Gg)return t;let e=t.split("?")[0];return e.length<=Gg?e:`${e.slice(0,Gg)}\u2026`},Ax=t=>{for(let e of ["q","url","u"]){let n=t.searchParams.get(e);if(!(!n||!/^https?:\/\//i.test(n)))try{let i=new URL(n);if(i.origin!==t.origin)return i}catch{}}},yx=t=>t.querySelector("cite")?.textContent?.trim().match(/^(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+(?:\.[a-z0-9-]+)+)/i)?.[1]?.toLowerCase(),bx=(t,e)=>{let n=Vt(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return /^https?:$/.test(i.protocol)?(i.origin===e.location.origin?Ax(i):i)?.hostname.replace(/^www\./,"")??yx(t):void 0}catch{return}},X1=t=>t.split("?")[0].replace(/\/+$/,"")||"/",_x=/\s+[—–|·:]\s+/,Sx=(t,e)=>du([["route",()=>wx(vo(Ex(t.location.pathname)))],["self-link",()=>An(e)],["title",()=>An(t.title.split(_x)[0]||"")]]),Ex=t=>t.split("/").filter(Boolean).pop()||"",wx=t=>t?t[0].toUpperCase()+t.slice(1):"",Mx=(t,e)=>{let n=t;for(let i=0;i<e&&n;i+=1)n=n.parentElement;return n?iE(ha(n,`${eE}, ${tE}, ${zg}`),oE):""},pd=(t,e=[])=>{let n=new Map;for(let r of t){let a=n.get(r.name);a?a.push(r):n.set(r.name,[r]);}let i=[];for(let r of n.values()){if(r.length===1){i.push(r[0]);continue}let a=Vt(r[0].el,"href");if(a&&r.every(d=>Vt(d.el,"href")===a)){i.push({...r[0],count:r.length});continue}let o=r.map(d=>iE(uE(d.el,e),oE));if(o.every(Boolean)&&new Set(o).size===r.length){r.forEach((d,g)=>{d.name=`${d.name} \u2014 in "${o[g]}"`;}),i.push(...r);continue}let u=false;for(let d=1;d<=sx&&!u;d+=1){let g=r.map(y=>Mx(y.el,d));g.some(y=>!y)||new Set(g).size===r.length&&(r.forEach((y,A)=>{y.name=`${y.name} \u2014 ${g[A]}`;}),u=true);}u?i.push(...r):i.push({...r[0],count:r.length});}return i.sort(jg)},gd=(t,e,n,i,r=false)=>{let a=[],o=[],u=0;for(let d of Array.from(t.querySelectorAll(e))){if(!qg(d,n)||r&&n&&Jk(d,t))continue;let g=r&&n&&Kk(d,t),y=i(d);if(g){y.name&&o.push(y.name);continue}if(!y.name){u+=1;continue}a.push({el:d,name:y.name,namedBy:y.namedBy});}return {named:a,unnamed:u,covered:o}},Tx=t=>t.length>=2&&/[a-z]/i.test(t),Cx=(t,e,n)=>{let i=[];for(let r of Array.from(t.querySelectorAll($1))){if(!qg(r,e)||n.some(o=>o.contains(r)))continue;let a=An(r.textContent||"");Tx(a)&&i.push({el:r,name:a,namedBy:"heading-block"});}return i},jg=(t,e)=>t.el.compareDocumentPosition(e.el)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Rx=t=>{let e=[];for(let n of t)e.some(r=>r.name===n.name&&(r.el.contains(n.el)||n.el.contains(r.el)))||e.push(n);return e},uE=(t,e)=>{let n="",i="";for(let r of e)r.el.contains(t)?n=r.name:r.el.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING&&(i=r.name);return n||i},kx=t=>aE(t,rE).join(" ").replace(nE,"").replace(/\s+/g," ").trim(),xx=(t,e)=>{let n=Array.from(t.primary).sort(([,i],[,r])=>(i.screenPosition?0:1)-(r.screenPosition?0:1)||i.list-r.list||i.position-r.position);return new Map(n.slice(0,e))},K1=({list:t,position:e,screenPosition:n,detail:i})=>({list:t,position:e,...n&&{screenPosition:n},...i&&{detail:i}});function cE(t=document,e=1,n=Yg){let i=Xk(t),r=new Map,a=[],o={},u={section:0,button:0,link:0,field:0,form:0},d=new Map,g=(j,X)=>{u[X]+=1;let K=`${Y1[X]}${u[X]}`;return r.set(K,j),d.set(j,K),K},y=gd(t,J1,i,lx);o.section=y.unnamed;let A=Rx([...y.named,...Cx(t,i,y.named.map(j=>j.el))].sort(jg)),p=pd(A).slice(0,Gk),_=p.filter(j=>j.namedBy!=="landmark");for(let{el:j,name:X,namedBy:K}of _)a.push({handle:g(j,"section"),kind:"section",name:X,namedBy:K});let C=gd(t,eE,i,q1,true);C.named=C.named.filter(j=>!j.el.matches(zg));let N=gd(t,tE,i,q1,true);C.named=C.named.filter(({name:j})=>!Vg.test(j)),N.named=N.named.filter(({name:j})=>!Vg.test(j));let B=gd(t,zg,i,ux,true);o.button=C.unnamed,o.link=N.unnamed,o.field=B.unnamed;let M=n.groupLists&&i?z1([...C.named,...N.named],{textOf:kx,pathOf:j=>Q1(j,t)}):null,w=M?xx(M,n.maxItems):null;if(M&&w){let j=X=>M.primary.has(X.el)&&!w.has(X.el);C.named=C.named.filter(X=>!j(X)),N.named=N.named.filter(X=>!j(X));for(let X of [...C.named,...N.named]){let K=w.get(X.el);K&&(X.name=K.name);}}let R=pd(B.named,p),D=pd(C.named,p),G=pd(N.named,p),ne=Math.min(n.reservedLinks,G.length),U={left:n.maxControls-ne},H=j=>{let X=Zk(j.el,t)?0:3;return M?.secondary.has(j.el)?X?7:6:w?.has(j.el)?X:X+(Fg(j.el)?2:1)},ee=j=>{let X=Math.max(0,U.left),K=j.slice(0,X);if(n.preferVisible&&i&&j.length>X){let me=j.map(Ie=>({candidate:Ie,rank:H(Ie)}));me.sort((Ie,qe)=>Ie.rank-qe.rank),K=me.slice(0,X).map(({candidate:Ie})=>Ie).sort(jg);}return U.left-=K.length,K};for(let{el:j,name:X,namedBy:K,count:me}of ee(R))a.push({handle:g(j,"field"),kind:"field",name:X,namedBy:K,fieldType:dx(j),...px(j),...j instanceof HTMLSelectElement&&{options:mx(j)},...me&&{count:me},...W1(j)&&{disabled:true},...hd(j,X)&&{sensitive:true}});for(let{el:j,name:X,namedBy:K,count:me}of ee(D)){let Ie=fx(j,t),qe=Ie?d.get(Ie):void 0,Dt=w?.get(j);a.push({handle:g(j,"button"),kind:"button",name:X,namedBy:K,...Dt&&{item:K1(Dt)},...qe&&{choiceOf:qe},...me&&{count:me},...fu(j)&&{submits:true},...W1(j)&&{disabled:true}});}let Q=X1(t.location.pathname),Ee="";U.left+=ne;for(let{el:j,name:X,namedBy:K,count:me}of ee(G)){let Ie=Q1(j,t),qe=bx(j,t),Dt=Ie?.includes("?")?Ie.slice(Ie.indexOf("?")):"",Je=!!Ie&&X1(Ie)===Q&&(!Dt||Dt===t.location.search);Je&&!Ee&&(Ee=X);let Qe=w?.get(j);a.push({handle:g(j,"link"),kind:"link",name:X,namedBy:K,...Qe&&{item:K1(Qe)},...me&&{count:me},...Ie&&!Qe&&!qe&&{path:vx(Ie)},...qe&&{site:qe},...Je&&{current:true}});}let Ce=new Map(a.map(j=>[r.get(j.handle),j.handle]));for(let j of Array.from(t.querySelectorAll(Qk))){if(!qg(j,i))continue;let X=[];for(let[Ie,qe]of Ce)j.contains(Ie)&&!qe.startsWith(Y1.section)&&X.push(qe);if(X.length===0)continue;let{name:K,namedBy:me}=du([["aria",()=>vd(j)],["heading",()=>sE(j)],["section",()=>uE(j,p)],["id",()=>vo(Vt(j,"name")||j.id)]]);a.push({handle:g(j,"form"),kind:"form",name:K||"form",namedBy:me,children:X});}let{name:Ue,namedBy:Be}=Sx(t,Ee),fe=new Set(a.map(j=>j.item?.list)),ye=M?.lists.filter(j=>fe.has(j.id))??[],ce=[...new Set([...C.covered,...N.covered,...B.covered].filter(j=>!Vg.test(j)))].slice(0,jk);return {index:{generation:e,url:t.location.pathname+t.location.search,title:An(t.title,Yk),pageName:Ue||"this",pageNamedBy:Be,nodes:a,unnamed:o,...ye.length>0&&{lists:ye},...i&&{covered:ce}},elements:r}}var pE=/^(?:true|yes|y|on|1|check|checked|tick|ticked|select|selected)$/i,Ox=/^(?:false|no|n|off|0|uncheck|unchecked|untick|unticked|deselect)$/i,Ix={date:"dates go in as YYYY-MM-DD",time:"times go in as HH:MM, 24-hour","datetime-local":"a date and time goes in as YYYY-MM-DDTHH:MM",month:"a month goes in as YYYY-MM",week:"a week goes in as YYYY-Www",number:"only a plain number fits",range:"only a plain number fits",color:"a colour goes in as #rrggbb"},fE=t=>t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim(),dE=(t,e)=>{let n=t.filter(e);return n.length===1?n[0]:void 0},gE=(t,e,n)=>{let i=fE(n);if(!i)return;let r=a=>e(a).map(fE);return t.find(a=>r(a).includes(i))??dE(t,a=>r(a).some(o=>o.startsWith(i)))??dE(t,a=>r(a).some(o=>o.includes(i)))},Nx=(t,e)=>{let n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptor(n,"value")?.set;i?i.call(t,e):t.value=e;},vE=(t,e)=>{t.focus({preventScroll:true}),Nx(t,e),t.dispatchEvent(new Event("input",{bubbles:true})),t.dispatchEvent(new Event("change",{bubbles:true})),t.blur();},hE=(t,e)=>t.readOnly?{outcome:"read_only"}:(vE(t,e),e&&t.value===""?{outcome:"rejected",detail:Ix[t.type]}:e&&!t.validity.valid?{outcome:"invalid",detail:t.validationMessage}:{outcome:"ok"}),Dx=(t,e)=>{let n=Array.from(t.options).filter(r=>!r.disabled),i=gE(n,r=>[r.value,r.label||r.text],e);return i?(vE(t,i.value),{outcome:"ok"}):{outcome:"no_such_option",detail:n.filter(r=>r.value!=="").map(r=>r.label||r.text).join(", ")}},mE=t=>t.labels?.[0]?.textContent?.trim()||t.getAttribute("aria-label")||t.value,Lx=(t,e)=>{let n=t.form??t.ownerDocument,i=t.name?Array.from(n.querySelectorAll(`input[type=radio][name="${CSS.escape(t.name)}"]`)):[t],r=gE(i,a=>[a.value,mE(a)],e)??(pE.test(e.trim())?t:void 0);return r?r.disabled?{outcome:"disabled"}:(r.checked||r.click(),r.checked?{outcome:"ok"}:{outcome:"rejected"}):{outcome:"no_such_option",detail:i.map(mE).join(", ")}},Px=(t,e)=>{let n=pE.test(e.trim())?true:Ox.test(e.trim())?false:void 0;return n===void 0?{outcome:"rejected",detail:'a tick box takes "yes" or "no"'}:(t.checked!==n&&t.click(),t.checked===n?{outcome:"ok"}:{outcome:"rejected"})},Bx=(t,e)=>(t.focus({preventScroll:true}),window.getSelection()?.selectAllChildren(t),(e?document.execCommand("insertText",false,e):document.execCommand("delete"))||(t.textContent=e,t.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:e}))),t.blur(),{outcome:"ok"}),AE=(t,e)=>t instanceof HTMLSelectElement?Dx(t,e):t instanceof HTMLTextAreaElement?hE(t,e):t instanceof HTMLInputElement?t.type==="radio"?Lx(t,e):t.type==="checkbox"?Px(t,e):t.type==="file"?{outcome:"not_fillable"}:hE(t,e):t instanceof HTMLElement&&t.isContentEditable?Bx(t,e):{outcome:"not_fillable"},Ux=t=>"willValidate"in t&&t.willValidate,Fx=(t,e)=>{let n=Array.from(t.elements).find(r=>Ux(r)&&!r.validity.valid);if(!n)return;let i=n.validationMessage||"still needs a valid value";return `"${e(n)}": ${i}`},yE=(t,e,n=false)=>{let i=t.form;if(i&&!i.noValidate&&!t.formNoValidate){let u=Fx(i,e);if(u)return {outcome:"invalid",detail:u}}let r=false,a=false,o=u=>{r=true,a=u.defaultPrevented,n||u.preventDefault();};window.addEventListener("submit",o);try{t.click();}finally{window.removeEventListener("submit",o);}return !r||a||n?{outcome:"ok"}:{outcome:"requires_reload"}};var Vx=new Set(["date","time","datetime-local","month","week","color"]),Hx=t=>{let e=t.getBoundingClientRect();return {clientX:e.left+e.width/2,clientY:e.top+e.height/2}},hu=(t,e,n,i)=>{let r={bubbles:true,cancelable:true,composed:true,view:window,button:0,buttons:i?1:0,...n};return e.startsWith("pointer")?typeof PointerEvent!="function"?true:t.dispatchEvent(new PointerEvent(e,{...r,pointerId:1,pointerType:"mouse",isPrimary:true})):t.dispatchEvent(new MouseEvent(e,r))},Wg=t=>{let e=Hx(t),n=hu(t,"pointerdown",e,true),i=hu(t,"mousedown",e,true);n&&i&&t instanceof HTMLElement&&t.focus({preventScroll:true}),hu(t,"pointerup",e,false),hu(t,"mouseup",e,false),t instanceof HTMLElement?t.click():hu(t,"click",e,false);},Gx=t=>{if(t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&Vx.has(t.type))try{t.showPicker?.();}catch{}},bE=t=>{Wg(t),Gx(t);};var Ao=0,Xa=0,Ad=null,zx=()=>{let t=Ad;if(Ad=null,t==="forward"){Ao+=1,Xa=Math.max(0,Xa-1);return}t==="back"?Xa+=1:Xa=0,Ao=Math.max(0,Ao-1);},Qg={canGo:t=>t==="back"?Ao>0:Xa>0,go(t){Ad=t,t==="back"?window.history.back():window.history.forward();}};function _E(t){if(typeof window>"u")return ()=>{};let e=null,n=()=>{e&&clearTimeout(e),e=setTimeout(t,500);};Ao=0,Xa=0,Ad=null;let{pushState:i,replaceState:r}=window.history,a=(g,y)=>function(...A){let p=g.apply(this,A);return y&&(Ao+=1,Xa=0),n(),p},o=()=>{zx(),n();},u=a(i,true),d=a(r,false);return window.history.pushState=u,window.history.replaceState=d,window.addEventListener("popstate",o),window.addEventListener("hashchange",n),()=>{e&&clearTimeout(e),window.history.pushState===u&&(window.history.pushState=i),window.history.replaceState===d&&(window.history.replaceState=r),window.removeEventListener("popstate",o),window.removeEventListener("hashchange",n);}}var jx=.8,Yx="l",Jg="b",Xg="f",ME="s",qx=new Set([ME,Jg]),yo=t=>/^([a-z]{1,4})\d{1,4}$/.exec(t)?.[1]??"",Wx=/\s+—\s+.*$/,Kg=t=>t.toLowerCase().replace(/\s+/g," ").trim(),Qx=t=>{try{return new URL(t,window.location.href).origin===window.location.origin}catch{return false}},SE=t=>t.replace(/\/+$/,"")||"/",Xx=t=>{try{return SE(new URL(t,window.location.href).pathname)===SE(window.location.pathname)}catch{return false}},EE=(t,e,n)=>{let i=false,r=o=>{i=o.defaultPrevented,e||o.preventDefault();};window.addEventListener("click",r);try{t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));}finally{window.removeEventListener("click",r);}if(i||e)return "ok";let a=t.href;return n===void 0||!a?"requires_reload":(setTimeout(()=>window.location.assign(a),n),"ok")},Zg=t=>t.matches(":disabled")||t.getAttribute("aria-disabled")==="true",Kx=new Set(["back","forward"]),TE=t=>Qg.canGo(t)?(Qg.go(t),"ok"):"no_history",Zx=t=>{let e=window.navigation;return e?(t==="back"?!e.canGoBack:!e.canGoForward)?"no_history":(t==="back"?e.back():e.forward(),"ok"):TE(t)},Jx=()=>{let t=document.documentElement;return {x:Math.max(0,t.scrollWidth-window.innerWidth),y:Math.max(0,t.scrollHeight-window.innerHeight)}},wE=(t,e,n,i)=>{if(!t)return e;if(t.relative){let r=t.percent?i*t.value/100:t.value;return e+r}return t.percent?n*t.value/100:t.value},$x=t=>{let e=Jx();if(t.kind==="edge"){let n=t.edge==="top"?0:t.edge==="bottom"?e.y:e.y/2;window.scrollTo({top:n,behavior:"smooth"});return}if(t.kind==="step"){let n=window.innerHeight*jx;window.scrollBy({top:t.direction==="up"?-n:n,behavior:"smooth"});return}window.scrollTo({left:wE(t.x,window.scrollX,e.x,window.innerWidth),top:wE(t.y,window.scrollY,e.y,window.innerHeight),behavior:"smooth"});};function eO(t={}){let e=t.survivesDocumentLoad??false,n=t.indexProfile??Yg,i=t.followLinksAnywhere??false,r=t.documentLoadAfterMs,a=null,o=(y,A)=>!a||a.generation!==A?null:a.elements.get(y)??null,u=y=>{let A=a?.elements.get(y);return A?.isConnected?{element:A,isSection:yo(y)===ME}:null},d=y=>a?.generation===y?"unknown_target":"stale",g=y=>{for(let[A,p]of a?.elements??[])if(p===y)return a?.names.get(A)??A;return y.labels?.[0]?.textContent?.trim()||y.getAttribute("aria-label")||y.getAttribute("placeholder")||y.getAttribute("name")||"a field"};return {elementNamed(y){let A=Kg(y);if(!a||!A)return null;let p=null;for(let[_,C]of a.names)if(qx.has(yo(_))){if(Kg(C)===A)return u(_);!p&&Kg(C.replace(Wx,""))===A&&(p=_);}return p?u(p):null},read(y){let{index:A,elements:p}=cE(document,y,n),_=new Map(A.nodes.map(C=>[C.handle,C.name]));return a={generation:y,elements:p,names:_},A},retag(y){a&&(a.generation=y);},scroll(y,A){let p=Lg(y);if(p)return $x(p),"ok";if(A===void 0)return "unknown_target";let _=o(y,A);return _?_.isConnected?(_.scrollIntoView({behavior:"smooth",block:"start"}),"ok"):"stale":d(A)},navigate(y,A){if(Kx.has(y)){let N=y;return e?Zx(N):TE(N)}if(A===void 0)return "unknown_target";if(yo(y)!==Yx)return "not_navigable";let p=o(y,A);if(!p)return d(A);if(!p.isConnected)return "stale";let _=p.getAttribute("href");if(!_)return "not_navigable";let C=Qx(_);return !C&&!i?"not_navigable":C&&Xx(_)?"already_here":EE(p,e,r)},click(y,A){if(A===void 0)return "unknown_target";let p=yo(y);if(p!==Jg&&p!==Xg)return "not_clickable";let _=o(y,A);return _?_.isConnected?fu(_)?"submits_form":Zg(_)?"disabled":(_.scrollIntoView({behavior:"smooth",block:"center"}),p===Xg?(bE(_),"ok"):_.closest("a[href]")?EE(_,e,r)==="ok"?"ok":"requires_reload":(Wg(_),"ok")):"stale":d(A)},fill(y,A){let p=false;return y.map(({handle:_,value:C})=>{let N=a?.names.get(_)??_,B=(D,G)=>({handle:_,name:N,outcome:D,...G&&{detail:G}});if(A===void 0)return B("unknown_target");if(yo(_)!==Xg)return B("not_fillable");let M=o(_,A);if(!M)return B(d(A));if(!M.isConnected)return B("stale");if(hd(M,N))return B("sensitive");if(Zg(M))return B("disabled");p||(M.scrollIntoView({behavior:"smooth",block:"center"}),p=true);let{outcome:w,detail:R}=AE(M,C);return B(w,R)})},submit(y,A){if(A===void 0)return {outcome:"unknown_target"};if(yo(y)!==Jg)return {outcome:"not_a_submit"};let p=o(y,A);return p?p.isConnected?fu(p)?Zg(p)?{outcome:"disabled"}:(p.scrollIntoView({behavior:"smooth",block:"center"}),yE(p,g,e)):{outcome:"not_a_submit"}:{outcome:"stale"}:{outcome:d(A)}}}}var CE=eO();var ev=Se(pu());var Ht=Se(pu()),Vi=(t,e)=>{let n=[...e?[e]:[],...t.stateMachineNames??[]];for(let i of n){let r;try{r=t.stateMachineInputs(i);}catch{r=void 0;}if(r?.length)return {name:i,inputs:r}}return {name:null,inputs:[]}},yd=(t,e)=>{let n;switch(t?.fit){case "fill":n=Ht.Fit.Fill;break;case "cover":n=Ht.Fit.Cover;break;case "fitWidth":n=Ht.Fit.FitWidth;break;case "fitHeight":n=Ht.Fit.FitHeight;break;case "none":n=Ht.Fit.None;break;case "scaleDown":n=Ht.Fit.ScaleDown;break;case "layout":n=Ht.Fit.Layout;break;default:n=Ht.Fit.Contain;}e&&(n=Ht.Fit.Contain);let i;switch(t?.alignment){case "topLeft":i=Ht.Alignment.TopLeft;break;case "topCenter":i=Ht.Alignment.TopCenter;break;case "topRight":i=Ht.Alignment.TopRight;break;case "centerLeft":i=Ht.Alignment.CenterLeft;break;case "centerRight":i=Ht.Alignment.CenterRight;break;case "bottomLeft":i=Ht.Alignment.BottomLeft;break;case "bottomCenter":i=Ht.Alignment.BottomCenter;break;case "bottomRight":i=Ht.Alignment.BottomRight;break;default:i=Ht.Alignment.Center;}return new Ht.Layout({fit:n,alignment:i})};var tO=100,nO=.001,iO=21,kE=t=>{let e=qa(t);return e!==null&&e<=iO},rO=t=>t.type===ev.StateMachineInputType.Trigger?"trigger":t.type===ev.StateMachineInputType.Boolean?"boolean":"number",aO=(t,e)=>{let{name:n,inputs:i}=Vi(t,e),r=i.map(a=>{let o=rO(a);return {path:a.name,kind:o,source:"input",isViseme:o==="number"&&kE(a.name),read:()=>o==="trigger"?null:a.value}});return {stateMachine:n,probes:r}},sO=(t,e,n,i)=>{let r={path:i,source:"property",isViseme:false};switch(n){case "number":{let a=t.number(e);return a&&{...r,kind:"number",isViseme:kE(e),read:()=>a.value}}case "boolean":{let a=t.boolean(e);return a&&{...r,kind:"boolean",read:()=>a.value}}case "string":{let a=t.string(e);return a&&{...r,kind:"string",read:()=>a.value}}case "color":{let a=t.color(e);return a&&{...r,kind:"color",read:()=>a.value}}case "enumType":{let a=t.enum(e);return a&&{...r,kind:"enum",read:()=>a.value}}case "trigger":{let a=t.trigger(e);return a&&{...r,kind:"trigger",read:()=>null,property:a}}default:return null}},xE=(t,e="")=>t.properties.flatMap(({name:n,type:i})=>{let r=e?`${e}/${n}`:n;if(i==="viewModel"){let o=t.viewModel(n);return o?xE(o,r):[]}let a=sO(t,n,i,r);return a?[a]:[]}),oO=(t,e)=>typeof t=="number"&&typeof e=="number"?Math.abs(t-e)>nO:t!==e,RE=({read:t,property:e,...n},i)=>({...n,value:i}),tv=class{constructor(e,n){this.target=e;this.emit=n;this.last=new Map;this.unreadable=new Set;this.triggerHandlers=new Map;this.timer=null;this.sample=()=>{for(let e of this.probes){if(e.kind==="trigger")continue;let n=this.read(e);if(n===void 0)continue;let i=this.last.get(e)??null;oO(n,i)&&(this.last.set(e,n),this.emit({type:"change",value:RE(e,n),previous:i}));}};let i=aO(e.rive,e.stateMachine),r=e.rive.viewModelInstance;this.stateMachine=i.stateMachine,this.probes=[...i.probes,...r?xE(r):[]];}snapshot(){let e=this.probes.flatMap(n=>{let i=this.read(n);return i===void 0?[]:[RE(n,i)]});return {type:"snapshot",binding:this.target.binding,stateMachine:this.stateMachine,values:e}}start(){if(!this.timer){for(let e of this.probes){let n=this.read(e);n!==void 0&&this.last.set(e,n);}this.listenForTriggers(),this.timer=setInterval(this.sample,tO);}}stop(){this.timer&&clearInterval(this.timer),this.timer=null;for(let[e,n]of this.triggerHandlers)e.property?.off(n);this.triggerHandlers.clear();}listenForTriggers(){for(let e of this.probes){if(!e.property)continue;let n=()=>this.emit({type:"trigger",path:e.path,source:"property"});e.property.on(n),this.triggerHandlers.set(e,n);}}read(e){if(!this.unreadable.has(e))try{return e.read()}catch(n){this.unreadable.add(e),T.warn("RigActivity",`can't read "${e.path}", skipping it`,{error:String(n)});return}}},bd=class{constructor(){this.listeners=new Set;this.watcher=null;this.subscribe=e=>(this.listeners.add(e),this.watcher&&(this.watcher.start(),e(this.watcher.snapshot())),()=>{this.listeners.delete(e),this.listeners.size===0&&this.watcher?.stop();});this.emit=e=>{for(let n of this.listeners)try{n(e);}catch(i){T.warn("RigActivity","a listener threw",{error:String(i)});}};}attach(e){this.detach();try{this.watcher=new tv(e,this.emit);}catch(n){T.warn("RigActivity","could not read the rig",{error:String(n)});return}this.listeners.size!==0&&(this.watcher.start(),this.emit(this.watcher.snapshot()));}detach(){this.watcher&&(this.watcher.stop(),this.watcher=null,this.emit({type:"detached"}));}reportTrigger(e){this.listeners.size&&this.emit({type:"trigger",path:e,source:"input"});}reportGesture(e,n){this.listeners.size&&this.emit({type:"gesture",name:e,target:n});}reportWrite(e,n,i){this.listeners.size&&this.emit({type:"write",path:e,value:n,landed:i});}};var OE=7e3,lO=()=>{if(typeof window>"u")return false;try{return window.self!==window.top}catch{return true}},uO=(t,e,n,i)=>{let r=(0, W.useMemo)(()=>Yl(t),[t]),a=r.environment==="meeting",o=(0, W.useRef)(null),u=(0, W.useRef)(e),[d,g]=(0, W.useState)("idle"),[y,A]=(0, W.useState)("none"),[p,_]=(0, W.useState)("idle"),[C,N]=(0, W.useState)(null),[B,M]=(0, W.useState)(false),[w,R]=(0, W.useState)(null),[D,G]=(0, W.useState)(false),[ne,U]=(0, W.useState)(null),[H,ee]=(0, W.useState)(false),Q=(0, W.useRef)(null),Ee=(0, W.useRef)(null),Ce=(0, W.useRef)(null),Ue=(0, W.useRef)(null),Be=(0, W.useRef)(null),fe=(0, W.useRef)(null),ye=(0, W.useRef)(null),ce=(0, W.useRef)(null);ce.current||(ce.current=new od);let[j,X]=(0, W.useState)(null),[K,me]=(0, W.useState)("user"),[Ie,qe]=(0, W.useState)(false),[Dt,Je]=(0, W.useState)("idle"),[Qe,Wt]=(0, W.useState)(0),[en,Et]=(0, W.useState)(0),[kn,Lt]=(0, W.useState)(false),[wn,Xe]=(0, W.useState)(false),[Ne,Un]=(0, W.useState)(false),[Mn,xn]=(0, W.useState)(false),[Qt,tn]=(0, W.useState)(false),[It,Pt]=(0, W.useState)(false),[lt,Re]=(0, W.useState)(false),[b,c]=(0, W.useState)(0),[m,E]=(0, W.useState)(0),x=(0, W.useRef)(0),L=(0, W.useRef)(0),z=(0, W.useRef)(null),ae=(0, W.useRef)([]),[be,re]=(0, W.useState)(0),pe=(0, W.useRef)(0),tt=(0, W.useMemo)(()=>new bd,[]),Ke=(0, W.useRef)(null);Ke.current||(Ke.current=iu([]));let De=Ke.current,wt=(0, W.useRef)(null);wt.current||(wt.current=iu(null));let Gt=wt.current,Fe=(0, W.useRef)(null),[zt,Mt]=(0, W.useState)(null),Tt=(0, W.useRef)(null);Tt.current||(Tt.current=iu({services:{ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},concern:null}));let ve=Tt.current,[ki,Fn]=(0, W.useState)("normal");o.current||(o.current=new $l(r,{cache:Ug,urlResolver:H1,pageSurface:u.current?.surface??(n||a?void 0:CE),pageBeforeLive:u.current?.pageBeforeLive,browser:u.current?.browser,framed:lO(),embedHostOrigin:n,embedResume:i,readsMood:true,reportsMicPipeline:true}));let I=o.current,vi=I.isPushToTalk();!fe.current&&(r.mode??"call")==="call"&&!vi&&r.turnTaking?.clientBargeIn!==false&&(fe.current=new cu(I,b1,{echoGate:r.turnTaking?.echoGate}),fe.current.prefetch()),fe.current?.setSpeaking(B);let wr=(0, W.useCallback)(()=>{if(!Ce.current){let oe=new ld;oe.subscribe(()=>{X(oe.getStream()),me(oe.getFacing()),qe(oe.isSessionOpen);}),oe.onStateChange(et=>I.sendCameraState(et)),Ce.current=oe;}return Ce.current},[I]),Vn=(0, W.useCallback)(()=>{Ue.current?.stop(),Ce.current?.stop(),Ce.current=null;},[]),xi=(0, W.useCallback)(()=>(Ue.current??(Ue.current=new ud({getVideo:()=>Ce.current?.getVideoElement()??null,isUserSpeaking:()=>fe.current?.isUserVoiced()??false,onReading:oe=>I.reportMood(oe),cache:Ug})),Ue.current),[I]),le=(0, W.useCallback)(()=>{if(!Be.current){let oe=new cd({onStatus:(et,Ct,Xi)=>I.reportScreenStatus(et,Ct,Xi),onState:et=>I.sendScreenState(et),onFrame:et=>I.sendScreenFrame(et)});oe.subscribe(()=>Je(oe.currentPhase)),Be.current=oe;}return Be.current},[I]),Hn=(0, W.useCallback)(()=>{Be.current?.dispose(),Be.current=null,Je("idle");},[]),Mr=(0, W.useCallback)(async()=>{let oe=Ce.current;oe&&await oe.setVideoEnabled(!oe.isActive);},[]);(0, W.useEffect)(()=>{if(I)return z.current&&(clearTimeout(z.current),z.current=null),I.load(),()=>{z.current=setTimeout(()=>{I.dispose(),fe.current?.dispose(),ce.current?.release();},0);}},[I]);let pa=r.avatar?.avatarId||"default";(0, W.useEffect)(()=>{I.setAvatarId(pa)&&(R(null),Mt(null),Fn("normal"),U(null),G(false));},[I,pa]),(0, W.useEffect)(()=>{if(!I)return;let oe=I.on("session-phase",ue=>{g(ue),ue==="connecting"&&(R(null),Mt(null),Fn("normal"),Wt(Le=>Le+1));}),et=I.on("paint-phase",A),Ct=I.on("turn-phase",ue=>{_(ue),(ue==="listening"||ue==="idle")&&Lt(false);}),Xi=I.on("talking-armed",Xe);g(I.getSessionPhase()),A(I.getPaintPhase()),_(I.getTurnPhase()),Xe(I.getTalkingArmed());let Ud=I.on("speak",ue=>{N(ue),M(true);}),Fd=I.on("interrupt",()=>{Q.current?.reset(),N(null),M(false),Lt(false),ae.current=[];}),us=I.on("speech-cancelled",()=>{Q.current?.reset(),M(false),Lt(false),ae.current=[];}),xu=I.on("avatar_thinking",()=>{Lt(true),E(ue=>ue+1);}),cs=I.on("avatar_slow_response",Un),Ou=I.on("mic-start",async ue=>{fe.current?.ensureInit();try{Ee.current=await h1(ue,Le=>{let on=fe.current;if(!on){I.sendPcmChunk(Le.buffer);return}for(let hs of on.releaseUplinkFrames(Le))I.sendPcmChunk(hs.buffer);},{sampleRate:16e3,onFloat32:Le=>fe.current?.pushPcm(Le),onBlocked:a?()=>I.reportAudioBlocked("mic"):void 0,onSettled:()=>I.reportMicPipelineSettled()});}catch{fe.current?.disable("mic_pipeline_failed"),I.reportMicPipelineSettled();}}),Sa=()=>{let ue=Date.now();ue-x.current<pg||(x.current=ue,c(Le=>Le+1));},Vd=I.on("user-partial",ue=>{fe.current?.onPartialTranscript(ue),ue.trim()&&Sa();}),Hd=I.on("user-speaking",Sa),sn=I.on("user-voice",Sa),Iu=I.on("mic-muted",ue=>{xn(ue),fe.current?.setMicMuted(ue);}),bi=I.on("speaker-muted",ue=>{tn(ue),ye.current?.setMuted(ue);}),Gd=I.on("mood-detection",Pt),fs=I.on("ptt-held",Re),Ea=ue=>{let Le=ye.current??(ye.current=new sd(ce.current));Le.setMuted(I.getSpeakerMuted()),Le.start(ue);},Oo=I.on("connect-tone",(ue,Le)=>{if(ue==="start"){Le&&Ea(Le);return}ye.current?.stop(r.connectTone?.fadeOutMs);}),Io=I.getPendingConnectTone();Io&&(T.debug("SDK","connect-tone was already ringing on listener attach"),Ea(Io));let No=I.on("avatar-ready",()=>{G(true);}),zd=I.on("gesture",(ue,Le,on)=>{pe.current++,T.debug("SDK","gesture: received",{name:ue,atMs:Le,speechless:on,token:pe.current}),ae.current.push({name:ue,token:pe.current,atMs:Le,speechless:on}),re(pe.current);}),jd=I.on("beep",(ue,Le)=>{pe.current++,ae.current.push({name:"beep",beep:true,token:pe.current,atMs:ue,speechless:Le}),re(pe.current);}),Do=I.on("vision-request",async ue=>{if(!r.perception?.camera){I.reportPerceptionOutcome("unavailable",ue);return}let Le=wr();if(Le.isActive){I.reportPerceptionOutcome("granted",ue,{hasHistory:Le.hasHistory(),feed:"live"});let Bu=await Le.waitForFrames(OE);Bu.length&&I.sendVisionFrames(Bu,ue);return}if(Le.isVideoOff){I.reportPerceptionOutcome("granted",ue,{hasHistory:false,feed:"off"});return}await Le.willPrompt()&&I.reportPerceptionOutcome("prompting",ue);let on=await Le.ensureCamera();if(on!=="granted"){I.reportPerceptionOutcome(on,ue);return}I.reportPerceptionOutcome("granted",ue,{hasHistory:Le.hasHistory(),feed:Le.feed});let hs=await Le.waitForFrames(OE);hs.length&&I.sendVisionFrames(hs,ue);}),Yd=I.on("camera-flip",async(ue,Le)=>{let on=Ce.current?await Ce.current.flip(ue):"unavailable";on==="switched"||on==="unchanged"?I.reportCommandStatus("flip_camera",Le,"ok"):on==="unavailable"?I.reportCommandStatus("flip_camera",Le,"unsupported","requested camera is not available"):I.reportCommandStatus("flip_camera",Le,"failed","could not switch camera");}),qd=I.on("camera-close",async ue=>{try{await Ce.current?.setVideoEnabled(!1),I.reportCommandStatus("close_camera",ue,"ok");}catch{I.reportCommandStatus("close_camera",ue,"failed","could not turn camera off");}}),Nu=I.on("camera-open",async ue=>{try{await Ce.current?.setVideoEnabled(!0),I.reportCommandStatus("open_camera",ue,"ok");}catch{I.reportCommandStatus("open_camera",ue,"failed","could not turn camera on");}}),Wd=I.on("screen-request",(ue,Le)=>{le().request(ue,Le);}),Qd=I.on("screen-stop",ue=>{Be.current?.stop(),I.reportCommandStatus("stop_screen",ue,"ok");}),Xd=I.on("transcript",De.set),Kd=I.on("action-flow",Gt.set),Zd=I.on("notice",ue=>{Mt(ue);}),Jd=I.on("health",ue=>{ve.set(ue);}),Du=I.on("visual",ue=>{Fn(ue);}),ds=I.on("error",R),Lu=I.getAvatarConfig();Lu&&U(Lu);let Pu=I.on("avatar-config",ue=>{T.debug("SDK","Received avatar config subscription update",ue),U(ue);}),$d=I.on("connection-status",ue=>{ee(ue),ue||(Ee.current&&(Ee.current.stop(),Ee.current=null),fe.current?.reset(),Vn(),Hn(),N(null),M(false),Lt(false),Re(false),Wt(Le=>Le+1));});return ()=>{oe(),et(),Ct(),Xi(),Ud(),Fd(),us(),xu(),cs(),Ou(),Vd(),Hd(),sn(),Iu(),bi(),Gd(),fs(),Oo(),No(),zd(),jd(),Do(),Yd(),qd(),Nu(),Wd(),Qd(),Xd(),Kd(),Zd(),Jd(),Du(),ds(),Pu(),$d(),Ee.current?.stop(),Ee.current=null,fe.current?.reset(),Vn(),Hn(),ye.current?.destroy(),ye.current=null;}},[I,wr,Vn,le,Hn]);let ti=(0, W.useCallback)(()=>(M(false),Lt(false),N(null),I.notifyPlaybackEnded(),I.getTurnPhase()==="thinking"),[I]),zi=(0, W.useCallback)(oe=>{Vn(),Hn(),I.stop({intentionalClose:true,code:4001,reason:oe||"Manual disconnect"});},[I,Vn,Hn]),es=(0, W.useCallback)(()=>I.markRiveReady(),[I]),ji=(0, W.useCallback)(oe=>{if(L.current<1){L.current++,Et(et=>et+1);return}L.current=0,I.notifyAvatarLoadError(oe);},[I]),Tr=(0, W.useRef)(new Map),Z=(0, W.useCallback)((oe,et)=>{let Ct;switch(oe){case "start":Ct=I.on("connection-status",Xi=>{Xi&&et();});break;case "stop":Ct=I.on("connection-status",Xi=>{Xi||et();});break;case "interrupt":Ct=I.on("interrupt",et);break;case "error":Ct=I.on("error",et);break;case "speaking":Ct=I.on("speak",()=>{et();});break;case "ready":Ct=I.on("avatar-ready",et);break;case "notice":Ct=I.on("notice",et);break;case "health":Ct=I.on("health",et);break;case "transcript":Ct=I.on("transcript",et);break;default:return}Tr.current.set(et,Ct);},[I]),de=(0, W.useCallback)((oe,et)=>{let Ct=Tr.current.get(et);Ct&&(Ct(),Tr.current.delete(et));},[]),Ae=(0, W.useCallback)(oe=>{Fe.current=oe;},[]);(0, W.useEffect)(()=>(I.setHeardSpeechProvider(()=>{let oe=[...De.getSnapshot()].reverse().find(Ct=>Ct.speaker==="avatar"),et=Fe.current?.();return !oe||oe.isFinal||et==null?null:wg(oe,et)}),()=>I.setHeardSpeechProvider(null)),[I,De]);let ke=(0, W.useCallback)(oe=>{Q.current=oe,fe.current?.setPlaybackControls(oe);},[]),$e=(0, W.useCallback)(()=>ce.current?.acquire()??null,[]),Bt=(0, W.useCallback)(oe=>I.setMicMuted(oe),[I]),Ze=(0, W.useCallback)(oe=>I.setSpeakerMuted(oe),[I]),Ve=(0, W.useCallback)(oe=>I.setMoodDetection(oe),[I]),ut=(0, W.useCallback)(()=>I.startTalking(),[I]),dt=(0, W.useCallback)(()=>I.stopTalking(),[I]),rt=(0, W.useCallback)(()=>{ce.current?.warm(),I.start();},[I]),an=(0, W.useRef)(false);(0, W.useEffect)(()=>{!r.autoStart||an.current||(an.current=true,rt(),ce.current?.ensureRunning().then(oe=>{oe||I.reportAudioBlocked("output");}));},[r.autoStart,rt,I]);let Yi=(0, W.useCallback)(()=>zi(),[zi]),Ld=(0, W.useCallback)(()=>I.interrupt(),[I]),ts=(0, W.useCallback)(()=>I.stopSpeaking(),[I]),Su=(0, W.useCallback)(oe=>I.speakText(oe),[I]),Eu=(0, W.useCallback)(oe=>I.speakAudio(oe),[I]),ga=(0, W.useCallback)(oe=>I.setLipSyncTuning(oe),[I]),wu=(0, W.useCallback)(oe=>I.play(oe),[I]),qi=(0, W.useCallback)(oe=>I.addLiveContext(oe),[I]),To=(0, W.useCallback)(oe=>I.notify(oe),[I]),va=(0, W.useCallback)(()=>I.readPage(),[I]),Cr=(0, W.useCallback)(oe=>I.registerAction(oe),[I]),Co=(0, W.useCallback)((...oe)=>I.sendActionUi(...oe),[I]),Ai=(0, W.useCallback)(()=>I.requestTour(),[I]),we=(0, W.useCallback)(()=>I.skipNextGreeting(),[I]),Gn=(0, W.useCallback)(oe=>I.on("speak",oe),[I]),yi=(0, W.useCallback)(oe=>I.on("widget-command",oe),[I]),Mu=(0, W.useCallback)((oe,et)=>I.reportCommandStatus("widget_control",oe,et),[I]);(0, W.useEffect)(()=>!H||!I.capabilities?.page.read||!u.current&&n?void 0:(u.current?.watch??_E)(()=>{I.readPage();}),[H,I,n]);let Tu=(0, W.useCallback)(oe=>I.triggerAction(oe),[I]),Cu=(0, W.useCallback)(()=>I.avatarClicked(),[I]),Nt=(0, W.useMemo)(()=>ne?.rive?.gestures?Object.keys(ne.rive.gestures):[],[ne]),Aa=(0, W.useMemo)(()=>({enabled:r?.controls?.enabled||false,stopSpeaking:r?.controls?.stopSpeaking||false}),[r?.controls?.enabled,r?.controls?.stopSpeaking]),ns=(0, W.useCallback)(()=>{Mr();},[Mr]),Rr=(0, W.useCallback)(()=>{Ce.current?.flip();},[]),ni=(0, W.useCallback)(()=>I.setMoodDetection(!I.isMoodDetectionOn),[I]),kr=H&&I.canReadMood,Wi=(0, W.useMemo)(()=>({stream:j,facing:K,sessionOpen:Ie,toggleVideo:ns,flip:Rr,mood:kr?{on:It,toggle:ni}:null}),[j,K,Ie,ns,Rr,kr,It,ni]),Ro=j!==null&&kr&&It;(0, W.useEffect)(()=>{Ro?xi().start():Ue.current?.stop();},[Ro,xi]),(0, W.useEffect)(()=>()=>Ue.current?.dispose(),[]);let xr=(0, W.useCallback)(()=>Be.current?.shareFromClick(),[]),ya=(0, W.useCallback)(()=>Be.current?.dismiss(),[]),is=(0, W.useCallback)(()=>Be.current?.stop(),[]),Ru=(0, W.useMemo)(()=>({phase:Dt,share:xr,dismiss:ya,stop:is}),[Dt,xr,ya,is]),ku=d==="idle",Pd=d==="connecting",ba=d==="active"&&p==="listening",rs=y==="painted"&&D,Or=y==="failed",as=y==="loading"||y==="painted"&&!D,_a=kn||wn||p==="greeting"||!!zt,Qi=r.transcript,Ir=!!Qi?.enabled&&Qi.captions!==false,ss=Qi?.position??"bottom-center",yn=r.statusBanner,Bd=yn?.enabled!==false,ii=yn?.position??"bottom-left",os=r.thinkingIndicator,ls=os?.enabled!==false,ko=os?.position??"top-left",xo=r.screenShare?.position??"top-center";return {isReady:rs,isLoading:as,isConnecting:Pd,isSpeaking:B,isListening:ba,isThinking:kn,isResponseSlow:Ne,isIdle:ku,isFailed:Or,isConnected:H,isMicMuted:Mn,isSpeakerMuted:Qt,setMicMuted:Bt,setSpeakerMuted:Ze,isMoodDetectionAvailable:kr,isMoodDetectionOn:It,setMoodDetection:Ve,isPushToTalk:vi,isTalking:lt,startTalking:ut,stopTalking:dt,on:Z,off:de,start:rt,stop:Yi,interrupt:Ld,stopSpeaking:ts,speakText:Su,speakAudio:Eu,play:wu,addLiveContext:qi,notify:To,readPage:va,registerAction:Cr,triggerAction:Tu,setLipSyncTuning:ga,availableActions:Nt,notice:zt,_healthStore:ve,_transcriptStore:De,_actionFlowStore:Gt,_sendActionUi:Co,avatarId:r.avatar?.avatarId,error:w,controls:Aa,_currentJob:C,_onPlaybackEnd:ti,_onRiveReady:es,_onRiveError:ji,_resetToken:Qe,_mode:I.getMode(),_setMountSurface:I.setMountSurface,_onWidgetCommand:yi,_onSpeechJob:Gn,_requestTour:Ai,_skipNextGreeting:we,_reportWidgetStatus:Mu,_riveKey:`${en}:${ne?.rive?.src??""}`,_avatarConfig:ne,_shouldArmTalking:_a,_userActivity:b,_thinkingSignal:m,_speakerMuted:Qt,_gestureQueue:ae,_gestureSignal:be,_avatarClicked:Cu,_lipSyncTuning:I.getLipSyncTuning(),_rigActivity:tt,_visualState:ki,_camera:Wi,_screen:Ru,_screenSharePosition:xo,_captionsEnabled:Ir,_captionPosition:ss,_statusBannerEnabled:Bd,_statusBannerPosition:ii,_thinkingIndicatorEnabled:ls,_thinkingIndicatorPosition:ko,_speechClockRef:Fe,_registerSpeechClock:Ae,_registerPlaybackControls:ke,_getAudioContext:$e,_spacebarToTalk:r.turnTaking?.spacebar!==false,_environment:r.environment,mode:r.mode||"call"}},IE=uO;var $n=Se(dn()),BE=Se(ze()),dO=(0, $n.createContext)(null),PE=({children:t})=>{let[e,n]=(0, $n.useState)(false),[i,r]=(0, $n.useState)("dormant"),[a,o]=(0, $n.useState)("idle"),u=(0, $n.useRef)(null),d=(0, $n.useCallback)(y=>n(y),[]),g=(0, $n.useMemo)(()=>({isOpen:e,stage:i,setOpen:d,setStage:r,tourState:a,setTourState:o,tourControlsRef:u}),[e,i,d,a]);return (0, BE.jsx)(dO.Provider,{value:g,children:t})};var nv=Se(ze()),UE=(0, Sd.createContext)(null),hO=({config:t,children:e,pageHost:n,embedHostOrigin:i,embedResume:r})=>{let a=IE(t,n,i,r);return (0, nv.jsx)(UE.Provider,{value:a,children:(0, nv.jsx)(PE,{children:e})})},FE=hO;function gu(){let t=(0, Sd.useContext)(UE);if(!t)throw new Error("useAvatar must be used within <AvatarProvider>");return t}var $a=Se(dn());var HE=Se(ze()),mO=({children:t,className:e,style:n})=>(0, HE.jsx)("div",{className:`avatar-shell-root ${e??""}`,style:n,children:t}),VE=mO;var ie=Se(dn()),bu=Se(pu());var GE="EnhancedLipSync",iv=100,pO=.55,gO=.35,vO=.45,AO=.4,Ed=.04,yO=60,bO=2,zE=64,wd=class{constructor(){this.rive=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.currentValues=new Map;this.inputs=new Map;this.silenceInput=null;this.jawOpen=0;this.lastActiveTime=Ui;this.lastTickTime=0;this.tuning=new yr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/yO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,o=false,u=1/0;for(let _ of this.visemes){let C=_.start-Ed,N=_.end+Ed;if(u===1/0&&_.start>r&&_.visemeId!==0&&(u=_.start-r),r<C||r>N)continue;let B=_.end-_.start,M=Math.min(.06,B*.45),w=1;if(r<_.start+M?w=(r-C)/(M+Ed):r>_.end-M&&(w=(N-r)/(M+Ed)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){o=true;let R=a.get(_.visemeId)||0;a.set(_.visemeId,Math.max(R,w));}}let d=0;for(let _ of a.values())d+=_;if(d>1)for(let[_,C]of a)a.set(_,C/d);o&&(this.lastActiveTime=r);let y=r-this.lastActiveTime<this.tuning.holdSec?1:0,A=y>this.jawOpen?pO:gO,p=i*this.tuning.jawSpeed;this.jawOpen+=(y-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0);for(let[_,C]of this.currentValues){let N=a.get(_)||0,M=Math.min(iv,N*this.jawOpen*iv*this.tuning.openness)-C,w=M>0?vO:AO,R=C+M*(1-Math.pow(1-w,i));this.currentValues.set(_,R);let D=this.inputs.get(_);D&&(D.value=Math.round(R));}if(this.silenceInput){let _=Math.min(r-this.lastActiveTime,u),C=this.tuning.holdSec,N=Math.min(1,Math.max(0,(_-C)/(Gl-C))),B=this.tuning.rest+N*(iv-this.tuning.rest);this.silenceInput.value=Math.round((1-this.jawOpen)*B);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i,r){this.clock=n,r&&(this.tuning=r),this.currentValues.clear(),this.jawOpen=0,this.visemes=[],this.lastTickTime=0,this.retarget(e,i);}retarget(e,n){if(this.rive=e,this.inputs.clear(),this.silenceInput=null,!e)return;let{name:i,inputs:r}=Vi(e,n);for(let a of r){let o=qa(a.name);if(o!==null){if(o===0){this.silenceInput=a,a.value=0;continue}this.inputs.set(o,a),this.currentValues.has(o)||this.currentValues.set(o,0),a.value=Math.round(this.currentValues.get(o)??0);}}this.inputs.size===0?T.error(GE,"no viseme inputs on the rig \u2014 lip-sync will not move",{requestedStateMachine:n??"(unset)",resolvedStateMachine:i,artboardStateMachines:e.stateMachineNames,inputNames:r.map(a=>a.name)}):T.debug(GE,"bound to rig",{stateMachine:i,visemeIds:[...this.inputs.keys()].sort((a,o)=>a-o),silenceInputFound:!!this.silenceInput});}detach(){this.retarget(null);}appendVisemes(e){this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes();}clearVisemes(){this.visemes=[],this.lastActiveTime=Ui;}pruneSpentVisemes(){if(this.visemes.length<=zE||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-bO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-zE),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.tick());}stop(){if(this.running){this.running=false,this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.inputs.values())try{e.value=0;}catch{}if(this.silenceInput)try{this.silenceInput.value=this.tuning.rest;}catch{}this.visemes=[],this.inputs.clear(),this.currentValues.clear(),this.silenceInput=null,this.rive=null,this.clock=null,this.lastTickTime=0;}}forceSilence(){this.lastActiveTime=Ui,this.jawOpen=0;for(let[e,n]of this.inputs)n.value=0,this.currentValues.set(e,0);this.silenceInput&&(this.silenceInput.value=this.tuning.rest);}};var Md=100,_O=.55,SO=.35,EO=.45,wO=.4,Td=.04,jE=0,MO=0,TO=60,CO=2,YE=64,Ti="DataBindingLipSync",Ka=class{constructor(){this.vmInstance=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.numberProps=new Map;this.currentValues=new Map;this.silenceProp=null;this.formatName=e=>`${e}`;this.jawOpen=0;this.lastActiveTime=Ui;this.lastTickTime=0;this.lastTickLogTime=0;this.silencing=false;this.tuning=new yr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/TO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,o=false;for(let _ of this.visemes){let C=_.start-Td,N=_.end+Td;if(r<C||r>N)continue;let B=_.end-_.start,M=Math.min(.06,B*.45),w=1;if(r<_.start+M?w=(r-C)/(M+Td):r>_.end-M&&(w=(N-r)/(M+Td)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){o=true;let R=a.get(_.visemeId)??0;a.set(_.visemeId,Math.max(R,w));}}let u=0;for(let _ of a.values())u+=_;if(u>1)for(let[_,C]of a)a.set(_,C/u);o&&(this.lastActiveTime=r);let d=r-this.lastActiveTime<this.tuning.holdSec,g=0;if(!d){for(let _ of this.visemes)if(_.start>r&&_.visemeId!==0){let C=_.start-r;C<jE&&(g=MO*(1-C/jE));break}}let y=d?1:g,A=y>this.jawOpen?_O:SO,p=i*this.tuning.jawSpeed;this.jawOpen+=(y-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0),this.silencing&&this.jawOpen===0&&(this.silencing=false,T.debug(Ti,"tick: silence complete"));for(let[_,C]of this.numberProps){let N=a.get(_)??0,B=Math.min(Md,N*this.jawOpen*Md*this.tuning.openness),M=this.currentValues.get(_)??0,w=B-M,R=w>0?EO:wO,D=M+w*(1-Math.pow(1-R,i)),G=Math.round(D);if(this.currentValues.set(_,D),!!C)try{C.value=G;}catch(ne){T.error(Ti,`tick: failed writing visemeId=${_} value=${G}`,ne);}}try{if(this.silenceProp){let _=Md;if(!this.silencing){let C=r-this.lastActiveTime,N=1/0;for(let R of this.visemes)if(R.start>r&&R.visemeId!==0){N=R.start-r;break}let B=Math.min(C,N),M=this.tuning.holdSec,w=Math.min(1,Math.max(0,(B-M)/(Gl-M)));_=this.tuning.rest+w*(Md-this.tuning.rest);}this.silenceProp.value=Math.round((1-this.jawOpen)*_);}}catch(_){T.error(Ti,"tick: failed writing silence prop",_);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i){this.clock=n,i&&(this.tuning=i);let r=n.getAlignmentTime();this.jawOpen=r>.05?1:0,this.lastActiveTime=this.jawOpen>0?r:Ui,this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.lastTickTime=0,this.lastTickLogTime=0,this.silencing=false,this.retarget(e),T.debug(Ti,"initialize",{initialT:r.toFixed(3),jawPreWarmed:this.jawOpen>0});try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch(a){T.error(Ti,"initialize: failed to set silence prop to rest",a);}this.prepareSpeech();}retarget(e){if(this.vmInstance=e,this.silenceProp=null,!e){for(let r of this.numberProps.keys())this.numberProps.set(r,null);return}let{format:n,shape:i}=uu(r=>{try{return e.number(r)!==null}catch{return !1}});this.formatName=n;for(let r of this.numberProps.keys())this.numberProps.set(r,e.number(this.formatName(r)));this.silenceProp=e.number(this.formatName(0)),T.debug(Ti,"bound to rig",{viewModelName:e.viewModelName??"unknown",visemeNameShape:i,silencePropFound:!!this.silenceProp,trackedIds:this.numberProps.size});}detach(){this.retarget(null);}prepareSpeech(){this.silencing=false;}appendVisemes(e){for(let n of e)if(n.visemeId!==0&&!this.numberProps.has(n.visemeId)){let i=this.vmInstance?.number(this.formatName(n.visemeId))??null;this.numberProps.set(n.visemeId,i),this.currentValues.set(n.visemeId,0);try{i&&(i.value=0);}catch{}}this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes(),T.debug(Ti,"appendVisemes",{newCount:e.length,totalVisemes:this.visemes.length,trackedIds:Array.from(this.numberProps.keys()),nullProps:Array.from(this.numberProps.entries()).filter(([,n])=>!n).map(([n])=>n)});}clearVisemes(){this.visemes=[],this.lastActiveTime=Ui;}pruneSpentVisemes(){if(this.visemes.length<=YE||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-CO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-YE),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.prepareSpeech(),T.debug(Ti,"start"),this.tick());}stop(){if(this.running){this.running=false,T.debug(Ti,"stop"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}interrupt(){if(this.running){this.running=false,T.debug(Ti,"interrupt"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}forceSilence(){this.lastActiveTime=Ui,this.silencing=true,T.debug(Ti,"forceSilence \u2014 jaw decaying naturally");}};var rv=25,RO=.8,kO=.003,xO=300,qE=.7,Cd=class{constructor(e,n){this.alignmentBaseCtxTime=null;this.scheduleCursor=0;this.timeline=new lu;this.decodedQueue=[];this.activeSources=new Set;this.pendingDecodes=0;this.schedulerTimer=null;this.interrupted=false;this.drainTimer=null;this.muted=false;this.paused=false;this.ownsContext=!n,this.ctx=n??new AudioContext,this.gain=this.ctx.createGain(),this.gain.gain.value=qE,this.analyser=this.ctx.createAnalyser(),this.analyser.fftSize=512,this.analyserBuf=new Float32Array(this.analyser.fftSize),this.gain.connect(this.analyser),this.analyser.connect(this.ctx.destination),this.onEnded=e,this.warm(),this.startScheduler();}warm(){try{this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{});let e=this.ctx.createBuffer(1,1,this.ctx.sampleRate),n=this.ctx.createBufferSource();n.buffer=e,n.connect(this.ctx.destination),n.start();}catch{}}setMuted(e){if(this.muted=e,this.ctx.state==="closed")return;let n=e?0:qE,i=this.ctx.currentTime;try{this.gain.gain.cancelScheduledValues(i),this.gain.gain.setValueAtTime(this.gain.gain.value,i),this.gain.gain.linearRampToValueAtTime(n,i+.02);}catch{this.gain.gain.value=n;}}isMuted(){return this.muted}playBeep(){if(this.ctx.state!=="closed")try{let e=this.ctx.currentTime,n=this.ctx.createOscillator(),i=this.ctx.createGain();n.frequency.value=vg,i.gain.setValueAtTime(0,e),i.gain.linearRampToValueAtTime(If,e+Nf),i.gain.setValueAtTime(If,e+zl-Nf),i.gain.linearRampToValueAtTime(0,e+zl),n.connect(i),i.connect(this.gain),n.onended=()=>i.disconnect(),n.start(e),n.stop(e+zl);}catch(e){T.warn("TtsPlayer","beep failed",{err:e});}}enqueueChunk(e,n){if(this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"){this.pendingDecodes++;try{this.decodeBase64(e).then(i=>{this.ctx.state!=="closed"&&(this.decodedQueue.push({buffer:i,alignmentStart:n}),this.decodedQueue.sort((r,a)=>r.alignmentStart-a.alignmentStart));}).catch(()=>{}).finally(()=>this.settleDecode());}catch{this.settleDecode();}}}enqueueSequentialChunk(e){this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"&&(this.pendingDecodes++,this.decodeBase64(e).then(n=>{this.ctx.state!=="closed"&&this.decodedQueue.push({buffer:n,alignmentStart:1/0});}).catch(()=>{}).finally(()=>this.settleDecode()));}settleDecode(){this.pendingDecodes>0&&this.pendingDecodes--,this.maybeArmDrain();}hasPendingAudio(){return this.activeSources.size>0||this.decodedQueue.length>0||this.pendingDecodes>0}maybeArmDrain(){this.interrupted||this.hasPendingAudio()||(this.drainTimer&&clearTimeout(this.drainTimer),this.drainTimer=window.setTimeout(()=>{this.drainTimer=null,!this.interrupted&&!this.hasPendingAudio()&&this.onEnded?.();},xO));}async decodeBase64(e){let n=atob(e),i=new Uint8Array(n.length);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return this.ctx.decodeAudioData(i.buffer)}startScheduler(){let e=()=>{if(this.interrupted||this.ctx.state==="closed")return;if(this.paused){this.schedulerTimer=window.setTimeout(e,rv);return}let n=this.ctx.currentTime,i=false,r=false;if(this.alignmentBaseCtxTime===null){let a=this.decodedQueue[0];if(!a){this.schedulerTimer=window.setTimeout(e,rv);return}let o=a.alignmentStart===1/0?0:a.alignmentStart;this.alignmentBaseCtxTime=n+.1-o,this.scheduleCursor=n+.1,i=true,T.debug("TtsPlayer","alignment clock anchored",{headStart:o,bufferDuration:a.buffer.duration,outputLatency:this.ctx.outputLatency??null,baseLatency:this.ctx.baseLatency??null,queuedChunks:this.decodedQueue.length,ctxState:this.ctx.state});}for(;this.decodedQueue.length>0&&(this.decodedQueue[0].alignmentStart===1/0||this.alignmentBaseCtxTime+this.decodedQueue[0].alignmentStart<n+RO);){let{buffer:a,alignmentStart:o}=this.decodedQueue.shift(),u;o===1/0?u=this.scheduleCursor:(u=this.alignmentBaseCtxTime+o,u<n+.02&&this.activeSources.size===0&&(this.scheduleCursor>0&&n-this.scheduleCursor<1&&T.warn("TtsPlayer","Playback stalled, realigning",{lateBySec:Number((n-u).toFixed(3))}),this.alignmentBaseCtxTime=n+.1-o,u=this.alignmentBaseCtxTime+o,i=true,this.timeline.reanchor()),Math.abs(u-this.scheduleCursor)<.1?u=this.scheduleCursor:u=Math.max(u,this.scheduleCursor)),this.timeline.schedule(u,a.duration,o===1/0?void 0:o),T.debug("TtsPlayer","chunk placed",{alignmentStart:o===1/0?null:o,startAt:Number(u.toFixed(3)),movedBySec:o===1/0?null:Number((u-(this.alignmentBaseCtxTime+o)).toFixed(3)),bufferDuration:Number(a.duration.toFixed(3))});let d=this.ctx.createBufferSource();d.buffer=a;let g=this.ctx.createGain();if(d.connect(g),g.connect(this.gain),u>this.scheduleCursor+.001){let y=Math.min(kO,a.duration/2);g.gain.setValueAtTime(0,u),g.gain.linearRampToValueAtTime(1,u+y);}else g.gain.setValueAtTime(1,u);d.start(u),this.scheduleCursor=u+a.duration,this.activeSources.add(d),r=true,d.onended=()=>{this.activeSources.delete(d),this.activeSources.size===0&&this.emitTimeline(),this.maybeArmDrain();};}(i||r)&&this.emitTimeline(),this.schedulerTimer=window.setTimeout(e,rv);};e();}getAlignmentTime(){return this.timeline.timeAt(this.ctx.currentTime-(this.ctx.outputLatency||0))}getPlayableAlignmentTime(){return this.timeline.playableTime()}getOutputLevel(){if(this.ctx.state==="closed")return 0;try{this.analyser.getFloatTimeDomainData(this.analyserBuf);}catch{return 0}let e=0;for(let n=0;n<this.analyserBuf.length;n++)e+=this.analyserBuf[n]*this.analyserBuf[n];return Math.sqrt(e/this.analyserBuf.length)}isAudioActive(){return this.activeSources.size>0||this.decodedQueue.length>0}isPlaybackScheduled(){return this.activeSources.size>0}pause(){this.paused||this.interrupted||this.ctx.state!=="closed"&&(this.paused=true,this.emitTimeline(),this.ctx.suspend().catch(()=>{}).then(()=>this.emitTimeline()));}isPaused(){return this.paused}resume(){this.paused&&this.ctx.state!=="closed"&&(this.paused=false,this.ctx.resume().catch(()=>{}).then(()=>this.emitTimeline()));}interrupt(){this.interrupted=true,this.paused=false,this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null);for(let e of this.activeSources)try{e.stop();}catch{}this.activeSources.clear(),this.decodedQueue.length=0,this.pendingDecodes=0,this.alignmentBaseCtxTime=null,this.scheduleCursor=0,this.timeline.reset(),this.schedulerTimer&&(clearTimeout(this.schedulerTimer),this.schedulerTimer=null),this.emitTimeline();}emitTimeline(){try{this.onTimeline?.();}catch{}}destroy(){let e=this.paused;this.interrupt();try{this.gain.disconnect(),this.analyser.disconnect();}catch{}if(this.ownsContext){try{this.ctx.state!=="closed"&&this.ctx.close().catch(()=>{});}catch{}return}(e||this.ctx.state==="suspended")&&this.ctx.resume().catch(()=>{});}};var bo=Se(ze());var OO=({label:t="Connecting",className:e,style:n})=>(0, bo.jsxs)("div",{className:`af-loader ${e??""}`,style:n,role:"status","aria-live":"polite","aria-label":`${t}\u2026`,children:[(0, bo.jsx)("span",{className:"af-loader__orb","aria-hidden":"true"}),(0, bo.jsx)("span",{className:"af-loader__letters","aria-hidden":"true",children:Array.from(t).map((i,r)=>(0, bo.jsx)("span",{className:"af-loader__letter",style:{animationDelay:`${r*.1}s`},children:i.trim()===""?"\xA0":i},`${i}-${r}`))})]}),Rd=OO;var So=Se(dn()),lw=Se(sv());var iw=Se(sv());var lI=6e4,uI=3,Od="Renderer",nw=false,ma=0,Au="live",ov=0,vu=[],rw=new Set,lv=new WeakMap,uv=new WeakMap,cv=new Set,fv=new Set,dv=()=>{for(let t of cv)t();},hv=t=>{for(let e of fv)try{e(t);}catch(n){T.error(Od,"renderer event listener threw",n);}},cI=(t,e)=>!t.isConnected&&t.width===1&&t.height===1&&typeof e=="object"&&e!==null&&"renderViaOffscreenBackBuffer"in e,fI=()=>{let t=iw.RuntimeLoader;return typeof t.isLoading!="boolean"||!("runtime"in t)?false:(t.runtime=void 0,t.isLoading=false,true)},dI=t=>{for(;vu.length>0&&t-vu[0]>lI;)vu.shift();return vu.length>=uI?false:(vu.push(t),true)},hI=t=>{if(!rw.delete(t)||Au==="unrecoverable")return;let e=`${t.width}x${t.height}`;ov=performance.now(),T.event(Od,"shared context lost",{generation:ma,surface:e}),hv({type:"lost",generation:ma,surface:e});let n=dI(ov)?fI()?null:"runtime-unsupported":"loss-storm";if(n){T.error(Od,"shared context unrecoverable",{generation:ma,reason:n}),Au="unrecoverable",hv({type:"unrecoverable",generation:ma,reason:n}),dv();return}ma+=1,Au="recovering",dv();},mI=(t,e)=>{if(lv.set(t,e),rw.add(t),t.addEventListener("webglcontextlost",()=>hI(t),{once:true}),Au!=="recovering")return;let n=Math.round(performance.now()-ov);T.event(Od,"shared context rebuilt",{generation:ma,recoveryMs:n}),Au="live",hv({type:"recovered",generation:ma,recoveryMs:n}),dv();};function Id(){if(nw||typeof HTMLCanvasElement>"u")return;nw=true;let t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(n,i){let r=t.call(this,n,i);return n==="webgl2"&&r&&!lv.has(this)&&cI(this,i)&&mI(this,r),r};let e=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(...n){let i=n[0],r=i instanceof HTMLCanvasElement?lv.get(i):void 0;r?.isContextLost()||(r&&uv.set(this.canvas,(uv.get(this.canvas)??0)+1),e.apply(this,n));};}var aw=()=>ma;var sw=t=>uv.get(t)??0;function ow(t){return cv.add(t),()=>{cv.delete(t);}}function Nd(t){return fv.add(t),()=>{fv.delete(t);}}var cw=Se(ze()),pI=({src:t,artboard:e,stateMachine:n,autoBind:i,layout:r,onReady:a,onLoadError:o})=>{(0, So.useEffect)(()=>Id(),[]);let u=(0, So.useRef)(a);u.current=a;let d=(0, So.useRef)(o);d.current=o;let{rive:g,RiveComponent:y}=(0, lw.useRive)({src:t,autoplay:true,autoBind:i,useOffscreenRenderer:true,layout:r,...e&&{artboard:e},...n&&{stateMachines:n},onLoadError:A=>d.current(A instanceof Error?A:new Error("Rive load failed"))});return (0, So.useEffect)(()=>{g&&u.current(g);},[g]),(0, cw.jsx)(y,{className:"rive-renderer-canvas"})},uw=pI;var mv=(t,e,n)=>{for(let i of e){for(let[r,a]of Object.entries(i.properties))try{if(typeof a=="boolean"){let o=t.boolean(r);o?(o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (boolean)`)):n&&T.error("Renderer",`data-binding: boolean prop "${r}" not found on ${i.name}`);}else if(typeof a=="number"){let o=t.number(r);if(o)o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (number)`);else {let u=t.color(r);u?(u.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (color)`)):n&&T.error("Renderer",`data-binding: prop "${r}" not found as number or color on ${i.name}`);}}else if(typeof a=="string"){let o=t.string(r);if(o)o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (string)`);else {let u=t.enum(r);u?(u.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (enum)`)):n&&T.error("Renderer",`data-binding: prop "${r}" not found as string or enum on ${i.name}`);}}}catch(o){n&&T.error("Renderer",`data-binding: exception setting ${i.name}.${r}`,o);}n&&T.debug("Renderer","data-binding: appearance overrides applied",{name:i.name});}};var fw=Se(dn());function dw(){return (0, fw.useSyncExternalStore)(ow,aw,()=>0)}var yu=Se(dn());var gI=3,vI=250,AI=(t,e)=>{let n=t?.querySelector("canvas"),i=e?.getContext("2d");return !n||!e||!i||!n.width||!n.height?false:(e.width=n.width,e.height=n.height,i.drawImage(n,0,0),e.hidden=false,true)},yI=t=>{t&&(t.hidden=true,t.width=0,t.height=0);};function hw(t,e,n){let i=(0, yu.useRef)(false);(0, yu.useEffect)(()=>(Id(),Nd(r=>{r.type!=="lost"||i.current||(i.current=AI(t.current,e.current));})),[t,e]),(0, yu.useEffect)(()=>{if(!n||!i.current)return;let r=gI,a=-1,o=0,u=requestAnimationFrame(function d(g){let y=t.current?.querySelector("canvas"),A=y?sw(y):0;A>a&&(a>=0&&(r-=1),A>0&&!o&&(o=g),a=A);let p=o>0&&g-o>=vI;if(r>0&&!p){u=requestAnimationFrame(d);return}yI(e.current),i.current=false;});return ()=>cancelAnimationFrame(u)},[n,t,e]);}var qt=Se(ze()),bI=120,_I=8,mw=()=>(0, qt.jsx)("div",{className:"rive-renderer-loader",children:(0, qt.jsx)(Rd,{label:"Loading"})}),pw=()=>(0, qt.jsxs)("div",{className:"rive-renderer-error",children:[(0, qt.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, qt.jsx)("circle",{cx:"12",cy:"8",r:"3.5"}),(0, qt.jsx)("path",{d:"M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7"}),(0, qt.jsx)("line",{x1:"17",y1:"17",x2:"21",y2:"21"}),(0, qt.jsx)("line",{x1:"21",y1:"17",x2:"17",y2:"21"})]}),(0, qt.jsx)("span",{className:"rive-renderer-error-text",children:"Avatar unavailable"})]}),SI=({lastResponse:t,onPlaybackEnd:e,className:n,style:i,onRiveReady:r,onRiveError:a,resetToken:o,avatarConfig:u,error:d,loader:g,errorFallback:y,shouldArmTalking:A,isConnected:p,userActivity:_,userAttending:C,isThinking:N,thinkingSignal:B,gestureQueue:M,gestureSignal:w,onAvatarClick:R,lipSyncTuning:D,visualState:G,onSpeechClock:ne,speakerMuted:U,onRegisterPlaybackControls:H,getAudioContext:ee,createSpeechPlayer:Q,fit:Ee,environment:Ce,rigActivity:Ue})=>{let Be=Ce==="meeting",[fe,ye]=(0, ie.useState)(false),[ce,j]=(0, ie.useState)(false),[X,K]=(0, ie.useState)(null),me=dw(),Ie=Ee?{...u?.rive?.layout||{},fit:Ee}:u?.rive?.layout||null,qe=yd(Ie,u?.rive?.watermark),Dt=Number(u?.lipSync?.visemeMs)||40,Je=(u?.pipelineMode??"input")==="data-binding",Qe=(0, ie.useRef)(r);Qe.current=r;let Wt=(0, ie.useRef)(a);Wt.current=a;let en=(0, ie.useCallback)(Z=>{K(Z),ye(true),Qe.current?.();},[]),Et=(0, ie.useCallback)(Z=>{T.error("Renderer","Failed to load Avatar file",Z),j(true),Wt.current?.(Z);},[]),kn=(0, ie.useRef)(null),Lt=(0, ie.useRef)(null),wn=(0, ie.useRef)(null);hw(Lt,wn,X);let Xe=(0, ie.useRef)(null),Ne=(0, ie.useRef)(null),Un=(0, ie.useRef)(Q??((Z,de)=>new Cd(Z,de))),Mn=(0, ie.useRef)([]),xn=(0, ie.useRef)(null),Qt=(0, ie.useRef)(0),tn=(0, ie.useRef)(0),It=(0, ie.useRef)(null),Pt=(0, ie.useRef)(null),lt=(0, ie.useRef)(Z=>`${Z}`),Re=(0, ie.useRef)(false);Re.current=!!A;let b=(0, ie.useRef)(false);b.current=!!p,(0, ie.useEffect)(()=>{Ne.current?.setMuted(!!U);},[U]);let c=G==="expired",m=(0, ie.useRef)(false);m.current=c;let E=(0, ie.useRef)(ne);E.current=ne;let x=(0, ie.useCallback)(Z=>{E.current?.(Z);},[]),L=(0, ie.useRef)(ee);L.current=ee;let z=(0, ie.useRef)(H);z.current=H,(0, ie.useEffect)(()=>{let Z={pause:()=>Ne.current?.pause(),resume:()=>Ne.current?.resume(),getOutputLevel:()=>Ne.current?.getOutputLevel()??0,hasPendingAudio:()=>Ne.current?.hasPendingAudio()??false,reset:()=>{xi(),Xe.current instanceof Ka?Xe.current.interrupt():Xe.current?.stop(),Xe.current=null,Ne.current?.destroy(),Ne.current=null,x(null),Qt.current=0,It.current=null,Mt();}};return z.current?.(Z),()=>z.current?.(null)},[]);let ae=(0, ie.useRef)(null);ae.current=X??null;let be=(0, ie.useRef)(void 0);be.current=u?.rive?.stateMachine;let re=(0, ie.useRef)(Je);re.current=Je,(0, ie.useEffect)(()=>Nd(Z=>{Z.type==="lost"&&(Ue?.detach(),Xe.current?.detach(),ae.current?.stopRendering(),ae.current=null,Pt.current=null,K(null));}),[Ue]);let pe=(0, ie.useCallback)((Z,de)=>{try{if(re.current){let $e=Pt.current,Bt=typeof de=="boolean"?$e?.boolean(Z):$e?.number(Z);return Bt?(Bt.value=de,!0):!1}let Ae=ae.current;if(!Ae)return !1;let ke=Vi(Ae,be.current).inputs.find($e=>$e.name===Z);return ke?(ke.value=de,!0):!1}catch{return false}},[]),tt=(0, ie.useCallback)((Z,de)=>{let Ae=pe(Z,de);return (re.current?Pt.current:ae.current)&&Ue?.reportWrite(Z,de,Ae),Ae},[pe,Ue]),Ke=(0, ie.useRef)(null),De=(0, ie.useCallback)(()=>(Ke.current||(Ke.current=new su(tt)),Ke.current),[tt]),wt=(0, ie.useRef)(null),Gt=(0, ie.useRef)({has:()=>false,fire:()=>{}}),Fe=(0, ie.useCallback)(()=>(wt.current||(wt.current=new au((Z,de)=>De().setMode(Z,de),{},Z=>De().cycle(Z),Z=>De().has(Z),{has:Z=>Gt.current.has(Z),fire:Z=>Gt.current.fire(Z)})),wt.current),[De]),zt=(0, ie.useCallback)(()=>{Fe().busy(),De().setMode("talking");},[Fe,De]),Mt=(0, ie.useCallback)(()=>{Fe().rest(b.current);},[Fe]),Tt=(0, ie.useCallback)(Z=>Z==="talking"?zt():Fe().resume(b.current),[zt,Fe]);(0, ie.useEffect)(()=>()=>wt.current?.dispose(),[]);let ve=u?.performance??null,ki=(0, ie.useRef)(null);(0, ie.useEffect)(()=>{if(ki.current===ve||(ki.current=ve,De().setPolicy(ve),!ve))return;let Z=Fe();Z.configure(ve),Z.current==="busy"?De().setMode("talking"):Z.resume(b.current);},[ve,De,Fe]),(0, ie.useEffect)(()=>{B&&Fe().think();},[B,Fe]),(0, ie.useEffect)(()=>{N||Fe().stopThinking();},[N,Fe]),(0, ie.useEffect)(()=>{_&&Fe().userActivity();},[_,Fe]),(0, ie.useEffect)(()=>{Fe().setAttending(!!C);},[C,Fe]);let Fn=(0, ie.useCallback)(()=>b.current?"listening":"idle",[]),I=(0, ie.useCallback)(()=>Ne.current?.isAudioActive()||Re.current?"talking":Fn(),[Fn]);(0, ie.useEffect)(()=>{if(!X||!fe||!u||!Je)return;T.debug("Renderer","data-binding: init start",{viewModelCount:X.viewModelCount,autoBindInstance:!!X.viewModelInstance});let Z=X.viewModelInstance;if(!Z){T.error("Renderer","data-binding: rive.viewModelInstance is null after autoBind \u2014 check the .riv file has a ViewModel");return}Pt.current=Z;let{format:de,shape:Ae,matched:ke}=uu(Ve=>{try{return Z.number(Ve)!==null}catch{return !1}});lt.current=de,ke?T.debug("Renderer","data-binding: viseme naming detected",{shape:Ae}):T.error("Renderer","data-binding: no viseme props found on the rig \u2014 lip-sync will not move");let $e=I();$e==="talking"&&T.debug("Renderer","data-binding: VM bound mid-turn \u2014 entering talking"),Tt($e);let Bt=u.rive.viewModel??[];mv(Z,Bt,true);let Ze=requestAnimationFrame(()=>mv(Z,Bt,false));return ()=>cancelAnimationFrame(Ze)},[X,fe,u,Je]),(0, ie.useEffect)(()=>{!X||!fe||Je||Tt(I());},[X,fe,Je,Tt,I]),(0, ie.useEffect)(()=>{if(!X||!fe||!u)return;let Z=u.rive.watermark?1:0;try{if(Je){let de=X.viewModelInstance?.number(ed);de&&(de.value=Z);}else {let{inputs:de}=Vi(X,u.rive?.stateMachine),Ae=de.find(ke=>ke.name===ed);Ae&&(Ae.value=Z);}}catch(de){T.error("Renderer","failed to set Watermark_opacity",de);}},[X,fe,u,Je]),(0, ie.useEffect)(()=>{if(!X||!fe)return;let Z=Xe.current;Z instanceof Ka?Z.retarget(Pt.current):Z&&Z.retarget(X,u?.rive?.stateMachine),Ke.current?.reapply();},[X,fe]);let vi=u?.rive?.stateMachine;(0, ie.useEffect)(()=>{if(!X||!fe||!Ue)return;let Z=Je?"data-binding":"input",de=requestAnimationFrame(()=>{de=requestAnimationFrame(()=>Ue.attach({rive:X,binding:Z,stateMachine:vi}));});return ()=>{cancelAnimationFrame(de),Ue.detach();}},[X,fe,Je,vi,Ue]),(0, ie.useEffect)(()=>{A&&(zt(),T.debug("Renderer","arming talking branch ahead of audio"));},[A,zt]),(0, ie.useEffect)(()=>{Ne.current?.isAudioActive()||p&&Re.current||(p?Fe().connect():Mt());},[p,Mt,Fe]);let wr=(0, ie.useCallback)(Z=>{let de=ae.current;if(!de)return;let{input:Ae,type:ke,value:$e,binding:Bt,resetMs:Ze}=ou(Z,u?.rive?.gestures,Je);T.debug("Renderer","gesture: firing",{name:Z,input:Ae,type:ke,binding:Bt}),Ue?.reportGesture(Z,Ae);try{if(Bt==="data-binding"){let Ve=Pt.current;if(!Ve)return;if(ke==="trigger")Ve.trigger(Ae)?.trigger();else if(ke==="boolean"){let ut=Ve.boolean(Ae);ut&&(ut.value=$e!==0,Ze&&setTimeout(()=>{let dt=Pt.current?.boolean(Ae);dt&&(dt.value=!1);},Ze));}else {let ut=Ve.number(Ae);ut&&(ut.value=$e);}}else {let{name:Ve,inputs:ut}=Vi(de,u?.rive?.stateMachine),dt=ut.find(rt=>rt.name===Ae);if(!dt)return;ke==="trigger"?(dt.fire(),Ue?.reportTrigger(Ae)):ke==="boolean"?(dt.value=$e!==0,Ze&&setTimeout(()=>{let rt=(Ve?ae.current?.stateMachineInputs(Ve):null)?.find(an=>an.name===Ae);rt&&(rt.value=!1);},Ze)):dt.value=$e;}}catch(Ve){T.error("Renderer",`gesture: failed to fire "${Z}"`,Ve);}},[u,Je,Ue]),Vn=(0, ie.useCallback)(Z=>{let de=ae.current;if(!de)return false;let{input:Ae,type:ke,binding:$e}=ou(Z,u?.rive?.gestures,Je);if(ke!=="trigger")return false;try{if($e==="data-binding")return !!Pt.current?.trigger(Ae);let{inputs:Bt}=Vi(de,u?.rive?.stateMachine);return Bt.some(Ze=>Ze.name===Ae)}catch{return false}},[u,Je]);Gt.current={has:Vn,fire:wr};let xi=(0, ie.useCallback)(()=>{for(let Z of Mn.current)Z();Mn.current=[];},[]),le=(0, ie.useCallback)(Z=>{let{name:de,atMs:Ae,speechless:ke}=Z,$e=()=>{Z.beep?Ne.current?.playBeep():wr(de);};if(Ae==null){T.debug("Renderer","gesture: scheduling",{name:de,mode:"immediate"}),$e();return}let Bt=!!Ne.current?.isAudioActive(),Ze=ke==null?Bt:!ke;T.debug("Renderer","gesture: scheduling",{name:de,atMs:Ae,speechless:ke,audioActive:Bt,mode:Ze?"alignment":"delay"});let Ve={cancel:()=>{}},ut=()=>{Mn.current=Mn.current.filter(dt=>dt!==Ve.cancel);};if(Ze){let dt=Ae/1e3,rt=requestAnimationFrame(function an(){let Yi=Ne.current;if(Yi){if(Yi.getAlignmentTime()>=dt){T.debug("Renderer","gesture: firing (alignment reached)",{name:de,atMs:Ae,alignmentMs:Math.round(Yi.getAlignmentTime()*1e3)}),ut(),$e();return}rt=requestAnimationFrame(an);}});Ve.cancel=()=>cancelAnimationFrame(rt);}else {let dt=window.setTimeout(()=>{T.debug("Renderer","gesture: firing (delay elapsed)",{name:de,atMs:Ae}),ut(),$e();},Ae);Ve.cancel=()=>clearTimeout(dt);}Mn.current.push(Ve.cancel);},[wr]);(0, ie.useEffect)(()=>{if(!X||!fe)return;let Z=M?.current;if(!Z||Z.length===0)return;let de=Z.splice(0,Z.length);for(let Ae of de)le(Ae);},[w,X,fe,M,le]),(0, ie.useEffect)(()=>xi,[xi]);let Hn=(0, ie.useCallback)(()=>{let Z=Ne.current;if(!Z)return ig;let de=D?.offsetSec??0;return Math.min(Z.getAlignmentTime()+de,Z.getPlayableAlignmentTime()+de+.5)},[D]),Mr=(0, ie.useCallback)(()=>!!Ne.current?.isPlaybackScheduled(),[]),pa=(0, ie.useCallback)(async()=>{if(!fe||!t)return;let{audioChunks:Z,alignments:de,sessionId:Ae,jobId:ke,chunkOffset:$e}=t;if(zt(),It.current!==ke&&(It.current!==null&&(Xe.current?.clearVisemes(),Xe.current instanceof Ka&&Xe.current.prepareSpeech()),Qt.current=0),It.current=ke,xn.current!==Ae&&(T.debug("Renderer","new epoch \u2192 reset audio + lipsync"),Xe.current?.stop(),Xe.current=null,Ne.current?.destroy(),Ne.current=null,x(null),xn.current=Ae,Qt.current=0),!Xe.current||!Ne.current){Xe.current&&(Xe.current.stop(),Xe.current=null),T.debug("Renderer","init audio + lipsync"),Ne.current||(Ne.current=Un.current(()=>{let Ve=e?.()===true;Xe.current?.clearVisemes(),Xe.current?.forceSilence(),Ve&&b.current?Fe().restThinking():Mt();},L.current?.()??null),Ne.current.setMuted(!!U),x(()=>Ne.current?.isPlaybackScheduled()?Ne.current.getAlignmentTime():null));let Ze=u?.pipelineMode??"input";if(T.debug("Renderer","engine selection",{pipelineMode:Ze,lipSyncVmReady:!!Pt.current}),Ze==="data-binding"){let Ve=Pt.current;if(!Ve&&X){T.error("Renderer","data-binding: lip-sync ViewModel not initialized \u2014 was bindViewModelInstance called before first speak?");return}let ut=new Ka;ut.initialize(Ve,{getAlignmentTime:Hn,isLive:Mr},D),Xe.current=ut;}else {let Ve=new wd;Ve.initialize(X,{getAlignmentTime:Hn,isLive:Mr},u?.rive?.stateMachine,D),Xe.current=Ve;}Xe.current.start();}$e>Qt.current&&T.error("Renderer","gap in TTS chunks \u2014 a speak batch was dropped",{expected:Qt.current,got:$e,jobId:ke});let Bt=Math.max(0,Qt.current-$e);for(let Ze=Bt;Ze<Z.length;Ze++){let Ve=Z[Ze],ut=de[Ze];if(Qt.current=$e+Ze+1,!Ve)continue;if(!ut){Ne.current.enqueueSequentialChunk(Ve),T.debug("Renderer","appended sequential (no-alignment) chunk",{index:$e+Ze});continue}let dt=ut.character_start_times_seconds[0]??0,rt=t.visemes?.[Ze]??Lf(ut,Dt);if(Ne.current.enqueueChunk(Ve,dt),Xe.current.appendVisemes(rt),T.debug("Renderer","appended chunk",{alignmentStart:dt,firstViseme:rt[0],lastViseme:rt[rt.length-1],alignmentNow:Ne.current.getAlignmentTime()}),t.isGreeting){let an=ut.character_end_times_seconds;T.event("Renderer","greeting chunk queued",{chunkIndex:$e+Ze,totalChunks:Z.length,alignmentStart:dt,alignmentSpan:an?.[an.length-1]??null,chars:ut.characters?.length??0,visemeCount:rt.length,firstVisemeStart:rt[0]?.start??null,clockAtQueue:Ne.current.getAlignmentTime()});}}},[t,X,fe,e,Dt,u,Je,zt,Mt,Fe,x,Hn,Mr,D]),ti=()=>{xi(),Xe.current?.stop(),Xe.current=null,Ne?.current?.destroy(),Ne.current=null,x(null),Ke.current?.stop(),xn.current=null,Qt.current=0,It.current=null,Mt();};(0, ie.useEffect)(()=>{if(!X)return;let Z=()=>{X&&(X.layout=yd(Ie,u?.rive?.watermark),X.resetArtboardSize?.());};return X.on(bu.EventType.Load,Z),X?.isPlaying&&Z(),()=>{X.off(bu.EventType.Load,Z);}},[X]),(0, ie.useEffect)(()=>{if(!X)return;let Z=de=>{if(Array.isArray(de.data))for(let Ae of de.data)typeof Ae=="string"&&Fe().rigEntered(Ae);};return X.on(bu.EventType.StateChange,Z),()=>X.off(bu.EventType.StateChange,Z)},[X,Fe]),(0, ie.useEffect)(()=>{X&&(X.layout=yd(Ie,u?.rive?.watermark));},[X,Ee,u]),(0, ie.useEffect)(()=>{let Z=kn.current;if(!Z||!X)return;let de=0,Ae=null,ke=()=>{let Ze=Z.querySelector(".rive-renderer-canvas > canvas");if(!Ze)return;let Ve=Ze.clientWidth;if(!Ve)return;let ut=Ze.getBoundingClientRect(),dt=ut.width/Ve;if(!dt||!isFinite(dt))return;let an=(Be?1:window.devicePixelRatio||1)/dt;Ze.width===Math.trunc(an*ut.width)&&Ze.height===Math.trunc(an*ut.height)||X.resizeDrawingSurfaceToCanvas?.(an);},$e=()=>{Ae&&clearTimeout(Ae),Ae=setTimeout(()=>{cancelAnimationFrame(de),de=requestAnimationFrame(ke);},bI);},Bt=new ResizeObserver($e);return Bt.observe(Z),de=requestAnimationFrame(ke),()=>{Ae&&clearTimeout(Ae),cancelAnimationFrame(de),Bt.disconnect();}},[X,Be]),(0, ie.useEffect)(()=>{if(t&&fe&&pa(),!t&&X){if((u?.pipelineMode??"input")==="data-binding"){let de=Pt.current;if(de){for(let Ae=1;Ae<=21;Ae++)try{let ke=de.number(lt.current(Ae));ke&&(ke.value=0);}catch{}try{let Ae=de.number(lt.current(0));Ae&&(Ae.value=100);}catch{}}}else {let{inputs:de}=Vi(X,u?.rive?.stateMachine);de.forEach(Ae=>{let ke=qa(Ae.name);ke!==null&&(Ae.value=ke===0?100:0);});}m.current||(Re.current?zt():Mt());}},[X,fe,t,pa,u,A]),(0, ie.useEffect)(()=>()=>{try{ti();}catch(Z){T.error("Renderer","Reset failed",Z);}},[]),(0, ie.useEffect)(()=>{o!==tn.current&&(tn.current=o,ti());},[o]);let zi=(0, ie.useRef)(null);if(!u)return (0, qt.jsx)("div",{className:`rive-renderer-root ${d?.fatal?"":"rive-renderer-root--loading"} ${n??""}`,style:i,children:d?.fatal?y??(0, qt.jsx)(pw,{}):g??(0, qt.jsx)(mw,{})});let es=R&&fe?{onPointerDown:Z=>{zi.current={x:Z.clientX,y:Z.clientY};},onClick:Z=>{let de=zi.current;zi.current=null,!(!de||Math.hypot(Z.clientX-de.x,Z.clientY-de.y)>_I)&&R();}}:null,ji=!ce&&!fe,Tr=ce?y??(0, qt.jsx)(pw,{}):ji?g??(0, qt.jsx)(mw,{}):null;return (0, qt.jsxs)("div",{className:`rive-renderer-root ${ji?"rive-renderer-root--loading":""} ${n??""}`,style:{...i,...c?{filter:"grayscale(1)",transition:"filter 600ms ease"}:null},children:[(0, qt.jsxs)("div",{className:"rive-renderer-canvasWrapper",ref:kn,...es,children:[(0, qt.jsx)("div",{className:"rive-renderer-surface",ref:Lt,children:(0, qt.jsx)(uw,{src:u.rive?.src,artboard:u.rive?.artboard,stateMachine:u.rive?.stateMachine,autoBind:Je,layout:qe,onReady:en,onLoadError:Et},me)}),(0, qt.jsx)("canvas",{ref:wn,className:"rive-renderer-hold",hidden:true,"aria-hidden":"true"})]}),Tr]})},gw=(0, ie.memo)(SI);var Hi=Se(dn());var Eo=Se(ze()),wI=.08,MI=6e3,vw=t=>t.speaker==="avatar"&&!t.isFinal&&t.words.some(e=>e.end>0),TI=({store:t,speechClockRef:e,position:n="bottom-center",controlsVisible:i,className:r,style:a})=>{let o=(0, Hi.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot),u=i&&n.startsWith("bottom"),d=o.slice(-2),g=d.find(vw)??null,[y,A]=(0, Hi.useState)(0),[p,_]=(0, Hi.useState)(false),C=(0, Hi.useRef)(null);C.current=g,(0, Hi.useEffect)(()=>{if(!g)return;A(0);let B=0,M=()=>{let w=C.current,R=e.current?.();if(w&&R!=null){let D=Ff(w,R+wI);A(G=>D>G?D:G);}B=requestAnimationFrame(M);};return B=requestAnimationFrame(M),()=>cancelAnimationFrame(B)},[g?.id,e]),(0, Hi.useEffect)(()=>{if(_(false),!o[o.length-1]?.isFinal)return;let M=setTimeout(()=>_(true),MI);return ()=>clearTimeout(M)},[o]);let N=d.map(B=>({entry:B,wordCount:vw(B)?Math.min(y,B.words.length):B.words.length})).filter(B=>B.wordCount>0);return N.length?(0, Eo.jsx)("div",{className:["avatar-captions",`avatar-captions--${n}`,u?"avatar-captions--raised":"",p?"avatar-captions--hidden":"",r??""].filter(Boolean).join(" "),style:a,role:"log","aria-live":"polite",children:N.map(({entry:B,wordCount:M},w)=>(0, Eo.jsxs)("p",{className:`avatar-captions-line avatar-captions-line--${B.speaker} ${w===N.length-1?"":"avatar-captions-line--past"}`,children:[B.speaker==="user"&&(0, Eo.jsx)("span",{className:"avatar-captions-tag",children:"You"}),B.words.slice(0,M).map((R,D)=>(0, Eo.jsx)("span",{className:`avatar-captions-word ${B.isFinal?"":"avatar-captions-word--interim"}`,children:R.text},`${D}-${R.text}`))]},B.id))}):null},Aw=TI;var yw=Se(dn()),Za=Se(ze()),CI={network:{title:"Your connection is unstable",detail:"Check your internet \u2014 audio may drop until it recovers."},device:{title:"Your device is struggling to keep up",detail:"Closing other tabs or apps should help."},service:{title:"Responses are running slow",detail:"It's on our side \u2014 replies may lag for a bit."}},RI=({store:t,position:e="bottom-left",controlsVisible:n,className:i,style:r})=>{let o=(0, yw.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot).concern;if(!o||o.state!=="degraded")return null;let u=CI[o.scope],d=n&&e.startsWith("bottom");return (0, Za.jsxs)("div",{className:["avatar-status-banner",`avatar-status-banner--${e}`,`avatar-status-banner--${o.state}`,d?"avatar-status-banner--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite",children:[(0, Za.jsx)("span",{className:"avatar-status-banner-dot","aria-hidden":"true"}),(0, Za.jsxs)("span",{className:"avatar-status-banner-text",children:[(0, Za.jsx)("span",{className:"avatar-status-banner-title",children:u.title}),(0, Za.jsx)("span",{className:"avatar-status-banner-detail",children:u.detail})]})]})},bw=RI;var wo=Se(ze()),kI=({visible:t,position:e="top-left",controlsVisible:n,className:i,style:r})=>{if(!t)return null;let a=n&&e.startsWith("bottom");return (0, wo.jsxs)("div",{className:["avatar-thinking-indicator",`avatar-thinking-indicator--${e}`,a?"avatar-thinking-indicator--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite","aria-label":"The avatar is thinking",children:[(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"})]})},_w=kI;var vt=Se(ze()),_u=({size:t=22,children:e})=>(0, vt.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e}),Sw=({muted:t,size:e})=>(0, vt.jsxs)(_u,{size:e,children:[(0, vt.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, vt.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, vt.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),t&&(0, vt.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),Ew=({muted:t,size:e})=>(0, vt.jsxs)(_u,{size:e,children:[(0, vt.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, vt.jsxs)(vt.Fragment,{children:[(0, vt.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, vt.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, vt.jsxs)(vt.Fragment,{children:[(0, vt.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, vt.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),ww=({size:t})=>(0, vt.jsx)(_u,{size:t,children:(0, vt.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Mw=({size:t})=>(0, vt.jsx)(_u,{size:t,children:(0, vt.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),Tw=({size:t})=>(0, vt.jsxs)(_u,{size:t,children:[(0, vt.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, vt.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]});var Sn=Se(ze()),xI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isMicMuted:a,isSpeakerMuted:o,setMicMuted:u,setSpeakerMuted:d,showStopSpeaking:g,isSpeaking:y,stopSpeaking:A})=>(0, Sn.jsx)("div",{className:`avatar-controls-root ${i}`,children:t?(0, Sn.jsx)("button",{type:"button",onClick:e,className:"avatar-controls-button avatar-controls-call","aria-label":"Start call",disabled:!r,children:(0, Sn.jsx)(Mw,{})}):(0, Sn.jsxs)(Sn.Fragment,{children:[(0, Sn.jsx)("button",{type:"button",onClick:()=>u(!a),className:`avatar-controls-button avatar-controls-mute${a?" avatar-controls-muted":""}`,"aria-label":a?"Unmute microphone":"Mute microphone","aria-pressed":a,children:(0, Sn.jsx)(Sw,{muted:a})}),(0, Sn.jsx)("button",{type:"button",onClick:()=>d(!o),className:`avatar-controls-button avatar-controls-mute${o?" avatar-controls-muted":""}`,"aria-label":o?"Unmute avatar audio":"Mute avatar audio","aria-pressed":o,children:(0, Sn.jsx)(Ew,{muted:o})}),g&&y&&(0, Sn.jsx)("button",{type:"button",onClick:A,className:"avatar-controls-button avatar-controls-stop-speaking","aria-label":"Stop the avatar from speaking",children:(0, Sn.jsx)(ww,{})}),(0, Sn.jsx)("button",{type:"button",onClick:n,className:"avatar-controls-button avatar-controls-hangup","aria-label":"End call",children:(0, Sn.jsx)(Tw,{})})]})}),Cw=xI;var Ja=Se(dn()),Gi=Se(ze()),OI=t=>{let e=t;if(!e?.tagName)return false;let n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||e.isContentEditable},II=({isTalking:t,isSpeaking:e,startTalking:n,stopTalking:i,spacebar:r,disabled:a=false})=>{let o=(0, Ja.useRef)({isTalking:t,startTalking:n,stopTalking:i,disabled:a});o.current={isTalking:t,startTalking:n,stopTalking:i,disabled:a};let u=t?"Listening":e?"Hold to interrupt":"Hold to talk",d=(0, Ja.useCallback)(y=>{a||y.button!==0||(y.currentTarget.setPointerCapture?.(y.pointerId),n());},[a,n]),g=(0, Ja.useCallback)(()=>i(),[i]);return (0, Ja.useEffect)(()=>{if(!r)return;let y=_=>{_.code!=="Space"||_.repeat||OI(_.target)||o.current.disabled||(_.preventDefault(),o.current.startTalking());},A=_=>{_.code!=="Space"||!o.current.isTalking||(_.preventDefault(),o.current.stopTalking());},p=()=>{o.current.isTalking&&o.current.stopTalking();};return window.addEventListener("keydown",y),window.addEventListener("keyup",A),window.addEventListener("blur",p),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",A),window.removeEventListener("blur",p);}},[r]),(0, Gi.jsxs)("button",{type:"button",className:`avatar-ptt-button${t?" avatar-ptt-holding":""}`,disabled:a,"aria-label":u,"aria-pressed":t,onPointerDown:d,onPointerUp:g,onPointerCancel:g,onContextMenu:y=>y.preventDefault(),children:[(0, Gi.jsx)("span",{className:"avatar-ptt-halo","aria-hidden":"true"}),(0, Gi.jsxs)("span",{className:"avatar-ptt-face",children:[(0, Gi.jsxs)("svg",{className:"avatar-ptt-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0, Gi.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, Gi.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, Gi.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"})]}),(0, Gi.jsx)("span",{className:"avatar-ptt-label",children:u},u)]})]})},Rw=II;var At=Se(ze()),NI=({muted:t})=>(0, At.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, At.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, At.jsxs)(At.Fragment,{children:[(0, At.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, At.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, At.jsxs)(At.Fragment,{children:[(0, At.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, At.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),DI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isSpeakerMuted:a,setSpeakerMuted:o,isTalking:u,isSpeaking:d,startTalking:g,stopTalking:y,spacebar:A})=>t?(0, At.jsx)("div",{className:`avatar-ptt-root ${i}`,children:(0, At.jsxs)("button",{type:"button",onClick:e,className:"avatar-ptt-connect","aria-label":"Start call",disabled:!r,children:[(0, At.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0, At.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),(0, At.jsx)("span",{children:"Connect"})]})}):(0, At.jsxs)("div",{className:`avatar-ptt-root ${i}`,children:[(0, At.jsx)("button",{type:"button",onClick:()=>o(!a),className:`avatar-ptt-secondary${a?" avatar-ptt-secondary-off":""}`,"aria-label":a?"Unmute avatar audio":"Mute avatar audio","aria-pressed":a,children:(0, At.jsx)(NI,{muted:a})}),(0, At.jsx)(Rw,{isTalking:u,isSpeaking:d,startTalking:g,stopTalking:y,spacebar:A}),(0, At.jsx)("button",{type:"button",onClick:n,className:"avatar-ptt-secondary avatar-ptt-hangup","aria-label":"End call",children:(0, At.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, At.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, At.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]})})]}),kw=DI;var Dd=Se(dn()),Ye=Se(ze()),pv=()=>(0, Ye.jsx)("span",{className:"avatar-pip-swap-hint","aria-hidden":"true",children:(0, Ye.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",children:(0, Ye.jsx)("path",{d:"M4 10V4h6M20 14v6h-6",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),xw=()=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("path",{d:"M16 10.5V8a2 2 0 0 0-2-2H6.5M3 6.5V16a2 2 0 0 0 2 2h9M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0, Ye.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),LI=()=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("rect",{x:"3",y:"6",width:"13",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, Ye.jsx)("path",{d:"M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),PI=({on:t})=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0, Ye.jsx)("path",{d:"M8.5 14.5c.9 1.2 2.1 1.8 3.5 1.8s2.6-.6 3.5-1.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, Ye.jsx)("path",{d:"M9 9.5h.01M15 9.5h.01",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round"}),!t&&(0, Ye.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),BI=({on:t,toggle:e})=>(0, Ye.jsxs)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":"Detect mood",title:t?"Detect mood: on":"Detect mood: off",className:`avatar-camera-preview-mood${t?" on":""}`,onClick:e,children:[(0, Ye.jsx)(PI,{on:t}),(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-label",children:"Detect mood"}),(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-track","aria-hidden":"true",children:(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-knob"})})]}),UI=({sessionOpen:t,stream:e,mirrored:n=true,corner:i="bottom-right",variant:r="corner",onSwap:a,onToggleVideo:o,onFlip:u,mood:d})=>{let g=(0, Dd.useRef)(null),y=e!==null;return (0, Dd.useEffect)(()=>{let A=g.current;A&&(A.srcObject=e,e&&A.play().catch(()=>{}));},[e]),t?(0, Ye.jsxs)("div",{className:`avatar-camera-preview ${r==="stage"?"stage":i}${y?"":" video-off"}${a?" swappable":""}`,...a&&{role:"button",tabIndex:0,"aria-label":"Show camera full size",onClick:a,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a());}},children:[y?(0, Ye.jsx)("video",{ref:g,className:`avatar-camera-preview-video${n?" mirrored":""}`,playsInline:true,muted:true,autoPlay:true}):(0, Ye.jsxs)("div",{className:"avatar-camera-preview-off","aria-label":"Video off",children:[(0, Ye.jsx)(xw,{}),(0, Ye.jsx)("span",{children:"Video off"})]}),a&&(0, Ye.jsx)(pv,{}),(0, Ye.jsxs)("div",{className:"avatar-camera-preview-actions",onClick:A=>A.stopPropagation(),children:[d&&y&&(0, Ye.jsx)(BI,{on:d.on,toggle:d.toggle}),u&&y&&(0, Ye.jsx)("button",{type:"button",className:"avatar-camera-preview-btn",onClick:u,title:"Switch camera","aria-label":"Switch camera",children:(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("path",{d:"M4 8a6 6 0 0 1 10-4.5M20 16a6 6 0 0 1-10 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, Ye.jsx)("path",{d:"M4 4v4h4M20 20v-4h-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),o&&(0, Ye.jsx)("button",{type:"button",className:`avatar-camera-preview-btn${y?"":" off"}`,onClick:o,title:y?"Turn off video":"Turn on video","aria-label":y?"Turn off video":"Turn on video","aria-pressed":!y,children:y?(0, Ye.jsx)(xw,{}):(0, Ye.jsx)(LI,{})})]})]}):null},Ow=UI;var ei=Se(ze()),FI=()=>(0, ei.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, ei.jsx)("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, ei.jsx)("path",{d:"M8 20h8M12 16v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),VI=({phase:t,onShare:e,onDismiss:n,onStop:i,position:r="top-center",controlsVisible:a,className:o,style:u})=>{if(t!=="awaiting_click"&&t!=="live")return null;let d=a&&r.startsWith("bottom"),g=["avatar-screen-share",`avatar-screen-share--${r}`,t==="live"?"live":"",d?"avatar-screen-share--raised":"",o??""].filter(Boolean).join(" ");return t==="awaiting_click"?(0, ei.jsxs)("div",{className:g,style:u,role:"group","aria-label":"Screen sharing request",children:[(0, ei.jsxs)("button",{type:"button",className:"avatar-screen-share-primary",onClick:e,children:[(0, ei.jsx)(FI,{}),"Share your screen"]}),(0, ei.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:n,children:"Not now"})]}):(0, ei.jsxs)("div",{className:g,style:u,role:"status",children:[(0, ei.jsx)("span",{className:"avatar-screen-share-dot","aria-hidden":"true"}),(0, ei.jsx)("span",{children:"Sharing your screen"}),(0, ei.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:i,children:"Stop"})]})},Iw=VI;var En=Se(ze()),HI=t=>{let e=gu(),i=e?.controls?.enabled!==false&&e.mode==="call",r=e?._camera?.sessionOpen??false,a=!!t?.usePictureInPicture&&r,[o,u]=(0, $a.useState)(true);(0, $a.useEffect)(()=>{r&&u(true);},[r]);let d=a&&o,g=(0, $a.useCallback)(()=>u(true),[]),y=(0, $a.useCallback)(()=>u(false),[]),A=e?._environment!=="meeting",p=A&&!!e?.isConnecting&&!!e?._avatarConfig,_=[d?`avatar-pip-frame swappable ${t?.pictureInPictureCorner??"bottom-right"}`:"avatar-stage-layer",p?"avatar-stage-loading":""].filter(Boolean).join(" "),C=(0, En.jsx)(gw,{lastResponse:e?._currentJob,onPlaybackEnd:e?._onPlaybackEnd,avatarConfig:e?._avatarConfig||null,fit:t?.fit,error:e?.error,className:t?.className,style:t?.style,onRiveReady:e?._onRiveReady,onRiveError:e?._onRiveError,resetToken:e?._resetToken,shouldArmTalking:e?._shouldArmTalking,isConnected:e?.isConnected,userActivity:e?._userActivity,userAttending:e?.isTalking,isThinking:e?.isThinking,thinkingSignal:e?._thinkingSignal,gestureQueue:e?._gestureQueue,gestureSignal:e?._gestureSignal,onAvatarClick:d||!A?void 0:e?._avatarClicked,lipSyncTuning:e?._lipSyncTuning,visualState:e?._visualState,onSpeechClock:e?._registerSpeechClock,onRegisterPlaybackControls:e?._registerPlaybackControls,getAudioContext:e?._getAudioContext,createSpeechPlayer:e?._createSpeechPlayer,speakerMuted:e?._speakerMuted,rigActivity:e?._rigActivity,loader:t?.loader,errorFallback:t?.errorFallback,environment:e?._environment},e?._riveKey);return (0, En.jsxs)(VE,{children:[(a||!t?.hideCameraPreview)&&(0, En.jsx)(Ow,{sessionOpen:r,stream:e?._camera?.stream??null,mirrored:e?._camera?.facing!=="environment",corner:t?.cameraPreviewCorner??"bottom-right",variant:d?"stage":"corner",onSwap:a&&!d?g:void 0,onToggleVideo:e?._camera?.toggleVideo,onFlip:e?._camera?.flip,mood:e?._camera?.mood}),(0, En.jsxs)("div",{className:_,...d&&{role:"button",tabIndex:0,"aria-label":"Show avatar full size",onClick:y,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),y());}},children:[C,d&&(0, En.jsx)(pv,{})]}),e?._captionsEnabled&&(0, En.jsx)(Aw,{store:e._transcriptStore,speechClockRef:e._speechClockRef,position:e._captionPosition,controlsVisible:i,className:t?.captionClassName,style:t?.captionStyle}),e?._statusBannerEnabled&&(0, En.jsx)(bw,{store:e._healthStore,position:e._statusBannerPosition,controlsVisible:i,className:t?.statusBannerClassName,style:t?.statusBannerStyle}),e?._thinkingIndicatorEnabled&&(0, En.jsx)(_w,{visible:!!e?.isResponseSlow,position:e._thinkingIndicatorPosition,controlsVisible:i,className:t?.thinkingIndicatorClassName,style:t?.thinkingIndicatorStyle}),e?._screen&&(0, En.jsx)(Iw,{phase:e._screen.phase,onShare:e._screen.share,onDismiss:e._screen.dismiss,onStop:e._screen.stop,position:e._screenSharePosition,controlsVisible:i,className:t?.screenShareClassName,style:t?.screenShareStyle}),e._mode!=="player"&&A&&(0, En.jsx)("div",{className:`connectivity-dot ${e.isConnected?"connected":"disconnected"}`,title:e.isConnected?"Connected to Server":"Disconnected"}),p&&(0, En.jsx)("div",{className:"avatar-connecting-overlay",children:t?.loader??(0, En.jsx)(Rd,{label:"Connecting"})}),i&&e?.isPushToTalk&&(0, En.jsx)(kw,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isSpeakerMuted:e?.isSpeakerMuted,setSpeakerMuted:e?.setSpeakerMuted,isTalking:e?.isTalking,isSpeaking:e?.isSpeaking,startTalking:e?.startTalking,stopTalking:e?.stopTalking,spacebar:e?._spacebarToTalk}),i&&!e?.isPushToTalk&&(0, En.jsx)(Cw,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isMicMuted:e?.isMicMuted,isSpeakerMuted:e?.isSpeakerMuted,setMicMuted:e?.setMicMuted,setSpeakerMuted:e?.setSpeakerMuted,showStopSpeaking:e?.controls?.stopSpeaking===true,isSpeaking:e?.isSpeaking,stopSpeaking:e?.stopSpeaking})]})},Nw=HI;var GI="/v1/meeting/session-token";async function Dw(t){let e=await fetch(`${Fl()}${GI}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:t})});if(!e.ok)throw new Error(`Meeting ticket exchange failed (${e.status})`);let n=await e.json();if(typeof n.token!="string"||!n.token)throw new Error("Meeting ticket exchange returned no token");return n.token}var zI=3e4,Lw=1e3;function jI(){try{let t=document.createElement("canvas").getContext("webgl2"),e=t?.getExtension("WEBGL_debug_renderer_info");return t&&e?String(t.getParameter(e.UNMASKED_RENDERER_WEBGL)):null}catch{return null}}function YI(){return new Promise(t=>{let e=0,n=performance.now(),i=setTimeout(()=>t(e),Lw+200),r=a=>{e++,a-n<Lw?requestAnimationFrame(r):(clearTimeout(i),t(e));};requestAnimationFrame(r);})}function Pw(t){let e=jI(),n=async()=>{T.event("meeting","diagnostics",{outputContext:t()?.state??null,visibility:document.visibilityState,fps:await YI(),webglRenderer:e,viewport:`${window.innerWidth}x${window.innerHeight}`});};n();let i=setInterval(()=>{n();},zI);return ()=>clearInterval(i)}var qI=2,WI=1e3,QI=-40,XI=-90;function KI(t){let e=t.sampleRate*qI,n=t.createBuffer(1,e,t.sampleRate),i=n.getChannelData(0);for(let r=0;r<e;r++)i[r]=Math.random()*2-1;return n}function Bw(t,e){let n=Math.max(XI,Math.min(QI,e)),i=null,r=()=>{if(i){try{i.source.stop();}catch{}i.source.disconnect(),i.gain.disconnect(),i=null;}},a=()=>{let u=t();if(i&&i.ctx===u||(r(),!u||u.state!=="running"))return;let d=u.createBufferSource();d.buffer=KI(u),d.loop=true;let g=u.createGain();g.gain.value=Math.pow(10,n/20),d.connect(g).connect(u.destination),d.start(),i={ctx:u,source:d,gain:g},T.event("meeting","audio bed started",{levelDb:n});};a();let o=setInterval(a,WI);return ()=>{clearInterval(o),r();}}var Ri=Se(ze()),ZI="#000",Uw=({avatarId:t,ticket:e,apiKey:n,background:i,debug:r,lipSyncOffsetMs:a,audioBedDb:o})=>{let u=(0, Mo.useMemo)(()=>{let d={environment:"meeting",mode:"call",debug:r,avatar:{avatarId:t,greeting:{enabled:true},...a!==void 0&&{voiceSettings:{lipSync:{offsetMs:a}}}}};return e?{...d,getSessionToken:()=>Dw(e)}:{...d,apiKey:n??""}},[t,e,n,r,a]);return eN(i??ZI),(0, Ri.jsxs)(FE,{config:u,children:[(0, Ri.jsx)(Nw,{loader:(0, Ri.jsx)(Ri.Fragment,{}),errorFallback:(0, Ri.jsx)(Ri.Fragment,{}),hideCameraPreview:true}),r&&(0, Ri.jsx)(JI,{}),o!==void 0&&(0, Ri.jsx)($I,{levelDb:o})]})},JI=()=>{let{_getAudioContext:t}=gu();return (0, Mo.useEffect)(()=>Pw(t),[t]),null},$I=({levelDb:t})=>{let{_getAudioContext:e}=gu();return (0, Mo.useEffect)(()=>Bw(e,t),[e,t]),null},eN=t=>{(0, Mo.useEffect)(()=>{for(let e of [document.documentElement,document.body])Object.assign(e.style,{background:t,margin:"0",width:"100vw",height:"100vh",overflow:"hidden"});},[t]);};function Er(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t));}Er(`.avatar-shell-root{position:relative;width:100%;height:100%;overflow:hidden;border-radius:inherit}.connectivity-dot{position:absolute;top:10px;right:25px;width:12px;height:12px;border-radius:50%;border:2px solid white;box-shadow:0 0 4px #0000004d;z-index:10;transition:background-color .3s ease}.connectivity-dot.connected{background-color:#4caf50}.connectivity-dot.disconnected{background-color:#f44336}
32
+ `;var rk={};var Qa=()=>rk;async function sd(t){let e=()=>t.state==="running";for(let n=0;n<5;n++){if(e())return true;if(t.state==="closed")return false;await Promise.race([t.resume().catch(()=>{}),new Promise(i=>setTimeout(i,400))]);}return e()}function h1(t,e){let n=2*Math.PI*t/e,i=Math.cos(n),r=Math.sin(n)/(2*Math.SQRT1_2),a=1+r,o=(1-i)/2/a,u=(1-i)/a,d=o,g=-2*i/a,y=(1-r)/a,A=0,p=0,_=0,C=0;return N=>{for(let B=0;B<N.length;B++){let M=N[B],w=o*M+u*A+d*p-g*_-y*C;p=A,A=M,C=_,_=w,N[B]=w;}}}function ak(t){let e=t/16e3,n=t>16e3?h1(7e3,t):null,i=t>16e3?h1(7e3,t):null,r=1,a=0;return o=>{let u=o.length;if(u===0)return new Float32Array(0);let d=o.slice();n&&i&&(n(d),i(d));let g=Math.max(0,Math.ceil((u-r)/e)),y=new Float32Array(g);for(let A=0;A<g;A++){let p=Math.floor(r),_=r-p,C=p===0?a:d[p-1],N=d[p];y[A]=C*(1-_)+N*_,r+=e;}return a=d[u-1],r-=u,y}}async function m1(t,e,n){let i=new AudioContext(n!=null?{sampleRate:n}:void 0);try{await i.audioWorklet.addModule(e);let r=i.createMediaStreamSource(t),a=new AudioWorkletNode(i,"pcm-processor");return {ctx:i,source:r,worklet:a}}catch(r){throw i.state!=="closed"&&i.close().catch(()=>{}),r}}async function p1(t,e,n){let i=n?.sampleRate??16e3,r=n?.workletUrl??Qa().pcmWorklet,a=r??URL.createObjectURL(new Blob([d1],{type:"application/javascript"})),o;try{try{o=await m1(t,a,i);}catch(C){T.warn("Audio","Mic graph failed at requested rate; retrying at hardware rate",{requested:i,error:String(C)}),o=await m1(t,a,void 0);}}finally{r||URL.revokeObjectURL(a);}let{ctx:u,source:d,worklet:g}=o;sd(u).then(C=>{n?.onSettled?.(),!(C||u.state==="closed")&&(T.warn("Audio","Mic AudioContext stayed suspended; uplink is silent"),n?.onBlocked?.());});let y=u.sampleRate,A=y!==16e3,p=A?ak(y):null;A&&T.warn("Audio","AudioContext rate is not 16kHz; resampling mic uplink",{requested:i,actual:y});let _=n?.onFloat32;return g.port.onmessage=C=>{let N=C.data,B=p?p(N):N;if(B.length===0)return;let M=new Int16Array(B.length);for(let w=0;w<B.length;w++)M[w]=Math.max(-1,Math.min(1,B[w]))*32767;_&&_(p?B:B.slice()),e(M);},d.connect(g),{stop(){try{g.disconnect();}catch{}try{d.disconnect();}catch{}try{u.state!=="closed"&&u.close().catch(()=>{});}catch{}}}}var g1="data:audio/mpeg;base64,//NoxAAQoEqwX0YYAgWUtG/4iIiP4gmnbGEAQgg8Hwffghh/D+UdwflAxhgDg+D4P1AgGMH//0f/xOD74gBAEDkTg+f1BjB8P/xOH//lAQTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAyU8beX5qYAoBQKBQKBQKRWKhaLRaI66OG/9uYyG5nliZ+kagG+7LE/aonsG5wGQguIG4Buhk4VQwHQwFRjnDPEBJgvkKpRHG4gOK4LMH8zHkZMrmiZgbtoldJM8Zm6kFLrq5u6CabS2QA8SBP0urqQKiaCFNZoXzU+m6zdP/17ugzJGhoT5FB6JkkhhEAJEUiITDIjm/9tNjRbp6lpvxWghcmSZJIc4qk+XiGk0LmHk+b///ZbvdNr/5iRMexwJEMIeOQQwi45iBBy4fWbm5uRRMA//NoxAAxM6qIDd2gAAtTM1rEplLKRQC2TSSBGtNNMAAdMJiRM2QgMGwMZMn6o2UACYSlOdTBiYyCmYPAypqocIQAEBRBEmyqVTQdAJjgMDJANEAKBiQHkXQFQADAYQCI4gKBOsXh3OklOniuhWgdLpgipTutkUUUWRRR6VJKit0HRRy8pjJToOK4bKMUTVFFraSST6LM9FJ0kkv86pMsD4E4l1FT3SrVbrqSSRZFettLRRszoE+I2SWicU9X/U6Js+o1fZReRRV0TyyImQlhj9+lMQU1FAAA//NoxAAlK8acvtjbTcHLdvf5d9i9yXPS99B9utHCoOi1FG4OeF8C3ZhQwfsRpePfGLdnVu1VuY8pyoFWX1jeGqCRZ5579mRST6Yxcoq+R8FEv/Skv4kmLJofL6TM0FrLE00PmyXZSOs460ElPf91JJuXA+BSl5NKp7LXUqtbsu3//6hiiRbX9n++dJSjLtbcxL7vsplBFjymSLpQNn4hp+XSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAqO8ZwHOpbLAoVyV2U25ungghAEmA93XVf1ebIiExzTMHEk1eo5GCIDAUCTAqCDagsRwNAEAu480iMvJFY/HHnh0lAQwQE+CEHl1RkugFQUhvSMpCe4yzZtjvvwED1vV2yyq/dz1GU36mpNPVnPR2ok8EhKaJ1GtVRl9T6nVMUdVS209FFRkEEJS61amu6/XWtv/tq60R9BaE7myP/+t2qTX90n+kZjhIDrOoGZpvfydCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxw9qxVsofVoQGvVss/nr/weufw+o1xZagafii6k2sP27AikB07rRSG5fKHftP5ORNy5cwycYhFY3G599IEic/Xt4A0MLeKp7SveyzyDHvdj4Mm0l40k9FeKhXIp7SqyDCw/AoRBcyT7IFBovANx6JLwKKKKL2KGFnwL2iS8Gg9QxwU4+nNOPU/GUdnk0HNP7a3Ahv4DyVQNbPI8mY3N4/wyVf3s8uXQOFjjxJr71/n/4zf7tjX+bZtT3+vu+NZ3TKncMXjtGIe/iPJQ2ho6tMQU1F//NoxAAvM96kBt5QmQXNLKmeW5Owl+r8uX1HQYPmnYxgi+D0DVORLLLIJh4cwXig5DFqCcym0QQ2hSXq6Z0tsAhh+xraSravxAQhKMA2y2B+YCi0qcGxcv3t0sax0noIQ6smuxEHs0qQHaXbWNEnMeUKnXNWw4c3K4bD2lqLGSsNRTuqHOa4rRQ8k1oprpUaV5W2ldtq+Pu/uogtVHRbyOKtozb4ememuuJ9I9l5jsdfIxDnHbOa0c010LGzMMo4erQcbMLUOQ+IWTEFNRQMACQgABAAAAAA//NoxAArM9qUDuNRbSqPeP1MZyq/qTpQIYk5j+s6hZjXOHMRihcqyfp27CITiRpkWdnPCVzdaedhhzUiQDGfQenohPg6Vt6BQcRI+KxV/qH7k1f5jrVe9paK2WZF50rI0kUcyNjFCutFSWmkZO3mTOy0FhYmjr1ttpWqM3C1/yTXEcM26zE1XCKrX1yt8RDMdyvqv/w1//P/txxMSuugswsc0hl2qclSih0M2qjr4p4Kuq1NgioQZ8WVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsY8J8FurLUQgbjjXprUEPq5QWAEWLhPxaqfDcwwFTG2CD5kIzDkBx4QS+6D69gsD40hr/U7d2nvtLn9d6ILJQtHQHKoKmgAwBQD0M1RCEBxICAqEJkqEwyAcALpe+KmhQ1FjIVmKjlGjnNeeTfFw6W6TYh0N9rozj//69gFyfF9/Ef9BJeecSeZ6mYuxWvXqzmtsy0Mli5SpVWIeT1ar5hG/b+bEs4kIPooQD5Lzy3H1GxcXfBjDvapTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAA//NoxAAo88KEHu6alA4pJZaPlaT1YgzAMFVyIzKmhgABDD0CjlkaDLiUoXTeF8UpDUB3ihbY5VTR6U8lUPQxcLwH9SiTZVUwQtTKGBwicAwxCMxqzVLpgU3ZVGbMy5ifN32ol1BVVZyrer+l+yC2TE9BtGpQQZR2q30vSZf79SV/PJrUtKi95qkfQWpnWizbsfTSU1uuvff//1mJtH030rOYrWm2+ktGYJnjxV2FRLUhMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAnpA6cFNGHQRqf7P+fuVt0QEpdoC0w2DppmNsnVXAYYxByHznltQVqJsPS/UHQcWI/FWhib7ppgwu0R9JBlZdMqi1TuPRW5eAwGFkyd46dhxbv13c4gAAO7v8iObn/9d3dz/d3d3Afd3f0Rz/iIjn8RERz9EREPRERE+Iif5In7u6fa7u5e7u7n9f/R3dzRE//JE0AAAQgQARMi//0T///rv/XdwNw9MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3BqMDOZQlSCNTWuW5mWJPGGAKY0TQYSWvOK6JiRPnjw6jMiUBioHQlBWwDZAEQDFFml1LNXTZdpYZQJFZnTzAmJvbUOPsy0YfSgh93n2hVIUDYRnDktrCIWvJJnmVFRU0VFYlRUVFRUV/+pVVZmj6VWFmv6Ulm5quV+a/H88rXBzKqrVQ2qytZTWtfdlM39tcX////fzX/zUmrWqk1Iqq338M2xtcCxTeq8MzXx1DM3BTft3DMocs+bhSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAArLA54HuoPWQnGoQI699JMZNAEYQBgwGD7KGK4KhUBlZ1gjB1mzt8OgwH14EIcv0vAwHEAwjBOOv4+bpAkCI4gOzwp5qCEyRkVWgOnFZDGhwHwcDCpX5m7OD4jDXFHJNNSmWRoypr2Uyf8aElrWNo+yJ4ZZniFqJr4XqaZnH+vN40Uu++skZf9eMCOILtHoY7QW3JuSOhdzed/uv/82Pln6b/5hyETMwThIR06f//99yrEiBjCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAm7BaIHuDbUDLtu5JRS4Y/Gh0BCQAMHoAOb85HUEBDNTW5MazDjLYZpGBGAAFbn+zbPbkR7hYpJG04wIGGkvHJpvNmI0KXN1f5ktGyE+TIcqsDL/2G/OgxCFrTEV1OcdsEpZZaqR59G2p+uYk2ndPMTqlIdnCyMXWtlLQdJJlmClpvdTt////8usp0q1Jpf1rUSKaOkYCSrXV2/a//vuyZiVsxkmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3A5kEu7UlA+TMr9eJij5vKARGQUMXwWDNuQSJumEIEGInhm/BGGeD4qCCEwU0IA8Kkp+QUUDMplzvhQCfmUMXlcZdIYA2bGzno8HLYXwzVh46HGLBNRB2fuQMPDyYhICakWyVGdXKV6FWMVzR4jEF0Rh+eQkp1B9myxhXfRHMoa5i6a1IqfmemQi0vdnQ93W88hMO////9jqj4ZFlupmb+e5jiuMTXdRWEEUPq19Pu3nulNqzRkE4lsAqYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAAty/6QFt5Q0RwRSkYmaac37GGvg09K0N8oHZ+KyJOkLNVrXIoMVCM2GFOHZxHcEsGy2VEBZgsoi+icqFMMcAQNM1cuuBACsIt+nIsCHDiAouyDk1V2nJ0K3u8/ErmrGHM/rePc9Ke1eop4W7mbririUmKn+klqLKBYJR7wtpL/9Xz1//9f/zfM2hZ6TFJPVpNpFOlWk308U8K83XHdSNF4q0n/4+eIp4Mn6/9Sf/+pKDxjC2UXhXeB1pNpzZAtTiYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAt076MFuLbVS/tpkqofr4v87zvkhhDBlDkuUxFWeJZFHFbbHYm1UwFezFwUBQFEIAUmgqXKcR712zTc3hZkomYcFHKdtXca8jKHAlTKC5fFX2MxtND0pU6Gxw1Fh57YPSx9Xd8OPe2Xxc0bQfahUfcLtuToCw7jFMtSlrns5qq31USla/9y6G1H06KQ1AzopqOIG61Uj51A8ZOtmpNexx2mLo1s6zpqdG9kkb//9+cPfWa/49ShU5xf9/u9ZDQmhMQU1FAwAJCAAEAAAAAAAAAAAAA//NoxAAvJBZ4FuGbTB/ils3LMpXORFhqUoAX4YGFotYIQOYetZyQOjwVdNR9PVV5kz+nojQHCRCqCla3UbE15tqCRL6h9BCYdKKyI2pGRzUNMXmK+djZI4K9TvOHq/y10/+fUa318ue1ajRL82m11Y1TCnQUdDljxUpStExMfpIMy0mWXal6j/60VxJgzvb1rQWr9Tosy2q6TfUqeDietT7KRq12UbHVmhkiSJpapZKDuLVGC1KLpcApxyuplKR2WzIakUzFBe0+pMQU1FAwAJCAAEAAAAAA//NoxAAp665wFu5azS6adkuuUU5DELbgxMwGKcHGQmO4DBTBZTRqXCICFSKAShN0xMRE7wCk4EFTwhZz84RWjhpfZdFySoOfXC1VlLXlkoW2PBNjhdq5ibpHqT7OWeeMXVrpHmWugYmr0mVNbqqov6Jg+sFZNnV11p+yy63ahf2/XuTgflKVt3t+r0etdBvu7mYQqKtvZ2+pmdVKSqCFSlkskipFaBgcGgli+CaXTIO/Le/80mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxQ6pcDV6gADyrAkVsO/AzW0eiyRgzAvlYiBfwWAMMC8BkwGBozIOATMCwBwv+YE4BoEAgBgAhgJBnGiEH6YJAMBECaFABlAU4g/oyZUEfkGBvwdYhoBYMM0FvIFQQbIJAHlGgMaFzQ6xO58ihKG6aalmayePNbRRXsgYe9SCqNGbutF00y89BWkzLUIDKNC+ZuowLhcQTLhcLiDG9N13MXu7snd7bY6BJk0l1JdKy70Gr9//1qQLwoMtMmbI//60Pa3ZLX3NiOSebV3XrTEFNRQAA//NoxAAx6/Lpn494AqQAABPPLtvXdrv//fCR9MafKhArcG4r7MTRbXmjSKaMrzr5vdn3ojBt/D5aHrdoXfZxA1oWcbn/4xFIqHC9pYL22/bf3/SnpSiHwXr2E+Zov/xvezLQtfFvPMMCqnAHDUnoJ+ohSoShsb/5m//OhwViscGePu990PcB8kiRyJP46kOg6xjwcf//0x6f4o/vun//3WDCYnL2fQWWbVreTfrTWJf8TfWb7pr6vd48iP7//3vf729i40zQYi5bma1vbNdf59t5tqTaYgpo//NoxAAwzBaAF9yoAAWapz+2asSQRGEQ8YlehlAkmFAE0Iz8WzIIgMPjoyX6DfZDIAIAg8llWMAhQxisjLglCBC7L8WYwLnFkkEFzEoBAAiukYBjJngYRBgGCwADhEYCbRKIIiELmI4gouEmSZYutUkpaToUJoh9bfWi/vR2ddXo1VpD8JGXS6km7uuyupIzXdSkk0dt7+utZKEiujtrP1K6uqtKpTrooppsupOOg3RomKn///db+db7pMkk5gpyfSZSZoZJlE2VNUUlPpGR9SYgpqKAAAAA//NoxAAli+KUHttPUFt975se9vdhksMQ8HrmbkZGrPE8JgswEs6kpA8EbpRkoWBkXzWd3tLVqxyNRSJAVCjcXUfeXUBoXS2zl+82SSSaub0E0yTSu1aCt8vLQV00TJOq0/1rZSGXgbxgaIMt1KZHf6KPm2TU82j0+OigMv/UKoy2foples5XuutQoE5A5HX//p1Mf47+0Iw9zkOMImnI0wci1SYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArw95oEujPSSQClnSR6q4a6TBljjVEC3AC4MmBD1sPRgMdT6E/HDhuCAVMEQLAwNonmDo9BjPlAFsQTrRjeqYfmNw+y9iBQCQGDIwmRtQJJEHAsr1ZQhBMwcAZ1LViHrgUAAcw/TAIdIKBDHbad83wFRpM9tXOs/NZ2qxoAOY9KO2/1nfpnvtU2PiIHv+ijQXjY6z0NT7K6/+p420X/+c6mPQKk2tlWOTzCo4Lj1HBSLBvc4tYqrtMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAww9ZwBO6UmBnhdqVydu66TAswDRMAQcE4wDBjwjg0JRhMBxg+e50KBgChw+ShyYUDS5mYZs3QQgBwgCAC1iiZgARehxKrc0T2HlBw4bgeclrmvPwvsCi1UQYEBQBCuAkeEUHla2u9nb/zlent3rUnJz3MMJDHQgMMY8jJyRp9z1qe7zDGoxjKUD0VD2bzz3z1vtf+6Cod3dUYWQTeZpx8RTfaeljL+ayqqWQ0hE07Hx/q/+26E5C3com3RxkNmVx4QlnPljw9D6yWIExBTUUDAAkI//NoxAAuE9Z4FuZQ0QCDakronZdSnYiYFERqcREAtFiiaXWaXJgMGAXqnKSIIQyBgYh2DAa74kTTRoTUIWw4wUFBSr6vzGHpQCtouYv8mNah503kSpIjTjUASy0waAWSQ2bukS11+ZqCnZitrJmOO6Thm+oKO5JNWFX+vZfZr9WutYFlrtdfmFX4/9v6/hjpVe2q6EoBmEFViOWrn9Y66+P69lmrZoxvXrVQ0/H//8/mh16123/6Xp1A+xKaxRsJnVUU3nUTEFNRQMACQgABAAAAAAAAAAAA//NoxAAv0/5gFOjVbQWWtr6qzvJL05fwwJGszTAtYo8fpuoiRhCAxgyDhiZx5iSNhhEDpfIoA54gSERgyUhn6FhCAbcmMvyWWeFpHIk1uOpGMvEgyWc7qqkGv4DQEMHwBpYYn4Xqal9NunfipKaTilrQr/HNR1otiONMjOnux005omh3rrD9FQwQV53d36z5iYmMYbVEQgEcIz1OeqHPOO+k9c9kv5vaqkw8MSs7v/zzEy49M2QjK6H3uLBhcgOOcfNIizMQ6kqIReJWExBTUUDAAkIAAQAA//NoxAAm+95sFuYOlSeJbjQ3a5GI5FR0ymMRoQDYMUJ0caDyEKoCMXWU2IDiZq/lGG3sGOSCCabu7kvYbKYpqharB8PJuuu71E5b5St/zEaWTuNuWMSeOkWUOWql1IDrXOuuXOZv5ph8vFBJTGqfO7GGbT6uguOXvqd/zRkgv7nhMqvb//Kula19Hf0UR2Z2z26f7NULk36nnaPzzUnGo5FqGGSmpPkOQpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAvS4JQCu7QmAkp1haUiAFgYVAoUTkwsDUwUSox0Dk6+wMxxBURhUYsPWc0AqRIsZMFMBYaHCUyx8PJVzDA5/kGE4kyGiJ6uUzlYQeBl8kIKZwErFgd3G8SSYCbUUrFcWk3UuwmzuZZTavvLYttCKfST+qqB5MStTctGPSnoqLjmG1/yx381NwNqE6/5El81NGxFB6rJc/bCAFxgxZlOonruPrJ/+MfP0MleJc2xCmK+xqxx/P/svmkXz2MF75I/ACZAM719iYgpqKBgASEAAIAAAAA//NoxAAqe7qAFtjLeRkTk1fP7VLSkAyCigVKlEjKbIvYsgwYHNQAYGUweVVQACRmjQaQyGdCAkASVda71iRSPrDq7afTK2IBEF3PYAkImIuyG3HtumzufqRiMXs69i7T2zRCcQm7+WX38uIVe6I+hZ/u8RCDgYGIru8RE0Trno76fn/u5/1zAEAABHQuIhdSF1w79d34nohV30I6aJ5Tqc//zs0+hJCTndAEAjsHA4xsZmx7454AmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtzAK1fsIe+8AhKa3bb54a/9yWcgyVjI6KmbuoTDNS1jAQj83GYl1NTU0QzarQByQajijg6tV5lVhrba8VWijlhm/vMKO1Ug4WWBZpFVWpWtrkletdQk8SI6lU1KJm3V7rEaurQo19QaMNYuvi1s2fRrfMF7XXq+HjNZ8+rWtaxcb19f1q9VrLb1rWa0K3+7bzXWWMxXHVf62/tCt/8//G7e2sf/fvi2sPrbmgtrA9iywI0PcPEj7dsSXx/4NWYKYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAxA7JYHOrbVAE5WKcsdopW05uRgENJkcD4NEwDFEaeIEEGEnuYADCa0BuYCgshJb5E4wWBkxnvI2RAkBBsRBA05LAcCcdABC1mEyzCUOSu4xiAwtSzVMBj8oJQQFgLXNGpTM9OsNag9mBmVX7Wl3U88sa9eO4PSyumuuEl4qz1Ut7rhM1A8Ph0vrOtk1l1uf3Pdyv9XFRNNp17uipY8AhEkWdJTqqm2ips6gtmqa2paTIKUmmOAPKTpLb//+5r86a99U1QY4BgM0hbcqlMQU1FAAAA//NoxAAvw8ZQFuobURlBhCKjX2xzL/LZAATmZQeAEECIsjXEugESgGA8xCL4x2E8MBNQUKA0YVgQAQFMT4cH3WCBfSISedYcAIKAAxd3Z4RgW+C1iqBhMiyhS31it3dxEIiE5psvv0NXLqgxdDAuKj6ofoT9tsw6hOM+eqh76i/1e55uo/oOzTjl36hV/9aR/qq2/XUoXAlc4s2RdaatWronEGTdFJFVJ0D5TKDJmx4OgLWXS6bOy1//7NMU/njCyqqSjps6S1LNUKHcTEFNRQMACQgABAAA//NoxAAs+8JcHuFbTA065GY9yWxykcJlZoIFkAZMOgc048QABXqMEPA1SFRwALVbmjknoYdJh6UXBgviD3MyQTKOL/m6ZeENwO6IGCKvGUu7RRZ6mPbt5/6mLRaCxHZSwUUF0vlZB67FSrspkUtWFF5EWyBqbhJTVZuaWTUkYoGyDOpb0zJJ9Gyr6l6k5wQQjH0TVJFzyGqySClqQSM0UNrrW6jBbnq0jcqCmurdd/1d0l62W1dJJmPtzAy7WPvIXpiCmooGABIQAAgAAAAAAAAAAAAAAAAA//NoxAApEgp0Ft5QlRgCttHzlHBqHQx46EoEEgqfgWXC9adRl2sawwGIKhKLwoOgYYBmDe5WuLCBAaKiW7GVfyuRw2/ZbQy3wx8zzxAMrxrEMryQCPTCp6znCwjkNQ9BcYt1cVdSi3aD0dJjVv//mJtHSfllKBYSUUt06TEzEsOPFCxhRo8wMjAqS9U6wY//0fdH//tuxXXKTBx7EWr////9Xs6r+p6a9ByaLfn6+8/WUxBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAlmtp0HtjbSFLK7tabUomL1OF4gBFaKCKJmqKttdBh9Yd0FqwQuSRFpgXQAdfS+xuQvtXf65NUL2PWWxNSN1Y2O1ZTyalkuq7s9sXgZY4kyPIQKt/FBanmnYe30K2RX7rRY3JgLMsmKDqXUnXoqWp51S7tqrbf9j6KB+srPorNVOm3sikj2mtmQOgNKK6Rk34gaWOkLipMUFxRAWXEE8mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAwq6JIFO7WzAKShgrdGUJzrSTvMFYaNhRDICqLfmwiPAYljAwRTAeoDUItTAAGlbSQC4cGAQMIR6BVbJdqKJJKwjAWuV0o+/Kw7d2HKqH4uwIBjCw4tgwZqogAhole2XSKvYehdqJbJSutspxU7c62oqN9L//B5tKPnPuuGucet+fAznbPnWlLpbV/XFxbbmbfmrP93/7YX/4falKenM9dtY3uHXFWyFYqqps8X9O76+47+OXnoVPkk9bmqJmrjrLfbjoxTw+whbcrYmIKaigYAEhA//NoxAApe2JIFObKlBkSRnEOOcmktctSYlzh/sNGCVUCisehLYOJAyHTG/+P8pkycGEiUAAiTZICGBqonJNTWFbnG1ZmMqyua87XmMwCqQ6BDIAFo6uZVEknAEd3KteriYXRYjMZitdRJy0dwZCuwlYxtWuOk19zjqM9gGS+q7edGPVF6KUny/2bRCi5ZTuHTPOk4nKlUDpxZEILGbqRO856W/SWRDjSLY+waCYW0OIWVdiYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAu+2JIDO7KmCLJAzd5LA6eiOhiKYRx2A5hSIA0eZqYWJgWEYoBhiOMh16DhhYoYQJgpmNFCTIjQUmzDigzQWMPJzDQAxQOFQUBDDMXSdxiblKhQEGsjS7U50kC96JQAAhYGUqFgQCADkv0kQ7r3v48bvyu5epx8TsQj72VFlVCHQXVlRNSK+pxjkOjB9GOgOinR5O5Luky3rLVfVmZTiDKhboPa6jggOMVZGM7aDH3cZWkmrpS7P//rEQOtOieJCOXstvWmIKaigYAEhAACAAAAAAA//NoxAAq0oJkDt4Q0SOWt8JM3TKHYSBSEfxjAREaUjNWQHAqe5rtGbC2GKiZEWmBgQIAjIygyz/K+09fH2nPANuL0AAWUL+XLAjLnhXbI2SwFDRc0gYe7ibAcIcCs9MFbTD1LXCib8xKxfr3jpppuvn5qUuaadov/27Xb4tVphqNKHNrF1FrO01/8ft8TE1C000ooGxFZv33lhyKzPr/p70KqmvrympAoYmI8RdymqzvWWmZ7ztufpMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAApUt5MHOjNcAnHXCdL7KDKQaS9xg+ept2HBhiSY8VZhoqoICcGASYjRea0AMAgtIgmhoAAGYBgkYAEWbMhgX9ROUVWqVAJXmsWQQ4z2GnryREdmGoajUZAASiQMyNrNHKaD6W53DWrt+WoZNTIuJgKIEy/blNqFcSG2CgKnUkbKNlDnNzp9//mxeV5qV3m72ORD5lutHDe7bj427kt8x56PzILw2+5VDLu/AuJY1MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArmqowAO6K0PQ5Fl0mxEDIEAQwJ3U5LHAxHZcwxDox2owwgActOZxaSffBqY4AsYqgkjgWXAAcGPMonKpAHFBlC8HB4EBhQZCg5CgFhlpiB7dGVm/TLyl8CQ1Hhg2NiXidO/zV6zV3KKbCZlnGoo0cNOyKhhcVEm1L9WIpTVUm3TR1ufSl7rx2ri7bqQzvRWc3IFAw0oeKLOOCRrvOqPaKu3hZakdfLPTZUUdiR8WCYxQ8sggYbWmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkImpUHubQWE7tLYLMqq8pGQFiGiggMBDcIKTV4MoEUVTDDs3IjHghobYZM0gwfjMSOGLtIZ9XkbtNrPYMKo6alLu40tX1DIERSpruI4nGjhqfA2xBj/xKJmMiWx9d/Ag5LySPJrqyLcd6EslzdjFLMMv+etZf+OquW+YRuxICuGk1x4VDwqeHgQUc5os54oH1ssWplXNXeUTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAr+vJEBO5G0FknWtqDusnIFQGMKGDNEgRAgLmCQBGdxcJ7opmAQSDRSMcTlMAASFQQMOAyMFYvM3hBO9M01zHDV21ks+X3Lllpy25f8wSTNBC4RnkquXIgETUTvBI5jhlr0rH4nM5+VxuG5fY+kwQIAAAgw4t3P64d3d3/vuLd35l/7hw4GBvogGBgYdzhZ9tO2xEXpu+RLTe1CQYZcGHQsjpFm06WeSaJC8kQiriwc//fsQUBAEAAmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAj44pwHtjLSBNZt+NY2cqaChwvB1Ao5FQUzsdkxi4PRRWE2HXUBMGmQMfN/NLqZUsE4sZjuFWtLqcmDoalViZlLAYFq3JTGaUBEr/+Zsx1ozMzNqX7ZMqku1PahjFLoJAYPB5cxkM/0ZqOxSllpKrK0qpMPDHRUGlY0WEmzGK7qUqb3K3KUoqIkVS9n+y7fpViP2KcRMOiVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtGm40DO7QzBQAEASw6gLjOir8xGM872IEKBwYMA+cCBaYbgCYQCSYuPSYChwFgkCAWEQVGEgYmCoeGK3pmhR1GBB4sDKWlgOC4/F10MySoEIayBNJX53RaXNMGASzkteNCSmrNyuU/UFxBs+RPEBENu45GtU8fnNT3tc/w4cq13XVevzcxg1g26/mftach6t5GKL46bhkac63ThwyGqse49gCsiHb2RV67GttL7/lX4X1NXWSPNDZNTh27WmIKaigYAEhAACAAAAAAAAAAAAAAAAA//NoxAAoqnY0Cu6UzBQR6kF5frBVKTBYag9bCAFhgCjZNmjBIFCQAzGA1zIYIAgNR4ExAFoCBQwxEAyArE+IIA6gM0IEeAt6tRZhfF5GqkQlmLtqVHvbFvmzoOsmgpIxB9wKK/czPKnnyppA46yS5VFfe6KcWbc7RlUjZ2bIGSr7zHBwscfpdE7tMWpeuer3ObM1Y5VJT1OV0QpSWfGahNaneJv9VMlsfetDGTynL3piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAmKnpEHO4WyAU7eF9sciYO8id4EI41CBEDAIgJMbjRZ2FQAMEguMWALJQMS5bsl4XbMMh9OYAVGuve2JiThQRBdyUvA5UM3zs9a8IdR5y8Mg9FbNjXZ764s3qfnbf/e6a+IuqfTanpW7cnMS6slPhiQC4QRKnnpZM1Uf8/3PeyWd1/9IXKJEN2StNtpPC7FywNTjXGzQNJFhc5c/7Mr/9EgmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArgu5QFtmHVBgCsDM6OeuZKZmFSh3Q0YUKF6jLVgHHYgADBEw2QoMmDgwYVvdQEgpgpoeoimFEQCGGjls1JumkGzCMu2ytJ4xYmMwJgElhQAXA/dYuAgY3Nl8OuPWQaILTLJ7Cj04z03d2QTx02QdPobH/e/Hj3piB6d20PphCSBpPYwnpCiEk6BFA6wdMxC0zELh7aPcT+volldC3/z/iURvErxYEJ0QGTDBcPja9ou6TRpJukExBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArqoZADObQzHlI2drcekaygqBCX1GojuGHlFQx4HQ4fggAmETOeUFoCCCmCcaOQWD5iR1nhgCY8HrQBwUoUCg3Nf6RLSlbnTJgAxtCPZJyIDBAYLByk3VQ8f1l0rkUpluUdBxZw022tTdSLhtUtGlYZ6/bRZWFRpNNKsk4lRh0g2KAWKBsebRVio5YFnFRwseCk4VNKOlWaGlY9a4tqtGdmu4vNSwJPDowLjCUKMZXX+vsbUOd7UpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtgqokAPdQXELE5l4lsAuAIYBgDZgqpCGMGEeMBEAYSTNslDEUKCIRDFotztQXzCcBggNVnA0GAECZk8Dp7cGpg8BQYAaRIsBZgKBjaK3LqYUhaIAOBIAmFwbmoQuFuTAMKl8JJtIUcWNAUVvTMgFwbBDI+XJklubkcISP1yXUfFQsXzBR9/+aOr4sZfySo396djrsb9u3j4z82Yi4577+Jnpmm/J+L7uP8dBadMVyWKB9XzLGqdqPWVY+QdfpTEFNRQMACQgABAAAAAAAAAAAAAAA//NoxAAi2qJEHuDNNEpNtCGvxuMxhz18mI5AEh8GhxS8xQGw4LFo0XDLQpGAqu92WzPUBEIbGErEHzdprLXYDm6SXxGhZ4+hj8CpfODq2BAjJ5vJfn0Uve0xp8YGHMvcMPDBf36/L/IYY0cPwgfUdLCFJeYVdMu5hSbx63MdT/qOVlJumWk0FU8pbYnU1GoQfvLPVF5FSf2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAoAqIsFO8QXAbtBw7C62kIRhwEmJa5B7zjQbmEQwahRA6EgECzB4OHjcFwQs9M1EQmCwUzhgg2uEv1oi6otTtLiuViUsKLdgZcq4UOd+BIbgyH4Efi9L4sKGi6DikiZXmpzP4nQLT/D/f7il73FJcXEWEg+8hrsR671Z1si+A9uMfOLLF/YlHXD8QIr1GMkRFuaG1sp1jnajqDjbx3sUZ/Zd/uaouj6uxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtSg4wDO6M0A0AwJ3YLLOJ+rmMBwxOgQWMDwxHgMMMj5MEwCYyYcCIBhEGAWEYDlUHDBcPDEwXzRUbDL8XDUETYljXAw7sbYgYw4YNeKnAQHDBREVLfLlLxFtggiDlQRIEl50NRUumtQBDUaIg4mAACOaeC11iKZrsdh05VFRyJJFawS2fcdkt/9w7Mez0RrN2LKdpZ3JK1nZ/8+fvv1sZyX307iWOmQKaExQg1kNCtLScXvV092n//dp5z8gmIKaigYAEhAACAAAAAAAAAAAAAAAA//NoxAAtq0YkDO6QzB0APAUxaEpXF1zBICDBA7zactDAYfTD4CjC5xDEgNxYNhk0jPAHhQFAwFAgCjAUFgMC5jhbJnQDQcPYYGL06Ro2DTAs2RRpHdlD9OszGVyqBUVmBGbpG/PDI9AIoYnOpEFwTC8FmsNQqah5WW/5IP+fvt5tat+riU5l4eYburp+GtL65XHGDnYejCS2YbT1dZtqLJGtsU7j5lpEVK2iJ7tr5qe/m//hZ5+6////xvTw17CZ/byHemIKaigYAEhAACAAAAAAAAAAAAAA//NoxAAtk7oYAumFWIL4Hgwj8CKODwNmHAjkylGEglGPAlmqOtipVgYViQ1DYgMxABAOCIWBNBAAQoMQKJA10t3EIXmCAMpsgoBYwq9/JFHlqZZ14tAVA9UOoFI/NDnOSnI/Qq1irfDdd6c0SGf59uhH9Ksk+/bdF8+s0tGf7P8Zm9D/Xdz/Zfdpj0HOay0elunUnK95jlVdwwf72nn/tTs3Yo1gq3aqj1D5hf5+9l61K5H1c9166prpxKNOADKSCmO6ExBTUUDAAkIAAQAAAAAAAAAAAAAA//NoxAAsw0oYAO4QyCAAC9K+QuEIFBsw7AAwPFAyvHswKLYEgWcFUkYfh+Y3gIQDwbfCcBgRMDAkGALFgFL3GK8wnPwxBOTCYAMTyAoLrwzkRetwaGlkrf38eCjhKES0Xo4ecFSqDG1mc92q84YH91EHze0Uli7TDvS8/dpaQ8dvKx9d3DJRCxntx3OmxiNC3jmT3G3vfG23c/U46amPeNR/pNY+a7m4+vyom28ZdlIiWJkR1wgFCdApQWOIkvZqTEFNRQMACQgABAAAAAAAAAAAAAAAAAAA//NoxAArCrYoDODNcDMADgSXkV242KM4iKxk0sAQjAQFnW0iJIVoxiQ7HOA+IQWXMVc8YgFBrZmnLjGXWZCUAZhC4VhFVS/aeinBd9dQAAScoCBiS6zi2ClIOAZfRCh04qw9530pYfoIcqzkrl+g4HCAxG3WsABS00R0T67hFMu3t6btEDsIBmBsl0p/IfS87topTv9PKQfvrSpk+oXSi9hbO/v/8paC6ddRw125ZyKsV6yiLdTsMc6mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArk2Y8BOZG0Z4jDK2CxFNBCeQDQz+MRCCBCAzRB1Egs/hpVTmrA0BQA8I0IQYBxkeG0aCY+SAUXZc/pjgMRgEuqh2V8XlRwTGS6CSS2KzS0ykzABFDhYYuaxBYWBFjQ3FZiHqGWzMZh6qJDCgEQAo1RuUy5rx2vxy3P/h1F2okMLEgWzlDX/7WUp1vKKl+/5dn8GZjpMagnb/Iz8MU2BgmMNbelEFKRn5fy/+5fSYLxHrH4yuldxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkInY4FOYGzBvvSC3wcJTR7y9LIw8HGHwULDYxiajB4AEQRMlPcz8KRYKNwEgU/4wDTFGzPhCAaiz1zYkiM0p+InRPvL5e7QLlBj/TEKrNypoHxyr8Ow6WDQcizWZ/5Is/aX+rBaRTjAiNVMwbkpqZX/LKs/Mi85CzzkX8smQjpjhh6PwMYKiNQSHyoDSCpNTHOH19+vs+vtTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuKpIgCu+QsAoMGgGLZJoNGTSUVMM0FOOQCMJxLDgAMJxMIhsMIwEMOhxMaQJMGgGLICwYrCA4CowwBvTROBTMEwABS9KxmYwAbAqaydU27jcF2sAMEACdds4taHuOFKG+w+S8FwlDSw2SHoj3ED5kPqe1gaPObqVZmvZ8VrmVZU42ZSpqiLdk5iensb1v9jxm+Oq4sq5x92hMdyOxOp8STnw7D5OEiRJrjMetK3JU9sC1zOdD1JGLMuahcgZYeuyaYgpqKBgASEAAIAAAAAAAAAAA//NoxAAsk4YcAujLdEDICLSXOpYXDFgRMK4XNvyQMMwrMQwdMVm3BoGA4LgYJxkOIiJRgmBAOA4DBSYLBYZBJwfcF2ChsWHX6luYDgcXMWnD0ZfiIxeGDDEIJe8Tw1fu00WvVbNyxjRWeYfvGmFtSVwakWTiVyFQXn6aqq2fJntDZe3TVDhzbMjLQzgtaRHxIZFZtAA1yHrbkoKo7ILWH23Ml9XyLv3oT7p3wo36PRqj0JpRsPHoSDi4cyB33UrTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAA//NoxAAr6mYkCuZMzBoFgq1tajwgoAmGgcYe84Q4zIIVMHAQzVoEgTBJXM/kMzeVTAQoMSAcgCJiIoGUDgYeih5Q2iFYS1RuassCCBlSI8AQAwBDKOM5g5Lh+gLGFAKt8nlDZQqKDg0x0ACxIowRMGpEAAg6Hwv8WFk917Pp3Lv29wQMxlb19shsgqLZ7t3fdyMjPj7V9y7u2yK8Zjae///bHynZ1OsegkXiUc2Fyjfqr6NVFlq+l4oKN3dCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAA//NoxAAp0tYsDObG0BFApN9HxSKYYp0DdGb+WThkoZNs6ExAKzBAjMvOs9uRgMSxIOSMs8YFEBjsKHLCKZYNmGAq3XLX6vpMmPNjRRfh7zDSQcnzIyYmHnSYk0UKBocARuCnda61mHYZhmWymU00al2AYMKlbY22OuqhVVV2ZhWz1c22Y84ff0FVVEqvc2MzP5VoXuu1PM/ypjakMerIx1IL40LHySTv0VcKDTEn9xd37vzj0xBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArq0YcAOoFVEiTBEGjA4Fw4SwgAE1jCyhz94GzBIIgqHxzpQwYQRbEwiHU2ZGgwGFNc6hSwSHMwMGw04BNO51GhqbIZMqSKkTsS+EF3UExgKRyegOBJrjgRphMCwNfu5T6KT2N+AmquZgfIzTrEaJa2jrVoU+7G1TTcMOuxv9y8zVjKq7e+eR3Mj0sQLa77RoioZGu8yPMpnUZGjpp8GzzvV9Mja6kppdmqkLQ9qrUu++0A8g5sOpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsC04cAO7QeE/mHKDBQCQIABhWAZkknZ/gFQ0Thdw6LC4yMAcxMKGQ818KDgUOfl9pEJOmAahzwiz5qrZYytmON2qzzdrEnUJHE9GpOWdoqCjfdz/paudOFrZLYaLy+J+RBsfkrZAXKtLE1tFw8oJnlbbGXVSjiUffSRt1PfW437Pm85qLx1N4hQ+dFwozpKkR/8bZfd3PfzVyN66jkf/8H/7Q91HPP/6j7WV4kVUtKEnVocbrBDX1piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAte/IkC12IAB8S9oGjF0DBIHjBQBjAoiDq4VQEPJi0MBuMoZjuKZgiBphqKJggExYAQOBpJ1FAHAwYEGAQg6pczBlGE4OYTZcKZJl+QcBOKhBiDkXc3LRWSN5fQRJ0+xkkpjFKtk3NTdNXUW1qSun7vN84k6zZF0KSjxupk05cdbo6CKR9nerUlRQQT6dtWYe6Zm6+pM4gpnWtJlqZbMfdk6zM/tplv10var6jB/rT9Tn2+qyt0kFV6n+cdkggmIKaigYAEhAACAAAAAAAAAAAAAAA//NoxAAybBbhH42gAgCARROByOhyOx8L/UtdKXxxakALwA2+aLcV0li94AQcChAAJYB0FzEOEdjB2wMlbA968KEBawbGyZJhGr8MYgYkaHiC08ZcWWYqfV/FnjjIOJwLIzYcYj0WR/5Ax3g3UEakGAxQoLhQGgYCgBuVEUWR//D+hYuLaDcsN/H8MjixigxmyuRcgJGEVRKRdmVSX//k+5cRTPE2VzAuMaMmgUnWVTAfzUmDh00l1Rj////oUGoN/OsViImBwyENHaYjydHJOpmZMkVKBLpg//NoxAAuy76UF9yoAT0Tk0ctYzkFvqMDMwwBpFWjAqAEAQo6jpZFAIKQDKDMBfVdMG9fmC3zyJ4pkCFJCUwbtAAA4GHBuBpgfAYaDYBADAsKQxiH6i4AFBaHKjXIkOcpJTonDJE6ZJXLpdLs8tbPTN3Z12ZK1TpI+q3tXpEcGXhmzxkXjZ/79SRsmykq0epWmitlJJJPR1rRbq9kUbVzIvU0Vl0y+pSX0UW20kn7ot1JGJqjSMiLGyVq60V6kjJJYn0FFSlH/eEmIKaigYAEhAACAAAAAAAA//NoxAAsnBJ8DutLbCtxxrtemjUy0YADOLLRDDAHdtFoDElQBv3zCcDUgVV37ayvltGtOcjrI5qRRiHMU3CIAg4EQgLDQkUwSFBCBQWAEtcj2FwiMMw1DAOfZTNVd+4PjElxs3MPkFMooMiuSb+bl1lUKZhoLYyU6/7Zec7ZTmISIzY0tRUfXkcwuMdWdA622lKEV/1TmdTS6RjGEgV4oecTClHNbyfv+v8tmxMOl5Bgw2yzXSskUnRmdu869FHJiCmooGABIQAAgAAAAAAAAAAAAAAAAAAA//NoxAAr/A6AFurLUTWdj0siDsTctekwCAcOSV1Ggu4roMBQwhI88FEIID8v0u984Zp2G08g7NTkNNinI2j6uYqgAj8ZPAeCAHcqDgCASt5gOAoKappiVNE1uA5OEq2sooJcGhPc1rh9Xd200hvxscfiuEdnE23X/kx6l0wqBls9cXMM9WRsokaZfrzkiJOkTbVyoxn3Eyisw9mGGaOKwsq+i/p+36v7B0JJ3FzNXtNzOLCLOhbprGOjtUawmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAt2+5wFu7KnCUKbgcAzEYIUHpG6gwNDMYEQYADTSUDguAZKExg/LZ8mVSAMDDyh6V6giom6wM2VsT10zbQIyGgUzXIj+KgR4s0YuIAkCAI4LAwBABR3N8RggHTOUOT6s2qWbyzrY0zfaitTtuzjbtb1rQfE3Oyb0qMH23W4ga40QZH5gGM31L+/dq//Eha3qiXYwxjmH6ldHIDOzSMH3V1W2hv//93VjJDoeKWUoQFG9nMRIxzoHloORxHjjTI8kmIKaigYAEhAACAAAAAAAAAAAAA//NoxAAua45oDusPRCNxpY2bxRlcDcyQhjFYA6eDguAwqBIgCow3805NKIZBIwFAILALKgCABedDoj+kYvBx3bYczeOugpaiM3ACg2YoIaYTAmHA+QgiDgMW+CAxMeBfAQIJkx9G6XHTIfTVc0PZIKp4+5HzrTrW5CJipjOqKtjZp0787y30GoL9mv+ytNdB1TTVT1S5o8hdqGsYh8ufH0LDqVNqyXec7HC0ieNZj6or+e7/v0t2uPEU9y2PQIiw4dU5VgvuemIKaigYAEhAACAAAAAAAAAA//NoxAAmC8J8HuNLUBbfv9ZmzZzmMyEaILyB7XKgsGAYwR8TAYyS9YhK7UrsxXCliUis26vY513YeTKBpQfyO241TQWyerOZb062bmJrND6tR01RZI6ikz1VHTyLVJJJa3VRRVYvUSVSRUWg5SkUp65ieM3frVpld7aU8rruuMGIDhwcKGOoZjDlbqyuk9EjK01u1SX9P9635N9GflR0rx8hfeP2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuu45YDPbamC1opznSstnG7mAOFkDhaxUBJhYOAbSDHgKzCWV5NEoUw1Q/QFKdmCgKb7tNEeVvkn1cMqc6cht/i/4wAioCYuMmh/4KGETAUdotppDgel8DguGntYe+k7di+X67N1o2ggpqJMfeShP+ta1VVLdq3eXmsszYxZdEkwhjQ8bNW9Lq12pmjqvdVO6aFCaIO60k3WbF5I2m0ooVd1u7HD6ajmmpR5VFa1svX//6NTKUg3UySCzqKbXnFANFKNSYgpqKBgASEAAIAAAAAAAA//NoxAAsC4JwH12gABG5bq6SrT2ZpuA6DQ0U6a6pErWfmD4emD7jnVwbGQQfBAWEQAL4WEZxHJDWsPZmbEUYhxiRQNtHNAyzAERkUEKDDZBnQkJALyjLDIlMcxIzLKCCl2NUXTVWpM3Wi6BiXVfQT9aK0W8xbUcWmylSiOlTrWiir+talrM1KU7ar1oJJl2jVtRRPosY5gm+iiiitKylNNUtExbdba6lrZv/3SouxdMndrn4ADYUG4GXIT30JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAu4lpkC52gACSQHMHQDkYgAkwhA8wIDgw3EQdGEiMAtuYKBqYxAUZC/qZICSbsF8aAgebDugZdhqFgi2LlEaigxYwNMRAzoAAowMaPgA5GAMWGaEtCASAwBDCANAIuYaYIEQGMBkINpEB4IBREITGaJVEaCDRZZAEjSqo6tSOLKHgWWSpAh2NSqftVkUIekSROF8u+ZH0Nutubk4ZGJuZmDHv/vX/1m6BseNzoMBEDm9nu/CIbCALjkBZ/7P/0BdA0OmakxBTUUDAAkIAAQAAAAAAA//NoxAAvAkIsAdp4AAsNM4pNcvNQfBSEVEGbVG3fG/eGYFsQa2YQuaRSaQqFAhq4h06xrj6IiKThggCYIClyX2MKGCtHcA7AQgkRYjtBsgZSXN5bScnTEL8F8DmQk/h6jKdsKGoarbVrIxK6M2q2NKwq1WxYSeOplhK5XPrvU6oY0F7F1Z8+t8bzWusWri1rWy9e2zBi19nz6uLW+a1r869rbzX+ta6xZ8MBo8CobEp0sDWJZ6DUFR4KuEQcLP/yUGnA1Ep1H/wVTEFNRQMACQgABAAAAAAA";var sk=[440,480],Fg=2,ok=4,lk=4,A1=.02,y1=1e-4,uk=.02,od=class{constructor(e){this.audioOut=e;this.ctx=null;this.gain=null;this.sources=[];this.stopTimer=null;this.generation=0;this.muted=false;this.volume=oa.volume;}start(e){this.stopImmediate();let n=++this.generation,{src:i,loop:r=oa.loop,volume:a=oa.volume}=e;this.volume=a;let o=this.audioOut.acquire();if(!o)return;let u=o.createGain();u.connect(o.destination),this.ctx=o,this.gain=u,T.debug("ConnectTone","Player start",{state:o.state,builtIn:!i,loop:r,volume:a,muted:this.muted}),(async()=>{if(o.state==="suspended"){try{await o.resume();}catch(y){T.warn("ConnectTone","resume() rejected \u2014 autoplay blocked",{err:String(y)});}if(n!==this.generation)return;let g=o.state;if(T.debug("ConnectTone","Post-resume state",{state:g}),g!=="running"){T.warn("ConnectTone","Context still suspended \u2014 no user gesture, ringback will be silent",{state:g});return}}let d=!i;u.gain.value=this.muted?0:a;try{let g=await fetch(i??g1).then(_=>_.arrayBuffer()),y=await o.decodeAudioData(g);if(n!==this.generation)return;let A=o.createBufferSource();A.buffer=y,A.loop=r;let p=d?this.applyLoopWindow(A,y):0;A.connect(u),A.start(0,p),this.sources.push(A),T.debug("ConnectTone","Decoded tone playing",{builtIn:d,durationS:y.duration,loopStart:A.loopStart,loopEnd:A.loopEnd});}catch(g){T.warn("ConnectTone","Decoded tone failed \u2014 falling back to synth",{builtIn:d,err:String(g)}),n===this.generation&&this.startSynthesized(o,u,r);}})();}applyLoopWindow(e,n){let i=n.getChannelData(0),r=0;for(;r<i.length&&Math.abs(i[r])<uk;)r++;let a=r/n.sampleRate;return r>=i.length||a+2.7315>n.duration?(T.warn("ConnectTone","Loop window not found \u2014 looping whole buffer",{startS:a,durationS:n.duration}),0):(e.loopStart=a,e.loopEnd=a+2.7315,a)}startSynthesized(e,n,i){let r=e.currentTime,a=Fg+ok,o=i?lk:1,u=this.muted?0:this.volume;try{n.gain.setValueAtTime(0,r);for(let d=0;d<o;d++){let g=r+d*a;n.gain.setValueAtTime(0,g),n.gain.linearRampToValueAtTime(u,g+A1),n.gain.setValueAtTime(u,g+Fg-A1),n.gain.linearRampToValueAtTime(0,g+Fg);}for(let d of sk){let g=e.createOscillator();g.type="sine",g.frequency.value=d,g.connect(n),g.start(r),g.stop(r+o*a),this.sources.push(g);}T.debug("ConnectTone","Synthesized ringback scheduled",{cycles:o,level:u,ctxTime:r});}catch(d){T.warn("ConnectTone","Failed to schedule ringback",{err:String(d)});}}stop(e=oa.fadeOutMs){this.generation++;let n=this.ctx,i=this.gain;if(!n||!i){this.stopImmediate();return}let r=Math.max(0,e)/1e3;try{let a=n.currentTime,o=i.gain;if(typeof o.cancelAndHoldAtTime=="function")o.cancelAndHoldAtTime(a);else {let d=o.value;o.cancelScheduledValues(a),o.setValueAtTime(d,a);}let u=Math.max(o.value,y1);o.setValueAtTime(u,a),o.exponentialRampToValueAtTime(y1,a+r),o.setValueAtTime(0,a+r);}catch{}this.stopTimer=setTimeout(()=>this.stopImmediate(),e+20);}setMuted(e){if(this.muted=e,!(!this.gain||!this.ctx||this.ctx.state==="closed"))try{e?this.gain.disconnect():this.gain.connect(this.ctx.destination);}catch{}}destroy(){this.generation++,this.stopImmediate();}stopImmediate(){this.stopTimer&&(clearTimeout(this.stopTimer),this.stopTimer=null);for(let e of this.sources){try{e.stop();}catch{}try{e.disconnect();}catch{}}this.sources=[];try{this.gain?.disconnect();}catch{}this.gain=null,this.ctx=null;}};var ld=class{constructor(){this.ctx=null;this.released=false;}acquire(){if(this.released)return null;if(this.ctx&&this.ctx.state!=="closed")return this.ctx;try{this.ctx=new AudioContext;}catch(e){T.warn("AudioOut","AudioContext unavailable",{err:String(e)}),this.ctx=null;}return this.ctx}peek(){return this.ctx&&this.ctx.state!=="closed"?this.ctx:null}warm(){let e=this.acquire();if(e)try{e.state==="suspended"&&e.resume().catch(()=>{});let n=e.createBufferSource();n.buffer=e.createBuffer(1,1,e.sampleRate),n.connect(e.destination),n.start();}catch{}}ensureRunning(){let e=this.acquire();return e?sd(e):Promise.resolve(false)}release(){this.released=true;let e=this.ctx;this.ctx=null,!(!e||e.state==="closed")&&e.close().catch(()=>{});}};async function fk(t){if(typeof Worker>"u")return Promise.reject(new Error("Web Workers unavailable"));let e=Qa().vadWorker??URL.createObjectURL(new Blob([(await Promise.resolve().then(()=>(_1(),b1))).VAD_WORKER_SOURCE],{type:"application/javascript"})),n=new Worker(e),i=null;return new Promise((r,a)=>{n.onmessage=o=>{let u=o.data;u.type==="prob"?i?.(u.prob,u.tMs,u.speech??null):u.type==="ready"?r({pushPcm(d){n.postMessage({type:"pcm",buffer:d.buffer},[d.buffer]);},onProb(d){i=d;},reset(){n.postMessage({type:"reset"});},destroy(){n.terminate(),URL.revokeObjectURL(e);}}):u.type==="error"&&(n.terminate(),URL.revokeObjectURL(e),a(new Error(u.message)));},n.onerror=o=>{n.terminate(),URL.revokeObjectURL(e),a(new Error(o.message||"VAD worker failed"));},n.postMessage({type:"init",weights:t.slice().buffer});})}var S1={create:fk};var dk=6,hk=1500,ud=class{constructor(e){this.stream=null;this.video=null;this.canvas=null;this.timer=null;this.buffer=[];this.startedAt=0;this.capturing=false;this.listeners=new Set;this.stateListeners=new Set;this.frameWaiters=new Set;this.blockedTicks=0;this.permissionStatus=null;this.everGranted=false;this.sessionOpen=false;this.userDisabled=false;this.stopped=false;this.pendingOpen=null;this.capabilities=null;this.handleTrackEnded=()=>{this.isActive&&(T.warn("Perception","camera track ended unexpectedly"),this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange());};this.handlePermissionChange=()=>{this.permissionStatus?.state==="denied"&&(T.warn("Perception","camera permission revoked mid-session"),this.everGranted=false,this.teardownCapture(),this.emitStateChange({access:"denied",feed:"off"}),this.emitChange());};this.fps=e?.fps??3,this.bufferMs=e?.bufferMs??12e3,this.maxEdge=e?.maxEdge??512,this.jpegQuality=e?.jpegQuality??.7,this.historyThresholdMs=e?.historyThresholdMs??3e3,this.facing=e?.facing??"user",this.maxFrames=Math.max(1,e?.maxFrames??3);}get isActive(){return this.stream!==null}get isSessionOpen(){return this.sessionOpen}get isVideoOff(){return this.userDisabled}get feed(){return this.isActive?"live":"off"}getStream(){return this.stream}getVideoElement(){return this.video}getFacing(){return this.facing}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}onStateChange(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}hasHistory(){return this.isActive&&Date.now()-this.startedAt>=this.historyThresholdMs}waitForFrames(e){if(this.freshFrames().length>0)return Promise.resolve(this.snapshot());if(!this.isActive)return Promise.resolve([]);this.buffer.length>0&&T.warn("Perception","newest frame is stale \u2014 waiting for a fresh one",{ageMs:Date.now()-this.buffer[this.buffer.length-1].t});let n=Date.now();return new Promise(i=>{let r=()=>{clearTimeout(a),this.frameWaiters.delete(r);let o=this.snapshot();T.info("Perception","waited for frames",{count:o.length,waitedMs:Date.now()-n}),i(o);},a=setTimeout(r,e);this.frameWaiters.add(r);})}async willPrompt(){if(this.isActive||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return false;try{let e=await navigator.permissions?.query({name:"camera"});if(e)return e.state==="prompt"}catch{}return !this.everGranted}async ensureCamera(){if(this.isActive)return "granted";if(this.stopped||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return "unavailable";let e;try{e=await this.openCamera();}catch(n){let i=n?.name;return T.warn("Perception","camera getUserMedia failed",{name:i}),i==="NotAllowedError"||i==="SecurityError"?"denied":"unavailable"}return e?(this.sessionOpen=true,this.userDisabled=false,this.emitChange(),this.emitStateChange({facing:this.facingLabel()}),this.reportCapabilities(),"granted"):"unavailable"}async setVideoEnabled(e){if(e){if(this.stopped||(this.userDisabled=false,this.isActive))return;let n;try{n=await this.openCamera();}catch(i){let r=i?.name;T.warn("Perception","failed to re-enable video",{name:r});let a=r==="NotAllowedError"||r==="SecurityError";a&&(this.everGranted=false),this.emitStateChange(a?{access:"denied",feed:"off"}:{feed:"off"}),this.emitChange();return}if(!n)return;this.sessionOpen=true,this.emitStateChange({feed:"live",facing:this.facingLabel()}),this.emitChange(),this.reportCapabilities();return}this.userDisabled=true,this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange();}snapshot(){return this.freshFrames().slice(-this.maxFrames).map(e=>e.bytes)}freshFrames(){let e=Date.now()-hk;return this.buffer.filter(n=>n.t>=e)}openCamera(){return this.stream?Promise.resolve(true):(this.pendingOpen??(this.pendingOpen=this.openStream(this.facing).then(e=>(this.everGranted=true,this.stopped||this.userDisabled?(e.getTracks().forEach(n=>n.stop()),T.info("Perception","released a camera opened after teardown"),false):(this.stream=e,this.attachTrackWatchers(),this.watchPermission(),this.startCaptureLoop(),true))).finally(()=>{this.pendingOpen=null;})),this.pendingOpen)}stop(){let e=this.sessionOpen||this.isActive;this.stopped=true,this.teardownCapture(),this.permissionStatus&&(this.permissionStatus.removeEventListener("change",this.handlePermissionChange),this.permissionStatus=null),this.sessionOpen=false,this.userDisabled=false,e&&this.emitChange();}async flip(e="toggle"){if(!this.isActive)return "unavailable";let n=e==="front"?"user":e==="back"||this.facing==="user"?"environment":"user";if(n===this.facing)return "unchanged";let i;try{i=await this.openStream(n);}catch(r){let a=r?.name;return T.warn("Perception","camera flip failed \u2014 keeping current camera",{name:a,next:n}),a==="OverconstrainedError"||a==="NotFoundError"?"unavailable":"failed"}return this.stopped||this.userDisabled||!this.stream?(i.getTracks().forEach(r=>r.stop()),"unavailable"):(this.detachTrackWatchers(),this.stream?.getTracks().forEach(r=>r.stop()),this.stream=i,this.facing=n,this.attachTrackWatchers(),this.video&&(this.video.srcObject=i),this.emitStateChange({facing:this.facingLabel()}),this.emitChange(),"switched")}facingLabel(){return this.facing==="environment"?"back":"front"}teardownCapture(){if(this.detachTrackWatchers(),this.timer&&(clearInterval(this.timer),this.timer=null),this.video){try{this.video.pause();}catch{}this.video.srcObject=null,this.video.remove(),this.video=null;}this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.buffer=[],this.canvas=null,this.capturing=false,this.startedAt=0,this.blockedTicks=0,[...this.frameWaiters].forEach(e=>e());}openStream(e){return navigator.mediaDevices.getUserMedia({video:{facingMode:e},audio:false})}async reportCapabilities(){try{this.capabilities||(this.capabilities=await this.detectCapabilities()),this.emitStateChange({canFlip:this.capabilities.canFlip,availableCameras:this.capabilities.availableCameras});}catch{}}async detectCapabilities(){let e=this.stream?.getVideoTracks()[0]?.getCapabilities?.().facingMode??[],n=e.includes("user")&&e.includes("environment"),i=0;try{i=(await navigator.mediaDevices.enumerateDevices()).filter(d=>d.kind==="videoinput").length;}catch{}let r=navigator.mediaDevices.getSupportedConstraints?.().facingMode??false,a=n||r&&i>=2,o=a?["front","back"]:[this.facing==="environment"?"back":"front"];return {canFlip:a,availableCameras:o}}emitChange(){this.listeners.forEach(e=>{try{e();}catch{}});}emitStateChange(e){this.stateListeners.forEach(n=>{try{n(e);}catch{}});}async watchPermission(){if(!this.permissionStatus)try{let e=await navigator.permissions?.query({name:"camera"});if(!e)return;this.permissionStatus=e,e.addEventListener("change",this.handlePermissionChange);}catch{}}attachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.addEventListener("ended",this.handleTrackEnded));}detachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded));}startCaptureLoop(){let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),this.video=e,this.canvas=document.createElement("canvas"),this.startedAt=Date.now(),e.play().catch(i=>T.error("Perception","capture video failed to play",{name:i?.name,message:i?.message}));let n=Math.max(1,Math.round(1e3/this.fps));this.timer=setInterval(()=>{this.captureFrame();},n);}async captureFrame(){if(this.capturing||!this.video||!this.canvas)return;let e=this.video.videoWidth,n=this.video.videoHeight;if(!e||!n){this.blockedTicks+=1,this.blockedTicks===dk&&T.error("Perception","capture video is not producing frames",{afterMs:Date.now()-this.startedAt,paused:this.video.paused,readyState:this.video.readyState,inDocument:this.video.isConnected});return}this.capturing=true;try{let i=Math.min(1,this.maxEdge/Math.max(e,n)),r=Math.max(1,Math.round(e*i)),a=Math.max(1,Math.round(n*i));this.canvas.width=r,this.canvas.height=a;let o=this.canvas.getContext("2d");if(!o)return;o.drawImage(this.video,0,0,r,a);let u=await this.canvasToJpegBytes(this.canvas);if(u){let d=Date.now(),g=this.buffer.length===0;this.buffer.push({t:d,bytes:u}),this.pruneBuffer(d),g&&T.info("Perception","first frame captured",{afterMs:d-this.startedAt,blockedTicks:this.blockedTicks}),this.frameWaiters.size>0&&[...this.frameWaiters].forEach(y=>y());}}catch(i){T.warn("Perception","frame capture failed",{err:i});}finally{this.capturing=false;}}canvasToJpegBytes(e){return new Promise(n=>{e.toBlob(i=>{if(!i)return n(null);i.arrayBuffer().then(r=>n(new Uint8Array(r))).catch(()=>n(null));},"image/jpeg",this.jpegQuality);})}pruneBuffer(e){let n=e-this.bufferMs,i=0;for(;i<this.buffer.length&&this.buffer[i].t<n;)i++;i>0&&this.buffer.splice(0,i);}};var ho={bundle:{sha256:"98db72469ffb176f5e9f2687be0f70783893aca681f7789c34b872b0a764371a",byteLength:155465,ext:"js"},loader:{sha256:"e170ee67dd4e16c1a6fcd8840a206687e5a59b22c20e4a902bc445b095454d73",byteLength:323377,ext:"js"},wasm:{sha256:"8da277a733926eacd0474b8704b36742d6ec3231c57a860c5b889dff8f1df886",byteLength:11756954,ext:"wasm"},model:{sha256:"64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",byteLength:3758596,ext:"task"}};var pk="CPU",gk=3e4;async function M1(t){if(typeof Worker>"u")throw new Error("Web Workers unavailable");let e=Qa().moodAssets?.replace(/\/+$/,""),n=g=>e?`${e}/${g.sha256}.${g.ext}`:Zp(g.sha256,g.ext),i=t?.getCachedAsset?{read:g=>t.getCachedAsset?.(g),write:(g,y)=>t.setCachedAsset?.(g,y)}:void 0,r=g=>Hl(g,n(g),i),a=[],o=(g,y)=>{let A=URL.createObjectURL(new Blob([g],{type:y}));return a.push(A),A},u=async g=>e?n(g):o(await r(g),"text/javascript"),d=null;try{let[g,y,A,p,_]=await Promise.all([Qa().moodWorker??Promise.resolve().then(()=>(w1(),E1)).then(({MOOD_WORKER_SOURCE:B})=>o(B,"text/javascript")),u(ho.bundle),u(ho.loader),r(ho.wasm).then(B=>o(B,"application/wasm")),r(ho.model)]);d=new Worker(g);let C={type:"init",bundleUrl:y,loaderUrl:A,wasmUrl:p,model:_,delegate:pk};d.postMessage(C);let N=await vk(d);return t?.pruneCachedAssets?.(Object.values(ho).map(B=>B.sha256)).catch(()=>{}),Ak(d,N)}catch(g){throw d?.terminate(),g}finally{for(let g of a)URL.revokeObjectURL(g);}}function vk(t){return new Promise((e,n)=>{let i=setTimeout(()=>n(new Error("mood worker did not start in time")),gk);t.onerror=r=>{clearTimeout(i),n(new Error(r.message||"mood worker failed to load"));},t.onmessage=r=>{let a=r.data;a.type==="ready"?(clearTimeout(i),e(a.delegate)):a.type==="error"&&(clearTimeout(i),n(new Error(a.message)));};})}function Ak(t,e){let n=null,i=r=>{let a=n;n=null,a&&("error"in r?a.reject(r.error):a.resolve(r.blendshapes));};return t.onerror=r=>i({error:new Error(r.message||"mood worker crashed")}),t.onmessage=r=>{let a=r.data;a.type==="result"?i({blendshapes:a.blendshapes}):a.type==="error"&&i({error:new Error(a.message)});},{delegate:e,detect:(r,a)=>n?(r.close(),Promise.reject(new Error("detect already pending"))):new Promise((o,u)=>{n={resolve:o,reject:u};let d={type:"frame",frame:r,timestampMs:a};t.postMessage(d,[r]);}),terminate:()=>{i({error:new Error("mood worker terminated")}),t.terminate();}}}var T1=5,C1=480,yk="afx:mood-debug",bk=()=>{try{return globalThis.localStorage?.getItem(yk)==="1"}catch{return false}},_k=t=>{if(typeof VideoFrame=="function")try{return Promise.resolve(new VideoFrame(t))}catch{}return createImageBitmap(t,{resizeWidth:C1,resizeHeight:Math.round(C1*t.videoHeight/t.videoWidth),resizeQuality:"low"})},cd=class{constructor(e){this.options=e;this.classifier=new iu;this.worker=null;this.timer=null;this.generation=0;this.detecting=false;this.failed=false;this.timestampMs=0;this.debug=false;this.ticks=0;}start(){if(this.timer||this.failed)return;this.worker??(this.worker=M1(this.options.cache));let e=this.generation;this.worker.then(n=>{e!==this.generation||this.timer||(this.debug=bk(),T.info("Mood","face model ready",{delegate:n.delegate,debug:this.debug}),this.timer=setInterval(()=>{this.tick(n);},1e3/T1));},n=>{e===this.generation&&this.fail("face model failed to load",n);});}stop(){this.generation+=1,this.timer&&(clearInterval(this.timer),this.timer=null),this.classifier.reset();}dispose(){this.stop(),this.worker?.then(e=>e.terminate(),()=>{}),this.worker=null;}async tick(e){if(this.detecting)return;let n=this.options.getVideo();if(!n||n.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||!n.videoWidth)return;let i=this.generation;this.detecting=true;try{let r=await _k(n);this.timestampMs=Math.max(performance.now(),this.timestampMs+1);let a=await e.detect(r,this.timestampMs);if(i!==this.generation)return;let o=this.classifier.update(a,Date.now(),this.options.isUserSpeaking());o&&this.options.onReading(o),this.debug&&++this.ticks%T1===0&&this.logFrame(o);}catch(r){i===this.generation&&this.fail("face detection failed",r);}finally{this.detecting=false;}}logFrame(e){let n=this.classifier.inspect();if(!n)return;let i=r=>Object.entries(r).map(([a,o])=>`${a}=${o}`).join(" ");T.info("Mood",`frame label=${n.label} reading=${e?.state??"none"} | scores ${i(n.scores)} | browDrop=${n.browDrop} | raw ${i(n.raw)} | base ${i(n.baseline)}`);}fail(e,n){this.failed=true,this.dispose(),T.warn("Mood",`${e}; mood reading is off for this session`,{cause:n});}};var Sk=1280,Ek=.75,wk=1e3,R1=5,k1=300,Mk=6e4,Tk=2500,Ck=3,Rk=new Set(["InvalidAccessError","InvalidStateError","NotAllowedError"]),kk={tab:"browser",window:"window",screen:"monitor"},xk=()=>{if(typeof navigator>"u")return "other";let t=navigator.userAgentData?.brands??[];if(t.some(n=>/Edge/i.test(n.brand)))return "edge";if(t.some(n=>/Chrom/i.test(n.brand)))return "chrome";let e=navigator.userAgent;return /Edg\//.test(e)?"edge":/Firefox\//.test(e)?"firefox":/Chrome\//.test(e)?"chrome":/Safari\//.test(e)?"safari":"other"},Ok=t=>t==="browser"?"tab":t==="window"?"window":t==="monitor"?"screen":void 0,Ik=()=>{if(typeof navigator>"u"||typeof document>"u")return "no browser";if(navigator.userAgentData?.mobile===true||/Android|iPhone|iPad|iPod/i.test(navigator.userAgent))return "mobile browsers cannot share a screen";if(typeof navigator.mediaDevices?.getDisplayMedia!="function")return "this browser cannot share a screen";let e=document.permissionsPolicy??document.featurePolicy;return typeof e?.allowsFeature=="function"&&!e.allowsFeature("display-capture")?"the embedding page does not allow display-capture":null},fd=class{constructor(e){this.browser=xk();this.phase="idle";this.surface=null;this.requestedSurface=null;this.turnId=null;this.clickTimer=null;this.listeners=new Set;this.disposed=false;this.stream=null;this.imageCapture=null;this.grabFailures=0;this.video=null;this.thumbCanvas=null;this.frameCanvas=null;this.sampleTimer=null;this.sampling=false;this.lastTickAt=0;this.throttleLogged=false;this.lastSentThumb=null;this.lastSentAt=0;this.handleTrackEnded=()=>{this.phase==="live"&&(T.info("Perception","screen share ended by the user"),this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"}));};this.handlers=e;}get currentPhase(){return this.phase}get currentSurface(){return this.surface}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,n){if(this.disposed){this.handlers.onStatus("unavailable",n,{reason:"session ended"});return}let i=Ik();if(i){this.handlers.onStatus("unavailable",n,{reason:i});return}if(this.turnId=n,this.phase==="live"){this.report("granted",{surface:this.surface??void 0}),this.turnId=null;return}if(this.phase==="awaiting_click"){this.report("awaiting_click");return}this.phase!=="picking"&&(this.requestedSurface=e,this.pick(false));}shareFromClick(){this.phase!=="awaiting_click"||this.disposed||(this.clearClickTimer(),this.pick(true));}dismiss(){this.phase==="awaiting_click"&&(this.clearClickTimer(),this.finish("declined","dismissed"));}stop(){if(this.phase==="live"){this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"});return}(this.phase==="awaiting_click"||this.phase==="picking")&&(this.clearClickTimer(),this.finish("declined","withdrawn"));}dispose(){this.disposed=true,this.clearClickTimer(),this.releaseCapture(),this.turnId=null,this.setPhase("idle"),this.listeners.clear();}async pick(e){this.setPhase("picking");let n=navigator.userActivation?.isActive??e,i=Date.now(),r=setTimeout(()=>{this.phase==="picking"&&!this.disposed&&this.report("picking");},k1),a;try{a=await navigator.mediaDevices.getDisplayMedia(this.pickerOptions());}catch(o){if(clearTimeout(r),this.disposed||this.phase!=="picking")return;let u=o?.name??"Error",d=Date.now()-i<k1;if(T.info("Perception","screen picker refused",{name:u,fromClick:e,hadActivation:n,afterMs:Date.now()-i}),!e&&!n&&d&&Rk.has(u)){this.awaitClick();return}if(u==="NotAllowedError"){this.finish("declined",d?"blocked by the browser":"cancelled");return}this.finish("unavailable",u);return}if(clearTimeout(r),this.disposed||this.phase!=="picking"){a.getTracks().forEach(o=>o.stop()),T.info("Perception","released a screen shared after the request ended");return}this.adopt(a);}pickerOptions(){return {video:{frameRate:{ideal:R1,max:R1},...this.requestedSurface&&{displaySurface:kk[this.requestedSurface]}},audio:false,selfBrowserSurface:"exclude",surfaceSwitching:"include"}}awaitClick(){this.setPhase("awaiting_click"),this.report("awaiting_click"),this.clickTimer=setTimeout(()=>{this.clickTimer=null,this.phase==="awaiting_click"&&this.finish("declined","no click");},Mk);}adopt(e){let n=e.getVideoTracks()[0];if(!n){e.getTracks().forEach(i=>i.stop()),this.finish("unavailable","no video track");return}this.stream=e,this.surface=Ok(n.getSettings?.().displaySurface)??this.requestedSurface,n.addEventListener("ended",this.handleTrackEnded),this.setPhase("live"),this.report("granted",{surface:this.surface??void 0}),this.turnId=null,this.startSampler(n);}report(e,n){this.turnId!==null&&this.handlers.onStatus(e,this.turnId,{browser:this.browser,...n});}finish(e,n){this.report(e,{reason:n}),this.turnId=null,this.setPhase("idle");}clearClickTimer(){this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=null;}setPhase(e){this.phase!==e&&(this.phase=e,this.listeners.forEach(n=>{try{n();}catch{}}));}startSampler(e){let n=globalThis.ImageCapture;typeof n=="function"?this.imageCapture=new n(e):this.attachVideo(),this.thumbCanvas=document.createElement("canvas"),this.thumbCanvas.width=32,this.thumbCanvas.height=32,this.frameCanvas=document.createElement("canvas"),this.lastTickAt=Date.now(),this.sampleTimer=setInterval(()=>{this.sample();},wk);}attachVideo(){if(this.video||!this.stream)return;let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),e.play().catch(()=>{}),this.video=e;}async sample(){if(this.sampling||!this.stream)return;let e=Date.now(),n=e-this.lastTickAt;this.lastTickAt=e,n>Tk&&!this.throttleLogged&&(this.throttleLogged=true,T.warn("Perception","screen sampling throttled",{gapMs:n,hidden:document.hidden})),this.sampling=true;let i=null;try{if(i=await this.grabSource(),!i||!this.thumbCanvas||!this.stream)return;let r=this.thumbCanvas.getContext("2d",{willReadFrequently:!0});if(!r)return;r.drawImage(i.image,0,0,32,32);let a=Lg(r.getImageData(0,0,32,32).data);if(!Pg(this.lastSentThumb,a,e-this.lastSentAt))return;let o=await this.encode(i);if(!o||!this.stream)return;this.lastSentThumb=a,this.lastSentAt=e,this.handlers.onFrame(o);}catch(r){T.warn("Perception","screen frame failed",{name:r?.name});}finally{i?.release(),this.sampling=false;}}async grabSource(){if(this.imageCapture)try{let n=await this.imageCapture.grabFrame();return this.grabFailures=0,{image:n,width:n.width,height:n.height,release:()=>n.close()}}catch(n){return this.grabFailures+=1,this.grabFailures>=Ck&&(T.warn("Perception","grabFrame keeps failing \u2014 using a video element",{name:n?.name}),this.imageCapture=null,this.attachVideo()),null}let e=this.video;return !e||!e.videoWidth||!e.videoHeight?null:{image:e,width:e.videoWidth,height:e.videoHeight,release:()=>{}}}encode(e){let n=this.frameCanvas;if(!n)return Promise.resolve(null);let i=Math.min(1,Sk/Math.max(e.width,e.height)),r=Math.max(1,Math.round(e.width*i)),a=Math.max(1,Math.round(e.height*i));return n.width=r,n.height=a,n.getContext("2d")?.drawImage(e.image,0,0,r,a),new Promise(o=>{n.toBlob(u=>{if(!u)return o(null);u.arrayBuffer().then(d=>o({bytes:new Uint8Array(d),width:r,height:a})).catch(()=>o(null));},"image/jpeg",Ek);})}releaseCapture(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded)),this.sampleTimer&&clearInterval(this.sampleTimer),this.sampleTimer=null,this.video&&(this.video.srcObject=null,this.video.remove(),this.video=null),this.stream?.getTracks().forEach(e=>e.stop()),this.stream=null,this.imageCapture=null,this.grabFailures=0,this.thumbCanvas=null,this.frameCanvas=null,this.lastSentThumb=null,this.lastSentAt=0,this.throttleLogged=false,this.surface=null;}};var Nk="avatarfactory-riv-cache",_r="riv-files",fa="avatar-configs",po="greetings",go="vad-weights",hd="cache-keys",da="content-assets";var x1="riv-wrap-key";var mo=null;function gi(){return mo||(mo=new Promise((e,n)=>{let i=indexedDB.open(Nk,6);i.onupgradeneeded=r=>{let a=i.result;a.objectStoreNames.contains(_r)?r.oldVersion<5&&i.transaction?.objectStore(_r).clear():a.createObjectStore(_r),a.objectStoreNames.contains(fa)||a.createObjectStore(fa),a.objectStoreNames.contains(po)||a.createObjectStore(po),a.objectStoreNames.contains(go)||a.createObjectStore(go),a.objectStoreNames.contains(hd)||a.createObjectStore(hd),a.objectStoreNames.contains(da)||a.createObjectStore(da);},i.onblocked=()=>n(new Error("indexedDB upgrade to v6 blocked")),i.onsuccess=()=>{let r=i.result;r.onversionchange=()=>{r.close(),mo=null;},e(r);},i.onerror=()=>n(i.error);}).catch(e=>{throw mo=null,e}),mo)}var dd=null;function O1(t){return dd||(dd=Dk(t).catch(()=>null).then(e=>(e||(dd=null),e))),dd}async function Dk(t){let e=globalThis.crypto?.subtle;if(!e)return null;let n=await e.generateKey({name:"AES-GCM",length:256},false,["encrypt","decrypt"]);return new Promise(i=>{let r=t.transaction(hd,"readwrite"),a=r.objectStore(hd),o=a.get(x1),u=n;o.onsuccess=()=>{let d=o.result;d?u=d:a.put(n,x1);},r.oncomplete=()=>i(u),r.onerror=()=>i(null);})}async function I1(t){try{let e=await gi(),n=await O1(e);if(!n)return null;let i=await new Promise(a=>{let u=e.transaction(_r,"readonly").objectStore(_r).get(t);u.onsuccess=()=>{let d=u.result;a(d?.cipher?d:null);},u.onerror=()=>a(null);});return i?{bytes:await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:i.iv},n,i.cipher),rivVersion:i.rivVersion}:null}catch{return null}}async function N1(t,e,n){try{let i=await gi(),r=await O1(i);if(!r)return;let a=globalThis.crypto.getRandomValues(new Uint8Array(12)),o=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:a},r,e);return new Promise(u=>{let d={cipher:o,iv:a,rivVersion:n},g=i.transaction(_r,"readwrite");g.objectStore(_r).put(d,t),g.oncomplete=()=>u(),g.onerror=()=>u();})}catch{}}async function Lk(t){try{let e=await gi();return new Promise(n=>{let i=e.transaction([_r,fa],"readwrite");i.objectStore(_r).delete(t),i.objectStore(fa).delete(t),i.oncomplete=()=>n(),i.onerror=()=>n();})}catch{}}async function D1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(fa,"readonly").objectStore(fa).get(t);r.onsuccess=()=>{let a=r.result;if(!a){n(null);return}let o=a;if(!o.cachedAt||Date.now()-o.cachedAt>6048e5){Lk(t),n(null);return}n(o.config);},r.onerror=()=>n(null);})}catch{return null}}async function L1(t,e){try{let n=await gi();return new Promise(i=>{let r={config:e,cachedAt:Date.now()},a=n.transaction(fa,"readwrite");a.objectStore(fa).put(r,t),a.oncomplete=()=>i(),a.onerror=()=>i();})}catch{}}async function P1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(po,"readonly").objectStore(po).get(t);r.onsuccess=()=>{let a=r.result;if(!a?.cachedAt||Date.now()-a.cachedAt>2592e6){n(null);return}n(a);},r.onerror=()=>n(null);})}catch{return null}}async function B1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(po,"readwrite"),a=r.objectStore(po);a.put(e,t);let o=t.slice(0,t.indexOf(":"));if(o){let u=IDBKeyRange.bound(`${o}:`,`${o}:\uFFFF`),d=a.openKeyCursor(u);d.onsuccess=()=>{let g=d.result;g&&(g.key!==t&&a.delete(g.key),g.continue());};}r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function U1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(go,"readonly").objectStore(go).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function F1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(go,"readwrite"),a=r.objectStore(go);a.put(e,t);let o=a.openKeyCursor();o.onsuccess=()=>{let u=o.result;u&&(u.key!==t&&a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function V1(t){try{let e=await gi();return new Promise(n=>{let r=e.transaction(da,"readonly").objectStore(da).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function H1(t,e){try{let n=await gi();return new Promise(i=>{let r=n.transaction(da,"readwrite");r.objectStore(da).put(e,t),r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function G1(t){try{let e=await gi(),n=new Set(t);return new Promise(i=>{let r=e.transaction(da,"readwrite"),a=r.objectStore(da),o=a.openKeyCursor();o.onsuccess=()=>{let u=o.result;u&&(n.has(String(u.key))||a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}var Vg={getCachedRiv:I1,setCachedRiv:N1,getCachedAvatarConfig:D1,setCachedAvatarConfig:L1,getCachedGreeting:P1,setCachedGreeting:B1,getCachedVadWeights:U1,setCachedVadWeights:F1,getCachedAsset:V1,setCachedAsset:H1,pruneCachedAssets:G1};var z1={async bytesToSrc(t){let e=new Blob([t],{type:"application/octet-stream"});return URL.createObjectURL(e)},revokeSrc(t){URL.revokeObjectURL(t);}};var Pk=/^(cc-|new-password|current-password|one-time-code)/,Bk=/\b(?:card (?:number|no|num)|cc (?:number|num|no)|cvv|cvc|csc|security code|iban|ssn|social security|otp)\b/,Uk=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase(),md=(t,e="")=>{if(t.getAttribute("type")==="password"||Pk.test(t.getAttribute("autocomplete")||""))return true;let n=["name","id","aria-label","placeholder"].map(i=>t.getAttribute(i)||"").concat(e).join(" ");return Bk.test(Uk(n))},du=t=>(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&(t.type==="submit"||t.type==="image")&&t.form!==null;var Fk=/\bsponsored\b/i,Vk="nav, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]",Hg=t=>{if(t.closest(Vk))return true;let e=t.closest("header, footer");return !!e&&!e.parentElement?.closest("article, section, main, [role=main]")},Hk=t=>{let e=t.getAttribute("role"),n=Array.from(t.classList).sort().slice(0,3).join(".");return `${t.tagName}${e?`[${e}]`:""}${n?`.${n}`:""}`},Gk=t=>[t,t.parentElement,t.parentElement?.parentElement].map(e=>e?Hk(e):"").join("<"),zk=t=>{let e=0;for(let n=t.parentElement;n;n=n.parentElement)e+=1;return e},j1=(t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,jk=t=>{let e=t.ownerDocument.defaultView;if(!e)return false;let n=t.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return i>=0&&r>=0&&i<=e.innerWidth&&r<=e.innerHeight},pd=(t,e)=>{if(t.length<=e)return t;let n=t.slice(0,e),i=n.lastIndexOf(" ");return `${i>0?n.slice(0,i):n}\u2026`},Yk=t=>{let e=new Map,n=new Map;for(let r of t){let a=r.el;for(let o=0;a&&o<=8&&a!==a.ownerDocument.body;o+=1){let u=Gk(a),d=e.get(u);d||e.set(u,d=new Set),d.add(a);let g=n.get(a);g||n.set(a,g=[]),g.push(r),a=a.parentElement;}}let i=[];for(let r of e.values()){if(r.size<3)continue;let a=Array.from(r).sort(j1);a.some((o,u)=>u>0&&a[u-1].contains(o))||i.push({cards:a,depth:a.reduce((o,u)=>o+zk(u),0)/a.length});}return {groups:i,controlsIn:n}},Wk=t=>{let e=new Set;for(let n of t){let i=new Set(n.cards);for(let r of t){let a=r.depth-n.depth;if(r===n||a<=0||a>8)continue;let o=new Map;for(let d of r.cards){let g=d.parentElement;for(let y=0;g&&y<8;y+=1,g=g.parentElement)if(i.has(g)){o.set(g,(o.get(g)??0)+1);break}}if(o.size<3)continue;Array.from(o.values()).reduce((d,g)=>d+g,0)/o.size>=1.5?e.add(n):e.add(r);}}return t.filter(n=>!e.has(n))};function Y1(t,e){let n=new Map,i=p=>{let _=n.get(p);return _===void 0&&n.set(p,_=e.textOf(p)),_},{groups:r,controlsIn:a}=Yk(t),o=p=>{if(Hg(p)||Fk.test(i(p)))return false;let _=a.get(p)??[];return _.length!==1?_.length>1:i(p).length>_[0].name.length+3},u=p=>{let _=(B,M)=>i(M.el).length-i(B.el).length,C=p.filter(({el:B})=>B.matches("a[href], [role=link]"));return [...C.filter(({el:B})=>e.pathOf(B))].sort(_)[0]??[...C].sort(_)[0]??p[0]},d=(p,_)=>{let C=p[0].parentElement;for(let N=0;C&&N<3;N+=1,C=C.parentElement){let B=C.getAttribute("aria-label")?.trim();if(B)return pd(B,60);let M=C.previousElementSibling;for(let w=0;M&&w<3;w+=1){let R=M.matches("h1, h2, h3, [role=heading]")?M:M.querySelector("h1, h2, h3, [role=heading]"),D=R?i(R):"";if(D)return pd(D,60);M=M.previousElementSibling;}}return `List ${_}`},g=Wk(r.map(p=>({...p,cards:p.cards.filter(o)})).filter(p=>p.cards.length>=3)).sort((p,_)=>j1(p.cards[0],_.cards[0])),y={lists:[],primary:new Map,secondary:new Set},A=new Set;for(let p of g){if(y.lists.length>=6)break;let _=y.lists.length+1,C=[],N=[],B=0;for(let M of p.cards){let w=(a.get(M)??[]).filter(({el:ne})=>!A.has(ne)),R=u(w);if(!R)continue;let D=i(R.el),G=pd(i(M).replace(D," ").replace(/\s+/g," ").trim(),90);C.push([R.el,{list:_,position:C.length+1,...jk(M)&&{screenPosition:++B},...G&&{detail:G},name:pd(D,60)||R.name}]);for(let{el:ne}of w)ne!==R.el&&N.push(ne);}if(!(C.length<3)){y.lists.push({id:_,name:d(p.cards,_),total:C.length});for(let[M,w]of C)y.primary.set(M,w),A.add(M);for(let M of N)y.secondary.add(M),A.add(M);}}return y}var Gg=/^skip (?:to\b|navigation\b|nav\b|main\b|links\b)/i,qk=25,Qk=60,Xk=40,qg={maxControls:Qk,reservedLinks:0,groupLists:false,maxItems:0,preferVisible:false};var $1=60,Kk=120,Zk=200,W1=2,eE="main, section, article, aside, nav, header, footer, [role=region], [role=tabpanel], [role=main], [role=navigation], [role=banner], [role=contentinfo]",tE="h1, h2, h3, [role=heading]",nE="button, summary, [role=button], [role=tab], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=option], input[type=submit], input[type=button], input[type=reset]",Jk=new Set(["option","menuitemradio","menuitemcheckbox"]),iE="a[href], [role=link]",Yg="input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea, [contenteditable=''], [contenteditable=true], [role=textbox], [role=combobox]",$k="form, [role=form]",q1={section:"s",button:"b",link:"l",field:"f",form:"frm"},Vt=(t,e)=>(t.getAttribute(e)||"").trim(),rE=/\s*[.(]?\s*opens? in (?:a )?new (?:tab|window)\)?\.?/gi,An=(t,e=$1)=>t.replace(rE,"").replace(/\s+/g," ").trim().slice(0,e),aE=(t,e)=>{let n=An(t,1/0);if(n.length<=e)return n;let i=n.slice(0,e),r=i.lastIndexOf(" ");return r>0?i.slice(0,r):i},ex=t=>!!t.body&&t.body.getBoundingClientRect().width>0,Qg=(t,e)=>{let n=t;if(typeof n.checkVisibility=="function"&&!n.checkVisibility({contentVisibilityAuto:true,visibilityProperty:true}))return false;if(!e)return true;let i=t.getBoundingClientRect();return i.width>=W1&&i.height>=W1},tx=(t,e)=>{let n=e.defaultView;if(!n)return false;let i=t.getBoundingClientRect(),r=i.left+i.width/2,a=i.top+i.height/2;if(r<0||a<0||r>n.innerWidth||a>n.innerHeight)return false;let o=e.elementFromPoint(r,a);return !!o&&o!==t&&!t.contains(o)&&!o.contains(t)},nx=(t,e)=>{let n=e.defaultView;if(!n)return true;let i=t.getBoundingClientRect();return i.bottom>0&&i.right>0&&i.top<n.innerHeight&&i.left<n.innerWidth},ix=(t,e)=>{if(t.closest("[inert]"))return true;let n=e.defaultView;return n?n.getComputedStyle(t).pointerEvents==="none":false},Ad=t=>{let e=Vt(t,"aria-label");if(e)return An(e);let n=Vt(t,"aria-labelledby");if(!n)return "";let i=n.split(/\s+/).map(r=>{let a=t.ownerDocument.getElementById(r);return a?ha(a):""}).join(" ");return An(i)},rx=new Set(["A","ABBR","B","BDI","BDO","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","RUBY","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]),sE="script, style, [aria-hidden=true], [hidden]",ha=(t,e,n=true)=>{if(t.nodeType===Node.TEXT_NODE)return t.nodeValue||"";if(t.nodeType!==Node.ELEMENT_NODE)return "";let i=t;if(!n&&e&&i.matches(e))return "";let r="";for(let a of Array.from(i.childNodes))r+=ha(a,e,false);return rx.has(i.tagName)?r:` ${r} `},oE=(t,e)=>{let n=[],i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:r=>r!==t&&r.nodeType===Node.ELEMENT_NODE&&r.matches(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let r=i.nextNode();r;r=i.nextNode())r.nodeType===Node.TEXT_NODE&&n.push(r.nodeValue??"");return n},ax=t=>{let e=An(ha(t,sE));return e.length>Zk?"":e},sx=t=>{let e=t.querySelector("img[alt], [role=img][aria-label]");return e?An(Vt(e,"alt")||Vt(e,"aria-label")):""},ox=t=>{let e=t.labels?.[0];if(e)return An(ha(e));if(t.id){let i=t.ownerDocument.querySelector(`label[for="${CSS.escape(t.id)}"]`);if(i)return An(ha(i))}let n=t.closest("label");return n?An(ha(n)):""},lx=t=>t.length>=3&&/[a-z]/i.test(t)&&/[aeiou]/i.test(t)&&!/\d{3}/.test(t),vo=t=>{if(!t)return "";let e=An(t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase());return lx(e)?e:""},ux=t=>{let e=Vt(t,"autocomplete");if(e&&e!=="off"&&e!=="on")return vo(e);let n=Vt(t,"type");return n&&n!=="text"?`${n} field`:""},cx=(t,e)=>{for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.matches(eE))return false;return true},lE=t=>{for(let e of Array.from(t.querySelectorAll(tE)))if(cx(t,e))return An(ha(e));return ""},fx=4,uE=30,hu=t=>{for(let[e,n]of t){let i=n();if(i)return {name:i,namedBy:e}}return {name:"",namedBy:"none"}},dx={nav:"navigation",header:"header",footer:"footer",main:"main content",aside:"sidebar"},hx=t=>hu([["aria",()=>Ad(t)],["heading",()=>lE(t)],["id",()=>vo(t.id)],["landmark",()=>dx[t.tagName.toLowerCase()]??""]]),Q1=t=>hu([["aria",()=>Ad(t)],["text",()=>ax(t)],["img-alt",()=>sx(t)],["title",()=>Vt(t,"title")],["id",()=>vo(Vt(t,"name")||t.id)]]),mx=t=>hu([["aria",()=>Ad(t)],["label",()=>ox(t)],["placeholder",()=>Vt(t,"placeholder")],["title",()=>Vt(t,"title")],["id",()=>vo(Vt(t,"name")||t.id)],["type",()=>ux(t)]]),cE=t=>Vt(t,"role")==="combobox"&&!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement),px=t=>t.hasAttribute("data-placeholder")?"":An(oE(t,"[aria-hidden=true]").join("")),gx=(t,e)=>{if(!Jk.has(Vt(t,"role")))return null;let n=t.closest("[role=listbox], [role=menu]");if(!n?.id)return null;let i=CSS.escape(n.id);return e.querySelector(`[aria-controls~="${i}"], [aria-owns~="${i}"]`)},vx=t=>{let e=Vt(t,"type");if(e==="checkbox"||e==="radio")return e;if(cE(t))return "combobox";let n=Vt(t,"autocomplete");if(n&&n!=="off"&&n!=="on")return n;if(e)return e;let i=t.tagName.toLowerCase();return i==="select"||i==="textarea"||i==="input"?i:Vt(t,"role")==="combobox"?"combobox":"text"},Ax=t=>t instanceof HTMLInputElement&&(t.type==="checkbox"||t.type==="radio"),zg=12,yx=t=>{let e=Array.from(t.options).filter(i=>!i.disabled&&i.value!=="").map(i=>An(i.label||i.text,$1)).filter(Boolean);if(e.length<=zg)return e;let n=e.length-zg;return [...e.slice(0,zg),`+${n} more`]},X1=t=>t.disabled===true||Vt(t,"aria-disabled")==="true",bx=t=>{if(Ax(t))return {checked:t.checked};if(!cE(t))return {filled:_x(t)};let e=px(t);return e?{shows:e}:{filled:false}},_x=t=>{let e=t.value;return typeof e=="string"?e.trim().length>0:An(t.textContent||"").length>0},K1=(t,e)=>{let n=Vt(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return i.origin===e.location.origin?i.pathname+i.search:void 0}catch{return}},jg=60,Sx=t=>{if(t.length<=jg)return t;let e=t.split("?")[0];return e.length<=jg?e:`${e.slice(0,jg)}\u2026`},Ex=t=>{for(let e of ["q","url","u"]){let n=t.searchParams.get(e);if(!(!n||!/^https?:\/\//i.test(n)))try{let i=new URL(n);if(i.origin!==t.origin)return i}catch{}}},wx=t=>t.querySelector("cite")?.textContent?.trim().match(/^(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+(?:\.[a-z0-9-]+)+)/i)?.[1]?.toLowerCase(),Mx=(t,e)=>{let n=Vt(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return /^https?:$/.test(i.protocol)?(i.origin===e.location.origin?Ex(i):i)?.hostname.replace(/^www\./,"")??wx(t):void 0}catch{return}},Z1=t=>t.split("?")[0].replace(/\/+$/,"")||"/",Tx=/\s+[—–|·:]\s+/,Cx=(t,e)=>hu([["route",()=>kx(vo(Rx(t.location.pathname)))],["self-link",()=>An(e)],["title",()=>An(t.title.split(Tx)[0]||"")]]),Rx=t=>t.split("/").filter(Boolean).pop()||"",kx=t=>t?t[0].toUpperCase()+t.slice(1):"",xx=(t,e)=>{let n=t;for(let i=0;i<e&&n;i+=1)n=n.parentElement;return n?aE(ha(n,`${nE}, ${iE}, ${Yg}`),uE):""},gd=(t,e=[])=>{let n=new Map;for(let r of t){let a=n.get(r.name);a?a.push(r):n.set(r.name,[r]);}let i=[];for(let r of n.values()){if(r.length===1){i.push(r[0]);continue}let a=Vt(r[0].el,"href");if(a&&r.every(d=>Vt(d.el,"href")===a)){i.push({...r[0],count:r.length});continue}let o=r.map(d=>aE(fE(d.el,e),uE));if(o.every(Boolean)&&new Set(o).size===r.length){r.forEach((d,g)=>{d.name=`${d.name} \u2014 in "${o[g]}"`;}),i.push(...r);continue}let u=false;for(let d=1;d<=fx&&!u;d+=1){let g=r.map(y=>xx(y.el,d));g.some(y=>!y)||new Set(g).size===r.length&&(r.forEach((y,A)=>{y.name=`${y.name} \u2014 ${g[A]}`;}),u=true);}u?i.push(...r):i.push({...r[0],count:r.length});}return i.sort(Wg)},vd=(t,e,n,i,r=false)=>{let a=[],o=[],u=0;for(let d of Array.from(t.querySelectorAll(e))){if(!Qg(d,n)||r&&n&&ix(d,t))continue;let g=r&&n&&tx(d,t),y=i(d);if(g){y.name&&o.push(y.name);continue}if(!y.name){u+=1;continue}a.push({el:d,name:y.name,namedBy:y.namedBy});}return {named:a,unnamed:u,covered:o}},Ox=t=>t.length>=2&&/[a-z]/i.test(t),Ix=(t,e,n)=>{let i=[];for(let r of Array.from(t.querySelectorAll(tE))){if(!Qg(r,e)||n.some(o=>o.contains(r)))continue;let a=An(r.textContent||"");Ox(a)&&i.push({el:r,name:a,namedBy:"heading-block"});}return i},Wg=(t,e)=>t.el.compareDocumentPosition(e.el)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Nx=t=>{let e=[];for(let n of t)e.some(r=>r.name===n.name&&(r.el.contains(n.el)||n.el.contains(r.el)))||e.push(n);return e},fE=(t,e)=>{let n="",i="";for(let r of e)r.el.contains(t)?n=r.name:r.el.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING&&(i=r.name);return n||i},Dx=t=>oE(t,sE).join(" ").replace(rE,"").replace(/\s+/g," ").trim(),Lx=(t,e)=>{let n=Array.from(t.primary).sort(([,i],[,r])=>(i.screenPosition?0:1)-(r.screenPosition?0:1)||i.list-r.list||i.position-r.position);return new Map(n.slice(0,e))},J1=({list:t,position:e,screenPosition:n,detail:i})=>({list:t,position:e,...n&&{screenPosition:n},...i&&{detail:i}});function dE(t=document,e=1,n=qg){let i=ex(t),r=new Map,a=[],o={},u={section:0,button:0,link:0,field:0,form:0},d=new Map,g=(j,X)=>{u[X]+=1;let K=`${q1[X]}${u[X]}`;return r.set(K,j),d.set(j,K),K},y=vd(t,eE,i,hx);o.section=y.unnamed;let A=Nx([...y.named,...Ix(t,i,y.named.map(j=>j.el))].sort(Wg)),p=gd(A).slice(0,qk),_=p.filter(j=>j.namedBy!=="landmark");for(let{el:j,name:X,namedBy:K}of _)a.push({handle:g(j,"section"),kind:"section",name:X,namedBy:K});let C=vd(t,nE,i,Q1,true);C.named=C.named.filter(j=>!j.el.matches(Yg));let N=vd(t,iE,i,Q1,true);C.named=C.named.filter(({name:j})=>!Gg.test(j)),N.named=N.named.filter(({name:j})=>!Gg.test(j));let B=vd(t,Yg,i,mx,true);o.button=C.unnamed,o.link=N.unnamed,o.field=B.unnamed;let M=n.groupLists&&i?Y1([...C.named,...N.named],{textOf:Dx,pathOf:j=>K1(j,t)}):null,w=M?Lx(M,n.maxItems):null;if(M&&w){let j=X=>M.primary.has(X.el)&&!w.has(X.el);C.named=C.named.filter(X=>!j(X)),N.named=N.named.filter(X=>!j(X));for(let X of [...C.named,...N.named]){let K=w.get(X.el);K&&(X.name=K.name);}}let R=gd(B.named,p),D=gd(C.named,p),G=gd(N.named,p),ne=Math.min(n.reservedLinks,G.length),U={left:n.maxControls-ne},H=j=>{let X=nx(j.el,t)?0:3;return M?.secondary.has(j.el)?X?7:6:w?.has(j.el)?X:X+(Hg(j.el)?2:1)},ee=j=>{let X=Math.max(0,U.left),K=j.slice(0,X);if(n.preferVisible&&i&&j.length>X){let me=j.map(Ie=>({candidate:Ie,rank:H(Ie)}));me.sort((Ie,We)=>Ie.rank-We.rank),K=me.slice(0,X).map(({candidate:Ie})=>Ie).sort(Wg);}return U.left-=K.length,K};for(let{el:j,name:X,namedBy:K,count:me}of ee(R))a.push({handle:g(j,"field"),kind:"field",name:X,namedBy:K,fieldType:vx(j),...bx(j),...j instanceof HTMLSelectElement&&{options:yx(j)},...me&&{count:me},...X1(j)&&{disabled:true},...md(j,X)&&{sensitive:true}});for(let{el:j,name:X,namedBy:K,count:me}of ee(D)){let Ie=gx(j,t),We=Ie?d.get(Ie):void 0,Dt=w?.get(j);a.push({handle:g(j,"button"),kind:"button",name:X,namedBy:K,...Dt&&{item:J1(Dt)},...We&&{choiceOf:We},...me&&{count:me},...du(j)&&{submits:true},...X1(j)&&{disabled:true}});}let Q=Z1(t.location.pathname),Ee="";U.left+=ne;for(let{el:j,name:X,namedBy:K,count:me}of ee(G)){let Ie=K1(j,t),We=Mx(j,t),Dt=Ie?.includes("?")?Ie.slice(Ie.indexOf("?")):"",Je=!!Ie&&Z1(Ie)===Q&&(!Dt||Dt===t.location.search);Je&&!Ee&&(Ee=X);let Qe=w?.get(j);a.push({handle:g(j,"link"),kind:"link",name:X,namedBy:K,...Qe&&{item:J1(Qe)},...me&&{count:me},...Ie&&!Qe&&!We&&{path:Sx(Ie)},...We&&{site:We},...Je&&{current:true}});}let Ce=new Map(a.map(j=>[r.get(j.handle),j.handle]));for(let j of Array.from(t.querySelectorAll($k))){if(!Qg(j,i))continue;let X=[];for(let[Ie,We]of Ce)j.contains(Ie)&&!We.startsWith(q1.section)&&X.push(We);if(X.length===0)continue;let{name:K,namedBy:me}=hu([["aria",()=>Ad(j)],["heading",()=>lE(j)],["section",()=>fE(j,p)],["id",()=>vo(Vt(j,"name")||j.id)]]);a.push({handle:g(j,"form"),kind:"form",name:K||"form",namedBy:me,children:X});}let{name:Ue,namedBy:Be}=Cx(t,Ee),fe=new Set(a.map(j=>j.item?.list)),ye=M?.lists.filter(j=>fe.has(j.id))??[],ce=[...new Set([...C.covered,...N.covered,...B.covered].filter(j=>!Gg.test(j)))].slice(0,Xk);return {index:{generation:e,url:t.location.pathname+t.location.search,title:An(t.title,Kk),pageName:Ue||"this",pageNamedBy:Be,nodes:a,unnamed:o,...ye.length>0&&{lists:ye},...i&&{covered:ce}},elements:r}}var vE=/^(?:true|yes|y|on|1|check|checked|tick|ticked|select|selected)$/i,Px=/^(?:false|no|n|off|0|uncheck|unchecked|untick|unticked|deselect)$/i,Bx={date:"dates go in as YYYY-MM-DD",time:"times go in as HH:MM, 24-hour","datetime-local":"a date and time goes in as YYYY-MM-DDTHH:MM",month:"a month goes in as YYYY-MM",week:"a week goes in as YYYY-Www",number:"only a plain number fits",range:"only a plain number fits",color:"a colour goes in as #rrggbb"},hE=t=>t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim(),mE=(t,e)=>{let n=t.filter(e);return n.length===1?n[0]:void 0},AE=(t,e,n)=>{let i=hE(n);if(!i)return;let r=a=>e(a).map(hE);return t.find(a=>r(a).includes(i))??mE(t,a=>r(a).some(o=>o.startsWith(i)))??mE(t,a=>r(a).some(o=>o.includes(i)))},Ux=(t,e)=>{let n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptor(n,"value")?.set;i?i.call(t,e):t.value=e;},yE=(t,e)=>{t.focus({preventScroll:true}),Ux(t,e),t.dispatchEvent(new Event("input",{bubbles:true})),t.dispatchEvent(new Event("change",{bubbles:true})),t.blur();},pE=(t,e)=>t.readOnly?{outcome:"read_only"}:(yE(t,e),e&&t.value===""?{outcome:"rejected",detail:Bx[t.type]}:e&&!t.validity.valid?{outcome:"invalid",detail:t.validationMessage}:{outcome:"ok"}),Fx=(t,e)=>{let n=Array.from(t.options).filter(r=>!r.disabled),i=AE(n,r=>[r.value,r.label||r.text],e);return i?(yE(t,i.value),{outcome:"ok"}):{outcome:"no_such_option",detail:n.filter(r=>r.value!=="").map(r=>r.label||r.text).join(", ")}},gE=t=>t.labels?.[0]?.textContent?.trim()||t.getAttribute("aria-label")||t.value,Vx=(t,e)=>{let n=t.form??t.ownerDocument,i=t.name?Array.from(n.querySelectorAll(`input[type=radio][name="${CSS.escape(t.name)}"]`)):[t],r=AE(i,a=>[a.value,gE(a)],e)??(vE.test(e.trim())?t:void 0);return r?r.disabled?{outcome:"disabled"}:(r.checked||r.click(),r.checked?{outcome:"ok"}:{outcome:"rejected"}):{outcome:"no_such_option",detail:i.map(gE).join(", ")}},Hx=(t,e)=>{let n=vE.test(e.trim())?true:Px.test(e.trim())?false:void 0;return n===void 0?{outcome:"rejected",detail:'a tick box takes "yes" or "no"'}:(t.checked!==n&&t.click(),t.checked===n?{outcome:"ok"}:{outcome:"rejected"})},Gx=(t,e)=>(t.focus({preventScroll:true}),window.getSelection()?.selectAllChildren(t),(e?document.execCommand("insertText",false,e):document.execCommand("delete"))||(t.textContent=e,t.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:e}))),t.blur(),{outcome:"ok"}),bE=(t,e)=>t instanceof HTMLSelectElement?Fx(t,e):t instanceof HTMLTextAreaElement?pE(t,e):t instanceof HTMLInputElement?t.type==="radio"?Vx(t,e):t.type==="checkbox"?Hx(t,e):t.type==="file"?{outcome:"not_fillable"}:pE(t,e):t instanceof HTMLElement&&t.isContentEditable?Gx(t,e):{outcome:"not_fillable"},zx=t=>"willValidate"in t&&t.willValidate,jx=(t,e)=>{let n=Array.from(t.elements).find(r=>zx(r)&&!r.validity.valid);if(!n)return;let i=n.validationMessage||"still needs a valid value";return `"${e(n)}": ${i}`},_E=(t,e,n=false)=>{let i=t.form;if(i&&!i.noValidate&&!t.formNoValidate){let u=jx(i,e);if(u)return {outcome:"invalid",detail:u}}let r=false,a=false,o=u=>{r=true,a=u.defaultPrevented,n||u.preventDefault();};window.addEventListener("submit",o);try{t.click();}finally{window.removeEventListener("submit",o);}return !r||a||n?{outcome:"ok"}:{outcome:"requires_reload"}};var Yx=new Set(["date","time","datetime-local","month","week","color"]),Wx=t=>{let e=t.getBoundingClientRect();return {clientX:e.left+e.width/2,clientY:e.top+e.height/2}},mu=(t,e,n,i)=>{let r={bubbles:true,cancelable:true,composed:true,view:window,button:0,buttons:i?1:0,...n};return e.startsWith("pointer")?typeof PointerEvent!="function"?true:t.dispatchEvent(new PointerEvent(e,{...r,pointerId:1,pointerType:"mouse",isPrimary:true})):t.dispatchEvent(new MouseEvent(e,r))},Xg=t=>{let e=Wx(t),n=mu(t,"pointerdown",e,true),i=mu(t,"mousedown",e,true);n&&i&&t instanceof HTMLElement&&t.focus({preventScroll:true}),mu(t,"pointerup",e,false),mu(t,"mouseup",e,false),t instanceof HTMLElement?t.click():mu(t,"click",e,false);},qx=t=>{if(t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&Yx.has(t.type))try{t.showPicker?.();}catch{}},SE=t=>{Xg(t),qx(t);};var Ao=0,Xa=0,yd=null,Qx=()=>{let t=yd;if(yd=null,t==="forward"){Ao+=1,Xa=Math.max(0,Xa-1);return}t==="back"?Xa+=1:Xa=0,Ao=Math.max(0,Ao-1);},Kg={canGo:t=>t==="back"?Ao>0:Xa>0,go(t){yd=t,t==="back"?window.history.back():window.history.forward();}};function EE(t){if(typeof window>"u")return ()=>{};let e=null,n=()=>{e&&clearTimeout(e),e=setTimeout(t,500);};Ao=0,Xa=0,yd=null;let{pushState:i,replaceState:r}=window.history,a=(g,y)=>function(...A){let p=g.apply(this,A);return y&&(Ao+=1,Xa=0),n(),p},o=()=>{Qx(),n();},u=a(i,true),d=a(r,false);return window.history.pushState=u,window.history.replaceState=d,window.addEventListener("popstate",o),window.addEventListener("hashchange",n),()=>{e&&clearTimeout(e),window.history.pushState===u&&(window.history.pushState=i),window.history.replaceState===d&&(window.history.replaceState=r),window.removeEventListener("popstate",o),window.removeEventListener("hashchange",n);}}var Xx=.8,Kx="l",ev="b",Zg="f",CE="s",Zx=new Set([CE,ev]),yo=t=>/^([a-z]{1,4})\d{1,4}$/.exec(t)?.[1]??"",Jx=/\s+—\s+.*$/,Jg=t=>t.toLowerCase().replace(/\s+/g," ").trim(),$x=t=>{try{return new URL(t,window.location.href).origin===window.location.origin}catch{return false}},wE=t=>t.replace(/\/+$/,"")||"/",eO=t=>{try{return wE(new URL(t,window.location.href).pathname)===wE(window.location.pathname)}catch{return false}},ME=(t,e,n)=>{let i=false,r=o=>{i=o.defaultPrevented,e||o.preventDefault();};window.addEventListener("click",r);try{t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));}finally{window.removeEventListener("click",r);}if(i||e)return "ok";let a=t.href;return n===void 0||!a?"requires_reload":(setTimeout(()=>window.location.assign(a),n),"ok")},$g=t=>t.matches(":disabled")||t.getAttribute("aria-disabled")==="true",tO=new Set(["back","forward"]),RE=t=>Kg.canGo(t)?(Kg.go(t),"ok"):"no_history",nO=t=>{let e=window.navigation;return e?(t==="back"?!e.canGoBack:!e.canGoForward)?"no_history":(t==="back"?e.back():e.forward(),"ok"):RE(t)},iO=()=>{let t=document.documentElement;return {x:Math.max(0,t.scrollWidth-window.innerWidth),y:Math.max(0,t.scrollHeight-window.innerHeight)}},TE=(t,e,n,i)=>{if(!t)return e;if(t.relative){let r=t.percent?i*t.value/100:t.value;return e+r}return t.percent?n*t.value/100:t.value},rO=t=>{let e=iO();if(t.kind==="edge"){let n=t.edge==="top"?0:t.edge==="bottom"?e.y:e.y/2;window.scrollTo({top:n,behavior:"smooth"});return}if(t.kind==="step"){let n=window.innerHeight*Xx;window.scrollBy({top:t.direction==="up"?-n:n,behavior:"smooth"});return}window.scrollTo({left:TE(t.x,window.scrollX,e.x,window.innerWidth),top:TE(t.y,window.scrollY,e.y,window.innerHeight),behavior:"smooth"});};function aO(t={}){let e=t.survivesDocumentLoad??false,n=t.indexProfile??qg,i=t.followLinksAnywhere??false,r=t.documentLoadAfterMs,a=null,o=(y,A)=>!a||a.generation!==A?null:a.elements.get(y)??null,u=y=>{let A=a?.elements.get(y);return A?.isConnected?{element:A,isSection:yo(y)===CE}:null},d=y=>a?.generation===y?"unknown_target":"stale",g=y=>{for(let[A,p]of a?.elements??[])if(p===y)return a?.names.get(A)??A;return y.labels?.[0]?.textContent?.trim()||y.getAttribute("aria-label")||y.getAttribute("placeholder")||y.getAttribute("name")||"a field"};return {elementNamed(y){let A=Jg(y);if(!a||!A)return null;let p=null;for(let[_,C]of a.names)if(Zx.has(yo(_))){if(Jg(C)===A)return u(_);!p&&Jg(C.replace(Jx,""))===A&&(p=_);}return p?u(p):null},read(y){let{index:A,elements:p}=dE(document,y,n),_=new Map(A.nodes.map(C=>[C.handle,C.name]));return a={generation:y,elements:p,names:_},A},retag(y){a&&(a.generation=y);},scroll(y,A){let p=Bg(y);if(p)return rO(p),"ok";if(A===void 0)return "unknown_target";let _=o(y,A);return _?_.isConnected?(_.scrollIntoView({behavior:"smooth",block:"start"}),"ok"):"stale":d(A)},navigate(y,A){if(tO.has(y)){let N=y;return e?nO(N):RE(N)}if(A===void 0)return "unknown_target";if(yo(y)!==Kx)return "not_navigable";let p=o(y,A);if(!p)return d(A);if(!p.isConnected)return "stale";let _=p.getAttribute("href");if(!_)return "not_navigable";let C=$x(_);return !C&&!i?"not_navigable":C&&eO(_)?"already_here":ME(p,e,r)},click(y,A){if(A===void 0)return "unknown_target";let p=yo(y);if(p!==ev&&p!==Zg)return "not_clickable";let _=o(y,A);return _?_.isConnected?du(_)?"submits_form":$g(_)?"disabled":(_.scrollIntoView({behavior:"smooth",block:"center"}),p===Zg?(SE(_),"ok"):_.closest("a[href]")?ME(_,e,r)==="ok"?"ok":"requires_reload":(Xg(_),"ok")):"stale":d(A)},fill(y,A){let p=false;return y.map(({handle:_,value:C})=>{let N=a?.names.get(_)??_,B=(D,G)=>({handle:_,name:N,outcome:D,...G&&{detail:G}});if(A===void 0)return B("unknown_target");if(yo(_)!==Zg)return B("not_fillable");let M=o(_,A);if(!M)return B(d(A));if(!M.isConnected)return B("stale");if(md(M,N))return B("sensitive");if($g(M))return B("disabled");p||(M.scrollIntoView({behavior:"smooth",block:"center"}),p=true);let{outcome:w,detail:R}=bE(M,C);return B(w,R)})},submit(y,A){if(A===void 0)return {outcome:"unknown_target"};if(yo(y)!==ev)return {outcome:"not_a_submit"};let p=o(y,A);return p?p.isConnected?du(p)?$g(p)?{outcome:"disabled"}:(p.scrollIntoView({behavior:"smooth",block:"center"}),_E(p,g,e)):{outcome:"not_a_submit"}:{outcome:"stale"}:{outcome:d(A)}}}}var kE=aO();var nv=Se(gu());var Ht=Se(gu()),Vi=(t,e)=>{let n=[...e?[e]:[],...t.stateMachineNames??[]];for(let i of n){let r;try{r=t.stateMachineInputs(i);}catch{r=void 0;}if(r?.length)return {name:i,inputs:r}}return {name:null,inputs:[]}},bd=(t,e)=>{let n;switch(t?.fit){case "fill":n=Ht.Fit.Fill;break;case "cover":n=Ht.Fit.Cover;break;case "fitWidth":n=Ht.Fit.FitWidth;break;case "fitHeight":n=Ht.Fit.FitHeight;break;case "none":n=Ht.Fit.None;break;case "scaleDown":n=Ht.Fit.ScaleDown;break;case "layout":n=Ht.Fit.Layout;break;default:n=Ht.Fit.Contain;}e&&(n=Ht.Fit.Contain);let i;switch(t?.alignment){case "topLeft":i=Ht.Alignment.TopLeft;break;case "topCenter":i=Ht.Alignment.TopCenter;break;case "topRight":i=Ht.Alignment.TopRight;break;case "centerLeft":i=Ht.Alignment.CenterLeft;break;case "centerRight":i=Ht.Alignment.CenterRight;break;case "bottomLeft":i=Ht.Alignment.BottomLeft;break;case "bottomCenter":i=Ht.Alignment.BottomCenter;break;case "bottomRight":i=Ht.Alignment.BottomRight;break;default:i=Ht.Alignment.Center;}return new Ht.Layout({fit:n,alignment:i})};var sO=100,oO=.001,lO=21,OE=t=>{let e=Wa(t);return e!==null&&e<=lO},uO=t=>t.type===nv.StateMachineInputType.Trigger?"trigger":t.type===nv.StateMachineInputType.Boolean?"boolean":"number",cO=(t,e)=>{let{name:n,inputs:i}=Vi(t,e),r=i.map(a=>{let o=uO(a);return {path:a.name,kind:o,source:"input",isViseme:o==="number"&&OE(a.name),read:()=>o==="trigger"?null:a.value}});return {stateMachine:n,probes:r}},fO=(t,e,n,i)=>{let r={path:i,source:"property",isViseme:false};switch(n){case "number":{let a=t.number(e);return a&&{...r,kind:"number",isViseme:OE(e),read:()=>a.value}}case "boolean":{let a=t.boolean(e);return a&&{...r,kind:"boolean",read:()=>a.value}}case "string":{let a=t.string(e);return a&&{...r,kind:"string",read:()=>a.value}}case "color":{let a=t.color(e);return a&&{...r,kind:"color",read:()=>a.value}}case "enumType":{let a=t.enum(e);return a&&{...r,kind:"enum",read:()=>a.value}}case "trigger":{let a=t.trigger(e);return a&&{...r,kind:"trigger",read:()=>null,property:a}}default:return null}},IE=(t,e="")=>t.properties.flatMap(({name:n,type:i})=>{let r=e?`${e}/${n}`:n;if(i==="viewModel"){let o=t.viewModel(n);return o?IE(o,r):[]}let a=fO(t,n,i,r);return a?[a]:[]}),dO=(t,e)=>typeof t=="number"&&typeof e=="number"?Math.abs(t-e)>oO:t!==e,xE=({read:t,property:e,...n},i)=>({...n,value:i}),iv=class{constructor(e,n){this.target=e;this.emit=n;this.last=new Map;this.unreadable=new Set;this.triggerHandlers=new Map;this.timer=null;this.sample=()=>{for(let e of this.probes){if(e.kind==="trigger")continue;let n=this.read(e);if(n===void 0)continue;let i=this.last.get(e)??null;dO(n,i)&&(this.last.set(e,n),this.emit({type:"change",value:xE(e,n),previous:i}));}};let i=cO(e.rive,e.stateMachine),r=e.rive.viewModelInstance;this.stateMachine=i.stateMachine,this.probes=[...i.probes,...r?IE(r):[]];}snapshot(){let e=this.probes.flatMap(n=>{let i=this.read(n);return i===void 0?[]:[xE(n,i)]});return {type:"snapshot",binding:this.target.binding,stateMachine:this.stateMachine,values:e}}start(){if(!this.timer){for(let e of this.probes){let n=this.read(e);n!==void 0&&this.last.set(e,n);}this.listenForTriggers(),this.timer=setInterval(this.sample,sO);}}stop(){this.timer&&clearInterval(this.timer),this.timer=null;for(let[e,n]of this.triggerHandlers)e.property?.off(n);this.triggerHandlers.clear();}listenForTriggers(){for(let e of this.probes){if(!e.property)continue;let n=()=>this.emit({type:"trigger",path:e.path,source:"property"});e.property.on(n),this.triggerHandlers.set(e,n);}}read(e){if(!this.unreadable.has(e))try{return e.read()}catch(n){this.unreadable.add(e),T.warn("RigActivity",`can't read "${e.path}", skipping it`,{error:String(n)});return}}},_d=class{constructor(){this.listeners=new Set;this.watcher=null;this.subscribe=e=>(this.listeners.add(e),this.watcher&&(this.watcher.start(),e(this.watcher.snapshot())),()=>{this.listeners.delete(e),this.listeners.size===0&&this.watcher?.stop();});this.emit=e=>{for(let n of this.listeners)try{n(e);}catch(i){T.warn("RigActivity","a listener threw",{error:String(i)});}};}attach(e){this.detach();try{this.watcher=new iv(e,this.emit);}catch(n){T.warn("RigActivity","could not read the rig",{error:String(n)});return}this.listeners.size!==0&&(this.watcher.start(),this.emit(this.watcher.snapshot()));}detach(){this.watcher&&(this.watcher.stop(),this.watcher=null,this.emit({type:"detached"}));}reportTrigger(e){this.listeners.size&&this.emit({type:"trigger",path:e,source:"input"});}reportGesture(e,n){this.listeners.size&&this.emit({type:"gesture",name:e,target:n});}reportWrite(e,n,i){this.listeners.size&&this.emit({type:"write",path:e,value:n,landed:i});}};var NE=7e3,hO=()=>{if(typeof window>"u")return false;try{return window.self!==window.top}catch{return true}},mO=(t,e,n,i)=>{let r=(0, q.useMemo)(()=>Yl(t),[t]),a=r.environment==="meeting",o=(0, q.useRef)(null),u=(0, q.useRef)(e),[d,g]=(0, q.useState)("idle"),[y,A]=(0, q.useState)("none"),[p,_]=(0, q.useState)("idle"),[C,N]=(0, q.useState)(null),[B,M]=(0, q.useState)(false),[w,R]=(0, q.useState)(null),[D,G]=(0, q.useState)(false),[ne,U]=(0, q.useState)(null),[H,ee]=(0, q.useState)(false),Q=(0, q.useRef)(null),Ee=(0, q.useRef)(null),Ce=(0, q.useRef)(null),Ue=(0, q.useRef)(null),Be=(0, q.useRef)(null),fe=(0, q.useRef)(null),ye=(0, q.useRef)(null),ce=(0, q.useRef)(null);ce.current||(ce.current=new ld);let[j,X]=(0, q.useState)(null),[K,me]=(0, q.useState)("user"),[Ie,We]=(0, q.useState)(false),[Dt,Je]=(0, q.useState)("idle"),[Qe,qt]=(0, q.useState)(0),[en,Et]=(0, q.useState)(0),[kn,Lt]=(0, q.useState)(false),[wn,Xe]=(0, q.useState)(false),[Ne,Un]=(0, q.useState)(false),[Mn,xn]=(0, q.useState)(false),[Qt,tn]=(0, q.useState)(false),[It,Pt]=(0, q.useState)(false),[lt,Re]=(0, q.useState)(false),[b,c]=(0, q.useState)(0),[m,E]=(0, q.useState)(0),x=(0, q.useRef)(0),L=(0, q.useRef)(0),z=(0, q.useRef)(null),ae=(0, q.useRef)([]),[be,re]=(0, q.useState)(0),pe=(0, q.useRef)(0),tt=(0, q.useMemo)(()=>new _d,[]),Ke=(0, q.useRef)(null);Ke.current||(Ke.current=ru([]));let De=Ke.current,wt=(0, q.useRef)(null);wt.current||(wt.current=ru(null));let Gt=wt.current,Fe=(0, q.useRef)(null),[zt,Mt]=(0, q.useState)(null),Tt=(0, q.useRef)(null);Tt.current||(Tt.current=ru({services:{ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},concern:null}));let ve=Tt.current,[ki,Fn]=(0, q.useState)("normal");o.current||(o.current=new eu(r,{cache:Vg,urlResolver:z1,pageSurface:u.current?.surface??(n||a?void 0:kE),pageBeforeLive:u.current?.pageBeforeLive,browser:u.current?.browser,framed:hO(),embedHostOrigin:n,embedResume:i,readsMood:true,reportsMicPipeline:true}));let I=o.current,vi=I.isPushToTalk();!fe.current&&(r.mode??"call")==="call"&&!vi&&r.turnTaking?.clientBargeIn!==false&&(fe.current=new fu(I,S1,{echoGate:r.turnTaking?.echoGate}),fe.current.prefetch()),fe.current?.setSpeaking(B);let wr=(0, q.useCallback)(()=>{if(!Ce.current){let oe=new ud;oe.subscribe(()=>{X(oe.getStream()),me(oe.getFacing()),We(oe.isSessionOpen);}),oe.onStateChange(et=>I.sendCameraState(et)),Ce.current=oe;}return Ce.current},[I]),Vn=(0, q.useCallback)(()=>{Ue.current?.stop(),Ce.current?.stop(),Ce.current=null;},[]),xi=(0, q.useCallback)(()=>(Ue.current??(Ue.current=new cd({getVideo:()=>Ce.current?.getVideoElement()??null,isUserSpeaking:()=>fe.current?.isUserVoiced()??false,onReading:oe=>I.reportMood(oe),cache:Vg})),Ue.current),[I]),le=(0, q.useCallback)(()=>{if(!Be.current){let oe=new fd({onStatus:(et,Ct,Xi)=>I.reportScreenStatus(et,Ct,Xi),onState:et=>I.sendScreenState(et),onFrame:et=>I.sendScreenFrame(et)});oe.subscribe(()=>Je(oe.currentPhase)),Be.current=oe;}return Be.current},[I]),Hn=(0, q.useCallback)(()=>{Be.current?.dispose(),Be.current=null,Je("idle");},[]),Mr=(0, q.useCallback)(async()=>{let oe=Ce.current;oe&&await oe.setVideoEnabled(!oe.isActive);},[]);(0, q.useEffect)(()=>{if(I)return z.current&&(clearTimeout(z.current),z.current=null),I.load(),()=>{z.current=setTimeout(()=>{I.dispose(),fe.current?.dispose(),ce.current?.release();},0);}},[I]);let pa=r.avatar?.avatarId||"default";(0, q.useEffect)(()=>{I.setAvatarId(pa)&&(R(null),Mt(null),Fn("normal"),U(null),G(false));},[I,pa]),(0, q.useEffect)(()=>{if(!I)return;let oe=I.on("session-phase",ue=>{g(ue),ue==="connecting"&&(R(null),Mt(null),Fn("normal"),qt(Le=>Le+1));}),et=I.on("paint-phase",A),Ct=I.on("turn-phase",ue=>{_(ue),(ue==="listening"||ue==="idle")&&Lt(false);}),Xi=I.on("talking-armed",Xe);g(I.getSessionPhase()),A(I.getPaintPhase()),_(I.getTurnPhase()),Xe(I.getTalkingArmed());let Fd=I.on("speak",ue=>{N(ue),M(true);}),Vd=I.on("interrupt",()=>{Q.current?.reset(),N(null),M(false),Lt(false),ae.current=[];}),us=I.on("speech-cancelled",()=>{Q.current?.reset(),M(false),Lt(false),ae.current=[];}),Ou=I.on("avatar_thinking",()=>{Lt(true),E(ue=>ue+1);}),cs=I.on("avatar_slow_response",Un),Iu=I.on("mic-start",async ue=>{fe.current?.ensureInit();try{Ee.current=await p1(ue,Le=>{let on=fe.current;if(!on){I.sendPcmChunk(Le.buffer);return}for(let hs of on.releaseUplinkFrames(Le))I.sendPcmChunk(hs.buffer);},{sampleRate:16e3,onFloat32:Le=>fe.current?.pushPcm(Le),onBlocked:a?()=>I.reportAudioBlocked("mic"):void 0,onSettled:()=>I.reportMicPipelineSettled()});}catch{fe.current?.disable("mic_pipeline_failed"),I.reportMicPipelineSettled();}}),Sa=()=>{let ue=Date.now();ue-x.current<gg||(x.current=ue,c(Le=>Le+1));},Hd=I.on("user-partial",ue=>{fe.current?.onPartialTranscript(ue),ue.trim()&&Sa();}),Gd=I.on("user-speaking",Sa),sn=I.on("user-voice",Sa),Nu=I.on("mic-muted",ue=>{xn(ue),fe.current?.setMicMuted(ue);}),bi=I.on("speaker-muted",ue=>{tn(ue),ye.current?.setMuted(ue);}),zd=I.on("mood-detection",Pt),fs=I.on("ptt-held",Re),Ea=ue=>{let Le=ye.current??(ye.current=new od(ce.current));Le.setMuted(I.getSpeakerMuted()),Le.start(ue);},Oo=I.on("connect-tone",(ue,Le)=>{if(ue==="start"){Le&&Ea(Le);return}ye.current?.stop(r.connectTone?.fadeOutMs);}),Io=I.getPendingConnectTone();Io&&(T.debug("SDK","connect-tone was already ringing on listener attach"),Ea(Io));let No=I.on("avatar-ready",()=>{G(true);}),jd=I.on("gesture",(ue,Le,on)=>{pe.current++,T.debug("SDK","gesture: received",{name:ue,atMs:Le,speechless:on,token:pe.current}),ae.current.push({name:ue,token:pe.current,atMs:Le,speechless:on}),re(pe.current);}),Yd=I.on("beep",(ue,Le)=>{pe.current++,ae.current.push({name:"beep",beep:true,token:pe.current,atMs:ue,speechless:Le}),re(pe.current);}),Do=I.on("vision-request",async ue=>{if(!r.perception?.camera){I.reportPerceptionOutcome("unavailable",ue);return}let Le=wr();if(Le.isActive){I.reportPerceptionOutcome("granted",ue,{hasHistory:Le.hasHistory(),feed:"live"});let Uu=await Le.waitForFrames(NE);Uu.length&&I.sendVisionFrames(Uu,ue);return}if(Le.isVideoOff){I.reportPerceptionOutcome("granted",ue,{hasHistory:false,feed:"off"});return}await Le.willPrompt()&&I.reportPerceptionOutcome("prompting",ue);let on=await Le.ensureCamera();if(on!=="granted"){I.reportPerceptionOutcome(on,ue);return}I.reportPerceptionOutcome("granted",ue,{hasHistory:Le.hasHistory(),feed:Le.feed});let hs=await Le.waitForFrames(NE);hs.length&&I.sendVisionFrames(hs,ue);}),Wd=I.on("camera-flip",async(ue,Le)=>{let on=Ce.current?await Ce.current.flip(ue):"unavailable";on==="switched"||on==="unchanged"?I.reportCommandStatus("flip_camera",Le,"ok"):on==="unavailable"?I.reportCommandStatus("flip_camera",Le,"unsupported","requested camera is not available"):I.reportCommandStatus("flip_camera",Le,"failed","could not switch camera");}),qd=I.on("camera-close",async ue=>{try{await Ce.current?.setVideoEnabled(!1),I.reportCommandStatus("close_camera",ue,"ok");}catch{I.reportCommandStatus("close_camera",ue,"failed","could not turn camera off");}}),Du=I.on("camera-open",async ue=>{try{await Ce.current?.setVideoEnabled(!0),I.reportCommandStatus("open_camera",ue,"ok");}catch{I.reportCommandStatus("open_camera",ue,"failed","could not turn camera on");}}),Qd=I.on("screen-request",(ue,Le)=>{le().request(ue,Le);}),Xd=I.on("screen-stop",ue=>{Be.current?.stop(),I.reportCommandStatus("stop_screen",ue,"ok");}),Kd=I.on("transcript",De.set),Zd=I.on("action-flow",Gt.set),Jd=I.on("notice",ue=>{Mt(ue);}),$d=I.on("health",ue=>{ve.set(ue);}),Lu=I.on("visual",ue=>{Fn(ue);}),ds=I.on("error",R),Pu=I.getAvatarConfig();Pu&&U(Pu);let Bu=I.on("avatar-config",ue=>{T.debug("SDK","Received avatar config subscription update",ue),U(ue);}),eh=I.on("connection-status",ue=>{ee(ue),ue||(Ee.current&&(Ee.current.stop(),Ee.current=null),fe.current?.reset(),Vn(),Hn(),N(null),M(false),Lt(false),Re(false),qt(Le=>Le+1));});return ()=>{oe(),et(),Ct(),Xi(),Fd(),Vd(),us(),Ou(),cs(),Iu(),Hd(),Gd(),sn(),Nu(),bi(),zd(),fs(),Oo(),No(),jd(),Yd(),Do(),Wd(),qd(),Du(),Qd(),Xd(),Kd(),Zd(),Jd(),$d(),Lu(),ds(),Bu(),eh(),Ee.current?.stop(),Ee.current=null,fe.current?.reset(),Vn(),Hn(),ye.current?.destroy(),ye.current=null;}},[I,wr,Vn,le,Hn]);let ti=(0, q.useCallback)(()=>(M(false),Lt(false),N(null),I.notifyPlaybackEnded(),I.getTurnPhase()==="thinking"),[I]),zi=(0, q.useCallback)(oe=>{Vn(),Hn(),I.stop({intentionalClose:true,code:4001,reason:oe||"Manual disconnect"});},[I,Vn,Hn]),es=(0, q.useCallback)(()=>I.markRiveReady(),[I]),ji=(0, q.useCallback)(oe=>{if(L.current<1){L.current++,Et(et=>et+1);return}L.current=0,I.notifyAvatarLoadError(oe);},[I]),Tr=(0, q.useRef)(new Map),Z=(0, q.useCallback)((oe,et)=>{let Ct;switch(oe){case "start":Ct=I.on("connection-status",Xi=>{Xi&&et();});break;case "stop":Ct=I.on("connection-status",Xi=>{Xi||et();});break;case "interrupt":Ct=I.on("interrupt",et);break;case "error":Ct=I.on("error",et);break;case "speaking":Ct=I.on("speak",()=>{et();});break;case "ready":Ct=I.on("avatar-ready",et);break;case "notice":Ct=I.on("notice",et);break;case "health":Ct=I.on("health",et);break;case "transcript":Ct=I.on("transcript",et);break;default:return}Tr.current.set(et,Ct);},[I]),de=(0, q.useCallback)((oe,et)=>{let Ct=Tr.current.get(et);Ct&&(Ct(),Tr.current.delete(et));},[]),Ae=(0, q.useCallback)(oe=>{Fe.current=oe;},[]);(0, q.useEffect)(()=>(I.setHeardSpeechProvider(()=>{let oe=[...De.getSnapshot()].reverse().find(Ct=>Ct.speaker==="avatar"),et=Fe.current?.();return !oe||oe.isFinal||et==null?null:Mg(oe,et)}),()=>I.setHeardSpeechProvider(null)),[I,De]);let ke=(0, q.useCallback)(oe=>{Q.current=oe,fe.current?.setPlaybackControls(oe);},[]),$e=(0, q.useCallback)(()=>ce.current?.acquire()??null,[]),Bt=(0, q.useCallback)(oe=>I.setMicMuted(oe),[I]),Ze=(0, q.useCallback)(oe=>I.setSpeakerMuted(oe),[I]),Ve=(0, q.useCallback)(oe=>I.setMoodDetection(oe),[I]),ut=(0, q.useCallback)(()=>I.startTalking(),[I]),dt=(0, q.useCallback)(()=>I.stopTalking(),[I]),rt=(0, q.useCallback)(()=>{ce.current?.warm(),I.start();},[I]),an=(0, q.useRef)(false);(0, q.useEffect)(()=>{!r.autoStart||an.current||(an.current=true,rt(),ce.current?.ensureRunning().then(oe=>{oe||I.reportAudioBlocked("output");}));},[r.autoStart,rt,I]);let Yi=(0, q.useCallback)(()=>zi(),[zi]),Pd=(0, q.useCallback)(()=>I.interrupt(),[I]),ts=(0, q.useCallback)(()=>I.stopSpeaking(),[I]),Eu=(0, q.useCallback)(oe=>I.speakText(oe),[I]),wu=(0, q.useCallback)(oe=>I.speakAudio(oe),[I]),ga=(0, q.useCallback)(oe=>I.setLipSyncTuning(oe),[I]),Mu=(0, q.useCallback)(oe=>I.play(oe),[I]),Wi=(0, q.useCallback)(oe=>I.addLiveContext(oe),[I]),To=(0, q.useCallback)(oe=>I.notify(oe),[I]),va=(0, q.useCallback)(()=>I.readPage(),[I]),Cr=(0, q.useCallback)(oe=>I.registerAction(oe),[I]),Co=(0, q.useCallback)((...oe)=>I.sendActionUi(...oe),[I]),Ai=(0, q.useCallback)(()=>I.requestTour(),[I]),we=(0, q.useCallback)(()=>I.skipNextGreeting(),[I]),Gn=(0, q.useCallback)(oe=>I.on("speak",oe),[I]),yi=(0, q.useCallback)(oe=>I.on("widget-command",oe),[I]),Tu=(0, q.useCallback)((oe,et)=>I.reportCommandStatus("widget_control",oe,et),[I]);(0, q.useEffect)(()=>!H||!I.capabilities?.page.read||!u.current&&n?void 0:(u.current?.watch??EE)(()=>{I.readPage();}),[H,I,n]);let Cu=(0, q.useCallback)(oe=>I.triggerAction(oe),[I]),Ru=(0, q.useCallback)(()=>I.avatarClicked(),[I]),Nt=(0, q.useMemo)(()=>ne?.rive?.gestures?Object.keys(ne.rive.gestures):[],[ne]),Aa=(0, q.useMemo)(()=>({enabled:r?.controls?.enabled||false,stopSpeaking:r?.controls?.stopSpeaking||false}),[r?.controls?.enabled,r?.controls?.stopSpeaking]),ns=(0, q.useCallback)(()=>{Mr();},[Mr]),Rr=(0, q.useCallback)(()=>{Ce.current?.flip();},[]),ni=(0, q.useCallback)(()=>I.setMoodDetection(!I.isMoodDetectionOn),[I]),kr=H&&I.canReadMood,qi=(0, q.useMemo)(()=>({stream:j,facing:K,sessionOpen:Ie,toggleVideo:ns,flip:Rr,mood:kr?{on:It,toggle:ni}:null}),[j,K,Ie,ns,Rr,kr,It,ni]),Ro=j!==null&&kr&&It;(0, q.useEffect)(()=>{Ro?xi().start():Ue.current?.stop();},[Ro,xi]),(0, q.useEffect)(()=>()=>Ue.current?.dispose(),[]);let xr=(0, q.useCallback)(()=>Be.current?.shareFromClick(),[]),ya=(0, q.useCallback)(()=>Be.current?.dismiss(),[]),is=(0, q.useCallback)(()=>Be.current?.stop(),[]),ku=(0, q.useMemo)(()=>({phase:Dt,share:xr,dismiss:ya,stop:is}),[Dt,xr,ya,is]),xu=d==="idle",Bd=d==="connecting",ba=d==="active"&&p==="listening",rs=y==="painted"&&D,Or=y==="failed",as=y==="loading"||y==="painted"&&!D,_a=kn||wn||p==="greeting"||!!zt,Qi=r.transcript,Ir=!!Qi?.enabled&&Qi.captions!==false,ss=Qi?.position??"bottom-center",yn=r.statusBanner,Ud=yn?.enabled!==false,ii=yn?.position??"bottom-left",os=r.thinkingIndicator,ls=os?.enabled!==false,ko=os?.position??"top-left",xo=r.screenShare?.position??"top-center";return {isReady:rs,isLoading:as,isConnecting:Bd,isSpeaking:B,isListening:ba,isThinking:kn,isResponseSlow:Ne,isIdle:xu,isFailed:Or,isConnected:H,isMicMuted:Mn,isSpeakerMuted:Qt,setMicMuted:Bt,setSpeakerMuted:Ze,isMoodDetectionAvailable:kr,isMoodDetectionOn:It,setMoodDetection:Ve,isPushToTalk:vi,isTalking:lt,startTalking:ut,stopTalking:dt,on:Z,off:de,start:rt,stop:Yi,interrupt:Pd,stopSpeaking:ts,speakText:Eu,speakAudio:wu,play:Mu,addLiveContext:Wi,notify:To,readPage:va,registerAction:Cr,triggerAction:Cu,setLipSyncTuning:ga,availableActions:Nt,notice:zt,_healthStore:ve,_transcriptStore:De,_actionFlowStore:Gt,_sendActionUi:Co,avatarId:r.avatar?.avatarId,error:w,controls:Aa,_currentJob:C,_onPlaybackEnd:ti,_onRiveReady:es,_onRiveError:ji,_resetToken:Qe,_mode:I.getMode(),_setMountSurface:I.setMountSurface,_onWidgetCommand:yi,_onSpeechJob:Gn,_requestTour:Ai,_skipNextGreeting:we,_reportWidgetStatus:Tu,_riveKey:`${en}:${ne?.rive?.src??""}`,_avatarConfig:ne,_shouldArmTalking:_a,_userActivity:b,_thinkingSignal:m,_speakerMuted:Qt,_gestureQueue:ae,_gestureSignal:be,_avatarClicked:Ru,_lipSyncTuning:I.getLipSyncTuning(),_rigActivity:tt,_visualState:ki,_camera:qi,_screen:ku,_screenSharePosition:xo,_captionsEnabled:Ir,_captionPosition:ss,_statusBannerEnabled:Ud,_statusBannerPosition:ii,_thinkingIndicatorEnabled:ls,_thinkingIndicatorPosition:ko,_speechClockRef:Fe,_registerSpeechClock:Ae,_registerPlaybackControls:ke,_getAudioContext:$e,_spacebarToTalk:r.turnTaking?.spacebar!==false,_environment:r.environment,mode:r.mode||"call"}},DE=mO;var $n=Se(dn()),FE=Se(ze()),vO=(0, $n.createContext)(null),UE=({children:t})=>{let[e,n]=(0, $n.useState)(false),[i,r]=(0, $n.useState)("dormant"),[a,o]=(0, $n.useState)("idle"),u=(0, $n.useRef)(null),d=(0, $n.useCallback)(y=>n(y),[]),g=(0, $n.useMemo)(()=>({isOpen:e,stage:i,setOpen:d,setStage:r,tourState:a,setTourState:o,tourControlsRef:u}),[e,i,d,a]);return (0, FE.jsx)(vO.Provider,{value:g,children:t})};var rv=Se(ze()),VE=(0, Ed.createContext)(null),AO=({config:t,children:e,pageHost:n,embedHostOrigin:i,embedResume:r})=>{let a=DE(t,n,i,r);return (0, rv.jsx)(VE.Provider,{value:a,children:(0, rv.jsx)(UE,{children:e})})},HE=AO;function vu(){let t=(0, Ed.useContext)(VE);if(!t)throw new Error("useAvatar must be used within <AvatarProvider>");return t}var $a=Se(dn());var zE=Se(ze()),yO=({children:t,className:e,style:n})=>(0, zE.jsx)("div",{className:`avatar-shell-root ${e??""}`,style:n,children:t}),GE=yO;var ie=Se(dn()),_u=Se(gu());var jE="EnhancedLipSync",av=100,bO=.55,_O=.35,SO=.45,EO=.4,wd=.04,wO=60,MO=2,YE=64,Md=class{constructor(){this.rive=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.currentValues=new Map;this.inputs=new Map;this.silenceInput=null;this.jawOpen=0;this.lastActiveTime=Ui;this.lastTickTime=0;this.tuning=new yr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/wO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,o=false,u=1/0;for(let _ of this.visemes){let C=_.start-wd,N=_.end+wd;if(u===1/0&&_.start>r&&_.visemeId!==0&&(u=_.start-r),r<C||r>N)continue;let B=_.end-_.start,M=Math.min(.06,B*.45),w=1;if(r<_.start+M?w=(r-C)/(M+wd):r>_.end-M&&(w=(N-r)/(M+wd)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){o=true;let R=a.get(_.visemeId)||0;a.set(_.visemeId,Math.max(R,w));}}let d=0;for(let _ of a.values())d+=_;if(d>1)for(let[_,C]of a)a.set(_,C/d);o&&(this.lastActiveTime=r);let y=r-this.lastActiveTime<this.tuning.holdSec?1:0,A=y>this.jawOpen?bO:_O,p=i*this.tuning.jawSpeed;this.jawOpen+=(y-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0);for(let[_,C]of this.currentValues){let N=a.get(_)||0,M=Math.min(av,N*this.jawOpen*av*this.tuning.openness)-C,w=M>0?SO:EO,R=C+M*(1-Math.pow(1-w,i));this.currentValues.set(_,R);let D=this.inputs.get(_);D&&(D.value=Math.round(R));}if(this.silenceInput){let _=Math.min(r-this.lastActiveTime,u),C=this.tuning.holdSec,N=Math.min(1,Math.max(0,(_-C)/(Gl-C))),B=this.tuning.rest+N*(av-this.tuning.rest);this.silenceInput.value=Math.round((1-this.jawOpen)*B);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i,r){this.clock=n,r&&(this.tuning=r),this.currentValues.clear(),this.jawOpen=0,this.visemes=[],this.lastTickTime=0,this.retarget(e,i);}retarget(e,n){if(this.rive=e,this.inputs.clear(),this.silenceInput=null,!e)return;let{name:i,inputs:r}=Vi(e,n);for(let a of r){let o=Wa(a.name);if(o!==null){if(o===0){this.silenceInput=a,a.value=0;continue}this.inputs.set(o,a),this.currentValues.has(o)||this.currentValues.set(o,0),a.value=Math.round(this.currentValues.get(o)??0);}}this.inputs.size===0?T.error(jE,"no viseme inputs on the rig \u2014 lip-sync will not move",{requestedStateMachine:n??"(unset)",resolvedStateMachine:i,artboardStateMachines:e.stateMachineNames,inputNames:r.map(a=>a.name)}):T.debug(jE,"bound to rig",{stateMachine:i,visemeIds:[...this.inputs.keys()].sort((a,o)=>a-o),silenceInputFound:!!this.silenceInput});}detach(){this.retarget(null);}appendVisemes(e){this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes();}clearVisemes(){this.visemes=[],this.lastActiveTime=Ui;}pruneSpentVisemes(){if(this.visemes.length<=YE||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-MO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-YE),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.tick());}stop(){if(this.running){this.running=false,this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.inputs.values())try{e.value=0;}catch{}if(this.silenceInput)try{this.silenceInput.value=this.tuning.rest;}catch{}this.visemes=[],this.inputs.clear(),this.currentValues.clear(),this.silenceInput=null,this.rive=null,this.clock=null,this.lastTickTime=0;}}forceSilence(){this.lastActiveTime=Ui,this.jawOpen=0;for(let[e,n]of this.inputs)n.value=0,this.currentValues.set(e,0);this.silenceInput&&(this.silenceInput.value=this.tuning.rest);}};var Td=100,TO=.55,CO=.35,RO=.45,kO=.4,Cd=.04,WE=0,xO=0,OO=60,IO=2,qE=64,Ti="DataBindingLipSync",Ka=class{constructor(){this.vmInstance=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.numberProps=new Map;this.currentValues=new Map;this.silenceProp=null;this.formatName=e=>`${e}`;this.jawOpen=0;this.lastActiveTime=Ui;this.lastTickTime=0;this.lastTickLogTime=0;this.silencing=false;this.tuning=new yr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/OO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,o=false;for(let _ of this.visemes){let C=_.start-Cd,N=_.end+Cd;if(r<C||r>N)continue;let B=_.end-_.start,M=Math.min(.06,B*.45),w=1;if(r<_.start+M?w=(r-C)/(M+Cd):r>_.end-M&&(w=(N-r)/(M+Cd)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){o=true;let R=a.get(_.visemeId)??0;a.set(_.visemeId,Math.max(R,w));}}let u=0;for(let _ of a.values())u+=_;if(u>1)for(let[_,C]of a)a.set(_,C/u);o&&(this.lastActiveTime=r);let d=r-this.lastActiveTime<this.tuning.holdSec,g=0;if(!d){for(let _ of this.visemes)if(_.start>r&&_.visemeId!==0){let C=_.start-r;C<WE&&(g=xO*(1-C/WE));break}}let y=d?1:g,A=y>this.jawOpen?TO:CO,p=i*this.tuning.jawSpeed;this.jawOpen+=(y-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0),this.silencing&&this.jawOpen===0&&(this.silencing=false,T.debug(Ti,"tick: silence complete"));for(let[_,C]of this.numberProps){let N=a.get(_)??0,B=Math.min(Td,N*this.jawOpen*Td*this.tuning.openness),M=this.currentValues.get(_)??0,w=B-M,R=w>0?RO:kO,D=M+w*(1-Math.pow(1-R,i)),G=Math.round(D);if(this.currentValues.set(_,D),!!C)try{C.value=G;}catch(ne){T.error(Ti,`tick: failed writing visemeId=${_} value=${G}`,ne);}}try{if(this.silenceProp){let _=Td;if(!this.silencing){let C=r-this.lastActiveTime,N=1/0;for(let R of this.visemes)if(R.start>r&&R.visemeId!==0){N=R.start-r;break}let B=Math.min(C,N),M=this.tuning.holdSec,w=Math.min(1,Math.max(0,(B-M)/(Gl-M)));_=this.tuning.rest+w*(Td-this.tuning.rest);}this.silenceProp.value=Math.round((1-this.jawOpen)*_);}}catch(_){T.error(Ti,"tick: failed writing silence prop",_);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i){this.clock=n,i&&(this.tuning=i);let r=n.getAlignmentTime();this.jawOpen=r>.05?1:0,this.lastActiveTime=this.jawOpen>0?r:Ui,this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.lastTickTime=0,this.lastTickLogTime=0,this.silencing=false,this.retarget(e),T.debug(Ti,"initialize",{initialT:r.toFixed(3),jawPreWarmed:this.jawOpen>0});try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch(a){T.error(Ti,"initialize: failed to set silence prop to rest",a);}this.prepareSpeech();}retarget(e){if(this.vmInstance=e,this.silenceProp=null,!e){for(let r of this.numberProps.keys())this.numberProps.set(r,null);return}let{format:n,shape:i}=cu(r=>{try{return e.number(r)!==null}catch{return !1}});this.formatName=n;for(let r of this.numberProps.keys())this.numberProps.set(r,e.number(this.formatName(r)));this.silenceProp=e.number(this.formatName(0)),T.debug(Ti,"bound to rig",{viewModelName:e.viewModelName??"unknown",visemeNameShape:i,silencePropFound:!!this.silenceProp,trackedIds:this.numberProps.size});}detach(){this.retarget(null);}prepareSpeech(){this.silencing=false;}appendVisemes(e){for(let n of e)if(n.visemeId!==0&&!this.numberProps.has(n.visemeId)){let i=this.vmInstance?.number(this.formatName(n.visemeId))??null;this.numberProps.set(n.visemeId,i),this.currentValues.set(n.visemeId,0);try{i&&(i.value=0);}catch{}}this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes(),T.debug(Ti,"appendVisemes",{newCount:e.length,totalVisemes:this.visemes.length,trackedIds:Array.from(this.numberProps.keys()),nullProps:Array.from(this.numberProps.entries()).filter(([,n])=>!n).map(([n])=>n)});}clearVisemes(){this.visemes=[],this.lastActiveTime=Ui;}pruneSpentVisemes(){if(this.visemes.length<=qE||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-IO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-qE),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.prepareSpeech(),T.debug(Ti,"start"),this.tick());}stop(){if(this.running){this.running=false,T.debug(Ti,"stop"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}interrupt(){if(this.running){this.running=false,T.debug(Ti,"interrupt"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}forceSilence(){this.lastActiveTime=Ui,this.silencing=true,T.debug(Ti,"forceSilence \u2014 jaw decaying naturally");}};var sv=25,NO=.8,DO=.003,LO=300,QE=.7,Rd=class{constructor(e,n){this.alignmentBaseCtxTime=null;this.scheduleCursor=0;this.timeline=new uu;this.decodedQueue=[];this.activeSources=new Set;this.pendingDecodes=0;this.schedulerTimer=null;this.interrupted=false;this.drainTimer=null;this.muted=false;this.paused=false;this.ownsContext=!n,this.ctx=n??new AudioContext,this.gain=this.ctx.createGain(),this.gain.gain.value=QE,this.analyser=this.ctx.createAnalyser(),this.analyser.fftSize=512,this.analyserBuf=new Float32Array(this.analyser.fftSize),this.gain.connect(this.analyser),this.analyser.connect(this.ctx.destination),this.onEnded=e,this.warm(),this.startScheduler();}warm(){try{this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{});let e=this.ctx.createBuffer(1,1,this.ctx.sampleRate),n=this.ctx.createBufferSource();n.buffer=e,n.connect(this.ctx.destination),n.start();}catch{}}setMuted(e){if(this.muted=e,this.ctx.state==="closed")return;let n=e?0:QE,i=this.ctx.currentTime;try{this.gain.gain.cancelScheduledValues(i),this.gain.gain.setValueAtTime(this.gain.gain.value,i),this.gain.gain.linearRampToValueAtTime(n,i+.02);}catch{this.gain.gain.value=n;}}isMuted(){return this.muted}playBeep(){if(this.ctx.state!=="closed")try{let e=this.ctx.currentTime,n=this.ctx.createOscillator(),i=this.ctx.createGain();n.frequency.value=Ag,i.gain.setValueAtTime(0,e),i.gain.linearRampToValueAtTime(Nf,e+Df),i.gain.setValueAtTime(Nf,e+zl-Df),i.gain.linearRampToValueAtTime(0,e+zl),n.connect(i),i.connect(this.gain),n.onended=()=>i.disconnect(),n.start(e),n.stop(e+zl);}catch(e){T.warn("TtsPlayer","beep failed",{err:e});}}enqueueChunk(e,n){if(this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"){this.pendingDecodes++;try{this.decodeBase64(e).then(i=>{this.ctx.state!=="closed"&&(this.decodedQueue.push({buffer:i,alignmentStart:n}),this.decodedQueue.sort((r,a)=>r.alignmentStart-a.alignmentStart));}).catch(()=>{}).finally(()=>this.settleDecode());}catch{this.settleDecode();}}}enqueueSequentialChunk(e){this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"&&(this.pendingDecodes++,this.decodeBase64(e).then(n=>{this.ctx.state!=="closed"&&this.decodedQueue.push({buffer:n,alignmentStart:1/0});}).catch(()=>{}).finally(()=>this.settleDecode()));}settleDecode(){this.pendingDecodes>0&&this.pendingDecodes--,this.maybeArmDrain();}hasPendingAudio(){return this.activeSources.size>0||this.decodedQueue.length>0||this.pendingDecodes>0}maybeArmDrain(){this.interrupted||this.hasPendingAudio()||(this.drainTimer&&clearTimeout(this.drainTimer),this.drainTimer=window.setTimeout(()=>{this.drainTimer=null,!this.interrupted&&!this.hasPendingAudio()&&this.onEnded?.();},LO));}async decodeBase64(e){let n=atob(e),i=new Uint8Array(n.length);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return this.ctx.decodeAudioData(i.buffer)}startScheduler(){let e=()=>{if(this.interrupted||this.ctx.state==="closed")return;if(this.paused){this.schedulerTimer=window.setTimeout(e,sv);return}let n=this.ctx.currentTime,i=false,r=false;if(this.alignmentBaseCtxTime===null){let a=this.decodedQueue[0];if(!a){this.schedulerTimer=window.setTimeout(e,sv);return}let o=a.alignmentStart===1/0?0:a.alignmentStart;this.alignmentBaseCtxTime=n+.1-o,this.scheduleCursor=n+.1,i=true,T.debug("TtsPlayer","alignment clock anchored",{headStart:o,bufferDuration:a.buffer.duration,outputLatency:this.ctx.outputLatency??null,baseLatency:this.ctx.baseLatency??null,queuedChunks:this.decodedQueue.length,ctxState:this.ctx.state});}for(;this.decodedQueue.length>0&&(this.decodedQueue[0].alignmentStart===1/0||this.alignmentBaseCtxTime+this.decodedQueue[0].alignmentStart<n+NO);){let{buffer:a,alignmentStart:o}=this.decodedQueue.shift(),u;o===1/0?u=this.scheduleCursor:(u=this.alignmentBaseCtxTime+o,u<n+.02&&this.activeSources.size===0&&(this.scheduleCursor>0&&n-this.scheduleCursor<1&&T.warn("TtsPlayer","Playback stalled, realigning",{lateBySec:Number((n-u).toFixed(3))}),this.alignmentBaseCtxTime=n+.1-o,u=this.alignmentBaseCtxTime+o,i=true,this.timeline.reanchor()),Math.abs(u-this.scheduleCursor)<.1?u=this.scheduleCursor:u=Math.max(u,this.scheduleCursor)),this.timeline.schedule(u,a.duration,o===1/0?void 0:o),T.debug("TtsPlayer","chunk placed",{alignmentStart:o===1/0?null:o,startAt:Number(u.toFixed(3)),movedBySec:o===1/0?null:Number((u-(this.alignmentBaseCtxTime+o)).toFixed(3)),bufferDuration:Number(a.duration.toFixed(3))});let d=this.ctx.createBufferSource();d.buffer=a;let g=this.ctx.createGain();if(d.connect(g),g.connect(this.gain),u>this.scheduleCursor+.001){let y=Math.min(DO,a.duration/2);g.gain.setValueAtTime(0,u),g.gain.linearRampToValueAtTime(1,u+y);}else g.gain.setValueAtTime(1,u);d.start(u),this.scheduleCursor=u+a.duration,this.activeSources.add(d),r=true,d.onended=()=>{this.activeSources.delete(d),this.activeSources.size===0&&this.emitTimeline(),this.maybeArmDrain();};}(i||r)&&this.emitTimeline(),this.schedulerTimer=window.setTimeout(e,sv);};e();}getAlignmentTime(){return this.timeline.timeAt(this.ctx.currentTime-(this.ctx.outputLatency||0))}getPlayableAlignmentTime(){return this.timeline.playableTime()}getOutputLevel(){if(this.ctx.state==="closed")return 0;try{this.analyser.getFloatTimeDomainData(this.analyserBuf);}catch{return 0}let e=0;for(let n=0;n<this.analyserBuf.length;n++)e+=this.analyserBuf[n]*this.analyserBuf[n];return Math.sqrt(e/this.analyserBuf.length)}isAudioActive(){return this.activeSources.size>0||this.decodedQueue.length>0}isPlaybackScheduled(){return this.activeSources.size>0}pause(){this.paused||this.interrupted||this.ctx.state!=="closed"&&(this.paused=true,this.emitTimeline(),this.ctx.suspend().catch(()=>{}).then(()=>this.emitTimeline()));}isPaused(){return this.paused}resume(){this.paused&&this.ctx.state!=="closed"&&(this.paused=false,this.ctx.resume().catch(()=>{}).then(()=>this.emitTimeline()));}interrupt(){this.interrupted=true,this.paused=false,this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null);for(let e of this.activeSources)try{e.stop();}catch{}this.activeSources.clear(),this.decodedQueue.length=0,this.pendingDecodes=0,this.alignmentBaseCtxTime=null,this.scheduleCursor=0,this.timeline.reset(),this.schedulerTimer&&(clearTimeout(this.schedulerTimer),this.schedulerTimer=null),this.emitTimeline();}emitTimeline(){try{this.onTimeline?.();}catch{}}destroy(){let e=this.paused;this.interrupt();try{this.gain.disconnect(),this.analyser.disconnect();}catch{}if(this.ownsContext){try{this.ctx.state!=="closed"&&this.ctx.close().catch(()=>{});}catch{}return}(e||this.ctx.state==="suspended")&&this.ctx.resume().catch(()=>{});}};var bo=Se(ze());var PO=({label:t="Connecting",className:e,style:n})=>(0, bo.jsxs)("div",{className:`af-loader ${e??""}`,style:n,role:"status","aria-live":"polite","aria-label":`${t}\u2026`,children:[(0, bo.jsx)("span",{className:"af-loader__orb","aria-hidden":"true"}),(0, bo.jsx)("span",{className:"af-loader__letters","aria-hidden":"true",children:Array.from(t).map((i,r)=>(0, bo.jsx)("span",{className:"af-loader__letter",style:{animationDelay:`${r*.1}s`},children:i.trim()===""?"\xA0":i},`${i}-${r}`))})]}),kd=PO;var So=Se(dn()),cw=Se(lv());var aw=Se(lv());var hI=6e4,mI=3,Id="Renderer",rw=false,ma=0,yu="live",uv=0,Au=[],sw=new Set,cv=new WeakMap,fv=new WeakMap,dv=new Set,hv=new Set,mv=()=>{for(let t of dv)t();},pv=t=>{for(let e of hv)try{e(t);}catch(n){T.error(Id,"renderer event listener threw",n);}},pI=(t,e)=>!t.isConnected&&t.width===1&&t.height===1&&typeof e=="object"&&e!==null&&"renderViaOffscreenBackBuffer"in e,gI=()=>{let t=aw.RuntimeLoader;return typeof t.isLoading!="boolean"||!("runtime"in t)?false:(t.runtime=void 0,t.isLoading=false,true)},vI=t=>{for(;Au.length>0&&t-Au[0]>hI;)Au.shift();return Au.length>=mI?false:(Au.push(t),true)},AI=t=>{if(!sw.delete(t)||yu==="unrecoverable")return;let e=`${t.width}x${t.height}`;uv=performance.now(),T.event(Id,"shared context lost",{generation:ma,surface:e}),pv({type:"lost",generation:ma,surface:e});let n=vI(uv)?gI()?null:"runtime-unsupported":"loss-storm";if(n){T.error(Id,"shared context unrecoverable",{generation:ma,reason:n}),yu="unrecoverable",pv({type:"unrecoverable",generation:ma,reason:n}),mv();return}ma+=1,yu="recovering",mv();},yI=(t,e)=>{if(cv.set(t,e),sw.add(t),t.addEventListener("webglcontextlost",()=>AI(t),{once:true}),yu!=="recovering")return;let n=Math.round(performance.now()-uv);T.event(Id,"shared context rebuilt",{generation:ma,recoveryMs:n}),yu="live",pv({type:"recovered",generation:ma,recoveryMs:n}),mv();};function Nd(){if(rw||typeof HTMLCanvasElement>"u")return;rw=true;let t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(n,i){let r=t.call(this,n,i);return n==="webgl2"&&r&&!cv.has(this)&&pI(this,i)&&yI(this,r),r};let e=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(...n){let i=n[0],r=i instanceof HTMLCanvasElement?cv.get(i):void 0;r?.isContextLost()||(r&&fv.set(this.canvas,(fv.get(this.canvas)??0)+1),e.apply(this,n));};}var ow=()=>ma;var lw=t=>fv.get(t)??0;function uw(t){return dv.add(t),()=>{dv.delete(t);}}function Dd(t){return hv.add(t),()=>{hv.delete(t);}}var dw=Se(ze()),bI=({src:t,artboard:e,stateMachine:n,autoBind:i,layout:r,onReady:a,onLoadError:o})=>{(0, So.useEffect)(()=>Nd(),[]);let u=(0, So.useRef)(a);u.current=a;let d=(0, So.useRef)(o);d.current=o;let{rive:g,RiveComponent:y}=(0, cw.useRive)({src:t,autoplay:true,autoBind:i,useOffscreenRenderer:true,layout:r,...e&&{artboard:e},...n&&{stateMachines:n},onLoadError:A=>d.current(A instanceof Error?A:new Error("Rive load failed"))});return (0, So.useEffect)(()=>{g&&u.current(g);},[g]),(0, dw.jsx)(y,{className:"rive-renderer-canvas"})},fw=bI;var gv=(t,e,n)=>{for(let i of e){for(let[r,a]of Object.entries(i.properties))try{if(typeof a=="boolean"){let o=t.boolean(r);o?(o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (boolean)`)):n&&T.error("Renderer",`data-binding: boolean prop "${r}" not found on ${i.name}`);}else if(typeof a=="number"){let o=t.number(r);if(o)o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (number)`);else {let u=t.color(r);u?(u.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (color)`)):n&&T.error("Renderer",`data-binding: prop "${r}" not found as number or color on ${i.name}`);}}else if(typeof a=="string"){let o=t.string(r);if(o)o.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (string)`);else {let u=t.enum(r);u?(u.value=a,n&&T.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (enum)`)):n&&T.error("Renderer",`data-binding: prop "${r}" not found as string or enum on ${i.name}`);}}}catch(o){n&&T.error("Renderer",`data-binding: exception setting ${i.name}.${r}`,o);}n&&T.debug("Renderer","data-binding: appearance overrides applied",{name:i.name});}};var hw=Se(dn());function mw(){return (0, hw.useSyncExternalStore)(uw,ow,()=>0)}var bu=Se(dn());var _I=3,SI=250,EI=(t,e)=>{let n=t?.querySelector("canvas"),i=e?.getContext("2d");return !n||!e||!i||!n.width||!n.height?false:(e.width=n.width,e.height=n.height,i.drawImage(n,0,0),e.hidden=false,true)},wI=t=>{t&&(t.hidden=true,t.width=0,t.height=0);};function pw(t,e,n){let i=(0, bu.useRef)(false);(0, bu.useEffect)(()=>(Nd(),Dd(r=>{r.type!=="lost"||i.current||(i.current=EI(t.current,e.current));})),[t,e]),(0, bu.useEffect)(()=>{if(!n||!i.current)return;let r=_I,a=-1,o=0,u=requestAnimationFrame(function d(g){let y=t.current?.querySelector("canvas"),A=y?lw(y):0;A>a&&(a>=0&&(r-=1),A>0&&!o&&(o=g),a=A);let p=o>0&&g-o>=SI;if(r>0&&!p){u=requestAnimationFrame(d);return}wI(e.current),i.current=false;});return ()=>cancelAnimationFrame(u)},[n,t,e]);}var Wt=Se(ze()),MI=120,TI=8,gw=()=>(0, Wt.jsx)("div",{className:"rive-renderer-loader",children:(0, Wt.jsx)(kd,{label:"Loading"})}),vw=()=>(0, Wt.jsxs)("div",{className:"rive-renderer-error",children:[(0, Wt.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, Wt.jsx)("circle",{cx:"12",cy:"8",r:"3.5"}),(0, Wt.jsx)("path",{d:"M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7"}),(0, Wt.jsx)("line",{x1:"17",y1:"17",x2:"21",y2:"21"}),(0, Wt.jsx)("line",{x1:"21",y1:"17",x2:"17",y2:"21"})]}),(0, Wt.jsx)("span",{className:"rive-renderer-error-text",children:"Avatar unavailable"})]}),CI=({lastResponse:t,onPlaybackEnd:e,className:n,style:i,onRiveReady:r,onRiveError:a,resetToken:o,avatarConfig:u,error:d,loader:g,errorFallback:y,shouldArmTalking:A,isConnected:p,userActivity:_,userAttending:C,isThinking:N,thinkingSignal:B,gestureQueue:M,gestureSignal:w,onAvatarClick:R,lipSyncTuning:D,visualState:G,onSpeechClock:ne,speakerMuted:U,onRegisterPlaybackControls:H,getAudioContext:ee,createSpeechPlayer:Q,fit:Ee,environment:Ce,rigActivity:Ue})=>{let Be=Ce==="meeting",[fe,ye]=(0, ie.useState)(false),[ce,j]=(0, ie.useState)(false),[X,K]=(0, ie.useState)(null),me=mw(),Ie=Ee?{...u?.rive?.layout||{},fit:Ee}:u?.rive?.layout||null,We=bd(Ie,u?.rive?.watermark),Dt=Number(u?.lipSync?.visemeMs)||40,Je=(u?.pipelineMode??"input")==="data-binding",Qe=(0, ie.useRef)(r);Qe.current=r;let qt=(0, ie.useRef)(a);qt.current=a;let en=(0, ie.useCallback)(Z=>{K(Z),ye(true),Qe.current?.();},[]),Et=(0, ie.useCallback)(Z=>{T.error("Renderer","Failed to load Avatar file",Z),j(true),qt.current?.(Z);},[]),kn=(0, ie.useRef)(null),Lt=(0, ie.useRef)(null),wn=(0, ie.useRef)(null);pw(Lt,wn,X);let Xe=(0, ie.useRef)(null),Ne=(0, ie.useRef)(null),Un=(0, ie.useRef)(Q??((Z,de)=>new Rd(Z,de))),Mn=(0, ie.useRef)([]),xn=(0, ie.useRef)(null),Qt=(0, ie.useRef)(0),tn=(0, ie.useRef)(0),It=(0, ie.useRef)(null),Pt=(0, ie.useRef)(null),lt=(0, ie.useRef)(Z=>`${Z}`),Re=(0, ie.useRef)(false);Re.current=!!A;let b=(0, ie.useRef)(false);b.current=!!p,(0, ie.useEffect)(()=>{Ne.current?.setMuted(!!U);},[U]);let c=G==="expired",m=(0, ie.useRef)(false);m.current=c;let E=(0, ie.useRef)(ne);E.current=ne;let x=(0, ie.useCallback)(Z=>{E.current?.(Z);},[]),L=(0, ie.useRef)(ee);L.current=ee;let z=(0, ie.useRef)(H);z.current=H,(0, ie.useEffect)(()=>{let Z={pause:()=>Ne.current?.pause(),resume:()=>Ne.current?.resume(),getOutputLevel:()=>Ne.current?.getOutputLevel()??0,hasPendingAudio:()=>Ne.current?.hasPendingAudio()??false,reset:()=>{xi(),Xe.current instanceof Ka?Xe.current.interrupt():Xe.current?.stop(),Xe.current=null,Ne.current?.destroy(),Ne.current=null,x(null),Qt.current=0,It.current=null,Mt();}};return z.current?.(Z),()=>z.current?.(null)},[]);let ae=(0, ie.useRef)(null);ae.current=X??null;let be=(0, ie.useRef)(void 0);be.current=u?.rive?.stateMachine;let re=(0, ie.useRef)(Je);re.current=Je,(0, ie.useEffect)(()=>Dd(Z=>{Z.type==="lost"&&(Ue?.detach(),Xe.current?.detach(),ae.current?.stopRendering(),ae.current=null,Pt.current=null,K(null));}),[Ue]);let pe=(0, ie.useCallback)((Z,de)=>{try{if(re.current){let $e=Pt.current,Bt=typeof de=="boolean"?$e?.boolean(Z):$e?.number(Z);return Bt?(Bt.value=de,!0):!1}let Ae=ae.current;if(!Ae)return !1;let ke=Vi(Ae,be.current).inputs.find($e=>$e.name===Z);return ke?(ke.value=de,!0):!1}catch{return false}},[]),tt=(0, ie.useCallback)((Z,de)=>{let Ae=pe(Z,de);return (re.current?Pt.current:ae.current)&&Ue?.reportWrite(Z,de,Ae),Ae},[pe,Ue]),Ke=(0, ie.useRef)(null),De=(0, ie.useCallback)(()=>(Ke.current||(Ke.current=new ou(tt)),Ke.current),[tt]),wt=(0, ie.useRef)(null),Gt=(0, ie.useRef)({has:()=>false,fire:()=>{}}),Fe=(0, ie.useCallback)(()=>(wt.current||(wt.current=new su((Z,de)=>De().setMode(Z,de),{},Z=>De().cycle(Z),Z=>De().has(Z),{has:Z=>Gt.current.has(Z),fire:Z=>Gt.current.fire(Z)})),wt.current),[De]),zt=(0, ie.useCallback)(()=>{Fe().busy(),De().setMode("talking");},[Fe,De]),Mt=(0, ie.useCallback)(()=>{Fe().rest(b.current);},[Fe]),Tt=(0, ie.useCallback)(Z=>Z==="talking"?zt():Fe().resume(b.current),[zt,Fe]);(0, ie.useEffect)(()=>()=>wt.current?.dispose(),[]);let ve=u?.performance??null,ki=(0, ie.useRef)(null);(0, ie.useEffect)(()=>{if(ki.current===ve||(ki.current=ve,De().setPolicy(ve),!ve))return;let Z=Fe();Z.configure(ve),Z.current==="busy"?De().setMode("talking"):Z.resume(b.current);},[ve,De,Fe]),(0, ie.useEffect)(()=>{B&&Fe().think();},[B,Fe]),(0, ie.useEffect)(()=>{N||Fe().stopThinking();},[N,Fe]),(0, ie.useEffect)(()=>{_&&Fe().userActivity();},[_,Fe]),(0, ie.useEffect)(()=>{Fe().setAttending(!!C);},[C,Fe]);let Fn=(0, ie.useCallback)(()=>b.current?"listening":"idle",[]),I=(0, ie.useCallback)(()=>Ne.current?.isAudioActive()||Re.current?"talking":Fn(),[Fn]);(0, ie.useEffect)(()=>{if(!X||!fe||!u||!Je)return;T.debug("Renderer","data-binding: init start",{viewModelCount:X.viewModelCount,autoBindInstance:!!X.viewModelInstance});let Z=X.viewModelInstance;if(!Z){T.error("Renderer","data-binding: rive.viewModelInstance is null after autoBind \u2014 check the .riv file has a ViewModel");return}Pt.current=Z;let{format:de,shape:Ae,matched:ke}=cu(Ve=>{try{return Z.number(Ve)!==null}catch{return !1}});lt.current=de,ke?T.debug("Renderer","data-binding: viseme naming detected",{shape:Ae}):T.error("Renderer","data-binding: no viseme props found on the rig \u2014 lip-sync will not move");let $e=I();$e==="talking"&&T.debug("Renderer","data-binding: VM bound mid-turn \u2014 entering talking"),Tt($e);let Bt=u.rive.viewModel??[];gv(Z,Bt,true);let Ze=requestAnimationFrame(()=>gv(Z,Bt,false));return ()=>cancelAnimationFrame(Ze)},[X,fe,u,Je]),(0, ie.useEffect)(()=>{!X||!fe||Je||Tt(I());},[X,fe,Je,Tt,I]),(0, ie.useEffect)(()=>{if(!X||!fe||!u)return;let Z=u.rive.watermark?1:0;try{if(Je){let de=X.viewModelInstance?.number(td);de&&(de.value=Z);}else {let{inputs:de}=Vi(X,u.rive?.stateMachine),Ae=de.find(ke=>ke.name===td);Ae&&(Ae.value=Z);}}catch(de){T.error("Renderer","failed to set Watermark_opacity",de);}},[X,fe,u,Je]),(0, ie.useEffect)(()=>{if(!X||!fe)return;let Z=Xe.current;Z instanceof Ka?Z.retarget(Pt.current):Z&&Z.retarget(X,u?.rive?.stateMachine),Ke.current?.reapply();},[X,fe]);let vi=u?.rive?.stateMachine;(0, ie.useEffect)(()=>{if(!X||!fe||!Ue)return;let Z=Je?"data-binding":"input",de=requestAnimationFrame(()=>{de=requestAnimationFrame(()=>Ue.attach({rive:X,binding:Z,stateMachine:vi}));});return ()=>{cancelAnimationFrame(de),Ue.detach();}},[X,fe,Je,vi,Ue]),(0, ie.useEffect)(()=>{A&&(zt(),T.debug("Renderer","arming talking branch ahead of audio"));},[A,zt]),(0, ie.useEffect)(()=>{Ne.current?.isAudioActive()||p&&Re.current||(p?Fe().connect():Mt());},[p,Mt,Fe]);let wr=(0, ie.useCallback)(Z=>{let de=ae.current;if(!de)return;let{input:Ae,type:ke,value:$e,binding:Bt,resetMs:Ze}=lu(Z,u?.rive?.gestures,Je);T.debug("Renderer","gesture: firing",{name:Z,input:Ae,type:ke,binding:Bt}),Ue?.reportGesture(Z,Ae);try{if(Bt==="data-binding"){let Ve=Pt.current;if(!Ve)return;if(ke==="trigger")Ve.trigger(Ae)?.trigger();else if(ke==="boolean"){let ut=Ve.boolean(Ae);ut&&(ut.value=$e!==0,Ze&&setTimeout(()=>{let dt=Pt.current?.boolean(Ae);dt&&(dt.value=!1);},Ze));}else {let ut=Ve.number(Ae);ut&&(ut.value=$e);}}else {let{name:Ve,inputs:ut}=Vi(de,u?.rive?.stateMachine),dt=ut.find(rt=>rt.name===Ae);if(!dt)return;ke==="trigger"?(dt.fire(),Ue?.reportTrigger(Ae)):ke==="boolean"?(dt.value=$e!==0,Ze&&setTimeout(()=>{let rt=(Ve?ae.current?.stateMachineInputs(Ve):null)?.find(an=>an.name===Ae);rt&&(rt.value=!1);},Ze)):dt.value=$e;}}catch(Ve){T.error("Renderer",`gesture: failed to fire "${Z}"`,Ve);}},[u,Je,Ue]),Vn=(0, ie.useCallback)(Z=>{let de=ae.current;if(!de)return false;let{input:Ae,type:ke,binding:$e}=lu(Z,u?.rive?.gestures,Je);if(ke!=="trigger")return false;try{if($e==="data-binding")return !!Pt.current?.trigger(Ae);let{inputs:Bt}=Vi(de,u?.rive?.stateMachine);return Bt.some(Ze=>Ze.name===Ae)}catch{return false}},[u,Je]);Gt.current={has:Vn,fire:wr};let xi=(0, ie.useCallback)(()=>{for(let Z of Mn.current)Z();Mn.current=[];},[]),le=(0, ie.useCallback)(Z=>{let{name:de,atMs:Ae,speechless:ke}=Z,$e=()=>{Z.beep?Ne.current?.playBeep():wr(de);};if(Ae==null){T.debug("Renderer","gesture: scheduling",{name:de,mode:"immediate"}),$e();return}let Bt=!!Ne.current?.isAudioActive(),Ze=ke==null?Bt:!ke;T.debug("Renderer","gesture: scheduling",{name:de,atMs:Ae,speechless:ke,audioActive:Bt,mode:Ze?"alignment":"delay"});let Ve={cancel:()=>{}},ut=()=>{Mn.current=Mn.current.filter(dt=>dt!==Ve.cancel);};if(Ze){let dt=Ae/1e3,rt=requestAnimationFrame(function an(){let Yi=Ne.current;if(Yi){if(Yi.getAlignmentTime()>=dt){T.debug("Renderer","gesture: firing (alignment reached)",{name:de,atMs:Ae,alignmentMs:Math.round(Yi.getAlignmentTime()*1e3)}),ut(),$e();return}rt=requestAnimationFrame(an);}});Ve.cancel=()=>cancelAnimationFrame(rt);}else {let dt=window.setTimeout(()=>{T.debug("Renderer","gesture: firing (delay elapsed)",{name:de,atMs:Ae}),ut(),$e();},Ae);Ve.cancel=()=>clearTimeout(dt);}Mn.current.push(Ve.cancel);},[wr]);(0, ie.useEffect)(()=>{if(!X||!fe)return;let Z=M?.current;if(!Z||Z.length===0)return;let de=Z.splice(0,Z.length);for(let Ae of de)le(Ae);},[w,X,fe,M,le]),(0, ie.useEffect)(()=>xi,[xi]);let Hn=(0, ie.useCallback)(()=>{let Z=Ne.current;if(!Z)return rg;let de=D?.offsetSec??0;return Math.min(Z.getAlignmentTime()+de,Z.getPlayableAlignmentTime()+de+.5)},[D]),Mr=(0, ie.useCallback)(()=>!!Ne.current?.isPlaybackScheduled(),[]),pa=(0, ie.useCallback)(async()=>{if(!fe||!t)return;let{audioChunks:Z,alignments:de,sessionId:Ae,jobId:ke,chunkOffset:$e}=t;if(zt(),It.current!==ke&&(It.current!==null&&(Xe.current?.clearVisemes(),Xe.current instanceof Ka&&Xe.current.prepareSpeech()),Qt.current=0),It.current=ke,xn.current!==Ae&&(T.debug("Renderer","new epoch \u2192 reset audio + lipsync"),Xe.current?.stop(),Xe.current=null,Ne.current?.destroy(),Ne.current=null,x(null),xn.current=Ae,Qt.current=0),!Xe.current||!Ne.current){Xe.current&&(Xe.current.stop(),Xe.current=null),T.debug("Renderer","init audio + lipsync"),Ne.current||(Ne.current=Un.current(()=>{let Ve=e?.()===true;Xe.current?.clearVisemes(),Xe.current?.forceSilence(),Ve&&b.current?Fe().restThinking():Mt();},L.current?.()??null),Ne.current.setMuted(!!U),x(()=>Ne.current?.isPlaybackScheduled()?Ne.current.getAlignmentTime():null));let Ze=u?.pipelineMode??"input";if(T.debug("Renderer","engine selection",{pipelineMode:Ze,lipSyncVmReady:!!Pt.current}),Ze==="data-binding"){let Ve=Pt.current;if(!Ve&&X){T.error("Renderer","data-binding: lip-sync ViewModel not initialized \u2014 was bindViewModelInstance called before first speak?");return}let ut=new Ka;ut.initialize(Ve,{getAlignmentTime:Hn,isLive:Mr},D),Xe.current=ut;}else {let Ve=new Md;Ve.initialize(X,{getAlignmentTime:Hn,isLive:Mr},u?.rive?.stateMachine,D),Xe.current=Ve;}Xe.current.start();}$e>Qt.current&&T.error("Renderer","gap in TTS chunks \u2014 a speak batch was dropped",{expected:Qt.current,got:$e,jobId:ke});let Bt=Math.max(0,Qt.current-$e);for(let Ze=Bt;Ze<Z.length;Ze++){let Ve=Z[Ze],ut=de[Ze];if(Qt.current=$e+Ze+1,!Ve)continue;if(!ut){Ne.current.enqueueSequentialChunk(Ve),T.debug("Renderer","appended sequential (no-alignment) chunk",{index:$e+Ze});continue}let dt=ut.character_start_times_seconds[0]??0,rt=t.visemes?.[Ze]??Pf(ut,Dt);if(Ne.current.enqueueChunk(Ve,dt),Xe.current.appendVisemes(rt),T.debug("Renderer","appended chunk",{alignmentStart:dt,firstViseme:rt[0],lastViseme:rt[rt.length-1],alignmentNow:Ne.current.getAlignmentTime()}),t.isGreeting){let an=ut.character_end_times_seconds;T.event("Renderer","greeting chunk queued",{chunkIndex:$e+Ze,totalChunks:Z.length,alignmentStart:dt,alignmentSpan:an?.[an.length-1]??null,chars:ut.characters?.length??0,visemeCount:rt.length,firstVisemeStart:rt[0]?.start??null,clockAtQueue:Ne.current.getAlignmentTime()});}}},[t,X,fe,e,Dt,u,Je,zt,Mt,Fe,x,Hn,Mr,D]),ti=()=>{xi(),Xe.current?.stop(),Xe.current=null,Ne?.current?.destroy(),Ne.current=null,x(null),Ke.current?.stop(),xn.current=null,Qt.current=0,It.current=null,Mt();};(0, ie.useEffect)(()=>{if(!X)return;let Z=()=>{X&&(X.layout=bd(Ie,u?.rive?.watermark),X.resetArtboardSize?.());};return X.on(_u.EventType.Load,Z),X?.isPlaying&&Z(),()=>{X.off(_u.EventType.Load,Z);}},[X]),(0, ie.useEffect)(()=>{if(!X)return;let Z=de=>{if(Array.isArray(de.data))for(let Ae of de.data)typeof Ae=="string"&&Fe().rigEntered(Ae);};return X.on(_u.EventType.StateChange,Z),()=>X.off(_u.EventType.StateChange,Z)},[X,Fe]),(0, ie.useEffect)(()=>{X&&(X.layout=bd(Ie,u?.rive?.watermark));},[X,Ee,u]),(0, ie.useEffect)(()=>{let Z=kn.current;if(!Z||!X)return;let de=0,Ae=null,ke=()=>{let Ze=Z.querySelector(".rive-renderer-canvas > canvas");if(!Ze)return;let Ve=Ze.clientWidth;if(!Ve)return;let ut=Ze.getBoundingClientRect(),dt=ut.width/Ve;if(!dt||!isFinite(dt))return;let an=(Be?1:window.devicePixelRatio||1)/dt;Ze.width===Math.trunc(an*ut.width)&&Ze.height===Math.trunc(an*ut.height)||X.resizeDrawingSurfaceToCanvas?.(an);},$e=()=>{Ae&&clearTimeout(Ae),Ae=setTimeout(()=>{cancelAnimationFrame(de),de=requestAnimationFrame(ke);},MI);},Bt=new ResizeObserver($e);return Bt.observe(Z),de=requestAnimationFrame(ke),()=>{Ae&&clearTimeout(Ae),cancelAnimationFrame(de),Bt.disconnect();}},[X,Be]),(0, ie.useEffect)(()=>{if(t&&fe&&pa(),!t&&X){if((u?.pipelineMode??"input")==="data-binding"){let de=Pt.current;if(de){for(let Ae=1;Ae<=21;Ae++)try{let ke=de.number(lt.current(Ae));ke&&(ke.value=0);}catch{}try{let Ae=de.number(lt.current(0));Ae&&(Ae.value=100);}catch{}}}else {let{inputs:de}=Vi(X,u?.rive?.stateMachine);de.forEach(Ae=>{let ke=Wa(Ae.name);ke!==null&&(Ae.value=ke===0?100:0);});}m.current||(Re.current?zt():Mt());}},[X,fe,t,pa,u,A]),(0, ie.useEffect)(()=>()=>{try{ti();}catch(Z){T.error("Renderer","Reset failed",Z);}},[]),(0, ie.useEffect)(()=>{o!==tn.current&&(tn.current=o,ti());},[o]);let zi=(0, ie.useRef)(null);if(!u)return (0, Wt.jsx)("div",{className:`rive-renderer-root ${d?.fatal?"":"rive-renderer-root--loading"} ${n??""}`,style:i,children:d?.fatal?y??(0, Wt.jsx)(vw,{}):g??(0, Wt.jsx)(gw,{})});let es=R&&fe?{onPointerDown:Z=>{zi.current={x:Z.clientX,y:Z.clientY};},onClick:Z=>{let de=zi.current;zi.current=null,!(!de||Math.hypot(Z.clientX-de.x,Z.clientY-de.y)>TI)&&R();}}:null,ji=!ce&&!fe,Tr=ce?y??(0, Wt.jsx)(vw,{}):ji?g??(0, Wt.jsx)(gw,{}):null;return (0, Wt.jsxs)("div",{className:`rive-renderer-root ${ji?"rive-renderer-root--loading":""} ${n??""}`,style:{...i,...c?{filter:"grayscale(1)",transition:"filter 600ms ease"}:null},children:[(0, Wt.jsxs)("div",{className:"rive-renderer-canvasWrapper",ref:kn,...es,children:[(0, Wt.jsx)("div",{className:"rive-renderer-surface",ref:Lt,children:(0, Wt.jsx)(fw,{src:u.rive?.src,artboard:u.rive?.artboard,stateMachine:u.rive?.stateMachine,autoBind:Je,layout:We,onReady:en,onLoadError:Et},me)}),(0, Wt.jsx)("canvas",{ref:wn,className:"rive-renderer-hold",hidden:true,"aria-hidden":"true"})]}),Tr]})},Aw=(0, ie.memo)(CI);var Hi=Se(dn());var Eo=Se(ze()),kI=.08,xI=6e3,yw=t=>t.speaker==="avatar"&&!t.isFinal&&t.words.some(e=>e.end>0),OI=({store:t,speechClockRef:e,position:n="bottom-center",controlsVisible:i,className:r,style:a})=>{let o=(0, Hi.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot),u=i&&n.startsWith("bottom"),d=o.slice(-2),g=d.find(yw)??null,[y,A]=(0, Hi.useState)(0),[p,_]=(0, Hi.useState)(false),C=(0, Hi.useRef)(null);C.current=g,(0, Hi.useEffect)(()=>{if(!g)return;A(0);let B=0,M=()=>{let w=C.current,R=e.current?.();if(w&&R!=null){let D=Vf(w,R+kI);A(G=>D>G?D:G);}B=requestAnimationFrame(M);};return B=requestAnimationFrame(M),()=>cancelAnimationFrame(B)},[g?.id,e]),(0, Hi.useEffect)(()=>{if(_(false),!o[o.length-1]?.isFinal)return;let M=setTimeout(()=>_(true),xI);return ()=>clearTimeout(M)},[o]);let N=d.map(B=>({entry:B,wordCount:yw(B)?Math.min(y,B.words.length):B.words.length})).filter(B=>B.wordCount>0);return N.length?(0, Eo.jsx)("div",{className:["avatar-captions",`avatar-captions--${n}`,u?"avatar-captions--raised":"",p?"avatar-captions--hidden":"",r??""].filter(Boolean).join(" "),style:a,role:"log","aria-live":"polite",children:N.map(({entry:B,wordCount:M},w)=>(0, Eo.jsxs)("p",{className:`avatar-captions-line avatar-captions-line--${B.speaker} ${w===N.length-1?"":"avatar-captions-line--past"}`,children:[B.speaker==="user"&&(0, Eo.jsx)("span",{className:"avatar-captions-tag",children:"You"}),B.words.slice(0,M).map((R,D)=>(0, Eo.jsx)("span",{className:`avatar-captions-word ${B.isFinal?"":"avatar-captions-word--interim"}`,children:R.text},`${D}-${R.text}`))]},B.id))}):null},bw=OI;var _w=Se(dn()),Za=Se(ze()),II={network:{title:"Your connection is unstable",detail:"Check your internet \u2014 audio may drop until it recovers."},device:{title:"Your device is struggling to keep up",detail:"Closing other tabs or apps should help."},service:{title:"Responses are running slow",detail:"It's on our side \u2014 replies may lag for a bit."}},NI=({store:t,position:e="bottom-left",controlsVisible:n,className:i,style:r})=>{let o=(0, _w.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot).concern;if(!o||o.state!=="degraded")return null;let u=II[o.scope],d=n&&e.startsWith("bottom");return (0, Za.jsxs)("div",{className:["avatar-status-banner",`avatar-status-banner--${e}`,`avatar-status-banner--${o.state}`,d?"avatar-status-banner--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite",children:[(0, Za.jsx)("span",{className:"avatar-status-banner-dot","aria-hidden":"true"}),(0, Za.jsxs)("span",{className:"avatar-status-banner-text",children:[(0, Za.jsx)("span",{className:"avatar-status-banner-title",children:u.title}),(0, Za.jsx)("span",{className:"avatar-status-banner-detail",children:u.detail})]})]})},Sw=NI;var wo=Se(ze()),DI=({visible:t,position:e="top-left",controlsVisible:n,className:i,style:r})=>{if(!t)return null;let a=n&&e.startsWith("bottom");return (0, wo.jsxs)("div",{className:["avatar-thinking-indicator",`avatar-thinking-indicator--${e}`,a?"avatar-thinking-indicator--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite","aria-label":"The avatar is thinking",children:[(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, wo.jsx)("span",{className:"avatar-thinking-indicator-dot"})]})},Ew=DI;var vt=Se(ze()),Su=({size:t=22,children:e})=>(0, vt.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e}),ww=({muted:t,size:e})=>(0, vt.jsxs)(Su,{size:e,children:[(0, vt.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, vt.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, vt.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),t&&(0, vt.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),Mw=({muted:t,size:e})=>(0, vt.jsxs)(Su,{size:e,children:[(0, vt.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, vt.jsxs)(vt.Fragment,{children:[(0, vt.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, vt.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, vt.jsxs)(vt.Fragment,{children:[(0, vt.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, vt.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),Tw=({size:t})=>(0, vt.jsx)(Su,{size:t,children:(0, vt.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Cw=({size:t})=>(0, vt.jsx)(Su,{size:t,children:(0, vt.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),Rw=({size:t})=>(0, vt.jsxs)(Su,{size:t,children:[(0, vt.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, vt.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]});var Sn=Se(ze()),LI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isMicMuted:a,isSpeakerMuted:o,setMicMuted:u,setSpeakerMuted:d,showStopSpeaking:g,isSpeaking:y,stopSpeaking:A})=>(0, Sn.jsx)("div",{className:`avatar-controls-root ${i}`,children:t?(0, Sn.jsx)("button",{type:"button",onClick:e,className:"avatar-controls-button avatar-controls-call","aria-label":"Start call",disabled:!r,children:(0, Sn.jsx)(Cw,{})}):(0, Sn.jsxs)(Sn.Fragment,{children:[(0, Sn.jsx)("button",{type:"button",onClick:()=>u(!a),className:`avatar-controls-button avatar-controls-mute${a?" avatar-controls-muted":""}`,"aria-label":a?"Unmute microphone":"Mute microphone","aria-pressed":a,children:(0, Sn.jsx)(ww,{muted:a})}),(0, Sn.jsx)("button",{type:"button",onClick:()=>d(!o),className:`avatar-controls-button avatar-controls-mute${o?" avatar-controls-muted":""}`,"aria-label":o?"Unmute avatar audio":"Mute avatar audio","aria-pressed":o,children:(0, Sn.jsx)(Mw,{muted:o})}),g&&y&&(0, Sn.jsx)("button",{type:"button",onClick:A,className:"avatar-controls-button avatar-controls-stop-speaking","aria-label":"Stop the avatar from speaking",children:(0, Sn.jsx)(Tw,{})}),(0, Sn.jsx)("button",{type:"button",onClick:n,className:"avatar-controls-button avatar-controls-hangup","aria-label":"End call",children:(0, Sn.jsx)(Rw,{})})]})}),kw=LI;var Ja=Se(dn()),Gi=Se(ze()),PI=t=>{let e=t;if(!e?.tagName)return false;let n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||e.isContentEditable},BI=({isTalking:t,isSpeaking:e,startTalking:n,stopTalking:i,spacebar:r,disabled:a=false})=>{let o=(0, Ja.useRef)({isTalking:t,startTalking:n,stopTalking:i,disabled:a});o.current={isTalking:t,startTalking:n,stopTalking:i,disabled:a};let u=t?"Listening":e?"Hold to interrupt":"Hold to talk",d=(0, Ja.useCallback)(y=>{a||y.button!==0||(y.currentTarget.setPointerCapture?.(y.pointerId),n());},[a,n]),g=(0, Ja.useCallback)(()=>i(),[i]);return (0, Ja.useEffect)(()=>{if(!r)return;let y=_=>{_.code!=="Space"||_.repeat||PI(_.target)||o.current.disabled||(_.preventDefault(),o.current.startTalking());},A=_=>{_.code!=="Space"||!o.current.isTalking||(_.preventDefault(),o.current.stopTalking());},p=()=>{o.current.isTalking&&o.current.stopTalking();};return window.addEventListener("keydown",y),window.addEventListener("keyup",A),window.addEventListener("blur",p),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",A),window.removeEventListener("blur",p);}},[r]),(0, Gi.jsxs)("button",{type:"button",className:`avatar-ptt-button${t?" avatar-ptt-holding":""}`,disabled:a,"aria-label":u,"aria-pressed":t,onPointerDown:d,onPointerUp:g,onPointerCancel:g,onContextMenu:y=>y.preventDefault(),children:[(0, Gi.jsx)("span",{className:"avatar-ptt-halo","aria-hidden":"true"}),(0, Gi.jsxs)("span",{className:"avatar-ptt-face",children:[(0, Gi.jsxs)("svg",{className:"avatar-ptt-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0, Gi.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, Gi.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, Gi.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"})]}),(0, Gi.jsx)("span",{className:"avatar-ptt-label",children:u},u)]})]})},xw=BI;var At=Se(ze()),UI=({muted:t})=>(0, At.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, At.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, At.jsxs)(At.Fragment,{children:[(0, At.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, At.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, At.jsxs)(At.Fragment,{children:[(0, At.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, At.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),FI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isSpeakerMuted:a,setSpeakerMuted:o,isTalking:u,isSpeaking:d,startTalking:g,stopTalking:y,spacebar:A})=>t?(0, At.jsx)("div",{className:`avatar-ptt-root ${i}`,children:(0, At.jsxs)("button",{type:"button",onClick:e,className:"avatar-ptt-connect","aria-label":"Start call",disabled:!r,children:[(0, At.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0, At.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),(0, At.jsx)("span",{children:"Connect"})]})}):(0, At.jsxs)("div",{className:`avatar-ptt-root ${i}`,children:[(0, At.jsx)("button",{type:"button",onClick:()=>o(!a),className:`avatar-ptt-secondary${a?" avatar-ptt-secondary-off":""}`,"aria-label":a?"Unmute avatar audio":"Mute avatar audio","aria-pressed":a,children:(0, At.jsx)(UI,{muted:a})}),(0, At.jsx)(xw,{isTalking:u,isSpeaking:d,startTalking:g,stopTalking:y,spacebar:A}),(0, At.jsx)("button",{type:"button",onClick:n,className:"avatar-ptt-secondary avatar-ptt-hangup","aria-label":"End call",children:(0, At.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, At.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, At.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]})})]}),Ow=FI;var Ld=Se(dn()),Ye=Se(ze()),vv=()=>(0, Ye.jsx)("span",{className:"avatar-pip-swap-hint","aria-hidden":"true",children:(0, Ye.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",children:(0, Ye.jsx)("path",{d:"M4 10V4h6M20 14v6h-6",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),Iw=()=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("path",{d:"M16 10.5V8a2 2 0 0 0-2-2H6.5M3 6.5V16a2 2 0 0 0 2 2h9M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0, Ye.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),VI=()=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("rect",{x:"3",y:"6",width:"13",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, Ye.jsx)("path",{d:"M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),HI=({on:t})=>(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0, Ye.jsx)("path",{d:"M8.5 14.5c.9 1.2 2.1 1.8 3.5 1.8s2.6-.6 3.5-1.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, Ye.jsx)("path",{d:"M9 9.5h.01M15 9.5h.01",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round"}),!t&&(0, Ye.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),GI=({on:t,toggle:e})=>(0, Ye.jsxs)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":"Detect mood",title:t?"Detect mood: on":"Detect mood: off",className:`avatar-camera-preview-mood${t?" on":""}`,onClick:e,children:[(0, Ye.jsx)(HI,{on:t}),(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-label",children:"Detect mood"}),(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-track","aria-hidden":"true",children:(0, Ye.jsx)("span",{className:"avatar-camera-preview-mood-knob"})})]}),zI=({sessionOpen:t,stream:e,mirrored:n=true,corner:i="bottom-right",variant:r="corner",onSwap:a,onToggleVideo:o,onFlip:u,mood:d})=>{let g=(0, Ld.useRef)(null),y=e!==null;return (0, Ld.useEffect)(()=>{let A=g.current;A&&(A.srcObject=e,e&&A.play().catch(()=>{}));},[e]),t?(0, Ye.jsxs)("div",{className:`avatar-camera-preview ${r==="stage"?"stage":i}${y?"":" video-off"}${a?" swappable":""}`,...a&&{role:"button",tabIndex:0,"aria-label":"Show camera full size",onClick:a,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a());}},children:[y?(0, Ye.jsx)("video",{ref:g,className:`avatar-camera-preview-video${n?" mirrored":""}`,playsInline:true,muted:true,autoPlay:true}):(0, Ye.jsxs)("div",{className:"avatar-camera-preview-off","aria-label":"Video off",children:[(0, Ye.jsx)(Iw,{}),(0, Ye.jsx)("span",{children:"Video off"})]}),a&&(0, Ye.jsx)(vv,{}),(0, Ye.jsxs)("div",{className:"avatar-camera-preview-actions",onClick:A=>A.stopPropagation(),children:[d&&y&&(0, Ye.jsx)(GI,{on:d.on,toggle:d.toggle}),u&&y&&(0, Ye.jsx)("button",{type:"button",className:"avatar-camera-preview-btn",onClick:u,title:"Switch camera","aria-label":"Switch camera",children:(0, Ye.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, Ye.jsx)("path",{d:"M4 8a6 6 0 0 1 10-4.5M20 16a6 6 0 0 1-10 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, Ye.jsx)("path",{d:"M4 4v4h4M20 20v-4h-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),o&&(0, Ye.jsx)("button",{type:"button",className:`avatar-camera-preview-btn${y?"":" off"}`,onClick:o,title:y?"Turn off video":"Turn on video","aria-label":y?"Turn off video":"Turn on video","aria-pressed":!y,children:y?(0, Ye.jsx)(Iw,{}):(0, Ye.jsx)(VI,{})})]})]}):null},Nw=zI;var ei=Se(ze()),jI=()=>(0, ei.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, ei.jsx)("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, ei.jsx)("path",{d:"M8 20h8M12 16v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),YI=({phase:t,onShare:e,onDismiss:n,onStop:i,position:r="top-center",controlsVisible:a,className:o,style:u})=>{if(t!=="awaiting_click"&&t!=="live")return null;let d=a&&r.startsWith("bottom"),g=["avatar-screen-share",`avatar-screen-share--${r}`,t==="live"?"live":"",d?"avatar-screen-share--raised":"",o??""].filter(Boolean).join(" ");return t==="awaiting_click"?(0, ei.jsxs)("div",{className:g,style:u,role:"group","aria-label":"Screen sharing request",children:[(0, ei.jsxs)("button",{type:"button",className:"avatar-screen-share-primary",onClick:e,children:[(0, ei.jsx)(jI,{}),"Share your screen"]}),(0, ei.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:n,children:"Not now"})]}):(0, ei.jsxs)("div",{className:g,style:u,role:"status",children:[(0, ei.jsx)("span",{className:"avatar-screen-share-dot","aria-hidden":"true"}),(0, ei.jsx)("span",{children:"Sharing your screen"}),(0, ei.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:i,children:"Stop"})]})},Dw=YI;var En=Se(ze()),WI=t=>{let e=vu(),i=e?.controls?.enabled!==false&&e.mode==="call",r=e?._camera?.sessionOpen??false,a=!!t?.usePictureInPicture&&r,[o,u]=(0, $a.useState)(true);(0, $a.useEffect)(()=>{r&&u(true);},[r]);let d=a&&o,g=(0, $a.useCallback)(()=>u(true),[]),y=(0, $a.useCallback)(()=>u(false),[]),A=e?._environment!=="meeting",p=A&&!!e?.isConnecting&&!!e?._avatarConfig,_=[d?`avatar-pip-frame swappable ${t?.pictureInPictureCorner??"bottom-right"}`:"avatar-stage-layer",p?"avatar-stage-loading":""].filter(Boolean).join(" "),C=(0, En.jsx)(Aw,{lastResponse:e?._currentJob,onPlaybackEnd:e?._onPlaybackEnd,avatarConfig:e?._avatarConfig||null,fit:t?.fit,error:e?.error,className:t?.className,style:t?.style,onRiveReady:e?._onRiveReady,onRiveError:e?._onRiveError,resetToken:e?._resetToken,shouldArmTalking:e?._shouldArmTalking,isConnected:e?.isConnected,userActivity:e?._userActivity,userAttending:e?.isTalking,isThinking:e?.isThinking,thinkingSignal:e?._thinkingSignal,gestureQueue:e?._gestureQueue,gestureSignal:e?._gestureSignal,onAvatarClick:d||!A?void 0:e?._avatarClicked,lipSyncTuning:e?._lipSyncTuning,visualState:e?._visualState,onSpeechClock:e?._registerSpeechClock,onRegisterPlaybackControls:e?._registerPlaybackControls,getAudioContext:e?._getAudioContext,createSpeechPlayer:e?._createSpeechPlayer,speakerMuted:e?._speakerMuted,rigActivity:e?._rigActivity,loader:t?.loader,errorFallback:t?.errorFallback,environment:e?._environment},e?._riveKey);return (0, En.jsxs)(GE,{children:[(a||!t?.hideCameraPreview)&&(0, En.jsx)(Nw,{sessionOpen:r,stream:e?._camera?.stream??null,mirrored:e?._camera?.facing!=="environment",corner:t?.cameraPreviewCorner??"bottom-right",variant:d?"stage":"corner",onSwap:a&&!d?g:void 0,onToggleVideo:e?._camera?.toggleVideo,onFlip:e?._camera?.flip,mood:e?._camera?.mood}),(0, En.jsxs)("div",{className:_,...d&&{role:"button",tabIndex:0,"aria-label":"Show avatar full size",onClick:y,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),y());}},children:[C,d&&(0, En.jsx)(vv,{})]}),e?._captionsEnabled&&(0, En.jsx)(bw,{store:e._transcriptStore,speechClockRef:e._speechClockRef,position:e._captionPosition,controlsVisible:i,className:t?.captionClassName,style:t?.captionStyle}),e?._statusBannerEnabled&&(0, En.jsx)(Sw,{store:e._healthStore,position:e._statusBannerPosition,controlsVisible:i,className:t?.statusBannerClassName,style:t?.statusBannerStyle}),e?._thinkingIndicatorEnabled&&(0, En.jsx)(Ew,{visible:!!e?.isResponseSlow,position:e._thinkingIndicatorPosition,controlsVisible:i,className:t?.thinkingIndicatorClassName,style:t?.thinkingIndicatorStyle}),e?._screen&&(0, En.jsx)(Dw,{phase:e._screen.phase,onShare:e._screen.share,onDismiss:e._screen.dismiss,onStop:e._screen.stop,position:e._screenSharePosition,controlsVisible:i,className:t?.screenShareClassName,style:t?.screenShareStyle}),e._mode!=="player"&&A&&(0, En.jsx)("div",{className:`connectivity-dot ${e.isConnected?"connected":"disconnected"}`,title:e.isConnected?"Connected to Server":"Disconnected"}),p&&(0, En.jsx)("div",{className:"avatar-connecting-overlay",children:t?.loader??(0, En.jsx)(kd,{label:"Connecting"})}),i&&e?.isPushToTalk&&(0, En.jsx)(Ow,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isSpeakerMuted:e?.isSpeakerMuted,setSpeakerMuted:e?.setSpeakerMuted,isTalking:e?.isTalking,isSpeaking:e?.isSpeaking,startTalking:e?.startTalking,stopTalking:e?.stopTalking,spacebar:e?._spacebarToTalk}),i&&!e?.isPushToTalk&&(0, En.jsx)(kw,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isMicMuted:e?.isMicMuted,isSpeakerMuted:e?.isSpeakerMuted,setMicMuted:e?.setMicMuted,setSpeakerMuted:e?.setSpeakerMuted,showStopSpeaking:e?.controls?.stopSpeaking===true,isSpeaking:e?.isSpeaking,stopSpeaking:e?.stopSpeaking})]})},Lw=WI;var qI="/v1/meeting/session-token";async function Pw(t){let e=await fetch(`${Fl()}${qI}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:t})});if(!e.ok)throw new Error(`Meeting ticket exchange failed (${e.status})`);let n=await e.json();if(typeof n.token!="string"||!n.token)throw new Error("Meeting ticket exchange returned no token");return n.token}var QI=3e4,Bw=1e3;function XI(){try{let t=document.createElement("canvas").getContext("webgl2"),e=t?.getExtension("WEBGL_debug_renderer_info");return t&&e?String(t.getParameter(e.UNMASKED_RENDERER_WEBGL)):null}catch{return null}}function KI(){return new Promise(t=>{let e=0,n=performance.now(),i=setTimeout(()=>t(e),Bw+200),r=a=>{e++,a-n<Bw?requestAnimationFrame(r):(clearTimeout(i),t(e));};requestAnimationFrame(r);})}function Uw(t){let e=XI(),n=async()=>{T.event("meeting","diagnostics",{outputContext:t()?.state??null,visibility:document.visibilityState,fps:await KI(),webglRenderer:e,viewport:`${window.innerWidth}x${window.innerHeight}`});};n();let i=setInterval(()=>{n();},QI);return ()=>clearInterval(i)}var ZI=2,JI=1e3,$I=-40,eN=-90;function tN(t){let e=t.sampleRate*ZI,n=t.createBuffer(1,e,t.sampleRate),i=n.getChannelData(0);for(let r=0;r<e;r++)i[r]=Math.random()*2-1;return n}function Fw(t,e){let n=Math.max(eN,Math.min($I,e)),i=null,r=()=>{if(i){try{i.source.stop();}catch{}i.source.disconnect(),i.gain.disconnect(),i=null;}},a=()=>{let u=t();if(i&&i.ctx===u||(r(),!u||u.state!=="running"))return;let d=u.createBufferSource();d.buffer=tN(u),d.loop=true;let g=u.createGain();g.gain.value=Math.pow(10,n/20),d.connect(g).connect(u.destination),d.start(),i={ctx:u,source:d,gain:g},T.event("meeting","audio bed started",{levelDb:n});};a();let o=setInterval(a,JI);return ()=>{clearInterval(o),r();}}var Ri=Se(ze()),nN="#000",Vw=({avatarId:t,ticket:e,apiKey:n,background:i,debug:r,lipSyncOffsetMs:a,audioBedDb:o})=>{let u=(0, Mo.useMemo)(()=>{let d={environment:"meeting",mode:"call",debug:r,avatar:{avatarId:t,greeting:{enabled:true},...a!==void 0&&{voiceSettings:{lipSync:{offsetMs:a}}}}};return e?{...d,getSessionToken:()=>Pw(e)}:{...d,apiKey:n??""}},[t,e,n,r,a]);return aN(i??nN),(0, Ri.jsxs)(HE,{config:u,children:[(0, Ri.jsx)(Lw,{loader:(0, Ri.jsx)(Ri.Fragment,{}),errorFallback:(0, Ri.jsx)(Ri.Fragment,{}),hideCameraPreview:true}),r&&(0, Ri.jsx)(iN,{}),o!==void 0&&(0, Ri.jsx)(rN,{levelDb:o})]})},iN=()=>{let{_getAudioContext:t}=vu();return (0, Mo.useEffect)(()=>Uw(t),[t]),null},rN=({levelDb:t})=>{let{_getAudioContext:e}=vu();return (0, Mo.useEffect)(()=>Fw(e,t),[e,t]),null},aN=t=>{(0, Mo.useEffect)(()=>{for(let e of [document.documentElement,document.body])Object.assign(e.style,{background:t,margin:"0",width:"100vw",height:"100vh",overflow:"hidden"});},[t]);};function Er(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t));}Er(`.avatar-shell-root{position:relative;width:100%;height:100%;overflow:hidden;border-radius:inherit}.connectivity-dot{position:absolute;top:10px;right:25px;width:12px;height:12px;border-radius:50%;border:2px solid white;box-shadow:0 0 4px #0000004d;z-index:10;transition:background-color .3s ease}.connectivity-dot.connected{background-color:#4caf50}.connectivity-dot.disconnected{background-color:#f44336}
33
33
  `);Er(`.avatar-root{position:relative;width:100%;height:100%}.avatar-connecting-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;container-type:size;pointer-events:none;z-index:21;animation:avatar-connecting-in .24s ease-out both}@keyframes avatar-connecting-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.avatar-connecting-overlay{animation:none}}.avatar-controls{position:absolute;left:50%;bottom:12px;transform:translate(-50%);z-index:10;display:flex;align-items:center;justify-content:center}
34
34
  `);Er(`.rive-renderer-root{position:relative;width:100%;height:100%;min-height:0;overflow:hidden;border-radius:inherit}.rive-renderer-canvasWrapper{position:absolute;inset:0;width:100%;height:100%}.rive-renderer-canvas{width:100%;height:100%}.rive-renderer-canvas>canvas{display:block;width:100%!important;height:100%!important}.rive-renderer-surface{position:absolute;inset:0}.rive-renderer-hold{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}.rive-renderer-hold[hidden]{display:none}.rive-renderer-loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;container-type:size;z-index:20}.rive-renderer-error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#0000008c;z-index:20;color:#ffffffb3}.rive-renderer-error-text{font-size:13px;font-family:system-ui,sans-serif;letter-spacing:.01em}
35
35
  `);Er(`.avatar-camera-preview{position:absolute;z-index:20;width:22%;min-width:96px;max-width:180px;aspect-ratio:3 / 4;border-radius:12px;overflow:hidden;background:#000;box-shadow:0 4px 16px #00000059;border:1px solid rgba(255,255,255,.18)}.avatar-camera-preview.top-left{top:12px;left:12px}.avatar-camera-preview.top-right{top:12px;right:12px}.avatar-camera-preview.bottom-left{bottom:12px;left:12px}.avatar-camera-preview.bottom-right{bottom:12px;right:12px}.avatar-camera-preview.stage{--af-camera-stage-inset: 10px;--af-camera-stage-radius: 18px;inset:var(--af-camera-stage-inset);width:auto;min-width:0;max-width:none;aspect-ratio:auto;border:none;border-radius:var(--af-camera-stage-radius);background:#0d0f16;box-shadow:0 1px 2px #10122024,0 14px 34px -14px #10122080,inset 0 0 0 1px #ffffff29;z-index:1;animation:avatar-camera-stage-in .32s cubic-bezier(.2,.8,.2,1) backwards}@keyframes avatar-camera-stage-in{0%{opacity:0;transform:scale(1.015)}to{opacity:1;transform:none}}.avatar-camera-preview.stage:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(125% 95% at 50% 45%,transparent 52%,rgba(10,12,20,.3) 100%),linear-gradient(to top,rgba(8,10,18,.45),transparent 30%)}.avatar-camera-preview.stage .avatar-camera-preview-actions{top:0;bottom:auto;z-index:2;padding:12px;background:linear-gradient(to bottom,#080a126b,#080a1200)}.avatar-camera-preview.stage .avatar-camera-preview-btn{width:36px;height:36px;background:#ffffff29;box-shadow:inset 0 0 0 1px #ffffff38;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.avatar-camera-preview.stage .avatar-camera-preview-btn:hover{background:#ffffff4d}.avatar-camera-preview.stage .avatar-camera-preview-off{gap:10px;font-size:14px;background:#0d0f16}.avatar-camera-preview.swappable,.avatar-pip-frame.swappable{cursor:pointer;transition:transform .18s ease,box-shadow .18s ease}.avatar-camera-preview.swappable:hover,.avatar-pip-frame.swappable:hover{transform:scale(1.03)}.avatar-camera-preview.swappable:focus-visible,.avatar-pip-frame.swappable:focus-visible{outline:2px solid #ffffff;outline-offset:2px}.avatar-pip-swap-hint{position:absolute;top:6px;right:6px;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;color:#fff;background:#0c0e1680;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);opacity:0;transition:opacity .15s ease;pointer-events:none}.swappable:hover .avatar-pip-swap-hint,.swappable:focus-visible .avatar-pip-swap-hint{opacity:1}@media(hover:none){.avatar-pip-swap-hint{opacity:1}.avatar-camera-preview.swappable:hover,.avatar-pip-frame.swappable:hover{transform:none}}.avatar-stage-layer{position:absolute;inset:0}.avatar-pip-frame{position:absolute;z-index:20;width:26%;min-width:104px;max-width:200px;aspect-ratio:3 / 4;border:none;border-radius:16px;overflow:hidden;background:radial-gradient(118% 76% at 50% 6%,rgba(186,207,243,.42),transparent 62%),linear-gradient(to bottom,#fff,#eaeef9);box-shadow:0 1px 2px #10122029,0 16px 34px -14px #1012208c,inset 0 0 0 1px #ffffffbf;animation:avatar-pip-frame-in .32s cubic-bezier(.2,.8,.2,1) backwards}@keyframes avatar-pip-frame-in{0%{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}.avatar-pip-frame.top-left{top:20px;left:20px}.avatar-pip-frame.top-right{top:20px;right:20px}.avatar-pip-frame.bottom-left{bottom:20px;left:20px}.avatar-pip-frame.bottom-right{bottom:20px;right:20px}@media(prefers-reduced-motion:reduce){.avatar-camera-preview.stage,.avatar-pip-frame{animation:none}}.avatar-camera-preview-video{width:100%;height:100%;object-fit:cover;display:block}.avatar-camera-preview-video.mirrored{transform:scaleX(-1)}.avatar-camera-preview-off{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#ffffff8c;background:#1b1b1f;font-size:11px;font-family:inherit;user-select:none}.avatar-camera-preview-actions{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px;background:linear-gradient(to top,#0000008c,#0000);opacity:0;transition:opacity .15s ease}.avatar-camera-preview:hover .avatar-camera-preview-actions,.avatar-camera-preview:focus-within .avatar-camera-preview-actions,.avatar-camera-preview.video-off .avatar-camera-preview-actions{opacity:1}@media(hover:none){.avatar-camera-preview-actions{opacity:1}}.avatar-camera-preview-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:50%;cursor:pointer;color:#fff;background:#ffffff2e;backdrop-filter:blur(4px);transition:background .15s ease}.avatar-camera-preview-btn:hover{background:#ffffff52}.avatar-camera-preview-btn.off{background:#d93b3b}.avatar-camera-preview-btn.off:hover{background:#e85555}.avatar-camera-preview-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.avatar-camera-preview-mood{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:28px;height:28px;padding:0;border:none;border-radius:999px;cursor:pointer;color:#ffffffb3;background:#ffffff2e;backdrop-filter:blur(4px);font:inherit;transition:background .15s ease,color .15s ease}.avatar-camera-preview-mood:hover{background:#ffffff52}.avatar-camera-preview-mood.on{color:#fff;background:#2fa86bd9}.avatar-camera-preview-mood.on:hover{background:#3aba79eb}.avatar-camera-preview-mood:focus-visible{outline:2px solid #fff;outline-offset:2px}.avatar-camera-preview-mood-label,.avatar-camera-preview-mood-track{display:none}.avatar-camera-preview.stage .avatar-camera-preview-mood{width:auto;height:36px;padding:0 10px 0 12px;color:#fff;background:#ffffff29;box-shadow:inset 0 0 0 1px #ffffff38;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.avatar-camera-preview.stage .avatar-camera-preview-mood:hover{background:#ffffff4d}.avatar-camera-preview.stage .avatar-camera-preview-mood-label{display:inline;font-size:13px;font-weight:500;white-space:nowrap}.avatar-camera-preview.stage .avatar-camera-preview-mood-track{position:relative;display:inline-block;width:28px;height:16px;border-radius:999px;background:#ffffff47;transition:background .15s ease}.avatar-camera-preview.stage .avatar-camera-preview-mood.on .avatar-camera-preview-mood-track{background:#2fa86b}.avatar-camera-preview-mood-knob{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .15s ease}.avatar-camera-preview-mood.on .avatar-camera-preview-mood-knob{transform:translate(12px)}@media(prefers-reduced-motion:reduce){.avatar-camera-preview-mood-knob{transition:none}}
36
- `);var Vw=Se(ze()),tN="afx-meeting",nN="afx-root",iN=()=>{let t=document.getElementById(tN)?.textContent,e=document.getElementById(nN);if(!t||!e){console.error("[avatarfactory] meeting page is missing its props");return}let n=JSON.parse(t);if(!n.avatarId||!n.ticket&&!n.apiKey){console.error("[avatarfactory] meeting page needs an avatarId and a ticket");return}Object.assign(e.style,{width:"100%",height:"100%"}),(0, Fw.createRoot)(e).render((0, Vw.jsx)(Uw,{...n}));};iN();
36
+ `);var Gw=Se(ze()),sN="afx-meeting",oN="afx-root",lN=()=>{let t=document.getElementById(sN)?.textContent,e=document.getElementById(oN);if(!t||!e){console.error("[avatarfactory] meeting page is missing its props");return}let n=JSON.parse(t);if(!n.avatarId||!n.ticket&&!n.apiKey){console.error("[avatarfactory] meeting page needs an avatarId and a ticket");return}Object.assign(e.style,{width:"100%",height:"100%"}),(0, Hw.createRoot)(e).render((0, Gw.jsx)(Vw,{...n}));};lN();
37
37
  /*! Bundled license information:
38
38
 
39
39
  scheduler/cjs/scheduler.production.js: