admesh-ui-sdk 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand-assistant.js +1216 -0
- package/dist/brand-assistant.js.map +1 -0
- package/dist/brandAssistantEmbed.d.ts +2 -0
- package/dist/brandAssistantEmbed.d.ts.map +1 -0
- package/dist/components/AdMeshIntentAssistant.d.ts +1 -0
- package/dist/components/AdMeshIntentAssistant.d.ts.map +1 -1
- package/dist/context/AdMeshProvider.d.ts +2 -0
- package/dist/context/AdMeshProvider.d.ts.map +1 -1
- package/dist/index.js +38 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2639 -2640
- package/dist/index.mjs.map +1 -1
- package/dist/publisher-assistant.js +53 -53
- package/dist/publisher-assistant.js.map +1 -1
- package/dist/sdk/AdMeshSDK.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var
|
|
1
|
+
(()=>{var K0=Object.defineProperty,X0=(Br,dr,zo)=>dr in Br?K0(Br,dr,{enumerable:!0,configurable:!0,writable:!0,value:zo}):Br[dr]=zo,Hr=(Br,dr,zo)=>X0(Br,typeof dr!="symbol"?dr+"":dr,zo);(function(){"use strict";var Br;function dr(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var zo={exports:{}},Ae={};/**
|
|
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 fd;function Nf(){if(fd)return Ae;fd=1;var s=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"),I=Symbol.for("react.consumer"),D=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),W=Symbol.iterator;function M(f){return f===null||typeof f!="object"?null:(f=W&&f[W]||f["@@iterator"],typeof f=="function"?f:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,U={};function ee(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}ee.prototype.isReactComponent={},ee.prototype.setState=function(f,P){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,P,"setState")},ee.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function te(){}te.prototype=ee.prototype;function re(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}var ne=re.prototype=new te;ne.constructor=re,H(ne,ee.prototype),ne.isPureReactComponent=!0;var ie=Array.isArray;function Q(){}var O={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function le(f,P,G){var Y=G.ref;return{$$typeof:s,type:f,key:P,ref:Y!==void 0?Y:null,props:G}}function ge(f,P){return le(f.type,P,f.props)}function $e(f){return typeof f=="object"&&f!==null&&f.$$typeof===s}function oe(f){var P={"=":"=0",":":"=2"};return"$"+f.replace(/[=:]/g,function(G){return P[G]})}var ue=/\/+/g;function xe(f,P){return typeof f=="object"&&f!==null&&f.key!=null?oe(""+f.key):P.toString(36)}function Pe(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(P){f.status==="pending"&&(f.status="fulfilled",f.value=P)},function(P){f.status==="pending"&&(f.status="rejected",f.reason=P)})),f.status){case"fulfilled":return f.value;case"rejected":throw f.reason}}throw f}function E(f,P,G,Y,_e){var ye=typeof f;(ye==="undefined"||ye==="boolean")&&(f=null);var ze=!1;if(f===null)ze=!0;else switch(ye){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(f.$$typeof){case s:case l:ze=!0;break;case B:return ze=f._init,E(ze(f._payload),P,G,Y,_e)}}if(ze)return _e=_e(f),ze=Y===""?"."+xe(f,0):Y,ie(_e)?(G="",ze!=null&&(G=ze.replace(ue,"$&/")+"/"),E(_e,P,G,"",function(De){return De})):_e!=null&&($e(_e)&&(_e=ge(_e,G+(_e.key==null||f&&f.key===_e.key?"":(""+_e.key).replace(ue,"$&/")+"/")+ze)),P.push(_e)),1;ze=0;var Le=Y===""?".":Y+":";if(ie(f))for(var Re=0;Re<f.length;Re++)Y=f[Re],ye=Le+xe(Y,Re),ze+=E(Y,P,G,ye,_e);else if(Re=M(f),typeof Re=="function")for(f=Re.call(f),Re=0;!(Y=f.next()).done;)Y=Y.value,ye=Le+xe(Y,Re++),ze+=E(Y,P,G,ye,_e);else if(ye==="object"){if(typeof f.then=="function")return E(Pe(f),P,G,Y,_e);throw P=String(f),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ze}function V(f,P,G){if(f==null)return f;var Y=[],_e=0;return E(f,Y,"","",function(ye){return P.call(G,ye,_e++)}),Y}function se(f){if(f._status===-1){var P=f._result;P=P(),P.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=P)}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 P=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(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},Ee={map:V,forEach:function(f,P,G){V(f,function(){P.apply(this,arguments)},G)},count:function(f){var P=0;return V(f,function(){P++}),P},toArray:function(f){return V(f,function(P){return P})||[]},only:function(f){if(!$e(f))throw Error("React.Children.only expected to receive a single React element child.");return f}};return Ae.Activity=C,Ae.Children=Ee,Ae.Component=ee,Ae.Fragment=d,Ae.Profiler=v,Ae.PureComponent=re,Ae.StrictMode=c,Ae.Suspense=_,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(f){return O.H.useMemoCache(f)}},Ae.cache=function(f){return function(){return f.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(f,P,G){if(f==null)throw Error("The argument must be a React element, but you passed "+f+".");var Y=H({},f.props),_e=f.key;if(P!=null)for(ye in P.key!==void 0&&(_e=""+P.key),P)!fe.call(P,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&P.ref===void 0||(Y[ye]=P[ye]);var ye=arguments.length-2;if(ye===1)Y.children=G;else if(1<ye){for(var ze=Array(ye),Le=0;Le<ye;Le++)ze[Le]=arguments[Le+2];Y.children=ze}return le(f.type,_e,Y)},Ae.createContext=function(f){return f={$$typeof:D,_currentValue:f,_currentValue2:f,_threadCount:0,Provider:null,Consumer:null},f.Provider=f,f.Consumer={$$typeof:I,_context:f},f},Ae.createElement=function(f,P,G){var Y,_e={},ye=null;if(P!=null)for(Y in P.key!==void 0&&(ye=""+P.key),P)fe.call(P,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=P[Y]);var ze=arguments.length-2;if(ze===1)_e.children=G;else if(1<ze){for(var Le=Array(ze),Re=0;Re<ze;Re++)Le[Re]=arguments[Re+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,ye,_e)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(f){return{$$typeof:q,render:f}},Ae.isValidElement=$e,Ae.lazy=function(f){return{$$typeof:B,_payload:{_status:-1,_result:f},_init:se}},Ae.memo=function(f,P){return{$$typeof:y,type:f,compare:P===void 0?null:P}},Ae.startTransition=function(f){var P=O.T,G={};O.T=G;try{var Y=f(),_e=O.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ye){ke(ye)}finally{P!==null&&G.types!==null&&(P.types=G.types),O.T=P}},Ae.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ae.use=function(f){return O.H.use(f)},Ae.useActionState=function(f,P,G){return O.H.useActionState(f,P,G)},Ae.useCallback=function(f,P){return O.H.useCallback(f,P)},Ae.useContext=function(f){return O.H.useContext(f)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(f,P){return O.H.useDeferredValue(f,P)},Ae.useEffect=function(f,P){return O.H.useEffect(f,P)},Ae.useEffectEvent=function(f){return O.H.useEffectEvent(f)},Ae.useId=function(){return O.H.useId()},Ae.useImperativeHandle=function(f,P,G){return O.H.useImperativeHandle(f,P,G)},Ae.useInsertionEffect=function(f,P){return O.H.useInsertionEffect(f,P)},Ae.useLayoutEffect=function(f,P){return O.H.useLayoutEffect(f,P)},Ae.useMemo=function(f,P){return O.H.useMemo(f,P)},Ae.useOptimistic=function(f,P){return O.H.useOptimistic(f,P)},Ae.useReducer=function(f,P,G){return O.H.useReducer(f,P,G)},Ae.useRef=function(f){return O.H.useRef(f)},Ae.useState=function(f){return O.H.useState(f)},Ae.useSyncExternalStore=function(f,P,G){return O.H.useSyncExternalStore(f,P,G)},Ae.useTransition=function(){return O.H.useTransition()},Ae.version="19.2.1",Ae}var hd;function Zs(){return hd||(hd=1,zo.exports=Nf()),zo.exports}var x=Zs();const gd=dr(x);var Js={exports:{}},Ha={},bd={exports:{}},yd={};/**
|
|
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 vd;function Rf(){return vd||(vd=1,(function(s){function l(E,V){var se=E.length;E.push(V);e:for(;0<se;){var ke=se-1>>>1,Ee=E[ke];if(0<v(Ee,V))E[ke]=V,E[se]=Ee,se=ke;else break e}}function d(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var V=E[0],se=E.pop();if(se!==V){E[0]=se;e:for(var ke=0,Ee=E.length,f=Ee>>>1;ke<f;){var P=2*(ke+1)-1,G=E[P],Y=P+1,_e=E[Y];if(0>v(G,se))Y<Ee&&0>v(_e,G)?(E[ke]=_e,E[Y]=se,ke=Y):(E[ke]=G,E[P]=se,ke=P);else if(Y<Ee&&0>v(_e,se))E[ke]=_e,E[Y]=se,ke=Y;else break e}}return V}function v(E,V){var se=E.sortIndex-V.sortIndex;return se!==0?se:E.id-V.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var I=performance;s.unstable_now=function(){return I.now()}}else{var D=Date,q=D.now();s.unstable_now=function(){return D.now()-q}}var _=[],y=[],B=1,C=null,W=3,M=!1,A=!1,H=!1,U=!1,ee=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function ne(E){for(var V=d(y);V!==null;){if(V.callback===null)c(y);else if(V.startTime<=E)c(y),V.sortIndex=V.expirationTime,l(_,V);else break;V=d(y)}}function ie(E){if(H=!1,ne(E),!A)if(d(_)!==null)A=!0,Q||(Q=!0,oe());else{var V=d(y);V!==null&&Pe(ie,V.startTime-E)}}var Q=!1,O=-1,fe=5,le=-1;function ge(){return U?!0:!(s.unstable_now()-le<fe)}function $e(){if(U=!1,Q){var E=s.unstable_now();le=E;var V=!0;try{e:{A=!1,H&&(H=!1,te(O),O=-1),M=!0;var se=W;try{t:{for(ne(E),C=d(_);C!==null&&!(C.expirationTime>E&&ge());){var ke=C.callback;if(typeof ke=="function"){C.callback=null,W=C.priorityLevel;var Ee=ke(C.expirationTime<=E);if(E=s.unstable_now(),typeof Ee=="function"){C.callback=Ee,ne(E),V=!0;break t}C===d(_)&&c(_),ne(E)}else c(_);C=d(_)}if(C!==null)V=!0;else{var f=d(y);f!==null&&Pe(ie,f.startTime-E),V=!1}}break e}finally{C=null,W=se,M=!1}V=void 0}}finally{V?oe():Q=!1}}}var oe;if(typeof re=="function")oe=function(){re($e)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,xe=ue.port2;ue.port1.onmessage=$e,oe=function(){xe.postMessage(null)}}else oe=function(){ee($e,0)};function Pe(E,V){O=ee(function(){E(s.unstable_now())},V)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return W},s.unstable_next=function(E){switch(W){case 1:case 2:case 3:var V=3;break;default:V=W}var se=W;W=V;try{return E()}finally{W=se}},s.unstable_requestPaint=function(){U=!0},s.unstable_runWithPriority=function(E,V){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var se=W;W=E;try{return V()}finally{W=se}},s.unstable_scheduleCallback=function(E,V,se){var ke=s.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ke+se:ke):se=ke,E){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=se+Ee,E={id:B++,callback:V,priorityLevel:E,startTime:se,expirationTime:Ee,sortIndex:-1},se>ke?(E.sortIndex=se,l(y,E),d(_)===null&&E===d(y)&&(H?(te(O),O=-1):H=!0,Pe(ie,se-ke))):(E.sortIndex=Ee,l(_,E),A||M||(A=!0,Q||(Q=!0,oe()))),E},s.unstable_shouldYield=ge,s.unstable_wrapCallback=function(E){var V=W;return function(){var se=W;W=V;try{return E.apply(this,arguments)}finally{W=se}}}})(yd)),yd}var xd;function Df(){return xd||(xd=1,bd.exports=Rf()),bd.exports}var Ys={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 wd;function Tf(){if(wd)return ln;wd=1;var s=Zs();function l(_){var y="https://react.dev/errors/"+_;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var B=2;B<arguments.length;B++)y+="&args[]="+encodeURIComponent(arguments[B])}return"Minified React error #"+_+"; visit "+y+" 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 I(_,y,B){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,key:C==null?null:""+C,children:_,containerInfo:y,implementation:B}}var D=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function q(_,y){if(_==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ln.createPortal=function(_,y){var B=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(l(299));return I(_,y,null,B)},ln.flushSync=function(_){var y=D.T,B=c.p;try{if(D.T=null,c.p=2,_)return _()}finally{D.T=y,c.p=B,c.d.f()}},ln.preconnect=function(_,y){typeof _=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(_,y))},ln.prefetchDNS=function(_){typeof _=="string"&&c.d.D(_)},ln.preinit=function(_,y){if(typeof _=="string"&&y&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin),W=typeof y.integrity=="string"?y.integrity:void 0,M=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;B==="style"?c.d.S(_,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:W,fetchPriority:M}):B==="script"&&c.d.X(_,{crossOrigin:C,integrity:W,fetchPriority:M,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},ln.preinitModule=function(_,y){if(typeof _=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var B=q(y.as,y.crossOrigin);c.d.M(_,{crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(_)},ln.preload=function(_,y){if(typeof _=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin);c.d.L(_,B,{crossOrigin:C,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},ln.preloadModule=function(_,y){if(typeof _=="string")if(y){var B=q(y.as,y.crossOrigin);c.d.m(_,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(_)},ln.requestFormReset=function(_){c.d.r(_)},ln.unstable_batchedUpdates=function(_,y){return _(y)},ln.useFormState=function(_,y,B){return D.H.useFormState(_,y,B)},ln.useFormStatus=function(){return D.H.useHostTransitionStatus()},ln.version="19.2.1",ln}var kd;function _d(){if(kd)return Ys.exports;kd=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(),Ys.exports=Tf(),Ys.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 Sd;function Lf(){if(Sd)return Ha;Sd=1;var s=Df(),l=Zs(),d=_d();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 I(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 D(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 q(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(I(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=I(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 i=!1,u=o.child;u;){if(u===n){i=!0,n=o,r=a;break}if(u===r){i=!0,r=o,n=a;break}u=u.sibling}if(!i){for(u=a.child;u;){if(u===n){i=!0,n=a,r=o;break}if(u===r){i=!0,r=a,n=o;break}u=u.sibling}if(!i)throw Error(c(189))}}if(n.alternate!==r)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function B(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=B(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,W=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),U=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"),O=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function xe(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 H:return"Fragment";case ee:return"Profiler";case U:return"StrictMode";case ie:return"Suspense";case Q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A: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 O:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Pe=Array.isArray,E=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=[],Ee=-1;function f(e){return{current:e}}function P(e){0>Ee||(e.current=ke[Ee],ke[Ee]=null,Ee--)}function G(e,t){Ee++,ke[Ee]=e.current,e.current=t}var Y=f(null),_e=f(null),ye=f(null),ze=f(null);function Le(e,t){switch(G(ye,t),G(_e,e),G(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(Y),G(Y,e)}function Re(){P(Y),P(_e),P(ye)}function De(e){e.memoizedState!==null&&G(ze,e);var t=Y.current,n=nf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function Be(e){_e.current===e&&(P(Y),P(_e)),ze.current===e&&(P(ze),Ri._currentValue=se)}var qt,ae;function ce(e){if(qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qt=t&&t[1]||"",ae=-1<n.stack.indexOf(`
|
|
34
34
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
35
|
-
`+
|
|
35
|
+
`+qt+e+ae}var be=!1;function Ie(e,t){if(!e||be)return"";be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(z){var S=z}Reflect.construct(e,[],$)}else{try{$.call()}catch(z){S=z}e.call($.prototype)}}else{try{throw Error()}catch(z){S=z}($=e())&&typeof $.catch=="function"&&$.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(),i=a[0],u=a[1];if(i&&u){var h=i.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 j=`
|
|
38
|
+
`+h[r].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=r&&0<=o);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ce(n):""}function je(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 J(e){try{var t="",n=null;do t+=je(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 Ke=Object.prototype.hasOwnProperty,K=i.unstable_scheduleCallback,Le=i.unstable_cancelCallback,Q=i.unstable_shouldYield,Oe=i.unstable_requestPaint,Fe=i.unstable_now,yt=i.unstable_getCurrentPriorityLevel,fn=i.unstable_ImmediatePriority,at=i.unstable_UserBlockingPriority,It=i.unstable_NormalPriority,Rn=i.unstable_LowPriority,ln=i.unstable_IdlePriority,Or=i.log,oa=i.unstable_setDisableYieldValue,Xt=null,Ye=null;function dt(e){if(typeof Or=="function"&&oa(e),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(Xt,e)}catch{}}var Te=Math.clz32?Math.clz32:Wr,hn=Math.log,Sn=Math.LN2;function Wr(e){return e>>>=0,e===0?32:31-(hn(e)/Sn|0)|0}var ce=256,on=262144,Cn=4194304;function Ln(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=Ln(r):(s&=u,s!==0?o=Ln(s):n||(n=u&~e,n!==0&&(o=Ln(n))))):(u=r&~a,u!==0?o=Ln(u):s!==0?o=Ln(s):n||(n=r&~e,n!==0&&(o=Ln(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 He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $n(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 vr(){var e=Cn;return Cn<<=1,(Cn&62914560)===0&&(Cn=4194304),e}function xr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function er(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ur(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 T=31-Te(n),O=1<<T;u[T]=0,h[T]=-1;var _=k[T];if(_!==null)for(k[T]=null,T=0;T<_.length;T++){var A=_[T];A!==null&&(A.lane&=-536870913)}n&=~O}r!==0&&aa(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(s&~t))}function aa(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Te(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ao(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Te(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function ur(e,t){var n=t&-t;return n=(n&42)!==0?1:un(n),(n&(e.suspendedLanes|t))!==0?0:n}function un(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 Po(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Br(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Cf(e.type))}function zo(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var En=Math.random().toString(36).slice(2),_t="__reactFiber$"+En,Vt="__reactProps$"+En,wr="__reactContainer$"+En,ia="__reactEvents$"+En,sa="__reactListeners$"+En,Xa="__reactHandles$"+En,la="__reactResources$"+En,Mo="__reactMarker$"+En;function To(e){delete e[_t],delete e[Vt],delete e[ia],delete e[sa],delete e[Xa]}function Hr(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wr]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uf(e);e!==null;){if(n=e[_t])return n;e=uf(e)}return t}e=n,n=e.parentNode}return null}function Jt(e){if(e=e[_t]||e[wr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Vr(e){var t=e[la];return t||(t=e[la]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Mo]=!0}var ua=new Set,Ja={};function dr(e,t){An(e,t),An(e+"Capture",t)}function An(e,t){for(Ja[e]=t,e=0;e<t.length;e++)ua.add(t[e])}var da=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]*$"),Ui={},ca={};function tr(e){return Ke.call(ca,e)?!0:Ke.call(Ui,e)?!1:da.test(e)?ca[e]=!0:(Ui[e]=!0,!1)}function nr(e,t,n){if(tr(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 pa(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 Fn(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 dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Io(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 ht(e){if(!e._valueTracker){var t=cn(e)?"checked":"value";e._valueTracker=Io(e,t,""+e[t])}}function Qr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cn(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kr(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 jo=/[\n"\\]/g;function gn(e){return e.replace(jo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function On(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=""+dn(t)):e.value!==""+dn(t)&&(e.value=""+dn(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Ya(e,s,dn(t)):n!=null?Ya(e,s,dn(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=""+dn(u):e.removeAttribute("name")}function Za(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)){ht(e);return}n=n!=null?""+dn(n):"",t=t!=null?""+dn(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),ht(e)}function Ya(e,t,n){t==="number"&&Kr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function qr(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=""+dn(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 ei(e,t,n){if(t!=null&&(t=""+dn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+dn(n):""}function ma(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Ie(r)){if(1<r.length)throw Error(c(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=dn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),ht(e)}function bn(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 No(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&&No(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&No(e,a,t[a])}function zt(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 Gr=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"]]),Ro=/^[\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 kr(e){return Ro.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wn(){}var tt=null;function fa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xr=null,Un=null;function ti(e){var t=Jt(e);if(t&&(e=t.stateNode)){var n=e[Vt]||null;e:switch(e=t.stateNode,t.type){case"input":if(On(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="'+gn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[Vt]||null;if(!o)throw Error(c(90));On(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&&Qr(r)}break e;case"textarea":ei(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&qr(e,!!n.multiple,t,!1)}}}var Lo=!1;function Jr(e,t,n){if(Lo)return e(t,n);Lo=!0;try{var r=e(t);return r}finally{if(Lo=!1,(Xr!==null||Un!==null)&&(zs(),Xr&&(t=Xr,e=Un,Un=Xr=null,ti(t),e)))for(t=0;t<e.length;t++)ti(e[t])}}function Zr(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Vt]||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 it=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nt=!1;if(it)try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){Nt=!0}}),window.addEventListener("test",Qt,Qt),window.removeEventListener("test",Qt,Qt)}catch{Nt=!1}var pr=null,an=null,St=null;function mr(){if(St)return St;var e,t=an,n=t.length,r,o="value"in pr?pr.value:pr.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 St=o.slice(e,1<r?1-r:void 0)}function $o(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 ha(){return!0}function Pn(){return!1}function Wt(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)?ha:Pn,this.isPropagationStopped=Pn,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=ha)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ha)},persist:function(){},isPersistent:ha}),t}var fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=Wt(fr),Bn=E({},fr,{view:0,detail:0}),ni=Wt(Bn),Oo,rr,Yr,Wo=E({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:j,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!==Yr&&(Yr&&e.type==="mousemove"?(Oo=e.screenX-Yr.screenX,rr=e.screenY-Yr.screenY):rr=Oo=0,Yr=e),Oo)},movementY:function(e){return"movementY"in e?e.movementY:rr}}),ga=Wt(Wo),ml=E({},Wo,{dataTransfer:0}),fl=Wt(ml),Bi=E({},Bn,{relatedTarget:0}),ri=Wt(Bi),hl=E({},fr,{animationName:0,elapsedTime:0,pseudoElement:0}),Hi=Wt(hl),Vi=E({},fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oi=Wt(Vi),gl=E({},fr,{data:0}),Qi=Wt(gl),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 p(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vl[e])?!!t[e]:!1}function j(){return p}var D=E({},Bn,{key:function(e){if(e.key){var t=bl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$o(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:j,charCode:function(e){return e.type==="keypress"?$o(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$o(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$=Wt(D),Y=E({},Wo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pe=Wt(Y),Ze=E({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:j}),Ct=Wt(Ze),Dt=E({},fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),$e=Wt(Dt),We=E({},Wo,{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}),wt=Wt(We),Kt=E({},fr,{newState:0,oldState:0}),Ut=Wt(Kt),Zt=[9,13,27,32],Hn=it&&"CompositionEvent"in window,sn=null;it&&"documentMode"in document&&(sn=document.documentMode);var Pe=it&&"TextEvent"in window&&!sn,Ue=it&&(!Hn||sn&&8<sn&&11>=sn),gt=" ",st=!1;function yn(e,t){switch(e){case"keyup":return Zt.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 Et=!1;function bt(e,t){switch(e){case"compositionend":return Bt(t);case"keypress":return t.which!==32?null:(st=!0,gt);case"textInput":return e=t.data,e===gt&&st?null:e;default:return null}}function Ki(e,t){if(Et)return e==="compositionend"||!Hn&&yn(e,t)?(e=mr(),St=an=pr=null,Et=!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 Ue&&t.locale!=="ko"?null:t.data;default:return null}}var xg={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 cc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xg[e.type]:t==="textarea"}function pc(e,t,n,r){Xr?Un?Un.push(r):Un=[r]:Xr=r,t=Rs(t,"onChange"),0<t.length&&(n=new Fo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ai=null,ii=null;function wg(e){qm(e,0)}function qi(e){var t=jt(e);if(Qr(t))return e}function mc(e,t){if(e==="change")return t}var fc=!1;if(it){var xl;if(it){var wl="oninput"in document;if(!wl){var hc=document.createElement("div");hc.setAttribute("oninput","return;"),wl=typeof hc.oninput=="function"}xl=wl}else xl=!1;fc=xl&&(!document.documentMode||9<document.documentMode)}function gc(){ai&&(ai.detachEvent("onpropertychange",bc),ii=ai=null)}function bc(e){if(e.propertyName==="value"&&qi(ii)){var t=[];pc(t,ii,e,fa(e)),Jr(wg,t)}}function kg(e,t,n){e==="focusin"?(gc(),ai=t,ii=n,ai.attachEvent("onpropertychange",bc)):e==="focusout"&&gc()}function _g(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(ii)}function Sg(e,t){if(e==="click")return qi(t)}function Cg(e,t){if(e==="input"||e==="change")return qi(t)}function Eg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:Eg;function si(e,t){if(zn(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(!Ke.call(t,o)||!zn(e[o],t[o]))return!1}return!0}function yc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vc(e,t){var n=yc(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=yc(n)}}function xc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function kl(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 Ag=it&&"documentMode"in document&&11>=document.documentMode,ba=null,_l=null,li=null,Sl=!1;function kc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sl||ba==null||ba!==Kr(r)||(r=ba,"selectionStart"in r&&kl(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}),li&&si(li,r)||(li=r,r=Rs(_l,"onSelect"),0<r.length&&(t=new Fo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ba)))}function Uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ya={animationend:Uo("Animation","AnimationEnd"),animationiteration:Uo("Animation","AnimationIteration"),animationstart:Uo("Animation","AnimationStart"),transitionrun:Uo("Transition","TransitionRun"),transitionstart:Uo("Transition","TransitionStart"),transitioncancel:Uo("Transition","TransitionCancel"),transitionend:Uo("Transition","TransitionEnd")},Cl={},_c={};it&&(_c=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Bo(e){if(Cl[e])return Cl[e];if(!ya[e])return e;var t=ya[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _c)return Cl[e]=t[n];return e}var Sc=Bo("animationend"),Cc=Bo("animationiteration"),Ec=Bo("animationstart"),Pg=Bo("transitionrun"),zg=Bo("transitionstart"),Mg=Bo("transitioncancel"),Ac=Bo("transitionend"),Pc=new Map,El="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(" ");El.push("scrollEnd");function or(e,t){Pc.set(e,t),dr(t,[e])}var Gi=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=[],va=0,Al=0;function Xi(){for(var e=va,t=Al=va=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 s=r.pending;s===null?o.next=o:(o.next=s.next,s.next=o),r.pending=o}a!==0&&zc(n,o,a)}}function Ji(e,t,n,r){Vn[va++]=e,Vn[va++]=t,Vn[va++]=n,Vn[va++]=r,Al|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pl(e,t,n,r){return Ji(e,t,n,r),Zi(e)}function Ho(e,t){return Ji(e,null,null,t),Zi(e)}function zc(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-Te(n),e=a.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zi(e){if(50<Mi)throw Mi=0,Lu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xa={};function Tg(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(e,t,n,r){return new Tg(e,t,n,r)}function zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _r(e,t){var n=e.alternate;return n===null?(n=Mn(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 Mc(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 s=0;if(r=e,typeof e=="function")zl(e)&&(s=1);else if(typeof e=="string")s=R0(e,n,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=Mn(31,n,t,o),e.elementType=me,e.lanes=a,e;case I:return Vo(n.children,o,a,t);case J:s=8,o|=24;break;case ee:return e=Mn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case q:return e=Mn(13,n,t,o),e.elementType=q,e.lanes=a,e;case Z:return e=Mn(19,n,t,o),e.elementType=Z,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oe:s=10;break e;case re:s=9;break e;case ae:s=11;break e;case U:s=14;break e;case de:s=16,r=null;break e}s=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Mn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Vo(e,t,n,r){return e=Mn(7,e,r,t),e.lanes=n,e}function Ml(e,t,n){return e=Mn(6,e,null,t),e.lanes=n,e}function Tc(e){var t=Mn(18,null,null,0);return t.stateNode=e,t}function Tl(e,t,n){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ic=new WeakMap;function Qn(e,t){if(typeof e=="object"&&e!==null){var n=Ic.get(e);return n!==void 0?n:(t={value:e,source:t,stack:X(t)},Ic.set(e,t),t)}return{value:e,source:t,stack:X(t)}}var wa=[],ka=0,es=null,ui=0,Kn=[],qn=0,eo=null,hr=1,gr="";function Sr(e,t){wa[ka++]=ui,wa[ka++]=es,es=e,ui=t}function jc(e,t,n){Kn[qn++]=hr,Kn[qn++]=gr,Kn[qn++]=eo,eo=e;var r=hr;e=gr;var o=32-Te(r)-1;r&=~(1<<o),n+=1;var a=32-Te(t)+o;if(30<a){var s=o-o%5;a=(r&(1<<s)-1).toString(32),r>>=s,o-=s,hr=1<<32-Te(t)+o|n<<o|r,gr=a+e}else hr=1<<a|n<<o|r,gr=e}function Il(e){e.return!==null&&(Sr(e,1),jc(e,1,0))}function jl(e){for(;e===es;)es=wa[--ka],wa[ka]=null,ui=wa[--ka],wa[ka]=null;for(;e===eo;)eo=Kn[--qn],Kn[qn]=null,gr=Kn[--qn],Kn[qn]=null,hr=Kn[--qn],Kn[qn]=null}function Nc(e,t){Kn[qn++]=hr,Kn[qn++]=gr,Kn[qn++]=eo,hr=t.id,gr=t.overflow,eo=e}var Yt=null,vt=null,Je=!1,to=null,Gn=!1,Nl=Error(c(519));function no(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw di(Qn(t,e)),Nl}function Dc(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[Vt]=r,n){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(n=0;n<Ii.length;n++)Qe(Ii[n],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),Za(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),ma(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||Zm(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=Wn),t=!0):t=!1,t||no(e,!0)}function Rc(e){for(Yt=e.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Yt=Yt.return}}function _a(e){if(e!==Yt)return!1;if(!Je)return Rc(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")||Zu(e.type,e.memoizedProps)),n=!n),n&&vt&&no(e),Rc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=lf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=lf(e)}else t===27?(t=vt,bo(e.type)?(e=rd,rd=null,vt=e):vt=t):vt=Yt?Xn(e.stateNode.nextSibling):null;return!0}function Qo(){vt=Yt=null,Je=!1}function Dl(){var e=to;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),to=null),e}function di(e){to===null?to=[e]:to.push(e)}var Rl=f(null),Ko=null,Cr=null;function ro(e,t,n){G(Rl,t._currentValue),t._currentValue=n}function Er(e){e._currentValue=Rl.current,z(Rl)}function Ll(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 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),Ll(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),Ll(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 Sa(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;zn(o.pendingProps.value,s.value)||(e!==null?e.push(u):e=[u])}}else if(o===Ae.current){if(s=o.alternate,s===null)throw Error(c(387));s.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Li):e=[Li])}o=o.return}e!==null&&$l(t,e,n,r),t.flags|=262144}function ts(e){for(e=e.firstContext;e!==null;){if(!zn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qo(e){Ko=e,Cr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function en(e){return Lc(Ko,e)}function ns(e,t){return Ko===null&&qo(e),Lc(e,t)}function Lc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Cr===null){if(e===null)throw Error(c(308));Cr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Cr=Cr.next=t;return n}var Ig=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()})}},jg=i.unstable_scheduleCallback,Ng=i.unstable_NormalPriority,Rt={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fl(){return{controller:new Ig,data:new Map,refCount:0}}function ci(e){e.refCount--,e.refCount===0&&jg(Ng,function(){e.controller.abort()})}var pi=null,Ol=0,Ca=0,Ea=null;function Dg(e,t){if(pi===null){var n=pi=[];Ol=0,Ca=Bu(),Ea={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Ol++,t.then($c,$c),t}function $c(){if(--Ol===0&&pi!==null){Ea!==null&&(Ea.status="fulfilled");var e=pi;pi=null,Ca=0,Ea=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Rg(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var Fc=C.S;C.S=function(e,t){km=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dg(e,t),Fc!==null&&Fc(e,t)};var Go=f(null);function Wl(){var e=Go.current;return e!==null?e:ft.pooledCache}function rs(e,t){t===null?G(Go,Go.current):G(Go,t.pool)}function Oc(){var e=Wl();return e===null?null:{parent:Rt._currentValue,pool:e}}var Aa=Error(c(460)),Ul=Error(c(474)),os=Error(c(542)),as={then:function(){}};function Wc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uc(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Wn,Wn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hc(e),e;default:if(typeof t.status=="string")t.then(Wn,Wn);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,Hc(e),e}throw Jo=t,Aa}}function Xo(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Jo=n,Aa):n}}var Jo=null;function Bc(){if(Jo===null)throw Error(c(459));var e=Jo;return Jo=null,e}function Hc(e){if(e===Aa||e===os)throw Error(c(483))}var Pa=null,mi=0;function is(e){var t=mi;return mi+=1,Pa===null&&(Pa=[]),Uc(Pa,e,t)}function fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ss(e,t){throw t.$$typeof===B?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Vc(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=_r(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 s(b){return e&&b.alternate===null&&(b.flags|=67108866),b}function u(b,g,w,L){return g===null||g.tag!==6?(g=Ml(w,b.mode,L),g.return=b,g):(g=o(g,w),g.return=b,g)}function h(b,g,w,L){var we=w.type;return we===I?T(b,g,w.props.children,L,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===de&&Xo(we)===g.type)?(g=o(g,w.props),fi(g,w),g.return=b,g):(g=Yi(w.type,w.key,w.props,null,b.mode,L),fi(g,w),g.return=b,g)}function k(b,g,w,L){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=Tl(w,b.mode,L),g.return=b,g):(g=o(g,w.children||[]),g.return=b,g)}function T(b,g,w,L,we){return g===null||g.tag!==7?(g=Vo(w,b.mode,L,we),g.return=b,g):(g=o(g,w),g.return=b,g)}function O(b,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Ml(""+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),fi(w,g),w.return=b,w;case P:return g=Tl(g,b.mode,w),g.return=b,g;case de:return g=Xo(g),O(b,g,w)}if(Ie(g)||ne(g))return g=Vo(g,b.mode,w,null),g.return=b,g;if(typeof g.then=="function")return O(b,is(g),w);if(g.$$typeof===oe)return O(b,ns(b,g),w);ss(b,g)}return null}function _(b,g,w,L){var we=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return we!==null?null:u(b,g,""+w,L);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case M:return w.key===we?h(b,g,w,L):null;case P:return w.key===we?k(b,g,w,L):null;case de:return w=Xo(w),_(b,g,w,L)}if(Ie(w)||ne(w))return we!==null?null:T(b,g,w,L,null);if(typeof w.then=="function")return _(b,g,is(w),L);if(w.$$typeof===oe)return _(b,g,ns(b,w),L);ss(b,w)}return null}function A(b,g,w,L,we){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return b=b.get(w)||null,u(g,b,""+L,we);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case M:return b=b.get(L.key===null?w:L.key)||null,h(g,b,L,we);case P:return b=b.get(L.key===null?w:L.key)||null,k(g,b,L,we);case de:return L=Xo(L),A(b,g,w,L,we)}if(Ie(L)||ne(L))return b=b.get(w)||null,T(g,b,L,we,null);if(typeof L.then=="function")return A(b,g,w,is(L),we);if(L.$$typeof===oe)return A(b,g,w,ns(g,L),we);ss(g,L)}return null}function ue(b,g,w,L){for(var we=null,nt=null,ge=g,Re=g=0,Ge=null;ge!==null&&Re<w.length;Re++){ge.index>Re?(Ge=ge,ge=null):Ge=ge.sibling;var rt=_(b,ge,w[Re],L);if(rt===null){ge===null&&(ge=Ge);break}e&&ge&&rt.alternate===null&&t(b,ge),g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt,ge=Ge}if(Re===w.length)return n(b,ge),Je&&Sr(b,Re),we;if(ge===null){for(;Re<w.length;Re++)ge=O(b,w[Re],L),ge!==null&&(g=a(ge,g,Re),nt===null?we=ge:nt.sibling=ge,nt=ge);return Je&&Sr(b,Re),we}for(ge=r(ge);Re<w.length;Re++)Ge=A(ge,b,Re,w[Re],L),Ge!==null&&(e&&Ge.alternate!==null&&ge.delete(Ge.key===null?Re:Ge.key),g=a(Ge,g,Re),nt===null?we=Ge:nt.sibling=Ge,nt=Ge);return e&&ge.forEach(function(ko){return t(b,ko)}),Je&&Sr(b,Re),we}function Ce(b,g,w,L){if(w==null)throw Error(c(151));for(var we=null,nt=null,ge=g,Re=g=0,Ge=null,rt=w.next();ge!==null&&!rt.done;Re++,rt=w.next()){ge.index>Re?(Ge=ge,ge=null):Ge=ge.sibling;var ko=_(b,ge,rt.value,L);if(ko===null){ge===null&&(ge=Ge);break}e&&ge&&ko.alternate===null&&t(b,ge),g=a(ko,g,Re),nt===null?we=ko:nt.sibling=ko,nt=ko,ge=Ge}if(rt.done)return n(b,ge),Je&&Sr(b,Re),we;if(ge===null){for(;!rt.done;Re++,rt=w.next())rt=O(b,rt.value,L),rt!==null&&(g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt);return Je&&Sr(b,Re),we}for(ge=r(ge);!rt.done;Re++,rt=w.next())rt=A(ge,b,Re,rt.value,L),rt!==null&&(e&&rt.alternate!==null&&ge.delete(rt.key===null?Re:rt.key),g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&ge.forEach(function(K0){return t(b,K0)}),Je&&Sr(b,Re),we}function mt(b,g,w,L){if(typeof w=="object"&&w!==null&&w.type===I&&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===I){if(g.tag===7){n(b,g.sibling),L=o(g,w.props.children),L.return=b,b=L;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===de&&Xo(we)===g.type){n(b,g.sibling),L=o(g,w.props),fi(L,w),L.return=b,b=L;break e}n(b,g);break}else t(b,g);g=g.sibling}w.type===I?(L=Vo(w.props.children,b.mode,L,w.key),L.return=b,b=L):(L=Yi(w.type,w.key,w.props,null,b.mode,L),fi(L,w),L.return=b,b=L)}return s(b);case P:e:{for(we=w.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(b,g.sibling),L=o(g,w.children||[]),L.return=b,b=L;break e}else{n(b,g);break}else t(b,g);g=g.sibling}L=Tl(w,b.mode,L),L.return=b,b=L}return s(b);case de:return w=Xo(w),mt(b,g,w,L)}if(Ie(w))return ue(b,g,w,L);if(ne(w)){if(we=ne(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Ce(b,g,w,L)}if(typeof w.then=="function")return mt(b,g,is(w),L);if(w.$$typeof===oe)return mt(b,g,ns(b,w),L);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),L=o(g,w),L.return=b,b=L):(n(b,g),L=Ml(w,b.mode,L),L.return=b,b=L),s(b)):n(b,g)}return function(b,g,w,L){try{mi=0;var we=mt(b,g,w,L);return Pa=null,we}catch(ge){if(ge===Aa||ge===os)throw ge;var nt=Mn(29,ge,null,b.mode);return nt.lanes=L,nt.return=b,nt}finally{}}}var Zo=Vc(!0),Qc=Vc(!1),oo=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hl(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 ao(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function io(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ot&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=Zi(e),zc(e,null,n),t}return Ji(e,r,t,n),Zi(e)}function hi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ao(e,n)}}function Vl(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 Ql=!1;function gi(){if(Ql){var e=Ea;if(e!==null)throw e}}function bi(e,t,n,r){Ql=!1;var o=e.updateQueue;oo=!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 T=e.alternate;T!==null&&(T=T.updateQueue,u=T.lastBaseUpdate,u!==s&&(u===null?T.firstBaseUpdate=k:u.next=k,T.lastBaseUpdate=h))}if(a!==null){var O=o.baseState;s=0,T=k=h=null,u=a;do{var _=u.lane&-536870913,A=_!==u.lane;if(A?(qe&_)===_:(r&_)===_){_!==0&&_===Ca&&(Ql=!0),T!==null&&(T=T.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var ue=e,Ce=u;_=t;var mt=n;switch(Ce.tag){case 1:if(ue=Ce.payload,typeof ue=="function"){O=ue.call(mt,O,_);break e}O=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=Ce.payload,_=typeof ue=="function"?ue.call(mt,O,_):ue,_==null)break e;O=E({},O,_);break e;case 2:oo=!0}}_=u.callback,_!==null&&(e.flags|=64,A&&(e.flags|=8192),A=o.callbacks,A===null?o.callbacks=[_]:A.push(_))}else A={lane:_,tag:u.tag,payload:u.payload,callback:u.callback,next:null},T===null?(k=T=A,h=O):T=T.next=A,s|=_;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;A=u,u=A.next,A.next=null,o.lastBaseUpdate=A,o.shared.pending=null}}while(!0);T===null&&(h=O),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=T,a===null&&(o.shared.lanes=0),po|=s,e.lanes=s,e.memoizedState=O}}function Kc(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function qc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Kc(n[e],t)}var za=f(null),ls=f(0);function Gc(e,t){e=Dr,G(ls,e),G(za,t),Dr=e|t.baseLanes}function Kl(){G(ls,Dr),G(za,za.current)}function ql(){Dr=ls.current,z(za),z(ls)}var Tn=f(null),ar=null;function so(e){var t=e.alternate;G(Mt,Mt.current&1),G(Tn,e),ar===null&&(t===null||za.current!==null||t.memoizedState!==null)&&(ar=e)}function Gl(e){G(Mt,Mt.current),G(Tn,e),ar===null&&(ar=e)}function Xc(e){e.tag===22?(G(Mt,Mt.current),G(Tn,e),ar===null&&(ar=e)):lo()}function lo(){G(Mt,Mt.current),G(Tn,Tn.current)}function In(e){z(Tn),ar===e&&(ar=null),z(Mt)}var Mt=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||td(n)||nd(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 Ar=0,je=null,ct=null,Lt=null,ds=!1,Ma=!1,Yo=!1,cs=0,yi=0,Ta=null,Lg=0;function At(){throw Error(c(321))}function Xl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function Jl(e,t,n,r,o,a){return Ar=a,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?jp:pu,Yo=!1,a=n(r,o),Yo=!1,Ma&&(a=Zc(t,n,r,o)),Jc(e),a}function Jc(e){C.H=wi;var t=ct!==null&&ct.next!==null;if(Ar=0,Lt=ct=je=null,ds=!1,yi=0,Ta=null,t)throw Error(c(300));e===null||$t||(e=e.dependencies,e!==null&&ts(e)&&($t=!0))}function Zc(e,t,n,r){je=e;var o=0;do{if(Ma&&(Ta=null),yi=0,Ma=!1,25<=o)throw Error(c(301));if(o+=1,Lt=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=Np,a=t(n,r)}while(Ma);return a}function $g(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?vi(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(je.flags|=1024),t}function Zl(){var e=cs!==0;return cs=0,e}function Yl(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function eu(e){if(ds){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ds=!1}Ar=0,Lt=ct=je=null,Ma=!1,yi=cs=0,Ta=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?je.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Tt(){if(ct===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=Lt===null?je.memoizedState:Lt.next;if(t!==null)Lt=t,ct=e;else{if(e===null)throw je.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},Lt===null?je.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vi(e){var t=yi;return yi+=1,Ta===null&&(Ta=[]),e=Uc(Ta,e,t),t=je,(Lt===null?t.memoizedState:Lt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?jp:pu),e}function ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vi(e);if(e.$$typeof===oe)return en(e)}throw Error(c(438,String(e)))}function tu(e){var t=null,n=je.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=je.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(),je.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]=he;return t.index++,n}function Pr(e,t){return typeof t=="function"?t(e):t}function fs(e){var t=Tt();return nu(t,ct,e)}function nu(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,T=!1;do{var O=k.lane&-536870913;if(O!==k.lane?(qe&O)===O:(Ar&O)===O){var _=k.revertLane;if(_===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),O===Ca&&(T=!0);else if((Ar&_)===_){k=k.next,_===Ca&&(T=!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,je.lanes|=_,po|=_;O=k.action,Yo&&n(a,O),a=k.hasEagerState?k.eagerState:n(a,O)}else _={lane:O,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=_,s=a):h=h.next=_,je.lanes|=O,po|=O;k=k.next}while(k!==null&&k!==t);if(h===null?s=a:h.next=u,!zn(a,e.memoizedState)&&($t=!0,T&&(n=Ea,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 ru(e){var t=Tt(),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);zn(a,t.memoizedState)||($t=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Yc(e,t,n){var r=je,o=Tt(),a=Je;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var s=!zn((ct||o).memoizedState,n);if(s&&(o.memoizedState=n,$t=!0),o=o.queue,iu(np.bind(null,r,o,e),[e]),o.getSnapshot!==t||s||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Ia(9,{destroy:void 0},tp.bind(null,r,o,n,t),null),ft===null)throw Error(c(349));a||(Ar&127)!==0||ep(r,t,n)}return n}function ep(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t=ps(),je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tp(e,t,n,r){t.value=n,t.getSnapshot=r,rp(t)&&op(e)}function np(e,t,n){return n(function(){rp(t)&&op(e)})}function rp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function op(e){var t=Ho(e,2);t!==null&&_n(t,e,2)}function ou(e){var t=pn();if(typeof e=="function"){var n=e;if(e=n(),Yo){dt(!0);try{n()}finally{dt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:e},t}function ap(e,t,n,r){return e.baseState=n,nu(e,ct,typeof r=="function"?r:Pr)}function Fg(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(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,ip(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ip(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),sp(e,t,u)}catch(k){au(e,t,k)}finally{a!==null&&s.types!==null&&(a.types=s.types),C.T=a}}else try{a=n(o,r),sp(e,t,a)}catch(k){au(e,t,k)}}function sp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){lp(e,t,r)},function(r){return au(e,t,r)}):lp(e,t,n)}function lp(e,t,n){t.status="fulfilled",t.value=n,up(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ip(e,n)))}function au(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,up(t),t=t.next;while(t!==r)}e.action=null}function up(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function dp(e,t){return t}function cp(e,t){if(Je){var n=ft.formState;if(n!==null){e:{var r=je;if(Je){if(vt){t:{for(var o=vt,a=Gn;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}}no(r)}r=!1}r&&(t=n[0])}}return n=pn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dp,lastRenderedState:t},n.queue=r,n=Mp.bind(null,je,r),r.dispatch=n,r=ou(!1),a=cu.bind(null,je,!1,r.queue),r=pn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=Fg.bind(null,je,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function pp(e){var t=Tt();return mp(t,ct,e)}function mp(e,t,n){if(t=nu(e,t,dp)[0],e=fs(Pr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=vi(t)}catch(s){throw s===Aa?os:s}else r=t;t=Tt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(je.flags|=2048,Ia(9,{destroy:void 0},Og.bind(null,o,n),null)),[r,a,e]}function Og(e,t){e.action=t}function fp(e){var t=Tt(),n=ct;if(n!==null)return mp(t,n,e);Tt(),t=t.memoizedState,n=Tt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ia(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=je.updateQueue,t===null&&(t=ps(),je.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 hp(){return Tt().memoizedState}function hs(e,t,n,r){var o=pn();je.flags|=e,o.memoizedState=Ia(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var o=Tt();r=r===void 0?null:r;var a=o.memoizedState.inst;ct!==null&&r!==null&&Xl(r,ct.memoizedState.deps)?o.memoizedState=Ia(t,a,n,r):(je.flags|=e,o.memoizedState=Ia(1|t,a,n,r))}function gp(e,t){hs(8390656,8,e,t)}function iu(e,t){gs(2048,8,e,t)}function Wg(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=ps(),je.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bp(e){var t=Tt().memoizedState;return Wg({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function yp(e,t){return gs(4,2,e,t)}function vp(e,t){return gs(4,4,e,t)}function xp(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 wp(e,t,n){n=n!=null?n.concat([e]):null,gs(4,4,xp.bind(null,t,e),n)}function su(){}function kp(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _p(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xl(t,r[1]))return r[0];if(r=e(),Yo){dt(!0);try{e()}finally{dt(!1)}}return n.memoizedState=[r,t],r}function lu(e,t,n){return n===void 0||(Ar&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Sm(),je.lanes|=e,po|=e,n)}function Sp(e,t,n,r){return zn(n,t)?n:za.current!==null?(e=lu(e,n,r),zn(e,t)||($t=!0),e):(Ar&42)===0||(Ar&1073741824)!==0&&(qe&261930)===0?($t=!0,e.memoizedState=n):(e=Sm(),je.lanes|=e,po|=e,t)}function Cp(e,t,n,r,o){var a=H.p;H.p=a!==0&&8>a?a:8;var s=C.T,u={};C.T=u,cu(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 T=Rg(h,r);xi(e,t,T,Dn(e))}else xi(e,t,r,Dn(e))}catch(O){xi(e,t,{then:function(){},status:"rejected",reason:O},Dn())}finally{H.p=a,s!==null&&u.types!==null&&(s.types=u.types),C.T=s}}function Ug(){}function uu(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=Ep(e).queue;Cp(e,o,t,le,n===null?Ug:function(){return Ap(e),n(r)})}function Ep(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ap(e){var t=Ep(e);t.next===null&&(t=e.alternate.memoizedState),xi(e,t.next.queue,{},Dn())}function du(){return en(Li)}function Pp(){return Tt().memoizedState}function zp(){return Tt().memoizedState}function Bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Dn();e=ao(n);var r=io(t,e,n);r!==null&&(_n(r,t,n),hi(r,t,n)),t={cache:Fl()},e.payload=t;return}t=t.return}}function Hg(e,t,n){var r=Dn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bs(e)?Tp(t,n):(n=Pl(e,t,n,r),n!==null&&(_n(n,e,r),Ip(n,t,r)))}function Mp(e,t,n){var r=Dn();xi(e,t,n,r)}function xi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bs(e))Tp(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,zn(u,s))return Ji(e,t,o,0),ft===null&&Xi(),!1}catch{}finally{}if(n=Pl(e,t,o,r),n!==null)return _n(n,e,r),Ip(n,t,r),!0}return!1}function cu(e,t,n,r){if(r={lane:2,revertLane:Bu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(c(479))}else t=Pl(e,n,r,2),t!==null&&_n(t,e,2)}function bs(e){var t=e.alternate;return e===je||t!==null&&t===je}function Tp(e,t){Ma=ds=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ip(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ao(e,n)}}var wi={readContext:en,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};wi.useEffectEvent=At;var jp={readContext:en,use:ms,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:gp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,hs(4194308,4,xp.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=pn();t=t===void 0?null:t;var r=e();if(Yo){dt(!0);try{e()}finally{dt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=pn();if(n!==void 0){var o=n(t);if(Yo){dt(!0);try{n(t)}finally{dt(!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=Hg.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:function(e){e=ou(e);var t=e.queue,n=Mp.bind(null,je,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:su,useDeferredValue:function(e,t){var n=pn();return lu(n,e,t)},useTransition:function(){var e=ou(!1);return e=Cp.bind(null,je,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=je,o=pn();if(Je){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ft===null)throw Error(c(349));(qe&127)!==0||ep(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,gp(np.bind(null,r,a,e),[e]),r.flags|=2048,Ia(9,{destroy:void 0},tp.bind(null,r,a,n,t),null),n},useId:function(){var e=pn(),t=ft.identifierPrefix;if(Je){var n=gr,r=hr;n=(r&~(1<<32-Te(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:du,useFormState:cp,useActionState:cp,useOptimistic:function(e){var t=pn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cu.bind(null,je,!0,n),n.dispatch=t,[e,t]},useMemoCache:tu,useCacheRefresh:function(){return pn().memoizedState=Bg.bind(null,je)},useEffectEvent:function(e){var t=pn(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},pu={readContext:en,use:ms,useCallback:kp,useContext:en,useEffect:iu,useImperativeHandle:wp,useInsertionEffect:yp,useLayoutEffect:vp,useMemo:_p,useReducer:fs,useRef:hp,useState:function(){return fs(Pr)},useDebugValue:su,useDeferredValue:function(e,t){var n=Tt();return Sp(n,ct.memoizedState,e,t)},useTransition:function(){var e=fs(Pr)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:Yc,useId:Pp,useHostTransitionStatus:du,useFormState:pp,useActionState:pp,useOptimistic:function(e,t){var n=Tt();return ap(n,ct,e,t)},useMemoCache:tu,useCacheRefresh:zp};pu.useEffectEvent=bp;var Np={readContext:en,use:ms,useCallback:kp,useContext:en,useEffect:iu,useImperativeHandle:wp,useInsertionEffect:yp,useLayoutEffect:vp,useMemo:_p,useReducer:ru,useRef:hp,useState:function(){return ru(Pr)},useDebugValue:su,useDeferredValue:function(e,t){var n=Tt();return ct===null?lu(n,e,t):Sp(n,ct.memoizedState,e,t)},useTransition:function(){var e=ru(Pr)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:Yc,useId:Pp,useHostTransitionStatus:du,useFormState:fp,useActionState:fp,useOptimistic:function(e,t){var n=Tt();return ct!==null?ap(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:tu,useCacheRefresh:zp};Np.useEffectEvent=bp;function mu(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 fu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Dn(),o=ao(r);o.payload=t,n!=null&&(o.callback=n),t=io(e,o,r),t!==null&&(_n(t,e,r),hi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Dn(),o=ao(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=io(e,o,r),t!==null&&(_n(t,e,r),hi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Dn(),r=ao(n);r.tag=2,t!=null&&(r.callback=t),t=io(e,r,n),t!==null&&(_n(t,e,n),hi(t,e,n))}};function Dp(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?!si(n,r)||!si(o,a):!0}function Rp(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&&fu.enqueueReplaceState(t,t.state,null)}function ea(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 Lp(e){Gi(e)}function $p(e){console.error(e)}function Fp(e){Gi(e)}function ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Op(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 hu(e,t,n){return n=ao(n),n.tag=3,n.payload={element:null},n.callback=function(){ys(e,t)},n}function Wp(e){return e=ao(e),e.tag=3,e}function Up(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(){Op(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Op(t,n,r),typeof o!="function"&&(mo===null?mo=new Set([this]):mo.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Vg(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Sa(t,n,o,!0),n=Tn.current,n!==null){switch(n.tag){case 31:case 13:return ar===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),Ou(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)),Ou(e,r,o)),!1}throw Error(c(435,n.tag))}return Ou(e,r,o),Ms(),!1}if(Je)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Nl&&(e=Error(c(422),{cause:r}),di(Qn(e,n)))):(r!==Nl&&(t=Error(c(423),{cause:r}),di(Qn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Qn(r,n),o=hu(e.stateNode,r,o),Vl(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(c(520),{cause:r});if(a=Qn(a,n),zi===null?zi=[a]:zi.push(a),Pt!==4&&(Pt=2),t===null)return!0;r=Qn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=hu(n.stateNode,r,e),Vl(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"&&(mo===null||!mo.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Wp(o),Up(o,e,n,r),Vl(n,o),!1}n=n.return}while(n!==null);return!1}var gu=Error(c(461)),$t=!1;function tn(e,t,n,r){t.child=e===null?Qc(t,null,n,r):Zo(t,e.child,n,r)}function Bp(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 qo(t),r=Jl(e,t,n,s,a,o),u=Zl(),e!==null&&!$t?(Yl(e,t,o),zr(e,t,o)):(Je&&u&&Il(t),t.flags|=1,tn(e,t,r,o),t.child)}function Hp(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!zl(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Vp(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,!Su(e,o)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:si,n(s,r)&&e.ref===t.ref)return zr(e,t,o)}return t.flags|=1,e=_r(a,r),e.ref=t.ref,e.return=t,t.child=e}function Vp(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(si(a,r)&&e.ref===t.ref)if($t=!1,t.pendingProps=r=a,Su(e,o))(e.flags&131072)!==0&&($t=!0);else return t.lanes=e.lanes,zr(e,t,o)}return bu(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(),Xc(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),lo(),t.memoizedState=null):(e!==null&&rs(t,null),Kl(),lo());return tn(e,t,o,n),t.child}function ki(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kp(e,t,n,r,o){var a=Wl();return a=a===null?null:{parent:Rt._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&rs(t,null),Kl(),Xc(t),e!==null&&Sa(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 qp(e,t,n){return Zo(t,e.child,null,n),e=vs(t,t.pendingProps),e.flags|=2,In(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(Je){if(r.mode==="hidden")return e=vs(t,r),t.lanes=536870912,ki(null,e);if(Gl(t),(e=vt)?(e=sf(e,Gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:eo!==null?{id:hr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},n=Tc(e),n.return=t,t.child=n,Yt=t,vt=null)):e=null,e===null)throw no(t);return t.lanes=536870912,null}return vs(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Gl(t),o)if(t.flags&256)t.flags&=-257,t=qp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if($t||Sa(e,t,n,!1),o=(n&e.childLanes)!==0,$t||o){if(r=ft,r!==null&&(s=ur(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Ho(e,s),_n(r,e,s),gu;Ms(),t=qp(e,t,n)}else e=a.treeContext,vt=Xn(s.nextSibling),Yt=t,Je=!0,to=null,Gn=!1,e!==null&&Nc(t,e),t=vs(t,r),t.flags|=4096;return t}return e=_r(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 bu(e,t,n,r,o){return qo(t),n=Jl(e,t,n,r,void 0,o),r=Zl(),e!==null&&!$t?(Yl(e,t,o),zr(e,t,o)):(Je&&r&&Il(t),t.flags|=1,tn(e,t,n,o),t.child)}function Gp(e,t,n,r,o,a){return qo(t),t.updateQueue=null,n=Zc(t,r,n,o),Jc(e),r=Zl(),e!==null&&!$t?(Yl(e,t,a),zr(e,t,a)):(Je&&r&&Il(t),t.flags|=1,tn(e,t,n,a),t.child)}function Xp(e,t,n,r,o){if(qo(t),t.stateNode===null){var a=xa,s=n.contextType;typeof s=="object"&&s!==null&&(a=en(s)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Bl(t),s=n.contextType,a.context=typeof s=="object"&&s!==null?en(s):xa,a.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(mu(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&&fu.enqueueReplaceState(a,a.state,null),bi(t,r,a,o),gi(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,h=ea(n,u);a.props=h;var k=a.context,T=n.contextType;s=xa,typeof T=="object"&&T!==null&&(s=en(T));var O=n.getDerivedStateFromProps;T=typeof O=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,T||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==s)&&Rp(t,a,r,s),oo=!1;var _=t.memoizedState;a.state=_,bi(t,r,a,o),gi(),k=t.memoizedState,u||_!==k||oo?(typeof O=="function"&&(mu(t,n,O,r),k=t.memoizedState),(h=oo||Dp(t,n,h,r,_,k,s))?(T||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,Hl(e,t),s=t.memoizedProps,T=ea(n,s),a.props=T,O=t.pendingProps,_=a.context,k=n.contextType,h=xa,typeof k=="object"&&k!==null&&(h=en(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==O||_!==h)&&Rp(t,a,r,h),oo=!1,_=t.memoizedState,a.state=_,bi(t,r,a,o),gi();var A=t.memoizedState;s!==O||_!==A||oo||e!==null&&e.dependencies!==null&&ts(e.dependencies)?(typeof u=="function"&&(mu(t,n,u,r),A=t.memoizedState),(T=oo||Dp(t,n,T,r,_,A,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,A,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,A,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=A),a.props=r,a.state=A,a.context=h,r=T):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&_===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)):tn(e,t,n,o),t.memoizedState=a.state,e=t.child):e=zr(e,t,o),e}function Jp(e,t,n,r){return Qo(),t.flags|=256,tn(e,t,n,r),t.child}var yu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vu(e){return{baseLanes:e,cachePool:Oc()}}function xu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Nn),e}function Zp(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:(Mt.current&2)!==0),s&&(o=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(o?so(t):lo(),(e=vt)?(e=sf(e,Gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:eo!==null?{id:hr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},n=Tc(e),n.return=t,t.child=n,Yt=t,vt=null)):e=null,e===null)throw no(t);return nd(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(lo(),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=vu(n),r.childLanes=xu(e,s,n),t.memoizedState=yu,ki(null,r)):(so(t),wu(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(so(t),t.flags&=-257,t=ku(e,t,n)):t.memoizedState!==null?(lo(),t.child=e.child,t.flags|=128,t=null):(lo(),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=vu(n),r.childLanes=xu(e,s,n),t.memoizedState=yu,t=ki(null,r));else if(so(t),nd(u)){if(s=u.nextSibling&&u.nextSibling.dataset,s)var k=s.dgst;s=k,r=Error(c(419)),r.stack="",r.digest=s,di({value:r,source:null,stack:null}),t=ku(e,t,n)}else if($t||Sa(e,t,n,!1),s=(n&e.childLanes)!==0,$t||s){if(s=ft,s!==null&&(r=ur(s,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Ho(e,r),_n(s,e,r),gu;td(u)||Ms(),t=ku(e,t,n)}else td(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,vt=Xn(u.nextSibling),Yt=t,Je=!0,to=null,Gn=!1,e!==null&&Nc(t,e),t=wu(t,r.children),t.flags|=4096);return t}return o?(lo(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=_r(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=_r(k,u):(u=Vo(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,ki(null,r),r=t.child,u=e.child.memoizedState,u===null?u=vu(n):(o=u.cachePool,o!==null?(h=Rt._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Oc(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=xu(e,s,n),t.memoizedState=yu,ki(e.child,r)):(so(t),n=e.child,e=n.sibling,n=_r(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 wu(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=Mn(22,e,null,t),e.lanes=0,e}function ku(e,t,n){return Zo(t,e.child,null,n),e=wu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ll(e.return,t,n)}function _u(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 em(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var s=Mt.current,u=(s&2)!==0;if(u?(s=s&1|2,t.flags|=128):s&=1,G(Mt,s),tn(e,t,r,n),r=Je?ui:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yp(e,n,t);else if(e.tag===19)Yp(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),_u(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}_u(t,!0,n,null,a,r);break;case"together":_u(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function zr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),po|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Sa(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=_r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Su(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ts(e)))}function Kg(e,t,n){switch(t.tag){case 3:Xe(t,t.stateNode.containerInfo),ro(t,Rt,e.memoizedState.cache),Qo();break;case 27:case 5:Ne(t);break;case 4:Xe(t,t.stateNode.containerInfo);break;case 10:ro(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?(so(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Zp(e,t,n):(so(t),e=zr(e,t,n),e!==null?e.sibling:null);so(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Sa(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return em(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Mt,Mt.current),r)break;return null;case 22:return t.lanes=0,Qp(e,t,n,t.pendingProps);case 24:ro(t,Rt,e.memoizedState.cache)}return zr(e,t,n)}function tm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$t=!0;else{if(!Su(e,n)&&(t.flags&128)===0)return $t=!1,Kg(e,t,n);$t=(e.flags&131072)!==0}else $t=!1,Je&&(t.flags&1048576)!==0&&jc(t,ui,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")zl(e)?(r=ea(e,r),t.tag=1,t=Xp(null,t,e,r,n)):(t.tag=0,t=bu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ae){t.tag=11,t=Bp(null,t,e,r,n);break e}else if(o===U){t.tag=14,t=Hp(null,t,e,r,n);break e}}throw t=ye(e)||e,Error(c(306,t,""))}}return t;case 0:return bu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=ea(r,t.pendingProps),Xp(e,t,r,o,n);case 3:e:{if(Xe(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Hl(e,t),bi(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ro(t,Rt,r),r!==a.cache&&$l(t,[Rt],n,!0),gi(),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=Jp(e,t,r,n);break e}else if(r!==o){o=Qn(Error(c(424)),t),di(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),Yt=t,Je=!0,to=null,Gn=!0,n=Qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Qo(),r===o){t=zr(e,t,n);break e}tn(e,t,r,n)}t=t.child}return t;case 26:return xs(e,t),e===null?(n=mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(n=t.type,e=t.pendingProps,r=Ls(be.current).createElement(n),r[_t]=t,r[Vt]=e,nn(r,n,e),et(r),t.stateNode=r):t.memoizedState=mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&Je&&(r=t.stateNode=df(t.type,t.pendingProps,be.current),Yt=t,Gn=!0,o=vt,bo(t.type)?(rd=o,vt=Xn(r.firstChild)):vt=o),tn(e,t,t.pendingProps.children,n),xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((o=r=vt)&&(r=_0(r,t.type,t.pendingProps,Gn),r!==null?(t.stateNode=r,Yt=t,vt=Xn(r.firstChild),Gn=!1,o=!0):o=!1),o||no(t)),Ne(t),o=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,r=a.children,Zu(o,a)?r=null:s!==null&&Zu(o,s)&&(t.flags|=32),t.memoizedState!==null&&(o=Jl(e,t,$g,null,null,n),Li._currentValue=o),xs(e,t),tn(e,t,r,n),t.child;case 6:return e===null&&Je&&((e=n=vt)&&(n=S0(n,t.pendingProps,Gn),n!==null?(t.stateNode=n,Yt=t,vt=null,e=!0):e=!1),e||no(t)),null;case 13:return Zp(e,t,n);case 4:return Xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zo(t,null,r,n):tn(e,t,r,n),t.child;case 11:return Bp(e,t,t.type,t.pendingProps,n);case 7:return tn(e,t,t.pendingProps,n),t.child;case 8:return tn(e,t,t.pendingProps.children,n),t.child;case 12:return tn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ro(t,t.type,r.value),tn(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,qo(t),o=en(o),r=r(o),t.flags|=1,tn(e,t,r,n),t.child;case 14:return Hp(e,t,t.type,t.pendingProps,n);case 15:return Vp(e,t,t.type,t.pendingProps,n);case 19:return em(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=en(Rt),e===null?(o=Wl(),o===null&&(o=ft,a=Fl(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Bl(t),ro(t,Rt,o)):((e.lanes&n)!==0&&(Hl(e,t),bi(t,null,null,n),gi()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),ro(t,Rt,r)):(r=a.cache,ro(t,Rt,r),r!==o.cache&&$l(t,[Rt],n,!0))),tn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Mr(e){e.flags|=4}function Cu(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 Jo=as,Ul}else e.flags&=-16777217}function nm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yf(t))if(Pm())e.flags|=8192;else throw Jo=as,Ul}function ks(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vr():536870912,e.lanes|=t,Ra|=t)}function _i(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 qg(e,t,n){var r=t.pendingProps;switch(jl(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),Er(Rt),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_a(t)?Mr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dl())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Mr(t),a!==null?(xt(t),nm(t,a)):(xt(t),Cu(t,o,null,r,n))):a?a!==e.memoizedState?(Mr(t),xt(t),nm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Mr(t),xt(t),Cu(t,o,e,r,n)),null;case 27:if(Ot(t),n=be.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=te.current,_a(t)?Dc(t):(e=df(o,r,n),t.stateNode=e,Mr(t))}return xt(t),null;case 5:if(Ot(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(a=te.current,_a(t))Dc(t);else{var s=Ls(be.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[_t]=t,a[Vt]=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(nn(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&&Mr(t)}}return xt(t),Cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=be.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=Yt,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Zm(e.nodeValue,n)),e||no(t,!0)}else e=Ls(e).createTextNode(r),e[_t]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=_a(t),n!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[_t]=t}else Qo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Dl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(In(t),t):(In(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=_a(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[_t]=t}else Qo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Dl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(In(t),t):(In(t),null)}return In(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 ve(),e===null&&Ku(t.stateNode.containerInfo),xt(t),null;case 10:return Er(t.type),xt(t),null;case 19:if(z(Mt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)_i(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,_i(r,!1),e=a.updateQueue,t.updateQueue=e,ks(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mc(n,e),n=n.sibling;return G(Mt,Mt.current&1|2),Je&&Sr(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Fe()>As&&(t.flags|=128,o=!0,_i(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),_i(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Je)return xt(t),null}else 2*Fe()-r.renderingStartTime>As&&n!==536870912&&(t.flags|=128,o=!0,_i(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=Fe(),e.sibling=null,n=Mt.current,G(Mt,o?n&1|2:n&1),Je&&Sr(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return In(t),ql(),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&&z(Go),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Er(Rt),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Gg(e,t){switch(jl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Er(Rt),ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ot(t),null;case 31:if(t.memoizedState!==null){if(In(t),t.alternate===null)throw Error(c(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(In(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(Mt),null;case 4:return ve(),null;case 10:return Er(t.type),null;case 22:case 23:return In(t),ql(),e!==null&&z(Go),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Er(Rt),null;case 25:return null;default:return null}}function rm(e,t){switch(jl(t),t.tag){case 3:Er(Rt),ve();break;case 26:case 27:case 5:Ot(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&In(t);break;case 13:In(t);break;case 19:z(Mt);break;case 10:Er(t.type);break;case 22:case 23:In(t),ql(),e!==null&&z(Go);break;case 24:Er(Rt)}}function Si(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){ut(t,t.return,u)}}function uo(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(T){ut(o,h,T)}}}r=r.next}while(r!==a)}}catch(T){ut(t,t.return,T)}}function om(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qc(t,n)}catch(r){ut(e,e.return,r)}}}function am(e,t,n){n.props=ea(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function Ci(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 br(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 im(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){ut(e,e.return,o)}}function Eu(e,t,n){try{var r=e.stateNode;b0(r,e.type,n,t),r[Vt]=t}catch(o){ut(e,e.return,o)}}function sm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bo(e.type)||e.tag===4}function Au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sm(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&&bo(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=Wn));else if(r!==4&&(r===27&&bo(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&&bo(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 lm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);nn(t,r,n),t[_t]=e,t[Vt]=n}catch(a){ut(e,e.return,a)}}var Tr=!1,Ft=!1,zu=!1,um=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Xg(e,t){if(e=e.containerInfo,Xu=Hs,e=wc(e),kl(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,T=0,O=e,_=null;t:for(;;){for(var A;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),(A=O.firstChild)!==null;)_=O,O=A;for(;;){if(O===e)break t;if(_===n&&++k===o&&(u=s),_===a&&++T===r&&(h=s),(A=O.nextSibling)!==null)break;O=_,_=O.parentNode}O=A}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},Hs=!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 ue=ea(n.type,o);e=r.getSnapshotBeforeUpdate(ue,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){ut(n,n.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ed(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ed(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 dm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:jr(e,n),r&4&&Si(5,n);break;case 1:if(jr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){ut(n,n.return,s)}else{var o=ea(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){ut(n,n.return,s)}}r&64&&om(n),r&512&&Ci(n,n.return);break;case 3:if(jr(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{qc(e,t)}catch(s){ut(n,n.return,s)}}break;case 27:t===null&&r&4&&lm(n);case 26:case 5:jr(e,n),t===null&&r&4&&im(n),r&512&&Ci(n,n.return);break;case 12:jr(e,n);break;case 31:jr(e,n),r&4&&mm(e,n);break;case 13:jr(e,n),r&4&&fm(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||Tr,!r){t=t!==null&&t.memoizedState!==null||Ft,o=Tr;var a=Ft;Tr=r,(Ft=t)&&!a?Nr(e,n,(n.subtreeFlags&8772)!==0):jr(e,n),Tr=o,Ft=a}break;case 30:break;default:jr(e,n)}}function cm(e){var t=e.alternate;t!==null&&(e.alternate=null,cm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&To(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,vn=!1;function Ir(e,t,n){for(n=n.child;n!==null;)pm(e,t,n),n=n.sibling}function pm(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Ft||br(n,t),Ir(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ft||br(n,t);var r=kt,o=vn;bo(n.type)&&(kt=n.stateNode,vn=!1),Ir(e,t,n),Ni(n.stateNode),kt=r,vn=o;break;case 5:Ft||br(n,t);case 6:if(r=kt,o=vn,kt=null,Ir(e,t,n),kt=r,vn=o,kt!==null)if(vn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(n.stateNode)}catch(a){ut(n,t,a)}else try{kt.removeChild(n.stateNode)}catch(a){ut(n,t,a)}break;case 18:kt!==null&&(vn?(e=kt,of(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ha(e)):of(kt,n.stateNode));break;case 4:r=kt,o=vn,kt=n.stateNode.containerInfo,vn=!0,Ir(e,t,n),kt=r,vn=o;break;case 0:case 11:case 14:case 15:uo(2,n,t),Ft||uo(4,n,t),Ir(e,t,n);break;case 1:Ft||(br(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&am(n,t,r)),Ir(e,t,n);break;case 21:Ir(e,t,n);break;case 22:Ft=(r=Ft)||n.memoizedState!==null,Ir(e,t,n),Ft=r;break;default:Ir(e,t,n)}}function mm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ha(e)}catch(n){ut(t,t.return,n)}}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ha(e)}catch(n){ut(t,t.return,n)}}function Jg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new um),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new um),t;default:throw Error(c(435,e.tag))}}function Ss(e,t){var n=Jg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=i0.bind(null,e,r);r.then(o,o)}})}function xn(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(bo(u.type)){kt=u.stateNode,vn=!1;break e}break;case 5:kt=u.stateNode,vn=!1;break e;case 3:case 4:kt=u.stateNode.containerInfo,vn=!0;break e}u=u.return}if(kt===null)throw Error(c(160));pm(a,s,o),kt=null,vn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hm(t,e),t=t.sibling}var ir=null;function hm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xn(t,e),wn(e),r&4&&(uo(3,e,e.return),Si(3,e),uo(5,e,e.return));break;case 1:xn(t,e),wn(e),r&512&&(Ft||n===null||br(n,n.return)),r&64&&Tr&&(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=ir;if(xn(t,e),wn(e),r&512&&(Ft||n===null||br(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[Mo]||a[_t]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),nn(a,r,n),a[_t]=e,et(a),r=a;break e;case"link":var s=gf("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),nn(a,r,n),o.head.appendChild(a);break;case"meta":if(s=gf("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),nn(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[_t]=e,et(a),r=a}e.stateNode=r}else bf(o,e.type,e.stateNode);else e.stateNode=hf(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?bf(o,e.type,e.stateNode):hf(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Eu(e,e.memoizedProps,n.memoizedProps)}break;case 27:xn(t,e),wn(e),r&512&&(Ft||n===null||br(n,n.return)),n!==null&&r&4&&Eu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xn(t,e),wn(e),r&512&&(Ft||n===null||br(n,n.return)),e.flags&32){o=e.stateNode;try{bn(o,"")}catch(ue){ut(e,e.return,ue)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Eu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(zu=!0);break;case 6:if(xn(t,e),wn(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ue){ut(e,e.return,ue)}}break;case 3:if(Os=null,o=ir,ir=$s(t.containerInfo),xn(t,e),ir=o,wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ha(t.containerInfo)}catch(ue){ut(e,e.return,ue)}zu&&(zu=!1,gm(e));break;case 4:r=ir,ir=$s(e.stateNode.containerInfo),xn(t,e),wn(e),ir=r;break;case 12:xn(t,e),wn(e);break;case 31:xn(t,e),wn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 13:xn(t,e),wn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Es=Fe()),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=Tr,T=Ft;if(Tr=k||o,Ft=T||h,xn(t,e),Ft=T,Tr=k,wn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Tr||Ft||ta(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,_=O!=null&&O.hasOwnProperty("display")?O.display:null;u.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===18){if(n===null){h=t;try{var A=h.stateNode;o?af(A,!0):af(h.stateNode,!1)}catch(ue){ut(h,h.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ss(e,n))));break;case 19:xn(t,e),wn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 30:break;case 21:break;default:xn(t,e),wn(e)}}function wn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(sm(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 s=n.stateNode;n.flags&32&&(bn(s,""),n.flags&=-33);var u=Au(e);_s(e,u,s);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Au(e);Pu(e,k,h);break;default:throw Error(c(161))}}catch(T){ut(e,e.return,T)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dm(e,t.alternate,t),t=t.sibling}function ta(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:uo(4,t,t.return),ta(t);break;case 1:br(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&am(t,t.return,n),ta(t);break;case 27:Ni(t.stateNode);case 26:case 5:br(t,t.return),ta(t);break;case 22:t.memoizedState===null&&ta(t);break;case 30:ta(t);break;default:ta(t)}e=e.sibling}}function Nr(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:Nr(o,a,n),Si(4,a);break;case 1:if(Nr(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&&s&64&&om(a),Ci(a,a.return);break;case 27:lm(a);case 26:case 5:Nr(o,a,n),n&&r===null&&s&4&&im(a),Ci(a,a.return);break;case 12:Nr(o,a,n);break;case 31:Nr(o,a,n),n&&s&4&&mm(o,a);break;case 13:Nr(o,a,n),n&&s&4&&fm(o,a);break;case 22:a.memoizedState===null&&Nr(o,a,n),Ci(a,a.return);break;case 30:break;default:Nr(o,a,n)}t=t.sibling}}function Mu(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&&ci(n))}function Tu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ci(e))}function sr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bm(e,t,n,r),t=t.sibling}function bm(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:sr(e,t,n,r),o&2048&&Si(9,t);break;case 1:sr(e,t,n,r);break;case 3:sr(e,t,n,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ci(e)));break;case 12:if(o&2048){sr(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){ut(t,t.return,h)}}else sr(e,t,n,r);break;case 31:sr(e,t,n,r);break;case 13:sr(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,t.memoizedState!==null?a._visibility&2?sr(e,t,n,r):Ei(e,t):a._visibility&2?sr(e,t,n,r):(a._visibility|=2,ja(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Mu(s,t);break;case 24:sr(e,t,n,r),o&2048&&Tu(t.alternate,t);break;default:sr(e,t,n,r)}}function ja(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:ja(a,s,u,h,o),Si(8,s);break;case 23:break;case 22:var T=s.stateNode;s.memoizedState!==null?T._visibility&2?ja(a,s,u,h,o):Ei(a,s):(T._visibility|=2,ja(a,s,u,h,o)),o&&k&2048&&Mu(s.alternate,s);break;case 24:ja(a,s,u,h,o),o&&k&2048&&Tu(s.alternate,s);break;default:ja(a,s,u,h,o)}t=t.sibling}}function Ei(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:Ei(n,r),o&2048&&Mu(r.alternate,r);break;case 24:Ei(n,r),o&2048&&Tu(r.alternate,r);break;default:Ei(n,r)}t=t.sibling}}var Ai=8192;function Na(e,t,n){if(e.subtreeFlags&Ai)for(e=e.child;e!==null;)ym(e,t,n),e=e.sibling}function ym(e,t,n){switch(e.tag){case 26:Na(e,t,n),e.flags&Ai&&e.memoizedState!==null&&L0(n,ir,e.memoizedState,e.memoizedProps);break;case 5:Na(e,t,n);break;case 3:case 4:var r=ir;ir=$s(e.stateNode.containerInfo),Na(e,t,n),ir=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ai,Ai=16777216,Na(e,t,n),Ai=r):Na(e,t,n));break;default:Na(e,t,n)}}function vm(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 Pi(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,wm(r,e)}vm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xm(e),e=e.sibling}function xm(e){switch(e.tag){case 0:case 11:case 15:Pi(e),e.flags&2048&&uo(9,e,e.return);break;case 3:Pi(e);break;case 12:Pi(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)):Pi(e);break;default:Pi(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];qt=r,wm(r,e)}vm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:uo(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 wm(e,t){for(;qt!==null;){var n=qt;switch(n.tag){case 0:case 11:case 15:uo(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:ci(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(cm(r),r===n){qt=null;break e}if(o!==null){o.return=a,qt=o;break e}qt=a}}}var Zg={getCacheForType:function(e){var t=en(Rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return en(Rt).controller.signal}},Yg=typeof WeakMap=="function"?WeakMap:Map,ot=0,ft=null,Ve=null,qe=0,lt=0,jn=null,co=!1,Da=!1,Iu=!1,Dr=0,Pt=0,po=0,na=0,ju=0,Nn=0,Ra=0,zi=null,kn=null,Nu=!1,Es=0,km=0,As=1/0,Ps=null,mo=null,Ht=0,fo=null,La=null,Rr=0,Du=0,Ru=null,_m=null,Mi=0,Lu=null;function Dn(){return(ot&2)!==0&&qe!==0?qe&-qe:C.T!==null?Bu():Br()}function Sm(){if(Nn===0)if((qe&536870912)===0||Je){var e=on;on<<=1,(on&3932160)===0&&(on=262144),Nn=e}else Nn=536870912;return e=Tn.current,e!==null&&(e.flags|=32),Nn}function _n(e,t,n){(e===ft&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&($a(e,0),ho(e,qe,Nn,!1)),er(e,n),((ot&2)===0||e!==ft)&&(e===ft&&((ot&2)===0&&(na|=n),Pt===4&&ho(e,qe,Nn,!1)),yr(e))}function Cm(e,t,n){if((ot&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||He(e,t),o=r?n0(e,t):Fu(e,t,!0),a=r;do{if(o===0){Da&&!r&&ho(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!e0(n)){o=Fu(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&&($a(u,s).flags|=256),s=Fu(u,s,!1),s!==2){if(Iu&&!h){u.errorRecoveryDisabledLanes|=a,na|=a,o=4;break e}a=kn,kn=o,a!==null&&(kn===null?kn=a:kn.push.apply(kn,a))}o=s}if(a=!1,o!==2)continue}}if(o===1){$a(e,0),ho(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:ho(r,t,Nn,!co);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Es+300-Fe(),10<o)){if(ho(r,t,Nn,!co),xe(r,0,!0)!==0)break e;Rr=t,r.timeoutHandle=nf(Em.bind(null,r,n,kn,Ps,Nu,t,Nn,na,Ra,co,a,"Throttled",-0,0),o);break e}Em(r,n,kn,Ps,Nu,t,Nn,na,Ra,co,a,null,-0,0)}}break}while(!0);yr(e)}function Em(e,t,n,r,o,a,s,u,h,k,T,O,_,A){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wn},ym(t,a,O);var ue=(a&62914560)===a?Es-Fe():(a&4194048)===a?km-Fe():0;if(ue=$0(O,ue),ue!==null){Rr=a,e.cancelPendingCommit=ue(Nm.bind(null,e,t,a,n,r,o,s,u,h,T,O,null,_,A)),ho(e,a,s,!k);return}}Nm(e,t,a,n,r,o,s,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(!zn(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 ho(e,t,n,r){t&=~ju,t&=~na,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-Te(o),s=1<<a;r[a]=-1,o&=~s}n!==0&&aa(e,n,t)}function zs(){return(ot&6)===0?(Ti(0),!1):!0}function $u(){if(Ve!==null){if(lt===0)var e=Ve.return;else e=Ve,Cr=Ko=null,eu(e),Pa=null,mi=0,e=Ve;for(;e!==null;)rm(e.alternate,e),e=e.return;Ve=null}}function $a(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,x0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Rr=0,$u(),ft=e,Ve=n=_r(e.current,null),qe=t,lt=0,jn=null,co=!1,Da=He(e,t),Iu=!1,Ra=Nn=ju=na=po=Pt=0,kn=zi=null,Nu=!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-Te(r),a=1<<o;t|=e[o],r&=~a}return Dr=t,Xi(),n}function Am(e,t){je=null,C.H=wi,t===Aa||t===os?(t=Bc(),lt=3):t===Ul?(t=Bc(),lt=4):lt=t===gu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jn=t,Ve===null&&(Pt=1,ys(e,Qn(t,e.current)))}function Pm(){var e=Tn.current;return e===null?!0:(qe&4194048)===qe?ar===null:(qe&62914560)===qe||(qe&536870912)!==0?e===ar:!1}function zm(){var e=C.H;return C.H=wi,e===null?wi:e}function Mm(){var e=C.A;return C.A=Zg,e}function Ms(){Pt=4,co||(qe&4194048)!==qe&&Tn.current!==null||(Da=!0),(po&134217727)===0&&(na&134217727)===0||ft===null||ho(ft,qe,Nn,!1)}function Fu(e,t,n){var r=ot;ot|=2;var o=zm(),a=Mm();(ft!==e||qe!==t)&&(Ps=null,$a(e,t)),t=!1;var s=Pt;e:do try{if(lt!==0&&Ve!==null){var u=Ve,h=jn;switch(lt){case 8:$u(),s=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var k=lt;if(lt=0,jn=null,Fa(e,u,h,k),n&&Da){s=0;break e}break;default:k=lt,lt=0,jn=null,Fa(e,u,h,k)}}t0(),s=Pt;break}catch(T){Am(e,T)}while(!0);return t&&e.shellSuspendCounter++,Cr=Ko=null,ot=r,C.H=o,C.A=a,Ve===null&&(ft=null,qe=0,Xi()),s}function t0(){for(;Ve!==null;)Tm(Ve)}function n0(e,t){var n=ot;ot|=2;var r=zm(),o=Mm();ft!==e||qe!==t?(Ps=null,As=Fe()+500,$a(e,t)):Da=He(e,t);e:do try{if(lt!==0&&Ve!==null){t=Ve;var a=jn;t:switch(lt){case 1:lt=0,jn=null,Fa(e,t,a,1);break;case 2:case 9:if(Wc(a)){lt=0,jn=null,Im(t);break}t=function(){lt!==2&<!==9||ft!==e||(lt=7),yr(e)},a.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Wc(a)?(lt=0,jn=null,Im(t)):(lt=0,jn=null,Fa(e,t,a,7));break;case 5:var s=null;switch(Ve.tag){case 26:s=Ve.memoizedState;case 5:case 27:var u=Ve;if(s?yf(s):u.stateNode.complete){lt=0,jn=null;var h=u.sibling;if(h!==null)Ve=h;else{var k=u.return;k!==null?(Ve=k,Ts(k)):Ve=null}break t}}lt=0,jn=null,Fa(e,t,a,5);break;case 6:lt=0,jn=null,Fa(e,t,a,6);break;case 8:$u(),Pt=6;break e;default:throw Error(c(462))}}r0();break}catch(T){Am(e,T)}while(!0);return Cr=Ko=null,C.H=r,C.A=o,ot=n,Ve!==null?0:(ft=null,qe=0,Xi(),Pt)}function r0(){for(;Ve!==null&&!Q();)Tm(Ve)}function Tm(e){var t=tm(e.alternate,e,Dr);e.memoizedProps=e.pendingProps,t===null?Ts(e):Ve=t}function Im(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gp(n,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Gp(n,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:eu(t);default:rm(n,t),t=Ve=Mc(t,Dr),t=tm(n,t,Dr)}e.memoizedProps=e.pendingProps,t===null?Ts(e):Ve=t}function Fa(e,t,n,r){Cr=Ko=null,eu(t),Pa=null,mi=0;var o=t.return;try{if(Vg(e,o,t,n,qe)){Pt=1,ys(e,Qn(n,e.current)),Ve=null;return}}catch(a){if(o!==null)throw Ve=o,a;Pt=1,ys(e,Qn(n,e.current)),Ve=null;return}t.flags&32768?(Je||r===1?e=!0:Da||(qe&536870912)!==0?e=!1:(co=e=!0,(r===2||r===9||r===3||r===6)&&(r=Tn.current,r!==null&&r.tag===13&&(r.flags|=16384))),jm(t,e)):Ts(t)}function Ts(e){var t=e;do{if((t.flags&32768)!==0){jm(t,co);return}e=t.return;var n=qg(t.alternate,t,Dr);if(n!==null){Ve=n;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Pt===0&&(Pt=5)}function jm(e,t){do{var n=Gg(e.alternate,e);if(n!==null){n.flags&=32767,Ve=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=n}while(e!==null);Pt=6,Ve=null}function Nm(e,t,n,r,o,a,s,u,h){e.cancelPendingCommit=null;do Is();while(Ht!==0);if((ot&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,Ur(e,n,a,s,u,h),e===ft&&(Ve=ft=null,qe=0),La=t,fo=e,Rr=n,Du=a,Ru=o,_m=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,s0(It,function(){return Fm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,o=H.p,H.p=2,s=ot,ot|=4;try{Xg(e,t,n)}finally{ot=s,H.p=o,C.T=r}}Ht=1,Dm(),Rm(),Lm()}}function Dm(){if(Ht===1){Ht=0;var e=fo,t=La,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=H.p;H.p=2;var o=ot;ot|=4;try{hm(t,e);var a=Ju,s=wc(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(s!==u&&u&&u.ownerDocument&&xc(u.ownerDocument.documentElement,u)){if(h!==null&&kl(u)){var k=h.start,T=h.end;if(T===void 0&&(T=k),"selectionStart"in u)u.selectionStart=k,u.selectionEnd=Math.min(T,u.value.length);else{var O=u.ownerDocument||document,_=O&&O.defaultView||window;if(_.getSelection){var A=_.getSelection(),ue=u.textContent.length,Ce=Math.min(h.start,ue),mt=h.end===void 0?Ce:Math.min(h.end,ue);!A.extend&&Ce>mt&&(s=mt,mt=Ce,Ce=s);var b=vc(u,Ce),g=vc(u,mt);if(b&&g&&(A.rangeCount!==1||A.anchorNode!==b.node||A.anchorOffset!==b.offset||A.focusNode!==g.node||A.focusOffset!==g.offset)){var w=O.createRange();w.setStart(b.node,b.offset),A.removeAllRanges(),Ce>mt?(A.addRange(w),A.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),A.addRange(w))}}}}for(O=[],A=u;A=A.parentNode;)A.nodeType===1&&O.push({element:A,left:A.scrollLeft,top:A.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}}Hs=!!Xu,Ju=Xu=null}finally{ot=o,H.p=r,C.T=n}}e.current=t,Ht=2}}function Rm(){if(Ht===2){Ht=0;var e=fo,t=La,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=H.p;H.p=2;var o=ot;ot|=4;try{dm(e,t.alternate,t)}finally{ot=o,H.p=r,C.T=n}}Ht=3}}function Lm(){if(Ht===4||Ht===3){Ht=0,Oe();var e=fo,t=La,n=Rr,r=_m;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ht=5:(Ht=0,La=fo=null,$m(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(mo=null),Po(n),t=t.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,o=H.p,H.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,H.p=o}}(Rr&3)!==0&&Is(),yr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Lu?Mi++:(Mi=0,Lu=e):Mi=0,Ti(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ci(t)))}function Is(){return Dm(),Rm(),Lm(),Fm()}function Fm(){if(Ht!==5)return!1;var e=fo,t=Du;Du=0;var n=Po(Rr),r=C.T,o=H.p;try{H.p=32>n?32:n,C.T=null,n=Ru,Ru=null;var a=fo,s=Rr;if(Ht=0,La=fo=null,Rr=0,(ot&6)!==0)throw Error(c(331));var u=ot;if(ot|=4,xm(a.current),bm(a,a.current,s,n),ot=u,Ti(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{H.p=o,C.T=r,$m(e,t)}}function Om(e,t,n){t=Qn(n,t),t=hu(e.stateNode,t,2),e=io(e,t,2),e!==null&&(er(e,2),yr(e))}function ut(e,t,n){if(e.tag===3)Om(e,e,n);else for(;t!==null;){if(t.tag===3){Om(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mo===null||!mo.has(r))){e=Qn(n,e),n=Wp(2),r=io(t,n,2),r!==null&&(Up(n,r,t,e),er(r,2),yr(r));break}}t=t.return}}function Ou(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)||(Iu=!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&&(qe&n)===n&&(Pt===4||Pt===3&&(qe&62914560)===qe&&300>Fe()-Es?(ot&2)===0&&$a(e,0):ju|=n,Ra===qe&&(Ra=0)),yr(e)}function Wm(e,t){t===0&&(t=vr()),e=Ho(e,t),e!==null&&(er(e,t),yr(e))}function a0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wm(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),Wm(e,n)}function s0(e,t){return K(e,t)}var js=null,Oa=null,Wu=!1,Ns=!1,Uu=!1,go=0;function yr(e){e!==Oa&&e.next===null&&(Oa===null?js=Oa=e:Oa=Oa.next=e),Ns=!0,Wu||(Wu=!0,u0())}function Ti(e,t){if(!Uu&&Ns){Uu=!0;do for(var n=!1,r=js;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-Te(42|e)+1)-1,a&=o&~(s&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Vm(r,a))}else a=qe,a=xe(r,r===ft?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||He(r,a)||(n=!0,Vm(r,a));r=r.next}while(n);Uu=!1}}function l0(){Um()}function Um(){Ns=Wu=!1;var e=0;go!==0&&v0()&&(e=go);for(var t=Fe(),n=null,r=js;r!==null;){var o=r.next,a=Bm(r,t);a===0?(r.next=null,n===null?js=o:n.next=o,o===null&&(Oa=n)):(n=r,(e!==0||(a&3)!==0)&&(Ns=!0)),r=o}Ht!==0&&Ht!==5||Ti(e),go!==0&&(go=0)}function Bm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var s=31-Te(a),u=1<<s,h=o[s];h===-1?((u&n)===0||(u&r)!==0)&&(o[s]=$n(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=ft,n=qe,n=xe(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&&Le(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),Po(n)){case 2:case 8:n=at;break;case 32:n=It;break;case 268435456:n=ln;break;default:n=It}return r=Hm.bind(null,e),n=K(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Hm(e,t){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Is()&&e.callbackNode!==n)return null;var r=qe;return r=xe(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Cm(e,r,t),Bm(e,Fe()),e.callbackNode!=null&&e.callbackNode===n?Hm.bind(null,e):null)}function Vm(e,t){if(Is())return null;Cm(e,t,!0)}function u0(){w0(function(){(ot&6)!==0?K(fn,l0):Um()})}function Bu(){if(go===0){var e=Ca;e===0&&(e=ce,ce<<=1,(ce&261888)===0&&(ce=256)),go=e}return go}function Qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:kr(""+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[Vt]||null).action),s=r.submitter;s&&(t=(t=s[Vt]||null)?Qm(t.formAction):s.getAttribute("formAction"),t!==null&&(a=t,s=null));var u=new Fo("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(go!==0){var h=s?Km(o,s):new FormData(o);uu(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=s?Km(o,s):new FormData(o),uu(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Hu=0;Hu<El.length;Hu++){var Vu=El[Hu],c0=Vu.toLowerCase(),p0=Vu[0].toUpperCase()+Vu.slice(1);or(c0,"on"+p0)}or(Sc,"onAnimationEnd"),or(Cc,"onAnimationIteration"),or(Ec,"onAnimationStart"),or("dblclick","onDoubleClick"),or("focusin","onFocus"),or("focusout","onBlur"),or(Pg,"onTransitionRun"),or(zg,"onTransitionStart"),or(Mg,"onTransitionCancel"),or(Ac,"onTransitionEnd"),An("onMouseEnter",["mouseout","mouseover"]),An("onMouseLeave",["mouseout","mouseover"]),An("onPointerEnter",["pointerout","pointerover"]),An("onPointerLeave",["pointerout","pointerover"]),dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dr("onBeforeInput",["compositionend","keypress","textInput","paste"]),dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),m0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function qm(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(T){Gi(T)}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(T){Gi(T)}o.currentTarget=null,a=h}}}}function Qe(e,t){var n=t[ia];n===void 0&&(n=t[ia]=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,ua.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(Cf(t)){case 2:var o=W0;break;case 8:o=U0;break;default:o=ld}n=o.bind(null,t,n,e),o=void 0,!Nt||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 qu(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=Hr(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}Jr(function(){var k=a,T=fa(n),O=[];e:{var _=Pc.get(e);if(_!==void 0){var A=Fo,ue=e;switch(e){case"keypress":if($o(n)===0)break e;case"keydown":case"keyup":A=$;break;case"focusin":ue="focus",A=ri;break;case"focusout":ue="blur",A=ri;break;case"beforeblur":case"afterblur":A=ri;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":A=ga;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":A=fl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":A=Ct;break;case Sc:case Cc:case Ec:A=Hi;break;case Ac:A=$e;break;case"scroll":case"scrollend":A=ni;break;case"wheel":A=wt;break;case"copy":case"cut":case"paste":A=oi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":A=pe;break;case"toggle":case"beforetoggle":A=Ut}var Ce=(t&4)!==0,mt=!Ce&&(e==="scroll"||e==="scrollend"),b=Ce?_!==null?_+"Capture":null:_;Ce=[];for(var g=k,w;g!==null;){var L=g;if(w=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||w===null||b===null||(L=Zr(g,b),L!=null&&Ce.push(ji(g,L,w))),mt)break;g=g.return}0<Ce.length&&(_=new A(_,ue,null,n,T),O.push({event:_,listeners:Ce}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",A=e==="mouseout"||e==="pointerout",_&&n!==tt&&(ue=n.relatedTarget||n.fromElement)&&(Hr(ue)||ue[wr]))break e;if((A||_)&&(_=T.window===T?T:(_=T.ownerDocument)?_.defaultView||_.parentWindow:window,A?(ue=n.relatedTarget||n.toElement,A=k,ue=ue?Hr(ue):null,ue!==null&&(mt=N(ue),Ce=ue.tag,ue!==mt||Ce!==5&&Ce!==27&&Ce!==6)&&(ue=null)):(A=null,ue=k),A!==ue)){if(Ce=ga,L="onMouseLeave",b="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=pe,L="onPointerLeave",b="onPointerEnter",g="pointer"),mt=A==null?_:jt(A),w=ue==null?_:jt(ue),_=new Ce(L,g+"leave",A,n,T),_.target=mt,_.relatedTarget=w,L=null,Hr(T)===k&&(Ce=new Ce(b,g+"enter",ue,n,T),Ce.target=w,Ce.relatedTarget=mt,L=Ce),mt=L,A&&ue)t:{for(Ce=f0,b=A,g=ue,w=0,L=b;L;L=Ce(L))w++;L=0;for(var we=g;we;we=Ce(we))L++;for(;0<w-L;)b=Ce(b),w--;for(;0<L-w;)g=Ce(g),L--;for(;w--;){if(b===g||g!==null&&b===g.alternate){Ce=b;break t}b=Ce(b),g=Ce(g)}Ce=null}else Ce=null;A!==null&&Xm(O,_,A,Ce,!1),ue!==null&&mt!==null&&Xm(O,mt,ue,Ce,!0)}}e:{if(_=k?jt(k):window,A=_.nodeName&&_.nodeName.toLowerCase(),A==="select"||A==="input"&&_.type==="file")var nt=mc;else if(cc(_))if(fc)nt=Cg;else{nt=_g;var ge=kg}else A=_.nodeName,!A||A.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?k&&zt(k.elementType)&&(nt=mc):nt=Sg;if(nt&&(nt=nt(e,k))){pc(O,nt,n,T);break e}ge&&ge(e,_,k),e==="focusout"&&k&&_.type==="number"&&k.memoizedProps.value!=null&&Ya(_,"number",_.value)}switch(ge=k?jt(k):window,e){case"focusin":(cc(ge)||ge.contentEditable==="true")&&(ba=ge,_l=k,li=null);break;case"focusout":li=_l=ba=null;break;case"mousedown":Sl=!0;break;case"contextmenu":case"mouseup":case"dragend":Sl=!1,kc(O,n,T);break;case"selectionchange":if(Ag)break;case"keydown":case"keyup":kc(O,n,T)}var Re;if(Hn)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 Et?yn(e,n)&&(Ge="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ge="onCompositionStart");Ge&&(Ue&&n.locale!=="ko"&&(Et||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Et&&(Re=mr()):(pr=T,an="value"in pr?pr.value:pr.textContent,Et=!0)),ge=Rs(k,Ge),0<ge.length&&(Ge=new Qi(Ge,e,null,n,T),O.push({event:Ge,listeners:ge}),Re?Ge.data=Re:(Re=Bt(n),Re!==null&&(Ge.data=Re)))),(Re=Pe?bt(e,n):Ki(e,n))&&(Ge=Rs(k,"onBeforeInput"),0<Ge.length&&(ge=new Qi("onBeforeInput","beforeinput",null,n,T),O.push({event:ge,listeners:Ge}),ge.data=Re)),d0(O,e,k,n,T)}qm(O,t)})}function ji(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rs(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=Zr(e,n),o!=null&&r.unshift(ji(e,o,a)),o=Zr(e,t),o!=null&&r.push(ji(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 Xm(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=Zr(n,a),k!=null&&s.unshift(ji(n,k,h))):o||(k=Zr(n,a),k!=null&&s.push(ji(n,k,h)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var h0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function Jm(e){return(typeof e=="string"?e:""+e).replace(h0,`
|
|
41
|
-
`).replace(g0,"")}function Zm(e,t){return t=Jm(t),Jm(e)===t}function pt(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||bn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&bn(e,""+r);break;case"className":pa(e,"class",r);break;case"tabIndex":pa(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":pa(e,n,r);break;case"style":Do(e,r,a);break;case"data":if(t!=="object"){pa(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=kr(""+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=kr(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Wn);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=kr(""+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),nr(e,"popover",r);break;case"xlinkActuate":Fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Fn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Fn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Fn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Fn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":nr(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=Gr.get(n)||n,nr(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"?bn(e,r):(typeof r=="number"||typeof r=="bigint")&&bn(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=Wn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ja.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[Vt]||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,""):nr(e,n,r)}}}function nn(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 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":Qe("invalid",e);var u=a=s=o=null,h=null,k=null;for(r in n)if(n.hasOwnProperty(r)){var T=n[r];if(T!=null)switch(r){case"name":o=T;break;case"type":s=T;break;case"checked":h=T;break;case"defaultChecked":k=T;break;case"value":a=T;break;case"defaultValue":u=T;break;case"children":case"dangerouslySetInnerHTML":if(T!=null)throw Error(c(137,t));break;default:pt(e,t,r,T,n,null)}}Za(e,a,u,h,k,s,o,!1);return;case"select":Qe("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?qr(e,!!r,t,!1):n!=null&&qr(e,!!r,n,!0);return;case"textarea":Qe("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)}ma(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":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(r=0;r<Ii.length;r++)Qe(Ii[r],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(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(zt(t)){for(T in n)n.hasOwnProperty(T)&&(r=n[T],r!==void 0&&Gu(e,t,T,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 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,s=null,u=null,h=null,k=null,T=null;for(A in n){var O=n[A];if(n.hasOwnProperty(A)&&O!=null)switch(A){case"checked":break;case"value":break;case"defaultValue":h=O;default:r.hasOwnProperty(A)||pt(e,t,A,null,r,O)}}for(var _ in r){var A=r[_];if(O=n[_],r.hasOwnProperty(_)&&(A!=null||O!=null))switch(_){case"type":a=A;break;case"name":o=A;break;case"checked":k=A;break;case"defaultChecked":T=A;break;case"value":s=A;break;case"defaultValue":u=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(c(137,t));break;default:A!==O&&pt(e,t,_,A,r,O)}}On(e,s,u,h,k,T,a,o);return;case"select":A=s=u=_=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":A=h;default:r.hasOwnProperty(a)||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":_=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=A,_!=null?qr(e,!!n,_,!1):!!r!=!!n&&(t!=null?qr(e,!!n,t,!0):qr(e,!!n,n?[]:"",!1));return;case"textarea":A=_=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":_=o;break;case"defaultValue":A=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)}ei(e,_,A);return;case"option":for(var ue in n)if(_=n[ue],n.hasOwnProperty(ue)&&_!=null&&!r.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:pt(e,t,ue,null,r,_)}for(h in r)if(_=r[h],A=n[h],r.hasOwnProperty(h)&&_!==A&&(_!=null||A!=null))switch(h){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:pt(e,t,h,_,r,A)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in n)_=n[Ce],n.hasOwnProperty(Ce)&&_!=null&&!r.hasOwnProperty(Ce)&&pt(e,t,Ce,null,r,_);for(k in r)if(_=r[k],A=n[k],r.hasOwnProperty(k)&&_!==A&&(_!=null||A!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,t));break;default:pt(e,t,k,_,r,A)}return;default:if(zt(t)){for(var mt in n)_=n[mt],n.hasOwnProperty(mt)&&_!==void 0&&!r.hasOwnProperty(mt)&&Gu(e,t,mt,void 0,r,_);for(T in r)_=r[T],A=n[T],!r.hasOwnProperty(T)||_===A||_===void 0&&A===void 0||Gu(e,t,T,_,r,A);return}}for(var b in n)_=n[b],n.hasOwnProperty(b)&&_!=null&&!r.hasOwnProperty(b)&&pt(e,t,b,null,r,_);for(O in r)_=r[O],A=n[O],!r.hasOwnProperty(O)||_===A||_==null&&A==null||pt(e,t,O,_,r,A)}function Ym(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,s=o.initiatorType,u=o.duration;if(a&&u&&Ym(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 T=h.transferSize,O=h.initiatorType;T&&Ym(O)&&(h=h.responseEnd,s+=T*(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 Xu=null,Ju=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function ef(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 tf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Zu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yu=null;function v0(){var e=window.event;return e&&e.type==="popstate"?e===Yu?!1:(Yu=e,!0):(Yu=null,!1)}var nf=typeof setTimeout=="function"?setTimeout:void 0,x0=typeof clearTimeout=="function"?clearTimeout:void 0,rf=typeof Promise=="function"?Promise:void 0,w0=typeof queueMicrotask=="function"?queueMicrotask:typeof rf<"u"?function(e){return rf.resolve(null).then(e).catch(k0)}:nf;function k0(e){setTimeout(function(){throw e})}function bo(e){return e==="head"}function of(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),Ha(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ni(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ni(n);for(var a=n.firstChild;a;){var s=a.nextSibling,u=a.nodeName;a[Mo]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=s}}else n==="body"&&Ni(e.ownerDocument.body);n=o}while(n);Ha(t)}function af(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 ed(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":ed(n),To(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[Mo])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 sf(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 td(e){return e.data==="$?"||e.data==="$~"}function nd(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 rd=null;function lf(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 uf(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 df(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 Ni(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);To(e)}var Jn=new Map,cf=new Set;function $s(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Lr=H.d;H.d={f:E0,r:A0,D:P0,C:z0,L:M0,m:T0,X:j0,S:I0,M:N0};function E0(){var e=Lr.f(),t=zs();return e||t}function A0(e){var t=Jt(e);t!==null&&t.tag===5&&t.type==="form"?Ap(t):Lr.r(e)}var Wa=typeof document>"u"?null:document;function pf(e,t,n){var r=Wa;if(r&&typeof t=="string"&&t){var o=gn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),cf.has(o)||(cf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),nn(t,"link",e),et(t),r.head.appendChild(t)))}}function P0(e){Lr.D(e),pf("dns-prefetch",e,null)}function z0(e,t){Lr.C(e,t),pf("preconnect",e,t)}function M0(e,t,n){Lr.L(e,t,n);var r=Wa;if(r&&e&&t){var o='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+gn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+gn(n.imageSizes)+'"]')):o+='[href="'+gn(e)+'"]';var a=o;switch(t){case"style":a=Ua(e);break;case"script":a=Ba(e)}Jn.has(a)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Jn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(Di(a))||t==="script"&&r.querySelector(Ri(a))||(t=r.createElement("link"),nn(t,"link",e),et(t),r.head.appendChild(t)))}}function T0(e,t){Lr.m(e,t);var n=Wa;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+gn(r)+'"][href="'+gn(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Ba(e)}if(!Jn.has(a)&&(e=E({rel:"modulepreload",href:e},t),Jn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ri(a)))return}r=n.createElement("link"),nn(r,"link",e),et(r),n.head.appendChild(r)}}}function I0(e,t,n){Lr.S(e,t,n);var r=Wa;if(r&&e){var o=Vr(r).hoistableStyles,a=Ua(e);t=t||"default";var s=o.get(a);if(!s){var u={loading:0,preload:null};if(s=r.querySelector(Di(a)))u.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Jn.get(a))&&od(e,n);var h=s=r.createElement("link");et(h),nn(h,"link",e),h._p=new Promise(function(k,T){h.onload=k,h.onerror=T}),h.addEventListener("load",function(){u.loading|=1}),h.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Fs(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:u},o.set(a,s)}}}function j0(e,t){Lr.X(e,t);var n=Wa;if(n&&e){var r=Vr(n).hoistableScripts,o=Ba(e),a=r.get(o);a||(a=n.querySelector(Ri(o)),a||(e=E({src:e,async:!0},t),(t=Jn.get(o))&&ad(e,t),a=n.createElement("script"),et(a),nn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function N0(e,t){Lr.M(e,t);var n=Wa;if(n&&e){var r=Vr(n).hoistableScripts,o=Ba(e),a=r.get(o);a||(a=n.querySelector(Ri(o)),a||(e=E({src:e,async:!0,type:"module"},t),(t=Jn.get(o))&&ad(e,t),a=n.createElement("script"),et(a),nn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function mf(e,t,n,r){var o=(o=be.current)?$s(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=Ua(n.href),n=Vr(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=Ua(n.href);var a=Vr(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(Di(e)))&&!a._p&&(s.instance=a,s.state.loading=5),Jn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Jn.set(e,n),a||D0(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=Ba(n),n=Vr(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 Ua(e){return'href="'+gn(e)+'"'}function Di(e){return'link[rel="stylesheet"]['+e+"]"}function ff(e){return E({},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}),nn(t,"link",n),et(t),e.head.appendChild(t))}function Ba(e){return'[src="'+gn(e)+'"]'}function Ri(e){return"script[async]"+e}function hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+gn(n.href)+'"]');if(r)return t.instance=r,et(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"),et(r),nn(r,"style",o),Fs(r,n.precedence,e),t.instance=r;case"stylesheet":o=Ua(n.href);var a=e.querySelector(Di(o));if(a)return t.state.loading|=4,t.instance=a,et(a),a;r=ff(n),(o=Jn.get(o))&&od(r,o),a=(e.ownerDocument||e).createElement("link"),et(a);var s=a;return s._p=new Promise(function(u,h){s.onload=u,s.onerror=h}),nn(a,"link",r),t.state.loading|=4,Fs(a,n.precedence,e),t.instance=a;case"script":return a=Ba(n.src),(o=e.querySelector(Ri(a)))?(t.instance=o,et(o),o):(r=n,(o=Jn.get(a))&&(r=E({},n),ad(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),et(o),nn(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,Fs(r,n.precedence,e));return t.instance}function Fs(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 od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ad(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 gf(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[Mo]||a[_t]||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 bf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function R0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function yf(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=Ua(r.href),a=t.querySelector(Di(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,et(a);return}a=t.ownerDocument||t,r=ff(r),(o=Jn.get(o))&&od(r,o),a=a.createElement("link"),et(a);var s=a;s._p=new Promise(function(u,h){s.onload=u,s.onerror=h}),nn(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 id=0;function $0(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&&id===0&&(id=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>id?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 Us=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Us=new Map,t.forEach(F0,e),Us=null,Ws.call(e))}function F0(e,t){if(!(t.state.loading&4)){var n=Us.get(e);if(n)var r=n.get(null);else{n=new Map,Us.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=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 Li={$$typeof:oe,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function O0(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=xr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.hiddenUpdates=xr(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 vf(e,t,n,r,o,a,s,u,h,k,T,O){return e=new O0(e,t,n,s,h,k,T,O,u),t=1,a===!0&&(t|=24),a=Mn(3,null,null,t),e.current=a,a.stateNode=e,t=Fl(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Bl(a),e}function xf(e){return e?(e=xa,e):xa}function wf(e,t,n,r,o,a){o=xf(o),r.context===null?r.context=o:r.pendingContext=o,r=ao(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=io(e,r,t),n!==null&&(_n(n,e,t),hi(n,e,t))}function kf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sd(e,t){kf(e,t),(e=e.alternate)&&kf(e,t)}function _f(e){if(e.tag===13||e.tag===31){var t=Ho(e,67108864);t!==null&&_n(t,e,67108864),sd(e,67108864)}}function Sf(e){if(e.tag===13||e.tag===31){var t=Dn();t=un(t);var n=Ho(e,t);n!==null&&_n(n,e,t),sd(e,t)}}var Hs=!0;function W0(e,t,n,r){var o=C.T;C.T=null;var a=H.p;try{H.p=2,ld(e,t,n,r)}finally{H.p=a,C.T=o}}function U0(e,t,n,r){var o=C.T;C.T=null;var a=H.p;try{H.p=8,ld(e,t,n,r)}finally{H.p=a,C.T=o}}function ld(e,t,n,r){if(Hs){var o=ud(r);if(o===null)qu(e,t,r,Vs,n),Ef(e,r);else if(H0(o,e,t,n,r))r.stopPropagation();else if(Ef(e,r),t&4&&-1<B0.indexOf(e)){for(;o!==null;){var a=Jt(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=Ln(a.pendingLanes);if(s!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;s;){var h=1<<31-Te(s);u.entanglements[1]|=h,s&=~h}yr(a),(ot&6)===0&&(As=Fe()+500,Ti(0))}}break;case 31:case 13:u=Ho(a,2),u!==null&&_n(u,a,2),zs(),sd(a,2)}if(a=ud(r),a===null&&qu(e,t,r,Vs,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else qu(e,t,r,null,n)}}function ud(e){return e=fa(e),dd(e)}var Vs=null;function dd(e){if(Vs=null,e=Hr(e),e!==null){var t=N(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=V(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 Vs=e,null}function Cf(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(yt()){case fn:return 2;case at:return 8;case It:case Rn:return 32;case ln:return 268435456;default:return 32}default:return 32}}var cd=!1,yo=null,vo=null,xo=null,$i=new Map,Fi=new Map,wo=[],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 Ef(e,t){switch(e){case"focusin":case"focusout":yo=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":xo=null;break;case"pointerover":case"pointerout":$i.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(t.pointerId)}}function Oi(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=Jt(t),t!==null&&_f(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function H0(e,t,n,r,o){switch(t){case"focusin":return yo=Oi(yo,e,t,n,r,o),!0;case"dragenter":return vo=Oi(vo,e,t,n,r,o),!0;case"mouseover":return xo=Oi(xo,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return $i.set(a,Oi($i.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Fi.set(a,Oi(Fi.get(a)||null,e,t,n,r,o)),!0}return!1}function Af(e){var t=Hr(e.target);if(t!==null){var n=N(t);if(n!==null){if(t=n.tag,t===13){if(t=R(n),t!==null){e.blockedOn=t,zo(e.priority,function(){Sf(n)});return}}else if(t===31){if(t=V(n),t!==null){e.blockedOn=t,zo(e.priority,function(){Sf(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=ud(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tt=r,n.target.dispatchEvent(r),tt=null}else return t=Jt(n),t!==null&&_f(t),e.blockedOn=n,!1;t.shift()}return!0}function Pf(e,t,n){Qs(e)&&n.delete(t)}function V0(){cd=!1,yo!==null&&Qs(yo)&&(yo=null),vo!==null&&Qs(vo)&&(vo=null),xo!==null&&Qs(xo)&&(xo=null),$i.forEach(Pf),Fi.forEach(Pf)}function Ks(e,t){e.blockedOn===t&&(e.blockedOn=null,cd||(cd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,V0)))}var qs=null;function zf(e){qs!==e&&(qs=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){qs===e&&(qs=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(dd(r||n)===null)continue;break}var a=Jt(n);a!==null&&(e.splice(t,3),t-=3,uu(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Ha(e){function t(h){return Ks(h,e)}yo!==null&&Ks(yo,e),vo!==null&&Ks(vo,e),xo!==null&&Ks(xo,e),$i.forEach(t),Fi.forEach(t);for(var n=0;n<wo.length;n++){var r=wo[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wo.length&&(n=wo[0],n.blockedOn===null);)Af(n),n.blockedOn===null&&wo.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[Vt]||null;if(typeof a=="function")s||zf(n);else if(s){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,s=a[Vt]||null)u=s.formAction;else if(dd(o)!==null)continue}else u=s.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),zf(n)}}}function Mf(){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 pd(e){this._internalRoot=e}Gs.prototype.render=pd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=Dn();wf(n,r,e,t,null,null)},Gs.prototype.unmount=pd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wf(e.current,2,null,e,null,null),zs(),t[wr]=null}};function Gs(e){this._internalRoot=e}Gs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Br();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wo.length&&t!==0&&t<wo[n].priority;n++);wo.splice(n,0,e),n===0&&Af(e)}};var Tf=l.version;if(Tf!=="19.2.1")throw Error(c(527,Tf,"19.2.1"));H.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=v(t),e=e!==null?W(e):null,e=e===null?null:e.stateNode,e};var Q0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xs.isDisabled&&Xs.supportsFiber)try{Xt=Xs.inject(Q0),Ye=Xs}catch{}}return Va.createRoot=function(e,t){if(!y(e))throw Error(c(299));var n=!1,r="",o=Lp,a=$p,s=Fp;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=vf(e,1,!1,null,null,n,r,null,o,a,s,Mf),e[wr]=t.current,Ku(e),new pd(t)},Va.hydrateRoot=function(e,t,n){if(!y(e))throw Error(c(299));var r=!1,o="",a=Lp,s=$p,u=Fp,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=vf(e,1,!0,t,n??null,r,o,h,a,s,u,Mf),t.context=xf(null),n=t.current,r=Dn(),r=un(r),o=ao(r),o.callback=null,io(n,o,r),n=r,t.current.lanes=n,er(t,n),yr(t),e[wr]=t.current,Ku(e),new Gs(t)},Va.version="19.2.1",Va}var Sd;function Lf(){if(Sd)return Zs.exports;Sd=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(),Zs.exports=Rf(),Zs.exports}var $f=Lf();const Cd=lr($f);var Ed={exports:{}},Qa={};/**
|
|
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={};/**
|
|
42
42
|
* @license React
|
|
43
43
|
* react-jsx-runtime.production.js
|
|
44
44
|
*
|
|
@@ -46,52 +46,52 @@ 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 Ad;function
|
|
49
|
+
*/var Ad;function Of(){if(Ad)return Ba;Ad=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function d(c,v,I){var D=null;if(I!==void 0&&(D=""+I),v.key!==void 0&&(D=""+v.key),"key"in v){I={};for(var q in v)q!=="key"&&(I[q]=v[q])}else I=v;return v=I.ref,{$$typeof:s,type:c,key:D,ref:v!==void 0?v:null,props:I}}return Ba.Fragment=l,Ba.jsx=d,Ba.jsxs=d,Ba}var Pd;function Wf(){return Pd||(Pd=1,zd.exports=Of()),zd.exports}var m=Wf(),el=_d();/**
|
|
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 Md=(...s)=>s.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 Hf=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
60
|
* @license lucide-react v0.563.0 - ISC
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const Bf=s=>s.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 Id=s=>{const l=Bf(s);return l.charAt(0).toUpperCase()+l.slice(1)};/**
|
|
70
70
|
* @license lucide-react v0.563.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/var
|
|
74
|
+
*/var Vf={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 Uf=s=>{for(const l in s)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};/**
|
|
80
80
|
* @license lucide-react v0.563.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const
|
|
84
|
+
*/const Qf=x.forwardRef(({color:s="currentColor",size:l=24,strokeWidth:d=2,absoluteStrokeWidth:c,className:v="",children:I,iconNode:D,...q},_)=>x.createElement("svg",{ref:_,...Vf,width:l,height:l,stroke:s,strokeWidth:c?Number(d)*24/Number(l):d,className:Md("lucide",v),...!I&&!Uf(q)&&{"aria-hidden":"true"},...q},[...D.map(([y,B])=>x.createElement(y,B)),...Array.isArray(I)?I:[I]]));/**
|
|
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 Zn=(
|
|
89
|
+
*/const Zn=(s,l)=>{const d=x.forwardRef(({className:c,...v},I)=>x.createElement(Qf,{ref:I,iconNode:l,className:Md(`lucide-${Hf(Id(s))}`,`lucide-${s}`,c),...v}));return d.displayName=Id(s),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
|
|
94
|
+
*/const qf=Zn("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.
|
|
@@ -101,7 +101,7 @@ Error generating stack: `+r.message+`
|
|
|
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 Xf=Zn("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"}]]);/**
|
|
105
105
|
* @license lucide-react v0.563.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
@@ -116,44 +116,44 @@ Error generating stack: `+r.message+`
|
|
|
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 jd=Zn("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"}]]);/**
|
|
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 Nd=Zn("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"}]]);/**
|
|
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 Zf=Zn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Rd=Zn("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"}]]);/**
|
|
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 Dd=Zn("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"}]]);/**
|
|
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 nl=Zn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),
|
|
144
|
+
*/const nl=Zn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Td=`
|
|
145
145
|
.admesh-publisher-panel {
|
|
146
146
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
147
147
|
text-align: left;
|
|
148
148
|
line-height: 1.5;
|
|
149
149
|
-webkit-font-smoothing: antialiased;
|
|
150
150
|
}
|
|
151
|
-
.admesh-publisher-panel *${
|
|
151
|
+
.admesh-publisher-panel *${bn}, .admesh-publisher-panel *${bn}::before, .admesh-publisher-panel *${bn}::after {
|
|
152
152
|
box-sizing: border-box;
|
|
153
153
|
}
|
|
154
|
-
.admesh-publisher-panel button${
|
|
155
|
-
.admesh-publisher-panel button${
|
|
156
|
-
.admesh-publisher-panel button${
|
|
154
|
+
.admesh-publisher-panel button${bn}, .admesh-publisher-panel input${bn} { font-family: inherit; }
|
|
155
|
+
.admesh-publisher-panel button${bn} { transition: border-color 150ms ease, background-color 150ms ease; }
|
|
156
|
+
.admesh-publisher-panel button${bn}:focus-visible, .admesh-publisher-panel a${bn}:focus-visible {
|
|
157
157
|
outline: 2px solid var(--publisher-accent);
|
|
158
158
|
outline-offset: 2px;
|
|
159
159
|
}
|
|
@@ -167,19 +167,19 @@ Error generating stack: `+r.message+`
|
|
|
167
167
|
}
|
|
168
168
|
.admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
|
|
169
169
|
.admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
|
|
170
|
-
.admesh-publisher-panel input${
|
|
171
|
-
.admesh-publisher-panel a${
|
|
170
|
+
.admesh-publisher-panel input${bn} { min-width: 0; }
|
|
171
|
+
.admesh-publisher-panel a${bn} { text-underline-offset: 3px; }
|
|
172
172
|
@media (prefers-reduced-motion: reduce) {
|
|
173
|
-
.admesh-publisher-panel *${
|
|
173
|
+
.admesh-publisher-panel *${bn}, .admesh-publisher-panel *${bn}::before, .admesh-publisher-panel *${bn}::after {
|
|
174
174
|
animation: none !important;
|
|
175
175
|
transition: none !important;
|
|
176
176
|
scroll-behavior: auto !important;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
@media (max-width: 767px) {
|
|
180
|
-
.admesh-publisher-panel:not([data-compact="true"]) input${
|
|
180
|
+
.admesh-publisher-panel:not([data-compact="true"]) input${bn} { font-size: 16px !important; }
|
|
181
181
|
}
|
|
182
|
-
`;function Jf({value:i,onChange:l,onSend:d,onStop:c,onSuggestion:y,suggestions:N,registerSuggestion:R,open:V,onOpenChange:S,loading:v,analyzing:W,compact:E,expanded:B,suggestionPlacement:M="below",showLogo:P=!0,logoUrl:I,title:J,placeholder:ee,colors:re}){const oe=x.useId(),ae=x.useRef(null),q=x.useRef(null),Z=x.useRef(null),[U,de]=x.useState({visibility:"hidden"}),me=V&&!v&&(W||N.length>0);x.useLayoutEffect(()=>{var ne;if(!me)return;const fe=()=>{var Ie,C;const H=(Ie=ae.current)==null?void 0:Ie.getBoundingClientRect();if(!H)return;const le=((C=window.visualViewport)==null?void 0:C.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=le-H.bottom-16,f=H.top-16,z=M==="above"?!(f<96&&Ee>f):Ee<96&&f>Ee;de({position:"fixed",left:Math.max(8,Math.min(H.left,ke-H.width-8)),width:Math.min(H.width,ke-16),maxHeight:Math.max(40,Math.min(300,z?f:Ee)),...z?{bottom:window.innerHeight-H.top+8}:{top:H.bottom+8},zIndex:2147483002})},ye=Ie=>{var C,H;const le=Ie.target;!((C=ae.current)!=null&&C.contains(le))&&!((H=Z.current)!=null&&H.contains(le))&&S(!1)};return fe(),window.addEventListener("resize",fe),window.addEventListener("scroll",fe,!0),(ne=window.visualViewport)==null||ne.addEventListener("resize",fe),document.addEventListener("pointerdown",ye),()=>{var Ie;window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe,!0),(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",fe),document.removeEventListener("pointerdown",ye)}},[me,M,S]);const he=ne=>{var fe,ye;!((fe=ae.current)!=null&&fe.contains(ne))&&!((ye=Z.current)!=null&&ye.contains(ne))&&S(!1)},Be=()=>{!i.trim()||v||(S(!1),d())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:ae,className:"admesh-publisher-composer",onBlur:ne=>he(ne.relatedTarget),onClick:ne=>{var fe;ne.target.closest("button, a")||((fe=q.current)==null||fe.focus(),S(!0))},style:{display:"flex",alignItems:"center",gap:E?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${re.border}`,borderRadius:8,background:re.surface,cursor:"text",padding:E?"6px":"8px 8px 8px 12px"},children:[P&&!B&&m.jsx("div",{style:{width:E?24:32,height:E?24:32,display:"grid",placeItems:"center",flexShrink:0,color:re.accent},children:I?m.jsx("img",{src:I,alt:`${J} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(tl,{size:E?18:21,strokeWidth:1.5,"aria-label":J})}),m.jsx("input",{ref:q,type:"text",value:i,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":me,"aria-controls":me?oe:void 0,onFocus:()=>S(!0),onChange:ne=>{l(ne.target.value),S(!0)},onKeyDown:ne=>{var fe,ye;ne.nativeEvent.isComposing||(ne.key==="Escape"&&(ne.preventDefault(),S(!1)),ne.key==="ArrowDown"&&(ne.preventDefault(),me?(ye=(fe=Z.current)==null?void 0:fe.querySelector("button"))==null||ye.focus():S(!0)),ne.key==="Enter"&&(ne.preventDefault(),Be()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:E?"6px 0":"10px 0",fontSize:E?13:15,color:re.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:E?8:9,lineHeight:1.3,color:re.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":v?"Stop generating":"Send message",disabled:!v&&!i.trim(),onClick:v?c:Be,style:{display:"grid",placeItems:"center",flexShrink:0,width:E?32:40,height:E?32:40,border:"none",borderRadius:6,background:re.accent,color:re.accentText,cursor:"pointer",opacity:!v&&!i.trim()?.5:1},children:v?m.jsx(Xf,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(Kf,{size:18,"aria-hidden":"true"})})]}),me&&el.createPortal(m.jsxs("div",{ref:Z,id:oe,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:ne=>he(ne.relatedTarget),onKeyDown:ne=>{var fe,ye,Ie,C;if(ne.key==="Escape"&&(ne.preventDefault(),(fe=q.current)==null||fe.focus(),S(!1)),ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const H=Array.from(((ye=Z.current)==null?void 0:ye.querySelectorAll("button"))??[]),le=H.indexOf(document.activeElement)+(ne.key==="ArrowDown"?1:-1);le<0?(Ie=q.current)==null||Ie.focus():(C=H[Math.min(le,H.length-1)])==null||C.focus()}},style:{...U,"--publisher-accent":re.accent,padding:6,border:`1px solid ${re.border}`,borderRadius:10,background:re.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Dd}),W&&!N.length?m.jsx("div",{role:"status",style:{padding:12,color:re.muted,fontSize:13},children:"Finding suggested questions\u2026"}):N.map(ne=>m.jsxs("button",{ref:R(ne.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":ne.is_sponsored?"true":void 0,onClick:()=>{S(!1),y(ne)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${ne.is_sponsored?re.accent:re.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:ne.is_sponsored?re.accent:re.surface,color:ne.is_sponsored?re.accentText:re.text},children:[m.jsx("span",{children:ne.text}),ne.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},ne.id))]}),document.body)]})}let Co=!1;try{typeof globalThis.importMeta<"u"&&(Fr=globalThis.importMeta.env)!=null&&Fr.PROD&&(Co=!0)}catch{}Co||(Co=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...i)=>{Co||console.log(...i)},warn:(...i)=>{Co||console.warn(...i)},error:(...i)=>{console.error(...i)},info:(...i)=>{Co||console.info(...i)},debug:(...i)=>{Co||console.debug(...i)}};function Zf(i,l,d){const c=i*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...d}}function Yf(i){return i<768?"mobile":i<1024?"tablet":"desktop"}function eh(i){const l=i.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,y=l.height,N=l.width;if(y===0||N===0)return 0;const R=Math.max(0,l.top),V=Math.min(d,l.bottom),S=Math.max(0,l.left),v=Math.min(c,l.right),W=Math.max(0,V-R),E=Math.max(0,v-S),B=W*E,M=y*N;return M>0?B/M:0}function Rd(){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 th(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 nh(i){const l=i.getBoundingClientRect(),d=th(i),c=window.innerWidth||document.documentElement.clientWidth,y=window.innerHeight||document.documentElement.clientHeight,N=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:Yf(c),viewportWidth:c,viewportHeight:y,adWidth:l.width,adHeight:l.height,adPositionTop:d.top,adPositionLeft:d.left,isDarkMode:N,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function rh(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function oh(i,l,d){return i>=d.visibilityThreshold&&l>=d.minimumDuration}function Ld(i=new Date){return i.toISOString()}function ah(i){return i.length===0?0:i.reduce((l,d)=>l+d,0)/i.length}function $d(i,l){let d;return function(...c){d||(i(...c),d=!0,setTimeout(()=>d=!1,l))}}let ih={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},sh=!1;function lh({productId:i,offerId:l,agentId:d,recommendationId:c,elementRef:y,config:N}){const R={...ih,...N},V=x.useRef(rh()),[S,v]=x.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Ld(),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}),W=x.useRef(null),E=x.useRef(null),B=x.useRef(null),M=x.useRef(null),P=x.useRef(null),I=x.useRef([]),J=x.useRef([]),ee=x.useRef(null),re=x.useCallback(Z=>{R.debug&&F.log(`[AdMesh Viewability] ${Z}`)},[R.debug]),oe=x.useCallback(async(Z,U)=>{if(!(!R.enabled||sh||!y.current||!W.current)&&(re(`Analytics disabled - skipping event: ${Z}`),R.onEvent)){const de=nh(y.current),me={eventType:Z,timestamp:Ld(),sessionId:V.current,productId:i,offerId:l,agentId:d,recommendationId:c,timeMetrics:S.timeMetrics,engagementMetrics:S.engagementMetrics,contextMetrics:de,mrcStandards:W.current,isViewable:S.isViewable,metadata:U};R.onEvent(me)}},[R,i,l,d,c,y,S,re]),ae=x.useCallback(async()=>{J.current.length!==0&&(re("Analytics disabled - clearing batch without sending"),J.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[re]),q=x.useCallback($d(()=>{if(!y.current)return;const Z=eh(y.current),U=Date.now(),de=new Date(S.timeMetrics.loadedAt).getTime();v(me=>{const he={...me};Z>0&&I.current.push(Z);const Be=me.isVisible,ne=Z>0;if(ne&&!Be)E.current=U,he.engagementMetrics.viewportEnterCount++,he.timeMetrics.timeToFirstVisible||(he.timeMetrics.timeToFirstVisible=U-de,he.engagementMetrics.scrollDepthAtFirstVisible=Rd(),oe("ad_visible"));else if(!ne&&Be){if(E.current){const fe=U-E.current;he.timeMetrics.totalVisibleDuration+=fe,E.current=null}he.engagementMetrics.viewportExitCount++,oe("ad_hidden")}else if(ne&&Be&&E.current){const fe=U-E.current;he.timeMetrics.totalVisibleDuration+=fe,E.current=U}if(he.isVisible=ne,he.visibilityPercentage=Z,Z>he.engagementMetrics.maxVisibilityPercentage&&(he.engagementMetrics.maxVisibilityPercentage=Z),I.current.length>0&&(he.engagementMetrics.averageVisibilityPercentage=ah(I.current)),W.current){const fe=me.isViewable,ye=oh(Z,he.timeMetrics.totalVisibleDuration,W.current);if(ye&&!fe)he.isViewable=!0,he.timeMetrics.timeToViewable=U-de,B.current=U,oe("ad_viewable");else if(ye&&fe&&B.current){const Ie=U-B.current;he.timeMetrics.totalViewableDuration+=Ie,B.current=U}}return he.engagementMetrics.currentScrollDepth=Rd(),he})},100),[y,S.timeMetrics.loadedAt,oe]);return x.useEffect(()=>{if(!y.current)return;const Z=y.current.getBoundingClientRect();W.current=Zf(Z.width,Z.height,R.mrcStandards),re("Initialized MRC standards"),oe("ad_loaded")},[y,R.mrcStandards,re,oe]),x.useEffect(()=>{if(!R.enabled||!y.current)return;const Z=new IntersectionObserver(U=>{U.forEach(()=>{q()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Z.observe(y.current),()=>{Z.disconnect()}},[R.enabled,y,q]),x.useEffect(()=>{if(!R.enabled)return;const Z=$d(()=>{q()},100);return window.addEventListener("scroll",Z,{passive:!0}),()=>window.removeEventListener("scroll",Z)},[R.enabled,q]),x.useEffect(()=>{if(!R.enabled||!y.current)return;const Z=y.current,U=()=>{M.current=Date.now(),v(me=>({...me,engagementMetrics:{...me.engagementMetrics,hoverCount:me.engagementMetrics.hoverCount+1}})),oe("ad_hover_start")},de=()=>{if(M.current){const me=Date.now()-M.current;v(he=>({...he,timeMetrics:{...he.timeMetrics,totalHoverDuration:he.timeMetrics.totalHoverDuration+me}})),M.current=null,oe("ad_hover_end",{hoverDuration:me})}};return Z.addEventListener("mouseenter",U),Z.addEventListener("mouseleave",de),()=>{Z.removeEventListener("mouseenter",U),Z.removeEventListener("mouseleave",de)}},[R.enabled,y,oe]),x.useEffect(()=>{if(!R.enabled||!y.current)return;const Z=y.current,U=()=>{P.current=Date.now(),oe("ad_focus")},de=()=>{if(P.current){const me=Date.now()-P.current;v(he=>({...he,timeMetrics:{...he.timeMetrics,totalFocusDuration:he.timeMetrics.totalFocusDuration+me}})),P.current=null,oe("ad_blur",{focusDuration:me})}};return Z.addEventListener("focus",U),Z.addEventListener("blur",de),()=>{Z.removeEventListener("focus",U),Z.removeEventListener("blur",de)}},[R.enabled,y,oe]),x.useEffect(()=>{if(!R.enabled||!y.current)return;const Z=y.current,U=()=>{v(de=>({...de,engagementMetrics:{...de.engagementMetrics,wasClicked:!0}})),oe("ad_click")};return Z.addEventListener("click",U),()=>{Z.removeEventListener("click",U)}},[R.enabled,y,oe]),x.useEffect(()=>()=>{const Z=Date.now(),U=new Date(S.timeMetrics.loadedAt).getTime(),de=Z-U;v(me=>({...me,timeMetrics:{...me.timeMetrics,sessionDuration:de}})),oe("ad_unloaded",{sessionDuration:de}),ae()},[]),S}const rl=({productId:i,offerId:l,agentId:d,recommendationId:c,exposureUrl:y,sessionId:N,triggerExposureUrl:R=!0,children:V,config:S,className:v,style:W,onViewabilityChange:E,onVisible:B,onViewable:M,onClick:P})=>{const I=x.useRef(null),J=x.useRef(!1),ee=lh({productId:i,offerId:l,agentId:d,recommendationId:c,elementRef:I,config:S}),re=x.useRef(ee.isViewable);x.useEffect(()=>{J.current=!1,re.current=!1},[y,c,N]),x.useEffect(()=>{ee.isViewable!==re.current&&(re.current=ee.isViewable,E&&E(ee.isViewable),ee.isViewable&&M&&M(),ee.isViewable&&!J.current&&R&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:y?"present":"MISSING",sessionId:N?"present":"MISSING",recommendationId:c}),y&&N?(J.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",y),fetch(y,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(q=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",q),J.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!y,hasSessionId:!!N})))},[ee.isViewable,E,M,y,N,c,R]);const oe=x.useRef(ee.isVisible);x.useEffect(()=>{ee.isVisible!==oe.current&&(oe.current=ee.isVisible,ee.isVisible&&B&&B())},[ee.isVisible,B]);const ae=()=>{P&&P()};return m.jsx("div",{ref:I,className:v,style:W,onClick:ae,"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:V})};rl.displayName="AdMeshViewabilityTracker";const Fd=i=>{try{return new URL(i),!0}catch{return!1}},ra=i=>typeof i=="string"?i.trim():typeof i=="number"?String(i):"",Yn=i=>ra(i)||void 0,uh=i=>i&&i.trim()?i.trim():"",dh=(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 ra(i)},Od=({recommendations:i,theme:l,className:d="",style:c={},sessionId:y,triggerExposureUrl:N=!0,onDelegationConsent:R,onDelegationActivated:V,onStartDelegation:S,onRecommendationReport:v})=>{var W,E,B,M,P,I,J,ee,re;if(!i||i.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const oe=i[0],ae=oe?.recommendation,q=ae?.creative,Z=oe?.tracking,U=oe?.delegation,de=oe?.recommendation_id||"",me=ae?.offerId||"",he=q?.brand_name||"",Be=q?.headline||"",ne=q?.description||"",fe=q?.logo_url||"",ye=Z?.click_url||q?.landing_page_url||"",Ie=Z?.exposure_url||"",C=ae?.disclosure||"Sponsored",H=q?.products||[],le=H.slice(0,4),ke=H.length>1,Ee=(ae?.format||"tail")==="bridge",f=U?.available===!0,z=Ee&&f,G=U?.brand_name||he,te="Talk to Agent",Se=uh(q?.cta_text),be=!ke&&!!Se&&!!ye;if(!he&&!Be&&!ne)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:de}),null;const Ae=Be&&Be!==he?Be:he,Xe=ne,ve=he.trim().toLowerCase(),Ne=Ae.trim().toLowerCase(),Ot=!!he&&ve!==Ne,[ie,_e]=x.useState(!1),[se,ze]=x.useState(!1),[De,Gt]=x.useState(!1),[X,Ke]=x.useState(null),K=x.useRef(null);x.useEffect(()=>()=>{K.current&&(K.current(!1),K.current=null)},[]);const Le=xe=>{var He;xe&&ze(!0),(He=K.current)==null||He.call(K,xe),K.current=null,xe||(ze(!1),_e(!1))},Q=async()=>R?await R(oe):await new Promise(xe=>{K.current=xe,_e(!0)}),Oe=(xe,He)=>{He&&He.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:de,productId:me,clickUrl:ye,source:xe}).catch(()=>{F.error(`[AdMesh] Failed to track ${xe} click`)})},Fe=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],yt=xe=>{xe.preventDefault(),xe.stopPropagation(),!X&&Gt(He=>!He)},fn=async(xe,He)=>{if(xe.preventDefault(),xe.stopPropagation(),Gt(!1),Ke(He),!!v)try{await v({recommendation:oe,recommendation_id:de,reason:He,session_id:y})}catch($n){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",$n)}},at=()=>{ke||!ye||(Oe("compact_tail_ad_card"),typeof window<"u"&&window.open(ye,"_blank","noopener,noreferrer"))},It=xe=>{ke||!ye||(xe.key==="Enter"||xe.key===" ")&&(xe.preventDefault(),at())},Rn=async()=>{if(de&&y)try{const xe=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",He=await fetch(`${xe}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:de,session_id:y,is_test:!1})});He.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",He.statusText)}catch(xe){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",xe)}},ln=async xe=>{if(xe.preventDefault(),xe.stopPropagation(),!oe||!z||(Oe("compact_tail_ad_delegation_cta"),!await Q()))return;Rn();const He=U!=null&&U.available?{recommendation_id:oe.recommendation_id,brand_id:Yn(U.brand_id),brand_name:Yn(U.brand_name||q?.brand_name),mcp_endpoint:Yn(U.mcp_endpoint),eligibility_reason:Yn(U.eligibility_reason),delegate_reason:Yn(U.delegate_reason),session_goal:Yn(U.session_goal),desired_outcome_type:U.desired_outcome_type,required_user_inputs:Array.isArray(U.required_user_inputs)?U.required_user_inputs.filter($n=>typeof $n=="string"):[],required_consent_types:Array.isArray(U.required_consent_types)?U.required_consent_types.filter($n=>typeof $n=="string"):[],success_outcome:Yn(U.success_outcome),fallback_message:Yn(U.fallback_message),session_mode:Yn(U.session_mode),status:Yn(U.status),capabilities:U.capabilities||[],allowed_data_types:U.allowed_data_types||[],consent_requirements:U.consent_requirements||[],auth_model:Yn(U.auth_model),handoff_protocol:U.handoff_protocol&&typeof U.handoff_protocol=="object"?U.handoff_protocol:void 0,supported_actions:U.supported_actions||[],metadata:U.metadata&&typeof U.metadata=="object"?U.metadata:void 0,platform_response:oe}:null;if(V&&He){try{await V(He)}finally{ze(!1),_e(!1)}return}if(S){try{await S(oe)}finally{ze(!1),_e(!1)}return}ze(!1),_e(!1)},[Or,oa]=x.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Ye=l?.surfaceColor||((E=(W=l?.components)==null?void 0:W.card)==null?void 0:E.backgroundColor)||(Xt?"#111827":"#ffffff"),dt=l?.borderColor||((M=(B=l?.components)==null?void 0:B.card)==null?void 0:M.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),Te=((P=l?.shadows)==null?void 0:P.medium)||((J=(I=l?.components)==null?void 0:I.card)==null?void 0:J.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),hn="#2563eb",Sn=Xt?"#9ca3af":"#6b7280",Wr=Xt?"#e5e7eb":"#374151",ce=Xt?"#f9fafb":"#0f172a",on=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",Cn="50px",Ln=z||be?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[z?m.jsx("button",{type:"button",onClick:ln,style:{background:"none",border:"none",padding:0,color:hn,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:te}):null,be?m.jsx("a",{href:ye,target:"_blank",rel:"noopener noreferrer",onClick:xe=>Oe("compact_tail_ad_cta",xe),style:{color:hn,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:Se}):null]}):null;return m.jsxs(rl,{productId:me,recommendationId:de,exposureUrl:Ie,sessionId:y,triggerExposureUrl:N,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:`
|
|
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:`
|
|
183
183
|
.admesh-compact-tail-ad,
|
|
184
184
|
.admesh-compact-tail-ad * {
|
|
185
185
|
box-sizing: border-box;
|
|
@@ -232,9 +232,9 @@ Error generating stack: `+r.message+`
|
|
|
232
232
|
min-height: 34px;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
`}),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||((re=(ee=l?.components)==null?void 0:ee.card)==null?void 0:re.borderRadius)||"14px",border:`1px solid ${dt}`,background:Ye,boxShadow:Te,minWidth:0,cursor:!ke&&ye?"pointer":void 0},onClick:at,onKeyDown:It,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:!Or&&fe&&Fd(fe)?m.jsx("img",{src:fe,alt:`${he} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>oa(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:Sn},children:(he||"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:Sn},children:Ot?he:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:Sn,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:ce,marginBottom:"4px"},title:Ae,children:Ae}),Xe&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Wr},title:Xe,children:Xe})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:le.map(xe=>{const He=ra(xe.product_name)||"Product",$n=ra(xe.product_link)||ra(xe.product_url)||ye||"#",vr=dh(xe.product_price,xe.product_currency),xr=ra(xe.product_image_url),er=xr&&Fd(xr)?xr:"",Ur=$n!=="#";return m.jsx("a",{href:$n,target:Ur?"_blank":void 0,rel:Ur?"noopener noreferrer":void 0,onClick:aa=>Oe(`compact_tail_ad_product_${xe.product_id||"item"}`,aa),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${dt}`,borderRadius:"12px",background:on,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:Sn,fontSize:"12px",fontWeight:700},children:er?m.jsx("img",{src:er,alt:He,style:{width:"100%",height:"100%",objectFit:"cover"}}):He.charAt(0).toUpperCase()}),m.jsxs("div",{style:{minWidth:0,flex:1},children:[m.jsx("div",{style:{fontSize:"12px",lineHeight:1.25,fontWeight:600,color:ce,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:He,children:He}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:vr&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:ce},children:vr})})]})]})},xe.product_id||`${de}-${He}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:Cn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:Ln}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&H.length>le.length?m.jsxs("span",{style:{fontSize:"10px",color:Sn},children:["+",H.length-le.length," more"]}):null,m.jsx("button",{type:"button","aria-label":X?"Recommendation reported":"Report recommendation",title:X?"Reported":"Report recommendation",disabled:!!X,onClick:yt,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${dt}`,background:X?on:Ye,color:X?hn:Sn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:X?"default":"pointer",flexShrink:0},children:m.jsx(qf,{size:13})})]})]}),De?m.jsx("div",{className:"admesh-compact-report-panel",onClick:xe=>xe.stopPropagation(),style:{marginLeft:ke?0:Cn,border:`1px solid ${dt}`,borderRadius:"12px",background:on,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Fe.map(xe=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:He=>fn(He,xe.value),style:{borderRadius:"999px",border:`1px solid ${dt}`,background:Ye,color:ce,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:xe.label},xe.value))}):null,X?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:Cn,fontSize:"11px",color:Sn},children:"Thanks for reporting this recommendation."}):null,ie?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${dt}`,borderRadius:"12px",background:on,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:hn},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:ce,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Wr},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:se,onClick:xe=>{xe.preventDefault(),xe.stopPropagation(),!se&&Le(!1)},style:{borderRadius:"10px",border:`1px solid ${dt}`,background:Ye,color:ce,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:se?"not-allowed":"pointer",opacity:se?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:se,onClick:xe=>{xe.preventDefault(),xe.stopPropagation(),!se&&Le(!0)},style:{borderRadius:"10px",border:"none",background:hn,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:se?"wait":"pointer",opacity:se?.86:1},children:se?"Connecting...":"Allow agent"})]})]}):null]})]})},ch=({recommendations:i,theme:l,className:d,style:c,sessionId:y,onDelegationConsent:N,onDelegationActivated:R,onStartDelegation:V})=>{const S=i.filter(W=>W&&typeof W=="object"&&typeof W.recommendation_id=="string"&&W.recommendation_id.length>0);if(!S||S.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${S.length} valid recommendations`);const v=()=>{var W;if(S.length>0){const E=S[0],B=(W=E.recommendation)==null?void 0:W.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:B,recommendationKeys:Object.keys(E||{})}),(B==="product_card"||B==="weave"||B==="bridge")&&F.warn(`[AdMeshLayout] ${B} format requested, falling back to tail for canonical render payload`)}return m.jsx(Od,{recommendations:S,theme:l,sessionId:y,onDelegationConsent:N,onDelegationActivated:R,onStartDelegation:V})};return m.jsx("div",{className:`admesh-layout ${d}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:v()})};class ph{constructor(l){$r(this,"firedExposures",new Set),$r(this,"debug",!1),$r(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,d,c){const y=`${c}_${d}`;if(this.firedExposures.has(y)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(y);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,y){const N=`${c}_${d}`;if(this.firedExposures.has(N)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(R=>{let V=null,S=null;const v=new IntersectionObserver(E=>{E.forEach(B=>{B.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?V===null&&(V=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),S=setTimeout(()=>{this.fireExposure(l,d,c),v.disconnect(),R()},this.mrcThreshold.minimumDurationMs)):V!==null&&(S&&(clearTimeout(S),S=null),V=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"});v.observe(y);const W=setTimeout(()=>{v.disconnect(),S&&clearTimeout(S),R()},3e4);y.__admeshTrackerCleanup=()=>{v.disconnect(),S&&clearTimeout(S),clearTimeout(W)}})}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(y=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",y)}).then(()=>{})}}function mh(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 fh(){var i;try{console.log("[AdMesh] Starting direct headings extraction...");const l=S=>S.replace(/\s+/g," ").trim(),d=()=>{var S;const v=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],W=["script","style","noscript","svg","canvas","iframe","nav","header","footer","aside",'[aria-hidden="true"]',"[data-admesh-ignore]",".admesh-publisher-assistant-root",".admesh-publisher-assistant-reactMount",".admesh-publisher-assistant-floating",".admesh-publisher-assistant-inline"].join(","),E=(((S=v.map(M=>document.querySelector(M)).filter(M=>!!M).map(M=>{const P=M.cloneNode(!0);P.querySelectorAll(W).forEach(J=>J.remove());const I=l(P.textContent||"");return{element:M,text:I}}).filter(M=>M.text.length>=200).sort((M,P)=>P.text.length-M.text.length)[0])==null?void 0:S.element)||document.body).cloneNode(!0);E.querySelectorAll(W).forEach(M=>M.remove());const B=Array.from(E.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(M=>l(M.textContent||"")).filter(M=>M.length>=24);return(B.length>0?B.join(`
|
|
236
|
-
`):l(
|
|
237
|
-
Article topic inferred from URL path: ${d}`,url:i,domain:l.hostname,extracted_at:new Date().toISOString()}}const _h=6e4,Hd=3;function Sh(i){const l=wh();if(l)return l;const d=i?.trim();return Ud(d)?d:null}const Vd=({apiKey:i,sessionId:l,extension:d,theme:c,apiBaseUrl:y,language:N,location:R,userId:V,model:S,messages:v,pageContext:W,articleUrl:E,contextMode:B="auto",agentDisplayId:M,children:P})=>{const[I,J]=x.useState(null),[ee,re]=x.useState(new Set),[oe,ae]=x.useState(new Map),[q,Z]=x.useState(null),[U,de]=x.useState([]),[me,he]=x.useState(!1),[Be,ne]=x.useState(null),[fe,ye]=x.useState(!1),Ie=x.useRef(!1),C=x.useRef(0),H=x.useRef(null),le=x.useRef(null);le.current=q;const ke=!!W||B==="ad-slot"||B==="auto"&&(!!(E!=null&&E.trim())||xh()),Ee=x.useCallback(async()=>{if(W)return W;if(!ke)return fh();const ie=Sh(E);if(!ie)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ne("Article URL is required for ad-slot context"),null;if(!i)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Bd(ie);try{ye(!0);const _e=await vh(ie,{apiKey:i,apiBaseUrl:y||"https://api.useadmesh.com",agentDisplayId:M});return F.log("[AdMeshProvider] Page context resolved",{source:_e.source,cache_hit:_e.cache_hit,domain:_e.context.domain}),_e.context}catch(_e){return F.error("[AdMeshProvider] Failed to fetch page context:",_e),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Bd(ie)}finally{ye(!1)}},[M,y,i,E,W,ke]),f=x.useCallback((ie,_e)=>{const se=ie.filter(ze=>!ze.is_sponsored).slice(0,3);return[_e,...se]},[]),z=x.useCallback((ie,_e)=>{const se=ie.find(De=>De.is_sponsored),ze=_e.filter(De=>!De.is_sponsored).slice(0,3);return se?[se,...ze]:ze},[]);x.useEffect(()=>{if(!l||l.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:",l)},[l]),x.useEffect(()=>{if(!i){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!l||l.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ie=new Kd({apiKey:i,theme:c,apiBaseUrl:y,extension:d});J(ie),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",l),y&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ie){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ie)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}},[i,c,y,l,d]);const G=x.useCallback(async ie=>{var _e;if(!i){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(d)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!i.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{he(!0),ne(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const se=ie??await Ee();if(!se){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ne("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:se.title,headingsCount:se.headings.length,articleTextLength:((_e=se.article_text)==null?void 0:_e.length)||0,domain:se.domain});const ze=await yh(se,{apiKey:i,apiBaseUrl:y||"https://api.useadmesh.com",extension:d,userId:V});ze?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:ze.suggestions.length,suggestions:(ze.suggestions||[]).map(De=>{var Gt;return{id:De.id,text:De.text,is_sponsored:De.is_sponsored,recommendationId:((Gt=De.recommendation)==null?void 0:Gt.recommendation_id)||null}})}),de(De=>z(De,ze.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ne("Intent analysis failed"),de(De=>De.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),De):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(se){F.error("[AdMeshProvider] Error in intent analysis:",se),ne("Intent analysis error"),de(ze=>ze.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),ze):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{he(!1)}},[i,y,d,V,z,Ee]),te=x.useCallback(async ie=>{var _e,se,ze,De,Gt,X;if(!I||!i||!i.toLowerCase().startsWith("pub_"))return;const Ke=ie??await Ee();if(!Ke){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const K=((se=(_e=Ke.headings)==null?void 0:_e[0])==null?void 0:se.trim())||((ze=Ke.title)==null?void 0:ze.trim());if(!K){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 Le=await I.fetchPlatformResponse({query:K,sessionId:l,messageId:Kd.createMessageId(l),platformSurface:"copilot",model:S,messages:[],language:N,location:R,userId:V}),Q=(X=(Gt=(De=Le.recommendation)==null?void 0:De.creative)==null?void 0:Gt.follow_up_suggestion)==null?void 0:X.trim(),Oe=Le.recommendation_id;if(!Q||!Oe){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Oe,text:Q,type:"action",is_sponsored:!0,recommendation:Le,metadata:{source:"aip_context_prefetch",recommendation_id:Oe}};de(yt=>f(yt,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Oe,suggestionText:Q})}catch(Le){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Le)}},[i,N,R,S,I,l,V,f,Ee]),Se=x.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await G()},[G]);x.useEffect(()=>{!I||Ie.current||(Ie.current=!0,(async()=>{const ie=await Ee();await Promise.allSettled([te(ie),G(ie)])})())},[I,G,te,Ee]);const be=x.useCallback(ie=>{if(!ie||ie.status!=="active")return!1;const _e=Date.parse(ie.expires_at);return Number.isNaN(_e)?!1:_e>Date.now()},[]),Ae=x.useCallback(async(ie,_e,se,ze)=>{const De=ze??q;if(!De||!I){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ie,eventType:_e,hasSession:!!De,hasSdk:!!I});return}const Gt=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ie,eventType:_e,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,sessionId:De.session_id});const X=await fetch(`${I.getApiBaseUrl()}${ie}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({delegation_session_id:De.delegation_session_id,recommendation_id:De.recommendation_id,session_id:De.session_id,event_type:_e,timestamp:Gt,metadata:se||{}})});if(!X.ok){const Le=await X.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ie,eventType:_e,status:X.status,errorBody:Le,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id}),new Error(`Delegation event failed (${X.status}): ${Le}`)}const Ke=await X.json(),K=Ke?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ie,eventType:_e,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,returnedStatus:K?.status||Ke?.status}),K&&Z(K)},[q,i,I]),Xe=x.useCallback(()=>{C.current=0},[]),ve=x.useCallback(async(ie="user_stopped",_e)=>{const se=q;if(!se){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ie,recommendationId:se.recommendation_id,delegationSessionId:se.delegation_session_id}),await Ae("/aip/delegation/stop","session_stopped",{reason:ie,..._e||{}},se),await I?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:se.session_id,recommendation_id:se.recommendation_id,delegation_session_id:se.delegation_session_id,brand_name:se.brand_name,status:"stopped",metadata:{reason:ie,..._e||{}}}).catch(ze=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",ze)}),C.current=0,H.current=null,Z(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[q,Ae,I]),Ne=x.useCallback(async(ie="turn_completed",_e)=>{ie==="turn_started"&&Xe(),await Ae("/aip/delegation/activity",ie,_e)},[Ae,Xe]);x.useEffect(()=>{const ie=q?.delegation_session_id??null;ie!==H.current&&(H.current=ie,C.current=0)},[q?.delegation_session_id]),x.useEffect(()=>{if(!(q?.delegation_session_id??null)||!I)return;const ie=le.current;if(!ie||!be(ie)){Z(se=>se?{...se,status:"expired"}:null);return}const _e=window.setInterval(()=>{const se=le.current;if(!(!se||!be(se))){if(C.current+=1,C.current>=Hd){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:se.delegation_session_id,heartbeatsSinceLastUserTurn:C.current,idleHeartbeatLimit:Hd}),ve("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:C.current}).catch(ze=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",ze)});return}Ae("/aip/delegation/heartbeat","heartbeat").catch(ze=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",ze)})}},_h);return()=>{window.clearInterval(_e)}},[q?.delegation_session_id,be,Ae,I,ve]);const Ot={sdk:I,apiKey:i,sessionId:l,theme:c,language:N,location:R,userId:V,model:S,messages:v,processedMessageIds:ee,recommendationResults:oe,activeDelegationSession:q,suggestions:U,isAnalyzingIntent:me||fe,intentError:Be,markMessageAsProcessed:ie=>{re(_e=>{const se=new Set(_e);return se.add(ie),se})},isMessageProcessed:ie=>ee.has(ie),setRecommendationResult:(ie,_e)=>{ae(se=>{const ze=new Map(se);return ze.set(ie,_e),ze}),re(se=>{const ze=new Set(se);return ze.add(ie),ze})},getRecommendationResult:ie=>oe.get(ie),hasRecommendationResult:ie=>oe.has(ie),setActiveDelegationSession:ie=>{Z(ie)},getActiveDelegationSession:()=>be(q)?q:null,hasActiveDelegationSession:()=>be(q),refreshDelegationActivity:Ne,stopDelegationSession:ve,retryIntentAnalysis:Se};return m.jsx(qd.Provider,{value:Ot,children:P})};class Ch{constructor(){$r(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 y=this.roots.get(l.containerId);y&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),y.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const N=Cd.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),N.render(m.jsx(Vd,{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(ch,{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,N)}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 Eh=i=>{if(typeof i!="string")return;const l=i.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},Qd=class _o{constructor(l){if($r(this,"config"),$r(this,"apiBaseUrl"),$r(this,"renderer",null),$r(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 _o.createSession();try{const c=new URL(d).pathname.split("/").filter(N=>N.length>0),y=c[c.length-1];return y?`session_${Date.now()}_${y}`:_o.createSession()}catch{return _o.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 Ch),this.renderer}getTracker(){return this.tracker||(this.tracker=new ph({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,d,c,y){const N=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:y||{}})});if(!N.ok){const V=await N.text();throw new Error(`Delegation event failed (${N.status}): ${V}`)}const R=await N.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]},y=this.getRenderer(),N=this.getTracker();await y.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:N,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,y,N,R,V,S,v,W,E,B,M,P;const I=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const fe=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"),fe}const J=l.messageId;if(!J||J.trim()===""){const fe=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"),fe}const ee=_o.buildPlatformResponseCacheKey(l.sessionId,J),re=_o.inFlightPlatformResponses.get(ee);if(re)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:J}),re;const oe=l.messages?l.messages.length:0,ae=(typeof window<"u"&&window.navigator,"web"),q=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Z=Eh((d=l.location)==null?void 0:d.countryCode)||"US",U=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,de=l.userId??this.config.userId,me={spec_version:"1.0",message_id:J,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:de||"",confidence:de?1:0},consent:{status:"granted",source:"admesh_ui_sdk",scope:{intent_based_monetization:!0,agent_participation:!0,measurement:!0},constraints:{allow_identity_downstream:!1}},classification_input:{type:"interaction",interaction:{session:{id:l.sessionId,turn_index:oe},surface:{channel:l.platformSurface||"conversation",interaction_mode:"text",platform:ae,form_factor:q,locale:l.language||"en-US",country:Z,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((c=l.location)==null?void 0:c.city)||void 0,state:((y=l.location)==null?void 0:y.state)||void 0,state_code:((N=l.location)==null?void 0:N.stateCode)||void 0,country:((R=l.location)==null?void 0:R.country)||void 0,country_code:Z,zipcode:((V=l.location)==null?void 0:V.zipcode)||void 0,latitude:(S=l.location)==null?void 0:S.latitude,longitude:(v=l.location)==null?void 0:v.longitude},page:U}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(E=(W=me.classification_input.interaction)==null?void 0:W.input.query_text)!=null&&E.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const he=JSON.stringify(me);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:me.message_id,specVersion:me.spec_version,classificationType:me.classification_input.type,platformId:me.platform.platform_id,surfaceChannel:(B=me.classification_input.interaction)==null?void 0:B.surface.channel,sessionId:(P=(M=me.classification_input.interaction)==null?void 0:M.session)==null?void 0:P.id});const Be={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){Be["X-AdMesh-Source"]="extension";const fe=this.getExtensionSourceDomain();fe&&(Be["X-AdMesh-Source-Domain"]=fe)}const ne=(async()=>{const fe=await fetch(I,{method:"POST",headers:Be,body:he});if(!fe.ok){const Ie=(await fe.json().catch(()=>({}))).detail||`HTTP ${fe.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Ie}`)}const ye=await fe.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})();_o.inFlightPlatformResponses.set(ee,ne);try{return await ne}finally{_o.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 y=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${y}`)}}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)}};$r(Qd,"inFlightPlatformResponses",new Map);let Kd=Qd;const qd=x.createContext(void 0);function Gd(){const i=x.useContext(qd);if(!i)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return i}function Xd(){const i=Gd();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 Ah=({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"})]}),Ph=({recommendation:i,theme:l,sdk:d,sessionId:c,onExecuteQuery:y})=>{var N,R,V,S,v;const W=(R=(N=i.recommendation)==null?void 0:N.creative)!=null&&R.follow_up_suggestion&&(V=i.tracking)!=null&&V.followup_engagement_url&&(S=i.tracking)!=null&&S.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=W?.query,B=W?.engagement_url,M=W?.exposure_url,P=i.recommendation_id,I=((v=i.recommendation)==null?void 0:v.offerId)||P;if(!E||!B||!M)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const J=async()=>{try{B&&P&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await d.fireFollowupEngagement(B,P,c)),y&&E?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${E}`),await y(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(rl,{productId:I,recommendationId:P||"",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:J,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===" ")&&J()},"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(Ah,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Ka=({onRecommendationsShown:i,onError:l,messageId:d,query:c,userId:y,initialRecommendation:N,triggerExposureUrl:R=!0,followups_container_id:V,onPasteToInput:S,onDelegationConsent:v,onDelegationActivated:W,onStartDelegation:E,onRecommendationReport:B,onExecuteQuery:M,onFollowupDetected:P,isContainerReady:I})=>{var J,ee,re,oe;const{sdk:ae,sessionId:q,apiKey:Z,language:U,location:de,userId:me,model:he,messages:Be,theme:ne,getRecommendationResult:fe,hasRecommendationResult:ye,setRecommendationResult:Ie,activeDelegationSession:C,setActiveDelegationSession:H,hasActiveDelegationSession:le}=Xd(),ke=X=>!!X&&X.status==="generated"&&!!X.recommendation,Ee=y||me,[f,z]=x.useState(null),[G,te]=x.useState(null),[Se,be]=x.useState(!0),[Ae,Xe]=x.useState(null),ve=x.useRef(null),Ne=x.useRef(!1),Ot=x.useRef(!1),ie=x.useRef(i),_e=x.useRef(l);x.useEffect(()=>{ie.current=i,_e.current=l},[i,l]),x.useEffect(()=>{ve.current!==d&&(ve.current=null,Ot.current=!1,z(null),te(null))},[d]);const se=le()&&C?.session_id===q;x.useEffect(()=>{var X,Ke,K;if(!d||!ye(d)||se)return;const Le=fe(d);if(!Le){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),z(null),te(null),Xe(null),be(!1),ve.current=d,Ne.current=!1,Ot.current=!0;return}let Q=((X=Le.recommendation)==null?void 0:X.format)||"tail";(Q==="weave"||Q==="product_card")&&(Q="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:d,recommendationId:Le.recommendation_id,format:(Ke=Le.recommendation)==null?void 0:Ke.format}),z(Le),te(Q),Xe(null),be(!1),ve.current=d,Ne.current=!1,Ot.current=!0,(K=ie.current)==null||K.call(ie,d,Le)},[fe,ye,se,d]),x.useEffect(()=>{var X,Ke,K,Le,Q,Oe,Fe;if(!(!N||!d)&&!se)try{const yt=N,fn=N.status||"unknown";if(!ke(yt)){if(fn==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),z(null),te(null),Xe(null),be(!1),ve.current=d,Ne.current=!1,Ot.current=!0,Ie(d,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${fn})`)}let at=((X=yt.recommendation)==null?void 0:X.format)||"tail";(at==="weave"||at==="product_card")&&(at="tail"),z(yt),te(at),Xe(null),be(!1),ve.current=d,Ne.current=!1,Ot.current=!0,Ie(d,yt),(Ke=ie.current)==null||Ke.call(ie,d,yt),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:yt.recommendation_id,format:(K=yt.recommendation)==null?void 0:K.format,brandName:(Q=(Le=yt.recommendation)==null?void 0:Le.creative)==null?void 0:Q.brand_name,headline:(Fe=(Oe=yt.recommendation)==null?void 0:Oe.creative)==null?void 0:Fe.headline,hasTracking:!!yt.tracking})}catch(yt){const fn=yt instanceof Error?yt:new Error(String(yt));Ot.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${fn.message}`)}},[se,N,d,Ie]),x.useEffect(()=>{if(!d||!c||c.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),be(!1);return}if(se){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:d,conversationSessionId:q,delegationSessionId:C?.delegation_session_id}),z(null),te(null),Xe(null),be(!1),Ne.current=!1;return}if(!(ae!=null&&ae.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),be(!1);return}if(Ot.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(ve.current===d){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(Ne.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Fetch already in progress, skipping duplicate fetch");return}F.log("[AdMeshRecommendations] \u{1F4E4} Fetching recommendation from /aip/context (single fetch)"),(async()=>{var X,Ke,K,Le,Q,Oe,Fe,yt,fn;try{Ne.current=!0,be(!0),Xe(null);const at=await ae.fetchPlatformResponse({query:c.trim(),sessionId:q,messageId:d,language:U,location:de,userId:Ee,model:he,...Be&&Be.length>0&&{messages:Be}}),It=at?.status||"unknown";if(!ke(at)){if(It==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),z(null),te(null),Xe(null),be(!1),Ne.current=!1,ve.current=d,Ie(d,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${It})`)}z(at),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:d,recommendationId:at.recommendation_id,format:(X=at.recommendation)==null?void 0:X.format,brandName:(K=(Ke=at.recommendation)==null?void 0:Ke.creative)==null?void 0:K.brand_name,headline:(Q=(Le=at.recommendation)==null?void 0:Le.creative)==null?void 0:Q.headline,hasTracking:!!at.tracking});let Rn=((Oe=at.recommendation)==null?void 0:Oe.format)||"tail";(Rn==="weave"||Rn==="product_card")&&(Rn="tail"),te(Rn),ve.current=d,Ie(d,at),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Fe=at.recommendation)==null?void 0:Fe.format,selected_format:Rn}),be(!1),Ne.current=!1,(yt=ie.current)==null||yt.call(ie,d,at)}catch(at){const It=at instanceof Error?at:new Error(String(at));It.message.includes("Failed to fetch")||It.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${It.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${It.message} `),Xe(It),be(!1),Ne.current=!1,(fn=_e.current)==null||fn.call(_e,It)}})()},[C?.delegation_session_id,se,ae,q,d,c,U,de,Ee,he,N,Ie]),x.useEffect(()=>{var X,Ke,K,Le;if(!f||!P)return;const Q=(Ke=(X=f.recommendation)==null?void 0:X.creative)!=null&&Ke.follow_up_suggestion&&(K=f.tracking)!=null&&K.followup_engagement_url&&(Le=f.tracking)!=null&&Le.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;Q&&P(Q,f.recommendation_id)},[f,P]);const ze=x.useCallback(async X=>{if(!ae||!q)throw new Error("AdMesh SDK activation requires an initialized session");const Ke=await fetch(`${ae.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Z}`},body:JSON.stringify({session_id:q,recommendation_id:X.recommendation_id,metadata:X.metadata})});if(!Ke.ok){const Oe=await Ke.text();throw new Error(`Failed to activate delegation session: ${Ke.status} ${Oe}`)}const K=await Ke.json(),Le={...X,delegation_session_id:K.delegation_session_id||X.delegation_session_id,session_id:K.session_id||q,brand_id:K.brand_id||X.brand_id,brand_name:K.brand_name||X.brand_name,mcp_endpoint:K.mcp_endpoint,eligibility_reason:K.eligibility_reason||X.eligibility_reason,delegate_reason:K.delegate_reason||X.delegate_reason,session_goal:K.session_goal||X.session_goal,desired_outcome_type:K.desired_outcome_type||X.desired_outcome_type,required_user_inputs:K.required_user_inputs||X.required_user_inputs||[],required_consent_types:K.required_consent_types||X.required_consent_types||[],success_outcome:K.success_outcome||X.success_outcome,fallback_message:K.fallback_message||X.fallback_message,session_mode:"inline",status:K.status||"active",capabilities:K.capabilities||X.capabilities||[],allowed_data_types:K.allowed_data_types||X.allowed_data_types||[],auth_model:K.auth_model||X.auth_model,handoff_protocol:K.handoff_protocol||X.handoff_protocol,supported_actions:K.supported_actions||X.supported_actions||[],metadata:K.metadata||X.metadata},Q={delegation_session_id:K.delegation_session_id,recommendation_id:X.recommendation_id,session_id:K.session_id||q,brand_agent_id:K.brand_agent_id,brand_id:K.brand_id||X.brand_id,brand_name:K.brand_name||X.brand_name||"Brand",mcp_endpoint:K.mcp_endpoint,status:K.status||"active",activated_at:K.created_at,last_activity_at:K.updated_at,expires_at:K.expires_at||K.updated_at,eligibility_reason:K.eligibility_reason||X.eligibility_reason,delegate_reason:K.delegate_reason||X.delegate_reason,session_goal:K.session_goal||X.session_goal,desired_outcome_type:K.desired_outcome_type||X.desired_outcome_type,required_user_inputs:K.required_user_inputs||X.required_user_inputs||[],required_consent_types:K.required_consent_types||X.required_consent_types||[],success_outcome:K.success_outcome||X.success_outcome,fallback_message:K.fallback_message||X.fallback_message,capabilities:K.capabilities||X.capabilities||[],allowed_data_types:K.allowed_data_types||X.allowed_data_types||[],consent_requirements:K.consent_requirements||X.consent_requirements||[],auth_model:K.auth_model||X.auth_model,handoff_protocol:K.handoff_protocol||X.handoff_protocol,supported_actions:K.supported_actions||X.supported_actions||[],metadata:K.metadata||X.metadata};if(H(Q),await ae.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:q,recommendation_id:X.recommendation_id,delegation_session_id:K.delegation_session_id,brand_name:Q.brand_name,status:K.status||"active",metadata:{brand_agent_id:K.brand_agent_id,source:"recommendation_card"}}).catch(Oe=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",Oe)}),await ae.reportDelegationSessionStarted(Q,{brand_agent_id:K.brand_agent_id,brand_name:Q.brand_name}).then(Oe=>{Oe&&H(Oe)}).catch(Oe=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",Oe)}),W){try{await W(Le)}catch(Oe){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",Oe)}return}if(E)try{await E({...X.platform_response,delegation:{...X.platform_response.delegation,...Le,delegation_session_id:K.delegation_session_id,available:!0,status:K.status||"active"}})}catch(Oe){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",Oe)}},[Z,W,E,ae,q,H]),De=x.useCallback(async X=>{var Ke,K;if(B){await B(X);return}!ae||!q||await ae.reportSponsoredRecommendation({session_id:q,message_id:d,recommendation_id:X.recommendation_id,reason:X.reason,brand_name:(K=(Ke=X.recommendation.recommendation)==null?void 0:Ke.creative)==null?void 0:K.brand_name,metadata:{reason:X.reason,source:"recommendation_card"}}).catch(Le=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",Le)})},[d,B,ae,q]);if(!d||!c||c.trim()===""||Se||Ae)return null;if(!f||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:d,hasPlatformResult:!!f,detectedFormat:G,isLoading:Se,hasError:!!Ae}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:d,recommendationId:f.recommendation_id,detectedFormat:G,brandName:(ee=(J=f.recommendation)==null?void 0:J.creative)==null?void 0:ee.brand_name,headline:(oe=(re=f.recommendation)==null?void 0:re.creative)==null?void 0:oe.headline});const Gt=typeof document<"u"&&V&&(I??!0)?document.getElementById(V):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(Od,{recommendations:[f],theme:ne,sessionId:q,triggerExposureUrl:R,onPasteToInput:S,onDelegationConsent:v,onDelegationActivated:ze,onStartDelegation:E,onRecommendationReport:De})}),Gt&&ae&&q?el.createPortal(m.jsx(Ph,{recommendation:f,theme:ne,sdk:ae,sessionId:q,onExecuteQuery:M}),Gt):null]})},ol="admesh-ui-sdk-styles",al="admesh-ui-sdk-reset",zh=`
|
|
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(C.textContent||"")).slice(0,6e3)},c=fh(window.location.pathname||"/"),v=l(document.title||"")||c,I=(()=>{const _=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach(B=>{const C=l(B.textContent||"");C.length>0&&_.push(C)}),_})(),D=I.length>0?I:[v||c],q={title:v,headings:D,article_text:d(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:q.title,headingsCount:q.headings.length,articleTextLength:((s=q.article_text)==null?void 0:s.length)||0,domain:q.domain}),q}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function gh(s){return!!(s&&typeof s=="object"&&"recommendation_id"in s&&"status"in s)}function bh(s){var l,d,c,v,I,D,q,_,y,B,C;if(!s||typeof s!="object")return;if(gh(s))return s;const W=s;if(!W.recommendation_id)return;const M=(W.products||[]).map(A=>{var H,U;return{product_id:A.product_id||"",product_link:A.product_link||A.product_click_url||W.click_url||W.url||"",product_name:A.product_name||W.title||((H=W.creative_input)==null?void 0:H.product_name)||"",product_description:A.product_description||"",product_price:A.product_price??void 0,product_discount:A.product_discount??void 0,product_currency:A.product_currency,product_discount_type:A.product_discount_type,product_cta_label:A.product_cta_label||((U=W.creative_input)==null?void 0:U.cta_label),product_image_url:A.product_image_url,product_features:A.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:((I=W.creative_input)==null?void 0:I.cta_label)||((D=M[0])==null?void 0:D.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(_=(q=W.creative_input)==null?void 0:q.assets)==null?void 0:_.logo_url,image_urls:((B=(y=W.creative_input)==null?void 0:y.assets)==null?void 0:B.image_urls)||[],landing_page_url:W.url||W.click_url||((C=W.creative_input)==null?void 0:C.cta_url)||"",products:M}},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 yh(s){return{...s,suggestions:(s.suggestions||[]).map(l=>({...l,recommendation:bh(l.recommendation)}))}}function Hd(s){try{const l=new URL(s).pathname.split("/").filter(d=>d.length>0);return l[l.length-1]||void 0}catch{return}}async function vh(s,l){var d,c,v,I,D;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:s.url});const q=Array.isArray(s.headings)?s.headings:[],_=(d=Hd(s.url))==null?void 0:d.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=_?_.replace(/\b\w/g,te=>te.toUpperCase()):void 0,B=l.apiKey.toLowerCase().startsWith("pub_")?Hd(s.url):void 0,C=l.extension?"extension":"admesh_ui_sdk",W=(s.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),M={url:s.url,title:s.title||void 0,headings:q.length>0?q:y?[y]:void 0,article_text:((c=s.article_text)==null?void 0:c.trim())||void 0,domain:W,article_slug:B,agent_id:void 0,cpx_floor:void 0,source:C,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:M.url,titleLength:((v=M.title)==null?void 0:v.length)||0,headingsCount:((I=M.headings)==null?void 0:I.length)||0,articleTextLength:((D=M.article_text)==null?void 0:D.length)||0,domain:M.domain,article_slug:M.article_slug,source:M.source,has_user_id:!!M.user_id});const A=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",A);const H=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(M)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:H.status,statusText:H.statusText,ok:H.ok}),!H.ok){const te=await H.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:H.status,statusText:H.statusText,errorText:te}),new Error(`ACIE API error: ${H.status} - ${te}`)}const U=await H.json(),ee=yh(U);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:s.url,suggestionsCount:ee.suggestions.length}),ee}catch(q){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",q),null}}async function xh(s,l){var d,c;const v=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),I=new URLSearchParams({url:s.trim()});(d=l.agentDisplayId)!=null&&d.trim()&&I.set("agent_display_id",l.agentDisplayId.trim()),(c=l.publisherId)!=null&&c.trim()&&I.set("publisher_id",l.publisherId.trim());const D=await fetch(`${v}/publisher-assistant/page-context?${I.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!D.ok){const q=await D.text().catch(()=>"");throw new Error(`Page context request failed (${D.status}): ${q||D.statusText}`)}return await D.json()}function wh(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function kh(){var s;if(typeof window>"u")return null;try{const l=(s=window.location.href)==null?void 0:s.trim();if(Bd(l))return l}catch{return null}return null}function Bd(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return d.protocol==="http:"||d.protocol==="https:"}catch{return!1}}function _h(s){try{const l=new URL(s),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 Vd(s){const l=new URL(s),d=_h(s);return{title:d,headings:[d],article_text:`Article URL: ${s}
|
|
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=`
|
|
238
238
|
/* AdMesh UI SDK - CSS Reset & Normalization */
|
|
239
239
|
.admesh-component,
|
|
240
240
|
.admesh-component * {
|
|
@@ -323,7 +323,7 @@ Article topic inferred from URL path: ${d}`,url:i,domain:l.hostname,extracted_at
|
|
|
323
323
|
.admesh-component[data-admesh-theme="light"] {
|
|
324
324
|
color-scheme: light;
|
|
325
325
|
}
|
|
326
|
-
`,
|
|
326
|
+
`,Ih=`
|
|
327
327
|
/* AdMesh Core Component Styles */
|
|
328
328
|
|
|
329
329
|
.admesh-component {
|
|
@@ -534,7 +534,7 @@ Article topic inferred from URL path: ${d}`,url:i,domain:l.hostname,extracted_at
|
|
|
534
534
|
font-size: 0.875rem;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
`,
|
|
537
|
+
`,jh=()=>{if(!(typeof document>"u")&&!(document.getElementById(al)&&document.getElementById(ol))){if(!document.getElementById(al)){const s=document.createElement("style");s.id=al,s.textContent=Mh,document.head.appendChild(s)}if(!document.getElementById(ol)){const s=document.createElement("style");s.id=ol,s.textContent=Ih,document.head.appendChild(s)}}},Nh=`
|
|
538
538
|
/* AdMesh UI SDK - Complete Self-Contained Styles */
|
|
539
539
|
|
|
540
540
|
/* CSS Reset for AdMesh components */
|
|
@@ -1202,17 +1202,17 @@ Article topic inferred from URL path: ${d}`,url:i,domain:l.hostname,extracted_at
|
|
|
1202
1202
|
.admesh-component .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1203
1203
|
.admesh-component .lg\\:col-span-1 { grid-column: span 1 / span 1; }
|
|
1204
1204
|
}
|
|
1205
|
-
`;let Jd=!1;const
|
|
1206
|
-
${
|
|
1207
|
-
| `),
|
|
1208
|
-
`),
|
|
1209
|
-
`).map(ee=>ee.trim()).filter(Boolean)),
|
|
1210
|
-
`),
|
|
1211
|
-
`)},
|
|
1212
|
-
`),
|
|
1213
|
-
`)})(
|
|
1214
|
-
`).map(ae=>ae.trim()).filter(Boolean),J=I.every(ae=>/^[-*]\s+/.test(ae)),ee=I.every(ae=>/^\d+\.\s+/.test(ae)),re=I.length===1&&/^#{1,3}\s+/.test(I[0]),oe=v(I);if(re){const ae=I[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ae)},P)}if(oe){const{heading:ae,lines:q}=S(I),Z=y(q[0]),U=q.slice(2).map(y).filter(de=>de.length===Z.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ae?m.jsx("p",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:d},children:c(ae)}):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:Z.length>3?520:void 0,borderCollapse:"collapse",color:l.textColor,fontSize:d,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Z.map((de,me)=>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(de)},me))})}),m.jsx("tbody",{children:U.map((de,me)=>m.jsx("tr",{children:de.map((he,Be)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:me===U.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(he)},Be))},me))})]})})]},P)}if(J||ee){const ae=ee?"ol":"ul";return m.jsx(ae,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:d},children:I.map((q,Z)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:c(q.replace(/^([-*]|\d+\.)\s+/,""))},Z))},P)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:d,whiteSpace:"pre-wrap"},children:I.map((ae,q)=>m.jsxs(x.Fragment,{children:[q>0&&m.jsx("br",{}),c(ae)]},q))},P)})})};function qa(i){return i===void 0?void 0:typeof i=="number"?`${i}px`:i}function Zd(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 Eo(i){return i.replace(/\s+/g," ").trim()}function Lh(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),y=l.find(R=>R?.is_sponsored);if(!y)return c.length?c:d;const N=c.length?c:d;return[y,...N].slice(0,4)}function $h(i,l,d,c){const y=new Set,N=[],R=(E,B="information")=>{const M=Eo(E);if(!M)return;const P=M.toLowerCase();y.has(P)||(y.add(P),N.push({id:`followup_${N.length}_${P.replace(/[^a-z0-9]+/g,"_")}`,text:M,type:B,is_sponsored:!1}))},V=new Set,S=E=>{const B=Eo(E||"");if(!B)return;const M=B.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();M&&V.add(M)};(c||[]).forEach(E=>S(E?.title)),(d||[]).forEach(E=>S(E?.title)),l.split(/\n+/).map(E=>Eo(E.replace(/^[-*]\s+/,""))).filter(Boolean).filter(E=>E.length>=24&&E.length<=90).forEach(E=>{V.size>=6||S(E)});const v=Eo(i.replace(/[?.!]+$/g,"")),W=Array.from(V).slice(0,3);return[W[0]?`Tell me more about ${W[0]}`:"",W[1]?`Show me examples related to ${W[1]}`:"",W[2]?`Compare the main options for ${W[2]}`:"","Break this down more simply",`What should I look at next about ${v}`,"Give me the practical takeaway here"].forEach((E,B)=>{N.length>=3||R(E,B===0?"comparison":"information")}),N.slice(0,3)}function Fh(){if(typeof window>"u")return"unknown";const i=window.innerWidth;return i<768?"mobile":i<1024?"tablet":"desktop"}function Yd(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 ec(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 tc(){var i;try{const l=(i=window.location.href)==null?void 0:i.trim();if(ec(l))return l}catch{return}}function nc(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=tc()||(ec(i)?i.trim():void 0);let d=l?window.location.pathname||"/":void 0;try{d=l?new URL(l).pathname||"/":void 0}catch{d=tc()?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:Fh()}}function Oh(i){var l,d;const c=(d=(l=i?.recommendation)==null?void 0:l.creative)==null?void 0:d.follow_up_suggestion,y=i?.recommendation_id;return!c||!y?null:{id:y,text:Eo(c),type:"action",is_sponsored:!0,recommendation:i,metadata:{source:"assistant_query_recommendation",recommendation_id:y}}}function sl(i){return[...i].sort((l,d)=>{const c=!!l.is_sponsored,y=!!d.is_sponsored;return c===y?0:c?-1:1})}const Wh={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)"}},Uh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},Bh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Hh=({theme:i,className:l,style:d,triggerLabel:c="Ask Ava",headerTitle:y="Ask Ava",headerLogoUrl:N,showHeader:R=!0,showHeaderTitle:V=!0,showSubtitle:S=!0,layout:v="floating",surface:W="page",adSlotBehavior:E="expand",showCompactSlotHeader:B=!0,showCompactWelcomeMessage:M=!0,showCompactSlotInput:P=!0,showCompactSlotDisclaimer:I=!0,panelWidth:J,panelHeight:ee,analyticsPageUrl:re,fontScale:oe=1,position:ae="bottom-right",size:q="md",defaultOpen:Z,open:U,onOpenChange:de,autoOpen:me=!1,showWelcomeMessage:he=!1,welcomeMessage:Be="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:ne="Ask me anything about products...",adsEnabled:fe=!0,suggestions:ye,maxSuggestions:Ie=6,suggestionStyle:C="carousel",suggestionTrigger:H="always",suggestionPlacement:le="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:f="default",queryHandler:z,suggestionsLoader:G,disclaimerText:te,poweredByLabel:Se="Powered by AdMesh",subtitle:be="Publisher Assistant",onOpen:Ae,onClose:Xe})=>{const{sdk:ve,sessionId:Ne,theme:Ot,apiKey:ie,userId:_e}=Xd(),{suggestions:se,isAnalyzingIntent:ze,intentError:De,retryIntentAnalysis:Gt,activeDelegationSession:X,hasActiveDelegationSession:Ke,stopDelegationSession:K,refreshDelegationActivity:Le}=Gd();jh(),console.log("[AdMeshIntentAssistant] Context:",{sdk:ve,sessionId:Ne,hasContextTheme:!!Ot});const Q=i||Ot||Wh,Oe=Q?.mode||"light",Fe=W==="ad-slot",yt=(p=!1)=>Fe&&!(p&&E==="expand"),[fn,at]=x.useState(Z||me),It=U!==void 0,Rn=It?U:fn,[ln,Or]=x.useState(""),[oa,Xt]=x.useState(!1),[Ye,dt]=x.useState([]),[Te,hn]=x.useState(!1),[Sn,Wr]=x.useState(null),[ce,on]=x.useState(!1),[Cn,Ln]=x.useState(new Set),[xe,He]=x.useState(ye||se||[]),[$n,vr]=x.useState(0),[xr,er]=x.useState(0),[Ur,aa]=x.useState({}),Ao=x.useRef(null),ur=x.useRef(!1),un=x.useRef(null),Po=x.useRef(new Map),Br=x.useRef([]),zo=x.useRef(null),En=x.useRef(null),_t=x.useRef(null),Vt=x.useRef(!1),wr=x.useRef(!1),ia=x.useRef(null),sa=x.useRef(null),Xa=x.useRef(null),[la,Mo]=x.useState(!1),[To,Hr]=x.useState(!1),Jt=x.useRef(null),jt=x.useRef(null),Vr=!!(ie!=null&&ie.toLowerCase().startsWith("pub_")),et=Ke()&&X?.session_id===Ne?X:null,ua=x.useRef(new Set),Ja=x.useRef(new Set),dr=x.useRef(!1),An=Fe&&E==="expand"&&(ce||Te),[da,Ui]=x.useState(!1);x.useEffect(()=>{if(typeof window>"u")return;const p=window.matchMedia("(max-width: 767px)"),j=()=>Ui(p.matches);return j(),p.addEventListener("change",j),()=>p.removeEventListener("change",j)},[]),x.useEffect(()=>{if(!An||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[An]);const ca=Fe&&E==="sticky"&&(ce||Ye.length>0||Te),tr=qa(J)??"100%",nr=qa(ee)??"100%",pa=Zd(J),Fn=Zd(ee),dn=Fe&&(Fn??Number.POSITIVE_INFINITY)<=60,cn=Fe&&(pa??Number.POSITIVE_INFINITY)<=360&&(Fn??Number.POSITIVE_INFINITY)<=120,Io=x.useCallback(p=>j=>{j?Po.current.set(p,j):Po.current.delete(p)},[]),ht=x.useCallback(async(p,j={})=>{if(!(!ve||!Ne))try{await ve.trackPublisherAssistantEvent({event_name:p,timestamp:new Date().toISOString(),session_id:Ne,...nc(re),...j})}catch(D){console.warn(`[AdMeshIntentAssistant] Failed to track ${p}`,D)}},[re,ve,Ne]),Qr=x.useCallback((p,j,D)=>{var $,Y;const pe=j?.recommendation_id;if(!pe)return;const Ze=`${p}:${pe}`;Ja.current.has(Ze)||(Ja.current.add(Ze),ht("recommendation_shown",{message_id:p,query:D,recommendation_id:pe,brand_name:(Y=($=j.recommendation)==null?void 0:$.creative)==null?void 0:Y.brand_name,is_sponsored:!0}))},[ht]),Kr=x.useCallback((p,j,D,$,Y,pe)=>{const Ze=Array.isArray(pe)&&pe.length?pe.map(($e,We)=>{const wt=Eo($e.text||"");return wt?{id:`followup_llm_${We}_${wt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:wt,type:$e.type||"information",is_sponsored:!1}:null}).filter($e=>!!$e).slice(0,3):$h(p,j,D,$),Ct=Oh(Y),Dt=Ct?[Ct,...Ze.slice(0,2)]:Ze.slice(0,3);Dt.length&&He(sl(Dt))},[]),jo=x.useCallback((p,j)=>{const D=Eo(p.query||p.label||"");if(!D||!j)return;const $={id:j,text:D,type:"action",is_sponsored:!0,recommendation:{recommendation_id:j,recommendation:{creative:{follow_up_suggestion:D}},tracking:{followup_engagement_url:p.engagement_url,followup_exposure_url:p.exposure_url}}};He(Y=>{const pe=Y.filter(Ze=>!Ze.is_sponsored).slice(0,3);return sl([$,...pe].slice(0,4))})},[]),gn=x.useCallback(()=>{const p=zo.current,j=En.current;if(!p||!j)return!1;const D=p.getBoundingClientRect(),$=j.getBoundingClientRect(),Y=Math.max(0,p.scrollTop+$.top-D.top);return p.scrollTop=Y,!0},[]);x.useLayoutEffect(()=>{var p;if(Vt.current){gn()&&(Vt.current=!1);return}wr.current||(p=sa.current)==null||p.scrollIntoView({behavior:"smooth"})},[Ye,gn]),x.useLayoutEffect(()=>{if(!Fe||An)return;const p=ia.current;if(!p)return;const j=p.closest(".admesh-publisher-assistant-reactMount"),D=nr;[p,j].forEach(Y=>{Y&&(Y.style.width=tr,Y.style.maxWidth=tr,Y.style.height=D,Y.style.maxHeight=D,Y.style.overflow="hidden",Y.style.boxSizing="border-box",Y.dataset.admeshAdSlotExpanded=ca?"true":"false")});const $=j?.parentElement;$&&$!==document.body&&$!==document.documentElement&&($.style.width=tr,$.style.maxWidth=tr,$.style.height=D,$.style.maxHeight=D,$.style.overflow="hidden",$.style.boxSizing="border-box")},[nr,tr,An,Fe,ca]),x.useEffect(()=>{if(ye&&ye.length){He(ye);return}se&&se.length&&He(p=>Lh(p,se))},[ye,se]),x.useEffect(()=>{if(f!=="default"||!G)return;let p=!1;return G().then(j=>{!p&&Array.isArray(j)&&j.length&&He(j)}).catch(j=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",j)}),()=>{p=!0}},[G,f]),x.useEffect(()=>{if(!Te){er(0),Ao.current=null;return}Ao.current==null&&(Ao.current=typeof performance<"u"?performance.now():Date.now());const p=()=>{const D=Ao.current;if(D==null)return;const $=typeof performance<"u"?performance.now():Date.now();er(Math.floor(($-D)/1e3))};p();const j=window.setInterval(p,1e3);return()=>window.clearInterval(j)},[Te]),x.useEffect(()=>{if(!Te||f!=="default"){vr(0);return}const p=window.setInterval(()=>{vr(j=>Math.min(j+1,7))},3e3);return()=>window.clearInterval(p)},[Te,f]),x.useEffect(()=>{dr.current||!ve||!Ne||(dr.current=!0,ht("assistant_loaded",{metadata:{layout:v,surface:W,variant:f,default_open:Z||me}}))},[me,Z,v,ve,Ne,W,ht,f]);const On=x.useCallback(p=>{It?de?.(p):at(p),p?(ht("assistant_opened",{metadata:{layout:v,surface:W,ad_slot_behavior:E,variant:f,expanded:ce}}),Ae?.()):Xe?.()},[It,ce,v,de,Ae,Xe,W,ht,f]),Za=x.useCallback(()=>{On(!0)},[On]),Ya=x.useCallback(()=>{On(!1)},[On]),qr=x.useCallback(()=>{on(p=>!p)},[]),ei=x.useCallback(async(p,j,D,$,Y,pe,Ze)=>{var Ct,Dt,$e;if(!ve)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{et&&await Le("turn_started",{source:"publisher_assistant",recommendation_id:et.recommendation_id}).catch(gt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",gt)});const We=await fetch(`${ve.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:pe,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ie}`},body:JSON.stringify({message:p,session_id:Ne||"default-session",message_id:j,user_id:_e,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:nc(re),conversation_history:Ze,sponsored_recommendation:Y!=null&&Y.recommendation_id?{recommendation_id:Y.recommendation_id,brand_name:(Dt=(Ct=Y.recommendation)==null?void 0:Ct.creative)==null?void 0:Dt.brand_name}:void 0,active_delegation_session:et?{delegation_session_id:et.delegation_session_id,recommendation_id:et.recommendation_id,session_id:et.session_id,brand_name:et.brand_name,mcp_endpoint:et.mcp_endpoint,status:et.status}:void 0}})});if(!We.ok)throw new Error(`API request failed: ${We.status} ${We.statusText}`);const wt=($e=We.body)==null?void 0:$e.getReader(),Kt=new TextDecoder;if(!wt)throw new Error("Response body is not readable");let Ut="",Zt,Hn,sn,Pe,Ue;return await(async()=>{try{for(;;){const{done:gt,value:st}=await wt.read();if(gt)break;const yn=Kt.decode(st,{stream:!0}).split(`
|
|
1215
|
-
`);for(const Bt of yn)if(Bt.startsWith("data: ")){const Et=Bt.slice(6);if(Et.trim()==="[DONE]")return et&&Le("turn_completed",{source:"publisher_assistant",recommendation_id:et.recommendation_id}).catch(bt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",bt)}),{text:Ut,source_links:Zt,related_items:Hn,followup_suggestions:sn,used_capability:Pe,response_time_ms:Ue};try{const bt=JSON.parse(Et);switch(bt.type){case"content":{const Ki=bt.content||"";Ut+=Ki,D?.(Ki);break}case"final":{Ut=bt.reply||Ut,Zt=Array.isArray(bt.source_links)?bt.source_links:void 0,Hn=Array.isArray(bt.related_items)?bt.related_items:void 0,sn=Array.isArray(bt.followup_suggestions)?bt.followup_suggestions:void 0,Pe=typeof bt.used_capability=="string"?bt.used_capability:Pe,Ue=typeof bt.response_time_ms=="number"?bt.response_time_ms:Ue;break}case"followup_suggestions":{sn=Array.isArray(bt.followup_suggestions)?bt.followup_suggestions:sn;break}case"error":throw new Error(bt.message||"Unknown streaming error");case"session_start":$?.(),console.log("Session started:",bt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",Et);continue}}}}catch(gt){if(pe!=null&&pe.aborted)return{text:Ut,source_links:Zt,related_items:Hn,followup_suggestions:sn,used_capability:Pe,response_time_ms:Ue,error:"aborted"};throw console.error("Stream processing error:",gt),gt}finally{wt.releaseLock()}return{text:Ut,source_links:Zt,related_items:Hn,followup_suggestions:sn,used_capability:Pe,response_time_ms:Ue}})()}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"})}},[ve,Ne,ie,_e,et,Le]),ma=x.useCallback(()=>{const p=Jt.current;if(!p||p.signal.aborted)return;p.abort(),hn(!1),un.current=null,ur.current=!1;const j=jt.current;j&&dt(D=>D.map($=>$.id===j&&!$.content.trim()?{...$,content:"Generation stopped."}:$))},[]),bn=x.useCallback(async p=>{var j,D,$,Y,pe,Ze,Ct,Dt;if(!p.trim()||Te)return;const $e=typeof performance<"u"?performance.now():Date.now(),We=p.trim(),wt=Date.now().toString(),Kt=new AbortController,Ut=un.current,Zt=Ut?.recommendation||null,Hn=Ye.filter(Pe=>(Pe.role==="user"||Pe.role==="assistant")&&Pe.content.trim()).slice(-6).map(Pe=>({role:Pe.role,content:Pe.content.trim().slice(0,1200)}));Jt.current=Kt,jt.current=null,_t.current=wt,Vt.current=!0,wr.current=!0,un.current=null,He(Pe=>Pe.some(Ue=>Ue.is_sponsored)?Pe.filter(Ue=>!Ue.is_sponsored):Pe),Wr(null);const sn={id:wt,role:"user",content:We,timestamp:new Date};if(ht("query_submitted",{message_id:wt,query:We}),dt(Pe=>[...Pe,sn]),Or(""),hn(!0),f==="default"&&z){try{const Pe=(Date.now()+1).toString(),Ue={id:Pe,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:null};ur.current&&(Ln(yn=>new Set([...yn,Pe])),ur.current=!1),dt(yn=>[...yn,Ue]),jt.current=Pe;const gt=await z(We,{sponsoredSuggestion:Ut});if(Kt.signal.aborted){un.current=null;return}const st=gt.recommendation||Zt||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:p,hasResponseRecommendation:!!gt.recommendation,hasSponsoredSuggestionRecommendation:!!Zt,finalRecommendationId:st?.recommendation_id}),dt(yn=>yn.map(Bt=>Bt.id===Pe?{...Bt,content:gt.answer,sourceLinks:gt.source_links,relatedItems:gt.related_items,initialRecommendation:st,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-$e}:Bt)),Kr(We,gt.answer,gt.source_links,gt.related_items,gt.recommendation||null,gt.followup_suggestions),ht("answer_completed",{message_id:Pe,query:We,recommendation_id:st?.recommendation_id,brand_name:(D=(j=st?.recommendation)==null?void 0:j.creative)==null?void 0:D.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:"completed",metadata:{variant:f,source:"query_handler"}}),un.current=null}catch(Pe){console.error("Error sending message:",Pe);const Ue=Pe instanceof Error?Pe.message:"Unknown error occurred";Wr(Ue);const gt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};dt(st=>[...st,gt]),ht("answer_failed",{query:We,status:Ue,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,metadata:{variant:f,source:"query_handler"}}),un.current=null}finally{Jt.current===Kt&&(Jt.current=null,jt.current=null,hn(!1))}return}if(!ve){setTimeout(()=>{if(Kt.signal.aborted){Jt.current===Kt&&(Jt.current=null,jt.current=null);return}const Pe={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};dt(Ue=>[...Ue,Pe]),Jt.current===Kt&&(Jt.current=null,jt.current=null,hn(!1))},1e3);return}try{const Pe=(Date.now()+1).toString(),Ue=Zt,gt={id:Pe,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:Ue};ur.current&&(Ln(Bt=>new Set([...Bt,Pe])),ur.current=!1),dt(Bt=>[...Bt,gt]),jt.current=Pe;const st=await ei(We,wt,Bt=>{dt(Et=>Et.map(bt=>bt.id===Pe?{...bt,content:bt.content+Bt}:bt))},()=>{hn(!0),vr(0)},Ue,Kt.signal,Hn);if(Kt.signal.aborted){st.text.trim()||dt(Bt=>Bt.map(Et=>Et.id===Pe&&!Et.content.trim()?{...Et,content:"Generation stopped."}:Et)),ht("answer_failed",{message_id:Pe,query:We,recommendation_id:Ue?.recommendation_id,brand_name:(Y=($=Ue?.recommendation)==null?void 0:$.creative)==null?void 0:Y.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:"aborted",metadata:{variant:f,source:"api_chat_assistant"}}),un.current=null;return}const yn=typeof st.response_time_ms=="number"?st.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-$e;dt(Bt=>Bt.map(Et=>Et.id===Pe?{...Et,content:st.text,sourceLinks:st.source_links,relatedItems:st.related_items,initialRecommendation:Et.initialRecommendation||Ue,responseTimeMs:yn}:Et)),Kr(We,st.text,st.source_links,st.related_items,null,st.followup_suggestions),st.error?ht("answer_failed",{message_id:Pe,query:We,recommendation_id:Ue?.recommendation_id,brand_name:(Ze=(pe=Ue?.recommendation)==null?void 0:pe.creative)==null?void 0:Ze.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:st.error,metadata:{variant:f,source:"api_chat_assistant"}}):ht("answer_completed",{message_id:Pe,query:We,recommendation_id:Ue?.recommendation_id,brand_name:(Dt=(Ct=Ue?.recommendation)==null?void 0:Ct.creative)==null?void 0:Dt.brand_name,used_capability:st.used_capability,latency_ms:yn,status:"completed",metadata:{variant:f,source:"api_chat_assistant",response_time_ms:yn}}),un.current=null}catch(Pe){console.error("Error sending message:",Pe);const Ue=Pe instanceof Error?Pe.message:"Unknown error occurred";Wr(Ue);const gt={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};dt(st=>[...st,gt]),ht("answer_failed",{query:We,latency_ms:(typeof performance<"u"?performance.now():Date.now())-$e,status:Ue,metadata:{variant:f,source:"api_chat_assistant"}}),un.current=null}finally{Jt.current===Kt&&(Jt.current=null,jt.current=null,hn(!1))}},[Te,ei,z,Kr,ve,ht,f]),cr=xe,No=x.useMemo(()=>cr.some(p=>p?.is_sponsored),[cr]),Do=x.useMemo(()=>cr.filter(p=>p&&typeof p.id=="string"?Ee?No:!0:!1),[No,Ee,cr]),zt=x.useMemo(()=>sl(Do),[Do]),Gr=x.useMemo(()=>ke==="below-input-container"&&fe?zt.find(p=>p.is_sponsored&&p.recommendation)??null:null,[fe,zt,ke]),Ro=x.useCallback(async p=>{var j,D,$,Y,pe,Ze,Ct;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:p.text,is_sponsored:p.is_sponsored,hasRecommendation:!!p.recommendation,recommendationId:((j=p.recommendation)==null?void 0:j.recommendation_id)||void 0,hasFollowupEngagementUrl:!!(($=(D=p.recommendation)==null?void 0:D.tracking)!=null&&$.followup_engagement_url),sessionId:Ne}),ur.current=p.is_sponsored||!1,un.current=p.is_sponsored?p:null;const Dt=zt.findIndex($e=>$e.id===p.id);ht("suggestion_clicked",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:Dt>=0?Dt:void 0,is_sponsored:p.is_sponsored,recommendation_id:(Y=p.recommendation)==null?void 0:Y.recommendation_id,brand_name:(Ct=(Ze=(pe=p.recommendation)==null?void 0:pe.recommendation)==null?void 0:Ze.creative)==null?void 0:Ct.brand_name,query:p.text}),bn(p.text),p.is_sponsored&&p.recommendation&&ve?setTimeout(async()=>{var $e;try{const We=($e=p.recommendation.tracking)==null?void 0:$e.followup_engagement_url,wt=p.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:We,recommendationId:wt,sessionId:Ne}),We&&wt&&Ne?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await ve.fireFollowupEngagement(We,wt,Ne),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!We,hasRecommendationId:!!wt,hasSessionId:!!Ne})}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")},[bn,zt,ve,Ne,ht]),kr=Bh[ae],Wn=Uh[q];x.useEffect(()=>{if(Br.current.forEach(p=>p()),Br.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return zt.forEach((p,j)=>{const D=Po.current.get(p.id);if(!D)return;const $=`${Ne||"anonymous"}:${p.id}:${p.is_sponsored?"s":"o"}`;if(ua.current.has($))return;let Y=null,pe=null;const Ze=()=>{Y&&(clearTimeout(Y),Y=null),pe?.disconnect(),pe=null},Ct=()=>{var Dt,$e,We,wt,Kt;if(ua.current.has($)){Ze();return}if(ua.current.add($),Ze(),ht("suggestion_exposure",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:j,is_sponsored:p.is_sponsored,recommendation_id:(Dt=p.recommendation)==null?void 0:Dt.recommendation_id,brand_name:(wt=(We=($e=p.recommendation)==null?void 0:$e.recommendation)==null?void 0:We.creative)==null?void 0:wt.brand_name}),ve&&Ne&&p.is_sponsored&&p.recommendation){const Ut=(Kt=p.recommendation.tracking)==null?void 0:Kt.followup_exposure_url,Zt=p.recommendation.recommendation_id;Ut&&Zt?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Ut,recommendationId:Zt,suggestionText:p.text,sessionId:Ne}),ve.fireFollowupExposure(Ut,Zt,Ne)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Ut,hasRecommendationId:!!Zt,suggestionText:p.text})}};pe=new IntersectionObserver(Dt=>{const $e=Dt[0];if($e){if($e.intersectionRatio>=.5){Y||(Y=setTimeout(Ct,1e3));return}Y&&(clearTimeout(Y),Y=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),pe.observe(D),Br.current.push(Ze)}),()=>{Br.current.forEach(p=>p()),Br.current=[]}},[zt,ve,Ne,ht,oa]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:cr.length,safeSuggestions:Do.length,isAnalyzingIntent:ze,hasIntentError:!!De,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:No,sponsoredCount:cr.filter(p=>p?.is_sponsored).length,nonSponsoredCount:cr.filter(p=>p&&!(p!=null&&p.is_sponsored)).length,modalShouldAppear:Ee?No:!0,suggestions:cr.map(p=>{var j,D,$;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((j=p?.recommendation)==null?void 0:j.recommendation_id)||void 0,hasFollowupEngagementUrl:!!(($=(D=p?.recommendation)==null?void 0:D.tracking)!=null&&$.followup_engagement_url)}}),renderedSuggestions:zt.map(p=>{var j,D,$;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((j=p?.recommendation)==null?void 0:j.recommendation_id)||void 0,hasFollowupEngagementUrl:!!(($=(D=p?.recommendation)==null?void 0:D.tracking)!=null&&$.followup_engagement_url)}})});const tt={base:`${16*oe}px`,sm:`${14*oe}px`,xs:`${12*oe}px`},fa=te||"AI-generated responses may contain errors. Please verify important information independently.",Xr=["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..."],Un=p=>{const j=p?.accentColor||Pn,D=p?.metaColor||fr,$=p?.includeSteps??f==="default",Y=`${xr}s`,pe=$?`${Xr[$n]} (${Y})`:`Generating answer... ${Y}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:p!=null&&p.compact?"8px":"10px",color:D,fontSize:p!=null&&p.compact?tt.xs:tt.sm},children:[m.jsx("span",{style:{width:p!=null&&p.compact?8:9,height:p!=null&&p.compact?8:9,borderRadius:999,background:j,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${it(Nt,.28)}`,flexShrink:0}}),m.jsx("span",{children:pe})]})},ti=x.useCallback((p,j)=>{if(Ur[p.id])return;const D=j?"helpful":"not_helpful";aa($=>({...$,[p.id]:D})),ht("answer_feedback",{message_id:p.id,query:p.userQuery,status:D,latency_ms:p.responseTimeMs,metadata:{helpful:j}})},[Ur,ht]);function Lo(p,j){if(p.role!=="assistant"||!p.content.trim()||Te&&p.id===jt.current)return null;const D=j?.accentColor||Pn,$=j?.metaColor||fr,Y=Ur[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 ${an}`,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:tt.xs,color:$,whiteSpace:"nowrap"},children:Y?"Thanks for your feedback":"Is this helpful?"}),Y?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:it(D,.12),color:D,flexShrink:0},children:Y==="helpful"?m.jsx(Nd,{size:14}):m.jsx(jd,{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:()=>ti(p,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${an}`,background:Qt,color:$,cursor:"pointer"},children:m.jsx(Nd,{size:14})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>ti(p,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${an}`,background:Qt,color:$,cursor:"pointer"},children:m.jsx(jd,{size:14})})]})]}),pe?m.jsxs("span",{style:{fontSize:tt.xs,color:$,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Rh(p.responseTimeMs)]}):null]})}const Jr=x.useCallback(()=>{const p=Xa.current;if(!p)return;const j=Math.max(0,p.scrollWidth-p.clientWidth);Mo(p.scrollLeft>4),Hr(p.scrollLeft<j-4)},[]);x.useEffect(()=>(Jr(),window.addEventListener("resize",Jr),()=>window.removeEventListener("resize",Jr)),[Jr,zt.length]);const Zr=x.useCallback(p=>{const j=Xa.current;j&&j.scrollBy({left:p==="left"?-Math.max(160,Math.floor(j.clientWidth*.75)):Math.max(160,Math.floor(j.clientWidth*.75)),behavior:"smooth"})},[]),it=(p,j)=>{if(!p||!p.startsWith("#"))return`rgba(15, 23, 42, ${j})`;const D=p.slice(1),$=D.length===3?D.split("").map(Ct=>`${Ct}${Ct}`).join(""):D;if($.length!==6)return p;const Y=parseInt($.slice(0,2),16),pe=parseInt($.slice(2,4),16),Ze=parseInt($.slice(4,6),16);return`rgba(${Y}, ${pe}, ${Ze}, ${j})`},Nt=Q.primaryColor||"#3F037F",Qt=Q.surfaceColor||"#ffffff",pr=Q.backgroundColor||"#eef2ff",an=Q.borderColor||"#e5e7eb",St=Q.textColor||"#111827",mr=Q.textSecondaryColor||"#6b7280";it(Nt,.12);const $o=it(Nt,.24);it(Nt,.38);const ha=Qt,Pn=Nt,Wt=Q.primaryTextColor||"#ffffff",fr=mr,Fo=be||"Publisher Assistant",Bn=ze&&zt.length===0&&Ye.length===0,ni=Qt,Oo=Qt,rr=an,Yr=an,Wo="0 16px 64px rgba(15, 23, 42, 0.14)",ga=mr,ml=mr,fl=Pn,Bi=pr,ri="none",hl="rgba(15, 23, 42, 0.18)";function Hi(p){return et?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 ${$o}`,background:it("#ffffff",.9),marginBottom:"4px"},children:[m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{color:Pn,fontSize:tt.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),m.jsxs("div",{style:{color:St,fontSize:tt.sm,fontWeight:600,lineHeight:1.3},children:[et.brand_name," agent is active"]})]}),m.jsx("button",{type:"button",onClick:()=>{K("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${$o}`,borderRadius:999,background:it("#ffffff",.92),color:Pn,padding:"7px 12px",fontSize:tt.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Vi(p,j=Fe){const D=da&&!j,$=j||D?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:j||p==="default"?"2px":"8px",marginTop:j?"0":p==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ml,fontSize:$,lineHeight:D?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:fa})})}function oi(p){const j=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:it(St,.06),flexShrink:0}}),m.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:j.map((D,$)=>m.jsx("div",{style:{width:D,maxWidth:"100%",height:40,borderRadius:"6px",background:it(St,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${$}`))}),m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:it(St,.06),flexShrink:0}})]}):m.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:p==="publisher"?"10px":"12px"},children:j.map((D,$)=>m.jsx("div",{style:{width:D,maxWidth:"100%",height:p==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${it(Nt,.08)} 0%, ${it(Nt,.18)} 50%, ${it(Nt,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:p==="publisher"?`0 8px 22px ${it(Nt,.08)}`:"none"}},`suggestion-skeleton-${$}`))})}function gl(p=Fe){if(Te)return null;if(Bn)return oi("publisher");if(!zt.length)return null;const j=p&&dn,D=zt.slice(0,Ie);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:D.map($=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":$.is_sponsored?"true":void 0,ref:Io($.id),onClick:()=>{f==="default"&&(on(!0),v==="floating"&&On(!0)),Ro($)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${$.is_sponsored?Nt:an}`,background:$.is_sponsored?Nt:Qt,color:$.is_sponsored?Wt:St,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:$.text}),fe&&$.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:it("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},$.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:j?"4px":cn?"5px":p?"6px":"10px",flexShrink:0},children:[!j&&m.jsx("button",{type:"button",onClick:()=>Zr("left"),disabled:!la,"aria-label":"Scroll suggestions left",style:{width:cn?20:p?24:28,height:cn?20:p?24:28,borderRadius:"6px",border:`1px solid ${an}`,background:Qt,color:"#6b7280",fontSize:cn?"13px":void 0,lineHeight:1,cursor:la?"pointer":"default",opacity:la?1:.55},children:"\u2039"}),m.jsx("div",{ref:Xa,onScroll:Jr,style:{display:"flex",gap:j?"4px":cn?"5px":p?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:D.map($=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":$.is_sponsored?"true":void 0,ref:Io($.id),onClick:()=>{f==="default"&&(on(!0),v==="floating"&&On(!0)),Ro($)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:j?"4px":cn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${$.is_sponsored?Nt:an}`,background:$.is_sponsored?Nt:Qt,color:$.is_sponsored?Wt:St,padding:j?"4px 8px":cn?"5px 8px":p?"7px 10px":"8px 14px",fontSize:j?"10px":cn?"11px":p?"12px":"13px",fontWeight:500,lineHeight:j?1:cn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:$.text}),fe&&$.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},$.id))}),!j&&m.jsx("button",{type:"button",onClick:()=>Zr("right"),disabled:!To,"aria-label":"Scroll suggestions right",style:{width:cn?20:p?24:28,height:cn?20:p?24:28,borderRadius:"6px",border:`1px solid ${an}`,background:Qt,color:"#6b7280",fontSize:cn?"13px":void 0,lineHeight:1,cursor:To?"pointer":"default",opacity:To?1:.55},children:"\u203A"})]})}function Qi(p=Fe){if(p||!(Gr!=null&&Gr.recommendation))return null;const j=`publisher-sponsored-creative-${Gr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Ka,{messageId:j,query:Gr.text,initialRecommendation:Gr.recommendation,onFollowupDetected:jo,onRecommendationsShown:(D,$)=>{Qr(D,$,Gr.text)},onError:D=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",D)}})})}function bl(p){var j,D;return(j=p.relatedItems)!=null&&j.length||!((D=p.sourceLinks)!=null&&D.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:mr},children:"Sources"}),p.sourceLinks.map($=>m.jsxs("a",{href:$.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{ht("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:$.title,source_url:$.url}})},style:{color:Pn,fontSize:tt.xs,textDecoration:"none",borderBottom:`1px solid ${it(Nt,.18)}`},children:[$.title||$.url," ",m.jsx(Qf,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${p.id}-${$.url}`))]})}function yl(p,j=Fe){var D;return(D=p.relatedItems)!=null&&D.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:mr,marginBottom:"8px"},children:"Related reading"}),m.jsx("div",{style:{display:"flex",gap:j?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:p.relatedItems.slice(0,4).map($=>m.jsxs("a",{className:"admesh-publisher-source",href:$.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{ht("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:$.title,source_url:$.url,source_publisher:$.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:j?"6px":"10px",padding:j?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:St,border:`1px solid ${an}`,background:Qt,boxShadow:"none",flex:j?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:j?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:j?"12px":"14px",fontWeight:650,lineHeight:1.35,color:St,overflowWrap:"anywhere"},children:$.title||$.url}),$.publisher&&m.jsx("div",{style:{fontSize:j?"11px":"12px",color:mr,lineHeight:1.4,overflowWrap:"anywhere"},children:$.publisher})]},`${p.id}-${$.url}`))})]}):null}function vl(p=Fe){const j=p?"13px":"15px";return m.jsxs("div",{ref:zo,style:{flex:p?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:p?"0 2px 4px":ce?"16px 16px 8px":0},children:[Ye.map(D=>{const $=D.role==="user"&&D.id===_t.current;return m.jsx("div",{ref:$?En:void 0,style:{marginBottom:p?"16px":"28px",textAlign:D.role==="user"?"right":"left"},children:(()=>{const Y=!!D.content.trim()||!Te;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:D.role==="assistant"?"block":"inline-block",width:D.role==="assistant"?"100%":void 0,maxWidth:D.role==="assistant"?"100%":"76%",padding:D.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:D.role==="assistant"?0:"8px",background:D.role==="user"?it(St,.05):"transparent",color:St,boxShadow:"none",border:"none",fontSize:D.role==="assistant"?j:p?"12px":"13px",lineHeight:D.role==="assistant"?1.62:1.4,textAlign:"left",overflowWrap:"anywhere"},children:[D.role==="assistant"?D.content.trim()?m.jsx(il,{content:D.content,theme:{...Q,textColor:St},fontSize:j}):Te&&D.id===jt.current?Un({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:St},children:D.content}),D.role==="assistant"&&bl(D),D.role==="assistant"&&yl(D,p),D.role==="assistant"&&Lo(D),D.role==="assistant"&&Y&&Cn.has(D.id)&&D.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ka,{messageId:D.id,query:D.userQuery,initialRecommendation:D.initialRecommendation,onFollowupDetected:jo,onRecommendationsShown:(pe,Ze)=>{Qr(pe,Ze,D.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})}),D.role==="assistant"&&Y&&!Cn.has(D.id)&&(D.initialRecommendation||Vr)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ka,{messageId:D.id,query:D.userQuery,initialRecommendation:D.initialRecommendation||void 0,onFollowupDetected:jo,onRecommendationsShown:(pe,Ze)=>{Qr(pe,Ze,D.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})})]})})})()},D.id)}),Sn&&m.jsx("div",{role:"alert",style:{color:St,fontSize:tt.sm,border:`1px solid ${an}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),m.jsx("div",{ref:sa})]})}if(f==="default"){let p=function($){const Y=Yd(da);return el.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:D}),m.jsx("div",{style:Y.shell,children:$})]}),document.body)},j=function($=!1){const Y=yt($),pe=$||Y&&ce,Ze=!pe&&H==="input",Ct=Y&&!pe&&dn,Dt=pe&&!(Fe&&E==="expand"&&!$&&An),$e=pe?Yd(da):null,We=!!($e&&da&&!Y),wt=Y?tr:$e?$e.panelWidth:v==="inline"?"100%":"min(420px, calc(100vw - 32px))",Kt=Y?nr:$e?$e.panelHeight:"auto",Ut=Y?tr:$e?.panelMaxWidth??"100%",Zt=Y?nr:$e?.panelMaxHeight,Hn=R&&!Ct&&pe;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":Y?"true":"false",style:{"--publisher-accent":Pn,color:St,width:wt,maxWidth:Ut,height:Kt,maxHeight:Zt,boxSizing:"border-box",display:"flex",flexDirection:"column",background:pe?ni:ha,borderRadius:!Y&&$e?$e.panelBorderRadius:"12px",padding:pe?0:Y?"6px":0,boxShadow:We?"none":pe?Wo:"none",border:We||Ze?"none":`1px solid ${Yr}`,overflow:"hidden",minHeight:Y?0:void 0},children:[m.jsx("style",{children:Dd}),Hn&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:Y?"8px 10px":"14px 20px",background:Oo,color:St,borderBottom:`1px solid ${rr}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:Y?26:32,height:Y?26:32,flexShrink:0,borderRadius:"6px",background:it(St,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:Pn,overflow:"hidden"},children:N?m.jsx("img",{src:N,alt:`${y||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:Qt,padding:4}}):m.jsx(tl,{size:Y?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(V||S)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[V&&m.jsx("div",{style:{fontSize:Y?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:y}),S&&m.jsx("div",{style:{fontSize:Y?"10px":"12px",color:ga,marginTop:"2px"},children:Fo})]})]}),pe&&(!Y||$)&&m.jsx("button",{type:"button",onClick:()=>on(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,borderRadius:"8px",border:`1px solid ${rr}`,background:Qt,color:ga,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(Td,{size:16,strokeWidth:1.5,"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:Ct?"2px":Y?"6px":"16px",minHeight:0,flex:Y||pe?"1 1 0":void 0,overflow:Y||pe?"hidden":void 0,overscrollBehavior:"contain",padding:Ze?Y?"4px":"8px":Y?"8px":"20px",justifyContent:pe?void 0:"center",background:ni},children:[Hi("default"),Dt&&vl(Y),!Ze&&m.jsxs(m.Fragment,{children:[Y&&!pe&&!Ct&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),Y&&!pe&&he&&M&&Ye.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:Be}),gl(Y)]}),(Ze||!Y||pe||P)&&m.jsx(Jf,{value:ln,onChange:Or,open:Ze&&oa&&!ce,onOpenChange:Ze?Xt:Nh,suggestions:zt.slice(0,Ie),registerSuggestion:Io,loading:Te,analyzing:Bn,compact:Y,expanded:pe,showLogo:!pe,suggestionPlacement:le,logoUrl:N,title:y,placeholder:ne,colors:{accent:Pn,accentText:Wt,surface:Bi,text:St,muted:mr,border:an},onStop:ma,onSend:()=>{un.current=null,ur.current=!1,on(!0),v==="floating"&&On(!0),bn(ln)},onSuggestion:sn=>{on(!0),v==="floating"&&On(!0),Ro(sn)}}),pe&&Vi("default",Y),!pe&&H==="always"&&Qi(Y)]})]})};const D={position:"fixed",inset:0,background:hl,backdropFilter:"blur(2px)",zIndex:2147483e3};return v==="inline"?Fe?m.jsxs("div",{ref:ia,className:"admesh-component","data-admesh-theme":Oe,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":E,"data-admesh-ad-slot-expanded":ca?"true":"false",style:{width:tr,height:nr,maxWidth:tr,maxHeight:nr,position:"relative",overflow:"hidden"},children:[j(!1),An&&typeof document<"u"&&p(j(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Oe,style:{width:"100%",position:"relative"},children:[j(!1),ce&&typeof document<"u"&&p(j(!0))]}):Rn?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Oe,children:[!ce&&m.jsx("div",{style:{position:"fixed",...kr,zIndex:2147483001},children:j(!1)}),ce&&typeof document<"u"&&p(j(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Oe,children:m.jsxs("button",{type:"button",onClick:Za,style:{position:"fixed",...kr,zIndex:2147483e3,border:"none",borderRadius:"6px",background:Q.primaryColor,color:Wt,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 zt.length===0&&!Bn?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):v==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Oe,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:qa(J)??"100%",backgroundColor:"#eef2ff",fontSize:tt.base,...d},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[Bn?oi("legacy"):zt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:zt.slice(0,Ie).map((p,j)=>m.jsxs("button",{ref:Io(p.id),onClick:()=>Ro(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:j===0?"100%":j===1?"82%":"68%",backgroundColor:Q.surfaceColor||"#ffffff",color:Q.textColor||"#1e293b",border:`1px solid ${Q.borderColor||"#e2e8f0"}`,fontSize:tt.sm},children:[m.jsx("span",{className:"leading-tight",children:p.text}),fe&&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))}),Ye.length>0&&m.jsxs("div",{ref:zo,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:[Ye.map(p=>{const j=p.role==="user"&&p.id===_t.current;return m.jsx("div",{ref:j?En: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:tt.sm,textAlign:"left",overflowWrap:"anywhere"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(il,{content:p.content,theme:Q,fontSize:tt.sm}),Lo(p,{accentColor:Q.primaryColor,metaColor:Q.textSecondaryColor})]}):Te&&p.id===jt.current?Un({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)}),Te&&!Ye.some(p=>p.role==="assistant"&&p.id===jt.current&&!p.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:Q.textSecondaryColor},children:Un({compact:!0,accentColor:Q.primaryColor,metaColor:Q.textSecondaryColor,includeSteps:!1})}),Sn&&m.jsx("div",{className:"text-sm",style:{color:Q.textSecondaryColor},children:"Connection issue. Please try again."}),m.jsx("div",{ref:sa})]}),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:ln,onChange:p=>Or(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(Te){p.preventDefault();return}bn(ln)}},placeholder:ne,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:Q.backgroundColor||"#ffffff",color:Q.textColor,fontSize:tt.sm}}),m.jsx("button",{onClick:()=>{if(Te){ma();return}bn(ln)},disabled:!Te&&!ln.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:Te?"#dc2626":Q.primaryColor,color:"#ffffff"},children:Te?m.jsx(nl,{size:18}):m.jsx(Id,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:Q.textSecondaryColor,fontSize:tt.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:tt.xs,lineHeight:1.5},children:fa})]})]})})}):Rn?m.jsx("div",{className:"admesh-component","data-admesh-theme":Oe,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...ce?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kr,width:qa(J)??Wn.width,height:qa(ee)??Wn.height},backgroundColor:ce?ni:Q.backgroundColor,zIndex:9999,fontSize:tt.base,borderRadius:ce?"20px":"16px",border:ce?`1px solid ${Yr}`:"1px solid transparent",boxShadow:ce?Wo:"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:ce?rr:"transparent",background:ce?Oo:Q.backgroundColor,padding:ce?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:ce?40:32,height:ce?40:32,borderRadius:ce?"14px":"10px",background:it(Nt,.08),color:Pn,display:"flex",alignItems:"center",justifyContent:"center",fontSize:ce?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:N?m.jsx("img",{src:N,alt:`${y||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(y||"AA").slice(0,2).toUpperCase()}),(V||S&&ce)&&m.jsxs("div",{children:[V&&m.jsx("div",{className:"font-medium",style:{color:Q.textColor,fontSize:ce?"20px":tt.base,fontWeight:700,letterSpacing:ce?"-0.02em":0},children:y}),S&&ce&&m.jsx("div",{style:{color:ga,fontSize:"12px",marginTop:"2px"},children:Fo})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:qr,className:"transition-colors",title:ce?"Minimize":"Expand",style:{width:ce?36:28,height:ce?36:28,borderRadius:ce?"12px":"10px",border:`1px solid ${ce?rr:"transparent"}`,background:ce?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:ce?m.jsx(Td,{size:16,style:{color:Q.textSecondaryColor}}):m.jsx(Gf,{size:16,style:{color:Q.textSecondaryColor}})}),m.jsx("button",{onClick:Ya,className:"transition-colors",style:{width:ce?36:28,height:ce?36:28,borderRadius:ce?"12px":"10px",border:`1px solid ${ce?rr:"transparent"}`,background:ce?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(nl,{size:16,style:{color:Q.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:zo,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:ce?"20px":"16px"},children:[Hi("legacy"),he&&Ye.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:tt.sm},children:Be})})}),Ye.map(p=>{const j=p.role==="user"&&p.id===_t.current;return m.jsxs("div",{ref:j?En:void 0,className:"mb-3",style:{textAlign:p.role==="user"?"right":"left"},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"?Q.primaryTextColor||"#ffffff":Q.textColor,border:"none",borderRadius:p.role==="user"?ce?"14px":"12px":0,padding:p.role==="user"?ce?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none",textAlign:"left",overflowWrap:"anywhere"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${tt.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(il,{content:p.content,theme:Q,fontSize:`calc(${tt.sm} * 1.3)`})}),Lo(p,{accentColor:Q.primaryColor,metaColor:Q.textSecondaryColor})]}):Te&&p.id===jt.current?Un({compact:!0,accentColor:Q.primaryColor,metaColor:Q.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:tt.sm,lineHeight:"1.4"},children:p.content})}),p.role==="assistant"&&!Cn.has(p.id)&&m.jsx(Ka,{messageId:p.id,query:p.userQuery,onFollowupDetected:jo,onRecommendationsShown:(D,$)=>{Qr(D,$,p.userQuery)},onError:D=>{console.error("[AdMeshIntentAssistant] Recommendations error:",D)}}),p.role==="assistant"&&Cn.has(p.id)&&p.initialRecommendation&&!Te&&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(Ka,{messageId:p.id,query:p.userQuery,initialRecommendation:p.initialRecommendation,onFollowupDetected:jo,onRecommendationsShown:(D,$)=>{Qr(D,$,p.userQuery)},onError:D=>{console.error("[AdMeshIntentAssistant] Recommendations error:",D)}})]})]},p.id)}),Te&&!Ye.some(p=>p.role==="assistant"&&p.id===jt.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:Un({compact:!0,accentColor:Q.primaryColor,metaColor:Q.textSecondaryColor,includeSteps:!1})})}),Sn&&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:tt.xs},children:"\u26A0\uFE0F"}),m.jsx("span",{style:{fontSize:tt.sm},children:"Connection issue. Please try again."})]})})}),m.jsx("div",{ref:sa})]}),Ye.length===0&&Bn&&m.jsx("div",{className:"px-4 pb-2",children:oi("legacy")}),zt.length>0&&Ye.length===0&&!Bn&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:zt.slice(0,Ie).map(p=>m.jsxs("button",{ref:Io(p.id),onClick:()=>Ro(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:tt.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:p.text}),fe&&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))})}),De&&!ze&&Do.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:tt.sm},children:"Intent analysis failed"}),m.jsx("button",{onClick:Gt,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:Q.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:tt.xs},children:De})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:ce?rr:"transparent",padding:ce?"18px 20px":void 0,background:ce?Oo:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${rr}`,borderRadius:ce?"16px":"12px",background:Bi,boxShadow:ce?ri:"none",padding:ce?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:ln,onChange:p=>Or(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(Te){p.preventDefault();return}bn(ln)}},placeholder:ne,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:ce?"15px":tt.sm,"--tw-ring-color":Q.primaryColor}}),m.jsx("button",{onClick:()=>{if(Te){ma();return}bn(ln)},disabled:!Te&&!ln.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:Te?"#dc2626":Q.primaryColor,color:"#ffffff",borderRadius:ce?"12px":"10px",width:ce?"46px":void 0,height:ce?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:ce?`0 10px 20px ${it(Nt,.18)}`:"none"},children:Te?m.jsx(nl,{size:14}):m.jsx(Id,{size:14})})]}),Vi("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Oe,children:m.jsx("button",{onClick:Za,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",...kr,backgroundColor:Q.primaryColor,color:"#ffffff",zIndex:9999,fontSize:tt.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}},Vh={"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},qh={"mobile-leaderboard":!1,leaderboard:!1},Gh={"mobile-leaderboard":!1,leaderboard:!1},rc={"mobile-leaderboard":"expand",leaderboard:"expand"},ul={"half-page":"medium-rectangle","large-rectangle":"medium-rectangle",skyscraper:"medium-rectangle",billboard:"medium-rectangle",leaderboard:"mobile-leaderboard"},Xh=60*1e3,oc="admesh-publisher-assistant-embed-styles",ac=window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com";function Jh(){if(document.getElementById(oc))return;const i=document.createElement("style");i.id=oc,i.textContent=`
|
|
1205
|
+
`;let Jd=!1;const Rh=()=>{x.useEffect(()=>{if(!Jd){try{jh();const s=document.createElement("style");s.id="admesh-ui-sdk-styles-legacy",s.textContent=Nh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(s),Jd=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Dh=()=>{};function Th(s){const l=Math.max(1,Math.round(s));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 Lh(s){return Th(s/1e3)}const il=({content:s,theme:l,fontSize:d})=>{const c=M=>M.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((A,H)=>{if(A.startsWith("**")&&A.endsWith("**")&&A.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:A.slice(2,-2)},H);const U=A.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return U?m.jsx("a",{href:U[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:U[1]},H):m.jsx(x.Fragment,{children:A},H)}),v=M=>M.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(A=>A.trim()).filter((A,H,U)=>A.length>0||H<U.length-1),I=M=>{const A=v(M);return A.length>1&&A.every(H=>/^:?-{3,}:?$/.test(H))},D=M=>{const A=M.indexOf("|");if(A<=0)return{heading:null,headerLine:M};const H=M.slice(0,A).trim();return!H||/^[-|:\s]+$/.test(H)?{heading:null,headerLine:M}:{heading:H,headerLine:M.slice(A).trim()}},q=(M,A)=>{const H=v(M).length,U=v(A).length;return H<=1||H===U?A:`| ${Array.from({length:H},()=>"---").join(" | ")} |`},_=M=>{if(M.length<2||!M[0].includes("|"))return{heading:null,lines:M};const{heading:A,headerLine:H}=D(M[0]),U=H.startsWith("|")?H:`| ${H}`,ee=q(U,M[1]);return{heading:A,lines:[U,ee,...M.slice(2)]}},y=M=>{if(M.length<2||!M[0].includes("|"))return!1;const{lines:A}=_(M);return I(A[1])&&v(A[0]).length>=2},B=M=>{if(!M.includes("|"))return[M];let A=M.trim();const H=[],U=A.indexOf("|");if(U>0){const ee=A.slice(0,U).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(H.push(ee),A=A.slice(U).trim())}return A=A.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,te)=>`
|
|
1206
|
+
${te}`),A=A.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
|
|
1207
|
+
| `),A=A.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
|
|
1208
|
+
`),H.push(...A.split(`
|
|
1209
|
+
`).map(ee=>ee.trim()).filter(Boolean)),H},C=M=>{const A=M.split(`
|
|
1210
|
+
`),H=[];for(const U of A){if(!U.includes("|")){H.push(U);continue}H.push(...B(U))}return H.join(`
|
|
1211
|
+
`)},W=(M=>{const A=C(M).split(`
|
|
1212
|
+
`),H=[];let U=0;for(;U<A.length;){const ee=A[U],te=A[U+1]||"";if(ee.includes("|")&&I(te)){H.length>0&&H[H.length-1].trim()&&H.push("");const{heading:re,headerLine:ne}=D(ee);for(re&&H.push(re),H.push(ne,q(ne,te)),U+=2;U<A.length&&A[U].includes("|")&&A[U].trim();)H.push(A[U]),U+=1;U<A.length&&A[U].trim()&&H.push("");continue}H.push(ee),U+=1}return H.join(`
|
|
1213
|
+
`)})(s).split(/\n\s*\n/).map(M=>M.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:d},children:W.map((M,A)=>{const H=M.split(`
|
|
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=`
|
|
1216
1216
|
.admesh-publisher-assistant-root {
|
|
1217
1217
|
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
1218
1218
|
line-height: 1.4;
|
|
@@ -1978,5 +1978,5 @@ ${re}`),P=P.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
|
|
|
1978
1978
|
font-size: 12px;
|
|
1979
1979
|
}
|
|
1980
1980
|
}
|
|
1981
|
-
`,document.head.appendChild(i)}function Zh(i){return i?i.startsWith("/")?i:`/${i}`:"/"}function ic(i,l){const d=Zh(l.trim());if(d==="/")return i==="/";if(d.endsWith("/*")){const c=d.slice(0,-1);return i.startsWith(c)}return i===d}function Yh(i,l){return l.page_rules_enabled?l.hide_on_paths.some(d=>ic(i,d))?!1:l.show_on_paths.length?l.show_on_paths.some(d=>ic(i,d)):!0:!0}function sc(){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 dl(){return sc()<768}function eg(i){if(!ul[i])return!1;const l=ll[i].width,d=sc();return d<l||d<768?!0:typeof window.matchMedia=="function"?window.matchMedia("(max-width: 767px)").matches:!1}function Ga(i){if(i)return eg(i)?ul[i]??i:i}function tg(i){const l=i.device_targeting||"all";if(l==="all")return!0;const d=dl();return l==="mobile_only"?d:l==="desktop_only"?!d:!0}async function ng(i,l){const d=await fetch(i,l);if(!d.ok)throw new Error(`Request failed: ${d.status}`);return d.json()}function rg(){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 og(i){var l,d;const c=(l=i.dataset.agentDisplayId)==null?void 0:l.trim();if(c)return c;const y=(d=i.dataset.publisherId)==null?void 0:d.trim();if(y)return y}function lc(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 Wi(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 ag(i){var l,d,c,y,N;const R=i.dataset.mode==="inline"||i.dataset.mode==="floating"?i.dataset.mode:void 0,V=i.dataset.size==="sm"||i.dataset.size==="md"||i.dataset.size==="lg"||i.dataset.size==="xl"?i.dataset.size:void 0,S=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,v=i.dataset.surface==="ad-slot"||i.dataset.surface==="page"?i.dataset.surface:i.dataset.adSlot==="true"||i.dataset.adServer==="true"?"ad-slot":void 0,W=(l=i.dataset.contextMode)==null?void 0:l.trim(),E=W==="page"||W==="ad-slot"||W==="auto"?W:void 0,B=i.dataset.suggestionStyle==="stacked"||i.dataset.suggestionStyle==="carousel"?i.dataset.suggestionStyle:void 0,M=i.dataset.behavior==="expand"||i.dataset.behavior==="sticky"?i.dataset.behavior:void 0,P=(d=i.dataset.slotType)==null?void 0:d.trim(),I=P&&P in ll?P:void 0;return{mode:R,position:S,size:V,surface:v??(I?"ad-slot":void 0),slotType:I,width:lc(i.dataset.width),height:lc(i.dataset.height),suggestionStyle:B,suggestionTrigger:i.dataset.suggestionTrigger==="input"?"input":i.dataset.suggestionTrigger==="always"?"always":void 0,suggestionPlacement:i.dataset.suggestionPlacement==="above"?"above":i.dataset.suggestionPlacement==="below"?"below":void 0,sponsoredCreativePlacement:i.dataset.sponsoredCreativePlacement==="below-input-container"?"below-input-container":i.dataset.sponsoredCreativePlacement==="none"?"none":void 0,showHeader:Wi(i.dataset.showHeader),showAssistantName:Wi(i.dataset.showAssistantName),showAssistantLabel:Wi(i.dataset.showAssistantLabel),showWelcomeMessage:Wi(i.dataset.showWelcomeMessage),welcomeMessage:((c=i.dataset.welcomeMessage)==null?void 0:c.trim())||void 0,targetSelector:((y=i.dataset.targetSelector)==null?void 0:y.trim())||void 0,articleUrl:((N=i.dataset.articleUrl)==null?void 0:N.trim())||void 0,contextMode:E,behavior:M}}function cl(){try{return window.self!==window.top}catch{return!0}}function pl(i){return`admesh:publisher-assistant:country-block:${encodeURIComponent(i)}`}function ig(i){try{const l=window.localStorage.getItem(pl(i));if(!l)return null;const d=JSON.parse(l);return typeof d.expiresAt!="number"||d.expiresAt<=Date.now()?(window.localStorage.removeItem(pl(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 sg(i,l){if(l.reason==="country_not_allowed")try{const d={expiresAt:Date.now()+Xh,reason:"country_not_allowed",country:l.country||null};window.localStorage.setItem(pl(i),JSON.stringify(d))}catch{}}function lg(i,l){const d=Ga(l?.slotType);if(d){const S=ll[d];return{width:S.width,height:S.height}}const c=i instanceof HTMLElement?i.getBoundingClientRect():null,y=cl()?window.innerWidth:void 0,N=cl()?window.innerHeight:void 0,R=l?.width||y||(c!=null&&c.width?Math.round(c.width):void 0),V=l?.height||N||(c!=null&&c.height?Math.round(c.height):void 0);return{width:R&&R>0?R:void 0,height:V&&V>0?V:void 0}}function ug(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 dg(i,l){if(i.suggestionStyle)return i.suggestionStyle;const d=Ga(i.slotType);return d?Vh[d]??"carousel":l.suggestion_style||"carousel"}function cg(i,l){return i&&rc[i]?rc[i]:l||"expand"}function pg(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 uc(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 mg(){var i;try{const l=(i=window.location.href)==null?void 0:i.trim();if(uc(l))return l}catch{return}}function fg(i,l){const d=mg();if(d)return d;const c=l?.trim();if(uc(c))return c;if(i!=="ad-slot")return window.location.href}function hg(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 gg({config:i,runtimeApiKey:l,sessionId:d,mode:c,floatingPosition:y,size:N,surface:R,panelWidth:V,panelHeight:S,suggestionStyle:v,suggestionTrigger:W,suggestionPlacement:E,sponsoredCreativePlacement:B,showHeader:M,showAssistantName:P,showAssistantLabel:I,showWelcomeMessage:J,welcomeMessage:ee,articleUrl:re,contextMode:oe,agentDisplayId:ae,adSlotBehavior:q,showCompactSlotHeader:Z,showCompactWelcomeMessage:U,showCompactSlotInput:de,showCompactSlotDisclaimer:me}){const he=oe||(R==="ad-slot"?"ad-slot":"auto");return hd.createElement(Vd,{apiKey:l,sessionId:d,apiBaseUrl:ac,theme:hg(i),articleUrl:re,contextMode:he,agentDisplayId:ae},hd.createElement(Hh,{variant:"default",layout:c,surface:R,adSlotBehavior:q,showCompactSlotHeader:Z,showCompactWelcomeMessage:U,showCompactSlotInput:de,showCompactSlotDisclaimer:me,position:y,size:N,panelWidth:V,panelHeight:S,analyticsPageUrl:fg(R,re),suggestionStyle:v??"carousel",suggestionTrigger:W??"always",suggestionPlacement:E??"below",sponsoredCreativePlacement:B??"none",headerTitle:i.assistant_name,headerLogoUrl:i.logo_url,showHeader:M??!0,showHeaderTitle:P??i.show_assistant_name!==!1,showSubtitle:I??i.show_assistant_label!==!1,triggerLabel:i.assistant_name,placeholder:i.input_placeholder,disclaimerText:i.disclaimer_text,poweredByLabel:"Powered by AdMesh",subtitle:I??i.show_assistant_label!==!1?"Publisher Assistant":"",adsEnabled:i.ads_enabled,showWelcomeMessage:J===!0,welcomeMessage:ee||i.welcome_description}))}function bg(i,l,d){d.width&&(i.style.width=`${d.width}px`,i.style.maxWidth=dl()?"100%":""),d.height&&(i.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 dc(i){const l=i.overrides.slotType,d=Ga(l),c=i.mode==="inline"&&i.targetSelector?document.querySelector(i.targetSelector):null;let y=ug(i.overrides);i.surface==="ad-slot"&&(y=lg(c,i.overrides)),i.mountNode.dataset.admeshRawSlotType=l??"",i.mountNode.dataset.admeshEffectiveSlotType=d??"",bg(i.mountNode,c instanceof HTMLElement?c:null,y),i.reactRoot.render(gg({config:i.config,runtimeApiKey:i.runtimeApiKey,sessionId:i.sessionId,mode:i.mode,floatingPosition:i.floatingPosition,size:i.size,surface:i.surface,panelWidth:y.width,panelHeight:y.height,suggestionStyle:dg(i.overrides,i.config),suggestionTrigger:i.overrides.suggestionTrigger??i.config.suggestion_trigger??"always",suggestionPlacement:i.overrides.suggestionPlacement??i.config.suggestion_placement??"below",sponsoredCreativePlacement:i.overrides.sponsoredCreativePlacement??i.config.sponsored_creative_placement??"none",showHeader:i.overrides.showHeader??i.config.show_header??!0,showAssistantName:i.overrides.showAssistantName??i.config.show_assistant_name??!0,showAssistantLabel:i.overrides.showAssistantLabel??i.config.show_assistant_label??!0,showWelcomeMessage:i.overrides.showWelcomeMessage??i.config.show_welcome_message??!0,welcomeMessage:i.overrides.welcomeMessage,articleUrl:i.articleUrl,contextMode:i.contextMode,agentDisplayId:i.agentDisplayId,adSlotBehavior:i.surface==="ad-slot"?cg(l,i.overrides.behavior):void 0,showCompactSlotHeader:d?Qh[d]??!0:!0,showCompactWelcomeMessage:d?Kh[d]??!0:!0,showCompactSlotInput:d?qh[d]??!0:!0,showCompactSlotDisclaimer:d?Gh[d]??!0:!0}))}function yg(i){var l,d;const c=i.overrides.slotType;if(!c||!ul[c])return;let y=Ga(c);const N=()=>{const R=Ga(c);R!==y&&(y=R,dc(i))};window.addEventListener("resize",N),(l=window.visualViewport)==null||l.addEventListener("resize",N),(d=window.visualViewport)==null||d.addEventListener("scroll",N)}async function vg(){var i,l;const d=rg();if(!d){console.error("[AdMesh] Publisher assistant embed script could not find its script tag.");return}const c=og(d);if(!c){console.error("[AdMesh] Missing required data-agent-display-id or data-publisher-id attribute.");return}const y=ag(d);try{const N=ig(c);if(N){console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${N.reason}`);return}const R=await ng(`${ac}/publisher-assistant/public/${encodeURIComponent(c)}/config`),V=R.config;if(R.ready===!1)if(R.reason==="missing_inline_target_selector"&&y.targetSelector)console.warn(`[AdMesh] Publisher assistant config is missing an inline target selector; using script override ${y.targetSelector}.`);else{console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${R.reason||"unknown_reason"}`),sg(c,R);return}const S=y.mode||V.deployment_mode||"inline",v=y.position||V.floating_position,W=y.surface||(S==="inline"&&cl()?"ad-slot":"page"),E=y.contextMode||(W==="ad-slot"?"ad-slot":"auto"),B=y.articleUrl,M=y.targetSelector||((i=V.inline_target_selector)==null?void 0:i.trim()),P=((l=R.runtime_api_key)==null?void 0:l.trim())||"";if(!Yh(window.location.pathname,V)||!tg(V))return;if(!P){console.warn(`[AdMesh] No active publisher runtime API key found for ${c}.`);return}const I=S==="inline"&&M?document.querySelector(M):null;if(S==="inline"&&M&&!I){console.error(`[AdMesh] Inline target not found for selector: ${M}`);return}Jh();const J=pg(window.location.href),ee=y.size||"md",re=document.createElement("div");re.className="admesh-publisher-assistant-reactMount",re.dataset.admeshSurface=W;const oe=Cd.createRoot(re),ae={script:d,mountNode:re,reactRoot:oe,overrides:y,config:V,runtimeApiKey:P,sessionId:J,mode:S,floatingPosition:v,surface:W,contextMode:E,articleUrl:B,agentDisplayId:c,size:ee,targetSelector:M};if(dc(ae),yg(ae),S==="inline"){if(M){I?.appendChild(re);return}d.insertAdjacentElement("afterend",re);return}document.body.appendChild(re)}catch(N){console.error("[AdMesh] Failed to initialize publisher assistant.",N)}}vg()})();})();
|
|
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()})();})();
|
|
1982
1982
|
//# sourceMappingURL=publisher-assistant.js.map
|