admesh-ui-sdk 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/brand-assistant.js +65 -55
- package/dist/brand-assistant.js.map +1 -1
- package/dist/components/AdMeshIntentAssistant.d.ts +2 -0
- package/dist/components/AdMeshIntentAssistant.d.ts.map +1 -1
- package/dist/components/PublisherAssistantComposer.d.ts.map +1 -1
- package/dist/index.js +50 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1420 -1322
- package/dist/index.mjs.map +1 -1
- package/dist/publisher-assistant.js +66 -56
- package/dist/publisher-assistant.js.map +1 -1
- package/dist/publisherAssistantEmbed.d.ts.map +1 -1
- package/dist/utils/relatedArticleImages.d.ts +2 -0
- package/dist/utils/relatedArticleImages.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var
|
|
1
|
+
(()=>{var J0=Object.defineProperty,Y0=(Qr,sr,Io)=>sr in Qr?J0(Qr,sr,{enumerable:!0,configurable:!0,writable:!0,value:Io}):Qr[sr]=Io,Kr=(Qr,sr,Io)=>Y0(Qr,typeof sr!="symbol"?sr+"":sr,Io);(function(){"use strict";var Qr;function sr(i,l){if(!i)return null;try{const d=new URL(i,l);return["https:","http:"].includes(d.protocol)?d.href:null}catch{return null}}function Io(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var gd={exports:{}},Me={};/**
|
|
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
|
|
9
|
+
*/var bd;function Nf(){if(bd)return Me;bd=1;var i=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),R=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),W=Symbol.iterator;function I(f){return f===null||typeof f!="object"?null:(f=W&&f[W]||f["@@iterator"],typeof f=="function"?f:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,H={};function ee(f,T,G){this.props=f,this.context=T,this.refs=H,this.updater=G||M}ee.prototype.isReactComponent={},ee.prototype.setState=function(f,T){if(typeof f!="object"&&typeof f!="function"&&f!=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,f,T,"setState")},ee.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function te(){}te.prototype=ee.prototype;function re(f,T,G){this.props=f,this.context=T,this.refs=H,this.updater=G||M}var ne=re.prototype=new te;ne.constructor=re,B(ne,ee.prototype),ne.isPureReactComponent=!0;var ie=Array.isArray;function Q(){}var $={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function le(f,T,G){var Y=G.ref;return{$$typeof:i,type:f,key:T,ref:Y!==void 0?Y:null,props:G}}function be(f,T){return le(f.type,T,f.props)}function Oe(f){return typeof f=="object"&&f!==null&&f.$$typeof===i}function oe(f){var T={"=":"=0",":":"=2"};return"$"+f.replace(/[=:]/g,function(G){return T[G]})}var ue=/\/+/g;function ye(f,T){return typeof f=="object"&&f!==null&&f.key!=null?oe(""+f.key):T.toString(36)}function Te(f){switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:switch(typeof f.status=="string"?f.then(Q,Q):(f.status="pending",f.then(function(T){f.status==="pending"&&(f.status="fulfilled",f.value=T)},function(T){f.status==="pending"&&(f.status="rejected",f.reason=T)})),f.status){case"fulfilled":return f.value;case"rejected":throw f.reason}}throw f}function C(f,T,G,Y,_e){var ve=typeof f;(ve==="undefined"||ve==="boolean")&&(f=null);var ze=!1;if(f===null)ze=!0;else switch(ve){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(f.$$typeof){case i:case l:ze=!0;break;case U:return ze=f._init,C(ze(f._payload),T,G,Y,_e)}}if(ze)return _e=_e(f),ze=Y===""?"."+ye(f,0):Y,ie(_e)?(G="",ze!=null&&(G=ze.replace(ue,"$&/")+"/"),C(_e,T,G,"",function(Re){return Re})):_e!=null&&(Oe(_e)&&(_e=be(_e,G+(_e.key==null||f&&f.key===_e.key?"":(""+_e.key).replace(ue,"$&/")+"/")+ze)),T.push(_e)),1;ze=0;var Le=Y===""?".":Y+":";if(ie(f))for(var Ne=0;Ne<f.length;Ne++)Y=f[Ne],ve=Le+ye(Y,Ne),ze+=C(Y,T,G,ve,_e);else if(Ne=I(f),typeof Ne=="function")for(f=Ne.call(f),Ne=0;!(Y=f.next()).done;)Y=Y.value,ve=Le+ye(Y,Ne++),ze+=C(Y,T,G,ve,_e);else if(ve==="object"){if(typeof f.then=="function")return C(Te(f),T,G,Y,_e);throw T=String(f),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return ze}function V(f,T,G){if(f==null)return f;var Y=[],_e=0;return C(f,Y,"","",function(ve){return T.call(G,ve,_e++)}),Y}function se(f){if(f._status===-1){var T=f._result;T=T(),T.then(function(G){(f._status===0||f._status===-1)&&(f._status=1,f._result=G)},function(G){(f._status===0||f._status===-1)&&(f._status=2,f._result=G)}),f._status===-1&&(f._status=0,f._result=T)}if(f._status===1)return f._result.default;throw f._result}var ke=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},Ce={map:V,forEach:function(f,T,G){V(f,function(){T.apply(this,arguments)},G)},count:function(f){var T=0;return V(f,function(){T++}),T},toArray:function(f){return V(f,function(T){return T})||[]},only:function(f){if(!Oe(f))throw Error("React.Children.only expected to receive a single React element child.");return f}};return Me.Activity=E,Me.Children=Ce,Me.Component=ee,Me.Fragment=d,Me.Profiler=v,Me.PureComponent=re,Me.StrictMode=c,Me.Suspense=_,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Me.__COMPILER_RUNTIME={__proto__:null,c:function(f){return $.H.useMemoCache(f)}},Me.cache=function(f){return function(){return f.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(f,T,G){if(f==null)throw Error("The argument must be a React element, but you passed "+f+".");var Y=B({},f.props),_e=f.key;if(T!=null)for(ve in T.key!==void 0&&(_e=""+T.key),T)!fe.call(T,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&T.ref===void 0||(Y[ve]=T[ve]);var ve=arguments.length-2;if(ve===1)Y.children=G;else if(1<ve){for(var ze=Array(ve),Le=0;Le<ve;Le++)ze[Le]=arguments[Le+2];Y.children=ze}return le(f.type,_e,Y)},Me.createContext=function(f){return f={$$typeof:R,_currentValue:f,_currentValue2:f,_threadCount:0,Provider:null,Consumer:null},f.Provider=f,f.Consumer={$$typeof:P,_context:f},f},Me.createElement=function(f,T,G){var Y,_e={},ve=null;if(T!=null)for(Y in T.key!==void 0&&(ve=""+T.key),T)fe.call(T,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=T[Y]);var ze=arguments.length-2;if(ze===1)_e.children=G;else if(1<ze){for(var Le=Array(ze),Ne=0;Ne<ze;Ne++)Le[Ne]=arguments[Ne+2];_e.children=Le}if(f&&f.defaultProps)for(Y in ze=f.defaultProps,ze)_e[Y]===void 0&&(_e[Y]=ze[Y]);return le(f,ve,_e)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(f){return{$$typeof:K,render:f}},Me.isValidElement=Oe,Me.lazy=function(f){return{$$typeof:U,_payload:{_status:-1,_result:f},_init:se}},Me.memo=function(f,T){return{$$typeof:b,type:f,compare:T===void 0?null:T}},Me.startTransition=function(f){var T=$.T,G={};$.T=G;try{var Y=f(),_e=$.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ve){ke(ve)}finally{T!==null&&G.types!==null&&(T.types=G.types),$.T=T}},Me.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Me.use=function(f){return $.H.use(f)},Me.useActionState=function(f,T,G){return $.H.useActionState(f,T,G)},Me.useCallback=function(f,T){return $.H.useCallback(f,T)},Me.useContext=function(f){return $.H.useContext(f)},Me.useDebugValue=function(){},Me.useDeferredValue=function(f,T){return $.H.useDeferredValue(f,T)},Me.useEffect=function(f,T){return $.H.useEffect(f,T)},Me.useEffectEvent=function(f){return $.H.useEffectEvent(f)},Me.useId=function(){return $.H.useId()},Me.useImperativeHandle=function(f,T,G){return $.H.useImperativeHandle(f,T,G)},Me.useInsertionEffect=function(f,T){return $.H.useInsertionEffect(f,T)},Me.useLayoutEffect=function(f,T){return $.H.useLayoutEffect(f,T)},Me.useMemo=function(f,T){return $.H.useMemo(f,T)},Me.useOptimistic=function(f,T){return $.H.useOptimistic(f,T)},Me.useReducer=function(f,T,G){return $.H.useReducer(f,T,G)},Me.useRef=function(f){return $.H.useRef(f)},Me.useState=function(f){return $.H.useState(f)},Me.useSyncExternalStore=function(f,T,G){return $.H.useSyncExternalStore(f,T,G)},Me.useTransition=function(){return $.H.useTransition()},Me.version="19.2.1",Me}var yd;function el(){return yd||(yd=1,gd.exports=Nf()),gd.exports}var x=el();const vd=Io(x);var tl={exports:{}},Oa={},xd={exports:{}},wd={};/**
|
|
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
|
|
17
|
+
*/var kd;function Rf(){return kd||(kd=1,(function(i){function l(C,V){var se=C.length;C.push(V);e:for(;0<se;){var ke=se-1>>>1,Ce=C[ke];if(0<v(Ce,V))C[ke]=V,C[se]=Ce,se=ke;else break e}}function d(C){return C.length===0?null:C[0]}function c(C){if(C.length===0)return null;var V=C[0],se=C.pop();if(se!==V){C[0]=se;e:for(var ke=0,Ce=C.length,f=Ce>>>1;ke<f;){var T=2*(ke+1)-1,G=C[T],Y=T+1,_e=C[Y];if(0>v(G,se))Y<Ce&&0>v(_e,G)?(C[ke]=_e,C[Y]=se,ke=Y):(C[ke]=G,C[T]=se,ke=T);else if(Y<Ce&&0>v(_e,se))C[ke]=_e,C[Y]=se,ke=Y;else break e}}return V}function v(C,V){var se=C.sortIndex-V.sortIndex;return se!==0?se:C.id-V.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var P=performance;i.unstable_now=function(){return P.now()}}else{var R=Date,K=R.now();i.unstable_now=function(){return R.now()-K}}var _=[],b=[],U=1,E=null,W=3,I=!1,M=!1,B=!1,H=!1,ee=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function ne(C){for(var V=d(b);V!==null;){if(V.callback===null)c(b);else if(V.startTime<=C)c(b),V.sortIndex=V.expirationTime,l(_,V);else break;V=d(b)}}function ie(C){if(B=!1,ne(C),!M)if(d(_)!==null)M=!0,Q||(Q=!0,oe());else{var V=d(b);V!==null&&Te(ie,V.startTime-C)}}var Q=!1,$=-1,fe=5,le=-1;function be(){return H?!0:!(i.unstable_now()-le<fe)}function Oe(){if(H=!1,Q){var C=i.unstable_now();le=C;var V=!0;try{e:{M=!1,B&&(B=!1,te($),$=-1),I=!0;var se=W;try{t:{for(ne(C),E=d(_);E!==null&&!(E.expirationTime>C&&be());){var ke=E.callback;if(typeof ke=="function"){E.callback=null,W=E.priorityLevel;var Ce=ke(E.expirationTime<=C);if(C=i.unstable_now(),typeof Ce=="function"){E.callback=Ce,ne(C),V=!0;break t}E===d(_)&&c(_),ne(C)}else c(_);E=d(_)}if(E!==null)V=!0;else{var f=d(b);f!==null&&Te(ie,f.startTime-C),V=!1}}break e}finally{E=null,W=se,I=!1}V=void 0}}finally{V?oe():Q=!1}}}var oe;if(typeof re=="function")oe=function(){re(Oe)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ye=ue.port2;ue.port1.onmessage=Oe,oe=function(){ye.postMessage(null)}}else oe=function(){ee(Oe,0)};function Te(C,V){$=ee(function(){C(i.unstable_now())},V)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(C){C.callback=null},i.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"):fe=0<C?Math.floor(1e3/C):5},i.unstable_getCurrentPriorityLevel=function(){return W},i.unstable_next=function(C){switch(W){case 1:case 2:case 3:var V=3;break;default:V=W}var se=W;W=V;try{return C()}finally{W=se}},i.unstable_requestPaint=function(){H=!0},i.unstable_runWithPriority=function(C,V){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var se=W;W=C;try{return V()}finally{W=se}},i.unstable_scheduleCallback=function(C,V,se){var ke=i.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ke+se:ke):se=ke,C){case 1:var Ce=-1;break;case 2:Ce=250;break;case 5:Ce=1073741823;break;case 4:Ce=1e4;break;default:Ce=5e3}return Ce=se+Ce,C={id:U++,callback:V,priorityLevel:C,startTime:se,expirationTime:Ce,sortIndex:-1},se>ke?(C.sortIndex=se,l(b,C),d(_)===null&&C===d(b)&&(B?(te($),$=-1):B=!0,Te(ie,se-ke))):(C.sortIndex=Ce,l(_,C),M||I||(M=!0,Q||(Q=!0,oe()))),C},i.unstable_shouldYield=be,i.unstable_wrapCallback=function(C){var V=W;return function(){var se=W;W=V;try{return C.apply(this,arguments)}finally{W=se}}}})(wd)),wd}var _d;function Df(){return _d||(_d=1,xd.exports=Rf()),xd.exports}var nl={exports:{}},ln={};/**
|
|
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
|
|
25
|
+
*/var Sd;function Lf(){if(Sd)return ln;Sd=1;var i=el();function l(_){var b="https://react.dev/errors/"+_;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var U=2;U<arguments.length;U++)b+="&args[]="+encodeURIComponent(arguments[U])}return"Minified React error #"+_+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var c={d:{f:d,r:function(){throw Error(l(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},v=Symbol.for("react.portal");function P(_,b,U){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,key:E==null?null:""+E,children:_,containerInfo:b,implementation:U}}var R=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function K(_,b){if(_==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ln.createPortal=function(_,b){var U=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(l(299));return P(_,b,null,U)},ln.flushSync=function(_){var b=R.T,U=c.p;try{if(R.T=null,c.p=2,_)return _()}finally{R.T=b,c.p=U,c.d.f()}},ln.preconnect=function(_,b){typeof _=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(_,b))},ln.prefetchDNS=function(_){typeof _=="string"&&c.d.D(_)},ln.preinit=function(_,b){if(typeof _=="string"&&b&&typeof b.as=="string"){var U=b.as,E=K(U,b.crossOrigin),W=typeof b.integrity=="string"?b.integrity:void 0,I=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;U==="style"?c.d.S(_,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:E,integrity:W,fetchPriority:I}):U==="script"&&c.d.X(_,{crossOrigin:E,integrity:W,fetchPriority:I,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},ln.preinitModule=function(_,b){if(typeof _=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var U=K(b.as,b.crossOrigin);c.d.M(_,{crossOrigin:U,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(_)},ln.preload=function(_,b){if(typeof _=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var U=b.as,E=K(U,b.crossOrigin);c.d.L(_,U,{crossOrigin:E,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},ln.preloadModule=function(_,b){if(typeof _=="string")if(b){var U=K(b.as,b.crossOrigin);c.d.m(_,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:U,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(_)},ln.requestFormReset=function(_){c.d.r(_)},ln.unstable_batchedUpdates=function(_,b){return _(b)},ln.useFormState=function(_,b,U){return R.H.useFormState(_,b,U)},ln.useFormStatus=function(){return R.H.useHostTransitionStatus()},ln.version="19.2.1",ln}var Ed;function Cd(){if(Ed)return nl.exports;Ed=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(l){console.error(l)}}return i(),nl.exports=Lf(),nl.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
|
|
33
|
+
*/var zd;function Ff(){if(zd)return Oa;zd=1;var i=Df(),l=el(),d=Cd();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 v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function P(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 R(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 K(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 _(e){if(P(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=P(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 _(o),e;if(a===r)return _(o),t;a=a.sibling}throw Error(c(188))}if(n.return!==r.return)n=o,r=a;else{for(var s=!1,u=o.child;u;){if(u===n){s=!0,n=o,r=a;break}if(u===r){s=!0,r=o,n=a;break}u=u.sibling}if(!s){for(u=a.child;u;){if(u===n){s=!0,n=a,r=o;break}if(u===r){s=!0,r=a,n=o;break}u=u.sibling}if(!s)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 U(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=U(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,W=Symbol.for("react.element"),I=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Oe=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=Oe&&e[Oe]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case ee:return"Profiler";case H:return"StrictMode";case ie:return"Suspense";case Q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case re:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var Te=Array.isArray,C=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ke=[],Ce=-1;function f(e){return{current:e}}function T(e){0>Ce||(e.current=ke[Ce],ke[Ce]=null,Ce--)}function G(e,t){Ce++,ke[Ce]=e.current,e.current=t}var Y=f(null),_e=f(null),ve=f(null),ze=f(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)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}T(Y),G(Y,e)}function Ne(){T(Y),T(_e),T(ve)}function Re(e){e.memoizedState!==null&&G(ze,e);var t=Y.current,n=rf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function Ue(e){_e.current===e&&(T(Y),T(_e)),ze.current===e&&(T(ze),Ri._currentValue=se)}var Ut,ae;function ce(e){if(Ut===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ut=t&&t[1]||"",ae=-1<n.stack.indexOf(`
|
|
34
34
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
35
|
-
`+
|
|
35
|
+
`+Ut+e+ae}var he=!1;function Ie(e,t){if(!e||he)return"";he=!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(z){var S=z}Reflect.construct(e,[],O)}else{try{O.call()}catch(z){S=z}e.call(O.prototype)}}else{try{throw Error()}catch(z){S=z}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(z){if(z&&S&&typeof z.stack=="string")return[z.stack,S.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(),s=a[0],u=a[1];if(s&&u){var h=s.split(`
|
|
36
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
|
|
38
|
-
`+h[r].replace(" at new "," at ");return e.displayName&&
|
|
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 N=`
|
|
38
|
+
`+h[r].replace(" at new "," at ");return e.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",e.displayName)),N}while(1<=r&&0<=o);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ce(n):""}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return ce(e.type);case 16:return ce("Lazy");case 13:return e.child!==t&&t!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return ce("Activity");default:return""}}function Z(e){try{var t="",n=null;do t+=Ae(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,X=s.unstable_scheduleCallback,Ve=s.unstable_cancelCallback,Ge=s.unstable_shouldYield,K=s.unstable_requestPaint,Je=s.unstable_now,Fe=s.unstable_getCurrentPriorityLevel,un=s.unstable_ImmediatePriority,it=s.unstable_UserBlockingPriority,Kt=s.unstable_NormalPriority,Mn=s.unstable_LowPriority,Mo=s.unstable_IdlePriority,yn=s.log,Vr=s.unstable_setDisableYieldValue,Xt=null,Rt=null;function ot(e){if(typeof yn=="function"&&Vr(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Xt,e)}catch{}}var mt=Math.clz32?Math.clz32:Ur,qe=Math.log,dn=Math.LN2;function Ur(e){return e>>>=0,e===0?32:31-(qe(e)/dn|0)|0}var pn=256,me=262144,mn=4194304;function vn(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 ve(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=vn(r):(i&=u,i!==0?o=vn(i):n||(n=u&~e,n!==0&&(o=vn(n))))):(u=r&~a,u!==0?o=vn(u):i!==0?o=vn(i):n||(n=r&~e,n!==0&&(o=vn(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 Jt(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 Io(){var e=mn;return mn<<=1,(mn&62914560)===0&&(mn=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function jo(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-mt(n),$=1<<j;u[j]=0,h[j]=-1;var S=k[j];if(S!==null)for(k[j]=null,j=0;j<S.length;j++){var z=S[j];z!==null&&(z.lane&=-536870913)}n&=~$}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-mt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $i(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function No(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 fn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ra(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Ef(e.type))}function qr(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var In=Math.random().toString(36).slice(2),Ct="__reactFiber$"+In,Ht="__reactProps$"+In,pr="__reactContainer$"+In,oa="__reactEvents$"+In,Oi="__reactListeners$"+In,aa="__reactHandles$"+In,ia="__reactResources$"+In,kr="__reactMarker$"+In;function qa(e){delete e[Ct],delete e[Ht],delete e[oa],delete e[Oi],delete e[aa]}function mr(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pr]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Ct])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Kr(e){if(e=e[Ct]||e[pr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Mt(e){var t=e[ia];return t||(t=e[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[kr]=!0}var Yt=new Set,sa={};function fr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(sa[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]*$"),Ro={},Wi={};function Ka(e){return Oe.call(Wi,e)?!0:Oe.call(Ro,e)?!1:Xr.test(e)?Wi[e]=!0:(Ro[e]=!0,!1)}function xn(e,t,n){if(Ka(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 hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wn(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=Xa(e)?"checked":"value";e._valueTracker=wn(e,t,""+e[t])}}function bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xa(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 Ga=/[\n"\\]/g;function en(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function la(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=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ua(e,i,hn(t)):n!=null?ua(e,i,hn(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=""+hn(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)){Sr(e);return}n=n!=null?""+hn(n):"",t=t!=null?""+hn(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),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=""+hn(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 Hi(e,t,n){if(t!=null&&(t=""+hn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+hn(n):""}function Za(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Pe(r)){if(1<r.length)throw Error(c(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=hn(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 Do(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 Zr(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 Bt=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"]]),Jr=/^[\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 br(e){return Jr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var da=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[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(la(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[Ht]||null;if(!o)throw Error(c(90));la(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&&bt(r)}break e;case"textarea":Hi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}}}var ca=!1;function pa(e,t,n){if(ca)return e(t,n);ca=!0;try{var r=e(t);return r}finally{if(ca=!1,(Er!==null||Yr!==null)&&(Ps(),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[Ht]||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 On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wt=!1;if(On)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 It=null,Ja=null,tn=null;function Tt(){if(tn)return tn;var e,t=Ja,n=t.length,r,o="value"in It?It.value:It.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 Wn(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 Bi(){return!1}function yt(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)?To:Bi,this.isPropagationStopped=Bi,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=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 Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lo=yt(Hn),to=C({},Hn,{view:0,detail:0}),no=yt(to),Fo,$o,jn,Oo=C({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:p,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!==jn&&(jn&&e.type==="mousemove"?(Fo=e.screenX-jn.screenX,$o=e.screenY-jn.screenY):$o=Fo=0,jn=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:$o}}),Ya=yt(Oo),ei=C({},Oo,{dataTransfer:0}),ml=yt(ei),fl=C({},to,{relatedTarget:0}),ma=yt(fl),hl=C({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0}),gl=yt(hl),Vi=C({},Hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ui=yt(Vi),ti=C({},Hn,{data:0}),Qi=yt(ti),bl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yl={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"},vl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xl(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vl[e])?!!t[e]:!1}function p(){return xl}var N=C({},to,{key:function(e){if(e.key){var t=bl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:p,charCode:function(e){return e.type==="keypress"?Wn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),R=yt(N),L=C({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z=yt(L),pe=C({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:p}),Ye=yt(pe),zt=C({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lt=yt(zt),Te=C({},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}),We=yt(Te),kt=C({},Hn,{newState:0,oldState:0}),Gt=yt(kt),Vt=[9,13,27,32],Ut=On&&"CompositionEvent"in window,_n=null;On&&"documentMode"in document&&(_n=document.documentMode);var Bn=On&&"TextEvent"in window&&!_n,Ce=On&&(!Ut||_n&&8<_n&&11>=_n),He=" ",ht=!1;function st(e,t){switch(e){case"keyup":return Vt.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,He);case"textInput":return e=t.data,e===He&&ht?null:e;default:return null}}function gt(e,t){if(St)return e==="compositionend"||!Ut&&st(e,t)?(e=Tt(),tn=Ja=It=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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qi[e.type]:t==="textarea"}function mc(e,t,n,r){Er?Yr?Yr.push(r):Yr=[r]:Er=r,t=Ts(t,"onChange"),0<t.length&&(n=new Lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ni=null,ri=null;function wg(e){Xm(e,0)}function Ki(e){var t=cn(e);if(bt(t))return e}function fc(e,t){if(e==="change")return t}var hc=!1;if(On){var wl;if(On){var kl="oninput"in document;if(!kl){var gc=document.createElement("div");gc.setAttribute("oninput","return;"),kl=typeof gc.oninput=="function"}wl=kl}else wl=!1;hc=wl&&(!document.documentMode||9<document.documentMode)}function bc(){ni&&(ni.detachEvent("onpropertychange",yc),ri=ni=null)}function yc(e){if(e.propertyName==="value"&&Ki(ri)){var t=[];mc(t,ri,e,et(e)),pa(wg,t)}}function kg(e,t,n){e==="focusin"?(bc(),ni=t,ri=n,ni.attachEvent("onpropertychange",yc)):e==="focusout"&&bc()}function _g(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ki(ri)}function Sg(e,t){if(e==="click")return Ki(t)}function Cg(e,t){if(e==="input"||e==="change")return Ki(t)}function Eg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:Eg;function oi(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 vc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xc(e,t){var n=vc(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=vc(n)}}function wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kc(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 _l(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 zg=On&&"documentMode"in document&&11>=document.documentMode,fa=null,Sl=null,ai=null,Cl=!1;function _c(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cl||fa==null||fa!==hr(r)||(r=fa,"selectionStart"in r&&_l(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}),ai&&oi(ai,r)||(ai=r,r=Ts(Sl,"onSelect"),0<r.length&&(t=new Lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fa)))}function Wo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Wo("Animation","AnimationEnd"),animationiteration:Wo("Animation","AnimationIteration"),animationstart:Wo("Animation","AnimationStart"),transitionrun:Wo("Transition","TransitionRun"),transitionstart:Wo("Transition","TransitionStart"),transitioncancel:Wo("Transition","TransitionCancel"),transitionend:Wo("Transition","TransitionEnd")},El={},Sc={};On&&(Sc=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 Ho(e){if(El[e])return El[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sc)return El[e]=t[n];return e}var Cc=Ho("animationend"),Ec=Ho("animationiteration"),zc=Ho("animationstart"),Ag=Ho("transitionrun"),Pg=Ho("transitionstart"),Mg=Ho("transitioncancel"),Ac=Ho("transitionend"),Pc=new Map,zl="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(" ");zl.push("scrollEnd");function ir(e,t){Pc.set(e,t),fr(t,[e])}var Xi=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,Al=0;function Gi(){for(var e=ga,t=Al=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&&Mc(n,o,a)}}function Zi(e,t,n,r){Vn[ga++]=e,Vn[ga++]=t,Vn[ga++]=n,Vn[ga++]=r,Al|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pl(e,t,n,r){return Zi(e,t,n,r),Ji(e)}function Bo(e,t){return Zi(e,null,null,t),Ji(e)}function Mc(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-mt(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<zi)throw zi=0,Fu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ba={};function Ig(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 Rn(e,t,n,r){return new Ig(e,t,n,r)}function Ml(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zr(e,t){var n=e.alternate;return n===null?(n=Rn(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 Ic(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 Yi(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")Ml(e)&&(i=1);else if(typeof e=="string")i=T0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Rn(31,n,t,o),e.elementType=le,e.lanes=a,e;case H:return Vo(n.children,o,a,t);case U:i=8,o|=24;break;case ee:return e=Rn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ie:return e=Rn(13,n,t,o),e.elementType=ie,e.lanes=a,e;case Q:return e=Rn(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 te:i=9;break e;case ne:i=11;break e;case O:i=14;break e;case fe:i=16,r=null;break e}i=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Rn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Vo(e,t,n,r){return e=Rn(7,e,r,t),e.lanes=n,e}function Il(e,t,n){return e=Rn(6,e,null,t),e.lanes=n,e}function jc(e){var t=Rn(18,null,null,0);return t.stateNode=e,t}function jl(e,t,n){return t=Rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nc=new WeakMap;function Un(e,t){if(typeof e=="object"&&e!==null){var n=Nc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:J(t)},Nc.set(e,t),t)}return{value:e,source:t,stack:J(t)}}var ya=[],va=0,es=null,ii=0,Qn=[],qn=0,ro=null,yr=1,vr="";function Ar(e,t){ya[va++]=ii,ya[va++]=es,es=e,ii=t}function Rc(e,t,n){Qn[qn++]=yr,Qn[qn++]=vr,Qn[qn++]=ro,ro=e;var r=yr;e=vr;var o=32-mt(r)-1;r&=~(1<<o),n+=1;var a=32-mt(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,yr=1<<32-mt(t)+o|n<<o|r,vr=a+e}else yr=1<<a|n<<o|r,vr=e}function Nl(e){e.return!==null&&(Ar(e,1),Rc(e,1,0))}function Rl(e){for(;e===es;)es=ya[--va],ya[va]=null,ii=ya[--va],ya[va]=null;for(;e===ro;)ro=Qn[--qn],Qn[qn]=null,vr=Qn[--qn],Qn[qn]=null,yr=Qn[--qn],Qn[qn]=null}function Dc(e,t){Qn[qn++]=yr,Qn[qn++]=vr,Qn[qn++]=ro,yr=t.id,vr=t.overflow,ro=e}var rn=null,vt=null,Ze=!1,oo=null,Kn=!1,Dl=Error(c(519));function ao(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw si(Un(t,e)),Dl}function Tc(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[Ht]=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<Pi.length;n++)Qe(Pi[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),Za(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||Ym(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 Lc(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:rn=rn.return}}function xa(e){if(e!==rn)return!1;if(!Ze)return Lc(e),Ze=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yu(e.type,e.memoizedProps)),n=!n),n&&vt&&ao(e),Lc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else t===27?(t=vt,xo(e.type)?(e=od,od=null,vt=e):vt=t):vt=rn?Xn(e.stateNode.nextSibling):null;return!0}function Uo(){vt=rn=null,Ze=!1}function Tl(){var e=oo;return e!==null&&(An===null?An=e:An.push.apply(An,e),oo=null),e}function si(e){oo===null?oo=[e]:oo.push(e)}var Ll=f(null),Qo=null,Pr=null;function io(e,t,n){G(Ll,t._currentValue),t._currentValue=n}function Mr(e){e._currentValue=Ll.current,P(Ll)}function Fl(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 $l(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),Fl(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),Fl(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(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(Ri):e=[Ri])}o=o.return}e!==null&&$l(t,e,n,r),t.flags|=262144}function ts(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qo(e){Qo=e,Pr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Fc(Qo,e)}function ns(e,t){return Qo===null&&qo(e),Fc(e,t)}function Fc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pr===null){if(e===null)throw Error(c(308));Pr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pr=Pr.next=t;return n}var jg=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()})}},Ng=s.unstable_scheduleCallback,Rg=s.unstable_NormalPriority,Ft={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ol(){return{controller:new jg,data:new Map,refCount:0}}function li(e){e.refCount--,e.refCount===0&&Ng(Rg,function(){e.controller.abort()})}var ui=null,Wl=0,ka=0,_a=null;function Dg(e,t){if(ui===null){var n=ui=[];Wl=0,ka=Vu(),_a={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Wl++,t.then($c,$c),t}function $c(){if(--Wl===0&&ui!==null){_a!==null&&(_a.status="fulfilled");var e=ui;ui=null,ka=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tg(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 Oc=E.S;E.S=function(e,t){_m=Je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dg(e,t),Oc!==null&&Oc(e,t)};var Ko=f(null);function Hl(){var e=Ko.current;return e!==null?e:ft.pooledCache}function rs(e,t){t===null?G(Ko,Ko.current):G(Ko,t.pool)}function Wc(){var e=Hl();return e===null?null:{parent:Ft._currentValue,pool:e}}var Sa=Error(c(460)),Bl=Error(c(474)),os=Error(c(542)),as={then:function(){}};function Hc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bc(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,Uc(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=ft,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,Uc(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 Vc(){if(Go===null)throw Error(c(459));var e=Go;return Go=null,e}function Uc(e){if(e===Sa||e===os)throw Error(c(483))}var Ca=null,di=0;function is(e){var t=di;return di+=1,Ca===null&&(Ca=[]),Bc(Ca,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ss(e,t){throw t.$$typeof===W?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(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=zr(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,T){return g===null||g.tag!==6?(g=Il(w,b.mode,T),g.return=b,g):(g=o(g,w),g.return=b,g)}function h(b,g,w,T){var we=w.type;return we===H?j(b,g,w.props.children,T,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type)?(g=o(g,w.props),ci(g,w),g.return=b,g):(g=Yi(w.type,w.key,w.props,null,b.mode,T),ci(g,w),g.return=b,g)}function k(b,g,w,T){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=jl(w,b.mode,T),g.return=b,g):(g=o(g,w.children||[]),g.return=b,g)}function j(b,g,w,T,we){return g===null||g.tag!==7?(g=Vo(w,b.mode,T,we),g.return=b,g):(g=o(g,w),g.return=b,g)}function $(b,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Il(""+g,b.mode,w),g.return=b,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case M:return w=Yi(g.type,g.key,g.props,null,b.mode,w),ci(w,g),w.return=b,w;case A:return g=jl(g,b.mode,w),g.return=b,g;case fe:return g=Xo(g),$(b,g,w)}if(Pe(g)||oe(g))return g=Vo(g,b.mode,w,null),g.return=b,g;if(typeof g.then=="function")return $(b,is(g),w);if(g.$$typeof===re)return $(b,ns(b,g),w);ss(b,g)}return null}function S(b,g,w,T){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,T);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case M:return w.key===we?h(b,g,w,T):null;case A:return w.key===we?k(b,g,w,T):null;case fe:return w=Xo(w),S(b,g,w,T)}if(Pe(w)||oe(w))return we!==null?null:j(b,g,w,T,null);if(typeof w.then=="function")return S(b,g,is(w),T);if(w.$$typeof===re)return S(b,g,ns(b,w),T);ss(b,w)}return null}function z(b,g,w,T,we){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return b=b.get(w)||null,u(g,b,""+T,we);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case M:return b=b.get(T.key===null?w:T.key)||null,h(g,b,T,we);case A:return b=b.get(T.key===null?w:T.key)||null,k(g,b,T,we);case fe:return T=Xo(T),z(b,g,w,T,we)}if(Pe(T)||oe(T))return b=b.get(w)||null,j(g,b,T,we,null);if(typeof T.then=="function")return z(b,g,w,is(T),we);if(T.$$typeof===re)return z(b,g,w,ns(g,T),we);ss(g,T)}return null}function de(b,g,w,T){for(var we=null,nt=null,he=g,Ne=g=0,Xe=null;he!==null&&Ne<w.length;Ne++){he.index>Ne?(Xe=he,he=null):Xe=he.sibling;var rt=S(b,he,w[Ne],T);if(rt===null){he===null&&(he=Xe);break}e&&he&&rt.alternate===null&&t(b,he),g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt,he=Xe}if(Ne===w.length)return n(b,he),Ze&&Ar(b,Ne),we;if(he===null){for(;Ne<w.length;Ne++)he=$(b,w[Ne],T),he!==null&&(g=a(he,g,Ne),nt===null?we=he:nt.sibling=he,nt=he);return Ze&&Ar(b,Ne),we}for(he=r(he);Ne<w.length;Ne++)Xe=z(he,b,Ne,w[Ne],T),Xe!==null&&(e&&Xe.alternate!==null&&he.delete(Xe.key===null?Ne:Xe.key),g=a(Xe,g,Ne),nt===null?we=Xe:nt.sibling=Xe,nt=Xe);return e&&he.forEach(function(Co){return t(b,Co)}),Ze&&Ar(b,Ne),we}function Se(b,g,w,T){if(w==null)throw Error(c(151));for(var we=null,nt=null,he=g,Ne=g=0,Xe=null,rt=w.next();he!==null&&!rt.done;Ne++,rt=w.next()){he.index>Ne?(Xe=he,he=null):Xe=he.sibling;var Co=S(b,he,rt.value,T);if(Co===null){he===null&&(he=Xe);break}e&&he&&Co.alternate===null&&t(b,he),g=a(Co,g,Ne),nt===null?we=Co:nt.sibling=Co,nt=Co,he=Xe}if(rt.done)return n(b,he),Ze&&Ar(b,Ne),we;if(he===null){for(;!rt.done;Ne++,rt=w.next())rt=$(b,rt.value,T),rt!==null&&(g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt);return Ze&&Ar(b,Ne),we}for(he=r(he);!rt.done;Ne++,rt=w.next())rt=z(he,b,Ne,rt.value,T),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(q0){return t(b,q0)}),Ze&&Ar(b,Ne),we}function pt(b,g,w,T){if(typeof w=="object"&&w!==null&&w.type===H&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case M:e:{for(var we=w.key;g!==null;){if(g.key===we){if(we=w.type,we===H){if(g.tag===7){n(b,g.sibling),T=o(g,w.props.children),T.return=b,b=T;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type){n(b,g.sibling),T=o(g,w.props),ci(T,w),T.return=b,b=T;break e}n(b,g);break}else t(b,g);g=g.sibling}w.type===H?(T=Vo(w.props.children,b.mode,T,w.key),T.return=b,b=T):(T=Yi(w.type,w.key,w.props,null,b.mode,T),ci(T,w),T.return=b,b=T)}return i(b);case A: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),T=o(g,w.children||[]),T.return=b,b=T;break e}else{n(b,g);break}else t(b,g);g=g.sibling}T=jl(w,b.mode,T),T.return=b,b=T}return i(b);case fe:return w=Xo(w),pt(b,g,w,T)}if(Pe(w))return de(b,g,w,T);if(oe(w)){if(we=oe(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Se(b,g,w,T)}if(typeof w.then=="function")return pt(b,g,is(w),T);if(w.$$typeof===re)return pt(b,g,ns(b,w),T);ss(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,g!==null&&g.tag===6?(n(b,g.sibling),T=o(g,w),T.return=b,b=T):(n(b,g),T=Il(w,b.mode,T),T.return=b,b=T),i(b)):n(b,g)}return function(b,g,w,T){try{di=0;var we=pt(b,g,w,T);return Ca=null,we}catch(he){if(he===Sa||he===os)throw he;var nt=Rn(29,he,null,b.mode);return nt.lanes=T,nt.return=b,nt}finally{}}}var Zo=Qc(!0),qc=Qc(!1),so=!1;function Vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ul(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 lo(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),Mc(e,null,n),t}return Zi(e,r,t,n),Ji(e)}function pi(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,$i(e,n)}}function Ql(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 ql=!1;function mi(){if(ql){var e=_a;if(e!==null)throw e}}function fi(e,t,n,r){ql=!1;var o=e.updateQueue;so=!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.baseState;i=0,j=k=h=null,u=a;do{var S=u.lane&-536870913,z=S!==u.lane;if(z?(Ke&S)===S:(r&S)===S){S!==0&&S===ka&&(ql=!0),j!==null&&(j=j.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var de=e,Se=u;S=t;var pt=n;switch(Se.tag){case 1:if(de=Se.payload,typeof de=="function"){$=de.call(pt,$,S);break e}$=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Se.payload,S=typeof de=="function"?de.call(pt,$,S):de,S==null)break e;$=C({},$,S);break e;case 2:so=!0}}S=u.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=o.callbacks,z===null?o.callbacks=[S]:z.push(S))}else z={lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},j===null?(k=j=z,h=$):j=j.next=z,i|=S;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;z=u,u=z.next,z.next=null,o.lastBaseUpdate=z,o.shared.pending=null}}while(!0);j===null&&(h=$),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=j,a===null&&(o.shared.lanes=0),ho|=i,e.lanes=i,e.memoizedState=$}}function Kc(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Xc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Kc(n[e],t)}var Ea=f(null),ls=f(0);function Gc(e,t){e=$r,G(ls,e),G(Ea,t),$r=e|t.baseLanes}function Kl(){G(ls,$r),G(Ea,Ea.current)}function Xl(){$r=ls.current,P(Ea),P(ls)}var Dn=f(null),sr=null;function co(e){var t=e.alternate;G(jt,jt.current&1),G(Dn,e),sr===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(sr=e)}function Gl(e){G(jt,jt.current),G(Dn,e),sr===null&&(sr=e)}function Zc(e){e.tag===22?(G(jt,jt.current),G(Dn,e),sr===null&&(sr=e)):po()}function po(){G(jt,jt.current),G(Dn,Dn.current)}function Tn(e){P(Dn),sr===e&&(sr=null),P(jt)}var jt=f(0);function us(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nd(n)||rd(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 Ir=0,Me=null,dt=null,$t=null,ds=!1,za=!1,Jo=!1,cs=0,hi=0,Aa=null,Lg=0;function At(){throw Error(c(321))}function Zl(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 Jl(e,t,n,r,o,a){return Ir=a,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Rp:mu,Jo=!1,a=n(r,o),Jo=!1,za&&(a=Yc(t,n,r,o)),Jc(e),a}function Jc(e){E.H=yi;var t=dt!==null&&dt.next!==null;if(Ir=0,$t=dt=Me=null,ds=!1,hi=0,Aa=null,t)throw Error(c(300));e===null||Ot||(e=e.dependencies,e!==null&&ts(e)&&(Ot=!0))}function Yc(e,t,n,r){Me=e;var o=0;do{if(za&&(Aa=null),hi=0,za=!1,25<=o)throw Error(c(301));if(o+=1,$t=dt=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=Dp,a=t(n,r)}while(za);return a}function Fg(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?gi(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Me.flags|=1024),t}function Yl(){var e=cs!==0;return cs=0,e}function eu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function tu(e){if(ds){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ds=!1}Ir=0,$t=dt=Me=null,za=!1,hi=cs=0,Aa=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Me.memoizedState=$t=e:$t=$t.next=e,$t}function Nt(){if(dt===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=$t===null?Me.memoizedState:$t.next;if(t!==null)$t=t,dt=e;else{if(e===null)throw Me.alternate===null?Error(c(467)):Error(c(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},$t===null?Me.memoizedState=$t=e:$t=$t.next=e}return $t}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gi(e){var t=hi;return hi+=1,Aa===null&&(Aa=[]),e=Bc(Aa,e,t),t=Me,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Rp:mu),e}function ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return gi(e);if(e.$$typeof===re)return on(e)}throw Error(c(438,String(e)))}function nu(e){var t=null,n=Me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Me.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=ps(),Me.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]=ge;return t.index++,n}function jr(e,t){return typeof t=="function"?t(e):t}function fs(e){var t=Nt();return ru(t,dt,e)}function ru(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 $=k.lane&-536870913;if($!==k.lane?(Ke&$)===$:(Ir&$)===$){var S=k.revertLane;if(S===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),$===ka&&(j=!0);else if((Ir&S)===S){k=k.next,S===ka&&(j=!0);continue}else $={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=$,i=a):h=h.next=$,Me.lanes|=S,ho|=S;$=k.action,Jo&&n(a,$),a=k.hasEagerState?k.eagerState:n(a,$)}else S={lane:$,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=S,i=a):h=h.next=S,Me.lanes|=$,ho|=$;k=k.next}while(k!==null&&k!==t);if(h===null?i=a:h.next=u,!Nn(a,e.memoizedState)&&(Ot=!0,j&&(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 ou(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)||(Ot=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ep(e,t,n){var r=Me,o=Nt(),a=Ze;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var i=!Nn((dt||o).memoizedState,n);if(i&&(o.memoizedState=n,Ot=!0),o=o.queue,su(rp.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},np.bind(null,r,o,n,t),null),ft===null)throw Error(c(349));a||(Ir&127)!==0||tp(r,t,n)}return n}function tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Me.updateQueue,t===null?(t=ps(),Me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function np(e,t,n,r){t.value=n,t.getSnapshot=r,op(t)&&ap(e)}function rp(e,t,n){return n(function(){op(t)&&ap(e)})}function op(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nn(e,n)}catch{return!0}}function ap(e){var t=Bo(e,2);t!==null&&Pn(t,e,2)}function au(e){var t=gn();if(typeof e=="function"){var n=e;if(e=n(),Jo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:e},t}function ip(e,t,n,r){return e.baseState=n,ru(e,dt,typeof r=="function"?r:jr)}function $g(e,t,n,r,o){if(bs(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,sp(t,a)):(a.next=n.next,t.pending=n.next=a)}}function sp(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),lp(e,t,u)}catch(k){iu(e,t,k)}finally{a!==null&&i.types!==null&&(a.types=i.types),E.T=a}}else try{a=n(o,r),lp(e,t,a)}catch(k){iu(e,t,k)}}function lp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){up(e,t,r)},function(r){return iu(e,t,r)}):up(e,t,n)}function up(e,t,n){t.status="fulfilled",t.value=n,dp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sp(e,n)))}function iu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,dp(t),t=t.next;while(t!==r)}e.action=null}function dp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cp(e,t){return t}function pp(e,t){if(Ze){var n=ft.formState;if(n!==null){e:{var r=Me;if(Ze){if(vt){t:{for(var o=vt,a=Kn;o.nodeType!==8;){if(!a){o=null;break t}if(o=Xn(o.nextSibling),o===null){o=null;break t}}a=o.data,o=a==="F!"||a==="F"?o:null}if(o){vt=Xn(o.nextSibling),r=o.data==="F!";break e}}ao(r)}r=!1}r&&(t=n[0])}}return n=gn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cp,lastRenderedState:t},n.queue=r,n=Ip.bind(null,Me,r),r.dispatch=n,r=au(!1),a=pu.bind(null,Me,!1,r.queue),r=gn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=$g.bind(null,Me,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function mp(e){var t=Nt();return fp(t,dt,e)}function fp(e,t,n){if(t=ru(e,t,cp)[0],e=fs(jr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=gi(t)}catch(i){throw i===Sa?os:i}else r=t;t=Nt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Me.flags|=2048,Pa(9,{destroy:void 0},Og.bind(null,o,n),null)),[r,a,e]}function Og(e,t){e.action=t}function hp(e){var t=Nt(),n=dt;if(n!==null)return fp(t,n,e);Nt(),t=t.memoizedState,n=Nt();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=Me.updateQueue,t===null&&(t=ps(),Me.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 gp(){return Nt().memoizedState}function hs(e,t,n,r){var o=gn();Me.flags|=e,o.memoizedState=Pa(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var o=Nt();r=r===void 0?null:r;var a=o.memoizedState.inst;dt!==null&&r!==null&&Zl(r,dt.memoizedState.deps)?o.memoizedState=Pa(t,a,n,r):(Me.flags|=e,o.memoizedState=Pa(1|t,a,n,r))}function bp(e,t){hs(8390656,8,e,t)}function su(e,t){gs(2048,8,e,t)}function Wg(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=ps(),Me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yp(e){var t=Nt().memoizedState;return Wg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function vp(e,t){return gs(4,2,e,t)}function xp(e,t){return gs(4,4,e,t)}function wp(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 kp(e,t,n){n=n!=null?n.concat([e]):null,gs(4,4,wp.bind(null,t,e),n)}function lu(){}function _p(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Sp(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zl(t,r[1]))return r[0];if(r=e(),Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function uu(e,t,n){return n===void 0||(Ir&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Cm(),Me.lanes|=e,ho|=e,n)}function Cp(e,t,n,r){return Nn(n,t)?n:Ea.current!==null?(e=uu(e,n,r),Nn(e,t)||(Ot=!0),e):(Ir&42)===0||(Ir&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=n):(e=Cm(),Me.lanes|=e,ho|=e,t)}function Ep(e,t,n,r,o){var a=V.p;V.p=a!==0&&8>a?a:8;var i=E.T,u={};E.T=u,pu(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=Tg(h,r);bi(e,t,j,$n(e))}else bi(e,t,r,$n(e))}catch($){bi(e,t,{then:function(){},status:"rejected",reason:$},$n())}finally{V.p=a,i!==null&&u.types!==null&&(i.types=u.types),E.T=i}}function Hg(){}function du(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=zp(e).queue;Ep(e,o,t,se,n===null?Hg:function(){return Ap(e),n(r)})}function zp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ap(e){var t=zp(e);t.next===null&&(t=e.alternate.memoizedState),bi(e,t.next.queue,{},$n())}function cu(){return on(Ri)}function Pp(){return Nt().memoizedState}function Mp(){return Nt().memoizedState}function Bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$n();e=lo(n);var r=uo(t,e,n);r!==null&&(Pn(r,t,n),pi(r,t,n)),t={cache:Ol()},e.payload=t;return}t=t.return}}function Vg(e,t,n){var r=$n();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bs(e)?jp(t,n):(n=Pl(e,t,n,r),n!==null&&(Pn(n,e,r),Np(n,t,r)))}function Ip(e,t,n){var r=$n();bi(e,t,n,r)}function bi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bs(e))jp(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 Zi(e,t,o,0),ft===null&&Gi(),!1}catch{}finally{}if(n=Pl(e,t,o,r),n!==null)return Pn(n,e,r),Np(n,t,r),!0}return!1}function pu(e,t,n,r){if(r={lane:2,revertLane:Vu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(c(479))}else t=Pl(e,n,r,2),t!==null&&Pn(t,e,2)}function bs(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function jp(e,t){za=ds=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Np(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}var yi={readContext:on,use:ms,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};yi.useEffectEvent=At;var Rp={readContext:on,use:ms,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:bp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,hs(4194308,4,wp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=gn();t=t===void 0?null:t;var r=e();if(Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=gn();if(n!==void 0){var o=n(t);if(Jo){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=Vg.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:function(e){e=au(e);var t=e.queue,n=Ip.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lu,useDeferredValue:function(e,t){var n=gn();return uu(n,e,t)},useTransition:function(){var e=au(!1);return e=Ep.bind(null,Me,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Me,o=gn();if(Ze){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ft===null)throw Error(c(349));(Ke&127)!==0||tp(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,bp(rp.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,{destroy:void 0},np.bind(null,r,a,n,t),null),n},useId:function(){var e=gn(),t=ft.identifierPrefix;if(Ze){var n=vr,r=yr;n=(r&~(1<<32-mt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Lg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cu,useFormState:pp,useActionState:pp,useOptimistic:function(e){var t=gn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pu.bind(null,Me,!0,n),n.dispatch=t,[e,t]},useMemoCache:nu,useCacheRefresh:function(){return gn().memoizedState=Bg.bind(null,Me)},useEffectEvent:function(e){var t=gn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},mu={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:fs,useRef:gp,useState:function(){return fs(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Nt();return Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=fs(jr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:mp,useActionState:mp,useOptimistic:function(e,t){var n=Nt();return ip(n,dt,e,t)},useMemoCache:nu,useCacheRefresh:Mp};mu.useEffectEvent=yp;var Dp={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:ou,useRef:gp,useState:function(){return ou(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Nt();return dt===null?uu(n,e,t):Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=ou(jr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:hp,useActionState:hp,useOptimistic:function(e,t){var n=Nt();return dt!==null?ip(n,dt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nu,useCacheRefresh:Mp};Dp.useEffectEvent=yp;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 hu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$n(),o=lo(r);o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$n(),o=lo(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$n(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pn(t,e,n),pi(t,e,n))}};function Tp(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?!oi(n,r)||!oi(o,a):!0}function Lp(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&&hu.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=C({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Fp(e){Xi(e)}function $p(e){console.error(e)}function Op(e){Xi(e)}function ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Wp(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 gu(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){ys(e,t)},n}function Hp(e){return e=lo(e),e.tag=3,e}function Bp(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(){Wp(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Wp(t,n,r),typeof o!="function"&&(go===null?go=new Set([this]):go.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Ug(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=Dn.current,n!==null){switch(n.tag){case 31:case 13:return sr===null?Ms():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===as?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,o)),!1;case 22:return n.flags|=65536,r===as?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)),Wu(e,r,o)),!1}throw Error(c(435,n.tag))}return Wu(e,r,o),Ms(),!1}if(Ze)return t=Dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Dl&&(e=Error(c(422),{cause:r}),si(Un(e,n)))):(r!==Dl&&(t=Error(c(423),{cause:r}),si(Un(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Un(r,n),o=gu(e.stateNode,r,o),Ql(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(c(520),{cause:r});if(a=Un(a,n),Ei===null?Ei=[a]:Ei.push(a),Pt!==4&&(Pt=2),t===null)return!0;r=Un(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=gu(n.stateNode,r,e),Ql(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=Hp(o),Bp(o,e,n,r),Ql(n,o),!1}n=n.return}while(n!==null);return!1}var bu=Error(c(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?qc(t,null,n,r):Zo(t,e.child,n,r)}function Vp(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 qo(t),r=Jl(e,t,n,i,a,o),u=Yl(),e!==null&&!Ot?(eu(e,t,o),Nr(e,t,o)):(Ze&&u&&Nl(t),t.flags|=1,an(e,t,r,o),t.child)}function Up(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Ml(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Qp(e,t,a,r,o)):(e=Yi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cu(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:oi,n(i,r)&&e.ref===t.ref)return Nr(e,t,o)}return t.flags|=1,e=zr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Qp(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(oi(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,Cu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,Nr(e,t,o)}return yu(e,t,n,r,o)}function qp(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 Kp(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&rs(t,a!==null?a.cachePool:null),a!==null?Gc(t,a):Kl(),Zc(t);else return r=t.lanes=536870912,Kp(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(rs(t,a.cachePool),Gc(t,a),po(),t.memoizedState=null):(e!==null&&rs(t,null),Kl(),po());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 Kp(e,t,n,r,o){var a=Hl();return a=a===null?null:{parent:Ft._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&rs(t,null),Kl(),Zc(t),e!==null&&wa(e,t,r,!0),t.childLanes=o,null}function vs(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xp(e,t,n){return Zo(t,e.child,null,n),e=vs(t,t.pendingProps),e.flags|=2,Tn(t),t.memoizedState=null,e}function Qg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(r.mode==="hidden")return e=vs(t,r),t.lanes=536870912,vi(null,e);if(Gl(t),(e=vt)?(e=lf(e,Kn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return t.lanes=536870912,null}return vs(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Gl(t),o)if(t.flags&256)t.flags&=-257,t=Xp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ot||wa(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=ft,r!==null&&(i=No(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Bo(e,i),Pn(r,e,i),bu;Ms(),t=Xp(e,t,n)}else e=a.treeContext,vt=Xn(i.nextSibling),rn=t,Ze=!0,oo=null,Kn=!1,e!==null&&Dc(t,e),t=vs(t,r),t.flags|=4096;return t}return e=zr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xs(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 yu(e,t,n,r,o){return qo(t),n=Jl(e,t,n,r,void 0,o),r=Yl(),e!==null&&!Ot?(eu(e,t,o),Nr(e,t,o)):(Ze&&r&&Nl(t),t.flags|=1,an(e,t,n,o),t.child)}function Gp(e,t,n,r,o,a){return qo(t),t.updateQueue=null,n=Yc(t,r,n,o),Jc(e),r=Yl(),e!==null&&!Ot?(eu(e,t,a),Nr(e,t,a)):(Ze&&r&&Nl(t),t.flags|=1,an(e,t,n,a),t.child)}function Zp(e,t,n,r,o){if(qo(t),t.stateNode===null){var a=ba,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=hu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Vl(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?on(i):ba,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&&hu.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 u=t.memoizedProps,h=Yo(n,u);a.props=h;var k=a.context,j=n.contextType;i=ba,typeof j=="object"&&j!==null&&(i=on(j));var $=n.getDerivedStateFromProps;j=typeof $=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,j||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==i)&&Lp(t,a,r,i),so=!1;var S=t.memoizedState;a.state=S,fi(t,r,a,o),mi(),k=t.memoizedState,u||S!==k||so?(typeof $=="function"&&(fu(t,n,$,r),k=t.memoizedState),(h=so||Tp(t,n,h,r,S,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,Ul(e,t),i=t.memoizedProps,j=Yo(n,i),a.props=j,$=t.pendingProps,S=a.context,k=n.contextType,h=ba,typeof k=="object"&&k!==null&&(h=on(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==$||S!==h)&&Lp(t,a,r,h),so=!1,S=t.memoizedState,a.state=S,fi(t,r,a,o),mi();var z=t.memoizedState;i!==$||S!==z||so||e!==null&&e.dependencies!==null&&ts(e.dependencies)?(typeof u=="function"&&(fu(t,n,u,r),z=t.memoizedState),(j=so||Tp(t,n,j,r,S,z,h)||e!==null&&e.dependencies!==null&&ts(e.dependencies))?(k||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,z,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,z,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),a.props=r,a.state=z,a.context=h,r=j):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xs(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=Zo(t,e.child,null,o),t.child=Zo(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=Nr(e,t,o),e}function Jp(e,t,n,r){return Uo(),t.flags|=256,an(e,t,n,r),t.child}var vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xu(e){return{baseLanes:e,cachePool:Wc()}}function wu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Fn),e}function Yp(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:(jt.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(o?co(t):po(),(e=vt)?(e=lf(e,Kn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return rd(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(po(),o=t.mode,u=ws({mode:"hidden",children:u},o),r=Vo(r,o,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(null,r)):(co(t),ku(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=_u(e,t,n)):t.memoizedState!==null?(po(),t.child=e.child,t.flags|=128,t=null):(po(),u=r.fallback,o=t.mode,r=ws({mode:"visible",children:r.children},o),u=Vo(u,o,n,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,Zo(t,e.child,null,n),r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,t=vi(null,r));else if(co(t),rd(u)){if(i=u.nextSibling&&u.nextSibling.dataset,i)var k=i.dgst;i=k,r=Error(c(419)),r.stack="",r.digest=i,si({value:r,source:null,stack:null}),t=_u(e,t,n)}else if(Ot||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Ot||i){if(i=ft,i!==null&&(r=No(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Bo(e,r),Pn(i,e,r),bu;nd(u)||Ms(),t=_u(e,t,n)}else nd(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,vt=Xn(u.nextSibling),rn=t,Ze=!0,oo=null,Kn=!1,e!==null&&Dc(t,e),t=ku(t,r.children),t.flags|=4096);return t}return o?(po(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=zr(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=zr(k,u):(u=Vo(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,vi(null,r),r=t.child,u=e.child.memoizedState,u===null?u=xu(n):(o=u.cachePool,o!==null?(h=Ft._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Wc(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(e.child,r)):(co(t),n=e.child,e=n.sibling,n=zr(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 ku(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=Rn(22,e,null,t),e.lanes=0,e}function _u(e,t,n){return Zo(t,e.child,null,n),e=ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function em(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fl(e.return,t,n)}function Su(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 tm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=jt.current,u=(i&2)!==0;if(u?(i=i&1|2,t.flags|=128):i&=1,G(jt,i),an(e,t,r,n),r=Ze?ii:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,n,t);else if(e.tag===19)em(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&&us(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Su(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&&us(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Su(t,!0,n,null,a,r);break;case"together":Su(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nr(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(c(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ts(e)))}function qg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),io(t,Ft,e.memoizedState.cache),Uo();break;case 27:case 5:De(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,Gl(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?Yp(e,t,n):(co(t),e=Nr(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 tm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(jt,jt.current),r)break;return null;case 22:return t.lanes=0,qp(e,t,n,t.pendingProps);case 24:io(t,Ft,e.memoizedState.cache)}return Nr(e,t,n)}function nm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Cu(e,n)&&(t.flags&128)===0)return Ot=!1,qg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Ze&&(t.flags&1048576)!==0&&Rc(t,ii,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")Ml(e)?(r=Yo(e,r),t.tag=1,t=Zp(null,t,e,r,n)):(t.tag=0,t=yu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=Vp(null,t,e,r,n);break e}else if(o===O){t.tag=14,t=Up(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(c(306,t,""))}}return t;case 0:return yu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Yo(r,t.pendingProps),Zp(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Ul(e,t),fi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,io(t,Ft,r),r!==a.cache&&$l(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=Jp(e,t,r,n);break e}else if(r!==o){o=Un(Error(c(424)),t),si(o),t=Jp(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(vt=Xn(e.firstChild),rn=t,Ze=!0,oo=null,Kn=!0,n=qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Uo(),r===o){t=Nr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return xs(e,t),e===null?(n=ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ze||(n=t.type,e=t.pendingProps,r=Ls(ye.current).createElement(n),r[Ct]=t,r[Ht]=e,sn(r,n,e),Dt(r),t.stateNode=r):t.memoizedState=ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&Ze&&(r=t.stateNode=cf(t.type,t.pendingProps,ye.current),rn=t,Kn=!0,o=vt,xo(t.type)?(od=o,vt=Xn(r.firstChild)):vt=o),an(e,t,t.pendingProps.children,n),xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((o=r=vt)&&(r=_0(r,t.type,t.pendingProps,Kn),r!==null?(t.stateNode=r,rn=t,vt=Xn(r.firstChild),Kn=!1,o=!0):o=!1),o||ao(t)),De(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Yu(o,a)?r=null:i!==null&&Yu(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Jl(e,t,Fg,null,null,n),Ri._currentValue=o),xs(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Ze&&((e=n=vt)&&(n=S0(n,t.pendingProps,Kn),n!==null?(t.stateNode=n,rn=t,vt=null,e=!0):e=!1),e||ao(t)),null;case 13:return Yp(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zo(t,null,r,n):an(e,t,r,n),t.child;case 11:return Vp(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,qo(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Up(e,t,t.type,t.pendingProps,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 19:return tm(e,t,n);case 31:return Qg(e,t,n);case 22:return qp(e,t,n,t.pendingProps);case 24:return qo(t),r=on(Ft),e===null?(o=Hl(),o===null&&(o=ft,a=Ol(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Vl(t),io(t,Ft,o)):((e.lanes&n)!==0&&(Ul(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&&$l(t,[Ft],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Rr(e){e.flags|=4}function Eu(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(Pm())e.flags|=8192;else throw Go=as,Bl}else e.flags&=-16777217}function rm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vf(t))if(Pm())e.flags|=8192;else throw Go=as,Bl}function ks(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Io():536870912,e.lanes|=t,Na|=t)}function xi(e,t){if(!Ze)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 Kg(e,t,n){var r=t.pendingProps;switch(Rl(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),Mr(Ft),Re(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?Rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Tl())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Rr(t),a!==null?(xt(t),rm(t,a)):(xt(t),Eu(t,o,null,r,n))):a?a!==e.memoizedState?(Rr(t),xt(t),rm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Rr(t),xt(t),Eu(t,o,e,r,n)),null;case 27:if(Be(t),n=ye.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=Y.current,xa(t)?Tc(t):(e=cf(o,r,n),t.stateNode=e,Rr(t))}return xt(t),null;case 5:if(Be(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(a=Y.current,xa(t))Tc(t);else{var i=Ls(ye.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[Ht]=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(sn(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&&Rr(t)}}return xt(t),Eu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.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||Ym(e.nodeValue,n)),e||ao(t,!0)}else e=Ls(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(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Tn(t),t):(Tn(t),null);if((t.flags&128)!==0)throw Error(c(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(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Tn(t),t):(Tn(t),null)}return Tn(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),ks(t,t.updateQueue),xt(t),null);case 4:return Re(),e===null&&Ku(t.stateNode.containerInfo),xt(t),null;case 10:return Mr(t.type),xt(t),null;case 19:if(P(jt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)xi(r,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=us(e),a!==null){for(t.flags|=128,xi(r,!1),e=a.updateQueue,t.updateQueue=e,ks(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ic(n,e),n=n.sibling;return G(jt,jt.current&1|2),Ze&&Ar(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>zs&&(t.flags|=128,o=!0,xi(r,!1),t.lanes=4194304)}else{if(!o)if(e=us(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,ks(t,e),xi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ze)return xt(t),null}else 2*Je()-r.renderingStartTime>zs&&n!==536870912&&(t.flags|=128,o=!0,xi(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=Je(),e.sibling=null,n=jt.current,G(jt,o?n&1|2:n&1),Ze&&Ar(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Tn(t),Xl(),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&&ks(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&&P(Ko),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Mr(Ft),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Xg(e,t){switch(Rl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mr(Ft),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Be(t),null;case 31:if(t.memoizedState!==null){if(Tn(t),t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(jt),null;case 4:return Re(),null;case 10:return Mr(t.type),null;case 22:case 23:return Tn(t),Xl(),e!==null&&P(Ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mr(Ft),null;case 25:return null;default:return null}}function om(e,t){switch(Rl(t),t.tag){case 3:Mr(Ft),Re();break;case 26:case 27:case 5:Be(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Tn(t);break;case 13:Tn(t);break;case 19:P(jt);break;case 10:Mr(t.type);break;case 22:case 23:Tn(t),Xl(),e!==null&&P(Ko);break;case 24:Mr(Ft)}}function wi(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 mo(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 am(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xc(t,n)}catch(r){ut(e,e.return,r)}}}function im(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function ki(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 sm(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 zu(e,t,n){try{var r=e.stateNode;b0(r,e.type,n,t),r[Ht]=t}catch(o){ut(e,e.return,o)}}function lm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xo(e.type)||e.tag===4}function Au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lm(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 Pu(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(Pu(e,t,n),e=e.sibling;e!==null;)Pu(e,t,n),e=e.sibling}function _s(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(_s(e,t,n),e=e.sibling;e!==null;)_s(e,t,n),e=e.sibling}function um(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);sn(t,r,n),t[Ct]=e,t[Ht]=n}catch(a){ut(e,e.return,a)}}var Dr=!1,Wt=!1,Mu=!1,dm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Gg(e,t){if(e=e.containerInfo,Zu=Vs,e=kc(e),_l(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,$=e,S=null;t:for(;;){for(var z;$!==n||o!==0&&$.nodeType!==3||(u=i+o),$!==a||r!==0&&$.nodeType!==3||(h=i+r),$.nodeType===3&&(i+=$.nodeValue.length),(z=$.firstChild)!==null;)S=$,$=z;for(;;){if($===e)break t;if(S===n&&++k===o&&(u=i),S===a&&++j===r&&(h=i),(z=$.nextSibling)!==null)break;$=S,S=$.parentNode}$=z}n=u===-1||h===-1?null:{start:u,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ju={focusedElem:e,selectionRange:n},Vs=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,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 de=Yo(n.type,o);e=r.getSnapshotBeforeUpdate(de,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)td(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":td(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,Zt=e;break}Zt=t.return}}function cm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(e,n),r&4&&wi(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&&am(n),r&512&&ki(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{Xc(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&um(n);case 26:case 5:Lr(e,n),t===null&&r&4&&sm(n),r&512&&ki(n,n.return);break;case 12:Lr(e,n);break;case 31:Lr(e,n),r&4&&fm(e,n);break;case 13:Lr(e,n),r&4&&hm(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=a0.bind(null,n),C0(e,n))));break;case 22:if(r=n.memoizedState!==null||Dr,!r){t=t!==null&&t.memoizedState!==null||Wt,o=Dr;var a=Wt;Dr=r,(Wt=t)&&!a?Fr(e,n,(n.subtreeFlags&8772)!==0):Lr(e,n),Dr=o,Wt=a}break;case 30:break;default:Lr(e,n)}}function pm(e){var t=e.alternate;t!==null&&(e.alternate=null,pm(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;)mm(e,t,n),n=n.sibling}function mm(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Wt||xr(n,t),Tr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Wt||xr(n,t);var r=_t,o=Cn;xo(n.type)&&(_t=n.stateNode,Cn=!1),Tr(e,t,n),Ii(n.stateNode),_t=r,Cn=o;break;case 5:Wt||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,af(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wa(e)):af(_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:mo(2,n,t),Wt||mo(4,n,t),Tr(e,t,n);break;case 1:Wt||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&im(n,t,r)),Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:Wt=(r=Wt)||n.memoizedState!==null,Tr(e,t,n),Wt=r;break;default:Tr(e,t,n)}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wa(e)}catch(n){ut(t,t.return,n)}}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wa(e)}catch(n){ut(t,t.return,n)}}function Zg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dm),t;default:throw Error(c(435,e.tag))}}function Ss(e,t){var n=Zg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=i0.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,u=i;e:for(;u!==null;){switch(u.tag){case 27:if(xo(u.type)){_t=u.stateNode,Cn=!1;break e}break;case 5:_t=u.stateNode,Cn=!1;break e;case 3:case 4:_t=u.stateNode.containerInfo,Cn=!0;break e}u=u.return}if(_t===null)throw Error(c(160));mm(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;)gm(t,e),t=t.sibling}var lr=null;function gm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),zn(e),r&4&&(mo(3,e,e.return),wi(3,e),mo(5,e,e.return));break;case 1:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),r&64&&Dr&&(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(En(t,e),zn(e),r&512&&(Wt||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"))),sn(a,r,n),a[Ct]=e,Dt(a),r=a;break e;case"link":var i=bf("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),sn(a,r,n),o.head.appendChild(a);break;case"meta":if(i=bf("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),sn(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[Ct]=e,Dt(a),r=a}e.stateNode=r}else yf(o,e.type,e.stateNode);else e.stateNode=gf(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?yf(o,e.type,e.stateNode):gf(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&zu(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),n!==null&&r&4&&zu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(de){ut(e,e.return,de)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,zu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Mu=!0);break;case 6:if(En(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(de){ut(e,e.return,de)}}break;case 3:if(Os=null,o=lr,lr=Fs(t.containerInfo),En(t,e),lr=o,zn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wa(t.containerInfo)}catch(de){ut(e,e.return,de)}Mu&&(Mu=!1,bm(e));break;case 4:r=lr,lr=Fs(e.stateNode.containerInfo),En(t,e),zn(e),lr=r;break;case 12:En(t,e),zn(e);break;case 31:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 13:En(t,e),zn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Es=Je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,k=Dr,j=Wt;if(Dr=k||o,Wt=j||h,En(t,e),Wt=j,Dr=k,zn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Dr||Wt||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{u=h.stateNode;var $=h.memoizedProps.style,S=$!=null&&$.hasOwnProperty("display")?$.display:null;u.style.display=S==null||typeof S=="boolean"?"":(""+S).trim()}}catch(de){ut(h,h.return,de)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(de){ut(h,h.return,de)}}}else if(t.tag===18){if(n===null){h=t;try{var z=h.stateNode;o?sf(z,!0):sf(h.stateNode,!1)}catch(de){ut(h,h.return,de)}}}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,Ss(e,n))));break;case 19:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 30:break;case 21:break;default:En(t,e),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(lm(r)){n=r;break}r=r.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var o=n.stateNode,a=Au(e);_s(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var u=Au(e);_s(e,u,i);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Au(e);Pu(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 bm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bm(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;)cm(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:mo(4,t,t.return),ea(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&im(t,t.return,n),ea(t);break;case 27:Ii(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),wi(4,a);break;case 1:if(Fr(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++)Kc(h[o],u)}catch(k){ut(r,r.return,k)}}n&&i&64&&am(a),ki(a,a.return);break;case 27:um(a);case 26:case 5:Fr(o,a,n),n&&r===null&&i&4&&sm(a),ki(a,a.return);break;case 12:Fr(o,a,n);break;case 31:Fr(o,a,n),n&&i&4&&fm(o,a);break;case 13:Fr(o,a,n),n&&i&4&&hm(o,a);break;case 22:a.memoizedState===null&&Fr(o,a,n),ki(a,a.return);break;case 30:break;default:Fr(o,a,n)}t=t.sibling}}function Iu(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 ju(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;)ym(e,t,n,r),t=t.sibling}function ym(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ur(e,t,n,r),o&2048&&wi(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,u=a.onPostCommit;typeof u=="function"&&u(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):_i(e,t):a._visibility&2?ur(e,t,n,r):(a._visibility|=2,Ma(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Iu(i,t);break;case 24:ur(e,t,n,r),o&2048&&ju(t.alternate,t);break;default:ur(e,t,n,r)}}function Ma(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:Ma(a,i,u,h,o),wi(8,i);break;case 23:break;case 22:var j=i.stateNode;i.memoizedState!==null?j._visibility&2?Ma(a,i,u,h,o):_i(a,i):(j._visibility|=2,Ma(a,i,u,h,o)),o&&k&2048&&Iu(i.alternate,i);break;case 24:Ma(a,i,u,h,o),o&&k&2048&&ju(i.alternate,i);break;default:Ma(a,i,u,h,o)}t=t.sibling}}function _i(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:_i(n,r),o&2048&&Iu(r.alternate,r);break;case 24:_i(n,r),o&2048&&ju(r.alternate,r);break;default:_i(n,r)}t=t.sibling}}var Si=8192;function Ia(e,t,n){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)vm(e,t,n),e=e.sibling}function vm(e,t,n){switch(e.tag){case 26:Ia(e,t,n),e.flags&Si&&e.memoizedState!==null&&L0(n,lr,e.memoizedState,e.memoizedProps);break;case 5:Ia(e,t,n);break;case 3:case 4:var r=lr;lr=Fs(e.stateNode.containerInfo),Ia(e,t,n),lr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Si,Si=16777216,Ia(e,t,n),Si=r):Ia(e,t,n));break;default:Ia(e,t,n)}}function xm(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 Ci(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];Zt=r,km(r,e)}xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wm(e),e=e.sibling}function wm(e){switch(e.tag){case 0:case 11:case 15:Ci(e),e.flags&2048&&mo(9,e,e.return);break;case 3:Ci(e);break;case 12:Ci(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cs(e)):Ci(e);break;default:Ci(e)}}function Cs(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];Zt=r,km(r,e)}xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mo(8,t,t.return),Cs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Cs(t));break;default:Cs(t)}e=e.sibling}}function km(e,t){for(;Zt!==null;){var n=Zt;switch(n.tag){case 0:case 11:case 15:mo(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,Zt=r;else e:for(n=e;Zt!==null;){r=Zt;var o=r.sibling,a=r.return;if(pm(r),r===n){Zt=null;break e}if(o!==null){o.return=a,Zt=o;break e}Zt=a}}}var Jg={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}},Yg=typeof WeakMap=="function"?WeakMap:Map,at=0,ft=null,Ue=null,Ke=0,lt=0,Ln=null,fo=!1,ja=!1,Nu=!1,$r=0,Pt=0,ho=0,ta=0,Ru=0,Fn=0,Na=0,Ei=null,An=null,Du=!1,Es=0,_m=0,zs=1/0,As=null,go=null,Qt=0,bo=null,Ra=null,Or=0,Tu=0,Lu=null,Sm=null,zi=0,Fu=null;function $n(){return(at&2)!==0&&Ke!==0?Ke&-Ke:E.T!==null?Vu():ra()}function Cm(){if(Fn===0)if((Ke&536870912)===0||Ze){var e=me;me<<=1,(me&3932160)===0&&(me=262144),Fn=e}else Fn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Fn}function Pn(e,t,n){(e===ft&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(Da(e,0),yo(e,Ke,Fn,!1)),cr(e,n),((at&2)===0||e!==ft)&&(e===ft&&((at&2)===0&&(ta|=n),Pt===4&&yo(e,Ke,Fn,!1)),wr(e))}function Em(e,t,n){if((at&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tt(e,t),o=r?n0(e,t):Ou(e,t,!0),a=r;do{if(o===0){ja&&!r&&yo(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!e0(n)){o=Ou(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=Ei;var h=u.current.memoizedState.isDehydrated;if(h&&(Da(u,i).flags|=256),i=Ou(u,i,!1),i!==2){if(Nu&&!h){u.errorRecoveryDisabledLanes|=a,ta|=a,o=4;break e}a=An,An=o,a!==null&&(An===null?An=a:An.push.apply(An,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){Da(e,0),yo(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:yo(r,t,Fn,!fo);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Es+300-Je(),10<o)){if(yo(r,t,Fn,!fo),ve(r,0,!0)!==0)break e;Or=t,r.timeoutHandle=rf(zm.bind(null,r,n,An,As,Du,t,Fn,ta,Na,fo,a,"Throttled",-0,0),o);break e}zm(r,n,An,As,Du,t,Fn,ta,Na,fo,a,null,-0,0)}}break}while(!0);wr(e)}function zm(e,t,n,r,o,a,i,u,h,k,j,$,S,z){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},vm(t,a,$);var de=(a&62914560)===a?Es-Je():(a&4194048)===a?_m-Je():0;if(de=F0($,de),de!==null){Or=a,e.cancelPendingCommit=de(Dm.bind(null,e,t,a,n,r,o,i,u,h,j,$,null,S,z)),yo(e,a,i,!k);return}}Dm(e,t,a,n,r,o,i,u,h)}function e0(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 yo(e,t,n,r){t&=~Ru,t&=~ta,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-mt(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Qr(e,n,t)}function Ps(){return(at&6)===0?(Ai(0),!1):!0}function $u(){if(Ue!==null){if(lt===0)var e=Ue.return;else e=Ue,Pr=Qo=null,tu(e),Ca=null,di=0,e=Ue;for(;e!==null;)om(e.alternate,e),e=e.return;Ue=null}}function Da(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,x0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Or=0,$u(),ft=e,Ue=n=zr(e.current,null),Ke=t,lt=0,Ln=null,fo=!1,ja=tt(e,t),Nu=!1,Na=Fn=Ru=ta=ho=Pt=0,An=Ei=null,Du=!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-mt(r),a=1<<o;t|=e[o],r&=~a}return $r=t,Gi(),n}function Am(e,t){Me=null,E.H=yi,t===Sa||t===os?(t=Vc(),lt=3):t===Bl?(t=Vc(),lt=4):lt=t===bu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,Ue===null&&(Pt=1,ys(e,Un(t,e.current)))}function Pm(){var e=Dn.current;return e===null?!0:(Ke&4194048)===Ke?sr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===sr:!1}function Mm(){var e=E.H;return E.H=yi,e===null?yi:e}function Im(){var e=E.A;return E.A=Jg,e}function Ms(){Pt=4,fo||(Ke&4194048)!==Ke&&Dn.current!==null||(ja=!0),(ho&134217727)===0&&(ta&134217727)===0||ft===null||yo(ft,Ke,Fn,!1)}function Ou(e,t,n){var r=at;at|=2;var o=Mm(),a=Im();(ft!==e||Ke!==t)&&(As=null,Da(e,t)),t=!1;var i=Pt;e:do try{if(lt!==0&&Ue!==null){var u=Ue,h=Ln;switch(lt){case 8:$u(),i=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(t=!0);var k=lt;if(lt=0,Ln=null,Ta(e,u,h,k),n&&ja){i=0;break e}break;default:k=lt,lt=0,Ln=null,Ta(e,u,h,k)}}t0(),i=Pt;break}catch(j){Am(e,j)}while(!0);return t&&e.shellSuspendCounter++,Pr=Qo=null,at=r,E.H=o,E.A=a,Ue===null&&(ft=null,Ke=0,Gi()),i}function t0(){for(;Ue!==null;)jm(Ue)}function n0(e,t){var n=at;at|=2;var r=Mm(),o=Im();ft!==e||Ke!==t?(As=null,zs=Je()+500,Da(e,t)):ja=tt(e,t);e:do try{if(lt!==0&&Ue!==null){t=Ue;var a=Ln;t:switch(lt){case 1:lt=0,Ln=null,Ta(e,t,a,1);break;case 2:case 9:if(Hc(a)){lt=0,Ln=null,Nm(t);break}t=function(){lt!==2&<!==9||ft!==e||(lt=7),wr(e)},a.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Hc(a)?(lt=0,Ln=null,Nm(t)):(lt=0,Ln=null,Ta(e,t,a,7));break;case 5:var i=null;switch(Ue.tag){case 26:i=Ue.memoizedState;case 5:case 27:var u=Ue;if(i?vf(i):u.stateNode.complete){lt=0,Ln=null;var h=u.sibling;if(h!==null)Ue=h;else{var k=u.return;k!==null?(Ue=k,Is(k)):Ue=null}break t}}lt=0,Ln=null,Ta(e,t,a,5);break;case 6:lt=0,Ln=null,Ta(e,t,a,6);break;case 8:$u(),Pt=6;break e;default:throw Error(c(462))}}r0();break}catch(j){Am(e,j)}while(!0);return Pr=Qo=null,E.H=r,E.A=o,at=n,Ue!==null?0:(ft=null,Ke=0,Gi(),Pt)}function r0(){for(;Ue!==null&&!Ge();)jm(Ue)}function jm(e){var t=nm(e.alternate,e,$r);e.memoizedProps=e.pendingProps,t===null?Is(e):Ue=t}function Nm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gp(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Gp(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:tu(t);default:om(n,t),t=Ue=Ic(t,$r),t=nm(n,t,$r)}e.memoizedProps=e.pendingProps,t===null?Is(e):Ue=t}function Ta(e,t,n,r){Pr=Qo=null,tu(t),Ca=null,di=0;var o=t.return;try{if(Ug(e,o,t,n,Ke)){Pt=1,ys(e,Un(n,e.current)),Ue=null;return}}catch(a){if(o!==null)throw Ue=o,a;Pt=1,ys(e,Un(n,e.current)),Ue=null;return}t.flags&32768?(Ze||r===1?e=!0:ja||(Ke&536870912)!==0?e=!1:(fo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Dn.current,r!==null&&r.tag===13&&(r.flags|=16384))),Rm(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){Rm(t,fo);return}e=t.return;var n=Kg(t.alternate,t,$r);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);Pt===0&&(Pt=5)}function Rm(e,t){do{var n=Xg(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);Pt=6,Ue=null}function Dm(e,t,n,r,o,a,i,u,h){e.cancelPendingCommit=null;do js();while(Qt!==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|=Al,jo(e,n,a,i,u,h),e===ft&&(Ue=ft=null,Ke=0),Ra=t,bo=e,Or=n,Tu=a,Lu=o,Sm=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,s0(Kt,function(){return Om(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=E.T,E.T=null,o=V.p,V.p=2,i=at,at|=4;try{Gg(e,t,n)}finally{at=i,V.p=o,E.T=r}}Qt=1,Tm(),Lm(),Fm()}}function Tm(){if(Qt===1){Qt=0;var e=bo,t=Ra,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{gm(t,e);var a=Ju,i=kc(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(i!==u&&u&&u.ownerDocument&&wc(u.ownerDocument.documentElement,u)){if(h!==null&&_l(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 $=u.ownerDocument||document,S=$&&$.defaultView||window;if(S.getSelection){var z=S.getSelection(),de=u.textContent.length,Se=Math.min(h.start,de),pt=h.end===void 0?Se:Math.min(h.end,de);!z.extend&&Se>pt&&(i=pt,pt=Se,Se=i);var b=xc(u,Se),g=xc(u,pt);if(b&&g&&(z.rangeCount!==1||z.anchorNode!==b.node||z.anchorOffset!==b.offset||z.focusNode!==g.node||z.focusOffset!==g.offset)){var w=$.createRange();w.setStart(b.node,b.offset),z.removeAllRanges(),Se>pt?(z.addRange(w),z.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),z.addRange(w))}}}}for($=[],z=u;z=z.parentNode;)z.nodeType===1&&$.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<$.length;u++){var T=$[u];T.element.scrollLeft=T.left,T.element.scrollTop=T.top}}Vs=!!Zu,Ju=Zu=null}finally{at=o,V.p=r,E.T=n}}e.current=t,Qt=2}}function Lm(){if(Qt===2){Qt=0;var e=bo,t=Ra,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{cm(e,t.alternate,t)}finally{at=o,V.p=r,E.T=n}}Qt=3}}function Fm(){if(Qt===4||Qt===3){Qt=0,K();var e=bo,t=Ra,n=Or,r=Sm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,Ra=bo=null,$m(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(go=null),fn(n),t=t.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=E.T,o=V.p,V.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,V.p=o}}(Or&3)!==0&&js(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Fu?zi++:(zi=0,Fu=e):zi=0,Ai(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,li(t)))}function js(){return Tm(),Lm(),Fm(),Om()}function Om(){if(Qt!==5)return!1;var e=bo,t=Tu;Tu=0;var n=fn(Or),r=E.T,o=V.p;try{V.p=32>n?32:n,E.T=null,n=Lu,Lu=null;var a=bo,i=Or;if(Qt=0,Ra=bo=null,Or=0,(at&6)!==0)throw Error(c(331));var u=at;if(at|=4,wm(a.current),ym(a,a.current,i,n),at=u,Ai(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{V.p=o,E.T=r,$m(e,t)}}function Wm(e,t,n){t=Un(n,t),t=gu(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(cr(e,2),wr(e))}function ut(e,t,n){if(e.tag===3)Wm(e,e,n);else for(;t!==null;){if(t.tag===3){Wm(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=Un(n,e),n=Hp(2),r=uo(t,n,2),r!==null&&(Bp(n,r,t,e),cr(r,2),wr(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yg;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)||(Nu=!0,o.add(n),e=o0.bind(null,e,t,n),t.then(e,e))}function o0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ft===e&&(Ke&n)===n&&(Pt===4||Pt===3&&(Ke&62914560)===Ke&&300>Je()-Es?(at&2)===0&&Da(e,0):Ru|=n,Na===Ke&&(Na=0)),wr(e)}function Hm(e,t){t===0&&(t=Io()),e=Bo(e,t),e!==null&&(cr(e,t),wr(e))}function a0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hm(e,n)}function i0(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),Hm(e,n)}function s0(e,t){return X(e,t)}var Ns=null,La=null,Hu=!1,Rs=!1,Bu=!1,vo=0;function wr(e){e!==La&&e.next===null&&(La===null?Ns=La=e:La=La.next=e),Rs=!0,Hu||(Hu=!0,u0())}function Ai(e,t){if(!Bu&&Rs){Bu=!0;do for(var n=!1,r=Ns;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-mt(42|e)+1)-1,a&=o&~(i&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Qm(r,a))}else a=Ke,a=ve(r,r===ft?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||tt(r,a)||(n=!0,Qm(r,a));r=r.next}while(n);Bu=!1}}function l0(){Bm()}function Bm(){Rs=Hu=!1;var e=0;vo!==0&&v0()&&(e=vo);for(var t=Je(),n=null,r=Ns;r!==null;){var o=r.next,a=Vm(r,t);a===0?(r.next=null,n===null?Ns=o:n.next=o,o===null&&(La=n)):(n=r,(e!==0||(a&3)!==0)&&(Rs=!0)),r=o}Qt!==0&&Qt!==5||Ai(e),vo!==0&&(vo=0)}function Vm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-mt(a),u=1<<i,h=o[i];h===-1?((u&n)===0||(u&r)!==0)&&(o[i]=Jt(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=ft,n=Ke,n=ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(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&&Ve(r),fn(n)){case 2:case 8:n=it;break;case 32:n=Kt;break;case 268435456:n=Mo;break;default:n=Kt}return r=Um.bind(null,e),n=X(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Um(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(js()&&e.callbackNode!==n)return null;var r=Ke;return r=ve(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Em(e,r,t),Vm(e,Je()),e.callbackNode!=null&&e.callbackNode===n?Um.bind(null,e):null)}function Qm(e,t){if(js())return null;Em(e,t,!0)}function u0(){w0(function(){(at&6)!==0?X(un,l0):Bm()})}function Vu(){if(vo===0){var e=ka;e===0&&(e=pn,pn<<=1,(pn&261888)===0&&(pn=256)),vo=e}return vo}function qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:br(""+e)}function Km(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 d0(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=qm((o[Ht]||null).action),i=r.submitter;i&&(t=(t=i[Ht]||null)?qm(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var u=new Lo("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vo!==0){var h=i?Km(o,i):new FormData(o);du(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=i?Km(o,i):new FormData(o),du(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Uu=0;Uu<zl.length;Uu++){var Qu=zl[Uu],c0=Qu.toLowerCase(),p0=Qu[0].toUpperCase()+Qu.slice(1);ir(c0,"on"+p0)}ir(Cc,"onAnimationEnd"),ir(Ec,"onAnimationIteration"),ir(zc,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Ag,"onTransitionRun"),ir(Pg,"onTransitionStart"),ir(Mg,"onTransitionCancel"),ir(Ac,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),m0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pi));function Xm(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){Xi(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){Xi(j)}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)||(Gm(t,e,2,!1),n.add(r))}function qu(e,t,n){var r=0;t&&(r|=4),Gm(n,e,r,t)}var Ds="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[Ds]){e[Ds]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(m0.has(n)||qu(n,!1,e),qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ds]||(t[Ds]=!0,qu("selectionchange",!1,t))}}function Gm(e,t,n,r){switch(Ef(t)){case 2:var o=W0;break;case 8:o=H0;break;default:o=ud}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 Xu(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}pa(function(){var k=a,j=et(n),$=[];e:{var S=Pc.get(e);if(S!==void 0){var z=Lo,de=e;switch(e){case"keypress":if(Wn(n)===0)break e;case"keydown":case"keyup":z=R;break;case"focusin":de="focus",z=ma;break;case"focusout":de="blur",z=ma;break;case"beforeblur":case"afterblur":z=ma;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":z=Ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=ml;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=Ye;break;case Cc:case Ec:case zc:z=gl;break;case Ac:z=Lt;break;case"scroll":case"scrollend":z=no;break;case"wheel":z=We;break;case"copy":case"cut":case"paste":z=Ui;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Z;break;case"toggle":case"beforetoggle":z=Gt}var Se=(t&4)!==0,pt=!Se&&(e==="scroll"||e==="scrollend"),b=Se?S!==null?S+"Capture":null:S;Se=[];for(var g=k,w;g!==null;){var T=g;if(w=T.stateNode,T=T.tag,T!==5&&T!==26&&T!==27||w===null||b===null||(T=ar(g,b),T!=null&&Se.push(Mi(g,T,w))),pt)break;g=g.return}0<Se.length&&(S=new z(S,de,null,n,j),$.push({event:S,listeners:Se}))}}if((t&7)===0){e:{if(S=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",S&&n!==da&&(de=n.relatedTarget||n.fromElement)&&(mr(de)||de[pr]))break e;if((z||S)&&(S=j.window===j?j:(S=j.ownerDocument)?S.defaultView||S.parentWindow:window,z?(de=n.relatedTarget||n.toElement,z=k,de=de?mr(de):null,de!==null&&(pt=I(de),Se=de.tag,de!==pt||Se!==5&&Se!==27&&Se!==6)&&(de=null)):(z=null,de=k),z!==de)){if(Se=Ya,T="onMouseLeave",b="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Z,T="onPointerLeave",b="onPointerEnter",g="pointer"),pt=z==null?S:cn(z),w=de==null?S:cn(de),S=new Se(T,g+"leave",z,n,j),S.target=pt,S.relatedTarget=w,T=null,mr(j)===k&&(Se=new Se(b,g+"enter",de,n,j),Se.target=w,Se.relatedTarget=pt,T=Se),pt=T,z&&de)t:{for(Se=f0,b=z,g=de,w=0,T=b;T;T=Se(T))w++;T=0;for(var we=g;we;we=Se(we))T++;for(;0<w-T;)b=Se(b),w--;for(;0<T-w;)g=Se(g),T--;for(;w--;){if(b===g||g!==null&&b===g.alternate){Se=b;break t}b=Se(b),g=Se(g)}Se=null}else Se=null;z!==null&&Zm($,S,z,Se,!1),de!==null&&pt!==null&&Zm($,pt,de,Se,!0)}}e:{if(S=k?cn(k):window,z=S.nodeName&&S.nodeName.toLowerCase(),z==="select"||z==="input"&&S.type==="file")var nt=fc;else if(pc(S))if(hc)nt=Cg;else{nt=_g;var he=kg}else z=S.nodeName,!z||z.toLowerCase()!=="input"||S.type!=="checkbox"&&S.type!=="radio"?k&&Zr(k.elementType)&&(nt=fc):nt=Sg;if(nt&&(nt=nt(e,k))){mc($,nt,n,j);break e}he&&he(e,S,k),e==="focusout"&&k&&S.type==="number"&&k.memoizedProps.value!=null&&ua(S,"number",S.value)}switch(he=k?cn(k):window,e){case"focusin":(pc(he)||he.contentEditable==="true")&&(fa=he,Sl=k,ai=null);break;case"focusout":ai=Sl=fa=null;break;case"mousedown":Cl=!0;break;case"contextmenu":case"mouseup":case"dragend":Cl=!1,_c($,n,j);break;case"selectionchange":if(zg)break;case"keydown":case"keyup":_c($,n,j)}var Ne;if(Ut)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?st(e,n)&&(Xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ce&&n.locale!=="ko"&&(St||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&St&&(Ne=Tt()):(It=j,Ja="value"in It?It.value:It.textContent,St=!0)),he=Ts(k,Xe),0<he.length&&(Xe=new Qi(Xe,e,null,n,j),$.push({event:Xe,listeners:he}),Ne?Xe.data=Ne:(Ne=Sn(n),Ne!==null&&(Xe.data=Ne)))),(Ne=Bn?nn(e,n):gt(e,n))&&(Xe=Ts(k,"onBeforeInput"),0<Xe.length&&(he=new Qi("onBeforeInput","beforeinput",null,n,j),$.push({event:he,listeners:Xe}),he.data=Ne)),d0($,e,k,n,j)}Xm($,t)})}function Mi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ts(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(Mi(e,o,a)),o=ar(e,t),o!=null&&r.push(Mi(e,o,a))),e.tag===3)return r;e=e.return}return[]}function f0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zm(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=ar(n,a),k!=null&&i.unshift(Mi(n,k,h))):o||(k=ar(n,a),k!=null&&i.push(Mi(n,k,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var h0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function Jm(e){return(typeof e=="string"?e:""+e).replace(h0,`
|
|
41
|
-
`).replace(g0,"")}function Ym(e,t){return t=Jm(t),Jm(e)===t}function ct(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":Do(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=br(""+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"&&ct(e,t,"name",o.name,o,null),ct(e,t,"formEncType",o.formEncType,o,null),ct(e,t,"formMethod",o.formMethod,o,null),ct(e,t,"formTarget",o.formTarget,o,null)):(ct(e,t,"encType",o.encType,o,null),ct(e,t,"method",o.method,o,null),ct(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=br(""+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(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=br(""+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),xn(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":xn(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=Bt.get(n)||n,xn(e,n,r))}}function Gu(e,t,n,r,o,a){switch(n){case"style":Do(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=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sa.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[Ht]||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,""):xn(e,n,r)}}}function sn(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:ct(e,t,a,i,n,null)}}o&&ct(e,t,"srcSet",n.srcSet,n,null),r&&ct(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:ct(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:ct(e,t,o,u,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)&&(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:ct(e,t,i,u,n,null)}Za(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:ct(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<Pi.length;r++)Qe(Pi[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:ct(e,t,k,r,n,null)}return;default:if(Zr(t)){for(j in n)n.hasOwnProperty(j)&&(r=n[j],r!==void 0&&Gu(e,t,j,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&ct(e,t,u,r,n,null))}function b0(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(z in n){var $=n[z];if(n.hasOwnProperty(z)&&$!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":h=$;default:r.hasOwnProperty(z)||ct(e,t,z,null,r,$)}}for(var S in r){var z=r[S];if($=n[S],r.hasOwnProperty(S)&&(z!=null||$!=null))switch(S){case"type":a=z;break;case"name":o=z;break;case"checked":k=z;break;case"defaultChecked":j=z;break;case"value":i=z;break;case"defaultValue":u=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:z!==$&&ct(e,t,S,z,r,$)}}la(e,i,u,h,k,j,a,o);return;case"select":z=i=u=S=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":z=h;default:r.hasOwnProperty(a)||ct(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":S=a;break;case"defaultValue":u=a;break;case"multiple":i=a;default:a!==h&&ct(e,t,o,a,r,h)}t=u,n=i,r=z,S!=null?Gr(e,!!n,S,!1):!!r!=!!n&&(t!=null?Gr(e,!!n,t,!0):Gr(e,!!n,n?[]:"",!1));return;case"textarea":z=S=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:ct(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":S=o;break;case"defaultValue":z=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==a&&ct(e,t,i,o,r,a)}Hi(e,S,z);return;case"option":for(var de in n)if(S=n[de],n.hasOwnProperty(de)&&S!=null&&!r.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:ct(e,t,de,null,r,S)}for(h in r)if(S=r[h],z=n[h],r.hasOwnProperty(h)&&S!==z&&(S!=null||z!=null))switch(h){case"selected":e.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:ct(e,t,h,S,r,z)}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)S=n[Se],n.hasOwnProperty(Se)&&S!=null&&!r.hasOwnProperty(Se)&&ct(e,t,Se,null,r,S);for(k in r)if(S=r[k],z=n[k],r.hasOwnProperty(k)&&S!==z&&(S!=null||z!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(137,t));break;default:ct(e,t,k,S,r,z)}return;default:if(Zr(t)){for(var pt in n)S=n[pt],n.hasOwnProperty(pt)&&S!==void 0&&!r.hasOwnProperty(pt)&&Gu(e,t,pt,void 0,r,S);for(j in r)S=r[j],z=n[j],!r.hasOwnProperty(j)||S===z||S===void 0&&z===void 0||Gu(e,t,j,S,r,z);return}}for(var b in n)S=n[b],n.hasOwnProperty(b)&&S!=null&&!r.hasOwnProperty(b)&&ct(e,t,b,null,r,S);for($ in r)S=r[$],z=n[$],!r.hasOwnProperty($)||S===z||S==null&&z==null||ct(e,t,$,S,r,z)}function ef(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y0(){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&&ef(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,$=h.initiatorType;j&&ef($)&&(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 Zu=null,Ju=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 Yu(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 ed=null;function v0(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var rf=typeof setTimeout=="function"?setTimeout:void 0,x0=typeof clearTimeout=="function"?clearTimeout:void 0,of=typeof Promise=="function"?Promise:void 0,w0=typeof queueMicrotask=="function"?queueMicrotask:typeof of<"u"?function(e){return of.resolve(null).then(e).catch(k0)}:rf;function k0(e){setTimeout(function(){throw e})}function xo(e){return e==="head"}function af(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),Wa(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ii(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ii(n);for(var a=n.firstChild;a;){var i=a.nextSibling,u=a.nodeName;a[kr]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Ii(e.ownerDocument.body);n=o}while(n);Wa(t)}function sf(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 td(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":td(n),qa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function _0(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=Xn(e.nextSibling),e===null)break}return null}function S0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Xn(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Xn(e.nextSibling),e===null))return null;return e}function nd(e){return e.data==="$?"||e.data==="$~"}function rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function C0(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 Xn(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 od=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Xn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function df(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 cf(e,t,n){switch(t=Ls(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 Ii(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qa(e)}var Gn=new Map,pf=new Set;function Fs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wr=V.d;V.d={f:E0,r:z0,D:A0,C:P0,L:M0,m:I0,X:N0,S:j0,M:R0};function E0(){var e=Wr.f(),t=Ps();return e||t}function z0(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?Ap(t):Wr.r(e)}var Fa=typeof document>"u"?null:document;function mf(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+'"]'),pf.has(o)||(pf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),sn(t,"link",e),Dt(t),r.head.appendChild(t)))}}function A0(e){Wr.D(e),mf("dns-prefetch",e,null)}function P0(e,t){Wr.C(e,t),mf("preconnect",e,t)}function M0(e,t,n){Wr.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)}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(ji(a))||t==="script"&&r.querySelector(Ni(a))||(t=r.createElement("link"),sn(t,"link",e),Dt(t),r.head.appendChild(t)))}}function I0(e,t){Wr.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(!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(Ni(a)))return}r=n.createElement("link"),sn(r,"link",e),Dt(r),n.head.appendChild(r)}}}function j0(e,t,n){Wr.S(e,t,n);var r=Fa;if(r&&e){var o=Mt(r).hoistableStyles,a=$a(e);t=t||"default";var i=o.get(a);if(!i){var u={loading:0,preload:null};if(i=r.querySelector(ji(a)))u.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Gn.get(a))&&ad(e,n);var h=i=r.createElement("link");Dt(h),sn(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,$s(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:u},o.set(a,i)}}}function N0(e,t){Wr.X(e,t);var n=Fa;if(n&&e){var r=Mt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=C({src:e,async:!0},t),(t=Gn.get(o))&&id(e,t),a=n.createElement("script"),Dt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function R0(e,t){Wr.M(e,t);var n=Fa;if(n&&e){var r=Mt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=C({src:e,async:!0,type:"module"},t),(t=Gn.get(o))&&id(e,t),a=n.createElement("script"),Dt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function ff(e,t,n,r){var o=(o=ye.current)?Fs(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=$a(n.href),n=Mt(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=Mt(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(ji(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||D0(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=Oa(n),n=Mt(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 $a(e){return'href="'+en(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function hf(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function D0(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}),sn(t,"link",n),Dt(t),e.head.appendChild(t))}function Oa(e){return'[src="'+en(e)+'"]'}function Ni(e){return"script[async]"+e}function gf(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,Dt(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"),Dt(r),sn(r,"style",o),$s(r,n.precedence,e),t.instance=r;case"stylesheet":o=$a(n.href);var a=e.querySelector(ji(o));if(a)return t.state.loading|=4,t.instance=a,Dt(a),a;r=hf(n),(o=Gn.get(o))&&ad(r,o),a=(e.ownerDocument||e).createElement("link"),Dt(a);var i=a;return i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(a,"link",r),t.state.loading|=4,$s(a,n.precedence,e),t.instance=a;case"script":return a=Oa(n.src),(o=e.querySelector(Ni(a)))?(t.instance=o,Dt(o),o):(r=n,(o=Gn.get(a))&&(r=C({},n),id(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),Dt(o),sn(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,$s(r,n.precedence,e));return t.instance}function $s(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 ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Os=null;function bf(e,t,n){if(Os===null){var r=new Map,o=Os=new Map;o.set(n,r)}else o=Os,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 u=r.get(i);u?u.push(a):r.set(i,[a])}}return r}function yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function T0(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 vf(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=$a(r.href),a=t.querySelector(ji(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ws.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Dt(a);return}a=t.ownerDocument||t,r=hf(r),(o=Gn.get(o))&&ad(r,o),a=a.createElement("link"),Dt(a);var i=a;i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(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=Ws.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var sd=0;function F0(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&sd===0&&(sd=62500*y0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>sd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Ws(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach($0,e),Hs=null,Ws.call(e))}function $0(e,t){if(!(t.state.loading&4)){var n=Hs.get(e);if(n)var r=n.get(null);else{n=new Map,Hs.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=Ws.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 Ri={$$typeof:re,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function O0(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=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 xf(e,t,n,r,o,a,i,u,h,k,j,$){return e=new O0(e,t,n,i,h,k,j,$,u),t=1,a===!0&&(t|=24),a=Rn(3,null,null,t),e.current=a,a.stateNode=e,t=Ol(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Vl(a),e}function wf(e){return e?(e=ba,e):ba}function kf(e,t,n,r,o,a){o=wf(o),r.context===null?r.context=o:r.pendingContext=o,r=lo(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),pi(n,e,t))}function _f(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ld(e,t){_f(e,t),(e=e.alternate)&&_f(e,t)}function Sf(e){if(e.tag===13||e.tag===31){var t=Bo(e,67108864);t!==null&&Pn(t,e,67108864),ld(e,67108864)}}function Cf(e){if(e.tag===13||e.tag===31){var t=$n();t=er(t);var n=Bo(e,t);n!==null&&Pn(n,e,t),ld(e,t)}}var Vs=!0;function W0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=2,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function H0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=8,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function ud(e,t,n,r){if(Vs){var o=dd(r);if(o===null)Xu(e,t,r,Us,n),zf(e,r);else if(V0(o,e,t,n,r))r.stopPropagation();else if(zf(e,r),t&4&&-1<B0.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=vn(a.pendingLanes);if(i!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;i;){var h=1<<31-mt(i);u.entanglements[1]|=h,i&=~h}wr(a),(at&6)===0&&(zs=Je()+500,Ai(0))}}break;case 31:case 13:u=Bo(a,2),u!==null&&Pn(u,a,2),Ps(),ld(a,2)}if(a=dd(r),a===null&&Xu(e,t,r,Us,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Xu(e,t,r,null,n)}}function dd(e){return e=et(e),cd(e)}var Us=null;function cd(e){if(Us=null,e=mr(e),e!==null){var t=I(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=D(t),e!==null)return e;e=null}else if(n===31){if(e=q(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 Us=e,null}function Ef(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 Mo:return 268435456;default:return 32}default:return 32}}var pd=!1,wo=null,ko=null,_o=null,Di=new Map,Ti=new Map,So=[],B0="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 zf(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":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(t.pointerId)}}function Li(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&&Sf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function V0(e,t,n,r,o){switch(t){case"focusin":return wo=Li(wo,e,t,n,r,o),!0;case"dragenter":return ko=Li(ko,e,t,n,r,o),!0;case"mouseover":return _o=Li(_o,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Di.set(a,Li(Di.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Ti.set(a,Li(Ti.get(a)||null,e,t,n,r,o)),!0}return!1}function Af(e){var t=mr(e.target);if(t!==null){var n=I(t);if(n!==null){if(t=n.tag,t===13){if(t=D(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(n)});return}}else if(t===31){if(t=q(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(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 Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dd(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);da=r,n.target.dispatchEvent(r),da=null}else return t=Kr(n),t!==null&&Sf(t),e.blockedOn=n,!1;t.shift()}return!0}function Pf(e,t,n){Qs(e)&&n.delete(t)}function U0(){pd=!1,wo!==null&&Qs(wo)&&(wo=null),ko!==null&&Qs(ko)&&(ko=null),_o!==null&&Qs(_o)&&(_o=null),Di.forEach(Pf),Ti.forEach(Pf)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,pd||(pd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,U0)))}var Ks=null;function Mf(e){Ks!==e&&(Ks=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ks===e&&(Ks=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(cd(r||n)===null)continue;break}var a=Kr(n);a!==null&&(e.splice(t,3),t-=3,du(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Wa(e){function t(h){return qs(h,e)}wo!==null&&qs(wo,e),ko!==null&&qs(ko,e),_o!==null&&qs(_o,e),Di.forEach(t),Ti.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);)Af(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[Ht]||null;if(typeof a=="function")i||Mf(n);else if(i){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[Ht]||null)u=i.formAction;else if(cd(o)!==null)continue}else u=i.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),Mf(n)}}}function If(){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 md(e){this._internalRoot=e}Xs.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=$n();kf(n,r,e,t,null,null)},Xs.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kf(e.current,2,null,e,null,null),Ps(),t[pr]=null}};function Xs(e){this._internalRoot=e}Xs.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&&Af(e)}};var jf=l.version;if(jf!=="19.2.1")throw Error(c(527,jf,"19.2.1"));V.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?B(e):null,e=e===null?null:e.stateNode,e};var Q0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{Xt=Gs.inject(Q0),Rt=Gs}catch{}}return Ha.createRoot=function(e,t){if(!v(e))throw Error(c(299));var n=!1,r="",o=Fp,a=$p,i=Op;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=xf(e,1,!1,null,null,n,r,null,o,a,i,If),e[pr]=t.current,Ku(e),new md(t)},Ha.hydrateRoot=function(e,t,n){if(!v(e))throw Error(c(299));var r=!1,o="",a=Fp,i=$p,u=Op,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=xf(e,1,!0,t,n??null,r,o,h,a,i,u,If),t.context=wf(null),n=t.current,r=$n(),r=er(r),o=lo(r),o.callback=null,uo(n,o,r),n=r,t.current.lanes=n,cr(t,n),wr(t),e[pr]=t.current,Ku(e),new Xs(t)},Ha.version="19.2.1",Ha}var Cd;function Ff(){if(Cd)return Js.exports;Cd=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(),Js.exports=Lf(),Js.exports}var $f=Ff();const Ed=dr($f);var zd={exports:{}},Ba={};/**
|
|
40
|
+
`+r.stack}}var $e=Object.prototype.hasOwnProperty,X=i.unstable_scheduleCallback,Ve=i.unstable_cancelCallback,Ze=i.unstable_shouldYield,q=i.unstable_requestPaint,Ye=i.unstable_now,Fe=i.unstable_getCurrentPriorityLevel,un=i.unstable_ImmediatePriority,st=i.unstable_UserBlockingPriority,Vt=i.unstable_NormalPriority,Pn=i.unstable_LowPriority,No=i.unstable_IdlePriority,wn=i.log,qr=i.unstable_setDisableYieldValue,Ht=null,At=null;function at(e){if(typeof wn=="function"&&qr(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Ht,e)}catch{}}var ft=Math.clz32?Math.clz32:Xr,Qe=Math.log,dn=Math.LN2;function Xr(e){return e>>>=0,e===0?32:31-(Qe(e)/dn|0)|0}var fn=256,me=262144,hn=4194304;function kn(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 xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?o=kn(r):(s&=u,s!==0?o=kn(s):n||(n=u&~e,n!==0&&(o=kn(n))))):(u=r&~a,u!==0?o=kn(u):s!==0?o=kn(s):n||(n=r&~e,n!==0&&(o=kn(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 nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qt(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 Ro(){var e=hn;return hn<<=1,(hn&62914560)===0&&(hn=4194304),e}function Gn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lr(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 s=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=s&~n;0<n;){var N=31-ft(n),O=1<<N;u[N]=0,h[N]=-1;var S=k[N];if(S!==null)for(k[N]=null,N=0;N<S.length;N++){var z=S[N];z!==null&&(z.lane&=-536870913)}n&=~O}r!==0&&Gr(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(s&~t))}function Gr(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 $i(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 Lo(e,t){var n=t&-t;return n=(n&42)!==0?1:Zn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Zn(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 gn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function na(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:zf(e.type))}function Zr(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var In=Math.random().toString(36).slice(2),St="__reactFiber$"+In,Wt="__reactProps$"+In,ur="__reactContainer$"+In,ra="__reactEvents$"+In,Wi="__reactListeners$"+In,oa="__reactHandles$"+In,aa="__reactResources$"+In,kr="__reactMarker$"+In;function Va(e){delete e[St],delete e[Wt],delete e[ra],delete e[Wi],delete e[oa]}function dr(e){var t=e[St];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ur]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cf(e);e!==null;){if(n=e[St])return n;e=cf(e)}return t}e=n,n=e.parentNode}return null}function Jr(e){if(e=e[St]||e[ur]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Tt(e){var t=e[aa];return t||(t=e[aa]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[kr]=!0}var Xt=new Set,ia={};function cr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(ia[e]=t,e=0;e<t.length;e++)Xt.add(t[e])}var Yr=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]*$"),Fo={},Bi={};function Ha(e){return $e.call(Bi,e)?!0:$e.call(Fo,e)?!1:Yr.test(e)?Bi[e]=!0:(Fo[e]=!0,!1)}function _n(e,t,n){if(Ha(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 Jn(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 Yn(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 Ka(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(s){n=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=Ka(e)?"checked":"value";e._valueTracker=pn(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 pr(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 Qa=/[\n"\\]/g;function Gt(e){return e.replace(Qa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sa(e,t,n,r,o,a,s,u){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bn(t)):e.value!==""+bn(t)&&(e.value=""+bn(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?la(e,s,bn(t)):n!=null?la(e,s,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 er(e,t,n,r,o,a,s,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)){Sr(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,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Sr(e)}function la(e,t,n){t==="number"&&pr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function eo(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 Ui(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 qa(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Te(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),Sr(e)}function mr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Er=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 tr(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||Er.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Oo(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&&tr(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&tr(e,a,t[a])}function to(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 Zt=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"]]),Vi=/^[\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 ua(e){return Vi.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mn(){}var Cr=null;function no(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zr=null,qe=null;function Xa(e){var t=Jr(e);if(t&&(e=t.stateNode)){var n=e[Wt]||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="'+Gt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[Wt]||null;if(!o)throw Error(c(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&&eo(e,!!n.multiple,t,!1)}}}var Ga=!1;function ro(e,t,n){if(Ga)return e(t,n);Ga=!0;try{var r=e(t);return r}finally{if(Ga=!1,(zr!==null||qe!==null)&&(As(),zr&&(t=zr,e=qe,qe=zr=null,Xa(t),e)))for(t=0;t<e.length;t++)Xa(e[t])}}function oo(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Wt]||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 An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mr=!1;if(An)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){Mr=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{Mr=!1}var lt=null,Nt=null,Jt=null;function Hi(){if(Jt)return Jt;var e,t=Nt,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 s=n-e;for(r=1;r<=s&&t[n-r]===o[a-r];r++);return Jt=o.slice(e,1<r?1-r:void 0)}function Yt(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 Et(){return!0}function fr(){return!1}function en(e){function t(n,r,o,a,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=a,this.target=s,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)?Et:fr,this.isPropagationStopped=fr,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=Et)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Et)},persist:function(){},isPersistent:Et}),t}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yn=en(Tr),hr=E({},Tr,{view:0,detail:0}),Ki=en(hr),da,gr,Pr,io=E({},hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ti,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!==Pr&&(Pr&&e.type==="mousemove"?(da=e.screenX-Pr.screenX,gr=e.screenY-Pr.screenY):gr=da=0,Pr=e),da)},movementY:function(e){return"movementY"in e?e.movementY:gr}}),br=en(io),Qi=E({},io,{dataTransfer:0}),qi=en(Qi),Za=E({},hr,{relatedTarget:0}),Ja=en(Za),gl=E({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),Xi=en(gl),bl=E({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yl=en(bl),Gi=E({},Tr,{data:0}),Ya=en(Gi),ei={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vl={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"},xl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wl(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xl[e])?!!t[e]:!1}function ti(){return wl}var kl=E({},hr,{key:function(e){if(e.key){var t=ei[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yt(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ti,charCode:function(e){return e.type==="keypress"?Yt(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yt(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),p=en(kl),A=E({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j=en(A),D=E({},hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ti}),J=en(D),pe=E({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),et=en(pe),Ct=E({},io,{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}),Rt=en(Ct),De=E({},Tr,{newState:0,oldState:0}),We=en(De),wt=[9,13,27,32],Dt=An&&"CompositionEvent"in window,_t=null;An&&"documentMode"in document&&(_t=document.documentMode);var tn=An&&"TextEvent"in window&&!_t,nr=An&&(!Dt||_t&&8<_t&&11>=_t),jn=" ",Ee=!1;function Be(e,t){switch(e){case"keyup":return wt.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bt(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tt=!1;function Nn(e,t){switch(e){case"compositionend":return bt(t);case"keypress":return t.which!==32?null:(Ee=!0,jn);case"textInput":return e=t.data,e===jn&&Ee?null:e;default:return null}}function Kt(e,t){if(tt)return e==="compositionend"||!Dt&&Be(e,t)?(e=Hi(),Jt=Nt=lt=null,tt=!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 nr&&t.locale!=="ko"?null:t.data;default:return null}}var nn={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 ht(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nn[e.type]:t==="textarea"}function ni(e,t,n,r){zr?qe?qe.push(r):qe=[r]:zr=r,t=Os(t,"onChange"),0<t.length&&(n=new yn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ri=null,oi=null;function Eg(e){Gm(e,0)}function Zi(e){var t=cn(e);if(yt(t))return e}function hc(e,t){if(e==="change")return t}var gc=!1;if(An){var _l;if(An){var Sl="oninput"in document;if(!Sl){var bc=document.createElement("div");bc.setAttribute("oninput","return;"),Sl=typeof bc.oninput=="function"}_l=Sl}else _l=!1;gc=_l&&(!document.documentMode||9<document.documentMode)}function yc(){ri&&(ri.detachEvent("onpropertychange",vc),oi=ri=null)}function vc(e){if(e.propertyName==="value"&&Zi(oi)){var t=[];ni(t,oi,e,no(e)),ro(Eg,t)}}function Cg(e,t,n){e==="focusin"?(yc(),ri=t,oi=n,ri.attachEvent("onpropertychange",vc)):e==="focusout"&&yc()}function zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zi(oi)}function Mg(e,t){if(e==="click")return Zi(t)}function Tg(e,t){if(e==="input"||e==="change")return Zi(t)}function Pg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rn=typeof Object.is=="function"?Object.is:Pg;function ai(e,t){if(Rn(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(!$e.call(t,o)||!Rn(e[o],t[o]))return!1}return!0}function xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wc(e,t){var n=xc(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=xc(n)}}function kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _c(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pr(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=pr(e.document)}return t}function El(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 Ig=An&&"documentMode"in document&&11>=document.documentMode,ca=null,Cl=null,ii=null,zl=!1;function Sc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zl||ca==null||ca!==pr(r)||(r=ca,"selectionStart"in r&&El(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}),ii&&ai(ii,r)||(ii=r,r=Os(Cl,"onSelect"),0<r.length&&(t=new yn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ca)))}function $o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pa={animationend:$o("Animation","AnimationEnd"),animationiteration:$o("Animation","AnimationIteration"),animationstart:$o("Animation","AnimationStart"),transitionrun:$o("Transition","TransitionRun"),transitionstart:$o("Transition","TransitionStart"),transitioncancel:$o("Transition","TransitionCancel"),transitionend:$o("Transition","TransitionEnd")},Ml={},Ec={};An&&(Ec=document.createElement("div").style,"AnimationEvent"in window||(delete pa.animationend.animation,delete pa.animationiteration.animation,delete pa.animationstart.animation),"TransitionEvent"in window||delete pa.transitionend.transition);function Wo(e){if(Ml[e])return Ml[e];if(!pa[e])return e;var t=pa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ec)return Ml[e]=t[n];return e}var Cc=Wo("animationend"),zc=Wo("animationiteration"),Mc=Wo("animationstart"),Ag=Wo("transitionrun"),jg=Wo("transitionstart"),Ng=Wo("transitioncancel"),Tc=Wo("transitionend"),Pc=new Map,Tl="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(" ");Tl.push("scrollEnd");function rr(e,t){Pc.set(e,t),cr(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)},Bn=[],ma=0,Pl=0;function Yi(){for(var e=ma,t=Pl=ma=0;t<e;){var n=Bn[t];Bn[t++]=null;var r=Bn[t];Bn[t++]=null;var o=Bn[t];Bn[t++]=null;var a=Bn[t];if(Bn[t++]=null,r!==null&&o!==null){var s=r.pending;s===null?o.next=o:(o.next=s.next,s.next=o),r.pending=o}a!==0&&Ic(n,o,a)}}function es(e,t,n,r){Bn[ma++]=e,Bn[ma++]=t,Bn[ma++]=n,Bn[ma++]=r,Pl|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Il(e,t,n,r){return es(e,t,n,r),ts(e)}function Bo(e,t){return es(e,null,null,t),ts(e)}function Ic(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 ts(e){if(50<Mi)throw Mi=0,$u=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fa={};function Rg(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 Rg(e,t,n,r)}function Al(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ir(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 Ac(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 ns(e,t,n,r,o,a){var s=0;if(r=e,typeof e=="function")Al(e)&&(s=1);else if(typeof e=="string")s=$0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Dn(31,n,t,o),e.elementType=le,e.lanes=a,e;case B:return Uo(n.children,o,a,t);case H:s=8,o|=24;break;case ee:return e=Dn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ie:return e=Dn(13,n,t,o),e.elementType=ie,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:s=10;break e;case te:s=9;break e;case ne:s=11;break e;case $:s=14;break e;case fe:s=16,r=null;break e}s=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Dn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Uo(e,t,n,r){return e=Dn(7,e,r,t),e.lanes=n,e}function jl(e,t,n){return e=Dn(6,e,null,t),e.lanes=n,e}function jc(e){var t=Dn(18,null,null,0);return t.stateNode=e,t}function Nl(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 Nc=new WeakMap;function Un(e,t){if(typeof e=="object"&&e!==null){var n=Nc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Z(t)},Nc.set(e,t),t)}return{value:e,source:t,stack:Z(t)}}var ha=[],ga=0,rs=null,si=0,Vn=[],Hn=0,so=null,yr=1,vr="";function Ar(e,t){ha[ga++]=si,ha[ga++]=rs,rs=e,si=t}function Rc(e,t,n){Vn[Hn++]=yr,Vn[Hn++]=vr,Vn[Hn++]=so,so=e;var r=yr;e=vr;var o=32-ft(r)-1;r&=~(1<<o),n+=1;var a=32-ft(t)+o;if(30<a){var s=o-o%5;a=(r&(1<<s)-1).toString(32),r>>=s,o-=s,yr=1<<32-ft(t)+o|n<<o|r,vr=a+e}else yr=1<<a|n<<o|r,vr=e}function Rl(e){e.return!==null&&(Ar(e,1),Rc(e,1,0))}function Dl(e){for(;e===rs;)rs=ha[--ga],ha[ga]=null,si=ha[--ga],ha[ga]=null;for(;e===so;)so=Vn[--Hn],Vn[Hn]=null,vr=Vn[--Hn],Vn[Hn]=null,yr=Vn[--Hn],Vn[Hn]=null}function Dc(e,t){Vn[Hn++]=yr,Vn[Hn++]=vr,Vn[Hn++]=so,yr=t.id,vr=t.overflow,so=e}var rn=null,vt=null,Je=!1,lo=null,Kn=!1,Ll=Error(c(519));function uo(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw li(Un(t,e)),Ll}function Lc(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Wt]=r,n){case"dialog":Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":case"embed":Ke("load",t);break;case"video":case"audio":for(n=0;n<Pi.length;n++)Ke(Pi[n],t);break;case"source":Ke("error",t);break;case"img":case"image":case"link":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"input":Ke("invalid",t),er(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ke("invalid",t);break;case"textarea":Ke("invalid",t),qa(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||ef(t.textContent,n)?(r.popover!=null&&(Ke("beforetoggle",t),Ke("toggle",t)),r.onScroll!=null&&Ke("scroll",t),r.onScrollEnd!=null&&Ke("scrollend",t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||uo(e,!0)}function Fc(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:rn=rn.return}}function ba(e){if(e!==rn)return!1;if(!Je)return Fc(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")||td(e.type,e.memoizedProps)),n=!n),n&&vt&&uo(e),Fc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=df(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=df(e)}else t===27?(t=vt,So(e.type)?(e=id,id=null,vt=e):vt=t):vt=rn?Qn(e.stateNode.nextSibling):null;return!0}function Vo(){vt=rn=null,Je=!1}function Fl(){var e=lo;return e!==null&&(zn===null?zn=e:zn.push.apply(zn,e),lo=null),e}function li(e){lo===null?lo=[e]:lo.push(e)}var Ol=f(null),Ho=null,jr=null;function co(e,t,n){G(Ol,t._currentValue),t._currentValue=n}function Nr(e){e._currentValue=Ol.current,T(Ol)}function $l(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 Wl(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){var s=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),$l(a.return,n,e),r||(s=null);break e}a=u.next}}else if(o.tag===18){if(s=o.return,s===null)throw Error(c(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),$l(s,n,e),s=null}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}function ya(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 s=o.alternate;if(s===null)throw Error(c(387));if(s=s.memoizedProps,s!==null){var u=o.type;Rn(o.pendingProps.value,s.value)||(e!==null?e.push(u):e=[u])}}else if(o===ze.current){if(s=o.alternate,s===null)throw Error(c(387));s.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ri):e=[Ri])}o=o.return}e!==null&&Wl(t,e,n,r),t.flags|=262144}function os(e){for(e=e.firstContext;e!==null;){if(!Rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ko(e){Ho=e,jr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Oc(Ho,e)}function as(e,t){return Ho===null&&Ko(e),Oc(e,t)}function Oc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},jr===null){if(e===null)throw Error(c(308));jr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else jr=jr.next=t;return n}var Dg=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()})}},Lg=i.unstable_scheduleCallback,Fg=i.unstable_NormalPriority,Lt={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bl(){return{controller:new Dg,data:new Map,refCount:0}}function ui(e){e.refCount--,e.refCount===0&&Lg(Fg,function(){e.controller.abort()})}var di=null,Ul=0,va=0,xa=null;function Og(e,t){if(di===null){var n=di=[];Ul=0,va=Ku(),xa={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Ul++,t.then($c,$c),t}function $c(){if(--Ul===0&&di!==null){xa!==null&&(xa.status="fulfilled");var e=di;di=null,va=0,xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $g(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 Wc=C.S;C.S=function(e,t){Sm=Ye(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Og(e,t),Wc!==null&&Wc(e,t)};var Qo=f(null);function Vl(){var e=Qo.current;return e!==null?e:gt.pooledCache}function is(e,t){t===null?G(Qo,Qo.current):G(Qo,t.pool)}function Bc(){var e=Vl();return e===null?null:{parent:Lt._currentValue,pool:e}}var wa=Error(c(460)),Hl=Error(c(474)),ss=Error(c(542)),ls={then:function(){}};function Uc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vc(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kc(e),e;default:if(typeof t.status=="string")t.then(mn,mn);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,Kc(e),e}throw Xo=t,wa}}function qo(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Xo=n,wa):n}}var Xo=null;function Hc(){if(Xo===null)throw Error(c(459));var e=Xo;return Xo=null,e}function Kc(e){if(e===wa||e===ss)throw Error(c(483))}var ka=null,ci=0;function us(e){var t=ci;return ci+=1,ka===null&&(ka=[]),Vc(ka,e,t)}function pi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ds(e,t){throw t.$$typeof===W?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(e){function t(y,g){if(e){var w=y.deletions;w===null?(y.deletions=[g],y.flags|=16):w.push(g)}}function n(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function r(y){for(var g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function o(y,g){return y=Ir(y,g),y.index=0,y.sibling=null,y}function a(y,g,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<g?(y.flags|=67108866,g):w):(y.flags|=67108866,g)):(y.flags|=1048576,g)}function s(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function u(y,g,w,L){return g===null||g.tag!==6?(g=jl(w,y.mode,L),g.return=y,g):(g=o(g,w),g.return=y,g)}function h(y,g,w,L){var we=w.type;return we===B?N(y,g,w.props.children,L,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&qo(we)===g.type)?(g=o(g,w.props),pi(g,w),g.return=y,g):(g=ns(w.type,w.key,w.props,null,y.mode,L),pi(g,w),g.return=y,g)}function k(y,g,w,L){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=Nl(w,y.mode,L),g.return=y,g):(g=o(g,w.children||[]),g.return=y,g)}function N(y,g,w,L,we){return g===null||g.tag!==7?(g=Uo(w,y.mode,L,we),g.return=y,g):(g=o(g,w),g.return=y,g)}function O(y,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=jl(""+g,y.mode,w),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case I:return w=ns(g.type,g.key,g.props,null,y.mode,w),pi(w,g),w.return=y,w;case M:return g=Nl(g,y.mode,w),g.return=y,g;case fe:return g=qo(g),O(y,g,w)}if(Te(g)||oe(g))return g=Uo(g,y.mode,w,null),g.return=y,g;if(typeof g.then=="function")return O(y,us(g),w);if(g.$$typeof===re)return O(y,as(y,g),w);ds(y,g)}return null}function S(y,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(y,g,""+w,L);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case I:return w.key===we?h(y,g,w,L):null;case M:return w.key===we?k(y,g,w,L):null;case fe:return w=qo(w),S(y,g,w,L)}if(Te(w)||oe(w))return we!==null?null:N(y,g,w,L,null);if(typeof w.then=="function")return S(y,g,us(w),L);if(w.$$typeof===re)return S(y,g,as(y,w),L);ds(y,w)}return null}function z(y,g,w,L,we){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return y=y.get(w)||null,u(g,y,""+L,we);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case I:return y=y.get(L.key===null?w:L.key)||null,h(g,y,L,we);case M:return y=y.get(L.key===null?w:L.key)||null,k(g,y,L,we);case fe:return L=qo(L),z(y,g,w,L,we)}if(Te(L)||oe(L))return y=y.get(w)||null,N(g,y,L,we,null);if(typeof L.then=="function")return z(y,g,w,us(L),we);if(L.$$typeof===re)return z(y,g,w,as(g,L),we);ds(g,L)}return null}function de(y,g,w,L){for(var we=null,rt=null,ge=g,je=g=0,Ge=null;ge!==null&&je<w.length;je++){ge.index>je?(Ge=ge,ge=null):Ge=ge.sibling;var ot=S(y,ge,w[je],L);if(ot===null){ge===null&&(ge=Ge);break}e&&ge&&ot.alternate===null&&t(y,ge),g=a(ot,g,je),rt===null?we=ot:rt.sibling=ot,rt=ot,ge=Ge}if(je===w.length)return n(y,ge),Je&&Ar(y,je),we;if(ge===null){for(;je<w.length;je++)ge=O(y,w[je],L),ge!==null&&(g=a(ge,g,je),rt===null?we=ge:rt.sibling=ge,rt=ge);return Je&&Ar(y,je),we}for(ge=r(ge);je<w.length;je++)Ge=z(ge,y,je,w[je],L),Ge!==null&&(e&&Ge.alternate!==null&&ge.delete(Ge.key===null?je:Ge.key),g=a(Ge,g,je),rt===null?we=Ge:rt.sibling=Ge,rt=Ge);return e&&ge.forEach(function(To){return t(y,To)}),Je&&Ar(y,je),we}function Se(y,g,w,L){if(w==null)throw Error(c(151));for(var we=null,rt=null,ge=g,je=g=0,Ge=null,ot=w.next();ge!==null&&!ot.done;je++,ot=w.next()){ge.index>je?(Ge=ge,ge=null):Ge=ge.sibling;var To=S(y,ge,ot.value,L);if(To===null){ge===null&&(ge=Ge);break}e&&ge&&To.alternate===null&&t(y,ge),g=a(To,g,je),rt===null?we=To:rt.sibling=To,rt=To,ge=Ge}if(ot.done)return n(y,ge),Je&&Ar(y,je),we;if(ge===null){for(;!ot.done;je++,ot=w.next())ot=O(y,ot.value,L),ot!==null&&(g=a(ot,g,je),rt===null?we=ot:rt.sibling=ot,rt=ot);return Je&&Ar(y,je),we}for(ge=r(ge);!ot.done;je++,ot=w.next())ot=z(ge,y,je,ot.value,L),ot!==null&&(e&&ot.alternate!==null&&ge.delete(ot.key===null?je:ot.key),g=a(ot,g,je),rt===null?we=ot:rt.sibling=ot,rt=ot);return e&&ge.forEach(function(Z0){return t(y,Z0)}),Je&&Ar(y,je),we}function mt(y,g,w,L){if(typeof w=="object"&&w!==null&&w.type===B&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case I:e:{for(var we=w.key;g!==null;){if(g.key===we){if(we=w.type,we===B){if(g.tag===7){n(y,g.sibling),L=o(g,w.props.children),L.return=y,y=L;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&qo(we)===g.type){n(y,g.sibling),L=o(g,w.props),pi(L,w),L.return=y,y=L;break e}n(y,g);break}else t(y,g);g=g.sibling}w.type===B?(L=Uo(w.props.children,y.mode,L,w.key),L.return=y,y=L):(L=ns(w.type,w.key,w.props,null,y.mode,L),pi(L,w),L.return=y,y=L)}return s(y);case M: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(y,g.sibling),L=o(g,w.children||[]),L.return=y,y=L;break e}else{n(y,g);break}else t(y,g);g=g.sibling}L=Nl(w,y.mode,L),L.return=y,y=L}return s(y);case fe:return w=qo(w),mt(y,g,w,L)}if(Te(w))return de(y,g,w,L);if(oe(w)){if(we=oe(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Se(y,g,w,L)}if(typeof w.then=="function")return mt(y,g,us(w),L);if(w.$$typeof===re)return mt(y,g,as(y,w),L);ds(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,g!==null&&g.tag===6?(n(y,g.sibling),L=o(g,w),L.return=y,y=L):(n(y,g),L=jl(w,y.mode,L),L.return=y,y=L),s(y)):n(y,g)}return function(y,g,w,L){try{ci=0;var we=mt(y,g,w,L);return ka=null,we}catch(ge){if(ge===wa||ge===ss)throw ge;var rt=Dn(29,ge,null,y.mode);return rt.lanes=L,rt.return=y,rt}finally{}}}var Go=Qc(!0),qc=Qc(!1),po=!1;function Kl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ql(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 mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(it&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=ts(e),Ic(e,null,n),t}return es(e,r,t,n),ts(e)}function mi(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,$i(e,n)}}function ql(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 s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?o=a=s:a=a.next=s,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 Xl=!1;function fi(){if(Xl){var e=xa;if(e!==null)throw e}}function hi(e,t,n,r){Xl=!1;var o=e.updateQueue;po=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var h=u,k=h.next;h.next=null,s===null?a=k:s.next=k,s=h;var N=e.alternate;N!==null&&(N=N.updateQueue,u=N.lastBaseUpdate,u!==s&&(u===null?N.firstBaseUpdate=k:u.next=k,N.lastBaseUpdate=h))}if(a!==null){var O=o.baseState;s=0,N=k=h=null,u=a;do{var S=u.lane&-536870913,z=S!==u.lane;if(z?(Xe&S)===S:(r&S)===S){S!==0&&S===va&&(Xl=!0),N!==null&&(N=N.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var de=e,Se=u;S=t;var mt=n;switch(Se.tag){case 1:if(de=Se.payload,typeof de=="function"){O=de.call(mt,O,S);break e}O=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Se.payload,S=typeof de=="function"?de.call(mt,O,S):de,S==null)break e;O=E({},O,S);break e;case 2:po=!0}}S=u.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=o.callbacks,z===null?o.callbacks=[S]:z.push(S))}else z={lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},N===null?(k=N=z,h=O):N=N.next=z,s|=S;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;z=u,u=z.next,z.next=null,o.lastBaseUpdate=z,o.shared.pending=null}}while(!0);N===null&&(h=O),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=N,a===null&&(o.shared.lanes=0),vo|=s,e.lanes=s,e.memoizedState=O}}function Xc(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Gc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xc(n[e],t)}var _a=f(null),cs=f(0);function Zc(e,t){e=Ur,G(cs,e),G(_a,t),Ur=e|t.baseLanes}function Gl(){G(cs,Ur),G(_a,_a.current)}function Zl(){Ur=cs.current,T(_a),T(cs)}var Ln=f(null),or=null;function ho(e){var t=e.alternate;G(Pt,Pt.current&1),G(Ln,e),or===null&&(t===null||_a.current!==null||t.memoizedState!==null)&&(or=e)}function Jl(e){G(Pt,Pt.current),G(Ln,e),or===null&&(or=e)}function Jc(e){e.tag===22?(G(Pt,Pt.current),G(Ln,e),or===null&&(or=e)):go()}function go(){G(Pt,Pt.current),G(Ln,Ln.current)}function Fn(e){T(Ln),or===e&&(or=null),T(Pt)}var Pt=f(0);function ps(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||od(n)||ad(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 Rr=0,Pe=null,ct=null,Ft=null,ms=!1,Sa=!1,Zo=!1,fs=0,gi=0,Ea=null,Wg=0;function zt(){throw Error(c(321))}function Yl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rn(e[n],t[n]))return!1;return!0}function eu(e,t,n,r,o,a){return Rr=a,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Rp:hu,Zo=!1,a=n(r,o),Zo=!1,Sa&&(a=ep(t,n,r,o)),Yc(e),a}function Yc(e){C.H=vi;var t=ct!==null&&ct.next!==null;if(Rr=0,Ft=ct=Pe=null,ms=!1,gi=0,Ea=null,t)throw Error(c(300));e===null||Ot||(e=e.dependencies,e!==null&&os(e)&&(Ot=!0))}function ep(e,t,n,r){Pe=e;var o=0;do{if(Sa&&(Ea=null),gi=0,Sa=!1,25<=o)throw Error(c(301));if(o+=1,Ft=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=Dp,a=t(n,r)}while(Sa);return a}function Bg(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?bi(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Pe.flags|=1024),t}function tu(){var e=fs!==0;return fs=0,e}function nu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ru(e){if(ms){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ms=!1}Rr=0,Ft=ct=Pe=null,Sa=!1,gi=fs=0,Ea=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?Pe.memoizedState=Ft=e:Ft=Ft.next=e,Ft}function It(){if(ct===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=Ft===null?Pe.memoizedState:Ft.next;if(t!==null)Ft=t,ct=e;else{if(e===null)throw Pe.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},Ft===null?Pe.memoizedState=Ft=e:Ft=Ft.next=e}return Ft}function hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bi(e){var t=gi;return gi+=1,Ea===null&&(Ea=[]),e=Vc(Ea,e,t),t=Pe,(Ft===null?t.memoizedState:Ft.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Rp:hu),e}function gs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return bi(e);if(e.$$typeof===re)return on(e)}throw Error(c(438,String(e)))}function ou(e){var t=null,n=Pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Pe.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=hs(),Pe.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]=be;return t.index++,n}function Dr(e,t){return typeof t=="function"?t(e):t}function bs(e){var t=It();return au(t,ct,e)}function au(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 s=o.next;o.next=a.next,a.next=s}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,o===null)e.memoizedState=a;else{t=o.next;var u=s=null,h=null,k=t,N=!1;do{var O=k.lane&-536870913;if(O!==k.lane?(Xe&O)===O:(Rr&O)===O){var S=k.revertLane;if(S===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),O===va&&(N=!0);else if((Rr&S)===S){k=k.next,S===va&&(N=!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,s=a):h=h.next=O,Pe.lanes|=S,vo|=S;O=k.action,Zo&&n(a,O),a=k.hasEagerState?k.eagerState:n(a,O)}else S={lane:O,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=S,s=a):h=h.next=S,Pe.lanes|=O,vo|=O;k=k.next}while(k!==null&&k!==t);if(h===null?s=a:h.next=u,!Rn(a,e.memoizedState)&&(Ot=!0,N&&(n=xa,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=h,r.lastRenderedState=a}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function iu(e){var t=It(),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 s=o=o.next;do a=e(a,s.action),s=s.next;while(s!==o);Rn(a,t.memoizedState)||(Ot=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function tp(e,t,n){var r=Pe,o=It(),a=Je;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var s=!Rn((ct||o).memoizedState,n);if(s&&(o.memoizedState=n,Ot=!0),o=o.queue,uu(op.bind(null,r,o,e),[e]),o.getSnapshot!==t||s||Ft!==null&&Ft.memoizedState.tag&1){if(r.flags|=2048,Ca(9,{destroy:void 0},rp.bind(null,r,o,n,t),null),gt===null)throw Error(c(349));a||(Rr&127)!==0||np(r,t,n)}return n}function np(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t=hs(),Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function rp(e,t,n,r){t.value=n,t.getSnapshot=r,ap(t)&&ip(e)}function op(e,t,n){return n(function(){ap(t)&&ip(e)})}function ap(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rn(e,n)}catch{return!0}}function ip(e){var t=Bo(e,2);t!==null&&Mn(t,e,2)}function su(e){var t=vn();if(typeof e=="function"){var n=e;if(e=n(),Zo){at(!0);try{n()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},t}function sp(e,t,n,r){return e.baseState=n,au(e,ct,typeof r=="function"?r:Dr)}function Ug(e,t,n,r,o){if(xs(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(s){a.listeners.push(s)}};C.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,lp(t,a)):(a.next=n.next,t.pending=n.next=a)}}function lp(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=C.T,s={};C.T=s;try{var u=n(o,r),h=C.S;h!==null&&h(s,u),up(e,t,u)}catch(k){lu(e,t,k)}finally{a!==null&&s.types!==null&&(a.types=s.types),C.T=a}}else try{a=n(o,r),up(e,t,a)}catch(k){lu(e,t,k)}}function up(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){dp(e,t,r)},function(r){return lu(e,t,r)}):dp(e,t,n)}function dp(e,t,n){t.status="fulfilled",t.value=n,cp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,lp(e,n)))}function lu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,cp(t),t=t.next;while(t!==r)}e.action=null}function cp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pp(e,t){return t}function mp(e,t){if(Je){var n=gt.formState;if(n!==null){e:{var r=Pe;if(Je){if(vt){t:{for(var o=vt,a=Kn;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){vt=Qn(o.nextSibling),r=o.data==="F!";break e}}uo(r)}r=!1}r&&(t=n[0])}}return n=vn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pp,lastRenderedState:t},n.queue=r,n=Ap.bind(null,Pe,r),r.dispatch=n,r=su(!1),a=fu.bind(null,Pe,!1,r.queue),r=vn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=Ug.bind(null,Pe,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function fp(e){var t=It();return hp(t,ct,e)}function hp(e,t,n){if(t=au(e,t,pp)[0],e=bs(Dr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=bi(t)}catch(s){throw s===wa?ss:s}else r=t;t=It();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Pe.flags|=2048,Ca(9,{destroy:void 0},Vg.bind(null,o,n),null)),[r,a,e]}function Vg(e,t){e.action=t}function gp(e){var t=It(),n=ct;if(n!==null)return hp(t,n,e);It(),t=t.memoizedState,n=It();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ca(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=hs(),Pe.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 bp(){return It().memoizedState}function ys(e,t,n,r){var o=vn();Pe.flags|=e,o.memoizedState=Ca(1|t,{destroy:void 0},n,r===void 0?null:r)}function vs(e,t,n,r){var o=It();r=r===void 0?null:r;var a=o.memoizedState.inst;ct!==null&&r!==null&&Yl(r,ct.memoizedState.deps)?o.memoizedState=Ca(t,a,n,r):(Pe.flags|=e,o.memoizedState=Ca(1|t,a,n,r))}function yp(e,t){ys(8390656,8,e,t)}function uu(e,t){vs(2048,8,e,t)}function Hg(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=hs(),Pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vp(e){var t=It().memoizedState;return Hg({ref:t,nextImpl:e}),function(){if((it&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function xp(e,t){return vs(4,2,e,t)}function wp(e,t){return vs(4,4,e,t)}function kp(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 _p(e,t,n){n=n!=null?n.concat([e]):null,vs(4,4,kp.bind(null,t,e),n)}function du(){}function Sp(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ep(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yl(t,r[1]))return r[0];if(r=e(),Zo){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r}function cu(e,t,n){return n===void 0||(Rr&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Cm(),Pe.lanes|=e,vo|=e,n)}function Cp(e,t,n,r){return Rn(n,t)?n:_a.current!==null?(e=cu(e,n,r),Rn(e,t)||(Ot=!0),e):(Rr&42)===0||(Rr&1073741824)!==0&&(Xe&261930)===0?(Ot=!0,e.memoizedState=n):(e=Cm(),Pe.lanes|=e,vo|=e,t)}function zp(e,t,n,r,o){var a=V.p;V.p=a!==0&&8>a?a:8;var s=C.T,u={};C.T=u,fu(e,!1,t,n);try{var h=o(),k=C.S;if(k!==null&&k(u,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var N=$g(h,r);yi(e,t,N,Wn(e))}else yi(e,t,r,Wn(e))}catch(O){yi(e,t,{then:function(){},status:"rejected",reason:O},Wn())}finally{V.p=a,s!==null&&u.types!==null&&(s.types=u.types),C.T=s}}function Kg(){}function pu(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=Mp(e).queue;zp(e,o,t,se,n===null?Kg:function(){return Tp(e),n(r)})}function Mp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:se},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 Tp(e){var t=Mp(e);t.next===null&&(t=e.alternate.memoizedState),yi(e,t.next.queue,{},Wn())}function mu(){return on(Ri)}function Pp(){return It().memoizedState}function Ip(){return It().memoizedState}function Qg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Wn();e=mo(n);var r=fo(t,e,n);r!==null&&(Mn(r,t,n),mi(r,t,n)),t={cache:Bl()},e.payload=t;return}t=t.return}}function qg(e,t,n){var r=Wn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},xs(e)?jp(t,n):(n=Il(e,t,n,r),n!==null&&(Mn(n,e,r),Np(n,t,r)))}function Ap(e,t,n){var r=Wn();yi(e,t,n,r)}function yi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(xs(e))jp(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,u=a(s,n);if(o.hasEagerState=!0,o.eagerState=u,Rn(u,s))return es(e,t,o,0),gt===null&&Yi(),!1}catch{}finally{}if(n=Il(e,t,o,r),n!==null)return Mn(n,e,r),Np(n,t,r),!0}return!1}function fu(e,t,n,r){if(r={lane:2,revertLane:Ku(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},xs(e)){if(t)throw Error(c(479))}else t=Il(e,n,r,2),t!==null&&Mn(t,e,2)}function xs(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function jp(e,t){Sa=ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Np(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}var vi={readContext:on,use:gs,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};vi.useEffectEvent=zt;var Rp={readContext:on,use:gs,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:yp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ys(4194308,4,kp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ys(4194308,4,e,t)},useInsertionEffect:function(e,t){ys(4,2,e,t)},useMemo:function(e,t){var n=vn();t=t===void 0?null:t;var r=e();if(Zo){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=vn();if(n!==void 0){var o=n(t);if(Zo){at(!0);try{n(t)}finally{at(!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=qg.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:function(e){e=su(e);var t=e.queue,n=Ap.bind(null,Pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:du,useDeferredValue:function(e,t){var n=vn();return cu(n,e,t)},useTransition:function(){var e=su(!1);return e=zp.bind(null,Pe,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Pe,o=vn();if(Je){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),gt===null)throw Error(c(349));(Xe&127)!==0||np(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,yp(op.bind(null,r,a,e),[e]),r.flags|=2048,Ca(9,{destroy:void 0},rp.bind(null,r,a,n,t),null),n},useId:function(){var e=vn(),t=gt.identifierPrefix;if(Je){var n=vr,r=yr;n=(r&~(1<<32-ft(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=fs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Wg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:mu,useFormState:mp,useActionState:mp,useOptimistic:function(e){var t=vn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fu.bind(null,Pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:ou,useCacheRefresh:function(){return vn().memoizedState=Qg.bind(null,Pe)},useEffectEvent:function(e){var t=vn(),n={impl:e};return t.memoizedState=n,function(){if((it&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},hu={readContext:on,use:gs,useCallback:Sp,useContext:on,useEffect:uu,useImperativeHandle:_p,useInsertionEffect:xp,useLayoutEffect:wp,useMemo:Ep,useReducer:bs,useRef:bp,useState:function(){return bs(Dr)},useDebugValue:du,useDeferredValue:function(e,t){var n=It();return Cp(n,ct.memoizedState,e,t)},useTransition:function(){var e=bs(Dr)[0],t=It().memoizedState;return[typeof e=="boolean"?e:bi(e),t]},useSyncExternalStore:tp,useId:Pp,useHostTransitionStatus:mu,useFormState:fp,useActionState:fp,useOptimistic:function(e,t){var n=It();return sp(n,ct,e,t)},useMemoCache:ou,useCacheRefresh:Ip};hu.useEffectEvent=vp;var Dp={readContext:on,use:gs,useCallback:Sp,useContext:on,useEffect:uu,useImperativeHandle:_p,useInsertionEffect:xp,useLayoutEffect:wp,useMemo:Ep,useReducer:iu,useRef:bp,useState:function(){return iu(Dr)},useDebugValue:du,useDeferredValue:function(e,t){var n=It();return ct===null?cu(n,e,t):Cp(n,ct.memoizedState,e,t)},useTransition:function(){var e=iu(Dr)[0],t=It().memoizedState;return[typeof e=="boolean"?e:bi(e),t]},useSyncExternalStore:tp,useId:Pp,useHostTransitionStatus:mu,useFormState:gp,useActionState:gp,useOptimistic:function(e,t){var n=It();return ct!==null?sp(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ou,useCacheRefresh:Ip};Dp.useEffectEvent=vp;function gu(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 bu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=mo(r);o.payload=t,n!=null&&(o.callback=n),t=fo(e,o,r),t!==null&&(Mn(t,e,r),mi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=mo(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=fo(e,o,r),t!==null&&(Mn(t,e,r),mi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wn(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=fo(e,r,n),t!==null&&(Mn(t,e,n),mi(t,e,n))}};function Lp(e,t,n,r,o,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!ai(n,r)||!ai(o,a):!0}function Fp(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&&bu.enqueueReplaceState(t,t.state,null)}function Jo(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 Op(e){Ji(e)}function $p(e){console.error(e)}function Wp(e){Ji(e)}function ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Bp(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 yu(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){ws(e,t)},n}function Up(e){return e=mo(e),e.tag=3,e}function Vp(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(){Bp(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Bp(t,n,r),typeof o!="function"&&(xo===null?xo=new Set([this]):xo.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Xg(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&ya(t,n,o,!0),n=Ln.current,n!==null){switch(n.tag){case 31:case 13:return or===null?js():n.alternate===null&&Mt===0&&(Mt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===ls?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Uu(e,r,o)),!1;case 22:return n.flags|=65536,r===ls?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)),Uu(e,r,o)),!1}throw Error(c(435,n.tag))}return Uu(e,r,o),js(),!1}if(Je)return t=Ln.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Ll&&(e=Error(c(422),{cause:r}),li(Un(e,n)))):(r!==Ll&&(t=Error(c(423),{cause:r}),li(Un(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Un(r,n),o=yu(e.stateNode,r,o),ql(e,o),Mt!==4&&(Mt=2)),!1;var a=Error(c(520),{cause:r});if(a=Un(a,n),zi===null?zi=[a]:zi.push(a),Mt!==4&&(Mt=2),t===null)return!0;r=Un(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=yu(n.stateNode,r,e),ql(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"&&(xo===null||!xo.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Up(o),Vp(o,e,n,r),ql(n,o),!1}n=n.return}while(n!==null);return!1}var vu=Error(c(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?qc(t,null,n,r):Go(t,e.child,n,r)}function Hp(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var s={};for(var u in r)u!=="ref"&&(s[u]=r[u])}else s=r;return Ko(t),r=eu(e,t,n,s,a,o),u=tu(),e!==null&&!Ot?(nu(e,t,o),Lr(e,t,o)):(Je&&u&&Rl(t),t.flags|=1,an(e,t,r,o),t.child)}function Kp(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Al(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Qp(e,t,a,r,o)):(e=ns(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!zu(e,o)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(s,r)&&e.ref===t.ref)return Lr(e,t,o)}return t.flags|=1,e=Ir(a,r),e.ref=t.ref,e.return=t,t.child=e}function Qp(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(ai(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,zu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,Lr(e,t,o)}return xu(e,t,n,r,o)}function qp(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 Xp(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&is(t,a!==null?a.cachePool:null),a!==null?Zc(t,a):Gl(),Jc(t);else return r=t.lanes=536870912,Xp(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(is(t,a.cachePool),Zc(t,a),go(),t.memoizedState=null):(e!==null&&is(t,null),Gl(),go());return an(e,t,o,n),t.child}function xi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xp(e,t,n,r,o){var a=Vl();return a=a===null?null:{parent:Lt._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&is(t,null),Gl(),Jc(t),e!==null&&ya(e,t,r,!0),t.childLanes=o,null}function ks(e,t){return t=Ss({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gp(e,t,n){return Go(t,e.child,null,n),e=ks(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(Je){if(r.mode==="hidden")return e=ks(t,r),t.lanes=536870912,xi(null,e);if(Jl(t),(e=vt)?(e=uf(e,Kn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:so!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw uo(t);return t.lanes=536870912,null}return ks(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Jl(t),o)if(t.flags&256)t.flags&=-257,t=Gp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ot||ya(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=gt,r!==null&&(s=Lo(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Bo(e,s),Mn(r,e,s),vu;js(),t=Gp(e,t,n)}else e=a.treeContext,vt=Qn(s.nextSibling),rn=t,Je=!0,lo=null,Kn=!1,e!==null&&Dc(t,e),t=ks(t,r),t.flags|=4096;return t}return e=Ir(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _s(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 xu(e,t,n,r,o){return Ko(t),n=eu(e,t,n,r,void 0,o),r=tu(),e!==null&&!Ot?(nu(e,t,o),Lr(e,t,o)):(Je&&r&&Rl(t),t.flags|=1,an(e,t,n,o),t.child)}function Zp(e,t,n,r,o,a){return Ko(t),t.updateQueue=null,n=ep(t,r,n,o),Yc(e),r=tu(),e!==null&&!Ot?(nu(e,t,a),Lr(e,t,a)):(Je&&r&&Rl(t),t.flags|=1,an(e,t,n,a),t.child)}function Jp(e,t,n,r,o){if(Ko(t),t.stateNode===null){var a=fa,s=n.contextType;typeof s=="object"&&s!==null&&(a=on(s)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Kl(t),s=n.contextType,a.context=typeof s=="object"&&s!==null?on(s):fa,a.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(gu(t,n,s,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&bu.enqueueReplaceState(a,a.state,null),hi(t,r,a,o),fi(),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=Jo(n,u);a.props=h;var k=a.context,N=n.contextType;s=fa,typeof N=="object"&&N!==null&&(s=on(N));var O=n.getDerivedStateFromProps;N=typeof O=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,N||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==s)&&Fp(t,a,r,s),po=!1;var S=t.memoizedState;a.state=S,hi(t,r,a,o),fi(),k=t.memoizedState,u||S!==k||po?(typeof O=="function"&&(gu(t,n,O,r),k=t.memoizedState),(h=po||Lp(t,n,h,r,S,k,s))?(N||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=s,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ql(e,t),s=t.memoizedProps,N=Jo(n,s),a.props=N,O=t.pendingProps,S=a.context,k=n.contextType,h=fa,typeof k=="object"&&k!==null&&(h=on(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==O||S!==h)&&Fp(t,a,r,h),po=!1,S=t.memoizedState,a.state=S,hi(t,r,a,o),fi();var z=t.memoizedState;s!==O||S!==z||po||e!==null&&e.dependencies!==null&&os(e.dependencies)?(typeof u=="function"&&(gu(t,n,u,r),z=t.memoizedState),(N=po||Lp(t,n,N,r,S,z,h)||e!==null&&e.dependencies!==null&&os(e.dependencies))?(k||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,z,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,z,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),a.props=r,a.state=z,a.context=h,r=N):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,_s(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=Go(t,e.child,null,o),t.child=Go(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=Lr(e,t,o),e}function Yp(e,t,n,r){return Vo(),t.flags|=256,an(e,t,n,r),t.child}var wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ku(e){return{baseLanes:e,cachePool:Bc()}}function _u(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function em(e,t,n){var r=t.pendingProps,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(Pt.current&2)!==0),s&&(o=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(o?ho(t):go(),(e=vt)?(e=uf(e,Kn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:so!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw uo(t);return ad(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(go(),o=t.mode,u=Ss({mode:"hidden",children:u},o),r=Uo(r,o,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,r=t.child,r.memoizedState=ku(n),r.childLanes=_u(e,s,n),t.memoizedState=wu,xi(null,r)):(ho(t),Su(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(ho(t),t.flags&=-257,t=Eu(e,t,n)):t.memoizedState!==null?(go(),t.child=e.child,t.flags|=128,t=null):(go(),u=r.fallback,o=t.mode,r=Ss({mode:"visible",children:r.children},o),u=Uo(u,o,n,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,Go(t,e.child,null,n),r=t.child,r.memoizedState=ku(n),r.childLanes=_u(e,s,n),t.memoizedState=wu,t=xi(null,r));else if(ho(t),ad(u)){if(s=u.nextSibling&&u.nextSibling.dataset,s)var k=s.dgst;s=k,r=Error(c(419)),r.stack="",r.digest=s,li({value:r,source:null,stack:null}),t=Eu(e,t,n)}else if(Ot||ya(e,t,n,!1),s=(n&e.childLanes)!==0,Ot||s){if(s=gt,s!==null&&(r=Lo(s,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Bo(e,r),Mn(s,e,r),vu;od(u)||js(),t=Eu(e,t,n)}else od(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,vt=Qn(u.nextSibling),rn=t,Je=!0,lo=null,Kn=!1,e!==null&&Dc(t,e),t=Su(t,r.children),t.flags|=4096);return t}return o?(go(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=Ir(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=Ir(k,u):(u=Uo(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,xi(null,r),r=t.child,u=e.child.memoizedState,u===null?u=ku(n):(o=u.cachePool,o!==null?(h=Lt._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Bc(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=_u(e,s,n),t.memoizedState=wu,xi(e.child,r)):(ho(t),n=e.child,e=n.sibling,n=Ir(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Su(e,t){return t=Ss({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ss(e,t){return e=Dn(22,e,null,t),e.lanes=0,e}function Eu(e,t,n){return Go(t,e.child,null,n),e=Su(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$l(e.return,t,n)}function Cu(e,t,n,r,o,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o,s.treeForkCount=a)}function nm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var s=Pt.current,u=(s&2)!==0;if(u?(s=s&1|2,t.flags|=128):s&=1,G(Pt,s),an(e,t,r,n),r=Je?si:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tm(e,n,t);else if(e.tag===19)tm(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&&ps(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Cu(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&&ps(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Cu(t,!0,n,null,a,r);break;case"together":Cu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Lr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vo|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ya(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=Ir(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ir(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&os(e)))}function Zg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),co(t,Lt,e.memoizedState.cache),Vo();break;case 27:case 5:Re(t);break;case 4:Le(t,t.stateNode.containerInfo);break;case 10:co(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Jl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(ho(t),t.flags|=128,null):(n&t.child.childLanes)!==0?em(e,t,n):(ho(t),e=Lr(e,t,n),e!==null?e.sibling:null);ho(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(ya(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return nm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Pt,Pt.current),r)break;return null;case 22:return t.lanes=0,qp(e,t,n,t.pendingProps);case 24:co(t,Lt,e.memoizedState.cache)}return Lr(e,t,n)}function rm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!zu(e,n)&&(t.flags&128)===0)return Ot=!1,Zg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Je&&(t.flags&1048576)!==0&&Rc(t,si,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=qo(t.elementType),t.type=e,typeof e=="function")Al(e)?(r=Jo(e,r),t.tag=1,t=Jp(null,t,e,r,n)):(t.tag=0,t=xu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=Hp(null,t,e,r,n);break e}else if(o===$){t.tag=14,t=Kp(null,t,e,r,n);break e}}throw t=ye(e)||e,Error(c(306,t,""))}}return t;case 0:return xu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Jo(r,t.pendingProps),Jp(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Ql(e,t),hi(t,r,null,n);var s=t.memoizedState;if(r=s.cache,co(t,Lt,r),r!==a.cache&&Wl(t,[Lt],n,!0),fi(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Yp(e,t,r,n);break e}else if(r!==o){o=Un(Error(c(424)),t),li(o),t=Yp(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(vt=Qn(e.firstChild),rn=t,Je=!0,lo=null,Kn=!0,n=qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vo(),r===o){t=Lr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return _s(e,t),e===null?(n=hf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(n=t.type,e=t.pendingProps,r=$s(ve.current).createElement(n),r[St]=t,r[Wt]=e,sn(r,n,e),jt(r),t.stateNode=r):t.memoizedState=hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Je&&(r=t.stateNode=pf(t.type,t.pendingProps,ve.current),rn=t,Kn=!0,o=vt,So(t.type)?(id=o,vt=Qn(r.firstChild)):vt=o),an(e,t,t.pendingProps.children,n),_s(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((o=r=vt)&&(r=z0(r,t.type,t.pendingProps,Kn),r!==null?(t.stateNode=r,rn=t,vt=Qn(r.firstChild),Kn=!1,o=!0):o=!1),o||uo(t)),Re(t),o=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,r=a.children,td(o,a)?r=null:s!==null&&td(o,s)&&(t.flags|=32),t.memoizedState!==null&&(o=eu(e,t,Bg,null,null,n),Ri._currentValue=o),_s(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Je&&((e=n=vt)&&(n=M0(n,t.pendingProps,Kn),n!==null?(t.stateNode=n,rn=t,vt=null,e=!0):e=!1),e||uo(t)),null;case 13:return em(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Go(t,null,r,n):an(e,t,r,n),t.child;case 11:return Hp(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,co(t,t.type,r.value),an(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Ko(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Kp(e,t,t.type,t.pendingProps,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 19:return nm(e,t,n);case 31:return Gg(e,t,n);case 22:return qp(e,t,n,t.pendingProps);case 24:return Ko(t),r=on(Lt),e===null?(o=Vl(),o===null&&(o=gt,a=Bl(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Kl(t),co(t,Lt,o)):((e.lanes&n)!==0&&(Ql(e,t),hi(t,null,null,n),fi()),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),co(t,Lt,r)):(r=a.cache,co(t,Lt,r),r!==o.cache&&Wl(t,[Lt],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Fr(e){e.flags|=4}function Mu(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(Pm())e.flags|=8192;else throw Xo=ls,Hl}else e.flags&=-16777217}function om(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xf(t))if(Pm())e.flags|=8192;else throw Xo=ls,Hl}function Es(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ro():536870912,e.lanes|=t,Pa|=t)}function wi(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 Jg(e,t,n){var r=t.pendingProps;switch(Dl(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),Nr(Lt),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ba(t)?Fr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fl())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Fr(t),a!==null?(xt(t),om(t,a)):(xt(t),Mu(t,o,null,r,n))):a?a!==e.memoizedState?(Fr(t),xt(t),om(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Fr(t),xt(t),Mu(t,o,e,r,n)),null;case 27:if(Ue(t),n=ve.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=Y.current,ba(t)?Lc(t):(e=pf(o,r,n),t.stateNode=e,Fr(t))}return xt(t),null;case 5:if(Ue(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(a=Y.current,ba(t))Lc(t);else{var s=$s(ve.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=s.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":a=s.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?s.createElement(o,{is:r.is}):s.createElement(o)}}a[St]=t,a[Wt]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;e:switch(sn(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&&Fr(t)}}return xt(t),Mu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=ve.current,ba(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[St]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||ef(e.nodeValue,n)),e||uo(t,!0)}else e=$s(e).createTextNode(r),e[St]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ba(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[St]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Fl(),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 xt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=ba(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[St]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Fl(),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),Es(t,t.updateQueue),xt(t),null);case 4:return Ne(),e===null&&Gu(t.stateNode.containerInfo),xt(t),null;case 10:return Nr(t.type),xt(t),null;case 19:if(T(Pt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)wi(r,!1);else{if(Mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=ps(e),a!==null){for(t.flags|=128,wi(r,!1),e=a.updateQueue,t.updateQueue=e,Es(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ac(n,e),n=n.sibling;return G(Pt,Pt.current&1|2),Je&&Ar(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ye()>Ps&&(t.flags|=128,o=!0,wi(r,!1),t.lanes=4194304)}else{if(!o)if(e=ps(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Es(t,e),wi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Je)return xt(t),null}else 2*Ye()-r.renderingStartTime>Ps&&n!==536870912&&(t.flags|=128,o=!0,wi(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=Ye(),e.sibling=null,n=Pt.current,G(Pt,o?n&1|2:n&1),Je&&Ar(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Fn(t),Zl(),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&&Es(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&&T(Qo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nr(Lt),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Yg(e,t){switch(Dl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nr(Lt),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ue(t),null;case 31:if(t.memoizedState!==null){if(Fn(t),t.alternate===null)throw Error(c(340));Vo()}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));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return T(Pt),null;case 4:return Ne(),null;case 10:return Nr(t.type),null;case 22:case 23:return Fn(t),Zl(),e!==null&&T(Qo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nr(Lt),null;case 25:return null;default:return null}}function am(e,t){switch(Dl(t),t.tag){case 3:Nr(Lt),Ne();break;case 26:case 27:case 5:Ue(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&Fn(t);break;case 13:Fn(t);break;case 19:T(Pt);break;case 10:Nr(t.type);break;case 22:case 23:Fn(t),Zl(),e!==null&&T(Qo);break;case 24:Nr(Lt)}}function ki(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,s=n.inst;r=a(),s.destroy=r}n=n.next}while(n!==o)}}catch(u){dt(t,t.return,u)}}function bo(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 s=r.inst,u=s.destroy;if(u!==void 0){s.destroy=void 0,o=t;var h=n,k=u;try{k()}catch(N){dt(o,h,N)}}}r=r.next}while(r!==a)}}catch(N){dt(t,t.return,N)}}function im(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Gc(t,n)}catch(r){dt(e,e.return,r)}}}function sm(e,t,n){n.props=Jo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){dt(e,t,r)}}function _i(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){dt(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){dt(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){dt(e,t,o)}else n.current=null}function lm(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){dt(e,e.return,o)}}function Tu(e,t,n){try{var r=e.stateNode;w0(r,e.type,n,t),r[Wt]=t}catch(o){dt(e,e.return,o)}}function um(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&So(e.type)||e.tag===4}function Pu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||um(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&&So(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=mn));else if(r!==4&&(r===27&&So(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 Cs(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&&So(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Cs(e,t,n),e=e.sibling;e!==null;)Cs(e,t,n),e=e.sibling}function dm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);sn(t,r,n),t[St]=e,t[Wt]=n}catch(a){dt(e,e.return,a)}}var Or=!1,$t=!1,Au=!1,cm=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function e0(e,t){if(e=e.containerInfo,Yu=Qs,e=_c(e),El(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 s=0,u=-1,h=-1,k=0,N=0,O=e,S=null;t:for(;;){for(var z;O!==n||o!==0&&O.nodeType!==3||(u=s+o),O!==a||r!==0&&O.nodeType!==3||(h=s+r),O.nodeType===3&&(s+=O.nodeValue.length),(z=O.firstChild)!==null;)S=O,O=z;for(;;){if(O===e)break t;if(S===n&&++k===o&&(u=s),S===a&&++N===r&&(h=s),(z=O.nextSibling)!==null)break;O=S,S=O.parentNode}O=z}n=u===-1||h===-1?null:{start:u,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(ed={focusedElem:e,selectionRange:n},Qs=!1,Qt=t;Qt!==null;)if(t=Qt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qt=e;else for(;Qt!==null;){switch(t=Qt,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 de=Jo(n.type,o);e=r.getSnapshotBeforeUpdate(de,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Se){dt(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rd(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,Qt=e;break}Qt=t.return}}function pm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Wr(e,n),r&4&&ki(5,n);break;case 1:if(Wr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){dt(n,n.return,s)}else{var o=Jo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){dt(n,n.return,s)}}r&64&&im(n),r&512&&_i(n,n.return);break;case 3:if(Wr(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{Gc(e,t)}catch(s){dt(n,n.return,s)}}break;case 27:t===null&&r&4&&dm(n);case 26:case 5:Wr(e,n),t===null&&r&4&&lm(n),r&512&&_i(n,n.return);break;case 12:Wr(e,n);break;case 31:Wr(e,n),r&4&&hm(e,n);break;case 13:Wr(e,n),r&4&&gm(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=u0.bind(null,n),T0(e,n))));break;case 22:if(r=n.memoizedState!==null||Or,!r){t=t!==null&&t.memoizedState!==null||$t,o=Or;var a=$t;Or=r,($t=t)&&!a?Br(e,n,(n.subtreeFlags&8772)!==0):Wr(e,n),Or=o,$t=a}break;case 30:break;default:Wr(e,n)}}function mm(e){var t=e.alternate;t!==null&&(e.alternate=null,mm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Va(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 kt=null,Sn=!1;function $r(e,t,n){for(n=n.child;n!==null;)fm(e,t,n),n=n.sibling}function fm(e,t,n){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Ht,n)}catch{}switch(n.tag){case 26:$t||xr(n,t),$r(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$t||xr(n,t);var r=kt,o=Sn;So(n.type)&&(kt=n.stateNode,Sn=!1),$r(e,t,n),Ai(n.stateNode),kt=r,Sn=o;break;case 5:$t||xr(n,t);case 6:if(r=kt,o=Sn,kt=null,$r(e,t,n),kt=r,Sn=o,kt!==null)if(Sn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(n.stateNode)}catch(a){dt(n,t,a)}else try{kt.removeChild(n.stateNode)}catch(a){dt(n,t,a)}break;case 18:kt!==null&&(Sn?(e=kt,sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Fa(e)):sf(kt,n.stateNode));break;case 4:r=kt,o=Sn,kt=n.stateNode.containerInfo,Sn=!0,$r(e,t,n),kt=r,Sn=o;break;case 0:case 11:case 14:case 15:bo(2,n,t),$t||bo(4,n,t),$r(e,t,n);break;case 1:$t||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&sm(n,t,r)),$r(e,t,n);break;case 21:$r(e,t,n);break;case 22:$t=(r=$t)||n.memoizedState!==null,$r(e,t,n),$t=r;break;default:$r(e,t,n)}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fa(e)}catch(n){dt(t,t.return,n)}}}function gm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fa(e)}catch(n){dt(t,t.return,n)}}function t0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cm),t;default:throw Error(c(435,e.tag))}}function zs(e,t){var n=t0(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=d0.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,s=t,u=s;e:for(;u!==null;){switch(u.tag){case 27:if(So(u.type)){kt=u.stateNode,Sn=!1;break e}break;case 5:kt=u.stateNode,Sn=!1;break e;case 3:case 4:kt=u.stateNode.containerInfo,Sn=!0;break e}u=u.return}if(kt===null)throw Error(c(160));fm(a,s,o),kt=null,Sn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bm(t,e),t=t.sibling}var ar=null;function bm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),Cn(e),r&4&&(bo(3,e,e.return),ki(3,e),bo(5,e,e.return));break;case 1:En(t,e),Cn(e),r&512&&($t||n===null||xr(n,n.return)),r&64&&Or&&(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=ar;if(En(t,e),Cn(e),r&512&&($t||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[St]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),sn(a,r,n),a[St]=e,jt(a),r=a;break e;case"link":var s=yf("link","href",o).get(r+(n.href||""));if(s){for(var u=0;u<s.length;u++)if(a=s[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)){s.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;case"meta":if(s=yf("meta","content",o).get(r+(n.content||""))){for(u=0;u<s.length;u++)if(a=s[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)){s.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[St]=e,jt(a),r=a}e.stateNode=r}else vf(o,e.type,e.stateNode);else e.stateNode=bf(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?vf(o,e.type,e.stateNode):bf(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Tu(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),Cn(e),r&512&&($t||n===null||xr(n,n.return)),n!==null&&r&4&&Tu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),Cn(e),r&512&&($t||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{mr(o,"")}catch(de){dt(e,e.return,de)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Tu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Au=!0);break;case 6:if(En(t,e),Cn(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(de){dt(e,e.return,de)}}break;case 3:if(Us=null,o=ar,ar=Ws(t.containerInfo),En(t,e),ar=o,Cn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fa(t.containerInfo)}catch(de){dt(e,e.return,de)}Au&&(Au=!1,ym(e));break;case 4:r=ar,ar=Ws(e.stateNode.containerInfo),En(t,e),Cn(e),ar=r;break;case 12:En(t,e),Cn(e);break;case 31:En(t,e),Cn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zs(e,r)));break;case 13:En(t,e),Cn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ts=Ye()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zs(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,k=Or,N=$t;if(Or=k||o,$t=N||h,En(t,e),$t=N,Or=k,Cn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Or||$t||Yo(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){h=n=t;try{if(a=h.stateNode,o)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{u=h.stateNode;var O=h.memoizedProps.style,S=O!=null&&O.hasOwnProperty("display")?O.display:null;u.style.display=S==null||typeof S=="boolean"?"":(""+S).trim()}}catch(de){dt(h,h.return,de)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(de){dt(h,h.return,de)}}}else if(t.tag===18){if(n===null){h=t;try{var z=h.stateNode;o?lf(z,!0):lf(h.stateNode,!1)}catch(de){dt(h,h.return,de)}}}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,zs(e,n))));break;case 19:En(t,e),Cn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zs(e,r)));break;case 30:break;case 21:break;default:En(t,e),Cn(e)}}function Cn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(um(r)){n=r;break}r=r.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var o=n.stateNode,a=Pu(e);Cs(e,a,o);break;case 5:var s=n.stateNode;n.flags&32&&(mr(s,""),n.flags&=-33);var u=Pu(e);Cs(e,u,s);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Pu(e);Iu(e,k,h);break;default:throw Error(c(161))}}catch(N){dt(e,e.return,N)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ym(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ym(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pm(e,t.alternate,t),t=t.sibling}function Yo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:bo(4,t,t.return),Yo(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&sm(t,t.return,n),Yo(t);break;case 27:Ai(t.stateNode);case 26:case 5:xr(t,t.return),Yo(t);break;case 22:t.memoizedState===null&&Yo(t);break;case 30:Yo(t);break;default:Yo(t)}e=e.sibling}}function Br(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,a=t,s=a.flags;switch(a.tag){case 0:case 11:case 15:Br(o,a,n),ki(4,a);break;case 1:if(Br(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(k){dt(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++)Xc(h[o],u)}catch(k){dt(r,r.return,k)}}n&&s&64&&im(a),_i(a,a.return);break;case 27:dm(a);case 26:case 5:Br(o,a,n),n&&r===null&&s&4&&lm(a),_i(a,a.return);break;case 12:Br(o,a,n);break;case 31:Br(o,a,n),n&&s&4&&hm(o,a);break;case 13:Br(o,a,n),n&&s&4&&gm(o,a);break;case 22:a.memoizedState===null&&Br(o,a,n),_i(a,a.return);break;case 30:break;default:Br(o,a,n)}t=t.sibling}}function ju(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&&ui(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ui(e))}function ir(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vm(e,t,n,r),t=t.sibling}function vm(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ir(e,t,n,r),o&2048&&ki(9,t);break;case 1:ir(e,t,n,r);break;case 3:ir(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&&ui(e)));break;case 12:if(o&2048){ir(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,s=a.id,u=a.onPostCommit;typeof u=="function"&&u(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){dt(t,t.return,h)}}else ir(e,t,n,r);break;case 31:ir(e,t,n,r);break;case 13:ir(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,t.memoizedState!==null?a._visibility&2?ir(e,t,n,r):Si(e,t):a._visibility&2?ir(e,t,n,r):(a._visibility|=2,za(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&ju(s,t);break;case 24:ir(e,t,n,r),o&2048&&Nu(t.alternate,t);break;default:ir(e,t,n,r)}}function za(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,s=t,u=n,h=r,k=s.flags;switch(s.tag){case 0:case 11:case 15:za(a,s,u,h,o),ki(8,s);break;case 23:break;case 22:var N=s.stateNode;s.memoizedState!==null?N._visibility&2?za(a,s,u,h,o):Si(a,s):(N._visibility|=2,za(a,s,u,h,o)),o&&k&2048&&ju(s.alternate,s);break;case 24:za(a,s,u,h,o),o&&k&2048&&Nu(s.alternate,s);break;default:za(a,s,u,h,o)}t=t.sibling}}function Si(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:Si(n,r),o&2048&&ju(r.alternate,r);break;case 24:Si(n,r),o&2048&&Nu(r.alternate,r);break;default:Si(n,r)}t=t.sibling}}var Ei=8192;function Ma(e,t,n){if(e.subtreeFlags&Ei)for(e=e.child;e!==null;)xm(e,t,n),e=e.sibling}function xm(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&Ei&&e.memoizedState!==null&&W0(n,ar,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var r=ar;ar=Ws(e.stateNode.containerInfo),Ma(e,t,n),ar=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ei,Ei=16777216,Ma(e,t,n),Ei=r):Ma(e,t,n));break;default:Ma(e,t,n)}}function wm(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 Ci(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];Qt=r,_m(r,e)}wm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)km(e),e=e.sibling}function km(e){switch(e.tag){case 0:case 11:case 15:Ci(e),e.flags&2048&&bo(9,e,e.return);break;case 3:Ci(e);break;case 12:Ci(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ms(e)):Ci(e);break;default:Ci(e)}}function Ms(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];Qt=r,_m(r,e)}wm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bo(8,t,t.return),Ms(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ms(t));break;default:Ms(t)}e=e.sibling}}function _m(e,t){for(;Qt!==null;){var n=Qt;switch(n.tag){case 0:case 11:case 15:bo(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:ui(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qt=r;else e:for(n=e;Qt!==null;){r=Qt;var o=r.sibling,a=r.return;if(mm(r),r===n){Qt=null;break e}if(o!==null){o.return=a,Qt=o;break e}Qt=a}}}var n0={getCacheForType:function(e){var t=on(Lt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return on(Lt).controller.signal}},r0=typeof WeakMap=="function"?WeakMap:Map,it=0,gt=null,He=null,Xe=0,ut=0,On=null,yo=!1,Ta=!1,Ru=!1,Ur=0,Mt=0,vo=0,ea=0,Du=0,$n=0,Pa=0,zi=null,zn=null,Lu=!1,Ts=0,Sm=0,Ps=1/0,Is=null,xo=null,Bt=0,wo=null,Ia=null,Vr=0,Fu=0,Ou=null,Em=null,Mi=0,$u=null;function Wn(){return(it&2)!==0&&Xe!==0?Xe&-Xe:C.T!==null?Ku():na()}function Cm(){if($n===0)if((Xe&536870912)===0||Je){var e=me;me<<=1,(me&3932160)===0&&(me=262144),$n=e}else $n=536870912;return e=Ln.current,e!==null&&(e.flags|=32),$n}function Mn(e,t,n){(e===gt&&(ut===2||ut===9)||e.cancelPendingCommit!==null)&&(Aa(e,0),ko(e,Xe,$n,!1)),lr(e,n),((it&2)===0||e!==gt)&&(e===gt&&((it&2)===0&&(ea|=n),Mt===4&&ko(e,Xe,$n,!1)),wr(e))}function zm(e,t,n){if((it&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||nt(e,t),o=r?i0(e,t):Bu(e,t,!0),a=r;do{if(o===0){Ta&&!r&&ko(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!o0(n)){o=Bu(e,t,!1),a=!1;continue}if(o===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var u=e;o=zi;var h=u.current.memoizedState.isDehydrated;if(h&&(Aa(u,s).flags|=256),s=Bu(u,s,!1),s!==2){if(Ru&&!h){u.errorRecoveryDisabledLanes|=a,ea|=a,o=4;break e}a=zn,zn=o,a!==null&&(zn===null?zn=a:zn.push.apply(zn,a))}o=s}if(a=!1,o!==2)continue}}if(o===1){Aa(e,0),ko(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:ko(r,t,$n,!yo);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Ts+300-Ye(),10<o)){if(ko(r,t,$n,!yo),xe(r,0,!0)!==0)break e;Vr=t,r.timeoutHandle=of(Mm.bind(null,r,n,zn,Is,Lu,t,$n,ea,Pa,yo,a,"Throttled",-0,0),o);break e}Mm(r,n,zn,Is,Lu,t,$n,ea,Pa,yo,a,null,-0,0)}}break}while(!0);wr(e)}function Mm(e,t,n,r,o,a,s,u,h,k,N,O,S,z){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:mn},xm(t,a,O);var de=(a&62914560)===a?Ts-Ye():(a&4194048)===a?Sm-Ye():0;if(de=B0(O,de),de!==null){Vr=a,e.cancelPendingCommit=de(Dm.bind(null,e,t,a,n,r,o,s,u,h,N,O,null,S,z)),ko(e,a,s,!k);return}}Dm(e,t,a,n,r,o,s,u,h)}function o0(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(!Rn(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 ko(e,t,n,r){t&=~Du,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-ft(o),s=1<<a;r[a]=-1,o&=~s}n!==0&&Gr(e,n,t)}function As(){return(it&6)===0?(Ti(0),!1):!0}function Wu(){if(He!==null){if(ut===0)var e=He.return;else e=He,jr=Ho=null,ru(e),ka=null,ci=0,e=He;for(;e!==null;)am(e.alternate,e),e=e.return;He=null}}function Aa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,S0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Vr=0,Wu(),gt=e,He=n=Ir(e.current,null),Xe=t,ut=0,On=null,yo=!1,Ta=nt(e,t),Ru=!1,Pa=$n=Du=ea=vo=Mt=0,zn=zi=null,Lu=!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 Ur=t,Yi(),n}function Tm(e,t){Pe=null,C.H=vi,t===wa||t===ss?(t=Hc(),ut=3):t===Hl?(t=Hc(),ut=4):ut=t===vu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,On=t,He===null&&(Mt=1,ws(e,Un(t,e.current)))}function Pm(){var e=Ln.current;return e===null?!0:(Xe&4194048)===Xe?or===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===or:!1}function Im(){var e=C.H;return C.H=vi,e===null?vi:e}function Am(){var e=C.A;return C.A=n0,e}function js(){Mt=4,yo||(Xe&4194048)!==Xe&&Ln.current!==null||(Ta=!0),(vo&134217727)===0&&(ea&134217727)===0||gt===null||ko(gt,Xe,$n,!1)}function Bu(e,t,n){var r=it;it|=2;var o=Im(),a=Am();(gt!==e||Xe!==t)&&(Is=null,Aa(e,t)),t=!1;var s=Mt;e:do try{if(ut!==0&&He!==null){var u=He,h=On;switch(ut){case 8:Wu(),s=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(t=!0);var k=ut;if(ut=0,On=null,ja(e,u,h,k),n&&Ta){s=0;break e}break;default:k=ut,ut=0,On=null,ja(e,u,h,k)}}a0(),s=Mt;break}catch(N){Tm(e,N)}while(!0);return t&&e.shellSuspendCounter++,jr=Ho=null,it=r,C.H=o,C.A=a,He===null&&(gt=null,Xe=0,Yi()),s}function a0(){for(;He!==null;)jm(He)}function i0(e,t){var n=it;it|=2;var r=Im(),o=Am();gt!==e||Xe!==t?(Is=null,Ps=Ye()+500,Aa(e,t)):Ta=nt(e,t);e:do try{if(ut!==0&&He!==null){t=He;var a=On;t:switch(ut){case 1:ut=0,On=null,ja(e,t,a,1);break;case 2:case 9:if(Uc(a)){ut=0,On=null,Nm(t);break}t=function(){ut!==2&&ut!==9||gt!==e||(ut=7),wr(e)},a.then(t,t);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Uc(a)?(ut=0,On=null,Nm(t)):(ut=0,On=null,ja(e,t,a,7));break;case 5:var s=null;switch(He.tag){case 26:s=He.memoizedState;case 5:case 27:var u=He;if(s?xf(s):u.stateNode.complete){ut=0,On=null;var h=u.sibling;if(h!==null)He=h;else{var k=u.return;k!==null?(He=k,Ns(k)):He=null}break t}}ut=0,On=null,ja(e,t,a,5);break;case 6:ut=0,On=null,ja(e,t,a,6);break;case 8:Wu(),Mt=6;break e;default:throw Error(c(462))}}s0();break}catch(N){Tm(e,N)}while(!0);return jr=Ho=null,C.H=r,C.A=o,it=n,He!==null?0:(gt=null,Xe=0,Yi(),Mt)}function s0(){for(;He!==null&&!Ze();)jm(He)}function jm(e){var t=rm(e.alternate,e,Ur);e.memoizedProps=e.pendingProps,t===null?Ns(e):He=t}function Nm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Zp(n,t,t.pendingProps,t.type,void 0,Xe);break;case 11:t=Zp(n,t,t.pendingProps,t.type.render,t.ref,Xe);break;case 5:ru(t);default:am(n,t),t=He=Ac(t,Ur),t=rm(n,t,Ur)}e.memoizedProps=e.pendingProps,t===null?Ns(e):He=t}function ja(e,t,n,r){jr=Ho=null,ru(t),ka=null,ci=0;var o=t.return;try{if(Xg(e,o,t,n,Xe)){Mt=1,ws(e,Un(n,e.current)),He=null;return}}catch(a){if(o!==null)throw He=o,a;Mt=1,ws(e,Un(n,e.current)),He=null;return}t.flags&32768?(Je||r===1?e=!0:Ta||(Xe&536870912)!==0?e=!1:(yo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ln.current,r!==null&&r.tag===13&&(r.flags|=16384))),Rm(t,e)):Ns(t)}function Ns(e){var t=e;do{if((t.flags&32768)!==0){Rm(t,yo);return}e=t.return;var n=Jg(t.alternate,t,Ur);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 Rm(e,t){do{var n=Yg(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 Dm(e,t,n,r,o,a,s,u,h){e.cancelPendingCommit=null;do Rs();while(Bt!==0);if((it&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(a=t.lanes|t.childLanes,a|=Pl,Do(e,n,a,s,u,h),e===gt&&(He=gt=null,Xe=0),Ia=t,wo=e,Vr=n,Fu=a,Ou=o,Em=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,c0(Vt,function(){return Wm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,o=V.p,V.p=2,s=it,it|=4;try{e0(e,t,n)}finally{it=s,V.p=o,C.T=r}}Bt=1,Lm(),Fm(),Om()}}function Lm(){if(Bt===1){Bt=0;var e=wo,t=Ia,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=V.p;V.p=2;var o=it;it|=4;try{bm(t,e);var a=ed,s=_c(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(s!==u&&u&&u.ownerDocument&&kc(u.ownerDocument.documentElement,u)){if(h!==null&&El(u)){var k=h.start,N=h.end;if(N===void 0&&(N=k),"selectionStart"in u)u.selectionStart=k,u.selectionEnd=Math.min(N,u.value.length);else{var O=u.ownerDocument||document,S=O&&O.defaultView||window;if(S.getSelection){var z=S.getSelection(),de=u.textContent.length,Se=Math.min(h.start,de),mt=h.end===void 0?Se:Math.min(h.end,de);!z.extend&&Se>mt&&(s=mt,mt=Se,Se=s);var y=wc(u,Se),g=wc(u,mt);if(y&&g&&(z.rangeCount!==1||z.anchorNode!==y.node||z.anchorOffset!==y.offset||z.focusNode!==g.node||z.focusOffset!==g.offset)){var w=O.createRange();w.setStart(y.node,y.offset),z.removeAllRanges(),Se>mt?(z.addRange(w),z.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),z.addRange(w))}}}}for(O=[],z=u;z=z.parentNode;)z.nodeType===1&&O.push({element:z,left:z.scrollLeft,top:z.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}}Qs=!!Yu,ed=Yu=null}finally{it=o,V.p=r,C.T=n}}e.current=t,Bt=2}}function Fm(){if(Bt===2){Bt=0;var e=wo,t=Ia,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=V.p;V.p=2;var o=it;it|=4;try{pm(e,t.alternate,t)}finally{it=o,V.p=r,C.T=n}}Bt=3}}function Om(){if(Bt===4||Bt===3){Bt=0,q();var e=wo,t=Ia,n=Vr,r=Em;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Bt=5:(Bt=0,Ia=wo=null,$m(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(xo=null),gn(n),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Ht,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,o=V.p,V.p=2,C.T=null;try{for(var a=e.onRecoverableError,s=0;s<r.length;s++){var u=r[s];a(u.value,{componentStack:u.stack})}}finally{C.T=t,V.p=o}}(Vr&3)!==0&&Rs(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===$u?Mi++:(Mi=0,$u=e):Mi=0,Ti(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ui(t)))}function Rs(){return Lm(),Fm(),Om(),Wm()}function Wm(){if(Bt!==5)return!1;var e=wo,t=Fu;Fu=0;var n=gn(Vr),r=C.T,o=V.p;try{V.p=32>n?32:n,C.T=null,n=Ou,Ou=null;var a=wo,s=Vr;if(Bt=0,Ia=wo=null,Vr=0,(it&6)!==0)throw Error(c(331));var u=it;if(it|=4,km(a.current),vm(a,a.current,s,n),it=u,Ti(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Ht,a)}catch{}return!0}finally{V.p=o,C.T=r,$m(e,t)}}function Bm(e,t,n){t=Un(n,t),t=yu(e.stateNode,t,2),e=fo(e,t,2),e!==null&&(lr(e,2),wr(e))}function dt(e,t,n){if(e.tag===3)Bm(e,e,n);else for(;t!==null;){if(t.tag===3){Bm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(xo===null||!xo.has(r))){e=Un(n,e),n=Up(2),r=fo(t,n,2),r!==null&&(Vp(n,r,t,e),lr(r,2),wr(r));break}}t=t.return}}function Uu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new r0;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)||(Ru=!0,o.add(n),e=l0.bind(null,e,t,n),t.then(e,e))}function l0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,gt===e&&(Xe&n)===n&&(Mt===4||Mt===3&&(Xe&62914560)===Xe&&300>Ye()-Ts?(it&2)===0&&Aa(e,0):Du|=n,Pa===Xe&&(Pa=0)),wr(e)}function Um(e,t){t===0&&(t=Ro()),e=Bo(e,t),e!==null&&(lr(e,t),wr(e))}function u0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Um(e,n)}function d0(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),Um(e,n)}function c0(e,t){return X(e,t)}var Ds=null,Na=null,Vu=!1,Ls=!1,Hu=!1,_o=0;function wr(e){e!==Na&&e.next===null&&(Na===null?Ds=Na=e:Na=Na.next=e),Ls=!0,Vu||(Vu=!0,m0())}function Ti(e,t){if(!Hu&&Ls){Hu=!0;do for(var n=!1,r=Ds;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var s=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-ft(42|e)+1)-1,a&=o&~(s&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Qm(r,a))}else a=Xe,a=xe(r,r===gt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||nt(r,a)||(n=!0,Qm(r,a));r=r.next}while(n);Hu=!1}}function p0(){Vm()}function Vm(){Ls=Vu=!1;var e=0;_o!==0&&_0()&&(e=_o);for(var t=Ye(),n=null,r=Ds;r!==null;){var o=r.next,a=Hm(r,t);a===0?(r.next=null,n===null?Ds=o:n.next=o,o===null&&(Na=n)):(n=r,(e!==0||(a&3)!==0)&&(Ls=!0)),r=o}Bt!==0&&Bt!==5||Ti(e),_o!==0&&(_o=0)}function Hm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var s=31-ft(a),u=1<<s,h=o[s];h===-1?((u&n)===0||(u&r)!==0)&&(o[s]=qt(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=gt,n=Xe,n=xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ut===2||ut===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||nt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),gn(n)){case 2:case 8:n=st;break;case 32:n=Vt;break;case 268435456:n=No;break;default:n=Vt}return r=Km.bind(null,e),n=X(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Km(e,t){if(Bt!==0&&Bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Rs()&&e.callbackNode!==n)return null;var r=Xe;return r=xe(e,e===gt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zm(e,r,t),Hm(e,Ye()),e.callbackNode!=null&&e.callbackNode===n?Km.bind(null,e):null)}function Qm(e,t){if(Rs())return null;zm(e,t,!0)}function m0(){E0(function(){(it&6)!==0?X(un,p0):Vm()})}function Ku(){if(_o===0){var e=va;e===0&&(e=fn,fn<<=1,(fn&261888)===0&&(fn=256)),_o=e}return _o}function qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ua(""+e)}function Xm(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 f0(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=qm((o[Wt]||null).action),s=r.submitter;s&&(t=(t=s[Wt]||null)?qm(t.formAction):s.getAttribute("formAction"),t!==null&&(a=t,s=null));var u=new yn("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(_o!==0){var h=s?Xm(o,s):new FormData(o);pu(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=s?Xm(o,s):new FormData(o),pu(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Qu=0;Qu<Tl.length;Qu++){var qu=Tl[Qu],h0=qu.toLowerCase(),g0=qu[0].toUpperCase()+qu.slice(1);rr(h0,"on"+g0)}rr(Cc,"onAnimationEnd"),rr(zc,"onAnimationIteration"),rr(Mc,"onAnimationStart"),rr("dblclick","onDoubleClick"),rr("focusin","onFocus"),rr("focusout","onBlur"),rr(Ag,"onTransitionRun"),rr(jg,"onTransitionStart"),rr(Ng,"onTransitionCancel"),rr(Tc,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),b0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pi));function Gm(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 s=r.length-1;0<=s;s--){var u=r[s],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(N){Ji(N)}o.currentTarget=null,a=h}else for(s=0;s<r.length;s++){if(u=r[s],h=u.instance,k=u.currentTarget,u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(N){Ji(N)}o.currentTarget=null,a=h}}}}function Ke(e,t){var n=t[ra];n===void 0&&(n=t[ra]=new Set);var r=e+"__bubble";n.has(r)||(Zm(t,e,2,!1),n.add(r))}function Xu(e,t,n){var r=0;t&&(r|=4),Zm(n,e,r,t)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function Gu(e){if(!e[Fs]){e[Fs]=!0,Xt.forEach(function(n){n!=="selectionchange"&&(b0.has(n)||Xu(n,!1,e),Xu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fs]||(t[Fs]=!0,Xu("selectionchange",!1,t))}}function Zm(e,t,n,r){switch(zf(t)){case 2:var o=H0;break;case 8:o=K0;break;default:o=cd}n=o.bind(null,t,n,e),o=void 0,!Mr||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 Zu(e,t,n,r,o){var a=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var u=r.stateNode.containerInfo;if(u===o)break;if(s===4)for(s=r.return;s!==null;){var h=s.tag;if((h===3||h===4)&&s.stateNode.containerInfo===o)return;s=s.return}for(;u!==null;){if(s=dr(u),s===null)return;if(h=s.tag,h===5||h===6||h===26||h===27){r=a=s;continue e}u=u.parentNode}}r=r.return}ro(function(){var k=a,N=no(n),O=[];e:{var S=Pc.get(e);if(S!==void 0){var z=yn,de=e;switch(e){case"keypress":if(Yt(n)===0)break e;case"keydown":case"keyup":z=p;break;case"focusin":de="focus",z=Ja;break;case"focusout":de="blur",z=Ja;break;case"beforeblur":case"afterblur":z=Ja;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":z=br;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=qi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=J;break;case Cc:case zc:case Mc:z=Xi;break;case Tc:z=et;break;case"scroll":case"scrollend":z=Ki;break;case"wheel":z=Rt;break;case"copy":case"cut":case"paste":z=yl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=j;break;case"toggle":case"beforetoggle":z=We}var Se=(t&4)!==0,mt=!Se&&(e==="scroll"||e==="scrollend"),y=Se?S!==null?S+"Capture":null:S;Se=[];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||y===null||(L=oo(g,y),L!=null&&Se.push(Ii(g,L,w))),mt)break;g=g.return}0<Se.length&&(S=new z(S,de,null,n,N),O.push({event:S,listeners:Se}))}}if((t&7)===0){e:{if(S=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",S&&n!==Cr&&(de=n.relatedTarget||n.fromElement)&&(dr(de)||de[ur]))break e;if((z||S)&&(S=N.window===N?N:(S=N.ownerDocument)?S.defaultView||S.parentWindow:window,z?(de=n.relatedTarget||n.toElement,z=k,de=de?dr(de):null,de!==null&&(mt=P(de),Se=de.tag,de!==mt||Se!==5&&Se!==27&&Se!==6)&&(de=null)):(z=null,de=k),z!==de)){if(Se=br,L="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=j,L="onPointerLeave",y="onPointerEnter",g="pointer"),mt=z==null?S:cn(z),w=de==null?S:cn(de),S=new Se(L,g+"leave",z,n,N),S.target=mt,S.relatedTarget=w,L=null,dr(N)===k&&(Se=new Se(y,g+"enter",de,n,N),Se.target=w,Se.relatedTarget=mt,L=Se),mt=L,z&&de)t:{for(Se=y0,y=z,g=de,w=0,L=y;L;L=Se(L))w++;L=0;for(var we=g;we;we=Se(we))L++;for(;0<w-L;)y=Se(y),w--;for(;0<L-w;)g=Se(g),L--;for(;w--;){if(y===g||g!==null&&y===g.alternate){Se=y;break t}y=Se(y),g=Se(g)}Se=null}else Se=null;z!==null&&Jm(O,S,z,Se,!1),de!==null&&mt!==null&&Jm(O,mt,de,Se,!0)}}e:{if(S=k?cn(k):window,z=S.nodeName&&S.nodeName.toLowerCase(),z==="select"||z==="input"&&S.type==="file")var rt=hc;else if(ht(S))if(gc)rt=Tg;else{rt=zg;var ge=Cg}else z=S.nodeName,!z||z.toLowerCase()!=="input"||S.type!=="checkbox"&&S.type!=="radio"?k&&to(k.elementType)&&(rt=hc):rt=Mg;if(rt&&(rt=rt(e,k))){ni(O,rt,n,N);break e}ge&&ge(e,S,k),e==="focusout"&&k&&S.type==="number"&&k.memoizedProps.value!=null&&la(S,"number",S.value)}switch(ge=k?cn(k):window,e){case"focusin":(ht(ge)||ge.contentEditable==="true")&&(ca=ge,Cl=k,ii=null);break;case"focusout":ii=Cl=ca=null;break;case"mousedown":zl=!0;break;case"contextmenu":case"mouseup":case"dragend":zl=!1,Sc(O,n,N);break;case"selectionchange":if(Ig)break;case"keydown":case"keyup":Sc(O,n,N)}var je;if(Dt)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else tt?Be(e,n)&&(Ge="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ge="onCompositionStart");Ge&&(nr&&n.locale!=="ko"&&(tt||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&tt&&(je=Hi()):(lt=N,Nt="value"in lt?lt.value:lt.textContent,tt=!0)),ge=Os(k,Ge),0<ge.length&&(Ge=new Ya(Ge,e,null,n,N),O.push({event:Ge,listeners:ge}),je?Ge.data=je:(je=bt(n),je!==null&&(Ge.data=je)))),(je=tn?Nn(e,n):Kt(e,n))&&(Ge=Os(k,"onBeforeInput"),0<Ge.length&&(ge=new Ya("onBeforeInput","beforeinput",null,n,N),O.push({event:ge,listeners:Ge}),ge.data=je)),f0(O,e,k,n,N)}Gm(O,t)})}function Ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Os(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=oo(e,n),o!=null&&r.unshift(Ii(e,o,a)),o=oo(e,t),o!=null&&r.push(Ii(e,o,a))),e.tag===3)return r;e=e.return}return[]}function y0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jm(e,t,n,r,o){for(var a=t._reactName,s=[];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=oo(n,a),k!=null&&s.unshift(Ii(n,k,h))):o||(k=oo(n,a),k!=null&&s.push(Ii(n,k,h)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var v0=/\r\n?/g,x0=/\u0000|\uFFFD/g;function Ym(e){return(typeof e=="string"?e:""+e).replace(v0,`
|
|
41
|
+
`).replace(x0,"")}function ef(e,t){return t=Ym(t),Ym(e)===t}function pt(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||mr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&mr(e,""+r);break;case"className":Jn(e,"class",r);break;case"tabIndex":Jn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Jn(e,n,r);break;case"style":Oo(e,r,a);break;case"data":if(t!=="object"){Jn(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=ua(""+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"&&pt(e,t,"name",o.name,o,null),pt(e,t,"formEncType",o.formEncType,o,null),pt(e,t,"formMethod",o.formMethod,o,null),pt(e,t,"formTarget",o.formTarget,o,null)):(pt(e,t,"encType",o.encType,o,null),pt(e,t,"method",o.method,o,null),pt(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=ua(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=mn);break;case"onScroll":r!=null&&Ke("scroll",e);break;case"onScrollEnd":r!=null&&Ke("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=ua(""+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":Ke("beforetoggle",e),Ke("toggle",e),_n(e,"popover",r);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Yn(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=Zt.get(n)||n,_n(e,n,r))}}function Ju(e,t,n,r,o,a){switch(n){case"style":Oo(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"?mr(e,r):(typeof r=="number"||typeof r=="bigint")&&mr(e,""+r);break;case"onScroll":r!=null&&Ke("scroll",e);break;case"onScrollEnd":r!=null&&Ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=mn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ia.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[Wt]||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 sn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",e),Ke("load",e);var r=!1,o=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:pt(e,t,a,s,n,null)}}o&&pt(e,t,"srcSet",n.srcSet,n,null),r&&pt(e,t,"src",n.src,n,null);return;case"input":Ke("invalid",e);var u=a=s=o=null,h=null,k=null;for(r in n)if(n.hasOwnProperty(r)){var N=n[r];if(N!=null)switch(r){case"name":o=N;break;case"type":s=N;break;case"checked":h=N;break;case"defaultChecked":k=N;break;case"value":a=N;break;case"defaultValue":u=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(137,t));break;default:pt(e,t,r,N,n,null)}}er(e,a,u,h,k,s,o,!1);return;case"select":Ke("invalid",e),r=s=a=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":a=u;break;case"defaultValue":s=u;break;case"multiple":r=u;default:pt(e,t,o,u,n,null)}t=a,n=s,e.multiple=!!r,t!=null?eo(e,!!r,t,!1):n!=null&&eo(e,!!r,n,!0);return;case"textarea":Ke("invalid",e),a=o=r=null;for(s in n)if(n.hasOwnProperty(s)&&(u=n[s],u!=null))switch(s){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:pt(e,t,s,u,n,null)}qa(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:pt(e,t,h,r,n,null)}return;case"dialog":Ke("beforetoggle",e),Ke("toggle",e),Ke("cancel",e),Ke("close",e);break;case"iframe":case"object":Ke("load",e);break;case"video":case"audio":for(r=0;r<Pi.length;r++)Ke(Pi[r],e);break;case"image":Ke("error",e),Ke("load",e);break;case"details":Ke("toggle",e);break;case"embed":case"source":case"link":Ke("error",e),Ke("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:pt(e,t,k,r,n,null)}return;default:if(to(t)){for(N in n)n.hasOwnProperty(N)&&(r=n[N],r!==void 0&&Ju(e,t,N,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&pt(e,t,u,r,n,null))}function w0(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,s=null,u=null,h=null,k=null,N=null;for(z in n){var O=n[z];if(n.hasOwnProperty(z)&&O!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":h=O;default:r.hasOwnProperty(z)||pt(e,t,z,null,r,O)}}for(var S in r){var z=r[S];if(O=n[S],r.hasOwnProperty(S)&&(z!=null||O!=null))switch(S){case"type":a=z;break;case"name":o=z;break;case"checked":k=z;break;case"defaultChecked":N=z;break;case"value":s=z;break;case"defaultValue":u=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:z!==O&&pt(e,t,S,z,r,O)}}sa(e,s,u,h,k,N,a,o);return;case"select":z=s=u=S=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":z=h;default:r.hasOwnProperty(a)||pt(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":S=a;break;case"defaultValue":u=a;break;case"multiple":s=a;default:a!==h&&pt(e,t,o,a,r,h)}t=u,n=s,r=z,S!=null?eo(e,!!n,S,!1):!!r!=!!n&&(t!=null?eo(e,!!n,t,!0):eo(e,!!n,n?[]:"",!1));return;case"textarea":z=S=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:pt(e,t,u,null,r,o)}for(s in r)if(o=r[s],a=n[s],r.hasOwnProperty(s)&&(o!=null||a!=null))switch(s){case"value":S=o;break;case"defaultValue":z=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==a&&pt(e,t,s,o,r,a)}Ui(e,S,z);return;case"option":for(var de in n)if(S=n[de],n.hasOwnProperty(de)&&S!=null&&!r.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:pt(e,t,de,null,r,S)}for(h in r)if(S=r[h],z=n[h],r.hasOwnProperty(h)&&S!==z&&(S!=null||z!=null))switch(h){case"selected":e.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:pt(e,t,h,S,r,z)}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)S=n[Se],n.hasOwnProperty(Se)&&S!=null&&!r.hasOwnProperty(Se)&&pt(e,t,Se,null,r,S);for(k in r)if(S=r[k],z=n[k],r.hasOwnProperty(k)&&S!==z&&(S!=null||z!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(137,t));break;default:pt(e,t,k,S,r,z)}return;default:if(to(t)){for(var mt in n)S=n[mt],n.hasOwnProperty(mt)&&S!==void 0&&!r.hasOwnProperty(mt)&&Ju(e,t,mt,void 0,r,S);for(N in r)S=r[N],z=n[N],!r.hasOwnProperty(N)||S===z||S===void 0&&z===void 0||Ju(e,t,N,S,r,z);return}}for(var y in n)S=n[y],n.hasOwnProperty(y)&&S!=null&&!r.hasOwnProperty(y)&&pt(e,t,y,null,r,S);for(O in r)S=r[O],z=n[O],!r.hasOwnProperty(O)||S===z||S==null&&z==null||pt(e,t,O,S,r,z)}function tf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function k0(){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,s=o.initiatorType,u=o.duration;if(a&&u&&tf(s)){for(s=0,u=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],k=h.startTime;if(k>u)break;var N=h.transferSize,O=h.initiatorType;N&&tf(O)&&(h=h.responseEnd,s+=N*(h<u?1:(u-k)/(h-k)))}if(--r,t+=8*(a+s)/(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 Yu=null,ed=null;function $s(e){return e.nodeType===9?e:e.ownerDocument}function nf(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 rf(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 td(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 nd=null;function _0(){var e=window.event;return e&&e.type==="popstate"?e===nd?!1:(nd=e,!0):(nd=null,!1)}var of=typeof setTimeout=="function"?setTimeout:void 0,S0=typeof clearTimeout=="function"?clearTimeout:void 0,af=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof af<"u"?function(e){return af.resolve(null).then(e).catch(C0)}:of;function C0(e){setTimeout(function(){throw e})}function So(e){return e==="head"}function sf(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),Fa(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 s=a.nextSibling,u=a.nodeName;a[kr]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=s}}else n==="body"&&Ai(e.ownerDocument.body);n=o}while(n);Fa(t)}function lf(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 rd(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":rd(n),Va(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function z0(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=Qn(e.nextSibling),e===null)break}return null}function M0(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 uf(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 od(e){return e.data==="$?"||e.data==="$~"}function ad(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function T0(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 id=null;function df(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 cf(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 pf(e,t,n){switch(t=$s(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]);Va(e)}var qn=new Map,mf=new Set;function Ws(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Hr=V.d;V.d={f:P0,r:I0,D:A0,C:j0,L:N0,m:R0,X:L0,S:D0,M:F0};function P0(){var e=Hr.f(),t=As();return e||t}function I0(e){var t=Jr(e);t!==null&&t.tag===5&&t.type==="form"?Tp(t):Hr.r(e)}var Ra=typeof document>"u"?null:document;function ff(e,t,n){var r=Ra;if(r&&typeof t=="string"&&t){var o=Gt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),mf.has(o)||(mf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),sn(t,"link",e),jt(t),r.head.appendChild(t)))}}function A0(e){Hr.D(e),ff("dns-prefetch",e,null)}function j0(e,t){Hr.C(e,t),ff("preconnect",e,t)}function N0(e,t,n){Hr.L(e,t,n);var r=Ra;if(r&&e&&t){var o='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+Gt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+Gt(n.imageSizes)+'"]')):o+='[href="'+Gt(e)+'"]';var a=o;switch(t){case"style":a=Da(e);break;case"script":a=La(e)}qn.has(a)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(ji(a))||t==="script"&&r.querySelector(Ni(a))||(t=r.createElement("link"),sn(t,"link",e),jt(t),r.head.appendChild(t)))}}function R0(e,t){Hr.m(e,t);var n=Ra;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Gt(r)+'"][href="'+Gt(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=La(e)}if(!qn.has(a)&&(e=E({rel:"modulepreload",href:e},t),qn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ni(a)))return}r=n.createElement("link"),sn(r,"link",e),jt(r),n.head.appendChild(r)}}}function D0(e,t,n){Hr.S(e,t,n);var r=Ra;if(r&&e){var o=Tt(r).hoistableStyles,a=Da(e);t=t||"default";var s=o.get(a);if(!s){var u={loading:0,preload:null};if(s=r.querySelector(ji(a)))u.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qn.get(a))&&sd(e,n);var h=s=r.createElement("link");jt(h),sn(h,"link",e),h._p=new Promise(function(k,N){h.onload=k,h.onerror=N}),h.addEventListener("load",function(){u.loading|=1}),h.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Bs(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:u},o.set(a,s)}}}function L0(e,t){Hr.X(e,t);var n=Ra;if(n&&e){var r=Tt(n).hoistableScripts,o=La(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=E({src:e,async:!0},t),(t=qn.get(o))&&ld(e,t),a=n.createElement("script"),jt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function F0(e,t){Hr.M(e,t);var n=Ra;if(n&&e){var r=Tt(n).hoistableScripts,o=La(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=E({src:e,async:!0,type:"module"},t),(t=qn.get(o))&&ld(e,t),a=n.createElement("script"),jt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function hf(e,t,n,r){var o=(o=ve.current)?Ws(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=Da(n.href),n=Tt(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=Da(n.href);var a=Tt(o).hoistableStyles,s=a.get(e);if(s||(o=o.ownerDocument||o,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=o.querySelector(ji(e)))&&!a._p&&(s.instance=a,s.state.loading=5),qn.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},qn.set(e,n),a||O0(o,e,n,s.state))),t&&r===null)throw Error(c(528,""));return s}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=La(n),n=Tt(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 Da(e){return'href="'+Gt(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function gf(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function O0(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}),sn(t,"link",n),jt(t),e.head.appendChild(t))}function La(e){return'[src="'+Gt(e)+'"]'}function Ni(e){return"script[async]"+e}function bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Gt(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),sn(r,"style",o),Bs(r,n.precedence,e),t.instance=r;case"stylesheet":o=Da(n.href);var a=e.querySelector(ji(o));if(a)return t.state.loading|=4,t.instance=a,jt(a),a;r=gf(n),(o=qn.get(o))&&sd(r,o),a=(e.ownerDocument||e).createElement("link"),jt(a);var s=a;return s._p=new Promise(function(u,h){s.onload=u,s.onerror=h}),sn(a,"link",r),t.state.loading|=4,Bs(a,n.precedence,e),t.instance=a;case"script":return a=La(n.src),(o=e.querySelector(Ni(a)))?(t.instance=o,jt(o),o):(r=n,(o=qn.get(a))&&(r=E({},n),ld(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),jt(o),sn(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,Bs(r,n.precedence,e));return t.instance}function Bs(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,s=0;s<r.length;s++){var u=r[s];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 sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ld(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Us=null;function yf(e,t,n){if(Us===null){var r=new Map,o=Us=new Map;o.set(n,r)}else o=Us,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[St]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(t)||"";s=e+s;var u=r.get(s);u?u.push(a):r.set(s,[a])}}return r}function vf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function $0(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 xf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function W0(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=Da(r.href),a=t.querySelector(ji(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,jt(a);return}a=t.ownerDocument||t,r=gf(r),(o=qn.get(o))&&sd(r,o),a=a.createElement("link"),jt(a);var s=a;s._p=new Promise(function(u,h){s.onload=u,s.onerror=h}),sn(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=Vs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var ud=0;function B0(e,t){return e.stylesheets&&e.count===0&&Ks(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Ks(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&ud===0&&(ud=62500*k0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ks(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>ud?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Vs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ks(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Ks(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach(U0,e),Hs=null,Vs.call(e))}function U0(e,t){if(!(t.state.loading&4)){var n=Hs.get(e);if(n)var r=n.get(null);else{n=new Map,Hs.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var s=o[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}o=t.instance,s=o.getAttribute("data-precedence"),a=n.get(s)||r,a===r&&n.set(null,o),n.set(s,o),this.count++,r=Vs.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 Ri={$$typeof:re,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function V0(e,t,n,r,o,a,s,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=Gn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gn(0),this.hiddenUpdates=Gn(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function wf(e,t,n,r,o,a,s,u,h,k,N,O){return e=new V0(e,t,n,s,h,k,N,O,u),t=1,a===!0&&(t|=24),a=Dn(3,null,null,t),e.current=a,a.stateNode=e,t=Bl(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Kl(a),e}function kf(e){return e?(e=fa,e):fa}function _f(e,t,n,r,o,a){o=kf(o),r.context===null?r.context=o:r.pendingContext=o,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=fo(e,r,t),n!==null&&(Mn(n,e,t),mi(n,e,t))}function Sf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function dd(e,t){Sf(e,t),(e=e.alternate)&&Sf(e,t)}function Ef(e){if(e.tag===13||e.tag===31){var t=Bo(e,67108864);t!==null&&Mn(t,e,67108864),dd(e,67108864)}}function Cf(e){if(e.tag===13||e.tag===31){var t=Wn();t=Zn(t);var n=Bo(e,t);n!==null&&Mn(n,e,t),dd(e,t)}}var Qs=!0;function H0(e,t,n,r){var o=C.T;C.T=null;var a=V.p;try{V.p=2,cd(e,t,n,r)}finally{V.p=a,C.T=o}}function K0(e,t,n,r){var o=C.T;C.T=null;var a=V.p;try{V.p=8,cd(e,t,n,r)}finally{V.p=a,C.T=o}}function cd(e,t,n,r){if(Qs){var o=pd(r);if(o===null)Zu(e,t,r,qs,n),Mf(e,r);else if(q0(o,e,t,n,r))r.stopPropagation();else if(Mf(e,r),t&4&&-1<Q0.indexOf(e)){for(;o!==null;){var a=Jr(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=kn(a.pendingLanes);if(s!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;s;){var h=1<<31-ft(s);u.entanglements[1]|=h,s&=~h}wr(a),(it&6)===0&&(Ps=Ye()+500,Ti(0))}}break;case 31:case 13:u=Bo(a,2),u!==null&&Mn(u,a,2),As(),dd(a,2)}if(a=pd(r),a===null&&Zu(e,t,r,qs,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Zu(e,t,r,null,n)}}function pd(e){return e=no(e),md(e)}var qs=null;function md(e){if(qs=null,e=dr(e),e!==null){var t=P(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=R(t),e!==null)return e;e=null}else if(n===31){if(e=K(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 qs=e,null}function zf(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 st:return 8;case Vt:case Pn:return 32;case No:return 268435456;default:return 32}default:return 32}}var fd=!1,Eo=null,Co=null,zo=null,Di=new Map,Li=new Map,Mo=[],Q0="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 Mf(e,t){switch(e){case"focusin":case"focusout":Eo=null;break;case"dragenter":case"dragleave":Co=null;break;case"mouseover":case"mouseout":zo=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(t.pointerId)}}function Fi(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=Jr(t),t!==null&&Ef(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function q0(e,t,n,r,o){switch(t){case"focusin":return Eo=Fi(Eo,e,t,n,r,o),!0;case"dragenter":return Co=Fi(Co,e,t,n,r,o),!0;case"mouseover":return zo=Fi(zo,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Di.set(a,Fi(Di.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Li.set(a,Fi(Li.get(a)||null,e,t,n,r,o)),!0}return!1}function Tf(e){var t=dr(e.target);if(t!==null){var n=P(t);if(n!==null){if(t=n.tag,t===13){if(t=R(n),t!==null){e.blockedOn=t,Zr(e.priority,function(){Cf(n)});return}}else if(t===31){if(t=K(n),t!==null){e.blockedOn=t,Zr(e.priority,function(){Cf(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 Xs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pd(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cr=r,n.target.dispatchEvent(r),Cr=null}else return t=Jr(n),t!==null&&Ef(t),e.blockedOn=n,!1;t.shift()}return!0}function Pf(e,t,n){Xs(e)&&n.delete(t)}function X0(){fd=!1,Eo!==null&&Xs(Eo)&&(Eo=null),Co!==null&&Xs(Co)&&(Co=null),zo!==null&&Xs(zo)&&(zo=null),Di.forEach(Pf),Li.forEach(Pf)}function Gs(e,t){e.blockedOn===t&&(e.blockedOn=null,fd||(fd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,X0)))}var Zs=null;function If(e){Zs!==e&&(Zs=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Zs===e&&(Zs=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(md(r||n)===null)continue;break}var a=Jr(n);a!==null&&(e.splice(t,3),t-=3,pu(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Fa(e){function t(h){return Gs(h,e)}Eo!==null&&Gs(Eo,e),Co!==null&&Gs(Co,e),zo!==null&&Gs(zo,e),Di.forEach(t),Li.forEach(t);for(var n=0;n<Mo.length;n++){var r=Mo[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mo.length&&(n=Mo[0],n.blockedOn===null);)Tf(n),n.blockedOn===null&&Mo.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],s=o[Wt]||null;if(typeof a=="function")s||If(n);else if(s){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,s=a[Wt]||null)u=s.formAction;else if(md(o)!==null)continue}else u=s.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),If(n)}}}function Af(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(s){return o=s})},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 hd(e){this._internalRoot=e}Js.prototype.render=hd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=Wn();_f(n,r,e,t,null,null)},Js.prototype.unmount=hd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_f(e.current,2,null,e,null,null),As(),t[ur]=null}};function Js(e){this._internalRoot=e}Js.prototype.unstable_scheduleHydration=function(e){if(e){var t=na();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mo.length&&t!==0&&t<Mo[n].priority;n++);Mo.splice(n,0,e),n===0&&Tf(e)}};var jf=l.version;if(jf!=="19.2.1")throw Error(c(527,jf,"19.2.1"));V.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=b(t),e=e!==null?U(e):null,e=e===null?null:e.stateNode,e};var G0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ys=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ys.isDisabled&&Ys.supportsFiber)try{Ht=Ys.inject(G0),At=Ys}catch{}}return Oa.createRoot=function(e,t){if(!v(e))throw Error(c(299));var n=!1,r="",o=Op,a=$p,s=Wp;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&&(s=t.onRecoverableError)),t=wf(e,1,!1,null,null,n,r,null,o,a,s,Af),e[ur]=t.current,Gu(e),new hd(t)},Oa.hydrateRoot=function(e,t,n){if(!v(e))throw Error(c(299));var r=!1,o="",a=Op,s=$p,u=Wp,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&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=wf(e,1,!0,t,n??null,r,o,h,a,s,u,Af),t.context=kf(null),n=t.current,r=Wn(),r=Zn(r),o=mo(r),o.callback=null,fo(n,o,r),n=r,t.current.lanes=n,lr(t,n),wr(t),e[ur]=t.current,Gu(e),new Js(t)},Oa.version="19.2.1",Oa}var Md;function Of(){if(Md)return tl.exports;Md=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(l){console.error(l)}}return i(),tl.exports=Ff(),tl.exports}var $f=Of();const Td=Io($f);var Pd={exports:{}},$a={};/**
|
|
42
42
|
* @license React
|
|
43
43
|
* react-jsx-runtime.production.js
|
|
44
44
|
*
|
|
@@ -46,114 +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
|
|
49
|
+
*/var Id;function Wf(){if(Id)return $a;Id=1;var i=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function d(c,v,P){var R=null;if(P!==void 0&&(R=""+P),v.key!==void 0&&(R=""+v.key),"key"in v){P={};for(var K in v)K!=="key"&&(P[K]=v[K])}else P=v;return v=P.ref,{$$typeof:i,type:c,key:R,ref:v!==void 0?v:null,props:P}}return $a.Fragment=l,$a.jsx=d,$a.jsxs=d,$a}var Ad;function Bf(){return Ad||(Ad=1,Pd.exports=Wf()),Pd.exports}var m=Bf(),rl=Cd();/**
|
|
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
|
|
54
|
+
*/const jd=(...i)=>i.filter((l,d,c)=>!!l&&l.trim()!==""&&c.indexOf(l)===d).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
|
|
59
|
+
*/const Uf=i=>i.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
|
|
64
|
+
*/const Vf=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,d,c)=>c?c.toUpperCase():d.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
|
|
69
|
+
*/const Nd=i=>{const l=Vf(i);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
|
|
74
|
+
*/var Hf={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
|
|
79
|
+
*/const Kf=i=>{for(const l in i)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 Qf=x.forwardRef(({color:
|
|
84
|
+
*/const Qf=x.forwardRef(({color:i="currentColor",size:l=24,strokeWidth:d=2,absoluteStrokeWidth:c,className:v="",children:P,iconNode:R,...K},_)=>x.createElement("svg",{ref:_,...Hf,width:l,height:l,stroke:i,strokeWidth:c?Number(d)*24/Number(l):d,className:jd("lucide",v),...!P&&!Kf(K)&&{"aria-hidden":"true"},...K},[...R.map(([b,U])=>x.createElement(b,U)),...Array.isArray(P)?P:[P]]));/**
|
|
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
|
|
89
|
+
*/const Tn=(i,l)=>{const d=x.forwardRef(({className:c,...v},P)=>x.createElement(Qf,{ref:P,iconNode:l,className:jd(`lucide-${Uf(Nd(i))}`,`lucide-${i}`,c),...v}));return d.displayName=Nd(i),d};/**
|
|
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 qf=
|
|
94
|
+
*/const qf=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
|
|
99
|
+
*/const Xf=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
|
|
104
|
+
*/const Gf=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
|
|
109
|
+
*/const Zf=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
|
|
114
|
+
*/const Jf=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
|
|
119
|
+
*/const Yf=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
|
|
124
|
+
*/const ol=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
|
|
129
|
+
*/const Rd=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
|
|
134
|
+
*/const Dd=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
|
|
139
|
+
*/const eh=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
|
|
144
|
+
*/const Ld=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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Fd=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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const al=Tn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),xn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Od=`
|
|
145
155
|
.admesh-publisher-panel {
|
|
146
156
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
147
157
|
text-align: left;
|
|
148
158
|
line-height: 1.5;
|
|
149
159
|
-webkit-font-smoothing: antialiased;
|
|
150
160
|
}
|
|
151
|
-
.admesh-publisher-panel *${
|
|
161
|
+
.admesh-publisher-panel *${xn}, .admesh-publisher-panel *${xn}::before, .admesh-publisher-panel *${xn}::after {
|
|
152
162
|
box-sizing: border-box;
|
|
153
163
|
}
|
|
154
|
-
.admesh-publisher-panel button${
|
|
155
|
-
.admesh-publisher-panel button${
|
|
156
|
-
.admesh-publisher-panel button${
|
|
164
|
+
.admesh-publisher-panel button${xn}, .admesh-publisher-panel input${xn} { font-family: inherit; }
|
|
165
|
+
.admesh-publisher-panel button${xn} { transition: border-color 150ms ease, background-color 150ms ease; }
|
|
166
|
+
.admesh-publisher-panel button${xn}:focus-visible, .admesh-publisher-panel a${xn}:focus-visible {
|
|
157
167
|
outline: 2px solid var(--publisher-accent);
|
|
158
168
|
outline-offset: 2px;
|
|
159
169
|
}
|
|
@@ -167,19 +177,19 @@ Error generating stack: `+r.message+`
|
|
|
167
177
|
}
|
|
168
178
|
.admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
|
|
169
179
|
.admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
|
|
170
|
-
.admesh-publisher-panel input${
|
|
171
|
-
.admesh-publisher-panel a${
|
|
180
|
+
.admesh-publisher-panel input${xn} { min-width: 0; }
|
|
181
|
+
.admesh-publisher-panel a${xn} { text-underline-offset: 3px; }
|
|
172
182
|
@media (prefers-reduced-motion: reduce) {
|
|
173
|
-
.admesh-publisher-panel *${
|
|
183
|
+
.admesh-publisher-panel *${xn}, .admesh-publisher-panel *${xn}::before, .admesh-publisher-panel *${xn}::after {
|
|
174
184
|
animation: none !important;
|
|
175
185
|
transition: none !important;
|
|
176
186
|
scroll-behavior: auto !important;
|
|
177
187
|
}
|
|
178
188
|
}
|
|
179
189
|
@media (max-width: 767px) {
|
|
180
|
-
.admesh-publisher-panel:not([data-compact="true"]) input${
|
|
190
|
+
.admesh-publisher-panel:not([data-compact="true"]) input${xn} { font-size: 16px !important; }
|
|
181
191
|
}
|
|
182
|
-
`;function Jf({value:s,onChange:l,onSend:d,onStop:c,onSuggestion:v,suggestions:I,registerSuggestion:D,open:q,onOpenChange:_,loading:y,analyzing:B,compact:C,expanded:W,suggestionPlacement:M="below",showLogo:A=!0,logoUrl:H,title:U,placeholder:ee,colors:te}){const re=x.useId(),ne=x.useRef(null),ie=x.useRef(null),Q=x.useRef(null),[O,fe]=x.useState({visibility:"hidden"}),le=q&&!y&&(B||I.length>0);x.useLayoutEffect(()=>{var oe;if(!le)return;const ue=()=>{var Pe,E;const V=(Pe=ne.current)==null?void 0:Pe.getBoundingClientRect();if(!V)return;const se=((E=window.visualViewport)==null?void 0:E.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=se-V.bottom-16,f=V.top-16,P=M==="above"?!(f<96&&Ee>f):Ee<96&&f>Ee;fe({position:"fixed",left:Math.max(8,Math.min(V.left,ke-V.width-8)),width:Math.min(V.width,ke-16),maxHeight:Math.max(40,Math.min(300,P?f:Ee)),...P?{bottom:window.innerHeight-V.top+8}:{top:V.bottom+8},zIndex:2147483002})},xe=Pe=>{var E,V;const se=Pe.target;!((E=ne.current)!=null&&E.contains(se))&&!((V=Q.current)!=null&&V.contains(se))&&_(!1)};return ue(),window.addEventListener("resize",ue),window.addEventListener("scroll",ue,!0),(oe=window.visualViewport)==null||oe.addEventListener("resize",ue),document.addEventListener("pointerdown",xe),()=>{var Pe;window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue,!0),(Pe=window.visualViewport)==null||Pe.removeEventListener("resize",ue),document.removeEventListener("pointerdown",xe)}},[le,M,_]);const ge=oe=>{var ue,xe;!((ue=ne.current)!=null&&ue.contains(oe))&&!((xe=Q.current)!=null&&xe.contains(oe))&&_(!1)},$e=()=>{!s.trim()||y||(_(!1),d())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:ne,className:"admesh-publisher-composer",onBlur:oe=>ge(oe.relatedTarget),onClick:oe=>{var ue;oe.target.closest("button, a")||((ue=ie.current)==null||ue.focus(),_(!0))},style:{display:"flex",alignItems:"center",gap:C?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${te.border}`,borderRadius:8,background:te.surface,cursor:"text",padding:C?"6px":"8px 8px 8px 12px"},children:[A&&!W&&m.jsx("div",{style:{width:C?24:32,height:C?24:32,display:"grid",placeItems:"center",flexShrink:0,color:te.accent},children:H?m.jsx("img",{src:H,alt:`${U} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(tl,{size:C?18:21,strokeWidth:1.5,"aria-label":U})}),m.jsx("input",{ref:ie,type:"text",value:s,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":le,"aria-controls":le?re:void 0,onFocus:()=>_(!0),onChange:oe=>{l(oe.target.value),_(!0)},onKeyDown:oe=>{var ue,xe;oe.nativeEvent.isComposing||(oe.key==="Escape"&&(oe.preventDefault(),_(!1)),oe.key==="ArrowDown"&&(oe.preventDefault(),le?(xe=(ue=Q.current)==null?void 0:ue.querySelector("button"))==null||xe.focus():_(!0)),oe.key==="Enter"&&(oe.preventDefault(),$e()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:C?"6px 0":"10px 0",fontSize:C?13:15,color:te.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:C?8:9,lineHeight:1.3,color:te.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&&!s.trim(),onClick:y?c:$e,style:{display:"grid",placeItems:"center",flexShrink:0,width:C?32:40,height:C?32:40,border:"none",borderRadius:6,background:te.accent,color:te.accentText,cursor:"pointer",opacity:!y&&!s.trim()?.5:1},children:y?m.jsx(Zf,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(Kf,{size:18,"aria-hidden":"true"})})]}),le&&el.createPortal(m.jsxs("div",{ref:Q,id:re,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:oe=>ge(oe.relatedTarget),onKeyDown:oe=>{var ue,xe,Pe,E;if(oe.key==="Escape"&&(oe.preventDefault(),(ue=ie.current)==null||ue.focus(),_(!1)),oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const V=Array.from(((xe=Q.current)==null?void 0:xe.querySelectorAll("button"))??[]),se=V.indexOf(document.activeElement)+(oe.key==="ArrowDown"?1:-1);se<0?(Pe=ie.current)==null||Pe.focus():(E=V[Math.min(se,V.length-1)])==null||E.focus()}},style:{...O,"--publisher-accent":te.accent,padding:6,border:`1px solid ${te.border}`,borderRadius:10,background:te.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Td}),B&&!I.length?m.jsx("div",{role:"status",style:{padding:12,color:te.muted,fontSize:13},children:"Finding suggested questions\u2026"}):I.map(oe=>m.jsxs("button",{ref:D(oe.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":oe.is_sponsored?"true":void 0,onClick:()=>{_(!1),v(oe)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${oe.is_sponsored?te.accent:te.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:oe.is_sponsored?te.accent:te.surface,color:oe.is_sponsored?te.accentText:te.text},children:[m.jsx("span",{children:oe.text}),oe.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},oe.id))]}),document.body)]})}let Ao=!1;try{typeof globalThis.importMeta<"u"&&(Br=globalThis.importMeta.env)!=null&&Br.PROD&&(Ao=!0)}catch{}Ao||(Ao=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...s)=>{Ao||console.log(...s)},warn:(...s)=>{Ao||console.warn(...s)},error:(...s)=>{console.error(...s)},info:(...s)=>{Ao||console.info(...s)},debug:(...s)=>{Ao||console.debug(...s)}};function Yf(s,l,d){const c=s*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...d}}function eh(s){return s<768?"mobile":s<1024?"tablet":"desktop"}function th(s){const l=s.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,v=l.height,I=l.width;if(v===0||I===0)return 0;const D=Math.max(0,l.top),q=Math.min(d,l.bottom),_=Math.max(0,l.left),y=Math.min(c,l.right),B=Math.max(0,q-D),C=Math.max(0,y-_),W=B*C,M=v*I;return M>0?W/M:0}function Ld(){const s=window.innerHeight,l=document.documentElement.scrollHeight,d=window.pageYOffset||document.documentElement.scrollTop,c=l-s;return c<=0?100:Math.min(100,d/c*100)}function nh(s){const l=s.getBoundingClientRect(),d=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+d,left:l.left+c}}function rh(s){const l=s.getBoundingClientRect(),d=nh(s),c=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,I=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:eh(c),viewportWidth:c,viewportHeight:v,adWidth:l.width,adHeight:l.height,adPositionTop:d.top,adPositionLeft:d.left,isDarkMode:I,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function oh(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function ah(s,l,d){return s>=d.visibilityThreshold&&l>=d.minimumDuration}function Fd(s=new Date){return s.toISOString()}function ih(s){return s.length===0?0:s.reduce((l,d)=>l+d,0)/s.length}function $d(s,l){let d;return function(...c){d||(s(...c),d=!0,setTimeout(()=>d=!1,l))}}let sh={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},lh=!1;function uh({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:v,config:I}){const D={...sh,...I},q=x.useRef(oh()),[_,y]=x.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Fd(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:D.enabled}),B=x.useRef(null),C=x.useRef(null),W=x.useRef(null),M=x.useRef(null),A=x.useRef(null),H=x.useRef([]),U=x.useRef([]),ee=x.useRef(null),te=x.useCallback(Q=>{D.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[D.debug]),re=x.useCallback(async(Q,O)=>{if(!(!D.enabled||lh||!v.current||!B.current)&&(te(`Analytics disabled - skipping event: ${Q}`),D.onEvent)){const fe=rh(v.current),le={eventType:Q,timestamp:Fd(),sessionId:q.current,productId:s,offerId:l,agentId:d,recommendationId:c,timeMetrics:_.timeMetrics,engagementMetrics:_.engagementMetrics,contextMetrics:fe,mrcStandards:B.current,isViewable:_.isViewable,metadata:O};D.onEvent(le)}},[D,s,l,d,c,v,_,te]),ne=x.useCallback(async()=>{U.current.length!==0&&(te("Analytics disabled - clearing batch without sending"),U.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[te]),ie=x.useCallback($d(()=>{if(!v.current)return;const Q=th(v.current),O=Date.now(),fe=new Date(_.timeMetrics.loadedAt).getTime();y(le=>{const ge={...le};Q>0&&H.current.push(Q);const $e=le.isVisible,oe=Q>0;if(oe&&!$e)C.current=O,ge.engagementMetrics.viewportEnterCount++,ge.timeMetrics.timeToFirstVisible||(ge.timeMetrics.timeToFirstVisible=O-fe,ge.engagementMetrics.scrollDepthAtFirstVisible=Ld(),re("ad_visible"));else if(!oe&&$e){if(C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=null}ge.engagementMetrics.viewportExitCount++,re("ad_hidden")}else if(oe&&$e&&C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=O}if(ge.isVisible=oe,ge.visibilityPercentage=Q,Q>ge.engagementMetrics.maxVisibilityPercentage&&(ge.engagementMetrics.maxVisibilityPercentage=Q),H.current.length>0&&(ge.engagementMetrics.averageVisibilityPercentage=ih(H.current)),B.current){const ue=le.isViewable,xe=ah(Q,ge.timeMetrics.totalVisibleDuration,B.current);if(xe&&!ue)ge.isViewable=!0,ge.timeMetrics.timeToViewable=O-fe,W.current=O,re("ad_viewable");else if(xe&&ue&&W.current){const Pe=O-W.current;ge.timeMetrics.totalViewableDuration+=Pe,W.current=O}}return ge.engagementMetrics.currentScrollDepth=Ld(),ge})},100),[v,_.timeMetrics.loadedAt,re]);return x.useEffect(()=>{if(!v.current)return;const Q=v.current.getBoundingClientRect();B.current=Yf(Q.width,Q.height,D.mrcStandards),te("Initialized MRC standards"),re("ad_loaded")},[v,D.mrcStandards,te,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=new IntersectionObserver(O=>{O.forEach(()=>{ie()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(v.current),()=>{Q.disconnect()}},[D.enabled,v,ie]),x.useEffect(()=>{if(!D.enabled)return;const Q=$d(()=>{ie()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[D.enabled,ie]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{M.current=Date.now(),y(le=>({...le,engagementMetrics:{...le.engagementMetrics,hoverCount:le.engagementMetrics.hoverCount+1}})),re("ad_hover_start")},fe=()=>{if(M.current){const le=Date.now()-M.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalHoverDuration:ge.timeMetrics.totalHoverDuration+le}})),M.current=null,re("ad_hover_end",{hoverDuration:le})}};return Q.addEventListener("mouseenter",O),Q.addEventListener("mouseleave",fe),()=>{Q.removeEventListener("mouseenter",O),Q.removeEventListener("mouseleave",fe)}},[D.enabled,v,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{A.current=Date.now(),re("ad_focus")},fe=()=>{if(A.current){const le=Date.now()-A.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalFocusDuration:ge.timeMetrics.totalFocusDuration+le}})),A.current=null,re("ad_blur",{focusDuration:le})}};return Q.addEventListener("focus",O),Q.addEventListener("blur",fe),()=>{Q.removeEventListener("focus",O),Q.removeEventListener("blur",fe)}},[D.enabled,v,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{y(fe=>({...fe,engagementMetrics:{...fe.engagementMetrics,wasClicked:!0}})),re("ad_click")};return Q.addEventListener("click",O),()=>{Q.removeEventListener("click",O)}},[D.enabled,v,re]),x.useEffect(()=>()=>{const Q=Date.now(),O=new Date(_.timeMetrics.loadedAt).getTime(),fe=Q-O;y(le=>({...le,timeMetrics:{...le.timeMetrics,sessionDuration:fe}})),re("ad_unloaded",{sessionDuration:fe}),ne()},[]),_}const rl=({productId:s,offerId:l,agentId:d,recommendationId:c,exposureUrl:v,sessionId:I,triggerExposureUrl:D=!0,children:q,config:_,className:y,style:B,onViewabilityChange:C,onVisible:W,onViewable:M,onClick:A})=>{const H=x.useRef(null),U=x.useRef(!1),ee=uh({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:H,config:_}),te=x.useRef(ee.isViewable);x.useEffect(()=>{U.current=!1,te.current=!1},[v,c,I]),x.useEffect(()=>{ee.isViewable!==te.current&&(te.current=ee.isViewable,C&&C(ee.isViewable),ee.isViewable&&M&&M(),ee.isViewable&&!U.current&&D&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:v?"present":"MISSING",sessionId:I?"present":"MISSING",recommendationId:c}),v&&I?(U.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",v),fetch(v,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ie=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ie),U.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!v,hasSessionId:!!I})))},[ee.isViewable,C,M,v,I,c,D]);const re=x.useRef(ee.isVisible);x.useEffect(()=>{ee.isVisible!==re.current&&(re.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const ne=()=>{A&&A()};return m.jsx("div",{ref:H,className:y,style:B,onClick:ne,"data-admesh-viewability-tracker":!0,"data-recommendation-id":c,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:q})};rl.displayName="AdMeshViewabilityTracker";const Od=s=>{try{return new URL(s),!0}catch{return!1}},na=s=>typeof s=="string"?s.trim():typeof s=="number"?String(s):"",Jn=s=>na(s)||void 0,dh=s=>s&&s.trim()?s.trim():"",ch=(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 na(s)},Wd=({recommendations:s,theme:l,className:d="",style:c={},sessionId:v,triggerExposureUrl:I=!0,onDelegationConsent:D,onDelegationActivated:q,onStartDelegation:_,onRecommendationReport:y})=>{var B,C,W,M,A,H,U,ee,te;if(!s||s.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const re=s[0],ne=re?.recommendation,ie=ne?.creative,Q=re?.tracking,O=re?.delegation,fe=re?.recommendation_id||"",le=ne?.offerId||"",ge=ie?.brand_name||"",$e=ie?.headline||"",oe=ie?.description||"",ue=ie?.logo_url||"",xe=Q?.click_url||ie?.landing_page_url||"",Pe=Q?.exposure_url||"",E=ne?.disclosure||"Sponsored",V=ie?.products||[],se=V.slice(0,4),ke=V.length>1,Ee=(ne?.format||"tail")==="bridge",f=O?.available===!0,P=Ee&&f,G=O?.brand_name||ge,Y="Talk to Agent",_e=dh(ie?.cta_text),ye=!ke&&!!_e&&!!xe;if(!ge&&!$e&&!oe)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:fe}),null;const ze=$e&&$e!==ge?$e:ge,Le=oe,Re=ge.trim().toLowerCase(),De=ze.trim().toLowerCase(),Be=!!ge&&Re!==De,[qt,ae]=x.useState(!1),[ce,be]=x.useState(!1),[Ie,je]=x.useState(!1),[J,Oe]=x.useState(null),X=x.useRef(null);x.useEffect(()=>()=>{X.current&&(X.current(!1),X.current=null)},[]);const Ve=ve=>{var tt;ve&&be(!0),(tt=X.current)==null||tt.call(X,ve),X.current=null,ve||(be(!1),ae(!1))},Ge=async()=>D?await D(re):await new Promise(ve=>{X.current=ve,ae(!0)}),K=(ve,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:fe,productId:le,clickUrl:xe,source:ve}).catch(()=>{F.error(`[AdMesh] Failed to track ${ve} click`)})},Je=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=ve=>{ve.preventDefault(),ve.stopPropagation(),!J&&je(tt=>!tt)},un=async(ve,tt)=>{if(ve.preventDefault(),ve.stopPropagation(),je(!1),Oe(tt),!!y)try{await y({recommendation:re,recommendation_id:fe,reason:tt,session_id:v})}catch(Jt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",Jt)}},it=()=>{ke||!xe||(K("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},Kt=ve=>{ke||!xe||(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),it())},Mn=async()=>{if(fe&&v)try{const ve=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${ve}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:fe,session_id:v,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(ve){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",ve)}},Mo=async ve=>{if(ve.preventDefault(),ve.stopPropagation(),!re||!P||(K("compact_tail_ad_delegation_cta"),!await Ge()))return;Mn();const tt=O!=null&&O.available?{recommendation_id:re.recommendation_id,brand_id:Jn(O.brand_id),brand_name:Jn(O.brand_name||ie?.brand_name),mcp_endpoint:Jn(O.mcp_endpoint),eligibility_reason:Jn(O.eligibility_reason),delegate_reason:Jn(O.delegate_reason),session_goal:Jn(O.session_goal),desired_outcome_type:O.desired_outcome_type,required_user_inputs:Array.isArray(O.required_user_inputs)?O.required_user_inputs.filter(Jt=>typeof Jt=="string"):[],required_consent_types:Array.isArray(O.required_consent_types)?O.required_consent_types.filter(Jt=>typeof Jt=="string"):[],success_outcome:Jn(O.success_outcome),fallback_message:Jn(O.fallback_message),session_mode:Jn(O.session_mode),status:Jn(O.status),capabilities:O.capabilities||[],allowed_data_types:O.allowed_data_types||[],consent_requirements:O.consent_requirements||[],auth_model:Jn(O.auth_model),handoff_protocol:O.handoff_protocol&&typeof O.handoff_protocol=="object"?O.handoff_protocol:void 0,supported_actions:O.supported_actions||[],metadata:O.metadata&&typeof O.metadata=="object"?O.metadata:void 0,platform_response:re}:null;if(q&&tt){try{await q(tt)}finally{be(!1),ae(!1)}return}if(_){try{await _(re)}finally{be(!1),ae(!1)}return}be(!1),ae(!1)},[yn,Vr]=x.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Rt=l?.surfaceColor||((C=(B=l?.components)==null?void 0:B.card)==null?void 0:C.backgroundColor)||(Xt?"#111827":"#ffffff"),ot=l?.borderColor||((M=(W=l?.components)==null?void 0:W.card)==null?void 0:M.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),mt=((A=l?.shadows)==null?void 0:A.medium)||((U=(H=l?.components)==null?void 0:H.card)==null?void 0:U.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),qe="#2563eb",dn=Xt?"#9ca3af":"#6b7280",Ur=Xt?"#e5e7eb":"#374151",pn=Xt?"#f9fafb":"#0f172a",me=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",mn="50px",vn=P||ye?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[P?m.jsx("button",{type:"button",onClick:Mo,style:{background:"none",border:"none",padding:0,color:qe,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ye?m.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:ve=>K("compact_tail_ad_cta",ve),style:{color:qe,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(rl,{productId:le,recommendationId:fe,exposureUrl:Pe,sessionId:v,triggerExposureUrl:I,className:`admesh-compact-tail-ad ${d}`,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:[m.jsx("style",{children:`
|
|
192
|
+
`;function th({value:i,onChange:l,onSend:d,onStop:c,onSuggestion:v,suggestions:P,registerSuggestion:R,open:K,onOpenChange:_,loading:b,analyzing:U,compact:E,expanded:W,suggestionPlacement:I="below",showLogo:M=!0,logoUrl:B,title:H,placeholder:ee,colors:te}){const re=x.useId(),ne=x.useRef(null),ie=x.useRef(null),Q=x.useRef(null),[$,fe]=x.useState({visibility:"hidden"}),le=K&&!b&&(U||P.length>0);x.useLayoutEffect(()=>{var oe;if(!le)return;const ue=()=>{var Te,C;const V=(Te=ne.current)==null?void 0:Te.getBoundingClientRect();if(!V)return;const se=((C=window.visualViewport)==null?void 0:C.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ce=se-V.bottom-16,f=V.top-16,T=I==="above"?!(f<96&&Ce>f):Ce<96&&f>Ce;fe({position:"fixed",left:Math.max(8,Math.min(V.left,ke-V.width-8)),width:Math.min(V.width,ke-16),maxHeight:Math.max(40,Math.min(300,T?f:Ce)),...T?{bottom:window.innerHeight-V.top+8}:{top:V.bottom+8},zIndex:2147483002})},ye=Te=>{var C,V;const se=Te.target;!((C=ne.current)!=null&&C.contains(se))&&!((V=Q.current)!=null&&V.contains(se))&&_(!1)};return ue(),window.addEventListener("resize",ue),window.addEventListener("scroll",ue,!0),(oe=window.visualViewport)==null||oe.addEventListener("resize",ue),document.addEventListener("pointerdown",ye),()=>{var Te;window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue,!0),(Te=window.visualViewport)==null||Te.removeEventListener("resize",ue),document.removeEventListener("pointerdown",ye)}},[le,I,_]);const be=oe=>{var ue,ye;!((ue=ne.current)!=null&&ue.contains(oe))&&!((ye=Q.current)!=null&&ye.contains(oe))&&_(!1)},Oe=()=>{!i.trim()||b||(_(!1),d())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:ne,className:"admesh-publisher-composer",onBlur:oe=>be(oe.relatedTarget),onClick:oe=>{var ue;oe.target.closest("button, a")||((ue=ie.current)==null||ue.focus(),_(!0))},style:{display:"flex",alignItems:"center",gap:E?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${te.border}`,borderRadius:8,background:te.surface,cursor:"text",padding:E?"6px":"8px 8px 8px 12px"},children:[M&&!W&&m.jsx("div",{style:{width:E?24:32,height:E?24:32,display:"grid",placeItems:"center",flexShrink:0,color:te.accent},children:B?m.jsx("img",{src:B,alt:`${H} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(ol,{size:E?18:21,strokeWidth:1.5,"aria-label":H})}),m.jsx("input",{ref:ie,type:"text",value:i,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":le,"aria-controls":le?re:void 0,onFocus:()=>_(!0),onChange:oe=>{l(oe.target.value),_(!0)},onKeyDown:oe=>{var ue,ye;oe.nativeEvent.isComposing||(oe.key==="Escape"&&(oe.preventDefault(),_(!1)),oe.key==="ArrowDown"&&(oe.preventDefault(),le?(ye=(ue=Q.current)==null?void 0:ue.querySelector("button"))==null||ye.focus():_(!0)),oe.key==="Enter"&&(oe.preventDefault(),Oe()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:E?"6px 0":"10px 0",fontSize:E?13:15,color:te.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:E?8:9,lineHeight:1.3,color:te.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":b?"Stop generating":"Send message",disabled:!b&&!i.trim(),onClick:b?c:Oe,style:{display:"grid",placeItems:"center",flexShrink:0,width:E?32:40,height:E?32:40,padding:0,margin:0,minWidth:0,border:"none",borderRadius:6,background:te.accent,color:te.accentText,cursor:"pointer",opacity:!b&&!i.trim()?.5:1},children:b?m.jsx(eh,{size:14,fill:"currentColor",style:{flexShrink:0},"aria-hidden":"true"}):m.jsx(Xf,{size:18,style:{flexShrink:0},"aria-hidden":"true"})})]}),le&&rl.createPortal(m.jsxs("div",{ref:Q,id:re,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:oe=>be(oe.relatedTarget),onKeyDown:oe=>{var ue,ye,Te,C;if(oe.key==="Escape"&&(oe.preventDefault(),(ue=ie.current)==null||ue.focus(),_(!1)),oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const V=Array.from(((ye=Q.current)==null?void 0:ye.querySelectorAll("button"))??[]),se=V.indexOf(document.activeElement)+(oe.key==="ArrowDown"?1:-1);se<0?(Te=ie.current)==null||Te.focus():(C=V[Math.min(se,V.length-1)])==null||C.focus()}},style:{...$,"--publisher-accent":te.accent,padding:6,border:`1px solid ${te.border}`,borderRadius:10,background:te.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Od}),U&&!P.length?m.jsx("div",{role:"status",style:{padding:12,color:te.muted,fontSize:13},children:"Finding suggested questions\u2026"}):P.map(oe=>m.jsxs("button",{ref:R(oe.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":oe.is_sponsored?"true":void 0,onClick:()=>{_(!1),v(oe)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${oe.is_sponsored?te.accent:te.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:oe.is_sponsored?te.accent:te.surface,color:oe.is_sponsored?te.accentText:te.text},children:[m.jsx("span",{children:oe.text}),oe.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},oe.id))]}),document.body)]})}let Ao=!1;try{typeof globalThis.importMeta<"u"&&(Qr=globalThis.importMeta.env)!=null&&Qr.PROD&&(Ao=!0)}catch{}Ao||(Ao=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...i)=>{Ao||console.log(...i)},warn:(...i)=>{Ao||console.warn(...i)},error:(...i)=>{console.error(...i)},info:(...i)=>{Ao||console.info(...i)},debug:(...i)=>{Ao||console.debug(...i)}};function nh(i,l,d){const c=i*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...d}}function rh(i){return i<768?"mobile":i<1024?"tablet":"desktop"}function oh(i){const l=i.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,v=l.height,P=l.width;if(v===0||P===0)return 0;const R=Math.max(0,l.top),K=Math.min(d,l.bottom),_=Math.max(0,l.left),b=Math.min(c,l.right),U=Math.max(0,K-R),E=Math.max(0,b-_),W=U*E,I=v*P;return I>0?W/I:0}function $d(){const i=window.innerHeight,l=document.documentElement.scrollHeight,d=window.pageYOffset||document.documentElement.scrollTop,c=l-i;return c<=0?100:Math.min(100,d/c*100)}function ah(i){const l=i.getBoundingClientRect(),d=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+d,left:l.left+c}}function ih(i){const l=i.getBoundingClientRect(),d=ah(i),c=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,P=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:rh(c),viewportWidth:c,viewportHeight:v,adWidth:l.width,adHeight:l.height,adPositionTop:d.top,adPositionLeft:d.left,isDarkMode:P,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function sh(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function lh(i,l,d){return i>=d.visibilityThreshold&&l>=d.minimumDuration}function Wd(i=new Date){return i.toISOString()}function uh(i){return i.length===0?0:i.reduce((l,d)=>l+d,0)/i.length}function Bd(i,l){let d;return function(...c){d||(i(...c),d=!0,setTimeout(()=>d=!1,l))}}let dh={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},ch=!1;function ph({productId:i,offerId:l,agentId:d,recommendationId:c,elementRef:v,config:P}){const R={...dh,...P},K=x.useRef(sh()),[_,b]=x.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Wd(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:R.enabled}),U=x.useRef(null),E=x.useRef(null),W=x.useRef(null),I=x.useRef(null),M=x.useRef(null),B=x.useRef([]),H=x.useRef([]),ee=x.useRef(null),te=x.useCallback(Q=>{R.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[R.debug]),re=x.useCallback(async(Q,$)=>{if(!(!R.enabled||ch||!v.current||!U.current)&&(te(`Analytics disabled - skipping event: ${Q}`),R.onEvent)){const fe=ih(v.current),le={eventType:Q,timestamp:Wd(),sessionId:K.current,productId:i,offerId:l,agentId:d,recommendationId:c,timeMetrics:_.timeMetrics,engagementMetrics:_.engagementMetrics,contextMetrics:fe,mrcStandards:U.current,isViewable:_.isViewable,metadata:$};R.onEvent(le)}},[R,i,l,d,c,v,_,te]),ne=x.useCallback(async()=>{H.current.length!==0&&(te("Analytics disabled - clearing batch without sending"),H.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[te]),ie=x.useCallback(Bd(()=>{if(!v.current)return;const Q=oh(v.current),$=Date.now(),fe=new Date(_.timeMetrics.loadedAt).getTime();b(le=>{const be={...le};Q>0&&B.current.push(Q);const Oe=le.isVisible,oe=Q>0;if(oe&&!Oe)E.current=$,be.engagementMetrics.viewportEnterCount++,be.timeMetrics.timeToFirstVisible||(be.timeMetrics.timeToFirstVisible=$-fe,be.engagementMetrics.scrollDepthAtFirstVisible=$d(),re("ad_visible"));else if(!oe&&Oe){if(E.current){const ue=$-E.current;be.timeMetrics.totalVisibleDuration+=ue,E.current=null}be.engagementMetrics.viewportExitCount++,re("ad_hidden")}else if(oe&&Oe&&E.current){const ue=$-E.current;be.timeMetrics.totalVisibleDuration+=ue,E.current=$}if(be.isVisible=oe,be.visibilityPercentage=Q,Q>be.engagementMetrics.maxVisibilityPercentage&&(be.engagementMetrics.maxVisibilityPercentage=Q),B.current.length>0&&(be.engagementMetrics.averageVisibilityPercentage=uh(B.current)),U.current){const ue=le.isViewable,ye=lh(Q,be.timeMetrics.totalVisibleDuration,U.current);if(ye&&!ue)be.isViewable=!0,be.timeMetrics.timeToViewable=$-fe,W.current=$,re("ad_viewable");else if(ye&&ue&&W.current){const Te=$-W.current;be.timeMetrics.totalViewableDuration+=Te,W.current=$}}return be.engagementMetrics.currentScrollDepth=$d(),be})},100),[v,_.timeMetrics.loadedAt,re]);return x.useEffect(()=>{if(!v.current)return;const Q=v.current.getBoundingClientRect();U.current=nh(Q.width,Q.height,R.mrcStandards),te("Initialized MRC standards"),re("ad_loaded")},[v,R.mrcStandards,te,re]),x.useEffect(()=>{if(!R.enabled||!v.current)return;const Q=new IntersectionObserver($=>{$.forEach(()=>{ie()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(v.current),()=>{Q.disconnect()}},[R.enabled,v,ie]),x.useEffect(()=>{if(!R.enabled)return;const Q=Bd(()=>{ie()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[R.enabled,ie]),x.useEffect(()=>{if(!R.enabled||!v.current)return;const Q=v.current,$=()=>{I.current=Date.now(),b(le=>({...le,engagementMetrics:{...le.engagementMetrics,hoverCount:le.engagementMetrics.hoverCount+1}})),re("ad_hover_start")},fe=()=>{if(I.current){const le=Date.now()-I.current;b(be=>({...be,timeMetrics:{...be.timeMetrics,totalHoverDuration:be.timeMetrics.totalHoverDuration+le}})),I.current=null,re("ad_hover_end",{hoverDuration:le})}};return Q.addEventListener("mouseenter",$),Q.addEventListener("mouseleave",fe),()=>{Q.removeEventListener("mouseenter",$),Q.removeEventListener("mouseleave",fe)}},[R.enabled,v,re]),x.useEffect(()=>{if(!R.enabled||!v.current)return;const Q=v.current,$=()=>{M.current=Date.now(),re("ad_focus")},fe=()=>{if(M.current){const le=Date.now()-M.current;b(be=>({...be,timeMetrics:{...be.timeMetrics,totalFocusDuration:be.timeMetrics.totalFocusDuration+le}})),M.current=null,re("ad_blur",{focusDuration:le})}};return Q.addEventListener("focus",$),Q.addEventListener("blur",fe),()=>{Q.removeEventListener("focus",$),Q.removeEventListener("blur",fe)}},[R.enabled,v,re]),x.useEffect(()=>{if(!R.enabled||!v.current)return;const Q=v.current,$=()=>{b(fe=>({...fe,engagementMetrics:{...fe.engagementMetrics,wasClicked:!0}})),re("ad_click")};return Q.addEventListener("click",$),()=>{Q.removeEventListener("click",$)}},[R.enabled,v,re]),x.useEffect(()=>()=>{const Q=Date.now(),$=new Date(_.timeMetrics.loadedAt).getTime(),fe=Q-$;b(le=>({...le,timeMetrics:{...le.timeMetrics,sessionDuration:fe}})),re("ad_unloaded",{sessionDuration:fe}),ne()},[]),_}const il=({productId:i,offerId:l,agentId:d,recommendationId:c,exposureUrl:v,sessionId:P,triggerExposureUrl:R=!0,children:K,config:_,className:b,style:U,onViewabilityChange:E,onVisible:W,onViewable:I,onClick:M})=>{const B=x.useRef(null),H=x.useRef(!1),ee=ph({productId:i,offerId:l,agentId:d,recommendationId:c,elementRef:B,config:_}),te=x.useRef(ee.isViewable);x.useEffect(()=>{H.current=!1,te.current=!1},[v,c,P]),x.useEffect(()=>{ee.isViewable!==te.current&&(te.current=ee.isViewable,E&&E(ee.isViewable),ee.isViewable&&I&&I(),ee.isViewable&&!H.current&&R&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:v?"present":"MISSING",sessionId:P?"present":"MISSING",recommendationId:c}),v&&P?(H.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",v),fetch(v,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ie=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ie),H.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!v,hasSessionId:!!P})))},[ee.isViewable,E,I,v,P,c,R]);const re=x.useRef(ee.isVisible);x.useEffect(()=>{ee.isVisible!==re.current&&(re.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const ne=()=>{M&&M()};return m.jsx("div",{ref:B,className:b,style:U,onClick:ne,"data-admesh-viewability-tracker":!0,"data-recommendation-id":c,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:K})};il.displayName="AdMeshViewabilityTracker";const Ud=i=>{try{return new URL(i),!0}catch{return!1}},ta=i=>typeof i=="string"?i.trim():typeof i=="number"?String(i):"",Xn=i=>ta(i)||void 0,mh=i=>i&&i.trim()?i.trim():"",fh=(i,l)=>{if(i==null||i==="")return"";if(typeof i=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(i)}catch{return String(i)}return ta(i)},Vd=({recommendations:i,theme:l,className:d="",style:c={},sessionId:v,triggerExposureUrl:P=!0,onDelegationConsent:R,onDelegationActivated:K,onStartDelegation:_,onRecommendationReport:b})=>{var U,E,W,I,M,B,H,ee,te;if(!i||i.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const re=i[0],ne=re?.recommendation,ie=ne?.creative,Q=re?.tracking,$=re?.delegation,fe=re?.recommendation_id||"",le=ne?.offerId||"",be=ie?.brand_name||"",Oe=ie?.headline||"",oe=ie?.description||"",ue=ie?.logo_url||"",ye=Q?.click_url||ie?.landing_page_url||"",Te=Q?.exposure_url||"",C=ne?.disclosure||"Sponsored",V=ie?.products||[],se=V.slice(0,4),ke=V.length>1,Ce=(ne?.format||"tail")==="bridge",f=$?.available===!0,T=Ce&&f,G=$?.brand_name||be,Y="Talk to Agent",_e=mh(ie?.cta_text),ve=!ke&&!!_e&&!!ye;if(!be&&!Oe&&!oe)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:fe}),null;const ze=Oe&&Oe!==be?Oe:be,Le=oe,Ne=be.trim().toLowerCase(),Re=ze.trim().toLowerCase(),Ue=!!be&&Ne!==Re,[Ut,ae]=x.useState(!1),[ce,he]=x.useState(!1),[Ie,Ae]=x.useState(!1),[Z,$e]=x.useState(null),X=x.useRef(null);x.useEffect(()=>()=>{X.current&&(X.current(!1),X.current=null)},[]);const Ve=xe=>{var nt;xe&&he(!0),(nt=X.current)==null||nt.call(X,xe),X.current=null,xe||(he(!1),ae(!1))},Ze=async()=>R?await R(re):await new Promise(xe=>{X.current=xe,ae(!0)}),q=(xe,nt)=>{nt&&nt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:fe,productId:le,clickUrl:ye,source:xe}).catch(()=>{F.error(`[AdMesh] Failed to track ${xe} click`)})},Ye=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=xe=>{xe.preventDefault(),xe.stopPropagation(),!Z&&Ae(nt=>!nt)},un=async(xe,nt)=>{if(xe.preventDefault(),xe.stopPropagation(),Ae(!1),$e(nt),!!b)try{await b({recommendation:re,recommendation_id:fe,reason:nt,session_id:v})}catch(qt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",qt)}},st=()=>{ke||!ye||(q("compact_tail_ad_card"),typeof window<"u"&&window.open(ye,"_blank","noopener,noreferrer"))},Vt=xe=>{ke||!ye||(xe.key==="Enter"||xe.key===" ")&&(xe.preventDefault(),st())},Pn=async()=>{if(fe&&v)try{const xe=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",nt=await fetch(`${xe}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:fe,session_id:v,is_test:!1})});nt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",nt.statusText)}catch(xe){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",xe)}},No=async xe=>{if(xe.preventDefault(),xe.stopPropagation(),!re||!T||(q("compact_tail_ad_delegation_cta"),!await Ze()))return;Pn();const nt=$!=null&&$.available?{recommendation_id:re.recommendation_id,brand_id:Xn($.brand_id),brand_name:Xn($.brand_name||ie?.brand_name),mcp_endpoint:Xn($.mcp_endpoint),eligibility_reason:Xn($.eligibility_reason),delegate_reason:Xn($.delegate_reason),session_goal:Xn($.session_goal),desired_outcome_type:$.desired_outcome_type,required_user_inputs:Array.isArray($.required_user_inputs)?$.required_user_inputs.filter(qt=>typeof qt=="string"):[],required_consent_types:Array.isArray($.required_consent_types)?$.required_consent_types.filter(qt=>typeof qt=="string"):[],success_outcome:Xn($.success_outcome),fallback_message:Xn($.fallback_message),session_mode:Xn($.session_mode),status:Xn($.status),capabilities:$.capabilities||[],allowed_data_types:$.allowed_data_types||[],consent_requirements:$.consent_requirements||[],auth_model:Xn($.auth_model),handoff_protocol:$.handoff_protocol&&typeof $.handoff_protocol=="object"?$.handoff_protocol:void 0,supported_actions:$.supported_actions||[],metadata:$.metadata&&typeof $.metadata=="object"?$.metadata:void 0,platform_response:re}:null;if(K&&nt){try{await K(nt)}finally{he(!1),ae(!1)}return}if(_){try{await _(re)}finally{he(!1),ae(!1)}return}he(!1),ae(!1)},[wn,qr]=x.useState(!1),Ht=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,At=l?.surfaceColor||((E=(U=l?.components)==null?void 0:U.card)==null?void 0:E.backgroundColor)||(Ht?"#111827":"#ffffff"),at=l?.borderColor||((I=(W=l?.components)==null?void 0:W.card)==null?void 0:I.borderColor)||(Ht?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),ft=((M=l?.shadows)==null?void 0:M.medium)||((H=(B=l?.components)==null?void 0:B.card)==null?void 0:H.boxShadow)||(Ht?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),Qe="#2563eb",dn=Ht?"#9ca3af":"#6b7280",Xr=Ht?"#e5e7eb":"#374151",fn=Ht?"#f9fafb":"#0f172a",me=Ht?"rgba(255, 255, 255, 0.04)":"#f8fafc",hn="50px",kn=T||ve?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[T?m.jsx("button",{type:"button",onClick:No,style:{background:"none",border:"none",padding:0,color:Qe,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ve?m.jsx("a",{href:ye,target:"_blank",rel:"noopener noreferrer",onClick:xe=>q("compact_tail_ad_cta",xe),style:{color:Qe,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(il,{productId:le,recommendationId:fe,exposureUrl:Te,sessionId:v,triggerExposureUrl:P,className:`admesh-compact-tail-ad ${d}`,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:[m.jsx("style",{children:`
|
|
183
193
|
.admesh-compact-tail-ad,
|
|
184
194
|
.admesh-compact-tail-ad * {
|
|
185
195
|
box-sizing: border-box;
|
|
@@ -232,9 +242,9 @@ Error generating stack: `+r.message+`
|
|
|
232
242
|
min-height: 34px;
|
|
233
243
|
}
|
|
234
244
|
}
|
|
235
|
-
`}),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||((te=(ee=l?.components)==null?void 0:ee.card)==null?void 0:te.borderRadius)||"14px",border:`1px solid ${ot}`,background:Rt,boxShadow:mt,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:!yn&&ue&&Od(ue)?m.jsx("img",{src:ue,alt:`${ge} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>Vr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:dn},children:(ge||"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:dn},children:Be?ge:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:dn,textTransform:"uppercase",letterSpacing:"0.08em"},children:E})]}),!ke&&m.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:pn,marginBottom:"4px"},title:ze,children:ze}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Ur},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:se.map(ve=>{const tt=na(ve.product_name)||"Product",Jt=na(ve.product_link)||na(ve.product_url)||xe||"#",Io=ch(ve.product_price,ve.product_currency),Yn=na(ve.product_image_url),cr=Yn&&Od(Yn)?Yn:"",jo=Jt!=="#";return m.jsx("a",{href:Jt,target:jo?"_blank":void 0,rel:jo?"noopener noreferrer":void 0,onClick:Qr=>K(`compact_tail_ad_product_${ve.product_id||"item"}`,Qr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${ot}`,borderRadius:"12px",background:me,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:dn,fontSize:"12px",fontWeight:700},children:cr?m.jsx("img",{src:cr,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:pn,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:tt,children:tt}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:Io&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:pn},children:Io})})]})]})},ve.product_id||`${fe}-${tt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:mn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:vn}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&V.length>se.length?m.jsxs("span",{style:{fontSize:"10px",color:dn},children:["+",V.length-se.length," more"]}):null,m.jsx("button",{type:"button","aria-label":J?"Recommendation reported":"Report recommendation",title:J?"Reported":"Report recommendation",disabled:!!J,onClick:Fe,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${ot}`,background:J?me:Rt,color:J?qe:dn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:J?"default":"pointer",flexShrink:0},children:m.jsx(Xf,{size:13})})]})]}),Ie?m.jsx("div",{className:"admesh-compact-report-panel",onClick:ve=>ve.stopPropagation(),style:{marginLeft:ke?0:mn,border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Je.map(ve=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>un(tt,ve.value),style:{borderRadius:"999px",border:`1px solid ${ot}`,background:Rt,color:pn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:ve.label},ve.value))}):null,J?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:mn,fontSize:"11px",color:dn},children:"Thanks for reporting this recommendation."}):null,qt?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${ot}`,borderRadius:"12px",background:me,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:qe},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:pn,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Ur},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:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!1)},style:{borderRadius:"10px",border:`1px solid ${ot}`,background:Rt,color:pn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:ce?"not-allowed":"pointer",opacity:ce?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!0)},style:{borderRadius:"10px",border:"none",background:qe,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:ce?"wait":"pointer",opacity:ce?.86:1},children:ce?"Connecting...":"Allow agent"})]})]}):null]})]})},ph=({recommendations:s,theme:l,className:d,style:c,sessionId:v,onDelegationConsent:I,onDelegationActivated:D,onStartDelegation:q})=>{const _=s.filter(B=>B&&typeof B=="object"&&typeof B.recommendation_id=="string"&&B.recommendation_id.length>0);if(!_||_.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${_.length} valid recommendations`);const y=()=>{var B;if(_.length>0){const C=_[0],W=(B=C.recommendation)==null?void 0:B.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:W,recommendationKeys:Object.keys(C||{})}),(W==="product_card"||W==="weave"||W==="bridge")&&F.warn(`[AdMeshLayout] ${W} format requested, falling back to tail for canonical render payload`)}return m.jsx(Wd,{recommendations:_,theme:l,sessionId:v,onDelegationConsent:I,onDelegationActivated:D,onStartDelegation:q})};return m.jsx("div",{className:`admesh-layout ${d}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:y()})};class mh{constructor(l){Hr(this,"firedExposures",new Set),Hr(this,"debug",!1),Hr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,d,c){const v=`${c}_${d}`;if(this.firedExposures.has(v)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(v);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,d,c,v){const I=`${c}_${d}`;if(this.firedExposures.has(I)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(D=>{let q=null,_=null;const y=new IntersectionObserver(C=>{C.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?q===null&&(q=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),_=setTimeout(()=>{this.fireExposure(l,d,c),y.disconnect(),D()},this.mrcThreshold.minimumDurationMs)):q!==null&&(_&&(clearTimeout(_),_=null),q=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(v);const B=setTimeout(()=>{y.disconnect(),_&&clearTimeout(_),D()},3e4);v.__admeshTrackerCleanup=()=>{y.disconnect(),_&&clearTimeout(_),clearTimeout(B)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,d,c){this.fireExposure(l,d,c)}fireFollowupEngagement(l,d,c){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})}).catch(v=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",v)}).then(()=>{})}}function fh(s){const l=s.split("/").filter(Boolean),d=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,c=>c.toUpperCase()):"This page"}function hh(){var s;try{console.log("[AdMesh] Starting direct headings extraction...");const l=_=>_.replace(/\s+/g," ").trim(),d=()=>{var _;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],B=["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=(((_=y.map(M=>document.querySelector(M)).filter(M=>!!M).map(M=>{const A=M.cloneNode(!0);A.querySelectorAll(B).forEach(U=>U.remove());const H=l(A.textContent||"");return{element:M,text:H}}).filter(M=>M.text.length>=200).sort((M,A)=>A.text.length-M.text.length)[0])==null?void 0:_.element)||document.body).cloneNode(!0);C.querySelectorAll(B).forEach(M=>M.remove());const W=Array.from(C.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(M=>l(M.textContent||"")).filter(M=>M.length>=24);return(W.length>0?W.join(`
|
|
236
|
-
`):l(
|
|
237
|
-
Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at:new Date().toISOString()}}const Sh=6e4,Ud=3;function Ch(s){const l=kh();if(l)return l;const d=s?.trim();return Bd(d)?d:null}const Qd=({apiKey:s,skipSdkInitialization:l=!1,sessionId:d,extension:c,theme:v,apiBaseUrl:I,language:D,location:q,userId:_,model:y,messages:B,pageContext:C,articleUrl:W,contextMode:M="auto",agentDisplayId:A,children:H})=>{const[U,ee]=x.useState(null),[te,re]=x.useState(new Set),[ne,ie]=x.useState(new Map),[Q,O]=x.useState(null),[fe,le]=x.useState([]),[ge,$e]=x.useState(!1),[oe,ue]=x.useState(null),[xe,Pe]=x.useState(!1),E=x.useRef(!1),V=x.useRef(0),se=x.useRef(null),ke=x.useRef(null);ke.current=Q;const Ee=!!C||M==="ad-slot"||M==="auto"&&(!!(W!=null&&W.trim())||wh()),f=x.useCallback(async()=>{if(C)return C;if(!Ee)return hh();const ae=Ch(W);if(!ae)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ue("Article URL is required for ad-slot context"),null;if(!s)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Vd(ae);try{Pe(!0);const ce=await xh(ae,{apiKey:s,apiBaseUrl:I||"https://api.useadmesh.com",agentDisplayId:A});return F.log("[AdMeshProvider] Page context resolved",{source:ce.source,cache_hit:ce.cache_hit,domain:ce.context.domain}),ce.context}catch(ce){return F.error("[AdMeshProvider] Failed to fetch page context:",ce),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Vd(ae)}finally{Pe(!1)}},[A,I,s,W,C,Ee]),P=x.useCallback((ae,ce)=>{const be=ae.filter(Ie=>!Ie.is_sponsored).slice(0,3);return[ce,...be]},[]),G=x.useCallback((ae,ce)=>{const be=ae.find(je=>je.is_sponsored),Ie=ce.filter(je=>!je.is_sponsored).slice(0,3);return be?[be,...Ie]:Ie},[]);x.useEffect(()=>{if(!d||d.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:",d)},[d]),x.useEffect(()=>{if(!l){if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!d||d.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ae=new Kd({apiKey:s,theme:v,apiBaseUrl:I,extension:c});ee(ae),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",d),I&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ae){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ae)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[s,v,I,d,c,l]);const Y=x.useCallback(async ae=>{var ce;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{$e(!0),ue(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const be=ae??await f();if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ue("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:be.title,headingsCount:be.headings.length,articleTextLength:((ce=be.article_text)==null?void 0:ce.length)||0,domain:be.domain});const Ie=await vh(be,{apiKey:s,apiBaseUrl:I||"https://api.useadmesh.com",extension:c,userId:_});Ie?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Ie.suggestions.length,suggestions:(Ie.suggestions||[]).map(je=>{var J;return{id:je.id,text:je.text,is_sponsored:je.is_sponsored,recommendationId:((J=je.recommendation)==null?void 0:J.recommendation_id)||null}})}),le(je=>G(je,Ie.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ue("Intent analysis failed"),le(je=>je.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),je):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(be){F.error("[AdMeshProvider] Error in intent analysis:",be),ue("Intent analysis error"),le(Ie=>Ie.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Ie):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{$e(!1)}},[s,I,c,_,G,f]),_e=x.useCallback(async ae=>{var ce,be,Ie,je,J,Oe;if(!U||!s||!s.toLowerCase().startsWith("pub_"))return;const X=ae??await f();if(!X){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const Ve=((be=(ce=X.headings)==null?void 0:ce[0])==null?void 0:be.trim())||((Ie=X.title)==null?void 0:Ie.trim());if(!Ve){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 U.fetchPlatformResponse({query:Ve,sessionId:d,messageId:Kd.createMessageId(d),platformSurface:"conversation",model:y,messages:[],language:D,location:q,userId:_}),K=(Oe=(J=(je=Ge.recommendation)==null?void 0:je.creative)==null?void 0:J.follow_up_suggestion)==null?void 0:Oe.trim(),Je=Ge.recommendation_id;if(!K||!Je){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Je,text:K,type:"action",is_sponsored:!0,recommendation:Ge,metadata:{source:"aip_context_prefetch",recommendation_id:Je}};le(un=>P(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Je,suggestionText:K})}catch(Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ge)}},[s,D,q,y,U,d,_,P,f]),ye=x.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);x.useEffect(()=>{!U||E.current||(E.current=!0,(async()=>{const ae=await f();await Promise.allSettled([_e(ae),Y(ae)])})())},[U,Y,_e,f]);const ze=x.useCallback(ae=>{if(!ae||ae.status!=="active")return!1;const ce=Date.parse(ae.expires_at);return Number.isNaN(ce)?!1:ce>Date.now()},[]),Le=x.useCallback(async(ae,ce,be,Ie)=>{const je=Ie??Q;if(!je||!U){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ae,eventType:ce,hasSession:!!je,hasSdk:!!U});return}const J=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,sessionId:je.session_id});const Oe=await fetch(`${U.getApiBaseUrl()}${ae}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({delegation_session_id:je.delegation_session_id,recommendation_id:je.recommendation_id,session_id:je.session_id,event_type:ce,timestamp:J,metadata:be||{}})});if(!Oe.ok){const Ge=await Oe.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ae,eventType:ce,status:Oe.status,errorBody:Ge,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id}),new Error(`Delegation event failed (${Oe.status}): ${Ge}`)}const X=await Oe.json(),Ve=X?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,returnedStatus:Ve?.status||X?.status}),Ve&&O(Ve)},[Q,s,U]),Re=x.useCallback(()=>{V.current=0},[]),De=x.useCallback(async(ae="user_stopped",ce)=>{const be=Q;if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ae,recommendationId:be.recommendation_id,delegationSessionId:be.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ae,...ce||{}},be),await U?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:be.session_id,recommendation_id:be.recommendation_id,delegation_session_id:be.delegation_session_id,brand_name:be.brand_name,status:"stopped",metadata:{reason:ae,...ce||{}}}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Ie)}),V.current=0,se.current=null,O(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,U]),Be=x.useCallback(async(ae="turn_completed",ce)=>{ae==="turn_started"&&Re(),await Le("/aip/delegation/activity",ae,ce)},[Le,Re]);x.useEffect(()=>{const ae=Q?.delegation_session_id??null;ae!==se.current&&(se.current=ae,V.current=0)},[Q?.delegation_session_id]),x.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!U)return;const ae=ke.current;if(!ae||!ze(ae)){O(be=>be?{...be,status:"expired"}:null);return}const ce=window.setInterval(()=>{const be=ke.current;if(!(!be||!ze(be))){if(V.current+=1,V.current>=Ud){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:be.delegation_session_id,heartbeatsSinceLastUserTurn:V.current,idleHeartbeatLimit:Ud}),De("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:V.current}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Ie)});return}Le("/aip/delegation/heartbeat","heartbeat").catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Ie)})}},Sh);return()=>{window.clearInterval(ce)}},[Q?.delegation_session_id,ze,Le,U,De]);const qt={sdk:U,apiKey:s,sessionId:d,theme:v,language:D,location:q,userId:_,model:y,messages:B,processedMessageIds:te,recommendationResults:ne,activeDelegationSession:Q,suggestions:fe,isAnalyzingIntent:ge||xe,intentError:oe,markMessageAsProcessed:ae=>{re(ce=>{const be=new Set(ce);return be.add(ae),be})},isMessageProcessed:ae=>te.has(ae),setRecommendationResult:(ae,ce)=>{ie(be=>{const Ie=new Map(be);return Ie.set(ae,ce),Ie}),re(be=>{const Ie=new Set(be);return Ie.add(ae),Ie})},getRecommendationResult:ae=>ne.get(ae),hasRecommendationResult:ae=>ne.has(ae),setActiveDelegationSession:ae=>{O(ae)},getActiveDelegationSession:()=>ze(Q)?Q:null,hasActiveDelegationSession:()=>ze(Q),refreshDelegationActivity:Be,stopDelegationSession:De,retryIntentAnalysis:ye};return m.jsx(Xd.Provider,{value:qt,children:H})};class Eh{constructor(){Hr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const d=l.response.recommendations||[];if(d.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 v=this.roots.get(l.containerId);v&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),v.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const I=Ed.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),I.render(m.jsx(Qd,{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(ph,{recommendations:d,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,I)}catch(d){throw F.error("[AdMeshRenderer] Error rendering recommendations"),d}}unmount(l){const d=this.roots.get(l);if(d){d.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 zh=s=>{if(typeof s!="string")return;const l=s.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},qd=class Eo{constructor(l){if(Hr(this,"config"),Hr(this,"apiBaseUrl"),Hr(this,"renderer",null),Hr(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,d){return`${l}::${d}`}getExtensionSourceDomain(){var l,d;const c=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(c)return c.toLowerCase();if(typeof window<"u"&&(d=window.location)!=null&&d.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),d=Math.random().toString(36).substring(2,15);return`session_${l}_${d}`}static generateSessionIdFromUrl(l){const d=l||(typeof window<"u"?window.location.href:"");if(!d)return Eo.createSession();try{const c=new URL(d).pathname.split("/").filter(I=>I.length>0),v=c[c.length-1];return v?`session_${Date.now()}_${v}`:Eo.createSession()}catch{return Eo.createSession()}}static createMessageId(l){const d=Date.now(),c=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${d}_${c}`:`msg_${d}_${c}`}getRenderer(){return this.renderer||(this.renderer=new Eh),this.renderer}getTracker(){return this.tracker||(this.tracker=new mh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,d,c,v){const I=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:d.delegation_session_id,recommendation_id:d.recommendation_id,session_id:d.session_id,event_type:c,timestamp:new Date().toISOString(),metadata:v||{}})});if(!I.ok){const q=await I.text();throw new Error(`Delegation event failed (${I.status}): ${q}`)}const D=await I.json();return D?.session||null}async reportDelegationTurnStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",d)}async reportDelegationSessionStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",d)}async reportDelegationTurnCompleted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",d)}async reportDelegationToolInvocation(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",d)}async reportDelegationOutcome(l,d,c){return this.postDelegationEvent("/aip/delegation/complete",l,d,c)}async stopDelegationSession(l,d="user_stopped",c){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:d,...c||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const d=Date.parse(l.expires_at);return Number.isNaN(d)||d<=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 d=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:[d]},v=this.getRenderer(),I=this.getTracker();await v.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:I,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(d){throw F.error("[AdMeshSDK] Error showing recommendations"),d}}async fetchPlatformResponse(l){var d,c,v,I,D,q,_,y,B,C,W,M,A;const H=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const ue=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"),ue}const U=l.messageId;if(!U||U.trim()===""){const ue=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"),ue}const ee=Eo.buildPlatformResponseCacheKey(l.sessionId,U),te=Eo.inFlightPlatformResponses.get(ee);if(te)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:U}),te;const re=l.messages?l.messages.length:0,ne=(typeof window<"u"&&window.navigator,"web"),ie=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=zh((d=l.location)==null?void 0:d.countryCode)||"US",O=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,fe=l.userId??this.config.userId,le={spec_version:"1.0",message_id:U,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:fe||"",confidence:fe?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:ne,form_factor:ie,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:((v=l.location)==null?void 0:v.state)||void 0,state_code:((I=l.location)==null?void 0:I.stateCode)||void 0,country:((D=l.location)==null?void 0:D.country)||void 0,country_code:Q,zipcode:((q=l.location)==null?void 0:q.zipcode)||void 0,latitude:(_=l.location)==null?void 0:_.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:O}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(C=(B=le.classification_input.interaction)==null?void 0:B.input.query_text)!=null&&C.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ge=JSON.stringify(le);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:le.message_id,specVersion:le.spec_version,classificationType:le.classification_input.type,platformId:le.platform.platform_id,surfaceChannel:(W=le.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(A=(M=le.classification_input.interaction)==null?void 0:M.session)==null?void 0:A.id});const $e={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){$e["X-AdMesh-Source"]="extension";const ue=this.getExtensionSourceDomain();ue&&($e["X-AdMesh-Source-Domain"]=ue)}const oe=(async()=>{const ue=await fetch(H,{method:"POST",headers:$e,body:ge});if(!ue.ok){const Pe=(await ue.json().catch(()=>({}))).detail||`HTTP ${ue.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Pe}`)}const xe=await ue.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,oe);try{return await oe}finally{Eo.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const d=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(d),keepalive:!0});if(!c.ok){const v=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${v}`)}}async reportSponsoredRecommendation(l){const d=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(!d.ok){const c=await d.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${d.status}): ${c}`)}}fireFollowupExposure(l,d,c){this.getTracker().fireFollowupExposure(l,d,c)}async fireFollowupEngagement(l,d,c){return this.getTracker().fireFollowupEngagement(l,d,c)}};Hr(qd,"inFlightPlatformResponses",new Map);let Kd=qd;const Xd=x.createContext(void 0);function Gd(){const s=x.useContext(Xd);if(!s)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return s}function Zd(){const s=Gd();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 Ah=({className:s,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:s,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),Ph=({recommendation:s,theme:l,sdk:d,sessionId:c,onExecuteQuery:v})=>{var I,D,q,_,y;const B=(D=(I=s.recommendation)==null?void 0:I.creative)!=null&&D.follow_up_suggestion&&(q=s.tracking)!=null&&q.followup_engagement_url&&(_=s.tracking)!=null&&_.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=B?.query,W=B?.engagement_url,M=B?.exposure_url,A=s.recommendation_id,H=((y=s.recommendation)==null?void 0:y.offerId)||A;if(!C||!W||!M)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const U=async()=>{try{W&&A&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await d.fireFollowupEngagement(W,A,c)),v&&C?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${C}`),await v(C)):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(rl,{productId:H,recommendationId:A||"",exposureUrl:M,sessionId:c,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:U,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===" ")&&U()},"aria-label":`Sponsored follow-up: ${C}`,children:[m.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:C}),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(Ah,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Va=({onRecommendationsShown:s,onError:l,messageId:d,query:c,userId:v,initialRecommendation:I,triggerExposureUrl:D=!0,followups_container_id:q,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:B,onStartDelegation:C,onRecommendationReport:W,onExecuteQuery:M,onFollowupDetected:A,isContainerReady:H})=>{var U,ee,te,re;const{sdk:ne,sessionId:ie,apiKey:Q,language:O,location:fe,userId:le,model:ge,messages:$e,theme:oe,getRecommendationResult:ue,hasRecommendationResult:xe,setRecommendationResult:Pe,activeDelegationSession:E,setActiveDelegationSession:V,hasActiveDelegationSession:se}=Zd(),ke=J=>!!J&&J.status==="generated"&&!!J.recommendation,Ee=v||le,[f,P]=x.useState(null),[G,Y]=x.useState(null),[_e,ye]=x.useState(!0),[ze,Le]=x.useState(null),Re=x.useRef(null),De=x.useRef(!1),Be=x.useRef(!1),qt=x.useRef(s),ae=x.useRef(l);x.useEffect(()=>{qt.current=s,ae.current=l},[s,l]),x.useEffect(()=>{Re.current!==d&&(Re.current=null,Be.current=!1,P(null),Y(null))},[d]);const ce=se()&&E?.session_id===ie;x.useEffect(()=>{var J,Oe,X;if(!d||!xe(d)||ce)return;const Ve=ue(d);if(!Ve){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),P(null),Y(null),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0;return}let Ge=((J=Ve.recommendation)==null?void 0:J.format)||"tail";(Ge==="weave"||Ge==="product_card")&&(Ge="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:d,recommendationId:Ve.recommendation_id,format:(Oe=Ve.recommendation)==null?void 0:Oe.format}),P(Ve),Y(Ge),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,(X=qt.current)==null||X.call(qt,d,Ve)},[ue,xe,ce,d]),x.useEffect(()=>{var J,Oe,X,Ve,Ge,K,Je;if(!(!I||!d)&&!ce)try{const Fe=I,un=I.status||"unknown";if(!ke(Fe)){if(un==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),P(null),Y(null),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,Pe(d,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let it=((J=Fe.recommendation)==null?void 0:J.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),P(Fe),Y(it),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,Pe(d,Fe),(Oe=qt.current)==null||Oe.call(qt,d,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:d,recommendationId:Fe.recommendation_id,format:(X=Fe.recommendation)==null?void 0:X.format,brandName:(Ge=(Ve=Fe.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.brand_name,headline:(Je=(K=Fe.recommendation)==null?void 0:K.creative)==null?void 0:Je.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));Be.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[ce,I,d,Pe]),x.useEffect(()=>{if(!d||!c||c.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ye(!1);return}if(ce){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:d,conversationSessionId:ie,delegationSessionId:E?.delegation_session_id}),P(null),Y(null),Le(null),ye(!1),De.current=!1;return}if(!(ne!=null&&ne.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ye(!1);return}if(Be.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Re.current===d){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(De.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 J,Oe,X,Ve,Ge,K,Je,Fe,un;try{De.current=!0,ye(!0),Le(null);const it=await ne.fetchPlatformResponse({query:c.trim(),sessionId:ie,messageId:d,language:O,location:fe,userId:Ee,model:ge,...$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"),P(null),Y(null),Le(null),ye(!1),De.current=!1,Re.current=d,Pe(d,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Kt})`)}P(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:d,recommendationId:it.recommendation_id,format:(J=it.recommendation)==null?void 0:J.format,brandName:(X=(Oe=it.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,headline:(Ge=(Ve=it.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.headline,hasTracking:!!it.tracking});let Mn=((K=it.recommendation)==null?void 0:K.format)||"tail";(Mn==="weave"||Mn==="product_card")&&(Mn="tail"),Y(Mn),Re.current=d,Pe(d,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Je=it.recommendation)==null?void 0:Je.format,selected_format:Mn}),ye(!1),De.current=!1,(Fe=qt.current)==null||Fe.call(qt,d,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),ye(!1),De.current=!1,(un=ae.current)==null||un.call(ae,Kt)}})()},[E?.delegation_session_id,ce,ne,ie,d,c,O,fe,Ee,ge,I,Pe]),x.useEffect(()=>{var J,Oe,X,Ve;if(!f||!A)return;const Ge=(Oe=(J=f.recommendation)==null?void 0:J.creative)!=null&&Oe.follow_up_suggestion&&(X=f.tracking)!=null&&X.followup_engagement_url&&(Ve=f.tracking)!=null&&Ve.followup_exposure_url?{label:f.recommendation.creative.follow_up_suggestion,query:f.recommendation.creative.follow_up_suggestion,engagement_url:f.tracking.followup_engagement_url,exposure_url:f.tracking.followup_exposure_url}:null;Ge&&A(Ge,f.recommendation_id)},[f,A]);const be=x.useCallback(async J=>{if(!ne||!ie)throw new Error("AdMesh SDK activation requires an initialized session");const Oe=await fetch(`${ne.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ie,recommendation_id:J.recommendation_id,metadata:J.metadata})});if(!Oe.ok){const K=await Oe.text();throw new Error(`Failed to activate delegation session: ${Oe.status} ${K}`)}const X=await Oe.json(),Ve={...J,delegation_session_id:X.delegation_session_id||J.delegation_session_id,session_id:X.session_id||ie,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name,mcp_endpoint:X.mcp_endpoint,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,session_mode:"inline",status:X.status||"active",capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata},Ge={delegation_session_id:X.delegation_session_id,recommendation_id:J.recommendation_id,session_id:X.session_id||ie,brand_agent_id:X.brand_agent_id,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name||"Brand",mcp_endpoint:X.mcp_endpoint,status:X.status||"active",activated_at:X.created_at,last_activity_at:X.updated_at,expires_at:X.expires_at||X.updated_at,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],consent_requirements:X.consent_requirements||J.consent_requirements||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata};if(V(Ge),await ne.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ie,recommendation_id:J.recommendation_id,delegation_session_id:X.delegation_session_id,brand_name:Ge.brand_name,status:X.status||"active",metadata:{brand_agent_id:X.brand_agent_id,source:"recommendation_card"}}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",K)}),await ne.reportDelegationSessionStarted(Ge,{brand_agent_id:X.brand_agent_id,brand_name:Ge.brand_name}).then(K=>{K&&V(K)}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",K)}),B){try{await B(Ve)}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",K)}return}if(C)try{await C({...J.platform_response,delegation:{...J.platform_response.delegation,...Ve,delegation_session_id:X.delegation_session_id,available:!0,status:X.status||"active"}})}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",K)}},[Q,B,C,ne,ie,V]),Ie=x.useCallback(async J=>{var Oe,X;if(W){await W(J);return}!ne||!ie||await ne.reportSponsoredRecommendation({session_id:ie,message_id:d,recommendation_id:J.recommendation_id,reason:J.reason,brand_name:(X=(Oe=J.recommendation.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,metadata:{reason:J.reason,source:"recommendation_card"}}).catch(Ve=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",Ve)})},[d,W,ne,ie]);if(!d||!c||c.trim()===""||_e||ze)return null;if(!f||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:d,hasPlatformResult:!!f,detectedFormat:G,isLoading:_e,hasError:!!ze}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:d,recommendationId:f.recommendation_id,detectedFormat:G,brandName:(ee=(U=f.recommendation)==null?void 0:U.creative)==null?void 0:ee.brand_name,headline:(re=(te=f.recommendation)==null?void 0:te.creative)==null?void 0:re.headline});const je=typeof document<"u"&&q&&(H??!0)?document.getElementById(q):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(Wd,{recommendations:[f],theme:oe,sessionId:ie,triggerExposureUrl:D,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:be,onStartDelegation:C,onRecommendationReport:Ie})}),je&&ne&&ie?el.createPortal(m.jsx(Ph,{recommendation:f,theme:oe,sdk:ne,sessionId:ie,onExecuteQuery:M}),je):null]})},ol="admesh-ui-sdk-styles",al="admesh-ui-sdk-reset",Mh=`
|
|
245
|
+
`}),m.jsxs("div",{role:!ke&&ye?"link":void 0,tabIndex:!ke&&ye?0:void 0,style:{display:"flex",flexDirection:"column",gap:"10px",padding:"12px",borderRadius:l?.borderRadius||((te=(ee=l?.components)==null?void 0:ee.card)==null?void 0:te.borderRadius)||"14px",border:`1px solid ${at}`,background:At,boxShadow:ft,minWidth:0,cursor:!ke&&ye?"pointer":void 0},onClick:st,onKeyDown:Vt,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:Ht?"#1f2937":"#eff6ff",display:"flex",alignItems:"center",justifyContent:"center"},children:!wn&&ue&&Ud(ue)?m.jsx("img",{src:ue,alt:`${be} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>qr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:dn},children:(be||"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:dn},children:Ue?be:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:dn,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:ze,children:ze}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Xr},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:se.map(xe=>{const nt=ta(xe.product_name)||"Product",qt=ta(xe.product_link)||ta(xe.product_url)||ye||"#",Ro=fh(xe.product_price,xe.product_currency),Gn=ta(xe.product_image_url),lr=Gn&&Ud(Gn)?Gn:"",Do=qt!=="#";return m.jsx("a",{href:qt,target:Do?"_blank":void 0,rel:Do?"noopener noreferrer":void 0,onClick:Gr=>q(`compact_tail_ad_product_${xe.product_id||"item"}`,Gr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${at}`,borderRadius:"12px",background:me,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:Ht?"#374151":"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",color:dn,fontSize:"12px",fontWeight:700},children:lr?m.jsx("img",{src:lr,alt:nt,style:{width:"100%",height:"100%",objectFit:"cover"}}):nt.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:nt,children:nt}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:Ro&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:fn},children:Ro})})]})]})},xe.product_id||`${fe}-${nt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:hn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:kn}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&V.length>se.length?m.jsxs("span",{style:{fontSize:"10px",color:dn},children:["+",V.length-se.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 ${at}`,background:Z?me:At,color:Z?Qe:dn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:Z?"default":"pointer",flexShrink:0},children:m.jsx(Jf,{size:13})})]})]}),Ie?m.jsx("div",{className:"admesh-compact-report-panel",onClick:xe=>xe.stopPropagation(),style:{marginLeft:ke?0:hn,border:`1px solid ${at}`,borderRadius:"12px",background:me,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Ye.map(xe=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:nt=>un(nt,xe.value),style:{borderRadius:"999px",border:`1px solid ${at}`,background:At,color:fn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:xe.label},xe.value))}):null,Z?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:hn,fontSize:"11px",color:dn},children:"Thanks for reporting this recommendation."}):null,Ut?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${at}`,borderRadius:"12px",background:me,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:Qe},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:Xr},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:ce,onClick:xe=>{xe.preventDefault(),xe.stopPropagation(),!ce&&Ve(!1)},style:{borderRadius:"10px",border:`1px solid ${at}`,background:At,color:fn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:ce?"not-allowed":"pointer",opacity:ce?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:ce,onClick:xe=>{xe.preventDefault(),xe.stopPropagation(),!ce&&Ve(!0)},style:{borderRadius:"10px",border:"none",background:Qe,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:ce?"wait":"pointer",opacity:ce?.86:1},children:ce?"Connecting...":"Allow agent"})]})]}):null]})]})},hh=({recommendations:i,theme:l,className:d,style:c,sessionId:v,onDelegationConsent:P,onDelegationActivated:R,onStartDelegation:K})=>{const _=i.filter(U=>U&&typeof U=="object"&&typeof U.recommendation_id=="string"&&U.recommendation_id.length>0);if(!_||_.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${_.length} valid recommendations`);const b=()=>{var U;if(_.length>0){const E=_[0],W=(U=E.recommendation)==null?void 0:U.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(Vd,{recommendations:_,theme:l,sessionId:v,onDelegationConsent:P,onDelegationActivated:R,onStartDelegation:K})};return m.jsx("div",{className:`admesh-layout ${d}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:b()})};class gh{constructor(l){Kr(this,"firedExposures",new Set),Kr(this,"debug",!1),Kr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,d,c){const v=`${c}_${d}`;if(this.firedExposures.has(v)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(v);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,d,c,v){const P=`${c}_${d}`;if(this.firedExposures.has(P)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(R=>{let K=null,_=null;const b=new IntersectionObserver(E=>{E.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?K===null&&(K=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),_=setTimeout(()=>{this.fireExposure(l,d,c),b.disconnect(),R()},this.mrcThreshold.minimumDurationMs)):K!==null&&(_&&(clearTimeout(_),_=null),K=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"});b.observe(v);const U=setTimeout(()=>{b.disconnect(),_&&clearTimeout(_),R()},3e4);v.__admeshTrackerCleanup=()=>{b.disconnect(),_&&clearTimeout(_),clearTimeout(U)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,d,c){this.fireExposure(l,d,c)}fireFollowupEngagement(l,d,c){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})}).catch(v=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",v)}).then(()=>{})}}function bh(i){const l=i.split("/").filter(Boolean),d=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,c=>c.toUpperCase()):"This page"}function yh(){var i;try{console.log("[AdMesh] Starting direct headings extraction...");const l=_=>_.replace(/\s+/g," ").trim(),d=()=>{var _;const b=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],U=["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=(((_=b.map(I=>document.querySelector(I)).filter(I=>!!I).map(I=>{const M=I.cloneNode(!0);M.querySelectorAll(U).forEach(H=>H.remove());const B=l(M.textContent||"");return{element:I,text:B}}).filter(I=>I.text.length>=200).sort((I,M)=>M.text.length-I.text.length)[0])==null?void 0:_.element)||document.body).cloneNode(!0);E.querySelectorAll(U).forEach(I=>I.remove());const W=Array.from(E.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(I=>l(I.textContent||"")).filter(I=>I.length>=24);return(W.length>0?W.join(`
|
|
246
|
+
`):l(E.textContent||"")).slice(0,6e3)},c=bh(window.location.pathname||"/"),v=l(document.title||"")||c,P=(()=>{const _=[],b=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(b).forEach(U=>{const E=l(U.textContent||"");E.length>0&&_.push(E)}),_})(),R=P.length>0?P:[v||c],K={title:v,headings:R,article_text:d(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:K.title,headingsCount:K.headings.length,articleTextLength:((i=K.article_text)==null?void 0:i.length)||0,domain:K.domain}),K}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function vh(i){return!!(i&&typeof i=="object"&&"recommendation_id"in i&&"status"in i)}function xh(i){var l,d,c,v,P,R,K,_,b,U,E;if(!i||typeof i!="object")return;if(vh(i))return i;const W=i;if(!W.recommendation_id)return;const I=(W.products||[]).map(M=>{var B,H;return{product_id:M.product_id||"",product_link:M.product_link||M.product_click_url||W.click_url||W.url||"",product_name:M.product_name||W.title||((B=W.creative_input)==null?void 0:B.product_name)||"",product_description:M.product_description||"",product_price:M.product_price??void 0,product_discount:M.product_discount??void 0,product_currency:M.product_currency,product_discount_type:M.product_discount_type,product_cta_label:M.product_cta_label||((H=W.creative_input)==null?void 0:H.cta_label),product_image_url:M.product_image_url,product_features:M.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||((d=W.creative_input)==null?void 0:d.product_name)||"",description:((c=W.creative_input)==null?void 0:c.short_description)||((v=W.creative_input)==null?void 0:v.long_description)||"",cta_text:((P=W.creative_input)==null?void 0:P.cta_label)||((R=I[0])==null?void 0:R.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(_=(K=W.creative_input)==null?void 0:K.assets)==null?void 0:_.logo_url,image_urls:((U=(b=W.creative_input)==null?void 0:b.assets)==null?void 0:U.image_urls)||[],landing_page_url:W.url||W.click_url||((E=W.creative_input)==null?void 0:E.cta_url)||"",products:I}},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 wh(i){return{...i,suggestions:(i.suggestions||[]).map(l=>({...l,recommendation:xh(l.recommendation)}))}}function Hd(i){try{const l=new URL(i).pathname.split("/").filter(d=>d.length>0);return l[l.length-1]||void 0}catch{return}}async function kh(i,l){var d,c,v,P,R;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:i.url});const K=Array.isArray(i.headings)?i.headings:[],_=(d=Hd(i.url))==null?void 0:d.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),b=_?_.replace(/\b\w/g,te=>te.toUpperCase()):void 0,U=l.apiKey.toLowerCase().startsWith("pub_")?Hd(i.url):void 0,E=l.extension?"extension":"admesh_ui_sdk",W=(i.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),I={url:i.url,title:i.title||void 0,headings:K.length>0?K:b?[b]:void 0,article_text:((c=i.article_text)==null?void 0:c.trim())||void 0,domain:W,article_slug:U,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:I.url,titleLength:((v=I.title)==null?void 0:v.length)||0,headingsCount:((P=I.headings)==null?void 0:P.length)||0,articleTextLength:((R=I.article_text)==null?void 0:R.length)||0,domain:I.domain,article_slug:I.article_slug,source:I.source,has_user_id:!!I.user_id});const M=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",M);const B=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(I)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:B.status,statusText:B.statusText,ok:B.ok}),!B.ok){const te=await B.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:B.status,statusText:B.statusText,errorText:te}),new Error(`ACIE API error: ${B.status} - ${te}`)}const H=await B.json(),ee=wh(H);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:i.url,suggestionsCount:ee.suggestions.length}),ee}catch(K){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",K),null}}async function _h(i,l){var d,c;const v=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),P=new URLSearchParams({url:i.trim()});(d=l.agentDisplayId)!=null&&d.trim()&&P.set("agent_display_id",l.agentDisplayId.trim()),(c=l.publisherId)!=null&&c.trim()&&P.set("publisher_id",l.publisherId.trim());const R=await fetch(`${v}/publisher-assistant/page-context?${P.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!R.ok){const K=await R.text().catch(()=>"");throw new Error(`Page context request failed (${R.status}): ${K||R.statusText}`)}return await R.json()}function Sh(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function Eh(){var i;if(typeof window>"u")return null;try{const l=(i=window.location.href)==null?void 0:i.trim();if(Kd(l))return l}catch{return null}return null}function Kd(i){const l=i?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return d.protocol==="http:"||d.protocol==="https:"}catch{return!1}}function Ch(i){try{const l=new URL(i),d=l.pathname.split("/").filter(Boolean),c=(d[d.length-1]||d[d.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return c?c.replace(/\b\w/g,v=>v.toUpperCase()):l.hostname}catch{return"This page"}}function Qd(i){const l=new URL(i),d=Ch(i);return{title:d,headings:[d],article_text:`Article URL: ${i}
|
|
247
|
+
Article topic inferred from URL path: ${d}`,url:i,domain:l.hostname,extracted_at:new Date().toISOString()}}const zh=6e4,qd=3;function Mh(i){const l=Eh();if(l)return l;const d=i?.trim();return Kd(d)?d:null}const Xd=({apiKey:i,skipSdkInitialization:l=!1,sessionId:d,extension:c,theme:v,apiBaseUrl:P,language:R,location:K,userId:_,model:b,messages:U,pageContext:E,articleUrl:W,contextMode:I="auto",agentDisplayId:M,children:B})=>{const[H,ee]=x.useState(null),[te,re]=x.useState(new Set),[ne,ie]=x.useState(new Map),[Q,$]=x.useState(null),[fe,le]=x.useState([]),[be,Oe]=x.useState(!1),[oe,ue]=x.useState(null),[ye,Te]=x.useState(!1),C=x.useRef(!1),V=x.useRef(0),se=x.useRef(null),ke=x.useRef(null);ke.current=Q;const Ce=!!E||I==="ad-slot"||I==="auto"&&(!!(W!=null&&W.trim())||Sh()),f=x.useCallback(async()=>{if(E)return E;if(!Ce)return yh();const ae=Mh(W);if(!ae)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ue("Article URL is required for ad-slot context"),null;if(!i)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Qd(ae);try{Te(!0);const ce=await _h(ae,{apiKey:i,apiBaseUrl:P||"https://api.useadmesh.com",agentDisplayId:M});return F.log("[AdMeshProvider] Page context resolved",{source:ce.source,cache_hit:ce.cache_hit,domain:ce.context.domain}),ce.context}catch(ce){return F.error("[AdMeshProvider] Failed to fetch page context:",ce),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Qd(ae)}finally{Te(!1)}},[M,P,i,W,E,Ce]),T=x.useCallback((ae,ce)=>{const he=ae.filter(Ie=>!Ie.is_sponsored).slice(0,3);return[ce,...he]},[]),G=x.useCallback((ae,ce)=>{const he=ae.find(Ae=>Ae.is_sponsored),Ie=ce.filter(Ae=>!Ae.is_sponsored).slice(0,3);return he?[he,...Ie]:Ie},[]);x.useEffect(()=>{if(!d||d.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:",d)},[d]),x.useEffect(()=>{if(!l){if(!i){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!d||d.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ae=new Zd({apiKey:i,theme:v,apiBaseUrl:P,extension:c});ee(ae),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",d),P&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ae){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ae)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[i,v,P,d,c,l]);const Y=x.useCallback(async ae=>{var ce;if(!i){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(!i.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{Oe(!0),ue(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const he=ae??await f();if(!he){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ue("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:he.title,headingsCount:he.headings.length,articleTextLength:((ce=he.article_text)==null?void 0:ce.length)||0,domain:he.domain});const Ie=await kh(he,{apiKey:i,apiBaseUrl:P||"https://api.useadmesh.com",extension:c,userId:_});Ie?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Ie.suggestions.length,suggestions:(Ie.suggestions||[]).map(Ae=>{var Z;return{id:Ae.id,text:Ae.text,is_sponsored:Ae.is_sponsored,recommendationId:((Z=Ae.recommendation)==null?void 0:Z.recommendation_id)||null}})}),le(Ae=>G(Ae,Ie.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ue("Intent analysis failed"),le(Ae=>Ae.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),Ae):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(he){F.error("[AdMeshProvider] Error in intent analysis:",he),ue("Intent analysis error"),le(Ie=>Ie.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Ie):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{Oe(!1)}},[i,P,c,_,G,f]),_e=x.useCallback(async ae=>{var ce,he,Ie,Ae,Z,$e;if(!H||!i||!i.toLowerCase().startsWith("pub_"))return;const X=ae??await f();if(!X){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const Ve=((he=(ce=X.headings)==null?void 0:ce[0])==null?void 0:he.trim())||((Ie=X.title)==null?void 0:Ie.trim());if(!Ve){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 Ze=await H.fetchPlatformResponse({query:Ve,sessionId:d,messageId:Zd.createMessageId(d),platformSurface:"conversation",model:b,messages:[],language:R,location:K,userId:_}),q=($e=(Z=(Ae=Ze.recommendation)==null?void 0:Ae.creative)==null?void 0:Z.follow_up_suggestion)==null?void 0:$e.trim(),Ye=Ze.recommendation_id;if(!q||!Ye){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Ye,text:q,type:"action",is_sponsored:!0,recommendation:Ze,metadata:{source:"aip_context_prefetch",recommendation_id:Ye}};le(un=>T(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Ye,suggestionText:q})}catch(Ze){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ze)}},[i,R,K,b,H,d,_,T,f]),ve=x.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);x.useEffect(()=>{!H||C.current||(C.current=!0,(async()=>{const ae=await f();await Promise.allSettled([_e(ae),Y(ae)])})())},[H,Y,_e,f]);const ze=x.useCallback(ae=>{if(!ae||ae.status!=="active")return!1;const ce=Date.parse(ae.expires_at);return Number.isNaN(ce)?!1:ce>Date.now()},[]),Le=x.useCallback(async(ae,ce,he,Ie)=>{const Ae=Ie??Q;if(!Ae||!H){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ae,eventType:ce,hasSession:!!Ae,hasSdk:!!H});return}const Z=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ae,eventType:ce,recommendationId:Ae.recommendation_id,delegationSessionId:Ae.delegation_session_id,sessionId:Ae.session_id});const $e=await fetch(`${H.getApiBaseUrl()}${ae}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({delegation_session_id:Ae.delegation_session_id,recommendation_id:Ae.recommendation_id,session_id:Ae.session_id,event_type:ce,timestamp:Z,metadata:he||{}})});if(!$e.ok){const Ze=await $e.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ae,eventType:ce,status:$e.status,errorBody:Ze,recommendationId:Ae.recommendation_id,delegationSessionId:Ae.delegation_session_id}),new Error(`Delegation event failed (${$e.status}): ${Ze}`)}const X=await $e.json(),Ve=X?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ae,eventType:ce,recommendationId:Ae.recommendation_id,delegationSessionId:Ae.delegation_session_id,returnedStatus:Ve?.status||X?.status}),Ve&&$(Ve)},[Q,i,H]),Ne=x.useCallback(()=>{V.current=0},[]),Re=x.useCallback(async(ae="user_stopped",ce)=>{const he=Q;if(!he){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ae,recommendationId:he.recommendation_id,delegationSessionId:he.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ae,...ce||{}},he),await H?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:he.session_id,recommendation_id:he.recommendation_id,delegation_session_id:he.delegation_session_id,brand_name:he.brand_name,status:"stopped",metadata:{reason:ae,...ce||{}}}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Ie)}),V.current=0,se.current=null,$(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,H]),Ue=x.useCallback(async(ae="turn_completed",ce)=>{ae==="turn_started"&&Ne(),await Le("/aip/delegation/activity",ae,ce)},[Le,Ne]);x.useEffect(()=>{const ae=Q?.delegation_session_id??null;ae!==se.current&&(se.current=ae,V.current=0)},[Q?.delegation_session_id]),x.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!H)return;const ae=ke.current;if(!ae||!ze(ae)){$(he=>he?{...he,status:"expired"}:null);return}const ce=window.setInterval(()=>{const he=ke.current;if(!(!he||!ze(he))){if(V.current+=1,V.current>=qd){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:he.delegation_session_id,heartbeatsSinceLastUserTurn:V.current,idleHeartbeatLimit:qd}),Re("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:V.current}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Ie)});return}Le("/aip/delegation/heartbeat","heartbeat").catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Ie)})}},zh);return()=>{window.clearInterval(ce)}},[Q?.delegation_session_id,ze,Le,H,Re]);const Ut={sdk:H,apiKey:i,sessionId:d,theme:v,language:R,location:K,userId:_,model:b,messages:U,processedMessageIds:te,recommendationResults:ne,activeDelegationSession:Q,suggestions:fe,isAnalyzingIntent:be||ye,intentError:oe,markMessageAsProcessed:ae=>{re(ce=>{const he=new Set(ce);return he.add(ae),he})},isMessageProcessed:ae=>te.has(ae),setRecommendationResult:(ae,ce)=>{ie(he=>{const Ie=new Map(he);return Ie.set(ae,ce),Ie}),re(he=>{const Ie=new Set(he);return Ie.add(ae),Ie})},getRecommendationResult:ae=>ne.get(ae),hasRecommendationResult:ae=>ne.has(ae),setActiveDelegationSession:ae=>{$(ae)},getActiveDelegationSession:()=>ze(Q)?Q:null,hasActiveDelegationSession:()=>ze(Q),refreshDelegationActivity:Ue,stopDelegationSession:Re,retryIntentAnalysis:ve};return m.jsx(Jd.Provider,{value:Ut,children:B})};class Th{constructor(){Kr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const d=l.response.recommendations||[];if(d.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 v=this.roots.get(l.containerId);v&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),v.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const P=Td.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),P.render(m.jsx(Xd,{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(hh,{recommendations:d,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,P)}catch(d){throw F.error("[AdMeshRenderer] Error rendering recommendations"),d}}unmount(l){const d=this.roots.get(l);if(d){d.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 Ph=i=>{if(typeof i!="string")return;const l=i.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},Gd=class Po{constructor(l){if(Kr(this,"config"),Kr(this,"apiBaseUrl"),Kr(this,"renderer",null),Kr(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,d){return`${l}::${d}`}getExtensionSourceDomain(){var l,d;const c=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(c)return c.toLowerCase();if(typeof window<"u"&&(d=window.location)!=null&&d.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),d=Math.random().toString(36).substring(2,15);return`session_${l}_${d}`}static generateSessionIdFromUrl(l){const d=l||(typeof window<"u"?window.location.href:"");if(!d)return Po.createSession();try{const c=new URL(d).pathname.split("/").filter(P=>P.length>0),v=c[c.length-1];return v?`session_${Date.now()}_${v}`:Po.createSession()}catch{return Po.createSession()}}static createMessageId(l){const d=Date.now(),c=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${d}_${c}`:`msg_${d}_${c}`}getRenderer(){return this.renderer||(this.renderer=new Th),this.renderer}getTracker(){return this.tracker||(this.tracker=new gh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,d,c,v){const P=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:d.delegation_session_id,recommendation_id:d.recommendation_id,session_id:d.session_id,event_type:c,timestamp:new Date().toISOString(),metadata:v||{}})});if(!P.ok){const K=await P.text();throw new Error(`Delegation event failed (${P.status}): ${K}`)}const R=await P.json();return R?.session||null}async reportDelegationTurnStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",d)}async reportDelegationSessionStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",d)}async reportDelegationTurnCompleted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",d)}async reportDelegationToolInvocation(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",d)}async reportDelegationOutcome(l,d,c){return this.postDelegationEvent("/aip/delegation/complete",l,d,c)}async stopDelegationSession(l,d="user_stopped",c){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:d,...c||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const d=Date.parse(l.expires_at);return Number.isNaN(d)||d<=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 d=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:[d]},v=this.getRenderer(),P=this.getTracker();await v.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:P,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(d){throw F.error("[AdMeshSDK] Error showing recommendations"),d}}async fetchPlatformResponse(l){var d,c,v,P,R,K,_,b,U,E,W,I,M;const B=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const ue=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"),ue}const H=l.messageId;if(!H||H.trim()===""){const ue=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"),ue}const ee=Po.buildPlatformResponseCacheKey(l.sessionId,H),te=Po.inFlightPlatformResponses.get(ee);if(te)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:H}),te;const re=l.messages?l.messages.length:0,ne=(typeof window<"u"&&window.navigator,"web"),ie=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=Ph((d=l.location)==null?void 0:d.countryCode)||"US",$=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,fe=l.userId??this.config.userId,le={spec_version:"1.0",message_id:H,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:fe||"",confidence:fe?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:ne,form_factor:ie,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:((v=l.location)==null?void 0:v.state)||void 0,state_code:((P=l.location)==null?void 0:P.stateCode)||void 0,country:((R=l.location)==null?void 0:R.country)||void 0,country_code:Q,zipcode:((K=l.location)==null?void 0:K.zipcode)||void 0,latitude:(_=l.location)==null?void 0:_.latitude,longitude:(b=l.location)==null?void 0:b.longitude},page:$}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(E=(U=le.classification_input.interaction)==null?void 0:U.input.query_text)!=null&&E.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const be=JSON.stringify(le);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:le.message_id,specVersion:le.spec_version,classificationType:le.classification_input.type,platformId:le.platform.platform_id,surfaceChannel:(W=le.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(M=(I=le.classification_input.interaction)==null?void 0:I.session)==null?void 0:M.id});const Oe={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){Oe["X-AdMesh-Source"]="extension";const ue=this.getExtensionSourceDomain();ue&&(Oe["X-AdMesh-Source-Domain"]=ue)}const oe=(async()=>{const ue=await fetch(B,{method:"POST",headers:Oe,body:be});if(!ue.ok){const Te=(await ue.json().catch(()=>({}))).detail||`HTTP ${ue.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Te}`)}const ye=await ue.json();return F.log("[AdMeshSDK] \u{1F4E5} Raw response from /aip/context:",{status:ye.status,recommendationId:ye.recommendation_id,hasRecommendation:!!ye.recommendation,hasTracking:!!ye.tracking,hasDelegation:!!ye.delegation,topLevelKeys:Object.keys(ye)}),F.log("[AdMeshSDK] \u{1F4E6} Full PlatformResponse received from /aip/context",ye),ye})();Po.inFlightPlatformResponses.set(ee,oe);try{return await oe}finally{Po.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const d=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(d),keepalive:!0});if(!c.ok){const v=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${v}`)}}async reportSponsoredRecommendation(l){const d=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(!d.ok){const c=await d.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${d.status}): ${c}`)}}fireFollowupExposure(l,d,c){this.getTracker().fireFollowupExposure(l,d,c)}async fireFollowupEngagement(l,d,c){return this.getTracker().fireFollowupEngagement(l,d,c)}};Kr(Gd,"inFlightPlatformResponses",new Map);let Zd=Gd;const Jd=x.createContext(void 0);function Yd(){const i=x.useContext(Jd);if(!i)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return i}function ec(){const i=Yd();return{sdk:i.sdk,apiKey:i.apiKey,sessionId:i.sessionId,theme:i.theme,language:i.language,location:i.location,userId:i.userId,model:i.model,messages:i.messages,processedMessageIds:i.processedMessageIds,recommendationResults:i.recommendationResults,activeDelegationSession:i.activeDelegationSession,markMessageAsProcessed:i.markMessageAsProcessed,isMessageProcessed:i.isMessageProcessed,setRecommendationResult:i.setRecommendationResult,getRecommendationResult:i.getRecommendationResult,hasRecommendationResult:i.hasRecommendationResult,setActiveDelegationSession:i.setActiveDelegationSession,getActiveDelegationSession:i.getActiveDelegationSession,hasActiveDelegationSession:i.hasActiveDelegationSession,refreshDelegationActivity:i.refreshDelegationActivity,stopDelegationSession:i.stopDelegationSession}}const Ih=({className:i,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:i,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),Ah=({recommendation:i,theme:l,sdk:d,sessionId:c,onExecuteQuery:v})=>{var P,R,K,_,b;const U=(R=(P=i.recommendation)==null?void 0:P.creative)!=null&&R.follow_up_suggestion&&(K=i.tracking)!=null&&K.followup_engagement_url&&(_=i.tracking)!=null&&_.followup_exposure_url?{query:i.recommendation.creative.follow_up_suggestion,engagement_url:i.tracking.followup_engagement_url,exposure_url:i.tracking.followup_exposure_url}:null,E=U?.query,W=U?.engagement_url,I=U?.exposure_url,M=i.recommendation_id,B=((b=i.recommendation)==null?void 0:b.offerId)||M;if(!E||!W||!I)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const H=async()=>{try{W&&M&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await d.fireFollowupEngagement(W,M,c)),v&&E?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${E}`),await v(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(il,{productId:B,recommendationId:M||"",exposureUrl:I,sessionId:c,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:H,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===" ")&&H()},"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(Ih,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Wa=({onRecommendationsShown:i,onError:l,messageId:d,query:c,userId:v,initialRecommendation:P,triggerExposureUrl:R=!0,followups_container_id:K,onPasteToInput:_,onDelegationConsent:b,onDelegationActivated:U,onStartDelegation:E,onRecommendationReport:W,onExecuteQuery:I,onFollowupDetected:M,isContainerReady:B})=>{var H,ee,te,re;const{sdk:ne,sessionId:ie,apiKey:Q,language:$,location:fe,userId:le,model:be,messages:Oe,theme:oe,getRecommendationResult:ue,hasRecommendationResult:ye,setRecommendationResult:Te,activeDelegationSession:C,setActiveDelegationSession:V,hasActiveDelegationSession:se}=ec(),ke=Z=>!!Z&&Z.status==="generated"&&!!Z.recommendation,Ce=v||le,[f,T]=x.useState(null),[G,Y]=x.useState(null),[_e,ve]=x.useState(!0),[ze,Le]=x.useState(null),Ne=x.useRef(null),Re=x.useRef(!1),Ue=x.useRef(!1),Ut=x.useRef(i),ae=x.useRef(l);x.useEffect(()=>{Ut.current=i,ae.current=l},[i,l]),x.useEffect(()=>{Ne.current!==d&&(Ne.current=null,Ue.current=!1,T(null),Y(null))},[d]);const ce=se()&&C?.session_id===ie;x.useEffect(()=>{var Z,$e,X;if(!d||!ye(d)||ce)return;const Ve=ue(d);if(!Ve){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),T(null),Y(null),Le(null),ve(!1),Ne.current=d,Re.current=!1,Ue.current=!0;return}let Ze=((Z=Ve.recommendation)==null?void 0:Z.format)||"tail";(Ze==="weave"||Ze==="product_card")&&(Ze="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:d,recommendationId:Ve.recommendation_id,format:($e=Ve.recommendation)==null?void 0:$e.format}),T(Ve),Y(Ze),Le(null),ve(!1),Ne.current=d,Re.current=!1,Ue.current=!0,(X=Ut.current)==null||X.call(Ut,d,Ve)},[ue,ye,ce,d]),x.useEffect(()=>{var Z,$e,X,Ve,Ze,q,Ye;if(!(!P||!d)&&!ce)try{const Fe=P,un=P.status||"unknown";if(!ke(Fe)){if(un==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),T(null),Y(null),Le(null),ve(!1),Ne.current=d,Re.current=!1,Ue.current=!0,Te(d,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let st=((Z=Fe.recommendation)==null?void 0:Z.format)||"tail";(st==="weave"||st==="product_card")&&(st="tail"),T(Fe),Y(st),Le(null),ve(!1),Ne.current=d,Re.current=!1,Ue.current=!0,Te(d,Fe),($e=Ut.current)==null||$e.call(Ut,d,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:d,recommendationId:Fe.recommendation_id,format:(X=Fe.recommendation)==null?void 0:X.format,brandName:(Ze=(Ve=Fe.recommendation)==null?void 0:Ve.creative)==null?void 0:Ze.brand_name,headline:(Ye=(q=Fe.recommendation)==null?void 0:q.creative)==null?void 0:Ye.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));Ue.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[ce,P,d,Te]),x.useEffect(()=>{if(!d||!c||c.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ve(!1);return}if(ce){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:d,conversationSessionId:ie,delegationSessionId:C?.delegation_session_id}),T(null),Y(null),Le(null),ve(!1),Re.current=!1;return}if(!(ne!=null&&ne.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ve(!1);return}if(Ue.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Ne.current===d){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(Re.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,$e,X,Ve,Ze,q,Ye,Fe,un;try{Re.current=!0,ve(!0),Le(null);const st=await ne.fetchPlatformResponse({query:c.trim(),sessionId:ie,messageId:d,language:$,location:fe,userId:Ce,model:be,...Oe&&Oe.length>0&&{messages:Oe}}),Vt=st?.status||"unknown";if(!ke(st)){if(Vt==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),T(null),Y(null),Le(null),ve(!1),Re.current=!1,Ne.current=d,Te(d,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Vt})`)}T(st),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:d,recommendationId:st.recommendation_id,format:(Z=st.recommendation)==null?void 0:Z.format,brandName:(X=($e=st.recommendation)==null?void 0:$e.creative)==null?void 0:X.brand_name,headline:(Ze=(Ve=st.recommendation)==null?void 0:Ve.creative)==null?void 0:Ze.headline,hasTracking:!!st.tracking});let Pn=((q=st.recommendation)==null?void 0:q.format)||"tail";(Pn==="weave"||Pn==="product_card")&&(Pn="tail"),Y(Pn),Ne.current=d,Te(d,st),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Ye=st.recommendation)==null?void 0:Ye.format,selected_format:Pn}),ve(!1),Re.current=!1,(Fe=Ut.current)==null||Fe.call(Ut,d,st)}catch(st){const Vt=st instanceof Error?st:new Error(String(st));Vt.message.includes("Failed to fetch")||Vt.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${Vt.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${Vt.message} `),Le(Vt),ve(!1),Re.current=!1,(un=ae.current)==null||un.call(ae,Vt)}})()},[C?.delegation_session_id,ce,ne,ie,d,c,$,fe,Ce,be,P,Te]),x.useEffect(()=>{var Z,$e,X,Ve;if(!f||!M)return;const Ze=($e=(Z=f.recommendation)==null?void 0:Z.creative)!=null&&$e.follow_up_suggestion&&(X=f.tracking)!=null&&X.followup_engagement_url&&(Ve=f.tracking)!=null&&Ve.followup_exposure_url?{label:f.recommendation.creative.follow_up_suggestion,query:f.recommendation.creative.follow_up_suggestion,engagement_url:f.tracking.followup_engagement_url,exposure_url:f.tracking.followup_exposure_url}:null;Ze&&M(Ze,f.recommendation_id)},[f,M]);const he=x.useCallback(async Z=>{if(!ne||!ie)throw new Error("AdMesh SDK activation requires an initialized session");const $e=await fetch(`${ne.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ie,recommendation_id:Z.recommendation_id,metadata:Z.metadata})});if(!$e.ok){const q=await $e.text();throw new Error(`Failed to activate delegation session: ${$e.status} ${q}`)}const X=await $e.json(),Ve={...Z,delegation_session_id:X.delegation_session_id||Z.delegation_session_id,session_id:X.session_id||ie,brand_id:X.brand_id||Z.brand_id,brand_name:X.brand_name||Z.brand_name,mcp_endpoint:X.mcp_endpoint,eligibility_reason:X.eligibility_reason||Z.eligibility_reason,delegate_reason:X.delegate_reason||Z.delegate_reason,session_goal:X.session_goal||Z.session_goal,desired_outcome_type:X.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:X.required_user_inputs||Z.required_user_inputs||[],required_consent_types:X.required_consent_types||Z.required_consent_types||[],success_outcome:X.success_outcome||Z.success_outcome,fallback_message:X.fallback_message||Z.fallback_message,session_mode:"inline",status:X.status||"active",capabilities:X.capabilities||Z.capabilities||[],allowed_data_types:X.allowed_data_types||Z.allowed_data_types||[],auth_model:X.auth_model||Z.auth_model,handoff_protocol:X.handoff_protocol||Z.handoff_protocol,supported_actions:X.supported_actions||Z.supported_actions||[],metadata:X.metadata||Z.metadata},Ze={delegation_session_id:X.delegation_session_id,recommendation_id:Z.recommendation_id,session_id:X.session_id||ie,brand_agent_id:X.brand_agent_id,brand_id:X.brand_id||Z.brand_id,brand_name:X.brand_name||Z.brand_name||"Brand",mcp_endpoint:X.mcp_endpoint,status:X.status||"active",activated_at:X.created_at,last_activity_at:X.updated_at,expires_at:X.expires_at||X.updated_at,eligibility_reason:X.eligibility_reason||Z.eligibility_reason,delegate_reason:X.delegate_reason||Z.delegate_reason,session_goal:X.session_goal||Z.session_goal,desired_outcome_type:X.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:X.required_user_inputs||Z.required_user_inputs||[],required_consent_types:X.required_consent_types||Z.required_consent_types||[],success_outcome:X.success_outcome||Z.success_outcome,fallback_message:X.fallback_message||Z.fallback_message,capabilities:X.capabilities||Z.capabilities||[],allowed_data_types:X.allowed_data_types||Z.allowed_data_types||[],consent_requirements:X.consent_requirements||Z.consent_requirements||[],auth_model:X.auth_model||Z.auth_model,handoff_protocol:X.handoff_protocol||Z.handoff_protocol,supported_actions:X.supported_actions||Z.supported_actions||[],metadata:X.metadata||Z.metadata};if(V(Ze),await ne.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ie,recommendation_id:Z.recommendation_id,delegation_session_id:X.delegation_session_id,brand_name:Ze.brand_name,status:X.status||"active",metadata:{brand_agent_id:X.brand_agent_id,source:"recommendation_card"}}).catch(q=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",q)}),await ne.reportDelegationSessionStarted(Ze,{brand_agent_id:X.brand_agent_id,brand_name:Ze.brand_name}).then(q=>{q&&V(q)}).catch(q=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",q)}),U){try{await U(Ve)}catch(q){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",q)}return}if(E)try{await E({...Z.platform_response,delegation:{...Z.platform_response.delegation,...Ve,delegation_session_id:X.delegation_session_id,available:!0,status:X.status||"active"}})}catch(q){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",q)}},[Q,U,E,ne,ie,V]),Ie=x.useCallback(async Z=>{var $e,X;if(W){await W(Z);return}!ne||!ie||await ne.reportSponsoredRecommendation({session_id:ie,message_id:d,recommendation_id:Z.recommendation_id,reason:Z.reason,brand_name:(X=($e=Z.recommendation.recommendation)==null?void 0:$e.creative)==null?void 0:X.brand_name,metadata:{reason:Z.reason,source:"recommendation_card"}}).catch(Ve=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",Ve)})},[d,W,ne,ie]);if(!d||!c||c.trim()===""||_e||ze)return null;if(!f||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:d,hasPlatformResult:!!f,detectedFormat:G,isLoading:_e,hasError:!!ze}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:d,recommendationId:f.recommendation_id,detectedFormat:G,brandName:(ee=(H=f.recommendation)==null?void 0:H.creative)==null?void 0:ee.brand_name,headline:(re=(te=f.recommendation)==null?void 0:te.creative)==null?void 0:re.headline});const Ae=typeof document<"u"&&K&&(B??!0)?document.getElementById(K):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(Vd,{recommendations:[f],theme:oe,sessionId:ie,triggerExposureUrl:R,onPasteToInput:_,onDelegationConsent:b,onDelegationActivated:he,onStartDelegation:E,onRecommendationReport:Ie})}),Ae&&ne&&ie?rl.createPortal(m.jsx(Ah,{recommendation:f,theme:oe,sdk:ne,sessionId:ie,onExecuteQuery:I}),Ae):null]})},sl="admesh-ui-sdk-styles",ll="admesh-ui-sdk-reset",jh=`
|
|
238
248
|
/* AdMesh UI SDK - CSS Reset & Normalization */
|
|
239
249
|
.admesh-component,
|
|
240
250
|
.admesh-component * {
|
|
@@ -323,7 +333,7 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
|
|
|
323
333
|
.admesh-component[data-admesh-theme="light"] {
|
|
324
334
|
color-scheme: light;
|
|
325
335
|
}
|
|
326
|
-
`,
|
|
336
|
+
`,Nh=`
|
|
327
337
|
/* AdMesh Core Component Styles */
|
|
328
338
|
|
|
329
339
|
.admesh-component {
|
|
@@ -534,7 +544,7 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
|
|
|
534
544
|
font-size: 0.875rem;
|
|
535
545
|
}
|
|
536
546
|
}
|
|
537
|
-
`,
|
|
547
|
+
`,Rh=()=>{if(!(typeof document>"u")&&!(document.getElementById(ll)&&document.getElementById(sl))){if(!document.getElementById(ll)){const i=document.createElement("style");i.id=ll,i.textContent=jh,document.head.appendChild(i)}if(!document.getElementById(sl)){const i=document.createElement("style");i.id=sl,i.textContent=Nh,document.head.appendChild(i)}}},Dh=`
|
|
538
548
|
/* AdMesh UI SDK - Complete Self-Contained Styles */
|
|
539
549
|
|
|
540
550
|
/* CSS Reset for AdMesh components */
|
|
@@ -1202,17 +1212,17 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
|
|
|
1202
1212
|
.admesh-component .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1203
1213
|
.admesh-component .lg\\:col-span-1 { grid-column: span 1 / span 1; }
|
|
1204
1214
|
}
|
|
1205
|
-
`;let
|
|
1206
|
-
${te}`),
|
|
1207
|
-
| `),
|
|
1208
|
-
`),
|
|
1209
|
-
`).map(ee=>ee.trim()).filter(Boolean)),
|
|
1210
|
-
`),
|
|
1211
|
-
`)},W=(
|
|
1212
|
-
`),
|
|
1213
|
-
`)})(
|
|
1214
|
-
`).map(ne=>ne.trim()).filter(Boolean),U=H.every(ne=>/^[-*]\s+/.test(ne)),ee=H.every(ne=>/^\d+\.\s+/.test(ne)),te=H.length===1&&/^#{1,3}\s+/.test(H[0]),re=y(H);if(te){const ne=H[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ne)},A)}if(re){const{heading:ne,lines:ie}=_(H),Q=v(ie[0]),O=ie.slice(2).map(v).filter(fe=>fe.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ne?m.jsx("p",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:d},children:c(ne)}):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:d,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((fe,le)=>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:c(fe)},le))})}),m.jsx("tbody",{children:O.map((fe,le)=>m.jsx("tr",{children:fe.map((ge,$e)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:le===O.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(ge)},$e))},le))})]})})]},A)}if(U||ee){const ne=ee?"ol":"ul";return m.jsx(ne,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:d},children:H.map((ie,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:c(ie.replace(/^([-*]|\d+\.)\s+/,""))},Q))},A)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:d,whiteSpace:"pre-wrap"},children:H.map((ne,ie)=>m.jsxs(x.Fragment,{children:[ie>0&&m.jsx("br",{}),c(ne)]},ie))},A)})})};function Ua(s){return s===void 0?void 0:typeof s=="number"?`${s}px`:s}function Yd(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 Po(s){return s.replace(/\s+/g," ").trim()}function Fh(s,l){const d=s.filter(D=>!(D!=null&&D.is_sponsored)).slice(0,3),c=l.filter(D=>!(D!=null&&D.is_sponsored)).slice(0,3),v=l.find(D=>D?.is_sponsored);if(!v)return c.length?c:d;const I=c.length?c:d;return[v,...I].slice(0,4)}function $h(s,l,d,c){const v=new Set,I=[],D=(C,W="information")=>{const M=Po(C);if(!M)return;const A=M.toLowerCase();v.has(A)||(v.add(A),I.push({id:`followup_${I.length}_${A.replace(/[^a-z0-9]+/g,"_")}`,text:M,type:W,is_sponsored:!1}))},q=new Set,_=C=>{const W=Po(C||"");if(!W)return;const M=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();M&&q.add(M)};(c||[]).forEach(C=>_(C?.title)),(d||[]).forEach(C=>_(C?.title)),l.split(/\n+/).map(C=>Po(C.replace(/^[-*]\s+/,""))).filter(Boolean).filter(C=>C.length>=24&&C.length<=90).forEach(C=>{q.size>=6||_(C)});const y=Po(s.replace(/[?.!]+$/g,"")),B=Array.from(q).slice(0,3);return[B[0]?`Tell me more about ${B[0]}`:"",B[1]?`Show me examples related to ${B[1]}`:"",B[2]?`Compare the main options for ${B[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((C,W)=>{I.length>=3||D(C,W===0?"comparison":"information")}),I.slice(0,3)}function Oh(){if(typeof window>"u")return"unknown";const s=window.innerWidth;return s<768?"mobile":s<1024?"tablet":"desktop"}function ec(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 tc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function nc(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(tc(l))return l}catch{return}}function rc(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=nc()||(tc(s)?s.trim():void 0);let d=l?window.location.pathname||"/":void 0;try{d=l?new URL(l).pathname||"/":void 0}catch{d=nc()?window.location.pathname||"/":void 0}const c=(d||"").split("/").filter(Boolean);return{page_url:l,page_path:d,article_slug:c[c.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Oh()}}function Wh(s){var l,d;const c=(d=(l=s?.recommendation)==null?void 0:l.creative)==null?void 0:d.follow_up_suggestion,v=s?.recommendation_id;return!c||!v?null:{id:v,text:Po(c),type:"action",is_sponsored:!0,recommendation:s,metadata:{source:"assistant_query_recommendation",recommendation_id:v}}}function sl(s){return[...s].sort((l,d)=>{const c=!!l.is_sponsored,v=!!d.is_sponsored;return c===v?0:c?-1:1})}const Hh={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)"}},Bh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},Vh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Uh=({theme:s,className:l,style:d,triggerLabel:c="Ask Ava",headerTitle:v="Ask Ava",headerLogoUrl:I,showHeader:D=!0,showHeaderTitle:q=!0,showSubtitle:_=!0,layout:y="floating",surface:B="page",adSlotBehavior:C="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:M=!0,showCompactSlotInput:A=!0,showCompactSlotDisclaimer:H=!0,panelWidth:U,panelHeight:ee,analyticsPageUrl:te,fontScale:re=1,position:ne="bottom-right",size:ie="md",defaultOpen:Q,open:O,onOpenChange:fe,autoOpen:le=!1,showWelcomeMessage:ge=!1,welcomeMessage:$e="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:oe="Ask me anything about products...",adsEnabled:ue=!0,suggestions:xe,maxSuggestions:Pe=6,suggestionStyle:E="carousel",suggestionTrigger:V="always",suggestionPlacement:se="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:f="default",queryHandler:P,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ye="Publisher Assistant",relatedItemsHeading:ze="Related reading",onOpen:Le,onClose:Re})=>{const{sdk:De,sessionId:Be,theme:qt,apiKey:ae,userId:ce}=Zd(),{suggestions:be,isAnalyzingIntent:Ie,intentError:je,retryIntentAnalysis:J,activeDelegationSession:Oe,hasActiveDelegationSession:X,stopDelegationSession:Ve,refreshDelegationActivity:Ge}=Gd();Rh(),console.log("[AdMeshIntentAssistant] Context:",{sdk:De,sessionId:Be,hasContextTheme:!!qt});const K=s||qt||Hh,Je=K?.mode||"light",Fe=B==="ad-slot",un=(p=!1)=>Fe&&!(p&&C==="expand"),[it,Kt]=x.useState(Q||le),Mn=O!==void 0,Mo=Mn?O:it,[yn,Vr]=x.useState(""),[Xt,Rt]=x.useState(!1),[ot,mt]=x.useState([]),[qe,dn]=x.useState(!1),[Ur,pn]=x.useState(null),[me,mn]=x.useState(!1),[vn,ve]=x.useState(new Set),[tt,Jt]=x.useState(xe||be||[]),[Io,Yn]=x.useState(0),[cr,jo]=x.useState(0),[Qr,$i]=x.useState({}),No=x.useRef(null),er=x.useRef(!1),fn=x.useRef(null),ra=x.useRef(new Map),qr=x.useRef([]),In=x.useRef(null),Ct=x.useRef(null),Ht=x.useRef(null),pr=x.useRef(!1),oa=x.useRef(!1),Oi=x.useRef(null),aa=x.useRef(null),ia=x.useRef(null),[kr,qa]=x.useState(!1),[mr,Kr]=x.useState(!1),cn=x.useRef(null),Mt=x.useRef(null),Dt=!!(ae!=null&&ae.toLowerCase().startsWith("pub_")),Yt=X()&&Oe?.session_id===Be?Oe:null,sa=x.useRef(new Set),fr=x.useRef(new Set),_r=x.useRef(!1),Xr=Fe&&C==="expand"&&(me||qe),[Ro,Wi]=x.useState(!1);x.useEffect(()=>{if(typeof window>"u")return;const p=window.matchMedia("(max-width: 767px)"),N=()=>Wi(p.matches);return N(),p.addEventListener("change",N),()=>p.removeEventListener("change",N)},[]),x.useEffect(()=>{if(!Xr||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[Xr]);const Ka=Fe&&C==="sticky"&&(me||ot.length>0||qe),xn=Ua(U)??"100%",tr=Ua(ee)??"100%",nr=Yd(U),hn=Yd(ee),Xa=Fe&&(hn??Number.POSITIVE_INFINITY)<=60,wn=Fe&&(nr??Number.POSITIVE_INFINITY)<=360&&(hn??Number.POSITIVE_INFINITY)<=120,Sr=x.useCallback(p=>N=>{N?ra.current.set(p,N):ra.current.delete(p)},[]),bt=x.useCallback(async(p,N={})=>{if(!(!De||!Be))try{await De.trackPublisherAssistantEvent({event_name:p,timestamp:new Date().toISOString(),session_id:Be,...rc(te),...N})}catch(R){console.warn(`[AdMeshIntentAssistant] Failed to track ${p}`,R)}},[te,De,Be]),hr=x.useCallback((p,N,R)=>{var L,Z;const pe=N?.recommendation_id;if(!pe)return;const Ye=`${p}:${pe}`;fr.current.has(Ye)||(fr.current.add(Ye),bt("recommendation_shown",{message_id:p,query:R,recommendation_id:pe,brand_name:(Z=(L=N.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,is_sponsored:!0}))},[bt]),Ga=x.useCallback((p,N,R,L,Z,pe)=>{const Ye=Array.isArray(pe)&&pe.length?pe.map((Te,We)=>{const kt=Po(Te.text||"");return kt?{id:`followup_llm_${We}_${kt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:kt,type:Te.type||"information",is_sponsored:!1}:null}).filter(Te=>!!Te).slice(0,3):$h(p,N,R,L),zt=Wh(Z),Lt=zt?[zt,...Ye.slice(0,2)]:Ye.slice(0,3);Lt.length&&Jt(sl(Lt))},[]),en=x.useCallback((p,N)=>{const R=Po(p.query||p.label||"");if(!R||!N)return;const L={id:N,text:R,type:"action",is_sponsored:!0,recommendation:{recommendation_id:N,recommendation:{creative:{follow_up_suggestion:R}},tracking:{followup_engagement_url:p.engagement_url,followup_exposure_url:p.exposure_url}}};Jt(Z=>{const pe=Z.filter(Ye=>!Ye.is_sponsored).slice(0,3);return sl([L,...pe].slice(0,4))})},[]),la=x.useCallback(()=>{const p=In.current,N=Ct.current;if(!p||!N)return!1;const R=p.getBoundingClientRect(),L=N.getBoundingClientRect(),Z=Math.max(0,p.scrollTop+L.top-R.top);return p.scrollTop=Z,!0},[]);x.useLayoutEffect(()=>{var p;if(pr.current){la()&&(pr.current=!1);return}oa.current||(p=aa.current)==null||p.scrollIntoView({behavior:"smooth"})},[ot,la]),x.useLayoutEffect(()=>{if(!Fe||Xr)return;const p=Oi.current;if(!p)return;const N=p.closest(".admesh-publisher-assistant-reactMount"),R=tr;[p,N].forEach(Z=>{Z&&(Z.style.width=xn,Z.style.maxWidth=xn,Z.style.height=R,Z.style.maxHeight=R,Z.style.overflow="hidden",Z.style.boxSizing="border-box",Z.dataset.admeshAdSlotExpanded=Ka?"true":"false")});const L=N?.parentElement;L&&L!==document.body&&L!==document.documentElement&&(L.style.width=xn,L.style.maxWidth=xn,L.style.height=R,L.style.maxHeight=R,L.style.overflow="hidden",L.style.boxSizing="border-box")},[tr,xn,Xr,Fe,Ka]),x.useEffect(()=>{if(xe&&xe.length){Jt(xe);return}be&&be.length&&Jt(p=>Fh(p,be))},[xe,be]),x.useEffect(()=>{if(f!=="default"||!G)return;let p=!1;return G().then(N=>{!p&&Array.isArray(N)&&N.length&&Jt(N)}).catch(N=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",N)}),()=>{p=!0}},[G,f]),x.useEffect(()=>{if(!qe){jo(0),No.current=null;return}No.current==null&&(No.current=typeof performance<"u"?performance.now():Date.now());const p=()=>{const R=No.current;if(R==null)return;const L=typeof performance<"u"?performance.now():Date.now();jo(Math.floor((L-R)/1e3))};p();const N=window.setInterval(p,1e3);return()=>window.clearInterval(N)},[qe]),x.useEffect(()=>{if(!qe||f!=="default"){Yn(0);return}const p=window.setInterval(()=>{Yn(N=>Math.min(N+1,7))},3e3);return()=>window.clearInterval(p)},[qe,f]),x.useEffect(()=>{_r.current||!De||!Be||(_r.current=!0,bt("assistant_loaded",{metadata:{layout:y,surface:B,variant:f,default_open:Q||le}}))},[le,Q,y,De,Be,B,bt,f]);const rr=x.useCallback(p=>{Mn?fe?.(p):Kt(p),p?(bt("assistant_opened",{metadata:{layout:y,surface:B,ad_slot_behavior:C,variant:f,expanded:me}}),Le?.()):Re?.()},[Mn,me,y,fe,Le,Re,B,bt,f]),ua=x.useCallback(()=>{rr(!0)},[rr]),Gr=x.useCallback(()=>{rr(!1)},[rr]),Hi=x.useCallback(()=>{mn(p=>!p)},[]),Za=x.useCallback(async(p,N,R,L,Z,pe,Ye)=>{var zt,Lt,Te;if(!De)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 We=await fetch(`${De.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:pe,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ae}`},body:JSON.stringify({message:p,session_id:Be||"default-session",message_id:N,user_id:ce,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:rc(te),conversation_history:Ye,sponsored_recommendation:Z!=null&&Z.recommendation_id?{recommendation_id:Z.recommendation_id,brand_name:(Lt=(zt=Z.recommendation)==null?void 0:zt.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(!We.ok)throw new Error(`API request failed: ${We.status} ${We.statusText}`);const kt=(Te=We.body)==null?void 0:Te.getReader(),Gt=new TextDecoder;if(!kt)throw new Error("Response body is not readable");let Vt="",Ut,_n,Bn,Ce,He;return await(async()=>{try{for(;;){const{done:ht,value:st}=await kt.read();if(ht)break;const Sn=Gt.decode(st,{stream:!0}).split(`
|
|
1215
|
-
`);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:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He};try{const gt=JSON.parse(nn);switch(gt.type){case"content":{const qi=gt.content||"";Vt+=qi,R?.(qi);break}case"final":{Vt=gt.reply||Vt,Ut=Array.isArray(gt.source_links)?gt.source_links:void 0,_n=Array.isArray(gt.related_items)?gt.related_items:void 0,Bn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:void 0,Ce=typeof gt.used_capability=="string"?gt.used_capability:Ce,He=typeof gt.response_time_ms=="number"?gt.response_time_ms:He;break}case"followup_suggestions":{Bn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:Bn;break}case"error":throw new Error(gt.message||"Unknown streaming error");case"session_start":L?.(),console.log("Session started:",gt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(ht){if(pe!=null&&pe.aborted)return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He,error:"aborted"};throw console.error("Stream processing error:",ht),ht}finally{kt.releaseLock()}return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He}})()}catch(We){return pe!=null&&pe.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",We),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:We instanceof Error?We.message:"request_failed"})}},[De,Be,ae,ce,Yt,Ge]),gr=x.useCallback(()=>{const p=cn.current;if(!p||p.signal.aborted)return;p.abort(),dn(!1),fn.current=null,er.current=!1;const N=Mt.current;N&&mt(R=>R.map(L=>L.id===N&&!L.content.trim()?{...L,content:"Generation stopped."}:L))},[]),Cr=x.useCallback(async p=>{var N,R,L,Z,pe,Ye,zt,Lt;if(!p.trim()||qe)return;const Te=typeof performance<"u"?performance.now():Date.now(),We=p.trim(),kt=Date.now().toString(),Gt=new AbortController,Vt=fn.current,Ut=Vt?.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)}));cn.current=Gt,Mt.current=null,Ht.current=kt,pr.current=!0,oa.current=!0,fn.current=null,Jt(Ce=>Ce.some(He=>He.is_sponsored)?Ce.filter(He=>!He.is_sponsored):Ce),pn(null);const Bn={id:kt,role:"user",content:We,timestamp:new Date};if(bt("query_submitted",{message_id:kt,query:We}),mt(Ce=>[...Ce,Bn]),Vr(""),dn(!0),f==="default"&&P){try{const Ce=(Date.now()+1).toString(),He={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:null};er.current&&(ve(Sn=>new Set([...Sn,Ce])),er.current=!1),mt(Sn=>[...Sn,He]),Mt.current=Ce;const ht=await P(We,{sponsoredSuggestion:Vt});if(Gt.signal.aborted){fn.current=null;return}const st=ht.recommendation||Ut||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:p,hasResponseRecommendation:!!ht.recommendation,hasSponsoredSuggestionRecommendation:!!Ut,finalRecommendationId:st?.recommendation_id}),mt(Sn=>Sn.map(St=>St.id===Ce?{...St,content:ht.answer,sourceLinks:ht.source_links,relatedItems:ht.related_items,initialRecommendation:st,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-Te}:St)),Ga(We,ht.answer,ht.source_links,ht.related_items,ht.recommendation||null,ht.followup_suggestions),bt("answer_completed",{message_id:Ce,query:We,recommendation_id:st?.recommendation_id,brand_name:(R=(N=st?.recommendation)==null?void 0:N.creative)==null?void 0:R.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"completed",metadata:{variant:f,source:"query_handler"}}),fn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";pn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,status:He,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,metadata:{variant:f,source:"query_handler"}}),fn.current=null}finally{cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))}return}if(!De){setTimeout(()=>{if(Gt.signal.aborted){cn.current===Gt&&(cn.current=null,Mt.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:p};mt(He=>[...He,Ce]),cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),He=Ut,ht={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:He};er.current&&(ve(St=>new Set([...St,Ce])),er.current=!1),mt(St=>[...St,ht]),Mt.current=Ce;const st=await Za(We,kt,St=>{mt(nn=>nn.map(gt=>gt.id===Ce?{...gt,content:gt.content+St}:gt))},()=>{dn(!0),Yn(0)},He,Gt.signal,_n);if(Gt.signal.aborted){st.text.trim()||mt(St=>St.map(nn=>nn.id===Ce&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Z=(L=He?.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"aborted",metadata:{variant:f,source:"api_chat_assistant"}}),fn.current=null;return}const Sn=typeof st.response_time_ms=="number"?st.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-Te;mt(St=>St.map(nn=>nn.id===Ce?{...nn,content:st.text,sourceLinks:st.source_links,relatedItems:st.related_items,initialRecommendation:nn.initialRecommendation||He,responseTimeMs:Sn}:nn)),Ga(We,st.text,st.source_links,st.related_items,null,st.followup_suggestions),st.error?bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Ye=(pe=He?.recommendation)==null?void 0:pe.creative)==null?void 0:Ye.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:st.error,metadata:{variant:f,source:"api_chat_assistant"}}):bt("answer_completed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Lt=(zt=He?.recommendation)==null?void 0:zt.creative)==null?void 0:Lt.brand_name,used_capability:st.used_capability,latency_ms:Sn,status:"completed",metadata:{variant:f,source:"api_chat_assistant",response_time_ms:Sn}}),fn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";pn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:He,metadata:{variant:f,source:"api_chat_assistant"}}),fn.current=null}finally{cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))}},[qe,Za,P,Ga,De,bt,f]),or=tt,Do=x.useMemo(()=>or.some(p=>p?.is_sponsored),[or]),Zr=x.useMemo(()=>or.filter(p=>p&&typeof p.id=="string"?Ee?Do:!0:!1),[Do,Ee,or]),Bt=x.useMemo(()=>sl(Zr),[Zr]),Jr=x.useMemo(()=>ke==="below-input-container"&&ue?Bt.find(p=>p.is_sponsored&&p.recommendation)??null:null,[ue,Bt,ke]),br=x.useCallback(async p=>{var N,R,L,Z,pe,Ye,zt;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:p.text,is_sponsored:p.is_sponsored,hasRecommendation:!!p.recommendation,recommendationId:((N=p.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url),sessionId:Be}),er.current=p.is_sponsored||!1,fn.current=p.is_sponsored?p:null;const Lt=Bt.findIndex(Te=>Te.id===p.id);bt("suggestion_clicked",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:Lt>=0?Lt:void 0,is_sponsored:p.is_sponsored,recommendation_id:(Z=p.recommendation)==null?void 0:Z.recommendation_id,brand_name:(zt=(Ye=(pe=p.recommendation)==null?void 0:pe.recommendation)==null?void 0:Ye.creative)==null?void 0:zt.brand_name,query:p.text}),Cr(p.text),p.is_sponsored&&p.recommendation&&De?setTimeout(async()=>{var Te;try{const We=(Te=p.recommendation.tracking)==null?void 0:Te.followup_engagement_url,kt=p.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:We,recommendationId:kt,sessionId:Be}),We&&kt&&Be?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await De.fireFollowupEngagement(We,kt,Be),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!We,hasRecommendationId:!!kt,hasSessionId:!!Be})}catch(We){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",We)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Cr,Bt,De,Be,bt]),kn=Vh[ne],da=Bh[ie];x.useEffect(()=>{if(qr.current.forEach(p=>p()),qr.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Bt.forEach((p,N)=>{const R=ra.current.get(p.id);if(!R)return;const L=`${Be||"anonymous"}:${p.id}:${p.is_sponsored?"s":"o"}`;if(sa.current.has(L))return;let Z=null,pe=null;const Ye=()=>{Z&&(clearTimeout(Z),Z=null),pe?.disconnect(),pe=null},zt=()=>{var Lt,Te,We,kt,Gt;if(sa.current.has(L)){Ye();return}if(sa.current.add(L),Ye(),bt("suggestion_exposure",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:N,is_sponsored:p.is_sponsored,recommendation_id:(Lt=p.recommendation)==null?void 0:Lt.recommendation_id,brand_name:(kt=(We=(Te=p.recommendation)==null?void 0:Te.recommendation)==null?void 0:We.creative)==null?void 0:kt.brand_name}),De&&Be&&p.is_sponsored&&p.recommendation){const Vt=(Gt=p.recommendation.tracking)==null?void 0:Gt.followup_exposure_url,Ut=p.recommendation.recommendation_id;Vt&&Ut?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Vt,recommendationId:Ut,suggestionText:p.text,sessionId:Be}),De.fireFollowupExposure(Vt,Ut,Be)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Vt,hasRecommendationId:!!Ut,suggestionText:p.text})}};pe=new IntersectionObserver(Lt=>{const Te=Lt[0];if(Te){if(Te.intersectionRatio>=.5){Z||(Z=setTimeout(zt,1e3));return}Z&&(clearTimeout(Z),Z=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),pe.observe(R),qr.current.push(Ye)}),()=>{qr.current.forEach(p=>p()),qr.current=[]}},[Bt,De,Be,bt,Xt]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:Zr.length,isAnalyzingIntent:Ie,hasIntentError:!!je,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:Do,sponsoredCount:or.filter(p=>p?.is_sponsored).length,nonSponsoredCount:or.filter(p=>p&&!(p!=null&&p.is_sponsored)).length,modalShouldAppear:Ee?Do:!0,suggestions:or.map(p=>{var N,R,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((N=p?.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p?.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url)}}),renderedSuggestions:Bt.map(p=>{var N,R,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((N=p?.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p?.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url)}})});const et={base:`${16*re}px`,sm:`${14*re}px`,xs:`${12*re}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=p=>{const N=p?.accentColor||yt,R=p?.metaColor||Lo,L=p?.includeSteps??f==="default",Z=`${cr}s`,pe=L?`${Yr[Io]} (${Z})`:`Generating answer... ${Z}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:p!=null&&p.compact?"8px":"10px",color:R,fontSize:p!=null&&p.compact?et.xs:et.sm},children:[m.jsx("span",{style:{width:p!=null&&p.compact?8:9,height:p!=null&&p.compact?8:9,borderRadius:999,background:N,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${wt(Et,.28)}`,flexShrink:0}}),m.jsx("span",{children:pe})]})},ca=x.useCallback((p,N)=>{if(Qr[p.id])return;const R=N?"helpful":"not_helpful";$i(L=>({...L,[p.id]:R})),bt("answer_feedback",{message_id:p.id,query:p.userQuery,status:R,latency_ms:p.responseTimeMs,metadata:{helpful:N}})},[Qr,bt]);function pa(p,N){if(p.role!=="assistant"||!p.content.trim()||qe&&p.id===Mt.current)return null;const R=N?.accentColor||yt,L=N?.metaColor||Lo,Z=Qr[p.id],pe=typeof p.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:L,whiteSpace:"nowrap"},children:Z?"Thanks for your feedback":"Is this helpful?"}),Z?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:wt(R,.12),color:R,flexShrink:0},children:Z==="helpful"?m.jsx(Dd,{size:14}):m.jsx(Rd,{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:()=>ca(p,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:L,cursor:"pointer"},children:m.jsx(Dd,{size:14})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>ca(p,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:L,cursor:"pointer"},children:m.jsx(Rd,{size:14})})]})]}),pe?m.jsxs("span",{style:{fontSize:et.xs,color:L,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Lh(p.responseTimeMs)]}):null]})}const ar=x.useCallback(()=>{const p=ia.current;if(!p)return;const N=Math.max(0,p.scrollWidth-p.clientWidth);qa(p.scrollLeft>4),Kr(p.scrollLeft<N-4)},[]);x.useEffect(()=>(ar(),window.addEventListener("resize",ar),()=>window.removeEventListener("resize",ar)),[ar,Bt.length]);const On=x.useCallback(p=>{const N=ia.current;N&&N.scrollBy({left:p==="left"?-Math.max(160,Math.floor(N.clientWidth*.75)):Math.max(160,Math.floor(N.clientWidth*.75)),behavior:"smooth"})},[]),wt=(p,N)=>{if(!p||!p.startsWith("#"))return`rgba(15, 23, 42, ${N})`;const R=p.slice(1),L=R.length===3?R.split("").map(zt=>`${zt}${zt}`).join(""):R;if(L.length!==6)return p;const Z=parseInt(L.slice(0,2),16),pe=parseInt(L.slice(2,4),16),Ye=parseInt(L.slice(4,6),16);return`rgba(${Z}, ${pe}, ${Ye}, ${N})`},Et=K.primaryColor||"#3F037F",It=K.surfaceColor||"#ffffff",Ja=K.backgroundColor||"#eef2ff",tn=K.borderColor||"#e5e7eb",Tt=K.textColor||"#111827",Wn=K.textSecondaryColor||"#6b7280";wt(Et,.12);const To=wt(Et,.24);wt(Et,.38);const Bi=It,yt=Et,Hn=K.primaryTextColor||"#ffffff",Lo=Wn,to=ye||"Publisher Assistant",no=Ie&&Bt.length===0&&ot.length===0,Fo=It,$o=It,jn=tn,Oo=tn,Ya="0 16px 64px rgba(15, 23, 42, 0.14)",ei=Wn,ml=Wn,fl=yt,ma=Ja,hl="none",gl="rgba(15, 23, 42, 0.18)";function Vi(p){return Yt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:p==="default"?"10px 12px":"8px 10px",borderRadius:p==="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:yt,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:()=>{Ve("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${To}`,borderRadius:999,background:wt("#ffffff",.92),color:yt,padding:"7px 12px",fontSize:et.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Ui(p,N=Fe){const R=Ro&&!N,L=N||R?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:N||p==="default"?"2px":"8px",marginTop:N?"0":p==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ml,fontSize:L,lineHeight:R?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Er})})}function ti(p){const N=p==="publisher"?[180,220,196]:["100%","82%","68%"];return p==="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:N.map((R,L)=>m.jsx("div",{style:{width:R,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-${L}`))}),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:p==="publisher"?"10px":"12px"},children:N.map((R,L)=>m.jsx("div",{style:{width:R,maxWidth:"100%",height:p==="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:p==="publisher"?`0 8px 22px ${wt(Et,.08)}`:"none"}},`suggestion-skeleton-${L}`))})}function Qi(p=Fe){if(qe)return null;if(no)return ti("publisher");if(!Bt.length)return null;const N=p&&Xa,R=Bt.slice(0,Pe);return E==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:p?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:p?"240px":void 0,paddingRight:p?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:R.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(mn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:It,color:L.is_sponsored?Hn:Tt,padding:p?"8px 10px":"10px 14px",fontSize:p?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:L.text}),ue&&L.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:wt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},L.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:N?"4px":wn?"5px":p?"6px":"10px",flexShrink:0},children:[!N&&m.jsx("button",{type:"button",onClick:()=>On("left"),disabled:!kr,"aria-label":"Scroll suggestions left",style:{width:wn?20:p?24:28,height:wn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:"#6b7280",fontSize:wn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:"\u2039"}),m.jsx("div",{ref:ia,onScroll:ar,style:{display:"flex",gap:N?"4px":wn?"5px":p?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:R.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(mn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:N?"4px":wn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:It,color:L.is_sponsored?Hn:Tt,padding:N?"4px 8px":wn?"5px 8px":p?"7px 10px":"8px 14px",fontSize:N?"10px":wn?"11px":p?"12px":"13px",fontWeight:500,lineHeight:N?1:wn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:L.text}),ue&&L.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},L.id))}),!N&&m.jsx("button",{type:"button",onClick:()=>On("right"),disabled:!mr,"aria-label":"Scroll suggestions right",style:{width:wn?20:p?24:28,height:wn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:"#6b7280",fontSize:wn?"13px":void 0,lineHeight:1,cursor:mr?"pointer":"default",opacity:mr?1:.55},children:"\u203A"})]})}function bl(p=Fe){if(p||!(Jr!=null&&Jr.recommendation))return null;const N=`publisher-sponsored-creative-${Jr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Va,{messageId:N,query:Jr.text,initialRecommendation:Jr.recommendation,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,Jr.text)},onError:R=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",R)}})})}function yl(p){var N,R;return(N=p.relatedItems)!=null&&N.length||!((R=p.sourceLinks)!=null&&R.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:Wn},children:"Sources"}),p.sourceLinks.map(L=>m.jsxs("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url}})},style:{color:yt,fontSize:et.xs,textDecoration:"none",borderBottom:`1px solid ${wt(Et,.18)}`},children:[L.title||L.url," ",m.jsx(qf,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${p.id}-${L.url}`))]})}function vl(p,N=Fe){var R;return(R=p.relatedItems)!=null&&R.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:Wn,marginBottom:"8px"},children:ze}),m.jsx("div",{style:{display:"flex",gap:N?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:p.relatedItems.slice(0,4).map(L=>m.jsxs("a",{className:"admesh-publisher-source",href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url,source_publisher:L.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:N?"6px":"10px",padding:N?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Tt,border:`1px solid ${tn}`,background:It,boxShadow:"none",flex:N?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:N?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:N?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Tt,overflowWrap:"anywhere"},children:L.title||L.url}),L.publisher&&m.jsx("div",{style:{fontSize:N?"11px":"12px",color:Wn,lineHeight:1.4,overflowWrap:"anywhere"},children:L.publisher})]},`${p.id}-${L.url}`))})]}):null}function xl(p=Fe){const N=p?"13px":"15px";return m.jsxs("div",{ref:In,style:{flex:p?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:p?"0 2px 4px":me?"16px 16px 8px":0},children:[ot.map(R=>{const L=R.role==="user"&&R.id===Ht.current;return m.jsx("div",{ref:L?Ct:void 0,style:{marginBottom:p?"16px":"28px",textAlign:R.role==="user"?"right":"left"},children:(()=>{const Z=!!R.content.trim()||!qe;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:R.role==="assistant"?"block":"inline-block",width:R.role==="assistant"?"100%":void 0,maxWidth:R.role==="assistant"?"100%":"76%",padding:R.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:R.role==="assistant"?0:"8px",background:R.role==="user"?wt(Tt,.05):"transparent",color:Tt,boxShadow:"none",border:"none",fontSize:R.role==="assistant"?N:p?"12px":"13px",lineHeight:R.role==="assistant"?1.62:1.4},children:[R.role==="assistant"?R.content.trim()?m.jsx(il,{content:R.content,theme:{...K,textColor:Tt},fontSize:N}):qe&&R.id===Mt.current?eo({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Tt},children:R.content}),R.role==="assistant"&&yl(R),R.role==="assistant"&&vl(R,p),R.role==="assistant"&&pa(R),R.role==="assistant"&&Z&&vn.has(R.id)&&R.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:R.id,query:R.userQuery,initialRecommendation:R.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,R.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})}),R.role==="assistant"&&Z&&!vn.has(R.id)&&(R.initialRecommendation||Dt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:R.id,query:R.userQuery,initialRecommendation:R.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,R.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})})]})})})()},R.id)}),Ur&&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(f==="default"){let p=function(L){const Z=ec(Ro);return el.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:R}),m.jsx("div",{style:Z.shell,children:L})]}),document.body)},N=function(L=!1){const Z=un(L),pe=L||Z&&me,Ye=!pe&&V==="input",zt=Z&&!pe&&Xa,Lt=pe&&!(Fe&&C==="expand"&&!L&&Xr),Te=pe?ec(Ro):null,We=!!(Te&&Ro&&!Z),kt=Z?xn:Te?Te.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Gt=Z?tr:Te?Te.panelHeight:"auto",Vt=Z?xn:Te?.panelMaxWidth??"100%",Ut=Z?tr:Te?.panelMaxHeight,_n=D&&!zt&&pe;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":Z?"true":"false",style:{"--publisher-accent":yt,color:Tt,width:kt,maxWidth:Vt,height:Gt,maxHeight:Ut,boxSizing:"border-box",display:"flex",flexDirection:"column",background:pe?Fo:Bi,borderRadius:!Z&&Te?Te.panelBorderRadius:"12px",padding:pe?0:Z?"6px":0,boxShadow:We?"none":pe?Ya:"none",border:We||Ye?"none":`1px solid ${Oo}`,overflow:"hidden",minHeight:Z?0:void 0},children:[m.jsx("style",{children:Td}),_n&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:Z?"8px 10px":"14px 20px",background:$o,color:Tt,borderBottom:`1px solid ${jn}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:Z?26:32,height:Z?26:32,flexShrink:0,borderRadius:"6px",background:wt(Tt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:yt,overflow:"hidden"},children:I?m.jsx("img",{src:I,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:It,padding:4}}):m.jsx(tl,{size:Z?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(q||_)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[q&&m.jsx("div",{style:{fontSize:Z?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:v}),_&&m.jsx("div",{style:{fontSize:Z?"10px":"12px",color:ei,marginTop:"2px"},children:to})]})]}),pe&&(!Z||L)&&m.jsx("button",{type:"button",onClick:()=>mn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,borderRadius:"8px",border:`1px solid ${jn}`,background:It,color:ei,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(jd,{size:16,strokeWidth:1.5,"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:zt?"2px":Z?"6px":"16px",minHeight:0,flex:Z||pe?"1 1 0":void 0,overflow:Z||pe?"hidden":void 0,overscrollBehavior:"contain",padding:Ye?Z?"4px":"8px":Z?"8px":"20px",justifyContent:pe?void 0:"center",background:Fo},children:[Vi("default"),Lt&&xl(Z),!Ye&&m.jsxs(m.Fragment,{children:[Z&&!pe&&!zt&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),Z&&!pe&&ge&&M&&ot.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:$e}),Qi(Z)]}),(Ye||!Z||pe||A)&&m.jsx(Jf,{value:yn,onChange:Vr,open:Ye&&Xt&&!me,onOpenChange:Ye?Rt:Dh,suggestions:Bt.slice(0,Pe),registerSuggestion:Sr,loading:qe,analyzing:no,compact:Z,expanded:pe,showLogo:!pe,suggestionPlacement:se,logoUrl:I,title:v,placeholder:oe,colors:{accent:yt,accentText:Hn,surface:ma,text:Tt,muted:Wn,border:tn},onStop:gr,onSend:()=>{fn.current=null,er.current=!1,mn(!0),y==="floating"&&rr(!0),Cr(yn)},onSuggestion:Bn=>{mn(!0),y==="floating"&&rr(!0),br(Bn)}}),pe&&Ui("default",Z),!pe&&V==="always"&&bl(Z)]})]})};const R={position:"fixed",inset:0,background:gl,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Fe?m.jsxs("div",{ref:Oi,className:"admesh-component","data-admesh-theme":Je,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":C,"data-admesh-ad-slot-expanded":Ka?"true":"false",style:{width:xn,height:tr,maxWidth:xn,maxHeight:tr,position:"relative",overflow:"hidden"},children:[N(!1),Xr&&typeof document<"u"&&p(N(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,style:{width:"100%",position:"relative"},children:[N(!1),me&&typeof document<"u"&&p(N(!0))]}):Mo?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,children:[!me&&m.jsx("div",{style:{position:"fixed",...kn,zIndex:2147483001},children:N(!1)}),me&&typeof document<"u"&&p(N(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("button",{type:"button",onClick:ua,style:{position:"fixed",...kn,zIndex:2147483e3,border:"none",borderRadius:"6px",background:K.primaryColor,color:Hn,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(tl,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),c]})})}return Bt.length===0&&!no?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Ua(U)??"100%",backgroundColor:"#eef2ff",fontSize:et.base,...d},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[no?ti("legacy"):Bt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Bt.slice(0,Pe).map((p,N)=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),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:N===0?"100%":N===1?"82%":"68%",backgroundColor:K.surfaceColor||"#ffffff",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:et.sm},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.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"})]},p.id))}),ot.length>0&&m.jsxs("div",{ref:In,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:[ot.map(p=>{const N=p.role==="user"&&p.id===Ht.current;return m.jsx("div",{ref:N?Ct:void 0,className:p.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:p.role==="user"?K.primaryColor:"#ffffff",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,fontSize:et.sm},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(il,{content:p.content,theme:K,fontSize:et.sm}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===Mt.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:p.content})})},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===Mt.current&&!p.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})}),Ur&&m.jsx("div",{className:"text-sm",style:{color:K.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:yn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(yn)}},placeholder:oe,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textColor,fontSize:et.sm}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(yn)},disabled:!qe&&!yn.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:qe?"#dc2626":K.primaryColor,color:"#ffffff"},children:qe?m.jsx(nl,{size:18}):m.jsx(Nd,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:K.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:K.textSecondaryColor,fontSize:et.xs,lineHeight:1.5},children:Er})]})]})})}):Mo?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...me?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kn,width:Ua(U)??da.width,height:Ua(ee)??da.height},backgroundColor:me?Fo:K.backgroundColor,zIndex:9999,fontSize:et.base,borderRadius:me?"20px":"16px",border:me?`1px solid ${Oo}`:"1px solid transparent",boxShadow:me?Ya:"0 20px 40px rgba(15, 23, 42, 0.12)",...d},children:[D&&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:me?jn:"transparent",background:me?$o:K.backgroundColor,padding:me?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:me?40:32,height:me?40:32,borderRadius:me?"14px":"10px",background:wt(Et,.08),color:yt,display:"flex",alignItems:"center",justifyContent:"center",fontSize:me?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:I?m.jsx("img",{src:I,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(v||"AA").slice(0,2).toUpperCase()}),(q||_&&me)&&m.jsxs("div",{children:[q&&m.jsx("div",{className:"font-medium",style:{color:K.textColor,fontSize:me?"20px":et.base,fontWeight:700,letterSpacing:me?"-0.02em":0},children:v}),_&&me&&m.jsx("div",{style:{color:ei,fontSize:"12px",marginTop:"2px"},children:to})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Hi,className:"transition-colors",title:me?"Minimize":"Expand",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?jn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:me?m.jsx(jd,{size:16,style:{color:K.textSecondaryColor}}):m.jsx(Gf,{size:16,style:{color:K.textSecondaryColor}})}),m.jsx("button",{onClick:Gr,className:"transition-colors",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?jn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(nl,{size:16,style:{color:K.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:In,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:me?"20px":"16px"},children:[Vi("legacy"),ge&&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:K.textColor,margin:0,fontSize:et.sm},children:$e})})}),ot.map(p=>{const N=p.role==="user"&&p.id===Ht.current;return m.jsxs("div",{ref:N?Ct:void 0,className:"mb-3",children:[m.jsx("div",{className:p.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:p.role==="user"?fl:"transparent",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,border:"none",borderRadius:p.role==="user"?me?"14px":"12px":0,padding:p.role==="user"?me?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${et.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(il,{content:p.content,theme:K,fontSize:`calc(${et.sm} * 1.3)`})}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===Mt.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:et.sm,lineHeight:"1.4"},children:p.content})}),p.role==="assistant"&&!vn.has(p.id)&&m.jsx(Va,{messageId:p.id,query:p.userQuery,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,p.userQuery)},onError:R=>{console.error("[AdMeshIntentAssistant] Recommendations error:",R)}}),p.role==="assistant"&&vn.has(p.id)&&p.initialRecommendation&&!qe&&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(Va,{messageId:p.id,query:p.userQuery,initialRecommendation:p.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,p.userQuery)},onError:R=>{console.error("[AdMeshIntentAssistant] Recommendations error:",R)}})]})]},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===Mt.current&&!p.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:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})})}),Ur&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.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:ti("legacy")}),Bt.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:Bt.slice(0,Pe).map(p=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),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:et.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.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:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b"},children:"Ad"})]},p.id))})}),je&&!Ie&&Zr.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:K.surfaceColor,borderColor:K.borderColor,color:K.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:J,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:K.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:et.xs},children:je})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:me?jn:"transparent",padding:me?"18px 20px":void 0,background:me?$o:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${jn}`,borderRadius:me?"16px":"12px",background:ma,boxShadow:me?hl:"none",padding:me?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:yn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(yn)}},placeholder:oe,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:me?"15px":et.sm,"--tw-ring-color":K.primaryColor}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(yn)},disabled:!qe&&!yn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:qe?"#dc2626":K.primaryColor,color:"#ffffff",borderRadius:me?"12px":"10px",width:me?"46px":void 0,height:me?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:me?`0 10px 20px ${wt(Et,.18)}`:"none"},children:qe?m.jsx(nl,{size:14}):m.jsx(Nd,{size:14})})]}),Ui("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,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:K.primaryColor,color:"#ffffff",zIndex:9999,fontSize:et.base,...d},children:m.jsx("span",{className:"font-medium",children:c})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const ll={"mobile-leaderboard":{width:320,height:100},"medium-rectangle":{width:300,height:250},leaderboard:{width:728,height:90},"half-page":{width:300,height:600},"large-rectangle":{width:336,height:280},skyscraper:{width:120,height:600},billboard:{width:970,height:250}},Qh={"mobile-leaderboard":"carousel","medium-rectangle":"carousel",leaderboard:"carousel","large-rectangle":"carousel",billboard:"carousel","half-page":"stacked",skyscraper:"stacked"},qh={"mobile-leaderboard":!1,"medium-rectangle":!1,leaderboard:!1},Kh={"mobile-leaderboard":!1,leaderboard:!1},Xh={"mobile-leaderboard":!1,leaderboard:!1},Gh={"mobile-leaderboard":!1,leaderboard:!1},oc={"mobile-leaderboard":"expand",leaderboard:"expand"},ul={"half-page":"medium-rectangle","large-rectangle":"medium-rectangle",skyscraper:"medium-rectangle",billboard:"medium-rectangle",leaderboard:"mobile-leaderboard"},Zh=60*1e3,ac="admesh-publisher-assistant-embed-styles",ic=window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com";function Jh(){if(document.getElementById(ac))return;const s=document.createElement("style");s.id=ac,s.textContent=`
|
|
1215
|
+
`;let tc=!1;const Lh=()=>{x.useEffect(()=>{if(!tc){try{Rh();const i=document.createElement("style");i.id="admesh-ui-sdk-styles-legacy",i.textContent=Dh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(i),tc=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Fh=()=>{};function Oh(i){const l=Math.max(1,Math.round(i));if(l<60)return`${l}s`;const d=Math.floor(l/60),c=l%60;return c>0?`${d}m ${c}s`:`${d}m`}function $h(i){return Oh(i/1e3)}function Wh({imageUrl:i,logoUrl:l,articleUrl:d}){const[c,v]=x.useState([]),P=sr(i,d),R=sr(l,d),K=[P,R].find(b=>b&&!c.includes(b));if(!K)return null;const _=K===R;return m.jsx("img",{src:K,alt:"",loading:"lazy",decoding:"async",onError:()=>v(b=>[...b,K]),style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",aspectRatio:"16 / 9",objectFit:_?"contain":"cover",borderRadius:"4px",margin:0,padding:_?"12px":0,boxSizing:"border-box"}})}const ul=({content:i,theme:l,fontSize:d})=>{const c=I=>I.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((M,B)=>{if(M.startsWith("**")&&M.endsWith("**")&&M.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:M.slice(2,-2)},B);const H=M.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return H?m.jsx("a",{href:H[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:H[1]},B):m.jsx(x.Fragment,{children:M},B)}),v=I=>I.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(M=>M.trim()).filter((M,B,H)=>M.length>0||B<H.length-1),P=I=>{const M=v(I);return M.length>1&&M.every(B=>/^:?-{3,}:?$/.test(B))},R=I=>{const M=I.indexOf("|");if(M<=0)return{heading:null,headerLine:I};const B=I.slice(0,M).trim();return!B||/^[-|:\s]+$/.test(B)?{heading:null,headerLine:I}:{heading:B,headerLine:I.slice(M).trim()}},K=(I,M)=>{const B=v(I).length,H=v(M).length;return B<=1||B===H?M:`| ${Array.from({length:B},()=>"---").join(" | ")} |`},_=I=>{if(I.length<2||!I[0].includes("|"))return{heading:null,lines:I};const{heading:M,headerLine:B}=R(I[0]),H=B.startsWith("|")?B:`| ${B}`,ee=K(H,I[1]);return{heading:M,lines:[H,ee,...I.slice(2)]}},b=I=>{if(I.length<2||!I[0].includes("|"))return!1;const{lines:M}=_(I);return P(M[1])&&v(M[0]).length>=2},U=I=>{if(!I.includes("|"))return[I];let M=I.trim();const B=[],H=M.indexOf("|");if(H>0){const ee=M.slice(0,H).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(B.push(ee),M=M.slice(H).trim())}return M=M.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,te)=>`
|
|
1216
|
+
${te}`),M=M.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
|
|
1217
|
+
| `),M=M.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
|
|
1218
|
+
`),B.push(...M.split(`
|
|
1219
|
+
`).map(ee=>ee.trim()).filter(Boolean)),B},E=I=>{const M=I.split(`
|
|
1220
|
+
`),B=[];for(const H of M){if(!H.includes("|")){B.push(H);continue}B.push(...U(H))}return B.join(`
|
|
1221
|
+
`)},W=(I=>{const M=E(I).split(`
|
|
1222
|
+
`),B=[];let H=0;for(;H<M.length;){const ee=M[H],te=M[H+1]||"";if(ee.includes("|")&&P(te)){B.length>0&&B[B.length-1].trim()&&B.push("");const{heading:re,headerLine:ne}=R(ee);for(re&&B.push(re),B.push(ne,K(ne,te)),H+=2;H<M.length&&M[H].includes("|")&&M[H].trim();)B.push(M[H]),H+=1;H<M.length&&M[H].trim()&&B.push("");continue}B.push(ee),H+=1}return B.join(`
|
|
1223
|
+
`)})(i).split(/\n\s*\n/).map(I=>I.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:d},children:W.map((I,M)=>{const B=I.split(`
|
|
1224
|
+
`).map(ne=>ne.trim()).filter(Boolean),H=B.every(ne=>/^[-*]\s+/.test(ne)),ee=B.every(ne=>/^\d+\.\s+/.test(ne)),te=B.length===1&&/^#{1,3}\s+/.test(B[0]),re=b(B);if(te){const ne=B[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:M===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ne)},M)}if(re){const{heading:ne,lines:ie}=_(B),Q=v(ie[0]),$=ie.slice(2).map(v).filter(fe=>fe.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ne?m.jsx("p",{style:{marginTop:M===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:d},children:c(ne)}):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:d,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((fe,le)=>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:c(fe)},le))})}),m.jsx("tbody",{children:$.map((fe,le)=>m.jsx("tr",{children:fe.map((be,Oe)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:le===$.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(be)},Oe))},le))})]})})]},M)}if(H||ee){const ne=ee?"ol":"ul";return m.jsx(ne,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:d},children:B.map((ie,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:c(ie.replace(/^([-*]|\d+\.)\s+/,""))},Q))},M)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:d,whiteSpace:"pre-wrap"},children:B.map((ne,ie)=>m.jsxs(x.Fragment,{children:[ie>0&&m.jsx("br",{}),c(ne)]},ie))},M)})})};function Ba(i){return i===void 0?void 0:typeof i=="number"?`${i}px`:i}function nc(i){if(typeof i=="number")return i;if(typeof i!="string")return;const l=Number(i.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function jo(i){return i.replace(/\s+/g," ").trim()}function Bh(i,l){const d=i.filter(R=>!(R!=null&&R.is_sponsored)).slice(0,3),c=l.filter(R=>!(R!=null&&R.is_sponsored)).slice(0,3),v=l.find(R=>R?.is_sponsored);if(!v)return c.length?c:d;const P=c.length?c:d;return[v,...P].slice(0,4)}function Uh(i,l,d,c){const v=new Set,P=[],R=(E,W="information")=>{const I=jo(E);if(!I)return;const M=I.toLowerCase();v.has(M)||(v.add(M),P.push({id:`followup_${P.length}_${M.replace(/[^a-z0-9]+/g,"_")}`,text:I,type:W,is_sponsored:!1}))},K=new Set,_=E=>{const W=jo(E||"");if(!W)return;const I=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();I&&K.add(I)};(c||[]).forEach(E=>_(E?.title)),(d||[]).forEach(E=>_(E?.title)),l.split(/\n+/).map(E=>jo(E.replace(/^[-*]\s+/,""))).filter(Boolean).filter(E=>E.length>=24&&E.length<=90).forEach(E=>{K.size>=6||_(E)});const b=jo(i.replace(/[?.!]+$/g,"")),U=Array.from(K).slice(0,3);return[U[0]?`Tell me more about ${U[0]}`:"",U[1]?`Show me examples related to ${U[1]}`:"",U[2]?`Compare the main options for ${U[2]}`:"","Break this down more simply",`What should I look at next about ${b}`,"Give me the practical takeaway here"].forEach((E,W)=>{P.length>=3||R(E,W===0?"comparison":"information")}),P.slice(0,3)}function Vh(){if(typeof window>"u")return"unknown";const i=window.innerWidth;return i<768?"mobile":i<1024?"tablet":"desktop"}function rc(i){return i?{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 oc(i){const l=i?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function ac(){var i;try{const l=(i=window.location.href)==null?void 0:i.trim();if(oc(l))return l}catch{return}}function ic(i){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=ac()||(oc(i)?i.trim():void 0);let d=l?window.location.pathname||"/":void 0;try{d=l?new URL(l).pathname||"/":void 0}catch{d=ac()?window.location.pathname||"/":void 0}const c=(d||"").split("/").filter(Boolean);return{page_url:l,page_path:d,article_slug:c[c.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Vh()}}function Hh(i){var l,d;const c=(d=(l=i?.recommendation)==null?void 0:l.creative)==null?void 0:d.follow_up_suggestion,v=i?.recommendation_id;return!c||!v?null:{id:v,text:jo(c),type:"action",is_sponsored:!0,recommendation:i,metadata:{source:"assistant_query_recommendation",recommendation_id:v}}}function dl(i){return[...i].sort((l,d)=>{const c=!!l.is_sponsored,v=!!d.is_sponsored;return c===v?0:c?-1:1})}const Kh={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)"}},Qh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},qh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Xh=({theme:i,className:l,style:d,triggerLabel:c="Ask Ava",headerTitle:v="Ask Ava",headerLogoUrl:P,showHeader:R=!0,showHeaderTitle:K=!0,showSubtitle:_=!0,layout:b="floating",surface:U="page",adSlotBehavior:E="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:I=!0,showCompactSlotInput:M=!0,showCompactSlotDisclaimer:B=!0,panelWidth:H,panelHeight:ee,analyticsPageUrl:te,fontScale:re=1,position:ne="bottom-right",size:ie="md",defaultOpen:Q,open:$,onOpenChange:fe,autoOpen:le=!1,showWelcomeMessage:be=!1,welcomeMessage:Oe="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:oe="Ask me anything about products...",adsEnabled:ue=!0,suggestions:ye,maxSuggestions:Te=6,suggestionStyle:C="carousel",suggestionTrigger:V="always",suggestionPlacement:se="below",sponsoredCreativePlacement:ke="below-input-container",onlyShowWhenSponsored:Ce=!1,variant:f="default",queryHandler:T,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ve="Publisher Assistant",relatedItemsHeading:ze="Related reading",onOpen:Le,onClose:Ne})=>{const{sdk:Re,sessionId:Ue,theme:Ut,apiKey:ae,userId:ce}=ec(),{suggestions:he,isAnalyzingIntent:Ie,intentError:Ae,retryIntentAnalysis:Z,activeDelegationSession:$e,hasActiveDelegationSession:X,stopDelegationSession:Ve,refreshDelegationActivity:Ze}=Yd();Lh(),console.log("[AdMeshIntentAssistant] Context:",{sdk:Re,sessionId:Ue,hasContextTheme:!!Ut});const q=i||Ut||Kh,Ye=q?.mode||"light",Fe=U==="ad-slot",un=(p=!1)=>Fe&&!(p&&E==="expand"),[st,Vt]=x.useState(Q||le),Pn=$!==void 0,No=Pn?$:st,[wn,qr]=x.useState(""),[Ht,At]=x.useState(!1),[at,ft]=x.useState([]),[Qe,dn]=x.useState(!1),[Xr,fn]=x.useState(null),[me,hn]=x.useState(!1),[kn,xe]=x.useState(new Set),[nt,qt]=x.useState(ye||he||[]),[Ro,Gn]=x.useState(0),[lr,Do]=x.useState(0),[Gr,$i]=x.useState({}),Lo=x.useRef(null),Zn=x.useRef(!1),gn=x.useRef(null),na=x.useRef(new Map),Zr=x.useRef([]),In=x.useRef(null),St=x.useRef(null),Wt=x.useRef(null),ur=x.useRef(!1),ra=x.useRef(!1),Wi=x.useRef(null),oa=x.useRef(null),aa=x.useRef(null),[kr,Va]=x.useState(!1),[dr,Jr]=x.useState(!1),cn=x.useRef(null),Tt=x.useRef(null),jt=!!(ae!=null&&ae.toLowerCase().startsWith("pub_")),Xt=X()&&$e?.session_id===Ue?$e:null,ia=x.useRef(new Set),cr=x.useRef(new Set),_r=x.useRef(!1),Yr=Fe&&E==="expand"&&(me||Qe),[Fo,Bi]=x.useState(!1);x.useEffect(()=>{if(typeof window>"u")return;const p=window.matchMedia("(max-width: 767px)"),A=()=>Bi(p.matches);return A(),p.addEventListener("change",A),()=>p.removeEventListener("change",A)},[]),x.useEffect(()=>{if(!Yr||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[Yr]);const Ha=Fe&&E==="sticky"&&(me||at.length>0||Qe),_n=Ba(H)??"100%",Jn=Ba(ee)??"100%",Yn=nc(H),bn=nc(ee),Ka=Fe&&(bn??Number.POSITIVE_INFINITY)<=60,pn=Fe&&(Yn??Number.POSITIVE_INFINITY)<=360&&(bn??Number.POSITIVE_INFINITY)<=120,Sr=x.useCallback(p=>A=>{A?na.current.set(p,A):na.current.delete(p)},[]),yt=x.useCallback(async(p,A={})=>{if(!(!Re||!Ue))try{await Re.trackPublisherAssistantEvent({event_name:p,timestamp:new Date().toISOString(),session_id:Ue,...ic(te),...A})}catch(j){console.warn(`[AdMeshIntentAssistant] Failed to track ${p}`,j)}},[te,Re,Ue]),pr=x.useCallback((p,A,j)=>{var D,J;const pe=A?.recommendation_id;if(!pe)return;const et=`${p}:${pe}`;cr.current.has(et)||(cr.current.add(et),yt("recommendation_shown",{message_id:p,query:j,recommendation_id:pe,brand_name:(J=(D=A.recommendation)==null?void 0:D.creative)==null?void 0:J.brand_name,is_sponsored:!0}))},[yt]),Qa=x.useCallback((p,A,j,D,J,pe)=>{const et=Array.isArray(pe)&&pe.length?pe.map((De,We)=>{const wt=jo(De.text||"");return wt?{id:`followup_llm_${We}_${wt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:wt,type:De.type||"information",is_sponsored:!1}:null}).filter(De=>!!De).slice(0,3):Uh(p,A,j,D),Ct=Hh(J),Rt=Ct?[Ct,...et.slice(0,2)]:et.slice(0,3);Rt.length&&qt(dl(Rt))},[]),Gt=x.useCallback((p,A)=>{const j=jo(p.query||p.label||"");if(!j||!A)return;const D={id:A,text:j,type:"action",is_sponsored:!0,recommendation:{recommendation_id:A,recommendation:{creative:{follow_up_suggestion:j}},tracking:{followup_engagement_url:p.engagement_url,followup_exposure_url:p.exposure_url}}};qt(J=>{const pe=J.filter(et=>!et.is_sponsored).slice(0,3);return dl([D,...pe].slice(0,4))})},[]),sa=x.useCallback(()=>{const p=In.current,A=St.current;if(!p||!A)return!1;const j=p.getBoundingClientRect(),D=A.getBoundingClientRect(),J=Math.max(0,p.scrollTop+D.top-j.top);return p.scrollTop=J,!0},[]);x.useLayoutEffect(()=>{var p;if(ur.current){sa()&&(ur.current=!1);return}ra.current||(p=oa.current)==null||p.scrollIntoView({behavior:"smooth"})},[at,sa]),x.useLayoutEffect(()=>{if(!Fe||Yr)return;const p=Wi.current;if(!p)return;const A=p.closest(".admesh-publisher-assistant-reactMount"),j=Jn;[p,A].forEach(J=>{J&&(J.style.width=_n,J.style.maxWidth=_n,J.style.height=j,J.style.maxHeight=j,J.style.overflow="hidden",J.style.boxSizing="border-box",J.dataset.admeshAdSlotExpanded=Ha?"true":"false")});const D=A?.parentElement;D&&D!==document.body&&D!==document.documentElement&&(D.style.width=_n,D.style.maxWidth=_n,D.style.height=j,D.style.maxHeight=j,D.style.overflow="hidden",D.style.boxSizing="border-box")},[Jn,_n,Yr,Fe,Ha]),x.useEffect(()=>{if(ye&&ye.length){qt(ye);return}he&&he.length&&qt(p=>Bh(p,he))},[ye,he]),x.useEffect(()=>{if(f!=="default"||!G)return;let p=!1;return G().then(A=>{!p&&Array.isArray(A)&&A.length&&qt(A)}).catch(A=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",A)}),()=>{p=!0}},[G,f]),x.useEffect(()=>{if(!Qe){Do(0),Lo.current=null;return}Lo.current==null&&(Lo.current=typeof performance<"u"?performance.now():Date.now());const p=()=>{const j=Lo.current;if(j==null)return;const D=typeof performance<"u"?performance.now():Date.now();Do(Math.floor((D-j)/1e3))};p();const A=window.setInterval(p,1e3);return()=>window.clearInterval(A)},[Qe]),x.useEffect(()=>{if(!Qe||f!=="default"){Gn(0);return}const p=window.setInterval(()=>{Gn(A=>Math.min(A+1,7))},3e3);return()=>window.clearInterval(p)},[Qe,f]),x.useEffect(()=>{_r.current||!Re||!Ue||(_r.current=!0,yt("assistant_loaded",{metadata:{layout:b,surface:U,variant:f,default_open:Q||le}}))},[le,Q,b,Re,Ue,U,yt,f]);const er=x.useCallback(p=>{Pn?fe?.(p):Vt(p),p?(yt("assistant_opened",{metadata:{layout:b,surface:U,ad_slot_behavior:E,variant:f,expanded:me}}),Le?.()):Ne?.()},[Pn,me,b,fe,Le,Ne,U,yt,f]),la=x.useCallback(()=>{er(!0)},[er]),eo=x.useCallback(()=>{er(!1)},[er]),Ui=x.useCallback(()=>{hn(p=>!p)},[]),qa=x.useCallback(async(p,A,j,D,J,pe,et)=>{var Ct,Rt,De;if(!Re)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{Xt&&await Ze("turn_started",{source:"publisher_assistant",recommendation_id:Xt.recommendation_id}).catch(bt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",bt)});const We=await fetch(`${Re.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:pe,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ae}`},body:JSON.stringify({message:p,session_id:Ue||"default-session",message_id:A,user_id:ce,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:ic(te),conversation_history:et,sponsored_recommendation:J!=null&&J.recommendation_id?{recommendation_id:J.recommendation_id,brand_name:(Rt=(Ct=J.recommendation)==null?void 0:Ct.creative)==null?void 0:Rt.brand_name}:void 0,active_delegation_session:Xt?{delegation_session_id:Xt.delegation_session_id,recommendation_id:Xt.recommendation_id,session_id:Xt.session_id,brand_name:Xt.brand_name,mcp_endpoint:Xt.mcp_endpoint,status:Xt.status}:void 0}})});if(!We.ok)throw new Error(`API request failed: ${We.status} ${We.statusText}`);const wt=(De=We.body)==null?void 0:De.getReader(),Dt=new TextDecoder;if(!wt)throw new Error("Response body is not readable");let _t="",tn,nr,jn,Ee,Be;return await(async()=>{try{for(;;){const{done:bt,value:tt}=await wt.read();if(bt)break;const Nn=Dt.decode(tt,{stream:!0}).split(`
|
|
1225
|
+
`);for(const Kt of Nn)if(Kt.startsWith("data: ")){const nn=Kt.slice(6);if(nn.trim()==="[DONE]")return Xt&&Ze("turn_completed",{source:"publisher_assistant",recommendation_id:Xt.recommendation_id}).catch(ht=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",ht)}),{text:_t,source_links:tn,related_items:nr,followup_suggestions:jn,used_capability:Ee,response_time_ms:Be};try{const ht=JSON.parse(nn);switch(ht.type){case"content":{const ni=ht.content||"";_t+=ni,j?.(ni);break}case"final":{_t=ht.reply||_t,tn=Array.isArray(ht.source_links)?ht.source_links:void 0,nr=Array.isArray(ht.related_items)?ht.related_items:void 0,jn=Array.isArray(ht.followup_suggestions)?ht.followup_suggestions:void 0,Ee=typeof ht.used_capability=="string"?ht.used_capability:Ee,Be=typeof ht.response_time_ms=="number"?ht.response_time_ms:Be;break}case"followup_suggestions":{jn=Array.isArray(ht.followup_suggestions)?ht.followup_suggestions:jn;break}case"error":throw new Error(ht.message||"Unknown streaming error");case"session_start":D?.(),console.log("Session started:",ht.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(bt){if(pe!=null&&pe.aborted)return{text:_t,source_links:tn,related_items:nr,followup_suggestions:jn,used_capability:Ee,response_time_ms:Be,error:"aborted"};throw console.error("Stream processing error:",bt),bt}finally{wt.releaseLock()}return{text:_t,source_links:tn,related_items:nr,followup_suggestions:jn,used_capability:Ee,response_time_ms:Be}})()}catch(We){return pe!=null&&pe.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",We),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:We instanceof Error?We.message:"request_failed"})}},[Re,Ue,ae,ce,Xt,Ze]),mr=x.useCallback(()=>{const p=cn.current;if(!p||p.signal.aborted)return;p.abort(),dn(!1),gn.current=null,Zn.current=!1;const A=Tt.current;A&&ft(j=>j.map(D=>D.id===A&&!D.content.trim()?{...D,content:"Generation stopped."}:D))},[]),Er=x.useCallback(async p=>{var A,j,D,J,pe,et,Ct,Rt;if(!p.trim()||Qe)return;const De=typeof performance<"u"?performance.now():Date.now(),We=p.trim(),wt=Date.now().toString(),Dt=new AbortController,_t=gn.current,tn=_t?.recommendation||null,nr=at.filter(Ee=>(Ee.role==="user"||Ee.role==="assistant")&&Ee.content.trim()).slice(-6).map(Ee=>({role:Ee.role,content:Ee.content.trim().slice(0,1200)}));cn.current=Dt,Tt.current=null,Wt.current=wt,ur.current=!0,ra.current=!0,gn.current=null,qt(Ee=>Ee.some(Be=>Be.is_sponsored)?Ee.filter(Be=>!Be.is_sponsored):Ee),fn(null);const jn={id:wt,role:"user",content:We,timestamp:new Date};if(yt("query_submitted",{message_id:wt,query:We}),ft(Ee=>[...Ee,jn]),qr(""),dn(!0),f==="default"&&T){try{const Ee=(Date.now()+1).toString(),Be={id:Ee,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:null};Zn.current&&(xe(Nn=>new Set([...Nn,Ee])),Zn.current=!1),ft(Nn=>[...Nn,Be]),Tt.current=Ee;const bt=await T(We,{sponsoredSuggestion:_t});if(Dt.signal.aborted){gn.current=null;return}const tt=bt.recommendation||tn||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:p,hasResponseRecommendation:!!bt.recommendation,hasSponsoredSuggestionRecommendation:!!tn,finalRecommendationId:tt?.recommendation_id}),ft(Nn=>Nn.map(Kt=>Kt.id===Ee?{...Kt,content:bt.answer,sourceLinks:bt.source_links,relatedItems:bt.related_items,initialRecommendation:tt,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-De}:Kt)),Qa(We,bt.answer,bt.source_links,bt.related_items,bt.recommendation||null,bt.followup_suggestions),yt("answer_completed",{message_id:Ee,query:We,recommendation_id:tt?.recommendation_id,brand_name:(j=(A=tt?.recommendation)==null?void 0:A.creative)==null?void 0:j.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-De,status:"completed",metadata:{variant:f,source:"query_handler"}}),gn.current=null}catch(Ee){console.error("Error sending message:",Ee);const Be=Ee instanceof Error?Ee.message:"Unknown error occurred";fn(Be);const bt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(tt=>[...tt,bt]),yt("answer_failed",{query:We,status:Be,latency_ms:(typeof performance<"u"?performance.now():Date.now())-De,metadata:{variant:f,source:"query_handler"}}),gn.current=null}finally{cn.current===Dt&&(cn.current=null,Tt.current=null,dn(!1))}return}if(!Re){setTimeout(()=>{if(Dt.signal.aborted){cn.current===Dt&&(cn.current=null,Tt.current=null);return}const Ee={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:p};ft(Be=>[...Be,Ee]),cn.current===Dt&&(cn.current=null,Tt.current=null,dn(!1))},1e3);return}try{const Ee=(Date.now()+1).toString(),Be=tn,bt={id:Ee,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:Be};Zn.current&&(xe(Kt=>new Set([...Kt,Ee])),Zn.current=!1),ft(Kt=>[...Kt,bt]),Tt.current=Ee;const tt=await qa(We,wt,Kt=>{ft(nn=>nn.map(ht=>ht.id===Ee?{...ht,content:ht.content+Kt}:ht))},()=>{dn(!0),Gn(0)},Be,Dt.signal,nr);if(Dt.signal.aborted){tt.text.trim()||ft(Kt=>Kt.map(nn=>nn.id===Ee&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),yt("answer_failed",{message_id:Ee,query:We,recommendation_id:Be?.recommendation_id,brand_name:(J=(D=Be?.recommendation)==null?void 0:D.creative)==null?void 0:J.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-De,status:"aborted",metadata:{variant:f,source:"api_chat_assistant"}}),gn.current=null;return}const Nn=typeof tt.response_time_ms=="number"?tt.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-De;ft(Kt=>Kt.map(nn=>nn.id===Ee?{...nn,content:tt.text,sourceLinks:tt.source_links,relatedItems:tt.related_items,initialRecommendation:nn.initialRecommendation||Be,responseTimeMs:Nn}:nn)),Qa(We,tt.text,tt.source_links,tt.related_items,null,tt.followup_suggestions),tt.error?yt("answer_failed",{message_id:Ee,query:We,recommendation_id:Be?.recommendation_id,brand_name:(et=(pe=Be?.recommendation)==null?void 0:pe.creative)==null?void 0:et.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-De,status:tt.error,metadata:{variant:f,source:"api_chat_assistant"}}):yt("answer_completed",{message_id:Ee,query:We,recommendation_id:Be?.recommendation_id,brand_name:(Rt=(Ct=Be?.recommendation)==null?void 0:Ct.creative)==null?void 0:Rt.brand_name,used_capability:tt.used_capability,latency_ms:Nn,status:"completed",metadata:{variant:f,source:"api_chat_assistant",response_time_ms:Nn}}),gn.current=null}catch(Ee){console.error("Error sending message:",Ee);const Be=Ee instanceof Error?Ee.message:"Unknown error occurred";fn(Be);const bt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(tt=>[...tt,bt]),yt("answer_failed",{query:We,latency_ms:(typeof performance<"u"?performance.now():Date.now())-De,status:Be,metadata:{variant:f,source:"api_chat_assistant"}}),gn.current=null}finally{cn.current===Dt&&(cn.current=null,Tt.current=null,dn(!1))}},[Qe,qa,T,Qa,Re,yt,f]),tr=nt,Oo=x.useMemo(()=>tr.some(p=>p?.is_sponsored),[tr]),to=x.useMemo(()=>tr.filter(p=>p&&typeof p.id=="string"?Ce?Oo:!0:!1),[Oo,Ce,tr]),Zt=x.useMemo(()=>dl(to),[to]),[Vi,ua]=x.useState(null);x.useEffect(()=>{const p=(ye||he||[]).find(A=>{var j;return A.is_sponsored&&((j=A.recommendation)==null?void 0:j.status)==="generated"&&A.recommendation.recommendation});p&&ua(A=>A??p)},[ye,he]);const mn=x.useMemo(()=>ke==="below-input-container"&&ue?Vi:null,[ue,Vi,ke]),Cr=x.useCallback(async p=>{var A,j,D,J,pe,et,Ct;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:p.text,is_sponsored:p.is_sponsored,hasRecommendation:!!p.recommendation,recommendationId:((A=p.recommendation)==null?void 0:A.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((D=(j=p.recommendation)==null?void 0:j.tracking)!=null&&D.followup_engagement_url),sessionId:Ue}),Zn.current=p.is_sponsored||!1,gn.current=p.is_sponsored?p:null;const Rt=Zt.findIndex(De=>De.id===p.id);yt("suggestion_clicked",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:Rt>=0?Rt:void 0,is_sponsored:p.is_sponsored,recommendation_id:(J=p.recommendation)==null?void 0:J.recommendation_id,brand_name:(Ct=(et=(pe=p.recommendation)==null?void 0:pe.recommendation)==null?void 0:et.creative)==null?void 0:Ct.brand_name,query:p.text}),Er(p.text),p.is_sponsored&&p.recommendation&&Re?setTimeout(async()=>{var De;try{const We=(De=p.recommendation.tracking)==null?void 0:De.followup_engagement_url,wt=p.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:We,recommendationId:wt,sessionId:Ue}),We&&wt&&Ue?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await Re.fireFollowupEngagement(We,wt,Ue),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!We,hasRecommendationId:!!wt,hasSessionId:!!Ue})}catch(We){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",We)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Er,Zt,Re,Ue,yt]),no=qh[ne],zr=Qh[ie];x.useEffect(()=>{if(Zr.current.forEach(p=>p()),Zr.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Zt.forEach((p,A)=>{const j=na.current.get(p.id);if(!j)return;const D=`${Ue||"anonymous"}:${p.id}:${p.is_sponsored?"s":"o"}`;if(ia.current.has(D))return;let J=null,pe=null;const et=()=>{J&&(clearTimeout(J),J=null),pe?.disconnect(),pe=null},Ct=()=>{var Rt,De,We,wt,Dt;if(ia.current.has(D)){et();return}if(ia.current.add(D),et(),yt("suggestion_exposure",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:A,is_sponsored:p.is_sponsored,recommendation_id:(Rt=p.recommendation)==null?void 0:Rt.recommendation_id,brand_name:(wt=(We=(De=p.recommendation)==null?void 0:De.recommendation)==null?void 0:We.creative)==null?void 0:wt.brand_name}),Re&&Ue&&p.is_sponsored&&p.recommendation){const _t=(Dt=p.recommendation.tracking)==null?void 0:Dt.followup_exposure_url,tn=p.recommendation.recommendation_id;_t&&tn?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:_t,recommendationId:tn,suggestionText:p.text,sessionId:Ue}),Re.fireFollowupExposure(_t,tn,Ue)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!_t,hasRecommendationId:!!tn,suggestionText:p.text})}};pe=new IntersectionObserver(Rt=>{const De=Rt[0];if(De){if(De.intersectionRatio>=.5){J||(J=setTimeout(Ct,1e3));return}J&&(clearTimeout(J),J=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),pe.observe(j),Zr.current.push(et)}),()=>{Zr.current.forEach(p=>p()),Zr.current=[]}},[Zt,Re,Ue,yt,Ht]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:tr.length,safeSuggestions:to.length,isAnalyzingIntent:Ie,hasIntentError:!!Ae,onlyShowWhenSponsored:Ce,hasSponsoredSuggestions:Oo,sponsoredCount:tr.filter(p=>p?.is_sponsored).length,nonSponsoredCount:tr.filter(p=>p&&!(p!=null&&p.is_sponsored)).length,modalShouldAppear:Ce?Oo:!0,suggestions:tr.map(p=>{var A,j,D;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((A=p?.recommendation)==null?void 0:A.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((D=(j=p?.recommendation)==null?void 0:j.tracking)!=null&&D.followup_engagement_url)}}),renderedSuggestions:Zt.map(p=>{var A,j,D;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((A=p?.recommendation)==null?void 0:A.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((D=(j=p?.recommendation)==null?void 0:j.tracking)!=null&&D.followup_engagement_url)}})});const qe={base:`${16*re}px`,sm:`${14*re}px`,xs:`${12*re}px`},Xa=Y||"AI-generated responses may contain errors. Please verify important information independently.",Ga=["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..."],ro=p=>{const A=p?.accentColor||yn,j=p?.metaColor||Ki,D=p?.includeSteps??f==="default",J=`${lr}s`,pe=D?`${Ga[Ro]} (${J})`:`Generating answer... ${J}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:p!=null&&p.compact?"8px":"10px",color:j,fontSize:p!=null&&p.compact?qe.xs:qe.sm},children:[m.jsx("span",{style:{width:p!=null&&p.compact?8:9,height:p!=null&&p.compact?8:9,borderRadius:999,background:A,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${lt(Nt,.28)}`,flexShrink:0}}),m.jsx("span",{children:pe})]})},oo=x.useCallback((p,A)=>{if(Gr[p.id])return;const j=A?"helpful":"not_helpful";$i(D=>({...D,[p.id]:j})),yt("answer_feedback",{message_id:p.id,query:p.userQuery,status:j,latency_ms:p.responseTimeMs,metadata:{helpful:A}})},[Gr,yt]);function An(p,A){if(p.role!=="assistant"||!p.content.trim()||Qe&&p.id===Tt.current)return null;const j=A?.accentColor||yn,D=A?.metaColor||Ki,J=Gr[p.id],pe=typeof p.responseTimeMs=="number";return m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginTop:"10px",paddingTop:"10px",borderTop:`1px solid ${Yt}`,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:qe.xs,color:D,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:lt(j,.12),color:j,flexShrink:0},children:J==="helpful"?m.jsx(Fd,{size:14}):m.jsx(Ld,{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:()=>oo(p,!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 ${Yt}`,background:Jt,color:D,cursor:"pointer"},children:m.jsx(Fd,{size:14,style:{flexShrink:0}})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>oo(p,!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 ${Yt}`,background:Jt,color:D,cursor:"pointer"},children:m.jsx(Ld,{size:14,style:{flexShrink:0}})})]})]}),pe?m.jsxs("span",{style:{fontSize:qe.xs,color:D,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",$h(p.responseTimeMs)]}):null]})}const Mr=x.useCallback(()=>{const p=aa.current;if(!p)return;const A=Math.max(0,p.scrollWidth-p.clientWidth);Va(p.scrollLeft>4),Jr(p.scrollLeft<A-4)},[]);x.useEffect(()=>(Mr(),window.addEventListener("resize",Mr),()=>window.removeEventListener("resize",Mr)),[Mr,Zt.length]);const ao=x.useCallback(p=>{const A=aa.current;A&&A.scrollBy({left:p==="left"?-Math.max(160,Math.floor(A.clientWidth*.75)):Math.max(160,Math.floor(A.clientWidth*.75)),behavior:"smooth"})},[]),lt=(p,A)=>{if(!p||!p.startsWith("#"))return`rgba(15, 23, 42, ${A})`;const j=p.slice(1),D=j.length===3?j.split("").map(Ct=>`${Ct}${Ct}`).join(""):j;if(D.length!==6)return p;const J=parseInt(D.slice(0,2),16),pe=parseInt(D.slice(2,4),16),et=parseInt(D.slice(4,6),16);return`rgba(${J}, ${pe}, ${et}, ${A})`},Nt=q.primaryColor||"#3F037F",Jt=q.surfaceColor||"#ffffff",Hi=q.backgroundColor||"#eef2ff",Yt=q.borderColor||"#e5e7eb",Et=q.textColor||"#111827",fr=q.textSecondaryColor||"#6b7280";lt(Nt,.12);const en=lt(Nt,.24);lt(Nt,.38);const Tr=Jt,yn=Nt,hr=q.primaryTextColor||"#ffffff",Ki=fr,da=ve||"Publisher Assistant",gr=Ie&&Zt.length===0&&at.length===0,Pr=Jt,io=Jt,br=Yt,Qi=Yt,qi="0 16px 64px rgba(15, 23, 42, 0.14)",Za=fr,Ja=fr,gl=yn,Xi=Hi,bl="none",yl="rgba(15, 23, 42, 0.18)";function Gi(p){return Xt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:p==="default"?"10px 12px":"8px 10px",borderRadius:p==="default"?"14px":"12px",border:`1px solid ${en}`,background:lt("#ffffff",.9),marginBottom:"4px"},children:[m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{color:yn,fontSize:qe.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),m.jsxs("div",{style:{color:Et,fontSize:qe.sm,fontWeight:600,lineHeight:1.3},children:[Xt.brand_name," agent is active"]})]}),m.jsx("button",{type:"button",onClick:()=>{Ve("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${en}`,borderRadius:999,background:lt("#ffffff",.92),color:yn,padding:"7px 12px",fontSize:qe.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Ya(p,A=Fe){const j=Fo&&!A,D=A||j?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:A||p==="default"?"2px":"8px",marginTop:A?"0":p==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:Ja,fontSize:D,lineHeight:j?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Xa})})}function ei(p){const A=p==="publisher"?[180,220,196]:["100%","82%","68%"];return p==="publisher"?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:lt(Et,.06),flexShrink:0}}),m.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:A.map((j,D)=>m.jsx("div",{style:{width:j,maxWidth:"100%",height:40,borderRadius:"6px",background:lt(Et,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${D}`))}),m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:lt(Et,.06),flexShrink:0}})]}):m.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:p==="publisher"?"10px":"12px"},children:A.map((j,D)=>m.jsx("div",{style:{width:j,maxWidth:"100%",height:p==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${lt(Nt,.08)} 0%, ${lt(Nt,.18)} 50%, ${lt(Nt,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:p==="publisher"?`0 8px 22px ${lt(Nt,.08)}`:"none"}},`suggestion-skeleton-${D}`))})}function vl(p=Fe){if(Qe)return null;if(gr)return ei("publisher");if(!Zt.length)return null;const A=p&&Ka,j=Zt.slice(0,Te);return C==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:p?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:p?"240px":void 0,paddingRight:p?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:j.map(D=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":D.is_sponsored?"true":void 0,ref:Sr(D.id),onClick:()=>{f==="default"&&(hn(!0),b==="floating"&&er(!0)),Cr(D)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${D.is_sponsored?Nt:Yt}`,background:D.is_sponsored?Nt:Jt,color:D.is_sponsored?hr:Et,padding:p?"8px 10px":"10px 14px",fontSize:p?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:D.text}),ue&&D.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:lt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},D.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:A?"4px":pn?"5px":p?"6px":"10px",flexShrink:0},children:[!A&&m.jsx("button",{type:"button",onClick:()=>ao("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:pn?20:p?24:28,height:pn?20:p?24:28,borderRadius:"6px",border:`1px solid ${Yt}`,background:Jt,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:m.jsx(Gf,{size:pn?13:p?14:16,style:{flexShrink:0},"aria-hidden":"true"})}),m.jsx("div",{ref:aa,onScroll:Mr,style:{display:"flex",gap:A?"4px":pn?"5px":p?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:j.map(D=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":D.is_sponsored?"true":void 0,ref:Sr(D.id),onClick:()=>{f==="default"&&(hn(!0),b==="floating"&&er(!0)),Cr(D)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:A?"4px":pn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${D.is_sponsored?Nt:Yt}`,background:D.is_sponsored?Nt:Jt,color:D.is_sponsored?hr:Et,padding:A?"4px 8px":pn?"5px 8px":p?"7px 10px":"8px 14px",fontSize:A?"10px":pn?"11px":p?"12px":"13px",fontWeight:500,lineHeight:A?1:pn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:D.text}),ue&&D.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},D.id))}),!A&&m.jsx("button",{type:"button",onClick:()=>ao("right"),disabled:!dr,"aria-label":"Scroll suggestions right",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:pn?20:p?24:28,height:pn?20:p?24:28,borderRadius:"6px",border:`1px solid ${Yt}`,background:Jt,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:dr?"pointer":"default",opacity:dr?1:.55},children:m.jsx(Zf,{size:pn?13:p?14:16,style:{flexShrink:0},"aria-hidden":"true"})})]})}function xl(p=Fe){if(p||!(mn!=null&&mn.recommendation))return null;const A=`publisher-sponsored-creative-${mn.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Wa,{messageId:A,query:mn.text,initialRecommendation:mn.recommendation,onFollowupDetected:Gt,onRecommendationsShown:(j,D)=>{pr(j,D,mn.text)},onError:j=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",j)}})})}function wl(p){var A,j;return(A=p.relatedItems)!=null&&A.length||!((j=p.sourceLinks)!=null&&j.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:fr},children:"Sources"}),p.sourceLinks.map(D=>m.jsxs("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:D.title,source_url:D.url}})},style:{color:yn,fontSize:qe.xs,textDecoration:"none",borderBottom:`1px solid ${lt(Nt,.18)}`},children:[D.title||D.url," ",m.jsx(qf,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${p.id}-${D.url}`))]})}function ti(p,A=Fe){var j;return(j=p.relatedItems)!=null&&j.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:fr,marginBottom:"8px"},children:ze}),m.jsx("div",{style:{display:"flex",gap:A?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:p.relatedItems.slice(0,4).map(D=>m.jsxs("a",{className:"admesh-publisher-source",href:D.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:D.title,source_url:D.url,source_publisher:D.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:A?"6px":"10px",padding:A?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Et,border:`1px solid ${Yt}`,background:Jt,boxShadow:"none",flex:A?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:A?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx(Wh,{imageUrl:D.image_url,logoUrl:P,articleUrl:D.url},`${D.image_url||""}-${P||""}`),m.jsx("div",{style:{fontSize:A?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Et,overflowWrap:"anywhere"},children:D.title||D.url}),D.publisher&&m.jsx("div",{style:{fontSize:A?"11px":"12px",color:fr,lineHeight:1.4,overflowWrap:"anywhere"},children:D.publisher})]},`${p.id}-${D.url}`))})]}):null}function kl(p=Fe){const A=p?"13px":"15px";return m.jsxs("div",{ref:In,style:{flex:p?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:p?"0 2px 4px":me?"16px 16px 8px":0},children:[at.map(j=>{const D=j.role==="user"&&j.id===Wt.current;return m.jsx("div",{ref:D?St:void 0,style:{marginBottom:p?"16px":"28px",textAlign:j.role==="user"?"right":"left"},children:(()=>{const J=!!j.content.trim()||!Qe;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:j.role==="assistant"?"block":"inline-block",width:j.role==="assistant"?"100%":void 0,maxWidth:j.role==="assistant"?"100%":"76%",padding:j.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:j.role==="assistant"?0:"8px",background:j.role==="user"?lt(Et,.05):"transparent",color:Et,boxShadow:"none",border:"none",fontSize:j.role==="assistant"?A:p?"12px":"13px",lineHeight:j.role==="assistant"?1.62:1.4},children:[j.role==="assistant"?j.content.trim()?m.jsx(ul,{content:j.content,theme:{...q,textColor:Et},fontSize:A}):Qe&&j.id===Tt.current?ro({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Et},children:j.content}),j.role==="assistant"&&wl(j),j.role==="assistant"&&ti(j,p),j.role==="assistant"&&An(j),j.role==="assistant"&&J&&kn.has(j.id)&&j.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Wa,{messageId:j.id,query:j.userQuery,initialRecommendation:j.initialRecommendation,onFollowupDetected:Gt,onRecommendationsShown:(pe,et)=>{pr(pe,et,j.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})}),j.role==="assistant"&&J&&!kn.has(j.id)&&(j.initialRecommendation||jt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Wa,{messageId:j.id,query:j.userQuery,initialRecommendation:j.initialRecommendation||void 0,onFollowupDetected:Gt,onRecommendationsShown:(pe,et)=>{pr(pe,et,j.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})})]})})})()},j.id)}),Xr&&m.jsx("div",{role:"alert",style:{color:Et,fontSize:qe.sm,border:`1px solid ${Yt}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),m.jsx("div",{ref:oa})]})}if(f==="default"){let p=function(D){const J=rc(Fo);return rl.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:j}),m.jsx("div",{style:J.shell,children:D})]}),document.body)},A=function(D=!1){const J=un(D),pe=D||J&&me,et=!pe&&V==="input",Ct=J&&!pe&&Ka,Rt=pe&&!(Fe&&E==="expand"&&!D&&Yr),De=pe?rc(Fo):null,We=!!(De&&Fo&&!J),wt=J?_n:De?De.panelWidth:b==="inline"?"100%":"min(420px, calc(100vw - 32px))",Dt=J?Jn:De?De.panelHeight:"auto",_t=J?_n:De?.panelMaxWidth??"100%",tn=J?Jn:De?.panelMaxHeight,nr=R&&!Ct&&pe;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":J?"true":"false",style:{"--publisher-accent":yn,color:Et,width:wt,maxWidth:_t,height:Dt,maxHeight:tn,boxSizing:"border-box",display:"flex",flexDirection:"column",background:pe?Pr:Tr,borderRadius:!J&&De?De.panelBorderRadius:"12px",padding:pe?0:J?"6px":0,boxShadow:We?"none":pe?qi:"none",border:We||et?"none":`1px solid ${Qi}`,overflow:"hidden",minHeight:J?0:void 0},children:[m.jsx("style",{children:Od}),nr&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:J?"8px 10px":"14px 20px",background:io,color:Et,borderBottom:`1px solid ${br}`,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:lt(Et,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:yn,overflow:"hidden"},children:P?m.jsx("img",{src:P,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:Jt,padding:4}}):m.jsx(ol,{size:J?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(K||_)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[K&&m.jsx("div",{style:{fontSize:J?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:v}),_&&m.jsx("div",{style:{fontSize:J?"10px":"12px",color:Za,marginTop:"2px"},children:da})]})]}),pe&&(!J||D)&&m.jsx("button",{type:"button",onClick:()=>hn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"8px",border:`1px solid ${br}`,background:Jt,color:Za,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(Rd,{size:16,strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:Ct?"2px":J?"6px":"16px",minHeight:0,flex:J||pe?"1 1 0":void 0,overflow:J||pe?"hidden":void 0,overscrollBehavior:"contain",padding:et?J?"4px":"8px":J?"8px":"20px",justifyContent:pe?void 0:"center",background:Pr},children:[Gi("default"),Rt&&kl(J),!et&&m.jsxs(m.Fragment,{children:[J&&!pe&&!Ct&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),J&&!pe&&be&&I&&at.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:Oe}),vl(J)]}),(et||!J||pe||M)&&m.jsx(th,{value:wn,onChange:qr,open:et&&Ht&&!me,onOpenChange:et?At:Fh,suggestions:Zt.slice(0,Te),registerSuggestion:Sr,loading:Qe,analyzing:gr,compact:J,expanded:pe,showLogo:!pe,suggestionPlacement:se,logoUrl:P,title:v,placeholder:oe,colors:{accent:yn,accentText:hr,surface:Xi,text:Et,muted:fr,border:Yt},onStop:mr,onSend:()=>{gn.current=null,Zn.current=!1,hn(!0),b==="floating"&&er(!0),Er(wn)},onSuggestion:jn=>{hn(!0),b==="floating"&&er(!0),Cr(jn)}}),pe&&Ya("default",J),!pe&&V==="always"&&xl(J)]})]})};const j={position:"fixed",inset:0,background:yl,backdropFilter:"blur(2px)",zIndex:2147483e3};return b==="inline"?Fe?m.jsxs("div",{ref:Wi,className:"admesh-component","data-admesh-theme":Ye,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":E,"data-admesh-ad-slot-expanded":Ha?"true":"false",style:{width:_n,height:Jn,maxWidth:_n,maxHeight:Jn,position:"relative",overflow:"hidden"},children:[A(!1),Yr&&typeof document<"u"&&p(A(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ye,style:{width:"100%",position:"relative"},children:[A(!1),me&&typeof document<"u"&&p(A(!0))]}):No?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ye,children:[!me&&m.jsx("div",{style:{position:"fixed",...no,zIndex:2147483001},children:A(!1)}),me&&typeof document<"u"&&p(A(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ye,children:m.jsxs("button",{type:"button",onClick:la,style:{position:"fixed",...no,zIndex:2147483e3,border:"none",borderRadius:"6px",background:q.primaryColor,color:hr,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(ol,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),c]})})}return Zt.length===0&&!gr?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):b==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ye,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Ba(H)??"100%",backgroundColor:"#eef2ff",fontSize:qe.base,...d},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[gr?ei("legacy"):Zt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Zt.slice(0,Te).map((p,A)=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>Cr(p),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:A===0?"100%":A===1?"82%":"68%",backgroundColor:q.surfaceColor||"#ffffff",color:q.textColor||"#1e293b",border:`1px solid ${q.borderColor||"#e2e8f0"}`,fontSize:qe.sm},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:q.backgroundColor||"#ffffff",color:q.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},p.id))}),at.length>0&&m.jsxs("div",{ref:In,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:q.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[at.map(p=>{const A=p.role==="user"&&p.id===Wt.current;return m.jsx("div",{ref:A?St:void 0,className:p.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:p.role==="user"?q.primaryColor:"#ffffff",color:p.role==="user"?q.primaryTextColor||"#ffffff":q.textColor,fontSize:qe.sm},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(ul,{content:p.content,theme:q,fontSize:qe.sm}),An(p,{accentColor:q.primaryColor,metaColor:q.textSecondaryColor})]}):Qe&&p.id===Tt.current?ro({compact:!0,accentColor:q.primaryColor,metaColor:q.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:p.content})})},p.id)}),Qe&&!at.some(p=>p.role==="assistant"&&p.id===Tt.current&&!p.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:q.textSecondaryColor},children:ro({compact:!0,accentColor:q.primaryColor,metaColor:q.textSecondaryColor,includeSteps:!1})}),Xr&&m.jsx("div",{className:"text-sm",style:{color:q.textSecondaryColor},children:"Connection issue. Please try again."}),m.jsx("div",{ref:oa})]}),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:wn,onChange:p=>qr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(Qe){p.preventDefault();return}Er(wn)}},placeholder:oe,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:q.backgroundColor||"#ffffff",color:q.textColor,fontSize:qe.sm}}),m.jsx("button",{onClick:()=>{if(Qe){mr();return}Er(wn)},disabled:!Qe&&!wn.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:Qe?"#dc2626":q.primaryColor,color:"#ffffff"},children:Qe?m.jsx(al,{size:18}):m.jsx(Dd,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:q.textSecondaryColor,fontSize:qe.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:q.textSecondaryColor,fontSize:qe.xs,lineHeight:1.5},children:Xa})]})]})})}):No?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ye,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...me?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...no,width:Ba(H)??zr.width,height:Ba(ee)??zr.height},backgroundColor:me?Pr:q.backgroundColor,zIndex:9999,fontSize:qe.base,borderRadius:me?"20px":"16px",border:me?`1px solid ${Qi}`:"1px solid transparent",boxShadow:me?qi:"0 20px 40px rgba(15, 23, 42, 0.12)",...d},children:[R&&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:me?br:"transparent",background:me?io:q.backgroundColor,padding:me?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:me?40:32,height:me?40:32,borderRadius:me?"14px":"10px",background:lt(Nt,.08),color:yn,display:"flex",alignItems:"center",justifyContent:"center",fontSize:me?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:P?m.jsx("img",{src:P,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(v||"AA").slice(0,2).toUpperCase()}),(K||_&&me)&&m.jsxs("div",{children:[K&&m.jsx("div",{className:"font-medium",style:{color:q.textColor,fontSize:me?"20px":qe.base,fontWeight:700,letterSpacing:me?"-0.02em":0},children:v}),_&&me&&m.jsx("div",{style:{color:Za,fontSize:"12px",marginTop:"2px"},children:da})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Ui,className:"transition-colors",title:me?"Minimize":"Expand",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?br:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:me?m.jsx(Rd,{size:16,style:{color:q.textSecondaryColor}}):m.jsx(Yf,{size:16,style:{color:q.textSecondaryColor}})}),m.jsx("button",{onClick:eo,className:"transition-colors",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?br:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(al,{size:16,style:{color:q.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:In,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:me?"20px":"16px"},children:[Gi("legacy"),be&&at.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:q.textColor,margin:0,fontSize:qe.sm},children:Oe})})}),at.map(p=>{const A=p.role==="user"&&p.id===Wt.current;return m.jsxs("div",{ref:A?St:void 0,className:"mb-3",children:[m.jsx("div",{className:p.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:p.role==="user"?gl:"transparent",color:p.role==="user"?q.primaryTextColor||"#ffffff":q.textColor,border:"none",borderRadius:p.role==="user"?me?"14px":"12px":0,padding:p.role==="user"?me?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${qe.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(ul,{content:p.content,theme:q,fontSize:`calc(${qe.sm} * 1.3)`})}),An(p,{accentColor:q.primaryColor,metaColor:q.textSecondaryColor})]}):Qe&&p.id===Tt.current?ro({compact:!0,accentColor:q.primaryColor,metaColor:q.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:qe.sm,lineHeight:"1.4"},children:p.content})}),p.role==="assistant"&&!kn.has(p.id)&&m.jsx(Wa,{messageId:p.id,query:p.userQuery,onFollowupDetected:Gt,onRecommendationsShown:(j,D)=>{pr(j,D,p.userQuery)},onError:j=>{console.error("[AdMeshIntentAssistant] Recommendations error:",j)}}),p.role==="assistant"&&kn.has(p.id)&&p.initialRecommendation&&!Qe&&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(Wa,{messageId:p.id,query:p.userQuery,initialRecommendation:p.initialRecommendation,onFollowupDetected:Gt,onRecommendationsShown:(j,D)=>{pr(j,D,p.userQuery)},onError:j=>{console.error("[AdMeshIntentAssistant] Recommendations error:",j)}})]})]},p.id)}),Qe&&!at.some(p=>p.role==="assistant"&&p.id===Tt.current&&!p.content.trim())&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",style:{backgroundColor:"transparent"},children:ro({compact:!0,accentColor:q.primaryColor,metaColor:q.textSecondaryColor,includeSteps:!1})})}),Xr&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:q.textSecondaryColor},children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{style:{fontSize:qe.xs},children:"\u26A0\uFE0F"}),m.jsx("span",{style:{fontSize:qe.sm},children:"Connection issue. Please try again."})]})})}),m.jsx("div",{ref:oa})]}),at.length===0&&gr&&m.jsx("div",{className:"px-4 pb-2",children:ei("legacy")}),Zt.length>0&&at.length===0&&!gr&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:Zt.slice(0,Te).map(p=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>Cr(p),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:q.surfaceColor||"#f8fafc",color:q.textColor||"#1e293b",border:`1px solid ${q.borderColor||"#e2e8f0"}`,fontSize:qe.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.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:q.backgroundColor||"#ffffff",color:q.textSecondaryColor||"#64748b"},children:"Ad"})]},p.id))})}),Ae&&!Ie&&to.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:q.surfaceColor,borderColor:q.borderColor,color:q.textSecondaryColor},children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{style:{fontSize:qe.sm},children:"Intent analysis failed"}),m.jsx("button",{onClick:Z,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:q.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:qe.xs},children:Ae})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:me?br:"transparent",padding:me?"18px 20px":void 0,background:me?io:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${br}`,borderRadius:me?"16px":"12px",background:Xi,boxShadow:me?bl:"none",padding:me?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:wn,onChange:p=>qr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(Qe){p.preventDefault();return}Er(wn)}},placeholder:oe,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:q.textColor,fontSize:me?"15px":qe.sm,"--tw-ring-color":q.primaryColor}}),m.jsx("button",{onClick:()=>{if(Qe){mr();return}Er(wn)},disabled:!Qe&&!wn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:Qe?"#dc2626":q.primaryColor,color:"#ffffff",borderRadius:me?"12px":"10px",width:me?"46px":void 0,height:me?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:me?`0 10px 20px ${lt(Nt,.18)}`:"none"},children:Qe?m.jsx(al,{size:14}):m.jsx(Dd,{size:14})})]}),Ya("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ye,children:m.jsx("button",{onClick:la,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",...no,backgroundColor:q.primaryColor,color:"#ffffff",zIndex:9999,fontSize:qe.base,...d},children:m.jsx("span",{className:"font-medium",children:c})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const cl={"mobile-leaderboard":{width:320,height:100},"medium-rectangle":{width:300,height:250},leaderboard:{width:728,height:90},"half-page":{width:300,height:600},"large-rectangle":{width:336,height:280},skyscraper:{width:120,height:600},billboard:{width:970,height:250}},Gh={"mobile-leaderboard":"carousel","medium-rectangle":"carousel",leaderboard:"carousel","large-rectangle":"carousel",billboard:"carousel","half-page":"stacked",skyscraper:"stacked"},Zh={"mobile-leaderboard":!1,"medium-rectangle":!1,leaderboard:!1},Jh={"mobile-leaderboard":!1,leaderboard:!1},Yh={"mobile-leaderboard":!1,leaderboard:!1},eg={"mobile-leaderboard":!1,leaderboard:!1},sc={"mobile-leaderboard":"expand",leaderboard:"expand"},pl={"half-page":"medium-rectangle","large-rectangle":"medium-rectangle",skyscraper:"medium-rectangle",billboard:"medium-rectangle",leaderboard:"mobile-leaderboard"},tg=60*1e3,lc="admesh-publisher-assistant-embed-styles",uc=window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com";function ng(){if(document.getElementById(lc))return;const i=document.createElement("style");i.id=lc,i.textContent=`
|
|
1216
1226
|
.admesh-publisher-assistant-root {
|
|
1217
1227
|
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
1218
1228
|
line-height: 1.4;
|
|
@@ -1978,5 +1988,5 @@ ${te}`),A=A.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
|
|
|
1978
1988
|
font-size: 12px;
|
|
1979
1989
|
}
|
|
1980
1990
|
}
|
|
1981
|
-
`,document.head.appendChild(s)}function Yh(s){return s?s.startsWith("/")?s:`/${s}`:"/"}function sc(s,l){const d=Yh(l.trim());if(d==="/")return s==="/";if(d.endsWith("/*")){const c=d.slice(0,-1);return s.startsWith(c)}return s===d}function eg(s,l){return l.page_rules_enabled?l.hide_on_paths.some(d=>sc(s,d))?!1:l.show_on_paths.length?l.show_on_paths.some(d=>sc(s,d)):!0:!0}function lc(){var s,l;if(typeof window>"u")return Number.POSITIVE_INFINITY;const d=[];typeof((s=window.visualViewport)==null?void 0:s.width)=="number"&&window.visualViewport.width>0&&d.push(window.visualViewport.width),(l=document.documentElement)!=null&&l.clientWidth&&document.documentElement.clientWidth>0&&d.push(document.documentElement.clientWidth),window.innerWidth>0&&d.push(window.innerWidth);try{window.parent&&window.parent!==window&&window.parent.innerWidth>0&&d.push(window.parent.innerWidth)}catch{}return d.length?Math.min(...d):window.innerWidth}function dl(){return lc()<768}function tg(s){if(!ul[s])return!1;const l=ll[s].width,d=lc();return d<l||d<768?!0:typeof window.matchMedia=="function"?window.matchMedia("(max-width: 767px)").matches:!1}function Qa(s){if(s)return tg(s)?ul[s]??s:s}function ng(s){const l=s.device_targeting||"all";if(l==="all")return!0;const d=dl();return l==="mobile_only"?d:l==="desktop_only"?!d:!0}async function rg(s,l){const d=await fetch(s,l);if(!d.ok)throw new Error(`Request failed: ${d.status}`);return d.json()}function og(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript.dataset.admeshProcessed="true",document.currentScript;const s=Array.from(document.querySelectorAll("script")).reverse().find(l=>l.src.includes("publisher-assistant.js")&&l.dataset.admeshProcessed!=="true");return s?(s.dataset.admeshProcessed="true",s):null}function ag(s){var l,d;const c=(l=s.dataset.agentDisplayId)==null?void 0:l.trim();if(c)return c;const v=(d=s.dataset.publisherId)==null?void 0:d.trim();if(v)return v}function uc(s){const l=s?.trim();if(!l)return;const d=Number(l.replace(/px$/i,""));if(!(!Number.isFinite(d)||d<=0))return Math.round(d)}function Fi(s){const l=s?.trim().toLowerCase();if(l){if(["1","true","yes","on"].includes(l))return!0;if(["0","false","no","off"].includes(l))return!1}}function ig(s){var l,d,c,v,I;const D=s.dataset.mode==="inline"||s.dataset.mode==="floating"?s.dataset.mode:void 0,q=s.dataset.size==="sm"||s.dataset.size==="md"||s.dataset.size==="lg"||s.dataset.size==="xl"?s.dataset.size:void 0,_=s.dataset.position==="bottom-left"||s.dataset.position==="top-right"||s.dataset.position==="top-left"||s.dataset.position==="bottom-right"?s.dataset.position:void 0,y=s.dataset.surface==="ad-slot"||s.dataset.surface==="page"?s.dataset.surface:s.dataset.adSlot==="true"||s.dataset.adServer==="true"?"ad-slot":void 0,B=(l=s.dataset.contextMode)==null?void 0:l.trim(),C=B==="page"||B==="ad-slot"||B==="auto"?B:void 0,W=s.dataset.suggestionStyle==="stacked"||s.dataset.suggestionStyle==="carousel"?s.dataset.suggestionStyle:void 0,M=s.dataset.behavior==="expand"||s.dataset.behavior==="sticky"?s.dataset.behavior:void 0,A=(d=s.dataset.slotType)==null?void 0:d.trim(),H=A&&A in ll?A:void 0;return{mode:D,position:_,size:q,surface:y??(H?"ad-slot":void 0),slotType:H,width:uc(s.dataset.width),height:uc(s.dataset.height),suggestionStyle:W,suggestionTrigger:s.dataset.suggestionTrigger==="input"?"input":"always",suggestionPlacement:s.dataset.suggestionPlacement==="above"?"above":"below",sponsoredCreativePlacement:s.dataset.sponsoredCreativePlacement==="below-input-container"?"below-input-container":"none",showHeader:Fi(s.dataset.showHeader),showAssistantName:Fi(s.dataset.showAssistantName),showAssistantLabel:Fi(s.dataset.showAssistantLabel),showWelcomeMessage:Fi(s.dataset.showWelcomeMessage),welcomeMessage:((c=s.dataset.welcomeMessage)==null?void 0:c.trim())||void 0,targetSelector:((v=s.dataset.targetSelector)==null?void 0:v.trim())||void 0,articleUrl:((I=s.dataset.articleUrl)==null?void 0:I.trim())||void 0,contextMode:C,behavior:M}}function cl(){try{return window.self!==window.top}catch{return!0}}function pl(s){return`admesh:publisher-assistant:country-block:${encodeURIComponent(s)}`}function sg(s){try{const l=window.localStorage.getItem(pl(s));if(!l)return null;const d=JSON.parse(l);return typeof d.expiresAt!="number"||d.expiresAt<=Date.now()?(window.localStorage.removeItem(pl(s)),null):{expiresAt:d.expiresAt,reason:typeof d.reason=="string"?d.reason:"country_not_allowed",country:typeof d.country=="string"?d.country:null}}catch{return null}}function lg(s,l){if(l.reason==="country_not_allowed")try{const d={expiresAt:Date.now()+Zh,reason:"country_not_allowed",country:l.country||null};window.localStorage.setItem(pl(s),JSON.stringify(d))}catch{}}function ug(s,l){const d=Qa(l?.slotType);if(d){const _=ll[d];return{width:_.width,height:_.height}}const c=s instanceof HTMLElement?s.getBoundingClientRect():null,v=cl()?window.innerWidth:void 0,I=cl()?window.innerHeight:void 0,D=l?.width||v||(c!=null&&c.width?Math.round(c.width):void 0),q=l?.height||I||(c!=null&&c.height?Math.round(c.height):void 0);return{width:D&&D>0?D:void 0,height:q&&q>0?q:void 0}}function dg(s){return{width:s!=null&&s.width&&s.width>0?s.width:void 0,height:s!=null&&s.height&&s.height>0?s.height:void 0}}function cg(s,l){if(s.suggestionStyle)return s.suggestionStyle;const d=Qa(s.slotType);return d?Qh[d]??"carousel":l.suggestion_style||"carousel"}function pg(s,l){return s&&oc[s]?oc[s]:l||"expand"}function mg(s){try{const l=new URL(s).pathname.split("/").filter(Boolean),d=l[l.length-1]||"publisher-assistant";return`session_${Date.now()}_${d.replace(/[^a-zA-Z0-9_-]/g,"-")}`}catch{return`session_${Date.now()}_publisher-assistant`}}function dc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function fg(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(dc(l))return l}catch{return}}function hg(s,l){const d=fg();if(d)return d;const c=l?.trim();if(dc(c))return c;if(s!=="ad-slot")return window.location.href}function gg(s){return{mode:"light",primaryColor:s.send_button_background_color,secondaryColor:s.meta_text_color,backgroundColor:s.input_background_color,surfaceColor:"#ffffff",borderColor:"rgba(17, 24, 39, 0.08)",textColor:s.input_text_color,textSecondaryColor:s.meta_text_color,primaryTextColor:s.send_button_text_color,borderRadius:"24px",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px rgba(15, 23, 42, 0.06)",medium:"0 8px 22px rgba(15, 23, 42, 0.08)",large:"0 24px 60px rgba(15, 23, 42, 0.16)"}}}function bg({config:s,runtimeApiKey:l,sessionId:d,mode:c,floatingPosition:v,size:I,surface:D,panelWidth:q,panelHeight:_,suggestionStyle:y,suggestionTrigger:B,suggestionPlacement:C,sponsoredCreativePlacement:W,showHeader:M,showAssistantName:A,showAssistantLabel:H,showWelcomeMessage:U,welcomeMessage:ee,articleUrl:te,contextMode:re,agentDisplayId:ne,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le}){const ge=re||(D==="ad-slot"?"ad-slot":"auto");return gd.createElement(Qd,{apiKey:l,sessionId:d,apiBaseUrl:ic,theme:gg(s),articleUrl:te,contextMode:ge,agentDisplayId:ne},gd.createElement(Uh,{variant:"default",layout:c,surface:D,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le,position:v,size:I,panelWidth:q,panelHeight:_,analyticsPageUrl:hg(D,te),suggestionStyle:y??"carousel",suggestionTrigger:B??"always",suggestionPlacement:C??"below",sponsoredCreativePlacement:W??"none",headerTitle:s.assistant_name,headerLogoUrl:s.logo_url,showHeader:M??!0,showHeaderTitle:A??s.show_assistant_name!==!1,showSubtitle:H??s.show_assistant_label!==!1,triggerLabel:s.assistant_name,placeholder:s.input_placeholder,disclaimerText:s.disclaimer_text,poweredByLabel:"Powered by AdMesh",subtitle:H??s.show_assistant_label!==!1?"Publisher Assistant":"",adsEnabled:s.ads_enabled,showWelcomeMessage:U===!0,welcomeMessage:ee||s.welcome_description}))}function yg(s,l,d){d.width&&(s.style.width=`${d.width}px`,s.style.maxWidth=dl()?"100%":""),d.height&&(s.style.height=`${d.height}px`),l&&(d.width&&(l.style.width=`${d.width}px`,l.style.maxWidth=dl()?"100%":""),d.height&&(l.style.height=`${d.height}px`),l.style.boxSizing="border-box")}function cc(s){const l=s.overrides.slotType,d=Qa(l),c=s.mode==="inline"&&s.targetSelector?document.querySelector(s.targetSelector):null;let v=dg(s.overrides);s.surface==="ad-slot"&&(v=ug(c,s.overrides)),s.mountNode.dataset.admeshRawSlotType=l??"",s.mountNode.dataset.admeshEffectiveSlotType=d??"",yg(s.mountNode,c instanceof HTMLElement?c:null,v),s.reactRoot.render(bg({config:s.config,runtimeApiKey:s.runtimeApiKey,sessionId:s.sessionId,mode:s.mode,floatingPosition:s.floatingPosition,size:s.size,surface:s.surface,panelWidth:v.width,panelHeight:v.height,suggestionStyle:cg(s.overrides,s.config),suggestionTrigger:s.overrides.suggestionTrigger,suggestionPlacement:s.overrides.suggestionPlacement,sponsoredCreativePlacement:s.overrides.sponsoredCreativePlacement,showHeader:s.overrides.showHeader,showAssistantName:s.overrides.showAssistantName,showAssistantLabel:s.overrides.showAssistantLabel,showWelcomeMessage:s.overrides.showWelcomeMessage,welcomeMessage:s.overrides.welcomeMessage,articleUrl:s.articleUrl,contextMode:s.contextMode,agentDisplayId:s.agentDisplayId,adSlotBehavior:s.surface==="ad-slot"?pg(l,s.overrides.behavior):void 0,showCompactSlotHeader:d?qh[d]??!0:!0,showCompactWelcomeMessage:d?Kh[d]??!0:!0,showCompactSlotInput:d?Xh[d]??!0:!0,showCompactSlotDisclaimer:d?Gh[d]??!0:!0}))}function vg(s){var l,d;const c=s.overrides.slotType;if(!c||!ul[c])return;let v=Qa(c);const I=()=>{const D=Qa(c);D!==v&&(v=D,cc(s))};window.addEventListener("resize",I),(l=window.visualViewport)==null||l.addEventListener("resize",I),(d=window.visualViewport)==null||d.addEventListener("scroll",I)}async function xg(){var s,l;const d=og();if(!d){console.error("[AdMesh] Publisher assistant embed script could not find its script tag.");return}const c=ag(d);if(!c){console.error("[AdMesh] Missing required data-agent-display-id or data-publisher-id attribute.");return}const v=ig(d);try{const I=sg(c);if(I){console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${I.reason}`);return}const D=await rg(`${ic}/publisher-assistant/public/${encodeURIComponent(c)}/config`),q=D.config;if(D.ready===!1)if(D.reason==="missing_inline_target_selector"&&v.targetSelector)console.warn(`[AdMesh] Publisher assistant config is missing an inline target selector; using script override ${v.targetSelector}.`);else{console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${D.reason||"unknown_reason"}`),lg(c,D);return}const _=v.mode||q.deployment_mode||"inline",y=v.position||q.floating_position,B=v.surface||(_==="inline"&&cl()?"ad-slot":"page"),C=v.contextMode||(B==="ad-slot"?"ad-slot":"auto"),W=v.articleUrl,M=v.targetSelector||((s=q.inline_target_selector)==null?void 0:s.trim()),A=((l=D.runtime_api_key)==null?void 0:l.trim())||"";if(!eg(window.location.pathname,q)||!ng(q))return;if(!A){console.warn(`[AdMesh] No active publisher runtime API key found for ${c}.`);return}const H=_==="inline"&&M?document.querySelector(M):null;if(_==="inline"&&M&&!H){console.error(`[AdMesh] Inline target not found for selector: ${M}`);return}Jh();const U=mg(window.location.href),ee=v.size||"md",te=document.createElement("div");te.className="admesh-publisher-assistant-reactMount",te.dataset.admeshSurface=B;const re=Ed.createRoot(te),ne={script:d,mountNode:te,reactRoot:re,overrides:v,config:q,runtimeApiKey:A,sessionId:U,mode:_,floatingPosition:y,surface:B,contextMode:C,articleUrl:W,agentDisplayId:c,size:ee,targetSelector:M};if(cc(ne),vg(ne),_==="inline"){if(M){H?.appendChild(te);return}d.insertAdjacentElement("afterend",te);return}document.body.appendChild(te)}catch(I){console.error("[AdMesh] Failed to initialize publisher assistant.",I)}}xg()})();})();
|
|
1991
|
+
`,document.head.appendChild(i)}function rg(i){return i?i.startsWith("/")?i:`/${i}`:"/"}function dc(i,l){const d=rg(l.trim());if(d==="/")return i==="/";if(d.endsWith("/*")){const c=d.slice(0,-1);return i.startsWith(c)}return i===d}function og(i,l){return l.page_rules_enabled?l.hide_on_paths.some(d=>dc(i,d))?!1:l.show_on_paths.length?l.show_on_paths.some(d=>dc(i,d)):!0:!0}function cc(){var i,l;if(typeof window>"u")return Number.POSITIVE_INFINITY;const d=[];typeof((i=window.visualViewport)==null?void 0:i.width)=="number"&&window.visualViewport.width>0&&d.push(window.visualViewport.width),(l=document.documentElement)!=null&&l.clientWidth&&document.documentElement.clientWidth>0&&d.push(document.documentElement.clientWidth),window.innerWidth>0&&d.push(window.innerWidth);try{window.parent&&window.parent!==window&&window.parent.innerWidth>0&&d.push(window.parent.innerWidth)}catch{}return d.length?Math.min(...d):window.innerWidth}function ml(){return cc()<768}function ag(i){if(!pl[i])return!1;const l=cl[i].width,d=cc();return d<l||d<768?!0:typeof window.matchMedia=="function"?window.matchMedia("(max-width: 767px)").matches:!1}function Ua(i){if(i)return ag(i)?pl[i]??i:i}function ig(i){const l=i.device_targeting||"all";if(l==="all")return!0;const d=ml();return l==="mobile_only"?d:l==="desktop_only"?!d:!0}async function sg(i,l){const d=await fetch(i,l);if(!d.ok)throw new Error(`Request failed: ${d.status}`);return d.json()}function lg(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript.dataset.admeshProcessed="true",document.currentScript;const i=Array.from(document.querySelectorAll("script")).reverse().find(l=>l.src.includes("publisher-assistant.js")&&l.dataset.admeshProcessed!=="true");return i?(i.dataset.admeshProcessed="true",i):null}function ug(i){var l,d;const c=(l=i.dataset.agentDisplayId)==null?void 0:l.trim();if(c)return c;const v=(d=i.dataset.publisherId)==null?void 0:d.trim();if(v)return v}function pc(i){const l=i?.trim();if(!l)return;const d=Number(l.replace(/px$/i,""));if(!(!Number.isFinite(d)||d<=0))return Math.round(d)}function Oi(i){const l=i?.trim().toLowerCase();if(l){if(["1","true","yes","on"].includes(l))return!0;if(["0","false","no","off"].includes(l))return!1}}function dg(i){var l,d,c,v,P;const R=i.dataset.mode==="inline"||i.dataset.mode==="floating"?i.dataset.mode:void 0,K=i.dataset.size==="sm"||i.dataset.size==="md"||i.dataset.size==="lg"||i.dataset.size==="xl"?i.dataset.size:void 0,_=i.dataset.position==="bottom-left"||i.dataset.position==="top-right"||i.dataset.position==="top-left"||i.dataset.position==="bottom-right"?i.dataset.position:void 0,b=i.dataset.surface==="ad-slot"||i.dataset.surface==="page"?i.dataset.surface:i.dataset.adSlot==="true"||i.dataset.adServer==="true"?"ad-slot":void 0,U=(l=i.dataset.contextMode)==null?void 0:l.trim(),E=U==="page"||U==="ad-slot"||U==="auto"?U:void 0,W=i.dataset.suggestionStyle==="stacked"||i.dataset.suggestionStyle==="carousel"?i.dataset.suggestionStyle:void 0,I=i.dataset.behavior==="expand"||i.dataset.behavior==="sticky"?i.dataset.behavior:void 0,M=(d=i.dataset.slotType)==null?void 0:d.trim(),B=M&&M in cl?M:void 0;return{mode:R,position:_,size:K,surface:b??(B?"ad-slot":void 0),slotType:B,width:pc(i.dataset.width),height:pc(i.dataset.height),suggestionStyle:W,suggestionTrigger:i.dataset.suggestionTrigger==="input"?"input":"always",suggestionPlacement:i.dataset.suggestionPlacement==="above"?"above":"below",sponsoredCreativePlacement:i.dataset.sponsoredCreativePlacement==="none"?"none":"below-input-container",showHeader:Oi(i.dataset.showHeader),showAssistantName:Oi(i.dataset.showAssistantName),showAssistantLabel:Oi(i.dataset.showAssistantLabel),showWelcomeMessage:Oi(i.dataset.showWelcomeMessage),welcomeMessage:((c=i.dataset.welcomeMessage)==null?void 0:c.trim())||void 0,targetSelector:((v=i.dataset.targetSelector)==null?void 0:v.trim())||void 0,articleUrl:((P=i.dataset.articleUrl)==null?void 0:P.trim())||void 0,contextMode:E,behavior:I}}function fl(){try{return window.self!==window.top}catch{return!0}}function hl(i){return`admesh:publisher-assistant:country-block:${encodeURIComponent(i)}`}function cg(i){try{const l=window.localStorage.getItem(hl(i));if(!l)return null;const d=JSON.parse(l);return typeof d.expiresAt!="number"||d.expiresAt<=Date.now()?(window.localStorage.removeItem(hl(i)),null):{expiresAt:d.expiresAt,reason:typeof d.reason=="string"?d.reason:"country_not_allowed",country:typeof d.country=="string"?d.country:null}}catch{return null}}function pg(i,l){if(l.reason==="country_not_allowed")try{const d={expiresAt:Date.now()+tg,reason:"country_not_allowed",country:l.country||null};window.localStorage.setItem(hl(i),JSON.stringify(d))}catch{}}function mg(i,l){const d=Ua(l?.slotType);if(d){const _=cl[d];return{width:_.width,height:_.height}}const c=i instanceof HTMLElement?i.getBoundingClientRect():null,v=fl()?window.innerWidth:void 0,P=fl()?window.innerHeight:void 0,R=l?.width||v||(c!=null&&c.width?Math.round(c.width):void 0),K=l?.height||P||(c!=null&&c.height?Math.round(c.height):void 0);return{width:R&&R>0?R:void 0,height:K&&K>0?K:void 0}}function fg(i){return{width:i!=null&&i.width&&i.width>0?i.width:void 0,height:i!=null&&i.height&&i.height>0?i.height:void 0}}function hg(i,l){if(i.suggestionStyle)return i.suggestionStyle;const d=Ua(i.slotType);return d?Gh[d]??"carousel":l.suggestion_style||"carousel"}function gg(i,l){return i&&sc[i]?sc[i]:l||"expand"}function bg(i){try{const l=new URL(i).pathname.split("/").filter(Boolean),d=l[l.length-1]||"publisher-assistant";return`session_${Date.now()}_${d.replace(/[^a-zA-Z0-9_-]/g,"-")}`}catch{return`session_${Date.now()}_publisher-assistant`}}function mc(i){const l=i?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function yg(){var i;try{const l=(i=window.location.href)==null?void 0:i.trim();if(mc(l))return l}catch{return}}function vg(i,l){const d=yg();if(d)return d;const c=l?.trim();if(mc(c))return c;if(i!=="ad-slot")return window.location.href}function xg(i){return{mode:"light",primaryColor:i.send_button_background_color,secondaryColor:i.meta_text_color,backgroundColor:i.input_background_color,surfaceColor:"#ffffff",borderColor:"rgba(17, 24, 39, 0.08)",textColor:i.input_text_color,textSecondaryColor:i.meta_text_color,primaryTextColor:i.send_button_text_color,borderRadius:"24px",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px rgba(15, 23, 42, 0.06)",medium:"0 8px 22px rgba(15, 23, 42, 0.08)",large:"0 24px 60px rgba(15, 23, 42, 0.16)"}}}function wg({config:i,runtimeApiKey:l,sessionId:d,mode:c,floatingPosition:v,size:P,surface:R,panelWidth:K,panelHeight:_,suggestionStyle:b,suggestionTrigger:U,suggestionPlacement:E,sponsoredCreativePlacement:W,showHeader:I,showAssistantName:M,showAssistantLabel:B,showWelcomeMessage:H,welcomeMessage:ee,articleUrl:te,contextMode:re,agentDisplayId:ne,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:$,showCompactSlotInput:fe,showCompactSlotDisclaimer:le}){const be=re||(R==="ad-slot"?"ad-slot":"auto");return vd.createElement(Xd,{apiKey:l,sessionId:d,apiBaseUrl:uc,theme:xg(i),articleUrl:te,contextMode:be,agentDisplayId:ne},vd.createElement(Xh,{variant:"default",layout:c,surface:R,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:$,showCompactSlotInput:fe,showCompactSlotDisclaimer:le,position:v,size:P,panelWidth:K,panelHeight:_,analyticsPageUrl:vg(R,te),suggestionStyle:b??"carousel",suggestionTrigger:U??"always",suggestionPlacement:E??"below",sponsoredCreativePlacement:W??"below-input-container",headerTitle:i.assistant_name,headerLogoUrl:i.logo_url,showHeader:I??!0,showHeaderTitle:M??i.show_assistant_name!==!1,showSubtitle:B??i.show_assistant_label!==!1,triggerLabel:i.assistant_name,placeholder:i.input_placeholder,disclaimerText:i.disclaimer_text,poweredByLabel:"Powered by AdMesh",subtitle:B??i.show_assistant_label!==!1?"Publisher Assistant":"",adsEnabled:i.ads_enabled,showWelcomeMessage:H===!0,welcomeMessage:ee||i.welcome_description}))}function kg(i,l,d){d.width&&(i.style.width=`${d.width}px`,i.style.maxWidth=ml()?"100%":""),d.height&&(i.style.height=`${d.height}px`),l&&(d.width&&(l.style.width=`${d.width}px`,l.style.maxWidth=ml()?"100%":""),d.height&&(l.style.height=`${d.height}px`),l.style.boxSizing="border-box")}function fc(i){const l=i.overrides.slotType,d=Ua(l),c=i.mode==="inline"&&i.targetSelector?document.querySelector(i.targetSelector):null;let v=fg(i.overrides);i.surface==="ad-slot"&&(v=mg(c,i.overrides)),i.mountNode.dataset.admeshRawSlotType=l??"",i.mountNode.dataset.admeshEffectiveSlotType=d??"",kg(i.mountNode,c instanceof HTMLElement?c:null,v),i.reactRoot.render(wg({config:i.config,runtimeApiKey:i.runtimeApiKey,sessionId:i.sessionId,mode:i.mode,floatingPosition:i.floatingPosition,size:i.size,surface:i.surface,panelWidth:v.width,panelHeight:v.height,suggestionStyle:hg(i.overrides,i.config),suggestionTrigger:i.overrides.suggestionTrigger,suggestionPlacement:i.overrides.suggestionPlacement,sponsoredCreativePlacement:i.overrides.sponsoredCreativePlacement,showHeader:i.overrides.showHeader,showAssistantName:i.overrides.showAssistantName,showAssistantLabel:i.overrides.showAssistantLabel,showWelcomeMessage:i.overrides.showWelcomeMessage,welcomeMessage:i.overrides.welcomeMessage,articleUrl:i.articleUrl,contextMode:i.contextMode,agentDisplayId:i.agentDisplayId,adSlotBehavior:i.surface==="ad-slot"?gg(l,i.overrides.behavior):void 0,showCompactSlotHeader:d?Zh[d]??!0:!0,showCompactWelcomeMessage:d?Jh[d]??!0:!0,showCompactSlotInput:d?Yh[d]??!0:!0,showCompactSlotDisclaimer:d?eg[d]??!0:!0}))}function _g(i){var l,d;const c=i.overrides.slotType;if(!c||!pl[c])return;let v=Ua(c);const P=()=>{const R=Ua(c);R!==v&&(v=R,fc(i))};window.addEventListener("resize",P),(l=window.visualViewport)==null||l.addEventListener("resize",P),(d=window.visualViewport)==null||d.addEventListener("scroll",P)}async function Sg(){var i,l;const d=lg();if(!d){console.error("[AdMesh] Publisher assistant embed script could not find its script tag.");return}const c=ug(d);if(!c){console.error("[AdMesh] Missing required data-agent-display-id or data-publisher-id attribute.");return}const v=dg(d);try{const P=cg(c);if(P){console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${P.reason}`);return}const R=await sg(`${uc}/publisher-assistant/public/${encodeURIComponent(c)}/config`),K=R.config;if(R.ready===!1)if(R.reason==="missing_inline_target_selector"&&v.targetSelector)console.warn(`[AdMesh] Publisher assistant config is missing an inline target selector; using script override ${v.targetSelector}.`);else{console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${R.reason||"unknown_reason"}`),pg(c,R);return}const _=v.mode||K.deployment_mode||"inline",b=v.position||K.floating_position,U=v.surface||(_==="inline"&&fl()?"ad-slot":"page"),E=v.contextMode||(U==="ad-slot"?"ad-slot":"auto"),W=v.articleUrl,I=v.targetSelector||((i=K.inline_target_selector)==null?void 0:i.trim()),M=((l=R.runtime_api_key)==null?void 0:l.trim())||"";if(!og(window.location.pathname,K)||!ig(K))return;if(!M){console.warn(`[AdMesh] No active publisher runtime API key found for ${c}.`);return}const B=_==="inline"&&I?document.querySelector(I):null;if(_==="inline"&&I&&!B){console.error(`[AdMesh] Inline target not found for selector: ${I}`);return}ng();const H=bg(window.location.href),ee=v.size||"md",te=document.createElement("div");te.className="admesh-publisher-assistant-reactMount",te.dataset.admeshSurface=U;const re=Td.createRoot(te),ne={script:d,mountNode:te,reactRoot:re,overrides:v,config:K,runtimeApiKey:M,sessionId:H,mode:_,floatingPosition:b,surface:U,contextMode:E,articleUrl:W,agentDisplayId:c,size:ee,targetSelector:I};if(fc(ne),_g(ne),_==="inline"){if(I){B?.appendChild(te);return}d.insertAdjacentElement("afterend",te);return}document.body.appendChild(te)}catch(P){console.error("[AdMesh] Failed to initialize publisher assistant.",P)}}Sg()})();})();
|
|
1982
1992
|
//# sourceMappingURL=publisher-assistant.js.map
|