admesh-ui-sdk 1.0.50 → 1.1.0

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,4 +1,4 @@
1
- (()=>{var h0=Object.defineProperty,g0=(Wr,cr,Ao)=>cr in Wr?h0(Wr,cr,{enumerable:!0,configurable:!0,writable:!0,value:Ao}):Wr[cr]=Ao,qr=(Wr,cr,Ao)=>g0(Wr,typeof cr!="symbol"?cr+"":cr,Ao);(function(){"use strict";var Wr;function cr(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Ao={exports:{}},Ie={};/**
1
+ (()=>{var b0=Object.defineProperty,v0=(to,ur,Fo)=>ur in to?b0(to,ur,{enumerable:!0,configurable:!0,writable:!0,value:Fo}):to[ur]=Fo,eo=(to,ur,Fo)=>v0(to,typeof ur!="symbol"?ur+"":ur,Fo);(function(){"use strict";var to;function ur(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Fo={exports:{}},Te={};/**
2
2
  * @license React
3
3
  * react.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var uc;function xp(){if(uc)return Ie;uc=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),L=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),W=Symbol.iterator;function N(p){return p===null||typeof p!="object"?null:(p=W&&p[W]||p["@@iterator"],typeof p=="function"?p:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,V={};function ee(p,I,G){this.props=p,this.context=I,this.refs=V,this.updater=G||P}ee.prototype.isReactComponent={},ee.prototype.setState=function(p,I){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,I,"setState")},ee.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function se(){}se.prototype=ee.prototype;function oe(p,I,G){this.props=p,this.context=I,this.refs=V,this.updater=G||P}var re=oe.prototype=new se;re.constructor=oe,H(re,ee.prototype),re.isPureReactComponent=!0;var ae=Array.isArray;function Q(){}var U={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function ce(p,I,G){var Y=G.ref;return{$$typeof:u,type:p,key:I,ref:Y!==void 0?Y:null,props:G}}function ye(p,I){return ce(p.type,I,p.props)}function $e(p){return typeof p=="object"&&p!==null&&p.$$typeof===u}function te(p){var I={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(G){return I[G]})}var le=/\/+/g;function xe(p,I){return typeof p=="object"&&p!==null&&p.key!=null?te(""+p.key):I.toString(36)}function Pe(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(Q,Q):(p.status="pending",p.then(function(I){p.status==="pending"&&(p.status="fulfilled",p.value=I)},function(I){p.status==="pending"&&(p.status="rejected",p.reason=I)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function C(p,I,G,Y,_e){var ve=typeof p;(ve==="undefined"||ve==="boolean")&&(p=null);var Ae=!1;if(p===null)Ae=!0;else switch(ve){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(p.$$typeof){case u:case l:Ae=!0;break;case $:return Ae=p._init,C(Ae(p._payload),I,G,Y,_e)}}if(Ae)return _e=_e(p),Ae=Y===""?"."+xe(p,0):Y,ae(_e)?(G="",Ae!=null&&(G=Ae.replace(le,"$&/")+"/"),C(_e,I,G,"",function(je){return je})):_e!=null&&($e(_e)&&(_e=ye(_e,G+(_e.key==null||p&&p.key===_e.key?"":(""+_e.key).replace(le,"$&/")+"/")+Ae)),I.push(_e)),1;Ae=0;var Le=Y===""?".":Y+":";if(ae(p))for(var Ne=0;Ne<p.length;Ne++)Y=p[Ne],ve=Le+xe(Y,Ne),Ae+=C(Y,I,G,ve,_e);else if(Ne=N(p),typeof Ne=="function")for(p=Ne.call(p),Ne=0;!(Y=p.next()).done;)Y=Y.value,ve=Le+xe(Y,Ne++),Ae+=C(Y,I,G,ve,_e);else if(ve==="object"){if(typeof p.then=="function")return C(Pe(p),I,G,Y,_e);throw I=String(p),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function q(p,I,G){if(p==null)return p;var Y=[],_e=0;return C(p,Y,"","",function(ve){return I.call(G,ve,_e++)}),Y}function ie(p){if(p._status===-1){var I=p._result;I=I(),I.then(function(G){(p._status===0||p._status===-1)&&(p._status=1,p._result=G)},function(G){(p._status===0||p._status===-1)&&(p._status=2,p._result=G)}),p._status===-1&&(p._status=0,p._result=I)}if(p._status===1)return p._result.default;throw p._result}var ke=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},Ee={map:q,forEach:function(p,I,G){q(p,function(){I.apply(this,arguments)},G)},count:function(p){var I=0;return q(p,function(){I++}),I},toArray:function(p){return q(p,function(I){return I})||[]},only:function(p){if(!$e(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return Ie.Activity=E,Ie.Children=Ee,Ie.Component=ee,Ie.Fragment=f,Ie.Profiler=k,Ie.PureComponent=oe,Ie.StrictMode=d,Ie.Suspense=S,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(p){return U.H.useMemoCache(p)}},Ie.cache=function(p){return function(){return p.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(p,I,G){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var Y=H({},p.props),_e=p.key;if(I!=null)for(ve in I.key!==void 0&&(_e=""+I.key),I)!he.call(I,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&I.ref===void 0||(Y[ve]=I[ve]);var ve=arguments.length-2;if(ve===1)Y.children=G;else if(1<ve){for(var Ae=Array(ve),Le=0;Le<ve;Le++)Ae[Le]=arguments[Le+2];Y.children=Ae}return ce(p.type,_e,Y)},Ie.createContext=function(p){return p={$$typeof:L,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:M,_context:p},p},Ie.createElement=function(p,I,G){var Y,_e={},ve=null;if(I!=null)for(Y in I.key!==void 0&&(ve=""+I.key),I)he.call(I,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=I[Y]);var Ae=arguments.length-2;if(Ae===1)_e.children=G;else if(1<Ae){for(var Le=Array(Ae),Ne=0;Ne<Ae;Ne++)Le[Ne]=arguments[Ne+2];_e.children=Le}if(p&&p.defaultProps)for(Y in Ae=p.defaultProps,Ae)_e[Y]===void 0&&(_e[Y]=Ae[Y]);return ce(p,ve,_e)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(p){return{$$typeof:X,render:p}},Ie.isValidElement=$e,Ie.lazy=function(p){return{$$typeof:$,_payload:{_status:-1,_result:p},_init:ie}},Ie.memo=function(p,I){return{$$typeof:y,type:p,compare:I===void 0?null:I}},Ie.startTransition=function(p){var I=U.T,G={};U.T=G;try{var Y=p(),_e=U.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ve){ke(ve)}finally{I!==null&&G.types!==null&&(I.types=G.types),U.T=I}},Ie.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Ie.use=function(p){return U.H.use(p)},Ie.useActionState=function(p,I,G){return U.H.useActionState(p,I,G)},Ie.useCallback=function(p,I){return U.H.useCallback(p,I)},Ie.useContext=function(p){return U.H.useContext(p)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(p,I){return U.H.useDeferredValue(p,I)},Ie.useEffect=function(p,I){return U.H.useEffect(p,I)},Ie.useEffectEvent=function(p){return U.H.useEffectEvent(p)},Ie.useId=function(){return U.H.useId()},Ie.useImperativeHandle=function(p,I,G){return U.H.useImperativeHandle(p,I,G)},Ie.useInsertionEffect=function(p,I){return U.H.useInsertionEffect(p,I)},Ie.useLayoutEffect=function(p,I){return U.H.useLayoutEffect(p,I)},Ie.useMemo=function(p,I){return U.H.useMemo(p,I)},Ie.useOptimistic=function(p,I){return U.H.useOptimistic(p,I)},Ie.useReducer=function(p,I,G){return U.H.useReducer(p,I,G)},Ie.useRef=function(p){return U.H.useRef(p)},Ie.useState=function(p){return U.H.useState(p)},Ie.useSyncExternalStore=function(p,I,G){return U.H.useSyncExternalStore(p,I,G)},Ie.useTransition=function(){return U.H.useTransition()},Ie.version="19.2.1",Ie}var cc;function Gl(){return cc||(cc=1,Ao.exports=xp()),Ao.exports}var b=Gl();const Jl=cr(b);var Zl={exports:{}},qa={},dc={exports:{}},mc={};/**
9
+ */var fc;function kp(){if(fc)return Te;fc=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),V=Symbol.iterator;function D(p){return p===null||typeof p!="object"?null:(p=V&&p[V]||p["@@iterator"],typeof p=="function"?p:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,Q={};function te(p,M,H){this.props=p,this.context=M,this.refs=Q,this.updater=H||R}te.prototype.isReactComponent={},te.prototype.setState=function(p,M){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,M,"setState")},te.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function le(){}le.prototype=te.prototype;function re(p,M,H){this.props=p,this.context=M,this.refs=Q,this.updater=H||R}var ye=re.prototype=new le;ye.constructor=re,U(ye,te.prototype),ye.isPureReactComponent=!0;var ae=Array.isArray;function q(){}var B={H:null,A:null,T:null,S:null},be=Object.prototype.hasOwnProperty;function se(p,M,H){var Y=H.ref;return{$$typeof:s,type:p,key:M,ref:Y!==void 0?Y:null,props:H}}function ve(p,M){return se(p.type,M,p.props)}function Ve(p){return typeof p=="object"&&p!==null&&p.$$typeof===s}function ne(p){var M={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(H){return M[H]})}var ie=/\/+/g;function xe(p,M){return typeof p=="object"&&p!==null&&p.key!=null?ne(""+p.key):M.toString(36)}function Fe(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(q,q):(p.status="pending",p.then(function(M){p.status==="pending"&&(p.status="fulfilled",p.value=M)},function(M){p.status==="pending"&&(p.status="rejected",p.reason=M)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function E(p,M,H,Y,Se){var _e=typeof p;(_e==="undefined"||_e==="boolean")&&(p=null);var ze=!1;if(p===null)ze=!0;else switch(_e){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(p.$$typeof){case s:case l:ze=!0;break;case W:return ze=p._init,E(ze(p._payload),M,H,Y,Se)}}if(ze)return Se=Se(p),ze=Y===""?"."+xe(p,0):Y,ae(Se)?(H="",ze!=null&&(H=ze.replace(ie,"$&/")+"/"),E(Se,M,H,"",function(Be){return Be})):Se!=null&&(Ve(Se)&&(Se=ve(Se,H+(Se.key==null||p&&p.key===Se.key?"":(""+Se.key).replace(ie,"$&/")+"/")+ze)),M.push(Se)),1;ze=0;var Re=Y===""?".":Y+":";if(ae(p))for(var et=0;et<p.length;et++)Y=p[et],_e=Re+xe(Y,et),ze+=E(Y,M,H,_e,Se);else if(et=D(p),typeof et=="function")for(p=et.call(p),et=0;!(Y=p.next()).done;)Y=Y.value,_e=Re+xe(Y,et++),ze+=E(Y,M,H,_e,Se);else if(_e==="object"){if(typeof p.then=="function")return E(Fe(p),M,H,Y,Se);throw M=String(p),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ze}function $(p,M,H){if(p==null)return p;var Y=[],Se=0;return E(p,Y,"","",function(_e){return M.call(H,_e,Se++)}),Y}function oe(p){if(p._status===-1){var M=p._result;M=M(),M.then(function(H){(p._status===0||p._status===-1)&&(p._status=1,p._result=H)},function(H){(p._status===0||p._status===-1)&&(p._status=2,p._result=H)}),p._status===-1&&(p._status=0,p._result=M)}if(p._status===1)return p._result.default;throw p._result}var ke=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},Me={map:$,forEach:function(p,M,H){$(p,function(){M.apply(this,arguments)},H)},count:function(p){var M=0;return $(p,function(){M++}),M},toArray:function(p){return $(p,function(M){return M})||[]},only:function(p){if(!Ve(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return Te.Activity=C,Te.Children=Me,Te.Component=te,Te.Fragment=m,Te.Profiler=x,Te.PureComponent=re,Te.StrictMode=c,Te.Suspense=S,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Te.__COMPILER_RUNTIME={__proto__:null,c:function(p){return B.H.useMemoCache(p)}},Te.cache=function(p){return function(){return p.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(p,M,H){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var Y=U({},p.props),Se=p.key;if(M!=null)for(_e in M.key!==void 0&&(Se=""+M.key),M)!be.call(M,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&M.ref===void 0||(Y[_e]=M[_e]);var _e=arguments.length-2;if(_e===1)Y.children=H;else if(1<_e){for(var ze=Array(_e),Re=0;Re<_e;Re++)ze[Re]=arguments[Re+2];Y.children=ze}return se(p.type,Se,Y)},Te.createContext=function(p){return p={$$typeof:N,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:A,_context:p},p},Te.createElement=function(p,M,H){var Y,Se={},_e=null;if(M!=null)for(Y in M.key!==void 0&&(_e=""+M.key),M)be.call(M,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(Se[Y]=M[Y]);var ze=arguments.length-2;if(ze===1)Se.children=H;else if(1<ze){for(var Re=Array(ze),et=0;et<ze;et++)Re[et]=arguments[et+2];Se.children=Re}if(p&&p.defaultProps)for(Y in ze=p.defaultProps,ze)Se[Y]===void 0&&(Se[Y]=ze[Y]);return se(p,_e,Se)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(p){return{$$typeof:G,render:p}},Te.isValidElement=Ve,Te.lazy=function(p){return{$$typeof:W,_payload:{_status:-1,_result:p},_init:oe}},Te.memo=function(p,M){return{$$typeof:y,type:p,compare:M===void 0?null:M}},Te.startTransition=function(p){var M=B.T,H={};B.T=H;try{var Y=p(),Se=B.S;Se!==null&&Se(H,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(q,ke)}catch(_e){ke(_e)}finally{M!==null&&H.types!==null&&(M.types=H.types),B.T=M}},Te.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Te.use=function(p){return B.H.use(p)},Te.useActionState=function(p,M,H){return B.H.useActionState(p,M,H)},Te.useCallback=function(p,M){return B.H.useCallback(p,M)},Te.useContext=function(p){return B.H.useContext(p)},Te.useDebugValue=function(){},Te.useDeferredValue=function(p,M){return B.H.useDeferredValue(p,M)},Te.useEffect=function(p,M){return B.H.useEffect(p,M)},Te.useEffectEvent=function(p){return B.H.useEffectEvent(p)},Te.useId=function(){return B.H.useId()},Te.useImperativeHandle=function(p,M,H){return B.H.useImperativeHandle(p,M,H)},Te.useInsertionEffect=function(p,M){return B.H.useInsertionEffect(p,M)},Te.useLayoutEffect=function(p,M){return B.H.useLayoutEffect(p,M)},Te.useMemo=function(p,M){return B.H.useMemo(p,M)},Te.useOptimistic=function(p,M){return B.H.useOptimistic(p,M)},Te.useReducer=function(p,M,H){return B.H.useReducer(p,M,H)},Te.useRef=function(p){return B.H.useRef(p)},Te.useState=function(p){return B.H.useState(p)},Te.useSyncExternalStore=function(p,M,H){return B.H.useSyncExternalStore(p,M,H)},Te.useTransition=function(){return B.H.useTransition()},Te.version="19.2.1",Te}var mc;function es(){return mc||(mc=1,Fo.exports=kp()),Fo.exports}var v=es();const ts=ur(v);var ns={exports:{}},Ka={},pc={exports:{}},hc={};/**
10
10
  * @license React
11
11
  * scheduler.production.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var fc;function wp(){return fc||(fc=1,(function(u){function l(C,q){var ie=C.length;C.push(q);e:for(;0<ie;){var ke=ie-1>>>1,Ee=C[ke];if(0<k(Ee,q))C[ke]=q,C[ie]=Ee,ie=ke;else break e}}function f(C){return C.length===0?null:C[0]}function d(C){if(C.length===0)return null;var q=C[0],ie=C.pop();if(ie!==q){C[0]=ie;e:for(var ke=0,Ee=C.length,p=Ee>>>1;ke<p;){var I=2*(ke+1)-1,G=C[I],Y=I+1,_e=C[Y];if(0>k(G,ie))Y<Ee&&0>k(_e,G)?(C[ke]=_e,C[Y]=ie,ke=Y):(C[ke]=G,C[I]=ie,ke=I);else if(Y<Ee&&0>k(_e,ie))C[ke]=_e,C[Y]=ie,ke=Y;else break e}}return q}function k(C,q){var ie=C.sortIndex-q.sortIndex;return ie!==0?ie:C.id-q.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var M=performance;u.unstable_now=function(){return M.now()}}else{var L=Date,X=L.now();u.unstable_now=function(){return L.now()-X}}var S=[],y=[],$=1,E=null,W=3,N=!1,P=!1,H=!1,V=!1,ee=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,oe=typeof setImmediate<"u"?setImmediate:null;function re(C){for(var q=f(y);q!==null;){if(q.callback===null)d(y);else if(q.startTime<=C)d(y),q.sortIndex=q.expirationTime,l(S,q);else break;q=f(y)}}function ae(C){if(H=!1,re(C),!P)if(f(S)!==null)P=!0,Q||(Q=!0,te());else{var q=f(y);q!==null&&Pe(ae,q.startTime-C)}}var Q=!1,U=-1,he=5,ce=-1;function ye(){return V?!0:!(u.unstable_now()-ce<he)}function $e(){if(V=!1,Q){var C=u.unstable_now();ce=C;var q=!0;try{e:{P=!1,H&&(H=!1,se(U),U=-1),N=!0;var ie=W;try{t:{for(re(C),E=f(S);E!==null&&!(E.expirationTime>C&&ye());){var ke=E.callback;if(typeof ke=="function"){E.callback=null,W=E.priorityLevel;var Ee=ke(E.expirationTime<=C);if(C=u.unstable_now(),typeof Ee=="function"){E.callback=Ee,re(C),q=!0;break t}E===f(S)&&d(S),re(C)}else d(S);E=f(S)}if(E!==null)q=!0;else{var p=f(y);p!==null&&Pe(ae,p.startTime-C),q=!1}}break e}finally{E=null,W=ie,N=!1}q=void 0}}finally{q?te():Q=!1}}}var te;if(typeof oe=="function")te=function(){oe($e)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,xe=le.port2;le.port1.onmessage=$e,te=function(){xe.postMessage(null)}}else te=function(){ee($e,0)};function Pe(C,q){U=ee(function(){C(u.unstable_now())},q)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(C){C.callback=null},u.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<C?Math.floor(1e3/C):5},u.unstable_getCurrentPriorityLevel=function(){return W},u.unstable_next=function(C){switch(W){case 1:case 2:case 3:var q=3;break;default:q=W}var ie=W;W=q;try{return C()}finally{W=ie}},u.unstable_requestPaint=function(){V=!0},u.unstable_runWithPriority=function(C,q){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var ie=W;W=C;try{return q()}finally{W=ie}},u.unstable_scheduleCallback=function(C,q,ie){var ke=u.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ke+ie:ke):ie=ke,C){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=ie+Ee,C={id:$++,callback:q,priorityLevel:C,startTime:ie,expirationTime:Ee,sortIndex:-1},ie>ke?(C.sortIndex=ie,l(y,C),f(S)===null&&C===f(y)&&(H?(se(U),U=-1):H=!0,Pe(ae,ie-ke))):(C.sortIndex=Ee,l(S,C),P||N||(P=!0,Q||(Q=!0,te()))),C},u.unstable_shouldYield=ye,u.unstable_wrapCallback=function(C){var q=W;return function(){var ie=W;W=q;try{return C.apply(this,arguments)}finally{W=ie}}}})(mc)),mc}var pc;function kp(){return pc||(pc=1,dc.exports=wp()),dc.exports}var Yl={exports:{}},sn={};/**
17
+ */var gc;function Sp(){return gc||(gc=1,(function(s){function l(E,$){var oe=E.length;E.push($);e:for(;0<oe;){var ke=oe-1>>>1,Me=E[ke];if(0<x(Me,$))E[ke]=$,E[oe]=Me,oe=ke;else break e}}function m(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var $=E[0],oe=E.pop();if(oe!==$){E[0]=oe;e:for(var ke=0,Me=E.length,p=Me>>>1;ke<p;){var M=2*(ke+1)-1,H=E[M],Y=M+1,Se=E[Y];if(0>x(H,oe))Y<Me&&0>x(Se,H)?(E[ke]=Se,E[Y]=oe,ke=Y):(E[ke]=H,E[M]=oe,ke=M);else if(Y<Me&&0>x(Se,oe))E[ke]=Se,E[Y]=oe,ke=Y;else break e}}return $}function x(E,$){var oe=E.sortIndex-$.sortIndex;return oe!==0?oe:E.id-$.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var A=performance;s.unstable_now=function(){return A.now()}}else{var N=Date,G=N.now();s.unstable_now=function(){return N.now()-G}}var S=[],y=[],W=1,C=null,V=3,D=!1,R=!1,U=!1,Q=!1,te=typeof setTimeout=="function"?setTimeout:null,le=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function ye(E){for(var $=m(y);$!==null;){if($.callback===null)c(y);else if($.startTime<=E)c(y),$.sortIndex=$.expirationTime,l(S,$);else break;$=m(y)}}function ae(E){if(U=!1,ye(E),!R)if(m(S)!==null)R=!0,q||(q=!0,ne());else{var $=m(y);$!==null&&Fe(ae,$.startTime-E)}}var q=!1,B=-1,be=5,se=-1;function ve(){return Q?!0:!(s.unstable_now()-se<be)}function Ve(){if(Q=!1,q){var E=s.unstable_now();se=E;var $=!0;try{e:{R=!1,U&&(U=!1,le(B),B=-1),D=!0;var oe=V;try{t:{for(ye(E),C=m(S);C!==null&&!(C.expirationTime>E&&ve());){var ke=C.callback;if(typeof ke=="function"){C.callback=null,V=C.priorityLevel;var Me=ke(C.expirationTime<=E);if(E=s.unstable_now(),typeof Me=="function"){C.callback=Me,ye(E),$=!0;break t}C===m(S)&&c(S),ye(E)}else c(S);C=m(S)}if(C!==null)$=!0;else{var p=m(y);p!==null&&Fe(ae,p.startTime-E),$=!1}}break e}finally{C=null,V=oe,D=!1}$=void 0}}finally{$?ne():q=!1}}}var ne;if(typeof re=="function")ne=function(){re(Ve)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,xe=ie.port2;ie.port1.onmessage=Ve,ne=function(){xe.postMessage(null)}}else ne=function(){te(Ve,0)};function Fe(E,$){B=te(function(){E(s.unstable_now())},$)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):be=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return V},s.unstable_next=function(E){switch(V){case 1:case 2:case 3:var $=3;break;default:$=V}var oe=V;V=$;try{return E()}finally{V=oe}},s.unstable_requestPaint=function(){Q=!0},s.unstable_runWithPriority=function(E,$){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var oe=V;V=E;try{return $()}finally{V=oe}},s.unstable_scheduleCallback=function(E,$,oe){var ke=s.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ke+oe:ke):oe=ke,E){case 1:var Me=-1;break;case 2:Me=250;break;case 5:Me=1073741823;break;case 4:Me=1e4;break;default:Me=5e3}return Me=oe+Me,E={id:W++,callback:$,priorityLevel:E,startTime:oe,expirationTime:Me,sortIndex:-1},oe>ke?(E.sortIndex=oe,l(y,E),m(S)===null&&E===m(y)&&(U?(le(B),B=-1):U=!0,Fe(ae,oe-ke))):(E.sortIndex=Me,l(S,E),R||D||(R=!0,q||(q=!0,ne()))),E},s.unstable_shouldYield=ve,s.unstable_wrapCallback=function(E){var $=V;return function(){var oe=V;V=$;try{return E.apply(this,arguments)}finally{V=oe}}}})(hc)),hc}var yc;function _p(){return yc||(yc=1,pc.exports=Sp()),pc.exports}var rs={exports:{}},cn={};/**
18
18
  * @license React
19
19
  * react-dom.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var hc;function _p(){if(hc)return sn;hc=1;var u=Gl();function l(S){var y="https://react.dev/errors/"+S;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var $=2;$<arguments.length;$++)y+="&args[]="+encodeURIComponent(arguments[$])}return"Minified React error #"+S+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var d={d:{f,r:function(){throw Error(l(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},k=Symbol.for("react.portal");function M(S,y,$){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:E==null?null:""+E,children:S,containerInfo:y,implementation:$}}var L=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function X(S,y){if(S==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,sn.createPortal=function(S,y){var $=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(l(299));return M(S,y,null,$)},sn.flushSync=function(S){var y=L.T,$=d.p;try{if(L.T=null,d.p=2,S)return S()}finally{L.T=y,d.p=$,d.d.f()}},sn.preconnect=function(S,y){typeof S=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,d.d.C(S,y))},sn.prefetchDNS=function(S){typeof S=="string"&&d.d.D(S)},sn.preinit=function(S,y){if(typeof S=="string"&&y&&typeof y.as=="string"){var $=y.as,E=X($,y.crossOrigin),W=typeof y.integrity=="string"?y.integrity:void 0,N=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;$==="style"?d.d.S(S,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:E,integrity:W,fetchPriority:N}):$==="script"&&d.d.X(S,{crossOrigin:E,integrity:W,fetchPriority:N,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},sn.preinitModule=function(S,y){if(typeof S=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var $=X(y.as,y.crossOrigin);d.d.M(S,{crossOrigin:$,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&d.d.M(S)},sn.preload=function(S,y){if(typeof S=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var $=y.as,E=X($,y.crossOrigin);d.d.L(S,$,{crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},sn.preloadModule=function(S,y){if(typeof S=="string")if(y){var $=X(y.as,y.crossOrigin);d.d.m(S,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:$,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else d.d.m(S)},sn.requestFormReset=function(S){d.d.r(S)},sn.unstable_batchedUpdates=function(S,y){return S(y)},sn.useFormState=function(S,y,$){return L.H.useFormState(S,y,$)},sn.useFormStatus=function(){return L.H.useHostTransitionStatus()},sn.version="19.2.1",sn}var gc;function yc(){if(gc)return Yl.exports;gc=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),Yl.exports=_p(),Yl.exports}/**
25
+ */var bc;function Ep(){if(bc)return cn;bc=1;var s=es();function l(S){var y="https://react.dev/errors/"+S;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var W=2;W<arguments.length;W++)y+="&args[]="+encodeURIComponent(arguments[W])}return"Minified React error #"+S+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(){}var c={d:{f:m,r:function(){throw Error(l(522))},D:m,C:m,L:m,m,X:m,S:m,M:m},p:0,findDOMNode:null},x=Symbol.for("react.portal");function A(S,y,W){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:C==null?null:""+C,children:S,containerInfo:y,implementation:W}}var N=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function G(S,y){if(S==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,cn.createPortal=function(S,y){var W=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(l(299));return A(S,y,null,W)},cn.flushSync=function(S){var y=N.T,W=c.p;try{if(N.T=null,c.p=2,S)return S()}finally{N.T=y,c.p=W,c.d.f()}},cn.preconnect=function(S,y){typeof S=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(S,y))},cn.prefetchDNS=function(S){typeof S=="string"&&c.d.D(S)},cn.preinit=function(S,y){if(typeof S=="string"&&y&&typeof y.as=="string"){var W=y.as,C=G(W,y.crossOrigin),V=typeof y.integrity=="string"?y.integrity:void 0,D=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;W==="style"?c.d.S(S,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:V,fetchPriority:D}):W==="script"&&c.d.X(S,{crossOrigin:C,integrity:V,fetchPriority:D,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},cn.preinitModule=function(S,y){if(typeof S=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var W=G(y.as,y.crossOrigin);c.d.M(S,{crossOrigin:W,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(S)},cn.preload=function(S,y){if(typeof S=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var W=y.as,C=G(W,y.crossOrigin);c.d.L(S,W,{crossOrigin:C,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},cn.preloadModule=function(S,y){if(typeof S=="string")if(y){var W=G(y.as,y.crossOrigin);c.d.m(S,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:W,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(S)},cn.requestFormReset=function(S){c.d.r(S)},cn.unstable_batchedUpdates=function(S,y){return S(y)},cn.useFormState=function(S,y,W){return N.H.useFormState(S,y,W)},cn.useFormStatus=function(){return N.H.useHostTransitionStatus()},cn.version="19.2.1",cn}var vc;function xc(){if(vc)return rs.exports;vc=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),rs.exports=Ep(),rs.exports}/**
26
26
  * @license React
27
27
  * react-dom-client.production.js
28
28
  *
@@ -30,15 +30,15 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var vc;function Sp(){if(vc)return qa;vc=1;var u=kp(),l=Gl(),f=yc();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function k(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function M(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function L(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function X(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(M(e)!==e)throw Error(d(188))}function y(e){var t=e.alternate;if(!t){if(t=M(e),t===null)throw Error(d(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var a=o.alternate;if(a===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return S(o),e;if(a===r)return S(o),t;a=a.sibling}throw Error(d(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i)throw Error(d(189))}}if(n.alternate!==r)throw Error(d(190))}if(n.tag!==3)throw Error(d(188));return n.stateNode.current===n?e:t}function $(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=$(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,W=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case ee:return"Profiler";case V:return"StrictMode";case ae:return"Suspense";case Q:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case P:return"Portal";case oe:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case re:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case he:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Pe=Array.isArray,C=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ke=[],Ee=-1;function p(e){return{current:e}}function I(e){0>Ee||(e.current=ke[Ee],ke[Ee]=null,Ee--)}function G(e,t){Ee++,ke[Ee]=e.current,e.current=t}var Y=p(null),_e=p(null),ve=p(null),Ae=p(null);function Le(e,t){switch(G(ve,t),G(_e,e),G(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wf(t),e=Hf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(Y),G(Y,e)}function Ne(){I(Y),I(_e),I(ve)}function je(e){e.memoizedState!==null&&G(Ae,e);var t=Y.current,n=Hf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function We(e){_e.current===e&&(I(Y),I(_e)),Ae.current===e&&(I(Ae),zi._currentValue=ie)}var Bt,ne;function de(e){if(Bt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Bt=t&&t[1]||"",ne=-1<n.stack.indexOf(`
33
+ */var wc;function Cp(){if(wc)return Ka;wc=1;var s=_p(),l=es(),m=xc();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function A(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function N(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function G(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(A(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=A(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var a=o.alternate;if(a===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return S(o),e;if(a===r)return S(o),t;a=a.sibling}throw Error(c(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,u=o.child;u;){if(u===n){i=!0,n=o,r=a;break}if(u===r){i=!0,r=o,n=a;break}u=u.sibling}if(!i){for(u=a.child;u;){if(u===n){i=!0,n=a,r=o;break}if(u===r){i=!0,r=a,n=o;break}u=u.sibling}if(!i)throw Error(c(189))}}if(n.alternate!==r)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function W(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=W(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,V=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),be=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),ve=Symbol.for("react.memo_cache_sentinel"),Ve=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=Ve&&e[Ve]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case te:return"Profiler";case Q:return"StrictMode";case ae:return"Suspense";case q:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case re:return e.displayName||"Context";case le:return(e._context.displayName||"Context")+".Consumer";case ye:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case be:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Fe=Array.isArray,E=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ke=[],Me=-1;function p(e){return{current:e}}function M(e){0>Me||(e.current=ke[Me],ke[Me]=null,Me--)}function H(e,t){Me++,ke[Me]=e.current,e.current=t}var Y=p(null),Se=p(null),_e=p(null),ze=p(null);function Re(e,t){switch(H(_e,t),H(Se,e),H(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Um(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Um(t),e=Km(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(Y),H(Y,e)}function et(){M(Y),M(Se),M(_e)}function Be(e){e.memoizedState!==null&&H(ze,e);var t=Y.current,n=Km(t,e.type);t!==n&&(H(Se,e),H(Y,n))}function Oe(e){Se.current===e&&(M(Y),M(Se)),ze.current===e&&(M(ze),Li._currentValue=oe)}var Tt,ee;function ue(e){if(Tt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Tt=t&&t[1]||"",ee=-1<n.stack.indexOf(`
34
34
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
35
- `+Bt+e+ne}var ge=!1;function Me(e,t){if(!e||ge)return"";ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(A){var _=A}Reflect.construct(e,[],O)}else{try{O.call()}catch(A){_=A}e.call(O.prototype)}}else{try{throw Error()}catch(A){_=A}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(A){if(A&&_&&typeof A.stack=="string")return[A.stack,_.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],s=a[1];if(i&&s){var h=i.split(`
36
- `),w=s.split(`
37
- `);for(o=r=0;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;for(;o<w.length&&!w[o].includes("DetermineComponentFrameRoot");)o++;if(r===h.length||o===w.length)for(r=h.length-1,o=w.length-1;1<=r&&0<=o&&h[r]!==w[o];)o--;for(;1<=r&&0<=o;r--,o--)if(h[r]!==w[o]){if(r!==1||o!==1)do if(r--,o--,0>o||h[r]!==w[o]){var R=`
38
- `+h[r].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=r&&0<=o);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?de(n):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de("Lazy");case 13:return e.child!==t&&t!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return de("Activity");default:return""}}function Z(e){try{var t="",n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
35
+ `+Tt+e+ee}var fe=!1;function Pe(e,t){if(!e||fe)return"";fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(I){var _=I}Reflect.construct(e,[],O)}else{try{O.call()}catch(I){_=I}e.call(O.prototype)}}else{try{throw Error()}catch(I){_=I}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(I){if(I&&_&&typeof I.stack=="string")return[I.stack,_.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],u=a[1];if(i&&u){var h=i.split(`
36
+ `),k=u.split(`
37
+ `);for(o=r=0;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;for(;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;if(r===h.length||o===k.length)for(r=h.length-1,o=k.length-1;1<=r&&0<=o&&h[r]!==k[o];)o--;for(;1<=r&&0<=o;r--,o--)if(h[r]!==k[o]){if(r!==1||o!==1)do if(r--,o--,0>o||h[r]!==k[o]){var j=`
38
+ `+h[r].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=r&&0<=o);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ue(n):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue("Lazy");case 13:return e.child!==t&&t!==null?ue("Suspense Fallback"):ue("Suspense");case 19:return ue("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ue("Activity");default:return""}}function _t(e){try{var t="",n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
39
39
  Error generating stack: `+r.message+`
40
- `+r.stack}}var Oe=Object.prototype.hasOwnProperty,K=u.unstable_scheduleCallback,He=u.unstable_cancelCallback,Ge=u.unstable_shouldYield,B=u.unstable_requestPaint,Ze=u.unstable_now,Fe=u.unstable_getCurrentPriorityLevel,un=u.unstable_ImmediatePriority,it=u.unstable_UserBlockingPriority,Kt=u.unstable_NormalPriority,Mn=u.unstable_LowPriority,Ro=u.unstable_IdlePriority,bn=u.log,Hr=u.unstable_setDisableYieldValue,Xt=null,Nt=null;function ot(e){if(typeof bn=="function"&&Hr(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Xt,e)}catch{}}var ft=Math.clz32?Math.clz32:Vr,Be=Math.log,cn=Math.LN2;function Vr(e){return e>>>=0,e===0?32:31-(Be(e)/cn|0)|0}var fn=256,fe=262144,pn=4194304;function xn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s!==0?(r=s&~a,r!==0?o=xn(r):(i&=s,i!==0?o=xn(i):n||(n=s&~e,n!==0&&(o=xn(n))))):(s=r&~a,s!==0?o=xn(s):i!==0?o=xn(i):n||(n=r&~e,n!==0&&(o=xn(n)))),o===0?0:t!==0&&t!==o&&(t&a)===0&&(a=o&-o,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:o}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Zt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Mo(){var e=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Do(e,t,n,r,o,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,h=e.expirationTimes,w=e.hiddenUpdates;for(n=i&~n;0<n;){var R=31-ft(n),O=1<<R;s[R]=0,h[R]=-1;var _=w[R];if(_!==null)for(w[R]=null,R=0;R<_.length;R++){var A=_[R];A!==null&&(A.lane&=-536870913)}n&=~O}r!==0&&Qr(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(i&~t))}function Qr(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ft(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Fi(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ft(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function zo(e,t){var n=t&-t;return n=(n&42)!==0?1:er(n),(n&(e.suspendedLanes|t))!==0?0:n}function er(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function hn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ra(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:fp(e.type))}function Br(e,t){var n=q.p;try{return q.p=e,t()}finally{q.p=n}}var Dn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Dn,qt="__reactProps$"+Dn,mr="__reactContainer$"+Dn,oa="__reactEvents$"+Dn,$i="__reactListeners$"+Dn,aa="__reactHandles$"+Dn,ia="__reactResources$"+Dn,kr="__reactMarker$"+Dn;function Qa(e){delete e[Ct],delete e[qt],delete e[oa],delete e[$i],delete e[aa]}function fr(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mr]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jf(e);e!==null;){if(n=e[Ct])return n;e=Jf(e)}return t}e=n,n=e.parentNode}return null}function Kr(e){if(e=e[Ct]||e[mr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function Rt(e){var t=e[ia];return t||(t=e[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[kr]=!0}var Yt=new Set,la={};function pr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(la[e]=t,e=0;e<t.length;e++)Yt.add(t[e])}var Xr=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]*$"),No={},Oi={};function Ba(e){return Oe.call(Oi,e)?!0:Oe.call(No,e)?!1:Xr.test(e)?Oi[e]=!0:(No[e]=!0,!1)}function wn(e,t,n){if(Ba(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function tr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function nr(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ka(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=Ka(e)?"checked":"value";e._valueTracker=mn(e,t,""+e[t])}}function yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ka(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xa=/[\n"\\]/g;function en(e){return e.replace(Xa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sa(e,t,n,r,o,a,i,s){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+gn(t)):e.value!==""+gn(t)&&(e.value=""+gn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ua(e,i,gn(t)):n!=null?ua(e,i,gn(n)):r!=null&&e.removeAttribute("value"),o==null&&a!=null&&(e.defaultChecked=!!a),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+gn(s):e.removeAttribute("name")}function rr(e,t,n,r,o,a,i,s){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Sr(e);return}n=n!=null?""+gn(n):"",t=t!=null?""+gn(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Sr(e)}function ua(e,t,n){t==="number"&&hr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ui(e,t,n){if(t!=null&&(t=""+gn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+gn(n):""}function Ga(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(d(92));if(Pe(r)){if(1<r.length)throw Error(d(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=gn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Sr(e)}function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cr=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 or(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Cr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function jo(e,t,n){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&or(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&or(e,a,t[a])}function Jr(e){if(e.indexOf("-")===-1)return!1;switch(e){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!1;default:return!0}}var Wt=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"]]),Zr=/^[\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 yr(e){return Zr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var ca=null;function et(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Er=null,Yr=null;function eo(e){var t=Kr(e);if(t&&(e=t.stateNode)){var n=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(sa(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[qt]||null;if(!o)throw Error(d(90));sa(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&yt(r)}break e;case"textarea":Ui(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}}}var da=!1;function ma(e,t,n){if(da)return e(t,n);da=!0;try{var r=e(t);return r}finally{if(da=!1,(Er!==null||Yr!==null)&&(Il(),Er&&(t=Er,e=Yr,Yr=Er=null,eo(t),e)))for(t=0;t<e.length;t++)eo(e[t])}}function ar(e,t){var n=e.stateNode;if(n===null)return null;var r=n[qt]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(d(231,t,typeof n));return n}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wt=!1;if(Un)try{var Et={};Object.defineProperty(Et,"passive",{get:function(){wt=!0}}),window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch{wt=!1}var Mt=null,Ja=null,tn=null;function Tt(){if(tn)return tn;var e,t=Ja,n=t.length,r,o="value"in Mt?Mt.value:Mt.textContent,a=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[a-r];r++);return tn=o.slice(e,1<r?1-r:void 0)}function qn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function To(){return!0}function qi(){return!1}function vt(e){function t(n,r,o,a,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?To:qi,this.isPropagationStopped=qi,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lo=vt(Wn),to=E({},Wn,{view:0,detail:0}),no=vt(to),Fo,$o,zn,Oo=E({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:c,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==zn&&(zn&&e.type==="mousemove"?(Fo=e.screenX-zn.screenX,$o=e.screenY-zn.screenY):$o=Fo=0,zn=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:$o}}),Za=vt(Oo),Ya=E({},Oo,{dataTransfer:0}),ss=vt(Ya),us=E({},to,{relatedTarget:0}),fa=vt(us),cs=E({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),ds=vt(cs),Wi=E({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hi=vt(Wi),ei=E({},Wn,{data:0}),Vi=vt(ei),ms={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fs={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"},ps={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hs(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ps[e])?!!t[e]:!1}function c(){return hs}var D=E({},to,{key:function(e){if(e.key){var t=ms[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:c,charCode:function(e){return e.type==="keypress"?qn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z=vt(D),T=E({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),J=vt(T),me=E({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:c}),Ye=vt(me),At=E({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lt=vt(At),Te=E({},Oo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ue=vt(Te),kt=E({},Wn,{newState:0,oldState:0}),Gt=vt(kt),Ht=[9,13,27,32],Vt=Un&&"CompositionEvent"in window,_n=null;Un&&"documentMode"in document&&(_n=document.documentMode);var Hn=Un&&"TextEvent"in window&&!_n,Ce=Un&&(!Vt||_n&&8<_n&&11>=_n),qe=" ",ht=!1;function lt(e,t){switch(e){case"keyup":return Ht.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sn(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var St=!1;function nn(e,t){switch(e){case"compositionend":return Sn(t);case"keypress":return t.which!==32?null:(ht=!0,qe);case"textInput":return e=t.data,e===qe&&ht?null:e;default:return null}}function gt(e,t){if(St)return e==="compositionend"||!Vt&&lt(e,t)?(e=Tt(),tn=Ja=Mt=null,St=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ce&&t.locale!=="ko"?null:t.data;default:return null}}var Qi={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qi[e.type]:t==="textarea"}function ed(e,t,n,r){Er?Yr?Yr.push(r):Yr=[r]:Er=r,t=jl(t,"onChange"),0<t.length&&(n=new Lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ti=null,ni=null;function qh(e){Lf(e,0)}function Bi(e){var t=dn(e);if(yt(t))return e}function td(e,t){if(e==="change")return t}var nd=!1;if(Un){var gs;if(Un){var ys="oninput"in document;if(!ys){var rd=document.createElement("div");rd.setAttribute("oninput","return;"),ys=typeof rd.oninput=="function"}gs=ys}else gs=!1;nd=gs&&(!document.documentMode||9<document.documentMode)}function od(){ti&&(ti.detachEvent("onpropertychange",ad),ni=ti=null)}function ad(e){if(e.propertyName==="value"&&Bi(ni)){var t=[];ed(t,ni,e,et(e)),ma(qh,t)}}function Wh(e,t,n){e==="focusin"?(od(),ti=t,ni=n,ti.attachEvent("onpropertychange",ad)):e==="focusout"&&od()}function Hh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(ni)}function Vh(e,t){if(e==="click")return Bi(t)}function Qh(e,t){if(e==="input"||e==="change")return Bi(t)}function Bh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:Bh;function ri(e,t){if(Nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Oe.call(t,o)||!Nn(e[o],t[o]))return!1}return!0}function id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ld(e,t){var n=id(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=id(n)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ud(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hr(e.document)}return t}function vs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Kh=Un&&"documentMode"in document&&11>=document.documentMode,pa=null,bs=null,oi=null,xs=!1;function cd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xs||pa==null||pa!==hr(r)||(r=pa,"selectionStart"in r&&vs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),oi&&ri(oi,r)||(oi=r,r=jl(bs,"onSelect"),0<r.length&&(t=new Lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=pa)))}function Uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Uo("Animation","AnimationEnd"),animationiteration:Uo("Animation","AnimationIteration"),animationstart:Uo("Animation","AnimationStart"),transitionrun:Uo("Transition","TransitionRun"),transitionstart:Uo("Transition","TransitionStart"),transitioncancel:Uo("Transition","TransitionCancel"),transitionend:Uo("Transition","TransitionEnd")},ws={},dd={};Un&&(dd=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function qo(e){if(ws[e])return ws[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dd)return ws[e]=t[n];return e}var md=qo("animationend"),fd=qo("animationiteration"),pd=qo("animationstart"),Xh=qo("transitionrun"),Gh=qo("transitionstart"),Jh=qo("transitioncancel"),hd=qo("transitionend"),gd=new Map,ks="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(" ");ks.push("scrollEnd");function ir(e,t){gd.set(e,t),pr(t,[e])}var Ki=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Vn=[],ga=0,_s=0;function Xi(){for(var e=ga,t=_s=ga=0;t<e;){var n=Vn[t];Vn[t++]=null;var r=Vn[t];Vn[t++]=null;var o=Vn[t];Vn[t++]=null;var a=Vn[t];if(Vn[t++]=null,r!==null&&o!==null){var i=r.pending;i===null?o.next=o:(o.next=i.next,i.next=o),r.pending=o}a!==0&&yd(n,o,a)}}function Gi(e,t,n,r){Vn[ga++]=e,Vn[ga++]=t,Vn[ga++]=n,Vn[ga++]=r,_s|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ss(e,t,n,r){return Gi(e,t,n,r),Ji(e)}function Wo(e,t){return Gi(e,null,null,t),Ji(e)}function yd(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var o=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(o=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,o&&t!==null&&(o=31-ft(n),e=a.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ji(e){if(50<Ei)throw Ei=0,zu=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ya={};function Zh(e,t,n,r){this.tag=e,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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,n,r){return new Zh(e,t,n,r)}function Cs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ar(e,t){var n=e.alternate;return n===null?(n=jn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zi(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")Cs(e)&&(i=1);else if(typeof e=="string")i=r0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=jn(31,n,t,o),e.elementType=ce,e.lanes=a,e;case H:return Ho(n.children,o,a,t);case V:i=8,o|=24;break;case ee:return e=jn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ae:return e=jn(13,n,t,o),e.elementType=ae,e.lanes=a,e;case Q:return e=jn(19,n,t,o),e.elementType=Q,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oe:i=10;break e;case se:i=9;break e;case re:i=11;break e;case U:i=14;break e;case he:i=16,r=null;break e}i=29,n=Error(d(130,e===null?"null":typeof e,"")),r=null}return t=jn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Ho(e,t,n,r){return e=jn(7,e,r,t),e.lanes=n,e}function Es(e,t,n){return e=jn(6,e,null,t),e.lanes=n,e}function bd(e){var t=jn(18,null,null,0);return t.stateNode=e,t}function As(e,t,n){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xd=new WeakMap;function Qn(e,t){if(typeof e=="object"&&e!==null){var n=xd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Z(t)},xd.set(e,t),t)}return{value:e,source:t,stack:Z(t)}}var va=[],ba=0,Yi=null,ai=0,Bn=[],Kn=0,ro=null,vr=1,br="";function Ir(e,t){va[ba++]=ai,va[ba++]=Yi,Yi=e,ai=t}function wd(e,t,n){Bn[Kn++]=vr,Bn[Kn++]=br,Bn[Kn++]=ro,ro=e;var r=vr;e=br;var o=32-ft(r)-1;r&=~(1<<o),n+=1;var a=32-ft(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,vr=1<<32-ft(t)+o|n<<o|r,br=a+e}else vr=1<<a|n<<o|r,br=e}function Is(e){e.return!==null&&(Ir(e,1),wd(e,1,0))}function Ps(e){for(;e===Yi;)Yi=va[--ba],va[ba]=null,ai=va[--ba],va[ba]=null;for(;e===ro;)ro=Bn[--Kn],Bn[Kn]=null,br=Bn[--Kn],Bn[Kn]=null,vr=Bn[--Kn],Bn[Kn]=null}function kd(e,t){Bn[Kn++]=vr,Bn[Kn++]=br,Bn[Kn++]=ro,vr=t.id,br=t.overflow,ro=e}var rn=null,bt=null,Je=!1,oo=null,Xn=!1,Rs=Error(d(519));function ao(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ii(Qn(t,e)),Rs}function _d(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[qt]=r,n){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(n=0;n<Ii.length;n++)Qe(Ii[n],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),rr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Ga(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Uf(t.textContent,n)?(r.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),r.onScroll!=null&&Qe("scroll",t),r.onScrollEnd!=null&&Qe("scrollend",t),r.onClick!=null&&(t.onclick=kn),t=!0):t=!1,t||ao(e,!0)}function Sd(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:rn=rn.return}}function xa(e){if(e!==rn)return!1;if(!Je)return Sd(e),Je=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ku(e.type,e.memoizedProps)),n=!n),n&&bt&&ao(e),Sd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));bt=Gf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));bt=Gf(e)}else t===27?(t=bt,xo(e.type)?(e=Yu,Yu=null,bt=e):bt=t):bt=rn?Gn(e.stateNode.nextSibling):null;return!0}function Vo(){bt=rn=null,Je=!1}function Ms(){var e=oo;return e!==null&&(In===null?In=e:In.push.apply(In,e),oo=null),e}function ii(e){oo===null?oo=[e]:oo.push(e)}var Ds=p(null),Qo=null,Pr=null;function io(e,t,n){G(Ds,t._currentValue),t._currentValue=n}function Rr(e){e._currentValue=Ds.current,I(Ds)}function zs(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ns(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){var i=o.child;a=a.firstContext;e:for(;a!==null;){var s=a;a=o;for(var h=0;h<t.length;h++)if(s.context===t[h]){a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),zs(a.return,n,e),r||(i=null);break e}a=s.next}}else if(o.tag===18){if(i=o.return,i===null)throw Error(d(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),zs(i,n,e),i=null}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===e){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}}function wa(e,t,n,r){e=null;for(var o=t,a=!1;o!==null;){if(!a){if((o.flags&524288)!==0)a=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var i=o.alternate;if(i===null)throw Error(d(387));if(i=i.memoizedProps,i!==null){var s=o.type;Nn(o.pendingProps.value,i.value)||(e!==null?e.push(s):e=[s])}}else if(o===Ae.current){if(i=o.alternate,i===null)throw Error(d(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(zi):e=[zi])}o=o.return}e!==null&&Ns(t,e,n,r),t.flags|=262144}function el(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bo(e){Qo=e,Pr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Cd(Qo,e)}function tl(e,t){return Qo===null&&Bo(e),Cd(e,t)}function Cd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pr===null){if(e===null)throw Error(d(308));Pr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pr=Pr.next=t;return n}var Yh=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},eg=u.unstable_scheduleCallback,tg=u.unstable_NormalPriority,Ft={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function js(){return{controller:new Yh,data:new Map,refCount:0}}function li(e){e.refCount--,e.refCount===0&&eg(tg,function(){e.controller.abort()})}var si=null,Ts=0,ka=0,_a=null;function ng(e,t){if(si===null){var n=si=[];Ts=0,ka=$u(),_a={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Ts++,t.then(Ed,Ed),t}function Ed(){if(--Ts===0&&si!==null){_a!==null&&(_a.status="fulfilled");var e=si;si=null,ka=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rg(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var Ad=C.S;C.S=function(e,t){df=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ng(e,t),Ad!==null&&Ad(e,t)};var Ko=p(null);function Ls(){var e=Ko.current;return e!==null?e:pt.pooledCache}function nl(e,t){t===null?G(Ko,Ko.current):G(Ko,t.pool)}function Id(){var e=Ls();return e===null?null:{parent:Ft._currentValue,pool:e}}var Sa=Error(d(460)),Fs=Error(d(474)),rl=Error(d(542)),ol={then:function(){}};function Pd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(kn,kn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dd(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=r}},function(r){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dd(e),e}throw Go=t,Sa}}function Xo(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Go=n,Sa):n}}var Go=null;function Md(){if(Go===null)throw Error(d(459));var e=Go;return Go=null,e}function Dd(e){if(e===Sa||e===rl)throw Error(d(483))}var Ca=null,ui=0;function al(e){var t=ui;return ui+=1,Ca===null&&(Ca=[]),Rd(Ca,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function il(e,t){throw t.$$typeof===W?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zd(e){function t(v,g){if(e){var x=v.deletions;x===null?(v.deletions=[g],v.flags|=16):x.push(g)}}function n(v,g){if(!e)return null;for(;g!==null;)t(v,g),g=g.sibling;return null}function r(v){for(var g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function o(v,g){return v=Ar(v,g),v.index=0,v.sibling=null,v}function a(v,g,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<g?(v.flags|=67108866,g):x):(v.flags|=67108866,g)):(v.flags|=1048576,g)}function i(v){return e&&v.alternate===null&&(v.flags|=67108866),v}function s(v,g,x,j){return g===null||g.tag!==6?(g=Es(x,v.mode,j),g.return=v,g):(g=o(g,x),g.return=v,g)}function h(v,g,x,j){var we=x.type;return we===H?R(v,g,x.props.children,j,x.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===he&&Xo(we)===g.type)?(g=o(g,x.props),ci(g,x),g.return=v,g):(g=Zi(x.type,x.key,x.props,null,v.mode,j),ci(g,x),g.return=v,g)}function w(v,g,x,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==x.containerInfo||g.stateNode.implementation!==x.implementation?(g=As(x,v.mode,j),g.return=v,g):(g=o(g,x.children||[]),g.return=v,g)}function R(v,g,x,j,we){return g===null||g.tag!==7?(g=Ho(x,v.mode,j,we),g.return=v,g):(g=o(g,x),g.return=v,g)}function O(v,g,x){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Es(""+g,v.mode,x),g.return=v,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case N:return x=Zi(g.type,g.key,g.props,null,v.mode,x),ci(x,g),x.return=v,x;case P:return g=As(g,v.mode,x),g.return=v,g;case he:return g=Xo(g),O(v,g,x)}if(Pe(g)||te(g))return g=Ho(g,v.mode,x,null),g.return=v,g;if(typeof g.then=="function")return O(v,al(g),x);if(g.$$typeof===oe)return O(v,tl(v,g),x);il(v,g)}return null}function _(v,g,x,j){var we=g!==null?g.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return we!==null?null:s(v,g,""+x,j);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case N:return x.key===we?h(v,g,x,j):null;case P:return x.key===we?w(v,g,x,j):null;case he:return x=Xo(x),_(v,g,x,j)}if(Pe(x)||te(x))return we!==null?null:R(v,g,x,j,null);if(typeof x.then=="function")return _(v,g,al(x),j);if(x.$$typeof===oe)return _(v,g,tl(v,x),j);il(v,x)}return null}function A(v,g,x,j,we){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return v=v.get(x)||null,s(g,v,""+j,we);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case N:return v=v.get(j.key===null?x:j.key)||null,h(g,v,j,we);case P:return v=v.get(j.key===null?x:j.key)||null,w(g,v,j,we);case he:return j=Xo(j),A(v,g,x,j,we)}if(Pe(j)||te(j))return v=v.get(x)||null,R(g,v,j,we,null);if(typeof j.then=="function")return A(v,g,x,al(j),we);if(j.$$typeof===oe)return A(v,g,x,tl(g,j),we);il(g,j)}return null}function ue(v,g,x,j){for(var we=null,nt=null,pe=g,ze=g=0,Xe=null;pe!==null&&ze<x.length;ze++){pe.index>ze?(Xe=pe,pe=null):Xe=pe.sibling;var rt=_(v,pe,x[ze],j);if(rt===null){pe===null&&(pe=Xe);break}e&&pe&&rt.alternate===null&&t(v,pe),g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt,pe=Xe}if(ze===x.length)return n(v,pe),Je&&Ir(v,ze),we;if(pe===null){for(;ze<x.length;ze++)pe=O(v,x[ze],j),pe!==null&&(g=a(pe,g,ze),nt===null?we=pe:nt.sibling=pe,nt=pe);return Je&&Ir(v,ze),we}for(pe=r(pe);ze<x.length;ze++)Xe=A(pe,v,ze,x[ze],j),Xe!==null&&(e&&Xe.alternate!==null&&pe.delete(Xe.key===null?ze:Xe.key),g=a(Xe,g,ze),nt===null?we=Xe:nt.sibling=Xe,nt=Xe);return e&&pe.forEach(function(Co){return t(v,Co)}),Je&&Ir(v,ze),we}function Se(v,g,x,j){if(x==null)throw Error(d(151));for(var we=null,nt=null,pe=g,ze=g=0,Xe=null,rt=x.next();pe!==null&&!rt.done;ze++,rt=x.next()){pe.index>ze?(Xe=pe,pe=null):Xe=pe.sibling;var Co=_(v,pe,rt.value,j);if(Co===null){pe===null&&(pe=Xe);break}e&&pe&&Co.alternate===null&&t(v,pe),g=a(Co,g,ze),nt===null?we=Co:nt.sibling=Co,nt=Co,pe=Xe}if(rt.done)return n(v,pe),Je&&Ir(v,ze),we;if(pe===null){for(;!rt.done;ze++,rt=x.next())rt=O(v,rt.value,j),rt!==null&&(g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt);return Je&&Ir(v,ze),we}for(pe=r(pe);!rt.done;ze++,rt=x.next())rt=A(pe,v,ze,rt.value,j),rt!==null&&(e&&rt.alternate!==null&&pe.delete(rt.key===null?ze:rt.key),g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&pe.forEach(function(p0){return t(v,p0)}),Je&&Ir(v,ze),we}function mt(v,g,x,j){if(typeof x=="object"&&x!==null&&x.type===H&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case N:e:{for(var we=x.key;g!==null;){if(g.key===we){if(we=x.type,we===H){if(g.tag===7){n(v,g.sibling),j=o(g,x.props.children),j.return=v,v=j;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===he&&Xo(we)===g.type){n(v,g.sibling),j=o(g,x.props),ci(j,x),j.return=v,v=j;break e}n(v,g);break}else t(v,g);g=g.sibling}x.type===H?(j=Ho(x.props.children,v.mode,j,x.key),j.return=v,v=j):(j=Zi(x.type,x.key,x.props,null,v.mode,j),ci(j,x),j.return=v,v=j)}return i(v);case P:e:{for(we=x.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(v,g.sibling),j=o(g,x.children||[]),j.return=v,v=j;break e}else{n(v,g);break}else t(v,g);g=g.sibling}j=As(x,v.mode,j),j.return=v,v=j}return i(v);case he:return x=Xo(x),mt(v,g,x,j)}if(Pe(x))return ue(v,g,x,j);if(te(x)){if(we=te(x),typeof we!="function")throw Error(d(150));return x=we.call(x),Se(v,g,x,j)}if(typeof x.then=="function")return mt(v,g,al(x),j);if(x.$$typeof===oe)return mt(v,g,tl(v,x),j);il(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,g!==null&&g.tag===6?(n(v,g.sibling),j=o(g,x),j.return=v,v=j):(n(v,g),j=Es(x,v.mode,j),j.return=v,v=j),i(v)):n(v,g)}return function(v,g,x,j){try{ui=0;var we=mt(v,g,x,j);return Ca=null,we}catch(pe){if(pe===Sa||pe===rl)throw pe;var nt=jn(29,pe,null,v.mode);return nt.lanes=j,nt.return=v,nt}finally{}}}var Jo=zd(!0),Nd=zd(!1),lo=!1;function $s(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Os(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(at&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=Ji(e),yd(e,null,n),t}return Gi(e,r,t,n),Ji(e)}function di(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fi(e,n)}}function Us(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?o=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qs=!1;function mi(){if(qs){var e=_a;if(e!==null)throw e}}function fi(e,t,n,r){qs=!1;var o=e.updateQueue;lo=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var h=s,w=h.next;h.next=null,i===null?a=w:i.next=w,i=h;var R=e.alternate;R!==null&&(R=R.updateQueue,s=R.lastBaseUpdate,s!==i&&(s===null?R.firstBaseUpdate=w:s.next=w,R.lastBaseUpdate=h))}if(a!==null){var O=o.baseState;i=0,R=w=h=null,s=a;do{var _=s.lane&-536870913,A=_!==s.lane;if(A?(Ke&_)===_:(r&_)===_){_!==0&&_===ka&&(qs=!0),R!==null&&(R=R.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var ue=e,Se=s;_=t;var mt=n;switch(Se.tag){case 1:if(ue=Se.payload,typeof ue=="function"){O=ue.call(mt,O,_);break e}O=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=Se.payload,_=typeof ue=="function"?ue.call(mt,O,_):ue,_==null)break e;O=E({},O,_);break e;case 2:lo=!0}}_=s.callback,_!==null&&(e.flags|=64,A&&(e.flags|=8192),A=o.callbacks,A===null?o.callbacks=[_]:A.push(_))}else A={lane:_,tag:s.tag,payload:s.payload,callback:s.callback,next:null},R===null?(w=R=A,h=O):R=R.next=A,i|=_;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;A=s,s=A.next,A.next=null,o.lastBaseUpdate=A,o.shared.pending=null}}while(!0);R===null&&(h=O),o.baseState=h,o.firstBaseUpdate=w,o.lastBaseUpdate=R,a===null&&(o.shared.lanes=0),ho|=i,e.lanes=i,e.memoizedState=O}}function jd(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function Td(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jd(n[e],t)}var Ea=p(null),ll=p(0);function Ld(e,t){e=$r,G(ll,e),G(Ea,t),$r=e|t.baseLanes}function Ws(){G(ll,$r),G(Ea,Ea.current)}function Hs(){$r=ll.current,I(Ea),I(ll)}var Tn=p(null),lr=null;function co(e){var t=e.alternate;G(Dt,Dt.current&1),G(Tn,e),lr===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(lr=e)}function Vs(e){G(Dt,Dt.current),G(Tn,e),lr===null&&(lr=e)}function Fd(e){e.tag===22?(G(Dt,Dt.current),G(Tn,e),lr===null&&(lr=e)):mo()}function mo(){G(Dt,Dt.current),G(Tn,Tn.current)}function Ln(e){I(Tn),lr===e&&(lr=null),I(Dt)}var Dt=p(0);function sl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ju(n)||Zu(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mr=0,Re=null,ct=null,$t=null,ul=!1,Aa=!1,Zo=!1,cl=0,pi=0,Ia=null,og=0;function It(){throw Error(d(321))}function Qs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nn(e[n],t[n]))return!1;return!0}function Bs(e,t,n,r,o,a){return Mr=a,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?wm:su,Zo=!1,a=n(r,o),Zo=!1,Aa&&(a=Od(t,n,r,o)),$d(e),a}function $d(e){C.H=yi;var t=ct!==null&&ct.next!==null;if(Mr=0,$t=ct=Re=null,ul=!1,pi=0,Ia=null,t)throw Error(d(300));e===null||Ot||(e=e.dependencies,e!==null&&el(e)&&(Ot=!0))}function Od(e,t,n,r){Re=e;var o=0;do{if(Aa&&(Ia=null),pi=0,Aa=!1,25<=o)throw Error(d(301));if(o+=1,$t=ct=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}C.H=km,a=t(n,r)}while(Aa);return a}function ag(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?hi(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Re.flags|=1024),t}function Ks(){var e=cl!==0;return cl=0,e}function Xs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Gs(e){if(ul){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ul=!1}Mr=0,$t=ct=Re=null,Aa=!1,pi=cl=0,Ia=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Re.memoizedState=$t=e:$t=$t.next=e,$t}function zt(){if(ct===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=$t===null?Re.memoizedState:$t.next;if(t!==null)$t=t,ct=e;else{if(e===null)throw Re.alternate===null?Error(d(467)):Error(d(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},$t===null?Re.memoizedState=$t=e:$t=$t.next=e}return $t}function dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hi(e){var t=pi;return pi+=1,Ia===null&&(Ia=[]),e=Rd(Ia,e,t),t=Re,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?wm:su),e}function ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hi(e);if(e.$$typeof===oe)return on(e)}throw Error(d(438,String(e)))}function Js(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Re.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=dl(),Re.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ye;return t.index++,n}function Dr(e,t){return typeof t=="function"?t(e):t}function fl(e){var t=zt();return Zs(t,ct,e)}function Zs(e,t,n){var r=e.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=n;var o=e.baseQueue,a=r.pending;if(a!==null){if(o!==null){var i=o.next;o.next=a.next,a.next=i}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,o===null)e.memoizedState=a;else{t=o.next;var s=i=null,h=null,w=t,R=!1;do{var O=w.lane&-536870913;if(O!==w.lane?(Ke&O)===O:(Mr&O)===O){var _=w.revertLane;if(_===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null}),O===ka&&(R=!0);else if((Mr&_)===_){w=w.next,_===ka&&(R=!0);continue}else O={lane:0,revertLane:w.revertLane,gesture:null,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},h===null?(s=h=O,i=a):h=h.next=O,Re.lanes|=_,ho|=_;O=w.action,Zo&&n(a,O),a=w.hasEagerState?w.eagerState:n(a,O)}else _={lane:O,revertLane:w.revertLane,gesture:w.gesture,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},h===null?(s=h=_,i=a):h=h.next=_,Re.lanes|=O,ho|=O;w=w.next}while(w!==null&&w!==t);if(h===null?i=a:h.next=s,!Nn(a,e.memoizedState)&&(Ot=!0,R&&(n=_a,n!==null)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=h,r.lastRenderedState=a}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ys(e){var t=zt(),n=t.queue;if(n===null)throw Error(d(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);Nn(a,t.memoizedState)||(Ot=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ud(e,t,n){var r=Re,o=zt(),a=Je;if(a){if(n===void 0)throw Error(d(407));n=n()}else n=t();var i=!Nn((ct||o).memoizedState,n);if(i&&(o.memoizedState=n,Ot=!0),o=o.queue,nu(Hd.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Pa(9,{destroy:void 0},Wd.bind(null,r,o,n,t),null),pt===null)throw Error(d(349));a||(Mr&127)!==0||qd(r,t,n)}return n}function qd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=dl(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wd(e,t,n,r){t.value=n,t.getSnapshot=r,Vd(t)&&Qd(e)}function Hd(e,t,n){return n(function(){Vd(t)&&Qd(e)})}function Vd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nn(e,n)}catch{return!0}}function Qd(e){var t=Wo(e,2);t!==null&&Pn(t,e,2)}function eu(e){var t=yn();if(typeof e=="function"){var n=e;if(e=n(),Zo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},t}function Bd(e,t,n,r){return e.baseState=n,Zs(e,ct,typeof r=="function"?r:Dr)}function ig(e,t,n,r,o){if(gl(e))throw Error(d(485));if(e=t.action,e!==null){var a={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){a.listeners.push(i)}};C.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,Kd(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Kd(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=C.T,i={};C.T=i;try{var s=n(o,r),h=C.S;h!==null&&h(i,s),Xd(e,t,s)}catch(w){tu(e,t,w)}finally{a!==null&&i.types!==null&&(a.types=i.types),C.T=a}}else try{a=n(o,r),Xd(e,t,a)}catch(w){tu(e,t,w)}}function Xd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Gd(e,t,r)},function(r){return tu(e,t,r)}):Gd(e,t,n)}function Gd(e,t,n){t.status="fulfilled",t.value=n,Jd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Kd(e,n)))}function tu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Jd(t),t=t.next;while(t!==r)}e.action=null}function Jd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zd(e,t){return t}function Yd(e,t){if(Je){var n=pt.formState;if(n!==null){e:{var r=Re;if(Je){if(bt){t:{for(var o=bt,a=Xn;o.nodeType!==8;){if(!a){o=null;break t}if(o=Gn(o.nextSibling),o===null){o=null;break t}}a=o.data,o=a==="F!"||a==="F"?o:null}if(o){bt=Gn(o.nextSibling),r=o.data==="F!";break e}}ao(r)}r=!1}r&&(t=n[0])}}return n=yn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zd,lastRenderedState:t},n.queue=r,n=vm.bind(null,Re,r),r.dispatch=n,r=eu(!1),a=lu.bind(null,Re,!1,r.queue),r=yn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=ig.bind(null,Re,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function em(e){var t=zt();return tm(t,ct,e)}function tm(e,t,n){if(t=Zs(e,t,Zd)[0],e=fl(Dr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=hi(t)}catch(i){throw i===Sa?rl:i}else r=t;t=zt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,Pa(9,{destroy:void 0},lg.bind(null,o,n),null)),[r,a,e]}function lg(e,t){e.action=t}function nm(e){var t=zt(),n=ct;if(n!==null)return tm(t,n,e);zt(),t=t.memoizedState,n=zt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pa(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Re.updateQueue,t===null&&(t=dl(),Re.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rm(){return zt().memoizedState}function pl(e,t,n,r){var o=yn();Re.flags|=e,o.memoizedState=Pa(1|t,{destroy:void 0},n,r===void 0?null:r)}function hl(e,t,n,r){var o=zt();r=r===void 0?null:r;var a=o.memoizedState.inst;ct!==null&&r!==null&&Qs(r,ct.memoizedState.deps)?o.memoizedState=Pa(t,a,n,r):(Re.flags|=e,o.memoizedState=Pa(1|t,a,n,r))}function om(e,t){pl(8390656,8,e,t)}function nu(e,t){hl(2048,8,e,t)}function sg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=dl(),Re.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function am(e){var t=zt().memoizedState;return sg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function im(e,t){return hl(4,2,e,t)}function lm(e,t){return hl(4,4,e,t)}function sm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function um(e,t,n){n=n!=null?n.concat([e]):null,hl(4,4,sm.bind(null,t,e),n)}function ru(){}function cm(e,t){var n=zt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dm(e,t){var n=zt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qs(t,r[1]))return r[0];if(r=e(),Zo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function ou(e,t,n){return n===void 0||(Mr&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ff(),Re.lanes|=e,ho|=e,n)}function mm(e,t,n,r){return Nn(n,t)?n:Ea.current!==null?(e=ou(e,n,r),Nn(e,t)||(Ot=!0),e):(Mr&42)===0||(Mr&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=n):(e=ff(),Re.lanes|=e,ho|=e,t)}function fm(e,t,n,r,o){var a=q.p;q.p=a!==0&&8>a?a:8;var i=C.T,s={};C.T=s,lu(e,!1,t,n);try{var h=o(),w=C.S;if(w!==null&&w(s,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var R=rg(h,r);gi(e,t,R,On(e))}else gi(e,t,r,On(e))}catch(O){gi(e,t,{then:function(){},status:"rejected",reason:O},On())}finally{q.p=a,i!==null&&s.types!==null&&(i.types=s.types),C.T=i}}function ug(){}function au(e,t,n,r){if(e.tag!==5)throw Error(d(476));var o=pm(e).queue;fm(e,o,t,ie,n===null?ug:function(){return hm(e),n(r)})}function pm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hm(e){var t=pm(e);t.next===null&&(t=e.alternate.memoizedState),gi(e,t.next.queue,{},On())}function iu(){return on(zi)}function gm(){return zt().memoizedState}function ym(){return zt().memoizedState}function cg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=On();e=so(n);var r=uo(t,e,n);r!==null&&(Pn(r,t,n),di(r,t,n)),t={cache:js()},e.payload=t;return}t=t.return}}function dg(e,t,n){var r=On();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gl(e)?bm(t,n):(n=Ss(e,t,n,r),n!==null&&(Pn(n,e,r),xm(n,t,r)))}function vm(e,t,n){var r=On();gi(e,t,n,r)}function gi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gl(e))bm(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,s=a(i,n);if(o.hasEagerState=!0,o.eagerState=s,Nn(s,i))return Gi(e,t,o,0),pt===null&&Xi(),!1}catch{}finally{}if(n=Ss(e,t,o,r),n!==null)return Pn(n,e,r),xm(n,t,r),!0}return!1}function lu(e,t,n,r){if(r={lane:2,revertLane:$u(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gl(e)){if(t)throw Error(d(479))}else t=Ss(e,n,r,2),t!==null&&Pn(t,e,2)}function gl(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function bm(e,t){Aa=ul=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fi(e,n)}}var yi={readContext:on,use:ml,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};yi.useEffectEvent=It;var wm={readContext:on,use:ml,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:om,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,pl(4194308,4,sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){pl(4,2,e,t)},useMemo:function(e,t){var n=yn();t=t===void 0?null:t;var r=e();if(Zo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=yn();if(n!==void 0){var o=n(t);if(Zo){ot(!0);try{n(t)}finally{ot(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=dg.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:function(e){e=eu(e);var t=e.queue,n=vm.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ru,useDeferredValue:function(e,t){var n=yn();return ou(n,e,t)},useTransition:function(){var e=eu(!1);return e=fm.bind(null,Re,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Re,o=yn();if(Je){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),pt===null)throw Error(d(349));(Ke&127)!==0||qd(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,om(Hd.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,{destroy:void 0},Wd.bind(null,r,a,n,t),null),n},useId:function(){var e=yn(),t=pt.identifierPrefix;if(Je){var n=br,r=vr;n=(r&~(1<<32-ft(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cl++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=og++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:iu,useFormState:Yd,useActionState:Yd,useOptimistic:function(e){var t=yn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lu.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:Js,useCacheRefresh:function(){return yn().memoizedState=cg.bind(null,Re)},useEffectEvent:function(e){var t=yn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(d(440));return n.impl.apply(void 0,arguments)}}},su={readContext:on,use:ml,useCallback:cm,useContext:on,useEffect:nu,useImperativeHandle:um,useInsertionEffect:im,useLayoutEffect:lm,useMemo:dm,useReducer:fl,useRef:rm,useState:function(){return fl(Dr)},useDebugValue:ru,useDeferredValue:function(e,t){var n=zt();return mm(n,ct.memoizedState,e,t)},useTransition:function(){var e=fl(Dr)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:hi(e),t]},useSyncExternalStore:Ud,useId:gm,useHostTransitionStatus:iu,useFormState:em,useActionState:em,useOptimistic:function(e,t){var n=zt();return Bd(n,ct,e,t)},useMemoCache:Js,useCacheRefresh:ym};su.useEffectEvent=am;var km={readContext:on,use:ml,useCallback:cm,useContext:on,useEffect:nu,useImperativeHandle:um,useInsertionEffect:im,useLayoutEffect:lm,useMemo:dm,useReducer:Ys,useRef:rm,useState:function(){return Ys(Dr)},useDebugValue:ru,useDeferredValue:function(e,t){var n=zt();return ct===null?ou(n,e,t):mm(n,ct.memoizedState,e,t)},useTransition:function(){var e=Ys(Dr)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:hi(e),t]},useSyncExternalStore:Ud,useId:gm,useHostTransitionStatus:iu,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=zt();return ct!==null?Bd(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Js,useCacheRefresh:ym};km.useEffectEvent=am;function uu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=On(),o=so(r);o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),di(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=On(),o=so(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),di(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=On(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pn(t,e,n),di(t,e,n))}};function _m(e,t,n,r,o,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!ri(n,r)||!ri(o,a):!0}function Sm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&cu.enqueueReplaceState(t,t.state,null)}function Yo(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=E({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Cm(e){Ki(e)}function Em(e){console.error(e)}function Am(e){Ki(e)}function yl(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Im(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function du(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){yl(e,t)},n}function Pm(e){return e=so(e),e.tag=3,e}function Rm(e,t,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var a=r.value;e.payload=function(){return o(a)},e.callback=function(){Im(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Im(t,n,r),typeof o!="function"&&(go===null?go=new Set([this]):go.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function mg(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&wa(t,n,o,!0),n=Tn.current,n!==null){switch(n.tag){case 31:case 13:return lr===null?Pl():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===ol?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Tu(e,r,o)),!1;case 22:return n.flags|=65536,r===ol?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Tu(e,r,o)),!1}throw Error(d(435,n.tag))}return Tu(e,r,o),Pl(),!1}if(Je)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Rs&&(e=Error(d(422),{cause:r}),ii(Qn(e,n)))):(r!==Rs&&(t=Error(d(423),{cause:r}),ii(Qn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Qn(r,n),o=du(e.stateNode,r,o),Us(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(d(520),{cause:r});if(a=Qn(a,n),Ci===null?Ci=[a]:Ci.push(a),Pt!==4&&(Pt=2),t===null)return!0;r=Qn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=du(n.stateNode,r,e),Us(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(go===null||!go.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Pm(o),Rm(o,e,n,r),Us(n,o),!1}n=n.return}while(n!==null);return!1}var mu=Error(d(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?Nd(t,null,n,r):Jo(t,e.child,n,r)}function Mm(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Bo(t),r=Bs(e,t,n,i,a,o),s=Ks(),e!==null&&!Ot?(Xs(e,t,o),zr(e,t,o)):(Je&&s&&Is(t),t.flags|=1,an(e,t,r,o),t.child)}function Dm(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Cs(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zm(e,t,a,r,o)):(e=Zi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!xu(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:ri,n(i,r)&&e.ref===t.ref)return zr(e,t,o)}return t.flags|=1,e=Ar(a,r),e.ref=t.ref,e.return=t,t.child=e}function zm(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(ri(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,xu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,zr(e,t,o)}return fu(e,t,n,r,o)}function Nm(e,t,n,r){var o=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~a}else r=0,t.child=null;return jm(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nl(t,a!==null?a.cachePool:null),a!==null?Ld(t,a):Ws(),Fd(t);else return r=t.lanes=536870912,jm(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(nl(t,a.cachePool),Ld(t,a),mo(),t.memoizedState=null):(e!==null&&nl(t,null),Ws(),mo());return an(e,t,o,n),t.child}function vi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jm(e,t,n,r,o){var a=Ls();return a=a===null?null:{parent:Ft._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&nl(t,null),Ws(),Fd(t),e!==null&&wa(e,t,r,!0),t.childLanes=o,null}function vl(e,t){return t=xl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tm(e,t,n){return Jo(t,e.child,null,n),e=vl(t,t.pendingProps),e.flags|=2,Ln(t),t.memoizedState=null,e}function fg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Je){if(r.mode==="hidden")return e=vl(t,r),t.lanes=536870912,vi(null,e);if(Vs(t),(e=bt)?(e=Xf(e,Xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:vr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},n=bd(e),n.return=t,t.child=n,rn=t,bt=null)):e=null,e===null)throw ao(t);return t.lanes=536870912,null}return vl(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Vs(t),o)if(t.flags&256)t.flags&=-257,t=Tm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Ot||wa(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=pt,r!==null&&(i=zo(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Wo(e,i),Pn(r,e,i),mu;Pl(),t=Tm(e,t,n)}else e=a.treeContext,bt=Gn(i.nextSibling),rn=t,Je=!0,oo=null,Xn=!1,e!==null&&kd(t,e),t=vl(t,r),t.flags|=4096;return t}return e=Ar(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(d(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fu(e,t,n,r,o){return Bo(t),n=Bs(e,t,n,r,void 0,o),r=Ks(),e!==null&&!Ot?(Xs(e,t,o),zr(e,t,o)):(Je&&r&&Is(t),t.flags|=1,an(e,t,n,o),t.child)}function Lm(e,t,n,r,o,a){return Bo(t),t.updateQueue=null,n=Od(t,r,n,o),$d(e),r=Ks(),e!==null&&!Ot?(Xs(e,t,a),zr(e,t,a)):(Je&&r&&Is(t),t.flags|=1,an(e,t,n,a),t.child)}function Fm(e,t,n,r,o){if(Bo(t),t.stateNode===null){var a=ya,i=n.contextType;typeof i=="object"&&i!==null&&(a=on(i)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=cu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},$s(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?on(i):ya,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(uu(t,n,i,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(i=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),i!==a.state&&cu.enqueueReplaceState(a,a.state,null),fi(t,r,a,o),mi(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,h=Yo(n,s);a.props=h;var w=a.context,R=n.contextType;i=ya,typeof R=="object"&&R!==null&&(i=on(R));var O=n.getDerivedStateFromProps;R=typeof O=="function"||typeof a.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,R||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s||w!==i)&&Sm(t,a,r,i),lo=!1;var _=t.memoizedState;a.state=_,fi(t,r,a,o),mi(),w=t.memoizedState,s||_!==w||lo?(typeof O=="function"&&(uu(t,n,O,r),w=t.memoizedState),(h=lo||_m(t,n,h,r,_,w,i))?(R||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"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=w),a.props=r,a.state=w,a.context=i,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Os(e,t),i=t.memoizedProps,R=Yo(n,i),a.props=R,O=t.pendingProps,_=a.context,w=n.contextType,h=ya,typeof w=="object"&&w!==null&&(h=on(w)),s=n.getDerivedStateFromProps,(w=typeof s=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==O||_!==h)&&Sm(t,a,r,h),lo=!1,_=t.memoizedState,a.state=_,fi(t,r,a,o),mi();var A=t.memoizedState;i!==O||_!==A||lo||e!==null&&e.dependencies!==null&&el(e.dependencies)?(typeof s=="function"&&(uu(t,n,s,r),A=t.memoizedState),(R=lo||_m(t,n,R,r,_,A,h)||e!==null&&e.dependencies!==null&&el(e.dependencies))?(w||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,A,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,A,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=A),a.props=r,a.state=A,a.context=h,r=R):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bl(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Jo(t,e.child,null,o),t.child=Jo(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=zr(e,t,o),e}function $m(e,t,n,r){return Vo(),t.flags|=256,an(e,t,n,r),t.child}var pu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:Id()}}function gu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function Om(e,t,n){var r=t.pendingProps,o=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(Dt.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(o?co(t):mo(),(e=bt)?(e=Xf(e,Xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:vr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},n=bd(e),n.return=t,t.child=n,rn=t,bt=null)):e=null,e===null)throw ao(t);return Zu(e)?t.lanes=32:t.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(mo(),o=t.mode,s=xl({mode:"hidden",children:s},o),r=Ho(r,o,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r=t.child,r.memoizedState=hu(n),r.childLanes=gu(e,i,n),t.memoizedState=pu,vi(null,r)):(co(t),yu(t,s))}var h=e.memoizedState;if(h!==null&&(s=h.dehydrated,s!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=vu(e,t,n)):t.memoizedState!==null?(mo(),t.child=e.child,t.flags|=128,t=null):(mo(),s=r.fallback,o=t.mode,r=xl({mode:"visible",children:r.children},o),s=Ho(s,o,n,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,Jo(t,e.child,null,n),r=t.child,r.memoizedState=hu(n),r.childLanes=gu(e,i,n),t.memoizedState=pu,t=vi(null,r));else if(co(t),Zu(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var w=i.dgst;i=w,r=Error(d(419)),r.stack="",r.digest=i,ii({value:r,source:null,stack:null}),t=vu(e,t,n)}else if(Ot||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Ot||i){if(i=pt,i!==null&&(r=zo(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Wo(e,r),Pn(i,e,r),mu;Ju(s)||Pl(),t=vu(e,t,n)}else Ju(s)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,bt=Gn(s.nextSibling),rn=t,Je=!0,oo=null,Xn=!1,e!==null&&kd(t,e),t=yu(t,r.children),t.flags|=4096);return t}return o?(mo(),s=r.fallback,o=t.mode,h=e.child,w=h.sibling,r=Ar(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,w!==null?s=Ar(w,s):(s=Ho(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,vi(null,r),r=t.child,s=e.child.memoizedState,s===null?s=hu(n):(o=s.cachePool,o!==null?(h=Ft._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Id(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=gu(e,i,n),t.memoizedState=pu,vi(e.child,r)):(co(t),n=e.child,e=n.sibling,n=Ar(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function yu(e,t){return t=xl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xl(e,t){return e=jn(22,e,null,t),e.lanes=0,e}function vu(e,t,n){return Jo(t,e.child,null,n),e=yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Um(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zs(e.return,t,n)}function bu(e,t,n,r,o,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.treeForkCount=a)}function qm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=Dt.current,s=(i&2)!==0;if(s?(i=i&1|2,t.flags|=128):i&=1,G(Dt,i),an(e,t,r,n),r=Je?ai:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Um(e,n,t);else if(e.tag===19)Um(e,n,t);else if(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;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&sl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),bu(t,!1,o,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&sl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}bu(t,!0,n,null,a,r);break;case"together":bu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function zr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ho|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,n=Ar(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ar(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&el(e)))}function pg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),io(t,Ft,e.memoizedState.cache),Vo();break;case 27:case 5:je(t);break;case 4:Le(t,t.stateNode.containerInfo);break;case 10:io(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vs(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(co(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Om(e,t,n):(co(t),e=zr(e,t,n),e!==null?e.sibling:null);co(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(wa(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return qm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Dt,Dt.current),r)break;return null;case 22:return t.lanes=0,Nm(e,t,n,t.pendingProps);case 24:io(t,Ft,e.memoizedState.cache)}return zr(e,t,n)}function Wm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!xu(e,n)&&(t.flags&128)===0)return Ot=!1,pg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Je&&(t.flags&1048576)!==0&&wd(t,ai,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Xo(t.elementType),t.type=e,typeof e=="function")Cs(e)?(r=Yo(e,r),t.tag=1,t=Fm(null,t,e,r,n)):(t.tag=0,t=fu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===re){t.tag=11,t=Mm(null,t,e,r,n);break e}else if(o===U){t.tag=14,t=Dm(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(d(306,t,""))}}return t;case 0:return fu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Yo(r,t.pendingProps),Fm(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(d(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Os(e,t),fi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,io(t,Ft,r),r!==a.cache&&Ns(t,[Ft],n,!0),mi(),r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=$m(e,t,r,n);break e}else if(r!==o){o=Qn(Error(d(424)),t),ii(o),t=$m(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(bt=Gn(e.firstChild),rn=t,Je=!0,oo=null,Xn=!0,n=Nd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vo(),r===o){t=zr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return bl(e,t),e===null?(n=tp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(n=t.type,e=t.pendingProps,r=Tl(ve.current).createElement(n),r[Ct]=t,r[qt]=e,ln(r,n,e),jt(r),t.stateNode=r):t.memoizedState=tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&Je&&(r=t.stateNode=Zf(t.type,t.pendingProps,ve.current),rn=t,Xn=!0,o=bt,xo(t.type)?(Yu=o,bt=Gn(r.firstChild)):bt=o),an(e,t,t.pendingProps.children,n),bl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((o=r=bt)&&(r=Hg(r,t.type,t.pendingProps,Xn),r!==null?(t.stateNode=r,rn=t,bt=Gn(r.firstChild),Xn=!1,o=!0):o=!1),o||ao(t)),je(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Ku(o,a)?r=null:i!==null&&Ku(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Bs(e,t,ag,null,null,n),zi._currentValue=o),bl(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Je&&((e=n=bt)&&(n=Vg(n,t.pendingProps,Xn),n!==null?(t.stateNode=n,rn=t,bt=null,e=!0):e=!1),e||ao(t)),null;case 13:return Om(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Jo(t,null,r,n):an(e,t,r,n),t.child;case 11:return Mm(e,t,t.type,t.pendingProps,n);case 7:return an(e,t,t.pendingProps,n),t.child;case 8:return an(e,t,t.pendingProps.children,n),t.child;case 12:return an(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,io(t,t.type,r.value),an(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Bo(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Dm(e,t,t.type,t.pendingProps,n);case 15:return zm(e,t,t.type,t.pendingProps,n);case 19:return qm(e,t,n);case 31:return fg(e,t,n);case 22:return Nm(e,t,n,t.pendingProps);case 24:return Bo(t),r=on(Ft),e===null?(o=Ls(),o===null&&(o=pt,a=js(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},$s(t),io(t,Ft,o)):((e.lanes&n)!==0&&(Os(e,t),fi(t,null,null,n),mi()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),io(t,Ft,r)):(r=a.cache,io(t,Ft,r),r!==o.cache&&Ns(t,[Ft],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function Nr(e){e.flags|=4}function wu(e,t,n,r,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(yf())e.flags|=8192;else throw Go=ol,Fs}else e.flags&=-16777217}function Hm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t))if(yf())e.flags|=8192;else throw Go=ol,Fs}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Mo():536870912,e.lanes|=t,za|=t)}function bi(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hg(e,t,n){var r=t.pendingProps;switch(Ps(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return xt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Rr(Ft),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?Nr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ms())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Nr(t),a!==null?(xt(t),Hm(t,a)):(xt(t),wu(t,o,null,r,n))):a?a!==e.memoizedState?(Nr(t),xt(t),Hm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Nr(t),xt(t),wu(t,o,e,r,n)),null;case 27:if(We(t),n=ve.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(!r){if(t.stateNode===null)throw Error(d(166));return xt(t),null}e=Y.current,xa(t)?_d(t):(e=Zf(o,r,n),t.stateNode=e,Nr(t))}return xt(t),null;case 5:if(We(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(!r){if(t.stateNode===null)throw Error(d(166));return xt(t),null}if(a=Y.current,xa(t))_d(t);else{var i=Tl(ve.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":a=i.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?i.createElement(o,{is:r.is}):i.createElement(o)}}a[Ct]=t,a[qt]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)a.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=a;e:switch(ln(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Nr(t)}}return xt(t),wu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(d(166));if(e=ve.current,xa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=rn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Uf(e.nodeValue,n)),e||ao(t,!0)}else e=Tl(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=xa(t),n!==null){if(e===null){if(!r)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[Ct]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Ms(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ln(t),t):(Ln(t),null);if((t.flags&128)!==0)throw Error(d(558))}return xt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(d(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(d(317));o[Ct]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Ms(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ln(t),t):(Ln(t),null)}return Ln(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wl(t,t.updateQueue),xt(t),null);case 4:return Ne(),e===null&&Wu(t.stateNode.containerInfo),xt(t),null;case 10:return Rr(t.type),xt(t),null;case 19:if(I(Dt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)bi(r,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=sl(e),a!==null){for(t.flags|=128,bi(r,!1),e=a.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vd(n,e),n=n.sibling;return G(Dt,Dt.current&1|2),Je&&Ir(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>El&&(t.flags|=128,o=!0,bi(r,!1),t.lanes=4194304)}else{if(!o)if(e=sl(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),bi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Je)return xt(t),null}else 2*Ze()-r.renderingStartTime>El&&n!==536870912&&(t.flags|=128,o=!0,bi(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ze(),e.sibling=null,n=Dt.current,G(Dt,o?n&1|2:n&1),Je&&Ir(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Ln(t),Hs(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),n=t.updateQueue,n!==null&&wl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(Ko),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Rr(Ft),xt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function gg(e,t){switch(Ps(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rr(Ft),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 31:if(t.memoizedState!==null){if(Ln(t),t.alternate===null)throw Error(d(340));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(Dt),null;case 4:return Ne(),null;case 10:return Rr(t.type),null;case 22:case 23:return Ln(t),Hs(),e!==null&&I(Ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Rr(Ft),null;case 25:return null;default:return null}}function Vm(e,t){switch(Ps(t),t.tag){case 3:Rr(Ft),Ne();break;case 26:case 27:case 5:We(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&Ln(t);break;case 13:Ln(t);break;case 19:I(Dt);break;case 10:Rr(t.type);break;case 22:case 23:Ln(t),Hs(),e!==null&&I(Ko);break;case 24:Rr(Ft)}}function xi(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==o)}}catch(s){ut(t,t.return,s)}}function fo(e,t,n){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var a=o.next;r=a;do{if((r.tag&e)===e){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,o=t;var h=n,w=s;try{w()}catch(R){ut(o,h,R)}}}r=r.next}while(r!==a)}}catch(R){ut(t,t.return,R)}}function Qm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Td(t,n)}catch(r){ut(e,e.return,r)}}}function Bm(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function wi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(o){ut(e,t,o)}}function xr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){ut(e,t,o)}else n.current=null}function Km(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){ut(e,e.return,o)}}function ku(e,t,n){try{var r=e.stateNode;Fg(r,e.type,n,t),r[qt]=t}catch(o){ut(e,e.return,o)}}function Xm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xo(e.type)||e.tag===4}function _u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xo(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Su(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kn));else if(r!==4&&(r===27&&xo(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Su(e,t,n),e=e.sibling;e!==null;)Su(e,t,n),e=e.sibling}function kl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&xo(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(kl(e,t,n),e=e.sibling;e!==null;)kl(e,t,n),e=e.sibling}function Gm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ln(t,r,n),t[Ct]=e,t[qt]=n}catch(a){ut(e,e.return,a)}}var jr=!1,Ut=!1,Cu=!1,Jm=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function yg(e,t){if(e=e.containerInfo,Qu=Wl,e=ud(e),vs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,s=-1,h=-1,w=0,R=0,O=e,_=null;t:for(;;){for(var A;O!==n||o!==0&&O.nodeType!==3||(s=i+o),O!==a||r!==0&&O.nodeType!==3||(h=i+r),O.nodeType===3&&(i+=O.nodeValue.length),(A=O.firstChild)!==null;)_=O,O=A;for(;;){if(O===e)break t;if(_===n&&++w===o&&(s=i),_===a&&++R===r&&(h=i),(A=O.nextSibling)!==null)break;O=_,_=O.parentNode}O=A}n=s===-1||h===-1?null:{start:s,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bu={focusedElem:e,selectionRange:n},Wl=!1,Jt=t;Jt!==null;)if(t=Jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Jt=e;else for(;Jt!==null;){switch(t=Jt,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,n=t,o=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var ue=Yo(n.type,o);e=r.getSnapshotBeforeUpdate(ue,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Se){ut(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Gu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(d(163))}if(e=t.sibling,e!==null){e.return=t.return,Jt=e;break}Jt=t.return}}function Zm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(e,n),r&4&&xi(5,n);break;case 1:if(Lr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){ut(n,n.return,i)}else{var o=Yo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ut(n,n.return,i)}}r&64&&Qm(n),r&512&&wi(n,n.return);break;case 3:if(Lr(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Td(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&Gm(n);case 26:case 5:Lr(e,n),t===null&&r&4&&Km(n),r&512&&wi(n,n.return);break;case 12:Lr(e,n);break;case 31:Lr(e,n),r&4&&tf(e,n);break;case 13:Lr(e,n),r&4&&nf(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Eg.bind(null,n),Qg(e,n))));break;case 22:if(r=n.memoizedState!==null||jr,!r){t=t!==null&&t.memoizedState!==null||Ut,o=jr;var a=Ut;jr=r,(Ut=t)&&!a?Fr(e,n,(n.subtreeFlags&8772)!==0):Lr(e,n),jr=o,Ut=a}break;case 30:break;default:Lr(e,n)}}function Ym(e){var t=e.alternate;t!==null&&(e.alternate=null,Ym(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qa(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,Cn=!1;function Tr(e,t,n){for(n=n.child;n!==null;)ef(e,t,n),n=n.sibling}function ef(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Ut||xr(n,t),Tr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ut||xr(n,t);var r=_t,o=Cn;xo(n.type)&&(_t=n.stateNode,Cn=!1),Tr(e,t,n),Ri(n.stateNode),_t=r,Cn=o;break;case 5:Ut||xr(n,t);case 6:if(r=_t,o=Cn,_t=null,Tr(e,t,n),_t=r,Cn=o,_t!==null)if(Cn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(n.stateNode)}catch(a){ut(n,t,a)}else try{_t.removeChild(n.stateNode)}catch(a){ut(n,t,a)}break;case 18:_t!==null&&(Cn?(e=_t,Bf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ua(e)):Bf(_t,n.stateNode));break;case 4:r=_t,o=Cn,_t=n.stateNode.containerInfo,Cn=!0,Tr(e,t,n),_t=r,Cn=o;break;case 0:case 11:case 14:case 15:fo(2,n,t),Ut||fo(4,n,t),Tr(e,t,n);break;case 1:Ut||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Bm(n,t,r)),Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:Ut=(r=Ut)||n.memoizedState!==null,Tr(e,t,n),Ut=r;break;default:Tr(e,t,n)}}function tf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ua(e)}catch(n){ut(t,t.return,n)}}}function nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ua(e)}catch(n){ut(t,t.return,n)}}function vg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jm),t;default:throw Error(d(435,e.tag))}}function _l(e,t){var n=vg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=Ag.bind(null,e,r);r.then(o,o)}})}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],a=e,i=t,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(xo(s.type)){_t=s.stateNode,Cn=!1;break e}break;case 5:_t=s.stateNode,Cn=!1;break e;case 3:case 4:_t=s.stateNode.containerInfo,Cn=!0;break e}s=s.return}if(_t===null)throw Error(d(160));ef(a,i,o),_t=null,Cn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rf(t,e),t=t.sibling}var sr=null;function rf(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),An(e),r&4&&(fo(3,e,e.return),xi(3,e),fo(5,e,e.return));break;case 1:En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),r&64&&jr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=sr;if(En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":a=o.getElementsByTagName("title")[0],(!a||a[kr]||a[Ct]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),ln(a,r,n),a[Ct]=e,jt(a),r=a;break e;case"link":var i=op("link","href",o).get(r+(n.href||""));if(i){for(var s=0;s<i.length;s++)if(a=i[s],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)){i.splice(s,1);break t}}a=o.createElement(r),ln(a,r,n),o.head.appendChild(a);break;case"meta":if(i=op("meta","content",o).get(r+(n.content||""))){for(s=0;s<i.length;s++)if(a=i[s],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)){i.splice(s,1);break t}}a=o.createElement(r),ln(a,r,n),o.head.appendChild(a);break;default:throw Error(d(468,r))}a[Ct]=e,jt(a),r=a}e.stateNode=r}else ap(o,e.type,e.stateNode);else e.stateNode=rp(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?ap(o,e.type,e.stateNode):rp(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ku(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),n!==null&&r&4&&ku(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(ue){ut(e,e.return,ue)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,ku(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Cu=!0);break;case 6:if(En(t,e),An(e),r&4){if(e.stateNode===null)throw Error(d(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ue){ut(e,e.return,ue)}}break;case 3:if($l=null,o=sr,sr=Ll(t.containerInfo),En(t,e),sr=o,An(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ua(t.containerInfo)}catch(ue){ut(e,e.return,ue)}Cu&&(Cu=!1,of(e));break;case 4:r=sr,sr=Ll(e.stateNode.containerInfo),En(t,e),An(e),sr=r;break;case 12:En(t,e),An(e);break;case 31:En(t,e),An(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:En(t,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Cl=Ze()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,w=jr,R=Ut;if(jr=w||o,Ut=R||h,En(t,e),Ut=R,jr=w,An(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||jr||Ut||ea(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){h=n=t;try{if(a=h.stateNode,o)i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=h.stateNode;var O=h.memoizedProps.style,_=O!=null&&O.hasOwnProperty("display")?O.display:null;s.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===18){if(n===null){h=t;try{var A=h.stateNode;o?Kf(A,!0):Kf(h.stateNode,!1)}catch(ue){ut(h,h.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,_l(e,n))));break;case 19:En(t,e),An(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:En(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xm(r)){n=r;break}r=r.return}if(n==null)throw Error(d(160));switch(n.tag){case 27:var o=n.stateNode,a=_u(e);kl(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var s=_u(e);kl(e,s,i);break;case 3:case 4:var h=n.stateNode.containerInfo,w=_u(e);Su(e,w,h);break;default:throw Error(d(161))}}catch(R){ut(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function of(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;of(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Lr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zm(e,t.alternate,t),t=t.sibling}function ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:fo(4,t,t.return),ea(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Bm(t,t.return,n),ea(t);break;case 27:Ri(t.stateNode);case 26:case 5:xr(t,t.return),ea(t);break;case 22:t.memoizedState===null&&ea(t);break;case 30:ea(t);break;default:ea(t)}e=e.sibling}}function Fr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Fr(o,a,n),xi(4,a);break;case 1:if(Fr(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(w){ut(r,r.return,w)}if(r=a,o=r.updateQueue,o!==null){var s=r.stateNode;try{var h=o.shared.hiddenCallbacks;if(h!==null)for(o.shared.hiddenCallbacks=null,o=0;o<h.length;o++)jd(h[o],s)}catch(w){ut(r,r.return,w)}}n&&i&64&&Qm(a),wi(a,a.return);break;case 27:Gm(a);case 26:case 5:Fr(o,a,n),n&&r===null&&i&4&&Km(a),wi(a,a.return);break;case 12:Fr(o,a,n);break;case 31:Fr(o,a,n),n&&i&4&&tf(o,a);break;case 13:Fr(o,a,n),n&&i&4&&nf(o,a);break;case 22:a.memoizedState===null&&Fr(o,a,n),wi(a,a.return);break;case 30:break;default:Fr(o,a,n)}t=t.sibling}}function Eu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&li(n))}function Au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e))}function ur(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)af(e,t,n,r),t=t.sibling}function af(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ur(e,t,n,r),o&2048&&xi(9,t);break;case 1:ur(e,t,n,r);break;case 3:ur(e,t,n,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e)));break;case 12:if(o&2048){ur(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,s=a.onPostCommit;typeof s=="function"&&s(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){ut(t,t.return,h)}}else ur(e,t,n,r);break;case 31:ur(e,t,n,r);break;case 13:ur(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,t.memoizedState!==null?a._visibility&2?ur(e,t,n,r):ki(e,t):a._visibility&2?ur(e,t,n,r):(a._visibility|=2,Ra(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Eu(i,t);break;case 24:ur(e,t,n,r),o&2048&&Au(t.alternate,t);break;default:ur(e,t,n,r)}}function Ra(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,s=n,h=r,w=i.flags;switch(i.tag){case 0:case 11:case 15:Ra(a,i,s,h,o),xi(8,i);break;case 23:break;case 22:var R=i.stateNode;i.memoizedState!==null?R._visibility&2?Ra(a,i,s,h,o):ki(a,i):(R._visibility|=2,Ra(a,i,s,h,o)),o&&w&2048&&Eu(i.alternate,i);break;case 24:Ra(a,i,s,h,o),o&&w&2048&&Au(i.alternate,i);break;default:Ra(a,i,s,h,o)}t=t.sibling}}function ki(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:ki(n,r),o&2048&&Eu(r.alternate,r);break;case 24:ki(n,r),o&2048&&Au(r.alternate,r);break;default:ki(n,r)}t=t.sibling}}var _i=8192;function Ma(e,t,n){if(e.subtreeFlags&_i)for(e=e.child;e!==null;)lf(e,t,n),e=e.sibling}function lf(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&_i&&e.memoizedState!==null&&o0(n,sr,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var r=sr;sr=Ll(e.stateNode.containerInfo),Ma(e,t,n),sr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=_i,_i=16777216,Ma(e,t,n),_i=r):Ma(e,t,n));break;default:Ma(e,t,n)}}function sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Si(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jt=r,cf(r,e)}sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)uf(e),e=e.sibling}function uf(e){switch(e.tag){case 0:case 11:case 15:Si(e),e.flags&2048&&fo(9,e,e.return);break;case 3:Si(e);break;case 12:Si(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sl(e)):Si(e);break;default:Si(e)}}function Sl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jt=r,cf(r,e)}sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:fo(8,t,t.return),Sl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Sl(t));break;default:Sl(t)}e=e.sibling}}function cf(e,t){for(;Jt!==null;){var n=Jt;switch(n.tag){case 0:case 11:case 15:fo(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:li(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Jt=r;else e:for(n=e;Jt!==null;){r=Jt;var o=r.sibling,a=r.return;if(Ym(r),r===n){Jt=null;break e}if(o!==null){o.return=a,Jt=o;break e}Jt=a}}}var bg={getCacheForType:function(e){var t=on(Ft),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return on(Ft).controller.signal}},xg=typeof WeakMap=="function"?WeakMap:Map,at=0,pt=null,Ve=null,Ke=0,st=0,Fn=null,po=!1,Da=!1,Iu=!1,$r=0,Pt=0,ho=0,ta=0,Pu=0,$n=0,za=0,Ci=null,In=null,Ru=!1,Cl=0,df=0,El=1/0,Al=null,go=null,Qt=0,yo=null,Na=null,Or=0,Mu=0,Du=null,mf=null,Ei=0,zu=null;function On(){return(at&2)!==0&&Ke!==0?Ke&-Ke:C.T!==null?$u():ra()}function ff(){if($n===0)if((Ke&536870912)===0||Je){var e=fe;fe<<=1,(fe&3932160)===0&&(fe=262144),$n=e}else $n=536870912;return e=Tn.current,e!==null&&(e.flags|=32),$n}function Pn(e,t,n){(e===pt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(ja(e,0),vo(e,Ke,$n,!1)),dr(e,n),((at&2)===0||e!==pt)&&(e===pt&&((at&2)===0&&(ta|=n),Pt===4&&vo(e,Ke,$n,!1)),wr(e))}function pf(e,t,n){if((at&6)!==0)throw Error(d(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tt(e,t),o=r?_g(e,t):ju(e,t,!0),a=r;do{if(o===0){Da&&!r&&vo(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!wg(n)){o=ju(e,t,!1),a=!1;continue}if(o===2){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var s=e;o=Ci;var h=s.current.memoizedState.isDehydrated;if(h&&(ja(s,i).flags|=256),i=ju(s,i,!1),i!==2){if(Iu&&!h){s.errorRecoveryDisabledLanes|=a,ta|=a,o=4;break e}a=In,In=o,a!==null&&(In===null?In=a:In.push.apply(In,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){ja(e,0),vo(e,t,0,!0);break}e:{switch(r=e,a=o,a){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:vo(r,t,$n,!po);break e;case 2:In=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(o=Cl+300-Ze(),10<o)){if(vo(r,t,$n,!po),be(r,0,!0)!==0)break e;Or=t,r.timeoutHandle=Vf(hf.bind(null,r,n,In,Al,Ru,t,$n,ta,za,po,a,"Throttled",-0,0),o);break e}hf(r,n,In,Al,Ru,t,$n,ta,za,po,a,null,-0,0)}}break}while(!0);wr(e)}function hf(e,t,n,r,o,a,i,s,h,w,R,O,_,A){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},lf(t,a,O);var ue=(a&62914560)===a?Cl-Ze():(a&4194048)===a?df-Ze():0;if(ue=a0(O,ue),ue!==null){Or=a,e.cancelPendingCommit=ue(_f.bind(null,e,t,a,n,r,o,i,s,h,R,O,null,_,A)),vo(e,a,i,!w);return}}_f(e,t,a,n,r,o,i,s,h)}function wg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!Nn(a(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vo(e,t,n,r){t&=~Pu,t&=~ta,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-ft(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Qr(e,n,t)}function Il(){return(at&6)===0?(Ai(0),!1):!0}function Nu(){if(Ve!==null){if(st===0)var e=Ve.return;else e=Ve,Pr=Qo=null,Gs(e),Ca=null,ui=0,e=Ve;for(;e!==null;)Vm(e.alternate,e),e=e.return;Ve=null}}function ja(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ug(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Or=0,Nu(),pt=e,Ve=n=Ar(e.current,null),Ke=t,st=0,Fn=null,po=!1,Da=tt(e,t),Iu=!1,za=$n=Pu=ta=ho=Pt=0,In=Ci=null,Ru=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var o=31-ft(r),a=1<<o;t|=e[o],r&=~a}return $r=t,Xi(),n}function gf(e,t){Re=null,C.H=yi,t===Sa||t===rl?(t=Md(),st=3):t===Fs?(t=Md(),st=4):st=t===mu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,Ve===null&&(Pt=1,yl(e,Qn(t,e.current)))}function yf(){var e=Tn.current;return e===null?!0:(Ke&4194048)===Ke?lr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===lr:!1}function vf(){var e=C.H;return C.H=yi,e===null?yi:e}function bf(){var e=C.A;return C.A=bg,e}function Pl(){Pt=4,po||(Ke&4194048)!==Ke&&Tn.current!==null||(Da=!0),(ho&134217727)===0&&(ta&134217727)===0||pt===null||vo(pt,Ke,$n,!1)}function ju(e,t,n){var r=at;at|=2;var o=vf(),a=bf();(pt!==e||Ke!==t)&&(Al=null,ja(e,t)),t=!1;var i=Pt;e:do try{if(st!==0&&Ve!==null){var s=Ve,h=Fn;switch(st){case 8:Nu(),i=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var w=st;if(st=0,Fn=null,Ta(e,s,h,w),n&&Da){i=0;break e}break;default:w=st,st=0,Fn=null,Ta(e,s,h,w)}}kg(),i=Pt;break}catch(R){gf(e,R)}while(!0);return t&&e.shellSuspendCounter++,Pr=Qo=null,at=r,C.H=o,C.A=a,Ve===null&&(pt=null,Ke=0,Xi()),i}function kg(){for(;Ve!==null;)xf(Ve)}function _g(e,t){var n=at;at|=2;var r=vf(),o=bf();pt!==e||Ke!==t?(Al=null,El=Ze()+500,ja(e,t)):Da=tt(e,t);e:do try{if(st!==0&&Ve!==null){t=Ve;var a=Fn;t:switch(st){case 1:st=0,Fn=null,Ta(e,t,a,1);break;case 2:case 9:if(Pd(a)){st=0,Fn=null,wf(t);break}t=function(){st!==2&&st!==9||pt!==e||(st=7),wr(e)},a.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Pd(a)?(st=0,Fn=null,wf(t)):(st=0,Fn=null,Ta(e,t,a,7));break;case 5:var i=null;switch(Ve.tag){case 26:i=Ve.memoizedState;case 5:case 27:var s=Ve;if(i?ip(i):s.stateNode.complete){st=0,Fn=null;var h=s.sibling;if(h!==null)Ve=h;else{var w=s.return;w!==null?(Ve=w,Rl(w)):Ve=null}break t}}st=0,Fn=null,Ta(e,t,a,5);break;case 6:st=0,Fn=null,Ta(e,t,a,6);break;case 8:Nu(),Pt=6;break e;default:throw Error(d(462))}}Sg();break}catch(R){gf(e,R)}while(!0);return Pr=Qo=null,C.H=r,C.A=o,at=n,Ve!==null?0:(pt=null,Ke=0,Xi(),Pt)}function Sg(){for(;Ve!==null&&!Ge();)xf(Ve)}function xf(e){var t=Wm(e.alternate,e,$r);e.memoizedProps=e.pendingProps,t===null?Rl(e):Ve=t}function wf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lm(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Lm(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Gs(t);default:Vm(n,t),t=Ve=vd(t,$r),t=Wm(n,t,$r)}e.memoizedProps=e.pendingProps,t===null?Rl(e):Ve=t}function Ta(e,t,n,r){Pr=Qo=null,Gs(t),Ca=null,ui=0;var o=t.return;try{if(mg(e,o,t,n,Ke)){Pt=1,yl(e,Qn(n,e.current)),Ve=null;return}}catch(a){if(o!==null)throw Ve=o,a;Pt=1,yl(e,Qn(n,e.current)),Ve=null;return}t.flags&32768?(Je||r===1?e=!0:Da||(Ke&536870912)!==0?e=!1:(po=e=!0,(r===2||r===9||r===3||r===6)&&(r=Tn.current,r!==null&&r.tag===13&&(r.flags|=16384))),kf(t,e)):Rl(t)}function Rl(e){var t=e;do{if((t.flags&32768)!==0){kf(t,po);return}e=t.return;var n=hg(t.alternate,t,$r);if(n!==null){Ve=n;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Pt===0&&(Pt=5)}function kf(e,t){do{var n=gg(e.alternate,e);if(n!==null){n.flags&=32767,Ve=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=n}while(e!==null);Pt=6,Ve=null}function _f(e,t,n,r,o,a,i,s,h){e.cancelPendingCommit=null;do Ml();while(Qt!==0);if((at&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(a=t.lanes|t.childLanes,a|=_s,Do(e,n,a,i,s,h),e===pt&&(Ve=pt=null,Ke=0),Na=t,yo=e,Or=n,Mu=a,Du=o,mf=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ig(Kt,function(){return If(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,o=q.p,q.p=2,i=at,at|=4;try{yg(e,t,n)}finally{at=i,q.p=o,C.T=r}}Qt=1,Sf(),Cf(),Ef()}}function Sf(){if(Qt===1){Qt=0;var e=yo,t=Na,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=q.p;q.p=2;var o=at;at|=4;try{rf(t,e);var a=Bu,i=ud(e.containerInfo),s=a.focusedElem,h=a.selectionRange;if(i!==s&&s&&s.ownerDocument&&sd(s.ownerDocument.documentElement,s)){if(h!==null&&vs(s)){var w=h.start,R=h.end;if(R===void 0&&(R=w),"selectionStart"in s)s.selectionStart=w,s.selectionEnd=Math.min(R,s.value.length);else{var O=s.ownerDocument||document,_=O&&O.defaultView||window;if(_.getSelection){var A=_.getSelection(),ue=s.textContent.length,Se=Math.min(h.start,ue),mt=h.end===void 0?Se:Math.min(h.end,ue);!A.extend&&Se>mt&&(i=mt,mt=Se,Se=i);var v=ld(s,Se),g=ld(s,mt);if(v&&g&&(A.rangeCount!==1||A.anchorNode!==v.node||A.anchorOffset!==v.offset||A.focusNode!==g.node||A.focusOffset!==g.offset)){var x=O.createRange();x.setStart(v.node,v.offset),A.removeAllRanges(),Se>mt?(A.addRange(x),A.extend(g.node,g.offset)):(x.setEnd(g.node,g.offset),A.addRange(x))}}}}for(O=[],A=s;A=A.parentNode;)A.nodeType===1&&O.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<O.length;s++){var j=O[s];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}Wl=!!Qu,Bu=Qu=null}finally{at=o,q.p=r,C.T=n}}e.current=t,Qt=2}}function Cf(){if(Qt===2){Qt=0;var e=yo,t=Na,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=q.p;q.p=2;var o=at;at|=4;try{Zm(e,t.alternate,t)}finally{at=o,q.p=r,C.T=n}}Qt=3}}function Ef(){if(Qt===4||Qt===3){Qt=0,B();var e=yo,t=Na,n=Or,r=mf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,Na=yo=null,Af(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(go=null),hn(n),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,o=q.p,q.p=2,C.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var s=r[i];a(s.value,{componentStack:s.stack})}}finally{C.T=t,q.p=o}}(Or&3)!==0&&Ml(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===zu?Ei++:(Ei=0,zu=e):Ei=0,Ai(0)}}function Af(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,li(t)))}function Ml(){return Sf(),Cf(),Ef(),If()}function If(){if(Qt!==5)return!1;var e=yo,t=Mu;Mu=0;var n=hn(Or),r=C.T,o=q.p;try{q.p=32>n?32:n,C.T=null,n=Du,Du=null;var a=yo,i=Or;if(Qt=0,Na=yo=null,Or=0,(at&6)!==0)throw Error(d(331));var s=at;if(at|=4,uf(a.current),af(a,a.current,i,n),at=s,Ai(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{q.p=o,C.T=r,Af(e,t)}}function Pf(e,t,n){t=Qn(n,t),t=du(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(dr(e,2),wr(e))}function ut(e,t,n){if(e.tag===3)Pf(e,e,n);else for(;t!==null;){if(t.tag===3){Pf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(go===null||!go.has(r))){e=Qn(n,e),n=Pm(2),r=uo(t,n,2),r!==null&&(Rm(n,r,t,e),dr(r,2),wr(r));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new xg;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(Iu=!0,o.add(n),e=Cg.bind(null,e,t,n),t.then(e,e))}function Cg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,pt===e&&(Ke&n)===n&&(Pt===4||Pt===3&&(Ke&62914560)===Ke&&300>Ze()-Cl?(at&2)===0&&ja(e,0):Pu|=n,za===Ke&&(za=0)),wr(e)}function Rf(e,t){t===0&&(t=Mo()),e=Wo(e,t),e!==null&&(dr(e,t),wr(e))}function Eg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rf(e,n)}function Ag(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(d(314))}r!==null&&r.delete(t),Rf(e,n)}function Ig(e,t){return K(e,t)}var Dl=null,La=null,Lu=!1,zl=!1,Fu=!1,bo=0;function wr(e){e!==La&&e.next===null&&(La===null?Dl=La=e:La=La.next=e),zl=!0,Lu||(Lu=!0,Rg())}function Ai(e,t){if(!Fu&&zl){Fu=!0;do for(var n=!1,r=Dl;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var i=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ft(42|e)+1)-1,a&=o&~(i&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=Ke,a=be(r,r===pt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||tt(r,a)||(n=!0,Nf(r,a));r=r.next}while(n);Fu=!1}}function Pg(){Mf()}function Mf(){zl=Lu=!1;var e=0;bo!==0&&Og()&&(e=bo);for(var t=Ze(),n=null,r=Dl;r!==null;){var o=r.next,a=Df(r,t);a===0?(r.next=null,n===null?Dl=o:n.next=o,o===null&&(La=n)):(n=r,(e!==0||(a&3)!==0)&&(zl=!0)),r=o}Qt!==0&&Qt!==5||Ai(e),bo!==0&&(bo=0)}function Df(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-ft(a),s=1<<i,h=o[i];h===-1?((s&n)===0||(s&r)!==0)&&(o[i]=Zt(s,t)):h<=t&&(e.expiredLanes|=s),a&=~s}if(t=pt,n=Ke,n=be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),hn(n)){case 2:case 8:n=it;break;case 32:n=Kt;break;case 268435456:n=Ro;break;default:n=Kt}return r=zf.bind(null,e),n=K(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ml()&&e.callbackNode!==n)return null;var r=Ke;return r=be(e,e===pt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pf(e,r,t),Df(e,Ze()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Nf(e,t){if(Ml())return null;pf(e,t,!0)}function Rg(){qg(function(){(at&6)!==0?K(un,Pg):Mf()})}function $u(){if(bo===0){var e=ka;e===0&&(e=fn,fn<<=1,(fn&261888)===0&&(fn=256)),bo=e}return bo}function jf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:yr(""+e)}function Tf(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Mg(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=jf((o[qt]||null).action),i=r.submitter;i&&(t=(t=i[qt]||null)?jf(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var s=new Lo("action","action",null,r,o);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(bo!==0){var h=i?Tf(o,i):new FormData(o);au(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(s.preventDefault(),h=i?Tf(o,i):new FormData(o),au(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Ou=0;Ou<ks.length;Ou++){var Uu=ks[Ou],Dg=Uu.toLowerCase(),zg=Uu[0].toUpperCase()+Uu.slice(1);ir(Dg,"on"+zg)}ir(md,"onAnimationEnd"),ir(fd,"onAnimationIteration"),ir(pd,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Xh,"onTransitionRun"),ir(Gh,"onTransitionStart"),ir(Jh,"onTransitionCancel"),ir(hd,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pr("onBeforeInput",["compositionend","keypress","textInput","paste"]),pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),Ng=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function Lf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var s=r[i],h=s.instance,w=s.currentTarget;if(s=s.listener,h!==a&&o.isPropagationStopped())break e;a=s,o.currentTarget=w;try{a(o)}catch(R){Ki(R)}o.currentTarget=null,a=h}else for(i=0;i<r.length;i++){if(s=r[i],h=s.instance,w=s.currentTarget,s=s.listener,h!==a&&o.isPropagationStopped())break e;a=s,o.currentTarget=w;try{a(o)}catch(R){Ki(R)}o.currentTarget=null,a=h}}}}function Qe(e,t){var n=t[oa];n===void 0&&(n=t[oa]=new Set);var r=e+"__bubble";n.has(r)||(Ff(t,e,2,!1),n.add(r))}function qu(e,t,n){var r=0;t&&(r|=4),Ff(n,e,r,t)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Wu(e){if(!e[Nl]){e[Nl]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(Ng.has(n)||qu(n,!1,e),qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nl]||(t[Nl]=!0,qu("selectionchange",!1,t))}}function Ff(e,t,n,r){switch(fp(t)){case 2:var o=s0;break;case 8:o=u0;break;default:o=oc}n=o.bind(null,t,n,e),o=void 0,!wt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Hu(e,t,n,r,o){var a=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===o)break;if(i===4)for(i=r.return;i!==null;){var h=i.tag;if((h===3||h===4)&&i.stateNode.containerInfo===o)return;i=i.return}for(;s!==null;){if(i=fr(s),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){r=a=i;continue e}s=s.parentNode}}r=r.return}ma(function(){var w=a,R=et(n),O=[];e:{var _=gd.get(e);if(_!==void 0){var A=Lo,ue=e;switch(e){case"keypress":if(qn(n)===0)break e;case"keydown":case"keyup":A=z;break;case"focusin":ue="focus",A=fa;break;case"focusout":ue="blur",A=fa;break;case"beforeblur":case"afterblur":A=fa;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":A=Za;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":A=ss;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":A=Ye;break;case md:case fd:case pd:A=ds;break;case hd:A=Lt;break;case"scroll":case"scrollend":A=no;break;case"wheel":A=Ue;break;case"copy":case"cut":case"paste":A=Hi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":A=J;break;case"toggle":case"beforetoggle":A=Gt}var Se=(t&4)!==0,mt=!Se&&(e==="scroll"||e==="scrollend"),v=Se?_!==null?_+"Capture":null:_;Se=[];for(var g=w,x;g!==null;){var j=g;if(x=j.stateNode,j=j.tag,j!==5&&j!==26&&j!==27||x===null||v===null||(j=ar(g,v),j!=null&&Se.push(Pi(g,j,x))),mt)break;g=g.return}0<Se.length&&(_=new A(_,ue,null,n,R),O.push({event:_,listeners:Se}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",A=e==="mouseout"||e==="pointerout",_&&n!==ca&&(ue=n.relatedTarget||n.fromElement)&&(fr(ue)||ue[mr]))break e;if((A||_)&&(_=R.window===R?R:(_=R.ownerDocument)?_.defaultView||_.parentWindow:window,A?(ue=n.relatedTarget||n.toElement,A=w,ue=ue?fr(ue):null,ue!==null&&(mt=M(ue),Se=ue.tag,ue!==mt||Se!==5&&Se!==27&&Se!==6)&&(ue=null)):(A=null,ue=w),A!==ue)){if(Se=Za,j="onMouseLeave",v="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=J,j="onPointerLeave",v="onPointerEnter",g="pointer"),mt=A==null?_:dn(A),x=ue==null?_:dn(ue),_=new Se(j,g+"leave",A,n,R),_.target=mt,_.relatedTarget=x,j=null,fr(R)===w&&(Se=new Se(v,g+"enter",ue,n,R),Se.target=x,Se.relatedTarget=mt,j=Se),mt=j,A&&ue)t:{for(Se=jg,v=A,g=ue,x=0,j=v;j;j=Se(j))x++;j=0;for(var we=g;we;we=Se(we))j++;for(;0<x-j;)v=Se(v),x--;for(;0<j-x;)g=Se(g),j--;for(;x--;){if(v===g||g!==null&&v===g.alternate){Se=v;break t}v=Se(v),g=Se(g)}Se=null}else Se=null;A!==null&&$f(O,_,A,Se,!1),ue!==null&&mt!==null&&$f(O,mt,ue,Se,!0)}}e:{if(_=w?dn(w):window,A=_.nodeName&&_.nodeName.toLowerCase(),A==="select"||A==="input"&&_.type==="file")var nt=td;else if(Yc(_))if(nd)nt=Qh;else{nt=Hh;var pe=Wh}else A=_.nodeName,!A||A.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?w&&Jr(w.elementType)&&(nt=td):nt=Vh;if(nt&&(nt=nt(e,w))){ed(O,nt,n,R);break e}pe&&pe(e,_,w),e==="focusout"&&w&&_.type==="number"&&w.memoizedProps.value!=null&&ua(_,"number",_.value)}switch(pe=w?dn(w):window,e){case"focusin":(Yc(pe)||pe.contentEditable==="true")&&(pa=pe,bs=w,oi=null);break;case"focusout":oi=bs=pa=null;break;case"mousedown":xs=!0;break;case"contextmenu":case"mouseup":case"dragend":xs=!1,cd(O,n,R);break;case"selectionchange":if(Kh)break;case"keydown":case"keyup":cd(O,n,R)}var ze;if(Vt)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else St?lt(e,n)&&(Xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ce&&n.locale!=="ko"&&(St||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&St&&(ze=Tt()):(Mt=R,Ja="value"in Mt?Mt.value:Mt.textContent,St=!0)),pe=jl(w,Xe),0<pe.length&&(Xe=new Vi(Xe,e,null,n,R),O.push({event:Xe,listeners:pe}),ze?Xe.data=ze:(ze=Sn(n),ze!==null&&(Xe.data=ze)))),(ze=Hn?nn(e,n):gt(e,n))&&(Xe=jl(w,"onBeforeInput"),0<Xe.length&&(pe=new Vi("onBeforeInput","beforeinput",null,n,R),O.push({event:pe,listeners:Xe}),pe.data=ze)),Mg(O,e,w,n,R)}Lf(O,t)})}function Pi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,a=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||a===null||(o=ar(e,n),o!=null&&r.unshift(Pi(e,o,a)),o=ar(e,t),o!=null&&r.push(Pi(e,o,a))),e.tag===3)return r;e=e.return}return[]}function jg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,n,r,o){for(var a=t._reactName,i=[];n!==null&&n!==r;){var s=n,h=s.alternate,w=s.stateNode;if(s=s.tag,h!==null&&h===r)break;s!==5&&s!==26&&s!==27||w===null||(h=w,o?(w=ar(n,a),w!=null&&i.unshift(Pi(n,w,h))):o||(w=ar(n,a),w!=null&&i.push(Pi(n,w,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Tg=/\r\n?/g,Lg=/\u0000|\uFFFD/g;function Of(e){return(typeof e=="string"?e:""+e).replace(Tg,`
41
- `).replace(Lg,"")}function Uf(e,t){return t=Of(t),Of(e)===t}function dt(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||gr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&gr(e,""+r);break;case"className":tr(e,"class",r);break;case"tabIndex":tr(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(e,n,r);break;case"style":jo(e,r,a);break;case"data":if(t!=="object"){tr(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=yr(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.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"?(t!=="input"&&dt(e,t,"name",o.name,o,null),dt(e,t,"formEncType",o.formEncType,o,null),dt(e,t,"formMethod",o.formMethod,o,null),dt(e,t,"formTarget",o.formTarget,o,null)):(dt(e,t,"encType",o.encType,o,null),dt(e,t,"method",o.method,o,null),dt(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=yr(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=kn);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(d(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=yr(""+r),e.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":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),wn(e,"popover",r);break;case"xlinkActuate":nr(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":nr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":nr(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":nr(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":nr(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":nr(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":nr(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":nr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":nr(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":wn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Wt.get(n)||n,wn(e,n,r))}}function Vu(e,t,n,r,o,a){switch(n){case"style":jo(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(d(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"children":typeof r=="string"?gr(e,r):(typeof r=="number"||typeof r=="bigint")&&gr(e,""+r);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!la.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),a=e[qt]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,o),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):wn(e,n,r)}}}function ln(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var r=!1,o=!1,a;for(a in n)if(n.hasOwnProperty(a)){var i=n[a];if(i!=null)switch(a){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:dt(e,t,a,i,n,null)}}o&&dt(e,t,"srcSet",n.srcSet,n,null),r&&dt(e,t,"src",n.src,n,null);return;case"input":Qe("invalid",e);var s=a=i=o=null,h=null,w=null;for(r in n)if(n.hasOwnProperty(r)){var R=n[r];if(R!=null)switch(r){case"name":o=R;break;case"type":i=R;break;case"checked":h=R;break;case"defaultChecked":w=R;break;case"value":a=R;break;case"defaultValue":s=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(d(137,t));break;default:dt(e,t,r,R,n,null)}}rr(e,a,s,h,w,i,o,!1);return;case"select":Qe("invalid",e),r=i=a=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":a=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:dt(e,t,o,s,n,null)}t=a,n=i,e.multiple=!!r,t!=null?Gr(e,!!r,t,!1):n!=null&&Gr(e,!!r,n,!0);return;case"textarea":Qe("invalid",e),a=o=r=null;for(i in n)if(n.hasOwnProperty(i)&&(s=n[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":o=s;break;case"children":a=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(d(91));break;default:dt(e,t,i,s,n,null)}Ga(e,r,o,a);return;case"option":for(h in n)if(n.hasOwnProperty(h)&&(r=n[h],r!=null))switch(h){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:dt(e,t,h,r,n,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(r=0;r<Ii.length;r++)Qe(Ii[r],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(w in n)if(n.hasOwnProperty(w)&&(r=n[w],r!=null))switch(w){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:dt(e,t,w,r,n,null)}return;default:if(Jr(t)){for(R in n)n.hasOwnProperty(R)&&(r=n[R],r!==void 0&&Vu(e,t,R,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&dt(e,t,s,r,n,null))}function Fg(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,a=null,i=null,s=null,h=null,w=null,R=null;for(A in n){var O=n[A];if(n.hasOwnProperty(A)&&O!=null)switch(A){case"checked":break;case"value":break;case"defaultValue":h=O;default:r.hasOwnProperty(A)||dt(e,t,A,null,r,O)}}for(var _ in r){var A=r[_];if(O=n[_],r.hasOwnProperty(_)&&(A!=null||O!=null))switch(_){case"type":a=A;break;case"name":o=A;break;case"checked":w=A;break;case"defaultChecked":R=A;break;case"value":i=A;break;case"defaultValue":s=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(d(137,t));break;default:A!==O&&dt(e,t,_,A,r,O)}}sa(e,i,s,h,w,R,a,o);return;case"select":A=i=s=_=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":A=h;default:r.hasOwnProperty(a)||dt(e,t,a,null,r,h)}for(o in r)if(a=r[o],h=n[o],r.hasOwnProperty(o)&&(a!=null||h!=null))switch(o){case"value":_=a;break;case"defaultValue":s=a;break;case"multiple":i=a;default:a!==h&&dt(e,t,o,a,r,h)}t=s,n=i,r=A,_!=null?Gr(e,!!n,_,!1):!!r!=!!n&&(t!=null?Gr(e,!!n,t,!0):Gr(e,!!n,n?[]:"",!1));return;case"textarea":A=_=null;for(s in n)if(o=n[s],n.hasOwnProperty(s)&&o!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:dt(e,t,s,null,r,o)}for(i in r)if(o=r[i],a=n[i],r.hasOwnProperty(i)&&(o!=null||a!=null))switch(i){case"value":_=o;break;case"defaultValue":A=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(d(91));break;default:o!==a&&dt(e,t,i,o,r,a)}Ui(e,_,A);return;case"option":for(var ue in n)if(_=n[ue],n.hasOwnProperty(ue)&&_!=null&&!r.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:dt(e,t,ue,null,r,_)}for(h in r)if(_=r[h],A=n[h],r.hasOwnProperty(h)&&_!==A&&(_!=null||A!=null))switch(h){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:dt(e,t,h,_,r,A)}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 Se in n)_=n[Se],n.hasOwnProperty(Se)&&_!=null&&!r.hasOwnProperty(Se)&&dt(e,t,Se,null,r,_);for(w in r)if(_=r[w],A=n[w],r.hasOwnProperty(w)&&_!==A&&(_!=null||A!=null))switch(w){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(d(137,t));break;default:dt(e,t,w,_,r,A)}return;default:if(Jr(t)){for(var mt in n)_=n[mt],n.hasOwnProperty(mt)&&_!==void 0&&!r.hasOwnProperty(mt)&&Vu(e,t,mt,void 0,r,_);for(R in r)_=r[R],A=n[R],!r.hasOwnProperty(R)||_===A||_===void 0&&A===void 0||Vu(e,t,R,_,r,A);return}}for(var v in n)_=n[v],n.hasOwnProperty(v)&&_!=null&&!r.hasOwnProperty(v)&&dt(e,t,v,null,r,_);for(O in r)_=r[O],A=n[O],!r.hasOwnProperty(O)||_===A||_==null&&A==null||dt(e,t,O,_,r,A)}function qf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $g(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],a=o.transferSize,i=o.initiatorType,s=o.duration;if(a&&s&&qf(i)){for(i=0,s=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],w=h.startTime;if(w>s)break;var R=h.transferSize,O=h.initiatorType;R&&qf(O)&&(h=h.responseEnd,i+=R*(h<s?1:(s-w)/(h-w)))}if(--r,t+=8*(a+i)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Qu=null,Bu=null;function Tl(e){return e.nodeType===9?e:e.ownerDocument}function Wf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Hf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ku(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xu=null;function Og(){var e=window.event;return e&&e.type==="popstate"?e===Xu?!1:(Xu=e,!0):(Xu=null,!1)}var Vf=typeof setTimeout=="function"?setTimeout:void 0,Ug=typeof clearTimeout=="function"?clearTimeout:void 0,Qf=typeof Promise=="function"?Promise:void 0,qg=typeof queueMicrotask=="function"?queueMicrotask:typeof Qf<"u"?function(e){return Qf.resolve(null).then(e).catch(Wg)}:Vf;function Wg(e){setTimeout(function(){throw e})}function xo(e){return e==="head"}function Bf(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(o),Ua(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ri(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ri(n);for(var a=n.firstChild;a;){var i=a.nextSibling,s=a.nodeName;a[kr]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Ri(e.ownerDocument.body);n=o}while(n);Ua(t)}function Kf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Gu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Gu(n),Qa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Hg(e,t,n,r){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[kr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence")||a!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Gn(e.nextSibling),e===null)break}return null}function Vg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Gn(e.nextSibling),e===null))return null;return e}function Xf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gn(e.nextSibling),e===null))return null;return e}function Ju(e){return e.data==="$?"||e.data==="$~"}function Zu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Qg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Gn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Yu=null;function Gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Gn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Jf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Zf(e,t,n){switch(t=Tl(n),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Ri(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qa(e)}var Jn=new Map,Yf=new Set;function Ll(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ur=q.d;q.d={f:Bg,r:Kg,D:Xg,C:Gg,L:Jg,m:Zg,X:e0,S:Yg,M:t0};function Bg(){var e=Ur.f(),t=Il();return e||t}function Kg(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?hm(t):Ur.r(e)}var Fa=typeof document>"u"?null:document;function ep(e,t,n){var r=Fa;if(r&&typeof t=="string"&&t){var o=en(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Yf.has(o)||(Yf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),ln(t,"link",e),jt(t),r.head.appendChild(t)))}}function Xg(e){Ur.D(e),ep("dns-prefetch",e,null)}function Gg(e,t){Ur.C(e,t),ep("preconnect",e,t)}function Jg(e,t,n){Ur.L(e,t,n);var r=Fa;if(r&&e&&t){var o='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+en(n.imageSizes)+'"]')):o+='[href="'+en(e)+'"]';var a=o;switch(t){case"style":a=$a(e);break;case"script":a=Oa(e)}Jn.has(a)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Jn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(Mi(a))||t==="script"&&r.querySelector(Di(a))||(t=r.createElement("link"),ln(t,"link",e),jt(t),r.head.appendChild(t)))}}function Zg(e,t){Ur.m(e,t);var n=Fa;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+en(r)+'"][href="'+en(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Oa(e)}if(!Jn.has(a)&&(e=E({rel:"modulepreload",href:e},t),Jn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Di(a)))return}r=n.createElement("link"),ln(r,"link",e),jt(r),n.head.appendChild(r)}}}function Yg(e,t,n){Ur.S(e,t,n);var r=Fa;if(r&&e){var o=Rt(r).hoistableStyles,a=$a(e);t=t||"default";var i=o.get(a);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Mi(a)))s.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Jn.get(a))&&ec(e,n);var h=i=r.createElement("link");jt(h),ln(h,"link",e),h._p=new Promise(function(w,R){h.onload=w,h.onerror=R}),h.addEventListener("load",function(){s.loading|=1}),h.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Fl(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:s},o.set(a,i)}}}function e0(e,t){Ur.X(e,t);var n=Fa;if(n&&e){var r=Rt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=E({src:e,async:!0},t),(t=Jn.get(o))&&tc(e,t),a=n.createElement("script"),jt(a),ln(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function t0(e,t){Ur.M(e,t);var n=Fa;if(n&&e){var r=Rt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=E({src:e,async:!0,type:"module"},t),(t=Jn.get(o))&&tc(e,t),a=n.createElement("script"),jt(a),ln(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function tp(e,t,n,r){var o=(o=ve.current)?Ll(o):null;if(!o)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$a(n.href),n=Rt(o).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=$a(n.href);var a=Rt(o).hoistableStyles,i=a.get(e);if(i||(o=o.ownerDocument||o,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,i),(a=o.querySelector(Mi(e)))&&!a._p&&(i.instance=a,i.state.loading=5),Jn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Jn.set(e,n),a||n0(o,e,n,i.state))),t&&r===null)throw Error(d(528,""));return i}if(t&&r!==null)throw Error(d(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Oa(n),n=Rt(o).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function $a(e){return'href="'+en(e)+'"'}function Mi(e){return'link[rel="stylesheet"]['+e+"]"}function np(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function n0(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),ln(t,"link",n),jt(t),e.head.appendChild(t))}function Oa(e){return'[src="'+en(e)+'"]'}function Di(e){return"script[async]"+e}function rp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(r)return t.instance=r,jt(r),r;var o=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),jt(r),ln(r,"style",o),Fl(r,n.precedence,e),t.instance=r;case"stylesheet":o=$a(n.href);var a=e.querySelector(Mi(o));if(a)return t.state.loading|=4,t.instance=a,jt(a),a;r=np(n),(o=Jn.get(o))&&ec(r,o),a=(e.ownerDocument||e).createElement("link"),jt(a);var i=a;return i._p=new Promise(function(s,h){i.onload=s,i.onerror=h}),ln(a,"link",r),t.state.loading|=4,Fl(a,n.precedence,e),t.instance=a;case"script":return a=Oa(n.src),(o=e.querySelector(Di(a)))?(t.instance=o,jt(o),o):(r=n,(o=Jn.get(a))&&(r=E({},n),tc(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),jt(o),ln(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Fl(r,n.precedence,e));return t.instance}function Fl(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,a=o,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===t)a=s;else if(a!==o)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ec(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function tc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $l=null;function op(e,t,n){if($l===null){var r=new Map,o=$l=new Map;o.set(n,r)}else o=$l,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var a=n[o];if(!(a[kr]||a[Ct]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var i=a.getAttribute(t)||"";i=e+i;var s=r.get(i);s?s.push(a):r.set(i,[a])}}return r}function ap(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function r0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function o0(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=$a(r.href),a=t.querySelector(Mi(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ol.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,jt(a);return}a=t.ownerDocument||t,r=np(r),(o=Jn.get(o))&&ec(r,o),a=a.createElement("link"),jt(a);var i=a;i._p=new Promise(function(s,h){i.onload=s,i.onerror=h}),ln(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ol.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var nc=0;function a0(e,t){return e.stylesheets&&e.count===0&&ql(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&nc===0&&(nc=62500*$g());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>nc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Ol(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ql(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ul=null;function ql(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ul=new Map,t.forEach(i0,e),Ul=null,Ol.call(e))}function i0(e,t){if(!(t.state.loading&4)){var n=Ul.get(e);if(n)var r=n.get(null);else{n=new Map,Ul.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var i=o[a];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}o=t.instance,i=o.getAttribute("data-precedence"),a=n.get(i)||r,a===r&&n.set(null,o),n.set(i,o),this.count++,r=Ol.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),a?a.parentNode.insertBefore(o,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var zi={$$typeof:oe,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function l0(e,t,n,r,o,a,i,s,h){this.tag=1,this.containerInfo=e,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=Yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yn(0),this.hiddenUpdates=Yn(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function lp(e,t,n,r,o,a,i,s,h,w,R,O){return e=new l0(e,t,n,i,h,w,R,O,s),t=1,a===!0&&(t|=24),a=jn(3,null,null,t),e.current=a,a.stateNode=e,t=js(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},$s(a),e}function sp(e){return e?(e=ya,e):ya}function up(e,t,n,r,o,a){o=sp(o),r.context===null?r.context=o:r.pendingContext=o,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Pn(n,e,t),di(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rc(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Wo(e,67108864);t!==null&&Pn(t,e,67108864),rc(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=On();t=er(t);var n=Wo(e,t);n!==null&&Pn(n,e,t),rc(e,t)}}var Wl=!0;function s0(e,t,n,r){var o=C.T;C.T=null;var a=q.p;try{q.p=2,oc(e,t,n,r)}finally{q.p=a,C.T=o}}function u0(e,t,n,r){var o=C.T;C.T=null;var a=q.p;try{q.p=8,oc(e,t,n,r)}finally{q.p=a,C.T=o}}function oc(e,t,n,r){if(Wl){var o=ac(r);if(o===null)Hu(e,t,r,Hl,n),pp(e,r);else if(d0(o,e,t,n,r))r.stopPropagation();else if(pp(e,r),t&4&&-1<c0.indexOf(e)){for(;o!==null;){var a=Kr(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var i=xn(a.pendingLanes);if(i!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var h=1<<31-ft(i);s.entanglements[1]|=h,i&=~h}wr(a),(at&6)===0&&(El=Ze()+500,Ai(0))}}break;case 31:case 13:s=Wo(a,2),s!==null&&Pn(s,a,2),Il(),rc(a,2)}if(a=ac(r),a===null&&Hu(e,t,r,Hl,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Hu(e,t,r,null,n)}}function ac(e){return e=et(e),ic(e)}var Hl=null;function ic(e){if(Hl=null,e=fr(e),e!==null){var t=M(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=L(t),e!==null)return e;e=null}else if(n===31){if(e=X(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hl=e,null}function fp(e){switch(e){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(Fe()){case un:return 2;case it:return 8;case Kt:case Mn:return 32;case Ro:return 268435456;default:return 32}default:return 32}}var lc=!1,wo=null,ko=null,_o=null,Ni=new Map,ji=new Map,So=[],c0="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 pp(e,t){switch(e){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":ko=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":Ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ji.delete(t.pointerId)}}function Ti(e,t,n,r,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},t!==null&&(t=Kr(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function d0(e,t,n,r,o){switch(t){case"focusin":return wo=Ti(wo,e,t,n,r,o),!0;case"dragenter":return ko=Ti(ko,e,t,n,r,o),!0;case"mouseover":return _o=Ti(_o,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Ni.set(a,Ti(Ni.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,ji.set(a,Ti(ji.get(a)||null,e,t,n,r,o)),!0}return!1}function hp(e){var t=fr(e.target);if(t!==null){var n=M(t);if(n!==null){if(t=n.tag,t===13){if(t=L(n),t!==null){e.blockedOn=t,Br(e.priority,function(){mp(n)});return}}else if(t===31){if(t=X(n),t!==null){e.blockedOn=t,Br(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ac(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ca=r,n.target.dispatchEvent(r),ca=null}else return t=Kr(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function gp(e,t,n){Vl(e)&&n.delete(t)}function m0(){lc=!1,wo!==null&&Vl(wo)&&(wo=null),ko!==null&&Vl(ko)&&(ko=null),_o!==null&&Vl(_o)&&(_o=null),Ni.forEach(gp),ji.forEach(gp)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,lc||(lc=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,m0)))}var Bl=null;function yp(e){Bl!==e&&(Bl=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){Bl===e&&(Bl=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if(typeof r!="function"){if(ic(r||n)===null)continue;break}var a=Kr(n);a!==null&&(e.splice(t,3),t-=3,au(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Ua(e){function t(h){return Ql(h,e)}wo!==null&&Ql(wo,e),ko!==null&&Ql(ko,e),_o!==null&&Ql(_o,e),Ni.forEach(t),ji.forEach(t);for(var n=0;n<So.length;n++){var r=So[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<So.length&&(n=So[0],n.blockedOn===null);)hp(n),n.blockedOn===null&&So.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],a=n[r+1],i=o[qt]||null;if(typeof a=="function")i||yp(n);else if(i){var s=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[qt]||null)s=i.formAction;else if(ic(o)!==null)continue}else s=i.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),yp(n)}}}function vp(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(i){return o=i})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!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 r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function sc(e){this._internalRoot=e}Kl.prototype.render=sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var n=t.current,r=On();up(n,r,e,t,null,null)},Kl.prototype.unmount=sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Il(),t[mr]=null}};function Kl(e){this._internalRoot=e}Kl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ra();e={blockedOn:null,target:e,priority:t};for(var n=0;n<So.length&&t!==0&&t<So[n].priority;n++);So.splice(n,0,e),n===0&&hp(e)}};var bp=l.version;if(bp!=="19.2.1")throw Error(d(527,bp,"19.2.1"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=y(t),e=e!==null?$(e):null,e=e===null?null:e.stateNode,e};var f0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{Xt=Xl.inject(f0),Nt=Xl}catch{}}return qa.createRoot=function(e,t){if(!k(e))throw Error(d(299));var n=!1,r="",o=Cm,a=Em,i=Am;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=lp(e,1,!1,null,null,n,r,null,o,a,i,vp),e[mr]=t.current,Wu(e),new sc(t)},qa.hydrateRoot=function(e,t,n){if(!k(e))throw Error(d(299));var r=!1,o="",a=Cm,i=Em,s=Am,h=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=lp(e,1,!0,t,n??null,r,o,h,a,i,s,vp),t.context=sp(null),n=t.current,r=On(),r=er(r),o=so(r),o.callback=null,uo(n,o,r),n=r,t.current.lanes=n,dr(t,n),wr(t),e[mr]=t.current,Wu(e),new Kl(t)},qa.version="19.2.1",qa}var bc;function Cp(){if(bc)return Zl.exports;bc=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),Zl.exports=Sp(),Zl.exports}var Ep=Cp();const xc=cr(Ep);var wc={exports:{}},Wa={};/**
40
+ `+r.stack}}var Rt=Object.prototype.hasOwnProperty,X=s.unstable_scheduleCallback,Ge=s.unstable_cancelCallback,Z=s.unstable_shouldYield,K=s.unstable_requestPaint,Ie=s.unstable_now,Le=s.unstable_getCurrentPriorityLevel,Sn=s.unstable_ImmediatePriority,vt=s.unstable_UserBlockingPriority,dn=s.unstable_NormalPriority,it=s.unstable_LowPriority,Xt=s.unstable_IdlePriority,Dt=s.log,no=s.unstable_setDisableYieldValue,cr=null,Zt=null;function Ue(e){if(typeof Dt=="function"&&no(e),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(cr,e)}catch{}}var ot=Math.clz32?Math.clz32:Jn,Ke=Math.log,Zn=Math.LN2;function Jn(e){return e>>>=0,e===0?32:31-(Ke(e)/Zn|0)|0}var fn=256,pe=262144,Ht=4194304;function Jt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Yn(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?o=Jt(r):(i&=u,i!==0?o=Jt(i):n||(n=u&~e,n!==0&&(o=Jt(n))))):(u=r&~a,u!==0?o=Jt(u):i!==0?o=Jt(i):n||(n=r&~e,n!==0&&(o=Jt(n)))),o===0?0:t!==0&&t!==o&&(t&a)===0&&(a=o&-o,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:o}function Cr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function de(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 tt(){var e=Ht;return Ht<<=1,(Ht&62914560)===0&&(Ht=4194304),e}function mn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ro(e,t,n,r,o,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,h=e.expirationTimes,k=e.hiddenUpdates;for(n=i&~n;0<n;){var j=31-ot(n),O=1<<j;u[j]=0,h[j]=-1;var _=k[j];if(_!==null)for(k[j]=null,j=0;j<_.length;j++){var I=_[j];I!==null&&(I.lane&=-536870913)}n&=~O}r!==0&&Ir(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(i&~t))}function Ir(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ot(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Wo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function zr(e,t){var n=t&-t;return n=(n&42)!==0?1:er(n),(n&(e.suspendedLanes|t))!==0?0:n}function er(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function sa(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:hp(e.type))}function oo(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var Rn=Math.random().toString(36).slice(2),Et="__reactFiber$"+Rn,qt="__reactProps$"+Rn,fr="__reactContainer$"+Rn,ua="__reactEvents$"+Rn,Bi="__reactListeners$"+Rn,ca="__reactHandles$"+Rn,da="__reactResources$"+Rn,Pr="__reactMarker$"+Rn;function Xa(e){delete e[Et],delete e[qt],delete e[ua],delete e[Bi],delete e[ca]}function mr(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fr]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ym(e);e!==null;){if(n=e[Et])return n;e=Ym(e)}return t}e=n,n=e.parentNode}return null}function ao(e){if(e=e[Et]||e[fr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function It(e){var t=e[da];return t||(t=e[da]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[Pr]=!0}var Yt=new Set,fa={};function pr(e,t){Mr(e,t),Mr(e+"Capture",t)}function Mr(e,t){for(fa[e]=t,e=0;e<t.length;e++)Yt.add(t[e])}var io=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]*$"),Bo={},qi={};function Za(e){return Rt.call(qi,e)?!0:Rt.call(Bo,e)?!1:io.test(e)?qi[e]=!0:(Bo[e]=!0,!1)}function _n(e,t,n){if(Za(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function tr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function nr(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function bn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ja(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tr(e){if(!e._valueTracker){var t=Ja(e)?"checked":"value";e._valueTracker=pn(e,t,""+e[t])}}function xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ja(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ma=/[\n"\\]/g;function en(e){return e.replace(ma,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function pa(e,t,n,r,o,a,i,u){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bn(t)):e.value!==""+bn(t)&&(e.value=""+bn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ha(e,i,bn(t)):n!=null?ha(e,i,bn(n)):r!=null&&e.removeAttribute("value"),o==null&&a!=null&&(e.defaultChecked=!!a),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+bn(u):e.removeAttribute("name")}function rr(e,t,n,r,o,a,i,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Tr(e);return}n=n!=null?""+bn(n):"",t=t!=null?""+bn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Tr(e)}function ha(e,t,n){t==="number"&&hr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function lo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+bn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Vi(e,t,n){if(t!=null&&(t=""+bn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+bn(n):""}function Ya(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Fe(r)){if(1<r.length)throw Error(c(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=bn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Tr(e)}function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rr=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 or(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Rr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function qo(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&or(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&or(e,a,t[a])}function so(e){if(e.indexOf("-")===-1)return!1;switch(e){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!1;default:return!0}}var tn=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"]]),Ui=/^[\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 ga(e){return Ui.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hn(){}var jr=null;function uo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ar=null,Xe=null;function ei(e){var t=ao(e);if(t&&(e=t.stateNode)){var n=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(pa(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[qt]||null;if(!o)throw Error(c(90));pa(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&xt(r)}break e;case"textarea":Vi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&lo(e,!!n.multiple,t,!1)}}}var ti=!1;function co(e,t,n){if(ti)return e(t,n);ti=!0;try{var r=e(t);return r}finally{if(ti=!1,(Ar!==null||Xe!==null)&&(Rl(),Ar&&(t=Ar,e=Xe,Xe=Ar=null,ei(t),e)))for(t=0;t<e.length;t++)ei(e[t])}}function fo(e,t){var n=e.stateNode;if(n===null)return null;var r=n[qt]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nr=!1;if(jn)try{var mo={};Object.defineProperty(mo,"passive",{get:function(){Nr=!0}}),window.addEventListener("test",mo,mo),window.removeEventListener("test",mo,mo)}catch{Nr=!1}var lt=null,Ft=null,nn=null;function Ki(){if(nn)return nn;var e,t=Ft,n=t.length,r,o="value"in lt?lt.value:lt.textContent,a=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[a-r];r++);return nn=o.slice(e,1<r?1-r:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zt(){return!0}function yr(){return!1}function on(e){function t(n,r,o,a,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?zt:yr,this.isPropagationStopped=yr,this}return C(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zt)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zt)},persist:function(){},isPersistent:zt}),t}var Dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=on(Dr),br=C({},Dr,{view:0,detail:0}),Hi=on(br),ya,vr,Lr,po=C({},br,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ii,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Lr&&(Lr&&e.type==="mousemove"?(ya=e.screenX-Lr.screenX,vr=e.screenY-Lr.screenY):vr=ya=0,Lr=e),ya)},movementY:function(e){return"movementY"in e?e.movementY:vr}}),xr=on(po),Qi=C({},po,{dataTransfer:0}),Gi=on(Qi),ni=C({},br,{relatedTarget:0}),ri=on(ni),fs=C({},Dr,{animationName:0,elapsedTime:0,pseudoElement:0}),Xi=on(fs),ms=C({},Dr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ps=on(ms),Zi=C({},Dr,{data:0}),oi=on(Zi),ai={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hs={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"},gs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ys(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gs[e])?!!t[e]:!1}function ii(){return ys}var bs=C({},br,{key:function(e){if(e.key){var t=ai[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ii,charCode:function(e){return e.type==="keypress"?rn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),d=on(bs),z=C({},po,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P=on(z),T=C({},br,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ii}),J=on(T),me=C({},Dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),$e=on(me),qe=C({},po,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mt=on(qe),ge=C({},Dr,{newState:0,oldState:0}),yt=on(ge),bt=[9,13,27,32],Vt=jn&&"CompositionEvent"in window,Qt=null;jn&&"documentMode"in document&&(Qt=document.documentMode);var Ce=jn&&"TextEvent"in window&&!Qt,je=jn&&(!Vt||Qt&&8<Qt&&11>=Qt),pt=" ",ht=!1;function Ut(e,t){switch(e){case"keyup":return bt.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gn(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var We=!1;function xn(e,t){switch(e){case"compositionend":return gn(t);case"keypress":return t.which!==32?null:(ht=!0,pt);case"textInput":return e=t.data,e===pt&&ht?null:e;default:return null}}function Bn(e,t){if(We)return e==="compositionend"||!Vt&&Ut(e,t)?(e=Ki(),nn=Ft=lt=null,We=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return je&&t.locale!=="ko"?null:t.data;default:return null}}var An={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!An[e.type]:t==="textarea"}function Fr(e,t,n,r){Ar?Xe?Xe.push(r):Xe=[r]:Ar=r,t=Ol(t,"onChange"),0<t.length&&(n=new vn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var wr=null,En=null;function jt(e){Om(e,0)}function Uo(e){var t=Ct(e);if(xt(t))return e}function rd(e,t){if(e==="change")return t}var od=!1;if(jn){var vs;if(jn){var xs="oninput"in document;if(!xs){var ad=document.createElement("div");ad.setAttribute("oninput","return;"),xs=typeof ad.oninput=="function"}vs=xs}else vs=!1;od=vs&&(!document.documentMode||9<document.documentMode)}function id(){wr&&(wr.detachEvent("onpropertychange",ld),En=wr=null)}function ld(e){if(e.propertyName==="value"&&Uo(En)){var t=[];Fr(t,En,e,uo(e)),co(jt,t)}}function Kh(e,t,n){e==="focusin"?(id(),wr=t,En=n,wr.attachEvent("onpropertychange",ld)):e==="focusout"&&id()}function Hh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Uo(En)}function Qh(e,t){if(e==="click")return Uo(t)}function Gh(e,t){if(e==="input"||e==="change")return Uo(t)}function Xh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:Xh;function li(e,t){if(Nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Rt.call(t,o)||!Nn(e[o],t[o]))return!1}return!0}function sd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ud(e,t){var n=sd(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sd(n)}}function cd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hr(e.document)}return t}function ws(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Zh=jn&&"documentMode"in document&&11>=document.documentMode,ba=null,ks=null,si=null,Ss=!1;function fd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ss||ba==null||ba!==hr(r)||(r=ba,"selectionStart"in r&&ws(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&li(si,r)||(si=r,r=Ol(ks,"onSelect"),0<r.length&&(t=new vn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ba)))}function Ko(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var va={animationend:Ko("Animation","AnimationEnd"),animationiteration:Ko("Animation","AnimationIteration"),animationstart:Ko("Animation","AnimationStart"),transitionrun:Ko("Transition","TransitionRun"),transitionstart:Ko("Transition","TransitionStart"),transitioncancel:Ko("Transition","TransitionCancel"),transitionend:Ko("Transition","TransitionEnd")},_s={},md={};jn&&(md=document.createElement("div").style,"AnimationEvent"in window||(delete va.animationend.animation,delete va.animationiteration.animation,delete va.animationstart.animation),"TransitionEvent"in window||delete va.transitionend.transition);function Ho(e){if(_s[e])return _s[e];if(!va[e])return e;var t=va[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in md)return _s[e]=t[n];return e}var pd=Ho("animationend"),hd=Ho("animationiteration"),gd=Ho("animationstart"),Jh=Ho("transitionrun"),Yh=Ho("transitionstart"),eg=Ho("transitioncancel"),yd=Ho("transitionend"),bd=new Map,Es="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(" ");Es.push("scrollEnd");function ar(e,t){bd.set(e,t),pr(t,[e])}var Ji=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qn=[],xa=0,Cs=0;function Yi(){for(var e=xa,t=Cs=xa=0;t<e;){var n=qn[t];qn[t++]=null;var r=qn[t];qn[t++]=null;var o=qn[t];qn[t++]=null;var a=qn[t];if(qn[t++]=null,r!==null&&o!==null){var i=r.pending;i===null?o.next=o:(o.next=i.next,i.next=o),r.pending=o}a!==0&&vd(n,o,a)}}function el(e,t,n,r){qn[xa++]=e,qn[xa++]=t,qn[xa++]=n,qn[xa++]=r,Cs|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Is(e,t,n,r){return el(e,t,n,r),tl(e)}function Qo(e,t){return el(e,null,null,t),tl(e)}function vd(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var o=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(o=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,o&&t!==null&&(o=31-ot(n),e=a.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=n|536870912),a):null}function tl(e){if(50<Mi)throw Mi=0,Du=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wa={};function tg(e,t,n,r){this.tag=e,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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dn(e,t,n,r){return new tg(e,t,n,r)}function zs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Or(e,t){var n=e.alternate;return n===null?(n=Dn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function xd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function nl(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")zs(e)&&(i=1);else if(typeof e=="string")i=i0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=Dn(31,n,t,o),e.elementType=se,e.lanes=a,e;case U:return Go(n.children,o,a,t);case Q:i=8,o|=24;break;case te:return e=Dn(12,n,t,o|2),e.elementType=te,e.lanes=a,e;case ae:return e=Dn(13,n,t,o),e.elementType=ae,e.lanes=a,e;case q:return e=Dn(19,n,t,o),e.elementType=q,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case re:i=10;break e;case le:i=9;break e;case ye:i=11;break e;case B:i=14;break e;case be:i=16,r=null;break e}i=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Dn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Go(e,t,n,r){return e=Dn(7,e,r,t),e.lanes=n,e}function Ps(e,t,n){return e=Dn(6,e,null,t),e.lanes=n,e}function wd(e){var t=Dn(18,null,null,0);return t.stateNode=e,t}function Ms(e,t,n){return t=Dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kd=new WeakMap;function Vn(e,t){if(typeof e=="object"&&e!==null){var n=kd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:_t(t)},kd.set(e,t),t)}return{value:e,source:t,stack:_t(t)}}var ka=[],Sa=0,rl=null,ui=0,Un=[],Kn=0,ho=null,kr=1,Sr="";function $r(e,t){ka[Sa++]=ui,ka[Sa++]=rl,rl=e,ui=t}function Sd(e,t,n){Un[Kn++]=kr,Un[Kn++]=Sr,Un[Kn++]=ho,ho=e;var r=kr;e=Sr;var o=32-ot(r)-1;r&=~(1<<o),n+=1;var a=32-ot(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,kr=1<<32-ot(t)+o|n<<o|r,Sr=a+e}else kr=1<<a|n<<o|r,Sr=e}function Ts(e){e.return!==null&&($r(e,1),Sd(e,1,0))}function Rs(e){for(;e===rl;)rl=ka[--Sa],ka[Sa]=null,ui=ka[--Sa],ka[Sa]=null;for(;e===ho;)ho=Un[--Kn],Un[Kn]=null,Sr=Un[--Kn],Un[Kn]=null,kr=Un[--Kn],Un[Kn]=null}function _d(e,t){Un[Kn++]=kr,Un[Kn++]=Sr,Un[Kn++]=ho,kr=t.id,Sr=t.overflow,ho=e}var an=null,wt=null,Ye=!1,go=null,Hn=!1,js=Error(c(519));function yo(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ci(Vn(t,e)),js}function Ed(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Et]=e,t[qt]=r,n){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(n=0;n<Ri.length;n++)Qe(Ri[n],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),rr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Ya(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||qm(t.textContent,n)?(r.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),r.onScroll!=null&&Qe("scroll",t),r.onScrollEnd!=null&&Qe("scrollend",t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||yo(e,!0)}function Cd(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:an=an.return}}function _a(e){if(e!==an)return!1;if(!Ye)return Cd(e),Ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Zu(e.type,e.memoizedProps)),n=!n),n&&wt&&yo(e),Cd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));wt=Jm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));wt=Jm(e)}else t===27?(t=wt,To(e.type)?(e=nc,nc=null,wt=e):wt=t):wt=an?Qn(e.stateNode.nextSibling):null;return!0}function Xo(){wt=an=null,Ye=!1}function As(){var e=go;return e!==null&&(Pn===null?Pn=e:Pn.push.apply(Pn,e),go=null),e}function ci(e){go===null?go=[e]:go.push(e)}var Ns=p(null),Zo=null,Wr=null;function bo(e,t,n){H(Ns,t._currentValue),t._currentValue=n}function Br(e){e._currentValue=Ns.current,M(Ns)}function Ds(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ls(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){var i=o.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=o;for(var h=0;h<t.length;h++)if(u.context===t[h]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ds(a.return,n,e),r||(i=null);break e}a=u.next}}else if(o.tag===18){if(i=o.return,i===null)throw Error(c(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Ds(i,n,e),i=null}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===e){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}}function Ea(e,t,n,r){e=null;for(var o=t,a=!1;o!==null;){if(!a){if((o.flags&524288)!==0)a=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var i=o.alternate;if(i===null)throw Error(c(387));if(i=i.memoizedProps,i!==null){var u=o.type;Nn(o.pendingProps.value,i.value)||(e!==null?e.push(u):e=[u])}}else if(o===ze.current){if(i=o.alternate,i===null)throw Error(c(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Li):e=[Li])}o=o.return}e!==null&&Ls(t,e,n,r),t.flags|=262144}function ol(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jo(e){Zo=e,Wr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ln(e){return Id(Zo,e)}function al(e,t){return Zo===null&&Jo(e),Id(e,t)}function Id(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wr===null){if(e===null)throw Error(c(308));Wr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wr=Wr.next=t;return n}var ng=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},rg=s.unstable_scheduleCallback,og=s.unstable_NormalPriority,Ot={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fs(){return{controller:new ng,data:new Map,refCount:0}}function di(e){e.refCount--,e.refCount===0&&rg(og,function(){e.controller.abort()})}var fi=null,Os=0,Ca=0,Ia=null;function ag(e,t){if(fi===null){var n=fi=[];Os=0,Ca=Bu(),Ia={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Os++,t.then(zd,zd),t}function zd(){if(--Os===0&&fi!==null){Ia!==null&&(Ia.status="fulfilled");var e=fi;fi=null,Ca=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ig(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var Pd=E.S;E.S=function(e,t){mm=Ie(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ag(e,t),Pd!==null&&Pd(e,t)};var Yo=p(null);function $s(){var e=Yo.current;return e!==null?e:gt.pooledCache}function il(e,t){t===null?H(Yo,Yo.current):H(Yo,t.pool)}function Md(){var e=$s();return e===null?null:{parent:Ot._currentValue,pool:e}}var za=Error(c(460)),Ws=Error(c(474)),ll=Error(c(542)),sl={then:function(){}};function Td(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e;default:if(typeof t.status=="string")t.then(hn,hn);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=r}},function(r){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e}throw ta=t,za}}function ea(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ta=n,za):n}}var ta=null;function jd(){if(ta===null)throw Error(c(459));var e=ta;return ta=null,e}function Ad(e){if(e===za||e===ll)throw Error(c(483))}var Pa=null,mi=0;function ul(e){var t=mi;return mi+=1,Pa===null&&(Pa=[]),Rd(Pa,e,t)}function pi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function cl(e,t){throw t.$$typeof===V?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Nd(e){function t(b,g){if(e){var w=b.deletions;w===null?(b.deletions=[g],b.flags|=16):w.push(g)}}function n(b,g){if(!e)return null;for(;g!==null;)t(b,g),g=g.sibling;return null}function r(b){for(var g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function o(b,g){return b=Or(b,g),b.index=0,b.sibling=null,b}function a(b,g,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<g?(b.flags|=67108866,g):w):(b.flags|=67108866,g)):(b.flags|=1048576,g)}function i(b){return e&&b.alternate===null&&(b.flags|=67108866),b}function u(b,g,w,L){return g===null||g.tag!==6?(g=Ps(w,b.mode,L),g.return=b,g):(g=o(g,w),g.return=b,g)}function h(b,g,w,L){var we=w.type;return we===U?j(b,g,w.props.children,L,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===be&&ea(we)===g.type)?(g=o(g,w.props),pi(g,w),g.return=b,g):(g=nl(w.type,w.key,w.props,null,b.mode,L),pi(g,w),g.return=b,g)}function k(b,g,w,L){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=Ms(w,b.mode,L),g.return=b,g):(g=o(g,w.children||[]),g.return=b,g)}function j(b,g,w,L,we){return g===null||g.tag!==7?(g=Go(w,b.mode,L,we),g.return=b,g):(g=o(g,w),g.return=b,g)}function O(b,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Ps(""+g,b.mode,w),g.return=b,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case D:return w=nl(g.type,g.key,g.props,null,b.mode,w),pi(w,g),w.return=b,w;case R:return g=Ms(g,b.mode,w),g.return=b,g;case be:return g=ea(g),O(b,g,w)}if(Fe(g)||ne(g))return g=Go(g,b.mode,w,null),g.return=b,g;if(typeof g.then=="function")return O(b,ul(g),w);if(g.$$typeof===re)return O(b,al(b,g),w);cl(b,g)}return null}function _(b,g,w,L){var we=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return we!==null?null:u(b,g,""+w,L);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case D:return w.key===we?h(b,g,w,L):null;case R:return w.key===we?k(b,g,w,L):null;case be:return w=ea(w),_(b,g,w,L)}if(Fe(w)||ne(w))return we!==null?null:j(b,g,w,L,null);if(typeof w.then=="function")return _(b,g,ul(w),L);if(w.$$typeof===re)return _(b,g,al(b,w),L);cl(b,w)}return null}function I(b,g,w,L,we){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return b=b.get(w)||null,u(g,b,""+L,we);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case D:return b=b.get(L.key===null?w:L.key)||null,h(g,b,L,we);case R:return b=b.get(L.key===null?w:L.key)||null,k(g,b,L,we);case be:return L=ea(L),I(b,g,w,L,we)}if(Fe(L)||ne(L))return b=b.get(w)||null,j(g,b,L,we,null);if(typeof L.then=="function")return I(b,g,w,ul(L),we);if(L.$$typeof===re)return I(b,g,w,al(g,L),we);cl(g,L)}return null}function ce(b,g,w,L){for(var we=null,nt=null,he=g,Ne=g=0,Je=null;he!==null&&Ne<w.length;Ne++){he.index>Ne?(Je=he,he=null):Je=he.sibling;var rt=_(b,he,w[Ne],L);if(rt===null){he===null&&(he=Je);break}e&&he&&rt.alternate===null&&t(b,he),g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt,he=Je}if(Ne===w.length)return n(b,he),Ye&&$r(b,Ne),we;if(he===null){for(;Ne<w.length;Ne++)he=O(b,w[Ne],L),he!==null&&(g=a(he,g,Ne),nt===null?we=he:nt.sibling=he,nt=he);return Ye&&$r(b,Ne),we}for(he=r(he);Ne<w.length;Ne++)Je=I(he,b,Ne,w[Ne],L),Je!==null&&(e&&Je.alternate!==null&&he.delete(Je.key===null?Ne:Je.key),g=a(Je,g,Ne),nt===null?we=Je:nt.sibling=Je,nt=Je);return e&&he.forEach(function(Do){return t(b,Do)}),Ye&&$r(b,Ne),we}function Ee(b,g,w,L){if(w==null)throw Error(c(151));for(var we=null,nt=null,he=g,Ne=g=0,Je=null,rt=w.next();he!==null&&!rt.done;Ne++,rt=w.next()){he.index>Ne?(Je=he,he=null):Je=he.sibling;var Do=_(b,he,rt.value,L);if(Do===null){he===null&&(he=Je);break}e&&he&&Do.alternate===null&&t(b,he),g=a(Do,g,Ne),nt===null?we=Do:nt.sibling=Do,nt=Do,he=Je}if(rt.done)return n(b,he),Ye&&$r(b,Ne),we;if(he===null){for(;!rt.done;Ne++,rt=w.next())rt=O(b,rt.value,L),rt!==null&&(g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt);return Ye&&$r(b,Ne),we}for(he=r(he);!rt.done;Ne++,rt=w.next())rt=I(he,b,Ne,rt.value,L),rt!==null&&(e&&rt.alternate!==null&&he.delete(rt.key===null?Ne:rt.key),g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&he.forEach(function(y0){return t(b,y0)}),Ye&&$r(b,Ne),we}function ft(b,g,w,L){if(typeof w=="object"&&w!==null&&w.type===U&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case D:e:{for(var we=w.key;g!==null;){if(g.key===we){if(we=w.type,we===U){if(g.tag===7){n(b,g.sibling),L=o(g,w.props.children),L.return=b,b=L;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===be&&ea(we)===g.type){n(b,g.sibling),L=o(g,w.props),pi(L,w),L.return=b,b=L;break e}n(b,g);break}else t(b,g);g=g.sibling}w.type===U?(L=Go(w.props.children,b.mode,L,w.key),L.return=b,b=L):(L=nl(w.type,w.key,w.props,null,b.mode,L),pi(L,w),L.return=b,b=L)}return i(b);case R:e:{for(we=w.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(b,g.sibling),L=o(g,w.children||[]),L.return=b,b=L;break e}else{n(b,g);break}else t(b,g);g=g.sibling}L=Ms(w,b.mode,L),L.return=b,b=L}return i(b);case be:return w=ea(w),ft(b,g,w,L)}if(Fe(w))return ce(b,g,w,L);if(ne(w)){if(we=ne(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Ee(b,g,w,L)}if(typeof w.then=="function")return ft(b,g,ul(w),L);if(w.$$typeof===re)return ft(b,g,al(b,w),L);cl(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,g!==null&&g.tag===6?(n(b,g.sibling),L=o(g,w),L.return=b,b=L):(n(b,g),L=Ps(w,b.mode,L),L.return=b,b=L),i(b)):n(b,g)}return function(b,g,w,L){try{mi=0;var we=ft(b,g,w,L);return Pa=null,we}catch(he){if(he===za||he===ll)throw he;var nt=Dn(29,he,null,b.mode);return nt.lanes=L,nt.return=b,nt}finally{}}}var na=Nd(!0),Dd=Nd(!1),vo=!1;function Bs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(at&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=tl(e),vd(e,null,n),t}return el(e,r,t,n),tl(e)}function hi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wo(e,n)}}function Vs(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?o=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Us=!1;function gi(){if(Us){var e=Ia;if(e!==null)throw e}}function yi(e,t,n,r){Us=!1;var o=e.updateQueue;vo=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var h=u,k=h.next;h.next=null,i===null?a=k:i.next=k,i=h;var j=e.alternate;j!==null&&(j=j.updateQueue,u=j.lastBaseUpdate,u!==i&&(u===null?j.firstBaseUpdate=k:u.next=k,j.lastBaseUpdate=h))}if(a!==null){var O=o.baseState;i=0,j=k=h=null,u=a;do{var _=u.lane&-536870913,I=_!==u.lane;if(I?(Ze&_)===_:(r&_)===_){_!==0&&_===Ca&&(Us=!0),j!==null&&(j=j.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var ce=e,Ee=u;_=t;var ft=n;switch(Ee.tag){case 1:if(ce=Ee.payload,typeof ce=="function"){O=ce.call(ft,O,_);break e}O=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=Ee.payload,_=typeof ce=="function"?ce.call(ft,O,_):ce,_==null)break e;O=C({},O,_);break e;case 2:vo=!0}}_=u.callback,_!==null&&(e.flags|=64,I&&(e.flags|=8192),I=o.callbacks,I===null?o.callbacks=[_]:I.push(_))}else I={lane:_,tag:u.tag,payload:u.payload,callback:u.callback,next:null},j===null?(k=j=I,h=O):j=j.next=I,i|=_;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;I=u,u=I.next,I.next=null,o.lastBaseUpdate=I,o.shared.pending=null}}while(!0);j===null&&(h=O),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=j,a===null&&(o.shared.lanes=0),Co|=i,e.lanes=i,e.memoizedState=O}}function Ld(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Fd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ld(n[e],t)}var Ma=p(null),dl=p(0);function Od(e,t){e=Zr,H(dl,e),H(Ma,t),Zr=e|t.baseLanes}function Ks(){H(dl,Zr),H(Ma,Ma.current)}function Hs(){Zr=dl.current,M(Ma),M(dl)}var Ln=p(null),ir=null;function ko(e){var t=e.alternate;H(At,At.current&1),H(Ln,e),ir===null&&(t===null||Ma.current!==null||t.memoizedState!==null)&&(ir=e)}function Qs(e){H(At,At.current),H(Ln,e),ir===null&&(ir=e)}function $d(e){e.tag===22?(H(At,At.current),H(Ln,e),ir===null&&(ir=e)):So()}function So(){H(At,At.current),H(Ln,Ln.current)}function Fn(e){M(Ln),ir===e&&(ir=null),M(At)}var At=p(0);function fl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ec(n)||tc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qr=0,Ae=null,ct=null,$t=null,ml=!1,Ta=!1,ra=!1,pl=0,bi=0,Ra=null,lg=0;function Pt(){throw Error(c(321))}function Gs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nn(e[n],t[n]))return!1;return!0}function Xs(e,t,n,r,o,a){return qr=a,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?_f:du,ra=!1,a=n(r,o),ra=!1,Ta&&(a=Bd(t,n,r,o)),Wd(e),a}function Wd(e){E.H=wi;var t=ct!==null&&ct.next!==null;if(qr=0,$t=ct=Ae=null,ml=!1,bi=0,Ra=null,t)throw Error(c(300));e===null||Wt||(e=e.dependencies,e!==null&&ol(e)&&(Wt=!0))}function Bd(e,t,n,r){Ae=e;var o=0;do{if(Ta&&(Ra=null),bi=0,Ta=!1,25<=o)throw Error(c(301));if(o+=1,$t=ct=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}E.H=Ef,a=t(n,r)}while(Ta);return a}function sg(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?vi(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Zs(){var e=pl!==0;return pl=0,e}function Js(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ys(e){if(ml){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ml=!1}qr=0,$t=ct=Ae=null,Ta=!1,bi=pl=0,Ra=null}function wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ae.memoizedState=$t=e:$t=$t.next=e,$t}function Nt(){if(ct===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=$t===null?Ae.memoizedState:$t.next;if(t!==null)$t=t,ct=e;else{if(e===null)throw Ae.alternate===null?Error(c(467)):Error(c(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},$t===null?Ae.memoizedState=$t=e:$t=$t.next=e}return $t}function hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vi(e){var t=bi;return bi+=1,Ra===null&&(Ra=[]),e=Rd(Ra,e,t),t=Ae,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?_f:du),e}function gl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vi(e);if(e.$$typeof===re)return ln(e)}throw Error(c(438,String(e)))}function eu(e){var t=null,n=Ae.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ae.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=hl(),Ae.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ve;return t.index++,n}function Vr(e,t){return typeof t=="function"?t(e):t}function yl(e){var t=Nt();return tu(t,ct,e)}function tu(e,t,n){var r=e.queue;if(r===null)throw Error(c(311));r.lastRenderedReducer=n;var o=e.baseQueue,a=r.pending;if(a!==null){if(o!==null){var i=o.next;o.next=a.next,a.next=i}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,o===null)e.memoizedState=a;else{t=o.next;var u=i=null,h=null,k=t,j=!1;do{var O=k.lane&-536870913;if(O!==k.lane?(Ze&O)===O:(qr&O)===O){var _=k.revertLane;if(_===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),O===Ca&&(j=!0);else if((qr&_)===_){k=k.next,_===Ca&&(j=!0);continue}else O={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=O,i=a):h=h.next=O,Ae.lanes|=_,Co|=_;O=k.action,ra&&n(a,O),a=k.hasEagerState?k.eagerState:n(a,O)}else _={lane:O,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=_,i=a):h=h.next=_,Ae.lanes|=O,Co|=O;k=k.next}while(k!==null&&k!==t);if(h===null?i=a:h.next=u,!Nn(a,e.memoizedState)&&(Wt=!0,j&&(n=Ia,n!==null)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=h,r.lastRenderedState=a}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function nu(e){var t=Nt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);Nn(a,t.memoizedState)||(Wt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function qd(e,t,n){var r=Ae,o=Nt(),a=Ye;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var i=!Nn((ct||o).memoizedState,n);if(i&&(o.memoizedState=n,Wt=!0),o=o.queue,au(Kd.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,ja(9,{destroy:void 0},Ud.bind(null,r,o,n,t),null),gt===null)throw Error(c(349));a||(qr&127)!==0||Vd(r,t,n)}return n}function Vd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ae.updateQueue,t===null?(t=hl(),Ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ud(e,t,n,r){t.value=n,t.getSnapshot=r,Hd(t)&&Qd(e)}function Kd(e,t,n){return n(function(){Hd(t)&&Qd(e)})}function Hd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nn(e,n)}catch{return!0}}function Qd(e){var t=Qo(e,2);t!==null&&Mn(t,e,2)}function ru(e){var t=wn();if(typeof e=="function"){var n=e;if(e=n(),ra){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:e},t}function Gd(e,t,n,r){return e.baseState=n,tu(e,ct,typeof r=="function"?r:Vr)}function ug(e,t,n,r,o){if(xl(e))throw Error(c(485));if(e=t.action,e!==null){var a={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){a.listeners.push(i)}};E.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,Xd(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Xd(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=E.T,i={};E.T=i;try{var u=n(o,r),h=E.S;h!==null&&h(i,u),Zd(e,t,u)}catch(k){ou(e,t,k)}finally{a!==null&&i.types!==null&&(a.types=i.types),E.T=a}}else try{a=n(o,r),Zd(e,t,a)}catch(k){ou(e,t,k)}}function Zd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Jd(e,t,r)},function(r){return ou(e,t,r)}):Jd(e,t,n)}function Jd(e,t,n){t.status="fulfilled",t.value=n,Yd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xd(e,n)))}function ou(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Yd(t),t=t.next;while(t!==r)}e.action=null}function Yd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ef(e,t){return t}function tf(e,t){if(Ye){var n=gt.formState;if(n!==null){e:{var r=Ae;if(Ye){if(wt){t:{for(var o=wt,a=Hn;o.nodeType!==8;){if(!a){o=null;break t}if(o=Qn(o.nextSibling),o===null){o=null;break t}}a=o.data,o=a==="F!"||a==="F"?o:null}if(o){wt=Qn(o.nextSibling),r=o.data==="F!";break e}}yo(r)}r=!1}r&&(t=n[0])}}return n=wn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ef,lastRenderedState:t},n.queue=r,n=wf.bind(null,Ae,r),r.dispatch=n,r=ru(!1),a=cu.bind(null,Ae,!1,r.queue),r=wn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=ug.bind(null,Ae,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function nf(e){var t=Nt();return rf(t,ct,e)}function rf(e,t,n){if(t=tu(e,t,ef)[0],e=yl(Vr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=vi(t)}catch(i){throw i===za?ll:i}else r=t;t=Nt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Ae.flags|=2048,ja(9,{destroy:void 0},cg.bind(null,o,n),null)),[r,a,e]}function cg(e,t){e.action=t}function of(e){var t=Nt(),n=ct;if(n!==null)return rf(t,n,e);Nt(),t=t.memoizedState,n=Nt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ja(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=hl(),Ae.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function af(){return Nt().memoizedState}function bl(e,t,n,r){var o=wn();Ae.flags|=e,o.memoizedState=ja(1|t,{destroy:void 0},n,r===void 0?null:r)}function vl(e,t,n,r){var o=Nt();r=r===void 0?null:r;var a=o.memoizedState.inst;ct!==null&&r!==null&&Gs(r,ct.memoizedState.deps)?o.memoizedState=ja(t,a,n,r):(Ae.flags|=e,o.memoizedState=ja(1|t,a,n,r))}function lf(e,t){bl(8390656,8,e,t)}function au(e,t){vl(2048,8,e,t)}function dg(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=hl(),Ae.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function sf(e){var t=Nt().memoizedState;return dg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function uf(e,t){return vl(4,2,e,t)}function cf(e,t){return vl(4,4,e,t)}function df(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ff(e,t,n){n=n!=null?n.concat([e]):null,vl(4,4,df.bind(null,t,e),n)}function iu(){}function mf(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Gs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pf(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Gs(t,r[1]))return r[0];if(r=e(),ra){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function lu(e,t,n){return n===void 0||(qr&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=hm(),Ae.lanes|=e,Co|=e,n)}function hf(e,t,n,r){return Nn(n,t)?n:Ma.current!==null?(e=lu(e,n,r),Nn(e,t)||(Wt=!0),e):(qr&42)===0||(qr&1073741824)!==0&&(Ze&261930)===0?(Wt=!0,e.memoizedState=n):(e=hm(),Ae.lanes|=e,Co|=e,t)}function gf(e,t,n,r,o){var a=$.p;$.p=a!==0&&8>a?a:8;var i=E.T,u={};E.T=u,cu(e,!1,t,n);try{var h=o(),k=E.S;if(k!==null&&k(u,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var j=ig(h,r);xi(e,t,j,Wn(e))}else xi(e,t,r,Wn(e))}catch(O){xi(e,t,{then:function(){},status:"rejected",reason:O},Wn())}finally{$.p=a,i!==null&&u.types!==null&&(i.types=u.types),E.T=i}}function fg(){}function su(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=yf(e).queue;gf(e,o,t,oe,n===null?fg:function(){return bf(e),n(r)})}function yf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bf(e){var t=yf(e);t.next===null&&(t=e.alternate.memoizedState),xi(e,t.next.queue,{},Wn())}function uu(){return ln(Li)}function vf(){return Nt().memoizedState}function xf(){return Nt().memoizedState}function mg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Wn();e=xo(n);var r=wo(t,e,n);r!==null&&(Mn(r,t,n),hi(r,t,n)),t={cache:Fs()},e.payload=t;return}t=t.return}}function pg(e,t,n){var r=Wn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},xl(e)?kf(t,n):(n=Is(e,t,n,r),n!==null&&(Mn(n,e,r),Sf(n,t,r)))}function wf(e,t,n){var r=Wn();xi(e,t,n,r)}function xi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(xl(e))kf(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,u=a(i,n);if(o.hasEagerState=!0,o.eagerState=u,Nn(u,i))return el(e,t,o,0),gt===null&&Yi(),!1}catch{}finally{}if(n=Is(e,t,o,r),n!==null)return Mn(n,e,r),Sf(n,t,r),!0}return!1}function cu(e,t,n,r){if(r={lane:2,revertLane:Bu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},xl(e)){if(t)throw Error(c(479))}else t=Is(e,n,r,2),t!==null&&Mn(t,e,2)}function xl(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function kf(e,t){Ta=ml=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sf(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wo(e,n)}}var wi={readContext:ln,use:gl,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};wi.useEffectEvent=Pt;var _f={readContext:ln,use:gl,useCallback:function(e,t){return wn().memoizedState=[e,t===void 0?null:t],e},useContext:ln,useEffect:lf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,bl(4194308,4,df.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){bl(4,2,e,t)},useMemo:function(e,t){var n=wn();t=t===void 0?null:t;var r=e();if(ra){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wn();if(n!==void 0){var o=n(t);if(ra){Ue(!0);try{n(t)}finally{Ue(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=pg.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var t=wn();return e={current:e},t.memoizedState=e},useState:function(e){e=ru(e);var t=e.queue,n=wf.bind(null,Ae,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:iu,useDeferredValue:function(e,t){var n=wn();return lu(n,e,t)},useTransition:function(){var e=ru(!1);return e=gf.bind(null,Ae,e.queue,!0,!1),wn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ae,o=wn();if(Ye){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),gt===null)throw Error(c(349));(Ze&127)!==0||Vd(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,lf(Kd.bind(null,r,a,e),[e]),r.flags|=2048,ja(9,{destroy:void 0},Ud.bind(null,r,a,n,t),null),n},useId:function(){var e=wn(),t=gt.identifierPrefix;if(Ye){var n=Sr,r=kr;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=pl++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=lg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uu,useFormState:tf,useActionState:tf,useOptimistic:function(e){var t=wn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cu.bind(null,Ae,!0,n),n.dispatch=t,[e,t]},useMemoCache:eu,useCacheRefresh:function(){return wn().memoizedState=mg.bind(null,Ae)},useEffectEvent:function(e){var t=wn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},du={readContext:ln,use:gl,useCallback:mf,useContext:ln,useEffect:au,useImperativeHandle:ff,useInsertionEffect:uf,useLayoutEffect:cf,useMemo:pf,useReducer:yl,useRef:af,useState:function(){return yl(Vr)},useDebugValue:iu,useDeferredValue:function(e,t){var n=Nt();return hf(n,ct.memoizedState,e,t)},useTransition:function(){var e=yl(Vr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:qd,useId:vf,useHostTransitionStatus:uu,useFormState:nf,useActionState:nf,useOptimistic:function(e,t){var n=Nt();return Gd(n,ct,e,t)},useMemoCache:eu,useCacheRefresh:xf};du.useEffectEvent=sf;var Ef={readContext:ln,use:gl,useCallback:mf,useContext:ln,useEffect:au,useImperativeHandle:ff,useInsertionEffect:uf,useLayoutEffect:cf,useMemo:pf,useReducer:nu,useRef:af,useState:function(){return nu(Vr)},useDebugValue:iu,useDeferredValue:function(e,t){var n=Nt();return ct===null?lu(n,e,t):hf(n,ct.memoizedState,e,t)},useTransition:function(){var e=nu(Vr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:qd,useId:vf,useHostTransitionStatus:uu,useFormState:of,useActionState:of,useOptimistic:function(e,t){var n=Nt();return ct!==null?Gd(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:eu,useCacheRefresh:xf};Ef.useEffectEvent=sf;function fu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=xo(r);o.payload=t,n!=null&&(o.callback=n),t=wo(e,o,r),t!==null&&(Mn(t,e,r),hi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=xo(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=wo(e,o,r),t!==null&&(Mn(t,e,r),hi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wn(),r=xo(n);r.tag=2,t!=null&&(r.callback=t),t=wo(e,r,n),t!==null&&(Mn(t,e,n),hi(t,e,n))}};function Cf(e,t,n,r,o,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!li(n,r)||!li(o,a):!0}function If(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mu.enqueueReplaceState(t,t.state,null)}function oa(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=C({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function zf(e){Ji(e)}function Pf(e){console.error(e)}function Mf(e){Ji(e)}function wl(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Tf(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function pu(e,t,n){return n=xo(n),n.tag=3,n.payload={element:null},n.callback=function(){wl(e,t)},n}function Rf(e){return e=xo(e),e.tag=3,e}function jf(e,t,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var a=r.value;e.payload=function(){return o(a)},e.callback=function(){Tf(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Tf(t,n,r),typeof o!="function"&&(Io===null?Io=new Set([this]):Io.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function hg(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Ea(t,n,o,!0),n=Ln.current,n!==null){switch(n.tag){case 31:case 13:return ir===null?jl():n.alternate===null&&Mt===0&&(Mt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===sl?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ou(e,r,o)),!1;case 22:return n.flags|=65536,r===sl?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ou(e,r,o)),!1}throw Error(c(435,n.tag))}return Ou(e,r,o),jl(),!1}if(Ye)return t=Ln.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==js&&(e=Error(c(422),{cause:r}),ci(Vn(e,n)))):(r!==js&&(t=Error(c(423),{cause:r}),ci(Vn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Vn(r,n),o=pu(e.stateNode,r,o),Vs(e,o),Mt!==4&&(Mt=2)),!1;var a=Error(c(520),{cause:r});if(a=Vn(a,n),Pi===null?Pi=[a]:Pi.push(a),Mt!==4&&(Mt=2),t===null)return!0;r=Vn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=pu(n.stateNode,r,e),Vs(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Io===null||!Io.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Rf(o),jf(o,e,n,r),Vs(n,o),!1}n=n.return}while(n!==null);return!1}var hu=Error(c(461)),Wt=!1;function sn(e,t,n,r){t.child=e===null?Dd(t,null,n,r):na(t,e.child,n,r)}function Af(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}else i=r;return Jo(t),r=Xs(e,t,n,i,a,o),u=Zs(),e!==null&&!Wt?(Js(e,t,o),Ur(e,t,o)):(Ye&&u&&Ts(t),t.flags|=1,sn(e,t,r,o),t.child)}function Nf(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!zs(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Df(e,t,a,r,o)):(e=nl(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Su(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:li,n(i,r)&&e.ref===t.ref)return Ur(e,t,o)}return t.flags|=1,e=Or(a,r),e.ref=t.ref,e.return=t,t.child=e}function Df(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(li(a,r)&&e.ref===t.ref)if(Wt=!1,t.pendingProps=r=a,Su(e,o))(e.flags&131072)!==0&&(Wt=!0);else return t.lanes=e.lanes,Ur(e,t,o)}return gu(e,t,n,r,o)}function Lf(e,t,n,r){var o=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~a}else r=0,t.child=null;return Ff(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&il(t,a!==null?a.cachePool:null),a!==null?Od(t,a):Ks(),$d(t);else return r=t.lanes=536870912,Ff(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(il(t,a.cachePool),Od(t,a),So(),t.memoizedState=null):(e!==null&&il(t,null),Ks(),So());return sn(e,t,o,n),t.child}function ki(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ff(e,t,n,r,o){var a=$s();return a=a===null?null:{parent:Ot._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&il(t,null),Ks(),$d(t),e!==null&&Ea(e,t,r,!0),t.childLanes=o,null}function kl(e,t){return t=_l({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Of(e,t,n){return na(t,e.child,null,n),e=kl(t,t.pendingProps),e.flags|=2,Fn(t),t.memoizedState=null,e}function gg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(r.mode==="hidden")return e=kl(t,r),t.lanes=536870912,ki(null,e);if(Qs(t),(e=wt)?(e=Zm(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ho!==null?{id:kr,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},n=wd(e),n.return=t,t.child=n,an=t,wt=null)):e=null,e===null)throw yo(t);return t.lanes=536870912,null}return kl(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Qs(t),o)if(t.flags&256)t.flags&=-257,t=Of(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Wt||Ea(e,t,n,!1),o=(n&e.childLanes)!==0,Wt||o){if(r=gt,r!==null&&(i=zr(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Qo(e,i),Mn(r,e,i),hu;jl(),t=Of(e,t,n)}else e=a.treeContext,wt=Qn(i.nextSibling),an=t,Ye=!0,go=null,Hn=!1,e!==null&&_d(t,e),t=kl(t,r),t.flags|=4096;return t}return e=Or(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gu(e,t,n,r,o){return Jo(t),n=Xs(e,t,n,r,void 0,o),r=Zs(),e!==null&&!Wt?(Js(e,t,o),Ur(e,t,o)):(Ye&&r&&Ts(t),t.flags|=1,sn(e,t,n,o),t.child)}function $f(e,t,n,r,o,a){return Jo(t),t.updateQueue=null,n=Bd(t,r,n,o),Wd(e),r=Zs(),e!==null&&!Wt?(Js(e,t,a),Ur(e,t,a)):(Ye&&r&&Ts(t),t.flags|=1,sn(e,t,n,a),t.child)}function Wf(e,t,n,r,o){if(Jo(t),t.stateNode===null){var a=wa,i=n.contextType;typeof i=="object"&&i!==null&&(a=ln(i)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=mu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Bs(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?ln(i):wa,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(fu(t,n,i,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(i=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),i!==a.state&&mu.enqueueReplaceState(a,a.state,null),yi(t,r,a,o),gi(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,h=oa(n,u);a.props=h;var k=a.context,j=n.contextType;i=wa,typeof j=="object"&&j!==null&&(i=ln(j));var O=n.getDerivedStateFromProps;j=typeof O=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,j||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==i)&&If(t,a,r,i),vo=!1;var _=t.memoizedState;a.state=_,yi(t,r,a,o),gi(),k=t.memoizedState,u||_!==k||vo?(typeof O=="function"&&(fu(t,n,O,r),k=t.memoizedState),(h=vo||Cf(t,n,h,r,_,k,i))?(j||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"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=k),a.props=r,a.state=k,a.context=i,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,qs(e,t),i=t.memoizedProps,j=oa(n,i),a.props=j,O=t.pendingProps,_=a.context,k=n.contextType,h=wa,typeof k=="object"&&k!==null&&(h=ln(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==O||_!==h)&&If(t,a,r,h),vo=!1,_=t.memoizedState,a.state=_,yi(t,r,a,o),gi();var I=t.memoizedState;i!==O||_!==I||vo||e!==null&&e.dependencies!==null&&ol(e.dependencies)?(typeof u=="function"&&(fu(t,n,u,r),I=t.memoizedState),(j=vo||Cf(t,n,j,r,_,I,h)||e!==null&&e.dependencies!==null&&ol(e.dependencies))?(k||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,I,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,I,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=I),a.props=r,a.state=I,a.context=h,r=j):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Sl(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=na(t,e.child,null,o),t.child=na(t,null,n,o)):sn(e,t,n,o),t.memoizedState=a.state,e=t.child):e=Ur(e,t,o),e}function Bf(e,t,n,r){return Xo(),t.flags|=256,sn(e,t,n,r),t.child}var yu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bu(e){return{baseLanes:e,cachePool:Md()}}function vu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function qf(e,t,n){var r=t.pendingProps,o=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(o?ko(t):So(),(e=wt)?(e=Zm(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ho!==null?{id:kr,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},n=wd(e),n.return=t,t.child=n,an=t,wt=null)):e=null,e===null)throw yo(t);return tc(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(So(),o=t.mode,u=_l({mode:"hidden",children:u},o),r=Go(r,o,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,r=t.child,r.memoizedState=bu(n),r.childLanes=vu(e,i,n),t.memoizedState=yu,ki(null,r)):(ko(t),xu(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(ko(t),t.flags&=-257,t=wu(e,t,n)):t.memoizedState!==null?(So(),t.child=e.child,t.flags|=128,t=null):(So(),u=r.fallback,o=t.mode,r=_l({mode:"visible",children:r.children},o),u=Go(u,o,n,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,na(t,e.child,null,n),r=t.child,r.memoizedState=bu(n),r.childLanes=vu(e,i,n),t.memoizedState=yu,t=ki(null,r));else if(ko(t),tc(u)){if(i=u.nextSibling&&u.nextSibling.dataset,i)var k=i.dgst;i=k,r=Error(c(419)),r.stack="",r.digest=i,ci({value:r,source:null,stack:null}),t=wu(e,t,n)}else if(Wt||Ea(e,t,n,!1),i=(n&e.childLanes)!==0,Wt||i){if(i=gt,i!==null&&(r=zr(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Qo(e,r),Mn(i,e,r),hu;ec(u)||jl(),t=wu(e,t,n)}else ec(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,wt=Qn(u.nextSibling),an=t,Ye=!0,go=null,Hn=!1,e!==null&&_d(t,e),t=xu(t,r.children),t.flags|=4096);return t}return o?(So(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=Or(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=Or(k,u):(u=Go(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,ki(null,r),r=t.child,u=e.child.memoizedState,u===null?u=bu(n):(o=u.cachePool,o!==null?(h=Ot._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Md(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=vu(e,i,n),t.memoizedState=yu,ki(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=Or(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function xu(e,t){return t=_l({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _l(e,t){return e=Dn(22,e,null,t),e.lanes=0,e}function wu(e,t,n){return na(t,e.child,null,n),e=xu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ds(e.return,t,n)}function ku(e,t,n,r,o,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.treeForkCount=a)}function Uf(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=At.current,u=(i&2)!==0;if(u?(i=i&1|2,t.flags|=128):i&=1,H(At,i),sn(e,t,r,n),r=Ye?ui:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vf(e,n,t);else if(e.tag===19)Vf(e,n,t);else if(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;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&fl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ku(t,!1,o,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&fl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ku(t,!0,n,null,a,r);break;case"together":ku(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ur(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Co|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Or(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Or(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Su(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ol(e)))}function yg(e,t,n){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),bo(t,Ot,e.memoizedState.cache),Xo();break;case 27:case 5:Be(t);break;case 4:Re(t,t.stateNode.containerInfo);break;case 10:bo(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qs(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(ko(t),t.flags|=128,null):(n&t.child.childLanes)!==0?qf(e,t,n):(ko(t),e=Ur(e,t,n),e!==null?e.sibling:null);ko(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Ea(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return Uf(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),H(At,At.current),r)break;return null;case 22:return t.lanes=0,Lf(e,t,n,t.pendingProps);case 24:bo(t,Ot,e.memoizedState.cache)}return Ur(e,t,n)}function Kf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Wt=!0;else{if(!Su(e,n)&&(t.flags&128)===0)return Wt=!1,yg(e,t,n);Wt=(e.flags&131072)!==0}else Wt=!1,Ye&&(t.flags&1048576)!==0&&Sd(t,ui,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ea(t.elementType),t.type=e,typeof e=="function")zs(e)?(r=oa(e,r),t.tag=1,t=Wf(null,t,e,r,n)):(t.tag=0,t=gu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ye){t.tag=11,t=Af(null,t,e,r,n);break e}else if(o===B){t.tag=14,t=Nf(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(c(306,t,""))}}return t;case 0:return gu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=oa(r,t.pendingProps),Wf(e,t,r,o,n);case 3:e:{if(Re(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,qs(e,t),yi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,bo(t,Ot,r),r!==a.cache&&Ls(t,[Ot],n,!0),gi(),r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Bf(e,t,r,n);break e}else if(r!==o){o=Vn(Error(c(424)),t),ci(o),t=Bf(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(wt=Qn(e.firstChild),an=t,Ye=!0,go=null,Hn=!0,n=Dd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Xo(),r===o){t=Ur(e,t,n);break e}sn(e,t,r,n)}t=t.child}return t;case 26:return Sl(e,t),e===null?(n=rp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ye||(n=t.type,e=t.pendingProps,r=$l(_e.current).createElement(n),r[Et]=t,r[qt]=e,un(r,n,e),Lt(r),t.stateNode=r):t.memoizedState=rp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&Ye&&(r=t.stateNode=ep(t.type,t.pendingProps,_e.current),an=t,Hn=!0,o=wt,To(t.type)?(nc=o,wt=Qn(r.firstChild)):wt=o),sn(e,t,t.pendingProps.children,n),Sl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((o=r=wt)&&(r=Hg(r,t.type,t.pendingProps,Hn),r!==null?(t.stateNode=r,an=t,wt=Qn(r.firstChild),Hn=!1,o=!0):o=!1),o||yo(t)),Be(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Zu(o,a)?r=null:i!==null&&Zu(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Xs(e,t,sg,null,null,n),Li._currentValue=o),Sl(e,t),sn(e,t,r,n),t.child;case 6:return e===null&&Ye&&((e=n=wt)&&(n=Qg(n,t.pendingProps,Hn),n!==null?(t.stateNode=n,an=t,wt=null,e=!0):e=!1),e||yo(t)),null;case 13:return qf(e,t,n);case 4:return Re(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=na(t,null,r,n):sn(e,t,r,n),t.child;case 11:return Af(e,t,t.type,t.pendingProps,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,bo(t,t.type,r.value),sn(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Jo(t),o=ln(o),r=r(o),t.flags|=1,sn(e,t,r,n),t.child;case 14:return Nf(e,t,t.type,t.pendingProps,n);case 15:return Df(e,t,t.type,t.pendingProps,n);case 19:return Uf(e,t,n);case 31:return gg(e,t,n);case 22:return Lf(e,t,n,t.pendingProps);case 24:return Jo(t),r=ln(Ot),e===null?(o=$s(),o===null&&(o=gt,a=Fs(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Bs(t),bo(t,Ot,o)):((e.lanes&n)!==0&&(qs(e,t),yi(t,null,null,n),gi()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),bo(t,Ot,r)):(r=a.cache,bo(t,Ot,r),r!==o.cache&&Ls(t,[Ot],n,!0))),sn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Kr(e){e.flags|=4}function _u(e,t,n,r,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(vm())e.flags|=8192;else throw ta=sl,Ws}else e.flags&=-16777217}function Hf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!sp(t))if(vm())e.flags|=8192;else throw ta=sl,Ws}function El(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?tt():536870912,e.lanes|=t,La|=t)}function Si(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function kt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bg(e,t,n){var r=t.pendingProps;switch(Rs(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(t),null;case 1:return kt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Br(Ot),et(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_a(t)?Kr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,As())),kt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Kr(t),a!==null?(kt(t),Hf(t,a)):(kt(t),_u(t,o,null,r,n))):a?a!==e.memoizedState?(Kr(t),kt(t),Hf(t,a)):(kt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Kr(t),kt(t),_u(t,o,e,r,n)),null;case 27:if(Oe(t),n=_e.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Kr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return kt(t),null}e=Y.current,_a(t)?Ed(t):(e=ep(o,r,n),t.stateNode=e,Kr(t))}return kt(t),null;case 5:if(Oe(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Kr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return kt(t),null}if(a=Y.current,_a(t))Ed(t);else{var i=$l(_e.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":a=i.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?i.createElement(o,{is:r.is}):i.createElement(o)}}a[Et]=t,a[qt]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)a.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=a;e:switch(un(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Kr(t)}}return kt(t),_u(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Kr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=_e.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=an,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||qm(e.nodeValue,n)),e||yo(t,!0)}else e=$l(e).createTextNode(r),e[Et]=t,t.stateNode=e}return kt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=_a(t),n!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Et]=t}else Xo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;kt(t),e=!1}else n=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fn(t),t):(Fn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return kt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=_a(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Et]=t}else Xo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;kt(t),o=!1}else o=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Fn(t),t):(Fn(t),null)}return Fn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),El(t,t.updateQueue),kt(t),null);case 4:return et(),e===null&&Ku(t.stateNode.containerInfo),kt(t),null;case 10:return Br(t.type),kt(t),null;case 19:if(M(At),r=t.memoizedState,r===null)return kt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)Si(r,!1);else{if(Mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=fl(e),a!==null){for(t.flags|=128,Si(r,!1),e=a.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)xd(n,e),n=n.sibling;return H(At,At.current&1|2),Ye&&$r(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>Ml&&(t.flags|=128,o=!0,Si(r,!1),t.lanes=4194304)}else{if(!o)if(e=fl(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Si(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ye)return kt(t),null}else 2*Ie()-r.renderingStartTime>Ml&&n!==536870912&&(t.flags|=128,o=!0,Si(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=At.current,H(At,o?n&1|2:n&1),Ye&&$r(t,r.treeForkCount),e):(kt(t),null);case 22:case 23:return Fn(t),Hs(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(kt(t),t.subtreeFlags&6&&(t.flags|=8192)):kt(t),n=t.updateQueue,n!==null&&El(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&M(Yo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Br(Ot),kt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function vg(e,t){switch(Rs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(Ot),et(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Fn(t),t.alternate===null)throw Error(c(340));Xo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Xo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(At),null;case 4:return et(),null;case 10:return Br(t.type),null;case 22:case 23:return Fn(t),Hs(),e!==null&&M(Yo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Br(Ot),null;case 25:return null;default:return null}}function Qf(e,t){switch(Rs(t),t.tag){case 3:Br(Ot),et();break;case 26:case 27:case 5:Oe(t);break;case 4:et();break;case 31:t.memoizedState!==null&&Fn(t);break;case 13:Fn(t);break;case 19:M(At);break;case 10:Br(t.type);break;case 22:case 23:Fn(t),Hs(),e!==null&&M(Yo);break;case 24:Br(Ot)}}function _i(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==o)}}catch(u){ut(t,t.return,u)}}function _o(e,t,n){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var a=o.next;r=a;do{if((r.tag&e)===e){var i=r.inst,u=i.destroy;if(u!==void 0){i.destroy=void 0,o=t;var h=n,k=u;try{k()}catch(j){ut(o,h,j)}}}r=r.next}while(r!==a)}}catch(j){ut(t,t.return,j)}}function Gf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Fd(t,n)}catch(r){ut(e,e.return,r)}}}function Xf(e,t,n){n.props=oa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function Ei(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(o){ut(e,t,o)}}function _r(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){ut(e,t,o)}else n.current=null}function Zf(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){ut(e,e.return,o)}}function Eu(e,t,n){try{var r=e.stateNode;Wg(r,e.type,n,t),r[qt]=t}catch(o){ut(e,e.return,o)}}function Jf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&To(e.type)||e.tag===4}function Cu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&To(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Iu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn));else if(r!==4&&(r===27&&To(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Iu(e,t,n),e=e.sibling;e!==null;)Iu(e,t,n),e=e.sibling}function Cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&To(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Cl(e,t,n),e=e.sibling;e!==null;)Cl(e,t,n),e=e.sibling}function Yf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);un(t,r,n),t[Et]=e,t[qt]=n}catch(a){ut(e,e.return,a)}}var Hr=!1,Bt=!1,zu=!1,em=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function xg(e,t){if(e=e.containerInfo,Gu=Hl,e=dd(e),ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,u=-1,h=-1,k=0,j=0,O=e,_=null;t:for(;;){for(var I;O!==n||o!==0&&O.nodeType!==3||(u=i+o),O!==a||r!==0&&O.nodeType!==3||(h=i+r),O.nodeType===3&&(i+=O.nodeValue.length),(I=O.firstChild)!==null;)_=O,O=I;for(;;){if(O===e)break t;if(_===n&&++k===o&&(u=i),_===a&&++j===r&&(h=i),(I=O.nextSibling)!==null)break;O=_,_=O.parentNode}O=I}n=u===-1||h===-1?null:{start:u,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xu={focusedElem:e,selectionRange:n},Hl=!1,Gt=t;Gt!==null;)if(t=Gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Gt=e;else for(;Gt!==null;){switch(t=Gt,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,n=t,o=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var ce=oa(n.type,o);e=r.getSnapshotBeforeUpdate(ce,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){ut(n,n.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Yu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Yu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Gt=e;break}Gt=t.return}}function tm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gr(e,n),r&4&&_i(5,n);break;case 1:if(Gr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){ut(n,n.return,i)}else{var o=oa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ut(n,n.return,i)}}r&64&&Gf(n),r&512&&Ei(n,n.return);break;case 3:if(Gr(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Fd(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&Yf(n);case 26:case 5:Gr(e,n),t===null&&r&4&&Zf(n),r&512&&Ei(n,n.return);break;case 12:Gr(e,n);break;case 31:Gr(e,n),r&4&&om(e,n);break;case 13:Gr(e,n),r&4&&am(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Pg.bind(null,n),Gg(e,n))));break;case 22:if(r=n.memoizedState!==null||Hr,!r){t=t!==null&&t.memoizedState!==null||Bt,o=Hr;var a=Bt;Hr=r,(Bt=t)&&!a?Xr(e,n,(n.subtreeFlags&8772)!==0):Gr(e,n),Hr=o,Bt=a}break;case 30:break;default:Gr(e,n)}}function nm(e){var t=e.alternate;t!==null&&(e.alternate=null,nm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Xa(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,Cn=!1;function Qr(e,t,n){for(n=n.child;n!==null;)rm(e,t,n),n=n.sibling}function rm(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(cr,n)}catch{}switch(n.tag){case 26:Bt||_r(n,t),Qr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Bt||_r(n,t);var r=St,o=Cn;To(n.type)&&(St=n.stateNode,Cn=!1),Qr(e,t,n),Ai(n.stateNode),St=r,Cn=o;break;case 5:Bt||_r(n,t);case 6:if(r=St,o=Cn,St=null,Qr(e,t,n),St=r,Cn=o,St!==null)if(Cn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(n.stateNode)}catch(a){ut(n,t,a)}else try{St.removeChild(n.stateNode)}catch(a){ut(n,t,a)}break;case 18:St!==null&&(Cn?(e=St,Gm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ua(e)):Gm(St,n.stateNode));break;case 4:r=St,o=Cn,St=n.stateNode.containerInfo,Cn=!0,Qr(e,t,n),St=r,Cn=o;break;case 0:case 11:case 14:case 15:_o(2,n,t),Bt||_o(4,n,t),Qr(e,t,n);break;case 1:Bt||(_r(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Xf(n,t,r)),Qr(e,t,n);break;case 21:Qr(e,t,n);break;case 22:Bt=(r=Bt)||n.memoizedState!==null,Qr(e,t,n),Bt=r;break;default:Qr(e,t,n)}}function om(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ua(e)}catch(n){ut(t,t.return,n)}}}function am(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ua(e)}catch(n){ut(t,t.return,n)}}function wg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new em),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new em),t;default:throw Error(c(435,e.tag))}}function Il(e,t){var n=wg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=Mg.bind(null,e,r);r.then(o,o)}})}function In(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],a=e,i=t,u=i;e:for(;u!==null;){switch(u.tag){case 27:if(To(u.type)){St=u.stateNode,Cn=!1;break e}break;case 5:St=u.stateNode,Cn=!1;break e;case 3:case 4:St=u.stateNode.containerInfo,Cn=!0;break e}u=u.return}if(St===null)throw Error(c(160));rm(a,i,o),St=null,Cn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)im(t,e),t=t.sibling}var lr=null;function im(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:In(t,e),zn(e),r&4&&(_o(3,e,e.return),_i(3,e),_o(5,e,e.return));break;case 1:In(t,e),zn(e),r&512&&(Bt||n===null||_r(n,n.return)),r&64&&Hr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=lr;if(In(t,e),zn(e),r&512&&(Bt||n===null||_r(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":a=o.getElementsByTagName("title")[0],(!a||a[Pr]||a[Et]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),un(a,r,n),a[Et]=e,Lt(a),r=a;break e;case"link":var i=ip("link","href",o).get(r+(n.href||""));if(i){for(var u=0;u<i.length;u++)if(a=i[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)){i.splice(u,1);break t}}a=o.createElement(r),un(a,r,n),o.head.appendChild(a);break;case"meta":if(i=ip("meta","content",o).get(r+(n.content||""))){for(u=0;u<i.length;u++)if(a=i[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)){i.splice(u,1);break t}}a=o.createElement(r),un(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[Et]=e,Lt(a),r=a}e.stateNode=r}else lp(o,e.type,e.stateNode);else e.stateNode=ap(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?lp(o,e.type,e.stateNode):ap(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Eu(e,e.memoizedProps,n.memoizedProps)}break;case 27:In(t,e),zn(e),r&512&&(Bt||n===null||_r(n,n.return)),n!==null&&r&4&&Eu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(In(t,e),zn(e),r&512&&(Bt||n===null||_r(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(ce){ut(e,e.return,ce)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Eu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(zu=!0);break;case 6:if(In(t,e),zn(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ce){ut(e,e.return,ce)}}break;case 3:if(ql=null,o=lr,lr=Wl(t.containerInfo),In(t,e),lr=o,zn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ua(t.containerInfo)}catch(ce){ut(e,e.return,ce)}zu&&(zu=!1,lm(e));break;case 4:r=lr,lr=Wl(e.stateNode.containerInfo),In(t,e),zn(e),lr=r;break;case 12:In(t,e),zn(e);break;case 31:In(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Il(e,r)));break;case 13:In(t,e),zn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Pl=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Il(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,k=Hr,j=Bt;if(Hr=k||o,Bt=j||h,In(t,e),Bt=j,Hr=k,zn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Hr||Bt||aa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){h=n=t;try{if(a=h.stateNode,o)i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{u=h.stateNode;var O=h.memoizedProps.style,_=O!=null&&O.hasOwnProperty("display")?O.display:null;u.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ce){ut(h,h.return,ce)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(ce){ut(h,h.return,ce)}}}else if(t.tag===18){if(n===null){h=t;try{var I=h.stateNode;o?Xm(I,!0):Xm(h.stateNode,!1)}catch(ce){ut(h,h.return,ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Il(e,n))));break;case 19:In(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Il(e,r)));break;case 30:break;case 21:break;default:In(t,e),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jf(r)){n=r;break}r=r.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var o=n.stateNode,a=Cu(e);Cl(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var u=Cu(e);Cl(e,u,i);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Cu(e);Iu(e,k,h);break;default:throw Error(c(161))}}catch(j){ut(e,e.return,j)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function lm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;lm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Gr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tm(e,t.alternate,t),t=t.sibling}function aa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_o(4,t,t.return),aa(t);break;case 1:_r(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Xf(t,t.return,n),aa(t);break;case 27:Ai(t.stateNode);case 26:case 5:_r(t,t.return),aa(t);break;case 22:t.memoizedState===null&&aa(t);break;case 30:aa(t);break;default:aa(t)}e=e.sibling}}function Xr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Xr(o,a,n),_i(4,a);break;case 1:if(Xr(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(k){ut(r,r.return,k)}if(r=a,o=r.updateQueue,o!==null){var u=r.stateNode;try{var h=o.shared.hiddenCallbacks;if(h!==null)for(o.shared.hiddenCallbacks=null,o=0;o<h.length;o++)Ld(h[o],u)}catch(k){ut(r,r.return,k)}}n&&i&64&&Gf(a),Ei(a,a.return);break;case 27:Yf(a);case 26:case 5:Xr(o,a,n),n&&r===null&&i&4&&Zf(a),Ei(a,a.return);break;case 12:Xr(o,a,n);break;case 31:Xr(o,a,n),n&&i&4&&om(o,a);break;case 13:Xr(o,a,n),n&&i&4&&am(o,a);break;case 22:a.memoizedState===null&&Xr(o,a,n),Ei(a,a.return);break;case 30:break;default:Xr(o,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&di(n))}function Mu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e))}function sr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sm(e,t,n,r),t=t.sibling}function sm(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:sr(e,t,n,r),o&2048&&_i(9,t);break;case 1:sr(e,t,n,r);break;case 3:sr(e,t,n,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e)));break;case 12:if(o&2048){sr(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,u=a.onPostCommit;typeof u=="function"&&u(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){ut(t,t.return,h)}}else sr(e,t,n,r);break;case 31:sr(e,t,n,r);break;case 13:sr(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,t.memoizedState!==null?a._visibility&2?sr(e,t,n,r):Ci(e,t):a._visibility&2?sr(e,t,n,r):(a._visibility|=2,Aa(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Pu(i,t);break;case 24:sr(e,t,n,r),o&2048&&Mu(t.alternate,t);break;default:sr(e,t,n,r)}}function Aa(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,u=n,h=r,k=i.flags;switch(i.tag){case 0:case 11:case 15:Aa(a,i,u,h,o),_i(8,i);break;case 23:break;case 22:var j=i.stateNode;i.memoizedState!==null?j._visibility&2?Aa(a,i,u,h,o):Ci(a,i):(j._visibility|=2,Aa(a,i,u,h,o)),o&&k&2048&&Pu(i.alternate,i);break;case 24:Aa(a,i,u,h,o),o&&k&2048&&Mu(i.alternate,i);break;default:Aa(a,i,u,h,o)}t=t.sibling}}function Ci(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:Ci(n,r),o&2048&&Pu(r.alternate,r);break;case 24:Ci(n,r),o&2048&&Mu(r.alternate,r);break;default:Ci(n,r)}t=t.sibling}}var Ii=8192;function Na(e,t,n){if(e.subtreeFlags&Ii)for(e=e.child;e!==null;)um(e,t,n),e=e.sibling}function um(e,t,n){switch(e.tag){case 26:Na(e,t,n),e.flags&Ii&&e.memoizedState!==null&&l0(n,lr,e.memoizedState,e.memoizedProps);break;case 5:Na(e,t,n);break;case 3:case 4:var r=lr;lr=Wl(e.stateNode.containerInfo),Na(e,t,n),lr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ii,Ii=16777216,Na(e,t,n),Ii=r):Na(e,t,n));break;default:Na(e,t,n)}}function cm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Gt=r,fm(r,e)}cm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dm(e),e=e.sibling}function dm(e){switch(e.tag){case 0:case 11:case 15:zi(e),e.flags&2048&&_o(9,e,e.return);break;case 3:zi(e);break;case 12:zi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zl(e)):zi(e);break;default:zi(e)}}function zl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Gt=r,fm(r,e)}cm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_o(8,t,t.return),zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zl(t));break;default:zl(t)}e=e.sibling}}function fm(e,t){for(;Gt!==null;){var n=Gt;switch(n.tag){case 0:case 11:case 15:_o(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:di(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Gt=r;else e:for(n=e;Gt!==null;){r=Gt;var o=r.sibling,a=r.return;if(nm(r),r===n){Gt=null;break e}if(o!==null){o.return=a,Gt=o;break e}Gt=a}}}var kg={getCacheForType:function(e){var t=ln(Ot),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ln(Ot).controller.signal}},Sg=typeof WeakMap=="function"?WeakMap:Map,at=0,gt=null,He=null,Ze=0,st=0,On=null,Eo=!1,Da=!1,Tu=!1,Zr=0,Mt=0,Co=0,ia=0,Ru=0,$n=0,La=0,Pi=null,Pn=null,ju=!1,Pl=0,mm=0,Ml=1/0,Tl=null,Io=null,Kt=0,zo=null,Fa=null,Jr=0,Au=0,Nu=null,pm=null,Mi=0,Du=null;function Wn(){return(at&2)!==0&&Ze!==0?Ze&-Ze:E.T!==null?Bu():sa()}function hm(){if($n===0)if((Ze&536870912)===0||Ye){var e=pe;pe<<=1,(pe&3932160)===0&&(pe=262144),$n=e}else $n=536870912;return e=Ln.current,e!==null&&(e.flags|=32),$n}function Mn(e,t,n){(e===gt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Oa(e,0),Po(e,Ze,$n,!1)),dr(e,n),((at&2)===0||e!==gt)&&(e===gt&&((at&2)===0&&(ia|=n),Mt===4&&Po(e,Ze,$n,!1)),Er(e))}function gm(e,t,n){if((at&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Cr(e,t),o=r?Cg(e,t):Fu(e,t,!0),a=r;do{if(o===0){Da&&!r&&Po(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!_g(n)){o=Fu(e,t,!1),a=!1;continue}if(o===2){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var u=e;o=Pi;var h=u.current.memoizedState.isDehydrated;if(h&&(Oa(u,i).flags|=256),i=Fu(u,i,!1),i!==2){if(Tu&&!h){u.errorRecoveryDisabledLanes|=a,ia|=a,o=4;break e}a=Pn,Pn=o,a!==null&&(Pn===null?Pn=a:Pn.push.apply(Pn,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){Oa(e,0),Po(e,t,0,!0);break}e:{switch(r=e,a=o,a){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Po(r,t,$n,!Eo);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Pl+300-Ie(),10<o)){if(Po(r,t,$n,!Eo),Yn(r,0,!0)!==0)break e;Jr=t,r.timeoutHandle=Hm(ym.bind(null,r,n,Pn,Tl,ju,t,$n,ia,La,Eo,a,"Throttled",-0,0),o);break e}ym(r,n,Pn,Tl,ju,t,$n,ia,La,Eo,a,null,-0,0)}}break}while(!0);Er(e)}function ym(e,t,n,r,o,a,i,u,h,k,j,O,_,I){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},um(t,a,O);var ce=(a&62914560)===a?Pl-Ie():(a&4194048)===a?mm-Ie():0;if(ce=s0(O,ce),ce!==null){Jr=a,e.cancelPendingCommit=ce(Em.bind(null,e,t,a,n,r,o,i,u,h,j,O,null,_,I)),Po(e,a,i,!k);return}}Em(e,t,a,n,r,o,i,u,h)}function _g(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!Nn(a(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Po(e,t,n,r){t&=~Ru,t&=~ia,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-ot(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Ir(e,n,t)}function Rl(){return(at&6)===0?(Ti(0),!1):!0}function Lu(){if(He!==null){if(st===0)var e=He.return;else e=He,Wr=Zo=null,Ys(e),Pa=null,mi=0,e=He;for(;e!==null;)Qf(e.alternate,e),e=e.return;He=null}}function Oa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Vg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Jr=0,Lu(),gt=e,He=n=Or(e.current,null),Ze=t,st=0,On=null,Eo=!1,Da=Cr(e,t),Tu=!1,La=$n=Ru=ia=Co=Mt=0,Pn=Pi=null,ju=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var o=31-ot(r),a=1<<o;t|=e[o],r&=~a}return Zr=t,Yi(),n}function bm(e,t){Ae=null,E.H=wi,t===za||t===ll?(t=jd(),st=3):t===Ws?(t=jd(),st=4):st=t===hu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,On=t,He===null&&(Mt=1,wl(e,Vn(t,e.current)))}function vm(){var e=Ln.current;return e===null?!0:(Ze&4194048)===Ze?ir===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===ir:!1}function xm(){var e=E.H;return E.H=wi,e===null?wi:e}function wm(){var e=E.A;return E.A=kg,e}function jl(){Mt=4,Eo||(Ze&4194048)!==Ze&&Ln.current!==null||(Da=!0),(Co&134217727)===0&&(ia&134217727)===0||gt===null||Po(gt,Ze,$n,!1)}function Fu(e,t,n){var r=at;at|=2;var o=xm(),a=wm();(gt!==e||Ze!==t)&&(Tl=null,Oa(e,t)),t=!1;var i=Mt;e:do try{if(st!==0&&He!==null){var u=He,h=On;switch(st){case 8:Lu(),i=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(t=!0);var k=st;if(st=0,On=null,$a(e,u,h,k),n&&Da){i=0;break e}break;default:k=st,st=0,On=null,$a(e,u,h,k)}}Eg(),i=Mt;break}catch(j){bm(e,j)}while(!0);return t&&e.shellSuspendCounter++,Wr=Zo=null,at=r,E.H=o,E.A=a,He===null&&(gt=null,Ze=0,Yi()),i}function Eg(){for(;He!==null;)km(He)}function Cg(e,t){var n=at;at|=2;var r=xm(),o=wm();gt!==e||Ze!==t?(Tl=null,Ml=Ie()+500,Oa(e,t)):Da=Cr(e,t);e:do try{if(st!==0&&He!==null){t=He;var a=On;t:switch(st){case 1:st=0,On=null,$a(e,t,a,1);break;case 2:case 9:if(Td(a)){st=0,On=null,Sm(t);break}t=function(){st!==2&&st!==9||gt!==e||(st=7),Er(e)},a.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Td(a)?(st=0,On=null,Sm(t)):(st=0,On=null,$a(e,t,a,7));break;case 5:var i=null;switch(He.tag){case 26:i=He.memoizedState;case 5:case 27:var u=He;if(i?sp(i):u.stateNode.complete){st=0,On=null;var h=u.sibling;if(h!==null)He=h;else{var k=u.return;k!==null?(He=k,Al(k)):He=null}break t}}st=0,On=null,$a(e,t,a,5);break;case 6:st=0,On=null,$a(e,t,a,6);break;case 8:Lu(),Mt=6;break e;default:throw Error(c(462))}}Ig();break}catch(j){bm(e,j)}while(!0);return Wr=Zo=null,E.H=r,E.A=o,at=n,He!==null?0:(gt=null,Ze=0,Yi(),Mt)}function Ig(){for(;He!==null&&!Z();)km(He)}function km(e){var t=Kf(e.alternate,e,Zr);e.memoizedProps=e.pendingProps,t===null?Al(e):He=t}function Sm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$f(n,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=$f(n,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:Ys(t);default:Qf(n,t),t=He=xd(t,Zr),t=Kf(n,t,Zr)}e.memoizedProps=e.pendingProps,t===null?Al(e):He=t}function $a(e,t,n,r){Wr=Zo=null,Ys(t),Pa=null,mi=0;var o=t.return;try{if(hg(e,o,t,n,Ze)){Mt=1,wl(e,Vn(n,e.current)),He=null;return}}catch(a){if(o!==null)throw He=o,a;Mt=1,wl(e,Vn(n,e.current)),He=null;return}t.flags&32768?(Ye||r===1?e=!0:Da||(Ze&536870912)!==0?e=!1:(Eo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ln.current,r!==null&&r.tag===13&&(r.flags|=16384))),_m(t,e)):Al(t)}function Al(e){var t=e;do{if((t.flags&32768)!==0){_m(t,Eo);return}e=t.return;var n=bg(t.alternate,t,Zr);if(n!==null){He=n;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Mt===0&&(Mt=5)}function _m(e,t){do{var n=vg(e.alternate,e);if(n!==null){n.flags&=32767,He=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=n}while(e!==null);Mt=6,He=null}function Em(e,t,n,r,o,a,i,u,h){e.cancelPendingCommit=null;do Nl();while(Kt!==0);if((at&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(a=t.lanes|t.childLanes,a|=Cs,ro(e,n,a,i,u,h),e===gt&&(He=gt=null,Ze=0),Fa=t,zo=e,Jr=n,Au=a,Nu=o,pm=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Tg(dn,function(){return Mm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=E.T,E.T=null,o=$.p,$.p=2,i=at,at|=4;try{xg(e,t,n)}finally{at=i,$.p=o,E.T=r}}Kt=1,Cm(),Im(),zm()}}function Cm(){if(Kt===1){Kt=0;var e=zo,t=Fa,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var r=$.p;$.p=2;var o=at;at|=4;try{im(t,e);var a=Xu,i=dd(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(i!==u&&u&&u.ownerDocument&&cd(u.ownerDocument.documentElement,u)){if(h!==null&&ws(u)){var k=h.start,j=h.end;if(j===void 0&&(j=k),"selectionStart"in u)u.selectionStart=k,u.selectionEnd=Math.min(j,u.value.length);else{var O=u.ownerDocument||document,_=O&&O.defaultView||window;if(_.getSelection){var I=_.getSelection(),ce=u.textContent.length,Ee=Math.min(h.start,ce),ft=h.end===void 0?Ee:Math.min(h.end,ce);!I.extend&&Ee>ft&&(i=ft,ft=Ee,Ee=i);var b=ud(u,Ee),g=ud(u,ft);if(b&&g&&(I.rangeCount!==1||I.anchorNode!==b.node||I.anchorOffset!==b.offset||I.focusNode!==g.node||I.focusOffset!==g.offset)){var w=O.createRange();w.setStart(b.node,b.offset),I.removeAllRanges(),Ee>ft?(I.addRange(w),I.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),I.addRange(w))}}}}for(O=[],I=u;I=I.parentNode;)I.nodeType===1&&O.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<O.length;u++){var L=O[u];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}Hl=!!Gu,Xu=Gu=null}finally{at=o,$.p=r,E.T=n}}e.current=t,Kt=2}}function Im(){if(Kt===2){Kt=0;var e=zo,t=Fa,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var r=$.p;$.p=2;var o=at;at|=4;try{tm(e,t.alternate,t)}finally{at=o,$.p=r,E.T=n}}Kt=3}}function zm(){if(Kt===4||Kt===3){Kt=0,K();var e=zo,t=Fa,n=Jr,r=pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Kt=5:(Kt=0,Fa=zo=null,Pm(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Io=null),yn(n),t=t.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(cr,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=E.T,o=$.p,$.p=2,E.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var u=r[i];a(u.value,{componentStack:u.stack})}}finally{E.T=t,$.p=o}}(Jr&3)!==0&&Nl(),Er(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Du?Mi++:(Mi=0,Du=e):Mi=0,Ti(0)}}function Pm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,di(t)))}function Nl(){return Cm(),Im(),zm(),Mm()}function Mm(){if(Kt!==5)return!1;var e=zo,t=Au;Au=0;var n=yn(Jr),r=E.T,o=$.p;try{$.p=32>n?32:n,E.T=null,n=Nu,Nu=null;var a=zo,i=Jr;if(Kt=0,Fa=zo=null,Jr=0,(at&6)!==0)throw Error(c(331));var u=at;if(at|=4,dm(a.current),sm(a,a.current,i,n),at=u,Ti(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(cr,a)}catch{}return!0}finally{$.p=o,E.T=r,Pm(e,t)}}function Tm(e,t,n){t=Vn(n,t),t=pu(e.stateNode,t,2),e=wo(e,t,2),e!==null&&(dr(e,2),Er(e))}function ut(e,t,n){if(e.tag===3)Tm(e,e,n);else for(;t!==null;){if(t.tag===3){Tm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Io===null||!Io.has(r))){e=Vn(n,e),n=Rf(2),r=wo(t,n,2),r!==null&&(jf(n,r,t,e),dr(r,2),Er(r));break}}t=t.return}}function Ou(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sg;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(Tu=!0,o.add(n),e=zg.bind(null,e,t,n),t.then(e,e))}function zg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,gt===e&&(Ze&n)===n&&(Mt===4||Mt===3&&(Ze&62914560)===Ze&&300>Ie()-Pl?(at&2)===0&&Oa(e,0):Ru|=n,La===Ze&&(La=0)),Er(e)}function Rm(e,t){t===0&&(t=tt()),e=Qo(e,t),e!==null&&(dr(e,t),Er(e))}function Pg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rm(e,n)}function Mg(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),Rm(e,n)}function Tg(e,t){return X(e,t)}var Dl=null,Wa=null,$u=!1,Ll=!1,Wu=!1,Mo=0;function Er(e){e!==Wa&&e.next===null&&(Wa===null?Dl=Wa=e:Wa=Wa.next=e),Ll=!0,$u||($u=!0,jg())}function Ti(e,t){if(!Wu&&Ll){Wu=!0;do for(var n=!1,r=Dl;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var i=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-ot(42|e)+1)-1,a&=o&~(i&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Dm(r,a))}else a=Ze,a=Yn(r,r===gt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||Cr(r,a)||(n=!0,Dm(r,a));r=r.next}while(n);Wu=!1}}function Rg(){jm()}function jm(){Ll=$u=!1;var e=0;Mo!==0&&qg()&&(e=Mo);for(var t=Ie(),n=null,r=Dl;r!==null;){var o=r.next,a=Am(r,t);a===0?(r.next=null,n===null?Dl=o:n.next=o,o===null&&(Wa=n)):(n=r,(e!==0||(a&3)!==0)&&(Ll=!0)),r=o}Kt!==0&&Kt!==5||Ti(e),Mo!==0&&(Mo=0)}function Am(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-ot(a),u=1<<i,h=o[i];h===-1?((u&n)===0||(u&r)!==0)&&(o[i]=de(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=gt,n=Ze,n=Yn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ge(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Cr(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ge(r),yn(n)){case 2:case 8:n=vt;break;case 32:n=dn;break;case 268435456:n=Xt;break;default:n=dn}return r=Nm.bind(null,e),n=X(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ge(r),e.callbackPriority=2,e.callbackNode=null,2}function Nm(e,t){if(Kt!==0&&Kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Nl()&&e.callbackNode!==n)return null;var r=Ze;return r=Yn(e,e===gt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gm(e,r,t),Am(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?Nm.bind(null,e):null)}function Dm(e,t){if(Nl())return null;gm(e,t,!0)}function jg(){Ug(function(){(at&6)!==0?X(Sn,Rg):jm()})}function Bu(){if(Mo===0){var e=Ca;e===0&&(e=fn,fn<<=1,(fn&261888)===0&&(fn=256)),Mo=e}return Mo}function Lm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ga(""+e)}function Fm(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ag(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=Lm((o[qt]||null).action),i=r.submitter;i&&(t=(t=i[qt]||null)?Lm(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var u=new vn("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mo!==0){var h=i?Fm(o,i):new FormData(o);su(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=i?Fm(o,i):new FormData(o),su(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var qu=0;qu<Es.length;qu++){var Vu=Es[qu],Ng=Vu.toLowerCase(),Dg=Vu[0].toUpperCase()+Vu.slice(1);ar(Ng,"on"+Dg)}ar(pd,"onAnimationEnd"),ar(hd,"onAnimationIteration"),ar(gd,"onAnimationStart"),ar("dblclick","onDoubleClick"),ar("focusin","onFocus"),ar("focusout","onBlur"),ar(Jh,"onTransitionRun"),ar(Yh,"onTransitionStart"),ar(eg,"onTransitionCancel"),ar(yd,"onTransitionEnd"),Mr("onMouseEnter",["mouseout","mouseover"]),Mr("onMouseLeave",["mouseout","mouseover"]),Mr("onPointerEnter",["pointerout","pointerover"]),Mr("onPointerLeave",["pointerout","pointerover"]),pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pr("onBeforeInput",["compositionend","keypress","textInput","paste"]),pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="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(" "),Lg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ri));function Om(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var u=r[i],h=u.instance,k=u.currentTarget;if(u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Ji(j)}o.currentTarget=null,a=h}else for(i=0;i<r.length;i++){if(u=r[i],h=u.instance,k=u.currentTarget,u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Ji(j)}o.currentTarget=null,a=h}}}}function Qe(e,t){var n=t[ua];n===void 0&&(n=t[ua]=new Set);var r=e+"__bubble";n.has(r)||($m(t,e,2,!1),n.add(r))}function Uu(e,t,n){var r=0;t&&(r|=4),$m(n,e,r,t)}var Fl="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[Fl]){e[Fl]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(Lg.has(n)||Uu(n,!1,e),Uu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fl]||(t[Fl]=!0,Uu("selectionchange",!1,t))}}function $m(e,t,n,r){switch(hp(t)){case 2:var o=d0;break;case 8:o=f0;break;default:o=lc}n=o.bind(null,t,n,e),o=void 0,!Nr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Hu(e,t,n,r,o){var a=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var u=r.stateNode.containerInfo;if(u===o)break;if(i===4)for(i=r.return;i!==null;){var h=i.tag;if((h===3||h===4)&&i.stateNode.containerInfo===o)return;i=i.return}for(;u!==null;){if(i=mr(u),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){r=a=i;continue e}u=u.parentNode}}r=r.return}co(function(){var k=a,j=uo(n),O=[];e:{var _=bd.get(e);if(_!==void 0){var I=vn,ce=e;switch(e){case"keypress":if(rn(n)===0)break e;case"keydown":case"keyup":I=d;break;case"focusin":ce="focus",I=ri;break;case"focusout":ce="blur",I=ri;break;case"beforeblur":case"afterblur":I=ri;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":I=xr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=Gi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=J;break;case pd:case hd:case gd:I=Xi;break;case yd:I=$e;break;case"scroll":case"scrollend":I=Hi;break;case"wheel":I=mt;break;case"copy":case"cut":case"paste":I=ps;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=P;break;case"toggle":case"beforetoggle":I=yt}var Ee=(t&4)!==0,ft=!Ee&&(e==="scroll"||e==="scrollend"),b=Ee?_!==null?_+"Capture":null:_;Ee=[];for(var g=k,w;g!==null;){var L=g;if(w=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||w===null||b===null||(L=fo(g,b),L!=null&&Ee.push(ji(g,L,w))),ft)break;g=g.return}0<Ee.length&&(_=new I(_,ce,null,n,j),O.push({event:_,listeners:Ee}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",_&&n!==jr&&(ce=n.relatedTarget||n.fromElement)&&(mr(ce)||ce[fr]))break e;if((I||_)&&(_=j.window===j?j:(_=j.ownerDocument)?_.defaultView||_.parentWindow:window,I?(ce=n.relatedTarget||n.toElement,I=k,ce=ce?mr(ce):null,ce!==null&&(ft=A(ce),Ee=ce.tag,ce!==ft||Ee!==5&&Ee!==27&&Ee!==6)&&(ce=null)):(I=null,ce=k),I!==ce)){if(Ee=xr,L="onMouseLeave",b="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=P,L="onPointerLeave",b="onPointerEnter",g="pointer"),ft=I==null?_:Ct(I),w=ce==null?_:Ct(ce),_=new Ee(L,g+"leave",I,n,j),_.target=ft,_.relatedTarget=w,L=null,mr(j)===k&&(Ee=new Ee(b,g+"enter",ce,n,j),Ee.target=w,Ee.relatedTarget=ft,L=Ee),ft=L,I&&ce)t:{for(Ee=Fg,b=I,g=ce,w=0,L=b;L;L=Ee(L))w++;L=0;for(var we=g;we;we=Ee(we))L++;for(;0<w-L;)b=Ee(b),w--;for(;0<L-w;)g=Ee(g),L--;for(;w--;){if(b===g||g!==null&&b===g.alternate){Ee=b;break t}b=Ee(b),g=Ee(g)}Ee=null}else Ee=null;I!==null&&Wm(O,_,I,Ee,!1),ce!==null&&ft!==null&&Wm(O,ft,ce,Ee,!0)}}e:{if(_=k?Ct(k):window,I=_.nodeName&&_.nodeName.toLowerCase(),I==="select"||I==="input"&&_.type==="file")var nt=rd;else if(Vo(_))if(od)nt=Gh;else{nt=Hh;var he=Kh}else I=_.nodeName,!I||I.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?k&&so(k.elementType)&&(nt=rd):nt=Qh;if(nt&&(nt=nt(e,k))){Fr(O,nt,n,j);break e}he&&he(e,_,k),e==="focusout"&&k&&_.type==="number"&&k.memoizedProps.value!=null&&ha(_,"number",_.value)}switch(he=k?Ct(k):window,e){case"focusin":(Vo(he)||he.contentEditable==="true")&&(ba=he,ks=k,si=null);break;case"focusout":si=ks=ba=null;break;case"mousedown":Ss=!0;break;case"contextmenu":case"mouseup":case"dragend":Ss=!1,fd(O,n,j);break;case"selectionchange":if(Zh)break;case"keydown":case"keyup":fd(O,n,j)}var Ne;if(Vt)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else We?Ut(e,n)&&(Je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Je="onCompositionStart");Je&&(je&&n.locale!=="ko"&&(We||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&We&&(Ne=Ki()):(lt=j,Ft="value"in lt?lt.value:lt.textContent,We=!0)),he=Ol(k,Je),0<he.length&&(Je=new oi(Je,e,null,n,j),O.push({event:Je,listeners:he}),Ne?Je.data=Ne:(Ne=gn(n),Ne!==null&&(Je.data=Ne)))),(Ne=Ce?xn(e,n):Bn(e,n))&&(Je=Ol(k,"onBeforeInput"),0<Je.length&&(he=new oi("onBeforeInput","beforeinput",null,n,j),O.push({event:he,listeners:Je}),he.data=Ne)),Ag(O,e,k,n,j)}Om(O,t)})}function ji(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ol(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,a=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||a===null||(o=fo(e,n),o!=null&&r.unshift(ji(e,o,a)),o=fo(e,t),o!=null&&r.push(ji(e,o,a))),e.tag===3)return r;e=e.return}return[]}function Fg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wm(e,t,n,r,o){for(var a=t._reactName,i=[];n!==null&&n!==r;){var u=n,h=u.alternate,k=u.stateNode;if(u=u.tag,h!==null&&h===r)break;u!==5&&u!==26&&u!==27||k===null||(h=k,o?(k=fo(n,a),k!=null&&i.unshift(ji(n,k,h))):o||(k=fo(n,a),k!=null&&i.push(ji(n,k,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Og=/\r\n?/g,$g=/\u0000|\uFFFD/g;function Bm(e){return(typeof e=="string"?e:""+e).replace(Og,`
41
+ `).replace($g,"")}function qm(e,t){return t=Bm(t),Bm(e)===t}function dt(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||gr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&gr(e,""+r);break;case"className":tr(e,"class",r);break;case"tabIndex":tr(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(e,n,r);break;case"style":qo(e,r,a);break;case"data":if(t!=="object"){tr(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=ga(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.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"?(t!=="input"&&dt(e,t,"name",o.name,o,null),dt(e,t,"formEncType",o.formEncType,o,null),dt(e,t,"formMethod",o.formMethod,o,null),dt(e,t,"formTarget",o.formTarget,o,null)):(dt(e,t,"encType",o.encType,o,null),dt(e,t,"method",o.method,o,null),dt(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=ga(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=hn);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=ga(""+r),e.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":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),_n(e,"popover",r);break;case"xlinkActuate":nr(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":nr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":nr(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":nr(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":nr(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":nr(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":nr(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":nr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":nr(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_n(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=tn.get(n)||n,_n(e,n,r))}}function Qu(e,t,n,r,o,a){switch(n){case"style":qo(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof r=="string"?gr(e,r):(typeof r=="number"||typeof r=="bigint")&&gr(e,""+r);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fa.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),a=e[qt]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,o),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_n(e,n,r)}}}function un(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var r=!1,o=!1,a;for(a in n)if(n.hasOwnProperty(a)){var i=n[a];if(i!=null)switch(a){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:dt(e,t,a,i,n,null)}}o&&dt(e,t,"srcSet",n.srcSet,n,null),r&&dt(e,t,"src",n.src,n,null);return;case"input":Qe("invalid",e);var u=a=i=o=null,h=null,k=null;for(r in n)if(n.hasOwnProperty(r)){var j=n[r];if(j!=null)switch(r){case"name":o=j;break;case"type":i=j;break;case"checked":h=j;break;case"defaultChecked":k=j;break;case"value":a=j;break;case"defaultValue":u=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(137,t));break;default:dt(e,t,r,j,n,null)}}rr(e,a,u,h,k,i,o,!1);return;case"select":Qe("invalid",e),r=i=a=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":a=u;break;case"defaultValue":i=u;break;case"multiple":r=u;default:dt(e,t,o,u,n,null)}t=a,n=i,e.multiple=!!r,t!=null?lo(e,!!r,t,!1):n!=null&&lo(e,!!r,n,!0);return;case"textarea":Qe("invalid",e),a=o=r=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":r=u;break;case"defaultValue":o=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:dt(e,t,i,u,n,null)}Ya(e,r,o,a);return;case"option":for(h in n)if(n.hasOwnProperty(h)&&(r=n[h],r!=null))switch(h){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:dt(e,t,h,r,n,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(r=0;r<Ri.length;r++)Qe(Ri[r],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in n)if(n.hasOwnProperty(k)&&(r=n[k],r!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:dt(e,t,k,r,n,null)}return;default:if(so(t)){for(j in n)n.hasOwnProperty(j)&&(r=n[j],r!==void 0&&Qu(e,t,j,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&dt(e,t,u,r,n,null))}function Wg(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,a=null,i=null,u=null,h=null,k=null,j=null;for(I in n){var O=n[I];if(n.hasOwnProperty(I)&&O!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":h=O;default:r.hasOwnProperty(I)||dt(e,t,I,null,r,O)}}for(var _ in r){var I=r[_];if(O=n[_],r.hasOwnProperty(_)&&(I!=null||O!=null))switch(_){case"type":a=I;break;case"name":o=I;break;case"checked":k=I;break;case"defaultChecked":j=I;break;case"value":i=I;break;case"defaultValue":u=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(c(137,t));break;default:I!==O&&dt(e,t,_,I,r,O)}}pa(e,i,u,h,k,j,a,o);return;case"select":I=i=u=_=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":I=h;default:r.hasOwnProperty(a)||dt(e,t,a,null,r,h)}for(o in r)if(a=r[o],h=n[o],r.hasOwnProperty(o)&&(a!=null||h!=null))switch(o){case"value":_=a;break;case"defaultValue":u=a;break;case"multiple":i=a;default:a!==h&&dt(e,t,o,a,r,h)}t=u,n=i,r=I,_!=null?lo(e,!!n,_,!1):!!r!=!!n&&(t!=null?lo(e,!!n,t,!0):lo(e,!!n,n?[]:"",!1));return;case"textarea":I=_=null;for(u in n)if(o=n[u],n.hasOwnProperty(u)&&o!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:dt(e,t,u,null,r,o)}for(i in r)if(o=r[i],a=n[i],r.hasOwnProperty(i)&&(o!=null||a!=null))switch(i){case"value":_=o;break;case"defaultValue":I=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==a&&dt(e,t,i,o,r,a)}Vi(e,_,I);return;case"option":for(var ce in n)if(_=n[ce],n.hasOwnProperty(ce)&&_!=null&&!r.hasOwnProperty(ce))switch(ce){case"selected":e.selected=!1;break;default:dt(e,t,ce,null,r,_)}for(h in r)if(_=r[h],I=n[h],r.hasOwnProperty(h)&&_!==I&&(_!=null||I!=null))switch(h){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:dt(e,t,h,_,r,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 Ee in n)_=n[Ee],n.hasOwnProperty(Ee)&&_!=null&&!r.hasOwnProperty(Ee)&&dt(e,t,Ee,null,r,_);for(k in r)if(_=r[k],I=n[k],r.hasOwnProperty(k)&&_!==I&&(_!=null||I!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,t));break;default:dt(e,t,k,_,r,I)}return;default:if(so(t)){for(var ft in n)_=n[ft],n.hasOwnProperty(ft)&&_!==void 0&&!r.hasOwnProperty(ft)&&Qu(e,t,ft,void 0,r,_);for(j in r)_=r[j],I=n[j],!r.hasOwnProperty(j)||_===I||_===void 0&&I===void 0||Qu(e,t,j,_,r,I);return}}for(var b in n)_=n[b],n.hasOwnProperty(b)&&_!=null&&!r.hasOwnProperty(b)&&dt(e,t,b,null,r,_);for(O in r)_=r[O],I=n[O],!r.hasOwnProperty(O)||_===I||_==null&&I==null||dt(e,t,O,_,r,I)}function Vm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Bg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],a=o.transferSize,i=o.initiatorType,u=o.duration;if(a&&u&&Vm(i)){for(i=0,u=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],k=h.startTime;if(k>u)break;var j=h.transferSize,O=h.initiatorType;j&&Vm(O)&&(h=h.responseEnd,i+=j*(h<u?1:(u-k)/(h-k)))}if(--r,t+=8*(a+i)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gu=null,Xu=null;function $l(e){return e.nodeType===9?e:e.ownerDocument}function Um(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Km(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Zu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ju=null;function qg(){var e=window.event;return e&&e.type==="popstate"?e===Ju?!1:(Ju=e,!0):(Ju=null,!1)}var Hm=typeof setTimeout=="function"?setTimeout:void 0,Vg=typeof clearTimeout=="function"?clearTimeout:void 0,Qm=typeof Promise=="function"?Promise:void 0,Ug=typeof queueMicrotask=="function"?queueMicrotask:typeof Qm<"u"?function(e){return Qm.resolve(null).then(e).catch(Kg)}:Hm;function Kg(e){setTimeout(function(){throw e})}function To(e){return e==="head"}function Gm(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(o),Ua(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ai(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ai(n);for(var a=n.firstChild;a;){var i=a.nextSibling,u=a.nodeName;a[Pr]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Ai(e.ownerDocument.body);n=o}while(n);Ua(t)}function Xm(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Yu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Yu(n),Xa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Hg(e,t,n,r){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Pr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence")||a!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Qn(e.nextSibling),e===null)break}return null}function Qg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Qn(e.nextSibling),e===null))return null;return e}function Zm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Qn(e.nextSibling),e===null))return null;return e}function ec(e){return e.data==="$?"||e.data==="$~"}function tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Gg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var nc=null;function Jm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Qn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function ep(e,t,n){switch(t=$l(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Ai(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Xa(e)}var Gn=new Map,tp=new Set;function Wl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Yr=$.d;$.d={f:Xg,r:Zg,D:Jg,C:Yg,L:e0,m:t0,X:r0,S:n0,M:o0};function Xg(){var e=Yr.f(),t=Rl();return e||t}function Zg(e){var t=ao(e);t!==null&&t.tag===5&&t.type==="form"?bf(t):Yr.r(e)}var Ba=typeof document>"u"?null:document;function np(e,t,n){var r=Ba;if(r&&typeof t=="string"&&t){var o=en(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),tp.has(o)||(tp.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),un(t,"link",e),Lt(t),r.head.appendChild(t)))}}function Jg(e){Yr.D(e),np("dns-prefetch",e,null)}function Yg(e,t){Yr.C(e,t),np("preconnect",e,t)}function e0(e,t,n){Yr.L(e,t,n);var r=Ba;if(r&&e&&t){var o='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+en(n.imageSizes)+'"]')):o+='[href="'+en(e)+'"]';var a=o;switch(t){case"style":a=qa(e);break;case"script":a=Va(e)}Gn.has(a)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Gn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(Ni(a))||t==="script"&&r.querySelector(Di(a))||(t=r.createElement("link"),un(t,"link",e),Lt(t),r.head.appendChild(t)))}}function t0(e,t){Yr.m(e,t);var n=Ba;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+en(r)+'"][href="'+en(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Va(e)}if(!Gn.has(a)&&(e=C({rel:"modulepreload",href:e},t),Gn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Di(a)))return}r=n.createElement("link"),un(r,"link",e),Lt(r),n.head.appendChild(r)}}}function n0(e,t,n){Yr.S(e,t,n);var r=Ba;if(r&&e){var o=It(r).hoistableStyles,a=qa(e);t=t||"default";var i=o.get(a);if(!i){var u={loading:0,preload:null};if(i=r.querySelector(Ni(a)))u.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Gn.get(a))&&rc(e,n);var h=i=r.createElement("link");Lt(h),un(h,"link",e),h._p=new Promise(function(k,j){h.onload=k,h.onerror=j}),h.addEventListener("load",function(){u.loading|=1}),h.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Bl(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:u},o.set(a,i)}}}function r0(e,t){Yr.X(e,t);var n=Ba;if(n&&e){var r=It(n).hoistableScripts,o=Va(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=C({src:e,async:!0},t),(t=Gn.get(o))&&oc(e,t),a=n.createElement("script"),Lt(a),un(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function o0(e,t){Yr.M(e,t);var n=Ba;if(n&&e){var r=It(n).hoistableScripts,o=Va(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=C({src:e,async:!0,type:"module"},t),(t=Gn.get(o))&&oc(e,t),a=n.createElement("script"),Lt(a),un(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function rp(e,t,n,r){var o=(o=_e.current)?Wl(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=qa(n.href),n=It(o).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=qa(n.href);var a=It(o).hoistableStyles,i=a.get(e);if(i||(o=o.ownerDocument||o,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,i),(a=o.querySelector(Ni(e)))&&!a._p&&(i.instance=a,i.state.loading=5),Gn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Gn.set(e,n),a||a0(o,e,n,i.state))),t&&r===null)throw Error(c(528,""));return i}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Va(n),n=It(o).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function qa(e){return'href="'+en(e)+'"'}function Ni(e){return'link[rel="stylesheet"]['+e+"]"}function op(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function a0(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),un(t,"link",n),Lt(t),e.head.appendChild(t))}function Va(e){return'[src="'+en(e)+'"]'}function Di(e){return"script[async]"+e}function ap(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(r)return t.instance=r,Lt(r),r;var o=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Lt(r),un(r,"style",o),Bl(r,n.precedence,e),t.instance=r;case"stylesheet":o=qa(n.href);var a=e.querySelector(Ni(o));if(a)return t.state.loading|=4,t.instance=a,Lt(a),a;r=op(n),(o=Gn.get(o))&&rc(r,o),a=(e.ownerDocument||e).createElement("link"),Lt(a);var i=a;return i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),un(a,"link",r),t.state.loading|=4,Bl(a,n.precedence,e),t.instance=a;case"script":return a=Va(n.src),(o=e.querySelector(Di(a)))?(t.instance=o,Lt(o),o):(r=n,(o=Gn.get(a))&&(r=C({},n),oc(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),Lt(o),un(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Bl(r,n.precedence,e));return t.instance}function Bl(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,a=o,i=0;i<r.length;i++){var u=r[i];if(u.dataset.precedence===t)a=u;else if(a!==o)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ql=null;function ip(e,t,n){if(ql===null){var r=new Map,o=ql=new Map;o.set(n,r)}else o=ql,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var a=n[o];if(!(a[Pr]||a[Et]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var i=a.getAttribute(t)||"";i=e+i;var u=r.get(i);u?u.push(a):r.set(i,[a])}}return r}function lp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function i0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function sp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function l0(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=qa(r.href),a=t.querySelector(Ni(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vl.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=op(r),(o=Gn.get(o))&&rc(r,o),a=a.createElement("link"),Lt(a);var i=a;i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),un(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Vl.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var ac=0;function s0(e,t){return e.stylesheets&&e.count===0&&Kl(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&ac===0&&(ac=62500*Bg());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>ac?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Vl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ul=null;function Kl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ul=new Map,t.forEach(u0,e),Ul=null,Vl.call(e))}function u0(e,t){if(!(t.state.loading&4)){var n=Ul.get(e);if(n)var r=n.get(null);else{n=new Map,Ul.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var i=o[a];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}o=t.instance,i=o.getAttribute("data-precedence"),a=n.get(i)||r,a===r&&n.set(null,o),n.set(i,o),this.count++,r=Vl.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),a?a.parentNode.insertBefore(o,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Li={$$typeof:re,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function c0(e,t,n,r,o,a,i,u,h){this.tag=1,this.containerInfo=e,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=mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mn(0),this.hiddenUpdates=mn(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function up(e,t,n,r,o,a,i,u,h,k,j,O){return e=new c0(e,t,n,i,h,k,j,O,u),t=1,a===!0&&(t|=24),a=Dn(3,null,null,t),e.current=a,a.stateNode=e,t=Fs(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Bs(a),e}function cp(e){return e?(e=wa,e):wa}function dp(e,t,n,r,o,a){o=cp(o),r.context===null?r.context=o:r.pendingContext=o,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=wo(e,r,t),n!==null&&(Mn(n,e,t),hi(n,e,t))}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=Qo(e,67108864);t!==null&&Mn(t,e,67108864),ic(e,67108864)}}function pp(e){if(e.tag===13||e.tag===31){var t=Wn();t=er(t);var n=Qo(e,t);n!==null&&Mn(n,e,t),ic(e,t)}}var Hl=!0;function d0(e,t,n,r){var o=E.T;E.T=null;var a=$.p;try{$.p=2,lc(e,t,n,r)}finally{$.p=a,E.T=o}}function f0(e,t,n,r){var o=E.T;E.T=null;var a=$.p;try{$.p=8,lc(e,t,n,r)}finally{$.p=a,E.T=o}}function lc(e,t,n,r){if(Hl){var o=sc(r);if(o===null)Hu(e,t,r,Ql,n),gp(e,r);else if(p0(o,e,t,n,r))r.stopPropagation();else if(gp(e,r),t&4&&-1<m0.indexOf(e)){for(;o!==null;){var a=ao(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var i=Jt(a.pendingLanes);if(i!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;i;){var h=1<<31-ot(i);u.entanglements[1]|=h,i&=~h}Er(a),(at&6)===0&&(Ml=Ie()+500,Ti(0))}}break;case 31:case 13:u=Qo(a,2),u!==null&&Mn(u,a,2),Rl(),ic(a,2)}if(a=sc(r),a===null&&Hu(e,t,r,Ql,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Hu(e,t,r,null,n)}}function sc(e){return e=uo(e),uc(e)}var Ql=null;function uc(e){if(Ql=null,e=mr(e),e!==null){var t=A(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=N(t),e!==null)return e;e=null}else if(n===31){if(e=G(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ql=e,null}function hp(e){switch(e){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(Le()){case Sn:return 2;case vt:return 8;case dn:case it:return 32;case Xt:return 268435456;default:return 32}default:return 32}}var cc=!1,Ro=null,jo=null,Ao=null,Fi=new Map,Oi=new Map,No=[],m0="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 gp(e,t){switch(e){case"focusin":case"focusout":Ro=null;break;case"dragenter":case"dragleave":jo=null;break;case"mouseover":case"mouseout":Ao=null;break;case"pointerover":case"pointerout":Fi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(t.pointerId)}}function $i(e,t,n,r,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},t!==null&&(t=ao(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function p0(e,t,n,r,o){switch(t){case"focusin":return Ro=$i(Ro,e,t,n,r,o),!0;case"dragenter":return jo=$i(jo,e,t,n,r,o),!0;case"mouseover":return Ao=$i(Ao,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Fi.set(a,$i(Fi.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Oi.set(a,$i(Oi.get(a)||null,e,t,n,r,o)),!0}return!1}function yp(e){var t=mr(e.target);if(t!==null){var n=A(t);if(n!==null){if(t=n.tag,t===13){if(t=N(n),t!==null){e.blockedOn=t,oo(e.priority,function(){pp(n)});return}}else if(t===31){if(t=G(n),t!==null){e.blockedOn=t,oo(e.priority,function(){pp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=sc(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);jr=r,n.target.dispatchEvent(r),jr=null}else return t=ao(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function bp(e,t,n){Gl(e)&&n.delete(t)}function h0(){cc=!1,Ro!==null&&Gl(Ro)&&(Ro=null),jo!==null&&Gl(jo)&&(jo=null),Ao!==null&&Gl(Ao)&&(Ao=null),Fi.forEach(bp),Oi.forEach(bp)}function Xl(e,t){e.blockedOn===t&&(e.blockedOn=null,cc||(cc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,h0)))}var Zl=null;function vp(e){Zl!==e&&(Zl=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Zl===e&&(Zl=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if(typeof r!="function"){if(uc(r||n)===null)continue;break}var a=ao(n);a!==null&&(e.splice(t,3),t-=3,su(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Ua(e){function t(h){return Xl(h,e)}Ro!==null&&Xl(Ro,e),jo!==null&&Xl(jo,e),Ao!==null&&Xl(Ao,e),Fi.forEach(t),Oi.forEach(t);for(var n=0;n<No.length;n++){var r=No[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<No.length&&(n=No[0],n.blockedOn===null);)yp(n),n.blockedOn===null&&No.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],a=n[r+1],i=o[qt]||null;if(typeof a=="function")i||vp(n);else if(i){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[qt]||null)u=i.formAction;else if(uc(o)!==null)continue}else u=i.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),vp(n)}}}function xp(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(i){return o=i})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!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 r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function dc(e){this._internalRoot=e}Jl.prototype.render=dc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=Wn();dp(n,r,e,t,null,null)},Jl.prototype.unmount=dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dp(e.current,2,null,e,null,null),Rl(),t[fr]=null}};function Jl(e){this._internalRoot=e}Jl.prototype.unstable_scheduleHydration=function(e){if(e){var t=sa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<No.length&&t!==0&&t<No[n].priority;n++);No.splice(n,0,e),n===0&&yp(e)}};var wp=l.version;if(wp!=="19.2.1")throw Error(c(527,wp,"19.2.1"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?W(e):null,e=e===null?null:e.stateNode,e};var g0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yl.isDisabled&&Yl.supportsFiber)try{cr=Yl.inject(g0),Zt=Yl}catch{}}return Ka.createRoot=function(e,t){if(!x(e))throw Error(c(299));var n=!1,r="",o=zf,a=Pf,i=Mf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=up(e,1,!1,null,null,n,r,null,o,a,i,xp),e[fr]=t.current,Ku(e),new dc(t)},Ka.hydrateRoot=function(e,t,n){if(!x(e))throw Error(c(299));var r=!1,o="",a=zf,i=Pf,u=Mf,h=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=up(e,1,!0,t,n??null,r,o,h,a,i,u,xp),t.context=cp(null),n=t.current,r=Wn(),r=er(r),o=xo(r),o.callback=null,wo(n,o,r),n=r,t.current.lanes=n,dr(t,n),Er(t),e[fr]=t.current,Ku(e),new Jl(t)},Ka.version="19.2.1",Ka}var kc;function Ip(){if(kc)return ns.exports;kc=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),ns.exports=Cp(),ns.exports}var zp=Ip();const Sc=ur(zp);var _c={exports:{}},Ha={};/**
42
42
  * @license React
43
43
  * react-jsx-runtime.production.js
44
44
  *
@@ -46,124 +46,124 @@ Error generating stack: `+r.message+`
46
46
  *
47
47
  * This source code is licensed under the MIT license found in the
48
48
  * LICENSE file in the root directory of this source tree.
49
- */var kc;function Ap(){if(kc)return Wa;kc=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function f(d,k,M){var L=null;if(M!==void 0&&(L=""+M),k.key!==void 0&&(L=""+k.key),"key"in k){M={};for(var X in k)X!=="key"&&(M[X]=k[X])}else M=k;return k=M.ref,{$$typeof:u,type:d,key:L,ref:k!==void 0?k:null,props:M}}return Wa.Fragment=l,Wa.jsx=f,Wa.jsxs=f,Wa}var _c;function Ip(){return _c||(_c=1,wc.exports=Ap()),wc.exports}var m=Ip(),es=yc();/**
49
+ */var Ec;function Pp(){if(Ec)return Ha;Ec=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function m(c,x,A){var N=null;if(A!==void 0&&(N=""+A),x.key!==void 0&&(N=""+x.key),"key"in x){A={};for(var G in x)G!=="key"&&(A[G]=x[G])}else A=x;return x=A.ref,{$$typeof:s,type:c,key:N,ref:x!==void 0?x:null,props:A}}return Ha.Fragment=l,Ha.jsx=m,Ha.jsxs=m,Ha}var Cc;function Mp(){return Cc||(Cc=1,_c.exports=Pp()),_c.exports}var f=Mp(),os=xc();/**
50
50
  * @license lucide-react v0.563.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const Sc=(...u)=>u.filter((l,f,d)=>!!l&&l.trim()!==""&&d.indexOf(l)===f).join(" ").trim();/**
54
+ */const Ic=(...s)=>s.filter((l,m,c)=>!!l&&l.trim()!==""&&c.indexOf(l)===m).join(" ").trim();/**
55
55
  * @license lucide-react v0.563.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const Pp=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
59
+ */const Tp=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
60
  * @license lucide-react v0.563.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const Rp=u=>u.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,f,d)=>d?d.toUpperCase():f.toLowerCase());/**
64
+ */const Rp=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,m,c)=>c?c.toUpperCase():m.toLowerCase());/**
65
65
  * @license lucide-react v0.563.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const Cc=u=>{const l=Rp(u);return l.charAt(0).toUpperCase()+l.slice(1)};/**
69
+ */const zc=s=>{const l=Rp(s);return l.charAt(0).toUpperCase()+l.slice(1)};/**
70
70
  * @license lucide-react v0.563.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */var Mp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
74
+ */var jp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
75
  * @license lucide-react v0.563.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const Dp=u=>{for(const l in u)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};/**
79
+ */const Ap=s=>{for(const l in s)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};/**
80
80
  * @license lucide-react v0.563.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const zp=b.forwardRef(({color:u="currentColor",size:l=24,strokeWidth:f=2,absoluteStrokeWidth:d,className:k="",children:M,iconNode:L,...X},S)=>b.createElement("svg",{ref:S,...Mp,width:l,height:l,stroke:u,strokeWidth:d?Number(f)*24/Number(l):f,className:Sc("lucide",k),...!M&&!Dp(X)&&{"aria-hidden":"true"},...X},[...L.map(([y,$])=>b.createElement(y,$)),...Array.isArray(M)?M:[M]]));/**
84
+ */const Np=v.forwardRef(({color:s="currentColor",size:l=24,strokeWidth:m=2,absoluteStrokeWidth:c,className:x="",children:A,iconNode:N,...G},S)=>v.createElement("svg",{ref:S,...jp,width:l,height:l,stroke:s,strokeWidth:c?Number(m)*24/Number(l):m,className:Ic("lucide",x),...!A&&!Ap(G)&&{"aria-hidden":"true"},...G},[...N.map(([y,W])=>v.createElement(y,W)),...Array.isArray(A)?A:[A]]));/**
85
85
  * @license lucide-react v0.563.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const Rn=(u,l)=>{const f=b.forwardRef(({className:d,...k},M)=>b.createElement(zp,{ref:M,iconNode:l,className:Sc(`lucide-${Pp(Cc(u))}`,`lucide-${u}`,d),...k}));return f.displayName=Cc(u),f};/**
89
+ */const Tn=(s,l)=>{const m=v.forwardRef(({className:c,...x},A)=>v.createElement(Np,{ref:A,iconNode:l,className:Ic(`lucide-${Tp(zc(s))}`,`lucide-${s}`,c),...x}));return m.displayName=zc(s),m};/**
90
90
  * @license lucide-react v0.563.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const Np=Rn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
94
+ */const Dp=Tn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
95
95
  * @license lucide-react v0.563.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const jp=Rn("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
99
+ */const Lp=Tn("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
100
100
  * @license lucide-react v0.563.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const Tp=Rn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
104
+ */const Fp=Tn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
105
105
  * @license lucide-react v0.563.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const Lp=Rn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
109
+ */const Op=Tn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
110
110
  * @license lucide-react v0.563.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const Fp=Rn("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);/**
114
+ */const $p=Tn("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);/**
115
115
  * @license lucide-react v0.563.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const $p=Rn("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
119
+ */const Wp=Tn("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
120
120
  * @license lucide-react v0.563.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const ts=Rn("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);/**
124
+ */const as=Tn("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);/**
125
125
  * @license lucide-react v0.563.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const Ec=Rn("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
129
+ */const Pc=Tn("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
130
130
  * @license lucide-react v0.563.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const Ac=Rn("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
134
+ */const Mc=Tn("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
135
135
  * @license lucide-react v0.563.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const Op=Rn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
139
+ */const Bp=Tn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
140
140
  * @license lucide-react v0.563.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const Ic=Rn("thumbs-down",[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]]);/**
144
+ */const Tc=Tn("thumbs-down",[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]]);/**
145
145
  * @license lucide-react v0.563.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const Pc=Rn("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);/**
149
+ */const Rc=Tn("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);/**
150
150
  * @license lucide-react v0.563.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const ns=Rn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Rc=`
154
+ */const is=Tn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),kn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",jc=`
155
155
  .admesh-publisher-panel {
156
156
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
157
157
  text-align: left;
158
158
  line-height: 1.5;
159
159
  -webkit-font-smoothing: antialiased;
160
160
  }
161
- .admesh-publisher-panel *${vn}, .admesh-publisher-panel *${vn}::before, .admesh-publisher-panel *${vn}::after {
161
+ .admesh-publisher-panel *${kn}, .admesh-publisher-panel *${kn}::before, .admesh-publisher-panel *${kn}::after {
162
162
  box-sizing: border-box;
163
163
  }
164
- .admesh-publisher-panel button${vn}, .admesh-publisher-panel input${vn} { font-family: inherit; }
165
- .admesh-publisher-panel button${vn} { transition: border-color 150ms ease, background-color 150ms ease; }
166
- .admesh-publisher-panel button${vn}:focus-visible, .admesh-publisher-panel a${vn}:focus-visible {
164
+ .admesh-publisher-panel button${kn}, .admesh-publisher-panel input${kn} { font-family: inherit; }
165
+ .admesh-publisher-panel button${kn} { transition: border-color 150ms ease, background-color 150ms ease; }
166
+ .admesh-publisher-panel button${kn}:focus-visible, .admesh-publisher-panel a${kn}:focus-visible {
167
167
  outline: 2px solid var(--publisher-accent);
168
168
  outline-offset: 2px;
169
169
  }
@@ -177,19 +177,19 @@ Error generating stack: `+r.message+`
177
177
  }
178
178
  .admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
179
179
  .admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
180
- .admesh-publisher-panel input${vn} { min-width: 0; }
181
- .admesh-publisher-panel a${vn} { text-underline-offset: 3px; }
180
+ .admesh-publisher-panel input${kn} { min-width: 0; }
181
+ .admesh-publisher-panel a${kn} { text-underline-offset: 3px; }
182
182
  @media (prefers-reduced-motion: reduce) {
183
- .admesh-publisher-panel *${vn}, .admesh-publisher-panel *${vn}::before, .admesh-publisher-panel *${vn}::after {
183
+ .admesh-publisher-panel *${kn}, .admesh-publisher-panel *${kn}::before, .admesh-publisher-panel *${kn}::after {
184
184
  animation: none !important;
185
185
  transition: none !important;
186
186
  scroll-behavior: auto !important;
187
187
  }
188
188
  }
189
189
  @media (max-width: 767px) {
190
- .admesh-publisher-panel:not([data-compact="true"]) input${vn} { font-size: 16px !important; }
190
+ .admesh-publisher-panel:not([data-compact="true"]) input${kn} { font-size: 16px !important; }
191
191
  }
192
- `;function Up({value:u,onChange:l,onSend:f,onStop:d,onSuggestion:k,suggestions:M,registerSuggestion:L,open:X,onOpenChange:S,loading:y,analyzing:$,compact:E,expanded:W,suggestionPlacement:N="below",showLogo:P=!0,logoUrl:H,title:V,placeholder:ee,colors:se}){const oe=b.useId(),re=b.useRef(null),ae=b.useRef(null),Q=b.useRef(null),[U,he]=b.useState({visibility:"hidden"}),ce=X&&!y&&($||M.length>0);b.useLayoutEffect(()=>{var te;if(!ce)return;const le=()=>{var Pe,C;const q=(Pe=re.current)==null?void 0:Pe.getBoundingClientRect();if(!q)return;const ie=((C=window.visualViewport)==null?void 0:C.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=ie-q.bottom-16,p=q.top-16,I=N==="above"?!(p<96&&Ee>p):Ee<96&&p>Ee;he({position:"fixed",left:Math.max(8,Math.min(q.left,ke-q.width-8)),width:Math.min(q.width,ke-16),maxHeight:Math.max(40,Math.min(300,I?p:Ee)),...I?{bottom:window.innerHeight-q.top+8}:{top:q.bottom+8},zIndex:2147483002})},xe=Pe=>{var C,q;const ie=Pe.target;!((C=re.current)!=null&&C.contains(ie))&&!((q=Q.current)!=null&&q.contains(ie))&&S(!1)};return le(),window.addEventListener("resize",le),window.addEventListener("scroll",le,!0),(te=window.visualViewport)==null||te.addEventListener("resize",le),document.addEventListener("pointerdown",xe),()=>{var Pe;window.removeEventListener("resize",le),window.removeEventListener("scroll",le,!0),(Pe=window.visualViewport)==null||Pe.removeEventListener("resize",le),document.removeEventListener("pointerdown",xe)}},[ce,N,S]);const ye=te=>{var le,xe;!((le=re.current)!=null&&le.contains(te))&&!((xe=Q.current)!=null&&xe.contains(te))&&S(!1)},$e=()=>{!u.trim()||y||(S(!1),f())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:re,className:"admesh-publisher-composer",onBlur:te=>ye(te.relatedTarget),onClick:te=>{var le;te.target.closest("button, a")||((le=ae.current)==null||le.focus(),S(!0))},style:{display:"flex",alignItems:"center",gap:E?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${se.border}`,borderRadius:8,background:se.surface,cursor:"text",padding:E?"6px":"8px 8px 8px 12px"},children:[P&&!W&&m.jsx("div",{style:{width:E?24:32,height:E?24:32,display:"grid",placeItems:"center",flexShrink:0,color:se.accent},children:H?m.jsx("img",{src:H,alt:`${V} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(ts,{size:E?18:21,strokeWidth:1.5,"aria-label":V})}),m.jsx("input",{ref:ae,type:"text",value:u,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":ce,"aria-controls":ce?oe:void 0,onFocus:()=>S(!0),onChange:te=>{l(te.target.value),S(!0)},onKeyDown:te=>{var le,xe;te.nativeEvent.isComposing||(te.key==="Escape"&&(te.preventDefault(),S(!1)),te.key==="ArrowDown"&&(te.preventDefault(),ce?(xe=(le=Q.current)==null?void 0:le.querySelector("button"))==null||xe.focus():S(!0)),te.key==="Enter"&&(te.preventDefault(),$e()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:E?"6px 0":"10px 0",fontSize:E?13:15,color:se.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:E?8:9,lineHeight:1.3,color:se.muted,textAlign:"right",whiteSpace:"nowrap"},children:["powered by",m.jsx("br",{}),m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"inherit",textDecoration:"underline",textUnderlineOffset:2,cursor:"pointer"},children:"AdMesh"})]}),m.jsx("button",{type:"button","aria-label":y?"Stop generating":"Send message",disabled:!y&&!u.trim(),onClick:y?d:$e,style:{display:"grid",placeItems:"center",flexShrink:0,width:E?32:40,height:E?32:40,border:"none",borderRadius:6,background:se.accent,color:se.accentText,cursor:"pointer",opacity:!y&&!u.trim()?.5:1},children:y?m.jsx(Op,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(jp,{size:18,"aria-hidden":"true"})})]}),ce&&es.createPortal(m.jsxs("div",{ref:Q,id:oe,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:te=>ye(te.relatedTarget),onKeyDown:te=>{var le,xe,Pe,C;if(te.key==="Escape"&&(te.preventDefault(),(le=ae.current)==null||le.focus(),S(!1)),te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const q=Array.from(((xe=Q.current)==null?void 0:xe.querySelectorAll("button"))??[]),ie=q.indexOf(document.activeElement)+(te.key==="ArrowDown"?1:-1);ie<0?(Pe=ae.current)==null||Pe.focus():(C=q[Math.min(ie,q.length-1)])==null||C.focus()}},style:{...U,"--publisher-accent":se.accent,padding:6,border:`1px solid ${se.border}`,borderRadius:10,background:se.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Rc}),$&&!M.length?m.jsx("div",{role:"status",style:{padding:12,color:se.muted,fontSize:13},children:"Finding suggested questions\u2026"}):M.map(te=>m.jsxs("button",{ref:L(te.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":te.is_sponsored?"true":void 0,onClick:()=>{S(!1),k(te)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${te.is_sponsored?se.accent:se.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:te.is_sponsored?se.accent:se.surface,color:te.is_sponsored?se.accentText:se.text},children:[m.jsx("span",{children:te.text}),te.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},te.id))]}),document.body)]})}let Io=!1;try{typeof globalThis.importMeta<"u"&&(Wr=globalThis.importMeta.env)!=null&&Wr.PROD&&(Io=!0)}catch{}Io||(Io=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...u)=>{Io||console.log(...u)},warn:(...u)=>{Io||console.warn(...u)},error:(...u)=>{console.error(...u)},info:(...u)=>{Io||console.info(...u)},debug:(...u)=>{Io||console.debug(...u)}};function qp(u,l,f){const d=u*l>242500;return{visibilityThreshold:d?.3:.5,minimumDuration:1e3,isLargeAd:d,...f}}function Wp(u){return u<768?"mobile":u<1024?"tablet":"desktop"}function Hp(u){const l=u.getBoundingClientRect(),f=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth,k=l.height,M=l.width;if(k===0||M===0)return 0;const L=Math.max(0,l.top),X=Math.min(f,l.bottom),S=Math.max(0,l.left),y=Math.min(d,l.right),$=Math.max(0,X-L),E=Math.max(0,y-S),W=$*E,N=k*M;return N>0?W/N:0}function Mc(){const u=window.innerHeight,l=document.documentElement.scrollHeight,f=window.pageYOffset||document.documentElement.scrollTop,d=l-u;return d<=0?100:Math.min(100,f/d*100)}function Vp(u){const l=u.getBoundingClientRect(),f=window.pageYOffset||document.documentElement.scrollTop,d=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+f,left:l.left+d}}function Qp(u){const l=u.getBoundingClientRect(),f=Vp(u),d=window.innerWidth||document.documentElement.clientWidth,k=window.innerHeight||document.documentElement.clientHeight,M=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:Wp(d),viewportWidth:d,viewportHeight:k,adWidth:l.width,adHeight:l.height,adPositionTop:f.top,adPositionLeft:f.left,isDarkMode:M,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function Bp(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function Kp(u,l,f){return u>=f.visibilityThreshold&&l>=f.minimumDuration}function Dc(u=new Date){return u.toISOString()}function Xp(u){return u.length===0?0:u.reduce((l,f)=>l+f,0)/u.length}function zc(u,l){let f;return function(...d){f||(u(...d),f=!0,setTimeout(()=>f=!1,l))}}let Gp={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},Jp=!1;function Zp({productId:u,offerId:l,agentId:f,recommendationId:d,elementRef:k,config:M}){const L={...Gp,...M},X=b.useRef(Bp()),[S,y]=b.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Dc(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:L.enabled}),$=b.useRef(null),E=b.useRef(null),W=b.useRef(null),N=b.useRef(null),P=b.useRef(null),H=b.useRef([]),V=b.useRef([]),ee=b.useRef(null),se=b.useCallback(Q=>{L.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[L.debug]),oe=b.useCallback(async(Q,U)=>{if(!(!L.enabled||Jp||!k.current||!$.current)&&(se(`Analytics disabled - skipping event: ${Q}`),L.onEvent)){const he=Qp(k.current),ce={eventType:Q,timestamp:Dc(),sessionId:X.current,productId:u,offerId:l,agentId:f,recommendationId:d,timeMetrics:S.timeMetrics,engagementMetrics:S.engagementMetrics,contextMetrics:he,mrcStandards:$.current,isViewable:S.isViewable,metadata:U};L.onEvent(ce)}},[L,u,l,f,d,k,S,se]),re=b.useCallback(async()=>{V.current.length!==0&&(se("Analytics disabled - clearing batch without sending"),V.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[se]),ae=b.useCallback(zc(()=>{if(!k.current)return;const Q=Hp(k.current),U=Date.now(),he=new Date(S.timeMetrics.loadedAt).getTime();y(ce=>{const ye={...ce};Q>0&&H.current.push(Q);const $e=ce.isVisible,te=Q>0;if(te&&!$e)E.current=U,ye.engagementMetrics.viewportEnterCount++,ye.timeMetrics.timeToFirstVisible||(ye.timeMetrics.timeToFirstVisible=U-he,ye.engagementMetrics.scrollDepthAtFirstVisible=Mc(),oe("ad_visible"));else if(!te&&$e){if(E.current){const le=U-E.current;ye.timeMetrics.totalVisibleDuration+=le,E.current=null}ye.engagementMetrics.viewportExitCount++,oe("ad_hidden")}else if(te&&$e&&E.current){const le=U-E.current;ye.timeMetrics.totalVisibleDuration+=le,E.current=U}if(ye.isVisible=te,ye.visibilityPercentage=Q,Q>ye.engagementMetrics.maxVisibilityPercentage&&(ye.engagementMetrics.maxVisibilityPercentage=Q),H.current.length>0&&(ye.engagementMetrics.averageVisibilityPercentage=Xp(H.current)),$.current){const le=ce.isViewable,xe=Kp(Q,ye.timeMetrics.totalVisibleDuration,$.current);if(xe&&!le)ye.isViewable=!0,ye.timeMetrics.timeToViewable=U-he,W.current=U,oe("ad_viewable");else if(xe&&le&&W.current){const Pe=U-W.current;ye.timeMetrics.totalViewableDuration+=Pe,W.current=U}}return ye.engagementMetrics.currentScrollDepth=Mc(),ye})},100),[k,S.timeMetrics.loadedAt,oe]);return b.useEffect(()=>{if(!k.current)return;const Q=k.current.getBoundingClientRect();$.current=qp(Q.width,Q.height,L.mrcStandards),se("Initialized MRC standards"),oe("ad_loaded")},[k,L.mrcStandards,se,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=new IntersectionObserver(U=>{U.forEach(()=>{ae()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(k.current),()=>{Q.disconnect()}},[L.enabled,k,ae]),b.useEffect(()=>{if(!L.enabled)return;const Q=zc(()=>{ae()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[L.enabled,ae]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{N.current=Date.now(),y(ce=>({...ce,engagementMetrics:{...ce.engagementMetrics,hoverCount:ce.engagementMetrics.hoverCount+1}})),oe("ad_hover_start")},he=()=>{if(N.current){const ce=Date.now()-N.current;y(ye=>({...ye,timeMetrics:{...ye.timeMetrics,totalHoverDuration:ye.timeMetrics.totalHoverDuration+ce}})),N.current=null,oe("ad_hover_end",{hoverDuration:ce})}};return Q.addEventListener("mouseenter",U),Q.addEventListener("mouseleave",he),()=>{Q.removeEventListener("mouseenter",U),Q.removeEventListener("mouseleave",he)}},[L.enabled,k,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{P.current=Date.now(),oe("ad_focus")},he=()=>{if(P.current){const ce=Date.now()-P.current;y(ye=>({...ye,timeMetrics:{...ye.timeMetrics,totalFocusDuration:ye.timeMetrics.totalFocusDuration+ce}})),P.current=null,oe("ad_blur",{focusDuration:ce})}};return Q.addEventListener("focus",U),Q.addEventListener("blur",he),()=>{Q.removeEventListener("focus",U),Q.removeEventListener("blur",he)}},[L.enabled,k,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{y(he=>({...he,engagementMetrics:{...he.engagementMetrics,wasClicked:!0}})),oe("ad_click")};return Q.addEventListener("click",U),()=>{Q.removeEventListener("click",U)}},[L.enabled,k,oe]),b.useEffect(()=>()=>{const Q=Date.now(),U=new Date(S.timeMetrics.loadedAt).getTime(),he=Q-U;y(ce=>({...ce,timeMetrics:{...ce.timeMetrics,sessionDuration:he}})),oe("ad_unloaded",{sessionDuration:he}),re()},[]),S}const rs=({productId:u,offerId:l,agentId:f,recommendationId:d,exposureUrl:k,sessionId:M,triggerExposureUrl:L=!0,children:X,config:S,className:y,style:$,onViewabilityChange:E,onVisible:W,onViewable:N,onClick:P})=>{const H=b.useRef(null),V=b.useRef(!1),ee=Zp({productId:u,offerId:l,agentId:f,recommendationId:d,elementRef:H,config:S}),se=b.useRef(ee.isViewable);b.useEffect(()=>{V.current=!1,se.current=!1},[k,d,M]),b.useEffect(()=>{ee.isViewable!==se.current&&(se.current=ee.isViewable,E&&E(ee.isViewable),ee.isViewable&&N&&N(),ee.isViewable&&!V.current&&L&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:k?"present":"MISSING",sessionId:M?"present":"MISSING",recommendationId:d}),k&&M?(V.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",k),fetch(k,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ae=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ae),V.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!k,hasSessionId:!!M})))},[ee.isViewable,E,N,k,M,d,L]);const oe=b.useRef(ee.isVisible);b.useEffect(()=>{ee.isVisible!==oe.current&&(oe.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const re=()=>{P&&P()};return m.jsx("div",{ref:H,className:y,style:$,onClick:re,"data-admesh-viewability-tracker":!0,"data-recommendation-id":d,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:X})};rs.displayName="AdMeshViewabilityTracker";const Nc=u=>{try{return new URL(u),!0}catch{return!1}},na=u=>typeof u=="string"?u.trim():typeof u=="number"?String(u):"",Zn=u=>na(u)||void 0,Yp=u=>u&&u.trim()?u.trim():"",eh=(u,l)=>{if(u==null||u==="")return"";if(typeof u=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(u)}catch{return String(u)}return na(u)},jc=({recommendations:u,theme:l,className:f="",style:d={},sessionId:k,triggerExposureUrl:M=!0,onDelegationConsent:L,onDelegationActivated:X,onStartDelegation:S,onRecommendationReport:y})=>{var $,E,W,N,P,H,V,ee,se;if(!u||u.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const oe=u[0],re=oe?.recommendation,ae=re?.creative,Q=oe?.tracking,U=oe?.delegation,he=oe?.recommendation_id||"",ce=re?.offerId||"",ye=ae?.brand_name||"",$e=ae?.headline||"",te=ae?.description||"",le=ae?.logo_url||"",xe=Q?.click_url||ae?.landing_page_url||"",Pe=Q?.exposure_url||"",C=re?.disclosure||"Sponsored",q=ae?.products||[],ie=q.slice(0,4),ke=q.length>1,Ee=(re?.format||"tail")==="bridge",p=U?.available===!0,I=Ee&&p,G=U?.brand_name||ye,Y="Talk to Agent",_e=Yp(ae?.cta_text),ve=!ke&&!!_e&&!!xe;if(!ye&&!$e&&!te)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:he}),null;const Ae=$e&&$e!==ye?$e:ye,Le=te,Ne=ye.trim().toLowerCase(),je=Ae.trim().toLowerCase(),We=!!ye&&Ne!==je,[Bt,ne]=b.useState(!1),[de,ge]=b.useState(!1),[Me,De]=b.useState(!1),[Z,Oe]=b.useState(null),K=b.useRef(null);b.useEffect(()=>()=>{K.current&&(K.current(!1),K.current=null)},[]);const He=be=>{var tt;be&&ge(!0),(tt=K.current)==null||tt.call(K,be),K.current=null,be||(ge(!1),ne(!1))},Ge=async()=>L?await L(oe):await new Promise(be=>{K.current=be,ne(!0)}),B=(be,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:he,productId:ce,clickUrl:xe,source:be}).catch(()=>{F.error(`[AdMesh] Failed to track ${be} click`)})},Ze=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=be=>{be.preventDefault(),be.stopPropagation(),!Z&&De(tt=>!tt)},un=async(be,tt)=>{if(be.preventDefault(),be.stopPropagation(),De(!1),Oe(tt),!!y)try{await y({recommendation:oe,recommendation_id:he,reason:tt,session_id:k})}catch(Zt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",Zt)}},it=()=>{ke||!xe||(B("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},Kt=be=>{ke||!xe||(be.key==="Enter"||be.key===" ")&&(be.preventDefault(),it())},Mn=async()=>{if(he&&k)try{const be=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${be}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:he,session_id:k,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(be){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",be)}},Ro=async be=>{if(be.preventDefault(),be.stopPropagation(),!oe||!I||(B("compact_tail_ad_delegation_cta"),!await Ge()))return;Mn();const tt=U!=null&&U.available?{recommendation_id:oe.recommendation_id,brand_id:Zn(U.brand_id),brand_name:Zn(U.brand_name||ae?.brand_name),mcp_endpoint:Zn(U.mcp_endpoint),eligibility_reason:Zn(U.eligibility_reason),delegate_reason:Zn(U.delegate_reason),session_goal:Zn(U.session_goal),desired_outcome_type:U.desired_outcome_type,required_user_inputs:Array.isArray(U.required_user_inputs)?U.required_user_inputs.filter(Zt=>typeof Zt=="string"):[],required_consent_types:Array.isArray(U.required_consent_types)?U.required_consent_types.filter(Zt=>typeof Zt=="string"):[],success_outcome:Zn(U.success_outcome),fallback_message:Zn(U.fallback_message),session_mode:Zn(U.session_mode),status:Zn(U.status),capabilities:U.capabilities||[],allowed_data_types:U.allowed_data_types||[],consent_requirements:U.consent_requirements||[],auth_model:Zn(U.auth_model),handoff_protocol:U.handoff_protocol&&typeof U.handoff_protocol=="object"?U.handoff_protocol:void 0,supported_actions:U.supported_actions||[],metadata:U.metadata&&typeof U.metadata=="object"?U.metadata:void 0,platform_response:oe}:null;if(X&&tt){try{await X(tt)}finally{ge(!1),ne(!1)}return}if(S){try{await S(oe)}finally{ge(!1),ne(!1)}return}ge(!1),ne(!1)},[bn,Hr]=b.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Nt=l?.surfaceColor||((E=($=l?.components)==null?void 0:$.card)==null?void 0:E.backgroundColor)||(Xt?"#111827":"#ffffff"),ot=l?.borderColor||((N=(W=l?.components)==null?void 0:W.card)==null?void 0:N.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),ft=((P=l?.shadows)==null?void 0:P.medium)||((V=(H=l?.components)==null?void 0:H.card)==null?void 0:V.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),Be="#2563eb",cn=Xt?"#9ca3af":"#6b7280",Vr=Xt?"#e5e7eb":"#374151",fn=Xt?"#f9fafb":"#0f172a",fe=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",pn="50px",xn=I||ve?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[I?m.jsx("button",{type:"button",onClick:Ro,style:{background:"none",border:"none",padding:0,color:Be,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ve?m.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:be=>B("compact_tail_ad_cta",be),style:{color:Be,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(rs,{productId:ce,recommendationId:he,exposureUrl:Pe,sessionId:k,triggerExposureUrl:M,className:`admesh-compact-tail-ad ${f}`,style:{all:"initial",boxSizing:"border-box",display:"block",fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",lineHeight:1.4,...d},children:[m.jsx("style",{children:`
192
+ `;function qp({value:s,onChange:l,onSend:m,onStop:c,onSuggestion:x,suggestions:A,registerSuggestion:N,open:G,onOpenChange:S,loading:y,analyzing:W,compact:C,expanded:V,suggestionPlacement:D="below",showLogo:R=!0,logoUrl:U,title:Q,placeholder:te,colors:le}){const re=v.useId(),ye=v.useRef(null),ae=v.useRef(null),q=v.useRef(null),[B,be]=v.useState({visibility:"hidden"}),se=G&&!y&&(W||A.length>0);v.useLayoutEffect(()=>{var ne;if(!se)return;const ie=()=>{var Fe,E;const $=(Fe=ye.current)==null?void 0:Fe.getBoundingClientRect();if(!$)return;const oe=((E=window.visualViewport)==null?void 0:E.height)??window.innerHeight,ke=document.documentElement.clientWidth,Me=oe-$.bottom-16,p=$.top-16,M=D==="above"?!(p<96&&Me>p):Me<96&&p>Me;be({position:"fixed",left:Math.max(8,Math.min($.left,ke-$.width-8)),width:Math.min($.width,ke-16),maxHeight:Math.max(40,Math.min(300,M?p:Me)),...M?{bottom:window.innerHeight-$.top+8}:{top:$.bottom+8},zIndex:2147483002})},xe=Fe=>{var E,$;const oe=Fe.target;!((E=ye.current)!=null&&E.contains(oe))&&!(($=q.current)!=null&&$.contains(oe))&&S(!1)};return ie(),window.addEventListener("resize",ie),window.addEventListener("scroll",ie,!0),(ne=window.visualViewport)==null||ne.addEventListener("resize",ie),document.addEventListener("pointerdown",xe),()=>{var Fe;window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0),(Fe=window.visualViewport)==null||Fe.removeEventListener("resize",ie),document.removeEventListener("pointerdown",xe)}},[se,D,S]);const ve=ne=>{var ie,xe;!((ie=ye.current)!=null&&ie.contains(ne))&&!((xe=q.current)!=null&&xe.contains(ne))&&S(!1)},Ve=()=>{!s.trim()||y||(S(!1),m())};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{ref:ye,className:"admesh-publisher-composer",onBlur:ne=>ve(ne.relatedTarget),onClick:ne=>{var ie;ne.target.closest("button, a")||((ie=ae.current)==null||ie.focus(),S(!0))},style:{display:"flex",alignItems:"center",gap:C?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${le.border}`,borderRadius:8,background:le.surface,cursor:"text",padding:C?"6px":"8px 8px 8px 12px"},children:[R&&!V&&f.jsx("div",{style:{width:C?24:32,height:C?24:32,display:"grid",placeItems:"center",flexShrink:0,color:le.accent},children:U?f.jsx("img",{src:U,alt:`${Q} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):f.jsx(as,{size:C?18:21,strokeWidth:1.5,"aria-label":Q})}),f.jsx("input",{ref:ae,type:"text",value:s,placeholder:te,"aria-label":"Ask the publisher assistant","aria-expanded":se,"aria-controls":se?re:void 0,onFocus:()=>S(!0),onChange:ne=>{l(ne.target.value),S(!0)},onKeyDown:ne=>{var ie,xe;ne.nativeEvent.isComposing||(ne.key==="Escape"&&(ne.preventDefault(),S(!1)),ne.key==="ArrowDown"&&(ne.preventDefault(),se?(xe=(ie=q.current)==null?void 0:ie.querySelector("button"))==null||xe.focus():S(!0)),ne.key==="Enter"&&(ne.preventDefault(),Ve()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:C?"6px 0":"10px 0",fontSize:C?13:15,color:le.text,background:"transparent"}}),f.jsxs("span",{style:{flexShrink:0,fontSize:C?8:9,lineHeight:1.3,color:le.muted,textAlign:"right",whiteSpace:"nowrap"},children:["powered by",f.jsx("br",{}),f.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"inherit",textDecoration:"underline",textUnderlineOffset:2,cursor:"pointer"},children:"AdMesh"})]}),f.jsx("button",{type:"button","aria-label":y?"Stop generating":"Send message",disabled:!y&&!s.trim(),onClick:y?c:Ve,style:{display:"grid",placeItems:"center",flexShrink:0,width:C?32:40,height:C?32:40,padding:0,margin:0,minWidth:0,border:"none",borderRadius:6,background:le.accent,color:le.accentText,cursor:"pointer",opacity:!y&&!s.trim()?.5:1},children:y?f.jsx(Bp,{size:14,fill:"currentColor",style:{flexShrink:0},"aria-hidden":"true"}):f.jsx(Lp,{size:18,style:{flexShrink:0},"aria-hidden":"true"})})]}),se&&os.createPortal(f.jsxs("div",{ref:q,id:re,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:ne=>ve(ne.relatedTarget),onKeyDown:ne=>{var ie,xe,Fe,E;if(ne.key==="Escape"&&(ne.preventDefault(),(ie=ae.current)==null||ie.focus(),S(!1)),ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const $=Array.from(((xe=q.current)==null?void 0:xe.querySelectorAll("button"))??[]),oe=$.indexOf(document.activeElement)+(ne.key==="ArrowDown"?1:-1);oe<0?(Fe=ae.current)==null||Fe.focus():(E=$[Math.min(oe,$.length-1)])==null||E.focus()}},style:{...B,"--publisher-accent":le.accent,padding:6,border:`1px solid ${le.border}`,borderRadius:10,background:le.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[f.jsx("style",{children:jc}),W&&!A.length?f.jsx("div",{role:"status",style:{padding:12,color:le.muted,fontSize:13},children:"Finding suggested questions\u2026"}):A.map(ne=>f.jsxs("button",{ref:N(ne.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":ne.is_sponsored?"true":void 0,onClick:()=>{S(!1),x(ne)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${ne.is_sponsored?le.accent:le.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:ne.is_sponsored?le.accent:le.surface,color:ne.is_sponsored?le.accentText:le.text},children:[f.jsx("span",{children:ne.text}),ne.is_sponsored&&f.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},ne.id))]}),document.body)]})}function Ac(s,l){if(!s)return null;try{const m=new URL(s,l);return["https:","http:"].includes(m.protocol)?m.href:null}catch{return null}}let Oo=!1;try{typeof globalThis.importMeta<"u"&&(to=globalThis.importMeta.env)!=null&&to.PROD&&(Oo=!0)}catch{}Oo||(Oo=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...s)=>{Oo||console.log(...s)},warn:(...s)=>{Oo||console.warn(...s)},error:(...s)=>{console.error(...s)},info:(...s)=>{Oo||console.info(...s)},debug:(...s)=>{Oo||console.debug(...s)}};function Vp(s,l,m){const c=s*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...m}}function Up(s){return s<768?"mobile":s<1024?"tablet":"desktop"}function Kp(s){const l=s.getBoundingClientRect(),m=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,x=l.height,A=l.width;if(x===0||A===0)return 0;const N=Math.max(0,l.top),G=Math.min(m,l.bottom),S=Math.max(0,l.left),y=Math.min(c,l.right),W=Math.max(0,G-N),C=Math.max(0,y-S),V=W*C,D=x*A;return D>0?V/D:0}function Nc(){const s=window.innerHeight,l=document.documentElement.scrollHeight,m=window.pageYOffset||document.documentElement.scrollTop,c=l-s;return c<=0?100:Math.min(100,m/c*100)}function Hp(s){const l=s.getBoundingClientRect(),m=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+m,left:l.left+c}}function Qp(s){const l=s.getBoundingClientRect(),m=Hp(s),c=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight,A=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:Up(c),viewportWidth:c,viewportHeight:x,adWidth:l.width,adHeight:l.height,adPositionTop:m.top,adPositionLeft:m.left,isDarkMode:A,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function Gp(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function Xp(s,l,m){return s>=m.visibilityThreshold&&l>=m.minimumDuration}function Dc(s=new Date){return s.toISOString()}function Zp(s){return s.length===0?0:s.reduce((l,m)=>l+m,0)/s.length}function Lc(s,l){let m;return function(...c){m||(s(...c),m=!0,setTimeout(()=>m=!1,l))}}let Jp={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},Yp=!1;function eh({productId:s,offerId:l,agentId:m,recommendationId:c,elementRef:x,config:A}){const N={...Jp,...A},G=v.useRef(Gp()),[S,y]=v.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Dc(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:N.enabled}),W=v.useRef(null),C=v.useRef(null),V=v.useRef(null),D=v.useRef(null),R=v.useRef(null),U=v.useRef([]),Q=v.useRef([]),te=v.useRef(null),le=v.useCallback(q=>{N.debug&&F.log(`[AdMesh Viewability] ${q}`)},[N.debug]),re=v.useCallback(async(q,B)=>{if(!(!N.enabled||Yp||!x.current||!W.current)&&(le(`Analytics disabled - skipping event: ${q}`),N.onEvent)){const be=Qp(x.current),se={eventType:q,timestamp:Dc(),sessionId:G.current,productId:s,offerId:l,agentId:m,recommendationId:c,timeMetrics:S.timeMetrics,engagementMetrics:S.engagementMetrics,contextMetrics:be,mrcStandards:W.current,isViewable:S.isViewable,metadata:B};N.onEvent(se)}},[N,s,l,m,c,x,S,le]),ye=v.useCallback(async()=>{Q.current.length!==0&&(le("Analytics disabled - clearing batch without sending"),Q.current=[],te.current&&(clearTimeout(te.current),te.current=null))},[le]),ae=v.useCallback(Lc(()=>{if(!x.current)return;const q=Kp(x.current),B=Date.now(),be=new Date(S.timeMetrics.loadedAt).getTime();y(se=>{const ve={...se};q>0&&U.current.push(q);const Ve=se.isVisible,ne=q>0;if(ne&&!Ve)C.current=B,ve.engagementMetrics.viewportEnterCount++,ve.timeMetrics.timeToFirstVisible||(ve.timeMetrics.timeToFirstVisible=B-be,ve.engagementMetrics.scrollDepthAtFirstVisible=Nc(),re("ad_visible"));else if(!ne&&Ve){if(C.current){const ie=B-C.current;ve.timeMetrics.totalVisibleDuration+=ie,C.current=null}ve.engagementMetrics.viewportExitCount++,re("ad_hidden")}else if(ne&&Ve&&C.current){const ie=B-C.current;ve.timeMetrics.totalVisibleDuration+=ie,C.current=B}if(ve.isVisible=ne,ve.visibilityPercentage=q,q>ve.engagementMetrics.maxVisibilityPercentage&&(ve.engagementMetrics.maxVisibilityPercentage=q),U.current.length>0&&(ve.engagementMetrics.averageVisibilityPercentage=Zp(U.current)),W.current){const ie=se.isViewable,xe=Xp(q,ve.timeMetrics.totalVisibleDuration,W.current);if(xe&&!ie)ve.isViewable=!0,ve.timeMetrics.timeToViewable=B-be,V.current=B,re("ad_viewable");else if(xe&&ie&&V.current){const Fe=B-V.current;ve.timeMetrics.totalViewableDuration+=Fe,V.current=B}}return ve.engagementMetrics.currentScrollDepth=Nc(),ve})},100),[x,S.timeMetrics.loadedAt,re]);return v.useEffect(()=>{if(!x.current)return;const q=x.current.getBoundingClientRect();W.current=Vp(q.width,q.height,N.mrcStandards),le("Initialized MRC standards"),re("ad_loaded")},[x,N.mrcStandards,le,re]),v.useEffect(()=>{if(!N.enabled||!x.current)return;const q=new IntersectionObserver(B=>{B.forEach(()=>{ae()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return q.observe(x.current),()=>{q.disconnect()}},[N.enabled,x,ae]),v.useEffect(()=>{if(!N.enabled)return;const q=Lc(()=>{ae()},100);return window.addEventListener("scroll",q,{passive:!0}),()=>window.removeEventListener("scroll",q)},[N.enabled,ae]),v.useEffect(()=>{if(!N.enabled||!x.current)return;const q=x.current,B=()=>{D.current=Date.now(),y(se=>({...se,engagementMetrics:{...se.engagementMetrics,hoverCount:se.engagementMetrics.hoverCount+1}})),re("ad_hover_start")},be=()=>{if(D.current){const se=Date.now()-D.current;y(ve=>({...ve,timeMetrics:{...ve.timeMetrics,totalHoverDuration:ve.timeMetrics.totalHoverDuration+se}})),D.current=null,re("ad_hover_end",{hoverDuration:se})}};return q.addEventListener("mouseenter",B),q.addEventListener("mouseleave",be),()=>{q.removeEventListener("mouseenter",B),q.removeEventListener("mouseleave",be)}},[N.enabled,x,re]),v.useEffect(()=>{if(!N.enabled||!x.current)return;const q=x.current,B=()=>{R.current=Date.now(),re("ad_focus")},be=()=>{if(R.current){const se=Date.now()-R.current;y(ve=>({...ve,timeMetrics:{...ve.timeMetrics,totalFocusDuration:ve.timeMetrics.totalFocusDuration+se}})),R.current=null,re("ad_blur",{focusDuration:se})}};return q.addEventListener("focus",B),q.addEventListener("blur",be),()=>{q.removeEventListener("focus",B),q.removeEventListener("blur",be)}},[N.enabled,x,re]),v.useEffect(()=>{if(!N.enabled||!x.current)return;const q=x.current,B=()=>{y(be=>({...be,engagementMetrics:{...be.engagementMetrics,wasClicked:!0}})),re("ad_click")};return q.addEventListener("click",B),()=>{q.removeEventListener("click",B)}},[N.enabled,x,re]),v.useEffect(()=>()=>{const q=Date.now(),B=new Date(S.timeMetrics.loadedAt).getTime(),be=q-B;y(se=>({...se,timeMetrics:{...se.timeMetrics,sessionDuration:be}})),re("ad_unloaded",{sessionDuration:be}),ye()},[]),S}const ls=({productId:s,offerId:l,agentId:m,recommendationId:c,exposureUrl:x,sessionId:A,triggerExposureUrl:N=!0,children:G,config:S,className:y,style:W,onViewabilityChange:C,onVisible:V,onViewable:D,onClick:R})=>{const U=v.useRef(null),Q=v.useRef(!1),te=eh({productId:s,offerId:l,agentId:m,recommendationId:c,elementRef:U,config:S}),le=v.useRef(te.isViewable);v.useEffect(()=>{Q.current=!1,le.current=!1},[x,c,A]),v.useEffect(()=>{te.isViewable!==le.current&&(le.current=te.isViewable,C&&C(te.isViewable),te.isViewable&&D&&D(),te.isViewable&&!Q.current&&N&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:x?"present":"MISSING",sessionId:A?"present":"MISSING",recommendationId:c}),x&&A?(Q.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",x),fetch(x,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ae=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ae),Q.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!x,hasSessionId:!!A})))},[te.isViewable,C,D,x,A,c,N]);const re=v.useRef(te.isVisible);v.useEffect(()=>{te.isVisible!==re.current&&(re.current=te.isVisible,te.isVisible&&V&&V())},[te.isVisible,V]);const ye=()=>{R&&R()};return f.jsx("div",{ref:U,className:y,style:W,onClick:ye,"data-admesh-viewability-tracker":!0,"data-recommendation-id":c,"data-is-viewable":te.isViewable,"data-is-visible":te.isVisible,"data-visibility-percentage":te.visibilityPercentage.toFixed(2),children:G})};ls.displayName="AdMeshViewabilityTracker";const Fc=s=>{try{return new URL(s),!0}catch{return!1}},la=s=>typeof s=="string"?s.trim():typeof s=="number"?String(s):"",Xn=s=>la(s)||void 0,th=s=>s&&s.trim()?s.trim():"",nh=(s,l)=>{if(s==null||s==="")return"";if(typeof s=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(s)}catch{return String(s)}return la(s)},Oc=({recommendations:s,theme:l,className:m="",style:c={},sessionId:x,triggerExposureUrl:A=!0,onDelegationConsent:N,onDelegationActivated:G,onStartDelegation:S,onRecommendationReport:y})=>{var W,C,V,D,R,U,Q,te,le;if(!s||s.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const re=s[0],ye=re?.recommendation,ae=ye?.creative,q=re?.tracking,B=re?.delegation,be=re?.recommendation_id||"",se=ye?.offerId||"",ve=ae?.brand_name||"",Ve=ae?.headline||"",ne=ae?.description||"",ie=ae?.logo_url||"",xe=q?.click_url||ae?.landing_page_url||"",Fe=q?.exposure_url||"",E=ye?.disclosure||"Sponsored",$=ae?.products||[],oe=$.slice(0,4),ke=$.length>1,Me=(ye?.format||"tail")==="bridge",p=B?.available===!0,M=Me&&p,H=B?.brand_name||ve,Y="Talk to Agent",Se=th(ae?.cta_text),_e=!ke&&!!Se&&!!xe;if(!ve&&!Ve&&!ne)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:be}),null;const ze=Ve&&Ve!==ve?Ve:ve,Re=ne,et=ve.trim().toLowerCase(),Be=ze.trim().toLowerCase(),Oe=!!ve&&et!==Be,[Tt,ee]=v.useState(!1),[ue,fe]=v.useState(!1),[Pe,De]=v.useState(!1),[_t,Rt]=v.useState(null),X=v.useRef(null);v.useEffect(()=>()=>{X.current&&(X.current(!1),X.current=null)},[]);const Ge=de=>{var tt;de&&fe(!0),(tt=X.current)==null||tt.call(X,de),X.current=null,de||(fe(!1),ee(!1))},Z=async()=>N?await N(re):await new Promise(de=>{X.current=de,ee(!0)}),K=(de,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:be,productId:se,clickUrl:xe,source:de}).catch(()=>{F.error(`[AdMesh] Failed to track ${de} click`)})},Ie=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Le=de=>{de.preventDefault(),de.stopPropagation(),!_t&&De(tt=>!tt)},Sn=async(de,tt)=>{if(de.preventDefault(),de.stopPropagation(),De(!1),Rt(tt),!!y)try{await y({recommendation:re,recommendation_id:be,reason:tt,session_id:x})}catch(mn){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",mn)}},vt=()=>{ke||!xe||(K("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},dn=de=>{ke||!xe||(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),vt())},it=async()=>{if(be&&x)try{const de=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${de}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:be,session_id:x,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(de){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",de)}},Xt=async de=>{if(de.preventDefault(),de.stopPropagation(),!re||!M||(K("compact_tail_ad_delegation_cta"),!await Z()))return;it();const tt=B!=null&&B.available?{recommendation_id:re.recommendation_id,brand_id:Xn(B.brand_id),brand_name:Xn(B.brand_name||ae?.brand_name),mcp_endpoint:Xn(B.mcp_endpoint),eligibility_reason:Xn(B.eligibility_reason),delegate_reason:Xn(B.delegate_reason),session_goal:Xn(B.session_goal),desired_outcome_type:B.desired_outcome_type,required_user_inputs:Array.isArray(B.required_user_inputs)?B.required_user_inputs.filter(mn=>typeof mn=="string"):[],required_consent_types:Array.isArray(B.required_consent_types)?B.required_consent_types.filter(mn=>typeof mn=="string"):[],success_outcome:Xn(B.success_outcome),fallback_message:Xn(B.fallback_message),session_mode:Xn(B.session_mode),status:Xn(B.status),capabilities:B.capabilities||[],allowed_data_types:B.allowed_data_types||[],consent_requirements:B.consent_requirements||[],auth_model:Xn(B.auth_model),handoff_protocol:B.handoff_protocol&&typeof B.handoff_protocol=="object"?B.handoff_protocol:void 0,supported_actions:B.supported_actions||[],metadata:B.metadata&&typeof B.metadata=="object"?B.metadata:void 0,platform_response:re}:null;if(G&&tt){try{await G(tt)}finally{fe(!1),ee(!1)}return}if(S){try{await S(re)}finally{fe(!1),ee(!1)}return}fe(!1),ee(!1)},[Dt,no]=v.useState(!1),[cr,Zt]=v.useState(()=>{var de;return typeof window<"u"&&!!((de=window.matchMedia)!=null&&de.call(window,"(prefers-color-scheme: dark)").matches)});v.useEffect(()=>{if(l!=null&&l.mode||typeof window>"u"||!window.matchMedia)return;const de=window.matchMedia("(prefers-color-scheme: dark)"),tt=()=>Zt(de.matches);return tt(),de.addEventListener("change",tt),()=>de.removeEventListener("change",tt)},[l?.mode]);const Ue=l!=null&&l.mode?l.mode==="dark":cr,ot=l?.surfaceColor||((C=(W=l?.components)==null?void 0:W.card)==null?void 0:C.backgroundColor)||(Ue?"#111827":"#ffffff"),Ke=l?.borderColor||((D=(V=l?.components)==null?void 0:V.card)==null?void 0:D.borderColor)||(Ue?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),Zn=((R=l?.shadows)==null?void 0:R.medium)||((Q=(U=l?.components)==null?void 0:U.card)==null?void 0:Q.boxShadow)||(Ue?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),Jn=l?.primaryColor||(Ue?"#60a5fa":"#2563eb"),fn=l?.textSecondaryColor||(Ue?"#9ca3af":"#6b7280"),pe=l?.textColor||(Ue?"#e5e7eb":"#374151"),Ht=l?.textColor||(Ue?"#f9fafb":"#0f172a"),Jt=Ue?"rgba(255, 255, 255, 0.04)":"#f8fafc",Yn="50px",Cr=M||_e?f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[M?f.jsx("button",{type:"button",onClick:Xt,style:{background:"none",border:"none",padding:0,color:Jn,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,_e?f.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:de=>K("compact_tail_ad_cta",de),style:{color:Jn,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:Se}):null]}):null;return f.jsxs(ls,{productId:se,recommendationId:be,exposureUrl:Fe,sessionId:x,triggerExposureUrl:A,className:`admesh-compact-tail-ad ${m}`,style:{all:"initial",boxSizing:"border-box",display:"block",fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",lineHeight:1.4,...c},children:[f.jsx("style",{children:`
193
193
  .admesh-compact-tail-ad,
194
194
  .admesh-compact-tail-ad * {
195
195
  box-sizing: border-box;
@@ -242,9 +242,9 @@ Error generating stack: `+r.message+`
242
242
  min-height: 34px;
243
243
  }
244
244
  }
245
- `}),m.jsxs("div",{role:!ke&&xe?"link":void 0,tabIndex:!ke&&xe?0:void 0,style:{display:"flex",flexDirection:"column",gap:"10px",padding:"12px",borderRadius:l?.borderRadius||((se=(ee=l?.components)==null?void 0:ee.card)==null?void 0:se.borderRadius)||"14px",border:`1px solid ${ot}`,background:Nt,boxShadow:ft,minWidth:0,cursor:!ke&&xe?"pointer":void 0},onClick:it,onKeyDown:Kt,children:[m.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start",minWidth:0},children:[m.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",flexShrink:0,overflow:"hidden",background:Xt?"#1f2937":"#eff6ff",display:"flex",alignItems:"center",justifyContent:"center"},children:!bn&&le&&Nc(le)?m.jsx("img",{src:le,alt:`${ye} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>Hr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:cn},children:(ye||"A").charAt(0).toUpperCase()})}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsxs("div",{className:"admesh-compact-meta-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"4px"},children:[m.jsx("div",{className:"admesh-compact-line-clamp-1",style:{fontSize:"11px",color:cn},children:We?ye:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:cn,textTransform:"uppercase",letterSpacing:"0.08em"},children:C})]}),!ke&&m.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:fn,marginBottom:"4px"},title:Ae,children:Ae}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Vr},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:ie.map(be=>{const tt=na(be.product_name)||"Product",Zt=na(be.product_link)||na(be.product_url)||xe||"#",Mo=eh(be.product_price,be.product_currency),Yn=na(be.product_image_url),dr=Yn&&Nc(Yn)?Yn:"",Do=Zt!=="#";return m.jsx("a",{href:Zt,target:Do?"_blank":void 0,rel:Do?"noopener noreferrer":void 0,onClick:Qr=>B(`compact_tail_ad_product_${be.product_id||"item"}`,Qr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${ot}`,borderRadius:"12px",background:fe,padding:"8px",flexShrink:0},children:m.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[m.jsx("div",{style:{width:"34px",height:"34px",borderRadius:"8px",overflow:"hidden",flexShrink:0,background:Xt?"#374151":"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",color:cn,fontSize:"12px",fontWeight:700},children:dr?m.jsx("img",{src:dr,alt:tt,style:{width:"100%",height:"100%",objectFit:"cover"}}):tt.charAt(0).toUpperCase()}),m.jsxs("div",{style:{minWidth:0,flex:1},children:[m.jsx("div",{style:{fontSize:"12px",lineHeight:1.25,fontWeight:600,color:fn,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:tt,children:tt}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:Mo&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:fn},children:Mo})})]})]})},be.product_id||`${he}-${tt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:pn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:xn}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&q.length>ie.length?m.jsxs("span",{style:{fontSize:"10px",color:cn},children:["+",q.length-ie.length," more"]}):null,m.jsx("button",{type:"button","aria-label":Z?"Recommendation reported":"Report recommendation",title:Z?"Reported":"Report recommendation",disabled:!!Z,onClick:Fe,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${ot}`,background:Z?fe:Nt,color:Z?Be:cn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:Z?"default":"pointer",flexShrink:0},children:m.jsx(Fp,{size:13})})]})]}),Me?m.jsx("div",{className:"admesh-compact-report-panel",onClick:be=>be.stopPropagation(),style:{marginLeft:ke?0:pn,border:`1px solid ${ot}`,borderRadius:"12px",background:fe,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Ze.map(be=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>un(tt,be.value),style:{borderRadius:"999px",border:`1px solid ${ot}`,background:Nt,color:fn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:be.label},be.value))}):null,Z?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:pn,fontSize:"11px",color:cn},children:"Thanks for reporting this recommendation."}):null,Bt?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${ot}`,borderRadius:"12px",background:fe,padding:"12px",display:"flex",flexDirection:"column",gap:"10px"},children:[m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:Be},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:fn,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Vr},children:"The agent will only use the details you choose to share for this request."})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[m.jsx("button",{type:"button",disabled:de,onClick:be=>{be.preventDefault(),be.stopPropagation(),!de&&He(!1)},style:{borderRadius:"10px",border:`1px solid ${ot}`,background:Nt,color:fn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:de?"not-allowed":"pointer",opacity:de?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:de,onClick:be=>{be.preventDefault(),be.stopPropagation(),!de&&He(!0)},style:{borderRadius:"10px",border:"none",background:Be,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:de?"wait":"pointer",opacity:de?.86:1},children:de?"Connecting...":"Allow agent"})]})]}):null]})]})},th=({recommendations:u,theme:l,className:f,style:d,sessionId:k,onDelegationConsent:M,onDelegationActivated:L,onStartDelegation:X})=>{const S=u.filter($=>$&&typeof $=="object"&&typeof $.recommendation_id=="string"&&$.recommendation_id.length>0);if(!S||S.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${S.length} valid recommendations`);const y=()=>{var $;if(S.length>0){const E=S[0],W=($=E.recommendation)==null?void 0:$.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:W,recommendationKeys:Object.keys(E||{})}),(W==="product_card"||W==="weave"||W==="bridge")&&F.warn(`[AdMeshLayout] ${W} format requested, falling back to tail for canonical render payload`)}return m.jsx(jc,{recommendations:S,theme:l,sessionId:k,onDelegationConsent:M,onDelegationActivated:L,onStartDelegation:X})};return m.jsx("div",{className:`admesh-layout ${f}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...d},children:y()})};class nh{constructor(l){qr(this,"firedExposures",new Set),qr(this,"debug",!1),qr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,f,d){const k=`${d}_${f}`;if(this.firedExposures.has(k)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(k);try{fetch(l,{method:"GET",keepalive:!0}).catch(()=>{this.debug&&F.warn("[Tracker] Failed to fire exposure")}),this.debug&&F.log("[Tracker] Fired MRC-compliant exposure")}catch{this.debug&&F.error("[Tracker] Error firing exposure")}}async fireExposureWithMRCCompliance(l,f,d,k){const M=`${d}_${f}`;if(this.firedExposures.has(M)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(L=>{let X=null,S=null;const y=new IntersectionObserver(E=>{E.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?X===null&&(X=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),S=setTimeout(()=>{this.fireExposure(l,f,d),y.disconnect(),L()},this.mrcThreshold.minimumDurationMs)):X!==null&&(S&&(clearTimeout(S),S=null),X=null,this.debug&&F.log("[Tracker] Ad visibility dropped below MRC threshold"))})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});y.observe(k);const $=setTimeout(()=>{y.disconnect(),S&&clearTimeout(S),L()},3e4);k.__admeshTrackerCleanup=()=>{y.disconnect(),S&&clearTimeout(S),clearTimeout($)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,f,d){this.fireExposure(l,f,d)}fireFollowupEngagement(l,f,d){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:d})}).catch(k=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",k)}).then(()=>{})}}function rh(u){const l=u.split("/").filter(Boolean),f=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return f?f.replace(/\b\w/g,d=>d.toUpperCase()):"This page"}function oh(){var u;try{console.log("[AdMesh] Starting direct headings extraction...");const l=S=>S.replace(/\s+/g," ").trim(),f=()=>{var S;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],$=["script","style","noscript","svg","canvas","iframe","nav","header","footer","aside",'[aria-hidden="true"]',"[data-admesh-ignore]",".admesh-publisher-assistant-root",".admesh-publisher-assistant-reactMount",".admesh-publisher-assistant-floating",".admesh-publisher-assistant-inline"].join(","),E=(((S=y.map(N=>document.querySelector(N)).filter(N=>!!N).map(N=>{const P=N.cloneNode(!0);P.querySelectorAll($).forEach(V=>V.remove());const H=l(P.textContent||"");return{element:N,text:H}}).filter(N=>N.text.length>=200).sort((N,P)=>P.text.length-N.text.length)[0])==null?void 0:S.element)||document.body).cloneNode(!0);E.querySelectorAll($).forEach(N=>N.remove());const W=Array.from(E.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(N=>l(N.textContent||"")).filter(N=>N.length>=24);return(W.length>0?W.join(`
246
- `):l(E.textContent||"")).slice(0,6e3)},d=rh(window.location.pathname||"/"),k=l(document.title||"")||d,M=(()=>{const S=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach($=>{const E=l($.textContent||"");E.length>0&&S.push(E)}),S})(),L=M.length>0?M:[k||d],X={title:k,headings:L,article_text:f(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:X.title,headingsCount:X.headings.length,articleTextLength:((u=X.article_text)==null?void 0:u.length)||0,domain:X.domain}),X}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function ah(u){return!!(u&&typeof u=="object"&&"recommendation_id"in u&&"status"in u)}function ih(u){var l,f,d,k,M,L,X,S,y,$,E;if(!u||typeof u!="object")return;if(ah(u))return u;const W=u;if(!W.recommendation_id)return;const N=(W.products||[]).map(P=>{var H,V;return{product_id:P.product_id||"",product_link:P.product_link||P.product_click_url||W.click_url||W.url||"",product_name:P.product_name||W.title||((H=W.creative_input)==null?void 0:H.product_name)||"",product_description:P.product_description||"",product_price:P.product_price??void 0,product_discount:P.product_discount??void 0,product_currency:P.product_currency,product_discount_type:P.product_discount_type,product_cta_label:P.product_cta_label||((V=W.creative_input)==null?void 0:V.cta_label),product_image_url:P.product_image_url,product_features:P.product_features}});return{spec_version:"1.0",recommendation_id:W.recommendation_id,timestamp:new Date().toISOString(),status:"generated",ttl_ms:3e5,recommendation:{format:W.preferred_format||"tail",disclosure:"Sponsored",creative:{brand_name:((l=W.creative_input)==null?void 0:l.brand_name)||"",headline:W.title||((f=W.creative_input)==null?void 0:f.product_name)||"",description:((d=W.creative_input)==null?void 0:d.short_description)||((k=W.creative_input)==null?void 0:k.long_description)||"",cta_text:((M=W.creative_input)==null?void 0:M.cta_label)||((L=N[0])==null?void 0:L.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(S=(X=W.creative_input)==null?void 0:X.assets)==null?void 0:S.logo_url,image_urls:(($=(y=W.creative_input)==null?void 0:y.assets)==null?void 0:$.image_urls)||[],landing_page_url:W.url||W.click_url||((E=W.creative_input)==null?void 0:E.cta_url)||"",products:N}},tracking:{exposure_url:W.exposure_url,click_url:W.click_url,followup_exposure_url:W.followup_exposure_url,followup_engagement_url:W.followup_engagement_url}}}function lh(u){return{...u,suggestions:(u.suggestions||[]).map(l=>({...l,recommendation:ih(l.recommendation)}))}}function Tc(u){try{const l=new URL(u).pathname.split("/").filter(f=>f.length>0);return l[l.length-1]||void 0}catch{return}}async function sh(u,l){var f,d,k,M,L;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:u.url});const X=Array.isArray(u.headings)?u.headings:[],S=(f=Tc(u.url))==null?void 0:f.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=S?S.replace(/\b\w/g,se=>se.toUpperCase()):void 0,$=l.apiKey.toLowerCase().startsWith("pub_")?Tc(u.url):void 0,E=l.extension?"extension":"admesh_ui_sdk",W=(u.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),N={url:u.url,title:u.title||void 0,headings:X.length>0?X:y?[y]:void 0,article_text:((d=u.article_text)==null?void 0:d.trim())||void 0,domain:W,article_slug:$,agent_id:void 0,cpx_floor:void 0,source:E,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:N.url,titleLength:((k=N.title)==null?void 0:k.length)||0,headingsCount:((M=N.headings)==null?void 0:M.length)||0,articleTextLength:((L=N.article_text)==null?void 0:L.length)||0,domain:N.domain,article_slug:N.article_slug,source:N.source,has_user_id:!!N.user_id});const P=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",P);const H=await fetch(P,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(N)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:H.status,statusText:H.statusText,ok:H.ok}),!H.ok){const se=await H.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:H.status,statusText:H.statusText,errorText:se}),new Error(`ACIE API error: ${H.status} - ${se}`)}const V=await H.json(),ee=lh(V);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:u.url,suggestionsCount:ee.suggestions.length}),ee}catch(X){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",X),null}}async function uh(u,l){var f,d;const k=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),M=new URLSearchParams({url:u.trim()});(f=l.agentDisplayId)!=null&&f.trim()&&M.set("agent_display_id",l.agentDisplayId.trim()),(d=l.publisherId)!=null&&d.trim()&&M.set("publisher_id",l.publisherId.trim());const L=await fetch(`${k}/publisher-assistant/page-context?${M.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!L.ok){const X=await L.text().catch(()=>"");throw new Error(`Page context request failed (${L.status}): ${X||L.statusText}`)}return await L.json()}function ch(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function dh(){var u;if(typeof window>"u")return null;try{const l=(u=window.location.href)==null?void 0:u.trim();if(Lc(l))return l}catch{return null}return null}function Lc(u){const l=u?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const f=new URL(l);return f.protocol==="http:"||f.protocol==="https:"}catch{return!1}}function mh(u){try{const l=new URL(u),f=l.pathname.split("/").filter(Boolean),d=(f[f.length-1]||f[f.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,k=>k.toUpperCase()):l.hostname}catch{return"This page"}}function Fc(u){const l=new URL(u),f=mh(u);return{title:f,headings:[f],article_text:`Article URL: ${u}
247
- Article topic inferred from URL path: ${f}`,url:u,domain:l.hostname,extracted_at:new Date().toISOString()}}const fh=6e4,$c=3;function ph(u){const l=dh();if(l)return l;const f=u?.trim();return Lc(f)?f:null}const Oc=({apiKey:u,skipSdkInitialization:l=!1,sessionId:f,extension:d,theme:k,apiBaseUrl:M,language:L,location:X,userId:S,model:y,messages:$,pageContext:E,articleUrl:W,contextMode:N="auto",agentDisplayId:P,children:H})=>{const[V,ee]=b.useState(null),[se,oe]=b.useState(new Set),[re,ae]=b.useState(new Map),[Q,U]=b.useState(null),[he,ce]=b.useState([]),[ye,$e]=b.useState(!1),[te,le]=b.useState(null),[xe,Pe]=b.useState(!1),C=b.useRef(!1),q=b.useRef(0),ie=b.useRef(null),ke=b.useRef(null);ke.current=Q;const Ee=!!E||N==="ad-slot"||N==="auto"&&(!!(W!=null&&W.trim())||ch()),p=b.useCallback(async()=>{if(E)return E;if(!Ee)return oh();const ne=ph(W);if(!ne)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),le("Article URL is required for ad-slot context"),null;if(!u)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Fc(ne);try{Pe(!0);const de=await uh(ne,{apiKey:u,apiBaseUrl:M||"https://api.useadmesh.com",agentDisplayId:P});return F.log("[AdMeshProvider] Page context resolved",{source:de.source,cache_hit:de.cache_hit,domain:de.context.domain}),de.context}catch(de){return F.error("[AdMeshProvider] Failed to fetch page context:",de),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Fc(ne)}finally{Pe(!1)}},[P,M,u,W,E,Ee]),I=b.useCallback((ne,de)=>{const ge=ne.filter(Me=>!Me.is_sponsored).slice(0,3);return[de,...ge]},[]),G=b.useCallback((ne,de)=>{const ge=ne.find(De=>De.is_sponsored),Me=de.filter(De=>!De.is_sponsored).slice(0,3);return ge?[ge,...Me]:Me},[]);b.useEffect(()=>{if(!f||f.trim()===""){F.error("[AdMeshProvider] sessionId is required and must be provided by the platform. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}F.log("[AdMeshProvider] \u2705 Session ID available:",f)},[f]),b.useEffect(()=>{if(!l){if(!u){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!f||f.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ne=new qc({apiKey:u,theme:k,apiBaseUrl:M,extension:d});ee(ne),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",f),M&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ne){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ne)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[u,k,M,f,d,l]);const Y=b.useCallback(async ne=>{var de;if(!u){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(d)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!u.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{$e(!0),le(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const ge=ne??await p();if(!ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),le("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:ge.title,headingsCount:ge.headings.length,articleTextLength:((de=ge.article_text)==null?void 0:de.length)||0,domain:ge.domain});const Me=await sh(ge,{apiKey:u,apiBaseUrl:M||"https://api.useadmesh.com",extension:d,userId:S});Me?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Me.suggestions.length,suggestions:(Me.suggestions||[]).map(De=>{var Z;return{id:De.id,text:De.text,is_sponsored:De.is_sponsored,recommendationId:((Z=De.recommendation)==null?void 0:Z.recommendation_id)||null}})}),ce(De=>G(De,Me.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),le("Intent analysis failed"),ce(De=>De.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),De):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(ge){F.error("[AdMeshProvider] Error in intent analysis:",ge),le("Intent analysis error"),ce(Me=>Me.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Me):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{$e(!1)}},[u,M,d,S,G,p]),_e=b.useCallback(async ne=>{var de,ge,Me,De,Z,Oe;if(!V||!u||!u.toLowerCase().startsWith("pub_"))return;const K=ne??await p();if(!K){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const He=((ge=(de=K.headings)==null?void 0:de[0])==null?void 0:ge.trim())||((Me=K.title)==null?void 0:Me.trim());if(!He){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping sponsored suggestion prefetch: no usable page query");return}try{F.log("[AdMeshProvider] \u{1F504} Prefetching sponsored suggestion from /aip/context...");const Ge=await V.fetchPlatformResponse({query:He,sessionId:f,messageId:qc.createMessageId(f),platformSurface:"conversation",model:y,messages:[],language:L,location:X,userId:S}),B=(Oe=(Z=(De=Ge.recommendation)==null?void 0:De.creative)==null?void 0:Z.follow_up_suggestion)==null?void 0:Oe.trim(),Ze=Ge.recommendation_id;if(!B||!Ze){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Ze,text:B,type:"action",is_sponsored:!0,recommendation:Ge,metadata:{source:"aip_context_prefetch",recommendation_id:Ze}};ce(un=>I(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Ze,suggestionText:B})}catch(Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ge)}},[u,L,X,y,V,f,S,I,p]),ve=b.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);b.useEffect(()=>{!V||C.current||(C.current=!0,(async()=>{const ne=await p();await Promise.allSettled([_e(ne),Y(ne)])})())},[V,Y,_e,p]);const Ae=b.useCallback(ne=>{if(!ne||ne.status!=="active")return!1;const de=Date.parse(ne.expires_at);return Number.isNaN(de)?!1:de>Date.now()},[]),Le=b.useCallback(async(ne,de,ge,Me)=>{const De=Me??Q;if(!De||!V){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ne,eventType:de,hasSession:!!De,hasSdk:!!V});return}const Z=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ne,eventType:de,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,sessionId:De.session_id});const Oe=await fetch(`${V.getApiBaseUrl()}${ne}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({delegation_session_id:De.delegation_session_id,recommendation_id:De.recommendation_id,session_id:De.session_id,event_type:de,timestamp:Z,metadata:ge||{}})});if(!Oe.ok){const Ge=await Oe.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ne,eventType:de,status:Oe.status,errorBody:Ge,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id}),new Error(`Delegation event failed (${Oe.status}): ${Ge}`)}const K=await Oe.json(),He=K?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ne,eventType:de,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,returnedStatus:He?.status||K?.status}),He&&U(He)},[Q,u,V]),Ne=b.useCallback(()=>{q.current=0},[]),je=b.useCallback(async(ne="user_stopped",de)=>{const ge=Q;if(!ge){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ne,recommendationId:ge.recommendation_id,delegationSessionId:ge.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ne,...de||{}},ge),await V?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:ge.session_id,recommendation_id:ge.recommendation_id,delegation_session_id:ge.delegation_session_id,brand_name:ge.brand_name,status:"stopped",metadata:{reason:ne,...de||{}}}).catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Me)}),q.current=0,ie.current=null,U(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,V]),We=b.useCallback(async(ne="turn_completed",de)=>{ne==="turn_started"&&Ne(),await Le("/aip/delegation/activity",ne,de)},[Le,Ne]);b.useEffect(()=>{const ne=Q?.delegation_session_id??null;ne!==ie.current&&(ie.current=ne,q.current=0)},[Q?.delegation_session_id]),b.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!V)return;const ne=ke.current;if(!ne||!Ae(ne)){U(ge=>ge?{...ge,status:"expired"}:null);return}const de=window.setInterval(()=>{const ge=ke.current;if(!(!ge||!Ae(ge))){if(q.current+=1,q.current>=$c){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:ge.delegation_session_id,heartbeatsSinceLastUserTurn:q.current,idleHeartbeatLimit:$c}),je("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:q.current}).catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Me)});return}Le("/aip/delegation/heartbeat","heartbeat").catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Me)})}},fh);return()=>{window.clearInterval(de)}},[Q?.delegation_session_id,Ae,Le,V,je]);const Bt={sdk:V,apiKey:u,sessionId:f,theme:k,language:L,location:X,userId:S,model:y,messages:$,processedMessageIds:se,recommendationResults:re,activeDelegationSession:Q,suggestions:he,isAnalyzingIntent:ye||xe,intentError:te,markMessageAsProcessed:ne=>{oe(de=>{const ge=new Set(de);return ge.add(ne),ge})},isMessageProcessed:ne=>se.has(ne),setRecommendationResult:(ne,de)=>{ae(ge=>{const Me=new Map(ge);return Me.set(ne,de),Me}),oe(ge=>{const Me=new Set(ge);return Me.add(ne),Me})},getRecommendationResult:ne=>re.get(ne),hasRecommendationResult:ne=>re.has(ne),setActiveDelegationSession:ne=>{U(ne)},getActiveDelegationSession:()=>Ae(Q)?Q:null,hasActiveDelegationSession:()=>Ae(Q),refreshDelegationActivity:We,stopDelegationSession:je,retryIntentAnalysis:ve};return m.jsx(Wc.Provider,{value:Bt,children:H})};class hh{constructor(){qr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const f=l.response.recommendations||[];if(f.length===0){F.log("[AdMeshRenderer] \u26A0\uFE0F No recommendations to render - skipping render to avoid occupying space");return}const d=document.getElementById(l.containerId);if(!d)throw F.error("[AdMeshRenderer] Container not found"),new Error(`Container with ID "${l.containerId}" not found`);F.log("[AdMeshRenderer] \u2705 Container ready");const k=this.roots.get(l.containerId);k&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),k.unmount(),this.roots.delete(l.containerId)),d.innerHTML="";const M=xc.createRoot(d);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),M.render(m.jsx(Oc,{apiKey:l.apiKey,sessionId:l.sessionId,theme:l.theme,apiBaseUrl:l.apiBaseUrl,language:l.language,location:l.location,userId:l.userId,model:l.model,messages:l.messages,children:m.jsx(th,{recommendations:f,theme:l.theme,sessionId:l.sessionId,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation})})),d.style.display="block",F.log("[AdMeshRenderer] \u2705 Recommendations rendered successfully"),this.roots.set(l.containerId,M)}catch(f){throw F.error("[AdMeshRenderer] Error rendering recommendations"),f}}unmount(l){const f=this.roots.get(l);if(f){f.unmount(),this.roots.delete(l);const d=document.getElementById(l);d&&(d.style.display="none")}}unmountAll(){for(const[,l]of this.roots.entries())l.unmount();this.roots.clear()}}const gh=u=>{if(typeof u!="string")return;const l=u.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},Uc=class Eo{constructor(l){if(qr(this,"config"),qr(this,"apiBaseUrl"),qr(this,"renderer",null),qr(this,"tracker",null),!l.apiKey)throw new Error("AdMeshSDK: apiKey is required");this.config={apiKey:l.apiKey,theme:l.theme,apiBaseUrl:l.apiBaseUrl,extension:l.extension,extensionSourceDomain:l.extensionSourceDomain,userId:l.userId},this.apiBaseUrl=l.apiBaseUrl||typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com"}getApiBaseUrl(){return this.apiBaseUrl}static buildPlatformResponseCacheKey(l,f){return`${l}::${f}`}getExtensionSourceDomain(){var l,f;const d=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(d)return d.toLowerCase();if(typeof window<"u"&&(f=window.location)!=null&&f.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),f=Math.random().toString(36).substring(2,15);return`session_${l}_${f}`}static generateSessionIdFromUrl(l){const f=l||(typeof window<"u"?window.location.href:"");if(!f)return Eo.createSession();try{const d=new URL(f).pathname.split("/").filter(M=>M.length>0),k=d[d.length-1];return k?`session_${Date.now()}_${k}`:Eo.createSession()}catch{return Eo.createSession()}}static createMessageId(l){const f=Date.now(),d=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${f}_${d}`:`msg_${f}_${d}`}getRenderer(){return this.renderer||(this.renderer=new hh),this.renderer}getTracker(){return this.tracker||(this.tracker=new nh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,f,d,k){const M=await fetch(`${this.apiBaseUrl}${l}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({delegation_session_id:f.delegation_session_id,recommendation_id:f.recommendation_id,session_id:f.session_id,event_type:d,timestamp:new Date().toISOString(),metadata:k||{}})});if(!M.ok){const X=await M.text();throw new Error(`Delegation event failed (${M.status}): ${X}`)}const L=await M.json();return L?.session||null}async reportDelegationTurnStarted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",f)}async reportDelegationSessionStarted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",f)}async reportDelegationTurnCompleted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",f)}async reportDelegationToolInvocation(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",f)}async reportDelegationOutcome(l,f,d){return this.postDelegationEvent("/aip/delegation/complete",l,f,d)}async stopDelegationSession(l,f="user_stopped",d){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:f,...d||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const f=Date.parse(l.expires_at);return Number.isNaN(f)||f<=Date.now()?null:l}hasActiveDelegationSession(l){return!!this.getActiveDelegationSession(l)}async showRecommendations(l){try{if(!l.sessionId||l.sessionId.trim()==="")throw new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");if(!l.messageId||l.messageId.trim()==="")throw new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");const f=await this.fetchPlatformResponse({query:l.query,sessionId:l.sessionId,messageId:l.messageId,platformSurface:l.platformSurface,model:l.model,messages:l.messages,language:l.locale,location:l.location,userId:l.userId??this.config.userId}),d={sessionId:l.sessionId,messageId:l.messageId,recommendations:[f]},k=this.getRenderer(),M=this.getTracker();await k.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:d,theme:l.theme||this.config.theme,tracker:M,sessionId:l.sessionId,apiKey:this.config.apiKey,apiBaseUrl:this.apiBaseUrl,language:l.locale,location:l.location,userId:l.userId,model:l.model,messages:l.messages,onPasteToInput:l.onPasteToInput,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation,onExecuteQuery:l.onExecuteQuery})}catch(f){throw F.error("[AdMeshSDK] Error showing recommendations"),f}}async fetchPlatformResponse(l){var f,d,k,M,L,X,S,y,$,E,W,N,P;const H=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const le=new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");throw F.error("[AdMeshSDK] sessionId not provided by platform - cannot process request"),le}const V=l.messageId;if(!V||V.trim()===""){const le=new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");throw F.error("[AdMeshSDK] messageId not provided by platform - cannot process request"),le}const ee=Eo.buildPlatformResponseCacheKey(l.sessionId,V),se=Eo.inFlightPlatformResponses.get(ee);if(se)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:V}),se;const oe=l.messages?l.messages.length:0,re=(typeof window<"u"&&window.navigator,"web"),ae=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=gh((f=l.location)==null?void 0:f.countryCode)||"US",U=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,he=l.userId??this.config.userId,ce={spec_version:"1.0",message_id:V,timestamp:new Date().toISOString(),platform:{platform_id:"placeholder",role:"platform",software:{name:"admesh_ui_sdk",version:l.model||"1.0.0"}},identity:{namespace:"platform_user",value_hash:he||"",confidence:he?1:0},consent:{status:"granted",source:"admesh_ui_sdk",scope:{intent_based_monetization:!0,agent_participation:!0,measurement:!0},constraints:{allow_identity_downstream:!1}},classification_input:{type:"interaction",interaction:{session:{id:l.sessionId,turn_index:oe},surface:{channel:l.platformSurface==="embedded_assistant"?"conversation":l.platformSurface||"conversation",interaction_mode:"text",platform:re,form_factor:ae,locale:l.language||"en-US",country:Q,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((d=l.location)==null?void 0:d.city)||void 0,state:((k=l.location)==null?void 0:k.state)||void 0,state_code:((M=l.location)==null?void 0:M.stateCode)||void 0,country:((L=l.location)==null?void 0:L.country)||void 0,country_code:Q,zipcode:((X=l.location)==null?void 0:X.zipcode)||void 0,latitude:(S=l.location)==null?void 0:S.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:U}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(E=($=ce.classification_input.interaction)==null?void 0:$.input.query_text)!=null&&E.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ye=JSON.stringify(ce);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:ce.message_id,specVersion:ce.spec_version,classificationType:ce.classification_input.type,platformId:ce.platform.platform_id,surfaceChannel:(W=ce.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(P=(N=ce.classification_input.interaction)==null?void 0:N.session)==null?void 0:P.id});const $e={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){$e["X-AdMesh-Source"]="extension";const le=this.getExtensionSourceDomain();le&&($e["X-AdMesh-Source-Domain"]=le)}const te=(async()=>{const le=await fetch(H,{method:"POST",headers:$e,body:ye});if(!le.ok){const Pe=(await le.json().catch(()=>({}))).detail||`HTTP ${le.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Pe}`)}const xe=await le.json();return F.log("[AdMeshSDK] \u{1F4E5} Raw response from /aip/context:",{status:xe.status,recommendationId:xe.recommendation_id,hasRecommendation:!!xe.recommendation,hasTracking:!!xe.tracking,hasDelegation:!!xe.delegation,topLevelKeys:Object.keys(xe)}),F.log("[AdMeshSDK] \u{1F4E6} Full PlatformResponse received from /aip/context",xe),xe})();Eo.inFlightPlatformResponses.set(ee,te);try{return await te}finally{Eo.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const f=Array.isArray(l)?{events:l}:l,d=await fetch(`${this.apiBaseUrl}/analytics/publisher-assistant/events`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(f),keepalive:!0});if(!d.ok){const k=await d.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${d.status}): ${k}`)}}async reportSponsoredRecommendation(l){const f=await fetch(`${this.apiBaseUrl}/analytics/recommendation-reports`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(l),keepalive:!0});if(!f.ok){const d=await f.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${f.status}): ${d}`)}}fireFollowupExposure(l,f,d){this.getTracker().fireFollowupExposure(l,f,d)}async fireFollowupEngagement(l,f,d){return this.getTracker().fireFollowupEngagement(l,f,d)}};qr(Uc,"inFlightPlatformResponses",new Map);let qc=Uc;const Wc=b.createContext(void 0);function Hc(){const u=b.useContext(Wc);if(!u)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return u}function Vc(){const u=Hc();return{sdk:u.sdk,apiKey:u.apiKey,sessionId:u.sessionId,theme:u.theme,language:u.language,location:u.location,userId:u.userId,model:u.model,messages:u.messages,processedMessageIds:u.processedMessageIds,recommendationResults:u.recommendationResults,activeDelegationSession:u.activeDelegationSession,markMessageAsProcessed:u.markMessageAsProcessed,isMessageProcessed:u.isMessageProcessed,setRecommendationResult:u.setRecommendationResult,getRecommendationResult:u.getRecommendationResult,hasRecommendationResult:u.hasRecommendationResult,setActiveDelegationSession:u.setActiveDelegationSession,getActiveDelegationSession:u.getActiveDelegationSession,hasActiveDelegationSession:u.hasActiveDelegationSession,refreshDelegationActivity:u.refreshDelegationActivity,stopDelegationSession:u.stopDelegationSession}}const yh=({className:u,size:l=20})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:u,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),vh=({recommendation:u,theme:l,sdk:f,sessionId:d,onExecuteQuery:k})=>{var M,L,X,S,y;const $=(L=(M=u.recommendation)==null?void 0:M.creative)!=null&&L.follow_up_suggestion&&(X=u.tracking)!=null&&X.followup_engagement_url&&(S=u.tracking)!=null&&S.followup_exposure_url?{query:u.recommendation.creative.follow_up_suggestion,engagement_url:u.tracking.followup_engagement_url,exposure_url:u.tracking.followup_exposure_url}:null,E=$?.query,W=$?.engagement_url,N=$?.exposure_url,P=u.recommendation_id,H=((y=u.recommendation)==null?void 0:y.offerId)||P;if(!E||!W||!N)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const V=async()=>{try{W&&P&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await f.fireFollowupEngagement(W,P,d)),k&&E?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${E}`),await k(E)):F.warn("[AdMeshFollowup] \u26A0\uFE0F onExecuteQuery not provided - cannot execute query")}catch(ee){F.error("[AdMeshFollowup] Error handling follow-up click:",ee)}};return m.jsx(rs,{productId:H,recommendationId:P||"",exposureUrl:N,sessionId:d,className:"admesh-followup-container",style:{width:"100%"},children:m.jsxs("div",{className:"flex flex-col space-y-3 text-sm admesh-followup-wrapper",children:[m.jsx("div",{className:"h-px w-full bg-[#E5E5E5] dark:bg-[#262626] admesh-divider"}),m.jsxs("div",{onClick:V,className:"cursor-pointer flex flex-row justify-between font-medium space-x-2 items-center group",role:"button",tabIndex:0,onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&V()},"aria-label":`Sponsored follow-up: ${E}`,children:[m.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:E}),m.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[m.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 italic admesh-ad-label",children:"Ad"}),m.jsx(yh,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Ha=({onRecommendationsShown:u,onError:l,messageId:f,query:d,userId:k,initialRecommendation:M,triggerExposureUrl:L=!0,followups_container_id:X,onPasteToInput:S,onDelegationConsent:y,onDelegationActivated:$,onStartDelegation:E,onRecommendationReport:W,onExecuteQuery:N,onFollowupDetected:P,isContainerReady:H})=>{var V,ee,se,oe;const{sdk:re,sessionId:ae,apiKey:Q,language:U,location:he,userId:ce,model:ye,messages:$e,theme:te,getRecommendationResult:le,hasRecommendationResult:xe,setRecommendationResult:Pe,activeDelegationSession:C,setActiveDelegationSession:q,hasActiveDelegationSession:ie}=Vc(),ke=Z=>!!Z&&Z.status==="generated"&&!!Z.recommendation,Ee=k||ce,[p,I]=b.useState(null),[G,Y]=b.useState(null),[_e,ve]=b.useState(!0),[Ae,Le]=b.useState(null),Ne=b.useRef(null),je=b.useRef(!1),We=b.useRef(!1),Bt=b.useRef(u),ne=b.useRef(l);b.useEffect(()=>{Bt.current=u,ne.current=l},[u,l]),b.useEffect(()=>{Ne.current!==f&&(Ne.current=null,We.current=!1,I(null),Y(null))},[f]);const de=ie()&&C?.session_id===ae;b.useEffect(()=>{var Z,Oe,K;if(!f||!xe(f)||de)return;const He=le(f);if(!He){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),I(null),Y(null),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0;return}let Ge=((Z=He.recommendation)==null?void 0:Z.format)||"tail";(Ge==="weave"||Ge==="product_card")&&(Ge="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:f,recommendationId:He.recommendation_id,format:(Oe=He.recommendation)==null?void 0:Oe.format}),I(He),Y(Ge),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,(K=Bt.current)==null||K.call(Bt,f,He)},[le,xe,de,f]),b.useEffect(()=>{var Z,Oe,K,He,Ge,B,Ze;if(!(!M||!f)&&!de)try{const Fe=M,un=M.status||"unknown";if(!ke(Fe)){if(un==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),I(null),Y(null),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,Pe(f,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let it=((Z=Fe.recommendation)==null?void 0:Z.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),I(Fe),Y(it),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,Pe(f,Fe),(Oe=Bt.current)==null||Oe.call(Bt,f,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:f,recommendationId:Fe.recommendation_id,format:(K=Fe.recommendation)==null?void 0:K.format,brandName:(Ge=(He=Fe.recommendation)==null?void 0:He.creative)==null?void 0:Ge.brand_name,headline:(Ze=(B=Fe.recommendation)==null?void 0:B.creative)==null?void 0:Ze.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));We.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[de,M,f,Pe]),b.useEffect(()=>{if(!f||!d||d.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ve(!1);return}if(de){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:f,conversationSessionId:ae,delegationSessionId:C?.delegation_session_id}),I(null),Y(null),Le(null),ve(!1),je.current=!1;return}if(!(re!=null&&re.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ve(!1);return}if(We.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Ne.current===f){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(je.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Fetch already in progress, skipping duplicate fetch");return}F.log("[AdMeshRecommendations] \u{1F4E4} Fetching recommendation from /aip/context (single fetch)"),(async()=>{var Z,Oe,K,He,Ge,B,Ze,Fe,un;try{je.current=!0,ve(!0),Le(null);const it=await re.fetchPlatformResponse({query:d.trim(),sessionId:ae,messageId:f,language:U,location:he,userId:Ee,model:ye,...$e&&$e.length>0&&{messages:$e}}),Kt=it?.status||"unknown";if(!ke(it)){if(Kt==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),I(null),Y(null),Le(null),ve(!1),je.current=!1,Ne.current=f,Pe(f,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Kt})`)}I(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:f,recommendationId:it.recommendation_id,format:(Z=it.recommendation)==null?void 0:Z.format,brandName:(K=(Oe=it.recommendation)==null?void 0:Oe.creative)==null?void 0:K.brand_name,headline:(Ge=(He=it.recommendation)==null?void 0:He.creative)==null?void 0:Ge.headline,hasTracking:!!it.tracking});let Mn=((B=it.recommendation)==null?void 0:B.format)||"tail";(Mn==="weave"||Mn==="product_card")&&(Mn="tail"),Y(Mn),Ne.current=f,Pe(f,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Ze=it.recommendation)==null?void 0:Ze.format,selected_format:Mn}),ve(!1),je.current=!1,(Fe=Bt.current)==null||Fe.call(Bt,f,it)}catch(it){const Kt=it instanceof Error?it:new Error(String(it));Kt.message.includes("Failed to fetch")||Kt.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${Kt.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${Kt.message} `),Le(Kt),ve(!1),je.current=!1,(un=ne.current)==null||un.call(ne,Kt)}})()},[C?.delegation_session_id,de,re,ae,f,d,U,he,Ee,ye,M,Pe]),b.useEffect(()=>{var Z,Oe,K,He;if(!p||!P)return;const Ge=(Oe=(Z=p.recommendation)==null?void 0:Z.creative)!=null&&Oe.follow_up_suggestion&&(K=p.tracking)!=null&&K.followup_engagement_url&&(He=p.tracking)!=null&&He.followup_exposure_url?{label:p.recommendation.creative.follow_up_suggestion,query:p.recommendation.creative.follow_up_suggestion,engagement_url:p.tracking.followup_engagement_url,exposure_url:p.tracking.followup_exposure_url}:null;Ge&&P(Ge,p.recommendation_id)},[p,P]);const ge=b.useCallback(async Z=>{if(!re||!ae)throw new Error("AdMesh SDK activation requires an initialized session");const Oe=await fetch(`${re.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ae,recommendation_id:Z.recommendation_id,metadata:Z.metadata})});if(!Oe.ok){const B=await Oe.text();throw new Error(`Failed to activate delegation session: ${Oe.status} ${B}`)}const K=await Oe.json(),He={...Z,delegation_session_id:K.delegation_session_id||Z.delegation_session_id,session_id:K.session_id||ae,brand_id:K.brand_id||Z.brand_id,brand_name:K.brand_name||Z.brand_name,mcp_endpoint:K.mcp_endpoint,eligibility_reason:K.eligibility_reason||Z.eligibility_reason,delegate_reason:K.delegate_reason||Z.delegate_reason,session_goal:K.session_goal||Z.session_goal,desired_outcome_type:K.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:K.required_user_inputs||Z.required_user_inputs||[],required_consent_types:K.required_consent_types||Z.required_consent_types||[],success_outcome:K.success_outcome||Z.success_outcome,fallback_message:K.fallback_message||Z.fallback_message,session_mode:"inline",status:K.status||"active",capabilities:K.capabilities||Z.capabilities||[],allowed_data_types:K.allowed_data_types||Z.allowed_data_types||[],auth_model:K.auth_model||Z.auth_model,handoff_protocol:K.handoff_protocol||Z.handoff_protocol,supported_actions:K.supported_actions||Z.supported_actions||[],metadata:K.metadata||Z.metadata},Ge={delegation_session_id:K.delegation_session_id,recommendation_id:Z.recommendation_id,session_id:K.session_id||ae,brand_agent_id:K.brand_agent_id,brand_id:K.brand_id||Z.brand_id,brand_name:K.brand_name||Z.brand_name||"Brand",mcp_endpoint:K.mcp_endpoint,status:K.status||"active",activated_at:K.created_at,last_activity_at:K.updated_at,expires_at:K.expires_at||K.updated_at,eligibility_reason:K.eligibility_reason||Z.eligibility_reason,delegate_reason:K.delegate_reason||Z.delegate_reason,session_goal:K.session_goal||Z.session_goal,desired_outcome_type:K.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:K.required_user_inputs||Z.required_user_inputs||[],required_consent_types:K.required_consent_types||Z.required_consent_types||[],success_outcome:K.success_outcome||Z.success_outcome,fallback_message:K.fallback_message||Z.fallback_message,capabilities:K.capabilities||Z.capabilities||[],allowed_data_types:K.allowed_data_types||Z.allowed_data_types||[],consent_requirements:K.consent_requirements||Z.consent_requirements||[],auth_model:K.auth_model||Z.auth_model,handoff_protocol:K.handoff_protocol||Z.handoff_protocol,supported_actions:K.supported_actions||Z.supported_actions||[],metadata:K.metadata||Z.metadata};if(q(Ge),await re.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ae,recommendation_id:Z.recommendation_id,delegation_session_id:K.delegation_session_id,brand_name:Ge.brand_name,status:K.status||"active",metadata:{brand_agent_id:K.brand_agent_id,source:"recommendation_card"}}).catch(B=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",B)}),await re.reportDelegationSessionStarted(Ge,{brand_agent_id:K.brand_agent_id,brand_name:Ge.brand_name}).then(B=>{B&&q(B)}).catch(B=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",B)}),$){try{await $(He)}catch(B){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",B)}return}if(E)try{await E({...Z.platform_response,delegation:{...Z.platform_response.delegation,...He,delegation_session_id:K.delegation_session_id,available:!0,status:K.status||"active"}})}catch(B){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",B)}},[Q,$,E,re,ae,q]),Me=b.useCallback(async Z=>{var Oe,K;if(W){await W(Z);return}!re||!ae||await re.reportSponsoredRecommendation({session_id:ae,message_id:f,recommendation_id:Z.recommendation_id,reason:Z.reason,brand_name:(K=(Oe=Z.recommendation.recommendation)==null?void 0:Oe.creative)==null?void 0:K.brand_name,metadata:{reason:Z.reason,source:"recommendation_card"}}).catch(He=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",He)})},[f,W,re,ae]);if(!f||!d||d.trim()===""||_e||Ae)return null;if(!p||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:f,hasPlatformResult:!!p,detectedFormat:G,isLoading:_e,hasError:!!Ae}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:f,recommendationId:p.recommendation_id,detectedFormat:G,brandName:(ee=(V=p.recommendation)==null?void 0:V.creative)==null?void 0:ee.brand_name,headline:(oe=(se=p.recommendation)==null?void 0:se.creative)==null?void 0:oe.headline});const De=typeof document<"u"&&X&&(H??!0)?document.getElementById(X):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(jc,{recommendations:[p],theme:te,sessionId:ae,triggerExposureUrl:L,onPasteToInput:S,onDelegationConsent:y,onDelegationActivated:ge,onStartDelegation:E,onRecommendationReport:Me})}),De&&re&&ae?es.createPortal(m.jsx(vh,{recommendation:p,theme:te,sdk:re,sessionId:ae,onExecuteQuery:N}),De):null]})},os="admesh-ui-sdk-styles",as="admesh-ui-sdk-reset",bh=`
245
+ `}),f.jsxs("div",{role:!ke&&xe?"link":void 0,tabIndex:!ke&&xe?0:void 0,style:{display:"flex",flexDirection:"column",gap:"10px",padding:"12px",borderRadius:l?.borderRadius||((le=(te=l?.components)==null?void 0:te.card)==null?void 0:le.borderRadius)||"14px",border:`1px solid ${Ke}`,background:ot,boxShadow:Zn,minWidth:0,cursor:!ke&&xe?"pointer":void 0},onClick:vt,onKeyDown:dn,children:[f.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start",minWidth:0},children:[f.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",flexShrink:0,overflow:"hidden",background:Ue?"#1f2937":"#eff6ff",display:"flex",alignItems:"center",justifyContent:"center"},children:!Dt&&ie&&Fc(ie)?f.jsx("img",{src:ie,alt:`${ve} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>no(!0)}):f.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:fn},children:(ve||"A").charAt(0).toUpperCase()})}),f.jsxs("div",{style:{flex:1,minWidth:0},children:[f.jsxs("div",{className:"admesh-compact-meta-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"4px"},children:[f.jsx("div",{className:"admesh-compact-line-clamp-1",style:{fontSize:"11px",color:fn},children:Oe?ve:""}),f.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:fn,textTransform:"uppercase",letterSpacing:"0.08em"},children:E})]}),!ke&&f.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:Ht,marginBottom:"4px"},title:ze,children:ze}),Re&&f.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:pe},title:Re,children:Re})]})]}),ke&&f.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:oe.map(de=>{const tt=la(de.product_name)||"Product",mn=la(de.product_link)||la(de.product_url)||xe||"#",dr=nh(de.product_price,de.product_currency),ro=la(de.product_image_url),Ir=ro&&Fc(ro)?ro:"",Wo=mn!=="#";return f.jsx("a",{href:mn,target:Wo?"_blank":void 0,rel:Wo?"noopener noreferrer":void 0,onClick:zr=>K(`compact_tail_ad_product_${de.product_id||"item"}`,zr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${Ke}`,borderRadius:"12px",background:Jt,padding:"8px",flexShrink:0},children:f.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[f.jsx("div",{style:{width:"34px",height:"34px",borderRadius:"8px",overflow:"hidden",flexShrink:0,background:Ue?"#374151":"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",color:fn,fontSize:"12px",fontWeight:700},children:Ir?f.jsx("img",{src:Ir,alt:tt,style:{display:"block",width:"100%",height:"100%",objectFit:"contain",objectPosition:"center"}}):tt.charAt(0).toUpperCase()}),f.jsxs("div",{style:{minWidth:0,flex:1},children:[f.jsx("div",{style:{fontSize:"12px",lineHeight:1.25,fontWeight:600,color:Ht,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:tt,children:tt}),f.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:dr&&f.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:Ht},children:dr})})]})]})},de.product_id||`${be}-${tt}`)})}),f.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:Yn},children:[f.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:Cr}),f.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&$.length>oe.length?f.jsxs("span",{style:{fontSize:"10px",color:fn},children:["+",$.length-oe.length," more"]}):null,f.jsx("button",{type:"button","aria-label":_t?"Recommendation reported":"Report recommendation",title:_t?"Reported":"Report recommendation",disabled:!!_t,onClick:Le,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${Ke}`,background:_t?Jt:ot,color:_t?Jn:fn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:_t?"default":"pointer",flexShrink:0},children:f.jsx($p,{size:13})})]})]}),Pe?f.jsx("div",{className:"admesh-compact-report-panel",onClick:de=>de.stopPropagation(),style:{marginLeft:ke?0:Yn,border:`1px solid ${Ke}`,borderRadius:"12px",background:Jt,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Ie.map(de=>f.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>Sn(tt,de.value),style:{borderRadius:"999px",border:`1px solid ${Ke}`,background:ot,color:Ht,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:de.label},de.value))}):null,_t?f.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:Yn,fontSize:"11px",color:fn},children:"Thanks for reporting this recommendation."}):null,Tt?f.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${Ke}`,borderRadius:"12px",background:Jt,padding:"12px",display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[f.jsx("div",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:Jn},children:"Confirm Agent Access"}),f.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:Ht,fontWeight:600},children:["Allow ",H||"this brand"," to start a delegated session?"]}),f.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:pe},children:"The agent will only use the details you choose to share for this request."})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[f.jsx("button",{type:"button",disabled:ue,onClick:de=>{de.preventDefault(),de.stopPropagation(),!ue&&Ge(!1)},style:{borderRadius:"10px",border:`1px solid ${Ke}`,background:ot,color:Ht,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:ue?"not-allowed":"pointer",opacity:ue?.65:1},children:"Not now"}),f.jsx("button",{type:"button",disabled:ue,onClick:de=>{de.preventDefault(),de.stopPropagation(),!ue&&Ge(!0)},style:{borderRadius:"10px",border:"none",background:Jn,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:ue?"wait":"pointer",opacity:ue?.86:1},children:ue?"Connecting...":"Allow agent"})]})]}):null]})]})},rh=({recommendations:s,theme:l,className:m,style:c,sessionId:x,onDelegationConsent:A,onDelegationActivated:N,onStartDelegation:G})=>{const S=s.filter(W=>W&&typeof W=="object"&&typeof W.recommendation_id=="string"&&W.recommendation_id.length>0);if(!S||S.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${S.length} valid recommendations`);const y=()=>{var W;if(S.length>0){const C=S[0],V=(W=C.recommendation)==null?void 0:W.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:V,recommendationKeys:Object.keys(C||{})}),(V==="product_card"||V==="weave"||V==="bridge")&&F.warn(`[AdMeshLayout] ${V} format requested, falling back to tail for canonical render payload`)}return f.jsx(Oc,{recommendations:S,theme:l,sessionId:x,onDelegationConsent:A,onDelegationActivated:N,onStartDelegation:G})};return f.jsx("div",{className:`admesh-layout ${m}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:y()})};class oh{constructor(l){eo(this,"firedExposures",new Set),eo(this,"debug",!1),eo(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,m,c){const x=`${c}_${m}`;if(this.firedExposures.has(x)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(x);try{fetch(l,{method:"GET",keepalive:!0}).catch(()=>{this.debug&&F.warn("[Tracker] Failed to fire exposure")}),this.debug&&F.log("[Tracker] Fired MRC-compliant exposure")}catch{this.debug&&F.error("[Tracker] Error firing exposure")}}async fireExposureWithMRCCompliance(l,m,c,x){const A=`${c}_${m}`;if(this.firedExposures.has(A)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(N=>{let G=null,S=null;const y=new IntersectionObserver(C=>{C.forEach(V=>{V.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?G===null&&(G=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),S=setTimeout(()=>{this.fireExposure(l,m,c),y.disconnect(),N()},this.mrcThreshold.minimumDurationMs)):G!==null&&(S&&(clearTimeout(S),S=null),G=null,this.debug&&F.log("[Tracker] Ad visibility dropped below MRC threshold"))})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});y.observe(x);const W=setTimeout(()=>{y.disconnect(),S&&clearTimeout(S),N()},3e4);x.__admeshTrackerCleanup=()=>{y.disconnect(),S&&clearTimeout(S),clearTimeout(W)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,m,c){this.fireExposure(l,m,c)}fireFollowupEngagement(l,m,c){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})}).catch(x=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",x)}).then(()=>{})}}function ah(s){const l=s.split("/").filter(Boolean),m=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return m?m.replace(/\b\w/g,c=>c.toUpperCase()):"This page"}function ih(){var s;try{console.log("[AdMesh] Starting direct headings extraction...");const l=S=>S.replace(/\s+/g," ").trim(),m=()=>{var S;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],W=["script","style","noscript","svg","canvas","iframe","nav","header","footer","aside",'[aria-hidden="true"]',"[data-admesh-ignore]",".admesh-publisher-assistant-root",".admesh-publisher-assistant-reactMount",".admesh-publisher-assistant-floating",".admesh-publisher-assistant-inline"].join(","),C=(((S=y.map(D=>document.querySelector(D)).filter(D=>!!D).map(D=>{const R=D.cloneNode(!0);R.querySelectorAll(W).forEach(Q=>Q.remove());const U=l(R.textContent||"");return{element:D,text:U}}).filter(D=>D.text.length>=200).sort((D,R)=>R.text.length-D.text.length)[0])==null?void 0:S.element)||document.body).cloneNode(!0);C.querySelectorAll(W).forEach(D=>D.remove());const V=Array.from(C.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(D=>l(D.textContent||"")).filter(D=>D.length>=24);return(V.length>0?V.join(`
246
+ `):l(C.textContent||"")).slice(0,6e3)},c=ah(window.location.pathname||"/"),x=l(document.title||"")||c,A=(()=>{const S=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach(W=>{const C=l(W.textContent||"");C.length>0&&S.push(C)}),S})(),N=A.length>0?A:[x||c],G={title:x,headings:N,article_text:m(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:G.title,headingsCount:G.headings.length,articleTextLength:((s=G.article_text)==null?void 0:s.length)||0,domain:G.domain}),G}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function lh(s){return!!(s&&typeof s=="object"&&"recommendation_id"in s&&"status"in s)}function sh(s){var l,m,c,x,A,N,G,S,y,W,C;if(!s||typeof s!="object")return;if(lh(s))return s;const V=s;if(!V.recommendation_id)return;const D=(V.products||[]).map(R=>{var U,Q;return{product_id:R.product_id||"",product_link:R.product_link||R.product_click_url||V.click_url||V.url||"",product_name:R.product_name||V.title||((U=V.creative_input)==null?void 0:U.product_name)||"",product_description:R.product_description||"",product_price:R.product_price??void 0,product_discount:R.product_discount??void 0,product_currency:R.product_currency,product_discount_type:R.product_discount_type,product_cta_label:R.product_cta_label||((Q=V.creative_input)==null?void 0:Q.cta_label),product_image_url:R.product_image_url,product_features:R.product_features}});return{spec_version:"1.0",recommendation_id:V.recommendation_id,timestamp:new Date().toISOString(),status:"generated",ttl_ms:3e5,recommendation:{format:V.preferred_format||"tail",disclosure:"Sponsored",creative:{brand_name:((l=V.creative_input)==null?void 0:l.brand_name)||"",headline:V.title||((m=V.creative_input)==null?void 0:m.product_name)||"",description:((c=V.creative_input)==null?void 0:c.short_description)||((x=V.creative_input)==null?void 0:x.long_description)||"",cta_text:((A=V.creative_input)==null?void 0:A.cta_label)||((N=D[0])==null?void 0:N.product_cta_label)||"Learn more",follow_up_suggestion:V.follow_up_suggestion,logo_url:(S=(G=V.creative_input)==null?void 0:G.assets)==null?void 0:S.logo_url,image_urls:((W=(y=V.creative_input)==null?void 0:y.assets)==null?void 0:W.image_urls)||[],landing_page_url:V.url||V.click_url||((C=V.creative_input)==null?void 0:C.cta_url)||"",products:D}},tracking:{exposure_url:V.exposure_url,click_url:V.click_url,followup_exposure_url:V.followup_exposure_url,followup_engagement_url:V.followup_engagement_url}}}function uh(s){return{...s,suggestions:(s.suggestions||[]).map(l=>({...l,recommendation:sh(l.recommendation)}))}}function $c(s){try{const l=new URL(s).pathname.split("/").filter(m=>m.length>0);return l[l.length-1]||void 0}catch{return}}async function ch(s,l){var m,c,x,A,N;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:s.url});const G=Array.isArray(s.headings)?s.headings:[],S=(m=$c(s.url))==null?void 0:m.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=S?S.replace(/\b\w/g,le=>le.toUpperCase()):void 0,W=l.apiKey.toLowerCase().startsWith("pub_")?$c(s.url):void 0,C=l.extension?"extension":"admesh_ui_sdk",V=(s.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),D={url:s.url,title:s.title||void 0,headings:G.length>0?G:y?[y]:void 0,article_text:((c=s.article_text)==null?void 0:c.trim())||void 0,domain:V,article_slug:W,agent_id:void 0,cpx_floor:void 0,source:C,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:D.url,titleLength:((x=D.title)==null?void 0:x.length)||0,headingsCount:((A=D.headings)==null?void 0:A.length)||0,articleTextLength:((N=D.article_text)==null?void 0:N.length)||0,domain:D.domain,article_slug:D.article_slug,source:D.source,has_user_id:!!D.user_id});const R=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",R);const U=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(D)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:U.status,statusText:U.statusText,ok:U.ok}),!U.ok){const le=await U.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:U.status,statusText:U.statusText,errorText:le}),new Error(`ACIE API error: ${U.status} - ${le}`)}const Q=await U.json(),te=uh(Q);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:s.url,suggestionsCount:te.suggestions.length}),te}catch(G){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",G),null}}async function dh(s,l){var m,c;const x=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),A=new URLSearchParams({url:s.trim()});(m=l.agentDisplayId)!=null&&m.trim()&&A.set("agent_display_id",l.agentDisplayId.trim()),(c=l.publisherId)!=null&&c.trim()&&A.set("publisher_id",l.publisherId.trim());const N=await fetch(`${x}/publisher-assistant/page-context?${A.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!N.ok){const G=await N.text().catch(()=>"");throw new Error(`Page context request failed (${N.status}): ${G||N.statusText}`)}return await N.json()}function fh(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function mh(){var s;if(typeof window>"u")return null;try{const l=(s=window.location.href)==null?void 0:s.trim();if(Wc(l))return l}catch{return null}return null}function Wc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const m=new URL(l);return m.protocol==="http:"||m.protocol==="https:"}catch{return!1}}function ph(s){try{const l=new URL(s),m=l.pathname.split("/").filter(Boolean),c=(m[m.length-1]||m[m.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return c?c.replace(/\b\w/g,x=>x.toUpperCase()):l.hostname}catch{return"This page"}}function Bc(s){const l=new URL(s),m=ph(s);return{title:m,headings:[m],article_text:`Article URL: ${s}
247
+ Article topic inferred from URL path: ${m}`,url:s,domain:l.hostname,extracted_at:new Date().toISOString()}}const hh=6e4,qc=3;function gh(s){const l=mh();if(l)return l;const m=s?.trim();return Wc(m)?m:null}const Vc=({apiKey:s,skipSdkInitialization:l=!1,sessionId:m,extension:c,theme:x,apiBaseUrl:A,language:N,location:G,userId:S,model:y,messages:W,pageContext:C,articleUrl:V,contextMode:D="auto",agentDisplayId:R,children:U})=>{const[Q,te]=v.useState(null),[le,re]=v.useState(new Set),[ye,ae]=v.useState(new Map),[q,B]=v.useState(null),[be,se]=v.useState([]),[ve,Ve]=v.useState(!1),[ne,ie]=v.useState(null),[xe,Fe]=v.useState(!1),E=v.useRef(!1),$=v.useRef(0),oe=v.useRef(null),ke=v.useRef(null);ke.current=q;const Me=!!C||D==="ad-slot"||D==="auto"&&(!!(V!=null&&V.trim())||fh()),p=v.useCallback(async()=>{if(C)return C;if(!Me)return ih();const ee=gh(V);if(!ee)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ie("Article URL is required for ad-slot context"),null;if(!s)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Bc(ee);try{Fe(!0);const ue=await dh(ee,{apiKey:s,apiBaseUrl:A||"https://api.useadmesh.com",agentDisplayId:R});return F.log("[AdMeshProvider] Page context resolved",{source:ue.source,cache_hit:ue.cache_hit,domain:ue.context.domain}),ue.context}catch(ue){return F.error("[AdMeshProvider] Failed to fetch page context:",ue),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Bc(ee)}finally{Fe(!1)}},[R,A,s,V,C,Me]),M=v.useCallback((ee,ue)=>{const fe=ee.filter(Pe=>!Pe.is_sponsored).slice(0,3);return[ue,...fe]},[]),H=v.useCallback((ee,ue)=>{const fe=ee.find(De=>De.is_sponsored),Pe=ue.filter(De=>!De.is_sponsored).slice(0,3);return fe?[fe,...Pe]:Pe},[]);v.useEffect(()=>{if(!m||m.trim()===""){F.error("[AdMeshProvider] sessionId is required and must be provided by the platform. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}F.log("[AdMeshProvider] \u2705 Session ID available:",m)},[m]),v.useEffect(()=>{if(!l){if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!m||m.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ee=new Kc({apiKey:s,theme:x,apiBaseUrl:A,extension:c});te(ee),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",m),A&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ee){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ee)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[s,x,A,m,c,l]);const Y=v.useCallback(async ee=>{var ue;if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(c)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!s.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{Ve(!0),ie(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const fe=ee??await p();if(!fe){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ie("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:fe.title,headingsCount:fe.headings.length,articleTextLength:((ue=fe.article_text)==null?void 0:ue.length)||0,domain:fe.domain});const Pe=await ch(fe,{apiKey:s,apiBaseUrl:A||"https://api.useadmesh.com",extension:c,userId:S});Pe?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Pe.suggestions.length,suggestions:(Pe.suggestions||[]).map(De=>{var _t;return{id:De.id,text:De.text,is_sponsored:De.is_sponsored,recommendationId:((_t=De.recommendation)==null?void 0:_t.recommendation_id)||null}})}),se(De=>H(De,Pe.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ie("Intent analysis failed"),se(De=>De.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),De):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(fe){F.error("[AdMeshProvider] Error in intent analysis:",fe),ie("Intent analysis error"),se(Pe=>Pe.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Pe):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{Ve(!1)}},[s,A,c,S,H,p]),Se=v.useCallback(async ee=>{var ue,fe,Pe,De,_t,Rt;if(!Q||!s||!s.toLowerCase().startsWith("pub_"))return;const X=ee??await p();if(!X){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const Ge=((fe=(ue=X.headings)==null?void 0:ue[0])==null?void 0:fe.trim())||((Pe=X.title)==null?void 0:Pe.trim());if(!Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping sponsored suggestion prefetch: no usable page query");return}try{F.log("[AdMeshProvider] \u{1F504} Prefetching sponsored suggestion from /aip/context...");const Z=await Q.fetchPlatformResponse({query:Ge,sessionId:m,messageId:Kc.createMessageId(m),platformSurface:"conversation",model:y,messages:[],language:N,location:G,userId:S}),K=(Rt=(_t=(De=Z.recommendation)==null?void 0:De.creative)==null?void 0:_t.follow_up_suggestion)==null?void 0:Rt.trim(),Ie=Z.recommendation_id;if(!K||!Ie){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Le={id:Ie,text:K,type:"action",is_sponsored:!0,recommendation:Z,metadata:{source:"aip_context_prefetch",recommendation_id:Ie}};se(Sn=>M(Sn,Le)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Ie,suggestionText:K})}catch(Z){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Z)}},[s,N,G,y,Q,m,S,M,p]),_e=v.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);v.useEffect(()=>{!Q||E.current||(E.current=!0,(async()=>{const ee=await p();await Promise.allSettled([Se(ee),Y(ee)])})())},[Q,Y,Se,p]);const ze=v.useCallback(ee=>{if(!ee||ee.status!=="active")return!1;const ue=Date.parse(ee.expires_at);return Number.isNaN(ue)?!1:ue>Date.now()},[]),Re=v.useCallback(async(ee,ue,fe,Pe)=>{const De=Pe??q;if(!De||!Q){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ee,eventType:ue,hasSession:!!De,hasSdk:!!Q});return}const _t=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ee,eventType:ue,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,sessionId:De.session_id});const Rt=await fetch(`${Q.getApiBaseUrl()}${ee}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({delegation_session_id:De.delegation_session_id,recommendation_id:De.recommendation_id,session_id:De.session_id,event_type:ue,timestamp:_t,metadata:fe||{}})});if(!Rt.ok){const Z=await Rt.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ee,eventType:ue,status:Rt.status,errorBody:Z,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id}),new Error(`Delegation event failed (${Rt.status}): ${Z}`)}const X=await Rt.json(),Ge=X?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ee,eventType:ue,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,returnedStatus:Ge?.status||X?.status}),Ge&&B(Ge)},[q,s,Q]),et=v.useCallback(()=>{$.current=0},[]),Be=v.useCallback(async(ee="user_stopped",ue)=>{const fe=q;if(!fe){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ee,recommendationId:fe.recommendation_id,delegationSessionId:fe.delegation_session_id}),await Re("/aip/delegation/stop","session_stopped",{reason:ee,...ue||{}},fe),await Q?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:fe.session_id,recommendation_id:fe.recommendation_id,delegation_session_id:fe.delegation_session_id,brand_name:fe.brand_name,status:"stopped",metadata:{reason:ee,...ue||{}}}).catch(Pe=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Pe)}),$.current=0,oe.current=null,B(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[q,Re,Q]),Oe=v.useCallback(async(ee="turn_completed",ue)=>{ee==="turn_started"&&et(),await Re("/aip/delegation/activity",ee,ue)},[Re,et]);v.useEffect(()=>{const ee=q?.delegation_session_id??null;ee!==oe.current&&(oe.current=ee,$.current=0)},[q?.delegation_session_id]),v.useEffect(()=>{if(!(q?.delegation_session_id??null)||!Q)return;const ee=ke.current;if(!ee||!ze(ee)){B(fe=>fe?{...fe,status:"expired"}:null);return}const ue=window.setInterval(()=>{const fe=ke.current;if(!(!fe||!ze(fe))){if($.current+=1,$.current>=qc){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:fe.delegation_session_id,heartbeatsSinceLastUserTurn:$.current,idleHeartbeatLimit:qc}),Be("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:$.current}).catch(Pe=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Pe)});return}Re("/aip/delegation/heartbeat","heartbeat").catch(Pe=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Pe)})}},hh);return()=>{window.clearInterval(ue)}},[q?.delegation_session_id,ze,Re,Q,Be]);const Tt={sdk:Q,apiKey:s,sessionId:m,theme:x,language:N,location:G,userId:S,model:y,messages:W,processedMessageIds:le,recommendationResults:ye,activeDelegationSession:q,suggestions:be,isAnalyzingIntent:ve||xe,intentError:ne,markMessageAsProcessed:ee=>{re(ue=>{const fe=new Set(ue);return fe.add(ee),fe})},isMessageProcessed:ee=>le.has(ee),setRecommendationResult:(ee,ue)=>{ae(fe=>{const Pe=new Map(fe);return Pe.set(ee,ue),Pe}),re(fe=>{const Pe=new Set(fe);return Pe.add(ee),Pe})},getRecommendationResult:ee=>ye.get(ee),hasRecommendationResult:ee=>ye.has(ee),setActiveDelegationSession:ee=>{B(ee)},getActiveDelegationSession:()=>ze(q)?q:null,hasActiveDelegationSession:()=>ze(q),refreshDelegationActivity:Oe,stopDelegationSession:Be,retryIntentAnalysis:_e};return f.jsx(Hc.Provider,{value:Tt,children:U})};class yh{constructor(){eo(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const m=l.response.recommendations||[];if(m.length===0){F.log("[AdMeshRenderer] \u26A0\uFE0F No recommendations to render - skipping render to avoid occupying space");return}const c=document.getElementById(l.containerId);if(!c)throw F.error("[AdMeshRenderer] Container not found"),new Error(`Container with ID "${l.containerId}" not found`);F.log("[AdMeshRenderer] \u2705 Container ready");const x=this.roots.get(l.containerId);x&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),x.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const A=Sc.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),A.render(f.jsx(Vc,{apiKey:l.apiKey,sessionId:l.sessionId,theme:l.theme,apiBaseUrl:l.apiBaseUrl,language:l.language,location:l.location,userId:l.userId,model:l.model,messages:l.messages,children:f.jsx(rh,{recommendations:m,theme:l.theme,sessionId:l.sessionId,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation})})),c.style.display="block",F.log("[AdMeshRenderer] \u2705 Recommendations rendered successfully"),this.roots.set(l.containerId,A)}catch(m){throw F.error("[AdMeshRenderer] Error rendering recommendations"),m}}unmount(l){const m=this.roots.get(l);if(m){m.unmount(),this.roots.delete(l);const c=document.getElementById(l);c&&(c.style.display="none")}}unmountAll(){for(const[,l]of this.roots.entries())l.unmount();this.roots.clear()}}const bh=new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));function vh(s){if(typeof s!="string")return;const l=s.trim().toUpperCase();return bh.has(l)?l:void 0}const Uc=class Lo{constructor(l){if(eo(this,"config"),eo(this,"apiBaseUrl"),eo(this,"renderer",null),eo(this,"tracker",null),!l.apiKey)throw new Error("AdMeshSDK: apiKey is required");this.config={apiKey:l.apiKey,theme:l.theme,apiBaseUrl:l.apiBaseUrl,extension:l.extension,extensionSourceDomain:l.extensionSourceDomain,userId:l.userId},this.apiBaseUrl=l.apiBaseUrl||typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com"}getApiBaseUrl(){return this.apiBaseUrl}static buildPlatformResponseCacheKey(l,m){return`${l}::${m}`}getExtensionSourceDomain(){var l,m;const c=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(c)return c.toLowerCase();if(typeof window<"u"&&(m=window.location)!=null&&m.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),m=Math.random().toString(36).substring(2,15);return`session_${l}_${m}`}static generateSessionIdFromUrl(l){const m=l||(typeof window<"u"?window.location.href:"");if(!m)return Lo.createSession();try{const c=new URL(m).pathname.split("/").filter(A=>A.length>0),x=c[c.length-1];return x?`session_${Date.now()}_${x}`:Lo.createSession()}catch{return Lo.createSession()}}static createMessageId(l){const m=Date.now(),c=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${m}_${c}`:`msg_${m}_${c}`}getRenderer(){return this.renderer||(this.renderer=new yh),this.renderer}getTracker(){return this.tracker||(this.tracker=new oh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,m,c,x){const A=await fetch(`${this.apiBaseUrl}${l}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({delegation_session_id:m.delegation_session_id,recommendation_id:m.recommendation_id,session_id:m.session_id,event_type:c,timestamp:new Date().toISOString(),metadata:x||{}})});if(!A.ok){const G=await A.text();throw new Error(`Delegation event failed (${A.status}): ${G}`)}const N=await A.json();return N?.session||null}async reportDelegationTurnStarted(l,m){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",m)}async reportDelegationSessionStarted(l,m){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",m)}async reportDelegationTurnCompleted(l,m){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",m)}async reportDelegationToolInvocation(l,m){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",m)}async reportDelegationOutcome(l,m,c){return this.postDelegationEvent("/aip/delegation/complete",l,m,c)}async stopDelegationSession(l,m="user_stopped",c){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:m,...c||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const m=Date.parse(l.expires_at);return Number.isNaN(m)||m<=Date.now()?null:l}hasActiveDelegationSession(l){return!!this.getActiveDelegationSession(l)}async showRecommendations(l){try{if(!l.sessionId||l.sessionId.trim()==="")throw new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");if(!l.messageId||l.messageId.trim()==="")throw new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");const m=await this.fetchPlatformResponse({query:l.query,sessionId:l.sessionId,messageId:l.messageId,platformSurface:l.platformSurface,model:l.model,messages:l.messages,language:l.locale,location:l.location,userId:l.userId??this.config.userId}),c={sessionId:l.sessionId,messageId:l.messageId,recommendations:[m]},x=this.getRenderer(),A=this.getTracker();await x.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:A,sessionId:l.sessionId,apiKey:this.config.apiKey,apiBaseUrl:this.apiBaseUrl,language:l.locale,location:l.location,userId:l.userId,model:l.model,messages:l.messages,onPasteToInput:l.onPasteToInput,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation,onExecuteQuery:l.onExecuteQuery})}catch(m){throw F.error("[AdMeshSDK] Error showing recommendations"),m}}async fetchPlatformResponse(l){var m,c,x,A,N,G,S,y,W,C,V,D,R;const U=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const ie=new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");throw F.error("[AdMeshSDK] sessionId not provided by platform - cannot process request"),ie}const Q=l.messageId;if(!Q||Q.trim()===""){const ie=new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");throw F.error("[AdMeshSDK] messageId not provided by platform - cannot process request"),ie}const te=Lo.buildPlatformResponseCacheKey(l.sessionId,Q),le=Lo.inFlightPlatformResponses.get(te);if(le)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:Q}),le;const re=l.messages?l.messages.length:0,ye=(typeof window<"u"&&window.navigator,"web"),ae=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",q=vh((m=l.location)==null?void 0:m.countryCode),B=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,be=l.userId??this.config.userId,se={spec_version:"1.0",message_id:Q,timestamp:new Date().toISOString(),platform:{platform_id:"placeholder",role:"platform",software:{name:"admesh_ui_sdk",version:l.model||"1.0.0"}},identity:{namespace:"platform_user",value_hash:be||"",confidence:be?1:0},consent:{status:"granted",source:"admesh_ui_sdk",scope:{intent_based_monetization:!0,agent_participation:!0,measurement:!0},constraints:{allow_identity_downstream:!1}},classification_input:{type:"interaction",interaction:{session:{id:l.sessionId,turn_index:re},surface:{channel:l.platformSurface==="embedded_assistant"?"conversation":l.platformSurface||"conversation",interaction_mode:"text",platform:ye,form_factor:ae,locale:l.language||"en-US",country:q,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((c=l.location)==null?void 0:c.city)||void 0,state:((x=l.location)==null?void 0:x.state)||void 0,state_code:((A=l.location)==null?void 0:A.stateCode)||void 0,country:((N=l.location)==null?void 0:N.country)||void 0,country_code:q,zipcode:((G=l.location)==null?void 0:G.zipcode)||void 0,latitude:(S=l.location)==null?void 0:S.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:B}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(C=(W=se.classification_input.interaction)==null?void 0:W.input.query_text)!=null&&C.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ve=JSON.stringify(se);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:se.message_id,specVersion:se.spec_version,classificationType:se.classification_input.type,platformId:se.platform.platform_id,surfaceChannel:(V=se.classification_input.interaction)==null?void 0:V.surface.channel,sessionId:(R=(D=se.classification_input.interaction)==null?void 0:D.session)==null?void 0:R.id});const Ve={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`,"X-AdMesh-Transport":typeof window<"u"||this.config.extension?"browser":"server"};if(this.config.extension){Ve["X-AdMesh-Source"]="extension";const ie=this.getExtensionSourceDomain();ie&&(Ve["X-AdMesh-Source-Domain"]=ie)}const ne=(async()=>{const ie=await fetch(U,{method:"POST",headers:Ve,body:ve});if(!ie.ok){const Fe=(await ie.json().catch(()=>({}))).detail||`HTTP ${ie.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Fe}`)}const xe=await ie.json();return F.log("[AdMeshSDK] \u{1F4E5} Raw response from /aip/context:",{status:xe.status,recommendationId:xe.recommendation_id,hasRecommendation:!!xe.recommendation,hasTracking:!!xe.tracking,hasDelegation:!!xe.delegation,topLevelKeys:Object.keys(xe)}),F.log("[AdMeshSDK] \u{1F4E6} Full PlatformResponse received from /aip/context",xe),xe})();Lo.inFlightPlatformResponses.set(te,ne);try{return await ne}finally{Lo.inFlightPlatformResponses.delete(te)}}async trackPublisherAssistantEvent(l){const m=Array.isArray(l)?{events:l}:l,c=await fetch(`${this.apiBaseUrl}/analytics/publisher-assistant/events`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(m),keepalive:!0});if(!c.ok){const x=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${x}`)}}async reportSponsoredRecommendation(l){const m=await fetch(`${this.apiBaseUrl}/analytics/recommendation-reports`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(l),keepalive:!0});if(!m.ok){const c=await m.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${m.status}): ${c}`)}}fireFollowupExposure(l,m,c){this.getTracker().fireFollowupExposure(l,m,c)}async fireFollowupEngagement(l,m,c){return this.getTracker().fireFollowupEngagement(l,m,c)}};eo(Uc,"inFlightPlatformResponses",new Map);let Kc=Uc;const Hc=v.createContext(void 0);function Qc(){const s=v.useContext(Hc);if(!s)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return s}function Gc(){const s=Qc();return{sdk:s.sdk,apiKey:s.apiKey,sessionId:s.sessionId,theme:s.theme,language:s.language,location:s.location,userId:s.userId,model:s.model,messages:s.messages,processedMessageIds:s.processedMessageIds,recommendationResults:s.recommendationResults,activeDelegationSession:s.activeDelegationSession,markMessageAsProcessed:s.markMessageAsProcessed,isMessageProcessed:s.isMessageProcessed,setRecommendationResult:s.setRecommendationResult,getRecommendationResult:s.getRecommendationResult,hasRecommendationResult:s.hasRecommendationResult,setActiveDelegationSession:s.setActiveDelegationSession,getActiveDelegationSession:s.getActiveDelegationSession,hasActiveDelegationSession:s.hasActiveDelegationSession,refreshDelegationActivity:s.refreshDelegationActivity,stopDelegationSession:s.stopDelegationSession}}const xh=({className:s,size:l=20})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[f.jsx("path",{d:"M5 12h14"}),f.jsx("path",{d:"M12 5v14"})]}),wh=({recommendation:s,theme:l,sdk:m,sessionId:c,onExecuteQuery:x})=>{var A,N,G,S,y;const W=(N=(A=s.recommendation)==null?void 0:A.creative)!=null&&N.follow_up_suggestion&&(G=s.tracking)!=null&&G.followup_engagement_url&&(S=s.tracking)!=null&&S.followup_exposure_url?{query:s.recommendation.creative.follow_up_suggestion,engagement_url:s.tracking.followup_engagement_url,exposure_url:s.tracking.followup_exposure_url}:null,C=W?.query,V=W?.engagement_url,D=W?.exposure_url,R=s.recommendation_id,U=((y=s.recommendation)==null?void 0:y.offerId)||R;if(!C||!V||!D)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const Q=async()=>{try{V&&R&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await m.fireFollowupEngagement(V,R,c)),x&&C?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${C}`),await x(C)):F.warn("[AdMeshFollowup] \u26A0\uFE0F onExecuteQuery not provided - cannot execute query")}catch(te){F.error("[AdMeshFollowup] Error handling follow-up click:",te)}};return f.jsx(ls,{productId:U,recommendationId:R||"",exposureUrl:D,sessionId:c,className:"admesh-followup-container",style:{width:"100%"},children:f.jsxs("div",{className:"flex flex-col space-y-3 text-sm admesh-followup-wrapper",children:[f.jsx("div",{className:"h-px w-full bg-[#E5E5E5] dark:bg-[#262626] admesh-divider"}),f.jsxs("div",{onClick:Q,className:"cursor-pointer flex flex-row justify-between font-medium space-x-2 items-center group",role:"button",tabIndex:0,onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&Q()},"aria-label":`Sponsored follow-up: ${C}`,children:[f.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:C}),f.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[f.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 italic admesh-ad-label",children:"Ad"}),f.jsx(xh,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Qa=({theme:s,onRecommendationsShown:l,onError:m,messageId:c,query:x,userId:A,initialRecommendation:N,triggerExposureUrl:G=!0,followups_container_id:S,onPasteToInput:y,onDelegationConsent:W,onDelegationActivated:C,onStartDelegation:V,onRecommendationReport:D,onExecuteQuery:R,onFollowupDetected:U,isContainerReady:Q})=>{var te,le,re,ye;const{sdk:ae,sessionId:q,apiKey:B,language:be,location:se,userId:ve,model:Ve,messages:ne,theme:ie,getRecommendationResult:xe,hasRecommendationResult:Fe,setRecommendationResult:E,activeDelegationSession:$,setActiveDelegationSession:oe,hasActiveDelegationSession:ke}=Gc(),Me=s||ie,p=X=>!!X&&X.status==="generated"&&!!X.recommendation,M=A||ve,[H,Y]=v.useState(null),[Se,_e]=v.useState(null),[ze,Re]=v.useState(!0),[et,Be]=v.useState(null),Oe=v.useRef(null),Tt=v.useRef(!1),ee=v.useRef(!1),ue=v.useRef(l),fe=v.useRef(m);v.useEffect(()=>{ue.current=l,fe.current=m},[l,m]),v.useEffect(()=>{Oe.current!==c&&(Oe.current=null,ee.current=!1,Y(null),_e(null))},[c]);const Pe=ke()&&$?.session_id===q;v.useEffect(()=>{var X,Ge,Z;if(!c||!Fe(c)||Pe)return;const K=xe(c);if(!K){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),Y(null),_e(null),Be(null),Re(!1),Oe.current=c,Tt.current=!1,ee.current=!0;return}let Ie=((X=K.recommendation)==null?void 0:X.format)||"tail";(Ie==="weave"||Ie==="product_card")&&(Ie="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:c,recommendationId:K.recommendation_id,format:(Ge=K.recommendation)==null?void 0:Ge.format}),Y(K),_e(Ie),Be(null),Re(!1),Oe.current=c,Tt.current=!1,ee.current=!0,(Z=ue.current)==null||Z.call(ue,c,K)},[xe,Fe,Pe,c]),v.useEffect(()=>{var X,Ge,Z,K,Ie,Le,Sn;if(!(!N||!c)&&!Pe)try{const vt=N,dn=N.status||"unknown";if(!p(vt)){if(dn==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),Y(null),_e(null),Be(null),Re(!1),Oe.current=c,Tt.current=!1,ee.current=!0,E(c,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${dn})`)}let it=((X=vt.recommendation)==null?void 0:X.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),Y(vt),_e(it),Be(null),Re(!1),Oe.current=c,Tt.current=!1,ee.current=!0,E(c,vt),(Ge=ue.current)==null||Ge.call(ue,c,vt),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:c,recommendationId:vt.recommendation_id,format:(Z=vt.recommendation)==null?void 0:Z.format,brandName:(Ie=(K=vt.recommendation)==null?void 0:K.creative)==null?void 0:Ie.brand_name,headline:(Sn=(Le=vt.recommendation)==null?void 0:Le.creative)==null?void 0:Sn.headline,hasTracking:!!vt.tracking})}catch(vt){const dn=vt instanceof Error?vt:new Error(String(vt));ee.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${dn.message}`)}},[Pe,N,c,E]),v.useEffect(()=>{if(!c||!x||x.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),Re(!1);return}if(Pe){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:c,conversationSessionId:q,delegationSessionId:$?.delegation_session_id}),Y(null),_e(null),Be(null),Re(!1),Tt.current=!1;return}if(!(ae!=null&&ae.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),Re(!1);return}if(ee.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Oe.current===c){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(Tt.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Fetch already in progress, skipping duplicate fetch");return}F.log("[AdMeshRecommendations] \u{1F4E4} Fetching recommendation from /aip/context (single fetch)"),(async()=>{var X,Ge,Z,K,Ie,Le,Sn,vt,dn;try{Tt.current=!0,Re(!0),Be(null);const it=await ae.fetchPlatformResponse({query:x.trim(),sessionId:q,messageId:c,language:be,location:se,userId:M,model:Ve,...ne&&ne.length>0&&{messages:ne}}),Xt=it?.status||"unknown";if(!p(it)){if(Xt==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),Y(null),_e(null),Be(null),Re(!1),Tt.current=!1,Oe.current=c,E(c,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Xt})`)}Y(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:c,recommendationId:it.recommendation_id,format:(X=it.recommendation)==null?void 0:X.format,brandName:(Z=(Ge=it.recommendation)==null?void 0:Ge.creative)==null?void 0:Z.brand_name,headline:(Ie=(K=it.recommendation)==null?void 0:K.creative)==null?void 0:Ie.headline,hasTracking:!!it.tracking});let Dt=((Le=it.recommendation)==null?void 0:Le.format)||"tail";(Dt==="weave"||Dt==="product_card")&&(Dt="tail"),_e(Dt),Oe.current=c,E(c,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Sn=it.recommendation)==null?void 0:Sn.format,selected_format:Dt}),Re(!1),Tt.current=!1,(vt=ue.current)==null||vt.call(ue,c,it)}catch(it){const Xt=it instanceof Error?it:new Error(String(it));Xt.message.includes("Failed to fetch")||Xt.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${Xt.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${Xt.message} `),Be(Xt),Re(!1),Tt.current=!1,(dn=fe.current)==null||dn.call(fe,Xt)}})()},[$?.delegation_session_id,Pe,ae,q,c,x,be,se,M,Ve,N,E]),v.useEffect(()=>{var X,Ge,Z,K;if(!H||!U)return;const Ie=(Ge=(X=H.recommendation)==null?void 0:X.creative)!=null&&Ge.follow_up_suggestion&&(Z=H.tracking)!=null&&Z.followup_engagement_url&&(K=H.tracking)!=null&&K.followup_exposure_url?{label:H.recommendation.creative.follow_up_suggestion,query:H.recommendation.creative.follow_up_suggestion,engagement_url:H.tracking.followup_engagement_url,exposure_url:H.tracking.followup_exposure_url}:null;Ie&&U(Ie,H.recommendation_id)},[H,U]);const De=v.useCallback(async X=>{if(!ae||!q)throw new Error("AdMesh SDK activation requires an initialized session");const Ge=await fetch(`${ae.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${B}`},body:JSON.stringify({session_id:q,recommendation_id:X.recommendation_id,metadata:X.metadata})});if(!Ge.ok){const Le=await Ge.text();throw new Error(`Failed to activate delegation session: ${Ge.status} ${Le}`)}const Z=await Ge.json(),K={...X,delegation_session_id:Z.delegation_session_id||X.delegation_session_id,session_id:Z.session_id||q,brand_id:Z.brand_id||X.brand_id,brand_name:Z.brand_name||X.brand_name,mcp_endpoint:Z.mcp_endpoint,eligibility_reason:Z.eligibility_reason||X.eligibility_reason,delegate_reason:Z.delegate_reason||X.delegate_reason,session_goal:Z.session_goal||X.session_goal,desired_outcome_type:Z.desired_outcome_type||X.desired_outcome_type,required_user_inputs:Z.required_user_inputs||X.required_user_inputs||[],required_consent_types:Z.required_consent_types||X.required_consent_types||[],success_outcome:Z.success_outcome||X.success_outcome,fallback_message:Z.fallback_message||X.fallback_message,session_mode:"inline",status:Z.status||"active",capabilities:Z.capabilities||X.capabilities||[],allowed_data_types:Z.allowed_data_types||X.allowed_data_types||[],auth_model:Z.auth_model||X.auth_model,handoff_protocol:Z.handoff_protocol||X.handoff_protocol,supported_actions:Z.supported_actions||X.supported_actions||[],metadata:Z.metadata||X.metadata},Ie={delegation_session_id:Z.delegation_session_id,recommendation_id:X.recommendation_id,session_id:Z.session_id||q,brand_agent_id:Z.brand_agent_id,brand_id:Z.brand_id||X.brand_id,brand_name:Z.brand_name||X.brand_name||"Brand",mcp_endpoint:Z.mcp_endpoint,status:Z.status||"active",activated_at:Z.created_at,last_activity_at:Z.updated_at,expires_at:Z.expires_at||Z.updated_at,eligibility_reason:Z.eligibility_reason||X.eligibility_reason,delegate_reason:Z.delegate_reason||X.delegate_reason,session_goal:Z.session_goal||X.session_goal,desired_outcome_type:Z.desired_outcome_type||X.desired_outcome_type,required_user_inputs:Z.required_user_inputs||X.required_user_inputs||[],required_consent_types:Z.required_consent_types||X.required_consent_types||[],success_outcome:Z.success_outcome||X.success_outcome,fallback_message:Z.fallback_message||X.fallback_message,capabilities:Z.capabilities||X.capabilities||[],allowed_data_types:Z.allowed_data_types||X.allowed_data_types||[],consent_requirements:Z.consent_requirements||X.consent_requirements||[],auth_model:Z.auth_model||X.auth_model,handoff_protocol:Z.handoff_protocol||X.handoff_protocol,supported_actions:Z.supported_actions||X.supported_actions||[],metadata:Z.metadata||X.metadata};if(oe(Ie),await ae.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:q,recommendation_id:X.recommendation_id,delegation_session_id:Z.delegation_session_id,brand_name:Ie.brand_name,status:Z.status||"active",metadata:{brand_agent_id:Z.brand_agent_id,source:"recommendation_card"}}).catch(Le=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",Le)}),await ae.reportDelegationSessionStarted(Ie,{brand_agent_id:Z.brand_agent_id,brand_name:Ie.brand_name}).then(Le=>{Le&&oe(Le)}).catch(Le=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",Le)}),C){try{await C(K)}catch(Le){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",Le)}return}if(V)try{await V({...X.platform_response,delegation:{...X.platform_response.delegation,...K,delegation_session_id:Z.delegation_session_id,available:!0,status:Z.status||"active"}})}catch(Le){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",Le)}},[B,C,V,ae,q,oe]),_t=v.useCallback(async X=>{var Ge,Z;if(D){await D(X);return}!ae||!q||await ae.reportSponsoredRecommendation({session_id:q,message_id:c,recommendation_id:X.recommendation_id,reason:X.reason,brand_name:(Z=(Ge=X.recommendation.recommendation)==null?void 0:Ge.creative)==null?void 0:Z.brand_name,metadata:{reason:X.reason,source:"recommendation_card"}}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",K)})},[c,D,ae,q]);if(!c||!x||x.trim()===""||ze||et)return null;if(!H||!Se)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:c,hasPlatformResult:!!H,detectedFormat:Se,isLoading:ze,hasError:!!et}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:c,recommendationId:H.recommendation_id,detectedFormat:Se,brandName:(le=(te=H.recommendation)==null?void 0:te.creative)==null?void 0:le.brand_name,headline:(ye=(re=H.recommendation)==null?void 0:re.creative)==null?void 0:ye.headline});const Rt=typeof document<"u"&&S&&(Q??!0)?document.getElementById(S):null;return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:f.jsx(Oc,{recommendations:[H],theme:Me,sessionId:q,triggerExposureUrl:G,onPasteToInput:y,onDelegationConsent:W,onDelegationActivated:De,onStartDelegation:V,onRecommendationReport:_t})}),Rt&&ae&&q?os.createPortal(f.jsx(wh,{recommendation:H,theme:Me,sdk:ae,sessionId:q,onExecuteQuery:R}),Rt):null]})},ss="admesh-ui-sdk-styles",us="admesh-ui-sdk-reset",kh=`
248
248
  /* AdMesh UI SDK - CSS Reset & Normalization */
249
249
  .admesh-component,
250
250
  .admesh-component * {
@@ -333,7 +333,7 @@ Article topic inferred from URL path: ${f}`,url:u,domain:l.hostname,extracted_at
333
333
  .admesh-component[data-admesh-theme="light"] {
334
334
  color-scheme: light;
335
335
  }
336
- `,xh=`
336
+ `,Sh=`
337
337
  /* AdMesh Core Component Styles */
338
338
 
339
339
  .admesh-component {
@@ -544,7 +544,7 @@ Article topic inferred from URL path: ${f}`,url:u,domain:l.hostname,extracted_at
544
544
  font-size: 0.875rem;
545
545
  }
546
546
  }
547
- `,wh=()=>{if(!(typeof document>"u")&&!(document.getElementById(as)&&document.getElementById(os))){if(!document.getElementById(as)){const u=document.createElement("style");u.id=as,u.textContent=bh,document.head.appendChild(u)}if(!document.getElementById(os)){const u=document.createElement("style");u.id=os,u.textContent=xh,document.head.appendChild(u)}}},kh=`
547
+ `,_h=()=>{if(!(typeof document>"u")&&!(document.getElementById(us)&&document.getElementById(ss))){if(!document.getElementById(us)){const s=document.createElement("style");s.id=us,s.textContent=kh,document.head.appendChild(s)}if(!document.getElementById(ss)){const s=document.createElement("style");s.id=ss,s.textContent=Sh,document.head.appendChild(s)}}},Eh=`
548
548
  /* AdMesh UI SDK - Complete Self-Contained Styles */
549
549
 
550
550
  /* CSS Reset for AdMesh components */
@@ -1212,15 +1212,15 @@ Article topic inferred from URL path: ${f}`,url:u,domain:l.hostname,extracted_at
1212
1212
  .admesh-component .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
1213
1213
  .admesh-component .lg\\:col-span-1 { grid-column: span 1 / span 1; }
1214
1214
  }
1215
- `;let Qc=!1;const _h=()=>{b.useEffect(()=>{if(!Qc){try{wh();const u=document.createElement("style");u.id="admesh-ui-sdk-styles-legacy",u.textContent=kh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(u),Qc=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Sh=()=>{};function Ch(u){const l=Math.max(1,Math.round(u));if(l<60)return`${l}s`;const f=Math.floor(l/60),d=l%60;return d>0?`${f}m ${d}s`:`${f}m`}function Eh(u){return Ch(u/1e3)}const is=({content:u,theme:l,fontSize:f})=>{const d=N=>N.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((P,H)=>{if(P.startsWith("**")&&P.endsWith("**")&&P.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:P.slice(2,-2)},H);const V=P.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return V?m.jsx("a",{href:V[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:V[1]},H):m.jsx(b.Fragment,{children:P},H)}),k=N=>N.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(P=>P.trim()).filter((P,H,V)=>P.length>0||H<V.length-1),M=N=>{const P=k(N);return P.length>1&&P.every(H=>/^:?-{3,}:?$/.test(H))},L=N=>{const P=N.indexOf("|");if(P<=0)return{heading:null,headerLine:N};const H=N.slice(0,P).trim();return!H||/^[-|:\s]+$/.test(H)?{heading:null,headerLine:N}:{heading:H,headerLine:N.slice(P).trim()}},X=(N,P)=>{const H=k(N).length,V=k(P).length;return H<=1||H===V?P:`| ${Array.from({length:H},()=>"---").join(" | ")} |`},S=N=>{if(N.length<2||!N[0].includes("|"))return{heading:null,lines:N};const{heading:P,headerLine:H}=L(N[0]),V=H.startsWith("|")?H:`| ${H}`,ee=X(V,N[1]);return{heading:P,lines:[V,ee,...N.slice(2)]}},y=N=>{if(N.length<2||!N[0].includes("|"))return!1;const{lines:P}=S(N);return M(P[1])&&k(P[0]).length>=2},$=N=>{if(!N.includes("|"))return[N];let P=N.trim();const H=[],V=P.indexOf("|");if(V>0){const ee=P.slice(0,V).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(H.push(ee),P=P.slice(V).trim())}return P=P.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,se)=>`
1216
- ${se}`),P=P.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
1217
- | `),P=P.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
1218
- `),H.push(...P.split(`
1219
- `).map(ee=>ee.trim()).filter(Boolean)),H},E=N=>{const P=N.split(`
1220
- `),H=[];for(const V of P){if(!V.includes("|")){H.push(V);continue}H.push(...$(V))}return H.join(`
1221
- `)},W=(N=>{const P=E(N).split(`
1222
- `),H=[];let V=0;for(;V<P.length;){const ee=P[V],se=P[V+1]||"";if(ee.includes("|")&&M(se)){H.length>0&&H[H.length-1].trim()&&H.push("");const{heading:oe,headerLine:re}=L(ee);for(oe&&H.push(oe),H.push(re,X(re,se)),V+=2;V<P.length&&P[V].includes("|")&&P[V].trim();)H.push(P[V]),V+=1;V<P.length&&P[V].trim()&&H.push("");continue}H.push(ee),V+=1}return H.join(`
1223
- `)})(u).split(/\n\s*\n/).map(N=>N.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:f},children:W.map((N,P)=>{const H=N.split(`
1224
- `).map(re=>re.trim()).filter(Boolean),V=H.every(re=>/^[-*]\s+/.test(re)),ee=H.every(re=>/^\d+\.\s+/.test(re)),se=H.length===1&&/^#{1,3}\s+/.test(H[0]),oe=y(H);if(se){const re=H[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:d(re)},P)}if(oe){const{heading:re,lines:ae}=S(H),Q=k(ae[0]),U=ae.slice(2).map(k).filter(he=>he.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[re?m.jsx("p",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:f},children:d(re)}):null,m.jsx("div",{style:{border:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,borderRadius:8,overflowX:"auto"},children:m.jsxs("table",{style:{width:"100%",minWidth:Q.length>3?520:void 0,borderCollapse:"collapse",color:l.textColor,fontSize:f,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((he,ce)=>m.jsx("th",{style:{textAlign:"left",padding:"9px 10px",fontWeight:600,background:l.surfaceColor||"rgba(148, 163, 184, 0.12)",borderBottom:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,whiteSpace:"normal"},children:d(he)},ce))})}),m.jsx("tbody",{children:U.map((he,ce)=>m.jsx("tr",{children:he.map((ye,$e)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:ce===U.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:d(ye)},$e))},ce))})]})})]},P)}if(V||ee){const re=ee?"ol":"ul";return m.jsx(re,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:f},children:H.map((ae,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:d(ae.replace(/^([-*]|\d+\.)\s+/,""))},Q))},P)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:f,whiteSpace:"pre-wrap"},children:H.map((re,ae)=>m.jsxs(b.Fragment,{children:[ae>0&&m.jsx("br",{}),d(re)]},ae))},P)})})};function Va(u){return u===void 0?void 0:typeof u=="number"?`${u}px`:u}function Bc(u){if(typeof u=="number")return u;if(typeof u!="string")return;const l=Number(u.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function Po(u){return u.replace(/\s+/g," ").trim()}function Ah(u,l){const f=u.filter(L=>!(L!=null&&L.is_sponsored)).slice(0,3),d=l.filter(L=>!(L!=null&&L.is_sponsored)).slice(0,3),k=l.find(L=>L?.is_sponsored);if(!k)return d.length?d:f;const M=d.length?d:f;return[k,...M].slice(0,4)}function Ih(u,l,f,d){const k=new Set,M=[],L=(E,W="information")=>{const N=Po(E);if(!N)return;const P=N.toLowerCase();k.has(P)||(k.add(P),M.push({id:`followup_${M.length}_${P.replace(/[^a-z0-9]+/g,"_")}`,text:N,type:W,is_sponsored:!1}))},X=new Set,S=E=>{const W=Po(E||"");if(!W)return;const N=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();N&&X.add(N)};(d||[]).forEach(E=>S(E?.title)),(f||[]).forEach(E=>S(E?.title)),l.split(/\n+/).map(E=>Po(E.replace(/^[-*]\s+/,""))).filter(Boolean).filter(E=>E.length>=24&&E.length<=90).forEach(E=>{X.size>=6||S(E)});const y=Po(u.replace(/[?.!]+$/g,"")),$=Array.from(X).slice(0,3);return[$[0]?`Tell me more about ${$[0]}`:"",$[1]?`Show me examples related to ${$[1]}`:"",$[2]?`Compare the main options for ${$[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((E,W)=>{M.length>=3||L(E,W===0?"comparison":"information")}),M.slice(0,3)}function Ph(){if(typeof window>"u")return"unknown";const u=window.innerWidth;return u<768?"mobile":u<1024?"tablet":"desktop"}function Kc(u){return u?{shell:{position:"fixed",left:0,right:0,bottom:0,width:"100%",maxWidth:"100%",height:"calc(100dvh - env(safe-area-inset-bottom, 0px))",maxHeight:"calc(100dvh - env(safe-area-inset-bottom, 0px))",padding:0,margin:0,zIndex:2147483001,boxSizing:"border-box"},panelWidth:"100%",panelMaxWidth:"100%",panelHeight:"100%",panelMaxHeight:"100%",panelBorderRadius:"0"}:{shell:{position:"fixed",left:"50%",bottom:"12px",transform:"translateX(-50%)",width:"min(960px, calc(100vw - 24px))",maxWidth:"100%",maxHeight:"calc(100vh - 24px)",zIndex:2147483001,boxSizing:"border-box"},panelWidth:"min(960px, calc(100vw - 24px))",panelMaxWidth:"100%",panelHeight:"min(78vh, 760px)",panelMaxHeight:void 0,panelBorderRadius:"12px"}}function Xc(u){const l=u?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const f=new URL(l);return!!(f.protocol&&f.hostname)}catch{return!1}}function Gc(){var u;try{const l=(u=window.location.href)==null?void 0:u.trim();if(Xc(l))return l}catch{return}}function Jc(u){if(typeof window>"u")return{page_url:void 0,page_path:void 0,article_slug:void 0,page_title:void 0,referrer:void 0,device_type:"unknown"};const l=Gc()||(Xc(u)?u.trim():void 0);let f=l?window.location.pathname||"/":void 0;try{f=l?new URL(l).pathname||"/":void 0}catch{f=Gc()?window.location.pathname||"/":void 0}const d=(f||"").split("/").filter(Boolean);return{page_url:l,page_path:f,article_slug:d[d.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Ph()}}function Rh(u){var l,f;const d=(f=(l=u?.recommendation)==null?void 0:l.creative)==null?void 0:f.follow_up_suggestion,k=u?.recommendation_id;return!d||!k?null:{id:k,text:Po(d),type:"action",is_sponsored:!0,recommendation:u,metadata:{source:"assistant_query_recommendation",recommendation_id:k}}}function ls(u){return[...u].sort((l,f)=>{const d=!!l.is_sponsored,k=!!f.is_sponsored;return d===k?0:d?-1:1})}const Mh={mode:"light",primaryColor:"#3b82f6",secondaryColor:"#64748b",backgroundColor:"#ffffff",surfaceColor:"#f8fafc",borderColor:"#e2e8f0",textColor:"#1e293b",textSecondaryColor:"#64748b",borderRadius:"0.5rem",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px 0 rgb(0 0 0 / 0.05)",medium:"0 4px 6px -1px rgb(0 0 0 / 0.1)",large:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}},Dh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},zh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Nh=({theme:u,className:l,style:f,triggerLabel:d="Ask Ava",headerTitle:k="Ask Ava",headerLogoUrl:M,showHeader:L=!0,showHeaderTitle:X=!0,showSubtitle:S=!0,layout:y="floating",surface:$="page",adSlotBehavior:E="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:N=!0,showCompactSlotInput:P=!0,showCompactSlotDisclaimer:H=!0,panelWidth:V,panelHeight:ee,analyticsPageUrl:se,fontScale:oe=1,position:re="bottom-right",size:ae="md",defaultOpen:Q,open:U,onOpenChange:he,autoOpen:ce=!1,showWelcomeMessage:ye=!1,welcomeMessage:$e="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:te="Ask me anything about products...",adsEnabled:le=!0,suggestions:xe,maxSuggestions:Pe=6,suggestionStyle:C="carousel",suggestionTrigger:q="always",suggestionPlacement:ie="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:p="default",queryHandler:I,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ve="Publisher Assistant",relatedItemsHeading:Ae="Related reading",onOpen:Le,onClose:Ne})=>{const{sdk:je,sessionId:We,theme:Bt,apiKey:ne,userId:de}=Vc(),{suggestions:ge,isAnalyzingIntent:Me,intentError:De,retryIntentAnalysis:Z,activeDelegationSession:Oe,hasActiveDelegationSession:K,stopDelegationSession:He,refreshDelegationActivity:Ge}=Hc();_h(),console.log("[AdMeshIntentAssistant] Context:",{sdk:je,sessionId:We,hasContextTheme:!!Bt});const B=u||Bt||Mh,Ze=B?.mode||"light",Fe=$==="ad-slot",un=(c=!1)=>Fe&&!(c&&E==="expand"),[it,Kt]=b.useState(Q||ce),Mn=U!==void 0,Ro=Mn?U:it,[bn,Hr]=b.useState(""),[Xt,Nt]=b.useState(!1),[ot,ft]=b.useState([]),[Be,cn]=b.useState(!1),[Vr,fn]=b.useState(null),[fe,pn]=b.useState(!1),[xn,be]=b.useState(new Set),[tt,Zt]=b.useState(xe||ge||[]),[Mo,Yn]=b.useState(0),[dr,Do]=b.useState(0),[Qr,Fi]=b.useState({}),zo=b.useRef(null),er=b.useRef(!1),hn=b.useRef(null),ra=b.useRef(new Map),Br=b.useRef([]),Dn=b.useRef(null),Ct=b.useRef(null),qt=b.useRef(null),mr=b.useRef(!1),oa=b.useRef(!1),$i=b.useRef(null),aa=b.useRef(null),ia=b.useRef(null),[kr,Qa]=b.useState(!1),[fr,Kr]=b.useState(!1),dn=b.useRef(null),Rt=b.useRef(null),jt=!!(ne!=null&&ne.toLowerCase().startsWith("pub_")),Yt=K()&&Oe?.session_id===We?Oe:null,la=b.useRef(new Set),pr=b.useRef(new Set),_r=b.useRef(!1),Xr=Fe&&E==="expand"&&(fe||Be),[No,Oi]=b.useState(!1);b.useEffect(()=>{if(typeof window>"u")return;const c=window.matchMedia("(max-width: 767px)"),D=()=>Oi(c.matches);return D(),c.addEventListener("change",D),()=>c.removeEventListener("change",D)},[]),b.useEffect(()=>{if(!Xr||typeof document>"u")return;const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[Xr]);const Ba=Fe&&E==="sticky"&&(fe||ot.length>0||Be),wn=Va(V)??"100%",tr=Va(ee)??"100%",nr=Bc(V),gn=Bc(ee),Ka=Fe&&(gn??Number.POSITIVE_INFINITY)<=60,mn=Fe&&(nr??Number.POSITIVE_INFINITY)<=360&&(gn??Number.POSITIVE_INFINITY)<=120,Sr=b.useCallback(c=>D=>{D?ra.current.set(c,D):ra.current.delete(c)},[]),yt=b.useCallback(async(c,D={})=>{if(!(!je||!We))try{await je.trackPublisherAssistantEvent({event_name:c,timestamp:new Date().toISOString(),session_id:We,...Jc(se),...D})}catch(z){console.warn(`[AdMeshIntentAssistant] Failed to track ${c}`,z)}},[se,je,We]),hr=b.useCallback((c,D,z)=>{var T,J;const me=D?.recommendation_id;if(!me)return;const Ye=`${c}:${me}`;pr.current.has(Ye)||(pr.current.add(Ye),yt("recommendation_shown",{message_id:c,query:z,recommendation_id:me,brand_name:(J=(T=D.recommendation)==null?void 0:T.creative)==null?void 0:J.brand_name,is_sponsored:!0}))},[yt]),Xa=b.useCallback((c,D,z,T,J,me)=>{const Ye=Array.isArray(me)&&me.length?me.map((Te,Ue)=>{const kt=Po(Te.text||"");return kt?{id:`followup_llm_${Ue}_${kt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:kt,type:Te.type||"information",is_sponsored:!1}:null}).filter(Te=>!!Te).slice(0,3):Ih(c,D,z,T),At=Rh(J),Lt=At?[At,...Ye.slice(0,2)]:Ye.slice(0,3);Lt.length&&Zt(ls(Lt))},[]),en=b.useCallback((c,D)=>{const z=Po(c.query||c.label||"");if(!z||!D)return;const T={id:D,text:z,type:"action",is_sponsored:!0,recommendation:{recommendation_id:D,recommendation:{creative:{follow_up_suggestion:z}},tracking:{followup_engagement_url:c.engagement_url,followup_exposure_url:c.exposure_url}}};Zt(J=>{const me=J.filter(Ye=>!Ye.is_sponsored).slice(0,3);return ls([T,...me].slice(0,4))})},[]),sa=b.useCallback(()=>{const c=Dn.current,D=Ct.current;if(!c||!D)return!1;const z=c.getBoundingClientRect(),T=D.getBoundingClientRect(),J=Math.max(0,c.scrollTop+T.top-z.top);return c.scrollTop=J,!0},[]);b.useLayoutEffect(()=>{var c;if(mr.current){sa()&&(mr.current=!1);return}oa.current||(c=aa.current)==null||c.scrollIntoView({behavior:"smooth"})},[ot,sa]),b.useLayoutEffect(()=>{if(!Fe||Xr)return;const c=$i.current;if(!c)return;const D=c.closest(".admesh-publisher-assistant-reactMount"),z=tr;[c,D].forEach(J=>{J&&(J.style.width=wn,J.style.maxWidth=wn,J.style.height=z,J.style.maxHeight=z,J.style.overflow="hidden",J.style.boxSizing="border-box",J.dataset.admeshAdSlotExpanded=Ba?"true":"false")});const T=D?.parentElement;T&&T!==document.body&&T!==document.documentElement&&(T.style.width=wn,T.style.maxWidth=wn,T.style.height=z,T.style.maxHeight=z,T.style.overflow="hidden",T.style.boxSizing="border-box")},[tr,wn,Xr,Fe,Ba]),b.useEffect(()=>{if(xe&&xe.length){Zt(xe);return}ge&&ge.length&&Zt(c=>Ah(c,ge))},[xe,ge]),b.useEffect(()=>{if(p!=="default"||!G)return;let c=!1;return G().then(D=>{!c&&Array.isArray(D)&&D.length&&Zt(D)}).catch(D=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",D)}),()=>{c=!0}},[G,p]),b.useEffect(()=>{if(!Be){Do(0),zo.current=null;return}zo.current==null&&(zo.current=typeof performance<"u"?performance.now():Date.now());const c=()=>{const z=zo.current;if(z==null)return;const T=typeof performance<"u"?performance.now():Date.now();Do(Math.floor((T-z)/1e3))};c();const D=window.setInterval(c,1e3);return()=>window.clearInterval(D)},[Be]),b.useEffect(()=>{if(!Be||p!=="default"){Yn(0);return}const c=window.setInterval(()=>{Yn(D=>Math.min(D+1,7))},3e3);return()=>window.clearInterval(c)},[Be,p]),b.useEffect(()=>{_r.current||!je||!We||(_r.current=!0,yt("assistant_loaded",{metadata:{layout:y,surface:$,variant:p,default_open:Q||ce}}))},[ce,Q,y,je,We,$,yt,p]);const rr=b.useCallback(c=>{Mn?he?.(c):Kt(c),c?(yt("assistant_opened",{metadata:{layout:y,surface:$,ad_slot_behavior:E,variant:p,expanded:fe}}),Le?.()):Ne?.()},[Mn,fe,y,he,Le,Ne,$,yt,p]),ua=b.useCallback(()=>{rr(!0)},[rr]),Gr=b.useCallback(()=>{rr(!1)},[rr]),Ui=b.useCallback(()=>{pn(c=>!c)},[]),Ga=b.useCallback(async(c,D,z,T,J,me,Ye)=>{var At,Lt,Te;if(!je)return console.warn("[AdMeshIntentAssistant] SDK not available - using fallback response"),{text:"I'm a demo assistant. The SDK is not properly configured, but I can still help with suggestions! Try clicking on one of the suggested questions above."};try{Yt&&await Ge("turn_started",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(ht=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",ht)});const Ue=await fetch(`${je.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:me,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ne}`},body:JSON.stringify({message:c,session_id:We||"default-session",message_id:D,user_id:de,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:Jc(se),conversation_history:Ye,sponsored_recommendation:J!=null&&J.recommendation_id?{recommendation_id:J.recommendation_id,brand_name:(Lt=(At=J.recommendation)==null?void 0:At.creative)==null?void 0:Lt.brand_name}:void 0,active_delegation_session:Yt?{delegation_session_id:Yt.delegation_session_id,recommendation_id:Yt.recommendation_id,session_id:Yt.session_id,brand_name:Yt.brand_name,mcp_endpoint:Yt.mcp_endpoint,status:Yt.status}:void 0}})});if(!Ue.ok)throw new Error(`API request failed: ${Ue.status} ${Ue.statusText}`);const kt=(Te=Ue.body)==null?void 0:Te.getReader(),Gt=new TextDecoder;if(!kt)throw new Error("Response body is not readable");let Ht="",Vt,_n,Hn,Ce,qe;return await(async()=>{try{for(;;){const{done:ht,value:lt}=await kt.read();if(ht)break;const Sn=Gt.decode(lt,{stream:!0}).split(`
1225
- `);for(const St of Sn)if(St.startsWith("data: ")){const nn=St.slice(6);if(nn.trim()==="[DONE]")return Yt&&Ge("turn_completed",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(gt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",gt)}),{text:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe};try{const gt=JSON.parse(nn);switch(gt.type){case"content":{const Qi=gt.content||"";Ht+=Qi,z?.(Qi);break}case"final":{Ht=gt.reply||Ht,Vt=Array.isArray(gt.source_links)?gt.source_links:void 0,_n=Array.isArray(gt.related_items)?gt.related_items:void 0,Hn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:void 0,Ce=typeof gt.used_capability=="string"?gt.used_capability:Ce,qe=typeof gt.response_time_ms=="number"?gt.response_time_ms:qe;break}case"followup_suggestions":{Hn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:Hn;break}case"error":throw new Error(gt.message||"Unknown streaming error");case"session_start":T?.(),console.log("Session started:",gt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(ht){if(me!=null&&me.aborted)return{text:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe,error:"aborted"};throw console.error("Stream processing error:",ht),ht}finally{kt.releaseLock()}return{text:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe}})()}catch(Ue){return me!=null&&me.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",Ue),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:Ue instanceof Error?Ue.message:"request_failed"})}},[je,We,ne,de,Yt,Ge]),gr=b.useCallback(()=>{const c=dn.current;if(!c||c.signal.aborted)return;c.abort(),cn(!1),hn.current=null,er.current=!1;const D=Rt.current;D&&ft(z=>z.map(T=>T.id===D&&!T.content.trim()?{...T,content:"Generation stopped."}:T))},[]),Cr=b.useCallback(async c=>{var D,z,T,J,me,Ye,At,Lt;if(!c.trim()||Be)return;const Te=typeof performance<"u"?performance.now():Date.now(),Ue=c.trim(),kt=Date.now().toString(),Gt=new AbortController,Ht=hn.current,Vt=Ht?.recommendation||null,_n=ot.filter(Ce=>(Ce.role==="user"||Ce.role==="assistant")&&Ce.content.trim()).slice(-6).map(Ce=>({role:Ce.role,content:Ce.content.trim().slice(0,1200)}));dn.current=Gt,Rt.current=null,qt.current=kt,mr.current=!0,oa.current=!0,hn.current=null,Zt(Ce=>Ce.some(qe=>qe.is_sponsored)?Ce.filter(qe=>!qe.is_sponsored):Ce),fn(null);const Hn={id:kt,role:"user",content:Ue,timestamp:new Date};if(yt("query_submitted",{message_id:kt,query:Ue}),ft(Ce=>[...Ce,Hn]),Hr(""),cn(!0),p==="default"&&I){try{const Ce=(Date.now()+1).toString(),qe={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:c,initialRecommendation:null};er.current&&(be(Sn=>new Set([...Sn,Ce])),er.current=!1),ft(Sn=>[...Sn,qe]),Rt.current=Ce;const ht=await I(Ue,{sponsoredSuggestion:Ht});if(Gt.signal.aborted){hn.current=null;return}const lt=ht.recommendation||Vt||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:c,hasResponseRecommendation:!!ht.recommendation,hasSponsoredSuggestionRecommendation:!!Vt,finalRecommendationId:lt?.recommendation_id}),ft(Sn=>Sn.map(St=>St.id===Ce?{...St,content:ht.answer,sourceLinks:ht.source_links,relatedItems:ht.related_items,initialRecommendation:lt,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-Te}:St)),Xa(Ue,ht.answer,ht.source_links,ht.related_items,ht.recommendation||null,ht.followup_suggestions),yt("answer_completed",{message_id:Ce,query:Ue,recommendation_id:lt?.recommendation_id,brand_name:(z=(D=lt?.recommendation)==null?void 0:D.creative)==null?void 0:z.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"completed",metadata:{variant:p,source:"query_handler"}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const qe=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(qe);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(lt=>[...lt,ht]),yt("answer_failed",{query:Ue,status:qe,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,metadata:{variant:p,source:"query_handler"}}),hn.current=null}finally{dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))}return}if(!je){setTimeout(()=>{if(Gt.signal.aborted){dn.current===Gt&&(dn.current=null,Rt.current=null);return}const Ce={id:(Date.now()+1).toString(),role:"assistant",content:"I'm a demo assistant. The SDK is not properly configured, but I can still help! Try clicking on the suggested questions above, or check your AdMesh API key configuration.",timestamp:new Date,recommendations:[],userQuery:c};ft(qe=>[...qe,Ce]),dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),qe=Vt,ht={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:c,initialRecommendation:qe};er.current&&(be(St=>new Set([...St,Ce])),er.current=!1),ft(St=>[...St,ht]),Rt.current=Ce;const lt=await Ga(Ue,kt,St=>{ft(nn=>nn.map(gt=>gt.id===Ce?{...gt,content:gt.content+St}:gt))},()=>{cn(!0),Yn(0)},qe,Gt.signal,_n);if(Gt.signal.aborted){lt.text.trim()||ft(St=>St.map(nn=>nn.id===Ce&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),yt("answer_failed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(J=(T=qe?.recommendation)==null?void 0:T.creative)==null?void 0:J.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"aborted",metadata:{variant:p,source:"api_chat_assistant"}}),hn.current=null;return}const Sn=typeof lt.response_time_ms=="number"?lt.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-Te;ft(St=>St.map(nn=>nn.id===Ce?{...nn,content:lt.text,sourceLinks:lt.source_links,relatedItems:lt.related_items,initialRecommendation:nn.initialRecommendation||qe,responseTimeMs:Sn}:nn)),Xa(Ue,lt.text,lt.source_links,lt.related_items,null,lt.followup_suggestions),lt.error?yt("answer_failed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(Ye=(me=qe?.recommendation)==null?void 0:me.creative)==null?void 0:Ye.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:lt.error,metadata:{variant:p,source:"api_chat_assistant"}}):yt("answer_completed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(Lt=(At=qe?.recommendation)==null?void 0:At.creative)==null?void 0:Lt.brand_name,used_capability:lt.used_capability,latency_ms:Sn,status:"completed",metadata:{variant:p,source:"api_chat_assistant",response_time_ms:Sn}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const qe=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(qe);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(lt=>[...lt,ht]),yt("answer_failed",{query:Ue,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:qe,metadata:{variant:p,source:"api_chat_assistant"}}),hn.current=null}finally{dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))}},[Be,Ga,I,Xa,je,yt,p]),or=tt,jo=b.useMemo(()=>or.some(c=>c?.is_sponsored),[or]),Jr=b.useMemo(()=>or.filter(c=>c&&typeof c.id=="string"?Ee?jo:!0:!1),[jo,Ee,or]),Wt=b.useMemo(()=>ls(Jr),[Jr]),Zr=b.useMemo(()=>ke==="below-input-container"&&le?Wt.find(c=>c.is_sponsored&&c.recommendation)??null:null,[le,Wt,ke]),yr=b.useCallback(async c=>{var D,z,T,J,me,Ye,At;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:c.text,is_sponsored:c.is_sponsored,hasRecommendation:!!c.recommendation,recommendationId:((D=c.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url),sessionId:We}),er.current=c.is_sponsored||!1,hn.current=c.is_sponsored?c:null;const Lt=Wt.findIndex(Te=>Te.id===c.id);yt("suggestion_clicked",{suggestion_id:c.id,suggestion_text:c.text,suggestion_type:c.type,suggestion_position:Lt>=0?Lt:void 0,is_sponsored:c.is_sponsored,recommendation_id:(J=c.recommendation)==null?void 0:J.recommendation_id,brand_name:(At=(Ye=(me=c.recommendation)==null?void 0:me.recommendation)==null?void 0:Ye.creative)==null?void 0:At.brand_name,query:c.text}),Cr(c.text),c.is_sponsored&&c.recommendation&&je?setTimeout(async()=>{var Te;try{const Ue=(Te=c.recommendation.tracking)==null?void 0:Te.followup_engagement_url,kt=c.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:Ue,recommendationId:kt,sessionId:We}),Ue&&kt&&We?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await je.fireFollowupEngagement(Ue,kt,We),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!Ue,hasRecommendationId:!!kt,hasSessionId:!!We})}catch(Ue){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",Ue)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Cr,Wt,je,We,yt]),kn=zh[re],ca=Dh[ae];b.useEffect(()=>{if(Br.current.forEach(c=>c()),Br.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Wt.forEach((c,D)=>{const z=ra.current.get(c.id);if(!z)return;const T=`${We||"anonymous"}:${c.id}:${c.is_sponsored?"s":"o"}`;if(la.current.has(T))return;let J=null,me=null;const Ye=()=>{J&&(clearTimeout(J),J=null),me?.disconnect(),me=null},At=()=>{var Lt,Te,Ue,kt,Gt;if(la.current.has(T)){Ye();return}if(la.current.add(T),Ye(),yt("suggestion_exposure",{suggestion_id:c.id,suggestion_text:c.text,suggestion_type:c.type,suggestion_position:D,is_sponsored:c.is_sponsored,recommendation_id:(Lt=c.recommendation)==null?void 0:Lt.recommendation_id,brand_name:(kt=(Ue=(Te=c.recommendation)==null?void 0:Te.recommendation)==null?void 0:Ue.creative)==null?void 0:kt.brand_name}),je&&We&&c.is_sponsored&&c.recommendation){const Ht=(Gt=c.recommendation.tracking)==null?void 0:Gt.followup_exposure_url,Vt=c.recommendation.recommendation_id;Ht&&Vt?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Ht,recommendationId:Vt,suggestionText:c.text,sessionId:We}),je.fireFollowupExposure(Ht,Vt,We)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Ht,hasRecommendationId:!!Vt,suggestionText:c.text})}};me=new IntersectionObserver(Lt=>{const Te=Lt[0];if(Te){if(Te.intersectionRatio>=.5){J||(J=setTimeout(At,1e3));return}J&&(clearTimeout(J),J=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),me.observe(z),Br.current.push(Ye)}),()=>{Br.current.forEach(c=>c()),Br.current=[]}},[Wt,je,We,yt,Xt]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:Jr.length,isAnalyzingIntent:Me,hasIntentError:!!De,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:jo,sponsoredCount:or.filter(c=>c?.is_sponsored).length,nonSponsoredCount:or.filter(c=>c&&!(c!=null&&c.is_sponsored)).length,modalShouldAppear:Ee?jo:!0,suggestions:or.map(c=>{var D,z,T;return{id:c?.id,text:c?.text,type:c?.type,is_sponsored:c?.is_sponsored,hasRecommendation:!!(c!=null&&c.recommendation),recommendationId:((D=c?.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c?.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url)}}),renderedSuggestions:Wt.map(c=>{var D,z,T;return{id:c?.id,text:c?.text,type:c?.type,is_sponsored:c?.is_sponsored,hasRecommendation:!!(c!=null&&c.recommendation),recommendationId:((D=c?.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c?.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url)}})});const et={base:`${16*oe}px`,sm:`${14*oe}px`,xs:`${12*oe}px`},Er=Y||"AI-generated responses may contain errors. Please verify important information independently.",Yr=["Searching trusted sources...","Reviewing publisher coverage...","Checking relevant context...","Comparing supporting signals...","Identifying the strongest examples...","Organizing the most useful details...","Shaping the response for clarity...","Preparing the clearest answer...","Finishing the response..."],eo=c=>{const D=c?.accentColor||vt,z=c?.metaColor||Lo,T=c?.includeSteps??p==="default",J=`${dr}s`,me=T?`${Yr[Mo]} (${J})`:`Generating answer... ${J}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:c!=null&&c.compact?"8px":"10px",color:z,fontSize:c!=null&&c.compact?et.xs:et.sm},children:[m.jsx("span",{style:{width:c!=null&&c.compact?8:9,height:c!=null&&c.compact?8:9,borderRadius:999,background:D,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${wt(Et,.28)}`,flexShrink:0}}),m.jsx("span",{children:me})]})},da=b.useCallback((c,D)=>{if(Qr[c.id])return;const z=D?"helpful":"not_helpful";Fi(T=>({...T,[c.id]:z})),yt("answer_feedback",{message_id:c.id,query:c.userQuery,status:z,latency_ms:c.responseTimeMs,metadata:{helpful:D}})},[Qr,yt]);function ma(c,D){if(c.role!=="assistant"||!c.content.trim()||Be&&c.id===Rt.current)return null;const z=D?.accentColor||vt,T=D?.metaColor||Lo,J=Qr[c.id],me=typeof c.responseTimeMs=="number";return m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginTop:"10px",paddingTop:"10px",borderTop:`1px solid ${tn}`,flexWrap:"wrap"},children:[m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",minWidth:0,flex:"1 1 auto",flexWrap:"wrap"},children:[m.jsx("span",{style:{fontSize:et.xs,color:T,whiteSpace:"nowrap"},children:J?"Thanks for your feedback":"Is this helpful?"}),J?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:wt(z,.12),color:z,flexShrink:0},children:J==="helpful"?m.jsx(Pc,{size:14}):m.jsx(Ic,{size:14})}):m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexShrink:0},children:[m.jsx("button",{type:"button","aria-label":"Mark answer as helpful",onClick:()=>da(c,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:T,cursor:"pointer"},children:m.jsx(Pc,{size:14,style:{flexShrink:0}})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>da(c,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:T,cursor:"pointer"},children:m.jsx(Ic,{size:14,style:{flexShrink:0}})})]})]}),me?m.jsxs("span",{style:{fontSize:et.xs,color:T,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Eh(c.responseTimeMs)]}):null]})}const ar=b.useCallback(()=>{const c=ia.current;if(!c)return;const D=Math.max(0,c.scrollWidth-c.clientWidth);Qa(c.scrollLeft>4),Kr(c.scrollLeft<D-4)},[]);b.useEffect(()=>(ar(),window.addEventListener("resize",ar),()=>window.removeEventListener("resize",ar)),[ar,Wt.length]);const Un=b.useCallback(c=>{const D=ia.current;D&&D.scrollBy({left:c==="left"?-Math.max(160,Math.floor(D.clientWidth*.75)):Math.max(160,Math.floor(D.clientWidth*.75)),behavior:"smooth"})},[]),wt=(c,D)=>{if(!c||!c.startsWith("#"))return`rgba(15, 23, 42, ${D})`;const z=c.slice(1),T=z.length===3?z.split("").map(At=>`${At}${At}`).join(""):z;if(T.length!==6)return c;const J=parseInt(T.slice(0,2),16),me=parseInt(T.slice(2,4),16),Ye=parseInt(T.slice(4,6),16);return`rgba(${J}, ${me}, ${Ye}, ${D})`},Et=B.primaryColor||"#3F037F",Mt=B.surfaceColor||"#ffffff",Ja=B.backgroundColor||"#eef2ff",tn=B.borderColor||"#e5e7eb",Tt=B.textColor||"#111827",qn=B.textSecondaryColor||"#6b7280";wt(Et,.12);const To=wt(Et,.24);wt(Et,.38);const qi=Mt,vt=Et,Wn=B.primaryTextColor||"#ffffff",Lo=qn,to=ve||"Publisher Assistant",no=Me&&Wt.length===0&&ot.length===0,Fo=Mt,$o=Mt,zn=tn,Oo=tn,Za="0 16px 64px rgba(15, 23, 42, 0.14)",Ya=qn,ss=qn,us=vt,fa=Ja,cs="none",ds="rgba(15, 23, 42, 0.18)";function Wi(c){return Yt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:c==="default"?"10px 12px":"8px 10px",borderRadius:c==="default"?"14px":"12px",border:`1px solid ${To}`,background:wt("#ffffff",.9),marginBottom:"4px"},children:[m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{color:vt,fontSize:et.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),m.jsxs("div",{style:{color:Tt,fontSize:et.sm,fontWeight:600,lineHeight:1.3},children:[Yt.brand_name," agent is active"]})]}),m.jsx("button",{type:"button",onClick:()=>{He("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${To}`,borderRadius:999,background:wt("#ffffff",.92),color:vt,padding:"7px 12px",fontSize:et.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Hi(c,D=Fe){const z=No&&!D,T=D||z?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:D||c==="default"?"2px":"8px",marginTop:D?"0":c==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ss,fontSize:T,lineHeight:z?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Er})})}function ei(c){const D=c==="publisher"?[180,220,196]:["100%","82%","68%"];return c==="publisher"?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}}),m.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:D.map((z,T)=>m.jsx("div",{style:{width:z,maxWidth:"100%",height:40,borderRadius:"6px",background:wt(Tt,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${T}`))}),m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}})]}):m.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:c==="publisher"?"10px":"12px"},children:D.map((z,T)=>m.jsx("div",{style:{width:z,maxWidth:"100%",height:c==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${wt(Et,.08)} 0%, ${wt(Et,.18)} 50%, ${wt(Et,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:c==="publisher"?`0 8px 22px ${wt(Et,.08)}`:"none"}},`suggestion-skeleton-${T}`))})}function Vi(c=Fe){if(Be)return null;if(no)return ei("publisher");if(!Wt.length)return null;const D=c&&Ka,z=Wt.slice(0,Pe);return C==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:c?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:c?"240px":void 0,paddingRight:c?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:z.map(T=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Sr(T.id),onClick:()=>{p==="default"&&(pn(!0),y==="floating"&&rr(!0)),yr(T)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${T.is_sponsored?Et:tn}`,background:T.is_sponsored?Et:Mt,color:T.is_sponsored?Wn:Tt,padding:c?"8px 10px":"10px 14px",fontSize:c?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:T.text}),le&&T.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:wt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},T.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:D?"4px":mn?"5px":c?"6px":"10px",flexShrink:0},children:[!D&&m.jsx("button",{type:"button",onClick:()=>Un("left"),disabled:!kr,"aria-label":"Scroll suggestions left",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:mn?20:c?24:28,height:mn?20:c?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:mn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:m.jsx(Tp,{size:mn?13:c?14:16,style:{flexShrink:0},"aria-hidden":"true"})}),m.jsx("div",{ref:ia,onScroll:ar,style:{display:"flex",gap:D?"4px":mn?"5px":c?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:z.map(T=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Sr(T.id),onClick:()=>{p==="default"&&(pn(!0),y==="floating"&&rr(!0)),yr(T)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:D?"4px":mn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${T.is_sponsored?Et:tn}`,background:T.is_sponsored?Et:Mt,color:T.is_sponsored?Wn:Tt,padding:D?"4px 8px":mn?"5px 8px":c?"7px 10px":"8px 14px",fontSize:D?"10px":mn?"11px":c?"12px":"13px",fontWeight:500,lineHeight:D?1:mn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:T.text}),le&&T.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},T.id))}),!D&&m.jsx("button",{type:"button",onClick:()=>Un("right"),disabled:!fr,"aria-label":"Scroll suggestions right",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:mn?20:c?24:28,height:mn?20:c?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:mn?"13px":void 0,lineHeight:1,cursor:fr?"pointer":"default",opacity:fr?1:.55},children:m.jsx(Lp,{size:mn?13:c?14:16,style:{flexShrink:0},"aria-hidden":"true"})})]})}function ms(c=Fe){if(c||!(Zr!=null&&Zr.recommendation))return null;const D=`publisher-sponsored-creative-${Zr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Ha,{messageId:D,query:Zr.text,initialRecommendation:Zr.recommendation,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,Zr.text)},onError:z=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",z)}})})}function fs(c){var D,z;return(D=c.relatedItems)!=null&&D.length||!((z=c.sourceLinks)!=null&&z.length)?null:m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"16px"},children:[m.jsx("div",{style:{width:"100%",fontSize:"11px",fontWeight:600,color:qn},children:"Sources"}),c.sourceLinks.map(T=>m.jsxs("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:c.id,query:c.userQuery,metadata:{source_title:T.title,source_url:T.url}})},style:{color:vt,fontSize:et.xs,textDecoration:"none",borderBottom:`1px solid ${wt(Et,.18)}`},children:[T.title||T.url," ",m.jsx(Np,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${c.id}-${T.url}`))]})}function ps(c,D=Fe){var z;return(z=c.relatedItems)!=null&&z.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:qn,marginBottom:"8px"},children:Ae}),m.jsx("div",{style:{display:"flex",gap:D?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:c.relatedItems.slice(0,4).map(T=>m.jsxs("a",{className:"admesh-publisher-source",href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:c.id,query:c.userQuery,metadata:{source_title:T.title,source_url:T.url,source_publisher:T.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:D?"6px":"10px",padding:D?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Tt,border:`1px solid ${tn}`,background:Mt,boxShadow:"none",flex:D?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:D?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:D?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Tt,overflowWrap:"anywhere"},children:T.title||T.url}),T.publisher&&m.jsx("div",{style:{fontSize:D?"11px":"12px",color:qn,lineHeight:1.4,overflowWrap:"anywhere"},children:T.publisher})]},`${c.id}-${T.url}`))})]}):null}function hs(c=Fe){const D=c?"13px":"15px";return m.jsxs("div",{ref:Dn,style:{flex:c?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:c?"0 2px 4px":fe?"16px 16px 8px":0},children:[ot.map(z=>{const T=z.role==="user"&&z.id===qt.current;return m.jsx("div",{ref:T?Ct:void 0,style:{marginBottom:c?"16px":"28px",textAlign:z.role==="user"?"right":"left"},children:(()=>{const J=!!z.content.trim()||!Be;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:z.role==="assistant"?"block":"inline-block",width:z.role==="assistant"?"100%":void 0,maxWidth:z.role==="assistant"?"100%":"76%",padding:z.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:z.role==="assistant"?0:"8px",background:z.role==="user"?wt(Tt,.05):"transparent",color:Tt,boxShadow:"none",border:"none",fontSize:z.role==="assistant"?D:c?"12px":"13px",lineHeight:z.role==="assistant"?1.62:1.4},children:[z.role==="assistant"?z.content.trim()?m.jsx(is,{content:z.content,theme:{...B,textColor:Tt},fontSize:D}):Be&&z.id===Rt.current?eo({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Tt},children:z.content}),z.role==="assistant"&&fs(z),z.role==="assistant"&&ps(z,c),z.role==="assistant"&&ma(z),z.role==="assistant"&&J&&xn.has(z.id)&&z.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ha,{messageId:z.id,query:z.userQuery,initialRecommendation:z.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(me,Ye)=>{hr(me,Ye,z.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})}),z.role==="assistant"&&J&&!xn.has(z.id)&&(z.initialRecommendation||jt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ha,{messageId:z.id,query:z.userQuery,initialRecommendation:z.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(me,Ye)=>{hr(me,Ye,z.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})})]})})})()},z.id)}),Vr&&m.jsx("div",{role:"alert",style:{color:Tt,fontSize:et.sm,border:`1px solid ${tn}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),m.jsx("div",{ref:aa})]})}if(p==="default"){let c=function(T){const J=Kc(No);return es.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:z}),m.jsx("div",{style:J.shell,children:T})]}),document.body)},D=function(T=!1){const J=un(T),me=T||J&&fe,Ye=!me&&q==="input",At=J&&!me&&Ka,Lt=me&&!(Fe&&E==="expand"&&!T&&Xr),Te=me?Kc(No):null,Ue=!!(Te&&No&&!J),kt=J?wn:Te?Te.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Gt=J?tr:Te?Te.panelHeight:"auto",Ht=J?wn:Te?.panelMaxWidth??"100%",Vt=J?tr:Te?.panelMaxHeight,_n=L&&!At&&me;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":J?"true":"false",style:{"--publisher-accent":vt,color:Tt,width:kt,maxWidth:Ht,height:Gt,maxHeight:Vt,boxSizing:"border-box",display:"flex",flexDirection:"column",background:me?Fo:qi,borderRadius:!J&&Te?Te.panelBorderRadius:"12px",padding:me?0:J?"6px":0,boxShadow:Ue?"none":me?Za:"none",border:Ue||Ye?"none":`1px solid ${Oo}`,overflow:"hidden",minHeight:J?0:void 0},children:[m.jsx("style",{children:Rc}),_n&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:J?"8px 10px":"14px 20px",background:$o,color:Tt,borderBottom:`1px solid ${zn}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:J?26:32,height:J?26:32,flexShrink:0,borderRadius:"6px",background:wt(Tt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:vt,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${k||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:Mt,padding:4}}):m.jsx(ts,{size:J?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(X||S)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[X&&m.jsx("div",{style:{fontSize:J?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:k}),S&&m.jsx("div",{style:{fontSize:J?"10px":"12px",color:Ya,marginTop:"2px"},children:to})]})]}),me&&(!J||T)&&m.jsx("button",{type:"button",onClick:()=>pn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"8px",border:`1px solid ${zn}`,background:Mt,color:Ya,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(Ec,{size:16,strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:At?"2px":J?"6px":"16px",minHeight:0,flex:J||me?"1 1 0":void 0,overflow:J||me?"hidden":void 0,overscrollBehavior:"contain",padding:Ye?J?"4px":"8px":J?"8px":"20px",justifyContent:me?void 0:"center",background:Fo},children:[Wi("default"),Lt&&hs(J),!Ye&&m.jsxs(m.Fragment,{children:[J&&!me&&!At&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),J&&!me&&ye&&N&&ot.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:$e}),Vi(J)]}),(Ye||!J||me||P)&&m.jsx(Up,{value:bn,onChange:Hr,open:Ye&&Xt&&!fe,onOpenChange:Ye?Nt:Sh,suggestions:Wt.slice(0,Pe),registerSuggestion:Sr,loading:Be,analyzing:no,compact:J,expanded:me,showLogo:!me,suggestionPlacement:ie,logoUrl:M,title:k,placeholder:te,colors:{accent:vt,accentText:Wn,surface:fa,text:Tt,muted:qn,border:tn},onStop:gr,onSend:()=>{hn.current=null,er.current=!1,pn(!0),y==="floating"&&rr(!0),Cr(bn)},onSuggestion:Hn=>{pn(!0),y==="floating"&&rr(!0),yr(Hn)}}),me&&Hi("default",J),!me&&q==="always"&&ms(J)]})]})};const z={position:"fixed",inset:0,background:ds,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Fe?m.jsxs("div",{ref:$i,className:"admesh-component","data-admesh-theme":Ze,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":E,"data-admesh-ad-slot-expanded":Ba?"true":"false",style:{width:wn,height:tr,maxWidth:wn,maxHeight:tr,position:"relative",overflow:"hidden"},children:[D(!1),Xr&&typeof document<"u"&&c(D(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ze,style:{width:"100%",position:"relative"},children:[D(!1),fe&&typeof document<"u"&&c(D(!0))]}):Ro?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ze,children:[!fe&&m.jsx("div",{style:{position:"fixed",...kn,zIndex:2147483001},children:D(!1)}),fe&&typeof document<"u"&&c(D(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsxs("button",{type:"button",onClick:ua,style:{position:"fixed",...kn,zIndex:2147483e3,border:"none",borderRadius:"6px",background:B.primaryColor,color:Wn,display:"flex",alignItems:"center",gap:"8px",fontSize:"13px",fontWeight:600,padding:"12px 16px",boxShadow:"0 4px 16px rgba(15, 23, 42, 0.12)",cursor:"pointer"},children:[m.jsx(ts,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),d]})})}return Wt.length===0&&!no?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Va(V)??"100%",backgroundColor:"#eef2ff",fontSize:et.base,...f},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[no?ei("legacy"):Wt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Wt.slice(0,Pe).map((c,D)=>m.jsxs("button",{ref:Sr(c.id),onClick:()=>yr(c),className:"rounded-full px-5 py-4 text-left shadow-sm transition-transform duration-200 hover:scale-[1.01] active:scale-[0.99]",style:{width:D===0?"100%":D===1?"82%":"68%",backgroundColor:B.surfaceColor||"#ffffff",color:B.textColor||"#1e293b",border:`1px solid ${B.borderColor||"#e2e8f0"}`,fontSize:et.sm},children:[m.jsx("span",{className:"leading-tight",children:c.text}),le&&c.is_sponsored&&m.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:B.backgroundColor||"#ffffff",color:B.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},c.id))}),ot.length>0&&m.jsxs("div",{ref:Dn,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:B.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[ot.map(c=>{const D=c.role==="user"&&c.id===qt.current;return m.jsx("div",{ref:D?Ct:void 0,className:c.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:c.role==="user"?B.primaryColor:"#ffffff",color:c.role==="user"?B.primaryTextColor||"#ffffff":B.textColor,fontSize:et.sm},children:c.role==="assistant"?c.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(is,{content:c.content,theme:B,fontSize:et.sm}),ma(c,{accentColor:B.primaryColor,metaColor:B.textSecondaryColor})]}):Be&&c.id===Rt.current?eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:c.content})})},c.id)}),Be&&!ot.some(c=>c.role==="assistant"&&c.id===Rt.current&&!c.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:B.textSecondaryColor},children:eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1})}),Vr&&m.jsx("div",{className:"text-sm",style:{color:B.textSecondaryColor},children:"Connection issue. Please try again."}),m.jsx("div",{ref:aa})]}),m.jsx("div",{className:"rounded-[1.5rem] bg-white p-3 shadow-sm",children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("input",{type:"text",value:bn,onChange:c=>Hr(c.target.value),onKeyPress:c=>{if(c.key==="Enter"){if(Be){c.preventDefault();return}Cr(bn)}},placeholder:te,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:B.backgroundColor||"#ffffff",color:B.textColor,fontSize:et.sm}}),m.jsx("button",{onClick:()=>{if(Be){gr();return}Cr(bn)},disabled:!Be&&!bn.trim(),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:Be?"#dc2626":B.primaryColor,color:"#ffffff"},children:Be?m.jsx(ns,{size:18}):m.jsx(Ac,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:B.textSecondaryColor,fontSize:et.xs,fontWeight:600},children:["Powered by"," ",m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none",fontWeight:700},children:"AdMesh"})]}),m.jsx("p",{style:{color:B.textSecondaryColor,fontSize:et.xs,lineHeight:1.5},children:Er})]})]})})}):Ro?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...fe?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kn,width:Va(V)??ca.width,height:Va(ee)??ca.height},backgroundColor:fe?Fo:B.backgroundColor,zIndex:9999,fontSize:et.base,borderRadius:fe?"20px":"16px",border:fe?`1px solid ${Oo}`:"1px solid transparent",boxShadow:fe?Za:"0 20px 40px rgba(15, 23, 42, 0.12)",...f},children:[L&&m.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between p-4 border-b",style:{position:"sticky",top:0,zIndex:10,borderColor:fe?zn:"transparent",background:fe?$o:B.backgroundColor,padding:fe?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:fe?40:32,height:fe?40:32,borderRadius:fe?"14px":"10px",background:wt(Et,.08),color:vt,display:"flex",alignItems:"center",justifyContent:"center",fontSize:fe?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${k||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(k||"AA").slice(0,2).toUpperCase()}),(X||S&&fe)&&m.jsxs("div",{children:[X&&m.jsx("div",{className:"font-medium",style:{color:B.textColor,fontSize:fe?"20px":et.base,fontWeight:700,letterSpacing:fe?"-0.02em":0},children:k}),S&&fe&&m.jsx("div",{style:{color:Ya,fontSize:"12px",marginTop:"2px"},children:to})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Ui,className:"transition-colors",title:fe?"Minimize":"Expand",style:{width:fe?36:28,height:fe?36:28,borderRadius:fe?"12px":"10px",border:`1px solid ${fe?zn:"transparent"}`,background:fe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:fe?m.jsx(Ec,{size:16,style:{color:B.textSecondaryColor}}):m.jsx($p,{size:16,style:{color:B.textSecondaryColor}})}),m.jsx("button",{onClick:Gr,className:"transition-colors",style:{width:fe?36:28,height:fe?36:28,borderRadius:fe?"12px":"10px",border:`1px solid ${fe?zn:"transparent"}`,background:fe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(ns,{size:16,style:{color:B.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:Dn,className:"flex-1 min-h-0 overflow-y-auto p-4",style:{flex:"1 1 0%",minHeight:0,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:fe?"20px":"16px"},children:[Wi("legacy"),ye&&ot.length===0&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",children:m.jsx("p",{style:{color:B.textColor,margin:0,fontSize:et.sm},children:$e})})}),ot.map(c=>{const D=c.role==="user"&&c.id===qt.current;return m.jsxs("div",{ref:D?Ct:void 0,className:"mb-3",children:[m.jsx("div",{className:c.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:c.role==="user"?us:"transparent",color:c.role==="user"?B.primaryTextColor||"#ffffff":B.textColor,border:"none",borderRadius:c.role==="user"?fe?"14px":"12px":0,padding:c.role==="user"?fe?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:c.role==="assistant"?c.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${et.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(is,{content:c.content,theme:B,fontSize:`calc(${et.sm} * 1.3)`})}),ma(c,{accentColor:B.primaryColor,metaColor:B.textSecondaryColor})]}):Be&&c.id===Rt.current?eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:et.sm,lineHeight:"1.4"},children:c.content})}),c.role==="assistant"&&!xn.has(c.id)&&m.jsx(Ha,{messageId:c.id,query:c.userQuery,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,c.userQuery)},onError:z=>{console.error("[AdMeshIntentAssistant] Recommendations error:",z)}}),c.role==="assistant"&&xn.has(c.id)&&c.initialRecommendation&&!Be&&m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"text-xs text-gray-500 mb-2 font-semibold",children:"Sponsored Recommendation"}),m.jsx(Ha,{messageId:c.id,query:c.userQuery,initialRecommendation:c.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,c.userQuery)},onError:z=>{console.error("[AdMeshIntentAssistant] Recommendations error:",z)}})]})]},c.id)}),Be&&!ot.some(c=>c.role==="assistant"&&c.id===Rt.current&&!c.content.trim())&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",style:{backgroundColor:"transparent"},children:eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1})})}),Vr&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:B.textSecondaryColor},children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{style:{fontSize:et.xs},children:"\u26A0\uFE0F"}),m.jsx("span",{style:{fontSize:et.sm},children:"Connection issue. Please try again."})]})})}),m.jsx("div",{ref:aa})]}),ot.length===0&&no&&m.jsx("div",{className:"px-4 pb-2",children:ei("legacy")}),Wt.length>0&&ot.length===0&&!no&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:Wt.slice(0,Pe).map(c=>m.jsxs("button",{ref:Sr(c.id),onClick:()=>yr(c),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:B.surfaceColor||"#f8fafc",color:B.textColor||"#1e293b",border:`1px solid ${B.borderColor||"#e2e8f0"}`,fontSize:et.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:c.text}),le&&c.is_sponsored&&m.jsx("sup",{className:"absolute right-1 top-1 rounded-full px-1.5 py-0.5 tracking-wide",style:{fontSize:"9px",lineHeight:1,backgroundColor:B.backgroundColor||"#ffffff",color:B.textSecondaryColor||"#64748b"},children:"Ad"})]},c.id))})}),De&&!Me&&Jr.length===0&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:m.jsxs("div",{className:"p-3 rounded-lg border",style:{backgroundColor:B.surfaceColor,borderColor:B.borderColor,color:B.textSecondaryColor},children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{style:{fontSize:et.sm},children:"Intent analysis failed"}),m.jsx("button",{onClick:Z,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:B.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:et.xs},children:De})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:fe?zn:"transparent",padding:fe?"18px 20px":void 0,background:fe?$o:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${zn}`,borderRadius:fe?"16px":"12px",background:fa,boxShadow:fe?cs:"none",padding:fe?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:bn,onChange:c=>Hr(c.target.value),onKeyPress:c=>{if(c.key==="Enter"){if(Be){c.preventDefault();return}Cr(bn)}},placeholder:te,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:B.textColor,fontSize:fe?"15px":et.sm,"--tw-ring-color":B.primaryColor}}),m.jsx("button",{onClick:()=>{if(Be){gr();return}Cr(bn)},disabled:!Be&&!bn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:Be?"#dc2626":B.primaryColor,color:"#ffffff",borderRadius:fe?"12px":"10px",width:fe?"46px":void 0,height:fe?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:fe?`0 10px 20px ${wt(Et,.18)}`:"none"},children:Be?m.jsx(ns,{size:14}):m.jsx(Ac,{size:14})})]}),Hi("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsx("button",{onClick:ua,className:"flex items-center gap-2 px-4 py-3 rounded-full shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",style:{position:"fixed",...kn,backgroundColor:B.primaryColor,color:"#ffffff",zIndex:9999,fontSize:et.base,...f},children:m.jsx("span",{className:"font-medium",children:d})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const jh=/^[a-z0-9](?:[a-z0-9-]{1,46}[a-z0-9])?$/,Li=new WeakMap,Th={mode:"light",primaryColor:"#42116e",primaryTextColor:"#ffffff",secondaryColor:"#6b5e75",backgroundColor:"#faf9fb",surfaceColor:"#ffffff",borderColor:"#e7e1ec",textColor:"#302039",textSecondaryColor:"#6b5e75",borderRadius:"16px"};function Lh(){const u=document.currentScript;return u instanceof HTMLScriptElement?u:Array.from(document.scripts).find(l=>l.src.includes("/brand-assistant.js")&&l.dataset.admeshMounted!=="true")||null}function Zc(u,l){if(!u||typeof u!="object")return null;const f=u;if(f.slug!==l||typeof f.assistant_name!="string"||typeof f.welcome_message!="string"||!Array.isArray(f.suggested_questions))return null;const d=f.assistant_name.trim().slice(0,160)||"Brand Assistant";let k=null;if(typeof f.support_url=="string")try{const L=new URL(f.support_url);L.protocol==="https:"&&(k=L.href)}catch{}const M=f.suggested_questions.filter(L=>typeof L=="string").slice(0,4).map(L=>L.slice(0,300)).filter(Boolean);return{slug:l,assistant_name:d,logo_url:typeof f.logo_url=="string"?f.logo_url:null,support_url:k,welcome_message:f.welcome_message.slice(0,500),suggested_questions:M.length?M:[`What is ${d}?`]}}async function Fh(u,l,f){if(u.dataset.brandPreview)try{return Zc(JSON.parse(u.dataset.brandPreview),l)}catch{return null}const d=await fetch(`${f}/api/public/brands/${encodeURIComponent(l)}/embed/`,{cache:"no-store",headers:{Accept:"application/json"},credentials:"omit"});return d.ok?Zc(await d.json(),l):null}function $h(u,l,f,d){let k=[],M=!1;return async L=>{if(f)throw new Error("Questions become available after this profile is published.");const X=L.trim().slice(0,500);if(!X)throw new Error("Enter a question.");M||(M=!0,fetch(`${l}/api/public/brands/${encodeURIComponent(u)}/qa-start/`,{method:"POST",credentials:"omit",keepalive:!0}).catch(()=>{}));const S=await fetch(`${l}/api/public/brands/${encodeURIComponent(u)}/ask/`,{method:"POST",cache:"no-store",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({question:X,history:k.slice(-6)}),signal:AbortSignal.timeout(25e3)});if(!S.ok){const $=await S.json().catch(()=>null);throw new Error($?.detail||"The Brand Agent could not answer right now. Please try again.")}const y=await S.json();if(y.outcome!=="answered"&&y.outcome!=="no_answer"||typeof y.answer!="string"||!Array.isArray(y.sources))throw new Error("The Brand Agent returned an unexpected answer. Please try again.");return k=[...k,{role:"visitor",text:X},{role:"assistant",text:y.answer}].slice(-6).map($=>({...$,text:$.text.slice(0,1e3)})),{answer:y.answer,source_links:y.sources.filter($=>$&&typeof $.url=="string").map($=>({title:$.title,url:$.url})),related_items:y.outcome==="no_answer"&&d?[{title:"Contact the brand",url:d}]:void 0}}}function Oh({config:u,mode:l,queryHandler:f,suggestions:d,preview:k}){const[M,L]=b.useState(()=>window.location.hash==="#brand-assistant");return b.useEffect(()=>{const X=()=>{window.location.hash==="#brand-assistant"&&L(!0)},S=y=>{y.target instanceof Element&&y.target.closest('a[href="#brand-assistant"]')&&L(!0)};return window.addEventListener("hashchange",X),document.addEventListener("click",S),()=>{window.removeEventListener("hashchange",X),document.removeEventListener("click",S)}},[]),Jl.createElement(Nh,{variant:"default",layout:l,position:"bottom-right",size:"md",open:M,onOpenChange:L,adsEnabled:!1,onlyShowWhenSponsored:!1,headerTitle:u.assistant_name,headerLogoUrl:u.logo_url,triggerLabel:`Ask ${u.assistant_name}`,subtitle:"Brand Assistant",showWelcomeMessage:!0,welcomeMessage:u.welcome_message,placeholder:`Ask ${u.assistant_name} a question\u2026`,disclaimerText:k?"Private preview. Questions become available after publication.":"Answers use this brand's approved public information. Avoid sharing personal details.",poweredByLabel:"Powered by AdMesh",relatedItemsHeading:"Need more help?",suggestions:d,queryHandler:f})}async function Uh(){var u;const l=Lh();if(!l||!l.isConnected||Li.has(l))return;const f=((u=l.dataset.brandSlug)==null?void 0:u.trim().toLowerCase())||"";if(!jh.test(f)){console.error("[AdMesh] Brand assistant script requires a valid data-brand-slug.");return}const d=new URL(l.src).origin,k=d==="https://embed.useadmesh.com"?"https://useadmesh.com":d,M=await Fh(l,f,k).catch(()=>null);if(!l.isConnected)return;if(!M){l.dispatchEvent(new Event("admesh:brand-assistant-unavailable"));return}const L=!!l.dataset.brandPreview,X=l.dataset.mode==="inline"?"inline":"floating",S=X==="inline"?document.querySelector(l.dataset.target||"#admesh-brand-assistant"):document.body;if(!S){console.error("[AdMesh] Brand assistant inline target was not found.");return}const y=document.createElement("div");y.className="admesh-publisher-assistant-reactMount",y.dataset.brandAssistant=f,S.appendChild(y);const $=xc.createRoot(y),E=`brand-${f}-${crypto.randomUUID()}`,W=M.suggested_questions.map((N,P)=>({id:`brand-${P}`,text:N,type:"information"}));$.render(Jl.createElement(Oc,{apiKey:"",sessionId:E,skipSdkInitialization:!0,theme:Th},Jl.createElement(Oh,{config:M,mode:X,suggestions:W,preview:L,queryHandler:$h(f,k,L,M.support_url)}))),l.dataset.admeshMounted="true",Li.set(l,{unmount:()=>{$.unmount(),y.remove(),l.dataset.admeshMounted="false"}}),l.dispatchEvent(new Event("admesh:brand-assistant-ready"))}window.AdMeshBrandAssistant={unmount(u){var l;(l=Li.get(u))==null||l.unmount(),Li.delete(u)}},Uh()})();})();
1215
+ `;let Xc=!1;const Ch=()=>{v.useEffect(()=>{if(!Xc){try{_h();const s=document.createElement("style");s.id="admesh-ui-sdk-styles-legacy",s.textContent=Eh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(s),Xc=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Ih=()=>{};function zh(s){const l=Math.max(1,Math.round(s));if(l<60)return`${l}s`;const m=Math.floor(l/60),c=l%60;return c>0?`${m}m ${c}s`:`${m}m`}function Ph(s){return zh(s/1e3)}function Mh({imageUrl:s,logoUrl:l,articleUrl:m}){const[c,x]=v.useState([]),A=Ac(s,m),N=Ac(l,m),G=[A,N].find(y=>y&&!c.includes(y));if(!G)return null;const S=G===N;return f.jsx("img",{src:G,alt:"",loading:"lazy",decoding:"async",onError:()=>x(y=>[...y,G]),style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",aspectRatio:"16 / 9",objectFit:S?"contain":"cover",borderRadius:"4px",margin:0,padding:S?"12px":0,boxSizing:"border-box"}})}const cs=({content:s,theme:l,fontSize:m})=>{const c=D=>D.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((R,U)=>{if(R.startsWith("**")&&R.endsWith("**")&&R.length>4)return f.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:R.slice(2,-2)},U);const Q=R.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return Q?f.jsx("a",{href:Q[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:Q[1]},U):f.jsx(v.Fragment,{children:R},U)}),x=D=>D.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(R=>R.trim()).filter((R,U,Q)=>R.length>0||U<Q.length-1),A=D=>{const R=x(D);return R.length>1&&R.every(U=>/^:?-{3,}:?$/.test(U))},N=D=>{const R=D.indexOf("|");if(R<=0)return{heading:null,headerLine:D};const U=D.slice(0,R).trim();return!U||/^[-|:\s]+$/.test(U)?{heading:null,headerLine:D}:{heading:U,headerLine:D.slice(R).trim()}},G=(D,R)=>{const U=x(D).length,Q=x(R).length;return U<=1||U===Q?R:`| ${Array.from({length:U},()=>"---").join(" | ")} |`},S=D=>{if(D.length<2||!D[0].includes("|"))return{heading:null,lines:D};const{heading:R,headerLine:U}=N(D[0]),Q=U.startsWith("|")?U:`| ${U}`,te=G(Q,D[1]);return{heading:R,lines:[Q,te,...D.slice(2)]}},y=D=>{if(D.length<2||!D[0].includes("|"))return!1;const{lines:R}=S(D);return A(R[1])&&x(R[0]).length>=2},W=D=>{if(!D.includes("|"))return[D];let R=D.trim();const U=[],Q=R.indexOf("|");if(Q>0){const te=R.slice(0,Q).trim();te&&!/^[-|:\s]+$/.test(te)&&(U.push(te),R=R.slice(Q).trim())}return R=R.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(te,le)=>`
1216
+ ${le}`),R=R.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
1217
+ | `),R=R.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
1218
+ `),U.push(...R.split(`
1219
+ `).map(te=>te.trim()).filter(Boolean)),U},C=D=>{const R=D.split(`
1220
+ `),U=[];for(const Q of R){if(!Q.includes("|")){U.push(Q);continue}U.push(...W(Q))}return U.join(`
1221
+ `)},V=(D=>{const R=C(D).split(`
1222
+ `),U=[];let Q=0;for(;Q<R.length;){const te=R[Q],le=R[Q+1]||"";if(te.includes("|")&&A(le)){U.length>0&&U[U.length-1].trim()&&U.push("");const{heading:re,headerLine:ye}=N(te);for(re&&U.push(re),U.push(ye,G(ye,le)),Q+=2;Q<R.length&&R[Q].includes("|")&&R[Q].trim();)U.push(R[Q]),Q+=1;Q<R.length&&R[Q].trim()&&U.push("");continue}U.push(te),Q+=1}return U.join(`
1223
+ `)})(s).split(/\n\s*\n/).map(D=>D.trim()).filter(Boolean);return f.jsx("div",{style:{margin:0,color:l.textColor,fontSize:m},children:V.map((D,R)=>{const U=D.split(`
1224
+ `).map(ye=>ye.trim()).filter(Boolean),Q=U.every(ye=>/^[-*]\s+/.test(ye)),te=U.every(ye=>/^\d+\.\s+/.test(ye)),le=U.length===1&&/^#{1,3}\s+/.test(U[0]),re=y(U);if(le){const ye=U[0].replace(/^#{1,3}\s+/,"");return f.jsx("h3",{style:{marginTop:R===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ye)},R)}if(re){const{heading:ye,lines:ae}=S(U),q=x(ae[0]),B=ae.slice(2).map(x).filter(be=>be.length===q.length);return f.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ye?f.jsx("p",{style:{marginTop:R===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:m},children:c(ye)}):null,f.jsx("div",{style:{border:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,borderRadius:8,overflowX:"auto"},children:f.jsxs("table",{style:{width:"100%",minWidth:q.length>3?520:void 0,borderCollapse:"collapse",color:l.textColor,fontSize:m,lineHeight:1.45},children:[f.jsx("thead",{children:f.jsx("tr",{children:q.map((be,se)=>f.jsx("th",{style:{textAlign:"left",padding:"9px 10px",fontWeight:600,background:l.surfaceColor||"rgba(148, 163, 184, 0.12)",borderBottom:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,whiteSpace:"normal"},children:c(be)},se))})}),f.jsx("tbody",{children:B.map((be,se)=>f.jsx("tr",{children:be.map((ve,Ve)=>f.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:se===B.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(ve)},Ve))},se))})]})})]},R)}if(Q||te){const ye=te?"ol":"ul";return f.jsx(ye,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:m},children:U.map((ae,q)=>f.jsx("li",{style:{marginBottom:"0.45rem"},children:c(ae.replace(/^([-*]|\d+\.)\s+/,""))},q))},R)}return f.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:m,whiteSpace:"pre-wrap"},children:U.map((ye,ae)=>f.jsxs(v.Fragment,{children:[ae>0&&f.jsx("br",{}),c(ye)]},ae))},R)})})};function Ga(s){return s===void 0?void 0:typeof s=="number"?`${s}px`:s}function Zc(s){if(typeof s=="number")return s;if(typeof s!="string")return;const l=Number(s.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function $o(s){return s.replace(/\s+/g," ").trim()}function Th(s,l){const m=s.filter(N=>!(N!=null&&N.is_sponsored)).slice(0,3),c=l.filter(N=>!(N!=null&&N.is_sponsored)).slice(0,3),x=l.find(N=>N?.is_sponsored);if(!x)return c.length?c:m;const A=c.length?c:m;return[x,...A].slice(0,4)}function Rh(s,l,m,c){const x=new Set,A=[],N=(C,V="information")=>{const D=$o(C);if(!D)return;const R=D.toLowerCase();x.has(R)||(x.add(R),A.push({id:`followup_${A.length}_${R.replace(/[^a-z0-9]+/g,"_")}`,text:D,type:V,is_sponsored:!1}))},G=new Set,S=C=>{const V=$o(C||"");if(!V)return;const D=V.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();D&&G.add(D)};(c||[]).forEach(C=>S(C?.title)),(m||[]).forEach(C=>S(C?.title)),l.split(/\n+/).map(C=>$o(C.replace(/^[-*]\s+/,""))).filter(Boolean).filter(C=>C.length>=24&&C.length<=90).forEach(C=>{G.size>=6||S(C)});const y=$o(s.replace(/[?.!]+$/g,"")),W=Array.from(G).slice(0,3);return[W[0]?`Tell me more about ${W[0]}`:"",W[1]?`Show me examples related to ${W[1]}`:"",W[2]?`Compare the main options for ${W[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((C,V)=>{A.length>=3||N(C,V===0?"comparison":"information")}),A.slice(0,3)}function jh(){if(typeof window>"u")return"unknown";const s=window.innerWidth;return s<768?"mobile":s<1024?"tablet":"desktop"}function Jc(s){return s?{shell:{position:"fixed",left:0,right:0,bottom:0,width:"100%",maxWidth:"100%",height:"calc(100dvh - env(safe-area-inset-bottom, 0px))",maxHeight:"calc(100dvh - env(safe-area-inset-bottom, 0px))",padding:0,margin:0,zIndex:2147483001,boxSizing:"border-box"},panelWidth:"100%",panelMaxWidth:"100%",panelHeight:"100%",panelMaxHeight:"100%",panelBorderRadius:"0"}:{shell:{position:"fixed",left:"50%",bottom:"12px",transform:"translateX(-50%)",width:"min(960px, calc(100vw - 24px))",maxWidth:"100%",maxHeight:"calc(100vh - 24px)",zIndex:2147483001,boxSizing:"border-box"},panelWidth:"min(960px, calc(100vw - 24px))",panelMaxWidth:"100%",panelHeight:"min(78vh, 760px)",panelMaxHeight:void 0,panelBorderRadius:"12px"}}function Yc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const m=new URL(l);return!!(m.protocol&&m.hostname)}catch{return!1}}function ed(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(Yc(l))return l}catch{return}}function td(s){if(typeof window>"u")return{page_url:void 0,page_path:void 0,article_slug:void 0,page_title:void 0,referrer:void 0,device_type:"unknown"};const l=ed()||(Yc(s)?s.trim():void 0);let m=l?window.location.pathname||"/":void 0;try{m=l?new URL(l).pathname||"/":void 0}catch{m=ed()?window.location.pathname||"/":void 0}const c=(m||"").split("/").filter(Boolean);return{page_url:l,page_path:m,article_slug:c[c.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:jh()}}function Ah(s){var l,m;const c=(m=(l=s?.recommendation)==null?void 0:l.creative)==null?void 0:m.follow_up_suggestion,x=s?.recommendation_id;return!c||!x?null:{id:x,text:$o(c),type:"action",is_sponsored:!0,recommendation:s,metadata:{source:"assistant_query_recommendation",recommendation_id:x}}}function ds(s){return[...s].sort((l,m)=>{const c=!!l.is_sponsored,x=!!m.is_sponsored;return c===x?0:c?-1:1})}const Nh={mode:"light",primaryColor:"#3b82f6",secondaryColor:"#64748b",backgroundColor:"#ffffff",surfaceColor:"#f8fafc",borderColor:"#e2e8f0",textColor:"#1e293b",textSecondaryColor:"#64748b",borderRadius:"0.5rem",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px 0 rgb(0 0 0 / 0.05)",medium:"0 4px 6px -1px rgb(0 0 0 / 0.1)",large:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}},Dh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},Lh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Fh=({theme:s,className:l,style:m,triggerLabel:c="Ask Ava",headerTitle:x="Ask Ava",headerLogoUrl:A,showHeader:N=!0,showHeaderTitle:G=!0,showSubtitle:S=!0,layout:y="floating",surface:W="page",adSlotBehavior:C="expand",showCompactSlotHeader:V=!0,showCompactWelcomeMessage:D=!0,showCompactSlotInput:R=!0,showCompactSlotDisclaimer:U=!0,panelWidth:Q,panelHeight:te,analyticsPageUrl:le,fontScale:re=1,position:ye="bottom-right",size:ae="md",defaultOpen:q,open:B,onOpenChange:be,autoOpen:se=!1,showWelcomeMessage:ve=!1,welcomeMessage:Ve="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:ne="Ask me anything about products...",adsEnabled:ie=!0,suggestions:xe,maxSuggestions:Fe=6,suggestionStyle:E="carousel",suggestionTrigger:$="always",suggestionPlacement:oe="below",sponsoredCreativePlacement:ke="below-input-container",onlyShowWhenSponsored:Me=!1,variant:p="default",queryHandler:M,suggestionsLoader:H,disclaimerText:Y,poweredByLabel:Se="Powered by AdMesh",subtitle:_e="Publisher Assistant",relatedItemsHeading:ze="Recommended for you",onOpen:Re,onClose:et})=>{const{sdk:Be,sessionId:Oe,theme:Tt,apiKey:ee,userId:ue}=Gc(),{suggestions:fe,isAnalyzingIntent:Pe,intentError:De,retryIntentAnalysis:_t,activeDelegationSession:Rt,hasActiveDelegationSession:X,stopDelegationSession:Ge,refreshDelegationActivity:Z}=Qc();Ch(),console.log("[AdMeshIntentAssistant] Context:",{sdk:Be,sessionId:Oe,hasContextTheme:!!Tt});const K=s||Tt||Nh,Ie=K?.mode||"light",Le=W==="ad-slot",Sn=(d=!1)=>Le&&!(d&&C==="expand"),[vt,dn]=v.useState(q||se),it=B!==void 0,Xt=it?B:vt,[Dt,no]=v.useState(""),[cr,Zt]=v.useState(!1),[Ue,ot]=v.useState([]),[Ke,Zn]=v.useState(!1),[Jn,fn]=v.useState(null),[pe,Ht]=v.useState(!1),[Jt,Yn]=v.useState(new Set),[Cr,de]=v.useState(xe||fe||[]),[tt,mn]=v.useState(0),[dr,ro]=v.useState(0),[Ir,Wo]=v.useState({}),zr=v.useRef(null),er=v.useRef(!1),yn=v.useRef(null),sa=v.useRef(new Map),oo=v.useRef([]),Rn=v.useRef(null),Et=v.useRef(null),qt=v.useRef(null),fr=v.useRef(!1),ua=v.useRef(!1),Bi=v.useRef(null),ca=v.useRef(null),da=v.useRef(null),[Pr,Xa]=v.useState(!1),[mr,ao]=v.useState(!1),Ct=v.useRef(null),It=v.useRef(null),Lt=!!(ee!=null&&ee.toLowerCase().startsWith("pub_")),Yt=X()&&Rt?.session_id===Oe?Rt:null,fa=v.useRef(new Set),pr=v.useRef(new Set),Mr=v.useRef(!1),io=Le&&C==="expand"&&(pe||Ke),[Bo,qi]=v.useState(!1);v.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(max-width: 767px)"),z=()=>qi(d.matches);return z(),d.addEventListener("change",z),()=>d.removeEventListener("change",z)},[]),v.useEffect(()=>{if(!io||typeof document>"u")return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[io]);const Za=Le&&C==="sticky"&&(pe||Ue.length>0||Ke),_n=Ga(Q)??"100%",tr=Ga(te)??"100%",nr=Zc(Q),bn=Zc(te),Ja=Le&&(bn??Number.POSITIVE_INFINITY)<=60,pn=Le&&(nr??Number.POSITIVE_INFINITY)<=360&&(bn??Number.POSITIVE_INFINITY)<=120,Tr=v.useCallback(d=>z=>{z?sa.current.set(d,z):sa.current.delete(d)},[]),xt=v.useCallback(async(d,z={})=>{if(!(!Be||!Oe))try{await Be.trackPublisherAssistantEvent({event_name:d,timestamp:new Date().toISOString(),session_id:Oe,...td(le),...z})}catch(P){console.warn(`[AdMeshIntentAssistant] Failed to track ${d}`,P)}},[le,Be,Oe]),hr=v.useCallback((d,z,P)=>{var T,J;z?.status==="generated"&&z.recommendation&&ot(qe=>{const mt=qe.find(ge=>ge.id===d&&ge.role==="assistant");return!mt||mt.initialRecommendation===z?qe:qe.map(ge=>ge===mt?{...ge,initialRecommendation:z}:ge)});const me=z?.recommendation_id;if(!me)return;const $e=`${d}:${me}`;pr.current.has($e)||(pr.current.add($e),xt("recommendation_shown",{message_id:d,query:P,recommendation_id:me,brand_name:(J=(T=z.recommendation)==null?void 0:T.creative)==null?void 0:J.brand_name,is_sponsored:!0}))},[xt]),ma=v.useCallback((d,z,P,T,J,me)=>{const $e=Array.isArray(me)&&me.length?me.map((ge,yt)=>{const bt=$o(ge.text||"");return bt?{id:`followup_llm_${yt}_${bt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:bt,type:ge.type||"information",is_sponsored:!1}:null}).filter(ge=>!!ge).slice(0,3):Rh(d,z,P,T),qe=Ah(J),mt=qe?[qe,...$e.slice(0,2)]:$e.slice(0,3);mt.length&&de(ge=>{const yt=qe||ge.find(bt=>bt.is_sponsored);return ds(yt?[yt,...mt.filter(bt=>!bt.is_sponsored)]:mt)})},[]),en=v.useCallback((d,z)=>{const P=$o(d.query||d.label||"");if(!P||!z)return;const T={id:z,text:P,type:"action",is_sponsored:!0,recommendation:{recommendation_id:z,recommendation:{creative:{follow_up_suggestion:P}},tracking:{followup_engagement_url:d.engagement_url,followup_exposure_url:d.exposure_url}}};de(J=>{const me=J.filter($e=>!$e.is_sponsored).slice(0,3);return ds([T,...me].slice(0,4))})},[]),pa=v.useCallback(()=>{const d=Rn.current,z=Et.current;if(!d||!z)return!1;const P=d.getBoundingClientRect(),T=z.getBoundingClientRect(),J=Math.max(0,d.scrollTop+T.top-P.top);return d.scrollTop=J,!0},[]);v.useLayoutEffect(()=>{var d;if(fr.current){pa()&&(fr.current=!1);return}ua.current||(d=ca.current)==null||d.scrollIntoView({behavior:"smooth"})},[Ue,pa]),v.useLayoutEffect(()=>{if(!Le||io)return;const d=Bi.current;if(!d)return;const z=d.closest(".admesh-publisher-assistant-reactMount"),P=tr;[d,z].forEach(J=>{J&&(J.style.width=_n,J.style.maxWidth=_n,J.style.height=P,J.style.maxHeight=P,J.style.overflow="hidden",J.style.boxSizing="border-box",J.dataset.admeshAdSlotExpanded=Za?"true":"false")});const T=z?.parentElement;T&&T!==document.body&&T!==document.documentElement&&(T.style.width=_n,T.style.maxWidth=_n,T.style.height=P,T.style.maxHeight=P,T.style.overflow="hidden",T.style.boxSizing="border-box")},[tr,_n,io,Le,Za]),v.useEffect(()=>{if(xe&&xe.length){de(xe);return}fe&&fe.length&&de(d=>Th(d,fe))},[xe,fe]),v.useEffect(()=>{if(p!=="default"||!H)return;let d=!1;return H().then(z=>{!d&&Array.isArray(z)&&z.length&&de(z)}).catch(z=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",z)}),()=>{d=!0}},[H,p]),v.useEffect(()=>{if(!Ke){ro(0),zr.current=null;return}zr.current==null&&(zr.current=typeof performance<"u"?performance.now():Date.now());const d=()=>{const P=zr.current;if(P==null)return;const T=typeof performance<"u"?performance.now():Date.now();ro(Math.floor((T-P)/1e3))};d();const z=window.setInterval(d,1e3);return()=>window.clearInterval(z)},[Ke]),v.useEffect(()=>{if(!Ke||p!=="default"){mn(0);return}const d=window.setInterval(()=>{mn(z=>Math.min(z+1,7))},3e3);return()=>window.clearInterval(d)},[Ke,p]),v.useEffect(()=>{Mr.current||!Be||!Oe||(Mr.current=!0,xt("assistant_loaded",{metadata:{layout:y,surface:W,variant:p,default_open:q||se}}))},[se,q,y,Be,Oe,W,xt,p]);const rr=v.useCallback(d=>{it?be?.(d):dn(d),d?(xt("assistant_opened",{metadata:{layout:y,surface:W,ad_slot_behavior:C,variant:p,expanded:pe}}),Re?.()):et?.()},[it,pe,y,be,Re,et,W,xt,p]),ha=v.useCallback(()=>{rr(!0)},[rr]),lo=v.useCallback(()=>{rr(!1)},[rr]),Vi=v.useCallback(()=>{Ht(d=>!d)},[]),Ya=v.useCallback(async(d,z,P,T,J,me,$e,qe,mt)=>{var ge,yt,bt;if(!Be)return console.warn("[AdMeshIntentAssistant] SDK not available - using fallback response"),{text:"I'm a demo assistant. The SDK is not properly configured, but I can still help with suggestions! Try clicking on one of the suggested questions above."};try{Yt&&await Z("turn_started",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(An=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",An)});const Vt=await fetch(`${Be.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:me,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ee}`},body:JSON.stringify({message:d,session_id:Oe||"default-session",message_id:z,user_id:ue,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:td(le),conversation_history:$e,sponsored_recommendation:J!=null&&J.recommendation_id?{recommendation_id:J.recommendation_id,brand_name:(yt=(ge=J.recommendation)==null?void 0:ge.creative)==null?void 0:yt.brand_name}:void 0,active_delegation_session:Yt?{delegation_session_id:Yt.delegation_session_id,recommendation_id:Yt.recommendation_id,session_id:Yt.session_id,brand_name:Yt.brand_name,mcp_endpoint:Yt.mcp_endpoint,status:Yt.status}:void 0}})});if(!Vt.ok)throw new Error(`API request failed: ${Vt.status} ${Vt.statusText}`);const Qt=(bt=Vt.body)==null?void 0:bt.getReader(),Ce=new TextDecoder;if(!Qt)throw new Error("Response body is not readable");let je="",pt,ht,Ut,gn,We,xn="";const Bn=()=>({text:je,source_links:pt,related_items:ht,followup_suggestions:Ut,used_capability:gn,response_time_ms:We});return await(async()=>{try{for(;;){const{done:An,value:Vo}=await Qt.read();xn+=Ce.decode(Vo,{stream:!An});const Fr=xn.split(`
1225
+ `);xn=An?"":Fr.pop()||"";for(const wr of Fr)if(wr.startsWith("data: ")){const En=wr.slice(6);if(En.trim()==="[DONE]")return Yt&&Z("turn_completed",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(jt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",jt)}),{text:je,source_links:pt,related_items:ht,followup_suggestions:Ut,used_capability:gn,response_time_ms:We};try{const jt=JSON.parse(En);switch(jt.type){case"content":{const Uo=jt.content||"";je+=Uo,P?.(Uo);break}case"final":{je=jt.reply||je,pt=Array.isArray(jt.source_links)?jt.source_links:void 0,ht=Array.isArray(jt.related_items)?jt.related_items:void 0,Ut=Array.isArray(jt.followup_suggestions)?jt.followup_suggestions:void 0,gn=typeof jt.used_capability=="string"?jt.used_capability:gn,We=typeof jt.response_time_ms=="number"?jt.response_time_ms:We,qe?.(Bn());break}case"followup_suggestions":{Ut=Array.isArray(jt.followup_suggestions)?jt.followup_suggestions:Ut,mt?.(Bn());break}case"error":throw new Error(jt.message||"Unknown streaming error");case"session_start":T?.(),console.log("Session started:",jt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",En);continue}}if(An)break}}catch(An){if(me!=null&&me.aborted)return{text:je,source_links:pt,related_items:ht,followup_suggestions:Ut,used_capability:gn,response_time_ms:We,error:"aborted"};throw console.error("Stream processing error:",An),An}finally{Qt.releaseLock()}return{text:je,source_links:pt,related_items:ht,followup_suggestions:Ut,used_capability:gn,response_time_ms:We}})()}catch(Vt){return me!=null&&me.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",Vt),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:Vt instanceof Error?Vt.message:"request_failed"})}},[Be,Oe,ee,ue,Yt,Z]),gr=v.useCallback(()=>{const d=Ct.current;if(!d||d.signal.aborted)return;d.abort(),Zn(!1),yn.current=null,er.current=!1;const z=It.current;z&&ot(P=>P.map(T=>T.id===z&&!T.content.trim()?{...T,content:"Generation stopped."}:T))},[]),Rr=v.useCallback(async d=>{var z,P,T,J,me;if(!d.trim()||Ke)return;const $e=typeof performance<"u"?performance.now():Date.now(),qe=d.trim(),mt=Date.now().toString(),ge=new AbortController,yt=yn.current,bt=yt?.recommendation||null,Vt=Ue.filter(Ce=>(Ce.role==="user"||Ce.role==="assistant")&&Ce.content.trim()).slice(-6).map(Ce=>({role:Ce.role,content:Ce.content.trim().slice(0,1200)}));(z=Ct.current)==null||z.abort(),Ct.current=ge,It.current=null,qt.current=mt,fr.current=!0,ua.current=!0,yn.current=null,de(Ce=>Ce.some(je=>je.is_sponsored)?Ce.filter(je=>!je.is_sponsored):Ce),fn(null);const Qt={id:mt,role:"user",content:qe,timestamp:new Date};if(xt("query_submitted",{message_id:mt,query:qe}),ot(Ce=>[...Ce,Qt]),no(""),Zn(!0),p==="default"&&M){try{const Ce=(Date.now()+1).toString(),je={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:d,initialRecommendation:null};er.current&&(Yn(Ut=>new Set([...Ut,Ce])),er.current=!1),ot(Ut=>[...Ut,je]),It.current=Ce;const pt=await M(qe,{sponsoredSuggestion:yt});if(ge.signal.aborted){yn.current=null;return}const ht=pt.recommendation||bt||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:d,hasResponseRecommendation:!!pt.recommendation,hasSponsoredSuggestionRecommendation:!!bt,finalRecommendationId:ht?.recommendation_id}),ot(Ut=>Ut.map(gn=>gn.id===Ce?{...gn,content:pt.answer,sourceLinks:pt.source_links,relatedItems:pt.related_items,initialRecommendation:ht,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-$e}:gn)),ma(qe,pt.answer,pt.source_links,pt.related_items,pt.recommendation||null,pt.followup_suggestions),xt("answer_completed",{message_id:Ce,query:qe,recommendation_id:ht?.recommendation_id,brand_name:(T=(P=ht?.recommendation)==null?void 0:P.creative)==null?void 0:T.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:"completed",metadata:{variant:p,source:"query_handler"}}),yn.current=null}catch(Ce){console.error("Error sending message:",Ce);const je=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(je);const pt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ot(ht=>[...ht,pt]),xt("answer_failed",{query:qe,status:je,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,metadata:{variant:p,source:"query_handler"}}),yn.current=null}finally{Ct.current===ge&&(Ct.current=null,It.current=null,Zn(!1))}return}if(!Be){setTimeout(()=>{if(ge.signal.aborted){Ct.current===ge&&(Ct.current=null,It.current=null);return}const Ce={id:(Date.now()+1).toString(),role:"assistant",content:"I'm a demo assistant. The SDK is not properly configured, but I can still help! Try clicking on the suggested questions above, or check your AdMesh API key configuration.",timestamp:new Date,recommendations:[],userQuery:d};ot(je=>[...je,Ce]),Ct.current===ge&&(Ct.current=null,It.current=null,Zn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),je=bt,pt={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:d,initialRecommendation:je};er.current&&(Yn(We=>new Set([...We,Ce])),er.current=!1),ot(We=>[...We,pt]),It.current=Ce;let ht=!1;const Ut=We=>{var xn,Bn,An,Vo;if(ht||ge.signal.aborted||Ct.current!==ge)return;ht=!0;const Fr=typeof We.response_time_ms=="number"?We.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-$e;ot(wr=>wr.map(En=>En.id===Ce?{...En,content:We.text,sourceLinks:We.source_links,relatedItems:We.related_items,initialRecommendation:En.initialRecommendation||je,responseTimeMs:Fr}:En)),ma(qe,We.text,We.source_links,We.related_items,null,We.followup_suggestions),We.error?xt("answer_failed",{message_id:Ce,query:qe,recommendation_id:je?.recommendation_id,brand_name:(Bn=(xn=je?.recommendation)==null?void 0:xn.creative)==null?void 0:Bn.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:We.error,metadata:{variant:p,source:"api_chat_assistant"}}):xt("answer_completed",{message_id:Ce,query:qe,recommendation_id:je?.recommendation_id,brand_name:(Vo=(An=je?.recommendation)==null?void 0:An.creative)==null?void 0:Vo.brand_name,used_capability:We.used_capability,latency_ms:Fr,status:"completed",metadata:{variant:p,source:"api_chat_assistant",response_time_ms:Fr}}),Ct.current===ge&&(yn.current=null,It.current=null,Zn(!1))},gn=await Ya(qe,mt,We=>{ht||ge.signal.aborted||ot(xn=>xn.map(Bn=>Bn.id===Ce?{...Bn,content:Bn.content+We}:Bn))},()=>{ht||ge.signal.aborted||Ct.current!==ge||(Zn(!0),mn(0))},je,ge.signal,Vt,Ut,We=>{!ht||ge.signal.aborted||Ct.current!==ge||ma(qe,We.text,We.source_links,We.related_items,null,We.followup_suggestions)});if(ht)return;if(ge.signal.aborted){gn.text.trim()||ot(We=>We.map(xn=>xn.id===Ce&&!xn.content.trim()?{...xn,content:"Generation stopped."}:xn)),xt("answer_failed",{message_id:Ce,query:qe,recommendation_id:je?.recommendation_id,brand_name:(me=(J=je?.recommendation)==null?void 0:J.creative)==null?void 0:me.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:"aborted",metadata:{variant:p,source:"api_chat_assistant"}}),yn.current=null;return}Ct.current===ge&&Ut(gn)}catch(Ce){console.error("Error sending message:",Ce);const je=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(je);const pt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ot(ht=>[...ht,pt]),xt("answer_failed",{query:qe,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:je,metadata:{variant:p,source:"api_chat_assistant"}}),yn.current=null}finally{Ct.current===ge&&(Ct.current=null,It.current=null,Zn(!1))}},[Ke,Ya,M,ma,Be,xt,p]),or=Cr,qo=v.useMemo(()=>or.some(d=>d?.is_sponsored),[or]),so=v.useMemo(()=>or.filter(d=>d&&typeof d.id=="string"?Me?qo:!0:!1),[qo,Me,or]),tn=v.useMemo(()=>ds(so),[so]),[Ui,ga]=v.useState(null);v.useEffect(()=>{const d=(xe||fe||[]).find(z=>{var P;return z.is_sponsored&&((P=z.recommendation)==null?void 0:P.status)==="generated"&&z.recommendation.recommendation});d&&ga(d)},[xe,fe]);const hn=v.useMemo(()=>{var d;if(ke!=="below-input-container"||!ie)return null;for(let z=Ue.length-1;z>=0;z-=1){const P=Ue[z],T=P.initialRecommendation;if(!(P.role!=="assistant"||T?.status!=="generated"||!T.recommendation))return{id:T.recommendation_id,text:((d=T.recommendation.creative)==null?void 0:d.follow_up_suggestion)||P.userQuery||"",type:"action",is_sponsored:!0,recommendation:T}}return Ui},[ie,Ue,Ui,ke]),jr=v.useCallback(async d=>{var z,P,T,J,me,$e,qe;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:d.text,is_sponsored:d.is_sponsored,hasRecommendation:!!d.recommendation,recommendationId:((z=d.recommendation)==null?void 0:z.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(P=d.recommendation)==null?void 0:P.tracking)!=null&&T.followup_engagement_url),sessionId:Oe}),er.current=d.is_sponsored||!1,yn.current=d.is_sponsored?d:null;const mt=tn.findIndex(ge=>ge.id===d.id);xt("suggestion_clicked",{suggestion_id:d.id,suggestion_text:d.text,suggestion_type:d.type,suggestion_position:mt>=0?mt:void 0,is_sponsored:d.is_sponsored,recommendation_id:(J=d.recommendation)==null?void 0:J.recommendation_id,brand_name:(qe=($e=(me=d.recommendation)==null?void 0:me.recommendation)==null?void 0:$e.creative)==null?void 0:qe.brand_name,query:d.text}),Rr(d.text),d.is_sponsored&&d.recommendation&&Be?setTimeout(async()=>{var ge;try{const yt=(ge=d.recommendation.tracking)==null?void 0:ge.followup_engagement_url,bt=d.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:yt,recommendationId:bt,sessionId:Oe}),yt&&bt&&Oe?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await Be.fireFollowupEngagement(yt,bt,Oe),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!yt,hasRecommendationId:!!bt,hasSessionId:!!Oe})}catch(yt){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",yt)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Rr,tn,Be,Oe,xt]),uo=Lh[ye],Ar=Dh[ae];v.useEffect(()=>{if(oo.current.forEach(d=>d()),oo.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return tn.forEach((d,z)=>{const P=sa.current.get(d.id);if(!P)return;const T=`${Oe||"anonymous"}:${d.id}:${d.is_sponsored?"s":"o"}`;if(fa.current.has(T))return;let J=null,me=null;const $e=()=>{J&&(clearTimeout(J),J=null),me?.disconnect(),me=null},qe=()=>{var mt,ge,yt,bt,Vt;if(fa.current.has(T)){$e();return}if(fa.current.add(T),$e(),xt("suggestion_exposure",{suggestion_id:d.id,suggestion_text:d.text,suggestion_type:d.type,suggestion_position:z,is_sponsored:d.is_sponsored,recommendation_id:(mt=d.recommendation)==null?void 0:mt.recommendation_id,brand_name:(bt=(yt=(ge=d.recommendation)==null?void 0:ge.recommendation)==null?void 0:yt.creative)==null?void 0:bt.brand_name}),Be&&Oe&&d.is_sponsored&&d.recommendation){const Qt=(Vt=d.recommendation.tracking)==null?void 0:Vt.followup_exposure_url,Ce=d.recommendation.recommendation_id;Qt&&Ce?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Qt,recommendationId:Ce,suggestionText:d.text,sessionId:Oe}),Be.fireFollowupExposure(Qt,Ce,Oe)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Qt,hasRecommendationId:!!Ce,suggestionText:d.text})}};me=new IntersectionObserver(mt=>{const ge=mt[0];if(ge){if(ge.intersectionRatio>=.5){J||(J=setTimeout(qe,1e3));return}J&&(clearTimeout(J),J=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),me.observe(P),oo.current.push($e)}),()=>{oo.current.forEach(d=>d()),oo.current=[]}},[tn,Be,Oe,xt,cr]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:so.length,isAnalyzingIntent:Pe,hasIntentError:!!De,onlyShowWhenSponsored:Me,hasSponsoredSuggestions:qo,sponsoredCount:or.filter(d=>d?.is_sponsored).length,nonSponsoredCount:or.filter(d=>d&&!(d!=null&&d.is_sponsored)).length,modalShouldAppear:Me?qo:!0,suggestions:or.map(d=>{var z,P,T;return{id:d?.id,text:d?.text,type:d?.type,is_sponsored:d?.is_sponsored,hasRecommendation:!!(d!=null&&d.recommendation),recommendationId:((z=d?.recommendation)==null?void 0:z.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(P=d?.recommendation)==null?void 0:P.tracking)!=null&&T.followup_engagement_url)}}),renderedSuggestions:tn.map(d=>{var z,P,T;return{id:d?.id,text:d?.text,type:d?.type,is_sponsored:d?.is_sponsored,hasRecommendation:!!(d!=null&&d.recommendation),recommendationId:((z=d?.recommendation)==null?void 0:z.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(P=d?.recommendation)==null?void 0:P.tracking)!=null&&T.followup_engagement_url)}})});const Xe={base:`${16*re}px`,sm:`${14*re}px`,xs:`${12*re}px`},ei=Y||"AI-generated responses may contain errors. Please verify important information independently.",ti=["Searching trusted sources...","Reviewing publisher coverage...","Checking relevant context...","Comparing supporting signals...","Identifying the strongest examples...","Organizing the most useful details...","Shaping the response for clarity...","Preparing the clearest answer...","Finishing the response..."],co=d=>{const z=d?.accentColor||vn,P=d?.metaColor||Hi,T=d?.includeSteps??p==="default",J=`${dr}s`,me=T?`${ti[tt]} (${J})`:`Generating answer... ${J}`;return f.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:d!=null&&d.compact?"8px":"10px",color:P,fontSize:d!=null&&d.compact?Xe.xs:Xe.sm},children:[f.jsx("span",{style:{width:d!=null&&d.compact?8:9,height:d!=null&&d.compact?8:9,borderRadius:999,background:z,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${lt(Ft,.28)}`,flexShrink:0}}),f.jsx("span",{children:me})]})},fo=v.useCallback((d,z)=>{if(Ir[d.id])return;const P=z?"helpful":"not_helpful";Wo(T=>({...T,[d.id]:P})),xt("answer_feedback",{message_id:d.id,query:d.userQuery,status:P,latency_ms:d.responseTimeMs,metadata:{helpful:z}})},[Ir,xt]);function jn(d,z){if(d.role!=="assistant"||!d.content.trim()||Ke&&d.id===It.current)return null;const P=z?.accentColor||vn,T=z?.metaColor||Hi,J=Ir[d.id],me=typeof d.responseTimeMs=="number";return f.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginTop:"10px",paddingTop:"10px",borderTop:`1px solid ${rn}`,flexWrap:"wrap"},children:[f.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",minWidth:0,flex:"1 1 auto",flexWrap:"wrap"},children:[f.jsx("span",{style:{fontSize:Xe.xs,color:T,whiteSpace:"nowrap"},children:J?"Thanks for your feedback":"Is this helpful?"}),J?f.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:lt(P,.12),color:P,flexShrink:0},children:J==="helpful"?f.jsx(Rc,{size:14}):f.jsx(Tc,{size:14})}):f.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexShrink:0},children:[f.jsx("button",{type:"button","aria-label":"Mark answer as helpful",onClick:()=>fo(d,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${rn}`,background:nn,color:T,cursor:"pointer"},children:f.jsx(Rc,{size:14,style:{flexShrink:0}})}),f.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>fo(d,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${rn}`,background:nn,color:T,cursor:"pointer"},children:f.jsx(Tc,{size:14,style:{flexShrink:0}})})]})]}),me?f.jsxs("span",{style:{fontSize:Xe.xs,color:T,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Ph(d.responseTimeMs)]}):null]})}const Nr=v.useCallback(()=>{const d=da.current;if(!d)return;const z=Math.max(0,d.scrollWidth-d.clientWidth);Xa(d.scrollLeft>4),ao(d.scrollLeft<z-4)},[]);v.useEffect(()=>(Nr(),window.addEventListener("resize",Nr),()=>window.removeEventListener("resize",Nr)),[Nr,tn.length]);const mo=v.useCallback(d=>{const z=da.current;z&&z.scrollBy({left:d==="left"?-Math.max(160,Math.floor(z.clientWidth*.75)):Math.max(160,Math.floor(z.clientWidth*.75)),behavior:"smooth"})},[]),lt=(d,z)=>{if(!d||!d.startsWith("#"))return`rgba(15, 23, 42, ${z})`;const P=d.slice(1),T=P.length===3?P.split("").map(qe=>`${qe}${qe}`).join(""):P;if(T.length!==6)return d;const J=parseInt(T.slice(0,2),16),me=parseInt(T.slice(2,4),16),$e=parseInt(T.slice(4,6),16);return`rgba(${J}, ${me}, ${$e}, ${z})`},Ft=K.primaryColor||"#3F037F",nn=K.surfaceColor||"#ffffff",Ki=K.backgroundColor||"#eef2ff",rn=K.borderColor||"#e5e7eb",zt=K.textColor||"#111827",yr=K.textSecondaryColor||"#6b7280";lt(Ft,.12);const on=lt(Ft,.24);lt(Ft,.38);const Dr=nn,vn=Ft,br=K.primaryTextColor||"#ffffff",Hi=yr,ya=_e||"Publisher Assistant",vr=Pe&&tn.length===0&&Ue.length===0,Lr=nn,po=nn,xr=rn,Qi=rn,Gi="0 16px 64px rgba(15, 23, 42, 0.14)",ni=yr,ri=yr,fs=vn,Xi=Ki,ms="none",ps="rgba(15, 23, 42, 0.18)";function Zi(d){return Yt?f.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:d==="default"?"10px 12px":"8px 10px",borderRadius:d==="default"?"14px":"12px",border:`1px solid ${on}`,background:lt("#ffffff",.9),marginBottom:"4px"},children:[f.jsxs("div",{style:{minWidth:0},children:[f.jsx("div",{style:{color:vn,fontSize:Xe.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),f.jsxs("div",{style:{color:zt,fontSize:Xe.sm,fontWeight:600,lineHeight:1.3},children:[Yt.brand_name," agent is active"]})]}),f.jsx("button",{type:"button",onClick:()=>{Ge("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${on}`,borderRadius:999,background:lt("#ffffff",.92),color:vn,padding:"7px 12px",fontSize:Xe.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function oi(d,z=Le){const P=Bo&&!z,T=z||P?"9px":"11px";return f.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:z||d==="default"?"2px":"8px",marginTop:z?"0":d==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:f.jsx("div",{style:{color:ri,fontSize:T,lineHeight:P?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:ei})})}function ai(d){const z=d==="publisher"?[180,220,196]:["100%","82%","68%"];return d==="publisher"?f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[f.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:lt(zt,.06),flexShrink:0}}),f.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:z.map((P,T)=>f.jsx("div",{style:{width:P,maxWidth:"100%",height:40,borderRadius:"6px",background:lt(zt,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${T}`))}),f.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:lt(zt,.06),flexShrink:0}})]}):f.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:d==="publisher"?"10px":"12px"},children:z.map((P,T)=>f.jsx("div",{style:{width:P,maxWidth:"100%",height:d==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${lt(Ft,.08)} 0%, ${lt(Ft,.18)} 50%, ${lt(Ft,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:d==="publisher"?`0 8px 22px ${lt(Ft,.08)}`:"none"}},`suggestion-skeleton-${T}`))})}function hs(d=Le){if(Ke)return null;if(vr)return ai("publisher");if(!tn.length)return null;const z=d&&Ja,P=tn.slice(0,Fe);return E==="stacked"?f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:d?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:d?"240px":void 0,paddingRight:d?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:P.map(T=>f.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Tr(T.id),onClick:()=>{p==="default"&&(Ht(!0),y==="floating"&&rr(!0)),jr(T)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${T.is_sponsored?Ft:rn}`,background:T.is_sponsored?Ft:nn,color:T.is_sponsored?br:zt,padding:d?"8px 10px":"10px 14px",fontSize:d?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[f.jsx("span",{style:{minWidth:0},children:T.text}),ie&&T.is_sponsored&&f.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:lt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},T.id))}):f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:z?"4px":pn?"5px":d?"6px":"10px",flexShrink:0},children:[!z&&f.jsx("button",{type:"button",onClick:()=>mo("left"),disabled:!Pr,"aria-label":"Scroll suggestions left",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:pn?20:d?24:28,height:pn?20:d?24:28,borderRadius:"6px",border:`1px solid ${rn}`,background:nn,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:Pr?"pointer":"default",opacity:Pr?1:.55},children:f.jsx(Fp,{size:pn?13:d?14:16,style:{flexShrink:0},"aria-hidden":"true"})}),f.jsx("div",{ref:da,onScroll:Nr,style:{display:"flex",gap:z?"4px":pn?"5px":d?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:P.map(T=>f.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Tr(T.id),onClick:()=>{p==="default"&&(Ht(!0),y==="floating"&&rr(!0)),jr(T)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:z?"4px":pn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${T.is_sponsored?Ft:rn}`,background:T.is_sponsored?Ft:nn,color:T.is_sponsored?br:zt,padding:z?"4px 8px":pn?"5px 8px":d?"7px 10px":"8px 14px",fontSize:z?"10px":pn?"11px":d?"12px":"13px",fontWeight:500,lineHeight:z?1:pn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[f.jsx("span",{children:T.text}),ie&&T.is_sponsored&&f.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},T.id))}),!z&&f.jsx("button",{type:"button",onClick:()=>mo("right"),disabled:!mr,"aria-label":"Scroll suggestions right",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:pn?20:d?24:28,height:pn?20:d?24:28,borderRadius:"6px",border:`1px solid ${rn}`,background:nn,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:mr?"pointer":"default",opacity:mr?1:.55},children:f.jsx(Op,{size:pn?13:d?14:16,style:{flexShrink:0},"aria-hidden":"true"})})]})}function gs(d=Le){if(d||pe||!(hn!=null&&hn.recommendation))return null;const z=`publisher-sponsored-creative-${hn.id}`;return f.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:f.jsx(Qa,{theme:K,messageId:z,query:hn.text,initialRecommendation:hn.recommendation,onFollowupDetected:en,onRecommendationsShown:(P,T)=>{hr(P,T,hn.text)},onError:P=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",P)}})})}function ys(d){var z,P;return(z=d.relatedItems)!=null&&z.length||!((P=d.sourceLinks)!=null&&P.length)?null:f.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"16px"},children:[f.jsx("div",{style:{width:"100%",fontSize:"11px",fontWeight:600,color:yr},children:"Sources"}),d.sourceLinks.map(T=>f.jsxs("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{xt("source_link_clicked",{message_id:d.id,query:d.userQuery,metadata:{source_title:T.title,source_url:T.url}})},style:{color:vn,fontSize:Xe.xs,textDecoration:"none",borderBottom:`1px solid ${lt(Ft,.18)}`},children:[T.title||T.url," ",f.jsx(Dp,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${d.id}-${T.url}`))]})}function ii(d,z=Le){var P;return(P=d.relatedItems)!=null&&P.length?f.jsxs("div",{style:{marginTop:"14px"},children:[ze&&f.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:yr,marginBottom:"8px"},children:ze}),f.jsx("div",{style:{display:"flex",gap:z?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:d.relatedItems.slice(0,4).map(T=>f.jsxs("a",{className:"admesh-publisher-source",href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{xt("source_link_clicked",{message_id:d.id,query:d.userQuery,metadata:{source_title:T.title,source_url:T.url,source_publisher:T.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:z?"6px":"10px",padding:z?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:zt,border:`1px solid ${rn}`,background:nn,boxShadow:"none",flex:z?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:z?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[f.jsx(Mh,{imageUrl:T.image_url,logoUrl:A,articleUrl:T.url},`${T.image_url||""}-${A||""}`),f.jsx("div",{style:{fontSize:z?"12px":"14px",fontWeight:650,lineHeight:1.35,color:zt,overflowWrap:"anywhere"},children:T.title||T.url}),T.publisher&&f.jsx("div",{style:{fontSize:z?"11px":"12px",color:yr,lineHeight:1.4,overflowWrap:"anywhere"},children:T.publisher})]},`${d.id}-${T.url}`))})]}):null}function bs(d=Le){const z=d?"13px":"15px";return f.jsxs("div",{ref:Rn,style:{flex:d?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:d?"0 2px 4px":pe?"16px 16px 8px":0},children:[Ue.map(P=>{const T=P.role==="user"&&P.id===qt.current;return f.jsx("div",{ref:T?Et:void 0,style:{marginBottom:d?"16px":"28px",textAlign:P.role==="user"?"right":"left"},children:(()=>{const J=!!P.content.trim()||!Ke;return f.jsx(f.Fragment,{children:f.jsxs("div",{style:{display:P.role==="assistant"?"block":"inline-block",width:P.role==="assistant"?"100%":void 0,maxWidth:P.role==="assistant"?"100%":"76%",padding:P.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:P.role==="assistant"?0:"8px",background:P.role==="user"?lt(zt,.05):"transparent",color:zt,boxShadow:"none",border:"none",fontSize:P.role==="assistant"?z:d?"12px":"13px",lineHeight:P.role==="assistant"?1.62:1.4},children:[P.role==="assistant"?P.content.trim()?f.jsx(cs,{content:P.content,theme:{...K,textColor:zt},fontSize:z}):Ke&&P.id===It.current?co({includeSteps:!0}):null:f.jsx("p",{style:{margin:0,color:zt},children:P.content}),P.role==="assistant"&&ys(P),P.role==="assistant"&&ii(P,d),P.role==="assistant"&&jn(P),ie&&P.role==="assistant"&&Jt.has(P.id)&&P.initialRecommendation&&f.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:f.jsx(Qa,{theme:K,messageId:P.id,query:P.userQuery,initialRecommendation:P.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(me,$e)=>{hr(me,$e,P.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})}),ie&&P.role==="assistant"&&(J||!M)&&!Jt.has(P.id)&&(P.initialRecommendation||Lt)&&f.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:f.jsx(Qa,{theme:K,messageId:P.id,query:P.userQuery,initialRecommendation:P.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(me,$e)=>{hr(me,$e,P.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})})]})})})()},P.id)}),Jn&&f.jsx("div",{role:"alert",style:{color:zt,fontSize:Xe.sm,border:`1px solid ${rn}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),f.jsx("div",{ref:ca})]})}if(p==="default"){let d=function(T){const J=Jc(Bo);return os.createPortal(f.jsxs(f.Fragment,{children:[f.jsx("div",{style:P}),f.jsx("div",{style:J.shell,children:T})]}),document.body)},z=function(T=!1){const J=Sn(T),me=T||J&&pe,$e=!me&&$==="input",qe=J&&!me&&Ja,mt=me&&!(Le&&C==="expand"&&!T&&io),ge=me?Jc(Bo):null,yt=!!(ge&&Bo&&!J),bt=J?_n:ge?ge.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Vt=J?tr:ge?ge.panelHeight:"auto",Qt=J?_n:ge?.panelMaxWidth??"100%",Ce=J?tr:ge?.panelMaxHeight,je=N&&!qe&&me;return f.jsxs("div",{className:"admesh-publisher-panel","data-compact":J?"true":"false",style:{"--publisher-accent":vn,color:zt,width:bt,maxWidth:Qt,height:Vt,maxHeight:Ce,boxSizing:"border-box",display:"flex",flexDirection:"column",background:me?Lr:Dr,borderRadius:!J&&ge?ge.panelBorderRadius:"12px",padding:me?0:J?"6px":0,boxShadow:yt?"none":me?Gi:"none",border:yt||$e?"none":`1px solid ${Qi}`,overflow:"hidden",minHeight:J?0:void 0},children:[f.jsx("style",{children:jc}),je&&f.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:J?"8px 10px":"14px 20px",background:po,color:zt,borderBottom:`1px solid ${xr}`,flexShrink:0},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[f.jsx("div",{style:{width:J?26:32,height:J?26:32,flexShrink:0,borderRadius:"6px",background:lt(zt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:vn,overflow:"hidden"},children:A?f.jsx("img",{src:A,alt:`${x||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:nn,padding:4}}):f.jsx(as,{size:J?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(G||S)&&f.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[G&&f.jsx("div",{style:{fontSize:J?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:x}),S&&f.jsx("div",{style:{fontSize:J?"10px":"12px",color:ni,marginTop:"2px"},children:ya})]})]}),me&&(!J||T)&&f.jsx("button",{type:"button",onClick:()=>Ht(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"8px",border:`1px solid ${xr}`,background:nn,color:ni,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(Pc,{size:16,strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":"true"})})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:qe?"2px":J?"6px":"16px",minHeight:0,flex:J||me?"1 1 0":void 0,overflow:J||me?"hidden":void 0,overscrollBehavior:"contain",padding:$e?J?"4px":"8px":J?"8px":"20px",justifyContent:me?void 0:"center",background:Lr},children:[Zi("default"),mt&&bs(J),!$e&&f.jsxs(f.Fragment,{children:[J&&!me&&!qe&&f.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),J&&!me&&ve&&D&&Ue.length===0&&f.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:Ve}),hs(J)]}),($e||!J||me||R)&&f.jsx(qp,{value:Dt,onChange:no,open:$e&&cr&&!pe,onOpenChange:$e?Zt:Ih,suggestions:tn.slice(0,Fe),registerSuggestion:Tr,loading:Ke,analyzing:vr,compact:J,expanded:me,showLogo:!me,suggestionPlacement:oe,logoUrl:A,title:x,placeholder:ne,colors:{accent:vn,accentText:br,surface:Xi,text:zt,muted:yr,border:rn},onStop:gr,onSend:()=>{yn.current=null,er.current=!1,Ht(!0),y==="floating"&&rr(!0),Rr(Dt)},onSuggestion:pt=>{Ht(!0),y==="floating"&&rr(!0),jr(pt)}}),me&&oi("default",J),!me&&$==="always"&&gs(J)]})]})};const P={position:"fixed",inset:0,background:ps,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Le?f.jsxs("div",{ref:Bi,className:"admesh-component","data-admesh-theme":Ie,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":C,"data-admesh-ad-slot-expanded":Za?"true":"false",style:{width:_n,height:tr,maxWidth:_n,maxHeight:tr,position:"relative",overflow:"hidden"},children:[z(!1),io&&typeof document<"u"&&d(z(!0))]}):f.jsxs("div",{className:"admesh-component","data-admesh-theme":Ie,style:{width:"100%",position:"relative"},children:[z(!1),pe&&typeof document<"u"&&d(z(!0))]}):Xt?f.jsxs("div",{className:"admesh-component","data-admesh-theme":Ie,children:[!pe&&f.jsx("div",{style:{position:"fixed",...uo,zIndex:2147483001},children:z(!1)}),pe&&typeof document<"u"&&d(z(!0))]}):f.jsx("div",{className:"admesh-component","data-admesh-theme":Ie,children:f.jsxs("button",{type:"button",onClick:ha,style:{position:"fixed",...uo,zIndex:2147483e3,border:"none",borderRadius:"6px",background:K.primaryColor,color:br,display:"flex",alignItems:"center",gap:"8px",fontSize:"13px",fontWeight:600,padding:"12px 16px",boxShadow:"0 4px 16px rgba(15, 23, 42, 0.12)",cursor:"pointer"},children:[f.jsx(as,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),c]})})}return tn.length===0&&!vr?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?f.jsx("div",{className:"admesh-component","data-admesh-theme":Ie,children:f.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Ga(Q)??"100%",backgroundColor:"#eef2ff",fontSize:Xe.base,...m},children:f.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[vr?ai("legacy"):tn.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:tn.slice(0,Fe).map((d,z)=>f.jsxs("button",{ref:Tr(d.id),onClick:()=>jr(d),className:"rounded-full px-5 py-4 text-left shadow-sm transition-transform duration-200 hover:scale-[1.01] active:scale-[0.99]",style:{width:z===0?"100%":z===1?"82%":"68%",backgroundColor:K.surfaceColor||"#ffffff",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:Xe.sm},children:[f.jsx("span",{className:"leading-tight",children:d.text}),ie&&d.is_sponsored&&f.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},d.id))}),Ue.length>0&&f.jsxs("div",{ref:Rn,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:K.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[Ue.map(d=>{const z=d.role==="user"&&d.id===qt.current;return f.jsx("div",{ref:z?Et:void 0,className:d.role==="user"?"text-right":"text-left",children:f.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:d.role==="user"?K.primaryColor:"#ffffff",color:d.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,fontSize:Xe.sm},children:d.role==="assistant"?d.content.trim()?f.jsxs(f.Fragment,{children:[f.jsx(cs,{content:d.content,theme:K,fontSize:Xe.sm}),jn(d,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):Ke&&d.id===It.current?co({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:f.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:d.content})})},d.id)}),Ke&&!Ue.some(d=>d.role==="assistant"&&d.id===It.current&&!d.content.trim())&&f.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:co({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})}),Jn&&f.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:"Connection issue. Please try again."}),f.jsx("div",{ref:ca})]}),f.jsx("div",{className:"rounded-[1.5rem] bg-white p-3 shadow-sm",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("input",{type:"text",value:Dt,onChange:d=>no(d.target.value),onKeyPress:d=>{if(d.key==="Enter"){if(Ke){d.preventDefault();return}Rr(Dt)}},placeholder:ne,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textColor,fontSize:Xe.sm}}),f.jsx("button",{onClick:()=>{if(Ke){gr();return}Rr(Dt)},disabled:!Ke&&!Dt.trim(),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:Ke?"#dc2626":K.primaryColor,color:"#ffffff"},children:Ke?f.jsx(is,{size:18}):f.jsx(Mc,{size:18})})]})}),f.jsxs("div",{className:"space-y-2 text-center",children:[f.jsxs("p",{style:{color:K.textSecondaryColor,fontSize:Xe.xs,fontWeight:600},children:["Powered by"," ",f.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none",fontWeight:700},children:"AdMesh"})]}),f.jsx("p",{style:{color:K.textSecondaryColor,fontSize:Xe.xs,lineHeight:1.5},children:ei})]})]})})}):Xt?f.jsx("div",{className:"admesh-component","data-admesh-theme":Ie,children:f.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...pe?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...uo,width:Ga(Q)??Ar.width,height:Ga(te)??Ar.height},backgroundColor:pe?Lr:K.backgroundColor,zIndex:9999,fontSize:Xe.base,borderRadius:pe?"20px":"16px",border:pe?`1px solid ${Qi}`:"1px solid transparent",boxShadow:pe?Gi:"0 20px 40px rgba(15, 23, 42, 0.12)",...m},children:[N&&f.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between p-4 border-b",style:{position:"sticky",top:0,zIndex:10,borderColor:pe?xr:"transparent",background:pe?po:K.backgroundColor,padding:pe?"18px 20px":"16px"},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{style:{width:pe?40:32,height:pe?40:32,borderRadius:pe?"14px":"10px",background:lt(Ft,.08),color:vn,display:"flex",alignItems:"center",justifyContent:"center",fontSize:pe?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:A?f.jsx("img",{src:A,alt:`${x||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(x||"AA").slice(0,2).toUpperCase()}),(G||S&&pe)&&f.jsxs("div",{children:[G&&f.jsx("div",{className:"font-medium",style:{color:K.textColor,fontSize:pe?"20px":Xe.base,fontWeight:700,letterSpacing:pe?"-0.02em":0},children:x}),S&&pe&&f.jsx("div",{style:{color:ni,fontSize:"12px",marginTop:"2px"},children:ya})]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[!Le&&f.jsx("button",{onClick:Vi,className:"transition-colors",title:pe?"Minimize":"Expand",style:{width:pe?36:28,height:pe?36:28,borderRadius:pe?"12px":"10px",border:`1px solid ${pe?xr:"transparent"}`,background:pe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:pe?f.jsx(Pc,{size:16,style:{color:K.textSecondaryColor}}):f.jsx(Wp,{size:16,style:{color:K.textSecondaryColor}})}),f.jsx("button",{onClick:lo,className:"transition-colors",style:{width:pe?36:28,height:pe?36:28,borderRadius:pe?"12px":"10px",border:`1px solid ${pe?xr:"transparent"}`,background:pe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(is,{size:16,style:{color:K.textSecondaryColor}})})]})]}),f.jsxs("div",{ref:Rn,className:"flex-1 min-h-0 overflow-y-auto p-4",style:{flex:"1 1 0%",minHeight:0,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:pe?"20px":"16px"},children:[Zi("legacy"),ve&&Ue.length===0&&f.jsx("div",{className:"mb-3",children:f.jsx("div",{className:"inline-block p-2 rounded-lg",children:f.jsx("p",{style:{color:K.textColor,margin:0,fontSize:Xe.sm},children:Ve})})}),Ue.map(d=>{const z=d.role==="user"&&d.id===qt.current;return f.jsxs("div",{ref:z?Et:void 0,className:"mb-3",children:[f.jsx("div",{className:d.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:d.role==="user"?fs:"transparent",color:d.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,border:"none",borderRadius:d.role==="user"?pe?"14px":"12px":0,padding:d.role==="user"?pe?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:d.role==="assistant"?d.content.trim()?f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{fontSize:`calc(${Xe.sm} * 1.3)`,lineHeight:1.65},children:f.jsx(cs,{content:d.content,theme:K,fontSize:`calc(${Xe.sm} * 1.3)`})}),jn(d,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):Ke&&d.id===It.current?co({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:f.jsx("p",{style:{margin:0,fontSize:Xe.sm,lineHeight:"1.4"},children:d.content})}),d.role==="assistant"&&!Jt.has(d.id)&&f.jsx(Qa,{theme:K,messageId:d.id,query:d.userQuery,onFollowupDetected:en,onRecommendationsShown:(P,T)=>{hr(P,T,d.userQuery)},onError:P=>{console.error("[AdMeshIntentAssistant] Recommendations error:",P)}}),d.role==="assistant"&&Jt.has(d.id)&&d.initialRecommendation&&f.jsxs("div",{className:"mb-4",children:[f.jsx("div",{className:"text-xs text-gray-500 mb-2 font-semibold",children:"Sponsored Recommendation"}),f.jsx(Qa,{theme:K,messageId:d.id,query:d.userQuery,initialRecommendation:d.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(P,T)=>{hr(P,T,d.userQuery)},onError:P=>{console.error("[AdMeshIntentAssistant] Recommendations error:",P)}})]})]},d.id)}),Ke&&!Ue.some(d=>d.role==="assistant"&&d.id===It.current&&!d.content.trim())&&f.jsx("div",{className:"mb-3",children:f.jsx("div",{className:"inline-block p-2 rounded-lg",style:{backgroundColor:"transparent"},children:co({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})})}),Jn&&f.jsx("div",{className:"mb-3",children:f.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textSecondaryColor},children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{style:{fontSize:Xe.xs},children:"\u26A0\uFE0F"}),f.jsx("span",{style:{fontSize:Xe.sm},children:"Connection issue. Please try again."})]})})}),f.jsx("div",{ref:ca})]}),Ue.length===0&&vr&&f.jsx("div",{className:"px-4 pb-2",children:ai("legacy")}),tn.length>0&&Ue.length===0&&!vr&&f.jsx("div",{className:"px-4 pb-2",children:f.jsx("div",{className:"flex flex-col gap-2",children:tn.slice(0,Fe).map(d=>f.jsxs("button",{ref:Tr(d.id),onClick:()=>jr(d),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:K.surfaceColor||"#f8fafc",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:Xe.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[f.jsx("span",{className:"leading-tight",children:d.text}),ie&&d.is_sponsored&&f.jsx("sup",{className:"absolute right-1 top-1 rounded-full px-1.5 py-0.5 tracking-wide",style:{fontSize:"9px",lineHeight:1,backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b"},children:"Ad"})]},d.id))})}),De&&!Pe&&so.length===0&&f.jsx("div",{className:"px-4 pb-2",children:f.jsx("div",{className:"flex flex-col gap-2",children:f.jsxs("div",{className:"p-3 rounded-lg border",style:{backgroundColor:K.surfaceColor,borderColor:K.borderColor,color:K.textSecondaryColor},children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx("span",{style:{fontSize:Xe.sm},children:"Intent analysis failed"}),f.jsx("button",{onClick:_t,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:K.primaryColor,color:"#ffffff"},children:"Retry"})]}),f.jsx("span",{style:{fontSize:Xe.xs},children:De})]})})}),f.jsxs("div",{className:"p-3 border-t",style:{borderColor:pe?xr:"transparent",padding:pe?"18px 20px":void 0,background:pe?po:void 0},children:[f.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${xr}`,borderRadius:pe?"16px":"12px",background:Xi,boxShadow:pe?ms:"none",padding:pe?"8px 8px 8px 14px":void 0},children:[f.jsx("input",{type:"text",value:Dt,onChange:d=>no(d.target.value),onKeyPress:d=>{if(d.key==="Enter"){if(Ke){d.preventDefault();return}Rr(Dt)}},placeholder:ne,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textColor,fontSize:pe?"15px":Xe.sm,"--tw-ring-color":K.primaryColor}}),f.jsx("button",{onClick:()=>{if(Ke){gr();return}Rr(Dt)},disabled:!Ke&&!Dt.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:Ke?"#dc2626":K.primaryColor,color:"#ffffff",borderRadius:pe?"12px":"10px",width:pe?"46px":void 0,height:pe?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:pe?`0 10px 20px ${lt(Ft,.18)}`:"none"},children:Ke?f.jsx(is,{size:14}):f.jsx(Mc,{size:14})})]}),oi("legacy")]})]})}):f.jsx("div",{className:"admesh-component","data-admesh-theme":Ie,children:f.jsx("button",{onClick:ha,className:"flex items-center gap-2 px-4 py-3 rounded-full shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",style:{position:"fixed",...uo,backgroundColor:K.primaryColor,color:"#ffffff",zIndex:9999,fontSize:Xe.base,...m},children:f.jsx("span",{className:"font-medium",children:c})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const Oh=/^[a-z0-9](?:[a-z0-9-]{1,46}[a-z0-9])?$/,Wi=new WeakMap,$h={mode:"light",primaryColor:"#42116e",primaryTextColor:"#ffffff",secondaryColor:"#6b5e75",backgroundColor:"#faf9fb",surfaceColor:"#ffffff",borderColor:"#e7e1ec",textColor:"#302039",textSecondaryColor:"#6b5e75",borderRadius:"16px"};function Wh(){const s=document.currentScript;return s instanceof HTMLScriptElement?s:Array.from(document.scripts).find(l=>l.src.includes("/brand-assistant.js")&&l.dataset.admeshMounted!=="true")||null}function nd(s,l){if(!s||typeof s!="object")return null;const m=s;if(m.slug!==l||typeof m.assistant_name!="string"||typeof m.welcome_message!="string"||!Array.isArray(m.suggested_questions))return null;const c=m.assistant_name.trim().slice(0,160)||"Brand Assistant";let x=null;if(typeof m.support_url=="string")try{const N=new URL(m.support_url);N.protocol==="https:"&&(x=N.href)}catch{}const A=m.suggested_questions.filter(N=>typeof N=="string").slice(0,4).map(N=>N.slice(0,300)).filter(Boolean);return{slug:l,assistant_name:c,logo_url:typeof m.logo_url=="string"?m.logo_url:null,support_url:x,welcome_message:m.welcome_message.slice(0,500),suggested_questions:A.length?A:[`What is ${c}?`]}}async function Bh(s,l,m){if(s.dataset.brandPreview)try{return nd(JSON.parse(s.dataset.brandPreview),l)}catch{return null}const c=await fetch(`${m}/api/public/brands/${encodeURIComponent(l)}/embed/`,{cache:"no-store",headers:{Accept:"application/json"},credentials:"omit"});return c.ok?nd(await c.json(),l):null}function qh(s,l,m,c){let x=[],A=!1;return async N=>{if(m)throw new Error("Questions become available after this profile is published.");const G=N.trim().slice(0,500);if(!G)throw new Error("Enter a question.");A||(A=!0,fetch(`${l}/api/public/brands/${encodeURIComponent(s)}/qa-start/`,{method:"POST",credentials:"omit",keepalive:!0}).catch(()=>{}));const S=await fetch(`${l}/api/public/brands/${encodeURIComponent(s)}/ask/`,{method:"POST",cache:"no-store",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({question:G,history:x.slice(-6)}),signal:AbortSignal.timeout(25e3)});if(!S.ok){const W=await S.json().catch(()=>null);throw new Error(W?.detail||"The Brand Agent could not answer right now. Please try again.")}const y=await S.json();if(y.outcome!=="answered"&&y.outcome!=="no_answer"||typeof y.answer!="string"||!Array.isArray(y.sources))throw new Error("The Brand Agent returned an unexpected answer. Please try again.");return x=[...x,{role:"visitor",text:G},{role:"assistant",text:y.answer}].slice(-6).map(W=>({...W,text:W.text.slice(0,1e3)})),{answer:y.answer,source_links:y.sources.filter(W=>W&&typeof W.url=="string").map(W=>({title:W.title,url:W.url})),related_items:y.outcome==="no_answer"&&c?[{title:"Contact the brand",url:c}]:void 0}}}function Vh({config:s,mode:l,queryHandler:m,suggestions:c,preview:x}){const[A,N]=v.useState(()=>window.location.hash==="#brand-assistant");return v.useEffect(()=>{const G=()=>{window.location.hash==="#brand-assistant"&&N(!0)},S=y=>{y.target instanceof Element&&y.target.closest('a[href="#brand-assistant"]')&&N(!0)};return window.addEventListener("hashchange",G),document.addEventListener("click",S),()=>{window.removeEventListener("hashchange",G),document.removeEventListener("click",S)}},[]),ts.createElement(Fh,{variant:"default",layout:l,position:"bottom-right",size:"md",open:A,onOpenChange:N,adsEnabled:!1,onlyShowWhenSponsored:!1,headerTitle:s.assistant_name,headerLogoUrl:s.logo_url,triggerLabel:`Ask ${s.assistant_name}`,subtitle:"Brand Assistant",showWelcomeMessage:!0,welcomeMessage:s.welcome_message,placeholder:`Ask ${s.assistant_name} a question\u2026`,disclaimerText:x?"Private preview. Questions become available after publication.":"Answers use this brand's approved public information. Avoid sharing personal details.",poweredByLabel:"Powered by AdMesh",relatedItemsHeading:"Need more help?",suggestions:c,queryHandler:m})}async function Uh(){var s;const l=Wh();if(!l||!l.isConnected||Wi.has(l))return;const m=((s=l.dataset.brandSlug)==null?void 0:s.trim().toLowerCase())||"";if(!Oh.test(m)){console.error("[AdMesh] Brand assistant script requires a valid data-brand-slug.");return}const c=new URL(l.src).origin,x=c==="https://embed.useadmesh.com"?"https://useadmesh.com":c,A=await Bh(l,m,x).catch(()=>null);if(!l.isConnected)return;if(!A){l.dispatchEvent(new Event("admesh:brand-assistant-unavailable"));return}const N=!!l.dataset.brandPreview,G=l.dataset.mode==="inline"?"inline":"floating",S=G==="inline"?document.querySelector(l.dataset.target||"#admesh-brand-assistant"):document.body;if(!S){console.error("[AdMesh] Brand assistant inline target was not found.");return}const y=document.createElement("div");y.className="admesh-publisher-assistant-reactMount",y.dataset.brandAssistant=m,S.appendChild(y);const W=Sc.createRoot(y),C=`brand-${m}-${crypto.randomUUID()}`,V=A.suggested_questions.map((D,R)=>({id:`brand-${R}`,text:D,type:"information"}));W.render(ts.createElement(Vc,{apiKey:"",sessionId:C,skipSdkInitialization:!0,theme:$h},ts.createElement(Vh,{config:A,mode:G,suggestions:V,preview:N,queryHandler:qh(m,x,N,A.support_url)}))),l.dataset.admeshMounted="true",Wi.set(l,{unmount:()=>{W.unmount(),y.remove(),l.dataset.admeshMounted="false"}}),l.dispatchEvent(new Event("admesh:brand-assistant-ready"))}window.AdMeshBrandAssistant={unmount(s){var l;(l=Wi.get(s))==null||l.unmount(),Wi.delete(s)}},Uh()})();})();
1226
1226
  //# sourceMappingURL=brand-assistant.js.map